pax_global_header00006660000000000000000000000064147660407220014522gustar00rootroot0000000000000052 comment=477f812984a9d75346e8ec37eefa3f79a117d581 node-postgres-pg-8.14.1/000077500000000000000000000000001476604072200150125ustar00rootroot00000000000000node-postgres-pg-8.14.1/.devcontainer/000077500000000000000000000000001476604072200175515ustar00rootroot00000000000000node-postgres-pg-8.14.1/.devcontainer/Dockerfile000066400000000000000000000061761476604072200215550ustar00rootroot00000000000000#------------------------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. #------------------------------------------------------------------------------------------------------------- FROM node:20 # Avoid warnings by switching to noninteractive ENV DEBIAN_FRONTEND=noninteractive # The node image includes a non-root user with sudo access. Use the # "remoteUser" property in devcontainer.json to use it. On Linux, update # these values to ensure the container user's UID/GID matches your local values. # See https://aka.ms/vscode-remote/containers/non-root-user for details. ARG USERNAME=node ARG USER_UID=1000 ARG USER_GID=$USER_UID RUN echo "deb http://archive.debian.org/debian stretch main" > /etc/apt/sources.list # Configure apt and install packages RUN apt-get update \ && apt-get -y install --no-install-recommends dialog 2>&1 \ # # Verify git and needed tools are installed && apt-get -y install git iproute2 procps \ # # Remove outdated yarn from /opt and install via package # so it can be easily updated via apt-get upgrade yarn && rm -rf /opt/yarn-* \ && rm -f /usr/local/bin/yarn \ && rm -f /usr/local/bin/yarnpkg \ && apt-get install -y curl apt-transport-https lsb-release \ && curl -sS https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/pubkey.gpg | apt-key add - 2>/dev/null \ && echo "deb https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ && apt-get update \ && apt-get -y install --no-install-recommends yarn tmux locales postgresql \ && apt-get install libpq-dev g++ make \ # # Install eslint globally && npm install -g eslint \ # # [Optional] Update a non-root user to UID/GID if needed. && if [ "$USER_GID" != "1000" ] || [ "$USER_UID" != "1000" ]; then \ groupmod --gid $USER_GID $USERNAME \ && usermod --uid $USER_UID --gid $USER_GID $USERNAME \ && chown -R $USER_UID:$USER_GID /home/$USERNAME; \ fi \ # [Optional] Add add sudo support for non-root user && apt-get install -y sudo \ && echo node ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ && chmod 0440 /etc/sudoers.d/$USERNAME \ # Clean up && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* RUN curl https://raw.githubusercontent.com/brianc/dotfiles/master/.tmux.conf > ~/.tmux.conf # install nvm RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash # set up a nicer prompt RUN git clone https://github.com/magicmonty/bash-git-prompt.git ~/.bash-git-prompt --depth=1 RUN echo "source $HOME/.bash-git-prompt/gitprompt.sh" >> ~/.bashrc # Set the locale RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && locale-gen ENV LANG en_US.UTF-8 ENV LANGUAGE en_US:en ENV LC_ALL en_US.UTF-8 # Switch back to dialog for any ad-hoc use of apt-get ENV DEBIAN_FRONTEND=dialog node-postgres-pg-8.14.1/.devcontainer/devcontainer.json000066400000000000000000000007521476604072200231310ustar00rootroot00000000000000// If you want to run as a non-root user in the container, see .devcontainer/docker-compose.yml. { "name": "Node.js 20 & Postgres", "dockerComposeFile": "docker-compose.yml", "service": "web", "workspaceFolder": "/workspace", // Add the IDs of extensions you want installed when the container is created in the array below. "customizations":{ "vscode": { "extensions": ["dbaeumer.vscode-eslint"], "settings": { "terminal.integrated.shell.linux": "/bin/bash" } } } } node-postgres-pg-8.14.1/.devcontainer/docker-compose.yml000066400000000000000000000033211476604072200232050ustar00rootroot00000000000000#------------------------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. #------------------------------------------------------------------------------------------------------------- version: '3.9' services: web: # Uncomment the next line to use a non-root user for all processes. You can also # simply use the "remoteUser" property in devcontainer.json if you just want VS Code # and its sub-processes (terminals, tasks, debugging) to execute as the user. On Linux, # you may need to update USER_UID and USER_GID in .devcontainer/Dockerfile to match your # user if not 1000. See https://aka.ms/vscode-remote/containers/non-root for details. # user: node build: context: . dockerfile: Dockerfile volumes: - ..:/workspace:cached environment: PGPASSWORD: pass PGUSER: user PGDATABASE: data PGHOST: db # set this to true in the development environment until I can get SSL setup on the # docker postgres instance PGTESTNOSSL: 'true' # Overrides default command so things don't shut down after the process ends. command: sleep infinity depends_on: - db links: - db:db db: image: postgres:14-alpine restart: unless-stopped ports: - 5432:5432 command: postgres -c password_encryption=md5 environment: POSTGRES_HOST_AUTH_METHOD: trust POSTGRES_INITDB_ARGS: "--auth-local=md5" POSTGRES_PASSWORD: pass POSTGRES_USER: user POSTGRES_DB: data node-postgres-pg-8.14.1/.eslintignore000066400000000000000000000000221476604072200175070ustar00rootroot00000000000000/packages/*/dist/ node-postgres-pg-8.14.1/.eslintrc000066400000000000000000000010441476604072200166350ustar00rootroot00000000000000{ "plugins": ["@typescript-eslint", "prettier"], "parser": "@typescript-eslint/parser", "extends": ["plugin:prettier/recommended", "prettier"], "ignorePatterns": ["node_modules", "coverage", "packages/pg-protocol/dist/**/*", "packages/pg-query-stream/dist/**/*"], "parserOptions": { "ecmaVersion": 2017, "sourceType": "module" }, "env": { "node": true, "es6": true, "mocha": true }, "rules": { "@typescript-eslint/no-unused-vars": ["error", { "args": "none" }], "no-unused-vars": "off" } } node-postgres-pg-8.14.1/.gitattributes000066400000000000000000000000221476604072200176770ustar00rootroot00000000000000* text=auto eol=lfnode-postgres-pg-8.14.1/.github/000077500000000000000000000000001476604072200163525ustar00rootroot00000000000000node-postgres-pg-8.14.1/.github/CODEOWNERS000066400000000000000000000000451476604072200177440ustar00rootroot00000000000000/packages/pg-connection-string @hjr3 node-postgres-pg-8.14.1/.github/FUNDING.yml000066400000000000000000000001001476604072200201560ustar00rootroot00000000000000# These are supported funding model platforms github: [brianc] node-postgres-pg-8.14.1/.github/dependabot.yaml000066400000000000000000000001541476604072200213430ustar00rootroot00000000000000 version: 2 updates: - package-ecosystem: "npm" directory: "/" schedule: interval: "monthly"node-postgres-pg-8.14.1/.github/workflows/000077500000000000000000000000001476604072200204075ustar00rootroot00000000000000node-postgres-pg-8.14.1/.github/workflows/ci.yml000066400000000000000000000034611476604072200215310ustar00rootroot00000000000000name: CI on: [push, pull_request] permissions: contents: read jobs: lint: timeout-minutes: 5 runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: persist-credentials: false - name: Setup node uses: actions/setup-node@v4 with: node-version: 18 cache: yarn - run: yarn install --frozen-lockfile - run: yarn lint build: timeout-minutes: 15 needs: lint services: postgres: image: ghcr.io/railwayapp-templates/postgres-ssl env: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_HOST_AUTH_METHOD: 'md5' POSTGRES_DB: ci_db_test ports: - 5432:5432 options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 strategy: fail-fast: false matrix: node: - '16' - '18' - '20' - '22' - '23' os: - ubuntu-latest name: Node.js ${{ matrix.node }} runs-on: ubuntu-latest env: PGUSER: postgres PGPASSWORD: postgres PGHOST: localhost PGDATABASE: ci_db_test PGTESTNOSSL: 'true' SCRAM_TEST_PGUSER: scram_test SCRAM_TEST_PGPASSWORD: test4scram steps: - name: Show OS run: | uname -a - run: | psql \ -c "SET password_encryption = 'scram-sha-256'" \ -c "CREATE ROLE scram_test LOGIN PASSWORD 'test4scram'" - uses: actions/checkout@v4 with: persist-credentials: false - name: Setup node uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} cache: yarn - run: yarn install --frozen-lockfile - run: yarn test node-postgres-pg-8.14.1/.gitignore000066400000000000000000000002051476604072200167770ustar00rootroot00000000000000*~ build/ .lock-wscript *.log node_modules/ package-lock.json *.swp dist .DS_Store /.eslintcache .vscode/ manually-test-on-heroku.js node-postgres-pg-8.14.1/.yarnrc000066400000000000000000000000351476604072200163070ustar00rootroot00000000000000--install.ignore-engines truenode-postgres-pg-8.14.1/CHANGELOG.md000066400000000000000000000611131476604072200166250ustar00rootroot00000000000000All major and minor releases are briefly explained below. For richer information consult the commit log on github with referenced pull requests. We do not include break-fix version release in this file. ## pg@8.14.0 - Add support from SCRAM-SAH-256-PLUS i.e. [channel binding](https://github.com/brianc/node-postgres/pull/3356). ## pg@8.13.0 - Add ability to specify query timeout on [per-query basis](https://github.com/brianc/node-postgres/pull/3074). ## pg@8.12.0 - Add `queryMode` config option to [force use of the extended query protocol](https://github.com/brianc/node-postgres/pull/3214) on queries without any parameters. ## pg-pool@8.10.0 - Emit `release` event when client is returned to [the pool](https://github.com/brianc/node-postgres/pull/2845). ## pg@8.9.0 - Add support for [stream factory](https://github.com/brianc/node-postgres/pull/2898). - [Better errors](https://github.com/brianc/node-postgres/pull/2901) for SASL authentication. - [Use native crypto module](https://github.com/brianc/node-postgres/pull/2815) for SASL authentication. ## pg@8.8.0 - Bump minimum required version of [native bindings](https://github.com/brianc/node-postgres/pull/2787). - Catch previously uncatchable errors thrown in [`pool.query`](https://github.com/brianc/node-postgres/pull/2569). - Prevent the pool from blocking the event loop if all clients are [idle](https://github.com/brianc/node-postgres/pull/2721) (and `allowExitOnIdle` is enabled). - Support `lock_timeout` in [client config](https://github.com/brianc/node-postgres/pull/2779). - Fix errors thrown in callbacks from [interfering with cleanup](https://github.com/brianc/node-postgres/pull/2753). ### pg-pool@3.5.0 - Add connection [lifetime limit](https://github.com/brianc/node-postgres/pull/2698) config option. ### pg@8.7.0 - Add optional config to [pool](https://github.com/brianc/node-postgres/pull/2568) to allow process to exit if pool is idle. ### pg-cursor@2.7.0 - Convert to [es6 class](https://github.com/brianc/node-postgres/pull/2553) - Add support for promises [to cursor methods](https://github.com/brianc/node-postgres/pull/2554) ### pg@8.6.0 - Better [SASL](https://github.com/brianc/node-postgres/pull/2436) error messages & more validation on bad configuration. - Export [DatabaseError](https://github.com/brianc/node-postgres/pull/2445). - Add [ParameterDescription](https://github.com/brianc/node-postgres/pull/2464) support to protocol parsing. - Fix typescript [typedefs](https://github.com/brianc/node-postgres/pull/2490) with `--isolatedModules`. ### pg-query-stream@4.0.0 - Library has been [converted](https://github.com/brianc/node-postgres/pull/2376) to Typescript. The behavior is identical, but there could be subtle breaking changes due to class names changing or other small inconsistencies introduced by the conversion. ### pg@8.5.0 - Fix bug forwarding [ssl key](https://github.com/brianc/node-postgres/pull/2394). - Convert pg-query-stream internals to [typescript](https://github.com/brianc/node-postgres/pull/2376). - Performance [improvements](https://github.com/brianc/node-postgres/pull/2286). ### pg@8.4.0 - Switch to optional peer dependencies & remove [semver](https://github.com/brianc/node-postgres/commit/a02dfac5ad2e2abf0dc3a9817f953938acdc19b1) package which has been a small thorn in the side of a few users. - Export `DatabaseError` from [pg-protocol](https://github.com/brianc/node-postgres/commit/58258430d52ee446721cc3e6611e26f8bcaa67f5). - Add support for `sslmode` in the [connection string](https://github.com/brianc/node-postgres/commit/6be3b9022f83efc721596cc41165afaa07bfceb0). ### pg@8.3.0 - Support passing a [string of command line options flags](https://github.com/brianc/node-postgres/pull/2216) via the `{ options: string }` field on client/pool config. ### pg@8.2.0 - Switch internal protocol parser & serializer to [pg-protocol](https://github.com/brianc/node-postgres/tree/master/packages/pg-protocol). The change is backwards compatible but results in a significant performance improvement across the board, with some queries as much as 50% faster. This is the first work to land in an on-going performance improvement initiative I'm working on. Stay tuned as things are set to get much faster still! :rocket: ### pg-cursor@2.2.0 - Switch internal protocol parser & serializer to [pg-protocol](https://github.com/brianc/node-postgres/tree/master/packages/pg-protocol). The change is backwards compatible but results in a significant performance improvement across the board, with some queries as much as 50% faster. ### pg-query-stream@3.1.0 - Switch internal protocol parser & serializer to [pg-protocol](https://github.com/brianc/node-postgres/tree/master/packages/pg-protocol). The change is backwards compatible but results in a significant performance improvement across the board, with some queries as much as 50% faster. ### pg@8.1.0 - Switch to using [monorepo](https://github.com/brianc/node-postgres/tree/master/packages/pg-connection-string) version of `pg-connection-string`. This includes better support for SSL argument parsing from connection strings and ensures continuity of support. - Add `&ssl=no-verify` option to connection string and `PGSSLMODE=no-verify` environment variable support for the pure JS driver. This is equivalent of passing `{ ssl: { rejectUnauthorized: false } }` to the client/pool constructor. The advantage of having support in connection strings and environment variables is it can be "externally" configured via environment variables and CLI arguments much more easily, and should remove the need to directly edit any application code for [the SSL default changes in 8.0](https://node-postgres.com/announcements#2020-02-25). This should make using `pg@8.x` significantly less difficult on environments like Heroku for example. ### pg-pool@3.2.0 - Same changes to `pg` impact `pg-pool` as they both use the same connection parameter and connection string parsing code for configuring SSL. ### pg-pool@3.1.0 - Add [maxUses](https://github.com/brianc/node-postgres/pull/2157) config option. ### pg@8.0.0 #### note: for detailed release notes please [check here](https://node-postgres.com/announcements#2020-02-25) - Remove versions of node older than `6 lts` from the test matrix. `pg>=8.0` may still work on older versions but it is no longer officially supported. - Change default behavior when not specifying `rejectUnauthorized` with the SSL connection parameters. Previously we defaulted to `rejectUnauthorized: false` when it was not specifically included. We now default to `rejectUnauthorized: true.` Manually specify `{ ssl: { rejectUnauthorized: false } }` for old behavior. - Change [default database](https://github.com/brianc/node-postgres/pull/1679) when not specified to use the `user` config option if available. Previously `process.env.USER` was used. - Change `pg.Pool` and `pg.Query` to [be](https://github.com/brianc/node-postgres/pull/2126) an [es6 class](https://github.com/brianc/node-postgres/pull/2063). - Make `pg.native` non enumerable. - `notice` messages are [no longer instances](https://github.com/brianc/node-postgres/pull/2090) of `Error`. - Passwords no longer [show up](https://github.com/brianc/node-postgres/pull/2070) when instances of clients or pools are logged. ### pg@7.18.0 - This will likely be the last minor release before pg@8.0. - This version contains a few bug fixes and adds a deprecation warning for [a pending change in 8.0](https://github.com/brianc/node-postgres/issues/2009#issuecomment-579371651) which will flip the default behavior over SSL from `rejectUnauthorized` from `false` to `true` making things more secure in the general use case. ### pg-query-stream@3.0.0 - [Rewrote stream internals](https://github.com/brianc/node-postgres/pull/2051) to better conform to node stream semantics. This should make pg-query-stream much better at respecting [highWaterMark](https://nodejs.org/api/stream.html#stream_new_stream_readable_options) and getting rid of some edge case bugs when using pg-query-stream as an async iterator. Due to the size and nature of this change (effectively a full re-write) it's safest to bump the semver major here, though almost all tests remain untouched and still passing, which brings us to a breaking change to the API.... - Changed `stream.close` to `stream.destroy` which is the [official](https://nodejs.org/api/stream.html#stream_readable_destroy_error) way to terminate a readable stream. This is a **breaking change** if you rely on the `stream.close` method on pg-query-stream...though should be just a find/replace type operation to upgrade as the semantics remain very similar (not exactly the same, since internals are rewritten, but more in line with how streams are "supposed" to behave). - Unified the `config.batchSize` and `config.highWaterMark` to both do the same thing: control how many rows are buffered in memory. The `ReadableStream` will manage exactly how many rows are requested from the cursor at a time. This should give better out of the box performance and help with efficient async iteration. ### pg@7.17.0 - Add support for `idle_in_transaction_session_timeout` [option](https://github.com/brianc/node-postgres/pull/2049). ### 7.16.0 - Add optional, opt-in behavior to test new, [faster query pipeline](https://github.com/brianc/node-postgres/pull/2044). This is experimental, and not documented yet. The pipeline changes will grow significantly after the 8.0 release. ### 7.15.0 - Change repository structure to support lerna & future monorepo [development](https://github.com/brianc/node-postgres/pull/2014). - [Warn about deprecation](https://github.com/brianc/node-postgres/pull/2021) for calling constructors without `new`. ### 7.14.0 - Reverts 7.13.0 as it contained [an accidental breaking change](https://github.com/brianc/node-postgres/pull/2010) for self-signed SSL cert verification. 7.14.0 is identical to 7.12.1. ### 7.13.0 - Add support for [all tls.connect()](https://github.com/brianc/node-postgres/pull/1996) options. ### 7.12.0 - Add support for [async password lookup](https://github.com/brianc/node-postgres/pull/1926). ### 7.11.0 - Add support for [connection_timeout](https://github.com/brianc/node-postgres/pull/1847/files#diff-5391bde944956870128be1136e7bc176R63) and [keepalives_idle](https://github.com/brianc/node-postgres/pull/1847). ### 7.10.0 - Add support for [per-query types](https://github.com/brianc/node-postgres/pull/1825). ### 7.9.0 - Add support for [sasl/scram authentication](https://github.com/brianc/node-postgres/pull/1835). ### 7.8.0 - Add support for passing [secureOptions](https://github.com/brianc/node-postgres/pull/1804) SSL config. - Upgrade [pg-types](https://github.com/brianc/node-postgres/pull/1806) to 2.0. ### 7.7.0 - Add support for configurable [query timeout](https://github.com/brianc/node-postgres/pull/1760) on a client level. ### 7.6.0 - Add support for ["bring your own promise"](https://github.com/brianc/node-postgres/pull/1518) ### 7.5.0 - Better [error message](https://github.com/brianc/node-postgres/commit/11a4793452d618c53e019416cc886ad38deb1aa7) when passing `null` or `undefined` to `client.query`. - Better [error handling](https://github.com/brianc/node-postgres/pull/1503) on queued queries. ### 7.4.0 - Add support for [Uint8Array](https://github.com/brianc/node-postgres/pull/1448) values. ### 7.3.0 - Add support for [statement timeout](https://github.com/brianc/node-postgres/pull/1436). ### 7.2.0 - Pinned pg-pool and pg-types to a tighter semver range. This is likely not a noticeable change for you unless you were specifically installing older versions of those libraries for some reason, but making it a minor bump here just in case it could cause any confusion. ### 7.1.0 #### Enhancements - [You can now supply both a connection string and additional config options to clients.](https://github.com/brianc/node-postgres/pull/1363) ### 7.0.0 #### Breaking Changes - Drop support for node < `4.x`. - Remove `pg.connect` `pg.end` and `pg.cancel` singleton methods. - `Client#connect(callback)` now returns `undefined`. It used to return an event emitter. - Upgrade [pg-pool](https://github.com/brianc/node-pg-pool) to `2.x`. - Upgrade [pg-native](https://github.com/brianc/node-pg-native) to `2.x`. - Standardize error message fields between JS and native driver. The only breaking changes were in the native driver as its field names were brought into alignment with the existing JS driver field names. - Result from multi-statement text queries such as `SELECT 1; SELECT 2;` are now returned as an array of results instead of a single result with 1 array containing rows from both queries. [Please see here for a migration guide](https://node-postgres.com/guides/upgrading) #### Enhancements - Overhauled documentation: [https://node-postgres.com](https://node-postgres.com). - Add `Client#connect() => Promise` and `Client#end() => Promise` calls. Promises are now returned from all async methods on clients _if and only if_ no callback was supplied to the method. - Add `connectionTimeoutMillis` to pg-pool. ### v6.2.0 - Add support for [parsing `replicationStart` messages](https://github.com/brianc/node-postgres/pull/1271/files). ### v6.1.0 - Add optional callback parameter to the pure JavaScript `client.end` method. The native client already supported this. ### v6.0.0 #### Breaking Changes - Remove `pg.pools`. There is still a reference kept to the pools created & tracked by `pg.connect` but it has been renamed, is considered private, and should not be used. Accessing this API directly was uncommon and was _supposed_ to be private but was incorrectly documented on the wiki. Therefore, it is a breaking change of an (unintentionally) public interface to remove it by renaming it & making it private. Eventually `pg.connect` itself will be deprecated in favor of instantiating pools directly via `new pg.Pool()` so this property should become completely moot at some point. In the mean time...check out the new features... #### New features - Replace internal pooling code with [pg-pool](https://github.com/brianc/node-pg-pool). This is the first step in eventually deprecating and removing the singleton `pg.connect`. The pg-pool constructor is exported from node-postgres at `require('pg').Pool`. It provides a backwards compatible interface with `pg.connect` as well as a promise based interface & additional niceties. You can now create an instance of a pool and don't have to rely on the `pg` singleton for anything: ``` var pg = require('pg') var pool = new pg.Pool() // your friendly neighborhood pool interface, without the singleton pool.connect(function(err, client, done) { // ... }) ``` Promise support & other goodness lives now in [pg-pool](https://github.com/brianc/node-pg-pool). **Please** read the readme at [pg-pool](https://github.com/brianc/node-pg-pool) for the full api. - Included support for tcp keep alive. Enable it as follows: ```js var client = new Client({ keepAlive: true }) ``` This should help with backends incorrectly considering idle clients to be dead and prematurely disconnecting them. ### v5.1.0 - Make the query object returned from `client.query` implement the promise interface. This is the first step towards promisifying more of the node-postgres api. Example: ```js var client = new Client() client.connect() client.query('SELECT $1::text as name', ['brianc']).then(function (res) { console.log('hello from', res.rows[0]) client.end() }) ``` ### v5.0.0 #### Breaking Changes - `require('pg').native` now returns null if the native bindings cannot be found; previously, this threw an exception. #### New Features - better error message when passing `undefined` as a query parameter - support for `defaults.connectionString` - support for `returnToHead` being passed to [generic pool](https://github.com/coopernurse/node-pool) ### v4.5.0 - Add option to parse JS date objects in query parameters as [UTC](https://github.com/brianc/node-postgres/pull/943) ### v4.4.0 - Warn to `stderr` if a named query exceeds 63 characters which is the max length supported by postgres. ### v4.3.0 - Unpin `pg-types` semver. Allow it to float against `pg-types@1.x`. ### v4.2.0 - Support for additional error fields in postgres >= 9.3 if available. ### v4.1.0 - Allow type parser overrides on a [per-client basis](https://github.com/brianc/node-postgres/pull/679) ### v4.0.0 - Make [native bindings](https://github.com/brianc/node-pg-native.git) an optional install with `npm install pg-native` - No longer surround query result callback with `try/catch` block. - Remove built in COPY IN / COPY OUT support - better implementations provided by [pg-copy-streams](https://github.com/brianc/node-pg-copy-streams.git) and [pg-native](https://github.com/brianc/node-pg-native.git) ### v3.6.0 - Include support for (parsing JSONB)[https://github.com/brianc/node-pg-types/pull/13] (supported in postgres 9.4) ### v3.5.0 - Include support for parsing boolean arrays ### v3.4.0 - Include port as connection parameter to [unix sockets](https://github.com/brianc/node-postgres/pull/604) - Better support for odd [date parsing](https://github.com/brianc/node-pg-types/pull/8) ### v3.2.0 - Add support for parsing [date arrays](https://github.com/brianc/node-pg-types/pull/3) - Expose array parsers on [pg.types](https://github.com/brianc/node-pg-types/pull/2) - Allow [pool](https://github.com/brianc/node-postgres/pull/591) to be configured ### v3.1.0 - Add [count of the number of times a client has been checked out from the pool](https://github.com/brianc/node-postgres/pull/556) - Emit `end` from `pg` object [when a pool is drained](https://github.com/brianc/node-postgres/pull/571) ### v3.0.0 #### Breaking changes - [Parse the DATE PostgreSQL type as local time](https://github.com/brianc/node-postgres/pull/514) After [some discussion](https://github.com/brianc/node-postgres/issues/510) it was decided node-postgres was non-compliant in how it was handling DATE results. They were being converted to UTC, but the PostgreSQL documentation specifies they should be returned in the client timezone. This is a breaking change, and if you use the `date` type you might want to examine your code and make sure nothing is impacted. - [Fix possible numeric precision loss on numeric & int8 arrays](https://github.com/brianc/node-postgres/pull/501) pg@v2.0 included changes to not convert large integers into their JavaScript number representation because of possibility for numeric precision loss. The same types in arrays were not taken into account. This fix applies the same type of type-coercion rules to arrays of those types, so there will be no more possible numeric loss on an array of very large int8s for example. This is a breaking change because now a return type from a query of `int8[]` will contain _string_ representations of the integers. Use your favorite JavaScript bignum module to represent them without precision loss, or punch over the type converter to return the old style arrays again. - [Fix to input array of dates being improperly converted to utc](https://github.com/benesch/node-postgres/commit/c41eedc3e01e5527a3d5c242fa1896f02ef0b261#diff-7172adb1fec2457a2700ed29008a8e0aR108) Single `date` parameters were properly sent to the PostgreSQL server properly in local time, but an input array of dates was being changed into utc dates. This is a violation of what PostgreSQL expects. Small breaking change, but none-the-less something you should check out if you are inserting an array of dates. - [Query no longer emits `end` event if it ends due to an error](https://github.com/brianc/node-postgres/commit/357b64d70431ec5ca721eb45a63b082c18e6ffa3) This is a small change to bring the semantics of query more in line with other EventEmitters. The tests all passed after this change, but I suppose it could still be a breaking change in certain use cases. If you are doing clever things with the `end` and `error` events of a query object you might want to check to make sure its still behaving normally, though it is most likely not an issue. #### New features - [Supercharge `prepareValue`](https://github.com/brianc/node-postgres/pull/555) The long & short of it is now any object you supply in the list of query values will be inspected for a `.toPostgres` method. If the method is present it will be called and its result used as the raw text value sent to PostgreSQL for that value. This allows the same type of custom type coercion on query parameters as was previously afforded to query result values. - [Domain aware connection pool](https://github.com/brianc/node-postgres/pull/531) If domains are active node-postgres will honor them and do everything it can to ensure all callbacks are properly fired in the active domain. If you have tried to use domains with node-postgres (or many other modules which pool long lived event emitters) you may have run into an issue where the active domain changes before and after a callback. This has been a longstanding footgun within node-postgres and I am happy to get it fixed. - [Disconnected clients now removed from pool](https://github.com/brianc/node-postgres/pull/543) Avoids a scenario where your pool could fill up with disconnected & unusable clients. - [Break type parsing code into separate module](https://github.com/brianc/node-postgres/pull/541) To provide better documentation and a clearer explanation of how to override the query result parsing system we broke the type converters [into their own module](https://github.com/brianc/node-pg-types). There is still work around removing the 'global-ness' of the type converters so each query or connection can return types differently, but this is a good first step and allow a lot more obvious way to return int8 results as JavaScript numbers, for example ### v2.11.0 - Add support for [application_name](https://github.com/brianc/node-postgres/pull/497) ### v2.10.0 - Add support for [the password file](http://www.postgresql.org/docs/9.3/static/libpq-pgpass.html) ### v2.9.0 - Add better support for [unix domain socket](https://github.com/brianc/node-postgres/pull/487) connections ### v2.8.0 - Add support for parsing JSON[] and UUID[] result types ### v2.7.0 - Use single row mode in native bindings when available [@rpedela] - reduces memory consumption when handling row values in 'row' event - Automatically bind buffer type parameters as binary [@eugeneware] ### v2.6.0 - Respect PGSSLMODE environment variable ### v2.5.0 - Ability to opt-in to int8 parsing via `pg.defaults.parseInt8 = true` ### v2.4.0 - Use eval in the result set parser to increase performance ### v2.3.0 - Remove built-in support for binary Int64 parsing. _Due to the low usage & required compiled dependency this will be pushed into a 3rd party add-on_ ### v2.2.0 - [Add support for excapeLiteral and escapeIdentifier in both JavaScript and the native bindings](https://github.com/brianc/node-postgres/pull/396) ### v2.1.0 - Add support for SSL connections in JavaScript driver - this means you can connect to heroku postgres from your local machine without the native bindings! - [Add field metadata to result object](https://github.com/brianc/node-postgres/blob/master/test/integration/client/row-description-on-results-tests.js) - [Add ability for rows to be returned as arrays instead of objects](https://github.com/brianc/node-postgres/blob/master/test/integration/client/results-as-array-tests.js) ### v2.0.0 - Properly handle various PostgreSQL to JavaScript type conversions to avoid data loss: ``` PostgreSQL | pg@v2.0 JavaScript | pg@v1.0 JavaScript --------------------------------|---------------- float4 | number (float) | string float8 | number (float) | string int8 | string | number (int) numeric | string | number (float) decimal | string | number (float) ``` For more information see https://github.com/brianc/node-postgres/pull/353 If you are unhappy with these changes you can always [override the built in type parsing fairly easily](https://github.com/brianc/node-pg-parse-float). ### v1.3.0 - Make client_encoding configurable and optional ### v1.2.0 - return field metadata on result object: access via result.fields[i].name/dataTypeID ### v1.1.0 - built in support for `JSON` data type for PostgreSQL Server @ v9.2.0 or greater ### v1.0.0 - remove deprecated functionality - Callback function passed to `pg.connect` now **requires** 3 arguments - Client#pauseDrain() / Client#resumeDrain removed - numeric, decimal, and float data types no longer parsed into float before being returned. Will be returned from query results as `String` ### v0.15.0 - client now emits `end` when disconnected from back-end server - if client is disconnected in the middle of a query, query receives an error ### v0.14.0 - add deprecation warnings in prep for v1.0 - fix read/write failures in native module under node v0.9.x node-postgres-pg-8.14.1/LICENSE000066400000000000000000000020651476604072200160220ustar00rootroot00000000000000MIT License Copyright (c) 2010 - 2021 Brian Carlson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. node-postgres-pg-8.14.1/LOCAL_DEV.md000066400000000000000000000020211476604072200166570ustar00rootroot00000000000000# Local development Steps to install and configure Postgres on Mac for developing against locally 1. Install homebrew 2. Install postgres ```sh brew install postgresql ``` 3. Create a database ```sh createdb test ``` 4. Create SSL certificates ```sh cd /opt/homebrew/var/postgresql@14 openssl genrsa -aes128 2048 > server.key openssl rsa -in server.key -out server.key chmod 400 server.key openssl req -new -key server.key -days 365 -out server.crt -x509 cp server.crt root.crt ``` 5. Update config in `/opt/homebrew/var/postgresql@14/postgresql.conf` ```conf listen_addresses = '*' password_encryption = md5 ssl = on ssl_ca_file = 'root.crt' ssl_cert_file = 'server.crt' ssl_crl_file = '' ssl_crl_dir = '' ssl_key_file = 'server.key' ssl_ciphers = 'HIGH:MEDIUM:+3DES:!aNULL' # allowed SSL ciphers ssl_prefer_server_ciphers = on ``` 6. Start Postgres server ```sh /opt/homebrew/opt/postgresql@14/bin/postgres -D /opt/homebrew/var/postgresql@14 ``` node-postgres-pg-8.14.1/README.md000066400000000000000000000127441476604072200163010ustar00rootroot00000000000000# node-postgres ![Build Status](https://github.com/brianc/node-postgres/actions/workflows/ci.yml/badge.svg) NPM version NPM downloads Non-blocking PostgreSQL client for Node.js. Pure JavaScript and optional native libpq bindings. ## Monorepo This repo is a monorepo which contains the core [pg](https://github.com/brianc/node-postgres/tree/master/packages/pg) module as well as a handful of related modules. - [pg](https://github.com/brianc/node-postgres/tree/master/packages/pg) - [pg-pool](https://github.com/brianc/node-postgres/tree/master/packages/pg-pool) - [pg-native](https://github.com/brianc/node-postgres/tree/master/packages/pg-native) - [pg-cursor](https://github.com/brianc/node-postgres/tree/master/packages/pg-cursor) - [pg-query-stream](https://github.com/brianc/node-postgres/tree/master/packages/pg-query-stream) - [pg-connection-string](https://github.com/brianc/node-postgres/tree/master/packages/pg-connection-string) - [pg-protocol](https://github.com/brianc/node-postgres/tree/master/packages/pg-protocol) ## Install ``` npm install pg ``` ## Documentation Each package in this repo should have its own readme more focused on how to develop/contribute. For overall documentation on the project and the related modules managed by this repo please see: ### :star: [Documentation](https://node-postgres.com) :star: The source repo for the documentation is available for contribution [here](https://github.com/brianc/node-postgres/tree/master/docs). ### Features - Pure JavaScript client and native libpq bindings share _the same API_ - Connection pooling - Extensible JS ↔ PostgreSQL data-type coercion - Supported PostgreSQL features - Parameterized queries - Named statements with query plan caching - Async notifications with `LISTEN/NOTIFY` - Bulk import & export with `COPY TO/COPY FROM` ### Extras node-postgres is by design pretty light on abstractions. These are some handy modules we've been using over the years to complete the picture. The entire list can be found on our [wiki](https://github.com/brianc/node-postgres/wiki/Extras). ## Support node-postgres is free software. If you encounter a bug with the library please open an issue on the [GitHub repo](https://github.com/brianc/node-postgres). If you have questions unanswered by the documentation please open an issue pointing out how the documentation was unclear & I will do my best to make it better! When you open an issue please provide: - version of Node - version of Postgres - smallest possible snippet of code to reproduce the problem You can also follow me [@briancarlson](https://twitter.com/briancarlson) if that's your thing. I try to always announce noteworthy changes & developments with node-postgres on Twitter. ## Sponsorship :two_hearts: node-postgres's continued development has been made possible in part by generous financial support from [the community](https://github.com/brianc/node-postgres/blob/master/SPONSORS.md). If you or your company are benefiting from node-postgres and would like to help keep the project financially sustainable [please consider supporting](https://github.com/sponsors/brianc) its development. ## Contributing **:heart: contributions!** I will **happily** accept your pull request if it: - **has tests** - looks reasonable - does not break backwards compatibility If your change involves breaking backwards compatibility please please point that out in the pull request & we can discuss & plan when and how to release it and what type of documentation or communication it will require. ### Setting up for local development 1. Clone the repo 2. Ensure you have installed libpq-dev in your system. 3. From your workspace root run `yarn` and then `yarn lerna bootstrap` 4. Ensure you have a PostgreSQL instance running with SSL enabled and an empty database for tests 5. Ensure you have the proper environment variables configured for connecting to the instance 6. Run `yarn test` to run all the tests ## Troubleshooting and FAQ The causes and solutions to common errors can be found among the [Frequently Asked Questions (FAQ)](https://github.com/brianc/node-postgres/wiki/FAQ) ## License Copyright (c) 2010-2020 Brian Carlson (brian.m.carlson@gmail.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. node-postgres-pg-8.14.1/SPONSORS.md000066400000000000000000000033451476604072200166270ustar00rootroot00000000000000node-postgres is made possible by the helpful contributors from the community as well as the following generous supporters on [GitHub Sponsors](https://github.com/sponsors/brianc) and [Patreon](https://www.patreon.com/node_postgres). # Leaders - [MadKudu](https://www.madkudu.com) - [@madkudu](https://twitter.com/madkudu) - [Third Iron](https://thirdiron.com/) - [Timescale](https://timescale.com) - [Nafundi](https://nafundi.com) - [CrateDB](https://crate.io/) - [BitMEX](https://www.bitmex.com/app/trade/XBTUSD) - [Dataform](https://dataform.co/) - [Eaze](https://www.eaze.com/) - [simpleanalytics](https://simpleanalytics.com/) - [n8n.io](https://n8n.io/) - [mpirik](https://github.com/mpirik) - [@BLUE-DEVIL1134](https://github.com/BLUE-DEVIL1134) - [bubble.io](https://bubble.io/) - GitHub[https://github.com/github] - loveland [https://github.com/loveland] # Supporters - John Fawcett - Lalit Kapoor [@lalitkapoor](https://twitter.com/lalitkapoor) - Paul Frazee [@pfrazee](https://twitter.com/pfrazee) - Rein Petersen - Arnaud Benhamdine [@abenhamdine](https://twitter.com/abenhamdine) - Matthew Welke - Matthew Weber - Andrea De Simon - Todd Kennedy - Alexander Robson - Benjie Gillam - David Hanson - Franklin Davenport - [Eventbot](https://geteventbot.com/) - Chuck T - Paul Cothenet - Pelle Wessman - Raul Murray - Simple Analytics - Trevor Linton - Ian Walter - @Guido4000 - [Martti Laine](https://github.com/codeclown) - [Tim Nolet](https://github.com/tnolet) - [Ideal Postcodes](https://github.com/ideal-postcodes) - [checkly](https://github.com/checkly) - [Scout APM](https://github.com/scoutapm-sponsorships) - [Sideline Sports](https://github.com/SidelineSports) - [Gadget](https://github.com/gadget-inc) - [Sentry](https://sentry.io/welcome/) node-postgres-pg-8.14.1/docs/000077500000000000000000000000001476604072200157425ustar00rootroot00000000000000node-postgres-pg-8.14.1/docs/.gitignore000066400000000000000000000000121476604072200177230ustar00rootroot00000000000000.next out node-postgres-pg-8.14.1/docs/components/000077500000000000000000000000001476604072200201275ustar00rootroot00000000000000node-postgres-pg-8.14.1/docs/components/alert.tsx000066400000000000000000000003151476604072200217750ustar00rootroot00000000000000import React from 'react' import { Callout } from 'nextra-theme-docs' export const Alert = ({ children }) => { return ( {children} ) } node-postgres-pg-8.14.1/docs/components/info.tsx000066400000000000000000000002471476604072200216250ustar00rootroot00000000000000import React from 'react' import { Callout } from 'nextra-theme-docs' export const Info = ({ children }) => { return {children} } node-postgres-pg-8.14.1/docs/next.config.js000066400000000000000000000003621476604072200205230ustar00rootroot00000000000000// next.config.js const withNextra = require('nextra')({ theme: 'nextra-theme-docs', themeConfig: './theme.config.js', // optional: add `unstable_staticImage: true` to enable Nextra's auto image import }) module.exports = withNextra() node-postgres-pg-8.14.1/docs/package.json000066400000000000000000000006241476604072200202320ustar00rootroot00000000000000{ "name": "docs", "version": "1.0.0", "description": "", "main": "next.config.js", "scripts": { "start": "next dev", "build": "next build && next export" }, "keywords": [], "author": "", "license": "ISC", "dependencies": { "next": "^12.3.1", "nextra": "2.0.0-beta.29", "nextra-theme-docs": "2.0.0-beta.29", "react": "^17.0.1", "react-dom": "^17.0.1" } } node-postgres-pg-8.14.1/docs/pages/000077500000000000000000000000001476604072200170415ustar00rootroot00000000000000node-postgres-pg-8.14.1/docs/pages/_app.js000066400000000000000000000002441476604072200203160ustar00rootroot00000000000000import 'nextra-theme-docs/style.css' export default function Nextra({ Component, pageProps }) { return ( <> ) } node-postgres-pg-8.14.1/docs/pages/_meta.json000066400000000000000000000001161476604072200210170ustar00rootroot00000000000000{ "index": "Welcome", "announcements": "Announcements", "apis": "API" } node-postgres-pg-8.14.1/docs/pages/announcements.mdx000066400000000000000000000212541476604072200224340ustar00rootroot00000000000000import { Alert } from '/components/alert.tsx' ## 2020-02-25 ### pg@8.0 release `pg@8.0` is [being released](https://github.com/brianc/node-postgres/pull/2117) which contains a handful of breaking changes. I will outline each breaking change here and try to give some historical context on them. Most of them are small and subtle and likely wont impact you; **however**, there is one larger breaking change you will likely run into: --- - Support all `tls.connect` [options](https://nodejs.org/api/tls.html#tls_tls_connect_options_callback) being passed to the client/pool constructor under the `ssl` option. Previously we white listed the parameters passed here and did slight massaging of some of them. The main **breaking** change here is that now if you do this: ```js const client = new Client({ ssl: true }) ``` Now we will use the default ssl options to tls.connect which includes rejectUnauthorized being enabled. This means your connection attempt may fail if you are using a self-signed cert. To use the old behavior you should do this: ```js const client = new Client({ ssl: { rejectUnauthorized: false } }) ``` This makes pg a bit more secure "out of the box" while still enabling you to opt in to the old behavior. --- The rest of the changes are relatively minor & you likely wont need to do anything, but good to be aware none the less! - change default database name If a database name is not specified, available in the environment at `PGDATABASE`, or available at `pg.defaults`, we used to use the username of the process user as the name of the database. Now we will use the `user` property supplied to the client as the database name, if it exists. What this means is this: ```jsx new Client({ user: 'foo', }) ``` `pg@7.x` will default the database name to the _process_ user. `pg@8.x` will use the `user` property supplied to the client. If you have not supplied `user` to the client, and it isn't available through any of its existing lookup mechanisms (environment variables, pg.defaults) then it will still use the process user for the database name. - drop support for versions of node older than 8.0 Node@6.0 has been out of LTS for quite some time now, and I've removed it from our test matrix. `pg@8.0` _may_ still work on older versions of node, but it isn't a goal of the project anymore. Node@8.0 is actually no longer in the LTS support line, but pg will continue to test against and support 8.0 until there is a compelling reason to drop support for it. Any security vulnerability issues which come up I will back-port fixes to the `pg@7.x` line and do a release, but any other fixes or improvements will not be back ported. - prevent password from being logged accidentally `pg@8.0` makes the password field on the pool and client non-enumerable. This means when you do `console.log(client)` you wont have your database password printed out unintentionally. You can still do `console.log(client.password)` if you really want to see it! - make `pg.native` non-enumerable You can use `pg.native.Client` to access the native client. The first time you access the `pg.native` getter it imports the native bindings...which must be installed. In some cases (such as webpacking the pg code for lambda deployment) the `.native` property would be traversed and trigger an import of the native bindings as a side-effect. Making this property non-enumerable will fix this issue. An easy fix, but its technically a breaking change in cases where people _are_ relying on this side effect for any reason. - make `pg.Pool` an es6 class This makes extending `pg.Pool` possible. Previously it was not a "proper" es6 class and `class MyPool extends pg.Pool` wouldn't work. - make `Notice` messages _not_ an instance of a JavaScript error The code path for parsing `notice` and `error` messages from the postgres backend is the same. Previously created a JavaScript `Error` instance for _both_ of these message types. Now, only actual `errors` from the postgres backend will be an instance of an `Error`. The _shape_ and _properties_ of the two messages did not change outside of this. - monorepo While not technically a breaking change for the module itself, I have begun the process of [consolidating](https://github.com/brianc/node-pg-query-stream) [separate](https://github.com/brianc/node-pg-cursor/) [repos](https://github.com/brianc/node-pg-pool) into the main [repo](https://github.com/brianc/node-postgres) and converted it into a monorepo managed by lerna. This will help me stay on top of issues better (it was hard to bounce between 3-4 separate repos) and coordinate bug fixes and changes between dependant modules. Thanks for reading that! pg tries to be super pedantic about not breaking backwards-compatibility in non semver major releases....even for seemingly small things. If you ever notice a breaking change on a semver minor/patch release please stop by the [repo](https://github.com/brianc/node-postgres) and open an issue! _If you find `pg` valuable to you or your business please consider [supporting](http://github.com/sponsors/brianc) it's continued development! Big performance improvements, typescript, better docs, query pipelining and more are all in the works!_ ## 2019-07-18 ### New documentation After a _very_ long time on my todo list I've ported the docs from my old hand-rolled webapp running on route53 + elb + ec2 + dokku (I know, I went overboard!) to [gatsby](https://www.gatsbyjs.org/) hosted on [netlify](https://www.netlify.com/) which is _so_ much easier to manage. I've released the code at [https://github.com/brianc/node-postgres-docs](https://github.com/brianc/node-postgres-docs) and invite your contributions! Let's make this documentation better together. Any time changes are merged to master on the documentation repo it will automatically deploy. If you see an error in the docs, big or small, use the "edit on GitHub" button to edit the page & submit a pull request right there. I'll get a new version out ASAP with your changes! If you want to add new pages of documentation open an issue if you need guidance, and I'll help you get started. I want to extend a special **thank you** to all the [supporters](https://github.com/brianc/node-postgres/blob/master/SPONSORS.md) and [contributors](https://github.com/brianc/node-postgres/graphs/contributors) to the project that have helped keep me going through times of burnout or life "getting in the way." ❤️ It's been quite a journey, and I look forward continuing it for as long as I can provide value to all y'all. 🤠 ## 2017-08-12 ### code execution vulnerability Today [@sehrope](https://github.com/sehrope) found and reported a code execution vulnerability in node-postgres. This affects all versions from `pg@2.x` through `pg@7.1.0`. I have published a fix on the tip of each major version branch of all affected versions as well as a fix on each minor version branch of `pg@6.x` and `pg@7.x`: ### Fixes The following versions have been published to npm & contain a patch to fix the vulnerability: ``` pg@2.11.2 pg@3.6.4 pg@4.5.7 pg@5.2.1 pg@6.0.5 pg@6.1.6 pg@6.2.5 pg@6.3.3 pg@6.4.2 pg@7.0.3 pg@7.1.2 ``` ### Example To demonstrate the issue & see if you are vulnerable execute the following in node: ```js import pg from 'pg' const { Client } = pg const client = new Client() client.connect() const sql = `SELECT 1 AS "\\'/*", 2 AS "\\'*/\n + console.log(process.env)] = null;\n//"` client.query(sql, (err, res) => { client.end() }) ``` You will see your environment variables printed to your console. An attacker can use this exploit to execute any arbitrary node code within your process. ### Impact This vulnerability _likely_ does not impact you if you are connecting to a database you control and not executing user-supplied sql. Still, you should **absolutely** upgrade to the most recent patch version as soon as possible to be safe. Two attack vectors we quickly thought of: - 1 - executing unsafe, user-supplied sql which contains a malicious column name like the one above. - 2 - connecting to an untrusted database and executing a query which returns results where any of the column names are malicious. ### Support I have created [an issue](https://github.com/brianc/node-postgres/issues/1408) you can use to discuss the vulnerability with me or ask questions, and I have reported this issue [on twitter](https://twitter.com/briancarlson) and directly to Heroku and [nodesecurity.io](https://nodesecurity.io/). I take security very seriously. If you or your company benefit from node-postgres **[please sponsor my work](https://www.patreon.com/node_postgres)**: this type of issue is one of the many things I am responsible for, and I want to be able to continue to tirelessly provide a world-class PostgreSQL experience in node for years to come. node-postgres-pg-8.14.1/docs/pages/apis/000077500000000000000000000000001476604072200177755ustar00rootroot00000000000000node-postgres-pg-8.14.1/docs/pages/apis/_meta.json000066400000000000000000000002231476604072200217520ustar00rootroot00000000000000{ "client": "pg.Client", "pool": "pg.Pool", "result": "pg.Result", "types": "pg.Types", "cursor": "Cursor", "utilities": "Utilities" } node-postgres-pg-8.14.1/docs/pages/apis/client.mdx000066400000000000000000000143011476604072200217640ustar00rootroot00000000000000--- title: pg.Client --- ## new Client `new Client(config: Config)` Every field of the `config` object is entirely optional. A `Client` instance will use [environment variables](/features/connecting#environment-variables) for all missing values. ```ts type Config = { user?: string, // default process.env.PGUSER || process.env.USER password?: string or function, //default process.env.PGPASSWORD host?: string, // default process.env.PGHOST port?: number, // default process.env.PGPORT database?: string, // default process.env.PGDATABASE || user connectionString?: string, // e.g. postgres://user:password@host:5432/database ssl?: any, // passed directly to node.TLSSocket, supports all tls.connect options types?: any, // custom type parsers statement_timeout?: number, // number of milliseconds before a statement in query will time out, default is no timeout query_timeout?: number, // number of milliseconds before a query call will timeout, default is no timeout lock_timeout?: number, // number of milliseconds a query is allowed to be en lock state before it's cancelled due to lock timeout application_name?: string, // The name of the application that created this Client instance connectionTimeoutMillis?: number, // number of milliseconds to wait for connection, default is no timeout idle_in_transaction_session_timeout?: number // number of milliseconds before terminating any session with an open idle transaction, default is no timeout } ``` example to create a client with specific connection information: ```js import pg from 'pg' const { Client } = pg const client = new Client({ user: 'database-user', password: 'secretpassword!!', host: 'my.database-server.com', port: 5334, database: 'database-name', }) ``` ## client.connect ```js import pg from 'pg' const { Client } = pg const client = new Client() await client.connect() ``` ## client.query ### QueryConfig You can pass an object to `client.query` with the signature of: ```ts type QueryConfig { // the raw query text text: string; // an array of query parameters values?: Array; // name of the query - used for prepared statements name?: string; // by default rows come out as a key/value pair for each row // pass the string 'array' here to receive rows as an array of values rowMode?: string; // custom type parsers just for this query result types?: Types; // TODO: document queryMode?: string; } ``` ```ts client.query(text: string, values?: any[]) => Promise ``` **Plain text query** ```js import pg from 'pg' const { Client } = pg const client = new Client() await client.connect() const result = await client.query('SELECT NOW()') console.log(result) await client.end() ``` **Parameterized query** ```js import pg from 'pg' const { Client } = pg const client = new Client() await client.connect() const result = await client.query('SELECT $1::text as name', ['brianc']) console.log(result) await client.end() ``` ```ts client.query(config: QueryConfig) => Promise ``` **client.query with a QueryConfig** If you pass a `name` parameter to the `client.query` method, the client will create a [prepared statement](/features/queries#prepared-statements). ```js const query = { name: 'get-name', text: 'SELECT $1::text', values: ['brianc'], rowMode: 'array', } const result = await client.query(query) console.log(result.rows) // ['brianc'] await client.end() ``` **client.query with a `Submittable`** If you pass an object to `client.query` and the object has a `.submit` function on it, the client will pass it's PostgreSQL server connection to the object and delegate query dispatching to the supplied object. This is an advanced feature mostly intended for library authors. It is incidentally also currently how the callback and promise based queries above are handled internally, but this is subject to change. It is also how [pg-cursor](https://github.com/brianc/node-pg-cursor) and [pg-query-stream](https://github.com/brianc/node-pg-query-stream) work. ```js import pg from 'pg' const { Query } = pg const query = new Query('select $1::text as name', ['brianc']) const result = client.query(query) assert(query === result) // true query.on('row', (row) => { console.log('row!', row) // { name: 'brianc' } }) query.on('end', () => { console.log('query done') }) query.on('error', (err) => { console.error(err.stack) }) ``` --- ## client.end Disconnects the client from the PostgreSQL server. ```js await client.end() console.log('client has disconnected') ``` ## events ### error ```ts client.on('error', (err: Error) => void) => void ``` When the client is in the process of connecting, dispatching a query, or disconnecting it will catch and forward errors from the PostgreSQL server to the respective `client.connect` `client.query` or `client.end` promise; however, the client maintains a long-lived connection to the PostgreSQL back-end and due to network partitions, back-end crashes, fail-overs, etc the client can (and over a long enough time period _will_) eventually be disconnected while it is idle. To handle this you may want to attach an error listener to a client to catch errors. Here's a contrived example: ```js const client = new pg.Client() client.connect() client.on('error', (err) => { console.error('something bad has happened!', err.stack) }) // walk over to server, unplug network cable // process output: 'something bad has happened!' followed by stacktrace :P ``` ### end ```ts client.on('end') => void ``` When the client disconnects from the PostgreSQL server it will emit an end event once. ### notification Used for `listen/notify` events: ```ts type Notification { processId: number, channel: string, payload?: string } ``` ```js const client = new pg.Client() await client.connect() client.query('LISTEN foo') client.on('notification', (msg) => { console.log(msg.channel) // foo console.log(msg.payload) // bar! }) client.query(`NOTIFY foo, 'bar!'`) ``` ### notice ```ts client.on('notice', (notice: Error) => void) => void ``` Used to log out [notice messages](https://www.postgresql.org/docs/9.6/static/plpgsql-errors-and-messages.html) from the PostgreSQL server. ```js client.on('notice', (msg) => console.warn('notice:', msg)) ``` node-postgres-pg-8.14.1/docs/pages/apis/cursor.mdx000066400000000000000000000044611476604072200220310ustar00rootroot00000000000000--- title: pg.Cursor slug: /apis/cursor --- A cursor can be used to efficiently read through large result sets without loading the entire result-set into memory ahead of time. It's useful to simulate a 'streaming' style read of data, or exit early from a large result set. The cursor is passed to `client.query` and is dispatched internally in a way very similar to how normal queries are sent, but the API it presents for consuming the result set is different. ## install ``` $ npm install pg pg-cursor ``` ## constructor ### `new Cursor(text: String, values: Any[][, config: CursorQueryConfig])` Instantiates a new Cursor. A cursor is an instance of `Submittable` and should be passed directly to the `client.query` method. ```js import pg from 'pg' const { Pool } = pg import Cursor from 'pg-cursor' const pool = new Pool() const client = await pool.connect() const text = 'SELECT * FROM my_large_table WHERE something > $1' const values = [10] const cursor = client.query(new Cursor(text, values)) cursor.read(100, (err, rows) => { cursor.close(() => { client.release() }) }) ``` ```ts type CursorQueryConfig { // by default rows come out as a key/value pair for each row // pass the string 'array' here to receive rows as an array of values rowMode?: string; // custom type parsers just for this query result types?: Types; } ``` ## read ### `cursor.read(rowCount: Number) => Promise` Read `rowCount` rows from the cursor instance. The callback will be called when the rows are available, loaded into memory, parsed, and converted to JavaScript types. If the cursor has read to the end of the result sets all subsequent calls to cursor#read will return a 0 length array of rows. Calling `read` on a cursor that has read to the end. Here is an example of reading to the end of a cursor: ```js import pg from 'pg' const { Pool } = pg import Cursor from 'pg-cursor' const pool = new Pool() const client = await pool.connect() const cursor = client.query(new Cursor('select * from generate_series(0, 5)')) let rows = await cursor.read(100) assert(rows.length == 6) rows = await cursor.read(100) assert(rows.length == 0) ``` ## close ### `cursor.close() => Promise` Used to close the cursor early. If you want to stop reading from the cursor before you get all of the rows returned, call this. node-postgres-pg-8.14.1/docs/pages/apis/pool.mdx000066400000000000000000000177351476604072200214750ustar00rootroot00000000000000--- title: pg.Pool --- import { Alert } from '/components/alert.tsx' ## new Pool ```ts new Pool(config: Config) ``` Constructs a new pool instance. The pool is initially created empty and will create new clients lazily as they are needed. Every field of the `config` object is entirely optional. The config passed to the pool is also passed to every client instance within the pool when the pool creates that client. ```ts type Config = { // all valid client config options are also valid here // in addition here are the pool specific configuration parameters: // number of milliseconds to wait before timing out when connecting a new client // by default this is 0 which means no timeout connectionTimeoutMillis?: number // number of milliseconds a client must sit idle in the pool and not be checked out // before it is disconnected from the backend and discarded // default is 10000 (10 seconds) - set to 0 to disable auto-disconnection of idle clients idleTimeoutMillis?: number // maximum number of clients the pool should contain // by default this is set to 10. max?: number // Default behavior is the pool will keep clients open & connected to the backend // until idleTimeoutMillis expire for each client and node will maintain a ref // to the socket on the client, keeping the event loop alive until all clients are closed // after being idle or the pool is manually shutdown with `pool.end()`. // // Setting `allowExitOnIdle: true` in the config will allow the node event loop to exit // as soon as all clients in the pool are idle, even if their socket is still open // to the postgres server. This can be handy in scripts & tests // where you don't want to wait for your clients to go idle before your process exits. allowExitOnIdle?: boolean } ``` example to create a new pool with configuration: ```js import pg from 'pg' const { Pool } = pg const pool = new Pool({ host: 'localhost', user: 'database-user', max: 20, idleTimeoutMillis: 30000, connectionTimeoutMillis: 2000, }) ``` ## pool.query Often we only need to run a single query on the database, so as convenience the pool has a method to run a query on the first available idle client and return its result. ```ts pool.query(text: string, values?: any[]) => Promise ``` ```js import pg from 'pg' const { Pool } = pg const pool = new Pool() const result = await pool.query('SELECT $1::text as name', ['brianc']) console.log(result.rows[0].name) // brianc ``` Notice in the example above there is no need to check out or release a client. The pool is doing the acquiring and releasing internally. I find `pool.query` to be a handy shortcut many situations and use it exclusively unless I need a transaction.
Do not use pool.query if you are using a transaction.
The pool will dispatch every query passed to pool.query on the first available idle client. Transactions within PostgreSQL are scoped to a single client and so dispatching individual queries within a single transaction across multiple, random clients will cause big problems in your app and not work. For more info please read transactions .
## pool.connect `pool.connect() => Promise` Acquires a client from the pool. - If there are idle clients in the pool one will be returned to the callback on `process.nextTick`. - If the pool is not full but all current clients are checked out a new client will be created & returned to this callback. - If the pool is 'full' and all clients are currently checked out will wait in a FIFO queue until a client becomes available by it being released back to the pool. ```js import pg from 'pg' const { Pool } = pg const pool = new Pool() const client = await pool.connect() await client.query('SELECT NOW()') client.release() ``` ### releasing clients `client.release(destroy?: boolean) => void` Client instances returned from `pool.connect` will have a `release` method which will release them from the pool. The `release` method on an acquired client returns it back to the pool. If you pass a truthy value in the `destroy` parameter, instead of releasing the client to the pool, the pool will be instructed to disconnect and destroy this client, leaving a space within itself for a new client. ```js import pg from 'pg' const { Pool } = pg const pool = new Pool() // check out a single client const client = await pool.connect() // release the client client.release() ``` ```js import pg from 'pg' const { Pool } = pg const pool = new Pool() assert(pool.totalCount === 0) assert(pool.idleCount === 0) const client = await pool.connect() await client.query('SELECT NOW()') assert(pool.totalCount === 1) assert(pool.idleCount === 0) // tell the pool to destroy this client await client.release(true) assert(pool.idleCount === 0) assert(pool.totalCount === 0) ```
You must release a client when you are finished with it.
If you forget to release the client then your application will quickly exhaust available, idle clients in the pool and all further calls to pool.connect will timeout with an error or hang indefinitely if you have connectionTimeoutMillis configured to 0.
## pool.end Calling `pool.end` will drain the pool of all active clients, disconnect them, and shut down any internal timers in the pool. It is common to call this at the end of a script using the pool or when your process is attempting to shut down cleanly. ```js // again both promises and callbacks are supported: import pg from 'pg' const { Pool } = pg const pool = new Pool() await pool.end() ``` ## properties `pool.totalCount: number` The total number of clients existing within the pool. `pool.idleCount: number` The number of clients which are not checked out but are currently idle in the pool. `pool.waitingCount: number` The number of queued requests waiting on a client when all clients are checked out. It can be helpful to monitor this number to see if you need to adjust the size of the pool. ## events `Pool` instances are also instances of [`EventEmitter`](https://nodejs.org/api/events.html). ### connect `pool.on('connect', (client: Client) => void) => void` Whenever the pool establishes a new client connection to the PostgreSQL backend it will emit the `connect` event with the newly connected client. This presents an opportunity for you to run setup commands on a client. ```js const pool = new Pool() pool.on('connect', (client) => { client.query('SET DATESTYLE = iso, mdy') }) ``` ### acquire `pool.on('acquire', (client: Client) => void) => void` Whenever a client is checked out from the pool the pool will emit the `acquire` event with the client that was acquired. ### error `pool.on('error', (err: Error, client: Client) => void) => void` When a client is sitting idly in the pool it can still emit errors because it is connected to a live backend. If the backend goes down or a network partition is encountered all the idle, connected clients in your application will emit an error _through_ the pool's error event emitter. The error listener is passed the error as the first argument and the client upon which the error occurred as the 2nd argument. The client will be automatically terminated and removed from the pool, it is only passed to the error handler in case you want to inspect it.
You probably want to add an event listener to the pool to catch background errors!
Just like other event emitters, if a pool emits an error event and no listeners are added node will emit an uncaught error and potentially crash your node process.
### release `pool.on('release', (err: Error, client: Client) => void) => void` Whenever a client is released back into the pool, the pool will emit the `release` event. ### remove `pool.on('remove', (client: Client) => void) => void` Whenever a client is closed & removed from the pool the pool will emit the `remove` event. node-postgres-pg-8.14.1/docs/pages/apis/result.mdx000066400000000000000000000054511476604072200220320ustar00rootroot00000000000000--- title: pg.Result slug: /apis/result --- The `pg.Result` shape is returned for every successful query.
note: you cannot instantiate this directly
## properties ### `result.rows: Array` Every result will have a rows array. If no rows are returned the array will be empty. Otherwise the array will contain one item for each row returned from the query. By default node-postgres creates a map from the name to value of each column, giving you a json-like object back for each row. ### `result.fields: Array` Every result will have a fields array. This array contains the `name` and `dataTypeID` of each field in the result. These fields are ordered in the same order as the columns if you are using `arrayMode` for the query: ```js import pg from 'pg' const { Pool } = pg const pool = new Pool() const client = await pool.connect() const result = await client.query({ rowMode: 'array', text: 'SELECT 1 as one, 2 as two;', }) console.log(result.fields[0].name) // one console.log(result.fields[1].name) // two console.log(result.rows) // [ [ 1, 2 ] ] await client.end() ``` ### `result.command: string` The command type last executed: `INSERT` `UPDATE` `CREATE` `SELECT` etc. ### `result.rowCount: int | null` The number of rows processed by the last command. Can be `null` for commands that never affect rows, such as the `LOCK`-command. More specifically, some commands, including `LOCK`, only return a command tag of the form `COMMAND`, without any `[ROWS]`-field to parse. For such commands `rowCount` will be `null`. _note: this does not reflect the number of rows __returned__ from a query. e.g. an update statement could update many rows (so high `result.rowCount` value) but `result.rows.length` would be zero. To check for an empty query response on a `SELECT` query use `result.rows.length === 0`_. [@sehrope](https://github.com/brianc/node-postgres/issues/2182#issuecomment-620553915) has a good explanation: The `rowCount` is populated from the command tag supplied by the PostgreSQL server. It's generally of the form: `COMMAND [OID] [ROWS]` For DML commands (INSERT, UPDATE, etc), it reflects how many rows the server modified to process the command. For SELECT or COPY commands it reflects how many rows were retrieved or copied. More info on the specifics here: https://www.postgresql.org/docs/current/protocol-message-formats.html (search for CommandComplete for the message type) The note in the docs about the difference is because that value is controlled by the server. It's possible for a non-standard server (ex: PostgreSQL fork) or a server version in the future to provide different information in some situations so it'd be best not to rely on it to assume that the rows array length matches the `rowCount`. It's fine to use it for DML counts though. node-postgres-pg-8.14.1/docs/pages/apis/types.mdx000066400000000000000000000002261476604072200216530ustar00rootroot00000000000000--- title: Types slug: /apis/types --- These docs are incomplete, for now please reference [pg-types docs](https://github.com/brianc/node-pg-types). node-postgres-pg-8.14.1/docs/pages/apis/utilities.mdx000066400000000000000000000027141476604072200225260ustar00rootroot00000000000000--- title: Utilities --- import { Alert } from '/components/alert.tsx' ## Utility Functions ### pg.escapeIdentifier Escapes a string as a [SQL identifier](https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS). ```js const { escapeIdentifier } = require('pg') const escapedIdentifier = escapeIdentifier('FooIdentifier') console.log(escapedIdentifier) // '"FooIdentifier"' ``` **Note**: When using an identifier that is the result of this function in an operation like `CREATE TABLE ${escapedIdentifier(identifier)}`, the table that is created will be CASE SENSITIVE. If you use any capital letters in the escaped identifier, you must always refer to the created table like `SELECT * from "MyCaseSensitiveTable"`; queries like `SELECT * FROM MyCaseSensitiveTable` will result in a "Non-existent table" error since case information is stripped from the query. ### pg.escapeLiteral **Note**: Instead of manually escaping SQL literals, it is recommended to use parameterized queries. Refer to [parameterized queries](/features/queries#parameterized-query) and the [client.query](/apis/client#clientquery) API for more information. Escapes a string as a [SQL literal](https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-CONSTANTS). ```js const { escapeLiteral } = require('pg') const escapedLiteral = escapeLiteral("hello 'world'") console.log(escapedLiteral) // "'hello ''world'''" ``` node-postgres-pg-8.14.1/docs/pages/features/000077500000000000000000000000001476604072200206575ustar00rootroot00000000000000node-postgres-pg-8.14.1/docs/pages/features/_meta.json000066400000000000000000000002621476604072200226370ustar00rootroot00000000000000{ "connecting": "Connecting", "queries": "Queries", "pooling": "Pooling", "transactions": "Transactions", "types": "Data Types", "ssl": "SSL", "native": "Native" } node-postgres-pg-8.14.1/docs/pages/features/connecting.mdx000066400000000000000000000102661476604072200235250ustar00rootroot00000000000000--- title: Connecting --- ## Environment variables node-postgres uses the same [environment variables](https://www.postgresql.org/docs/9.1/static/libpq-envars.html) as libpq and psql to connect to a PostgreSQL server. Both individual clients & pools will use these environment variables. Here's a tiny program connecting node.js to the PostgreSQL server: ```js import pg from 'pg' const { Pool, Client } = pg // pools will use environment variables // for connection information const pool = new Pool() // you can also use async/await const res = await pool.query('SELECT NOW()') await pool.end() // clients will also use environment variables // for connection information const client = new Client() await client.connect() const res = await client.query('SELECT NOW()') await client.end() ``` To run the above program and specify which database to connect to we can invoke it like so: ```sh $ PGUSER=dbuser \ PGPASSWORD=secretpassword \ PGHOST=database.server.com \ PGPORT=3211 \ PGDATABASE=mydb \ node script.js ``` This allows us to write our programs without having to specify connection information in the program and lets us reuse them to connect to different databases without having to modify the code. The default values for the environment variables used are: ``` PGUSER=process.env.USER PGPASSWORD=null PGHOST=localhost PGPORT=5432 PGDATABASE=process.env.USER ``` ## Programmatic node-postgres also supports configuring a pool or client programmatically with connection information. Here's our same script from above modified to use programmatic (hard-coded in this case) values. This can be useful if your application already has a way to manage config values or you don't want to use environment variables. ```js import pg from 'pg' const { Pool, Client } = pg const pool = new Pool({ user: 'dbuser', password: 'secretpassword', host: 'database.server.com', port: 3211, database: 'mydb', }) console.log(await pool.query('SELECT NOW()')) const client = new Client({ user: 'dbuser', password: 'secretpassword', host: 'database.server.com', port: 3211, database: 'mydb', }) await client.connect() console.log(await client.query('SELECT NOW()')) await client.end() ``` Many cloud providers include alternative methods for connecting to database instances using short-lived authentication tokens. node-postgres supports dynamic passwords via a callback function, either synchronous or asynchronous. The callback function must resolve to a string. ```js import pg from 'pg' const { Pool } = pg import { RDS } from 'aws-sdk' const signerOptions = { credentials: { accessKeyId: 'YOUR-ACCESS-KEY', secretAccessKey: 'YOUR-SECRET-ACCESS-KEY', }, region: 'us-east-1', hostname: 'example.aslfdewrlk.us-east-1.rds.amazonaws.com', port: 5432, username: 'api-user', } const signer = new RDS.Signer() const getPassword = () => signer.getAuthToken(signerOptions) const pool = new Pool({ user: signerOptions.username, password: getPassword, host: signerOptions.hostname, port: signerOptions.port, database: 'my-db', }) ``` ### Unix Domain Sockets Connections to unix sockets can also be made. This can be useful on distros like Ubuntu, where authentication is managed via the socket connection instead of a password. ```js import pg from 'pg' const { Client } = pg client = new Client({ user: 'username', password: 'password', host: '/cloudsql/myproject:zone:mydb', database: 'database_name', }) ``` ## Connection URI You can initialize both a pool and a client with a connection string URI as well. This is common in environments like Heroku where the database connection string is supplied to your application dyno through an environment variable. Connection string parsing brought to you by [pg-connection-string](https://github.com/brianc/node-postgres/tree/master/packages/pg-connection-string). ```js import pg from 'pg' const { Pool, Client } = pg const connectionString = 'postgresql://dbuser:secretpassword@database.server.com:3211/mydb' const pool = new Pool({ connectionString, }) await pool.query('SELECT NOW()') await pool.end() const client = new Client({ connectionString, }) await client.connect() await client.query('SELECT NOW()') await client.end() ``` node-postgres-pg-8.14.1/docs/pages/features/native.mdx000066400000000000000000000034231476604072200226610ustar00rootroot00000000000000--- title: Native Bindings slug: /features/native metaTitle: bar --- Native bindings between node.js & [libpq](https://www.postgresql.org/docs/9.5/static/libpq.html) are provided by the [node-pg-native](https://github.com/brianc/node-pg-native) package. node-postgres can consume this package & use the native bindings to access the PostgreSQL server while giving you the same interface that is used with the JavaScript version of the library. To use the native bindings first you'll need to install them: ```sh $ npm install pg pg-native ``` Once `pg-native` is installed instead of requiring a `Client` or `Pool` constructor from `pg` you do the following: ```js import pg from 'pg' const { native } = pg const { Client, Pool } = native ``` When you access the `.native` property on `'pg'` it will automatically require the `pg-native` package and wrap it in the same API.
Care has been taken to normalize between the two, but there might still be edge cases where things behave subtly differently due to the nature of using libpq over handling the binary protocol directly in JavaScript, so it's recommended you chose to either use the JavaScript driver or the native bindings both in development and production. For what its worth: I use the pure JavaScript driver because the JavaScript driver is more portable (doesn't need a compiler), and the pure JavaScript driver is plenty fast.
Some of the modules using advanced features of PostgreSQL such as [pg-query-stream](https://github.com/brianc/node-pg-query-stream), [pg-cursor](https://github.com/brianc/node-pg-cursor),and [pg-copy-streams](https://github.com/brianc/node-pg-copy-streams) need to operate directly on the binary stream and therefore are incompatible with the native bindings. node-postgres-pg-8.14.1/docs/pages/features/pooling.mdx000066400000000000000000000077631476604072200230550ustar00rootroot00000000000000--- title: Pooling --- import { Alert } from '/components/alert.tsx' import { Info } from '/components/info.tsx' If you're working on a web application or other software which makes frequent queries you'll want to use a connection pool. The easiest and by far most common way to use node-postgres is through a connection pool. ## Why? - Connecting a new client to the PostgreSQL server requires a handshake which can take 20-30 milliseconds. During this time passwords are negotiated, SSL may be established, and configuration information is shared with the client & server. Incurring this cost _every time_ we want to execute a query would substantially slow down our application. - The PostgreSQL server can only handle a [limited number of clients at a time](https://wiki.postgresql.org/wiki/Number_Of_Database_Connections). Depending on the available memory of your PostgreSQL server you may even crash the server if you connect an unbounded number of clients. _note: I have crashed a large production PostgreSQL server instance in RDS by opening new clients and never disconnecting them in a python application long ago. It was not fun._ - PostgreSQL can only process one query at a time on a single connected client in a first-in first-out manner. If your multi-tenant web application is using only a single connected client all queries among all simultaneous requests will be pipelined and executed serially, one after the other. No good! ### Good news node-postgres ships with built-in connection pooling via the [pg-pool](/apis/pool) module. ## Examples The client pool allows you to have a reusable pool of clients you can check out, use, and return. You generally want a limited number of these in your application and usually just 1. Creating an unbounded number of pools defeats the purpose of pooling at all. ### Checkout, use, and return ```js import pg from 'pg' const { Pool } = pg const pool = new Pool() // the pool will emit an error on behalf of any idle clients // it contains if a backend error or network partition happens pool.on('error', (err, client) => { console.error('Unexpected error on idle client', err) process.exit(-1) }) const client = await pool.connect() const res = await client.query('SELECT * FROM users WHERE id = $1', [1]) console.log(res.rows[0]) client.release() ```
You must always return the client to the pool if you successfully check it out, regardless of whether or not there was an error with the queries you ran on the client.
If you don't release the client your application will leak them and eventually your pool will be empty forever and all future requests to check out a client from the pool will wait forever.
### Single query If you don't need a transaction or you just need to run a single query, the pool has a convenience method to run a query on any available client in the pool. This is the preferred way to query with node-postgres if you can as it removes the risk of leaking a client. ```js import pg from 'pg' const { Pool } = pg const pool = new Pool() const res = await pool.query('SELECT * FROM users WHERE id = $1', [1]) console.log('user:', res.rows[0]) ``` ### Shutdown To shut down a pool call `pool.end()` on the pool. This will wait for all checked-out clients to be returned and then shut down all the clients and the pool timers. ```js import pg from 'pg' const { Pool } = pg const pool = new Pool() console.log('starting async query') const result = await pool.query('SELECT NOW()') console.log('async query finished') console.log('starting callback query') pool.query('SELECT NOW()', (err, res) => { console.log('callback query finished') }) console.log('calling end') await pool.end() console.log('pool has drained') ``` The output of the above will be: ``` starting async query async query finished starting callback query calling end callback query finished pool has drained ``` The pool will return errors when attempting to check out a client after you've called pool.end() on the pool. node-postgres-pg-8.14.1/docs/pages/features/queries.mdx000066400000000000000000000133471476604072200230560ustar00rootroot00000000000000--- title: Queries slug: /features/queries --- For the sake of brevity I am using the `client.query` method instead of the `pool.query` method - both methods support the same API. In fact, `pool.query` delegates directly to `client.query` internally. ## Text only If your query has no parameters you do not need to include them to the query method: ```js await client.query('SELECT NOW() as now') ``` ## Parameterized query If you are passing parameters to your queries you will want to avoid string concatenating parameters into the query text directly. This can (and often does) lead to sql injection vulnerabilities. node-postgres supports parameterized queries, passing your query text _unaltered_ as well as your parameters to the PostgreSQL server where the parameters are safely substituted into the query with battle-tested parameter substitution code within the server itself. ```js const text = 'INSERT INTO users(name, email) VALUES($1, $2) RETURNING *' const values = ['brianc', 'brian.m.carlson@gmail.com'] const res = await client.query(text, values) console.log(res.rows[0]) // { name: 'brianc', email: 'brian.m.carlson@gmail.com' } ```
PostgreSQL does not support parameters for identifiers. If you need to have dynamic database, schema, table, or column names (e.g. in DDL statements) use [pg-format](https://www.npmjs.com/package/pg-format) package for handling escaping these values to ensure you do not have SQL injection!
Parameters passed as the second argument to `query()` will be converted to raw data types using the following rules: **null and undefined** If parameterizing `null` and `undefined` then both will be converted to `null`. **Date** Custom conversion to a UTC date string. **Buffer** Buffer instances are unchanged. **Array** Converted to a string that describes a Postgres array. Each array item is recursively converted using the rules described here. **Object** If a parameterized value has the method `toPostgres` then it will be called and its return value will be used in the query. The signature of `toPostgres` is the following: ``` toPostgres (prepareValue: (value) => any): any ``` The `prepareValue` function provided can be used to convert nested types to raw data types suitable for the database. Otherwise if no `toPostgres` method is defined then `JSON.stringify` is called on the parameterized value. **Everything else** All other parameterized values will be converted by calling `value.toString` on the value. ## Query config object `pool.query` and `client.query` both support taking a config object as an argument instead of taking a string and optional array of parameters. The same example above could also be performed like so: ```js const query = { text: 'INSERT INTO users(name, email) VALUES($1, $2)', values: ['brianc', 'brian.m.carlson@gmail.com'], } const res = await client.query(query) console.log(res.rows[0]) ``` The query config object allows for a few more advanced scenarios: ### Prepared statements PostgreSQL has the concept of a [prepared statement](https://www.postgresql.org/docs/9.3/static/sql-prepare.html). node-postgres supports this by supplying a `name` parameter to the query config object. If you supply a `name` parameter the query execution plan will be cached on the PostgreSQL server on a **per connection basis**. This means if you use two different connections each will have to parse & plan the query once. node-postgres handles this transparently for you: a client only requests a query to be parsed the first time that particular client has seen that query name: ```js const query = { // give the query a unique name name: 'fetch-user', text: 'SELECT * FROM user WHERE id = $1', values: [1], } const res = await client.query(query) console.log(res.rows[0]) ``` In the above example the first time the client sees a query with the name `'fetch-user'` it will send a 'parse' request to the PostgreSQL server & execute the query as normal. The second time, it will skip the 'parse' request and send the _name_ of the query to the PostgreSQL server.
Be careful not to fall into the trap of premature optimization. Most of your queries will likely not benefit much, if at all, from using prepared statements. This is a somewhat "power user" feature of PostgreSQL that is best used when you know how to use it - namely with very complex queries with lots of joins and advanced operations like union and switch statements. I rarely use this feature in my own apps unless writing complex aggregate queries for reports and I know the reports are going to be executed very frequently.
### Row mode By default node-postgres reads rows and collects them into JavaScript objects with the keys matching the column names and the values matching the corresponding row value for each column. If you do not need or do not want this behavior you can pass `rowMode: 'array'` to a query object. This will inform the result parser to bypass collecting rows into a JavaScript object, and instead will return each row as an array of values. ```js const query = { text: 'SELECT $1::text as first_name, $2::text as last_name', values: ['Brian', 'Carlson'], rowMode: 'array', } const res = await client.query(query) console.log(res.fields.map(field => field.name)) // ['first_name', 'last_name'] console.log(res.rows[0]) // ['Brian', 'Carlson'] ``` ### Types You can pass in a custom set of type parsers to use when parsing the results of a particular query. The `types` property must conform to the [Types](/apis/types) API. Here is an example in which every value is returned as a string: ```js const query = { text: 'SELECT * from some_table', types: { getTypeParser: () => val => val, }, } ``` node-postgres-pg-8.14.1/docs/pages/features/ssl.mdx000066400000000000000000000042731476604072200222000ustar00rootroot00000000000000--- title: SSL slug: /features/ssl --- node-postgres supports TLS/SSL connections to your PostgreSQL server as long as the server is configured to support it. When instantiating a pool or a client you can provide an `ssl` property on the config object and it will be passed to the constructor for the [node TLSSocket](https://nodejs.org/api/tls.html#tls_class_tls_tlssocket). ## Self-signed cert Here's an example of a configuration you can use to connect a client or a pool to a PostgreSQL server. ```js const config = { database: 'database-name', host: 'host-or-ip', // this object will be passed to the TLSSocket constructor ssl: { rejectUnauthorized: false, ca: fs.readFileSync('/path/to/server-certificates/root.crt').toString(), key: fs.readFileSync('/path/to/client-key/postgresql.key').toString(), cert: fs.readFileSync('/path/to/client-certificates/postgresql.crt').toString(), }, } import pg from 'pg' const { Client, Pool } = pg const client = new Client(config) await client.connect() console.log('connected') await client.end() const pool = new Pool(config) const pooledClient = await pool.connect() console.log('connected') pooledClient.release() await pool.end() ``` ## Usage with `connectionString` If you plan to use a combination of a database connection string from the environment and SSL settings in the config object directly, then you must avoid including any of `sslcert`, `sslkey`, `sslrootcert`, or `sslmode` in the connection string. If any of these options are used then the `ssl` object is replaced and any additional options provided there will be lost. ```js const config = { connectionString: 'postgres://user:password@host:port/db?sslmode=require', // Beware! The ssl object is overwritten when parsing the connectionString ssl: { rejectUnauthorized: false, ca: fs.readFileSync('/path/to/server-certificates/root.crt').toString(), }, } ``` ## Channel binding If the PostgreSQL server offers SCRAM-SHA-256-PLUS (i.e. channel binding) for TLS/SSL connections, you can enable this as follows: ```js const client = new Client({ ...config, enableChannelBinding: true}) ``` or ```js const pool = new Pool({ ...config, enableChannelBinding: true}) ``` node-postgres-pg-8.14.1/docs/pages/features/transactions.mdx000066400000000000000000000025511476604072200241040ustar00rootroot00000000000000--- title: Transactions --- import { Alert } from '/components/alert.tsx' To execute a transaction with node-postgres you simply execute `BEGIN / COMMIT / ROLLBACK` queries yourself through a client. Because node-postgres strives to be low level and un-opinionated, it doesn't provide any higher level abstractions specifically around transactions. You must use the same client instance for all statements within a transaction. PostgreSQL isolates a transaction to individual clients. This means if you initialize or use transactions with the{' '} pool.query method you will have problems. Do not use transactions with the pool.query method. ## Examples ```js import pg from 'pg' const { Pool } = pg const pool = new Pool() const client = await pool.connect() try { await client.query('BEGIN') const queryText = 'INSERT INTO users(name) VALUES($1) RETURNING id' const res = await client.query(queryText, ['brianc']) const insertPhotoText = 'INSERT INTO photos(user_id, photo_url) VALUES ($1, $2)' const insertPhotoValues = [res.rows[0].id, 's3.bucket.foo'] await client.query(insertPhotoText, insertPhotoValues) await client.query('COMMIT') } catch (e) { await client.query('ROLLBACK') throw e } finally { client.release() } ``` node-postgres-pg-8.14.1/docs/pages/features/types.mdx000066400000000000000000000102421476604072200225340ustar00rootroot00000000000000--- title: Data Types --- import { Alert } from '/components/alert.tsx' PostgreSQL has a rich system of supported [data types](https://www.postgresql.org/docs/current/datatype.html). node-postgres does its best to support the most common data types out of the box and supplies an extensible type parser to allow for custom type serialization and parsing. ## strings by default node-postgres will convert a database type to a JavaScript string if it doesn't have a registered type parser for the database type. Furthermore, you can send any type to the PostgreSQL server as a string and node-postgres will pass it through without modifying it in any way. To circumvent the type parsing completely do something like the following. ```js const queryText = 'SELECT int_col::text, date_col::text, json_col::text FROM my_table' const result = await client.query(queryText) console.log(result.rows[0]) // will contain the unparsed string value of each column ``` ## type parsing examples ### uuid + json / jsonb There is no data type in JavaScript for a uuid/guid so node-postgres converts a uuid to a string. JavaScript has great support for JSON and node-postgres converts json/jsonb objects directly into their JavaScript object via [`JSON.parse`](https://github.com/brianc/node-pg-types/blob/master/lib/textParsers.js#L193). Likewise sending an object to the PostgreSQL server via a query from node-postgres, node-postgres will call [`JSON.stringify`](https://github.com/brianc/node-postgres/blob/e5f0e5d36a91a72dda93c74388ac890fa42b3be0/lib/utils.js#L47) on your outbound value, automatically converting it to json for the server. ```js const createTableText = ` CREATE EXTENSION IF NOT EXISTS "pgcrypto"; CREATE TEMP TABLE IF NOT EXISTS users ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), data JSONB ); ` // create our temp table await client.query(createTableText) const newUser = { email: 'brian.m.carlson@gmail.com' } // create a new user await client.query('INSERT INTO users(data) VALUES($1)', [newUser]) const { rows } = await client.query('SELECT * FROM users') console.log(rows) /* output: [{ id: 'd70195fd-608e-42dc-b0f5-eee975a621e9', data: { email: 'brian.m.carlson@gmail.com' } }] */ ``` ### date / timestamp / timestamptz node-postgres will convert instances of JavaScript date objects into the expected input value for your PostgreSQL server. Likewise, when reading a `date`, `timestamp`, or `timestamptz` column value back into JavaScript, node-postgres will parse the value into an instance of a JavaScript `Date` object. ```js const createTableText = ` CREATE TEMP TABLE dates( date_col DATE, timestamp_col TIMESTAMP, timestamptz_col TIMESTAMPTZ ); ` // create our temp table await client.query(createTableText) // insert the current time into it const now = new Date() const insertText = 'INSERT INTO dates(date_col, timestamp_col, timestamptz_col) VALUES ($1, $2, $3)' await client.query(insertText, [now, now, now]) // read the row back out const result = await client.query('SELECT * FROM dates') console.log(result.rows) // { // date_col: 2017-05-29T05:00:00.000Z, // timestamp_col: 2017-05-29T23:18:13.263Z, // timestamptz_col: 2017-05-29T23:18:13.263Z // } ``` psql output: ``` bmc=# select * from dates; date_col | timestamp_col | timestamptz_col ------------+-------------------------+---------------------------- 2017-05-29 | 2017-05-29 18:18:13.263 | 2017-05-29 18:18:13.263-05 (1 row) ``` node-postgres converts `DATE` and `TIMESTAMP` columns into the **local** time of the node process set at `process.env.TZ`. _note: I generally use `TIMESTAMPTZ` when storing dates; otherwise, inserting a time from a process in one timezone and reading it out in a process in another timezone can cause unexpected differences in the time._
Although PostgreSQL supports microseconds in dates, JavaScript only supports dates to the millisecond precision. Keep this in mind when you send dates to and from PostgreSQL from node: your microseconds will be truncated when converting to a JavaScript date object even if they exist in the database. If you need to preserve them, I recommend using a custom type parser.
node-postgres-pg-8.14.1/docs/pages/guides/000077500000000000000000000000001476604072200203215ustar00rootroot00000000000000node-postgres-pg-8.14.1/docs/pages/guides/_meta.json000066400000000000000000000002011476604072200222720ustar00rootroot00000000000000{ "project-structure": "Suggested Code Structure", "async-express": "Express with Async/Await", "upgrading": "Upgrading" } node-postgres-pg-8.14.1/docs/pages/guides/async-express.md000066400000000000000000000044251476604072200234540ustar00rootroot00000000000000--- title: Express with async/await --- My preferred way to use node-postgres (and all async code in node.js) is with `async/await`. I find it makes reasoning about control-flow easier and allows me to write more concise and maintainable code. This is how I typically structure express web-applications with node-postgres to use `async/await`: ``` - app.js - index.js - routes/ - index.js - photos.js - user.js - db/ - index.js <--- this is where I put data access code ``` That's the same structure I used in the [project structure](/guides/project-structure) example. My `db/index.js` file usually starts out like this: ```js import pg from 'pg' const { Pool } = pg const pool = new Pool() export const query = (text, params) => pool.query(text, params) ``` Then I will install [express-promise-router](https://www.npmjs.com/package/express-promise-router) and use it to define my routes. Here is my `routes/user.js` file: ```js import Router from 'express-promise-router' import db from '../db.js' // create a new express-promise-router // this has the same API as the normal express router except // it allows you to use async functions as route handlers const router = new Router() // export our router to be mounted by the parent application export default router router.get('/:id', async (req, res) => { const { id } = req.params const { rows } = await db.query('SELECT * FROM users WHERE id = $1', [id]) res.send(rows[0]) }) ``` Then in my `routes/index.js` file I'll have something like this which mounts each individual router into the main application: ```js // ./routes/index.js import users from './user.js' import photos from './photos.js' const mountRoutes = (app) => { app.use('/users', users) app.use('/photos', photos) // etc.. } export default mountRoutes ``` And finally in my `app.js` file where I bootstrap express I will have my `routes/index.js` file mount all my routes. The routes know they're using async functions but because of express-promise-router the main express app doesn't know and doesn't care! ```js // ./app.js import express from 'express' import mountRoutes from './routes.js' const app = express() mountRoutes(app) // ... more express setup stuff can follow ``` Now you've got `async/await`, node-postgres, and express all working together! node-postgres-pg-8.14.1/docs/pages/guides/project-structure.md000066400000000000000000000120371476604072200243520ustar00rootroot00000000000000--- title: Suggested Project Structure --- Whenever I am writing a project & using node-postgres I like to create a file within it and make all interactions with the database go through this file. This serves a few purposes: - Allows my project to adjust to any changes to the node-postgres API without having to trace down all the places I directly use node-postgres in my application. - Allows me to have a single place to put logging and diagnostics around my database. - Allows me to make custom extensions to my database access code & share it throughout the project. - Allows a single place to bootstrap & configure the database. ## example The location doesn't really matter - I've found it usually ends up being somewhat app specific and in line with whatever folder structure conventions you're using. For this example I'll use an express app structured like so: ``` - app.js - index.js - routes/ - index.js - photos.js - user.js - db/ - index.js <--- this is where I put data access code ``` Typically I'll start out my `db/index.js` file like so: ```js import pg from 'pg' const { Pool } = pg const pool = new Pool() export const query = (text, params, callback) => { return pool.query(text, params, callback) } ``` That's it. But now everywhere else in my application instead of requiring `pg` directly, I'll require this file. Here's an example of a route within `routes/user.js`: ```js // notice here I'm requiring my database adapter file // and not requiring node-postgres directly import * as db from '../db/index.js' app.get('/:id', async (req, res, next) => { const result = await db.query('SELECT * FROM users WHERE id = $1', [req.params.id]) res.send(result.rows[0]) }) // ... many other routes in this file ``` Imagine we have lots of routes scattered throughout many files under our `routes/` directory. We now want to go back and log every single query that's executed, how long it took, and the number of rows it returned. If we had required node-postgres directly in every route file we'd have to go edit every single route - that would take forever & be really error prone! But thankfully we put our data access into `db/index.js`. Let's go add some logging: ```js import pg from 'pg' const { Pool } = pg const pool = new Pool() export const query = async (text, params) => { const start = Date.now() const res = await pool.query(text, params) const duration = Date.now() - start console.log('executed query', { text, duration, rows: res.rowCount }) return res } ``` That was pretty quick! And now all of our queries everywhere in our application are being logged. _note: I didn't log the query parameters. Depending on your application you might be storing encrypted passwords or other sensitive information in your database. If you log your query parameters you might accidentally log sensitive information. Every app is different though so do what suits you best!_ Now what if we need to check out a client from the pool to run several queries in a row in a transaction? We can add another method to our `db/index.js` file when we need to do this: ```js import pg from 'pg' const { Pool } = pg const pool = new Pool() export const query = async (text, params) => { const start = Date.now() const res = await pool.query(text, params) const duration = Date.now() - start console.log('executed query', { text, duration, rows: res.rowCount }) return res } export const getClient = () => { return pool.connect() } ``` Okay. Great - the simplest thing that could possibly work. It seems like one of our routes that checks out a client to run a transaction is forgetting to call `release` in some situation! Oh no! We are leaking a client & have hundreds of these routes to go audit. Good thing we have all our client access going through this single file. Lets add some deeper diagnostic information here to help us track down where the client leak is happening. ```js export const query = async (text, params) => { const start = Date.now() const res = await pool.query(text, params) const duration = Date.now() - start console.log('executed query', { text, duration, rows: res.rowCount }) return res } export const getClient = async () => { const client = await pool.connect() const query = client.query const release = client.release // set a timeout of 5 seconds, after which we will log this client's last query const timeout = setTimeout(() => { console.error('A client has been checked out for more than 5 seconds!') console.error(`The last executed query on this client was: ${client.lastQuery}`) }, 5000) // monkey patch the query method to keep track of the last query executed client.query = (...args) => { client.lastQuery = args return query.apply(client, args) } client.release = () => { // clear our timeout clearTimeout(timeout) // set the methods back to their old un-monkey-patched version client.query = query client.release = release return release.apply(client) } return client } ``` That should hopefully give us enough diagnostic information to track down any leaks. node-postgres-pg-8.14.1/docs/pages/guides/upgrading.md000066400000000000000000000127541476604072200226340ustar00rootroot00000000000000--- title: Upgrading slug: /guides/upgrading --- # Upgrading to 8.0 node-postgres at 8.0 introduces a breaking change to ssl-verified connections. If you connect with ssl and use ``` const client = new Client({ ssl: true }) ``` and the server's SSL certificate is self-signed, connections will fail as of node-postgres 8.0. To keep the existing behavior, modify the invocation to ``` const client = new Client({ ssl: { rejectUnauthorized: false } }) ``` The rest of the changes are relatively minor and unlikely to cause issues; see [the announcement](/announcements#2020-02-25) for full details. # Upgrading to 7.0 node-postgres at 7.0 introduces somewhat significant breaking changes to the public API. ## node version support Starting with `pg@7.0` the earliest version of node supported will be `node@4.x LTS`. Support for `node@0.12.x` and `node@.10.x` is dropped, and the module wont work as it relies on new es6 features not available in older versions of node. ## pg singleton In the past there was a singleton pool manager attached to the root `pg` object in the package. This singleton could be used to provision connection pools automatically by calling `pg.connect`. This API caused a lot of confusion for users. It also introduced a opaque module-managed singleton which was difficult to reason about, debug, error-prone, and inflexible. Starting in pg@6.0 the methods' documentation was removed, and starting in pg@6.3 the methods were deprecated with a warning message. If your application still relies on these they will be _gone_ in `pg@7.0`. In order to migrate you can do the following: ```js // old way, deprecated in 6.3.0: // connection using global singleton pg.connect(function (err, client, done) { client.query(/* etc, etc */) done() }) // singleton pool shutdown pg.end() // ------------------ // new way, available since 6.0.0: // create a pool var pool = new pg.Pool() // connection using created pool pool.connect(function (err, client, done) { client.query(/* etc, etc */) done() }) // pool shutdown pool.end() ``` node-postgres ships with a built-in pool object provided by [pg-pool](https://github.com/brianc/node-pg-pool) which is already used internally by the `pg.connect` and `pg.end` methods. Migrating to a user-managed pool (or set of pools) allows you to more directly control their set up their life-cycle. ## client.query(...).on Before `pg@7.0` the `client.query` method would _always_ return an instance of a query. The query instance was an event emitter, accepted a callback, and was also a promise. A few problems... - too many flow control options on a single object was confusing - event emitter `.on('error')` does not mix well with promise `.catch` - the `row` event was a common source of errors: it looks like a stream but has no support for back-pressure, misleading users into trying to pipe results or handling them in the event emitter for a desired performance gain. - error handling with a `.done` and `.error` emitter pair for every query is cumbersome and returning the emitter from `client.query` indicated this sort of pattern may be encouraged: it is not. Starting with `pg@7.0` the return value `client.query` will be dependent on what you pass to the method: I think this aligns more with how most node libraries handle the callback/promise combo, and I hope it will make the "just works" :tm: feeling better while reducing surface area and surprises around event emitter / callback combos. ### client.query with a callback ```js const query = client.query('SELECT NOW()', (err, res) => { /* etc, etc */ }) assert(query === undefined) // true ``` If you pass a callback to the method `client.query` will return `undefined`. This limits flow control to the callback which is in-line with almost all of node's core APIs. ### client.query without a callback ```js const query = client.query('SELECT NOW()') assert(query instanceof Promise) // true assert(query.on === undefined) // true query.then((res) => /* etc, etc */) ``` If you do **not** pass a callback `client.query` will return an instance of a `Promise`. This will **not** be a query instance and will not be an event emitter. This is in line with how most promise-based APIs work in node. ### client.query(Submittable) `client.query` has always accepted any object that has a `.submit` method on it. In this scenario the client calls `.submit` on the object, delegating execution responsibility to it. In this situation the client also **returns the instance it was passed**. This is how [pg-cursor](https://github.com/brianc/node-pg-cursor) and [pg-query-stream](https://github.com/brianc/node-pg-query-stream) work. So, if you need the event emitter functionality on your queries for some reason, it is still possible because `Query` is an instance of `Submittable`: ```js import pg from 'pg' const { Client, Query } = pg const query = client.query(new Query('SELECT NOW()')) query.on('row', (row) => {}) query.on('end', (res) => {}) query.on('error', (res) => {}) ``` `Query` is considered a public, documented part of the API of node-postgres and this form will be supported indefinitely. _note: I have been building apps with node-postgres for almost 7 years. In that time I have never used the event emitter API as the primary way to execute queries. I used to use callbacks and now I use async/await. If you need to stream results I highly recommend you use [pg-cursor](https://github.com/brianc/node-pg-cursor) or [pg-query-stream](https://github.com/brianc/node-pg-query-stream) and **not** the query object as an event emitter._ node-postgres-pg-8.14.1/docs/pages/index.mdx000066400000000000000000000060261476604072200206660ustar00rootroot00000000000000--- title: Welcome slug: / --- node-postgres is a collection of node.js modules for interfacing with your PostgreSQL database. It has support for callbacks, promises, async/await, connection pooling, prepared statements, cursors, streaming results, C/C++ bindings, rich type parsing, and more! Just like PostgreSQL itself there are a lot of features: this documentation aims to get you up and running quickly and in the right direction. It also tries to provide guides for more advanced & edge-case topics allowing you to tap into the full power of PostgreSQL from node.js. ## Install ```bash $ npm install pg ``` ## Supporters node-postgres continued development and support is made possible by the many [supporters](https://github.com/brianc/node-postgres/blob/master/SPONSORS.md). If you or your company would like to sponsor node-postgres stop by [GitHub Sponsors](https://github.com/sponsors/brianc) and sign up or feel free to [email me](mailto:brian@pecanware.com) if you want to add your logo to the documentation or discuss higher tiers of sponsorship! # Version compatibility node-postgres strives to be compatible with all recent LTS versions of node & the most recent "stable" version. At the time of this writing node-postgres is compatible with node 8.x, 10.x, 12.x and 14.x To use node >= 14.x you will need to install `pg@8.2.x` or later due to some internal stream changes on the node 14 branch. Dropping support for an old node lts version will always be considered a breaking change in node-postgres and will be done on _major_ version number changes only, and we will try to keep support for 8.x for as long as reasonably possible. ## Getting started The simplest possible way to connect, query, and disconnect is with async/await: ```js import pg from 'pg' const { Client } = pg const client = new Client() await client.connect() const res = await client.query('SELECT $1::text as message', ['Hello world!']) console.log(res.rows[0].message) // Hello world! await client.end() ``` ### Error Handling For the sake of simplicity, these docs will assume that the methods are successful. In real life use, make sure to properly handle errors thrown in the methods. A `try/catch` block is a great way to do so: ```ts import pg from 'pg' const { Client } = pg const client = new Client() await client.connect() try { const res = await client.query('SELECT $1::text as message', ['Hello world!']) console.log(res.rows[0].message) // Hello world! } catch (err) { console.error(err); } finally { await client.end() } ``` ### Callbacks If you prefer a callback-style approach to asynchronous programming, all async methods support an optional callback parameter as well: ```js import pg from 'pg' const { Client } = pg const client = new Client() client.connect((err) => { client.query('SELECT $1::text as message', ['Hello world!'], (err, res) => { console.log(err ? err.stack : res.rows[0].message) // Hello World! client.end() }) }) ``` Our real-world apps are almost always more complicated than that, and I urge you to read on! node-postgres-pg-8.14.1/docs/theme.config.js000066400000000000000000000025131476604072200206470ustar00rootroot00000000000000// theme.config.js export default { project: { link: 'https://github.com/brianc/node-postgres', }, twitter: { cardType: 'summary_large_image', site: 'https://node-postgres.com', }, docsRepositoryBase: 'https://github.com/brianc/node-postgres/blob/master/docs', // base URL for the docs repository titleSuffix: ' – node-postgres', darkMode: true, footer: true, navigation: { prev: true, next: true, }, footer: { text: `MIT ${new Date().getFullYear()} © Brian Carlson.`, }, editLink: { text: 'Edit this page on GitHub', }, logo: ( <> ... node-postgres ), head: ( <> ), } node-postgres-pg-8.14.1/docs/yarn.lock000066400000000000000000002606301476604072200175740ustar00rootroot00000000000000# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. # yarn lockfile v1 "@babel/runtime@^7.12.5": version "7.19.0" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.19.0.tgz#22b11c037b094d27a8a2504ea4dcff00f50e2259" integrity sha512-eR8Lo9hnDS7tqkO7NsV+mKvCmv5boaXFSZ70DnfhcgiEne8hv9oCEd36Klw74EtizEqLsy4YnW8UWwpBVolHZA== dependencies: regenerator-runtime "^0.13.4" "@headlessui/react@^1.6.6": version "1.7.2" resolved "https://registry.yarnpkg.com/@headlessui/react/-/react-1.7.2.tgz#e6a6a8d38342064a53182f1eb2bf6d9c1e53ba6a" integrity sha512-snLv2lxwsf2HNTOBNgHYdvoYZ3ChJE8QszPi1d/hl9js8KrFrUulTaQBfSyPbJP5BybVreWh9DxCgz9S0Z6hKQ== "@mdx-js/mdx@^2.1.3": version "2.1.3" resolved "https://registry.yarnpkg.com/@mdx-js/mdx/-/mdx-2.1.3.tgz#d5821920ebe546b45192f4c7a64dcc68a658f7f9" integrity sha512-ahbb47HJIJ4xnifaL06tDJiSyLEy1EhFAStO7RZIm3GTa7yGW3NGhZaj+GUCveFgl5oI54pY4BgiLmYm97y+zg== dependencies: "@types/estree-jsx" "^1.0.0" "@types/mdx" "^2.0.0" estree-util-build-jsx "^2.0.0" estree-util-is-identifier-name "^2.0.0" estree-util-to-js "^1.1.0" estree-walker "^3.0.0" hast-util-to-estree "^2.0.0" markdown-extensions "^1.0.0" periscopic "^3.0.0" remark-mdx "^2.0.0" remark-parse "^10.0.0" remark-rehype "^10.0.0" unified "^10.0.0" unist-util-position-from-estree "^1.0.0" unist-util-stringify-position "^3.0.0" unist-util-visit "^4.0.0" vfile "^5.0.0" "@mdx-js/react@^2.1.2": version "2.1.3" resolved "https://registry.yarnpkg.com/@mdx-js/react/-/react-2.1.3.tgz#4b28a774295ed1398cf6be1b8ddef69d6a30e78d" integrity sha512-11n4lTvvRyxq3OYbWJwEYM+7q6PE0GxKbk0AwYIIQmrRkxDeljIsjDQkKOgdr/orgRRbYy5zi+iERdnwe01CHQ== dependencies: "@types/mdx" "^2.0.0" "@types/react" ">=16" "@napi-rs/simple-git-android-arm-eabi@0.1.8": version "0.1.8" resolved "https://registry.yarnpkg.com/@napi-rs/simple-git-android-arm-eabi/-/simple-git-android-arm-eabi-0.1.8.tgz#303bea1ec00db24466e3b3ba13de337d87c5371b" integrity sha512-JJCejHBB1G6O8nxjQLT4quWCcvLpC3oRdJJ9G3MFYSCoYS8i1bWCWeU+K7Br+xT+D6s1t9q8kNJAwJv9Ygpi0g== "@napi-rs/simple-git-android-arm64@0.1.8": version "0.1.8" resolved "https://registry.yarnpkg.com/@napi-rs/simple-git-android-arm64/-/simple-git-android-arm64-0.1.8.tgz#42c8d04287364fd1619002629fa52183dcf462ee" integrity sha512-mraHzwWBw3tdRetNOS5KnFSjvdAbNBnjFLA8I4PwTCPJj3Q4txrigcPp2d59cJ0TC51xpnPXnZjYdNwwSI9g6g== "@napi-rs/simple-git-darwin-arm64@0.1.8": version "0.1.8" resolved "https://registry.yarnpkg.com/@napi-rs/simple-git-darwin-arm64/-/simple-git-darwin-arm64-0.1.8.tgz#e210808e6d646d6efecea84c67ced8eb44a8f821" integrity sha512-ufy/36eI/j4UskEuvqSH7uXtp3oXeLDmjQCfKJz3u5Vx98KmOMKrqAm2H81AB2WOtCo5mqS6PbBeUXR8BJX8lQ== "@napi-rs/simple-git-darwin-x64@0.1.8": version "0.1.8" resolved "https://registry.yarnpkg.com/@napi-rs/simple-git-darwin-x64/-/simple-git-darwin-x64-0.1.8.tgz#d717525c33e0dfd8a6d6215da2fcbc0ad40011e1" integrity sha512-Vb21U+v3tPJNl+8JtIHHT8HGe6WZ8o1Tq3f6p+Jx9Cz71zEbcIiB9FCEMY1knS/jwQEOuhhlI9Qk7d4HY+rprA== "@napi-rs/simple-git-linux-arm-gnueabihf@0.1.8": version "0.1.8" resolved "https://registry.yarnpkg.com/@napi-rs/simple-git-linux-arm-gnueabihf/-/simple-git-linux-arm-gnueabihf-0.1.8.tgz#03e7b2dd299c10e61bbf29f405ea74f6571cf6a1" integrity sha512-6BPTJ7CzpSm2t54mRLVaUr3S7ORJfVJoCk2rQ8v8oDg0XAMKvmQQxOsAgqKBo9gYNHJnqrOx3AEuEgvB586BuQ== "@napi-rs/simple-git-linux-arm64-gnu@0.1.8": version "0.1.8" resolved "https://registry.yarnpkg.com/@napi-rs/simple-git-linux-arm64-gnu/-/simple-git-linux-arm64-gnu-0.1.8.tgz#945123f75c9a36fd0364e789ce06cd29a74a43cc" integrity sha512-qfESqUCAA/XoQpRXHptSQ8gIFnETCQt1zY9VOkplx6tgYk9PCeaX4B1Xuzrh3eZamSCMJFn+1YB9Ut8NwyGgAA== "@napi-rs/simple-git-linux-arm64-musl@0.1.8": version "0.1.8" resolved "https://registry.yarnpkg.com/@napi-rs/simple-git-linux-arm64-musl/-/simple-git-linux-arm64-musl-0.1.8.tgz#2c20a0bff7c08f60b033ed7056dcb07bbbff8310" integrity sha512-G80BQPpaRmQpn8dJGHp4I2/YVhWDUNJwcCrJAtAdbKFDCMyCHJBln2ERL/+IEUlIAT05zK/c1Z5WEprvXEdXow== "@napi-rs/simple-git-linux-x64-gnu@0.1.8": version "0.1.8" resolved "https://registry.yarnpkg.com/@napi-rs/simple-git-linux-x64-gnu/-/simple-git-linux-x64-gnu-0.1.8.tgz#980e22b7376252a0767298ec801d374d97553da1" integrity sha512-NI6o1sZYEf6vPtNWJAm9w8BxJt+LlSFW0liSjYe3lc3e4dhMfV240f0ALeqlwdIldRPaDFwZSJX5/QbS7nMzhw== "@napi-rs/simple-git-linux-x64-musl@0.1.8": version "0.1.8" resolved "https://registry.yarnpkg.com/@napi-rs/simple-git-linux-x64-musl/-/simple-git-linux-x64-musl-0.1.8.tgz#edca3b2833dc5d3fc9151f5b931f7b14478ccca4" integrity sha512-wljGAEOW41er45VTiU8kXJmO480pQKzsgRCvPlJJSCaEVBbmo6XXbFIXnZy1a2J3Zyy2IOsRB4PVkUZaNuPkZQ== "@napi-rs/simple-git-win32-arm64-msvc@0.1.8": version "0.1.8" resolved "https://registry.yarnpkg.com/@napi-rs/simple-git-win32-arm64-msvc/-/simple-git-win32-arm64-msvc-0.1.8.tgz#3ac4c7fe816a2cdafabd091ded76161d1ba1fe88" integrity sha512-QuV4QILyKPfbWHoQKrhXqjiCClx0SxbCTVogkR89BwivekqJMd9UlMxZdoCmwLWutRx4z9KmzQqokvYI5QeepA== "@napi-rs/simple-git-win32-x64-msvc@0.1.8": version "0.1.8" resolved "https://registry.yarnpkg.com/@napi-rs/simple-git-win32-x64-msvc/-/simple-git-win32-x64-msvc-0.1.8.tgz#3b825bc2cb1c7ff535a3ca03768142d68bbf5c19" integrity sha512-UzNS4JtjhZhZ5hRLq7BIUq+4JOwt1ThIKv11CsF1ag2l99f0123XvfEpjczKTaa94nHtjXYc2Mv9TjccBqYOew== "@napi-rs/simple-git@^0.1.8": version "0.1.8" resolved "https://registry.yarnpkg.com/@napi-rs/simple-git/-/simple-git-0.1.8.tgz#391cb58436d50bd32d924611d45bdc41f5e7607a" integrity sha512-BvOMdkkofTz6lEE35itJ/laUokPhr/5ToMGlOH25YnhLD2yN1KpRAT4blW9tT8281/1aZjW3xyi73bs//IrDKA== optionalDependencies: "@napi-rs/simple-git-android-arm-eabi" "0.1.8" "@napi-rs/simple-git-android-arm64" "0.1.8" "@napi-rs/simple-git-darwin-arm64" "0.1.8" "@napi-rs/simple-git-darwin-x64" "0.1.8" "@napi-rs/simple-git-linux-arm-gnueabihf" "0.1.8" "@napi-rs/simple-git-linux-arm64-gnu" "0.1.8" "@napi-rs/simple-git-linux-arm64-musl" "0.1.8" "@napi-rs/simple-git-linux-x64-gnu" "0.1.8" "@napi-rs/simple-git-linux-x64-musl" "0.1.8" "@napi-rs/simple-git-win32-arm64-msvc" "0.1.8" "@napi-rs/simple-git-win32-x64-msvc" "0.1.8" "@next/env@12.3.1": version "12.3.1" resolved "https://registry.yarnpkg.com/@next/env/-/env-12.3.1.tgz#18266bd92de3b4aa4037b1927aa59e6f11879260" integrity sha512-9P9THmRFVKGKt9DYqeC2aKIxm8rlvkK38V1P1sRE7qyoPBIs8l9oo79QoSdPtOWfzkbDAVUqvbQGgTMsb8BtJg== "@next/swc-android-arm-eabi@12.3.1": version "12.3.1" resolved "https://registry.yarnpkg.com/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-12.3.1.tgz#b15ce8ad376102a3b8c0f3c017dde050a22bb1a3" integrity sha512-i+BvKA8tB//srVPPQxIQN5lvfROcfv4OB23/L1nXznP+N/TyKL8lql3l7oo2LNhnH66zWhfoemg3Q4VJZSruzQ== "@next/swc-android-arm64@12.3.1": version "12.3.1" resolved "https://registry.yarnpkg.com/@next/swc-android-arm64/-/swc-android-arm64-12.3.1.tgz#85d205f568a790a137cb3c3f720d961a2436ac9c" integrity sha512-CmgU2ZNyBP0rkugOOqLnjl3+eRpXBzB/I2sjwcGZ7/Z6RcUJXK5Evz+N0ucOxqE4cZ3gkTeXtSzRrMK2mGYV8Q== "@next/swc-darwin-arm64@12.3.1": version "12.3.1" resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-12.3.1.tgz#b105457d6760a7916b27e46c97cb1a40547114ae" integrity sha512-hT/EBGNcu0ITiuWDYU9ur57Oa4LybD5DOQp4f22T6zLfpoBMfBibPtR8XktXmOyFHrL/6FC2p9ojdLZhWhvBHg== "@next/swc-darwin-x64@12.3.1": version "12.3.1" resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-12.3.1.tgz#6947b39082271378896b095b6696a7791c6e32b1" integrity sha512-9S6EVueCVCyGf2vuiLiGEHZCJcPAxglyckTZcEwLdJwozLqN0gtS0Eq0bQlGS3dH49Py/rQYpZ3KVWZ9BUf/WA== "@next/swc-freebsd-x64@12.3.1": version "12.3.1" resolved "https://registry.yarnpkg.com/@next/swc-freebsd-x64/-/swc-freebsd-x64-12.3.1.tgz#2b6c36a4d84aae8b0ea0e0da9bafc696ae27085a" integrity sha512-qcuUQkaBZWqzM0F1N4AkAh88lLzzpfE6ImOcI1P6YeyJSsBmpBIV8o70zV+Wxpc26yV9vpzb+e5gCyxNjKJg5Q== "@next/swc-linux-arm-gnueabihf@12.3.1": version "12.3.1" resolved "https://registry.yarnpkg.com/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-12.3.1.tgz#6e421c44285cfedac1f4631d5de330dd60b86298" integrity sha512-diL9MSYrEI5nY2wc/h/DBewEDUzr/DqBjIgHJ3RUNtETAOB3spMNHvJk2XKUDjnQuluLmFMloet9tpEqU2TT9w== "@next/swc-linux-arm64-gnu@12.3.1": version "12.3.1" resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-12.3.1.tgz#8863f08a81f422f910af126159d2cbb9552ef717" integrity sha512-o/xB2nztoaC7jnXU3Q36vGgOolJpsGG8ETNjxM1VAPxRwM7FyGCPHOMk1XavG88QZSQf+1r+POBW0tLxQOJ9DQ== "@next/swc-linux-arm64-musl@12.3.1": version "12.3.1" resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-12.3.1.tgz#0038f07cf0b259d70ae0c80890d826dfc775d9f3" integrity sha512-2WEasRxJzgAmP43glFNhADpe8zB7kJofhEAVNbDJZANp+H4+wq+/cW1CdDi8DqjkShPEA6/ejJw+xnEyDID2jg== "@next/swc-linux-x64-gnu@12.3.1": version "12.3.1" resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-12.3.1.tgz#c66468f5e8181ffb096c537f0dbfb589baa6a9c1" integrity sha512-JWEaMyvNrXuM3dyy9Pp5cFPuSSvG82+yABqsWugjWlvfmnlnx9HOQZY23bFq3cNghy5V/t0iPb6cffzRWylgsA== "@next/swc-linux-x64-musl@12.3.1": version "12.3.1" resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-12.3.1.tgz#c6269f3e96ac0395bc722ad97ce410ea5101d305" integrity sha512-xoEWQQ71waWc4BZcOjmatuvPUXKTv6MbIFzpm4LFeCHsg2iwai0ILmNXf81rJR+L1Wb9ifEke2sQpZSPNz1Iyg== "@next/swc-win32-arm64-msvc@12.3.1": version "12.3.1" resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-12.3.1.tgz#83c639ee969cee36ce247c3abd1d9df97b5ecade" integrity sha512-hswVFYQYIeGHE2JYaBVtvqmBQ1CppplQbZJS/JgrVI3x2CurNhEkmds/yqvDONfwfbttTtH4+q9Dzf/WVl3Opw== "@next/swc-win32-ia32-msvc@12.3.1": version "12.3.1" resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-12.3.1.tgz#52995748b92aa8ad053440301bc2c0d9fbcf27c2" integrity sha512-Kny5JBehkTbKPmqulr5i+iKntO5YMP+bVM8Hf8UAmjSMVo3wehyLVc9IZkNmcbxi+vwETnQvJaT5ynYBkJ9dWA== "@next/swc-win32-x64-msvc@12.3.1": version "12.3.1" resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-12.3.1.tgz#27d71a95247a9eaee03d47adee7e3bd594514136" integrity sha512-W1ijvzzg+kPEX6LAc+50EYYSEo0FVu7dmTE+t+DM4iOLqgGHoW9uYSz9wCVdkXOEEMP9xhXfGpcSxsfDucyPkA== "@popperjs/core@^2.11.6": version "2.11.6" resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.6.tgz#cee20bd55e68a1720bdab363ecf0c821ded4cd45" integrity sha512-50/17A98tWUfQ176raKiOGXuYpLyyVMkxxG6oylzL3BPOlA6ADGdK7EYunSa4I064xerltq9TGXs8HmOk5E+vw== "@reach/skip-nav@^0.17.0": version "0.17.0" resolved "https://registry.yarnpkg.com/@reach/skip-nav/-/skip-nav-0.17.0.tgz#225aaaf947f8750568ad5f4cc3646641fd335d56" integrity sha512-wkkpQK3ffczzGHis6TaUvpOabuAL9n9Kh5vr4h56XPIJP3X77VcHUDk7MK3HbV1mTgamGxc9Hbd1sXKSWLu3yA== dependencies: "@reach/utils" "0.17.0" tslib "^2.3.0" "@reach/utils@0.17.0": version "0.17.0" resolved "https://registry.yarnpkg.com/@reach/utils/-/utils-0.17.0.tgz#3d1d2ec56d857f04fe092710d8faee2b2b121303" integrity sha512-M5y8fCBbrWeIsxedgcSw6oDlAMQDkl5uv3VnMVJ7guwpf4E48Xlh1v66z/1BgN/WYe2y8mB/ilFD2nysEfdGeA== dependencies: tiny-warning "^1.0.3" tslib "^2.3.0" "@swc/helpers@0.4.11": version "0.4.11" resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.4.11.tgz#db23a376761b3d31c26502122f349a21b592c8de" integrity sha512-rEUrBSGIoSFuYxwBYtlUFMlE2CwGhmW+w9355/5oduSw8e5h2+Tj4UrAGNNgP9915++wj5vkQo0UuOBqOAq4nw== dependencies: tslib "^2.4.0" "@types/acorn@^4.0.0": version "4.0.6" resolved "https://registry.yarnpkg.com/@types/acorn/-/acorn-4.0.6.tgz#d61ca5480300ac41a7d973dd5b84d0a591154a22" integrity sha512-veQTnWP+1D/xbxVrPC3zHnCZRjSrKfhbMUlEA43iMZLu7EsnTtkJklIuwrCPbOi8YkvDQAiW05VQQFvvz9oieQ== dependencies: "@types/estree" "*" "@types/debug@^4.0.0": version "4.1.7" resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.7.tgz#7cc0ea761509124709b8b2d1090d8f6c17aadb82" integrity sha512-9AonUzyTjXXhEOa0DnqpzZi6VHlqKMswga9EXjpXnnqxwLtdvPPtlO8evrI5D9S6asFRCQ6v+wpiUKbw+vKqyg== dependencies: "@types/ms" "*" "@types/estree-jsx@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@types/estree-jsx/-/estree-jsx-1.0.0.tgz#7bfc979ab9f692b492017df42520f7f765e98df1" integrity sha512-3qvGd0z8F2ENTGr/GG1yViqfiKmRfrXVx5sJyHGFu3z7m5g5utCQtGp/g29JnjflhtQJBv1WDQukHiT58xPcYQ== dependencies: "@types/estree" "*" "@types/estree@*", "@types/estree@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.0.tgz#5fb2e536c1ae9bf35366eed879e827fa59ca41c2" integrity sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ== "@types/hast@^2.0.0": version "2.3.4" resolved "https://registry.yarnpkg.com/@types/hast/-/hast-2.3.4.tgz#8aa5ef92c117d20d974a82bdfb6a648b08c0bafc" integrity sha512-wLEm0QvaoawEDoTRwzTXp4b4jpwiJDvR5KMnFnVodm3scufTlBOWRD6N1OBf9TZMhjlNsSfcO5V+7AF4+Vy+9g== dependencies: "@types/unist" "*" "@types/mdast@^3.0.0": version "3.0.10" resolved "https://registry.yarnpkg.com/@types/mdast/-/mdast-3.0.10.tgz#4724244a82a4598884cbbe9bcfd73dff927ee8af" integrity sha512-W864tg/Osz1+9f4lrGTZpCSO5/z4608eUp19tbozkq2HJK6i3z1kT0H9tlADXuYIb1YYOBByU4Jsqkk75q48qA== dependencies: "@types/unist" "*" "@types/mdurl@^1.0.0": version "1.0.2" resolved "https://registry.yarnpkg.com/@types/mdurl/-/mdurl-1.0.2.tgz#e2ce9d83a613bacf284c7be7d491945e39e1f8e9" integrity sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA== "@types/mdx@^2.0.0": version "2.0.2" resolved "https://registry.yarnpkg.com/@types/mdx/-/mdx-2.0.2.tgz#64be19baddba4323ae7893e077e98759316fe279" integrity sha512-mJGfgj4aWpiKb8C0nnJJchs1sHBHn0HugkVfqqyQi7Wn6mBRksLeQsPOFvih/Pu8L1vlDzfe/LidhVHBeUk3aQ== "@types/ms@*": version "0.7.31" resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.31.tgz#31b7ca6407128a3d2bbc27fe2d21b345397f6197" integrity sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA== "@types/prop-types@*": version "15.7.5" resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.5.tgz#5f19d2b85a98e9558036f6a3cacc8819420f05cf" integrity sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w== "@types/react@>=16": version "18.0.21" resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.21.tgz#b8209e9626bb00a34c76f55482697edd2b43cc67" integrity sha512-7QUCOxvFgnD5Jk8ZKlUAhVcRj7GuJRjnjjiY/IUBWKgOlnvDvTMLD4RTF7NPyVmbRhNrbomZiOepg7M/2Kj1mA== dependencies: "@types/prop-types" "*" "@types/scheduler" "*" csstype "^3.0.2" "@types/scheduler@*": version "0.16.2" resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39" integrity sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew== "@types/unist@*", "@types/unist@^2.0.0": version "2.0.6" resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.6.tgz#250a7b16c3b91f672a24552ec64678eeb1d3a08d" integrity sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ== acorn-jsx@^5.0.0: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== acorn@^8.0.0: version "8.8.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.0.tgz#88c0187620435c7f6015803f5539dae05a9dbea8" integrity sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w== ansi-styles@^3.1.0: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== dependencies: color-convert "^1.9.0" arch@^2.1.0: version "2.2.0" resolved "https://registry.yarnpkg.com/arch/-/arch-2.2.0.tgz#1bc47818f305764f23ab3306b0bfc086c5a29d11" integrity sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ== arg@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/arg/-/arg-1.0.0.tgz#444d885a4e25b121640b55155ef7cd03975d6050" integrity sha512-Wk7TEzl1KqvTGs/uyhmHO/3XLd3t1UeU4IstvPXVzGPM522cTjqjNZ99esCkcL52sjqjo8e8CTBcWhkxvGzoAw== argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== dependencies: sprintf-js "~1.0.2" astring@^1.8.0: version "1.8.3" resolved "https://registry.yarnpkg.com/astring/-/astring-1.8.3.tgz#1a0ae738c7cc558f8e5ddc8e3120636f5cebcb85" integrity sha512-sRpyiNrx2dEYIMmUXprS8nlpRg2Drs8m9ElX9vVEXaCB4XEAJhKfs7IcX0IwShjuOAjLR6wzIrgoptz1n19i1A== bail@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/bail/-/bail-2.0.2.tgz#d26f5cd8fe5d6f832a31517b9f7c356040ba6d5d" integrity sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw== caniuse-lite@^1.0.30001406: version "1.0.30001410" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001410.tgz#b5a86366fbbf439d75dd3db1d21137a73e829f44" integrity sha512-QoblBnuE+rG0lc3Ur9ltP5q47lbguipa/ncNMyyGuqPk44FxbScWAeEO+k5fSQ8WekdAK4mWqNs1rADDAiN5xQ== ccount@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/ccount/-/ccount-2.0.1.tgz#17a3bf82302e0870d6da43a01311a8bc02a3ecf5" integrity sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg== chalk@2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.0.tgz#b5ea48efc9c1793dccc9b4767c93914d3f2d52ba" integrity sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q== dependencies: ansi-styles "^3.1.0" escape-string-regexp "^1.0.5" supports-color "^4.0.0" character-entities-html4@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/character-entities-html4/-/character-entities-html4-2.1.0.tgz#1f1adb940c971a4b22ba39ddca6b618dc6e56b2b" integrity sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA== character-entities-legacy@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz#76bc83a90738901d7bc223a9e93759fdd560125b" integrity sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ== character-entities@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/character-entities/-/character-entities-2.0.2.tgz#2d09c2e72cd9523076ccb21157dff66ad43fcc22" integrity sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ== character-reference-invalid@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/character-reference-invalid/-/character-reference-invalid-2.0.1.tgz#85c66b041e43b47210faf401278abf808ac45cb9" integrity sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw== clipboardy@1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/clipboardy/-/clipboardy-1.2.2.tgz#2ce320b9ed9be1514f79878b53ff9765420903e2" integrity sha512-16KrBOV7bHmHdxcQiCvfUFYVFyEah4FI8vYT1Fr7CGSA4G+xBWMEfUEQJS1hxeHGtI9ju1Bzs9uXSbj5HZKArw== dependencies: arch "^2.1.0" execa "^0.8.0" clsx@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/clsx/-/clsx-1.2.1.tgz#0ddc4a20a549b59c93a4116bb26f5294ca17dc12" integrity sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg== color-convert@^1.9.0: version "1.9.3" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== dependencies: color-name "1.1.3" color-name@1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== comma-separated-tokens@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-2.0.2.tgz#d4c25abb679b7751c880be623c1179780fe1dd98" integrity sha512-G5yTt3KQN4Yn7Yk4ed73hlZ1evrFKXeUW3086p3PRFNp7m2vIjI6Pg+Kgb+oyzhd9F2qdcoj67+y3SdxL5XWsg== compute-scroll-into-view@^1.0.17: version "1.0.17" resolved "https://registry.yarnpkg.com/compute-scroll-into-view/-/compute-scroll-into-view-1.0.17.tgz#6a88f18acd9d42e9cf4baa6bec7e0522607ab7ab" integrity sha512-j4dx+Fb0URmzbwwMUrhqWM2BEWHdFGx+qZ9qqASHRPqvTYdqvWnHg0H1hIbcyLnvgnoNAVMlwkepyqM3DaIFUg== cross-spawn@^5.0.1: version "5.1.0" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" integrity sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A== dependencies: lru-cache "^4.0.1" shebang-command "^1.2.0" which "^1.2.9" csstype@^3.0.2: version "3.1.1" resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.1.tgz#841b532c45c758ee546a11d5bd7b7b473c8c30b9" integrity sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw== debug@^4.0.0: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== dependencies: ms "2.1.2" decode-named-character-reference@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/decode-named-character-reference/-/decode-named-character-reference-1.0.2.tgz#daabac9690874c394c81e4162a0304b35d824f0e" integrity sha512-O8x12RzrUF8xyVcY0KJowWsmaJxQbmy0/EtnNtHRpsOcT7dFk5W598coHqBVpmWo1oQQfsCqfCmkZN5DJrZVdg== dependencies: character-entities "^2.0.0" dequal@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/dequal/-/dequal-2.0.3.tgz#2644214f1997d39ed0ee0ece72335490a7ac67be" integrity sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA== diff@^5.0.0: version "5.1.0" resolved "https://registry.yarnpkg.com/diff/-/diff-5.1.0.tgz#bc52d298c5ea8df9194800224445ed43ffc87e40" integrity sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw== escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== escape-string-regexp@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz#4683126b500b61762f2dbebace1806e8be31b1c8" integrity sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw== esprima@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== estree-util-attach-comments@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/estree-util-attach-comments/-/estree-util-attach-comments-2.1.0.tgz#47d69900588bcbc6bf58c3798803ec5f1f3008de" integrity sha512-rJz6I4L0GaXYtHpoMScgDIwM0/Vwbu5shbMeER596rB2D1EWF6+Gj0e0UKzJPZrpoOc87+Q2kgVFHfjAymIqmw== dependencies: "@types/estree" "^1.0.0" estree-util-build-jsx@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/estree-util-build-jsx/-/estree-util-build-jsx-2.2.0.tgz#d4307bbeee28c14eb4d63b75c9aad28fa61d84f5" integrity sha512-apsfRxF9uLrqosApvHVtYZjISPvTJ+lBiIydpC+9wE6cF6ssbhnjyQLqaIjgzGxvC2Hbmec1M7g91PoBayYoQQ== dependencies: "@types/estree-jsx" "^1.0.0" estree-util-is-identifier-name "^2.0.0" estree-walker "^3.0.0" estree-util-is-identifier-name@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/estree-util-is-identifier-name/-/estree-util-is-identifier-name-1.1.0.tgz#2e3488ea06d9ea2face116058864f6370b37456d" integrity sha512-OVJZ3fGGt9By77Ix9NhaRbzfbDV/2rx9EP7YIDJTmsZSEc5kYn2vWcNccYyahJL2uAQZK2a5Or2i0wtIKTPoRQ== estree-util-is-identifier-name@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/estree-util-is-identifier-name/-/estree-util-is-identifier-name-2.0.1.tgz#cf07867f42705892718d9d89eb2d85eaa8f0fcb5" integrity sha512-rxZj1GkQhY4x1j/CSnybK9cGuMFQYFPLq0iNyopqf14aOVLFtMv7Esika+ObJWPWiOHuMOAHz3YkWoLYYRnzWQ== estree-util-to-js@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/estree-util-to-js/-/estree-util-to-js-1.1.0.tgz#3bd9bb86354063537cc3d81259be2f0d4c3af39f" integrity sha512-490lbfCcpLk+ofK6HCgqDfYs4KAfq6QVvDw3+Bm1YoKRgiOjKiKYGAVQE1uwh7zVxBgWhqp4FDtp5SqunpUk1A== dependencies: "@types/estree-jsx" "^1.0.0" astring "^1.8.0" source-map "^0.7.0" estree-util-value-to-estree@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/estree-util-value-to-estree/-/estree-util-value-to-estree-1.3.0.tgz#1d3125594b4d6680f666644491e7ac1745a3df49" integrity sha512-Y+ughcF9jSUJvncXwqRageavjrNPAI+1M/L3BI3PyLp1nmgYTGUXU6t5z1Y7OWuThoDdhPME07bQU+d5LxdJqw== dependencies: is-plain-obj "^3.0.0" estree-util-visit@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/estree-util-visit/-/estree-util-visit-1.2.0.tgz#aa0311a9c2f2aa56e9ae5e8b9d87eac14e4ec8f8" integrity sha512-wdsoqhWueuJKsh5hqLw3j8lwFqNStm92VcwtAOAny8g/KS/l5Y8RISjR4k5W6skCj3Nirag/WUCMS0Nfy3sgsg== dependencies: "@types/estree-jsx" "^1.0.0" "@types/unist" "^2.0.0" estree-walker@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-3.0.1.tgz#c2a9fb4a30232f5039b7c030b37ead691932debd" integrity sha512-woY0RUD87WzMBUiZLx8NsYr23N5BKsOMZHhu2hoNRVh6NXGfoiT1KOL8G3UHlJAnEDGmfa5ubNA/AacfG+Kb0g== execa@^0.8.0: version "0.8.0" resolved "https://registry.yarnpkg.com/execa/-/execa-0.8.0.tgz#d8d76bbc1b55217ed190fd6dd49d3c774ecfc8da" integrity sha512-zDWS+Rb1E8BlqqhALSt9kUhss8Qq4nN3iof3gsOdyINksElaPyNBtKUMTR62qhvgVWR0CqCX7sdnKe4MnUbFEA== dependencies: cross-spawn "^5.0.1" get-stream "^3.0.0" is-stream "^1.1.0" npm-run-path "^2.0.0" p-finally "^1.0.0" signal-exit "^3.0.0" strip-eof "^1.0.0" extend-shallow@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" integrity sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug== dependencies: is-extendable "^0.1.0" extend@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== flexsearch@^0.7.21: version "0.7.21" resolved "https://registry.yarnpkg.com/flexsearch/-/flexsearch-0.7.21.tgz#0f5ede3f2aae67ddc351efbe3b24b69d29e9d48b" integrity sha512-W7cHV7Hrwjid6lWmy0IhsWDFQboWSng25U3VVywpHOTJnnAZNPScog67G+cVpeX9f7yDD21ih0WDrMMT+JoaYg== focus-visible@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/focus-visible/-/focus-visible-5.2.0.tgz#3a9e41fccf587bd25dcc2ef045508284f0a4d6b3" integrity sha512-Rwix9pBtC1Nuy5wysTmKy+UjbDJpIfg8eHjw0rjZ1mX4GNLz1Bmd16uDpI3Gk1i70Fgcs8Csg2lPm8HULFg9DQ== get-stream@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" integrity sha512-GlhdIUuVakc8SJ6kK0zAFbiGzRFzNnY4jUuEbV9UROo4Y+0Ny4fjvcZFVTeDA4odpFyOQzaw6hXukJSq/f28sQ== github-slugger@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/github-slugger/-/github-slugger-1.4.0.tgz#206eb96cdb22ee56fdc53a28d5a302338463444e" integrity sha512-w0dzqw/nt51xMVmlaV1+JRzN+oCa1KfcgGEWhxUG16wbdA+Xnt/yoFO8Z8x/V82ZcZ0wy6ln9QDup5avbhiDhQ== graceful-fs@^4.2.10: version "4.2.10" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== gray-matter@^4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/gray-matter/-/gray-matter-4.0.3.tgz#e893c064825de73ea1f5f7d88c7a9f7274288798" integrity sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q== dependencies: js-yaml "^3.13.1" kind-of "^6.0.2" section-matter "^1.0.0" strip-bom-string "^1.0.0" has-flag@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" integrity sha512-P+1n3MnwjR/Epg9BBo1KT8qbye2g2Ou4sFumihwt6I4tsUX7jnLcX4BTOSKg/B1ZrIYMN9FcEnG4x5a7NB8Eng== hast-util-to-estree@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/hast-util-to-estree/-/hast-util-to-estree-2.1.0.tgz#aeac70aad0102ae309570907b3f56a08231d5323" integrity sha512-Vwch1etMRmm89xGgz+voWXvVHba2iiMdGMKmaMfYt35rbVtFDq8JNwwAIvi8zHMkO6Gvqo9oTMwJTmzVRfXh4g== dependencies: "@types/estree" "^1.0.0" "@types/estree-jsx" "^1.0.0" "@types/hast" "^2.0.0" "@types/unist" "^2.0.0" comma-separated-tokens "^2.0.0" estree-util-attach-comments "^2.0.0" estree-util-is-identifier-name "^2.0.0" hast-util-whitespace "^2.0.0" mdast-util-mdx-expression "^1.0.0" mdast-util-mdxjs-esm "^1.0.0" property-information "^6.0.0" space-separated-tokens "^2.0.0" style-to-object "^0.3.0" unist-util-position "^4.0.0" zwitch "^2.0.0" hast-util-to-string@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/hast-util-to-string/-/hast-util-to-string-1.0.4.tgz#9b24c114866bdb9478927d7e9c36a485ac728378" integrity sha512-eK0MxRX47AV2eZ+Lyr18DCpQgodvaS3fAQO2+b9Two9F5HEoRPhiUMNzoXArMJfZi2yieFzUBMRl3HNJ3Jus3w== hast-util-whitespace@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/hast-util-whitespace/-/hast-util-whitespace-2.0.0.tgz#4fc1086467cc1ef5ba20673cb6b03cec3a970f1c" integrity sha512-Pkw+xBHuV6xFeJprJe2BBEoDV+AvQySaz3pPDRUs5PNZEMQjpXJJueqrpcHIXxnWTcAGi/UOCgVShlkY6kLoqg== inline-style-parser@0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/inline-style-parser/-/inline-style-parser-0.1.1.tgz#ec8a3b429274e9c0a1f1c4ffa9453a7fef72cea1" integrity sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q== intersection-observer@^0.12.2: version "0.12.2" resolved "https://registry.yarnpkg.com/intersection-observer/-/intersection-observer-0.12.2.tgz#4a45349cc0cd91916682b1f44c28d7ec737dc375" integrity sha512-7m1vEcPCxXYI8HqnL8CKI6siDyD+eIWSwgB3DZA+ZTogxk9I4CDnj4wilt9x/+/QbHI4YG5YZNmC6458/e9Ktg== is-alphabetical@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/is-alphabetical/-/is-alphabetical-2.0.1.tgz#01072053ea7c1036df3c7d19a6daaec7f19e789b" integrity sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ== is-alphanumerical@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/is-alphanumerical/-/is-alphanumerical-2.0.1.tgz#7c03fbe96e3e931113e57f964b0a368cc2dfd875" integrity sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw== dependencies: is-alphabetical "^2.0.0" is-decimal "^2.0.0" is-buffer@^2.0.0: version "2.0.5" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191" integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== is-decimal@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/is-decimal/-/is-decimal-2.0.1.tgz#9469d2dc190d0214fd87d78b78caecc0cc14eef7" integrity sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A== is-extendable@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" integrity sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw== is-hexadecimal@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-2.0.1.tgz#86b5bf668fca307498d319dfc03289d781a90027" integrity sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg== is-plain-obj@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-3.0.0.tgz#af6f2ea14ac5a646183a5bbdb5baabbc156ad9d7" integrity sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA== is-plain-obj@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-4.1.0.tgz#d65025edec3657ce032fd7db63c97883eaed71f0" integrity sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg== is-reference@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-reference/-/is-reference-3.0.0.tgz#b1380c03d96ddf7089709781e3208fceb0c92cd6" integrity sha512-Eo1W3wUoHWoCoVM4GVl/a+K0IgiqE5aIo4kJABFyMum1ZORlPkC+UC357sSQUL5w5QCE5kCC9upl75b7+7CY/Q== dependencies: "@types/estree" "*" is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" integrity sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ== isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== "js-tokens@^3.0.0 || ^4.0.0": version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== js-yaml@^3.13.1: version "3.14.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== dependencies: argparse "^1.0.7" esprima "^4.0.0" jsonc-parser@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.0.tgz#31ff3f4c2b9793f89c67212627c51c6394f88e76" integrity sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w== kind-of@^6.0.0, kind-of@^6.0.2: version "6.0.3" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== kleur@^4.0.3: version "4.1.5" resolved "https://registry.yarnpkg.com/kleur/-/kleur-4.1.5.tgz#95106101795f7050c6c650f350c683febddb1780" integrity sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ== longest-streak@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/longest-streak/-/longest-streak-3.0.1.tgz#c97315b7afa0e7d9525db9a5a2953651432bdc5d" integrity sha512-cHlYSUpL2s7Fb3394mYxwTYj8niTaNHUCLr0qdiCXQfSjfuA7CKofpX2uSwEfFDQ0EB7JcnMnm+GjbqqoinYYg== loose-envify@^1.1.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== dependencies: js-tokens "^3.0.0 || ^4.0.0" lru-cache@^4.0.1: version "4.1.5" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== dependencies: pseudomap "^1.0.2" yallist "^2.1.2" markdown-extensions@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/markdown-extensions/-/markdown-extensions-1.1.1.tgz#fea03b539faeaee9b4ef02a3769b455b189f7fc3" integrity sha512-WWC0ZuMzCyDHYCasEGs4IPvLyTGftYwh6wIEOULOF0HXcqZlhwRzrK0w2VUlxWA98xnvb/jszw4ZSkJ6ADpM6Q== markdown-table@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-3.0.2.tgz#9b59eb2c1b22fe71954a65ff512887065a7bb57c" integrity sha512-y8j3a5/DkJCmS5x4dMCQL+OR0+2EAq3DOtio1COSHsmW2BGXnNCK3v12hJt1LrUz5iZH5g0LmuYOjDdI+czghA== match-sorter@^6.3.1: version "6.3.1" resolved "https://registry.yarnpkg.com/match-sorter/-/match-sorter-6.3.1.tgz#98cc37fda756093424ddf3cbc62bfe9c75b92bda" integrity sha512-mxybbo3pPNuA+ZuCUhm5bwNkXrJTbsk5VWbR5wiwz/GC6LIiegBGn2w3O08UG/jdbYLinw51fSQ5xNU1U3MgBw== dependencies: "@babel/runtime" "^7.12.5" remove-accents "0.4.2" mdast-util-definitions@^5.0.0: version "5.1.1" resolved "https://registry.yarnpkg.com/mdast-util-definitions/-/mdast-util-definitions-5.1.1.tgz#2c1d684b28e53f84938bb06317944bee8efa79db" integrity sha512-rQ+Gv7mHttxHOBx2dkF4HWTg+EE+UR78ptQWDylzPKaQuVGdG4HIoY3SrS/pCp80nZ04greFvXbVFHT+uf0JVQ== dependencies: "@types/mdast" "^3.0.0" "@types/unist" "^2.0.0" unist-util-visit "^4.0.0" mdast-util-find-and-replace@^2.0.0: version "2.2.1" resolved "https://registry.yarnpkg.com/mdast-util-find-and-replace/-/mdast-util-find-and-replace-2.2.1.tgz#249901ef43c5f41d6e8a8d446b3b63b17e592d7c" integrity sha512-SobxkQXFAdd4b5WmEakmkVoh18icjQRxGy5OWTCzgsLRm1Fu/KCtwD1HIQSsmq5ZRjVH0Ehwg6/Fn3xIUk+nKw== dependencies: escape-string-regexp "^5.0.0" unist-util-is "^5.0.0" unist-util-visit-parents "^5.0.0" mdast-util-from-markdown@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/mdast-util-from-markdown/-/mdast-util-from-markdown-1.2.0.tgz#84df2924ccc6c995dec1e2368b2b208ad0a76268" integrity sha512-iZJyyvKD1+K7QX1b5jXdE7Sc5dtoTry1vzV28UZZe8Z1xVnB/czKntJ7ZAkG0tANqRnBF6p3p7GpU1y19DTf2Q== dependencies: "@types/mdast" "^3.0.0" "@types/unist" "^2.0.0" decode-named-character-reference "^1.0.0" mdast-util-to-string "^3.1.0" micromark "^3.0.0" micromark-util-decode-numeric-character-reference "^1.0.0" micromark-util-decode-string "^1.0.0" micromark-util-normalize-identifier "^1.0.0" micromark-util-symbol "^1.0.0" micromark-util-types "^1.0.0" unist-util-stringify-position "^3.0.0" uvu "^0.5.0" mdast-util-gfm-autolink-literal@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-1.0.2.tgz#4032dcbaddaef7d4f2f3768ed830475bb22d3970" integrity sha512-FzopkOd4xTTBeGXhXSBU0OCDDh5lUj2rd+HQqG92Ld+jL4lpUfgX2AT2OHAVP9aEeDKp7G92fuooSZcYJA3cRg== dependencies: "@types/mdast" "^3.0.0" ccount "^2.0.0" mdast-util-find-and-replace "^2.0.0" micromark-util-character "^1.0.0" mdast-util-gfm-footnote@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-1.0.1.tgz#11d2d40a1a673a399c459e467fa85e00223191fe" integrity sha512-p+PrYlkw9DeCRkTVw1duWqPRHX6Ywh2BNKJQcZbCwAuP/59B0Lk9kakuAd7KbQprVO4GzdW8eS5++A9PUSqIyw== dependencies: "@types/mdast" "^3.0.0" mdast-util-to-markdown "^1.3.0" micromark-util-normalize-identifier "^1.0.0" mdast-util-gfm-strikethrough@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-1.0.1.tgz#a4a74c36864ec6a6e3bbd31e1977f29beb475789" integrity sha512-zKJbEPe+JP6EUv0mZ0tQUyLQOC+FADt0bARldONot/nefuISkaZFlmVK4tU6JgfyZGrky02m/I6PmehgAgZgqg== dependencies: "@types/mdast" "^3.0.0" mdast-util-to-markdown "^1.3.0" mdast-util-gfm-table@^1.0.0: version "1.0.6" resolved "https://registry.yarnpkg.com/mdast-util-gfm-table/-/mdast-util-gfm-table-1.0.6.tgz#184e900979fe790745fc3dabf77a4114595fcd7f" integrity sha512-uHR+fqFq3IvB3Rd4+kzXW8dmpxUhvgCQZep6KdjsLK4O6meK5dYZEayLtIxNus1XO3gfjfcIFe8a7L0HZRGgag== dependencies: "@types/mdast" "^3.0.0" markdown-table "^3.0.0" mdast-util-from-markdown "^1.0.0" mdast-util-to-markdown "^1.3.0" mdast-util-gfm-task-list-item@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-1.0.1.tgz#6f35f09c6e2bcbe88af62fdea02ac199cc802c5c" integrity sha512-KZ4KLmPdABXOsfnM6JHUIjxEvcx2ulk656Z/4Balw071/5qgnhz+H1uGtf2zIGnrnvDC8xR4Fj9uKbjAFGNIeA== dependencies: "@types/mdast" "^3.0.0" mdast-util-to-markdown "^1.3.0" mdast-util-gfm@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/mdast-util-gfm/-/mdast-util-gfm-2.0.1.tgz#16fcf70110ae689a06d77e8f4e346223b64a0ea6" integrity sha512-42yHBbfWIFisaAfV1eixlabbsa6q7vHeSPY+cg+BBjX51M8xhgMacqH9g6TftB/9+YkcI0ooV4ncfrJslzm/RQ== dependencies: mdast-util-from-markdown "^1.0.0" mdast-util-gfm-autolink-literal "^1.0.0" mdast-util-gfm-footnote "^1.0.0" mdast-util-gfm-strikethrough "^1.0.0" mdast-util-gfm-table "^1.0.0" mdast-util-gfm-task-list-item "^1.0.0" mdast-util-to-markdown "^1.0.0" mdast-util-mdx-expression@^1.0.0: version "1.3.0" resolved "https://registry.yarnpkg.com/mdast-util-mdx-expression/-/mdast-util-mdx-expression-1.3.0.tgz#fed063cc6320da1005c8e50338bb374d6dac69ba" integrity sha512-9kTO13HaL/ChfzVCIEfDRdp1m5hsvsm6+R8yr67mH+KS2ikzZ0ISGLPTbTswOFpLLlgVHO9id3cul4ajutCvCA== dependencies: "@types/estree-jsx" "^1.0.0" "@types/hast" "^2.0.0" "@types/mdast" "^3.0.0" mdast-util-from-markdown "^1.0.0" mdast-util-to-markdown "^1.0.0" mdast-util-mdx-jsx@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/mdast-util-mdx-jsx/-/mdast-util-mdx-jsx-2.1.0.tgz#029f5a9c38485dbb5cf482059557ee7d788f1947" integrity sha512-KzgzfWMhdteDkrY4mQtyvTU5bc/W4ppxhe9SzelO6QUUiwLAM+Et2Dnjjprik74a336kHdo0zKm7Tp+n6FFeRg== dependencies: "@types/estree-jsx" "^1.0.0" "@types/hast" "^2.0.0" "@types/mdast" "^3.0.0" ccount "^2.0.0" mdast-util-to-markdown "^1.3.0" parse-entities "^4.0.0" stringify-entities "^4.0.0" unist-util-remove-position "^4.0.0" unist-util-stringify-position "^3.0.0" vfile-message "^3.0.0" mdast-util-mdx@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/mdast-util-mdx/-/mdast-util-mdx-2.0.0.tgz#dd4f6c993cf27da32725e50a04874f595b7b63fb" integrity sha512-M09lW0CcBT1VrJUaF/PYxemxxHa7SLDHdSn94Q9FhxjCQfuW7nMAWKWimTmA3OyDMSTH981NN1csW1X+HPSluw== dependencies: mdast-util-mdx-expression "^1.0.0" mdast-util-mdx-jsx "^2.0.0" mdast-util-mdxjs-esm "^1.0.0" mdast-util-mdxjs-esm@^1.0.0: version "1.3.0" resolved "https://registry.yarnpkg.com/mdast-util-mdxjs-esm/-/mdast-util-mdxjs-esm-1.3.0.tgz#137345ef827169aeeeb6069277cd3e090830ce9a" integrity sha512-7N5ihsOkAEGjFotIX9p/YPdl4TqUoMxL4ajNz7PbT89BqsdWJuBC9rvgt6wpbwTZqWWR0jKWqQbwsOWDBUZv4g== dependencies: "@types/estree-jsx" "^1.0.0" "@types/hast" "^2.0.0" "@types/mdast" "^3.0.0" mdast-util-from-markdown "^1.0.0" mdast-util-to-markdown "^1.0.0" mdast-util-to-hast@^12.1.0: version "12.2.2" resolved "https://registry.yarnpkg.com/mdast-util-to-hast/-/mdast-util-to-hast-12.2.2.tgz#2bd8cf985a67c90c181eadcfdd8d31b8798ed9a1" integrity sha512-lVkUttV9wqmdXFtEBXKcepvU/zfwbhjbkM5rxrquLW55dS1DfOrnAXCk5mg1be1sfY/WfMmayGy1NsbK1GLCYQ== dependencies: "@types/hast" "^2.0.0" "@types/mdast" "^3.0.0" "@types/mdurl" "^1.0.0" mdast-util-definitions "^5.0.0" mdurl "^1.0.0" micromark-util-sanitize-uri "^1.0.0" trim-lines "^3.0.0" unist-builder "^3.0.0" unist-util-generated "^2.0.0" unist-util-position "^4.0.0" unist-util-visit "^4.0.0" mdast-util-to-markdown@^1.0.0, mdast-util-to-markdown@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/mdast-util-to-markdown/-/mdast-util-to-markdown-1.3.0.tgz#38b6cdc8dc417de642a469c4fc2abdf8c931bd1e" integrity sha512-6tUSs4r+KK4JGTTiQ7FfHmVOaDrLQJPmpjD6wPMlHGUVXoG9Vjc3jIeP+uyBWRf8clwB2blM+W7+KrlMYQnftA== dependencies: "@types/mdast" "^3.0.0" "@types/unist" "^2.0.0" longest-streak "^3.0.0" mdast-util-to-string "^3.0.0" micromark-util-decode-string "^1.0.0" unist-util-visit "^4.0.0" zwitch "^2.0.0" mdast-util-to-string@^3.0.0, mdast-util-to-string@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/mdast-util-to-string/-/mdast-util-to-string-3.1.0.tgz#56c506d065fbf769515235e577b5a261552d56e9" integrity sha512-n4Vypz/DZgwo0iMHLQL49dJzlp7YtAJP+N07MZHpjPf/5XJuHUWstviF4Mn2jEiR/GNmtnRRqnwsXExk3igfFA== mdurl@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" integrity sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g== micromark-core-commonmark@^1.0.0, micromark-core-commonmark@^1.0.1: version "1.0.6" resolved "https://registry.yarnpkg.com/micromark-core-commonmark/-/micromark-core-commonmark-1.0.6.tgz#edff4c72e5993d93724a3c206970f5a15b0585ad" integrity sha512-K+PkJTxqjFfSNkfAhp4GB+cZPfQd6dxtTXnf+RjZOV7T4EEXnvgzOcnp+eSTmpGk9d1S9sL6/lqrgSNn/s0HZA== dependencies: decode-named-character-reference "^1.0.0" micromark-factory-destination "^1.0.0" micromark-factory-label "^1.0.0" micromark-factory-space "^1.0.0" micromark-factory-title "^1.0.0" micromark-factory-whitespace "^1.0.0" micromark-util-character "^1.0.0" micromark-util-chunked "^1.0.0" micromark-util-classify-character "^1.0.0" micromark-util-html-tag-name "^1.0.0" micromark-util-normalize-identifier "^1.0.0" micromark-util-resolve-all "^1.0.0" micromark-util-subtokenize "^1.0.0" micromark-util-symbol "^1.0.0" micromark-util-types "^1.0.1" uvu "^0.5.0" micromark-extension-gfm-autolink-literal@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-1.0.3.tgz#dc589f9c37eaff31a175bab49f12290edcf96058" integrity sha512-i3dmvU0htawfWED8aHMMAzAVp/F0Z+0bPh3YrbTPPL1v4YAlCZpy5rBO5p0LPYiZo0zFVkoYh7vDU7yQSiCMjg== dependencies: micromark-util-character "^1.0.0" micromark-util-sanitize-uri "^1.0.0" micromark-util-symbol "^1.0.0" micromark-util-types "^1.0.0" uvu "^0.5.0" micromark-extension-gfm-footnote@^1.0.0: version "1.0.4" resolved "https://registry.yarnpkg.com/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-1.0.4.tgz#cbfd8873b983e820c494498c6dac0105920818d5" integrity sha512-E/fmPmDqLiMUP8mLJ8NbJWJ4bTw6tS+FEQS8CcuDtZpILuOb2kjLqPEeAePF1djXROHXChM/wPJw0iS4kHCcIg== dependencies: micromark-core-commonmark "^1.0.0" micromark-factory-space "^1.0.0" micromark-util-character "^1.0.0" micromark-util-normalize-identifier "^1.0.0" micromark-util-sanitize-uri "^1.0.0" micromark-util-symbol "^1.0.0" micromark-util-types "^1.0.0" uvu "^0.5.0" micromark-extension-gfm-strikethrough@^1.0.0: version "1.0.4" resolved "https://registry.yarnpkg.com/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-1.0.4.tgz#162232c284ffbedd8c74e59c1525bda217295e18" integrity sha512-/vjHU/lalmjZCT5xt7CcHVJGq8sYRm80z24qAKXzaHzem/xsDYb2yLL+NNVbYvmpLx3O7SYPuGL5pzusL9CLIQ== dependencies: micromark-util-chunked "^1.0.0" micromark-util-classify-character "^1.0.0" micromark-util-resolve-all "^1.0.0" micromark-util-symbol "^1.0.0" micromark-util-types "^1.0.0" uvu "^0.5.0" micromark-extension-gfm-table@^1.0.0: version "1.0.5" resolved "https://registry.yarnpkg.com/micromark-extension-gfm-table/-/micromark-extension-gfm-table-1.0.5.tgz#7b708b728f8dc4d95d486b9e7a2262f9cddbcbb4" integrity sha512-xAZ8J1X9W9K3JTJTUL7G6wSKhp2ZYHrFk5qJgY/4B33scJzE2kpfRL6oiw/veJTbt7jiM/1rngLlOKPWr1G+vg== dependencies: micromark-factory-space "^1.0.0" micromark-util-character "^1.0.0" micromark-util-symbol "^1.0.0" micromark-util-types "^1.0.0" uvu "^0.5.0" micromark-extension-gfm-tagfilter@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-1.0.1.tgz#fb2e303f7daf616db428bb6a26e18fda14a90a4d" integrity sha512-Ty6psLAcAjboRa/UKUbbUcwjVAv5plxmpUTy2XC/3nJFL37eHej8jrHrRzkqcpipJliuBH30DTs7+3wqNcQUVA== dependencies: micromark-util-types "^1.0.0" micromark-extension-gfm-task-list-item@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-1.0.3.tgz#7683641df5d4a09795f353574d7f7f66e47b7fc4" integrity sha512-PpysK2S1Q/5VXi72IIapbi/jliaiOFzv7THH4amwXeYXLq3l1uo8/2Be0Ac1rEwK20MQEsGH2ltAZLNY2KI/0Q== dependencies: micromark-factory-space "^1.0.0" micromark-util-character "^1.0.0" micromark-util-symbol "^1.0.0" micromark-util-types "^1.0.0" uvu "^0.5.0" micromark-extension-gfm@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/micromark-extension-gfm/-/micromark-extension-gfm-2.0.1.tgz#40f3209216127a96297c54c67f5edc7ef2d1a2a2" integrity sha512-p2sGjajLa0iYiGQdT0oelahRYtMWvLjy8J9LOCxzIQsllMCGLbsLW+Nc+N4vi02jcRJvedVJ68cjelKIO6bpDA== dependencies: micromark-extension-gfm-autolink-literal "^1.0.0" micromark-extension-gfm-footnote "^1.0.0" micromark-extension-gfm-strikethrough "^1.0.0" micromark-extension-gfm-table "^1.0.0" micromark-extension-gfm-tagfilter "^1.0.0" micromark-extension-gfm-task-list-item "^1.0.0" micromark-util-combine-extensions "^1.0.0" micromark-util-types "^1.0.0" micromark-extension-mdx-expression@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/micromark-extension-mdx-expression/-/micromark-extension-mdx-expression-1.0.3.tgz#cd3843573921bf55afcfff4ae0cd2e857a16dcfa" integrity sha512-TjYtjEMszWze51NJCZmhv7MEBcgYRgb3tJeMAJ+HQCAaZHHRBaDCccqQzGizR/H4ODefP44wRTgOn2vE5I6nZA== dependencies: micromark-factory-mdx-expression "^1.0.0" micromark-factory-space "^1.0.0" micromark-util-character "^1.0.0" micromark-util-events-to-acorn "^1.0.0" micromark-util-symbol "^1.0.0" micromark-util-types "^1.0.0" uvu "^0.5.0" micromark-extension-mdx-jsx@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/micromark-extension-mdx-jsx/-/micromark-extension-mdx-jsx-1.0.3.tgz#9f196be5f65eb09d2a49b237a7b3398bba2999be" integrity sha512-VfA369RdqUISF0qGgv2FfV7gGjHDfn9+Qfiv5hEwpyr1xscRj/CiVRkU7rywGFCO7JwJ5L0e7CJz60lY52+qOA== dependencies: "@types/acorn" "^4.0.0" estree-util-is-identifier-name "^2.0.0" micromark-factory-mdx-expression "^1.0.0" micromark-factory-space "^1.0.0" micromark-util-character "^1.0.0" micromark-util-symbol "^1.0.0" micromark-util-types "^1.0.0" uvu "^0.5.0" vfile-message "^3.0.0" micromark-extension-mdx-md@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/micromark-extension-mdx-md/-/micromark-extension-mdx-md-1.0.0.tgz#382f5df9ee3706dd120b51782a211f31f4760d22" integrity sha512-xaRAMoSkKdqZXDAoSgp20Azm0aRQKGOl0RrS81yGu8Hr/JhMsBmfs4wR7m9kgVUIO36cMUQjNyiyDKPrsv8gOw== dependencies: micromark-util-types "^1.0.0" micromark-extension-mdxjs-esm@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/micromark-extension-mdxjs-esm/-/micromark-extension-mdxjs-esm-1.0.3.tgz#630d9dc9db2c2fd470cac8c1e7a824851267404d" integrity sha512-2N13ol4KMoxb85rdDwTAC6uzs8lMX0zeqpcyx7FhS7PxXomOnLactu8WI8iBNXW8AVyea3KIJd/1CKnUmwrK9A== dependencies: micromark-core-commonmark "^1.0.0" micromark-util-character "^1.0.0" micromark-util-events-to-acorn "^1.0.0" micromark-util-symbol "^1.0.0" micromark-util-types "^1.0.0" unist-util-position-from-estree "^1.1.0" uvu "^0.5.0" vfile-message "^3.0.0" micromark-extension-mdxjs@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/micromark-extension-mdxjs/-/micromark-extension-mdxjs-1.0.0.tgz#772644e12fc8299a33e50f59c5aa15727f6689dd" integrity sha512-TZZRZgeHvtgm+IhtgC2+uDMR7h8eTKF0QUX9YsgoL9+bADBpBY6SiLvWqnBlLbCEevITmTqmEuY3FoxMKVs1rQ== dependencies: acorn "^8.0.0" acorn-jsx "^5.0.0" micromark-extension-mdx-expression "^1.0.0" micromark-extension-mdx-jsx "^1.0.0" micromark-extension-mdx-md "^1.0.0" micromark-extension-mdxjs-esm "^1.0.0" micromark-util-combine-extensions "^1.0.0" micromark-util-types "^1.0.0" micromark-factory-destination@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/micromark-factory-destination/-/micromark-factory-destination-1.0.0.tgz#fef1cb59ad4997c496f887b6977aa3034a5a277e" integrity sha512-eUBA7Rs1/xtTVun9TmV3gjfPz2wEwgK5R5xcbIM5ZYAtvGF6JkyaDsj0agx8urXnO31tEO6Ug83iVH3tdedLnw== dependencies: micromark-util-character "^1.0.0" micromark-util-symbol "^1.0.0" micromark-util-types "^1.0.0" micromark-factory-label@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/micromark-factory-label/-/micromark-factory-label-1.0.2.tgz#6be2551fa8d13542fcbbac478258fb7a20047137" integrity sha512-CTIwxlOnU7dEshXDQ+dsr2n+yxpP0+fn271pu0bwDIS8uqfFcumXpj5mLn3hSC8iw2MUr6Gx8EcKng1dD7i6hg== dependencies: micromark-util-character "^1.0.0" micromark-util-symbol "^1.0.0" micromark-util-types "^1.0.0" uvu "^0.5.0" micromark-factory-mdx-expression@^1.0.0: version "1.0.6" resolved "https://registry.yarnpkg.com/micromark-factory-mdx-expression/-/micromark-factory-mdx-expression-1.0.6.tgz#917e17d16e6e9c2551f3a862e6a9ebdd22056476" integrity sha512-WRQIc78FV7KrCfjsEf/sETopbYjElh3xAmNpLkd1ODPqxEngP42eVRGbiPEQWpRV27LzqW+XVTvQAMIIRLPnNA== dependencies: micromark-factory-space "^1.0.0" micromark-util-character "^1.0.0" micromark-util-events-to-acorn "^1.0.0" micromark-util-symbol "^1.0.0" micromark-util-types "^1.0.0" unist-util-position-from-estree "^1.0.0" uvu "^0.5.0" vfile-message "^3.0.0" micromark-factory-space@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/micromark-factory-space/-/micromark-factory-space-1.0.0.tgz#cebff49968f2b9616c0fcb239e96685cb9497633" integrity sha512-qUmqs4kj9a5yBnk3JMLyjtWYN6Mzfcx8uJfi5XAveBniDevmZasdGBba5b4QsvRcAkmvGo5ACmSUmyGiKTLZew== dependencies: micromark-util-character "^1.0.0" micromark-util-types "^1.0.0" micromark-factory-title@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/micromark-factory-title/-/micromark-factory-title-1.0.2.tgz#7e09287c3748ff1693930f176e1c4a328382494f" integrity sha512-zily+Nr4yFqgMGRKLpTVsNl5L4PMu485fGFDOQJQBl2NFpjGte1e86zC0da93wf97jrc4+2G2GQudFMHn3IX+A== dependencies: micromark-factory-space "^1.0.0" micromark-util-character "^1.0.0" micromark-util-symbol "^1.0.0" micromark-util-types "^1.0.0" uvu "^0.5.0" micromark-factory-whitespace@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/micromark-factory-whitespace/-/micromark-factory-whitespace-1.0.0.tgz#e991e043ad376c1ba52f4e49858ce0794678621c" integrity sha512-Qx7uEyahU1lt1RnsECBiuEbfr9INjQTGa6Err+gF3g0Tx4YEviPbqqGKNv/NrBaE7dVHdn1bVZKM/n5I/Bak7A== dependencies: micromark-factory-space "^1.0.0" micromark-util-character "^1.0.0" micromark-util-symbol "^1.0.0" micromark-util-types "^1.0.0" micromark-util-character@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/micromark-util-character/-/micromark-util-character-1.1.0.tgz#d97c54d5742a0d9611a68ca0cd4124331f264d86" integrity sha512-agJ5B3unGNJ9rJvADMJ5ZiYjBRyDpzKAOk01Kpi1TKhlT1APx3XZk6eN7RtSz1erbWHC2L8T3xLZ81wdtGRZzg== dependencies: micromark-util-symbol "^1.0.0" micromark-util-types "^1.0.0" micromark-util-chunked@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/micromark-util-chunked/-/micromark-util-chunked-1.0.0.tgz#5b40d83f3d53b84c4c6bce30ed4257e9a4c79d06" integrity sha512-5e8xTis5tEZKgesfbQMKRCyzvffRRUX+lK/y+DvsMFdabAicPkkZV6gO+FEWi9RfuKKoxxPwNL+dFF0SMImc1g== dependencies: micromark-util-symbol "^1.0.0" micromark-util-classify-character@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/micromark-util-classify-character/-/micromark-util-classify-character-1.0.0.tgz#cbd7b447cb79ee6997dd274a46fc4eb806460a20" integrity sha512-F8oW2KKrQRb3vS5ud5HIqBVkCqQi224Nm55o5wYLzY/9PwHGXC01tr3d7+TqHHz6zrKQ72Okwtvm/xQm6OVNZA== dependencies: micromark-util-character "^1.0.0" micromark-util-symbol "^1.0.0" micromark-util-types "^1.0.0" micromark-util-combine-extensions@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/micromark-util-combine-extensions/-/micromark-util-combine-extensions-1.0.0.tgz#91418e1e74fb893e3628b8d496085639124ff3d5" integrity sha512-J8H058vFBdo/6+AsjHp2NF7AJ02SZtWaVUjsayNFeAiydTxUwViQPxN0Hf8dp4FmCQi0UUFovFsEyRSUmFH3MA== dependencies: micromark-util-chunked "^1.0.0" micromark-util-types "^1.0.0" micromark-util-decode-numeric-character-reference@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-1.0.0.tgz#dcc85f13b5bd93ff8d2868c3dba28039d490b946" integrity sha512-OzO9AI5VUtrTD7KSdagf4MWgHMtET17Ua1fIpXTpuhclCqD8egFWo85GxSGvxgkGS74bEahvtM0WP0HjvV0e4w== dependencies: micromark-util-symbol "^1.0.0" micromark-util-decode-string@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/micromark-util-decode-string/-/micromark-util-decode-string-1.0.2.tgz#942252ab7a76dec2dbf089cc32505ee2bc3acf02" integrity sha512-DLT5Ho02qr6QWVNYbRZ3RYOSSWWFuH3tJexd3dgN1odEuPNxCngTCXJum7+ViRAd9BbdxCvMToPOD/IvVhzG6Q== dependencies: decode-named-character-reference "^1.0.0" micromark-util-character "^1.0.0" micromark-util-decode-numeric-character-reference "^1.0.0" micromark-util-symbol "^1.0.0" micromark-util-encode@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/micromark-util-encode/-/micromark-util-encode-1.0.1.tgz#2c1c22d3800870ad770ece5686ebca5920353383" integrity sha512-U2s5YdnAYexjKDel31SVMPbfi+eF8y1U4pfiRW/Y8EFVCy/vgxk/2wWTxzcqE71LHtCuCzlBDRU2a5CQ5j+mQA== micromark-util-events-to-acorn@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/micromark-util-events-to-acorn/-/micromark-util-events-to-acorn-1.2.0.tgz#65785cb77299d791bfefdc6a5213ab57ceead115" integrity sha512-WWp3bf7xT9MppNuw3yPjpnOxa8cj5ACivEzXJKu0WwnjBYfzaBvIAT9KfeyI0Qkll+bfQtfftSwdgTH6QhTOKw== dependencies: "@types/acorn" "^4.0.0" "@types/estree" "^1.0.0" estree-util-visit "^1.0.0" micromark-util-types "^1.0.0" uvu "^0.5.0" vfile-location "^4.0.0" vfile-message "^3.0.0" micromark-util-html-tag-name@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/micromark-util-html-tag-name/-/micromark-util-html-tag-name-1.1.0.tgz#eb227118befd51f48858e879b7a419fc0df20497" integrity sha512-BKlClMmYROy9UiV03SwNmckkjn8QHVaWkqoAqzivabvdGcwNGMMMH/5szAnywmsTBUzDsU57/mFi0sp4BQO6dA== micromark-util-normalize-identifier@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-1.0.0.tgz#4a3539cb8db954bbec5203952bfe8cedadae7828" integrity sha512-yg+zrL14bBTFrQ7n35CmByWUTFsgst5JhA4gJYoty4Dqzj4Z4Fr/DHekSS5aLfH9bdlfnSvKAWsAgJhIbogyBg== dependencies: micromark-util-symbol "^1.0.0" micromark-util-resolve-all@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/micromark-util-resolve-all/-/micromark-util-resolve-all-1.0.0.tgz#a7c363f49a0162e931960c44f3127ab58f031d88" integrity sha512-CB/AGk98u50k42kvgaMM94wzBqozSzDDaonKU7P7jwQIuH2RU0TeBqGYJz2WY1UdihhjweivStrJ2JdkdEmcfw== dependencies: micromark-util-types "^1.0.0" micromark-util-sanitize-uri@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-1.0.0.tgz#27dc875397cd15102274c6c6da5585d34d4f12b2" integrity sha512-cCxvBKlmac4rxCGx6ejlIviRaMKZc0fWm5HdCHEeDWRSkn44l6NdYVRyU+0nT1XC72EQJMZV8IPHF+jTr56lAg== dependencies: micromark-util-character "^1.0.0" micromark-util-encode "^1.0.0" micromark-util-symbol "^1.0.0" micromark-util-subtokenize@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/micromark-util-subtokenize/-/micromark-util-subtokenize-1.0.2.tgz#ff6f1af6ac836f8bfdbf9b02f40431760ad89105" integrity sha512-d90uqCnXp/cy4G881Ub4psE57Sf8YD0pim9QdjCRNjfas2M1u6Lbt+XZK9gnHL2XFhnozZiEdCa9CNfXSfQ6xA== dependencies: micromark-util-chunked "^1.0.0" micromark-util-symbol "^1.0.0" micromark-util-types "^1.0.0" uvu "^0.5.0" micromark-util-symbol@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/micromark-util-symbol/-/micromark-util-symbol-1.0.1.tgz#b90344db62042ce454f351cf0bebcc0a6da4920e" integrity sha512-oKDEMK2u5qqAptasDAwWDXq0tG9AssVwAx3E9bBF3t/shRIGsWIRG+cGafs2p/SnDSOecnt6hZPCE2o6lHfFmQ== micromark-util-types@^1.0.0, micromark-util-types@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/micromark-util-types/-/micromark-util-types-1.0.2.tgz#f4220fdb319205812f99c40f8c87a9be83eded20" integrity sha512-DCfg/T8fcrhrRKTPjRrw/5LLvdGV7BHySf/1LOZx7TzWZdYRjogNtyNq885z3nNallwr3QUKARjqvHqX1/7t+w== micromark@^3.0.0: version "3.0.10" resolved "https://registry.yarnpkg.com/micromark/-/micromark-3.0.10.tgz#1eac156f0399d42736458a14b0ca2d86190b457c" integrity sha512-ryTDy6UUunOXy2HPjelppgJ2sNfcPz1pLlMdA6Rz9jPzhLikWXv/irpWV/I2jd68Uhmny7hHxAlAhk4+vWggpg== dependencies: "@types/debug" "^4.0.0" debug "^4.0.0" decode-named-character-reference "^1.0.0" micromark-core-commonmark "^1.0.1" micromark-factory-space "^1.0.0" micromark-util-character "^1.0.0" micromark-util-chunked "^1.0.0" micromark-util-combine-extensions "^1.0.0" micromark-util-decode-numeric-character-reference "^1.0.0" micromark-util-encode "^1.0.0" micromark-util-normalize-identifier "^1.0.0" micromark-util-resolve-all "^1.0.0" micromark-util-sanitize-uri "^1.0.0" micromark-util-subtokenize "^1.0.0" micromark-util-symbol "^1.0.0" micromark-util-types "^1.0.1" uvu "^0.5.0" mri@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/mri/-/mri-1.2.0.tgz#6721480fec2a11a4889861115a48b6cbe7cc8f0b" integrity sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA== ms@2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== nanoid@^3.3.4: version "3.3.4" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab" integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw== next-themes@^0.2.0-beta.2: version "0.2.1" resolved "https://registry.yarnpkg.com/next-themes/-/next-themes-0.2.1.tgz#0c9f128e847979daf6c67f70b38e6b6567856e45" integrity sha512-B+AKNfYNIzh0vqQQKqQItTS8evEouKD7H5Hj3kmuPERwddR2TxvDSFZuTj6T7Jfn1oyeUyJMydPl1Bkxkh0W7A== next@^12.3.1: version "12.3.1" resolved "https://registry.yarnpkg.com/next/-/next-12.3.1.tgz#127b825ad2207faf869b33393ec8c75fe61e50f1" integrity sha512-l7bvmSeIwX5lp07WtIiP9u2ytZMv7jIeB8iacR28PuUEFG5j0HGAPnMqyG5kbZNBG2H7tRsrQ4HCjuMOPnANZw== dependencies: "@next/env" "12.3.1" "@swc/helpers" "0.4.11" caniuse-lite "^1.0.30001406" postcss "8.4.14" styled-jsx "5.0.7" use-sync-external-store "1.2.0" optionalDependencies: "@next/swc-android-arm-eabi" "12.3.1" "@next/swc-android-arm64" "12.3.1" "@next/swc-darwin-arm64" "12.3.1" "@next/swc-darwin-x64" "12.3.1" "@next/swc-freebsd-x64" "12.3.1" "@next/swc-linux-arm-gnueabihf" "12.3.1" "@next/swc-linux-arm64-gnu" "12.3.1" "@next/swc-linux-arm64-musl" "12.3.1" "@next/swc-linux-x64-gnu" "12.3.1" "@next/swc-linux-x64-musl" "12.3.1" "@next/swc-win32-arm64-msvc" "12.3.1" "@next/swc-win32-ia32-msvc" "12.3.1" "@next/swc-win32-x64-msvc" "12.3.1" nextra-theme-docs@2.0.0-beta.29: version "2.0.0-beta.29" resolved "https://registry.yarnpkg.com/nextra-theme-docs/-/nextra-theme-docs-2.0.0-beta.29.tgz#febfaaee75bbe8bd0df744a4da5739c7b9594a8c" integrity sha512-2oGsuOv7sMxnsYPM6+qI7F0Rcq9cMTtClwa8MeOdn0FCtMjhxJjfeLxpDvXrELkVNOU9/Bg1SFHxHTLpt0/Xjw== dependencies: "@headlessui/react" "^1.6.6" "@mdx-js/react" "^2.1.2" "@popperjs/core" "^2.11.6" "@reach/skip-nav" "^0.17.0" clsx "^1.2.1" flexsearch "^0.7.21" focus-visible "^5.2.0" github-slugger "^1.4.0" intersection-observer "^0.12.2" match-sorter "^6.3.1" next-themes "^0.2.0-beta.2" parse-git-url "^1.0.1" scroll-into-view-if-needed "^2.2.29" nextra@2.0.0-beta.29: version "2.0.0-beta.29" resolved "https://registry.yarnpkg.com/nextra/-/nextra-2.0.0-beta.29.tgz#128383f84e8bcf8826a2f2ad594db945268fcb0e" integrity sha512-UjsaoMNsJRG0fbzqgoLDXgvJwcSJxwPr+ojBBjJsaZ6fu5+cwbCx8wXazA0y5sSxGw75fG6D1I7rS6pflHctuQ== dependencies: "@mdx-js/mdx" "^2.1.3" "@napi-rs/simple-git" "^0.1.8" github-slugger "^1.4.0" graceful-fs "^4.2.10" gray-matter "^4.0.3" rehype-mdx-title "^1.0.0" rehype-pretty-code "0.2.4" remark-gfm "^3.0.1" remark-reading-time "^2.0.1" shiki "0.10.1" slash "^3.0.0" title "^3.5.3" unist-util-visit "^4.1.1" npm-run-path@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" integrity sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw== dependencies: path-key "^2.0.0" object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" integrity sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow== parse-entities@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-4.0.0.tgz#f67c856d4e3fe19b1a445c3fabe78dcdc1053eeb" integrity sha512-5nk9Fn03x3rEhGaX1FU6IDwG/k+GxLXlFAkgrbM1asuAFl3BhdQWvASaIsmwWypRNcZKHPYnIuOSfIWEyEQnPQ== dependencies: "@types/unist" "^2.0.0" character-entities "^2.0.0" character-entities-legacy "^3.0.0" character-reference-invalid "^2.0.0" decode-named-character-reference "^1.0.0" is-alphanumerical "^2.0.0" is-decimal "^2.0.0" is-hexadecimal "^2.0.0" parse-git-url@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/parse-git-url/-/parse-git-url-1.0.1.tgz#92bdaf615a7e24d32bea3bf955ee90a9050aeb57" integrity sha512-Zukjztu09UXpXV/Q+4vgwyVPzUBkUvDjlqHlpG+swv/zYzed/5Igw/33rIEJxFDRc5LxvEqYDVDzhBfnOLWDYw== parse-numeric-range@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/parse-numeric-range/-/parse-numeric-range-1.3.0.tgz#7c63b61190d61e4d53a1197f0c83c47bb670ffa3" integrity sha512-twN+njEipszzlMJd4ONUYgSfZPDxgHhT9Ahed5uTigpQn90FggW4SA/AIPq/6a149fTbE9qBEcSwE3FAEp6wQQ== path-key@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" integrity sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw== periscopic@^3.0.0: version "3.0.4" resolved "https://registry.yarnpkg.com/periscopic/-/periscopic-3.0.4.tgz#b3fbed0d1bc844976b977173ca2cd4a0ef4fa8d1" integrity sha512-SFx68DxCv0Iyo6APZuw/AKewkkThGwssmU0QWtTlvov3VAtPX+QJ4CadwSaz8nrT5jPIuxdvJWB4PnD2KNDxQg== dependencies: estree-walker "^3.0.0" is-reference "^3.0.0" picocolors@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== postcss@8.4.14: version "8.4.14" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.14.tgz#ee9274d5622b4858c1007a74d76e42e56fd21caf" integrity sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig== dependencies: nanoid "^3.3.4" picocolors "^1.0.0" source-map-js "^1.0.2" property-information@^6.0.0: version "6.1.1" resolved "https://registry.yarnpkg.com/property-information/-/property-information-6.1.1.tgz#5ca85510a3019726cb9afed4197b7b8ac5926a22" integrity sha512-hrzC564QIl0r0vy4l6MvRLhafmUowhO/O3KgVSoXIbbA2Sz4j8HGpJc6T2cubRVwMwpdiG/vKGfhT4IixmKN9w== pseudomap@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" integrity sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ== react-dom@^17.0.1: version "17.0.2" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.2.tgz#ecffb6845e3ad8dbfcdc498f0d0a939736502c23" integrity sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" scheduler "^0.20.2" react@^17.0.1: version "17.0.2" resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037" integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" reading-time@^1.3.0: version "1.5.0" resolved "https://registry.yarnpkg.com/reading-time/-/reading-time-1.5.0.tgz#d2a7f1b6057cb2e169beaf87113cc3411b5bc5bb" integrity sha512-onYyVhBNr4CmAxFsKS7bz+uTLRakypIe4R+5A824vBSkQy/hB3fZepoVEf8OVAxzLvK+H/jm9TzpI3ETSm64Kg== regenerator-runtime@^0.13.4: version "0.13.9" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52" integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA== rehype-mdx-title@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/rehype-mdx-title/-/rehype-mdx-title-1.0.0.tgz#292598b5ad8af2c2bd01b3674caea1a44bb60f63" integrity sha512-5B/53Y+KQHm4/nrE6pIIPc9Ie2fbPMCLs8WwMGYWWHr+5g3TkmEijRkr8TGYHULtc+C7bOoPR8LIF5DpGROIDg== dependencies: estree-util-is-identifier-name "^1.1.0" hast-util-to-string "^1.0.4" unist-util-visit "^2.0.3" rehype-pretty-code@0.2.4: version "0.2.4" resolved "https://registry.yarnpkg.com/rehype-pretty-code/-/rehype-pretty-code-0.2.4.tgz#73b1e1c3ca7f50aaeeb131185a744a5ea936a08f" integrity sha512-vbqwIa4cNwRaVur9caUw/b0jOQR88Svrs9c9RaQoogvbBxs5X9bWrSe5oFypaRTTq2cpZ45YzJQ7UUPO76LMKA== dependencies: parse-numeric-range "^1.3.0" remark-gfm@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/remark-gfm/-/remark-gfm-3.0.1.tgz#0b180f095e3036545e9dddac0e8df3fa5cfee54f" integrity sha512-lEFDoi2PICJyNrACFOfDD3JlLkuSbOa5Wd8EPt06HUdptv8Gn0bxYTdbU/XXQ3swAPkEaGxxPN9cbnMHvVu1Ig== dependencies: "@types/mdast" "^3.0.0" mdast-util-gfm "^2.0.0" micromark-extension-gfm "^2.0.0" unified "^10.0.0" remark-mdx@^2.0.0: version "2.1.3" resolved "https://registry.yarnpkg.com/remark-mdx/-/remark-mdx-2.1.3.tgz#6273e8b94d27ade35407a63bc8cdd04592f7be9f" integrity sha512-3SmtXOy9+jIaVctL8Cs3VAQInjRLGOwNXfrBB9KCT+EpJpKD3PQiy0x8hUNGyjQmdyOs40BqgPU7kYtH9uoR6w== dependencies: mdast-util-mdx "^2.0.0" micromark-extension-mdxjs "^1.0.0" remark-parse@^10.0.0: version "10.0.1" resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-10.0.1.tgz#6f60ae53edbf0cf38ea223fe643db64d112e0775" integrity sha512-1fUyHr2jLsVOkhbvPRBJ5zTKZZyD6yZzYaWCS6BPBdQ8vEMBCH+9zNCDA6tET/zHCi/jLqjCWtlJZUPk+DbnFw== dependencies: "@types/mdast" "^3.0.0" mdast-util-from-markdown "^1.0.0" unified "^10.0.0" remark-reading-time@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/remark-reading-time/-/remark-reading-time-2.0.1.tgz#fe8bb8e420db7678dc749385167adb4fc99318f7" integrity sha512-fy4BKy9SRhtYbEHvp6AItbRTnrhiDGbqLQTSYVbQPGuRCncU1ubSsh9p/W5QZSxtYcUXv8KGL0xBgPLyNJA1xw== dependencies: estree-util-is-identifier-name "^2.0.0" estree-util-value-to-estree "^1.3.0" reading-time "^1.3.0" unist-util-visit "^3.1.0" remark-rehype@^10.0.0: version "10.1.0" resolved "https://registry.yarnpkg.com/remark-rehype/-/remark-rehype-10.1.0.tgz#32dc99d2034c27ecaf2e0150d22a6dcccd9a6279" integrity sha512-EFmR5zppdBp0WQeDVZ/b66CWJipB2q2VLNFMabzDSGR66Z2fQii83G5gTBbgGEnEEA0QRussvrFHxk1HWGJskw== dependencies: "@types/hast" "^2.0.0" "@types/mdast" "^3.0.0" mdast-util-to-hast "^12.1.0" unified "^10.0.0" remove-accents@0.4.2: version "0.4.2" resolved "https://registry.yarnpkg.com/remove-accents/-/remove-accents-0.4.2.tgz#0a43d3aaae1e80db919e07ae254b285d9e1c7bb5" integrity sha512-7pXIJqJOq5tFgG1A2Zxti3Ht8jJF337m4sowbuHsW30ZnkQFnDzy9qBNhgzX8ZLW4+UBcXiiR7SwR6pokHsxiA== sade@^1.7.3: version "1.8.1" resolved "https://registry.yarnpkg.com/sade/-/sade-1.8.1.tgz#0a78e81d658d394887be57d2a409bf703a3b2701" integrity sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A== dependencies: mri "^1.1.0" scheduler@^0.20.2: version "0.20.2" resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.2.tgz#4baee39436e34aa93b4874bddcbf0fe8b8b50e91" integrity sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" scroll-into-view-if-needed@^2.2.29: version "2.2.29" resolved "https://registry.yarnpkg.com/scroll-into-view-if-needed/-/scroll-into-view-if-needed-2.2.29.tgz#551791a84b7e2287706511f8c68161e4990ab885" integrity sha512-hxpAR6AN+Gh53AdAimHM6C8oTN1ppwVZITihix+WqalywBeFcQ6LdQP5ABNl26nX8GTEL7VT+b8lKpdqq65wXg== dependencies: compute-scroll-into-view "^1.0.17" section-matter@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/section-matter/-/section-matter-1.0.0.tgz#e9041953506780ec01d59f292a19c7b850b84167" integrity sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA== dependencies: extend-shallow "^2.0.1" kind-of "^6.0.0" shebang-command@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" integrity sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg== dependencies: shebang-regex "^1.0.0" shebang-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" integrity sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ== shiki@0.10.1: version "0.10.1" resolved "https://registry.yarnpkg.com/shiki/-/shiki-0.10.1.tgz#6f9a16205a823b56c072d0f1a0bcd0f2646bef14" integrity sha512-VsY7QJVzU51j5o1+DguUd+6vmCmZ5v/6gYu4vyYAhzjuNQU6P/vmSy4uQaOhvje031qQMiW0d2BwgMH52vqMng== dependencies: jsonc-parser "^3.0.0" vscode-oniguruma "^1.6.1" vscode-textmate "5.2.0" signal-exit@^3.0.0: version "3.0.7" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== slash@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== source-map-js@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== source-map@^0.7.0: version "0.7.4" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.4.tgz#a9bbe705c9d8846f4e08ff6765acf0f1b0898656" integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA== space-separated-tokens@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-2.0.1.tgz#43193cec4fb858a2ce934b7f98b7f2c18107098b" integrity sha512-ekwEbFp5aqSPKaqeY1PGrlGQxPNaq+Cnx4+bE2D8sciBQrHpbwoBbawqTN2+6jPs9IdWxxiUcN0K2pkczD3zmw== sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== stringify-entities@^4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/stringify-entities/-/stringify-entities-4.0.3.tgz#cfabd7039d22ad30f3cc435b0ca2c1574fc88ef8" integrity sha512-BP9nNHMhhfcMbiuQKCqMjhDP5yBCAxsPu4pHFFzJ6Alo9dZgY4VLDPutXqIjpRiMoKdp7Av85Gr73Q5uH9k7+g== dependencies: character-entities-html4 "^2.0.0" character-entities-legacy "^3.0.0" strip-bom-string@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-bom-string/-/strip-bom-string-1.0.0.tgz#e5211e9224369fbb81d633a2f00044dc8cedad92" integrity sha512-uCC2VHvQRYu+lMh4My/sFNmF2klFymLX1wHJeXnbEJERpV/ZsVuonzerjfrGpIGF7LBVa1O7i9kjiWvJiFck8g== strip-eof@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" integrity sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q== style-to-object@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/style-to-object/-/style-to-object-0.3.0.tgz#b1b790d205991cc783801967214979ee19a76e46" integrity sha512-CzFnRRXhzWIdItT3OmF8SQfWyahHhjq3HwcMNCNLn+N7klOOqPjMeG/4JSu77D7ypZdGvSzvkrbyeTMizz2VrA== dependencies: inline-style-parser "0.1.1" styled-jsx@5.0.7: version "5.0.7" resolved "https://registry.yarnpkg.com/styled-jsx/-/styled-jsx-5.0.7.tgz#be44afc53771b983769ac654d355ca8d019dff48" integrity sha512-b3sUzamS086YLRuvnaDigdAewz1/EFYlHpYBP5mZovKEdQQOIIYq8lApylub3HHZ6xFjV051kkGU7cudJmrXEA== supports-color@^4.0.0: version "4.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.5.0.tgz#be7a0de484dec5c5cddf8b3d59125044912f635b" integrity sha512-ycQR/UbvI9xIlEdQT1TQqwoXtEldExbCEAJgRo5YXlmSKjv6ThHnP9/vwGa1gr19Gfw+LkFd7KqYMhzrRC5JYw== dependencies: has-flag "^2.0.0" tiny-warning@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/tiny-warning/-/tiny-warning-1.0.3.tgz#94a30db453df4c643d0fd566060d60a875d84754" integrity sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA== title@^3.5.3: version "3.5.3" resolved "https://registry.yarnpkg.com/title/-/title-3.5.3.tgz#b338d701a3d949db6b49b2c86f409f9c2f36cd91" integrity sha512-20JyowYglSEeCvZv3EZ0nZ046vLarO37prvV0mbtQV7C8DJPGgN967r8SJkqd3XK3K3lD3/Iyfp3avjfil8Q2Q== dependencies: arg "1.0.0" chalk "2.3.0" clipboardy "1.2.2" titleize "1.0.0" titleize@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/titleize/-/titleize-1.0.0.tgz#7d350722061830ba6617631e0cfd3ea08398d95a" integrity sha512-TARUb7z1pGvlLxgPk++7wJ6aycXF3GJ0sNSBTAsTuJrQG5QuZlkUQP+zl+nbjAh4gMX9yDw9ZYklMd7vAfJKEw== trim-lines@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/trim-lines/-/trim-lines-3.0.1.tgz#d802e332a07df861c48802c04321017b1bd87338" integrity sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg== trough@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/trough/-/trough-2.1.0.tgz#0f7b511a4fde65a46f18477ab38849b22c554876" integrity sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g== tslib@^2.3.0, tslib@^2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== unified@^10.0.0: version "10.1.2" resolved "https://registry.yarnpkg.com/unified/-/unified-10.1.2.tgz#b1d64e55dafe1f0b98bb6c719881103ecf6c86df" integrity sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q== dependencies: "@types/unist" "^2.0.0" bail "^2.0.0" extend "^3.0.0" is-buffer "^2.0.0" is-plain-obj "^4.0.0" trough "^2.0.0" vfile "^5.0.0" unist-builder@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/unist-builder/-/unist-builder-3.0.0.tgz#728baca4767c0e784e1e64bb44b5a5a753021a04" integrity sha512-GFxmfEAa0vi9i5sd0R2kcrI9ks0r82NasRq5QHh2ysGngrc6GiqD5CDf1FjPenY4vApmFASBIIlk/jj5J5YbmQ== dependencies: "@types/unist" "^2.0.0" unist-util-generated@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/unist-util-generated/-/unist-util-generated-2.0.0.tgz#86fafb77eb6ce9bfa6b663c3f5ad4f8e56a60113" integrity sha512-TiWE6DVtVe7Ye2QxOVW9kqybs6cZexNwTwSMVgkfjEReqy/xwGpAXb99OxktoWwmL+Z+Epb0Dn8/GNDYP1wnUw== unist-util-is@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-4.1.0.tgz#976e5f462a7a5de73d94b706bac1b90671b57797" integrity sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg== unist-util-is@^5.0.0: version "5.1.1" resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-5.1.1.tgz#e8aece0b102fa9bc097b0fef8f870c496d4a6236" integrity sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ== unist-util-position-from-estree@^1.0.0, unist-util-position-from-estree@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/unist-util-position-from-estree/-/unist-util-position-from-estree-1.1.1.tgz#96f4d543dfb0428edc01ebb928570b602d280c4c" integrity sha512-xtoY50b5+7IH8tFbkw64gisG9tMSpxDjhX9TmaJJae/XuxQ9R/Kc8Nv1eOsf43Gt4KV/LkriMy9mptDr7XLcaw== dependencies: "@types/unist" "^2.0.0" unist-util-position@^4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/unist-util-position/-/unist-util-position-4.0.3.tgz#5290547b014f6222dff95c48d5c3c13a88fadd07" integrity sha512-p/5EMGIa1qwbXjA+QgcBXaPWjSnZfQ2Sc3yBEEfgPwsEmJd8Qh+DSk3LGnmOM4S1bY2C0AjmMnB8RuEYxpPwXQ== dependencies: "@types/unist" "^2.0.0" unist-util-remove-position@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/unist-util-remove-position/-/unist-util-remove-position-4.0.1.tgz#d5b46a7304ac114c8d91990ece085ca7c2c135c8" integrity sha512-0yDkppiIhDlPrfHELgB+NLQD5mfjup3a8UYclHruTJWmY74je8g+CIFr79x5f6AkmzSwlvKLbs63hC0meOMowQ== dependencies: "@types/unist" "^2.0.0" unist-util-visit "^4.0.0" unist-util-stringify-position@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-3.0.2.tgz#5c6aa07c90b1deffd9153be170dce628a869a447" integrity sha512-7A6eiDCs9UtjcwZOcCpM4aPII3bAAGv13E96IkawkOAW0OhH+yRxtY0lzo8KiHpzEMfH7Q+FizUmwp8Iqy5EWg== dependencies: "@types/unist" "^2.0.0" unist-util-visit-parents@^3.0.0: version "3.1.1" resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz#65a6ce698f78a6b0f56aa0e88f13801886cdaef6" integrity sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg== dependencies: "@types/unist" "^2.0.0" unist-util-is "^4.0.0" unist-util-visit-parents@^4.0.0: version "4.1.1" resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-4.1.1.tgz#e83559a4ad7e6048a46b1bdb22614f2f3f4724f2" integrity sha512-1xAFJXAKpnnJl8G7K5KgU7FY55y3GcLIXqkzUj5QF/QVP7biUm0K0O2oqVkYsdjzJKifYeWn9+o6piAK2hGSHw== dependencies: "@types/unist" "^2.0.0" unist-util-is "^5.0.0" unist-util-visit-parents@^5.0.0, unist-util-visit-parents@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-5.1.1.tgz#868f353e6fce6bf8fa875b251b0f4fec3be709bb" integrity sha512-gks4baapT/kNRaWxuGkl5BIhoanZo7sC/cUT/JToSRNL1dYoXRFl75d++NkjYk4TAu2uv2Px+l8guMajogeuiw== dependencies: "@types/unist" "^2.0.0" unist-util-is "^5.0.0" unist-util-visit@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-2.0.3.tgz#c3703893146df47203bb8a9795af47d7b971208c" integrity sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q== dependencies: "@types/unist" "^2.0.0" unist-util-is "^4.0.0" unist-util-visit-parents "^3.0.0" unist-util-visit@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-3.1.0.tgz#9420d285e1aee938c7d9acbafc8e160186dbaf7b" integrity sha512-Szoh+R/Ll68QWAyQyZZpQzZQm2UPbxibDvaY8Xc9SUtYgPsDzx5AWSk++UUt2hJuow8mvwR+rG+LQLw+KsuAKA== dependencies: "@types/unist" "^2.0.0" unist-util-is "^5.0.0" unist-util-visit-parents "^4.0.0" unist-util-visit@^4.0.0, unist-util-visit@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-4.1.1.tgz#1c4842d70bd3df6cc545276f5164f933390a9aad" integrity sha512-n9KN3WV9k4h1DxYR1LoajgN93wpEi/7ZplVe02IoB4gH5ctI1AaF2670BLHQYbwj+pY83gFtyeySFiyMHJklrg== dependencies: "@types/unist" "^2.0.0" unist-util-is "^5.0.0" unist-util-visit-parents "^5.1.1" use-sync-external-store@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz#7dbefd6ef3fe4e767a0cf5d7287aacfb5846928a" integrity sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA== uvu@^0.5.0: version "0.5.6" resolved "https://registry.yarnpkg.com/uvu/-/uvu-0.5.6.tgz#2754ca20bcb0bb59b64e9985e84d2e81058502df" integrity sha512-+g8ENReyr8YsOc6fv/NVJs2vFdHBnBNdfE49rshrTzDWOlUx4Gq7KOS2GD8eqhy2j+Ejq29+SbKH8yjkAqXqoA== dependencies: dequal "^2.0.0" diff "^5.0.0" kleur "^4.0.3" sade "^1.7.3" vfile-location@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/vfile-location/-/vfile-location-4.0.1.tgz#06f2b9244a3565bef91f099359486a08b10d3a95" integrity sha512-JDxPlTbZrZCQXogGheBHjbRWjESSPEak770XwWPfw5mTc1v1nWGLB/apzZxsx8a0SJVfF8HK8ql8RD308vXRUw== dependencies: "@types/unist" "^2.0.0" vfile "^5.0.0" vfile-message@^3.0.0: version "3.1.2" resolved "https://registry.yarnpkg.com/vfile-message/-/vfile-message-3.1.2.tgz#a2908f64d9e557315ec9d7ea3a910f658ac05f7d" integrity sha512-QjSNP6Yxzyycd4SVOtmKKyTsSvClqBPJcd00Z0zuPj3hOIjg0rUPG6DbFGPvUKRgYyaIWLPKpuEclcuvb3H8qA== dependencies: "@types/unist" "^2.0.0" unist-util-stringify-position "^3.0.0" vfile@^5.0.0: version "5.3.5" resolved "https://registry.yarnpkg.com/vfile/-/vfile-5.3.5.tgz#ec2e206b1414f561c85b7972bb1eeda8ab47ee61" integrity sha512-U1ho2ga33eZ8y8pkbQLH54uKqGhFJ6GYIHnnG5AhRpAh3OWjkrRHKa/KogbmQn8We+c0KVV3rTOgR9V/WowbXQ== dependencies: "@types/unist" "^2.0.0" is-buffer "^2.0.0" unist-util-stringify-position "^3.0.0" vfile-message "^3.0.0" vscode-oniguruma@^1.6.1: version "1.6.2" resolved "https://registry.yarnpkg.com/vscode-oniguruma/-/vscode-oniguruma-1.6.2.tgz#aeb9771a2f1dbfc9083c8a7fdd9cccaa3f386607" integrity sha512-KH8+KKov5eS/9WhofZR8M8dMHWN2gTxjMsG4jd04YhpbPR91fUj7rYQ2/XjeHCJWbg7X++ApRIU9NUwM2vTvLA== vscode-textmate@5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/vscode-textmate/-/vscode-textmate-5.2.0.tgz#01f01760a391e8222fe4f33fbccbd1ad71aed74e" integrity sha512-Uw5ooOQxRASHgu6C7GVvUxisKXfSgW4oFlO+aa+PAkgmH89O3CXxEEzNRNtHSqtXFTl0nAC1uYj0GMSH27uwtQ== which@^1.2.9: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== dependencies: isexe "^2.0.0" yallist@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" integrity sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A== zwitch@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/zwitch/-/zwitch-2.0.2.tgz#91f8d0e901ffa3d66599756dde7f57b17c95dce1" integrity sha512-JZxotl7SxAJH0j7dN4pxsTV6ZLXoLdGME+PsjkL/DaBrVryK9kTGq06GfKrwcSOqypP+fdXGoCHE36b99fWVoA== node-postgres-pg-8.14.1/lerna.json000066400000000000000000000002571476604072200170120ustar00rootroot00000000000000{ "packages": [ "packages/*" ], "npmClient": "yarn", "useWorkspaces": true, "version": "independent", "ignoreChanges": [ "**/*.md", "**/test/**" ] } node-postgres-pg-8.14.1/package.json000066400000000000000000000021301476604072200172740ustar00rootroot00000000000000{ "name": "node-postgres", "description": "node postgres monorepo", "main": "index.js", "private": true, "repository": "git@github.com:brianc/node-postgres.git", "author": "Brian M. Carlson ", "license": "MIT", "workspaces": [ "packages/*" ], "scripts": { "test": "yarn lerna exec yarn test", "build": "tsc --build", "build:watch": "tsc --build --watch", "docs:build": "cd docs && yarn build", "docs:start": "cd docs && yarn start", "pretest": "yarn build", "prepublish": "yarn build", "lint": "eslint --cache 'packages/**/*.{js,ts,tsx}'" }, "devDependencies": { "@typescript-eslint/eslint-plugin": "^7.0.0", "@typescript-eslint/parser": "^6.17.0", "eslint": "^8.56.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-node": "^11.1.0", "eslint-plugin-prettier": "^5.1.2", "lerna": "^3.19.0", "prettier": "3.0.3", "typescript": "^4.0.3" }, "prettier": { "semi": false, "printWidth": 120, "arrowParens": "always", "trailingComma": "es5", "singleQuote": true } } node-postgres-pg-8.14.1/packages/000077500000000000000000000000001476604072200165705ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg-cloudflare/000077500000000000000000000000001476604072200213145ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg-cloudflare/README.md000066400000000000000000000056271476604072200226050ustar00rootroot00000000000000# pg-cloudflare `pg-cloudflare` makes it easier to take an existing package that relies on `tls` and `net`, and make it work in environments where only `connect()` is supported, such as Cloudflare Workers. `pg-cloudflare` wraps `connect()`, the [TCP Socket API](https://github.com/wintercg/proposal-sockets-api) proposed within WinterCG, and implemented in [Cloudflare Workers](https://developers.cloudflare.com/workers/runtime-apis/tcp-sockets/), and exposes an interface with methods similar to what the `net` and `tls` modules in Node.js expose. (ex: `net.connect(path[, options][, callback])`). This minimizes the number of changes needed in order to make an existing package work across JavaScript runtimes. ## Installation ``` npm i --save-dev pg-cloudflare ``` ## How to use conditionally, in non-Node.js environments As implemented in `pg` [here](https://github.com/brianc/node-postgres/commit/07553428e9c0eacf761a5d4541a3300ff7859578#diff-34588ad868ebcb232660aba7ee6a99d1e02f4bc93f73497d2688c3f074e60533R5-R13), a typical use case might look as follows, where in a Node.js environment the `net` module is used, while in a non-Node.js environment, where `net` is unavailable, `pg-cloudflare` is used instead, providing an equivalent interface: ```js module.exports.getStream = function getStream(ssl = false) { const net = require('net') if (typeof net.Socket === 'function') { return net.Socket() } const { CloudflareSocket } = require('pg-cloudflare') return new CloudflareSocket(ssl); } ``` ## Node.js implementation of the Socket API proposal If you're looking for a way to rely on `connect()` as the interface you use to interact with raw sockets, but need this interface to be availble in a Node.js environment, [`@arrowood.dev/socket`](https://github.com/Ethan-Arrowood/socket) provides a Node.js implementation of the Socket API. ### license The MIT License (MIT) Copyright (c) 2023 Brian M. Carlson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. node-postgres-pg-8.14.1/packages/pg-cloudflare/package.json000066400000000000000000000013541476604072200236050ustar00rootroot00000000000000{ "name": "pg-cloudflare", "version": "1.1.1", "description": "A socket implementation that can run on Cloudflare Workers using native TCP connections.", "main": "dist/empty.js", "types": "dist/index.d.ts", "license": "MIT", "devDependencies": { "ts-node": "^8.5.4", "typescript": "^4.0.3" }, "exports": { "workerd": "./dist/index.js", "default": "./dist/empty.js" }, "scripts": { "build": "tsc", "build:watch": "tsc --watch", "prepublish": "yarn build", "test": "echo e2e test in pg package" }, "repository": { "type": "git", "url": "git://github.com/brianc/node-postgres.git", "directory": "packages/pg-cloudflare" }, "files": [ "/dist/*{js,ts,map}", "/src" ] } node-postgres-pg-8.14.1/packages/pg-cloudflare/src/000077500000000000000000000000001476604072200221035ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg-cloudflare/src/empty.ts000066400000000000000000000002201476604072200236030ustar00rootroot00000000000000// This is an empty module that is served up when outside of a workerd environment // See the `exports` field in package.json export default {} node-postgres-pg-8.14.1/packages/pg-cloudflare/src/index.ts000066400000000000000000000103521476604072200235630ustar00rootroot00000000000000import { SocketOptions, Socket, TlsOptions } from 'cloudflare:sockets' import { EventEmitter } from 'events' /** * Wrapper around the Cloudflare built-in socket that can be used by the `Connection`. */ export class CloudflareSocket extends EventEmitter { writable = false destroyed = false private _upgrading = false private _upgraded = false private _cfSocket: Socket | null = null private _cfWriter: WritableStreamDefaultWriter | null = null private _cfReader: ReadableStreamDefaultReader | null = null constructor(readonly ssl: boolean) { super() } setNoDelay() { return this } setKeepAlive() { return this } ref() { return this } unref() { return this } async connect(port: number, host: string, connectListener?: (...args: unknown[]) => void) { try { log('connecting') if (connectListener) this.once('connect', connectListener) const options: SocketOptions = this.ssl ? { secureTransport: 'starttls' } : {} const { connect } = await import('cloudflare:sockets') this._cfSocket = connect(`${host}:${port}`, options) this._cfWriter = this._cfSocket.writable.getWriter() this._addClosedHandler() this._cfReader = this._cfSocket.readable.getReader() if (this.ssl) { this._listenOnce().catch((e) => this.emit('error', e)) } else { this._listen().catch((e) => this.emit('error', e)) } await this._cfWriter!.ready log('socket ready') this.writable = true this.emit('connect') return this } catch (e) { this.emit('error', e) } } async _listen() { while (true) { log('awaiting receive from CF socket') const { done, value } = await this._cfReader!.read() log('CF socket received:', done, value) if (done) { log('done') break } this.emit('data', Buffer.from(value)) } } async _listenOnce() { log('awaiting first receive from CF socket') const { done, value } = await this._cfReader!.read() log('First CF socket received:', done, value) this.emit('data', Buffer.from(value)) } write( data: Uint8Array | string, encoding: BufferEncoding = 'utf8', callback: (...args: unknown[]) => void = () => {} ) { if (data.length === 0) return callback() if (typeof data === 'string') data = Buffer.from(data, encoding) log('sending data direct:', data) this._cfWriter!.write(data).then( () => { log('data sent') callback() }, (err) => { log('send error', err) callback(err) } ) return true } end(data = Buffer.alloc(0), encoding: BufferEncoding = 'utf8', callback: (...args: unknown[]) => void = () => {}) { log('ending CF socket') this.write(data, encoding, (err) => { this._cfSocket!.close() if (callback) callback(err) }) return this } destroy(reason: string) { log('destroying CF socket', reason) this.destroyed = true return this.end() } startTls(options: TlsOptions) { if (this._upgraded) { // Don't try to upgrade again. this.emit('error', 'Cannot call `startTls()` more than once on a socket') return } this._cfWriter!.releaseLock() this._cfReader!.releaseLock() this._upgrading = true this._cfSocket = this._cfSocket!.startTls(options) this._cfWriter = this._cfSocket.writable.getWriter() this._cfReader = this._cfSocket.readable.getReader() this._addClosedHandler() this._listen().catch((e) => this.emit('error', e)) } _addClosedHandler() { this._cfSocket!.closed.then(() => { if (!this._upgrading) { log('CF socket closed') this._cfSocket = null this.emit('close') } else { this._upgrading = false this._upgraded = true } }).catch((e) => this.emit('error', e)) } } const debug = false function dump(data: unknown) { if (data instanceof Uint8Array || data instanceof ArrayBuffer) { const hex = Buffer.from(data).toString('hex') const str = new TextDecoder().decode(data) return `\n>>> STR: "${str.replace(/\n/g, '\\n')}"\n>>> HEX: ${hex}\n` } else { return data } } function log(...args: unknown[]) { debug && console.log(...args.map(dump)) } node-postgres-pg-8.14.1/packages/pg-cloudflare/src/types.d.ts000066400000000000000000000011441476604072200240410ustar00rootroot00000000000000declare module 'cloudflare:sockets' { export class Socket { public readonly readable: any public readonly writable: any public readonly closed: Promise public close(): Promise public startTls(options: TlsOptions): Socket } export type TlsOptions = { expectedServerHostname?: string } export type SocketAddress = { hostname: string port: number } export type SocketOptions = { secureTransport?: 'off' | 'on' | 'starttls' allowHalfOpen?: boolean } export function connect(address: string | SocketAddress, options?: SocketOptions): Socket } node-postgres-pg-8.14.1/packages/pg-cloudflare/tsconfig.json000066400000000000000000000007251476604072200240270ustar00rootroot00000000000000{ "compilerOptions": { "module": "ES2020", "esModuleInterop": true, "allowSyntheticDefaultImports": true, "strict": true, "target": "ES2020", "noImplicitAny": true, "moduleResolution": "node", "sourceMap": true, "outDir": "dist", "incremental": true, "baseUrl": ".", "declaration": true, "paths": { "*": [ "node_modules/*", "src/types/*" ] } }, "include": [ "src/**/*" ] } node-postgres-pg-8.14.1/packages/pg-connection-string/000077500000000000000000000000001476604072200226375ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg-connection-string/.coveralls.yml000066400000000000000000000001071476604072200254300ustar00rootroot00000000000000service_name: travis-pro repo_token: 5F6dODinz9L9uFR6HatKmtsYDoV1A5S2N node-postgres-pg-8.14.1/packages/pg-connection-string/.gitignore000066400000000000000000000010501476604072200246230ustar00rootroot00000000000000# Logs logs *.log # Runtime data pids *.pid *.seed # Directory for instrumented libs generated by jscoverage/JSCover lib-cov # Coverage directory used by tools like istanbul coverage # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) .grunt # Compiled binary addons (http://nodejs.org/api/addons.html) build/Release # Dependency directory # Deployed apps should consider commenting this line out: # see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git node_modules package-lock.jsonnode-postgres-pg-8.14.1/packages/pg-connection-string/LICENSE000066400000000000000000000020721476604072200236450ustar00rootroot00000000000000The MIT License (MIT) Copyright (c) 2014 Iced Development Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.node-postgres-pg-8.14.1/packages/pg-connection-string/README.md000066400000000000000000000066041476604072200241240ustar00rootroot00000000000000pg-connection-string ==================== [![NPM](https://nodei.co/npm/pg-connection-string.png?compact=true)](https://nodei.co/npm/pg-connection-string/) [![Build Status](https://travis-ci.org/iceddev/pg-connection-string.svg?branch=master)](https://travis-ci.org/iceddev/pg-connection-string) [![Coverage Status](https://coveralls.io/repos/github/iceddev/pg-connection-string/badge.svg?branch=master)](https://coveralls.io/github/iceddev/pg-connection-string?branch=master) Functions for dealing with a PostgresSQL connection string `parse` method taken from [node-postgres](https://github.com/brianc/node-postgres.git) Copyright (c) 2010-2014 Brian Carlson (brian.m.carlson@gmail.com) MIT License ## Usage ```js var parse = require('pg-connection-string').parse; var config = parse('postgres://someuser:somepassword@somehost:381/somedatabase') ``` The resulting config contains a subset of the following properties: * `user` - User with which to authenticate to the server * `password` - Corresponding password * `host` - Postgres server hostname or, for UNIX domain sockets, the socket filename * `port` - port on which to connect * `database` - Database name within the server * `client_encoding` - string encoding the client will use * `ssl`, either a boolean or an object with properties * `rejectUnauthorized` * `cert` * `key` * `ca` * any other query parameters (for example, `application_name`) are preserved intact. ## Connection Strings The short summary of acceptable URLs is: * `socket:?` - UNIX domain socket * `postgres://:@:/?` - TCP connection But see below for more details. ### UNIX Domain Sockets When user and password are not given, the socket path follows `socket:`, as in `socket:/var/run/pgsql`. This form can be shortened to just a path: `/var/run/pgsql`. When user and password are given, they are included in the typical URL positions, with an empty `host`, as in `socket://user:pass@/var/run/pgsql`. Query parameters follow a `?` character, including the following special query parameters: * `db=` - sets the database name (urlencoded) * `encoding=` - sets the `client_encoding` property ### TCP Connections TCP connections to the Postgres server are indicated with `pg:` or `postgres:` schemes (in fact, any scheme but `socket:` is accepted). If username and password are included, they should be urlencoded. The database name, however, should *not* be urlencoded. Query parameters follow a `?` character, including the following special query parameters: * `host=` - sets `host` property, overriding the URL's host * `encoding=` - sets the `client_encoding` property * `ssl=1`, `ssl=true`, `ssl=0`, `ssl=false` - sets `ssl` to true or false, accordingly * `sslmode=` * `sslmode=disable` - sets `ssl` to false * `sslmode=no-verify` - sets `ssl` to `{ rejectUnauthorized: false }` * `sslmode=prefer`, `sslmode=require`, `sslmode=verify-ca`, `sslmode=verify-full` - sets `ssl` to true * `sslcert=` - reads data from the given file and includes the result as `ssl.cert` * `sslkey=` - reads data from the given file and includes the result as `ssl.key` * `sslrootcert=` - reads data from the given file and includes the result as `ssl.ca` A bare relative URL, such as `salesdata`, will indicate a database name while leaving other properties empty. node-postgres-pg-8.14.1/packages/pg-connection-string/index.d.ts000066400000000000000000000005531476604072200245430ustar00rootroot00000000000000export function parse(connectionString: string): ConnectionOptions export interface ConnectionOptions { host: string | null password?: string user?: string port?: string | null database: string | null | undefined client_encoding?: string ssl?: boolean | string application_name?: string fallback_application_name?: string options?: string } node-postgres-pg-8.14.1/packages/pg-connection-string/index.js000066400000000000000000000057031476604072200243110ustar00rootroot00000000000000'use strict' //Parse method copied from https://github.com/brianc/node-postgres //Copyright (c) 2010-2014 Brian Carlson (brian.m.carlson@gmail.com) //MIT License //parses a connection string function parse(str) { //unix socket if (str.charAt(0) === '/') { const config = str.split(' ') return { host: config[0], database: config[1] } } // Check for empty host in URL const config = {} let result let dummyHost = false if (/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(str)) { // Ensure spaces are encoded as %20 str = encodeURI(str).replace(/\%25(\d\d)/g, '%$1') } try { result = new URL(str, 'postgres://base') } catch (e) { // The URL is invalid so try again with a dummy host result = new URL(str.replace('@/', '@___DUMMY___/'), 'postgres://base') dummyHost = true } // We'd like to use Object.fromEntries() here but Node.js 10 does not support it for (const entry of result.searchParams.entries()) { config[entry[0]] = entry[1] } config.user = config.user || decodeURIComponent(result.username) config.password = config.password || decodeURIComponent(result.password) if (result.protocol == 'socket:') { config.host = decodeURI(result.pathname) config.database = result.searchParams.get('db') config.client_encoding = result.searchParams.get('encoding') return config } const hostname = dummyHost ? '' : result.hostname if (!config.host) { // Only set the host if there is no equivalent query param. config.host = decodeURIComponent(hostname) } else if (hostname && /^%2f/i.test(hostname)) { // Only prepend the hostname to the pathname if it is not a URL encoded Unix socket host. result.pathname = hostname + result.pathname } if (!config.port) { // Only set the port if there is no equivalent query param. config.port = result.port } const pathname = result.pathname.slice(1) || null config.database = pathname ? decodeURI(pathname) : null if (config.ssl === 'true' || config.ssl === '1') { config.ssl = true } if (config.ssl === '0') { config.ssl = false } if (config.sslcert || config.sslkey || config.sslrootcert || config.sslmode) { config.ssl = {} } // Only try to load fs if we expect to read from the disk const fs = config.sslcert || config.sslkey || config.sslrootcert ? require('fs') : null if (config.sslcert) { config.ssl.cert = fs.readFileSync(config.sslcert).toString() } if (config.sslkey) { config.ssl.key = fs.readFileSync(config.sslkey).toString() } if (config.sslrootcert) { config.ssl.ca = fs.readFileSync(config.sslrootcert).toString() } switch (config.sslmode) { case 'disable': { config.ssl = false break } case 'prefer': case 'require': case 'verify-ca': case 'verify-full': { break } case 'no-verify': { config.ssl.rejectUnauthorized = false break } } return config } module.exports = parse parse.parse = parse node-postgres-pg-8.14.1/packages/pg-connection-string/package.json000066400000000000000000000021451476604072200251270ustar00rootroot00000000000000{ "name": "pg-connection-string", "version": "2.7.0", "description": "Functions for dealing with a PostgresSQL connection string", "main": "./index.js", "types": "./index.d.ts", "scripts": { "test": "istanbul cover _mocha && npm run check-coverage", "check-coverage": "istanbul check-coverage --statements 100 --branches 100 --lines 100 --functions 100", "coveralls": "cat ./coverage/lcov.info | ./node_modules/.bin/coveralls" }, "repository": { "type": "git", "url": "git://github.com/brianc/node-postgres.git", "directory": "packages/pg-connection-string" }, "keywords": [ "pg", "connection", "string", "parse" ], "author": "Blaine Bublitz (http://iceddev.com/)", "license": "MIT", "bugs": { "url": "https://github.com/brianc/node-postgres/issues" }, "homepage": "https://github.com/brianc/node-postgres/tree/master/packages/pg-connection-string", "devDependencies": { "chai": "^4.1.1", "coveralls": "^3.0.4", "istanbul": "^0.4.5", "mocha": "^10.5.2" }, "files": [ "index.js", "index.d.ts" ] } node-postgres-pg-8.14.1/packages/pg-connection-string/test/000077500000000000000000000000001476604072200236165ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg-connection-string/test/example.ca000066400000000000000000000000131476604072200255500ustar00rootroot00000000000000example ca node-postgres-pg-8.14.1/packages/pg-connection-string/test/example.cert000066400000000000000000000000151476604072200261240ustar00rootroot00000000000000example cert node-postgres-pg-8.14.1/packages/pg-connection-string/test/example.key000066400000000000000000000000141476604072200257560ustar00rootroot00000000000000example key node-postgres-pg-8.14.1/packages/pg-connection-string/test/parse.js000066400000000000000000000254121476604072200252720ustar00rootroot00000000000000'use strict' var chai = require('chai') chai.should() var parse = require('../').parse describe('parse', function () { it('using connection string in client constructor', function () { var subject = parse('postgres://brian:pw@boom:381/lala') subject.user.should.equal('brian') subject.password.should.equal('pw') subject.host.should.equal('boom') subject.port.should.equal('381') subject.database.should.equal('lala') }) it('escape spaces if present', function () { var subject = parse('postgres://localhost/post gres') subject.database.should.equal('post gres') }) it('do not double escape spaces', function () { var subject = parse('postgres://localhost/post%20gres') subject.database.should.equal('post gres') }) it('initializing with unix domain socket', function () { var subject = parse('/var/run/') subject.host.should.equal('/var/run/') }) it('initializing with unix domain socket and a specific database, the simple way', function () { var subject = parse('/var/run/ mydb') subject.host.should.equal('/var/run/') subject.database.should.equal('mydb') }) it('initializing with unix domain socket, the health way', function () { var subject = parse('socket:/some path/?db=my[db]&encoding=utf8') subject.host.should.equal('/some path/') subject.database.should.equal('my[db]', 'must to be escaped and unescaped trough "my%5Bdb%5D"') subject.client_encoding.should.equal('utf8') }) it('initializing with unix domain socket, the escaped health way', function () { var subject = parse('socket:/some%20path/?db=my%2Bdb&encoding=utf8') subject.host.should.equal('/some path/') subject.database.should.equal('my+db') subject.client_encoding.should.equal('utf8') }) it('initializing with unix domain socket, username and password', function () { var subject = parse('socket://brian:pw@/var/run/?db=mydb') subject.user.should.equal('brian') subject.password.should.equal('pw') subject.host.should.equal('/var/run/') subject.database.should.equal('mydb') }) it('password contains < and/or > characters', function () { var sourceConfig = { user: 'brian', password: 'helloe', host: 'localhost', port: 5432, database: 'postgres', } var connectionString = 'postgres://' + sourceConfig.user + ':' + sourceConfig.password + '@' + sourceConfig.host + ':' + sourceConfig.port + '/' + sourceConfig.database var subject = parse(connectionString) subject.password.should.equal(sourceConfig.password) }) it('password contains colons', function () { var sourceConfig = { user: 'brian', password: 'hello:pass:world', host: 'localhost', port: 5432, database: 'postgres', } var connectionString = 'postgres://' + sourceConfig.user + ':' + sourceConfig.password + '@' + sourceConfig.host + ':' + sourceConfig.port + '/' + sourceConfig.database var subject = parse(connectionString) subject.password.should.equal(sourceConfig.password) }) it('username or password contains weird characters', function () { var strang = 'pg://my f%irst name:is&%awesome!@localhost:9000' var subject = parse(strang) subject.user.should.equal('my f%irst name') subject.password.should.equal('is&%awesome!') subject.host.should.equal('localhost') }) it('url is properly encoded', function () { var encoded = 'pg://bi%25na%25%25ry%20:s%40f%23@localhost/%20u%2520rl' var subject = parse(encoded) subject.user.should.equal('bi%na%%ry ') subject.password.should.equal('s@f#') subject.host.should.equal('localhost') subject.database.should.equal(' u%20rl') }) it('relative url sets database', function () { var relative = 'different_db_on_default_host' var subject = parse(relative) subject.database.should.equal('different_db_on_default_host') }) it('no pathname returns null database', function () { var subject = parse('pg://myhost') ;(subject.database === null).should.equal(true) }) it('pathname of "/" returns null database', function () { var subject = parse('pg://myhost/') subject.host.should.equal('myhost') ;(subject.database === null).should.equal(true) }) it('configuration parameter host', function () { var subject = parse('pg://user:pass@/dbname?host=/unix/socket') subject.user.should.equal('user') subject.password.should.equal('pass') subject.host.should.equal('/unix/socket') subject.database.should.equal('dbname') }) it('configuration parameter host overrides url host', function () { var subject = parse('pg://user:pass@localhost/dbname?host=/unix/socket') subject.database.should.equal('dbname') subject.host.should.equal('/unix/socket') }) it('url with encoded socket', function () { var subject = parse('pg://user:pass@%2Funix%2Fsocket/dbname') subject.user.should.equal('user') subject.password.should.equal('pass') subject.host.should.equal('/unix/socket') subject.database.should.equal('dbname') }) it('url with real host and an encoded db name', function () { var subject = parse('pg://user:pass@localhost/%2Fdbname') subject.user.should.equal('user') subject.password.should.equal('pass') subject.host.should.equal('localhost') subject.database.should.equal('%2Fdbname') }) it('configuration parameter host treats encoded host as part of the db name', function () { var subject = parse('pg://user:pass@%2Funix%2Fsocket/dbname?host=localhost') subject.user.should.equal('user') subject.password.should.equal('pass') subject.host.should.equal('localhost') subject.database.should.equal('%2Funix%2Fsocket/dbname') }) it('configuration parameter application_name', function () { var connectionString = 'pg:///?application_name=TheApp' var subject = parse(connectionString) subject.application_name.should.equal('TheApp') }) it('configuration parameter fallback_application_name', function () { var connectionString = 'pg:///?fallback_application_name=TheAppFallback' var subject = parse(connectionString) subject.fallback_application_name.should.equal('TheAppFallback') }) it('configuration parameter options', function () { var connectionString = 'pg:///?options=-c geqo=off' var subject = parse(connectionString) subject.options.should.equal('-c geqo=off') }) it('configuration parameter ssl=true', function () { var connectionString = 'pg:///?ssl=true' var subject = parse(connectionString) subject.ssl.should.equal(true) }) it('configuration parameter ssl=1', function () { var connectionString = 'pg:///?ssl=1' var subject = parse(connectionString) subject.ssl.should.equal(true) }) it('configuration parameter ssl=0', function () { var connectionString = 'pg:///?ssl=0' var subject = parse(connectionString) subject.ssl.should.equal(false) }) it('set ssl', function () { var subject = parse('pg://myhost/db?ssl=1') subject.ssl.should.equal(true) }) it('configuration parameter sslcert=/path/to/cert', function () { var connectionString = 'pg:///?sslcert=' + __dirname + '/example.cert' var subject = parse(connectionString) subject.ssl.should.eql({ cert: 'example cert\n', }) }) it('configuration parameter sslkey=/path/to/key', function () { var connectionString = 'pg:///?sslkey=' + __dirname + '/example.key' var subject = parse(connectionString) subject.ssl.should.eql({ key: 'example key\n', }) }) it('configuration parameter sslrootcert=/path/to/ca', function () { var connectionString = 'pg:///?sslrootcert=' + __dirname + '/example.ca' var subject = parse(connectionString) subject.ssl.should.eql({ ca: 'example ca\n', }) }) it('configuration parameter sslmode=no-verify', function () { var connectionString = 'pg:///?sslmode=no-verify' var subject = parse(connectionString) subject.ssl.should.eql({ rejectUnauthorized: false, }) }) it('configuration parameter sslmode=disable', function () { var connectionString = 'pg:///?sslmode=disable' var subject = parse(connectionString) subject.ssl.should.eql(false) }) it('configuration parameter sslmode=prefer', function () { var connectionString = 'pg:///?sslmode=prefer' var subject = parse(connectionString) subject.ssl.should.eql({}) }) it('configuration parameter sslmode=require', function () { var connectionString = 'pg:///?sslmode=require' var subject = parse(connectionString) subject.ssl.should.eql({}) }) it('configuration parameter sslmode=verify-ca', function () { var connectionString = 'pg:///?sslmode=verify-ca' var subject = parse(connectionString) subject.ssl.should.eql({}) }) it('configuration parameter sslmode=verify-full', function () { var connectionString = 'pg:///?sslmode=verify-full' var subject = parse(connectionString) subject.ssl.should.eql({}) }) it('configuration parameter ssl=true and sslmode=require still work with sslrootcert=/path/to/ca', function () { var connectionString = 'pg:///?ssl=true&sslrootcert=' + __dirname + '/example.ca&sslmode=require' var subject = parse(connectionString) subject.ssl.should.eql({ ca: 'example ca\n', }) }) it('allow other params like max, ...', function () { var subject = parse('pg://myhost/db?max=18&min=4') subject.max.should.equal('18') subject.min.should.equal('4') }) it('configuration parameter keepalives', function () { var connectionString = 'pg:///?keepalives=1' var subject = parse(connectionString) subject.keepalives.should.equal('1') }) it('unknown configuration parameter is passed into client', function () { var connectionString = 'pg:///?ThereIsNoSuchPostgresParameter=1234' var subject = parse(connectionString) subject.ThereIsNoSuchPostgresParameter.should.equal('1234') }) it('do not override a config field with value from query string', function () { var subject = parse('socket:/some path/?db=my[db]&encoding=utf8&client_encoding=bogus') subject.host.should.equal('/some path/') subject.database.should.equal('my[db]', 'must to be escaped and unescaped through "my%5Bdb%5D"') subject.client_encoding.should.equal('utf8') }) it('return last value of repeated parameter', function () { var connectionString = 'pg:///?keepalives=1&keepalives=0' var subject = parse(connectionString) subject.keepalives.should.equal('0') }) it('use the port specified in the query parameters', function () { var connectionString = 'postgres:///?host=localhost&port=1234' var subject = parse(connectionString) subject.port.should.equal('1234') }) }) node-postgres-pg-8.14.1/packages/pg-cursor/000077500000000000000000000000001476604072200205115ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg-cursor/README.md000066400000000000000000000027321476604072200217740ustar00rootroot00000000000000node-pg-cursor ============== Use a PostgreSQL result cursor from node with an easy to use API. ### install ```sh $ npm install pg-cursor ``` ___note___: this depends on _either_ `npm install pg` or `npm install pg.js`, but you __must__ be using the pure JavaScript client. This will __not work__ with the native bindings. ### :star: [Documentation](https://node-postgres.com/apis/cursor) :star: ### license The MIT License (MIT) Copyright (c) 2013 Brian M. Carlson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. node-postgres-pg-8.14.1/packages/pg-cursor/index.js000066400000000000000000000147161476604072200221670ustar00rootroot00000000000000'use strict' const Result = require('pg/lib/result.js') const prepare = require('pg/lib/utils.js').prepareValue const EventEmitter = require('events').EventEmitter const util = require('util') let nextUniqueID = 1 // concept borrowed from org.postgresql.core.v3.QueryExecutorImpl class Cursor extends EventEmitter { constructor(text, values, config) { super() this._conf = config || {} this.text = text this.values = values ? values.map(prepare) : null this.connection = null this._queue = [] this.state = 'initialized' this._result = new Result(this._conf.rowMode, this._conf.types) this._Promise = this._conf.Promise || global.Promise this._cb = null this._rows = null this._portal = null this._ifNoData = this._ifNoData.bind(this) this._rowDescription = this._rowDescription.bind(this) } _ifNoData() { this.state = 'idle' this._shiftQueue() if (this.connection) { this.connection.removeListener('rowDescription', this._rowDescription) } } _rowDescription() { if (this.connection) { this.connection.removeListener('noData', this._ifNoData) } } submit(connection) { this.state = 'submitted' this.connection = connection this._portal = 'C_' + nextUniqueID++ const con = connection con.parse( { text: this.text, }, true ) con.bind( { portal: this._portal, values: this.values, }, true ) con.describe( { type: 'P', name: this._portal, // AWS Redshift requires a portal name }, true ) con.flush() if (this._conf.types) { this._result._getTypeParser = this._conf.types.getTypeParser } con.once('noData', this._ifNoData) con.once('rowDescription', this._rowDescription) } _shiftQueue() { if (this._queue.length) { this._getRows.apply(this, this._queue.shift()) } } _closePortal() { if (this.state === 'done') return // because we opened a named portal to stream results // we need to close the same named portal. Leaving a named portal // open can lock tables for modification if inside a transaction. // see https://github.com/brianc/node-pg-cursor/issues/56 this.connection.close({ type: 'P', name: this._portal }) // If we've received an error we already sent a sync message. // do not send another sync as it triggers another readyForQuery message. if (this.state !== 'error') { this.connection.sync() } this.state = 'done' } handleRowDescription(msg) { this._result.addFields(msg.fields) this.state = 'idle' this._shiftQueue() } handleDataRow(msg) { const row = this._result.parseRow(msg.fields) this.emit('row', row, this._result) this._rows.push(row) } _sendRows() { this.state = 'idle' setImmediate(() => { const cb = this._cb // remove callback before calling it // because likely a new one will be added // within the call to this callback this._cb = null if (cb) { this._result.rows = this._rows cb(null, this._rows, this._result) } this._rows = [] }) } handleCommandComplete(msg) { this._result.addCommandComplete(msg) this._closePortal() } handlePortalSuspended() { this._sendRows() } handleReadyForQuery() { this._sendRows() this.state = 'done' this.emit('end', this._result) } handleEmptyQuery() { this.connection.sync() } handleError(msg) { // If this cursor has already closed, don't try to handle the error. if (this.state === 'done') return // If we're in an initialized state we've never been submitted // and don't have a connection instance reference yet. // This can happen if you queue a stream and close the client before // the client has submitted the stream. In this scenario we don't have // a connection so there's nothing to unsubscribe from. if (this.state !== 'initialized') { this.connection.removeListener('noData', this._ifNoData) this.connection.removeListener('rowDescription', this._rowDescription) // call sync to trigger a readyForQuery this.connection.sync() } this.state = 'error' this._error = msg // satisfy any waiting callback if (this._cb) { this._cb(msg) } // dispatch error to all waiting callbacks for (let i = 0; i < this._queue.length; i++) { const queuedCallback = this._queue[i][1] queuedCallback.call(this, msg) } this._queue.length = 0 if (this.listenerCount('error') > 0) { // only dispatch error events if we have a listener this.emit('error', msg) } } _getRows(rows, cb) { this.state = 'busy' this._cb = cb this._rows = [] const msg = { portal: this._portal, rows: rows, } this.connection.execute(msg, true) this.connection.flush() } // users really shouldn't be calling 'end' here and terminating a connection to postgres // via the low level connection.end api end(cb) { if (this.state !== 'initialized') { this.connection.sync() } this.connection.once('end', cb) this.connection.end() } close(cb) { let promise if (!cb) { promise = new this._Promise((resolve, reject) => { cb = (err) => (err ? reject(err) : resolve()) }) } if (!this.connection || this.state === 'done') { setImmediate(cb) return promise } this._closePortal() this.connection.once('readyForQuery', function () { cb() }) // Return the promise (or undefined) return promise } read(rows, cb) { let promise if (!cb) { promise = new this._Promise((resolve, reject) => { cb = (err, rows) => (err ? reject(err) : resolve(rows)) }) } if (this.state === 'idle' || this.state === 'submitted') { this._getRows(rows, cb) } else if (this.state === 'busy' || this.state === 'initialized') { this._queue.push([rows, cb]) } else if (this.state === 'error') { setImmediate(() => cb(this._error)) } else if (this.state === 'done') { setImmediate(() => cb(null, [])) } else { throw new Error('Unknown state: ' + this.state) } // Return the promise (or undefined) return promise } } Cursor.prototype.end = util.deprecate( Cursor.prototype.end, 'Cursor.end is deprecated. Call end on the client itself to end a connection to the database.' ) module.exports = Cursor node-postgres-pg-8.14.1/packages/pg-cursor/package.json000066400000000000000000000010071476604072200227750ustar00rootroot00000000000000{ "name": "pg-cursor", "version": "2.13.1", "description": "Query cursor extension for node-postgres", "main": "index.js", "directories": { "test": "test" }, "scripts": { "test": "mocha" }, "repository": { "type": "git", "url": "git://github.com/brianc/node-postgres.git", "directory": "packages/pg-cursor" }, "author": "Brian M. Carlson", "license": "MIT", "devDependencies": { "mocha": "^10.5.2", "pg": "^8.14.1" }, "peerDependencies": { "pg": "^8" } } node-postgres-pg-8.14.1/packages/pg-cursor/test/000077500000000000000000000000001476604072200214705ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg-cursor/test/close.js000066400000000000000000000033031476604072200231320ustar00rootroot00000000000000const assert = require('assert') const Cursor = require('../') const pg = require('pg') const text = 'SELECT generate_series as num FROM generate_series(0, 50)' describe('close', function () { beforeEach(function (done) { const client = (this.client = new pg.Client()) client.connect(done) }) this.afterEach(function (done) { this.client.end(done) }) it('can close a finished cursor without a callback', function (done) { const cursor = new Cursor(text) this.client.query(cursor) this.client.query('SELECT NOW()', done) cursor.read(100, function (err) { assert.ifError(err) cursor.close() }) }) it('can close a finished cursor a promise', function (done) { const cursor = new Cursor(text) this.client.query(cursor) cursor.read(100, (err) => { assert.ifError(err) cursor.close().then(() => { this.client.query('SELECT NOW()', done) }) }) }) it('closes cursor early', function (done) { const cursor = new Cursor(text) this.client.query(cursor) this.client.query('SELECT NOW()', done) cursor.read(25, function (err) { assert.ifError(err) cursor.close() }) }) it('works with callback style', function (done) { const cursor = new Cursor(text) const client = this.client client.query(cursor) cursor.read(25, function (err, rows) { assert.ifError(err) assert.strictEqual(rows.length, 25) cursor.close(function (err) { assert.ifError(err) client.query('SELECT NOW()', done) }) }) }) it('is a no-op to "close" the cursor before submitting it', function (done) { const cursor = new Cursor(text) cursor.close(done) }) }) node-postgres-pg-8.14.1/packages/pg-cursor/test/error-handling.js000066400000000000000000000057421476604072200247510ustar00rootroot00000000000000'use strict' const assert = require('assert') const Cursor = require('../') const pg = require('pg') const text = 'SELECT generate_series as num FROM generate_series(0, 4)' describe('error handling', function () { it('can continue after error', function (done) { const client = new pg.Client() client.connect() const cursor = client.query(new Cursor('asdfdffsdf')) cursor.read(1, function (err) { assert(err) client.query('SELECT NOW()', function (err) { assert.ifError(err) client.end() done() }) }) }) it('errors queued reads', async () => { const client = new pg.Client() await client.connect() const cursor = client.query(new Cursor('asdfdffsdf')) const immediateRead = cursor.read(1) const queuedRead1 = cursor.read(1) const queuedRead2 = cursor.read(1) assert( await immediateRead.then( () => null, (err) => err ) ) assert( await queuedRead1.then( () => null, (err) => err ) ) assert( await queuedRead2.then( () => null, (err) => err ) ) client.end() }) }) describe('read callback does not fire sync', () => { it('does not fire error callback sync', (done) => { const client = new pg.Client() client.connect() const cursor = client.query(new Cursor('asdfdffsdf')) let after = false cursor.read(1, function (err) { assert(err, 'error should be returned') assert.strictEqual(after, true, 'should not call read sync') after = false cursor.read(1, function (err) { assert(err, 'error should be returned') assert.strictEqual(after, true, 'should not call read sync') client.end() done() }) after = true }) after = true }) it('does not fire result sync after finished', (done) => { const client = new pg.Client() client.connect() const cursor = client.query(new Cursor('SELECT NOW()')) let after = false cursor.read(1, function (err) { assert(!err) assert.strictEqual(after, true, 'should not call read sync') cursor.read(1, function (err) { assert(!err) after = false cursor.read(1, function (err) { assert(!err) assert.strictEqual(after, true, 'should not call read sync') client.end() done() }) after = true }) }) after = true }) }) describe('proper cleanup', function () { it('can issue multiple cursors on one client', function (done) { const client = new pg.Client() client.connect() const cursor1 = client.query(new Cursor(text)) cursor1.read(8, function (err, rows) { assert.ifError(err) assert.strictEqual(rows.length, 5) const cursor2 = client.query(new Cursor(text)) cursor2.read(8, function (err, rows) { assert.ifError(err) assert.strictEqual(rows.length, 5) client.end() done() }) }) }) }) node-postgres-pg-8.14.1/packages/pg-cursor/test/index.js000066400000000000000000000114751476604072200231450ustar00rootroot00000000000000const assert = require('assert') const Cursor = require('../') const pg = require('pg') const text = 'SELECT generate_series as num FROM generate_series(0, 5)' describe('cursor', function () { beforeEach(function (done) { const client = (this.client = new pg.Client()) client.connect(done) this.pgCursor = function (text, values) { return client.query(new Cursor(text, values || [])) } }) afterEach(function () { this.client.end() }) it('fetch 6 when asking for 10', function (done) { const cursor = this.pgCursor(text) cursor.read(10, function (err, res) { assert.ifError(err) assert.strictEqual(res.length, 6) done() }) }) it('end before reading to end', function (done) { const cursor = this.pgCursor(text) cursor.read(3, function (err, res) { assert.ifError(err) assert.strictEqual(res.length, 3) done() }) }) it('callback with error', function (done) { const cursor = this.pgCursor('select asdfasdf') cursor.read(1, function (err) { assert(err) done() }) }) it('read a partial chunk of data', function (done) { const cursor = this.pgCursor(text) cursor.read(2, function (err, res) { assert.ifError(err) assert.strictEqual(res.length, 2) cursor.read(3, function (err, res) { assert(!err) assert.strictEqual(res.length, 3) cursor.read(1, function (err, res) { assert(!err) assert.strictEqual(res.length, 1) cursor.read(1, function (err, res) { assert(!err) assert.ifError(err) assert.strictEqual(res.length, 0) done() }) }) }) }) }) it('read return length 0 past the end', function (done) { const cursor = this.pgCursor(text) cursor.read(2, function (err) { assert(!err) cursor.read(100, function (err, res) { assert(!err) assert.strictEqual(res.length, 4) cursor.read(100, function (err, res) { assert(!err) assert.strictEqual(res.length, 0) done() }) }) }) }) it('read huge result', function (done) { this.timeout(10000) const text = 'SELECT generate_series as num FROM generate_series(0, 100000)' const values = [] const cursor = this.pgCursor(text, values) let count = 0 const read = function () { cursor.read(100, function (err, rows) { if (err) return done(err) if (!rows.length) { assert.strictEqual(count, 100001) return done() } count += rows.length if (count % 10000 === 0) { // console.log(count) } setImmediate(read) }) } read() }) it('normalizes parameter values', function (done) { const text = 'SELECT $1::json me' const values = [{ name: 'brian' }] const cursor = this.pgCursor(text, values) cursor.read(1, function (err, rows) { if (err) return done(err) assert.strictEqual(rows[0].me.name, 'brian') cursor.read(1, function (err, rows) { assert(!err) assert.strictEqual(rows.length, 0) done() }) }) }) it('returns result along with rows', function (done) { const cursor = this.pgCursor(text) cursor.read(1, function (err, rows, result) { assert.ifError(err) assert.strictEqual(rows.length, 1) assert.strictEqual(rows, result.rows) assert.deepStrictEqual( result.fields.map((f) => f.name), ['num'] ) done() }) }) it('emits row events', function (done) { const cursor = this.pgCursor(text) cursor.read(10) cursor.on('row', (row, result) => result.addRow(row)) cursor.on('end', (result) => { assert.strictEqual(result.rows.length, 6) done() }) }) it('emits row events when cursor is closed manually', function (done) { const cursor = this.pgCursor(text) cursor.on('row', (row, result) => result.addRow(row)) cursor.on('end', (result) => { assert.strictEqual(result.rows.length, 3) done() }) cursor.read(3, () => cursor.close()) }) it('emits error events', function (done) { const cursor = this.pgCursor('select asdfasdf') cursor.on('error', function (err) { assert(err) done() }) }) it('returns rowCount on insert', function (done) { const pgCursor = this.pgCursor this.client .query('CREATE TEMPORARY TABLE pg_cursor_test (foo VARCHAR(1), bar VARCHAR(1))') .then(function () { const cursor = pgCursor('insert into pg_cursor_test values($1, $2)', ['a', 'b']) cursor.read(1, function (err, rows, result) { assert.ifError(err) assert.strictEqual(rows.length, 0) assert.strictEqual(result.rowCount, 1) done() }) }) .catch(done) }) }) node-postgres-pg-8.14.1/packages/pg-cursor/test/mocha.opts000066400000000000000000000000411476604072200234610ustar00rootroot00000000000000--reporter spec --no-exit --bail node-postgres-pg-8.14.1/packages/pg-cursor/test/no-data-handling.js000066400000000000000000000015651476604072200251420ustar00rootroot00000000000000const assert = require('assert') const pg = require('pg') const Cursor = require('../') describe('queries with no data', function () { beforeEach(function (done) { const client = (this.client = new pg.Client()) client.connect(done) }) afterEach(function () { this.client.end() }) it('handles queries that return no data', function (done) { const cursor = new Cursor('CREATE TEMPORARY TABLE whatwhat (thing int)') this.client.query(cursor) cursor.read(100, function (err, rows) { assert.ifError(err) assert.strictEqual(rows.length, 0) done() }) }) it('handles empty query', function (done) { let cursor = new Cursor('-- this is a comment') cursor = this.client.query(cursor) cursor.read(100, function (err, rows) { assert.ifError(err) assert.strictEqual(rows.length, 0) done() }) }) }) node-postgres-pg-8.14.1/packages/pg-cursor/test/pool.js000066400000000000000000000047561476604072200230130ustar00rootroot00000000000000'use strict' const assert = require('assert') const Cursor = require('../') const pg = require('pg') const text = 'SELECT generate_series as num FROM generate_series(0, 50)' function poolQueryPromise(pool, readRowCount) { return new Promise((resolve, reject) => { pool.connect((err, client, done) => { if (err) { done(err) return reject(err) } const cursor = client.query(new Cursor(text)) cursor.read(readRowCount, (err) => { if (err) { done(err) return reject(err) } cursor.close((err) => { if (err) { done(err) return reject(err) } done() resolve() }) }) }) }) } describe('pool', function () { beforeEach(function () { this.pool = new pg.Pool({ max: 1 }) }) afterEach(function () { this.pool.end() }) it('closes cursor early, single pool query', function (done) { poolQueryPromise(this.pool, 25) .then(() => done()) .catch((err) => { assert.ifError(err) done() }) }) it('closes cursor early, saturated pool', function (done) { const promises = [] for (let i = 0; i < 10; i++) { promises.push(poolQueryPromise(this.pool, 25)) } Promise.all(promises) .then(() => done()) .catch((err) => { assert.ifError(err) done() }) }) it('closes exhausted cursor, single pool query', function (done) { poolQueryPromise(this.pool, 100) .then(() => done()) .catch((err) => { assert.ifError(err) done() }) }) it('closes exhausted cursor, saturated pool', function (done) { const promises = [] for (let i = 0; i < 10; i++) { promises.push(poolQueryPromise(this.pool, 100)) } Promise.all(promises) .then(() => done()) .catch((err) => { assert.ifError(err) done() }) }) it('can close multiple times on a pool', async function () { const pool = new pg.Pool({ max: 1 }) const run = async () => { const cursor = new Cursor(text) const client = await pool.connect() client.query(cursor) await new Promise((resolve) => { cursor.read(25, function (err) { assert.ifError(err) cursor.close(function (err) { assert.ifError(err) client.release() resolve() }) }) }) } await Promise.all([run(), run(), run()]) await pool.end() }) }) node-postgres-pg-8.14.1/packages/pg-cursor/test/promises.js000066400000000000000000000023031476604072200236650ustar00rootroot00000000000000const assert = require('assert') const Cursor = require('../') const pg = require('pg') const text = 'SELECT generate_series as num FROM generate_series(0, 5)' describe('cursor using promises', function () { beforeEach(function (done) { const client = (this.client = new pg.Client()) client.connect(done) this.pgCursor = function (text, values) { return client.query(new Cursor(text, values || [])) } }) afterEach(function () { this.client.end() }) it('resolve with result', async function () { const cursor = this.pgCursor(text) const res = await cursor.read(6) assert.strictEqual(res.length, 6) }) it('reject with error', function (done) { const cursor = this.pgCursor('select asdfasdf') cursor.read(1).catch((err) => { assert(err) done() }) }) it('read multiple times', async function () { const cursor = this.pgCursor(text) let res res = await cursor.read(2) assert.strictEqual(res.length, 2) res = await cursor.read(3) assert.strictEqual(res.length, 3) res = await cursor.read(1) assert.strictEqual(res.length, 1) res = await cursor.read(1) assert.strictEqual(res.length, 0) }) }) node-postgres-pg-8.14.1/packages/pg-cursor/test/query-config.js000066400000000000000000000020571476604072200244420ustar00rootroot00000000000000'use strict' const assert = require('assert') const Cursor = require('../') const pg = require('pg') describe('query config passed to result', () => { it('passes rowMode to result', (done) => { const client = new pg.Client() client.connect() const text = 'SELECT generate_series as num FROM generate_series(0, 5)' const cursor = client.query(new Cursor(text, null, { rowMode: 'array' })) cursor.read(10, (err, rows) => { assert(!err) assert.deepStrictEqual(rows, [[0], [1], [2], [3], [4], [5]]) client.end() done() }) }) it('passes types to result', (done) => { const client = new pg.Client() client.connect() const text = 'SELECT generate_series as num FROM generate_series(0, 2)' const types = { getTypeParser: () => () => 'foo', } const cursor = client.query(new Cursor(text, null, { types })) cursor.read(10, (err, rows) => { assert(!err) assert.deepStrictEqual(rows, [{ num: 'foo' }, { num: 'foo' }, { num: 'foo' }]) client.end() done() }) }) }) node-postgres-pg-8.14.1/packages/pg-cursor/test/transactions.js000066400000000000000000000033061476604072200245400ustar00rootroot00000000000000const assert = require('assert') const Cursor = require('../') const pg = require('pg') describe('transactions', () => { it('can execute multiple statements in a transaction', async () => { const client = new pg.Client() await client.connect() await client.query('begin') await client.query('CREATE TEMP TABLE foobar(id SERIAL PRIMARY KEY)') const cursor = client.query(new Cursor('SELECT * FROM foobar')) const rows = await new Promise((resolve, reject) => { cursor.read(10, (err, rows) => (err ? reject(err) : resolve(rows))) }) assert.strictEqual(rows.length, 0) await client.query('ALTER TABLE foobar ADD COLUMN name TEXT') await client.end() }) it('can execute multiple statements in a transaction if ending cursor early', async () => { const client = new pg.Client() await client.connect() await client.query('begin') await client.query('CREATE TEMP TABLE foobar(id SERIAL PRIMARY KEY)') const cursor = client.query(new Cursor('SELECT * FROM foobar')) await new Promise((resolve) => cursor.close(resolve)) await client.query('ALTER TABLE foobar ADD COLUMN name TEXT') await client.end() }) it('can execute multiple statements in a transaction if no data', async () => { const client = new pg.Client() await client.connect() await client.query('begin') // create a cursor that has no data response const createText = 'CREATE TEMP TABLE foobar(id SERIAL PRIMARY KEY)' const cursor = client.query(new Cursor(createText)) const err = await new Promise((resolve) => cursor.read(100, resolve)) assert.ifError(err) await client.query('ALTER TABLE foobar ADD COLUMN name TEXT') await client.end() }) }) node-postgres-pg-8.14.1/packages/pg-native/000077500000000000000000000000001476604072200204625ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg-native/README.md000066400000000000000000000250041476604072200217420ustar00rootroot00000000000000# node-pg-native [![Build Status](https://travis-ci.org/brianc/node-pg-native.svg?branch=master)](https://travis-ci.org/brianc/node-pg-native) High performance native bindings between node.js and PostgreSQL via [libpq](https://github.com/brianc/node-libpq) with a simple API. ## install You need PostgreSQL client libraries & tools installed. An easy way to check is to type `pg_config`. If `pg_config` is in your path, you should be good to go. If it's not in your path you'll need to consult operating specific instructions on how to go about getting it there. Some ways I've done it in the past: - On macOS: `brew install libpq` - On Ubuntu/Debian: `apt-get install libpq-dev g++ make` - On RHEL/CentOS: `yum install postgresql-devel` - On Windows: 1. Install Visual Studio C++ (successfully built with Express 2010). Express is free. 2. Install PostgreSQL (`http://www.postgresql.org/download/windows/`) 3. Add your Postgre Installation's `bin` folder to the system path (i.e. `C:\Program Files\PostgreSQL\9.3\bin`). 4. Make sure that both `libpq.dll` and `pg_config.exe` are in that folder. Afterwards `pg_config` should be in your path. Then... ```sh $ npm i pg-native ``` ## use ### async ```js var Client = require('pg-native') var client = new Client(); client.connect(function(err) { if(err) throw err //text queries client.query('SELECT NOW() AS the_date', function(err, rows) { if(err) throw err console.log(rows[0].the_date) //Tue Sep 16 2014 23:42:39 GMT-0400 (EDT) //parameterized statements client.query('SELECT $1::text as twitter_handle', ['@briancarlson'], function(err, rows) { if(err) throw err console.log(rows[0].twitter_handle) //@briancarlson }) //prepared statements client.prepare('get_twitter', 'SELECT $1::text as twitter_handle', 1, function(err) { if(err) throw err //execute the prepared, named statement client.execute('get_twitter', ['@briancarlson'], function(err, rows) { if(err) throw err console.log(rows[0].twitter_handle) //@briancarlson //execute the prepared, named statement again client.execute('get_twitter', ['@realcarrotfacts'], function(err, rows) { if(err) throw err console.log(rows[0].twitter_handle) //@realcarrotfacts client.end(function() { console.log('ended') }) }) }) }) }) }) ``` ### sync Because `pg-native` is bound to [libpq](https://github.com/brianc/node-libpq) it is able to provide _sync_ operations for both connecting and queries. This is a bad idea in _non-blocking systems_ like web servers, but is exteremly convienent in scripts and bootstrapping applications - much the same way `fs.readFileSync` comes in handy. ```js var Client = require('pg-native') var client = new Client() client.connectSync() //text queries var rows = client.querySync('SELECT NOW() AS the_date') console.log(rows[0].the_date) //Tue Sep 16 2014 23:42:39 GMT-0400 (EDT) //parameterized queries var rows = client.querySync('SELECT $1::text as twitter_handle', ['@briancarlson']) console.log(rows[0].twitter_handle) //@briancarlson //prepared statements client.prepareSync('get_twitter', 'SELECT $1::text as twitter_handle', 1) var rows = client.executeSync('get_twitter', ['@briancarlson']) console.log(rows[0].twitter_handle) //@briancarlson var rows = client.executeSync('get_twitter', ['@realcarrotfacts']) console.log(rows[0].twitter_handle) //@realcarrotfacts ``` ## api ### constructor - __`constructor Client()`__ Constructs and returns a new `Client` instance ### async functions - __`client.connect(, callback:function(err:Error))`__ Connect to a PostgreSQL backend server. __params__ is _optional_ and is in any format accepted by [libpq](http://www.postgresql.org/docs/9.3/static/libpq-connect.html#LIBPQ-CONNSTRING). The connection string is passed _as is_ to libpq, so any format supported by libpq will be supported here. Likewise, any format _unsupported_ by libpq will not work. If no parameters are supplied libpq will use [environment variables](http://www.postgresql.org/docs/9.3/static/libpq-envars.html) to connect. Returns an `Error` to the `callback` if the connection was unsuccessful. `callback` is _required_. ##### example ```js var client = new Client() client.connect(function(err) { if(err) throw err console.log('connected!') }) var client2 = new Client() client2.connect('postgresql://user:password@host:5432/database?param=value', function(err) { if(err) throw err console.log('connected with connection string!') }) ``` - __`client.query(queryText:string, , callback:Function(err:Error, rows:Object[]))`__ Execute a query with the text of `queryText` and _optional_ parameters specified in the `values` array. All values are passed to the PostgreSQL backend server and executed as a parameterized statement. The callback is _required_ and is called with an `Error` object in the event of a query error, otherwise it is passed an array of result objects. Each element in this array is a dictionary of results with keys for column names and their values as the values for those columns. ##### example ```js var client = new Client() client.connect(function(err) { if (err) throw err client.query('SELECT NOW()', function(err, rows) { if (err) throw err console.log(rows) // [{ "now": "Tue Sep 16 2014 23:42:39 GMT-0400 (EDT)" }] client.query('SELECT $1::text as name', ['Brian'], function(err, rows) { if (err) throw err console.log(rows) // [{ "name": "Brian" }] client.end() }) }) }) ``` - __`client.prepare(statementName:string, queryText:string, nParams:int, callback:Function(err:Error))`__ Prepares a _named statement_ for later execution. You _must_ supply the name of the statement via `statementName`, the command to prepare via `queryText` and the number of parameters in `queryText` via `nParams`. Calls the callback with an `Error` if there was an error. ##### example ```js var client = new Client() client.connect(function(err) { if(err) throw err client.prepare('prepared_statement', 'SELECT $1::text as name', 1, function(err) { if(err) throw err console.log('statement prepared') client.end() }) }) ``` - __`client.execute(statementName:string, , callback:Function(err:err, rows:Object[]))`__ Executes a previously prepared statement on this client with the name of `statementName`, passing it the optional array of query parameters as a `values` array. The `callback` is mandatory and is called with and `Error` if the execution failed, or with the same array of results as would be passed to the callback of a `client.query` result. ##### example ```js var client = new Client() client.connect(function(err) { if(err) throw err client.prepare('i_like_beans', 'SELECT $1::text as beans', 1, function(err) { if(err) throw err client.execute('i_like_beans', ['Brak'], function(err, rows) { if(err) throw err console.log(rows) // [{ "i_like_beans": "Brak" }] client.end() }) }) }) ``` - __`client.end(`__ Ends the connection. Calls the _optional_ callback when the connection is terminated. ##### example ```js var client = new Client() client.connect(function(err) { if(err) throw err client.end(function() { console.log('client ended') // client ended }) }) ``` - __`client.cancel(callback:function(err))`__ Cancels the active query on the client. Callback receives an error if there was an error _sending_ the cancel request. ##### example ```js var client = new Client() client.connectSync() //sleep for 100 seconds client.query('select pg_sleep(100)', function(err) { console.log(err) // [Error: ERROR: canceling statement due to user request] }) client.cancel(function(err) { console.log('cancel dispatched') }) ``` ### sync functions - __`client.connectSync(params:string)`__ Connect to a PostgreSQL backend server. Params is in any format accepted by [libpq](http://www.postgresql.org/docs/9.3/static/libpq-connect.html#LIBPQ-CONNSTRING). Throws an `Error` if the connection was unsuccessful. - __`client.querySync(queryText:string, ) -> results:Object[]`__ Executes a query with a text of `queryText` and optional parameters as `values`. Uses a parameterized query if `values` are supplied. Throws an `Error` if the query fails, otherwise returns an array of results. - __`client.prepareSync(statementName:string, queryText:string, nParams:int)`__ Prepares a name statement with name of `statementName` and a query text of `queryText`. You must specify the number of params in the query with the `nParams` argument. Throws an `Error` if the statement is un-preparable, otherwise returns an array of results. - __`client.executeSync(statementName:string, ) -> results:Object[]`__ Executes a previously prepared statement on this client with the name of `statementName`, passing it the optional array of query paramters as a `values` array. Throws an `Error` if the execution fails, otherwas returns an array of results. ## testing ```sh $ npm test ``` To run the tests you need a PostgreSQL backend reachable by typing `psql` with no connection parameters in your terminal. The tests use [environment variables](http://www.postgresql.org/docs/9.3/static/libpq-envars.html) to connect to the backend. An example of supplying a specific host the tests: ```sh $ PGHOST=blabla.mydatabasehost.com npm test ``` ## license The MIT License (MIT) Copyright (c) 2014 Brian M. Carlson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. node-postgres-pg-8.14.1/packages/pg-native/bench/000077500000000000000000000000001476604072200215415ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg-native/bench/index.js000066400000000000000000000017751476604072200232200ustar00rootroot00000000000000var pg = require('pg').native var Native = require('../') var warmup = function (fn, cb) { var count = 0 var max = 10 var run = function (err) { if (err) return cb(err) if (max >= count++) { return fn(run) } cb() } run() } var native = Native() native.connectSync() var queryText = 'SELECT generate_series(0, 1000) as X, generate_series(0, 1000) as Y, generate_series(0, 1000) as Z' var client = new pg.Client() client.connect(function () { var pure = function (cb) { client.query(queryText, function (err) { if (err) throw err cb(err) }) } var nativeQuery = function (cb) { native.query(queryText, function (err) { if (err) throw err cb(err) }) } var run = function () { console.time('pure') warmup(pure, function () { console.timeEnd('pure') console.time('native') warmup(nativeQuery, function () { console.timeEnd('native') }) }) } setInterval(function () { run() }, 500) }) node-postgres-pg-8.14.1/packages/pg-native/bench/leaks.js000066400000000000000000000022371476604072200232020ustar00rootroot00000000000000var Client = require('../') var async = require('async') var loop = function () { var client = new Client() var connect = function (cb) { client.connect(cb) } var simpleQuery = function (cb) { client.query('SELECT NOW()', cb) } var paramsQuery = function (cb) { client.query('SELECT $1::text as name', ['Brian'], cb) } var prepared = function (cb) { client.prepare('test', 'SELECT $1::text as name', 1, function (err) { if (err) return cb(err) client.execute('test', ['Brian'], cb) }) } var sync = function (cb) { client.querySync('SELECT NOW()') client.querySync('SELECT $1::text as name', ['Brian']) client.prepareSync('boom', 'SELECT $1::text as name', 1) client.executeSync('boom', ['Brian']) setImmediate(cb) } var end = function (cb) { client.end(cb) } var ops = [connect, simpleQuery, paramsQuery, prepared, sync, end] var start = Date.now() async.series(ops, function (err) { if (err) throw err console.log(Date.now() - start) setImmediate(loop) }) } // on my machine this will consume memory up to about 50 megs of ram // and then stabalize at that point loop() node-postgres-pg-8.14.1/packages/pg-native/index.js000066400000000000000000000203171476604072200221320ustar00rootroot00000000000000var Libpq = require('libpq') var EventEmitter = require('events').EventEmitter var util = require('util') var assert = require('assert') var types = require('pg-types') var buildResult = require('./lib/build-result') var CopyStream = require('./lib/copy-stream') var Client = (module.exports = function (config) { if (!(this instanceof Client)) { return new Client(config) } config = config || {} EventEmitter.call(this) this.pq = new Libpq() this._reading = false this._read = this._read.bind(this) // allow custom type converstion to be passed in this._types = config.types || types // allow config to specify returning results // as an array of values instead of a hash this.arrayMode = config.arrayMode || false this._resultCount = 0 this._rows = undefined this._results = undefined // lazy start the reader if notifications are listened for // this way if you only run sync queries you wont block // the event loop artificially this.on('newListener', (event) => { if (event !== 'notification') return this._startReading() }) this.on('result', this._onResult.bind(this)) this.on('readyForQuery', this._onReadyForQuery.bind(this)) }) util.inherits(Client, EventEmitter) Client.prototype.connect = function (params, cb) { this.pq.connect(params, cb) } Client.prototype.connectSync = function (params) { this.pq.connectSync(params) } Client.prototype.query = function (text, values, cb) { var queryFn if (typeof values === 'function') { cb = values } if (Array.isArray(values)) { queryFn = function () { return self.pq.sendQueryParams(text, values) } } else { queryFn = function () { return self.pq.sendQuery(text) } } var self = this self._dispatchQuery(self.pq, queryFn, function (err) { if (err) return cb(err) self._awaitResult(cb) }) } Client.prototype.prepare = function (statementName, text, nParams, cb) { var self = this var fn = function () { return self.pq.sendPrepare(statementName, text, nParams) } self._dispatchQuery(self.pq, fn, function (err) { if (err) return cb(err) self._awaitResult(cb) }) } Client.prototype.execute = function (statementName, parameters, cb) { var self = this var fn = function () { return self.pq.sendQueryPrepared(statementName, parameters) } self._dispatchQuery(self.pq, fn, function (err, rows) { if (err) return cb(err) self._awaitResult(cb) }) } Client.prototype.getCopyStream = function () { this.pq.setNonBlocking(true) this._stopReading() return new CopyStream(this.pq) } // cancel a currently executing query Client.prototype.cancel = function (cb) { assert(cb, 'Callback is required') // result is either true or a string containing an error var result = this.pq.cancel() return setImmediate(function () { cb(result === true ? undefined : new Error(result)) }) } Client.prototype.querySync = function (text, values) { if (values) { this.pq.execParams(text, values) } else { this.pq.exec(text) } throwIfError(this.pq) const result = buildResult(this.pq, this._types, this.arrayMode) return result.rows } Client.prototype.prepareSync = function (statementName, text, nParams) { this.pq.prepare(statementName, text, nParams) throwIfError(this.pq) } Client.prototype.executeSync = function (statementName, parameters) { this.pq.execPrepared(statementName, parameters) throwIfError(this.pq) return buildResult(this.pq, this._types, this.arrayMode).rows } Client.prototype.escapeLiteral = function (value) { return this.pq.escapeLiteral(value) } Client.prototype.escapeIdentifier = function (value) { return this.pq.escapeIdentifier(value) } // export the version number so we can check it in node-postgres module.exports.version = require('./package.json').version Client.prototype.end = function (cb) { this._stopReading() this.pq.finish() if (cb) setImmediate(cb) } Client.prototype._readError = function (message) { var err = new Error(message || this.pq.errorMessage()) this.emit('error', err) } Client.prototype._stopReading = function () { if (!this._reading) return this._reading = false this.pq.stopReader() this.pq.removeListener('readable', this._read) } Client.prototype._consumeQueryResults = function (pq) { return buildResult(pq, this._types, this.arrayMode) } Client.prototype._emitResult = function (pq) { var status = pq.resultStatus() switch (status) { case 'PGRES_FATAL_ERROR': this._queryError = new Error(this.pq.resultErrorMessage()) break case 'PGRES_TUPLES_OK': case 'PGRES_COMMAND_OK': case 'PGRES_EMPTY_QUERY': const result = this._consumeQueryResults(this.pq) this.emit('result', result) break case 'PGRES_COPY_OUT': case 'PGRES_COPY_BOTH': { break } default: this._readError('unrecognized command status: ' + status) break } return status } // called when libpq is readable Client.prototype._read = function () { var pq = this.pq // read waiting data from the socket // e.g. clear the pending 'select' if (!pq.consumeInput()) { // if consumeInput returns false // than a read error has been encountered return this._readError() } // check if there is still outstanding data // if so, wait for it all to come in if (pq.isBusy()) { return } // load our result object while (pq.getResult()) { const resultStatus = this._emitResult(this.pq) // if the command initiated copy mode we need to break out of the read loop // so a substream can begin to read copy data if (resultStatus === 'PGRES_COPY_BOTH' || resultStatus === 'PGRES_COPY_OUT') { break } // if reading multiple results, sometimes the following results might cause // a blocking read. in this scenario yield back off the reader until libpq is readable if (pq.isBusy()) { return } } this.emit('readyForQuery') var notice = this.pq.notifies() while (notice) { this.emit('notification', notice) notice = this.pq.notifies() } } // ensures the client is reading and // everything is set up for async io Client.prototype._startReading = function () { if (this._reading) return this._reading = true this.pq.on('readable', this._read) this.pq.startReader() } var throwIfError = function (pq) { var err = pq.resultErrorMessage() || pq.errorMessage() if (err) { throw new Error(err) } } Client.prototype._awaitResult = function (cb) { this._queryCallback = cb return this._startReading() } // wait for the writable socket to drain Client.prototype._waitForDrain = function (pq, cb) { var res = pq.flush() // res of 0 is success if (res === 0) return cb() // res of -1 is failure if (res === -1) return cb(pq.errorMessage()) // otherwise outgoing message didn't flush to socket // wait for it to flush and try again var self = this // you cannot read & write on a socket at the same time return pq.writable(function () { self._waitForDrain(pq, cb) }) } // send an async query to libpq and wait for it to // finish writing query text to the socket Client.prototype._dispatchQuery = function (pq, fn, cb) { this._stopReading() var success = pq.setNonBlocking(true) if (!success) return cb(new Error('Unable to set non-blocking to true')) var sent = fn() if (!sent) return cb(new Error(pq.errorMessage() || 'Something went wrong dispatching the query')) this._waitForDrain(pq, cb) } Client.prototype._onResult = function (result) { if (this._resultCount === 0) { this._results = result this._rows = result.rows } else if (this._resultCount === 1) { this._results = [this._results, result] this._rows = [this._rows, result.rows] } else { this._results.push(result) this._rows.push(result.rows) } this._resultCount++ } Client.prototype._onReadyForQuery = function () { // remove instance callback const cb = this._queryCallback this._queryCallback = undefined // remove instance query error const err = this._queryError this._queryError = undefined // remove instance rows const rows = this._rows this._rows = undefined // remove instance results const results = this._results this._results = undefined this._resultCount = 0 if (cb) { cb(err, rows || [], results) } } node-postgres-pg-8.14.1/packages/pg-native/lib/000077500000000000000000000000001476604072200212305ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg-native/lib/build-result.js000066400000000000000000000036331476604072200242060ustar00rootroot00000000000000'use strict' class Result { constructor(types, arrayMode) { this._types = types this._arrayMode = arrayMode this.command = undefined this.rowCount = undefined this.fields = [] this.rows = [] this._prebuiltEmptyResultObject = null } consumeCommand(pq) { this.command = pq.cmdStatus().split(' ')[0] this.rowCount = parseInt(pq.cmdTuples(), 10) } consumeFields(pq) { const nfields = pq.nfields() this.fields = new Array(nfields) var row = {} for (var x = 0; x < nfields; x++) { var name = pq.fname(x) row[name] = null this.fields[x] = { name: name, dataTypeID: pq.ftype(x), } } this._prebuiltEmptyResultObject = { ...row } } consumeRows(pq) { const tupleCount = pq.ntuples() this.rows = new Array(tupleCount) for (var i = 0; i < tupleCount; i++) { this.rows[i] = this._arrayMode ? this.consumeRowAsArray(pq, i) : this.consumeRowAsObject(pq, i) } } consumeRowAsObject(pq, rowIndex) { const row = { ...this._prebuiltEmptyResultObject } for (var j = 0; j < this.fields.length; j++) { row[this.fields[j].name] = this.readValue(pq, rowIndex, j) } return row } consumeRowAsArray(pq, rowIndex) { const row = new Array(this.fields.length) for (var j = 0; j < this.fields.length; j++) { row[j] = this.readValue(pq, rowIndex, j) } return row } readValue(pq, rowIndex, colIndex) { var rawValue = pq.getvalue(rowIndex, colIndex) if (rawValue === '' && pq.getisnull(rowIndex, colIndex)) { return null } const dataTypeId = this.fields[colIndex].dataTypeID return this._types.getTypeParser(dataTypeId)(rawValue) } } function buildResult(pq, types, arrayMode) { const result = new Result(types, arrayMode) result.consumeCommand(pq) result.consumeFields(pq) result.consumeRows(pq) return result } module.exports = buildResult node-postgres-pg-8.14.1/packages/pg-native/lib/copy-stream.js000066400000000000000000000072111476604072200240320ustar00rootroot00000000000000var Duplex = require('stream').Duplex var Writable = require('stream').Writable var util = require('util') var CopyStream = (module.exports = function (pq, options) { Duplex.call(this, options) this.pq = pq this._reading = false }) util.inherits(CopyStream, Duplex) // writer methods CopyStream.prototype._write = function (chunk, encoding, cb) { var result = this.pq.putCopyData(chunk) // sent successfully if (result === 1) return cb() // error if (result === -1) return cb(new Error(this.pq.errorMessage())) // command would block. wait for writable and call again. var self = this this.pq.writable(function () { self._write(chunk, encoding, cb) }) } CopyStream.prototype.end = function () { var args = Array.prototype.slice.call(arguments, 0) var self = this var callback = args.pop() if (args.length) { this.write(args[0]) } var result = this.pq.putCopyEnd() // sent successfully if (result === 1) { // consume our results and then call 'end' on the // "parent" writable class so we can emit 'finish' and // all that jazz return consumeResults(this.pq, function (err, res) { Writable.prototype.end.call(self) // handle possible passing of callback to end method if (callback) { callback(err) } }) } // error if (result === -1) { var err = new Error(this.pq.errorMessage()) return this.emit('error', err) } // command would block. wait for writable and call end again // don't pass any buffers to end on the second call because // we already sent them to possible this.write the first time // we called end return this.pq.writable(function () { return self.end.apply(self, callback) }) } // reader methods CopyStream.prototype._consumeBuffer = function (cb) { var result = this.pq.getCopyData(true) if (result instanceof Buffer) { return setImmediate(function () { cb(null, result) }) } if (result === -1) { // end of stream return cb(null, null) } if (result === 0) { var self = this this.pq.once('readable', function () { self.pq.stopReader() self.pq.consumeInput() self._consumeBuffer(cb) }) return this.pq.startReader() } cb(new Error('Unrecognized read status: ' + result)) } CopyStream.prototype._read = function (size) { if (this._reading) return this._reading = true // console.log('read begin'); var self = this this._consumeBuffer(function (err, buffer) { self._reading = false if (err) { return self.emit('error', err) } if (buffer === false) { // nothing to read for now, return return } self.push(buffer) }) } var consumeResults = function (pq, cb) { var cleanup = function () { pq.removeListener('readable', onReadable) pq.stopReader() } var readError = function (message) { cleanup() return cb(new Error(message || pq.errorMessage())) } var onReadable = function () { // read waiting data from the socket // e.g. clear the pending 'select' if (!pq.consumeInput()) { return readError() } // check if there is still outstanding data // if so, wait for it all to come in if (pq.isBusy()) { return } // load our result object pq.getResult() // "read until results return null" // or in our case ensure we only have one result if (pq.getResult() && pq.resultStatus() !== 'PGRES_COPY_OUT') { return readError('Only one result at a time is accepted') } if (pq.resultStatus() === 'PGRES_FATAL_ERROR') { return readError() } cleanup() return cb(null) } pq.on('readable', onReadable) pq.startReader() } node-postgres-pg-8.14.1/packages/pg-native/package.json000066400000000000000000000015411476604072200227510ustar00rootroot00000000000000{ "name": "pg-native", "version": "3.3.0", "description": "A slightly nicer interface to Postgres over node-libpq", "main": "index.js", "scripts": { "test": "mocha" }, "repository": { "type": "git", "url": "https://github.com/brianc/node-postgres.git" }, "keywords": [ "postgres", "pg", "libpq" ], "author": "Brian M. Carlson", "license": "MIT", "bugs": { "url": "https://github.com/brianc/node-postgres/issues" }, "homepage": "https://github.com/brianc/node-postgres/tree/master/packages/pg-native", "dependencies": { "libpq": "1.8.14", "pg-types": "^2.1.0" }, "devDependencies": { "async": "^0.9.0", "concat-stream": "^1.4.6", "generic-pool": "^2.1.1", "lodash": "^4.17.21", "mocha": "10.5.2", "node-gyp": ">=10.x", "okay": "^0.3.0", "semver": "^4.1.0" } } node-postgres-pg-8.14.1/packages/pg-native/test/000077500000000000000000000000001476604072200214415ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg-native/test/array-mode.js000066400000000000000000000015341476604072200240420ustar00rootroot00000000000000var Client = require('../') var assert = require('assert') describe('client with arrayMode', function () { it('returns result as array', function (done) { var client = new Client({ arrayMode: true }) client.connectSync() client.querySync('CREATE TEMP TABLE blah(name TEXT)') client.querySync('INSERT INTO blah (name) VALUES ($1)', ['brian']) client.querySync('INSERT INTO blah (name) VALUES ($1)', ['aaron']) var rows = client.querySync('SELECT * FROM blah') assert.equal(rows.length, 2) var row = rows[0] assert.equal(row.length, 1) assert.equal(row[0], 'brian') assert.equal(rows[1][0], 'aaron') client.query("SELECT 'brian', null", function (err, res) { assert.ifError(err) assert.strictEqual(res[0][0], 'brian') assert.strictEqual(res[0][1], null) client.end(done) }) }) }) node-postgres-pg-8.14.1/packages/pg-native/test/async-workflow.js000066400000000000000000000041701476604072200247660ustar00rootroot00000000000000var Client = require('../') var ok = require('okay') var assert = require('assert') var concat = require('concat-stream') describe('async workflow', function () { before(function (done) { this.client = new Client() this.client.connect(done) }) var echoParams = function (params, cb) { this.client.query( 'SELECT $1::text as first, $2::text as second', params, ok(cb, function (rows) { checkParams(params, rows) cb(null, rows) }) ) } var checkParams = function (params, rows) { assert.equal(rows.length, 1) assert.equal(rows[0].first, params[0]) assert.equal(rows[0].second, params[1]) } it('sends async query', function (done) { var params = ['one', 'two'] echoParams.call(this, params, done) }) it('sends multiple async queries', function (done) { var self = this var params = ['bang', 'boom'] echoParams.call( this, params, ok(done, function (rows) { echoParams.call(self, params, done) }) ) }) it('sends an async query, copies in, copies out, and sends another query', function (done) { var self = this this.client.querySync('CREATE TEMP TABLE test(name text, age int)') this.client.query( "INSERT INTO test(name, age) VALUES('brian', 32)", ok(done, function () { self.client.querySync('COPY test FROM stdin') var input = self.client.getCopyStream() input.write(Buffer.from('Aaron\t30\n', 'utf8')) input.end(function () { self.client.query( 'SELECT COUNT(*) FROM test', ok(done, function (rows) { assert.equal(rows.length, 1) self.client.query( 'COPY test TO stdout', ok(done, function () { var output = self.client.getCopyStream() // pump the stream output.read() output.pipe( concat(function (res) { done() }) ) }) ) }) ) }) }) ) }) }) node-postgres-pg-8.14.1/packages/pg-native/test/cancel.js000066400000000000000000000014771476604072200232350ustar00rootroot00000000000000var Client = require('../') var assert = require('assert') describe('cancel query', function () { it('works', function (done) { var client = new Client() client.connectSync() client.query('SELECT pg_sleep(1000);', function (err) { assert(err instanceof Error) client.end(done) }) setTimeout(() => { client.cancel(function (err) { assert.ifError(err) }) }, 100) }) it('does not raise error if no active query', function (done) { var client = new Client() client.connectSync() client.cancel(function (err) { assert.ifError(err) done() }) }) it('raises error if client is not connected', function (done) { new Client().cancel(function (err) { assert(err, 'should raise an error when not connected') done() }) }) }) node-postgres-pg-8.14.1/packages/pg-native/test/connection-errors.js000066400000000000000000000007341476604072200254540ustar00rootroot00000000000000'use strict' var Client = require('../') var assert = require('assert') describe('connection errors', function () { it('raise error events', function (done) { var client = new Client() client.connectSync() client.query('SELECT pg_terminate_backend(pg_backend_pid())', assert.fail) client.on('error', function (err) { assert(err) assert.strictEqual(client.pq.resultErrorFields().sqlState, '57P01') client.end() done() }) }) }) node-postgres-pg-8.14.1/packages/pg-native/test/connection.js000066400000000000000000000011331476604072200241340ustar00rootroot00000000000000var Client = require('../') var assert = require('assert') describe('connection error', function () { it('doesnt segfault', function (done) { var client = new Client() client.connect('asldgsdgasgdasdg', function (err) { assert(err) // calling error on a closed client was segfaulting client.end() done() }) }) }) describe('reading while not connected', function () { it('does not seg fault but does throw execption', function () { var client = new Client() assert.throws(function () { client.on('notification', function (msg) {}) }) }) }) node-postgres-pg-8.14.1/packages/pg-native/test/copy-from.js000066400000000000000000000027071476604072200237200ustar00rootroot00000000000000var assert = require('assert') var Client = require('../') describe('COPY FROM', function () { before(function (done) { this.client = Client() this.client.connect(done) }) after(function (done) { this.client.end(done) }) it('works', function (done) { var client = this.client this.client.querySync('CREATE TEMP TABLE blah(name text, age int)') this.client.querySync('COPY blah FROM stdin') var stream = this.client.getCopyStream() stream.write(Buffer.from('Brian\t32\n', 'utf8')) stream.write(Buffer.from('Aaron\t30\n', 'utf8')) stream.write(Buffer.from('Shelley\t28\n', 'utf8')) stream.end() stream.once('finish', function () { var rows = client.querySync('SELECT COUNT(*) FROM blah') assert.equal(rows.length, 1) assert.equal(rows[0].count, 3) done() }) }) it('works with a callback passed to end', function (done) { var client = this.client this.client.querySync('CREATE TEMP TABLE boom(name text, age int)') this.client.querySync('COPY boom FROM stdin') var stream = this.client.getCopyStream() stream.write(Buffer.from('Brian\t32\n', 'utf8')) stream.write(Buffer.from('Aaron\t30\n', 'utf8'), function () { stream.end(Buffer.from('Shelley\t28\n', 'utf8'), function () { var rows = client.querySync('SELECT COUNT(*) FROM boom') assert.equal(rows.length, 1) assert.equal(rows[0].count, 3) done() }) }) }) }) node-postgres-pg-8.14.1/packages/pg-native/test/copy-to.js000066400000000000000000000016211476604072200233710ustar00rootroot00000000000000var assert = require('assert') var Client = require('../') var concat = require('concat-stream') var _ = require('lodash') describe('COPY TO', function () { before(function (done) { this.client = Client() this.client.connect(done) }) after(function (done) { this.client.end(done) }) it('works - basic check', function (done) { var limit = 1000 var qText = 'COPY (SELECT * FROM generate_series(0, ' + (limit - 1) + ')) TO stdout' var self = this this.client.query(qText, function (err) { if (err) return done(err) var stream = self.client.getCopyStream() // pump the stream for node v0.11.x stream.read() stream.pipe( concat(function (buff) { var res = buff.toString('utf8') var expected = _.range(0, limit).join('\n') + '\n' assert.equal(res, expected) done() }) ) }) }) }) node-postgres-pg-8.14.1/packages/pg-native/test/custom-types.js000066400000000000000000000011761476604072200244600ustar00rootroot00000000000000var Client = require('../') var ok = require('okay') var assert = require('assert') describe('Custom type parser', function () { it('is used by client', function (done) { var client = new Client({ types: { getTypeParser: function () { return function () { return 'blah' } }, }, }) client.connectSync() var rows = client.querySync('SELECT NOW() AS when') assert.equal(rows[0].when, 'blah') client.query( 'SELECT NOW() as when', ok(function (rows) { assert.equal(rows[0].when, 'blah') client.end(done) }) ) }) }) node-postgres-pg-8.14.1/packages/pg-native/test/domains.js000066400000000000000000000020001476604072200234210ustar00rootroot00000000000000var Client = require('../') var assert = require('assert') var checkDomain = function (domain, when) { assert(process.domain, 'Domain was lost after ' + when) assert.strictEqual(process.domain, domain, 'Domain switched after ' + when) } describe('domains', function () { it('remains bound after a query', function (done) { var domain = require('domain').create() // eslint-disable-line domain.run(function () { var client = new Client() client.connect(function () { checkDomain(domain, 'connection') client.query('SELECT NOW()', function () { checkDomain(domain, 'query') client.prepare('testing', 'SELECT NOW()', 0, function () { checkDomain(domain, 'prepare') client.execute('testing', [], function () { checkDomain(domain, 'execute') client.end(function () { checkDomain(domain, 'end') done() }) }) }) }) }) }) }) }) node-postgres-pg-8.14.1/packages/pg-native/test/empty-query.js000066400000000000000000000006711476604072200243040ustar00rootroot00000000000000var Client = require('../') var assert = require('assert') describe('empty query', () => { it('has field metadata in result', (done) => { const client = new Client() client.connectSync() client.query('SELECT NOW() as now LIMIT 0', (err, rows, res) => { assert(!err) assert.equal(rows.length, 0) assert(Array.isArray(res.fields)) assert.equal(res.fields.length, 1) client.end(done) }) }) }) node-postgres-pg-8.14.1/packages/pg-native/test/huge-query.js000066400000000000000000000011451476604072200240730ustar00rootroot00000000000000var Client = require('../') var assert = require('assert') describe('huge async query', function () { before(function (done) { this.client = Client() this.client.connect(done) }) after(function (done) { this.client.end(done) }) it('works', function (done) { var params = [''] var len = 100000 for (var i = 0; i < len; i++) { params[0] += 'A' } var qText = "SELECT '" + params[0] + "'::text as my_text" this.client.query(qText, function (err, rows) { if (err) return done(err) assert.equal(rows[0].my_text.length, len) done() }) }) }) node-postgres-pg-8.14.1/packages/pg-native/test/index.js000066400000000000000000000015151476604072200231100ustar00rootroot00000000000000var Client = require('../') var assert = require('assert') describe('connection', function () { it('works', function (done) { Client().connect(done) }) it('connects with args', function (done) { Client().connect('host=localhost', done) }) it('errors out with bad connection args', function (done) { Client().connect('host=asldkfjasdf', function (err) { assert(err, 'should raise an error for bad host') done() }) }) }) describe('connectSync', function () { it('works without args', function () { Client().connectSync() }) it('works with args', function () { var args = 'host=' + (process.env.PGHOST || 'localhost') Client().connectSync(args) }) it('throws if bad host', function () { assert.throws(function () { Client().connectSync('host=laksdjfdsf') }) }) }) node-postgres-pg-8.14.1/packages/pg-native/test/load.js000066400000000000000000000012051476604072200227140ustar00rootroot00000000000000var Client = require('../') var async = require('async') var ok = require('okay') var execute = function (x, done) { var client = new Client() client.connectSync() var query = function (n, cb) { client.query('SELECT $1::int as num', [n], function (err) { cb(err) }) } return async.timesSeries( 5, query, ok(done, function () { client.end() done() }) ) } describe('Load tests', function () { it('single client and many queries', function (done) { async.times(1, execute, done) }) it('multiple client and many queries', function (done) { async.times(20, execute, done) }) }) node-postgres-pg-8.14.1/packages/pg-native/test/many-connections.js000066400000000000000000000021741476604072200252670ustar00rootroot00000000000000var Client = require('../') var async = require('async') var ok = require('okay') var bytes = require('crypto').pseudoRandomBytes describe('many connections', function () { describe('async', function () { var test = function (count, times) { it(`connecting ${count} clients ${times} times`, function (done) { this.timeout(200000) var connectClient = function (n, cb) { var client = new Client() client.connect( ok(cb, function () { bytes( 1000, ok(cb, function (chunk) { client.query( 'SELECT $1::text as txt', [chunk.toString('base64')], ok(cb, function (rows) { client.end(cb) }) ) }) ) }) ) } var run = function (n, cb) { async.times(count, connectClient, cb) } async.timesSeries(times, run, done) }) } test(1, 1) test(5, 5) test(10, 10) test(20, 20) test(30, 10) }) }) node-postgres-pg-8.14.1/packages/pg-native/test/many-errors.js000066400000000000000000000012061476604072200242540ustar00rootroot00000000000000var Client = require('../') var async = require('async') var assert = require('assert') describe('many errors', function () { it('functions properly without segfault', function (done) { var throwError = function (n, cb) { var client = new Client() client.connectSync() var doIt = function (n, cb) { client.query('select asdfiasdf', function (err) { assert(err, 'bad query should emit an error') cb(null) }) } async.timesSeries(10, doIt, function (err) { if (err) return cb(err) client.end(cb) }) } async.times(10, throwError, done) }) }) node-postgres-pg-8.14.1/packages/pg-native/test/mocha.opts000066400000000000000000000000211476604072200234300ustar00rootroot00000000000000--bail --no-exit node-postgres-pg-8.14.1/packages/pg-native/test/multiple-queries.js000066400000000000000000000023101476604072200253010ustar00rootroot00000000000000var Client = require('../') var assert = require('assert') describe('multiple commands in a single query', function () { before(function (done) { this.client = new Client() this.client.connect(done) }) after(function (done) { this.client.end(done) }) it('all execute to completion', function (done) { this.client.query("SELECT '10'::int as num; SELECT 'brian'::text as name", function (err, rows) { assert.ifError(err) assert.equal(rows.length, 2, 'should return two sets rows') assert.equal(rows[0][0].num, '10') assert.equal(rows[1][0].name, 'brian') done() }) }) it('inserts and reads at once', function (done) { var txt = 'CREATE TEMP TABLE boom(age int);' txt += 'INSERT INTO boom(age) VALUES(10);' txt += 'SELECT * FROM boom;' this.client.query(txt, function (err, rows, results) { assert.ifError(err) assert.equal(rows.length, 3) assert.equal(rows[0].length, 0) assert.equal(rows[1].length, 0) assert.equal(rows[2][0].age, 10) assert.equal(results[0].command, 'CREATE') assert.equal(results[1].command, 'INSERT') assert.equal(results[2].command, 'SELECT') done() }) }) }) node-postgres-pg-8.14.1/packages/pg-native/test/multiple-statement-results.js000066400000000000000000000013211476604072200273300ustar00rootroot00000000000000var Client = require('../') var assert = require('assert') describe('multiple statements', () => { before(() => { this.client = new Client() this.client.connectSync() }) after(() => this.client.end()) it('works with multiple queries', (done) => { const text = ` SELECT generate_series(1, 2) as foo; SELECT generate_series(10, 11) as bar; SELECT generate_series(20, 22) as baz; ` this.client.query(text, (err, results) => { if (err) return done(err) assert(Array.isArray(results)) assert.equal(results.length, 3) assert(Array.isArray(results[0])) assert(Array.isArray(results[1])) assert(Array.isArray(results[2])) done() }) }) }) node-postgres-pg-8.14.1/packages/pg-native/test/notify.js000066400000000000000000000025771476604072200233220ustar00rootroot00000000000000var Client = require('../') var ok = require('okay') var notify = function (channel, payload) { var client = new Client() client.connectSync() client.querySync('NOTIFY ' + channel + ", '" + payload + "'") client.end() } describe('simple LISTEN/NOTIFY', function () { before(function (done) { var client = (this.client = new Client()) client.connect(done) }) it('works', function (done) { var client = this.client client.querySync('LISTEN boom') client.on('notification', function (msg) { done() }) notify('boom', 'sup') }) after(function (done) { this.client.end(done) }) }) if (!process.env.TRAVIS_CI) { describe('async LISTEN/NOTIFY', function () { before(function (done) { var client = (this.client = new Client()) client.connect(done) }) it('works', function (done) { var client = this.client var count = 0 var check = function () { count++ if (count >= 2) return done() } client.on('notification', check) client.query( 'LISTEN test', ok(done, function () { notify('test', 'bot') client.query( 'SELECT pg_sleep(.05)', ok(done, function () { notify('test', 'bot') }) ) }) ) }) after(function (done) { this.client.end(done) }) }) } node-postgres-pg-8.14.1/packages/pg-native/test/prepare.js000066400000000000000000000023141476604072200234350ustar00rootroot00000000000000var Client = require('../') var ok = require('okay') var async = require('async') describe('async prepare', function () { var run = function (n, cb) { var client = new Client() client.connectSync() var exec = function (x, done) { client.prepare('get_now' + x, 'SELECT NOW()', 0, done) } async.timesSeries( 10, exec, ok(cb, function () { client.end(cb) }) ) } var t = function (n) { it('works for ' + n + ' clients', function (done) { async.times(n, run, function (err) { done(err) }) }) } for (var i = 0; i < 10; i++) { t(i) } }) describe('async execute', function () { var run = function (n, cb) { var client = new Client() client.connectSync() client.prepareSync('get_now', 'SELECT NOW()', 0) var exec = function (x, cb) { client.execute('get_now', [], cb) } async.timesSeries( 10, exec, ok(cb, function () { client.end(cb) }) ) } var t = function (n) { it('works for ' + n + ' clients', function (done) { async.times(n, run, function (err) { done(err) }) }) } for (var i = 0; i < 10; i++) { t(i) } }) node-postgres-pg-8.14.1/packages/pg-native/test/query-async.js000066400000000000000000000061551476604072200242660ustar00rootroot00000000000000var Client = require('../') var assert = require('assert') var async = require('async') var ok = require('okay') describe('async query', function () { before(function (done) { this.client = Client() this.client.connect(done) }) after(function (done) { this.client.end(done) }) it('can execute many prepared statements on a client', function (done) { async.timesSeries( 20, (i, cb) => { this.client.query('SELECT $1::text as name', ['brianc'], cb) }, done ) }) it('simple query works', function (done) { var runQuery = function (n, done) { this.client.query('SELECT NOW() AS the_time', function (err, rows) { if (err) return done(err) assert.equal(rows[0].the_time.getFullYear(), new Date().getFullYear()) return done() }) }.bind(this) async.timesSeries(3, runQuery, done) }) it('parameters work', function (done) { var runQuery = function (n, done) { this.client.query('SELECT $1::text AS name', ['Brian'], done) }.bind(this) async.timesSeries(3, runQuery, done) }) it('prepared, named statements work', function (done) { var client = this.client client.prepare('test', 'SELECT $1::text as name', 1, function (err) { if (err) return done(err) client.execute( 'test', ['Brian'], ok(done, function (rows) { assert.equal(rows.length, 1) assert.equal(rows[0].name, 'Brian') client.execute( 'test', ['Aaron'], ok(done, function (rows) { assert.equal(rows.length, 1) assert.equal(rows[0].name, 'Aaron') done() }) ) }) ) }) }) it('returns error if prepare fails', function (done) { this.client.prepare('test', 'SELECT AWWW YEAH', 0, function (err) { assert(err, 'Should have returned an error') done() }) }) it('returns an error if execute fails', function (done) { this.client.execute('test', [], function (err) { assert(err, 'Should have returned an error') done() }) }) it('returns an error if there was a query error', function (done) { var runErrorQuery = function (n, done) { this.client.query('SELECT ALKJSFDSLFKJ', function (err) { assert(err instanceof Error, 'Should return an error instance') done() }) }.bind(this) async.timesSeries(3, runErrorQuery, done) }) it('is still usable after an error', function (done) { const runErrorQuery = (_, cb) => { this.client.query('SELECT LKJSDJFLSDKFJ', (err) => { assert(err instanceof Error, 'Should return an error instance') cb(null, err) }) } async.timesSeries(3, runErrorQuery, (err, res) => { assert(!err) assert.equal(res.length, 3) this.client.query('SELECT NOW()', done) }) }) it('supports empty query', function (done) { this.client.query('', function (err, rows) { assert.ifError(err) assert(Array.isArray(rows)) console.log('rows', rows) assert(rows.length === 0) done() }) }) }) node-postgres-pg-8.14.1/packages/pg-native/test/query-sync.js000066400000000000000000000044061476604072200241220ustar00rootroot00000000000000var Client = require('../') var assert = require('assert') describe('query sync', function () { before(function () { this.client = Client() this.client.connectSync() }) after(function (done) { this.client.end(done) }) it('simple query works', function () { var rows = this.client.querySync('SELECT NOW() AS the_time') assert.equal(rows.length, 1) assert.equal(rows[0].the_time.getFullYear(), new Date().getFullYear()) }) it('parameterized query works', function () { var rows = this.client.querySync('SELECT $1::text AS name', ['Brian']) assert.equal(rows.length, 1) assert.equal(rows[0].name, 'Brian') }) it('throws when second argument is not an array', function () { assert.throws(() => { this.client.querySync('SELECT $1::text AS name', 'Brian') }) assert.throws(() => { this.client.prepareSync('test-failure', 'SELECT $1::text as name', 1) this.client.executeSync('test-failure', 'Brian') }) }) it('prepared statement works', function () { this.client.prepareSync('test', 'SELECT $1::text as name', 1) var rows = this.client.executeSync('test', ['Brian']) assert.equal(rows.length, 1) assert.equal(rows[0].name, 'Brian') var rows2 = this.client.executeSync('test', ['Aaron']) assert.equal(rows2.length, 1) assert.equal(rows2[0].name, 'Aaron') }) it('prepare throws exception on error', function () { assert.throws( function () { this.client.prepareSync('blah', 'I LIKE TO PARTY!!!', 0) }.bind(this) ) }) it('throws exception on executing improperly', function () { assert.throws(function () { // wrong number of parameters this.client.executeSync('test', []) }) }) it('throws exception on error', function () { assert.throws( function () { this.client.querySync('SELECT ASLKJASLKJF') }.bind(this) ) }) it('is still usable after an error', function () { var rows = this.client.querySync('SELECT NOW()') assert(rows, 'should have returned rows') assert.equal(rows.length, 1) }) it('supports empty query', function () { var rows = this.client.querySync('') assert(rows, 'should return rows') assert.equal(rows.length, 0, 'should return no rows') }) }) node-postgres-pg-8.14.1/packages/pg-native/test/version.js000066400000000000000000000004661476604072200234720ustar00rootroot00000000000000var Client = require('../') var assert = require('assert') var semver = require('semver') describe('version', function () { it('is exported', function () { assert(Client.version) assert.equal(require('../package.json').version, Client.version) assert(semver.gt(Client.version, '1.4.0')) }) }) node-postgres-pg-8.14.1/packages/pg-pool/000077500000000000000000000000001476604072200201455ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg-pool/LICENSE000066400000000000000000000020611476604072200211510ustar00rootroot00000000000000MIT License Copyright (c) 2017 Brian M. Carlson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. node-postgres-pg-8.14.1/packages/pg-pool/README.md000066400000000000000000000331111476604072200214230ustar00rootroot00000000000000# pg-pool [![Build Status](https://travis-ci.org/brianc/node-pg-pool.svg?branch=master)](https://travis-ci.org/brianc/node-pg-pool) A connection pool for node-postgres ## install ```sh npm i pg-pool pg ``` ## use ### create to use pg-pool you must first create an instance of a pool ```js var Pool = require('pg-pool') // by default the pool uses the same // configuration as whatever `pg` version you have installed var pool = new Pool() // you can pass properties to the pool // these properties are passed unchanged to both the node-postgres Client constructor // and the node-pool (https://github.com/coopernurse/node-pool) constructor // allowing you to fully configure the behavior of both var pool2 = new Pool({ database: 'postgres', user: 'brianc', password: 'secret!', port: 5432, ssl: true, max: 20, // set pool max size to 20 idleTimeoutMillis: 1000, // close idle clients after 1 second connectionTimeoutMillis: 1000, // return an error after 1 second if connection could not be established maxUses: 7500, // close (and replace) a connection after it has been used 7500 times (see below for discussion) }) //you can supply a custom client constructor //if you want to use the native postgres client var NativeClient = require('pg').native.Client var nativePool = new Pool({ Client: NativeClient }) //you can even pool pg-native clients directly var PgNativeClient = require('pg-native') var pgNativePool = new Pool({ Client: PgNativeClient }) ``` ##### Note: The Pool constructor does not support passing a Database URL as the parameter. To use pg-pool on heroku, for example, you need to parse the URL into a config object. Here is an example of how to parse a Database URL. ```js const Pool = require('pg-pool'); const url = require('url') const params = url.parse(process.env.DATABASE_URL); const auth = params.auth.split(':'); const config = { user: auth[0], password: auth[1], host: params.hostname, port: params.port, database: params.pathname.split('/')[1], ssl: true }; const pool = new Pool(config); /* Transforms, 'postgres://DBuser:secret@DBHost:#####/myDB', into config = { user: 'DBuser', password: 'secret', host: 'DBHost', port: '#####', database: 'myDB', ssl: true } */ ``` ### acquire clients with a promise pg-pool supports a fully promise-based api for acquiring clients ```js var pool = new Pool() pool.connect().then(client => { client.query('select $1::text as name', ['pg-pool']).then(res => { client.release() console.log('hello from', res.rows[0].name) }) .catch(e => { client.release() console.error('query error', e.message, e.stack) }) }) ``` ### plays nice with async/await this ends up looking much nicer if you're using [co](https://github.com/tj/co) or async/await: ```js // with async/await (async () => { var pool = new Pool() var client = await pool.connect() try { var result = await client.query('select $1::text as name', ['brianc']) console.log('hello from', result.rows[0]) } finally { client.release() } })().catch(e => console.error(e.message, e.stack)) // with co co(function * () { var client = yield pool.connect() try { var result = yield client.query('select $1::text as name', ['brianc']) console.log('hello from', result.rows[0]) } finally { client.release() } }).catch(e => console.error(e.message, e.stack)) ``` ### your new favorite helper method because its so common to just run a query and return the client to the pool afterward pg-pool has this built-in: ```js var pool = new Pool() var time = await pool.query('SELECT NOW()') var name = await pool.query('select $1::text as name', ['brianc']) console.log(name.rows[0].name, 'says hello at', time.rows[0].now) ``` you can also use a callback here if you'd like: ```js var pool = new Pool() pool.query('SELECT $1::text as name', ['brianc'], function (err, res) { console.log(res.rows[0].name) // brianc }) ``` __pro tip:__ unless you need to run a transaction (which requires a single client for multiple queries) or you have some other edge case like [streaming rows](https://github.com/brianc/node-pg-query-stream) or using a [cursor](https://github.com/brianc/node-pg-cursor) you should almost always just use `pool.query`. Its easy, it does the right thing :tm:, and wont ever forget to return clients back to the pool after the query is done. ### drop-in backwards compatible pg-pool still and will always support the traditional callback api for acquiring a client. This is the exact API node-postgres has shipped with for years: ```js var pool = new Pool() pool.connect((err, client, done) => { if (err) return done(err) client.query('SELECT $1::text as name', ['pg-pool'], (err, res) => { done() if (err) { return console.error('query error', err.message, err.stack) } console.log('hello from', res.rows[0].name) }) }) ``` ### shut it down When you are finished with the pool if all the clients are idle the pool will close them after `config.idleTimeoutMillis` and your app will shutdown gracefully. If you don't want to wait for the timeout you can end the pool as follows: ```js var pool = new Pool() var client = await pool.connect() console.log(await client.query('select now()')) client.release() await pool.end() ``` ### a note on instances The pool should be a __long-lived object__ in your application. Generally you'll want to instantiate one pool when your app starts up and use the same instance of the pool throughout the lifetime of your application. If you are frequently creating a new pool within your code you likely don't have your pool initialization code in the correct place. Example: ```js // assume this is a file in your program at ./your-app/lib/db.js // correct usage: create the pool and let it live // 'globally' here, controlling access to it through exported methods var pool = new pg.Pool() // this is the right way to export the query method module.exports.query = (text, values) => { console.log('query:', text, values) return pool.query(text, values) } // this would be the WRONG way to export the connect method module.exports.connect = () => { // notice how we would be creating a pool instance here // every time we called 'connect' to get a new client? // that's a bad thing & results in creating an unbounded // number of pools & therefore connections var aPool = new pg.Pool() return aPool.connect() } ``` ### events Every instance of a `Pool` is an event emitter. These instances emit the following events: #### error Emitted whenever an idle client in the pool encounters an error. This is common when your PostgreSQL server shuts down, reboots, or a network partition otherwise causes it to become unavailable while your pool has connected clients. Example: ```js const Pool = require('pg-pool') const pool = new Pool() // attach an error handler to the pool for when a connected, idle client // receives an error by being disconnected, etc pool.on('error', function(error, client) { // handle this in the same way you would treat process.on('uncaughtException') // it is supplied the error as well as the idle client which received the error }) ``` #### connect Fired whenever the pool creates a __new__ `pg.Client` instance and successfully connects it to the backend. Example: ```js const Pool = require('pg-pool') const pool = new Pool() var count = 0 pool.on('connect', client => { client.count = count++ }) pool .connect() .then(client => { return client .query('SELECT $1::int AS "clientCount"', [client.count]) .then(res => console.log(res.rows[0].clientCount)) // outputs 0 .then(() => client) }) .then(client => client.release()) ``` #### acquire Fired whenever a client is acquired from the pool Example: This allows you to count the number of clients which have ever been acquired from the pool. ```js var Pool = require('pg-pool') var pool = new Pool() var acquireCount = 0 pool.on('acquire', function (client) { acquireCount++ }) var connectCount = 0 pool.on('connect', function () { connectCount++ }) for (var i = 0; i < 200; i++) { pool.query('SELECT NOW()') } setTimeout(function () { console.log('connect count:', connectCount) // output: connect count: 10 console.log('acquire count:', acquireCount) // output: acquire count: 200 }, 100) ``` ### environment variables pg-pool & node-postgres support some of the same environment variables as `psql` supports. The most common are: ``` PGDATABASE=my_db PGUSER=username PGPASSWORD="my awesome password" PGPORT=5432 PGSSLMODE=require ``` Usually I will export these into my local environment via a `.env` file with environment settings or export them in `~/.bash_profile` or something similar. This way I get configurability which works with both the postgres suite of tools (`psql`, `pg_dump`, `pg_restore`) and node, I can vary the environment variables locally and in production, and it supports the concept of a [12-factor app](http://12factor.net/) out of the box. ## bring your own promise In versions of node `<=0.12.x` there is no native promise implementation available globally. You can polyfill the promise globally like this: ```js // first run `npm install promise-polyfill --save if (typeof Promise == 'undefined') { global.Promise = require('promise-polyfill') } ``` You can use any other promise implementation you'd like. The pool also allows you to configure the promise implementation on a per-pool level: ```js var bluebirdPool = new Pool({ Promise: require('bluebird') }) ``` __please note:__ in node `<=0.12.x` the pool will throw if you do not provide a promise constructor in one of the two ways mentioned above. In node `>=4.0.0` the pool will use the native promise implementation by default; however, the two methods above still allow you to "bring your own." ## maxUses and read-replica autoscaling (e.g. AWS Aurora) The maxUses config option can help an application instance rebalance load against a replica set that has been auto-scaled after the connection pool is already full of healthy connections. The mechanism here is that a connection is considered "expended" after it has been acquired and released `maxUses` number of times. Depending on the load on your system, this means there will be an approximate time in which any given connection will live, thus creating a window for rebalancing. Imagine a scenario where you have 10 app instances providing an API running against a replica cluster of 3 that are accessed via a round-robin DNS entry. Each instance runs a connection pool size of 20. With an ambient load of 50 requests per second, the connection pool will likely fill up in a few minutes with healthy connections. If you have weekly bursts of traffic which peak at 1,000 requests per second, you might want to grow your replicas to 10 during this period. Without setting `maxUses`, the new replicas will not be adopted by the app servers without an intervention -- namely, restarting each in turn in order to build up new connection pools that are balanced against all the replicas. Adding additional app server instances will help to some extent because they will adopt all the replicas in an even way, but the initial app servers will continue to focus additional load on the original replicas. This is where the `maxUses` configuration option comes into play. Setting `maxUses` to 7500 will ensure that over a period of 30 minutes or so the new replicas will be adopted as the pre-existing connections are closed and replaced with new ones, thus creating a window for eventual balance. You'll want to test based on your own scenarios, but one way to make a first guess at `maxUses` is to identify an acceptable window for rebalancing and then solve for the value: ``` maxUses = rebalanceWindowSeconds * totalRequestsPerSecond / numAppInstances / poolSize ``` In the example above, assuming we acquire and release 1 connection per request and we are aiming for a 30 minute rebalancing window: ``` maxUses = rebalanceWindowSeconds * totalRequestsPerSecond / numAppInstances / poolSize 7200 = 1800 * 1000 / 10 / 25 ``` ## tests To run tests clone the repo, `npm i` in the working dir, and then run `npm test` ## contributions I love contributions. Please make sure they have tests, and submit a PR. If you're not sure if the issue is worth it or will be accepted it never hurts to open an issue to begin the conversation. If you're interested in keeping up with node-postgres releated stuff, you can follow me on twitter at [@briancarlson](https://twitter.com/briancarlson) - I generally announce any noteworthy updates there. ## license The MIT License (MIT) Copyright (c) 2016 Brian M. Carlson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. node-postgres-pg-8.14.1/packages/pg-pool/index.js000066400000000000000000000315051476604072200216160ustar00rootroot00000000000000'use strict' const EventEmitter = require('events').EventEmitter const NOOP = function () {} const removeWhere = (list, predicate) => { const i = list.findIndex(predicate) return i === -1 ? undefined : list.splice(i, 1)[0] } class IdleItem { constructor(client, idleListener, timeoutId) { this.client = client this.idleListener = idleListener this.timeoutId = timeoutId } } class PendingItem { constructor(callback) { this.callback = callback } } function throwOnDoubleRelease() { throw new Error('Release called on client which has already been released to the pool.') } function promisify(Promise, callback) { if (callback) { return { callback: callback, result: undefined } } let rej let res const cb = function (err, client) { err ? rej(err) : res(client) } const result = new Promise(function (resolve, reject) { res = resolve rej = reject }).catch((err) => { // replace the stack trace that leads to `TCP.onStreamRead` with one that leads back to the // application that created the query Error.captureStackTrace(err) throw err }) return { callback: cb, result: result } } function makeIdleListener(pool, client) { return function idleListener(err) { err.client = client client.removeListener('error', idleListener) client.on('error', () => { pool.log('additional client error after disconnection due to error', err) }) pool._remove(client) // TODO - document that once the pool emits an error // the client has already been closed & purged and is unusable pool.emit('error', err, client) } } class Pool extends EventEmitter { constructor(options, Client) { super() this.options = Object.assign({}, options) if (options != null && 'password' in options) { // "hiding" the password so it doesn't show up in stack traces // or if the client is console.logged Object.defineProperty(this.options, 'password', { configurable: true, enumerable: false, writable: true, value: options.password, }) } if (options != null && options.ssl && options.ssl.key) { // "hiding" the ssl->key so it doesn't show up in stack traces // or if the client is console.logged Object.defineProperty(this.options.ssl, 'key', { enumerable: false, }) } this.options.max = this.options.max || this.options.poolSize || 10 this.options.maxUses = this.options.maxUses || Infinity this.options.allowExitOnIdle = this.options.allowExitOnIdle || false this.options.maxLifetimeSeconds = this.options.maxLifetimeSeconds || 0 this.log = this.options.log || function () {} this.Client = this.options.Client || Client || require('pg').Client this.Promise = this.options.Promise || global.Promise if (typeof this.options.idleTimeoutMillis === 'undefined') { this.options.idleTimeoutMillis = 10000 } this._clients = [] this._idle = [] this._expired = new WeakSet() this._pendingQueue = [] this._endCallback = undefined this.ending = false this.ended = false } _isFull() { return this._clients.length >= this.options.max } _pulseQueue() { this.log('pulse queue') if (this.ended) { this.log('pulse queue ended') return } if (this.ending) { this.log('pulse queue on ending') if (this._idle.length) { this._idle.slice().map((item) => { this._remove(item.client) }) } if (!this._clients.length) { this.ended = true this._endCallback() } return } // if we don't have any waiting, do nothing if (!this._pendingQueue.length) { this.log('no queued requests') return } // if we don't have any idle clients and we have no more room do nothing if (!this._idle.length && this._isFull()) { return } const pendingItem = this._pendingQueue.shift() if (this._idle.length) { const idleItem = this._idle.pop() clearTimeout(idleItem.timeoutId) const client = idleItem.client client.ref && client.ref() const idleListener = idleItem.idleListener return this._acquireClient(client, pendingItem, idleListener, false) } if (!this._isFull()) { return this.newClient(pendingItem) } throw new Error('unexpected condition') } _remove(client) { const removed = removeWhere(this._idle, (item) => item.client === client) if (removed !== undefined) { clearTimeout(removed.timeoutId) } this._clients = this._clients.filter((c) => c !== client) client.end() this.emit('remove', client) } connect(cb) { if (this.ending) { const err = new Error('Cannot use a pool after calling end on the pool') return cb ? cb(err) : this.Promise.reject(err) } const response = promisify(this.Promise, cb) const result = response.result // if we don't have to connect a new client, don't do so if (this._isFull() || this._idle.length) { // if we have idle clients schedule a pulse immediately if (this._idle.length) { process.nextTick(() => this._pulseQueue()) } if (!this.options.connectionTimeoutMillis) { this._pendingQueue.push(new PendingItem(response.callback)) return result } const queueCallback = (err, res, done) => { clearTimeout(tid) response.callback(err, res, done) } const pendingItem = new PendingItem(queueCallback) // set connection timeout on checking out an existing client const tid = setTimeout(() => { // remove the callback from pending waiters because // we're going to call it with a timeout error removeWhere(this._pendingQueue, (i) => i.callback === queueCallback) pendingItem.timedOut = true response.callback(new Error('timeout exceeded when trying to connect')) }, this.options.connectionTimeoutMillis) if (tid.unref) { tid.unref() } this._pendingQueue.push(pendingItem) return result } this.newClient(new PendingItem(response.callback)) return result } newClient(pendingItem) { const client = new this.Client(this.options) this._clients.push(client) const idleListener = makeIdleListener(this, client) this.log('checking client timeout') // connection timeout logic let tid let timeoutHit = false if (this.options.connectionTimeoutMillis) { tid = setTimeout(() => { this.log('ending client due to timeout') timeoutHit = true // force kill the node driver, and let libpq do its teardown client.connection ? client.connection.stream.destroy() : client.end() }, this.options.connectionTimeoutMillis) } this.log('connecting new client') client.connect((err) => { if (tid) { clearTimeout(tid) } client.on('error', idleListener) if (err) { this.log('client failed to connect', err) // remove the dead client from our list of clients this._clients = this._clients.filter((c) => c !== client) if (timeoutHit) { err = new Error('Connection terminated due to connection timeout', { cause: err }) } // this client won’t be released, so move on immediately this._pulseQueue() if (!pendingItem.timedOut) { pendingItem.callback(err, undefined, NOOP) } } else { this.log('new client connected') if (this.options.maxLifetimeSeconds !== 0) { const maxLifetimeTimeout = setTimeout(() => { this.log('ending client due to expired lifetime') this._expired.add(client) const idleIndex = this._idle.findIndex((idleItem) => idleItem.client === client) if (idleIndex !== -1) { this._acquireClient( client, new PendingItem((err, client, clientRelease) => clientRelease()), idleListener, false ) } }, this.options.maxLifetimeSeconds * 1000) maxLifetimeTimeout.unref() client.once('end', () => clearTimeout(maxLifetimeTimeout)) } return this._acquireClient(client, pendingItem, idleListener, true) } }) } // acquire a client for a pending work item _acquireClient(client, pendingItem, idleListener, isNew) { if (isNew) { this.emit('connect', client) } this.emit('acquire', client) client.release = this._releaseOnce(client, idleListener) client.removeListener('error', idleListener) if (!pendingItem.timedOut) { if (isNew && this.options.verify) { this.options.verify(client, (err) => { if (err) { client.release(err) return pendingItem.callback(err, undefined, NOOP) } pendingItem.callback(undefined, client, client.release) }) } else { pendingItem.callback(undefined, client, client.release) } } else { if (isNew && this.options.verify) { this.options.verify(client, client.release) } else { client.release() } } } // returns a function that wraps _release and throws if called more than once _releaseOnce(client, idleListener) { let released = false return (err) => { if (released) { throwOnDoubleRelease() } released = true this._release(client, idleListener, err) } } // release a client back to the poll, include an error // to remove it from the pool _release(client, idleListener, err) { client.on('error', idleListener) client._poolUseCount = (client._poolUseCount || 0) + 1 this.emit('release', err, client) // TODO(bmc): expose a proper, public interface _queryable and _ending if (err || this.ending || !client._queryable || client._ending || client._poolUseCount >= this.options.maxUses) { if (client._poolUseCount >= this.options.maxUses) { this.log('remove expended client') } this._remove(client) this._pulseQueue() return } const isExpired = this._expired.has(client) if (isExpired) { this.log('remove expired client') this._expired.delete(client) this._remove(client) this._pulseQueue() return } // idle timeout let tid if (this.options.idleTimeoutMillis) { tid = setTimeout(() => { this.log('remove idle client') this._remove(client) }, this.options.idleTimeoutMillis) if (this.options.allowExitOnIdle) { // allow Node to exit if this is all that's left tid.unref() } } if (this.options.allowExitOnIdle) { client.unref() } this._idle.push(new IdleItem(client, idleListener, tid)) this._pulseQueue() } query(text, values, cb) { // guard clause against passing a function as the first parameter if (typeof text === 'function') { const response = promisify(this.Promise, text) setImmediate(function () { return response.callback(new Error('Passing a function as the first parameter to pool.query is not supported')) }) return response.result } // allow plain text query without values if (typeof values === 'function') { cb = values values = undefined } const response = promisify(this.Promise, cb) cb = response.callback this.connect((err, client) => { if (err) { return cb(err) } let clientReleased = false const onError = (err) => { if (clientReleased) { return } clientReleased = true client.release(err) cb(err) } client.once('error', onError) this.log('dispatching query') try { client.query(text, values, (err, res) => { this.log('query dispatched') client.removeListener('error', onError) if (clientReleased) { return } clientReleased = true client.release(err) if (err) { return cb(err) } return cb(undefined, res) }) } catch (err) { client.release(err) return cb(err) } }) return response.result } end(cb) { this.log('ending') if (this.ending) { const err = new Error('Called end on pool more than once') return cb ? cb(err) : this.Promise.reject(err) } this.ending = true const promised = promisify(this.Promise, cb) this._endCallback = promised.callback this._pulseQueue() return promised.result } get waitingCount() { return this._pendingQueue.length } get idleCount() { return this._idle.length } get expiredCount() { return this._clients.reduce((acc, client) => acc + (this._expired.has(client) ? 1 : 0), 0) } get totalCount() { return this._clients.length } } module.exports = Pool node-postgres-pg-8.14.1/packages/pg-pool/package.json000066400000000000000000000015141476604072200224340ustar00rootroot00000000000000{ "name": "pg-pool", "version": "3.8.0", "description": "Connection pool for node-postgres", "main": "index.js", "directories": { "test": "test" }, "scripts": { "test": " node_modules/.bin/mocha" }, "repository": { "type": "git", "url": "git://github.com/brianc/node-postgres.git", "directory": "packages/pg-pool" }, "keywords": [ "pg", "postgres", "pool", "database" ], "author": "Brian M. Carlson", "license": "MIT", "bugs": { "url": "https://github.com/brianc/node-pg-pool/issues" }, "homepage": "https://github.com/brianc/node-pg-pool#readme", "devDependencies": { "bluebird": "3.7.2", "co": "4.6.0", "expect.js": "0.3.1", "lodash": "^4.17.11", "mocha": "^10.5.2", "pg-cursor": "^1.3.0" }, "peerDependencies": { "pg": ">=8.0" } } node-postgres-pg-8.14.1/packages/pg-pool/test/000077500000000000000000000000001476604072200211245ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg-pool/test/bring-your-own-promise.js000066400000000000000000000022071476604072200260350ustar00rootroot00000000000000'use strict' const co = require('co') const expect = require('expect.js') const describe = require('mocha').describe const it = require('mocha').it const BluebirdPromise = require('bluebird') const Pool = require('../') const checkType = (promise) => { expect(promise).to.be.a(BluebirdPromise) return promise.catch((e) => undefined) } describe('Bring your own promise', function () { it( 'uses supplied promise for operations', co.wrap(function* () { const pool = new Pool({ Promise: BluebirdPromise }) const client1 = yield checkType(pool.connect()) client1.release() yield checkType(pool.query('SELECT NOW()')) const client2 = yield checkType(pool.connect()) // TODO - make sure pg supports BYOP as well client2.release() yield checkType(pool.end()) }) ) it( 'uses promises in errors', co.wrap(function* () { const pool = new Pool({ Promise: BluebirdPromise, port: 48484 }) yield checkType(pool.connect()) yield checkType(pool.end()) yield checkType(pool.connect()) yield checkType(pool.query()) yield checkType(pool.end()) }) ) }) node-postgres-pg-8.14.1/packages/pg-pool/test/connection-strings.js000066400000000000000000000015051476604072200253110ustar00rootroot00000000000000const expect = require('expect.js') const describe = require('mocha').describe const it = require('mocha').it const Pool = require('../') describe('Connection strings', function () { it('pool delegates connectionString property to client', function (done) { const connectionString = 'postgres://foo:bar@baz:1234/xur' const pool = new Pool({ // use a fake client so we can check we're passed the connectionString Client: function (args) { expect(args.connectionString).to.equal(connectionString) return { connect: function (cb) { cb(new Error('testing')) }, on: function () {}, } }, connectionString: connectionString, }) pool.connect(function (err, client) { expect(err).to.not.be(undefined) done() }) }) }) node-postgres-pg-8.14.1/packages/pg-pool/test/connection-timeout.js000066400000000000000000000141121476604072200253040ustar00rootroot00000000000000'use strict' const net = require('net') const co = require('co') const expect = require('expect.js') const describe = require('mocha').describe const it = require('mocha').it const before = require('mocha').before const after = require('mocha').after const Pool = require('../') describe('connection timeout', () => { const connectionFailure = new Error('Temporary connection failure') before((done) => { this.server = net.createServer((socket) => { socket.on('data', () => { // discard any buffered data or the server wont terminate }) }) this.server.listen(() => { this.port = this.server.address().port done() }) }) after((done) => { this.server.close(done) }) it('should callback with an error if timeout is passed', (done) => { const pool = new Pool({ connectionTimeoutMillis: 10, port: this.port, host: 'localhost' }) pool.connect((err, client, release) => { expect(err).to.be.an(Error) expect(err.message).to.contain('timeout') expect(client).to.equal(undefined) expect(pool.idleCount).to.equal(0) done() }) }) it('should reject promise with an error if timeout is passed', (done) => { const pool = new Pool({ connectionTimeoutMillis: 10, port: this.port, host: 'localhost' }) pool.connect().catch((err) => { expect(err).to.be.an(Error) expect(err.message).to.contain('timeout') expect(pool.idleCount).to.equal(0) done() }) }) it( 'should handle multiple timeouts', co.wrap( function* () { const errors = [] const pool = new Pool({ connectionTimeoutMillis: 1, port: this.port, host: 'localhost' }) for (var i = 0; i < 15; i++) { try { yield pool.connect() } catch (e) { errors.push(e) } } expect(errors).to.have.length(15) }.bind(this) ) ) it('should timeout on checkout of used connection', (done) => { const pool = new Pool({ connectionTimeoutMillis: 100, max: 1 }) pool.connect((err, client, release) => { expect(err).to.be(undefined) expect(client).to.not.be(undefined) pool.connect((err, client) => { expect(err).to.be.an(Error) expect(client).to.be(undefined) release() pool.end(done) }) }) }) it('should not break further pending checkouts on a timeout', (done) => { const pool = new Pool({ connectionTimeoutMillis: 200, max: 1 }) pool.connect((err, client, releaseOuter) => { expect(err).to.be(undefined) pool.connect((err, client) => { expect(err).to.be.an(Error) expect(client).to.be(undefined) releaseOuter() }) setTimeout(() => { pool.connect((err, client, releaseInner) => { expect(err).to.be(undefined) expect(client).to.not.be(undefined) releaseInner() pool.end(done) }) }, 100) }) }) it('should timeout on query if all clients are busy', (done) => { const pool = new Pool({ connectionTimeoutMillis: 100, max: 1 }) pool.connect((err, client, release) => { expect(err).to.be(undefined) expect(client).to.not.be(undefined) pool.query('select now()', (err, result) => { expect(err).to.be.an(Error) expect(result).to.be(undefined) release() pool.end(done) }) }) }) it('should recover from timeout errors', (done) => { const pool = new Pool({ connectionTimeoutMillis: 100, max: 1 }) pool.connect((err, client, release) => { expect(err).to.be(undefined) expect(client).to.not.be(undefined) pool.query('select now()', (err, result) => { expect(err).to.be.an(Error) expect(result).to.be(undefined) release() pool.query('select $1::text as name', ['brianc'], (err, res) => { expect(err).to.be(undefined) expect(res.rows).to.have.length(1) pool.end(done) }) }) }) }) it('continues processing after a connection failure', (done) => { const Client = require('pg').Client const orgConnect = Client.prototype.connect let called = false Client.prototype.connect = function (cb) { // Simulate a failure on first call if (!called) { called = true return setTimeout(() => { cb(connectionFailure) }, 100) } // And pass-through the second call orgConnect.call(this, cb) } const pool = new Pool({ Client: Client, connectionTimeoutMillis: 1000, max: 1, }) pool.connect((err, client, release) => { expect(err).to.be(connectionFailure) pool.query('select $1::text as name', ['brianc'], (err, res) => { expect(err).to.be(undefined) expect(res.rows).to.have.length(1) pool.end(done) }) }) }) it('releases newly connected clients if the queued already timed out', (done) => { const Client = require('pg').Client const orgConnect = Client.prototype.connect let connection = 0 Client.prototype.connect = function (cb) { // Simulate a failure on first call if (connection === 0) { connection++ return setTimeout(() => { cb(connectionFailure) }, 300) } // And second connect taking > connection timeout if (connection === 1) { connection++ return setTimeout(() => { orgConnect.call(this, cb) }, 1000) } orgConnect.call(this, cb) } const pool = new Pool({ Client: Client, connectionTimeoutMillis: 1000, max: 1, }) // Direct connect pool.connect((err, client, release) => { expect(err).to.be(connectionFailure) }) // Queued let called = 0 pool.connect((err, client, release) => { // Verify the callback is only called once expect(called++).to.be(0) expect(err).to.be.an(Error) pool.query('select $1::text as name', ['brianc'], (err, res) => { expect(err).to.be(undefined) expect(res.rows).to.have.length(1) pool.end(done) }) }) }) }) node-postgres-pg-8.14.1/packages/pg-pool/test/ending.js000066400000000000000000000016131476604072200227270ustar00rootroot00000000000000'use strict' const co = require('co') const expect = require('expect.js') const describe = require('mocha').describe const it = require('mocha').it const Pool = require('../') describe('pool ending', () => { it('ends without being used', (done) => { const pool = new Pool() pool.end(done) }) it('ends with a promise', () => { return new Pool().end() }) it( 'ends with clients', co.wrap(function* () { const pool = new Pool() const res = yield pool.query('SELECT $1::text as name', ['brianc']) expect(res.rows[0].name).to.equal('brianc') return pool.end() }) ) it( 'allows client to finish', co.wrap(function* () { const pool = new Pool() const query = pool.query('SELECT $1::text as name', ['brianc']) yield pool.end() const res = yield query expect(res.rows[0].name).to.equal('brianc') }) ) }) node-postgres-pg-8.14.1/packages/pg-pool/test/error-handling.js000066400000000000000000000156741476604072200244120ustar00rootroot00000000000000'use strict' const net = require('net') const co = require('co') const expect = require('expect.js') const describe = require('mocha').describe const it = require('mocha').it const Pool = require('../') describe('pool error handling', function () { it('Should complete these queries without dying', function (done) { const pool = new Pool() let errors = 0 let shouldGet = 0 function runErrorQuery() { shouldGet++ return new Promise(function (resolve, reject) { pool .query("SELECT 'asd'+1 ") .then(function (res) { reject(res) // this should always error }) .catch(function (err) { errors++ resolve(err) }) }) } const ps = [] for (let i = 0; i < 5; i++) { ps.push(runErrorQuery()) } Promise.all(ps).then(function () { expect(shouldGet).to.eql(errors) pool.end(done) }) }) it('Catches errors in client.query', async function () { let caught = false const pool = new Pool() try { await pool.query(null) } catch (e) { caught = true } pool.end() expect(caught).to.be(true) }) describe('calling release more than once', () => { it( 'should throw each time', co.wrap(function* () { const pool = new Pool() const client = yield pool.connect() client.release() expect(() => client.release()).to.throwError() expect(() => client.release()).to.throwError() return yield pool.end() }) ) it('should throw each time with callbacks', function (done) { const pool = new Pool() pool.connect(function (err, client, clientDone) { expect(err).not.to.be.an(Error) clientDone() expect(() => clientDone()).to.throwError() expect(() => clientDone()).to.throwError() pool.end(done) }) }) }) describe('using an ended pool', () => { it('rejects all additional promises', (done) => { const pool = new Pool() const promises = [] pool.end().then(() => { const squash = (promise) => promise.catch((e) => 'okay!') promises.push(squash(pool.connect())) promises.push(squash(pool.query('SELECT NOW()'))) promises.push(squash(pool.end())) Promise.all(promises).then((res) => { expect(res).to.eql(['okay!', 'okay!', 'okay!']) done() }) }) }) it('returns an error on all additional callbacks', (done) => { const pool = new Pool() pool.end(() => { pool.query('SELECT *', (err) => { expect(err).to.be.an(Error) pool.connect((err) => { expect(err).to.be.an(Error) pool.end((err) => { expect(err).to.be.an(Error) done() }) }) }) }) }) }) describe('error from idle client', () => { it( 'removes client from pool', co.wrap(function* () { const pool = new Pool() const client = yield pool.connect() expect(pool.totalCount).to.equal(1) expect(pool.waitingCount).to.equal(0) expect(pool.idleCount).to.equal(0) client.release() yield new Promise((resolve, reject) => { process.nextTick(() => { let poolError pool.once('error', (err) => { poolError = err }) let clientError client.once('error', (err) => { clientError = err }) client.emit('error', new Error('expected')) expect(clientError.message).to.equal('expected') expect(poolError.message).to.equal('expected') expect(pool.idleCount).to.equal(0) expect(pool.totalCount).to.equal(0) pool.end().then(resolve, reject) }) }) }) ) }) describe('error from in-use client', () => { it( 'keeps the client in the pool', co.wrap(function* () { const pool = new Pool() const client = yield pool.connect() expect(pool.totalCount).to.equal(1) expect(pool.waitingCount).to.equal(0) expect(pool.idleCount).to.equal(0) yield new Promise((resolve, reject) => { process.nextTick(() => { let poolError pool.once('error', (err) => { poolError = err }) let clientError client.once('error', (err) => { clientError = err }) client.emit('error', new Error('expected')) expect(clientError.message).to.equal('expected') expect(poolError).not.to.be.ok() expect(pool.idleCount).to.equal(0) expect(pool.totalCount).to.equal(1) client.release() pool.end().then(resolve, reject) }) }) }) ) }) describe('passing a function to pool.query', () => { it('calls back with error', (done) => { const pool = new Pool() console.log('passing fn to query') pool.query((err) => { expect(err).to.be.an(Error) pool.end(done) }) }) }) describe('pool with lots of errors', () => { it( 'continues to work and provide new clients', co.wrap(function* () { const pool = new Pool({ max: 1 }) const errors = [] for (var i = 0; i < 20; i++) { try { yield pool.query('invalid sql') } catch (err) { errors.push(err) } } expect(errors).to.have.length(20) expect(pool.idleCount).to.equal(0) expect(pool.query).to.be.a(Function) const res = yield pool.query('SELECT $1::text as name', ['brianc']) expect(res.rows).to.have.length(1) expect(res.rows[0].name).to.equal('brianc') return pool.end() }) ) }) it('should continue with queued items after a connection failure', (done) => { const closeServer = net .createServer((socket) => { socket.destroy() }) .unref() closeServer.listen(() => { const pool = new Pool({ max: 1, port: closeServer.address().port, host: 'localhost' }) pool.connect((err) => { expect(err).to.be.an(Error) if (err.code) { expect(err.code).to.be('ECONNRESET') } }) pool.connect((err) => { expect(err).to.be.an(Error) if (err.code) { expect(err.code).to.be('ECONNRESET') } closeServer.close(() => { pool.end(done) }) }) }) }) it('handles post-checkout client failures in pool.query', (done) => { const pool = new Pool({ max: 1 }) pool.on('error', () => { // We double close the connection in this test, prevent exception caused by that }) pool.query('SELECT pg_sleep(5)', [], (err) => { expect(err).to.be.an(Error) done() }) setTimeout(() => { pool._clients[0].end() }, 1000) }) }) node-postgres-pg-8.14.1/packages/pg-pool/test/events.js000066400000000000000000000065201476604072200227710ustar00rootroot00000000000000'use strict' const expect = require('expect.js') const EventEmitter = require('events').EventEmitter const describe = require('mocha').describe const it = require('mocha').it const Pool = require('../') describe('events', function () { it('emits connect before callback', function (done) { const pool = new Pool() let emittedClient = false pool.on('connect', function (client) { emittedClient = client }) pool.connect(function (err, client, release) { if (err) return done(err) release() pool.end() expect(client).to.be(emittedClient) done() }) }) it('emits "connect" only with a successful connection', function () { const pool = new Pool({ // This client will always fail to connect Client: mockClient({ connect: function (cb) { process.nextTick(() => { cb(new Error('bad news')) }) }, }), }) pool.on('connect', function () { throw new Error('should never get here') }) return pool.connect().catch((e) => expect(e.message).to.equal('bad news')) }) it('emits acquire every time a client is acquired', function (done) { const pool = new Pool() let acquireCount = 0 pool.on('acquire', function (client) { expect(client).to.be.ok() acquireCount++ }) for (let i = 0; i < 10; i++) { pool.connect(function (err, client, release) { if (err) return done(err) release() }) pool.query('SELECT now()') } setTimeout(function () { expect(acquireCount).to.be(20) pool.end(done) }, 100) }) it('emits release every time a client is released', function (done) { const pool = new Pool() let releaseCount = 0 pool.on('release', function (err, client) { expect(err instanceof Error).not.to.be(true) expect(client).to.be.ok() releaseCount++ }) const promises = [] for (let i = 0; i < 10; i++) { pool.connect(function (err, client, release) { if (err) return done(err) release() }) promises.push(pool.query('SELECT now()')) } Promise.all(promises).then(() => { pool.end(() => { expect(releaseCount).to.be(20) done() }) }) }) it('emits release with an error if client is released due to an error', function (done) { const pool = new Pool() pool.connect(function (err, client, release) { expect(err).to.equal(undefined) const releaseError = new Error('problem') pool.once('release', function (err, errClient) { expect(err).to.equal(releaseError) expect(errClient).to.equal(client) pool.end(done) }) release(releaseError) }) }) it('emits error and client if an idle client in the pool hits an error', function (done) { const pool = new Pool() pool.connect(function (err, client) { expect(err).to.equal(undefined) client.release() setImmediate(function () { client.emit('error', new Error('problem')) }) pool.once('error', function (err, errClient) { expect(err.message).to.equal('problem') expect(errClient).to.equal(client) done() }) }) }) }) function mockClient(methods) { return function () { const client = new EventEmitter() Object.assign(client, methods) return client } } node-postgres-pg-8.14.1/packages/pg-pool/test/idle-timeout-exit.js000066400000000000000000000011511476604072200250300ustar00rootroot00000000000000// This test is meant to be spawned from idle-timeout.js if (module === require.main) { const allowExitOnIdle = process.env.ALLOW_EXIT_ON_IDLE === '1' const Pool = require('../index') const pool = new Pool({ maxLifetimeSeconds: 2, idleTimeoutMillis: 200, ...(allowExitOnIdle ? { allowExitOnIdle: true } : {}), }) pool.query('SELECT NOW()', (err, res) => console.log('completed first')) pool.on('remove', () => { console.log('removed') done() }) setTimeout(() => { pool.query('SELECT * from generate_series(0, 1000)', (err, res) => console.log('completed second')) }, 50) } node-postgres-pg-8.14.1/packages/pg-pool/test/idle-timeout.js000066400000000000000000000067561476604072200241010ustar00rootroot00000000000000'use strict' const co = require('co') const expect = require('expect.js') const describe = require('mocha').describe const it = require('mocha').it const { fork } = require('child_process') const path = require('path') const Pool = require('../') const wait = (time) => new Promise((resolve) => setTimeout(resolve, time)) describe('idle timeout', () => { it('should timeout and remove the client', (done) => { const pool = new Pool({ idleTimeoutMillis: 10 }) pool.query('SELECT NOW()') pool.on('remove', () => { expect(pool.idleCount).to.equal(0) expect(pool.totalCount).to.equal(0) done() }) }) it( 'times out and removes clients when others are also removed', co.wrap(function* () { const pool = new Pool({ idleTimeoutMillis: 10 }) const clientA = yield pool.connect() const clientB = yield pool.connect() clientA.release() clientB.release(new Error()) const removal = new Promise((resolve) => { pool.on('remove', () => { expect(pool.idleCount).to.equal(0) expect(pool.totalCount).to.equal(0) resolve() }) }) const timeout = wait(100).then(() => Promise.reject(new Error('Idle timeout failed to occur'))) try { yield Promise.race([removal, timeout]) } finally { pool.end() } }) ) it( 'can remove idle clients and recreate them', co.wrap(function* () { const pool = new Pool({ idleTimeoutMillis: 1 }) const results = [] for (var i = 0; i < 20; i++) { let query = pool.query('SELECT NOW()') expect(pool.idleCount).to.equal(0) expect(pool.totalCount).to.equal(1) results.push(yield query) yield wait(2) expect(pool.idleCount).to.equal(0) expect(pool.totalCount).to.equal(0) } expect(results).to.have.length(20) }) ) it( 'does not time out clients which are used', co.wrap(function* () { const pool = new Pool({ idleTimeoutMillis: 1 }) const results = [] for (var i = 0; i < 20; i++) { let client = yield pool.connect() expect(pool.totalCount).to.equal(1) expect(pool.idleCount).to.equal(0) yield wait(10) results.push(yield client.query('SELECT NOW()')) client.release() expect(pool.idleCount).to.equal(1) expect(pool.totalCount).to.equal(1) } expect(results).to.have.length(20) return pool.end() }) ) it('unrefs the connections and timeouts so the program can exit when idle when the allowExitOnIdle option is set', function (done) { const child = fork(path.join(__dirname, 'idle-timeout-exit.js'), [], { silent: true, env: { ...process.env, ALLOW_EXIT_ON_IDLE: '1' }, }) let result = '' child.stdout.setEncoding('utf8') child.stdout.on('data', (chunk) => (result += chunk)) child.on('error', (err) => done(err)) child.on('close', () => { expect(result).to.equal('completed first\ncompleted second\n') done() }) }) it('keeps old behavior when allowExitOnIdle option is not set', function (done) { const child = fork(path.join(__dirname, 'idle-timeout-exit.js'), [], { silent: true, }) let result = '' child.stdout.setEncoding('utf8') child.stdout.on('data', (chunk) => (result += chunk)) child.on('error', (err) => done(err)) child.on('close', () => { expect(result).to.equal('completed first\ncompleted second\nremoved\n') done() }) }) }) node-postgres-pg-8.14.1/packages/pg-pool/test/index.js000066400000000000000000000153701476604072200225770ustar00rootroot00000000000000'use strict' const expect = require('expect.js') const _ = require('lodash') const describe = require('mocha').describe const it = require('mocha').it const Pool = require('../') describe('pool', function () { describe('with callbacks', function () { it('works totally unconfigured', function (done) { const pool = new Pool() pool.connect(function (err, client, release) { if (err) return done(err) client.query('SELECT NOW()', function (err, res) { release() if (err) return done(err) expect(res.rows).to.have.length(1) pool.end(done) }) }) }) it('passes props to clients', function (done) { const pool = new Pool({ binary: true }) pool.connect(function (err, client, release) { release() if (err) return done(err) expect(client.binary).to.eql(true) pool.end(done) }) }) it('can run a query with a callback without parameters', function (done) { const pool = new Pool() pool.query('SELECT 1 as num', function (err, res) { expect(res.rows[0]).to.eql({ num: 1 }) pool.end(function () { done(err) }) }) }) it('can run a query with a callback', function (done) { const pool = new Pool() pool.query('SELECT $1::text as name', ['brianc'], function (err, res) { expect(res.rows[0]).to.eql({ name: 'brianc' }) pool.end(function () { done(err) }) }) }) it('passes connection errors to callback', function (done) { const pool = new Pool({ port: 53922 }) pool.query('SELECT $1::text as name', ['brianc'], function (err, res) { expect(res).to.be(undefined) expect(err).to.be.an(Error) // a connection error should not polute the pool with a dead client expect(pool.totalCount).to.equal(0) pool.end(function (err) { done(err) }) }) }) it('does not pass client to error callback', function (done) { const pool = new Pool({ port: 58242 }) pool.connect(function (err, client, release) { expect(err).to.be.an(Error) expect(client).to.be(undefined) expect(release).to.be.a(Function) pool.end(done) }) }) it('removes client if it errors in background', function (done) { const pool = new Pool() pool.connect(function (err, client, release) { release() if (err) return done(err) client.testString = 'foo' setTimeout(function () { client.emit('error', new Error('on purpose')) }, 10) }) pool.on('error', function (err) { expect(err.message).to.be('on purpose') expect(err.client).to.not.be(undefined) expect(err.client.testString).to.be('foo') err.client.connection.stream.on('end', function () { pool.end(done) }) }) }) it('should not change given options', function (done) { const options = { max: 10 } const pool = new Pool(options) pool.connect(function (err, client, release) { release() if (err) return done(err) expect(options).to.eql({ max: 10 }) pool.end(done) }) }) it('does not create promises when connecting', function (done) { const pool = new Pool() const returnValue = pool.connect(function (err, client, release) { release() if (err) return done(err) pool.end(done) }) expect(returnValue).to.be(undefined) }) it('does not create promises when querying', function (done) { const pool = new Pool() const returnValue = pool.query('SELECT 1 as num', function (err) { pool.end(function () { done(err) }) }) expect(returnValue).to.be(undefined) }) it('does not create promises when ending', function (done) { const pool = new Pool() const returnValue = pool.end(done) expect(returnValue).to.be(undefined) }) it('never calls callback syncronously', function (done) { const pool = new Pool() pool.connect((err, client) => { if (err) throw err client.release() setImmediate(() => { let called = false pool.connect((err, client) => { if (err) throw err called = true client.release() setImmediate(() => { pool.end(done) }) }) expect(called).to.equal(false) }) }) }) }) describe('with promises', function () { it('connects, queries, and disconnects', function () { const pool = new Pool() return pool.connect().then(function (client) { return client.query('select $1::text as name', ['hi']).then(function (res) { expect(res.rows).to.eql([{ name: 'hi' }]) client.release() return pool.end() }) }) }) it('executes a query directly', () => { const pool = new Pool() return pool.query('SELECT $1::text as name', ['hi']).then((res) => { expect(res.rows).to.have.length(1) expect(res.rows[0].name).to.equal('hi') return pool.end() }) }) it('properly pools clients', function () { const pool = new Pool({ poolSize: 9 }) const promises = _.times(30, function () { return pool.connect().then(function (client) { return client.query('select $1::text as name', ['hi']).then(function (res) { client.release() return res }) }) }) return Promise.all(promises).then(function (res) { expect(res).to.have.length(30) expect(pool.totalCount).to.be(9) return pool.end() }) }) it('supports just running queries', function () { const pool = new Pool({ poolSize: 9 }) const text = 'select $1::text as name' const values = ['hi'] const query = { text: text, values: values } const promises = _.times(30, () => pool.query(query)) return Promise.all(promises).then(function (queries) { expect(queries).to.have.length(30) return pool.end() }) }) it('recovers from query errors', function () { const pool = new Pool() const errors = [] const promises = _.times(30, () => { return pool.query('SELECT asldkfjasldkf').catch(function (e) { errors.push(e) }) }) return Promise.all(promises).then(() => { expect(errors).to.have.length(30) expect(pool.totalCount).to.equal(0) expect(pool.idleCount).to.equal(0) return pool.query('SELECT $1::text as name', ['hi']).then(function (res) { expect(res.rows).to.eql([{ name: 'hi' }]) return pool.end() }) }) }) }) }) node-postgres-pg-8.14.1/packages/pg-pool/test/lifetime-timeout.js000066400000000000000000000030301476604072200247400ustar00rootroot00000000000000'use strict' const co = require('co') const expect = require('expect.js') const describe = require('mocha').describe const it = require('mocha').it const Pool = require('../') describe('lifetime timeout', () => { it('connection lifetime should expire and remove the client', (done) => { const pool = new Pool({ maxLifetimeSeconds: 1 }) pool.query('SELECT NOW()') pool.on('remove', () => { console.log('expired while idle - on-remove event') expect(pool.expiredCount).to.equal(0) expect(pool.totalCount).to.equal(0) done() }) }) it('connection lifetime should expire and remove the client after the client is done working', (done) => { const pool = new Pool({ maxLifetimeSeconds: 1 }) pool.query('SELECT pg_sleep(1.4)') pool.on('remove', () => { console.log('expired while busy - on-remove event') expect(pool.expiredCount).to.equal(0) expect(pool.totalCount).to.equal(0) done() }) }) it( 'can remove expired clients and recreate them', co.wrap(function* () { const pool = new Pool({ maxLifetimeSeconds: 1 }) let query = pool.query('SELECT pg_sleep(1.4)') expect(pool.expiredCount).to.equal(0) expect(pool.totalCount).to.equal(1) yield query yield new Promise((resolve) => setTimeout(resolve, 100)) expect(pool.expiredCount).to.equal(0) expect(pool.totalCount).to.equal(0) yield pool.query('SELECT NOW()') expect(pool.expiredCount).to.equal(0) expect(pool.totalCount).to.equal(1) }) ) }) node-postgres-pg-8.14.1/packages/pg-pool/test/logging.js000066400000000000000000000007771476604072200231230ustar00rootroot00000000000000const expect = require('expect.js') const describe = require('mocha').describe const it = require('mocha').it const Pool = require('../') describe('logging', function () { it('logs to supplied log function if given', function () { const messages = [] const log = function (msg) { messages.push(msg) } const pool = new Pool({ log: log }) return pool.query('SELECT NOW()').then(function () { expect(messages.length).to.be.greaterThan(0) return pool.end() }) }) }) node-postgres-pg-8.14.1/packages/pg-pool/test/max-uses.js000066400000000000000000000061661476604072200232350ustar00rootroot00000000000000const expect = require('expect.js') const co = require('co') const describe = require('mocha').describe const it = require('mocha').it const Pool = require('../') describe('maxUses', () => { it( 'can create a single client and use it once', co.wrap(function* () { const pool = new Pool({ maxUses: 2 }) expect(pool.waitingCount).to.equal(0) const client = yield pool.connect() const res = yield client.query('SELECT $1::text as name', ['hi']) expect(res.rows[0].name).to.equal('hi') client.release() pool.end() }) ) it( 'getting a connection a second time returns the same connection and releasing it also closes it', co.wrap(function* () { const pool = new Pool({ maxUses: 2 }) expect(pool.waitingCount).to.equal(0) const client = yield pool.connect() client.release() const client2 = yield pool.connect() expect(client).to.equal(client2) expect(client2._ending).to.equal(false) client2.release() expect(client2._ending).to.equal(true) return yield pool.end() }) ) it( 'getting a connection a third time returns a new connection', co.wrap(function* () { const pool = new Pool({ maxUses: 2 }) expect(pool.waitingCount).to.equal(0) const client = yield pool.connect() client.release() const client2 = yield pool.connect() expect(client).to.equal(client2) client2.release() const client3 = yield pool.connect() expect(client3).not.to.equal(client2) client3.release() return yield pool.end() }) ) it( 'getting a connection from a pending request gets a fresh client when the released candidate is expended', co.wrap(function* () { const pool = new Pool({ max: 1, maxUses: 2 }) expect(pool.waitingCount).to.equal(0) const client1 = yield pool.connect() pool.connect().then((client2) => { expect(client2).to.equal(client1) expect(pool.waitingCount).to.equal(1) // Releasing the client this time should also expend it since maxUses is 2, causing client3 to be a fresh client client2.release() }) const client3Promise = pool.connect().then((client3) => { // client3 should be a fresh client since client2's release caused the first client to be expended expect(pool.waitingCount).to.equal(0) expect(client3).not.to.equal(client1) return client3.release() }) // There should be two pending requests since we have 3 connect requests but a max size of 1 expect(pool.waitingCount).to.equal(2) // Releasing the client should not yet expend it since maxUses is 2 client1.release() yield client3Promise return yield pool.end() }) ) it( 'logs when removing an expended client', co.wrap(function* () { const messages = [] const log = function (msg) { messages.push(msg) } const pool = new Pool({ maxUses: 1, log }) const client = yield pool.connect() client.release() expect(messages).to.contain('remove expended client') return yield pool.end() }) ) }) node-postgres-pg-8.14.1/packages/pg-pool/test/releasing-clients.js000066400000000000000000000032241476604072200250730ustar00rootroot00000000000000const Pool = require('../') const expect = require('expect.js') describe('releasing clients', () => { it('removes a client which cannot be queried', async () => { // make a pool w/ only 1 client const pool = new Pool({ max: 1 }) expect(pool.totalCount).to.eql(0) const client = await pool.connect() expect(pool.totalCount).to.eql(1) expect(pool.idleCount).to.eql(0) // reach into the client and sever its connection client.connection.end() // wait for the client to error out const err = await new Promise((resolve) => client.once('error', resolve)) expect(err).to.be.ok() expect(pool.totalCount).to.eql(1) expect(pool.idleCount).to.eql(0) // try to return it to the pool - this removes it because its broken client.release() expect(pool.totalCount).to.eql(0) expect(pool.idleCount).to.eql(0) // make sure pool still works const { rows } = await pool.query('SELECT NOW()') expect(rows).to.have.length(1) await pool.end() }) it('removes a client which is ending', async () => { // make a pool w/ only 1 client const pool = new Pool({ max: 1 }) expect(pool.totalCount).to.eql(0) const client = await pool.connect() expect(pool.totalCount).to.eql(1) expect(pool.idleCount).to.eql(0) // end the client gracefully (but you shouldn't do this with pooled clients) client.end() // try to return it to the pool client.release() expect(pool.totalCount).to.eql(0) expect(pool.idleCount).to.eql(0) // make sure pool still works const { rows } = await pool.query('SELECT NOW()') expect(rows).to.have.length(1) await pool.end() }) }) node-postgres-pg-8.14.1/packages/pg-pool/test/setup.js000066400000000000000000000003021476604072200226150ustar00rootroot00000000000000const crash = (reason) => { process.on(reason, (err) => { console.error(reason, err.stack) process.exit(-1) }) } crash('unhandledRejection') crash('uncaughtError') crash('warning') node-postgres-pg-8.14.1/packages/pg-pool/test/sizing.js000066400000000000000000000035061476604072200227710ustar00rootroot00000000000000const expect = require('expect.js') const co = require('co') const _ = require('lodash') const describe = require('mocha').describe const it = require('mocha').it const Pool = require('../') describe('pool size of 1', () => { it( 'can create a single client and use it once', co.wrap(function* () { const pool = new Pool({ max: 1 }) expect(pool.waitingCount).to.equal(0) const client = yield pool.connect() const res = yield client.query('SELECT $1::text as name', ['hi']) expect(res.rows[0].name).to.equal('hi') client.release() pool.end() }) ) it( 'can create a single client and use it multiple times', co.wrap(function* () { const pool = new Pool({ max: 1 }) expect(pool.waitingCount).to.equal(0) const client = yield pool.connect() const wait = pool.connect() expect(pool.waitingCount).to.equal(1) client.release() const client2 = yield wait expect(client).to.equal(client2) client2.release() return yield pool.end() }) ) it( 'can only send 1 query at a time', co.wrap(function* () { const pool = new Pool({ max: 1 }) // the query text column name changed in PostgreSQL 9.2 const versionResult = yield pool.query('SHOW server_version_num') const version = parseInt(versionResult.rows[0].server_version_num, 10) const queryColumn = version < 90200 ? 'current_query' : 'query' const queryText = 'SELECT COUNT(*) as counts FROM pg_stat_activity WHERE ' + queryColumn + ' = $1' const queries = _.times(20, () => pool.query(queryText, [queryText])) const results = yield Promise.all(queries) const counts = results.map((res) => parseInt(res.rows[0].counts, 10)) expect(counts).to.eql(_.times(20, (i) => 1)) return yield pool.end() }) ) }) node-postgres-pg-8.14.1/packages/pg-pool/test/submittable.js000066400000000000000000000010241476604072200237720ustar00rootroot00000000000000'use strict' const Cursor = require('pg-cursor') const expect = require('expect.js') const describe = require('mocha').describe const it = require('mocha').it const Pool = require('../') describe('submittle', () => { it('is returned from the query method', false, (done) => { const pool = new Pool() const cursor = pool.query(new Cursor('SELECT * from generate_series(0, 1000)')) cursor.read((err, rows) => { expect(err).to.be(undefined) expect(!!rows).to.be.ok() cursor.close(done) }) }) }) node-postgres-pg-8.14.1/packages/pg-pool/test/timeout.js000066400000000000000000000000001476604072200231360ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg-pool/test/verify.js000066400000000000000000000007611476604072200227720ustar00rootroot00000000000000'use strict' const expect = require('expect.js') const describe = require('mocha').describe const it = require('mocha').it const Pool = require('../') describe('verify', () => { it('verifies a client with a callback', (done) => { const pool = new Pool({ verify: (client, cb) => { cb(new Error('nope')) }, }) pool.connect((err, client) => { expect(err).to.be.an(Error) expect(err.message).to.be('nope') pool.end() done() }) }) }) node-postgres-pg-8.14.1/packages/pg-protocol/000077500000000000000000000000001476604072200210355ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg-protocol/README.md000066400000000000000000000002261476604072200223140ustar00rootroot00000000000000# pg-protocol Low level postgres wire protocol parser and serializer written in Typescript. Used by node-postgres. Needs more documentation. :smile: node-postgres-pg-8.14.1/packages/pg-protocol/package.json000066400000000000000000000014711476604072200233260ustar00rootroot00000000000000{ "name": "pg-protocol", "version": "1.8.0", "description": "The postgres client/server binary protocol, implemented in TypeScript", "main": "dist/index.js", "types": "dist/index.d.ts", "license": "MIT", "devDependencies": { "@types/chai": "^4.2.7", "@types/mocha": "^10.0.7", "@types/node": "^12.12.21", "chai": "^4.2.0", "chunky": "^0.0.0", "mocha": "^10.5.2", "ts-node": "^8.5.4", "typescript": "^4.0.3" }, "scripts": { "test": "mocha dist/**/*.test.js", "build": "tsc", "build:watch": "tsc --watch", "prepublish": "yarn build", "pretest": "yarn build" }, "repository": { "type": "git", "url": "git://github.com/brianc/node-postgres.git", "directory": "packages/pg-protocol" }, "files": [ "/dist/*{js,ts,map}", "/src" ] } node-postgres-pg-8.14.1/packages/pg-protocol/src/000077500000000000000000000000001476604072200216245ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg-protocol/src/b.ts000066400000000000000000000007111476604072200224140ustar00rootroot00000000000000// file for microbenchmarking import { BufferReader } from './buffer-reader' const LOOPS = 1000 let count = 0 let start = Date.now() const reader = new BufferReader() const buffer = Buffer.from([33, 33, 33, 33, 33, 33, 33, 0]) const run = () => { if (count > LOOPS) { console.log(Date.now() - start) return } count++ for (let i = 0; i < LOOPS; i++) { reader.setBuffer(0, buffer) reader.cstring() } setImmediate(run) } run() node-postgres-pg-8.14.1/packages/pg-protocol/src/buffer-reader.ts000066400000000000000000000025671476604072200247170ustar00rootroot00000000000000const emptyBuffer = Buffer.allocUnsafe(0) export class BufferReader { private buffer: Buffer = emptyBuffer // TODO(bmc): support non-utf8 encoding? private encoding: string = 'utf-8' constructor(private offset: number = 0) {} public setBuffer(offset: number, buffer: Buffer): void { this.offset = offset this.buffer = buffer } public int16(): number { const result = this.buffer.readInt16BE(this.offset) this.offset += 2 return result } public byte(): number { const result = this.buffer[this.offset] this.offset++ return result } public int32(): number { const result = this.buffer.readInt32BE(this.offset) this.offset += 4 return result } public uint32(): number { const result = this.buffer.readUInt32BE(this.offset) this.offset += 4 return result } public string(length: number): string { const result = this.buffer.toString(this.encoding, this.offset, this.offset + length) this.offset += length return result } public cstring(): string { const start = this.offset let end = start while (this.buffer[end++] !== 0) {} this.offset = end return this.buffer.toString(this.encoding, start, end - 1) } public bytes(length: number): Buffer { const result = this.buffer.slice(this.offset, this.offset + length) this.offset += length return result } } node-postgres-pg-8.14.1/packages/pg-protocol/src/buffer-writer.ts000066400000000000000000000046731476604072200247710ustar00rootroot00000000000000//binary data writer tuned for encoding binary specific to the postgres binary protocol export class Writer { private buffer: Buffer private offset: number = 5 private headerPosition: number = 0 constructor(private size = 256) { this.buffer = Buffer.allocUnsafe(size) } private ensure(size: number): void { var remaining = this.buffer.length - this.offset if (remaining < size) { var oldBuffer = this.buffer // exponential growth factor of around ~ 1.5 // https://stackoverflow.com/questions/2269063/buffer-growth-strategy var newSize = oldBuffer.length + (oldBuffer.length >> 1) + size this.buffer = Buffer.allocUnsafe(newSize) oldBuffer.copy(this.buffer) } } public addInt32(num: number): Writer { this.ensure(4) this.buffer[this.offset++] = (num >>> 24) & 0xff this.buffer[this.offset++] = (num >>> 16) & 0xff this.buffer[this.offset++] = (num >>> 8) & 0xff this.buffer[this.offset++] = (num >>> 0) & 0xff return this } public addInt16(num: number): Writer { this.ensure(2) this.buffer[this.offset++] = (num >>> 8) & 0xff this.buffer[this.offset++] = (num >>> 0) & 0xff return this } public addCString(string: string): Writer { if (!string) { this.ensure(1) } else { var len = Buffer.byteLength(string) this.ensure(len + 1) // +1 for null terminator this.buffer.write(string, this.offset, 'utf-8') this.offset += len } this.buffer[this.offset++] = 0 // null terminator return this } public addString(string: string = ''): Writer { var len = Buffer.byteLength(string) this.ensure(len) this.buffer.write(string, this.offset) this.offset += len return this } public add(otherBuffer: Buffer): Writer { this.ensure(otherBuffer.length) otherBuffer.copy(this.buffer, this.offset) this.offset += otherBuffer.length return this } private join(code?: number): Buffer { if (code) { this.buffer[this.headerPosition] = code //length is everything in this packet minus the code const length = this.offset - (this.headerPosition + 1) this.buffer.writeInt32BE(length, this.headerPosition + 1) } return this.buffer.slice(code ? 0 : 5, this.offset) } public flush(code?: number): Buffer { var result = this.join(code) this.offset = 5 this.headerPosition = 0 this.buffer = Buffer.allocUnsafe(this.size) return result } } node-postgres-pg-8.14.1/packages/pg-protocol/src/inbound-parser.test.ts000066400000000000000000000356451476604072200261170ustar00rootroot00000000000000import buffers from './testing/test-buffers' import BufferList from './testing/buffer-list' import { parse } from '.' import assert from 'assert' import { PassThrough } from 'stream' import { BackendMessage } from './messages' var authOkBuffer = buffers.authenticationOk() var paramStatusBuffer = buffers.parameterStatus('client_encoding', 'UTF8') var readyForQueryBuffer = buffers.readyForQuery() var backendKeyDataBuffer = buffers.backendKeyData(1, 2) var commandCompleteBuffer = buffers.commandComplete('SELECT 3') var parseCompleteBuffer = buffers.parseComplete() var bindCompleteBuffer = buffers.bindComplete() var portalSuspendedBuffer = buffers.portalSuspended() var row1 = { name: 'id', tableID: 1, attributeNumber: 2, dataTypeID: 3, dataTypeSize: 4, typeModifier: 5, formatCode: 0, } var oneRowDescBuff = buffers.rowDescription([row1]) row1.name = 'bang' var twoRowBuf = buffers.rowDescription([ row1, { name: 'whoah', tableID: 10, attributeNumber: 11, dataTypeID: 12, dataTypeSize: 13, typeModifier: 14, formatCode: 0, }, ]) var rowWithBigOids = { name: 'bigoid', tableID: 3000000001, attributeNumber: 2, dataTypeID: 3000000003, dataTypeSize: 4, typeModifier: 5, formatCode: 0, } var bigOidDescBuff = buffers.rowDescription([rowWithBigOids]) var emptyRowFieldBuf = new BufferList().addInt16(0).join(true, 'D') var emptyRowFieldBuf = buffers.dataRow([]) var oneFieldBuf = new BufferList() .addInt16(1) // number of fields .addInt32(5) // length of bytes of fields .addCString('test') .join(true, 'D') var oneFieldBuf = buffers.dataRow(['test']) var expectedAuthenticationOkayMessage = { name: 'authenticationOk', length: 8, } var expectedParameterStatusMessage = { name: 'parameterStatus', parameterName: 'client_encoding', parameterValue: 'UTF8', length: 25, } var expectedBackendKeyDataMessage = { name: 'backendKeyData', processID: 1, secretKey: 2, } var expectedReadyForQueryMessage = { name: 'readyForQuery', length: 5, status: 'I', } var expectedCommandCompleteMessage = { name: 'commandComplete', length: 13, text: 'SELECT 3', } var emptyRowDescriptionBuffer = new BufferList() .addInt16(0) // number of fields .join(true, 'T') var expectedEmptyRowDescriptionMessage = { name: 'rowDescription', length: 6, fieldCount: 0, fields: [], } var expectedOneRowMessage = { name: 'rowDescription', length: 27, fieldCount: 1, fields: [ { name: 'id', tableID: 1, columnID: 2, dataTypeID: 3, dataTypeSize: 4, dataTypeModifier: 5, format: 'text', }, ], } var expectedTwoRowMessage = { name: 'rowDescription', length: 53, fieldCount: 2, fields: [ { name: 'bang', tableID: 1, columnID: 2, dataTypeID: 3, dataTypeSize: 4, dataTypeModifier: 5, format: 'text', }, { name: 'whoah', tableID: 10, columnID: 11, dataTypeID: 12, dataTypeSize: 13, dataTypeModifier: 14, format: 'text', }, ], } var expectedBigOidMessage = { name: 'rowDescription', length: 31, fieldCount: 1, fields: [ { name: 'bigoid', tableID: 3000000001, columnID: 2, dataTypeID: 3000000003, dataTypeSize: 4, dataTypeModifier: 5, format: 'text', }, ], } var emptyParameterDescriptionBuffer = new BufferList() .addInt16(0) // number of parameters .join(true, 't') var oneParameterDescBuf = buffers.parameterDescription([1111]) var twoParameterDescBuf = buffers.parameterDescription([2222, 3333]) var expectedEmptyParameterDescriptionMessage = { name: 'parameterDescription', length: 6, parameterCount: 0, dataTypeIDs: [], } var expectedOneParameterMessage = { name: 'parameterDescription', length: 10, parameterCount: 1, dataTypeIDs: [1111], } var expectedTwoParameterMessage = { name: 'parameterDescription', length: 14, parameterCount: 2, dataTypeIDs: [2222, 3333], } var testForMessage = function (buffer: Buffer, expectedMessage: any) { it('receives and parses ' + expectedMessage.name, async () => { const messages = await parseBuffers([buffer]) const [lastMessage] = messages for (const key in expectedMessage) { assert.deepEqual((lastMessage as any)[key], expectedMessage[key]) } }) } var plainPasswordBuffer = buffers.authenticationCleartextPassword() var md5PasswordBuffer = buffers.authenticationMD5Password() var SASLBuffer = buffers.authenticationSASL() var SASLContinueBuffer = buffers.authenticationSASLContinue() var SASLFinalBuffer = buffers.authenticationSASLFinal() var expectedPlainPasswordMessage = { name: 'authenticationCleartextPassword', } var expectedMD5PasswordMessage = { name: 'authenticationMD5Password', salt: Buffer.from([1, 2, 3, 4]), } var expectedSASLMessage = { name: 'authenticationSASL', mechanisms: ['SCRAM-SHA-256'], } var expectedSASLContinueMessage = { name: 'authenticationSASLContinue', data: 'data', } var expectedSASLFinalMessage = { name: 'authenticationSASLFinal', data: 'data', } var notificationResponseBuffer = buffers.notification(4, 'hi', 'boom') var expectedNotificationResponseMessage = { name: 'notification', processId: 4, channel: 'hi', payload: 'boom', } const parseBuffers = async (buffers: Buffer[]): Promise => { const stream = new PassThrough() for (const buffer of buffers) { stream.write(buffer) } stream.end() const msgs: BackendMessage[] = [] await parse(stream, (msg) => msgs.push(msg)) return msgs } describe('PgPacketStream', function () { testForMessage(authOkBuffer, expectedAuthenticationOkayMessage) testForMessage(plainPasswordBuffer, expectedPlainPasswordMessage) testForMessage(md5PasswordBuffer, expectedMD5PasswordMessage) testForMessage(SASLBuffer, expectedSASLMessage) testForMessage(SASLContinueBuffer, expectedSASLContinueMessage) // this exercises a found bug in the parser: // https://github.com/brianc/node-postgres/pull/2210#issuecomment-627626084 // and adds a test which is deterministic, rather than relying on network packet chunking const extendedSASLContinueBuffer = Buffer.concat([SASLContinueBuffer, Buffer.from([1, 2, 3, 4])]) testForMessage(extendedSASLContinueBuffer, expectedSASLContinueMessage) testForMessage(SASLFinalBuffer, expectedSASLFinalMessage) // this exercises a found bug in the parser: // https://github.com/brianc/node-postgres/pull/2210#issuecomment-627626084 // and adds a test which is deterministic, rather than relying on network packet chunking const extendedSASLFinalBuffer = Buffer.concat([SASLFinalBuffer, Buffer.from([1, 2, 4, 5])]) testForMessage(extendedSASLFinalBuffer, expectedSASLFinalMessage) testForMessage(paramStatusBuffer, expectedParameterStatusMessage) testForMessage(backendKeyDataBuffer, expectedBackendKeyDataMessage) testForMessage(readyForQueryBuffer, expectedReadyForQueryMessage) testForMessage(commandCompleteBuffer, expectedCommandCompleteMessage) testForMessage(notificationResponseBuffer, expectedNotificationResponseMessage) testForMessage(buffers.emptyQuery(), { name: 'emptyQuery', length: 4, }) testForMessage(Buffer.from([0x6e, 0, 0, 0, 4]), { name: 'noData', }) describe('rowDescription messages', function () { testForMessage(emptyRowDescriptionBuffer, expectedEmptyRowDescriptionMessage) testForMessage(oneRowDescBuff, expectedOneRowMessage) testForMessage(twoRowBuf, expectedTwoRowMessage) testForMessage(bigOidDescBuff, expectedBigOidMessage) }) describe('parameterDescription messages', function () { testForMessage(emptyParameterDescriptionBuffer, expectedEmptyParameterDescriptionMessage) testForMessage(oneParameterDescBuf, expectedOneParameterMessage) testForMessage(twoParameterDescBuf, expectedTwoParameterMessage) }) describe('parsing rows', function () { describe('parsing empty row', function () { testForMessage(emptyRowFieldBuf, { name: 'dataRow', fieldCount: 0, }) }) describe('parsing data row with fields', function () { testForMessage(oneFieldBuf, { name: 'dataRow', fieldCount: 1, fields: ['test'], }) }) }) describe('notice message', function () { // this uses the same logic as error message var buff = buffers.notice([{ type: 'C', value: 'code' }]) testForMessage(buff, { name: 'notice', code: 'code', }) }) testForMessage(buffers.error([]), { name: 'error', }) describe('with all the fields', function () { var buffer = buffers.error([ { type: 'S', value: 'ERROR', }, { type: 'C', value: 'code', }, { type: 'M', value: 'message', }, { type: 'D', value: 'details', }, { type: 'H', value: 'hint', }, { type: 'P', value: '100', }, { type: 'p', value: '101', }, { type: 'q', value: 'query', }, { type: 'W', value: 'where', }, { type: 'F', value: 'file', }, { type: 'L', value: 'line', }, { type: 'R', value: 'routine', }, { type: 'Z', // ignored value: 'alsdkf', }, ]) testForMessage(buffer, { name: 'error', severity: 'ERROR', code: 'code', message: 'message', detail: 'details', hint: 'hint', position: '100', internalPosition: '101', internalQuery: 'query', where: 'where', file: 'file', line: 'line', routine: 'routine', }) }) testForMessage(parseCompleteBuffer, { name: 'parseComplete', }) testForMessage(bindCompleteBuffer, { name: 'bindComplete', }) testForMessage(bindCompleteBuffer, { name: 'bindComplete', }) testForMessage(buffers.closeComplete(), { name: 'closeComplete', }) describe('parses portal suspended message', function () { testForMessage(portalSuspendedBuffer, { name: 'portalSuspended', }) }) describe('parses replication start message', function () { testForMessage(Buffer.from([0x57, 0x00, 0x00, 0x00, 0x04]), { name: 'replicationStart', length: 4, }) }) describe('copy', () => { testForMessage(buffers.copyIn(0), { name: 'copyInResponse', length: 7, binary: false, columnTypes: [], }) testForMessage(buffers.copyIn(2), { name: 'copyInResponse', length: 11, binary: false, columnTypes: [0, 1], }) testForMessage(buffers.copyOut(0), { name: 'copyOutResponse', length: 7, binary: false, columnTypes: [], }) testForMessage(buffers.copyOut(3), { name: 'copyOutResponse', length: 13, binary: false, columnTypes: [0, 1, 2], }) testForMessage(buffers.copyDone(), { name: 'copyDone', length: 4, }) testForMessage(buffers.copyData(Buffer.from([5, 6, 7])), { name: 'copyData', length: 7, chunk: Buffer.from([5, 6, 7]), }) }) // since the data message on a stream can randomly divide the incomming // tcp packets anywhere, we need to make sure we can parse every single // split on a tcp message describe('split buffer, single message parsing', function () { var fullBuffer = buffers.dataRow([null, 'bang', 'zug zug', null, '!']) it('parses when full buffer comes in', async function () { const messages = await parseBuffers([fullBuffer]) const message = messages[0] as any assert.equal(message.fields.length, 5) assert.equal(message.fields[0], null) assert.equal(message.fields[1], 'bang') assert.equal(message.fields[2], 'zug zug') assert.equal(message.fields[3], null) assert.equal(message.fields[4], '!') }) var testMessageReceivedAfterSplitAt = async function (split: number) { var firstBuffer = Buffer.alloc(fullBuffer.length - split) var secondBuffer = Buffer.alloc(fullBuffer.length - firstBuffer.length) fullBuffer.copy(firstBuffer, 0, 0) fullBuffer.copy(secondBuffer, 0, firstBuffer.length) const messages = await parseBuffers([firstBuffer, secondBuffer]) const message = messages[0] as any assert.equal(message.fields.length, 5) assert.equal(message.fields[0], null) assert.equal(message.fields[1], 'bang') assert.equal(message.fields[2], 'zug zug') assert.equal(message.fields[3], null) assert.equal(message.fields[4], '!') } it('parses when split in the middle', function () { return testMessageReceivedAfterSplitAt(6) }) it('parses when split at end', function () { return testMessageReceivedAfterSplitAt(2) }) it('parses when split at beginning', function () { return Promise.all([ testMessageReceivedAfterSplitAt(fullBuffer.length - 2), testMessageReceivedAfterSplitAt(fullBuffer.length - 1), testMessageReceivedAfterSplitAt(fullBuffer.length - 5), ]) }) }) describe('split buffer, multiple message parsing', function () { var dataRowBuffer = buffers.dataRow(['!']) var readyForQueryBuffer = buffers.readyForQuery() var fullBuffer = Buffer.alloc(dataRowBuffer.length + readyForQueryBuffer.length) dataRowBuffer.copy(fullBuffer, 0, 0) readyForQueryBuffer.copy(fullBuffer, dataRowBuffer.length, 0) var verifyMessages = function (messages: any[]) { assert.strictEqual(messages.length, 2) assert.deepEqual(messages[0], { name: 'dataRow', fieldCount: 1, length: 11, fields: ['!'], }) assert.equal(messages[0].fields[0], '!') assert.deepEqual(messages[1], { name: 'readyForQuery', length: 5, status: 'I', }) } // sanity check it('receives both messages when packet is not split', async function () { const messages = await parseBuffers([fullBuffer]) verifyMessages(messages) }) var splitAndVerifyTwoMessages = async function (split: number) { var firstBuffer = Buffer.alloc(fullBuffer.length - split) var secondBuffer = Buffer.alloc(fullBuffer.length - firstBuffer.length) fullBuffer.copy(firstBuffer, 0, 0) fullBuffer.copy(secondBuffer, 0, firstBuffer.length) const messages = await parseBuffers([firstBuffer, secondBuffer]) verifyMessages(messages) } describe('receives both messages when packet is split', function () { it('in the middle', function () { return splitAndVerifyTwoMessages(11) }) it('at the front', function () { return Promise.all([ splitAndVerifyTwoMessages(fullBuffer.length - 1), splitAndVerifyTwoMessages(fullBuffer.length - 4), splitAndVerifyTwoMessages(fullBuffer.length - 6), ]) }) it('at the end', function () { return Promise.all([splitAndVerifyTwoMessages(8), splitAndVerifyTwoMessages(1)]) }) }) }) }) node-postgres-pg-8.14.1/packages/pg-protocol/src/index.ts000066400000000000000000000006731476604072200233110ustar00rootroot00000000000000import { DatabaseError } from './messages' import { serialize } from './serializer' import { Parser, MessageCallback } from './parser' export function parse(stream: NodeJS.ReadableStream, callback: MessageCallback): Promise { const parser = new Parser() stream.on('data', (buffer: Buffer) => parser.parse(buffer, callback)) return new Promise((resolve) => stream.on('end', () => resolve())) } export { serialize, DatabaseError } node-postgres-pg-8.14.1/packages/pg-protocol/src/messages.ts000066400000000000000000000144721476604072200240130ustar00rootroot00000000000000export type Mode = 'text' | 'binary' export type MessageName = | 'parseComplete' | 'bindComplete' | 'closeComplete' | 'noData' | 'portalSuspended' | 'replicationStart' | 'emptyQuery' | 'copyDone' | 'copyData' | 'rowDescription' | 'parameterDescription' | 'parameterStatus' | 'backendKeyData' | 'notification' | 'readyForQuery' | 'commandComplete' | 'dataRow' | 'copyInResponse' | 'copyOutResponse' | 'authenticationOk' | 'authenticationMD5Password' | 'authenticationCleartextPassword' | 'authenticationSASL' | 'authenticationSASLContinue' | 'authenticationSASLFinal' | 'error' | 'notice' export interface BackendMessage { name: MessageName length: number } export const parseComplete: BackendMessage = { name: 'parseComplete', length: 5, } export const bindComplete: BackendMessage = { name: 'bindComplete', length: 5, } export const closeComplete: BackendMessage = { name: 'closeComplete', length: 5, } export const noData: BackendMessage = { name: 'noData', length: 5, } export const portalSuspended: BackendMessage = { name: 'portalSuspended', length: 5, } export const replicationStart: BackendMessage = { name: 'replicationStart', length: 4, } export const emptyQuery: BackendMessage = { name: 'emptyQuery', length: 4, } export const copyDone: BackendMessage = { name: 'copyDone', length: 4, } interface NoticeOrError { message: string | undefined severity: string | undefined code: string | undefined detail: string | undefined hint: string | undefined position: string | undefined internalPosition: string | undefined internalQuery: string | undefined where: string | undefined schema: string | undefined table: string | undefined column: string | undefined dataType: string | undefined constraint: string | undefined file: string | undefined line: string | undefined routine: string | undefined } export class DatabaseError extends Error implements NoticeOrError { public severity: string | undefined public code: string | undefined public detail: string | undefined public hint: string | undefined public position: string | undefined public internalPosition: string | undefined public internalQuery: string | undefined public where: string | undefined public schema: string | undefined public table: string | undefined public column: string | undefined public dataType: string | undefined public constraint: string | undefined public file: string | undefined public line: string | undefined public routine: string | undefined constructor( message: string, public readonly length: number, public readonly name: MessageName ) { super(message) } } export class CopyDataMessage { public readonly name = 'copyData' constructor( public readonly length: number, public readonly chunk: Buffer ) {} } export class CopyResponse { public readonly columnTypes: number[] constructor( public readonly length: number, public readonly name: MessageName, public readonly binary: boolean, columnCount: number ) { this.columnTypes = new Array(columnCount) } } export class Field { constructor( public readonly name: string, public readonly tableID: number, public readonly columnID: number, public readonly dataTypeID: number, public readonly dataTypeSize: number, public readonly dataTypeModifier: number, public readonly format: Mode ) {} } export class RowDescriptionMessage { public readonly name: MessageName = 'rowDescription' public readonly fields: Field[] constructor( public readonly length: number, public readonly fieldCount: number ) { this.fields = new Array(this.fieldCount) } } export class ParameterDescriptionMessage { public readonly name: MessageName = 'parameterDescription' public readonly dataTypeIDs: number[] constructor( public readonly length: number, public readonly parameterCount: number ) { this.dataTypeIDs = new Array(this.parameterCount) } } export class ParameterStatusMessage { public readonly name: MessageName = 'parameterStatus' constructor( public readonly length: number, public readonly parameterName: string, public readonly parameterValue: string ) {} } export class AuthenticationMD5Password implements BackendMessage { public readonly name: MessageName = 'authenticationMD5Password' constructor( public readonly length: number, public readonly salt: Buffer ) {} } export class BackendKeyDataMessage { public readonly name: MessageName = 'backendKeyData' constructor( public readonly length: number, public readonly processID: number, public readonly secretKey: number ) {} } export class NotificationResponseMessage { public readonly name: MessageName = 'notification' constructor( public readonly length: number, public readonly processId: number, public readonly channel: string, public readonly payload: string ) {} } export class ReadyForQueryMessage { public readonly name: MessageName = 'readyForQuery' constructor( public readonly length: number, public readonly status: string ) {} } export class CommandCompleteMessage { public readonly name: MessageName = 'commandComplete' constructor( public readonly length: number, public readonly text: string ) {} } export class DataRowMessage { public readonly fieldCount: number public readonly name: MessageName = 'dataRow' constructor( public length: number, public fields: any[] ) { this.fieldCount = fields.length } } export class NoticeMessage implements BackendMessage, NoticeOrError { constructor( public readonly length: number, public readonly message: string | undefined ) {} public readonly name = 'notice' public severity: string | undefined public code: string | undefined public detail: string | undefined public hint: string | undefined public position: string | undefined public internalPosition: string | undefined public internalQuery: string | undefined public where: string | undefined public schema: string | undefined public table: string | undefined public column: string | undefined public dataType: string | undefined public constraint: string | undefined public file: string | undefined public line: string | undefined public routine: string | undefined } node-postgres-pg-8.14.1/packages/pg-protocol/src/outbound-serializer.test.ts000066400000000000000000000204001476604072200271540ustar00rootroot00000000000000import assert from 'assert' import { serialize } from './serializer' import BufferList from './testing/buffer-list' describe('serializer', () => { it('builds startup message', function () { const actual = serialize.startup({ user: 'brian', database: 'bang', }) assert.deepEqual( actual, new BufferList() .addInt16(3) .addInt16(0) .addCString('user') .addCString('brian') .addCString('database') .addCString('bang') .addCString('client_encoding') .addCString('UTF8') .addCString('') .join(true) ) }) it('builds password message', function () { const actual = serialize.password('!') assert.deepEqual(actual, new BufferList().addCString('!').join(true, 'p')) }) it('builds request ssl message', function () { const actual = serialize.requestSsl() const expected = new BufferList().addInt32(80877103).join(true) assert.deepEqual(actual, expected) }) it('builds SASLInitialResponseMessage message', function () { const actual = serialize.sendSASLInitialResponseMessage('mech', 'data') assert.deepEqual(actual, new BufferList().addCString('mech').addInt32(4).addString('data').join(true, 'p')) }) it('builds SCRAMClientFinalMessage message', function () { const actual = serialize.sendSCRAMClientFinalMessage('data') assert.deepEqual(actual, new BufferList().addString('data').join(true, 'p')) }) it('builds query message', function () { var txt = 'select * from boom' const actual = serialize.query(txt) assert.deepEqual(actual, new BufferList().addCString(txt).join(true, 'Q')) }) describe('parse message', () => { it('builds parse message', function () { const actual = serialize.parse({ text: '!' }) var expected = new BufferList().addCString('').addCString('!').addInt16(0).join(true, 'P') assert.deepEqual(actual, expected) }) it('builds parse message with named query', function () { const actual = serialize.parse({ name: 'boom', text: 'select * from boom', types: [], }) var expected = new BufferList().addCString('boom').addCString('select * from boom').addInt16(0).join(true, 'P') assert.deepEqual(actual, expected) }) it('with multiple parameters', function () { const actual = serialize.parse({ name: 'force', text: 'select * from bang where name = $1', types: [1, 2, 3, 4], }) var expected = new BufferList() .addCString('force') .addCString('select * from bang where name = $1') .addInt16(4) .addInt32(1) .addInt32(2) .addInt32(3) .addInt32(4) .join(true, 'P') assert.deepEqual(actual, expected) }) }) describe('bind messages', function () { it('with no values', function () { const actual = serialize.bind() var expectedBuffer = new BufferList() .addCString('') .addCString('') .addInt16(0) .addInt16(0) .addInt16(0) .join(true, 'B') assert.deepEqual(actual, expectedBuffer) }) it('with named statement, portal, and values', function () { const actual = serialize.bind({ portal: 'bang', statement: 'woo', values: ['1', 'hi', null, 'zing'], }) var expectedBuffer = new BufferList() .addCString('bang') // portal name .addCString('woo') // statement name .addInt16(4) .addInt16(0) .addInt16(0) .addInt16(0) .addInt16(0) .addInt16(4) .addInt32(1) .add(Buffer.from('1')) .addInt32(2) .add(Buffer.from('hi')) .addInt32(-1) .addInt32(4) .add(Buffer.from('zing')) .addInt16(0) .join(true, 'B') assert.deepEqual(actual, expectedBuffer) }) }) it('with custom valueMapper', function () { const actual = serialize.bind({ portal: 'bang', statement: 'woo', values: ['1', 'hi', null, 'zing'], valueMapper: () => null, }) var expectedBuffer = new BufferList() .addCString('bang') // portal name .addCString('woo') // statement name .addInt16(4) .addInt16(0) .addInt16(0) .addInt16(0) .addInt16(0) .addInt16(4) .addInt32(-1) .addInt32(-1) .addInt32(-1) .addInt32(-1) .addInt16(0) .join(true, 'B') assert.deepEqual(actual, expectedBuffer) }) it('with named statement, portal, and buffer value', function () { const actual = serialize.bind({ portal: 'bang', statement: 'woo', values: ['1', 'hi', null, Buffer.from('zing', 'utf8')], }) var expectedBuffer = new BufferList() .addCString('bang') // portal name .addCString('woo') // statement name .addInt16(4) // value count .addInt16(0) // string .addInt16(0) // string .addInt16(0) // string .addInt16(1) // binary .addInt16(4) .addInt32(1) .add(Buffer.from('1')) .addInt32(2) .add(Buffer.from('hi')) .addInt32(-1) .addInt32(4) .add(Buffer.from('zing', 'utf-8')) .addInt16(0) .join(true, 'B') assert.deepEqual(actual, expectedBuffer) }) describe('builds execute message', function () { it('for unamed portal with no row limit', function () { const actual = serialize.execute() var expectedBuffer = new BufferList().addCString('').addInt32(0).join(true, 'E') assert.deepEqual(actual, expectedBuffer) }) it('for named portal with row limit', function () { const actual = serialize.execute({ portal: 'my favorite portal', rows: 100, }) var expectedBuffer = new BufferList().addCString('my favorite portal').addInt32(100).join(true, 'E') assert.deepEqual(actual, expectedBuffer) }) }) it('builds flush command', function () { const actual = serialize.flush() var expected = new BufferList().join(true, 'H') assert.deepEqual(actual, expected) }) it('builds sync command', function () { const actual = serialize.sync() var expected = new BufferList().join(true, 'S') assert.deepEqual(actual, expected) }) it('builds end command', function () { const actual = serialize.end() var expected = Buffer.from([0x58, 0, 0, 0, 4]) assert.deepEqual(actual, expected) }) describe('builds describe command', function () { it('describe statement', function () { const actual = serialize.describe({ type: 'S', name: 'bang' }) var expected = new BufferList().addChar('S').addCString('bang').join(true, 'D') assert.deepEqual(actual, expected) }) it('describe unnamed portal', function () { const actual = serialize.describe({ type: 'P' }) var expected = new BufferList().addChar('P').addCString('').join(true, 'D') assert.deepEqual(actual, expected) }) }) describe('builds close command', function () { it('describe statement', function () { const actual = serialize.close({ type: 'S', name: 'bang' }) var expected = new BufferList().addChar('S').addCString('bang').join(true, 'C') assert.deepEqual(actual, expected) }) it('describe unnamed portal', function () { const actual = serialize.close({ type: 'P' }) var expected = new BufferList().addChar('P').addCString('').join(true, 'C') assert.deepEqual(actual, expected) }) }) describe('copy messages', function () { it('builds copyFromChunk', () => { const actual = serialize.copyData(Buffer.from([1, 2, 3])) const expected = new BufferList().add(Buffer.from([1, 2, 3])).join(true, 'd') assert.deepEqual(actual, expected) }) it('builds copy fail', () => { const actual = serialize.copyFail('err!') const expected = new BufferList().addCString('err!').join(true, 'f') assert.deepEqual(actual, expected) }) it('builds copy done', () => { const actual = serialize.copyDone() const expected = new BufferList().join(true, 'c') assert.deepEqual(actual, expected) }) }) it('builds cancel message', () => { const actual = serialize.cancel(3, 4) const expected = new BufferList().addInt16(1234).addInt16(5678).addInt32(3).addInt32(4).join(true) assert.deepEqual(actual, expected) }) }) node-postgres-pg-8.14.1/packages/pg-protocol/src/parser.ts000066400000000000000000000321701476604072200234730ustar00rootroot00000000000000import { TransformOptions } from 'stream' import { Mode, bindComplete, parseComplete, closeComplete, noData, portalSuspended, copyDone, replicationStart, emptyQuery, ReadyForQueryMessage, CommandCompleteMessage, CopyDataMessage, CopyResponse, NotificationResponseMessage, RowDescriptionMessage, ParameterDescriptionMessage, Field, DataRowMessage, ParameterStatusMessage, BackendKeyDataMessage, DatabaseError, BackendMessage, MessageName, AuthenticationMD5Password, NoticeMessage, } from './messages' import { BufferReader } from './buffer-reader' // every message is prefixed with a single bye const CODE_LENGTH = 1 // every message has an int32 length which includes itself but does // NOT include the code in the length const LEN_LENGTH = 4 const HEADER_LENGTH = CODE_LENGTH + LEN_LENGTH export type Packet = { code: number packet: Buffer } const emptyBuffer = Buffer.allocUnsafe(0) type StreamOptions = TransformOptions & { mode: Mode } const enum MessageCodes { DataRow = 0x44, // D ParseComplete = 0x31, // 1 BindComplete = 0x32, // 2 CloseComplete = 0x33, // 3 CommandComplete = 0x43, // C ReadyForQuery = 0x5a, // Z NoData = 0x6e, // n NotificationResponse = 0x41, // A AuthenticationResponse = 0x52, // R ParameterStatus = 0x53, // S BackendKeyData = 0x4b, // K ErrorMessage = 0x45, // E NoticeMessage = 0x4e, // N RowDescriptionMessage = 0x54, // T ParameterDescriptionMessage = 0x74, // t PortalSuspended = 0x73, // s ReplicationStart = 0x57, // W EmptyQuery = 0x49, // I CopyIn = 0x47, // G CopyOut = 0x48, // H CopyDone = 0x63, // c CopyData = 0x64, // d } export type MessageCallback = (msg: BackendMessage) => void export class Parser { private buffer: Buffer = emptyBuffer private bufferLength: number = 0 private bufferOffset: number = 0 private reader = new BufferReader() private mode: Mode constructor(opts?: StreamOptions) { if (opts?.mode === 'binary') { throw new Error('Binary mode not supported yet') } this.mode = opts?.mode || 'text' } public parse(buffer: Buffer, callback: MessageCallback) { this.mergeBuffer(buffer) const bufferFullLength = this.bufferOffset + this.bufferLength let offset = this.bufferOffset while (offset + HEADER_LENGTH <= bufferFullLength) { // code is 1 byte long - it identifies the message type const code = this.buffer[offset] // length is 1 Uint32BE - it is the length of the message EXCLUDING the code const length = this.buffer.readUInt32BE(offset + CODE_LENGTH) const fullMessageLength = CODE_LENGTH + length if (fullMessageLength + offset <= bufferFullLength) { const message = this.handlePacket(offset + HEADER_LENGTH, code, length, this.buffer) callback(message) offset += fullMessageLength } else { break } } if (offset === bufferFullLength) { // No more use for the buffer this.buffer = emptyBuffer this.bufferLength = 0 this.bufferOffset = 0 } else { // Adjust the cursors of remainingBuffer this.bufferLength = bufferFullLength - offset this.bufferOffset = offset } } private mergeBuffer(buffer: Buffer): void { if (this.bufferLength > 0) { const newLength = this.bufferLength + buffer.byteLength const newFullLength = newLength + this.bufferOffset if (newFullLength > this.buffer.byteLength) { // We can't concat the new buffer with the remaining one let newBuffer: Buffer if (newLength <= this.buffer.byteLength && this.bufferOffset >= this.bufferLength) { // We can move the relevant part to the beginning of the buffer instead of allocating a new buffer newBuffer = this.buffer } else { // Allocate a new larger buffer let newBufferLength = this.buffer.byteLength * 2 while (newLength >= newBufferLength) { newBufferLength *= 2 } newBuffer = Buffer.allocUnsafe(newBufferLength) } // Move the remaining buffer to the new one this.buffer.copy(newBuffer, 0, this.bufferOffset, this.bufferOffset + this.bufferLength) this.buffer = newBuffer this.bufferOffset = 0 } // Concat the new buffer with the remaining one buffer.copy(this.buffer, this.bufferOffset + this.bufferLength) this.bufferLength = newLength } else { this.buffer = buffer this.bufferOffset = 0 this.bufferLength = buffer.byteLength } } private handlePacket(offset: number, code: number, length: number, bytes: Buffer): BackendMessage { switch (code) { case MessageCodes.BindComplete: return bindComplete case MessageCodes.ParseComplete: return parseComplete case MessageCodes.CloseComplete: return closeComplete case MessageCodes.NoData: return noData case MessageCodes.PortalSuspended: return portalSuspended case MessageCodes.CopyDone: return copyDone case MessageCodes.ReplicationStart: return replicationStart case MessageCodes.EmptyQuery: return emptyQuery case MessageCodes.DataRow: return this.parseDataRowMessage(offset, length, bytes) case MessageCodes.CommandComplete: return this.parseCommandCompleteMessage(offset, length, bytes) case MessageCodes.ReadyForQuery: return this.parseReadyForQueryMessage(offset, length, bytes) case MessageCodes.NotificationResponse: return this.parseNotificationMessage(offset, length, bytes) case MessageCodes.AuthenticationResponse: return this.parseAuthenticationResponse(offset, length, bytes) case MessageCodes.ParameterStatus: return this.parseParameterStatusMessage(offset, length, bytes) case MessageCodes.BackendKeyData: return this.parseBackendKeyData(offset, length, bytes) case MessageCodes.ErrorMessage: return this.parseErrorMessage(offset, length, bytes, 'error') case MessageCodes.NoticeMessage: return this.parseErrorMessage(offset, length, bytes, 'notice') case MessageCodes.RowDescriptionMessage: return this.parseRowDescriptionMessage(offset, length, bytes) case MessageCodes.ParameterDescriptionMessage: return this.parseParameterDescriptionMessage(offset, length, bytes) case MessageCodes.CopyIn: return this.parseCopyInMessage(offset, length, bytes) case MessageCodes.CopyOut: return this.parseCopyOutMessage(offset, length, bytes) case MessageCodes.CopyData: return this.parseCopyData(offset, length, bytes) default: return new DatabaseError('received invalid response: ' + code.toString(16), length, 'error') } } private parseReadyForQueryMessage(offset: number, length: number, bytes: Buffer) { this.reader.setBuffer(offset, bytes) const status = this.reader.string(1) return new ReadyForQueryMessage(length, status) } private parseCommandCompleteMessage(offset: number, length: number, bytes: Buffer) { this.reader.setBuffer(offset, bytes) const text = this.reader.cstring() return new CommandCompleteMessage(length, text) } private parseCopyData(offset: number, length: number, bytes: Buffer) { const chunk = bytes.slice(offset, offset + (length - 4)) return new CopyDataMessage(length, chunk) } private parseCopyInMessage(offset: number, length: number, bytes: Buffer) { return this.parseCopyMessage(offset, length, bytes, 'copyInResponse') } private parseCopyOutMessage(offset: number, length: number, bytes: Buffer) { return this.parseCopyMessage(offset, length, bytes, 'copyOutResponse') } private parseCopyMessage(offset: number, length: number, bytes: Buffer, messageName: MessageName) { this.reader.setBuffer(offset, bytes) const isBinary = this.reader.byte() !== 0 const columnCount = this.reader.int16() const message = new CopyResponse(length, messageName, isBinary, columnCount) for (let i = 0; i < columnCount; i++) { message.columnTypes[i] = this.reader.int16() } return message } private parseNotificationMessage(offset: number, length: number, bytes: Buffer) { this.reader.setBuffer(offset, bytes) const processId = this.reader.int32() const channel = this.reader.cstring() const payload = this.reader.cstring() return new NotificationResponseMessage(length, processId, channel, payload) } private parseRowDescriptionMessage(offset: number, length: number, bytes: Buffer) { this.reader.setBuffer(offset, bytes) const fieldCount = this.reader.int16() const message = new RowDescriptionMessage(length, fieldCount) for (let i = 0; i < fieldCount; i++) { message.fields[i] = this.parseField() } return message } private parseField(): Field { const name = this.reader.cstring() const tableID = this.reader.uint32() const columnID = this.reader.int16() const dataTypeID = this.reader.uint32() const dataTypeSize = this.reader.int16() const dataTypeModifier = this.reader.int32() const mode = this.reader.int16() === 0 ? 'text' : 'binary' return new Field(name, tableID, columnID, dataTypeID, dataTypeSize, dataTypeModifier, mode) } private parseParameterDescriptionMessage(offset: number, length: number, bytes: Buffer) { this.reader.setBuffer(offset, bytes) const parameterCount = this.reader.int16() const message = new ParameterDescriptionMessage(length, parameterCount) for (let i = 0; i < parameterCount; i++) { message.dataTypeIDs[i] = this.reader.int32() } return message } private parseDataRowMessage(offset: number, length: number, bytes: Buffer) { this.reader.setBuffer(offset, bytes) const fieldCount = this.reader.int16() const fields: any[] = new Array(fieldCount) for (let i = 0; i < fieldCount; i++) { const len = this.reader.int32() // a -1 for length means the value of the field is null fields[i] = len === -1 ? null : this.reader.string(len) } return new DataRowMessage(length, fields) } private parseParameterStatusMessage(offset: number, length: number, bytes: Buffer) { this.reader.setBuffer(offset, bytes) const name = this.reader.cstring() const value = this.reader.cstring() return new ParameterStatusMessage(length, name, value) } private parseBackendKeyData(offset: number, length: number, bytes: Buffer) { this.reader.setBuffer(offset, bytes) const processID = this.reader.int32() const secretKey = this.reader.int32() return new BackendKeyDataMessage(length, processID, secretKey) } public parseAuthenticationResponse(offset: number, length: number, bytes: Buffer) { this.reader.setBuffer(offset, bytes) const code = this.reader.int32() // TODO(bmc): maybe better types here const message: BackendMessage & any = { name: 'authenticationOk', length, } switch (code) { case 0: // AuthenticationOk break case 3: // AuthenticationCleartextPassword if (message.length === 8) { message.name = 'authenticationCleartextPassword' } break case 5: // AuthenticationMD5Password if (message.length === 12) { message.name = 'authenticationMD5Password' const salt = this.reader.bytes(4) return new AuthenticationMD5Password(length, salt) } break case 10: // AuthenticationSASL message.name = 'authenticationSASL' message.mechanisms = [] let mechanism: string do { mechanism = this.reader.cstring() if (mechanism) { message.mechanisms.push(mechanism) } } while (mechanism) break case 11: // AuthenticationSASLContinue message.name = 'authenticationSASLContinue' message.data = this.reader.string(length - 8) break case 12: // AuthenticationSASLFinal message.name = 'authenticationSASLFinal' message.data = this.reader.string(length - 8) break default: throw new Error('Unknown authenticationOk message type ' + code) } return message } private parseErrorMessage(offset: number, length: number, bytes: Buffer, name: MessageName) { this.reader.setBuffer(offset, bytes) const fields: Record = {} let fieldType = this.reader.string(1) while (fieldType !== '\0') { fields[fieldType] = this.reader.cstring() fieldType = this.reader.string(1) } const messageValue = fields.M const message = name === 'notice' ? new NoticeMessage(length, messageValue) : new DatabaseError(messageValue, length, name) message.severity = fields.S message.code = fields.C message.detail = fields.D message.hint = fields.H message.position = fields.P message.internalPosition = fields.p message.internalQuery = fields.q message.where = fields.W message.schema = fields.s message.table = fields.t message.column = fields.c message.dataType = fields.d message.constraint = fields.n message.file = fields.F message.line = fields.L message.routine = fields.R return message } } node-postgres-pg-8.14.1/packages/pg-protocol/src/serializer.ts000066400000000000000000000160311476604072200243460ustar00rootroot00000000000000import { Writer } from './buffer-writer' const enum code { startup = 0x70, query = 0x51, parse = 0x50, bind = 0x42, execute = 0x45, flush = 0x48, sync = 0x53, end = 0x58, close = 0x43, describe = 0x44, copyFromChunk = 0x64, copyDone = 0x63, copyFail = 0x66, } const writer = new Writer() const startup = (opts: Record): Buffer => { // protocol version writer.addInt16(3).addInt16(0) for (const key of Object.keys(opts)) { writer.addCString(key).addCString(opts[key]) } writer.addCString('client_encoding').addCString('UTF8') var bodyBuffer = writer.addCString('').flush() // this message is sent without a code var length = bodyBuffer.length + 4 return new Writer().addInt32(length).add(bodyBuffer).flush() } const requestSsl = (): Buffer => { const response = Buffer.allocUnsafe(8) response.writeInt32BE(8, 0) response.writeInt32BE(80877103, 4) return response } const password = (password: string): Buffer => { return writer.addCString(password).flush(code.startup) } const sendSASLInitialResponseMessage = function (mechanism: string, initialResponse: string): Buffer { // 0x70 = 'p' writer.addCString(mechanism).addInt32(Buffer.byteLength(initialResponse)).addString(initialResponse) return writer.flush(code.startup) } const sendSCRAMClientFinalMessage = function (additionalData: string): Buffer { return writer.addString(additionalData).flush(code.startup) } const query = (text: string): Buffer => { return writer.addCString(text).flush(code.query) } type ParseOpts = { name?: string types?: number[] text: string } const emptyArray: any[] = [] const parse = (query: ParseOpts): Buffer => { // expect something like this: // { name: 'queryName', // text: 'select * from blah', // types: ['int8', 'bool'] } // normalize missing query names to allow for null const name = query.name || '' if (name.length > 63) { /* eslint-disable no-console */ console.error('Warning! Postgres only supports 63 characters for query names.') console.error('You supplied %s (%s)', name, name.length) console.error('This can cause conflicts and silent errors executing queries') /* eslint-enable no-console */ } const types = query.types || emptyArray var len = types.length var buffer = writer .addCString(name) // name of query .addCString(query.text) // actual query text .addInt16(len) for (var i = 0; i < len; i++) { buffer.addInt32(types[i]) } return writer.flush(code.parse) } type ValueMapper = (param: any, index: number) => any type BindOpts = { portal?: string binary?: boolean statement?: string values?: any[] // optional map from JS value to postgres value per parameter valueMapper?: ValueMapper } const paramWriter = new Writer() // make this a const enum so typescript will inline the value const enum ParamType { STRING = 0, BINARY = 1, } const writeValues = function (values: any[], valueMapper?: ValueMapper): void { for (let i = 0; i < values.length; i++) { const mappedVal = valueMapper ? valueMapper(values[i], i) : values[i] if (mappedVal == null) { // add the param type (string) to the writer writer.addInt16(ParamType.STRING) // write -1 to the param writer to indicate null paramWriter.addInt32(-1) } else if (mappedVal instanceof Buffer) { // add the param type (binary) to the writer writer.addInt16(ParamType.BINARY) // add the buffer to the param writer paramWriter.addInt32(mappedVal.length) paramWriter.add(mappedVal) } else { // add the param type (string) to the writer writer.addInt16(ParamType.STRING) paramWriter.addInt32(Buffer.byteLength(mappedVal)) paramWriter.addString(mappedVal) } } } const bind = (config: BindOpts = {}): Buffer => { // normalize config const portal = config.portal || '' const statement = config.statement || '' const binary = config.binary || false const values = config.values || emptyArray const len = values.length writer.addCString(portal).addCString(statement) writer.addInt16(len) writeValues(values, config.valueMapper) writer.addInt16(len) writer.add(paramWriter.flush()) // format code writer.addInt16(binary ? ParamType.BINARY : ParamType.STRING) return writer.flush(code.bind) } type ExecOpts = { portal?: string rows?: number } const emptyExecute = Buffer.from([code.execute, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00]) const execute = (config?: ExecOpts): Buffer => { // this is the happy path for most queries if (!config || (!config.portal && !config.rows)) { return emptyExecute } const portal = config.portal || '' const rows = config.rows || 0 const portalLength = Buffer.byteLength(portal) const len = 4 + portalLength + 1 + 4 // one extra bit for code const buff = Buffer.allocUnsafe(1 + len) buff[0] = code.execute buff.writeInt32BE(len, 1) buff.write(portal, 5, 'utf-8') buff[portalLength + 5] = 0 // null terminate portal cString buff.writeUInt32BE(rows, buff.length - 4) return buff } const cancel = (processID: number, secretKey: number): Buffer => { const buffer = Buffer.allocUnsafe(16) buffer.writeInt32BE(16, 0) buffer.writeInt16BE(1234, 4) buffer.writeInt16BE(5678, 6) buffer.writeInt32BE(processID, 8) buffer.writeInt32BE(secretKey, 12) return buffer } type PortalOpts = { type: 'S' | 'P' name?: string } const cstringMessage = (code: code, string: string): Buffer => { const stringLen = Buffer.byteLength(string) const len = 4 + stringLen + 1 // one extra bit for code const buffer = Buffer.allocUnsafe(1 + len) buffer[0] = code buffer.writeInt32BE(len, 1) buffer.write(string, 5, 'utf-8') buffer[len] = 0 // null terminate cString return buffer } const emptyDescribePortal = writer.addCString('P').flush(code.describe) const emptyDescribeStatement = writer.addCString('S').flush(code.describe) const describe = (msg: PortalOpts): Buffer => { return msg.name ? cstringMessage(code.describe, `${msg.type}${msg.name || ''}`) : msg.type === 'P' ? emptyDescribePortal : emptyDescribeStatement } const close = (msg: PortalOpts): Buffer => { const text = `${msg.type}${msg.name || ''}` return cstringMessage(code.close, text) } const copyData = (chunk: Buffer): Buffer => { return writer.add(chunk).flush(code.copyFromChunk) } const copyFail = (message: string): Buffer => { return cstringMessage(code.copyFail, message) } const codeOnlyBuffer = (code: code): Buffer => Buffer.from([code, 0x00, 0x00, 0x00, 0x04]) const flushBuffer = codeOnlyBuffer(code.flush) const syncBuffer = codeOnlyBuffer(code.sync) const endBuffer = codeOnlyBuffer(code.end) const copyDoneBuffer = codeOnlyBuffer(code.copyDone) const serialize = { startup, password, requestSsl, sendSASLInitialResponseMessage, sendSCRAMClientFinalMessage, query, parse, bind, execute, describe, close, flush: () => flushBuffer, sync: () => syncBuffer, end: () => endBuffer, copyData, copyDone: () => copyDoneBuffer, copyFail, cancel, } export { serialize } node-postgres-pg-8.14.1/packages/pg-protocol/src/testing/000077500000000000000000000000001476604072200233015ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg-protocol/src/testing/buffer-list.ts000066400000000000000000000032651476604072200261010ustar00rootroot00000000000000export default class BufferList { constructor(public buffers: Buffer[] = []) {} public add(buffer: Buffer, front?: boolean) { this.buffers[front ? 'unshift' : 'push'](buffer) return this } public addInt16(val: number, front?: boolean) { return this.add(Buffer.from([val >>> 8, val >>> 0]), front) } public getByteLength() { return this.buffers.reduce(function (previous, current) { return previous + current.length }, 0) } public addInt32(val: number, first?: boolean) { return this.add( Buffer.from([(val >>> 24) & 0xff, (val >>> 16) & 0xff, (val >>> 8) & 0xff, (val >>> 0) & 0xff]), first ) } public addCString(val: string, front?: boolean) { var len = Buffer.byteLength(val) var buffer = Buffer.alloc(len + 1) buffer.write(val) buffer[len] = 0 return this.add(buffer, front) } public addString(val: string, front?: boolean) { var len = Buffer.byteLength(val) var buffer = Buffer.alloc(len) buffer.write(val) return this.add(buffer, front) } public addChar(char: string, first?: boolean) { return this.add(Buffer.from(char, 'utf8'), first) } public addByte(byte: number) { return this.add(Buffer.from([byte])) } public join(appendLength?: boolean, char?: string): Buffer { var length = this.getByteLength() if (appendLength) { this.addInt32(length + 4, true) return this.join(false, char) } if (char) { this.addChar(char, true) length++ } var result = Buffer.alloc(length) var index = 0 this.buffers.forEach(function (buffer) { buffer.copy(result, index, 0) index += buffer.length }) return result } } node-postgres-pg-8.14.1/packages/pg-protocol/src/testing/test-buffers.ts000066400000000000000000000103761476604072200262710ustar00rootroot00000000000000// https://www.postgresql.org/docs/current/protocol-message-formats.html import BufferList from './buffer-list' const buffers = { readyForQuery: function () { return new BufferList().add(Buffer.from('I')).join(true, 'Z') }, authenticationOk: function () { return new BufferList().addInt32(0).join(true, 'R') }, authenticationCleartextPassword: function () { return new BufferList().addInt32(3).join(true, 'R') }, authenticationMD5Password: function () { return new BufferList() .addInt32(5) .add(Buffer.from([1, 2, 3, 4])) .join(true, 'R') }, authenticationSASL: function () { return new BufferList().addInt32(10).addCString('SCRAM-SHA-256').addCString('').join(true, 'R') }, authenticationSASLContinue: function () { return new BufferList().addInt32(11).addString('data').join(true, 'R') }, authenticationSASLFinal: function () { return new BufferList().addInt32(12).addString('data').join(true, 'R') }, parameterStatus: function (name: string, value: string) { return new BufferList().addCString(name).addCString(value).join(true, 'S') }, backendKeyData: function (processID: number, secretKey: number) { return new BufferList().addInt32(processID).addInt32(secretKey).join(true, 'K') }, commandComplete: function (string: string) { return new BufferList().addCString(string).join(true, 'C') }, rowDescription: function (fields: any[]) { fields = fields || [] var buf = new BufferList() buf.addInt16(fields.length) fields.forEach(function (field) { buf .addCString(field.name) .addInt32(field.tableID || 0) .addInt16(field.attributeNumber || 0) .addInt32(field.dataTypeID || 0) .addInt16(field.dataTypeSize || 0) .addInt32(field.typeModifier || 0) .addInt16(field.formatCode || 0) }) return buf.join(true, 'T') }, parameterDescription: function (dataTypeIDs: number[]) { dataTypeIDs = dataTypeIDs || [] var buf = new BufferList() buf.addInt16(dataTypeIDs.length) dataTypeIDs.forEach(function (dataTypeID) { buf.addInt32(dataTypeID) }) return buf.join(true, 't') }, dataRow: function (columns: any[]) { columns = columns || [] var buf = new BufferList() buf.addInt16(columns.length) columns.forEach(function (col) { if (col == null) { buf.addInt32(-1) } else { var strBuf = Buffer.from(col, 'utf8') buf.addInt32(strBuf.length) buf.add(strBuf) } }) return buf.join(true, 'D') }, error: function (fields: any) { return buffers.errorOrNotice(fields).join(true, 'E') }, notice: function (fields: any) { return buffers.errorOrNotice(fields).join(true, 'N') }, errorOrNotice: function (fields: any) { fields = fields || [] var buf = new BufferList() fields.forEach(function (field: any) { buf.addChar(field.type) buf.addCString(field.value) }) return buf.add(Buffer.from([0])) // terminator }, parseComplete: function () { return new BufferList().join(true, '1') }, bindComplete: function () { return new BufferList().join(true, '2') }, notification: function (id: number, channel: string, payload: string) { return new BufferList().addInt32(id).addCString(channel).addCString(payload).join(true, 'A') }, emptyQuery: function () { return new BufferList().join(true, 'I') }, portalSuspended: function () { return new BufferList().join(true, 's') }, closeComplete: function () { return new BufferList().join(true, '3') }, copyIn: function (cols: number) { const list = new BufferList() // text mode .addByte(0) // column count .addInt16(cols) for (let i = 0; i < cols; i++) { list.addInt16(i) } return list.join(true, 'G') }, copyOut: function (cols: number) { const list = new BufferList() // text mode .addByte(0) // column count .addInt16(cols) for (let i = 0; i < cols; i++) { list.addInt16(i) } return list.join(true, 'H') }, copyData: function (bytes: Buffer) { return new BufferList().add(bytes).join(true, 'd') }, copyDone: function () { return new BufferList().join(true, 'c') }, } export default buffers node-postgres-pg-8.14.1/packages/pg-protocol/src/types/000077500000000000000000000000001476604072200227705ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg-protocol/src/types/chunky.d.ts000066400000000000000000000000301476604072200250540ustar00rootroot00000000000000declare module 'chunky' node-postgres-pg-8.14.1/packages/pg-protocol/tsconfig.json000066400000000000000000000007241476604072200235470ustar00rootroot00000000000000{ "compilerOptions": { "module": "commonjs", "esModuleInterop": true, "allowSyntheticDefaultImports": true, "strict": true, "target": "es6", "noImplicitAny": true, "moduleResolution": "node", "sourceMap": true, "outDir": "dist", "incremental": true, "baseUrl": ".", "declaration": true, "paths": { "*": [ "node_modules/*", "src/types/*" ] } }, "include": [ "src/**/*" ] } node-postgres-pg-8.14.1/packages/pg-query-stream/000077500000000000000000000000001476604072200216325ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg-query-stream/LICENSE000066400000000000000000000020731476604072200226410ustar00rootroot00000000000000The MIT License (MIT) Copyright (c) 2013 Brian M. Carlson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. node-postgres-pg-8.14.1/packages/pg-query-stream/README.md000066400000000000000000000051101476604072200231060ustar00rootroot00000000000000# pg-query-stream Receive result rows from [pg](https://github.com/brianc/node-postgres) as a readable (object) stream. ## installation ```bash $ npm install pg --save $ npm install pg-query-stream --save ``` _requires pg>=2.8.1_ ## use ```js const pg = require('pg') var pool = new pg.Pool() const QueryStream = require('pg-query-stream') const JSONStream = require('JSONStream') //pipe 1,000,000 rows to stdout without blowing up your memory usage pool.connect((err, client, done) => { if (err) throw err const query = new QueryStream('SELECT * FROM generate_series(0, $1) num', [1000000]) const stream = client.query(query) //release the client when the stream is finished stream.on('end', done) stream.pipe(JSONStream.stringify()).pipe(process.stdout) }) ``` The stream uses a cursor on the server so it efficiently keeps only a low number of rows in memory. This is especially useful when doing [ETL](http://en.wikipedia.org/wiki/Extract,_transform,_load) on a huge table. Using manual `limit` and `offset` queries to fake out async itteration through your data is cumbersome, and _way way way_ slower than using a cursor. _note: this module only works with the JavaScript client, and does not work with the native bindings. libpq doesn't expose the protocol at a level where a cursor can be manipulated directly_ ## contribution I'm very open to contribution! Open a pull request with your code or idea and we'll talk about it. If it's not way insane we'll merge it in too: isn't open source awesome? ## license The MIT License (MIT) Copyright (c) 2013-2020 Brian M. Carlson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. node-postgres-pg-8.14.1/packages/pg-query-stream/package.json000066400000000000000000000021701476604072200241200ustar00rootroot00000000000000{ "name": "pg-query-stream", "version": "4.8.1", "description": "Postgres query result returned as readable stream", "main": "./dist/index.js", "types": "./dist/index.d.ts", "scripts": { "test": "mocha -r ts-node/register test/**/*.ts" }, "repository": { "type": "git", "url": "git://github.com/brianc/node-postgres.git", "directory": "packages/pg-query-stream" }, "keywords": [ "postgres", "query-stream", "pg", "query", "stream" ], "files": [ "/dist/*{js,ts,map}", "/src" ], "author": "Brian M. Carlson", "license": "MIT", "bugs": { "url": "https://github.com/brianc/node-postgres/issues" }, "devDependencies": { "@types/chai": "^4.2.13", "@types/mocha": "^10.0.7", "@types/node": "^14.0.0", "@types/pg": "^7.14.5", "JSONStream": "~1.3.5", "concat-stream": "~1.0.1", "eslint-plugin-promise": "^6.0.1", "mocha": "^10.5.2", "pg": "^8.14.1", "stream-spec": "~0.3.5", "ts-node": "^8.5.4", "typescript": "^4.0.3" }, "peerDependencies": { "pg": "^8" }, "dependencies": { "pg-cursor": "^2.13.1" } } node-postgres-pg-8.14.1/packages/pg-query-stream/src/000077500000000000000000000000001476604072200224215ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg-query-stream/src/index.ts000066400000000000000000000041271476604072200241040ustar00rootroot00000000000000import { Readable } from 'stream' import { Submittable, Connection } from 'pg' import Cursor from 'pg-cursor' interface QueryStreamConfig { batchSize?: number highWaterMark?: number rowMode?: 'array' types?: any } class QueryStream extends Readable implements Submittable { cursor: any _result: any handleRowDescription: Function handleDataRow: Function handlePortalSuspended: Function handleCommandComplete: Function handleReadyForQuery: Function handleError: Function handleEmptyQuery: Function public constructor(text: string, values?: any[], config: QueryStreamConfig = {}) { const { batchSize, highWaterMark = 100 } = config super({ objectMode: true, autoDestroy: true, highWaterMark: batchSize || highWaterMark }) this.cursor = new Cursor(text, values, config) // delegate Submittable callbacks to cursor this.handleRowDescription = this.cursor.handleRowDescription.bind(this.cursor) this.handleDataRow = this.cursor.handleDataRow.bind(this.cursor) this.handlePortalSuspended = this.cursor.handlePortalSuspended.bind(this.cursor) this.handleCommandComplete = this.cursor.handleCommandComplete.bind(this.cursor) this.handleReadyForQuery = this.cursor.handleReadyForQuery.bind(this.cursor) this.handleError = this.cursor.handleError.bind(this.cursor) this.handleEmptyQuery = this.cursor.handleEmptyQuery.bind(this.cursor) // pg client sets types via _result property this._result = this.cursor._result } public submit(connection: Connection): void { this.cursor.submit(connection) } public _destroy(_err: Error, cb: Function) { this.cursor.close((err?: Error) => { cb(err || _err) }) } // https://nodejs.org/api/stream.html#stream_readable_read_size_1 public _read(size: number) { this.cursor.read(size, (err: Error, rows: any[]) => { if (err) { // https://nodejs.org/api/stream.html#stream_errors_while_reading this.destroy(err) } else { for (const row of rows) this.push(row) if (rows.length < size) this.push(null) } }) } } export = QueryStream node-postgres-pg-8.14.1/packages/pg-query-stream/test/000077500000000000000000000000001476604072200226115ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg-query-stream/test/async-iterator.ts000066400000000000000000000102431476604072200261250ustar00rootroot00000000000000import QueryStream from '../src' import pg from 'pg' import assert from 'assert' const queryText = 'SELECT * FROM generate_series(0, 200) num' // node v8 do not support async iteration if (!process.version.startsWith('v8')) { describe('Async iterator', () => { it('works', async () => { const stream = new QueryStream(queryText, []) const client = new pg.Client() await client.connect() const query = client.query(stream) const rows = [] for await (const row of query) { rows.push(row) } assert.equal(rows.length, 201) await client.end() }) it('can async iterate and then do a query afterwards', async () => { const stream = new QueryStream(queryText, []) const client = new pg.Client() await client.connect() const query = client.query(stream) const iteratorRows = [] for await (const row of query) { iteratorRows.push(row) } assert.equal(iteratorRows.length, 201) const { rows } = await client.query('SELECT NOW()') assert.equal(rows.length, 1) await client.end() }) it('can async iterate multiple times with a pool', async () => { const pool = new pg.Pool({ max: 1 }) const allRows = [] const run = async () => { // get the client const client = await pool.connect() // stream some rows const stream = new QueryStream(queryText, []) const iteratorRows = [] client.query(stream) for await (const row of stream) { iteratorRows.push(row) allRows.push(row) } assert.equal(iteratorRows.length, 201) client.release() } await Promise.all([run(), run(), run()]) assert.equal(allRows.length, 603) await pool.end() }) it('can break out of iteration early', async () => { const pool = new pg.Pool({ max: 1 }) const client = await pool.connect() const rows = [] for await (const row of client.query(new QueryStream(queryText, [], { batchSize: 1 }))) { rows.push(row) break } for await (const row of client.query(new QueryStream(queryText, []))) { rows.push(row) break } for await (const row of client.query(new QueryStream(queryText, []))) { rows.push(row) break } assert.strictEqual(rows.length, 3) client.release() await pool.end() }) it('only returns rows on first iteration', async () => { const pool = new pg.Pool({ max: 1 }) const client = await pool.connect() const rows = [] const stream = client.query(new QueryStream(queryText, [])) for await (const row of stream) { rows.push(row) break } try { for await (const row of stream) { rows.push(row) } for await (const row of stream) { rows.push(row) } } catch (e) { // swallow error - node 17 throws if stream is aborted } assert.strictEqual(rows.length, 1) client.release() await pool.end() }) it('can read with delays', async () => { const pool = new pg.Pool({ max: 1 }) const client = await pool.connect() const rows = [] const stream = client.query(new QueryStream(queryText, [], { batchSize: 1 })) for await (const row of stream) { rows.push(row) await new Promise((resolve) => setTimeout(resolve, 1)) } assert.strictEqual(rows.length, 201) client.release() await pool.end() }) it('supports breaking with low watermark', async function () { const pool = new pg.Pool({ max: 1 }) const client = await pool.connect() /* eslint-disable @typescript-eslint/no-unused-vars */ for await (const _ of client.query(new QueryStream('select TRUE', [], { highWaterMark: 1 }))) break for await (const _ of client.query(new QueryStream('select TRUE', [], { highWaterMark: 1 }))) break for await (const _ of client.query(new QueryStream('select TRUE', [], { highWaterMark: 1 }))) break /* eslint-enable @typescript-eslint/no-unused-vars */ client.release() await pool.end() }) }) } node-postgres-pg-8.14.1/packages/pg-query-stream/test/client-options.ts000066400000000000000000000014001476604072200261230ustar00rootroot00000000000000import pg from 'pg' import assert from 'assert' import QueryStream from '../src' describe('client options', function () { it('uses custom types from client config', function (done) { const types = { getTypeParser: () => (string) => string, } //@ts-expect-error const client = new pg.Client({ types }) client.connect() const stream = new QueryStream('SELECT * FROM generate_series(0, 10) num') const query = client.query(stream) const result = [] query.on('data', (datum) => { result.push(datum) }) query.on('end', () => { const expected = new Array(11).fill(0).map((_, i) => ({ num: i.toString(), })) assert.deepEqual(result, expected) client.end() done() }) }) }) node-postgres-pg-8.14.1/packages/pg-query-stream/test/close.ts000066400000000000000000000063731476604072200242770ustar00rootroot00000000000000import assert from 'assert' import concat from 'concat-stream' import QueryStream from '../src' import helper from './helper' if (process.version.startsWith('v8.')) { console.error('warning! node less than 10lts stream closing semantics may not behave properly') } else { helper('close', function (client) { it('emits close', function (done) { const stream = new QueryStream('SELECT * FROM generate_series(0, $1) num', [3], { batchSize: 2, highWaterMark: 2, }) const query = client.query(stream) query.pipe(concat(function () {})) query.on('close', done) }) }) helper('early close', function (client) { it('can be closed early', function (done) { const stream = new QueryStream('SELECT * FROM generate_series(0, $1) num', [20000], { batchSize: 2, highWaterMark: 2, }) const query = client.query(stream) let readCount = 0 query.on('readable', function () { readCount++ query.read() }) query.once('readable', function () { query.destroy() }) query.on('close', function () { assert(readCount < 10, 'should not have read more than 10 rows') done() }) }) it('can destroy stream while reading', function (done) { const stream = new QueryStream('SELECT * FROM generate_series(0, 100), pg_sleep(1)') client.query(stream) stream.on('data', () => done(new Error('stream should not have returned rows'))) setTimeout(() => { stream.destroy() stream.on('close', done) }, 100) }) it('emits an error when calling destroy with an error', function (done) { const stream = new QueryStream('SELECT * FROM generate_series(0, 100), pg_sleep(1)') client.query(stream) stream.on('data', () => done(new Error('stream should not have returned rows'))) setTimeout(() => { stream.destroy(new Error('intentional error')) stream.on('error', (err) => { // make sure there's an error assert(err) assert.strictEqual(err.message, 'intentional error') done() }) }, 100) }) it('can destroy stream while reading an error', function (done) { const stream = new QueryStream('SELECT * from pg_sleep(1), basdfasdf;') client.query(stream) stream.on('data', () => done(new Error('stream should not have returned rows'))) stream.once('error', () => { stream.destroy() // wait a bit to let any other errors shake through setTimeout(done, 100) }) }) it('does not crash when destroying the stream immediately after calling read', function (done) { const stream = new QueryStream('SELECT * from generate_series(0, 100), pg_sleep(1);') client.query(stream) stream.on('data', () => done(new Error('stream should not have returned rows'))) stream.destroy() stream.on('close', done) }) it('does not crash when destroying the stream before its submitted', function (done) { const stream = new QueryStream('SELECT * from generate_series(0, 100), pg_sleep(1);') stream.on('data', () => done(new Error('stream should not have returned rows'))) stream.destroy() stream.on('close', done) }) }) } node-postgres-pg-8.14.1/packages/pg-query-stream/test/concat.ts000066400000000000000000000014341476604072200244320ustar00rootroot00000000000000import assert from 'assert' import concat from 'concat-stream' import { Transform } from 'stream' import helper from './helper' import QueryStream from '../src' helper('concat', function (client) { it('concats correctly', function (done) { const stream = new QueryStream('SELECT * FROM generate_series(0, 200) num', []) const query = client.query(stream) query .pipe( new Transform({ transform(chunk, _, callback) { callback(null, chunk.num) }, objectMode: true, }) ) .pipe( concat(function (result) { const total = result.reduce(function (prev, cur) { return prev + cur }) assert.equal(total, 20100) }) ) stream.on('end', done) }) }) node-postgres-pg-8.14.1/packages/pg-query-stream/test/config.ts000066400000000000000000000013521476604072200244270ustar00rootroot00000000000000import assert from 'assert' import QueryStream from '../src' describe('stream config options', () => { // this is mostly for backwards compatibility. it('sets readable.highWaterMark based on batch size', () => { const stream = new QueryStream('SELECT NOW()', [], { batchSize: 88, }) assert.equal(stream.readableHighWaterMark, 88) }) it('sets readable.highWaterMark based on highWaterMark config', () => { const stream = new QueryStream('SELECT NOW()', [], { highWaterMark: 88, }) assert.equal(stream.readableHighWaterMark, 88) }) it('defaults to 100 for highWaterMark', () => { const stream = new QueryStream('SELECT NOW()', []) assert.equal(stream.readableHighWaterMark, 100) }) }) node-postgres-pg-8.14.1/packages/pg-query-stream/test/empty-query.ts000066400000000000000000000010571476604072200254650ustar00rootroot00000000000000import helper from './helper' import QueryStream from '../src' helper('empty-query', function (client) { it('handles empty query', function (done) { const stream = new QueryStream('-- this is a comment', []) const query = client.query(stream) query .on('end', function () { // nothing should happen for empty query done() }) .on('data', function () { // noop to kick off reading }) }) it('continues to function after stream', function (done) { client.query('SELECT NOW()', done) }) }) node-postgres-pg-8.14.1/packages/pg-query-stream/test/error.ts000066400000000000000000000126761476604072200243260ustar00rootroot00000000000000import assert from 'assert' import helper from './helper' import QueryStream from '../src' import { Pool, Client } from 'pg' helper('error', function (client) { it('receives error on stream', function (done) { const stream = new QueryStream('SELECT * FROM asdf num', []) const query = client.query(stream) query .on('error', function (err) { assert(err) assert.equal(err.code, '42P01') done() }) .on('data', function () { // noop to kick of reading }) }) it('continues to function after stream', function (done) { client.query('SELECT NOW()', done) }) }) describe('error recovery', () => { // created from https://github.com/chrisdickinson/pg-test-case it('recovers from a streaming error in a transaction', async () => { const pool = new Pool() const client = await pool.connect() await client.query(`CREATE TEMP TABLE frobnicators ( id serial primary key, updated timestamp )`) await client.query(`BEGIN;`) const query = new QueryStream(`INSERT INTO frobnicators ("updated") VALUES ($1) RETURNING "id"`, [Date.now()]) let error: Error | undefined = undefined query.on('data', console.log).on('error', (e) => { error = e }) client.query(query) // useless callback necessitated by an older version of honeycomb-beeline await client.query(`ROLLBACK`) assert(error, 'Error should not be undefined') const { rows } = await client.query('SELECT NOW()') assert.strictEqual(rows.length, 1) client.release() const client2 = await pool.connect() await client2.query(`BEGIN`) client2.release() pool.end() }) // created from https://github.com/brianc/node-postgres/pull/2333 it('handles an error on a stream after a plain text non-stream error', async () => { const client = new Client() const stmt = 'SELECT * FROM goose;' await client.connect() return new Promise((resolve, reject) => { client.query(stmt).catch((e) => { assert(e, 'Query should have rejected with an error') const stream = new QueryStream('SELECT * FROM duck') client.query(stream) stream.on('data', () => {}) stream.on('error', () => { client.end((err) => { err ? reject(err) : resolve() }) }) }) }) }) it('does not crash when closing a connection with a queued stream', async () => { const client = new Client() const stmt = 'SELECT * FROM goose;' await client.connect() return new Promise(async (resolve) => { let queryError: Error | undefined client.query(stmt).catch((e) => { queryError = e }) const stream = client.query(new QueryStream(stmt)) stream.on('data', () => {}) stream.on('error', () => { assert(queryError, 'query should have errored due to client ending') resolve() }) await client.end() }) }) it('should work if used after timeout error', async () => { const pool = new Pool({ max: 1, connectionTimeoutMillis: 400, statement_timeout: 400 }) const res1 = await pool.query('SELECT 1 AS a') assert.deepStrictEqual(res1.rows, [{ a: 1 }]) const query = new QueryStream('SELECT 2 AS b') const client = await pool.connect() const stream = await client.query(query) await assert.rejects(() => pool.query('SELECT TRUE'), { message: 'timeout exceeded when trying to connect' }) await stream.destroy() await client.release() const res2 = await pool.query('SELECT 4 AS d') assert.deepStrictEqual(res2.rows, [{ d: 4 }]) await pool.end() }) it('should work if used after syntax error', async () => { const pool = new Pool({ max: 1, statement_timeout: 100 }) // statement_timeout is required here, so maybe this is just another timeout error? const res1 = await pool.query('SELECT 1 AS a') assert.deepStrictEqual(res1.rows, [{ a: 1 }]) const query = new QueryStream('SELECT 2 AS b') const client = await pool.connect() const stream = await client.query(query) await new Promise((resolve) => setTimeout(resolve, 10)) await stream.destroy() await client.release() const res2 = await pool.query('SELECT 4 AS d') assert.deepStrictEqual(res2.rows, [{ d: 4 }]) await pool.end() }) it('should work after cancelling query', async () => { const pool = new Pool() const conn = await pool.connect() // Get connection PID for sake of pg_cancel_backend() call const result = await conn.query('SELECT pg_backend_pid() AS pid;') const { pid } = result.rows[0] const stream = conn.query(new QueryStream('SELECT pg_sleep(10);')) stream.on('data', (chunk) => { // Switches stream into readableFlowing === true mode }) stream.on('error', (err) => { // Errors are expected due to pg_cancel_backend() call }) // Create a promise that is resolved when the stream is closed const closed = new Promise((res) => { stream.on('close', res) }) // Wait 100ms before cancelling the query await new Promise((res) => setTimeout(res, 100)) // Cancel pg_sleep(10) query await pool.query('SELECT pg_cancel_backend($1);', [pid]) // Destroy stream and wait for it to be closed stream.destroy() await closed // Subsequent query on same connection should succeed const res = await conn.query('SELECT 1 AS a;') assert.deepStrictEqual(res.rows, [{ a: 1 }]) conn.release() await pool.end() }) }) node-postgres-pg-8.14.1/packages/pg-query-stream/test/fast-reader.ts000066400000000000000000000020401476604072200253520ustar00rootroot00000000000000import assert from 'assert' import helper from './helper' import QueryStream from '../src' helper('fast reader', function (client) { it('works', function (done) { const stream = new QueryStream('SELECT * FROM generate_series(0, 200) num', []) const query = client.query(stream) const result = [] stream.on('readable', function () { let res = stream.read() while (res) { if (result.length !== 201) { assert(res, 'should not return null on evented reader') } else { // a readable stream will emit a null datum when it finishes being readable // https://nodejs.org/api/stream.html#stream_event_readable assert.equal(res, null) } if (res) { result.push(res.num) } res = stream.read() } }) stream.on('end', function () { const total = result.reduce(function (prev, cur) { return prev + cur }) assert.equal(total, 20100) done() }) assert.strictEqual(query.read(2), null) }) }) node-postgres-pg-8.14.1/packages/pg-query-stream/test/helper.ts000066400000000000000000000004471476604072200244450ustar00rootroot00000000000000import pg from 'pg' export default function (name, cb) { describe(name, function () { const client = new pg.Client() before(function (done) { client.connect(done) }) cb(client) after(function (done) { client.end() client.on('end', done) }) }) } node-postgres-pg-8.14.1/packages/pg-query-stream/test/instant.ts000066400000000000000000000006431476604072200246440ustar00rootroot00000000000000import helper from './helper' import assert from 'assert' import concat from 'concat-stream' import QueryStream from '../src' helper('instant', function (client) { it('instant', function (done) { const query = new QueryStream('SELECT pg_sleep(1)', []) const stream = client.query(query) stream.pipe( concat(function (res) { assert.equal(res.length, 1) done() }) ) }) }) node-postgres-pg-8.14.1/packages/pg-query-stream/test/issue-3.ts000066400000000000000000000016661476604072200244620ustar00rootroot00000000000000import pg from 'pg' import QueryStream from '../src' describe('end semantics race condition', function () { before(function (done) { const client = new pg.Client() client.connect() client.on('drain', client.end.bind(client)) client.on('end', done) client.query('create table IF NOT EXISTS p(id serial primary key)') client.query('create table IF NOT EXISTS c(id int primary key references p)') }) it('works', function (done) { const client1 = new pg.Client() client1.connect() const client2 = new pg.Client() client2.connect() const qr = new QueryStream('INSERT INTO p DEFAULT VALUES RETURNING id') client1.query(qr) let id = null qr.on('data', function (row) { id = row.id }) qr.on('end', function () { client2.query('INSERT INTO c(id) VALUES ($1)', [id], function (err, rows) { client1.end() client2.end() done(err) }) }) }) }) node-postgres-pg-8.14.1/packages/pg-query-stream/test/passing-options.ts000066400000000000000000000021311476604072200263130ustar00rootroot00000000000000import assert from 'assert' import helper from './helper' import QueryStream from '../src' helper('passing options', function (client) { it('passes row mode array', function (done) { const stream = new QueryStream('SELECT * FROM generate_series(0, 10) num', [], { rowMode: 'array' }) const query = client.query(stream) const result = [] query.on('data', (datum) => { result.push(datum) }) query.on('end', () => { const expected = new Array(11).fill(0).map((_, i) => [i]) assert.deepEqual(result, expected) done() }) }) it('passes custom types', function (done) { const types = { getTypeParser: () => (string) => string, } const stream = new QueryStream('SELECT * FROM generate_series(0, 10) num', [], { types }) const query = client.query(stream) const result = [] query.on('data', (datum) => { result.push(datum) }) query.on('end', () => { const expected = new Array(11).fill(0).map((_, i) => ({ num: i.toString(), })) assert.deepEqual(result, expected) done() }) }) }) node-postgres-pg-8.14.1/packages/pg-query-stream/test/pauses.ts000066400000000000000000000015441476604072200244650ustar00rootroot00000000000000import helper from './helper' import concat from 'concat-stream' import JSONStream from 'JSONStream' import QueryStream from '../src' import { Transform } from 'stream' class PauseStream extends Transform { constructor() { super({ objectMode: true }) } _transform(chunk, encoding, callback): void { this.push(chunk, encoding) setTimeout(callback, 1) } } helper('pauses', function (client) { it('pauses', function (done) { this.timeout(5000) const stream = new QueryStream('SELECT * FROM generate_series(0, $1) num', [200], { batchSize: 2, highWaterMark: 2, }) const query = client.query(stream) const pauser = new PauseStream() query .pipe(JSONStream.stringify()) .pipe(pauser) .pipe( concat(function (json) { JSON.parse(json) done() }) ) }) }) node-postgres-pg-8.14.1/packages/pg-query-stream/test/slow-reader.ts000066400000000000000000000013071476604072200254060ustar00rootroot00000000000000import helper from './helper' import QueryStream from '../src' import concat from 'concat-stream' import { Transform } from 'stream' const mapper = new Transform({ objectMode: true }) mapper._transform = function (obj, enc, cb) { this.push(obj) setTimeout(cb, 5) } helper('slow reader', function (client) { it('works', function (done) { this.timeout(50000) const stream = new QueryStream('SELECT * FROM generate_series(0, 201) num', [], { highWaterMark: 100, batchSize: 50, }) stream.on('end', function () { // console.log('stream end') }) client.query(stream) stream.pipe(mapper).pipe( concat(function (res) { done() }) ) }) }) node-postgres-pg-8.14.1/packages/pg-query-stream/test/stream-tester-timestamp.ts000066400000000000000000000014461476604072200277660ustar00rootroot00000000000000import helper from './helper' import QueryStream from '../src' import spec from 'stream-spec' import assert from 'assert' helper('stream tester timestamp', function (client) { it('should not warn about max listeners', function (done) { const sql = "SELECT * FROM generate_series('1983-12-30 00:00'::timestamp, '2013-12-30 00:00', '1 years')" const stream = new QueryStream(sql, []) let ended = false const query = client.query(stream) query.on('end', function () { ended = true }) spec(query).readable().pausable({ strict: true }).validateOnExit() const checkListeners = function () { assert(stream.listeners('end').length < 10) if (!ended) { setImmediate(checkListeners) } else { done() } } checkListeners() }) }) node-postgres-pg-8.14.1/packages/pg-query-stream/test/stream-tester.ts000066400000000000000000000006351476604072200257640ustar00rootroot00000000000000import spec from 'stream-spec' import helper from './helper' import QueryStream from '../src' helper('stream tester', function (client) { it('passes stream spec', function (done) { const stream = new QueryStream('SELECT * FROM generate_series(0, 200) num', []) const query = client.query(stream) spec(query).readable().pausable({ strict: true }).validateOnExit() stream.on('end', done) }) }) node-postgres-pg-8.14.1/packages/pg-query-stream/tsconfig.json000066400000000000000000000007331476604072200243440ustar00rootroot00000000000000{ "compilerOptions": { "module": "commonjs", "esModuleInterop": true, "allowSyntheticDefaultImports": true, "strict": false, "target": "es6", "noImplicitAny": false, "moduleResolution": "node", "sourceMap": true, "pretty": true, "outDir": "dist", "incremental": true, "baseUrl": ".", "declaration": true, "types": [ "node", "pg", "mocha", "chai" ] }, "include": [ "src/**/*" ] } node-postgres-pg-8.14.1/packages/pg/000077500000000000000000000000001476604072200171765ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg/Makefile000066400000000000000000000025751476604072200206470ustar00rootroot00000000000000SHELL := /bin/sh connectionString=postgres:// params := $(connectionString) node-command := xargs -n 1 -I file node file $(params) .PHONY : test test-connection test-integration bench test-native \ publish update-npm all: npm install help: @echo "make test-all [connectionString=postgres://]" test: test-unit test-all: test-unit test-integration test-native test-worker update-npm: @npm i npm --global bench: @find benchmark -name "*-bench.js" | $(node-command) test-unit: @find test/unit -name "*-tests.js" | $(node-command) test-connection: @echo "***Testing connection***" @node script/create-test-tables.js $(params) test-native: test-connection @echo "***Testing native bindings***" ifeq ($(TEST_SKIP_NATIVE), true) @echo "***Skipping tests***" else @find test/native -name "*-tests.js" | $(node-command) @find test/integration -name "*-tests.js" | $(node-command) native endif test-integration: test-connection @echo "***Testing Pure Javascript***" @find test/integration -name "*-tests.js" | $(node-command) test-binary: test-connection @echo "***Testing Pure Javascript (binary)***" @find test/integration -name "*-tests.js" | $(node-command) binary test-pool: @find test/integration/connection-pool -name "*.js" | $(node-command) binary test-worker: @echo "***Testing Cloudflare Worker support***" @node test/worker/src/index.test.js node-postgres-pg-8.14.1/packages/pg/README.md000066400000000000000000000077631476604072200204720ustar00rootroot00000000000000# node-postgres [![Build Status](https://secure.travis-ci.org/brianc/node-postgres.svg?branch=master)](http://travis-ci.org/brianc/node-postgres) NPM version NPM downloads Non-blocking PostgreSQL client for Node.js. Pure JavaScript and optional native libpq bindings. ## Install ```sh $ npm install pg ``` --- ## :star: [Documentation](https://node-postgres.com) :star: ### Features - Pure JavaScript client and native libpq bindings share _the same API_ - Connection pooling - Extensible JS ↔ PostgreSQL data-type coercion - Supported PostgreSQL features - Parameterized queries - Named statements with query plan caching - Async notifications with `LISTEN/NOTIFY` - Bulk import & export with `COPY TO/COPY FROM` ### Extras node-postgres is by design pretty light on abstractions. These are some handy modules we've been using over the years to complete the picture. The entire list can be found on our [wiki](https://github.com/brianc/node-postgres/wiki/Extras). ## Support node-postgres is free software. If you encounter a bug with the library please open an issue on the [GitHub repo](https://github.com/brianc/node-postgres). If you have questions unanswered by the documentation please open an issue pointing out how the documentation was unclear & I will do my best to make it better! When you open an issue please provide: - version of Node - version of Postgres - smallest possible snippet of code to reproduce the problem You can also follow me [@briancarlson](https://twitter.com/briancarlson) if that's your thing. I try to always announce noteworthy changes & developments with node-postgres on Twitter. ## Sponsorship :two_hearts: node-postgres's continued development has been made possible in part by generous finanical support from [the community](https://github.com/brianc/node-postgres/blob/master/SPONSORS.md). If you or your company are benefiting from node-postgres and would like to help keep the project financially sustainable [please consider supporting](https://github.com/sponsors/brianc) its development. ## Contributing **:heart: contributions!** I will **happily** accept your pull request if it: - **has tests** - looks reasonable - does not break backwards compatibility If your change involves breaking backwards compatibility please please point that out in the pull request & we can discuss & plan when and how to release it and what type of documentation or communicate it will require. ## Troubleshooting and FAQ The causes and solutions to common errors can be found among the [Frequently Asked Questions (FAQ)](https://github.com/brianc/node-postgres/wiki/FAQ) ## License Copyright (c) 2010-2020 Brian Carlson (brian.m.carlson@gmail.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. node-postgres-pg-8.14.1/packages/pg/bench.js000066400000000000000000000053551476604072200206230ustar00rootroot00000000000000const pg = require('./lib') const params = { text: 'select typname, typnamespace, typowner, typlen, typbyval, typcategory, typispreferred, typisdefined, typdelim, typrelid, typelem, typarray from pg_type where typtypmod = $1 and typisdefined = $2', values: [-1, true], } const insert = { text: 'INSERT INTO foobar(name, age) VALUES ($1, $2)', values: ['brian', 100], } const seq = { text: 'SELECT * FROM generate_series(1, 1000)', } const exec = async (client, q) => { await client.query({ text: q.text, values: q.values, rowMode: 'array', }) } const bench = async (client, q, time) => { let start = Date.now() let count = 0 while (true) { await exec(client, q) count++ if (Date.now() - start > time) { return count } } } const run = async () => { const client = new pg.Client() await client.connect() console.log('start') await client.query('CREATE TEMP TABLE foobar(name TEXT, age NUMERIC)') await client.query('CREATE TEMP TABLE buf(name TEXT, data BYTEA)') await bench(client, params, 1000) console.log('warmup done') const seconds = 5 for (let i = 0; i < 4; i++) { let queries = await bench(client, params, seconds * 1000) console.log('') console.log('param queries:', queries) console.log('qps', queries / seconds) console.log('on my laptop best so far seen 987 qps') queries = await bench(client, { ...params, name: 'params' }, seconds * 1000) console.log('') console.log('named queries:', queries) console.log('qps', queries / seconds) console.log('on my laptop best so far seen 937 qps') console.log('') queries = await bench(client, seq, seconds * 1000) console.log('sequence queries:', queries) console.log('qps', queries / seconds) console.log('on my laptop best so far seen 2725 qps') console.log('') queries = await bench(client, insert, seconds * 1000) console.log('insert queries:', queries) console.log('qps', queries / seconds) console.log('on my laptop best so far seen 27383 qps') console.log('') console.log('Warming up bytea test') await client.query({ text: 'INSERT INTO buf(name, data) VALUES ($1, $2)', values: ['test', Buffer.allocUnsafe(104857600)], }) console.log('bytea warmup done') const start = Date.now() const results = await client.query('SELECT * FROM buf') const time = Date.now() - start console.log('bytea time:', time, 'ms') console.log('bytea length:', results.rows[0].data.byteLength, 'bytes') console.log('on my laptop best so far seen 1407ms and 104857600 bytes') await new Promise((resolve) => setTimeout(resolve, 250)) } await client.end() await client.end() } run().catch((e) => console.error(e) || process.exit(-1)) node-postgres-pg-8.14.1/packages/pg/lib/000077500000000000000000000000001476604072200177445ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg/lib/client.js000066400000000000000000000444461476604072200215740ustar00rootroot00000000000000'use strict' var EventEmitter = require('events').EventEmitter var utils = require('./utils') var sasl = require('./crypto/sasl') var TypeOverrides = require('./type-overrides') var ConnectionParameters = require('./connection-parameters') var Query = require('./query') var defaults = require('./defaults') var Connection = require('./connection') const crypto = require('./crypto/utils') class Client extends EventEmitter { constructor(config) { super() this.connectionParameters = new ConnectionParameters(config) this.user = this.connectionParameters.user this.database = this.connectionParameters.database this.port = this.connectionParameters.port this.host = this.connectionParameters.host // "hiding" the password so it doesn't show up in stack traces // or if the client is console.logged Object.defineProperty(this, 'password', { configurable: true, enumerable: false, writable: true, value: this.connectionParameters.password, }) this.replication = this.connectionParameters.replication var c = config || {} this._Promise = c.Promise || global.Promise this._types = new TypeOverrides(c.types) this._ending = false this._ended = false this._connecting = false this._connected = false this._connectionError = false this._queryable = true this.enableChannelBinding = Boolean(c.enableChannelBinding) // set true to use SCRAM-SHA-256-PLUS when offered this.connection = c.connection || new Connection({ stream: c.stream, ssl: this.connectionParameters.ssl, keepAlive: c.keepAlive || false, keepAliveInitialDelayMillis: c.keepAliveInitialDelayMillis || 0, encoding: this.connectionParameters.client_encoding || 'utf8', }) this.queryQueue = [] this.binary = c.binary || defaults.binary this.processID = null this.secretKey = null this.ssl = this.connectionParameters.ssl || false // As with Password, make SSL->Key (the private key) non-enumerable. // It won't show up in stack traces // or if the client is console.logged if (this.ssl && this.ssl.key) { Object.defineProperty(this.ssl, 'key', { enumerable: false, }) } this._connectionTimeoutMillis = c.connectionTimeoutMillis || 0 } _errorAllQueries(err) { const enqueueError = (query) => { process.nextTick(() => { query.handleError(err, this.connection) }) } if (this.activeQuery) { enqueueError(this.activeQuery) this.activeQuery = null } this.queryQueue.forEach(enqueueError) this.queryQueue.length = 0 } _connect(callback) { var self = this var con = this.connection this._connectionCallback = callback if (this._connecting || this._connected) { const err = new Error('Client has already been connected. You cannot reuse a client.') process.nextTick(() => { callback(err) }) return } this._connecting = true if (this._connectionTimeoutMillis > 0) { this.connectionTimeoutHandle = setTimeout(() => { con._ending = true con.stream.destroy(new Error('timeout expired')) }, this._connectionTimeoutMillis) if (this.connectionTimeoutHandle.unref) { this.connectionTimeoutHandle.unref() } } if (this.host && this.host.indexOf('/') === 0) { con.connect(this.host + '/.s.PGSQL.' + this.port) } else { con.connect(this.port, this.host) } // once connection is established send startup message con.on('connect', function () { if (self.ssl) { con.requestSsl() } else { con.startup(self.getStartupConf()) } }) con.on('sslconnect', function () { con.startup(self.getStartupConf()) }) this._attachListeners(con) con.once('end', () => { const error = this._ending ? new Error('Connection terminated') : new Error('Connection terminated unexpectedly') clearTimeout(this.connectionTimeoutHandle) this._errorAllQueries(error) this._ended = true if (!this._ending) { // if the connection is ended without us calling .end() // on this client then we have an unexpected disconnection // treat this as an error unless we've already emitted an error // during connection. if (this._connecting && !this._connectionError) { if (this._connectionCallback) { this._connectionCallback(error) } else { this._handleErrorEvent(error) } } else if (!this._connectionError) { this._handleErrorEvent(error) } } process.nextTick(() => { this.emit('end') }) }) } connect(callback) { if (callback) { this._connect(callback) return } return new this._Promise((resolve, reject) => { this._connect((error) => { if (error) { reject(error) } else { resolve() } }) }) } _attachListeners(con) { // password request handling con.on('authenticationCleartextPassword', this._handleAuthCleartextPassword.bind(this)) // password request handling con.on('authenticationMD5Password', this._handleAuthMD5Password.bind(this)) // password request handling (SASL) con.on('authenticationSASL', this._handleAuthSASL.bind(this)) con.on('authenticationSASLContinue', this._handleAuthSASLContinue.bind(this)) con.on('authenticationSASLFinal', this._handleAuthSASLFinal.bind(this)) con.on('backendKeyData', this._handleBackendKeyData.bind(this)) con.on('error', this._handleErrorEvent.bind(this)) con.on('errorMessage', this._handleErrorMessage.bind(this)) con.on('readyForQuery', this._handleReadyForQuery.bind(this)) con.on('notice', this._handleNotice.bind(this)) con.on('rowDescription', this._handleRowDescription.bind(this)) con.on('dataRow', this._handleDataRow.bind(this)) con.on('portalSuspended', this._handlePortalSuspended.bind(this)) con.on('emptyQuery', this._handleEmptyQuery.bind(this)) con.on('commandComplete', this._handleCommandComplete.bind(this)) con.on('parseComplete', this._handleParseComplete.bind(this)) con.on('copyInResponse', this._handleCopyInResponse.bind(this)) con.on('copyData', this._handleCopyData.bind(this)) con.on('notification', this._handleNotification.bind(this)) } // TODO(bmc): deprecate pgpass "built in" integration since this.password can be a function // it can be supplied by the user if required - this is a breaking change! _checkPgPass(cb) { const con = this.connection if (typeof this.password === 'function') { this._Promise .resolve() .then(() => this.password()) .then((pass) => { if (pass !== undefined) { if (typeof pass !== 'string') { con.emit('error', new TypeError('Password must be a string')) return } this.connectionParameters.password = this.password = pass } else { this.connectionParameters.password = this.password = null } cb() }) .catch((err) => { con.emit('error', err) }) } else if (this.password !== null) { cb() } else { try { const pgPass = require('pgpass') pgPass(this.connectionParameters, (pass) => { if (undefined !== pass) { this.connectionParameters.password = this.password = pass } cb() }) } catch (e) { this.emit('error', e) } } } _handleAuthCleartextPassword(msg) { this._checkPgPass(() => { this.connection.password(this.password) }) } _handleAuthMD5Password(msg) { this._checkPgPass(async () => { try { const hashedPassword = await crypto.postgresMd5PasswordHash(this.user, this.password, msg.salt) this.connection.password(hashedPassword) } catch (e) { this.emit('error', e) } }) } _handleAuthSASL(msg) { this._checkPgPass(() => { try { this.saslSession = sasl.startSession(msg.mechanisms, this.enableChannelBinding && this.connection.stream) this.connection.sendSASLInitialResponseMessage(this.saslSession.mechanism, this.saslSession.response) } catch (err) { this.connection.emit('error', err) } }) } async _handleAuthSASLContinue(msg) { try { await sasl.continueSession( this.saslSession, this.password, msg.data, this.enableChannelBinding && this.connection.stream ) this.connection.sendSCRAMClientFinalMessage(this.saslSession.response) } catch (err) { this.connection.emit('error', err) } } _handleAuthSASLFinal(msg) { try { sasl.finalizeSession(this.saslSession, msg.data) this.saslSession = null } catch (err) { this.connection.emit('error', err) } } _handleBackendKeyData(msg) { this.processID = msg.processID this.secretKey = msg.secretKey } _handleReadyForQuery(msg) { if (this._connecting) { this._connecting = false this._connected = true clearTimeout(this.connectionTimeoutHandle) // process possible callback argument to Client#connect if (this._connectionCallback) { this._connectionCallback(null, this) // remove callback for proper error handling // after the connect event this._connectionCallback = null } this.emit('connect') } const { activeQuery } = this this.activeQuery = null this.readyForQuery = true if (activeQuery) { activeQuery.handleReadyForQuery(this.connection) } this._pulseQueryQueue() } // if we receieve an error event or error message // during the connection process we handle it here _handleErrorWhileConnecting(err) { if (this._connectionError) { // TODO(bmc): this is swallowing errors - we shouldn't do this return } this._connectionError = true clearTimeout(this.connectionTimeoutHandle) if (this._connectionCallback) { return this._connectionCallback(err) } this.emit('error', err) } // if we're connected and we receive an error event from the connection // this means the socket is dead - do a hard abort of all queries and emit // the socket error on the client as well _handleErrorEvent(err) { if (this._connecting) { return this._handleErrorWhileConnecting(err) } this._queryable = false this._errorAllQueries(err) this.emit('error', err) } // handle error messages from the postgres backend _handleErrorMessage(msg) { if (this._connecting) { return this._handleErrorWhileConnecting(msg) } const activeQuery = this.activeQuery if (!activeQuery) { this._handleErrorEvent(msg) return } this.activeQuery = null activeQuery.handleError(msg, this.connection) } _handleRowDescription(msg) { // delegate rowDescription to active query this.activeQuery.handleRowDescription(msg) } _handleDataRow(msg) { // delegate dataRow to active query this.activeQuery.handleDataRow(msg) } _handlePortalSuspended(msg) { // delegate portalSuspended to active query this.activeQuery.handlePortalSuspended(this.connection) } _handleEmptyQuery(msg) { // delegate emptyQuery to active query this.activeQuery.handleEmptyQuery(this.connection) } _handleCommandComplete(msg) { if (this.activeQuery == null) { const error = new Error('Received unexpected commandComplete message from backend.') this._handleErrorEvent(error) return } // delegate commandComplete to active query this.activeQuery.handleCommandComplete(msg, this.connection) } _handleParseComplete() { if (this.activeQuery == null) { const error = new Error('Received unexpected parseComplete message from backend.') this._handleErrorEvent(error) return } // if a prepared statement has a name and properly parses // we track that its already been executed so we don't parse // it again on the same client if (this.activeQuery.name) { this.connection.parsedStatements[this.activeQuery.name] = this.activeQuery.text } } _handleCopyInResponse(msg) { this.activeQuery.handleCopyInResponse(this.connection) } _handleCopyData(msg) { this.activeQuery.handleCopyData(msg, this.connection) } _handleNotification(msg) { this.emit('notification', msg) } _handleNotice(msg) { this.emit('notice', msg) } getStartupConf() { var params = this.connectionParameters var data = { user: params.user, database: params.database, } var appName = params.application_name || params.fallback_application_name if (appName) { data.application_name = appName } if (params.replication) { data.replication = '' + params.replication } if (params.statement_timeout) { data.statement_timeout = String(parseInt(params.statement_timeout, 10)) } if (params.lock_timeout) { data.lock_timeout = String(parseInt(params.lock_timeout, 10)) } if (params.idle_in_transaction_session_timeout) { data.idle_in_transaction_session_timeout = String(parseInt(params.idle_in_transaction_session_timeout, 10)) } if (params.options) { data.options = params.options } return data } cancel(client, query) { if (client.activeQuery === query) { var con = this.connection if (this.host && this.host.indexOf('/') === 0) { con.connect(this.host + '/.s.PGSQL.' + this.port) } else { con.connect(this.port, this.host) } // once connection is established send cancel message con.on('connect', function () { con.cancel(client.processID, client.secretKey) }) } else if (client.queryQueue.indexOf(query) !== -1) { client.queryQueue.splice(client.queryQueue.indexOf(query), 1) } } setTypeParser(oid, format, parseFn) { return this._types.setTypeParser(oid, format, parseFn) } getTypeParser(oid, format) { return this._types.getTypeParser(oid, format) } // escapeIdentifier and escapeLiteral moved to utility functions & exported // on PG // re-exported here for backwards compatibility escapeIdentifier(str) { return utils.escapeIdentifier(str) } escapeLiteral(str) { return utils.escapeLiteral(str) } _pulseQueryQueue() { if (this.readyForQuery === true) { this.activeQuery = this.queryQueue.shift() if (this.activeQuery) { this.readyForQuery = false this.hasExecuted = true const queryError = this.activeQuery.submit(this.connection) if (queryError) { process.nextTick(() => { this.activeQuery.handleError(queryError, this.connection) this.readyForQuery = true this._pulseQueryQueue() }) } } else if (this.hasExecuted) { this.activeQuery = null this.emit('drain') } } } query(config, values, callback) { // can take in strings, config object or query object var query var result var readTimeout var readTimeoutTimer var queryCallback if (config === null || config === undefined) { throw new TypeError('Client was passed a null or undefined query') } else if (typeof config.submit === 'function') { readTimeout = config.query_timeout || this.connectionParameters.query_timeout result = query = config if (typeof values === 'function') { query.callback = query.callback || values } } else { readTimeout = config.query_timeout || this.connectionParameters.query_timeout query = new Query(config, values, callback) if (!query.callback) { result = new this._Promise((resolve, reject) => { query.callback = (err, res) => (err ? reject(err) : resolve(res)) }).catch((err) => { // replace the stack trace that leads to `TCP.onStreamRead` with one that leads back to the // application that created the query Error.captureStackTrace(err) throw err }) } } if (readTimeout) { queryCallback = query.callback readTimeoutTimer = setTimeout(() => { var error = new Error('Query read timeout') process.nextTick(() => { query.handleError(error, this.connection) }) queryCallback(error) // we already returned an error, // just do nothing if query completes query.callback = () => {} // Remove from queue var index = this.queryQueue.indexOf(query) if (index > -1) { this.queryQueue.splice(index, 1) } this._pulseQueryQueue() }, readTimeout) query.callback = (err, res) => { clearTimeout(readTimeoutTimer) queryCallback(err, res) } } if (this.binary && !query.binary) { query.binary = true } if (query._result && !query._result._types) { query._result._types = this._types } if (!this._queryable) { process.nextTick(() => { query.handleError(new Error('Client has encountered a connection error and is not queryable'), this.connection) }) return result } if (this._ending) { process.nextTick(() => { query.handleError(new Error('Client was closed and is not queryable'), this.connection) }) return result } this.queryQueue.push(query) this._pulseQueryQueue() return result } ref() { this.connection.ref() } unref() { this.connection.unref() } end(cb) { this._ending = true // if we have never connected, then end is a noop, callback immediately if (!this.connection._connecting || this._ended) { if (cb) { cb() } else { return this._Promise.resolve() } } if (this.activeQuery || !this._queryable) { // if we have an active query we need to force a disconnect // on the socket - otherwise a hung query could block end forever this.connection.stream.destroy() } else { this.connection.end() } if (cb) { this.connection.once('end', cb) } else { return new this._Promise((resolve) => { this.connection.once('end', resolve) }) } } } // expose a Query constructor Client.Query = Query module.exports = Client node-postgres-pg-8.14.1/packages/pg/lib/connection-parameters.js000066400000000000000000000121541476604072200246050ustar00rootroot00000000000000'use strict' var dns = require('dns') var defaults = require('./defaults') var parse = require('pg-connection-string').parse // parses a connection string var val = function (key, config, envVar) { if (envVar === undefined) { envVar = process.env['PG' + key.toUpperCase()] } else if (envVar === false) { // do nothing ... use false } else { envVar = process.env[envVar] } return config[key] || envVar || defaults[key] } var readSSLConfigFromEnvironment = function () { switch (process.env.PGSSLMODE) { case 'disable': return false case 'prefer': case 'require': case 'verify-ca': case 'verify-full': return true case 'no-verify': return { rejectUnauthorized: false } } return defaults.ssl } // Convert arg to a string, surround in single quotes, and escape single quotes and backslashes var quoteParamValue = function (value) { return "'" + ('' + value).replace(/\\/g, '\\\\').replace(/'/g, "\\'") + "'" } var add = function (params, config, paramName) { var value = config[paramName] if (value !== undefined && value !== null) { params.push(paramName + '=' + quoteParamValue(value)) } } class ConnectionParameters { constructor(config) { // if a string is passed, it is a raw connection string so we parse it into a config config = typeof config === 'string' ? parse(config) : config || {} // if the config has a connectionString defined, parse IT into the config we use // this will override other default values with what is stored in connectionString if (config.connectionString) { config = Object.assign({}, config, parse(config.connectionString)) } this.user = val('user', config) this.database = val('database', config) if (this.database === undefined) { this.database = this.user } this.port = parseInt(val('port', config), 10) this.host = val('host', config) // "hiding" the password so it doesn't show up in stack traces // or if the client is console.logged Object.defineProperty(this, 'password', { configurable: true, enumerable: false, writable: true, value: val('password', config), }) this.binary = val('binary', config) this.options = val('options', config) this.ssl = typeof config.ssl === 'undefined' ? readSSLConfigFromEnvironment() : config.ssl if (typeof this.ssl === 'string') { if (this.ssl === 'true') { this.ssl = true } } // support passing in ssl=no-verify via connection string if (this.ssl === 'no-verify') { this.ssl = { rejectUnauthorized: false } } if (this.ssl && this.ssl.key) { Object.defineProperty(this.ssl, 'key', { enumerable: false, }) } this.client_encoding = val('client_encoding', config) this.replication = val('replication', config) // a domain socket begins with '/' this.isDomainSocket = !(this.host || '').indexOf('/') this.application_name = val('application_name', config, 'PGAPPNAME') this.fallback_application_name = val('fallback_application_name', config, false) this.statement_timeout = val('statement_timeout', config, false) this.lock_timeout = val('lock_timeout', config, false) this.idle_in_transaction_session_timeout = val('idle_in_transaction_session_timeout', config, false) this.query_timeout = val('query_timeout', config, false) if (config.connectionTimeoutMillis === undefined) { this.connect_timeout = process.env.PGCONNECT_TIMEOUT || 0 } else { this.connect_timeout = Math.floor(config.connectionTimeoutMillis / 1000) } if (config.keepAlive === false) { this.keepalives = 0 } else if (config.keepAlive === true) { this.keepalives = 1 } if (typeof config.keepAliveInitialDelayMillis === 'number') { this.keepalives_idle = Math.floor(config.keepAliveInitialDelayMillis / 1000) } } getLibpqConnectionString(cb) { var params = [] add(params, this, 'user') add(params, this, 'password') add(params, this, 'port') add(params, this, 'application_name') add(params, this, 'fallback_application_name') add(params, this, 'connect_timeout') add(params, this, 'options') var ssl = typeof this.ssl === 'object' ? this.ssl : this.ssl ? { sslmode: this.ssl } : {} add(params, ssl, 'sslmode') add(params, ssl, 'sslca') add(params, ssl, 'sslkey') add(params, ssl, 'sslcert') add(params, ssl, 'sslrootcert') if (this.database) { params.push('dbname=' + quoteParamValue(this.database)) } if (this.replication) { params.push('replication=' + quoteParamValue(this.replication)) } if (this.host) { params.push('host=' + quoteParamValue(this.host)) } if (this.isDomainSocket) { return cb(null, params.join(' ')) } if (this.client_encoding) { params.push('client_encoding=' + quoteParamValue(this.client_encoding)) } dns.lookup(this.host, function (err, address) { if (err) return cb(err, null) params.push('hostaddr=' + quoteParamValue(address)) return cb(null, params.join(' ')) }) } } module.exports = ConnectionParameters node-postgres-pg-8.14.1/packages/pg/lib/connection.js000066400000000000000000000120531476604072200224420ustar00rootroot00000000000000'use strict' var EventEmitter = require('events').EventEmitter const { parse, serialize } = require('pg-protocol') const { getStream, getSecureStream } = require('./stream') const flushBuffer = serialize.flush() const syncBuffer = serialize.sync() const endBuffer = serialize.end() // TODO(bmc) support binary mode at some point class Connection extends EventEmitter { constructor(config) { super() config = config || {} this.stream = config.stream || getStream(config.ssl) if (typeof this.stream === 'function') { this.stream = this.stream(config) } this._keepAlive = config.keepAlive this._keepAliveInitialDelayMillis = config.keepAliveInitialDelayMillis this.lastBuffer = false this.parsedStatements = {} this.ssl = config.ssl || false this._ending = false this._emitMessage = false var self = this this.on('newListener', function (eventName) { if (eventName === 'message') { self._emitMessage = true } }) } connect(port, host) { var self = this this._connecting = true this.stream.setNoDelay(true) this.stream.connect(port, host) this.stream.once('connect', function () { if (self._keepAlive) { self.stream.setKeepAlive(true, self._keepAliveInitialDelayMillis) } self.emit('connect') }) const reportStreamError = function (error) { // errors about disconnections should be ignored during disconnect if (self._ending && (error.code === 'ECONNRESET' || error.code === 'EPIPE')) { return } self.emit('error', error) } this.stream.on('error', reportStreamError) this.stream.on('close', function () { self.emit('end') }) if (!this.ssl) { return this.attachListeners(this.stream) } this.stream.once('data', function (buffer) { var responseCode = buffer.toString('utf8') switch (responseCode) { case 'S': // Server supports SSL connections, continue with a secure connection break case 'N': // Server does not support SSL connections self.stream.end() return self.emit('error', new Error('The server does not support SSL connections')) default: // Any other response byte, including 'E' (ErrorResponse) indicating a server error self.stream.end() return self.emit('error', new Error('There was an error establishing an SSL connection')) } const options = { socket: self.stream, } if (self.ssl !== true) { Object.assign(options, self.ssl) if ('key' in self.ssl) { options.key = self.ssl.key } } var net = require('net') if (net.isIP && net.isIP(host) === 0) { options.servername = host } try { self.stream = getSecureStream(options) } catch (err) { return self.emit('error', err) } self.attachListeners(self.stream) self.stream.on('error', reportStreamError) self.emit('sslconnect') }) } attachListeners(stream) { parse(stream, (msg) => { var eventName = msg.name === 'error' ? 'errorMessage' : msg.name if (this._emitMessage) { this.emit('message', msg) } this.emit(eventName, msg) }) } requestSsl() { this.stream.write(serialize.requestSsl()) } startup(config) { this.stream.write(serialize.startup(config)) } cancel(processID, secretKey) { this._send(serialize.cancel(processID, secretKey)) } password(password) { this._send(serialize.password(password)) } sendSASLInitialResponseMessage(mechanism, initialResponse) { this._send(serialize.sendSASLInitialResponseMessage(mechanism, initialResponse)) } sendSCRAMClientFinalMessage(additionalData) { this._send(serialize.sendSCRAMClientFinalMessage(additionalData)) } _send(buffer) { if (!this.stream.writable) { return false } return this.stream.write(buffer) } query(text) { this._send(serialize.query(text)) } // send parse message parse(query) { this._send(serialize.parse(query)) } // send bind message bind(config) { this._send(serialize.bind(config)) } // send execute message execute(config) { this._send(serialize.execute(config)) } flush() { if (this.stream.writable) { this.stream.write(flushBuffer) } } sync() { this._ending = true this._send(syncBuffer) } ref() { this.stream.ref() } unref() { this.stream.unref() } end() { // 0x58 = 'X' this._ending = true if (!this._connecting || !this.stream.writable) { this.stream.end() return } return this.stream.write(endBuffer, () => { this.stream.end() }) } close(msg) { this._send(serialize.close(msg)) } describe(msg) { this._send(serialize.describe(msg)) } sendCopyFromChunk(chunk) { this._send(serialize.copyData(chunk)) } endCopyFrom() { this._send(serialize.copyDone()) } sendCopyFail(msg) { this._send(serialize.copyFail(msg)) } } module.exports = Connection node-postgres-pg-8.14.1/packages/pg/lib/crypto/000077500000000000000000000000001476604072200212645ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg/lib/crypto/cert-signatures.js000066400000000000000000000077071476604072200247540ustar00rootroot00000000000000function x509Error(msg, cert) { throw new Error('SASL channel binding: ' + msg + ' when parsing public certificate ' + cert.toString('base64')) } function readASN1Length(data, index) { let length = data[index++] if (length < 0x80) return { length, index } const lengthBytes = length & 0x7f if (lengthBytes > 4) x509Error('bad length', data) length = 0 for (let i = 0; i < lengthBytes; i++) { length = (length << 8) | data[index++] } return { length, index } } function readASN1OID(data, index) { if (data[index++] !== 0x6) x509Error('non-OID data', data) // 6 = OID const { length: OIDLength, index: indexAfterOIDLength } = readASN1Length(data, index) index = indexAfterOIDLength lastIndex = index + OIDLength const byte1 = data[index++] let oid = ((byte1 / 40) >> 0) + '.' + (byte1 % 40) while (index < lastIndex) { // loop over numbers in OID let value = 0 while (index < lastIndex) { // loop over bytes in number const nextByte = data[index++] value = (value << 7) | (nextByte & 0x7f) if (nextByte < 0x80) break } oid += '.' + value } return { oid, index } } function expectASN1Seq(data, index) { if (data[index++] !== 0x30) x509Error('non-sequence data', data) // 30 = Sequence return readASN1Length(data, index) } function signatureAlgorithmHashFromCertificate(data, index) { // read this thread: https://www.postgresql.org/message-id/17760-b6c61e752ec07060%40postgresql.org if (index === undefined) index = 0 index = expectASN1Seq(data, index).index const { length: certInfoLength, index: indexAfterCertInfoLength } = expectASN1Seq(data, index) index = indexAfterCertInfoLength + certInfoLength // skip over certificate info index = expectASN1Seq(data, index).index // skip over signature length field const { oid, index: indexAfterOID } = readASN1OID(data, index) switch (oid) { // RSA case '1.2.840.113549.1.1.4': return 'MD5' case '1.2.840.113549.1.1.5': return 'SHA-1' case '1.2.840.113549.1.1.11': return 'SHA-256' case '1.2.840.113549.1.1.12': return 'SHA-384' case '1.2.840.113549.1.1.13': return 'SHA-512' case '1.2.840.113549.1.1.14': return 'SHA-224' case '1.2.840.113549.1.1.15': return 'SHA512-224' case '1.2.840.113549.1.1.16': return 'SHA512-256' // ECDSA case '1.2.840.10045.4.1': return 'SHA-1' case '1.2.840.10045.4.3.1': return 'SHA-224' case '1.2.840.10045.4.3.2': return 'SHA-256' case '1.2.840.10045.4.3.3': return 'SHA-384' case '1.2.840.10045.4.3.4': return 'SHA-512' // RSASSA-PSS: hash is indicated separately case '1.2.840.113549.1.1.10': index = indexAfterOID index = expectASN1Seq(data, index).index if (data[index++] !== 0xa0) x509Error('non-tag data', data) // a0 = constructed tag 0 index = readASN1Length(data, index).index // skip over tag length field index = expectASN1Seq(data, index).index // skip over sequence length field const { oid: hashOID } = readASN1OID(data, index) switch (hashOID) { // standalone hash OIDs case '1.2.840.113549.2.5': return 'MD5' case '1.3.14.3.2.26': return 'SHA-1' case '2.16.840.1.101.3.4.2.1': return 'SHA-256' case '2.16.840.1.101.3.4.2.2': return 'SHA-384' case '2.16.840.1.101.3.4.2.3': return 'SHA-512' } x509Error('unknown hash OID ' + hashOID, data) // Ed25519 -- see https: return//github.com/openssl/openssl/issues/15477 case '1.3.101.110': case '1.3.101.112': // ph return 'SHA-512' // Ed448 -- still not in pg 17.2 (if supported, digest would be SHAKE256 x 64 bytes) case '1.3.101.111': case '1.3.101.113': // ph x509Error('Ed448 certificate channel binding is not currently supported by Postgres') } x509Error('unknown OID ' + oid, data) } module.exports = { signatureAlgorithmHashFromCertificate } node-postgres-pg-8.14.1/packages/pg/lib/crypto/sasl.js000066400000000000000000000163471476604072200225770ustar00rootroot00000000000000'use strict' const crypto = require('./utils') const { signatureAlgorithmHashFromCertificate } = require('./cert-signatures') function startSession(mechanisms, stream) { const candidates = ['SCRAM-SHA-256'] if (stream) candidates.unshift('SCRAM-SHA-256-PLUS') // higher-priority, so placed first const mechanism = candidates.find((candidate) => mechanisms.includes(candidate)) if (!mechanism) { throw new Error('SASL: Only mechanism(s) ' + candidates.join(' and ') + ' are supported') } if (mechanism === 'SCRAM-SHA-256-PLUS' && typeof stream.getPeerCertificate !== 'function') { // this should never happen if we are really talking to a Postgres server throw new Error('SASL: Mechanism SCRAM-SHA-256-PLUS requires a certificate') } const clientNonce = crypto.randomBytes(18).toString('base64') const gs2Header = mechanism === 'SCRAM-SHA-256-PLUS' ? 'p=tls-server-end-point' : stream ? 'y' : 'n' return { mechanism, clientNonce, response: gs2Header + ',,n=*,r=' + clientNonce, message: 'SASLInitialResponse', } } async function continueSession(session, password, serverData, stream) { if (session.message !== 'SASLInitialResponse') { throw new Error('SASL: Last message was not SASLInitialResponse') } if (typeof password !== 'string') { throw new Error('SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string') } if (password === '') { throw new Error('SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a non-empty string') } if (typeof serverData !== 'string') { throw new Error('SASL: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a string') } const sv = parseServerFirstMessage(serverData) if (!sv.nonce.startsWith(session.clientNonce)) { throw new Error('SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce') } else if (sv.nonce.length === session.clientNonce.length) { throw new Error('SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce is too short') } var clientFirstMessageBare = 'n=*,r=' + session.clientNonce var serverFirstMessage = 'r=' + sv.nonce + ',s=' + sv.salt + ',i=' + sv.iteration // without channel binding: let channelBinding = stream ? 'eSws' : 'biws' // 'y,,' or 'n,,', base64-encoded // override if channel binding is in use: if (session.mechanism === 'SCRAM-SHA-256-PLUS') { const peerCert = stream.getPeerCertificate().raw let hashName = signatureAlgorithmHashFromCertificate(peerCert) if (hashName === 'MD5' || hashName === 'SHA-1') hashName = 'SHA-256' const certHash = await crypto.hashByName(hashName, peerCert) const bindingData = Buffer.concat([Buffer.from('p=tls-server-end-point,,'), Buffer.from(certHash)]) channelBinding = bindingData.toString('base64') } var clientFinalMessageWithoutProof = 'c=' + channelBinding + ',r=' + sv.nonce var authMessage = clientFirstMessageBare + ',' + serverFirstMessage + ',' + clientFinalMessageWithoutProof var saltBytes = Buffer.from(sv.salt, 'base64') var saltedPassword = await crypto.deriveKey(password, saltBytes, sv.iteration) var clientKey = await crypto.hmacSha256(saltedPassword, 'Client Key') var storedKey = await crypto.sha256(clientKey) var clientSignature = await crypto.hmacSha256(storedKey, authMessage) var clientProof = xorBuffers(Buffer.from(clientKey), Buffer.from(clientSignature)).toString('base64') var serverKey = await crypto.hmacSha256(saltedPassword, 'Server Key') var serverSignatureBytes = await crypto.hmacSha256(serverKey, authMessage) session.message = 'SASLResponse' session.serverSignature = Buffer.from(serverSignatureBytes).toString('base64') session.response = clientFinalMessageWithoutProof + ',p=' + clientProof } function finalizeSession(session, serverData) { if (session.message !== 'SASLResponse') { throw new Error('SASL: Last message was not SASLResponse') } if (typeof serverData !== 'string') { throw new Error('SASL: SCRAM-SERVER-FINAL-MESSAGE: serverData must be a string') } const { serverSignature } = parseServerFinalMessage(serverData) if (serverSignature !== session.serverSignature) { throw new Error('SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature does not match') } } /** * printable = %x21-2B / %x2D-7E * ;; Printable ASCII except ",". * ;; Note that any "printable" is also * ;; a valid "value". */ function isPrintableChars(text) { if (typeof text !== 'string') { throw new TypeError('SASL: text must be a string') } return text .split('') .map((_, i) => text.charCodeAt(i)) .every((c) => (c >= 0x21 && c <= 0x2b) || (c >= 0x2d && c <= 0x7e)) } /** * base64-char = ALPHA / DIGIT / "/" / "+" * * base64-4 = 4base64-char * * base64-3 = 3base64-char "=" * * base64-2 = 2base64-char "==" * * base64 = *base64-4 [base64-3 / base64-2] */ function isBase64(text) { return /^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/.test(text) } function parseAttributePairs(text) { if (typeof text !== 'string') { throw new TypeError('SASL: attribute pairs text must be a string') } return new Map( text.split(',').map((attrValue) => { if (!/^.=/.test(attrValue)) { throw new Error('SASL: Invalid attribute pair entry') } const name = attrValue[0] const value = attrValue.substring(2) return [name, value] }) ) } function parseServerFirstMessage(data) { const attrPairs = parseAttributePairs(data) const nonce = attrPairs.get('r') if (!nonce) { throw new Error('SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing') } else if (!isPrintableChars(nonce)) { throw new Error('SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce must only contain printable characters') } const salt = attrPairs.get('s') if (!salt) { throw new Error('SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing') } else if (!isBase64(salt)) { throw new Error('SASL: SCRAM-SERVER-FIRST-MESSAGE: salt must be base64') } const iterationText = attrPairs.get('i') if (!iterationText) { throw new Error('SASL: SCRAM-SERVER-FIRST-MESSAGE: iteration missing') } else if (!/^[1-9][0-9]*$/.test(iterationText)) { throw new Error('SASL: SCRAM-SERVER-FIRST-MESSAGE: invalid iteration count') } const iteration = parseInt(iterationText, 10) return { nonce, salt, iteration, } } function parseServerFinalMessage(serverData) { const attrPairs = parseAttributePairs(serverData) const serverSignature = attrPairs.get('v') if (!serverSignature) { throw new Error('SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature is missing') } else if (!isBase64(serverSignature)) { throw new Error('SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature must be base64') } return { serverSignature, } } function xorBuffers(a, b) { if (!Buffer.isBuffer(a)) { throw new TypeError('first argument must be a Buffer') } if (!Buffer.isBuffer(b)) { throw new TypeError('second argument must be a Buffer') } if (a.length !== b.length) { throw new Error('Buffer lengths must match') } if (a.length === 0) { throw new Error('Buffers cannot be empty') } return Buffer.from(a.map((_, i) => a[i] ^ b[i])) } module.exports = { startSession, continueSession, finalizeSession, } node-postgres-pg-8.14.1/packages/pg/lib/crypto/utils-legacy.js000066400000000000000000000022731476604072200242300ustar00rootroot00000000000000'use strict' // This file contains crypto utility functions for versions of Node.js < 15.0.0, // which does not support the WebCrypto.subtle API. const nodeCrypto = require('crypto') function md5(string) { return nodeCrypto.createHash('md5').update(string, 'utf-8').digest('hex') } // See AuthenticationMD5Password at https://www.postgresql.org/docs/current/static/protocol-flow.html function postgresMd5PasswordHash(user, password, salt) { var inner = md5(password + user) var outer = md5(Buffer.concat([Buffer.from(inner), salt])) return 'md5' + outer } function sha256(text) { return nodeCrypto.createHash('sha256').update(text).digest() } function hashByName(hashName, text) { hashName = hashName.replace(/(\D)-/, '$1') // e.g. SHA-256 -> SHA256 return nodeCrypto.createHash(hashName).update(text).digest() } function hmacSha256(key, msg) { return nodeCrypto.createHmac('sha256', key).update(msg).digest() } async function deriveKey(password, salt, iterations) { return nodeCrypto.pbkdf2Sync(password, salt, iterations, 32, 'sha256') } module.exports = { postgresMd5PasswordHash, randomBytes: nodeCrypto.randomBytes, deriveKey, sha256, hashByName, hmacSha256, md5, } node-postgres-pg-8.14.1/packages/pg/lib/crypto/utils-webcrypto.js000066400000000000000000000050601476604072200247770ustar00rootroot00000000000000const nodeCrypto = require('crypto') module.exports = { postgresMd5PasswordHash, randomBytes, deriveKey, sha256, hashByName, hmacSha256, md5, } /** * The Web Crypto API - grabbed from the Node.js library or the global * @type Crypto */ const webCrypto = nodeCrypto.webcrypto || globalThis.crypto /** * The SubtleCrypto API for low level crypto operations. * @type SubtleCrypto */ const subtleCrypto = webCrypto.subtle const textEncoder = new TextEncoder() /** * * @param {*} length * @returns */ function randomBytes(length) { return webCrypto.getRandomValues(Buffer.alloc(length)) } async function md5(string) { try { return nodeCrypto.createHash('md5').update(string, 'utf-8').digest('hex') } catch (e) { // `createHash()` failed so we are probably not in Node.js, use the WebCrypto API instead. // Note that the MD5 algorithm on WebCrypto is not available in Node.js. // This is why we cannot just use WebCrypto in all environments. const data = typeof string === 'string' ? textEncoder.encode(string) : string const hash = await subtleCrypto.digest('MD5', data) return Array.from(new Uint8Array(hash)) .map((b) => b.toString(16).padStart(2, '0')) .join('') } } // See AuthenticationMD5Password at https://www.postgresql.org/docs/current/static/protocol-flow.html async function postgresMd5PasswordHash(user, password, salt) { var inner = await md5(password + user) var outer = await md5(Buffer.concat([Buffer.from(inner), salt])) return 'md5' + outer } /** * Create a SHA-256 digest of the given data * @param {Buffer} data */ async function sha256(text) { return await subtleCrypto.digest('SHA-256', text) } async function hashByName(hashName, text) { return await subtleCrypto.digest(hashName, text) } /** * Sign the message with the given key * @param {ArrayBuffer} keyBuffer * @param {string} msg */ async function hmacSha256(keyBuffer, msg) { const key = await subtleCrypto.importKey('raw', keyBuffer, { name: 'HMAC', hash: 'SHA-256' }, false, ['sign']) return await subtleCrypto.sign('HMAC', key, textEncoder.encode(msg)) } /** * Derive a key from the password and salt * @param {string} password * @param {Uint8Array} salt * @param {number} iterations */ async function deriveKey(password, salt, iterations) { const key = await subtleCrypto.importKey('raw', textEncoder.encode(password), 'PBKDF2', false, ['deriveBits']) const params = { name: 'PBKDF2', hash: 'SHA-256', salt: salt, iterations: iterations } return await subtleCrypto.deriveBits(params, key, 32 * 8, ['deriveBits']) } node-postgres-pg-8.14.1/packages/pg/lib/crypto/utils.js000066400000000000000000000005251476604072200227640ustar00rootroot00000000000000'use strict' const useLegacyCrypto = parseInt(process.versions && process.versions.node && process.versions.node.split('.')[0]) < 15 if (useLegacyCrypto) { // We are on an old version of Node.js that requires legacy crypto utilities. module.exports = require('./utils-legacy') } else { module.exports = require('./utils-webcrypto') } node-postgres-pg-8.14.1/packages/pg/lib/defaults.js000066400000000000000000000045641476604072200221220ustar00rootroot00000000000000'use strict' module.exports = { // database host. defaults to localhost host: 'localhost', // database user's name user: process.platform === 'win32' ? process.env.USERNAME : process.env.USER, // name of database to connect database: undefined, // database user's password password: null, // a Postgres connection string to be used instead of setting individual connection items // NOTE: Setting this value will cause it to override any other value (such as database or user) defined // in the defaults object. connectionString: undefined, // database port port: 5432, // number of rows to return at a time from a prepared statement's // portal. 0 will return all rows at once rows: 0, // binary result mode binary: false, // Connection pool options - see https://github.com/brianc/node-pg-pool // number of connections to use in connection pool // 0 will disable connection pooling max: 10, // max milliseconds a client can go unused before it is removed // from the pool and destroyed idleTimeoutMillis: 30000, client_encoding: '', ssl: false, application_name: undefined, fallback_application_name: undefined, options: undefined, parseInputDatesAsUTC: false, // max milliseconds any query using this connection will execute for before timing out in error. // false=unlimited statement_timeout: false, // Abort any statement that waits longer than the specified duration in milliseconds while attempting to acquire a lock. // false=unlimited lock_timeout: false, // Terminate any session with an open transaction that has been idle for longer than the specified duration in milliseconds // false=unlimited idle_in_transaction_session_timeout: false, // max milliseconds to wait for query to complete (client side) query_timeout: false, connect_timeout: 0, keepalives: 1, keepalives_idle: 0, } var pgTypes = require('pg-types') // save default parsers var parseBigInteger = pgTypes.getTypeParser(20, 'text') var parseBigIntegerArray = pgTypes.getTypeParser(1016, 'text') // parse int8 so you can get your count values as actual numbers module.exports.__defineSetter__('parseInt8', function (val) { pgTypes.setTypeParser(20, 'text', val ? pgTypes.getTypeParser(23, 'text') : parseBigInteger) pgTypes.setTypeParser(1016, 'text', val ? pgTypes.getTypeParser(1007, 'text') : parseBigIntegerArray) }) node-postgres-pg-8.14.1/packages/pg/lib/index.js000066400000000000000000000027571476604072200214240ustar00rootroot00000000000000'use strict' var Client = require('./client') var defaults = require('./defaults') var Connection = require('./connection') var Pool = require('pg-pool') const { DatabaseError } = require('pg-protocol') const { escapeIdentifier, escapeLiteral } = require('./utils') const poolFactory = (Client) => { return class BoundPool extends Pool { constructor(options) { super(options, Client) } } } var PG = function (clientConstructor) { this.defaults = defaults this.Client = clientConstructor this.Query = this.Client.Query this.Pool = poolFactory(this.Client) this._pools = [] this.Connection = Connection this.types = require('pg-types') this.DatabaseError = DatabaseError this.escapeIdentifier = escapeIdentifier this.escapeLiteral = escapeLiteral } if (typeof process.env.NODE_PG_FORCE_NATIVE !== 'undefined') { module.exports = new PG(require('./native')) } else { module.exports = new PG(Client) // lazy require native module...the native module may not have installed Object.defineProperty(module.exports, 'native', { configurable: true, enumerable: false, get() { var native = null try { native = new PG(require('./native')) } catch (err) { if (err.code !== 'MODULE_NOT_FOUND') { throw err } } // overwrite module.exports.native so that getter is never called again Object.defineProperty(module.exports, 'native', { value: native, }) return native }, }) } node-postgres-pg-8.14.1/packages/pg/lib/native/000077500000000000000000000000001476604072200212325ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg/lib/native/client.js000066400000000000000000000174731476604072200230620ustar00rootroot00000000000000'use strict' // eslint-disable-next-line var Native try { // Wrap this `require()` in a try-catch to avoid upstream bundlers from complaining that this might not be available since it is an optional import Native = require('pg-native') } catch (e) { throw e } var TypeOverrides = require('../type-overrides') var EventEmitter = require('events').EventEmitter var util = require('util') var ConnectionParameters = require('../connection-parameters') var NativeQuery = require('./query') var Client = (module.exports = function (config) { EventEmitter.call(this) config = config || {} this._Promise = config.Promise || global.Promise this._types = new TypeOverrides(config.types) this.native = new Native({ types: this._types, }) this._queryQueue = [] this._ending = false this._connecting = false this._connected = false this._queryable = true // keep these on the object for legacy reasons // for the time being. TODO: deprecate all this jazz var cp = (this.connectionParameters = new ConnectionParameters(config)) if (config.nativeConnectionString) cp.nativeConnectionString = config.nativeConnectionString this.user = cp.user // "hiding" the password so it doesn't show up in stack traces // or if the client is console.logged Object.defineProperty(this, 'password', { configurable: true, enumerable: false, writable: true, value: cp.password, }) this.database = cp.database this.host = cp.host this.port = cp.port // a hash to hold named queries this.namedQueries = {} }) Client.Query = NativeQuery util.inherits(Client, EventEmitter) Client.prototype._errorAllQueries = function (err) { const enqueueError = (query) => { process.nextTick(() => { query.native = this.native query.handleError(err) }) } if (this._hasActiveQuery()) { enqueueError(this._activeQuery) this._activeQuery = null } this._queryQueue.forEach(enqueueError) this._queryQueue.length = 0 } // connect to the backend // pass an optional callback to be called once connected // or with an error if there was a connection error Client.prototype._connect = function (cb) { var self = this if (this._connecting) { process.nextTick(() => cb(new Error('Client has already been connected. You cannot reuse a client.'))) return } this._connecting = true this.connectionParameters.getLibpqConnectionString(function (err, conString) { if (self.connectionParameters.nativeConnectionString) conString = self.connectionParameters.nativeConnectionString if (err) return cb(err) self.native.connect(conString, function (err) { if (err) { self.native.end() return cb(err) } // set internal states to connected self._connected = true // handle connection errors from the native layer self.native.on('error', function (err) { self._queryable = false self._errorAllQueries(err) self.emit('error', err) }) self.native.on('notification', function (msg) { self.emit('notification', { channel: msg.relname, payload: msg.extra, }) }) // signal we are connected now self.emit('connect') self._pulseQueryQueue(true) cb() }) }) } Client.prototype.connect = function (callback) { if (callback) { this._connect(callback) return } return new this._Promise((resolve, reject) => { this._connect((error) => { if (error) { reject(error) } else { resolve() } }) }) } // send a query to the server // this method is highly overloaded to take // 1) string query, optional array of parameters, optional function callback // 2) object query with { // string query // optional array values, // optional function callback instead of as a separate parameter // optional string name to name & cache the query plan // optional string rowMode = 'array' for an array of results // } Client.prototype.query = function (config, values, callback) { var query var result var readTimeout var readTimeoutTimer var queryCallback if (config === null || config === undefined) { throw new TypeError('Client was passed a null or undefined query') } else if (typeof config.submit === 'function') { readTimeout = config.query_timeout || this.connectionParameters.query_timeout result = query = config // accept query(new Query(...), (err, res) => { }) style if (typeof values === 'function') { config.callback = values } } else { readTimeout = config.query_timeout || this.connectionParameters.query_timeout query = new NativeQuery(config, values, callback) if (!query.callback) { let resolveOut, rejectOut result = new this._Promise((resolve, reject) => { resolveOut = resolve rejectOut = reject }).catch((err) => { Error.captureStackTrace(err) throw err }) query.callback = (err, res) => (err ? rejectOut(err) : resolveOut(res)) } } if (readTimeout) { queryCallback = query.callback readTimeoutTimer = setTimeout(() => { var error = new Error('Query read timeout') process.nextTick(() => { query.handleError(error, this.connection) }) queryCallback(error) // we already returned an error, // just do nothing if query completes query.callback = () => {} // Remove from queue var index = this._queryQueue.indexOf(query) if (index > -1) { this._queryQueue.splice(index, 1) } this._pulseQueryQueue() }, readTimeout) query.callback = (err, res) => { clearTimeout(readTimeoutTimer) queryCallback(err, res) } } if (!this._queryable) { query.native = this.native process.nextTick(() => { query.handleError(new Error('Client has encountered a connection error and is not queryable')) }) return result } if (this._ending) { query.native = this.native process.nextTick(() => { query.handleError(new Error('Client was closed and is not queryable')) }) return result } this._queryQueue.push(query) this._pulseQueryQueue() return result } // disconnect from the backend server Client.prototype.end = function (cb) { var self = this this._ending = true if (!this._connected) { this.once('connect', this.end.bind(this, cb)) } var result if (!cb) { result = new this._Promise(function (resolve, reject) { cb = (err) => (err ? reject(err) : resolve()) }) } this.native.end(function () { self._errorAllQueries(new Error('Connection terminated')) process.nextTick(() => { self.emit('end') if (cb) cb() }) }) return result } Client.prototype._hasActiveQuery = function () { return this._activeQuery && this._activeQuery.state !== 'error' && this._activeQuery.state !== 'end' } Client.prototype._pulseQueryQueue = function (initialConnection) { if (!this._connected) { return } if (this._hasActiveQuery()) { return } var query = this._queryQueue.shift() if (!query) { if (!initialConnection) { this.emit('drain') } return } this._activeQuery = query query.submit(this) var self = this query.once('_done', function () { self._pulseQueryQueue() }) } // attempt to cancel an in-progress query Client.prototype.cancel = function (query) { if (this._activeQuery === query) { this.native.cancel(function () {}) } else if (this._queryQueue.indexOf(query) !== -1) { this._queryQueue.splice(this._queryQueue.indexOf(query), 1) } } Client.prototype.ref = function () {} Client.prototype.unref = function () {} Client.prototype.setTypeParser = function (oid, format, parseFn) { return this._types.setTypeParser(oid, format, parseFn) } Client.prototype.getTypeParser = function (oid, format) { return this._types.getTypeParser(oid, format) } node-postgres-pg-8.14.1/packages/pg/lib/native/index.js000066400000000000000000000000621476604072200226750ustar00rootroot00000000000000'use strict' module.exports = require('./client') node-postgres-pg-8.14.1/packages/pg/lib/native/query.js000066400000000000000000000113541476604072200227410ustar00rootroot00000000000000'use strict' var EventEmitter = require('events').EventEmitter var util = require('util') var utils = require('../utils') var NativeQuery = (module.exports = function (config, values, callback) { EventEmitter.call(this) config = utils.normalizeQueryConfig(config, values, callback) this.text = config.text this.values = config.values this.name = config.name this.queryMode = config.queryMode this.callback = config.callback this.state = 'new' this._arrayMode = config.rowMode === 'array' // if the 'row' event is listened for // then emit them as they come in // without setting singleRowMode to true // this has almost no meaning because libpq // reads all rows into memory befor returning any this._emitRowEvents = false this.on( 'newListener', function (event) { if (event === 'row') this._emitRowEvents = true }.bind(this) ) }) util.inherits(NativeQuery, EventEmitter) var errorFieldMap = { /* eslint-disable quote-props */ sqlState: 'code', statementPosition: 'position', messagePrimary: 'message', context: 'where', schemaName: 'schema', tableName: 'table', columnName: 'column', dataTypeName: 'dataType', constraintName: 'constraint', sourceFile: 'file', sourceLine: 'line', sourceFunction: 'routine', } NativeQuery.prototype.handleError = function (err) { // copy pq error fields into the error object var fields = this.native.pq.resultErrorFields() if (fields) { for (var key in fields) { var normalizedFieldName = errorFieldMap[key] || key err[normalizedFieldName] = fields[key] } } if (this.callback) { this.callback(err) } else { this.emit('error', err) } this.state = 'error' } NativeQuery.prototype.then = function (onSuccess, onFailure) { return this._getPromise().then(onSuccess, onFailure) } NativeQuery.prototype.catch = function (callback) { return this._getPromise().catch(callback) } NativeQuery.prototype._getPromise = function () { if (this._promise) return this._promise this._promise = new Promise( function (resolve, reject) { this._once('end', resolve) this._once('error', reject) }.bind(this) ) return this._promise } NativeQuery.prototype.submit = function (client) { this.state = 'running' var self = this this.native = client.native client.native.arrayMode = this._arrayMode var after = function (err, rows, results) { client.native.arrayMode = false setImmediate(function () { self.emit('_done') }) // handle possible query error if (err) { return self.handleError(err) } // emit row events for each row in the result if (self._emitRowEvents) { if (results.length > 1) { rows.forEach((rowOfRows, i) => { rowOfRows.forEach((row) => { self.emit('row', row, results[i]) }) }) } else { rows.forEach(function (row) { self.emit('row', row, results) }) } } // handle successful result self.state = 'end' self.emit('end', results) if (self.callback) { self.callback(null, results) } } if (process.domain) { after = process.domain.bind(after) } // named query if (this.name) { if (this.name.length > 63) { /* eslint-disable no-console */ console.error('Warning! Postgres only supports 63 characters for query names.') console.error('You supplied %s (%s)', this.name, this.name.length) console.error('This can cause conflicts and silent errors executing queries') /* eslint-enable no-console */ } var values = (this.values || []).map(utils.prepareValue) // check if the client has already executed this named query // if so...just execute it again - skip the planning phase if (client.namedQueries[this.name]) { if (this.text && client.namedQueries[this.name] !== this.text) { const err = new Error(`Prepared statements must be unique - '${this.name}' was used for a different statement`) return after(err) } return client.native.execute(this.name, values, after) } // plan the named query the first time, then execute it return client.native.prepare(this.name, this.text, values.length, function (err) { if (err) return after(err) client.namedQueries[self.name] = self.text return self.native.execute(self.name, values, after) }) } else if (this.values) { if (!Array.isArray(this.values)) { const err = new Error('Query values must be an array') return after(err) } var vals = this.values.map(utils.prepareValue) client.native.query(this.text, vals, after) } else if (this.queryMode === 'extended') { client.native.query(this.text, [], after) } else { client.native.query(this.text, after) } } node-postgres-pg-8.14.1/packages/pg/lib/query.js000066400000000000000000000162761476604072200214630ustar00rootroot00000000000000'use strict' const { EventEmitter } = require('events') const Result = require('./result') const utils = require('./utils') class Query extends EventEmitter { constructor(config, values, callback) { super() config = utils.normalizeQueryConfig(config, values, callback) this.text = config.text this.values = config.values this.rows = config.rows this.types = config.types this.name = config.name this.queryMode = config.queryMode this.binary = config.binary // use unique portal name each time this.portal = config.portal || '' this.callback = config.callback this._rowMode = config.rowMode if (process.domain && config.callback) { this.callback = process.domain.bind(config.callback) } this._result = new Result(this._rowMode, this.types) // potential for multiple results this._results = this._result this._canceledDueToError = false } requiresPreparation() { if (this.queryMode === 'extended') { return true } // named queries must always be prepared if (this.name) { return true } // always prepare if there are max number of rows expected per // portal execution if (this.rows) { return true } // don't prepare empty text queries if (!this.text) { return false } // prepare if there are values if (!this.values) { return false } return this.values.length > 0 } _checkForMultirow() { // if we already have a result with a command property // then we've already executed one query in a multi-statement simple query // turn our results into an array of results if (this._result.command) { if (!Array.isArray(this._results)) { this._results = [this._result] } this._result = new Result(this._rowMode, this._result._types) this._results.push(this._result) } } // associates row metadata from the supplied // message with this query object // metadata used when parsing row results handleRowDescription(msg) { this._checkForMultirow() this._result.addFields(msg.fields) this._accumulateRows = this.callback || !this.listeners('row').length } handleDataRow(msg) { let row if (this._canceledDueToError) { return } try { row = this._result.parseRow(msg.fields) } catch (err) { this._canceledDueToError = err return } this.emit('row', row, this._result) if (this._accumulateRows) { this._result.addRow(row) } } handleCommandComplete(msg, connection) { this._checkForMultirow() this._result.addCommandComplete(msg) // need to sync after each command complete of a prepared statement // if we were using a row count which results in multiple calls to _getRows if (this.rows) { connection.sync() } } // if a named prepared statement is created with empty query text // the backend will send an emptyQuery message but *not* a command complete message // since we pipeline sync immediately after execute we don't need to do anything here // unless we have rows specified, in which case we did not pipeline the intial sync call handleEmptyQuery(connection) { if (this.rows) { connection.sync() } } handleError(err, connection) { // need to sync after error during a prepared statement if (this._canceledDueToError) { err = this._canceledDueToError this._canceledDueToError = false } // if callback supplied do not emit error event as uncaught error // events will bubble up to node process if (this.callback) { return this.callback(err) } this.emit('error', err) } handleReadyForQuery(con) { if (this._canceledDueToError) { return this.handleError(this._canceledDueToError, con) } if (this.callback) { try { this.callback(null, this._results) } catch (err) { process.nextTick(() => { throw err }) } } this.emit('end', this._results) } submit(connection) { if (typeof this.text !== 'string' && typeof this.name !== 'string') { return new Error('A query must have either text or a name. Supplying neither is unsupported.') } const previous = connection.parsedStatements[this.name] if (this.text && previous && this.text !== previous) { return new Error(`Prepared statements must be unique - '${this.name}' was used for a different statement`) } if (this.values && !Array.isArray(this.values)) { return new Error('Query values must be an array') } if (this.requiresPreparation()) { // If we're using the extended query protocol we fire off several separate commands // to the backend. On some versions of node & some operating system versions // the network stack writes each message separately instead of buffering them together // causing the client & network to send more slowly. Corking & uncorking the stream // allows node to buffer up the messages internally before sending them all off at once. // note: we're checking for existence of cork/uncork because some versions of streams // might not have this (cloudflare?) connection.stream.cork && connection.stream.cork() try { this.prepare(connection) } finally { // while unlikely for this.prepare to throw, if it does & we don't uncork this stream // this client becomes unresponsive, so put in finally block "just in case" connection.stream.uncork && connection.stream.uncork() } } else { connection.query(this.text) } return null } hasBeenParsed(connection) { return this.name && connection.parsedStatements[this.name] } handlePortalSuspended(connection) { this._getRows(connection, this.rows) } _getRows(connection, rows) { connection.execute({ portal: this.portal, rows: rows, }) // if we're not reading pages of rows send the sync command // to indicate the pipeline is finished if (!rows) { connection.sync() } else { // otherwise flush the call out to read more rows connection.flush() } } // http://developer.postgresql.org/pgdocs/postgres/protocol-flow.html#PROTOCOL-FLOW-EXT-QUERY prepare(connection) { // TODO refactor this poor encapsulation if (!this.hasBeenParsed(connection)) { connection.parse({ text: this.text, name: this.name, types: this.types, }) } // because we're mapping user supplied values to // postgres wire protocol compatible values it could // throw an exception, so try/catch this section try { connection.bind({ portal: this.portal, statement: this.name, values: this.values, binary: this.binary, valueMapper: utils.prepareValue, }) } catch (err) { this.handleError(err, connection) return } connection.describe({ type: 'P', name: this.portal || '', }) this._getRows(connection, this.rows) } handleCopyInResponse(connection) { connection.sendCopyFail('No source stream defined') } // eslint-disable-next-line no-unused-vars handleCopyData(msg, connection) { // noop } } module.exports = Query node-postgres-pg-8.14.1/packages/pg/lib/result.js000066400000000000000000000052311476604072200216210ustar00rootroot00000000000000'use strict' var types = require('pg-types') var matchRegexp = /^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/ // result object returned from query // in the 'end' event and also // passed as second argument to provided callback class Result { constructor(rowMode, types) { this.command = null this.rowCount = null this.oid = null this.rows = [] this.fields = [] this._parsers = undefined this._types = types this.RowCtor = null this.rowAsArray = rowMode === 'array' if (this.rowAsArray) { this.parseRow = this._parseRowAsArray } this._prebuiltEmptyResultObject = null } // adds a command complete message addCommandComplete(msg) { var match if (msg.text) { // pure javascript match = matchRegexp.exec(msg.text) } else { // native bindings match = matchRegexp.exec(msg.command) } if (match) { this.command = match[1] if (match[3]) { // COMMAND OID ROWS this.oid = parseInt(match[2], 10) this.rowCount = parseInt(match[3], 10) } else if (match[2]) { // COMMAND ROWS this.rowCount = parseInt(match[2], 10) } } } _parseRowAsArray(rowData) { var row = new Array(rowData.length) for (var i = 0, len = rowData.length; i < len; i++) { var rawValue = rowData[i] if (rawValue !== null) { row[i] = this._parsers[i](rawValue) } else { row[i] = null } } return row } parseRow(rowData) { var row = { ...this._prebuiltEmptyResultObject } for (var i = 0, len = rowData.length; i < len; i++) { var rawValue = rowData[i] var field = this.fields[i].name if (rawValue !== null) { row[field] = this._parsers[i](rawValue) } else { row[field] = null } } return row } addRow(row) { this.rows.push(row) } addFields(fieldDescriptions) { // clears field definitions // multiple query statements in 1 action can result in multiple sets // of rowDescriptions...eg: 'select NOW(); select 1::int;' // you need to reset the fields this.fields = fieldDescriptions if (this.fields.length) { this._parsers = new Array(fieldDescriptions.length) } var row = {} for (var i = 0; i < fieldDescriptions.length; i++) { var desc = fieldDescriptions[i] row[desc.name] = null if (this._types) { this._parsers[i] = this._types.getTypeParser(desc.dataTypeID, desc.format || 'text') } else { this._parsers[i] = types.getTypeParser(desc.dataTypeID, desc.format || 'text') } } this._prebuiltEmptyResultObject = { ...row } } } module.exports = Result node-postgres-pg-8.14.1/packages/pg/lib/stream.js000066400000000000000000000040021476604072200215710ustar00rootroot00000000000000const { getStream, getSecureStream } = getStreamFuncs() module.exports = { /** * Get a socket stream compatible with the current runtime environment. * @returns {Duplex} */ getStream, /** * Get a TLS secured socket, compatible with the current environment, * using the socket and other settings given in `options`. * @returns {Duplex} */ getSecureStream, } /** * The stream functions that work in Node.js */ function getNodejsStreamFuncs() { function getStream(ssl) { const net = require('net') return new net.Socket() } function getSecureStream(options) { var tls = require('tls') return tls.connect(options) } return { getStream, getSecureStream, } } /** * The stream functions that work in Cloudflare Workers */ function getCloudflareStreamFuncs() { function getStream(ssl) { const { CloudflareSocket } = require('pg-cloudflare') return new CloudflareSocket(ssl) } function getSecureStream(options) { options.socket.startTls(options) return options.socket } return { getStream, getSecureStream, } } /** * Are we running in a Cloudflare Worker? * * @returns true if the code is currently running inside a Cloudflare Worker. */ function isCloudflareRuntime() { // Since 2022-03-21 the `global_navigator` compatibility flag is on for Cloudflare Workers // which means that `navigator.userAgent` will be defined. if (typeof navigator === 'object' && navigator !== null && typeof navigator.userAgent === 'string') { return navigator.userAgent === 'Cloudflare-Workers' } // In case `navigator` or `navigator.userAgent` is not defined then try a more sneaky approach if (typeof Response === 'function') { const resp = new Response(null, { cf: { thing: true } }) if (typeof resp.cf === 'object' && resp.cf !== null && resp.cf.thing) { return true } } return false } function getStreamFuncs() { if (isCloudflareRuntime()) { return getCloudflareStreamFuncs() } return getNodejsStreamFuncs() } node-postgres-pg-8.14.1/packages/pg/lib/type-overrides.js000066400000000000000000000014001476604072200232560ustar00rootroot00000000000000'use strict' var types = require('pg-types') function TypeOverrides(userTypes) { this._types = userTypes || types this.text = {} this.binary = {} } TypeOverrides.prototype.getOverrides = function (format) { switch (format) { case 'text': return this.text case 'binary': return this.binary default: return {} } } TypeOverrides.prototype.setTypeParser = function (oid, format, parseFn) { if (typeof format === 'function') { parseFn = format format = 'text' } this.getOverrides(format)[oid] = parseFn } TypeOverrides.prototype.getTypeParser = function (oid, format) { format = format || 'text' return this.getOverrides(format)[oid] || this._types.getTypeParser(oid, format) } module.exports = TypeOverrides node-postgres-pg-8.14.1/packages/pg/lib/utils.js000066400000000000000000000124741476604072200214520ustar00rootroot00000000000000'use strict' const defaults = require('./defaults') function escapeElement(elementRepresentation) { var escaped = elementRepresentation.replace(/\\/g, '\\\\').replace(/"/g, '\\"') return '"' + escaped + '"' } // convert a JS array to a postgres array literal // uses comma separator so won't work for types like box that use // a different array separator. function arrayString(val) { var result = '{' for (var i = 0; i < val.length; i++) { if (i > 0) { result = result + ',' } if (val[i] === null || typeof val[i] === 'undefined') { result = result + 'NULL' } else if (Array.isArray(val[i])) { result = result + arrayString(val[i]) } else if (ArrayBuffer.isView(val[i])) { var item = val[i] if (!(item instanceof Buffer)) { var buf = Buffer.from(item.buffer, item.byteOffset, item.byteLength) if (buf.length === item.byteLength) { item = buf } else { item = buf.slice(item.byteOffset, item.byteOffset + item.byteLength) } } result += '\\\\x' + item.toString('hex') } else { result += escapeElement(prepareValue(val[i])) } } result = result + '}' return result } // converts values from javascript types // to their 'raw' counterparts for use as a postgres parameter // note: you can override this function to provide your own conversion mechanism // for complex types, etc... var prepareValue = function (val, seen) { // null and undefined are both null for postgres if (val == null) { return null } if (typeof val === 'object') { if (val instanceof Buffer) { return val } if (ArrayBuffer.isView(val)) { var buf = Buffer.from(val.buffer, val.byteOffset, val.byteLength) if (buf.length === val.byteLength) { return buf } return buf.slice(val.byteOffset, val.byteOffset + val.byteLength) // Node.js v4 does not support those Buffer.from params } if (val instanceof Date) { if (defaults.parseInputDatesAsUTC) { return dateToStringUTC(val) } else { return dateToString(val) } } if (Array.isArray(val)) { return arrayString(val) } return prepareObject(val, seen) } return val.toString() } function prepareObject(val, seen) { if (val && typeof val.toPostgres === 'function') { seen = seen || [] if (seen.indexOf(val) !== -1) { throw new Error('circular reference detected while preparing "' + val + '" for query') } seen.push(val) return prepareValue(val.toPostgres(prepareValue), seen) } return JSON.stringify(val) } function dateToString(date) { var offset = -date.getTimezoneOffset() var year = date.getFullYear() var isBCYear = year < 1 if (isBCYear) year = Math.abs(year) + 1 // negative years are 1 off their BC representation var ret = String(year).padStart(4, '0') + '-' + String(date.getMonth() + 1).padStart(2, '0') + '-' + String(date.getDate()).padStart(2, '0') + 'T' + String(date.getHours()).padStart(2, '0') + ':' + String(date.getMinutes()).padStart(2, '0') + ':' + String(date.getSeconds()).padStart(2, '0') + '.' + String(date.getMilliseconds()).padStart(3, '0') if (offset < 0) { ret += '-' offset *= -1 } else { ret += '+' } ret += String(Math.floor(offset / 60)).padStart(2, '0') + ':' + String(offset % 60).padStart(2, '0') if (isBCYear) ret += ' BC' return ret } function dateToStringUTC(date) { var year = date.getUTCFullYear() var isBCYear = year < 1 if (isBCYear) year = Math.abs(year) + 1 // negative years are 1 off their BC representation var ret = String(year).padStart(4, '0') + '-' + String(date.getUTCMonth() + 1).padStart(2, '0') + '-' + String(date.getUTCDate()).padStart(2, '0') + 'T' + String(date.getUTCHours()).padStart(2, '0') + ':' + String(date.getUTCMinutes()).padStart(2, '0') + ':' + String(date.getUTCSeconds()).padStart(2, '0') + '.' + String(date.getUTCMilliseconds()).padStart(3, '0') ret += '+00:00' if (isBCYear) ret += ' BC' return ret } function normalizeQueryConfig(config, values, callback) { // can take in strings or config objects config = typeof config === 'string' ? { text: config } : config if (values) { if (typeof values === 'function') { config.callback = values } else { config.values = values } } if (callback) { config.callback = callback } return config } // Ported from PostgreSQL 9.2.4 source code in src/interfaces/libpq/fe-exec.c const escapeIdentifier = function (str) { return '"' + str.replace(/"/g, '""') + '"' } const escapeLiteral = function (str) { var hasBackslash = false var escaped = "'" for (var i = 0; i < str.length; i++) { var c = str[i] if (c === "'") { escaped += c + c } else if (c === '\\') { escaped += c + c hasBackslash = true } else { escaped += c } } escaped += "'" if (hasBackslash === true) { escaped = ' E' + escaped } return escaped } module.exports = { prepareValue: function prepareValueWrapper(value) { // this ensures that extra arguments do not get passed into prepareValue // by accident, eg: from calling values.map(utils.prepareValue) return prepareValue(value) }, normalizeQueryConfig, escapeIdentifier, escapeLiteral, } node-postgres-pg-8.14.1/packages/pg/package.json000066400000000000000000000024111476604072200214620ustar00rootroot00000000000000{ "name": "pg", "version": "8.14.1", "description": "PostgreSQL client - pure javascript & libpq with the same API", "keywords": [ "database", "libpq", "pg", "postgre", "postgres", "postgresql", "rdbms" ], "homepage": "https://github.com/brianc/node-postgres", "repository": { "type": "git", "url": "git://github.com/brianc/node-postgres.git", "directory": "packages/pg" }, "author": "Brian Carlson ", "main": "./lib", "dependencies": { "pg-connection-string": "^2.7.0", "pg-pool": "^3.8.0", "pg-protocol": "^1.8.0", "pg-types": "^2.1.0", "pgpass": "1.x" }, "devDependencies": { "@cloudflare/workers-types": "^4.20230404.0", "async": "2.6.4", "bluebird": "3.7.2", "co": "4.6.0", "pg-copy-streams": "0.3.0", "typescript": "^4.0.3", "workerd": "^1.20230419.0", "wrangler": "3.58.0" }, "optionalDependencies": { "pg-cloudflare": "^1.1.1" }, "peerDependencies": { "pg-native": ">=3.0.1" }, "peerDependenciesMeta": { "pg-native": { "optional": true } }, "scripts": { "test": "make test-all" }, "files": [ "lib", "SPONSORS.md" ], "license": "MIT", "engines": { "node": ">= 8.0.0" } } node-postgres-pg-8.14.1/packages/pg/script/000077500000000000000000000000001476604072200205025ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg/script/create-test-tables.js000066400000000000000000000030101476604072200245220ustar00rootroot00000000000000'use strict' var args = require('../test/cli') var pg = require('../lib') var people = [ { name: 'Aaron', age: 10 }, { name: 'Brian', age: 20 }, { name: 'Chris', age: 30 }, { name: 'David', age: 40 }, { name: 'Elvis', age: 50 }, { name: 'Frank', age: 60 }, { name: 'Grace', age: 70 }, { name: 'Haley', age: 80 }, { name: 'Irma', age: 90 }, { name: 'Jenny', age: 100 }, { name: 'Kevin', age: 110 }, { name: 'Larry', age: 120 }, { name: 'Michelle', age: 130 }, { name: 'Nancy', age: 140 }, { name: 'Olivia', age: 150 }, { name: 'Peter', age: 160 }, { name: 'Quinn', age: 170 }, { name: 'Ronda', age: 180 }, { name: 'Shelley', age: 190 }, { name: 'Tobias', age: 200 }, { name: 'Uma', age: 210 }, { name: 'Veena', age: 220 }, { name: 'Wanda', age: 230 }, { name: 'Xavier', age: 240 }, { name: 'Yoyo', age: 250 }, { name: 'Zanzabar', age: 260 }, ] async function run() { var con = new pg.Client({ user: args.user, password: args.password, host: args.host, port: args.port, database: args.database, }) console.log('creating test dataset') await con.connect() await con.query('DROP TABLE IF EXISTS person') await con.query('CREATE TABLE person (id serial, name varchar(10), age integer)') await con.query( 'INSERT INTO person (name, age) VALUES' + people.map((person) => ` ('${person.name}', ${person.age})`).join(',') ) await con.end() console.log('created test dataset') } run().catch((e) => { console.log('setup failed', e) process.exit(255) }) node-postgres-pg-8.14.1/packages/pg/script/dump-db-types.js000066400000000000000000000007121476604072200235320ustar00rootroot00000000000000'use strict' var pg = require('../lib') var args = require('../test/cli') var queries = ['select CURRENT_TIMESTAMP', "select interval '1 day' + interval '1 hour'", "select TIMESTAMP 'today'"] queries.forEach(function (query) { var client = new pg.Client({ user: args.user, database: args.database, password: args.password, }) client.connect() client.query(query).on('row', function (row) { console.log(row) client.end() }) }) node-postgres-pg-8.14.1/packages/pg/test/000077500000000000000000000000001476604072200201555ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg/test/buffer-list.js000066400000000000000000000027321476604072200227410ustar00rootroot00000000000000'use strict' const BufferList = function () { this.buffers = [] } var p = BufferList.prototype p.add = function (buffer, front) { this.buffers[front ? 'unshift' : 'push'](buffer) return this } p.addInt16 = function (val, front) { return this.add(Buffer.from([val >>> 8, val >>> 0]), front) } p.getByteLength = function () { return this.buffers.reduce(function (previous, current) { return previous + current.length }, 0) } p.addInt32 = function (val, first) { return this.add( Buffer.from([(val >>> 24) & 0xff, (val >>> 16) & 0xff, (val >>> 8) & 0xff, (val >>> 0) & 0xff]), first ) } p.addCString = function (val, front) { var len = Buffer.byteLength(val) var buffer = Buffer.alloc(len + 1) buffer.write(val) buffer[len] = 0 return this.add(buffer, front) } p.addString = function (val, front) { var len = Buffer.byteLength(val) var buffer = Buffer.alloc(len) buffer.write(val) return this.add(buffer, front) } p.addChar = function (char, first) { return this.add(Buffer.from(char, 'utf8'), first) } p.join = function (appendLength, char) { var length = this.getByteLength() if (appendLength) { this.addInt32(length + 4, true) return this.join(false, char) } if (char) { this.addChar(char, true) length++ } var result = Buffer.alloc(length) var index = 0 this.buffers.forEach(function (buffer) { buffer.copy(result, index, 0) index += buffer.length }) return result } module.exports = BufferList node-postgres-pg-8.14.1/packages/pg/test/cli.js000066400000000000000000000010041476604072200212550ustar00rootroot00000000000000'use strict' var ConnectionParameters = require('../lib/connection-parameters') var config = new ConnectionParameters(process.argv[2]) for (var i = 0; i < process.argv.length; i++) { switch (process.argv[i].toLowerCase()) { case 'native': config.native = true break case 'binary': config.binary = true break case 'down': config.down = true break default: break } } if (process.env['PG_TEST_NATIVE']) { config.native = true } module.exports = config node-postgres-pg-8.14.1/packages/pg/test/integration/000077500000000000000000000000001476604072200225005ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg/test/integration/client/000077500000000000000000000000001476604072200237565ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg/test/integration/client/api-tests.js000066400000000000000000000160251476604072200262310ustar00rootroot00000000000000'use strict' var helper = require('../test-helper') var pg = helper.pg const assert = require('assert') var suite = new helper.Suite() suite.test('null and undefined are both inserted as NULL', function (done) { const pool = new pg.Pool() pool.connect( assert.calls(function (err, client, release) { assert(!err) client.query('CREATE TEMP TABLE my_nulls(a varchar(1), b varchar(1), c integer, d integer, e date, f date)') client.query('INSERT INTO my_nulls(a,b,c,d,e,f) VALUES ($1,$2,$3,$4,$5,$6)', [ null, undefined, null, undefined, null, undefined, ]) client.query( 'SELECT * FROM my_nulls', assert.calls(function (err, result) { console.log(err) assert.ifError(err) assert.equal(result.rows.length, 1) assert.isNull(result.rows[0].a) assert.isNull(result.rows[0].b) assert.isNull(result.rows[0].c) assert.isNull(result.rows[0].d) assert.isNull(result.rows[0].e) assert.isNull(result.rows[0].f) pool.end(done) release() }) ) }) ) }) suite.test('pool callback behavior', (done) => { // test weird callback behavior with node-pool const pool = new pg.Pool() pool.connect(function (err) { assert(!err) arguments[1].emit('drain') arguments[2]() pool.end(done) }) }) suite.test('query timeout', (cb) => { const pool = new pg.Pool({ query_timeout: 1000 }) pool.connect().then((client) => { client.query( 'SELECT pg_sleep(2)', assert.calls(function (err, result) { assert(err) assert(err.message === 'Query read timeout') client.release() pool.end(cb) }) ) }) }) suite.test('query recover from timeout', (cb) => { const pool = new pg.Pool({ query_timeout: 1000 }) pool.connect().then((client) => { client.query( 'SELECT pg_sleep(20)', assert.calls(function (err, result) { assert(err) assert(err.message === 'Query read timeout') client.release(err) pool.connect().then((client) => { client.query( 'SELECT 1', assert.calls(function (err, result) { assert(!err) client.release(err) pool.end(cb) }) ) }) }) ) }) }) suite.test('query no timeout', (cb) => { const pool = new pg.Pool({ query_timeout: 10000 }) pool.connect().then((client) => { client.query( 'SELECT pg_sleep(1)', assert.calls(function (err, result) { assert(!err) client.release() pool.end(cb) }) ) }) }) suite.test('query with timeout on query basis', (cb) => { const pool = new pg.Pool() pool.connect().then((client) => { client.query( { text: 'SELECT pg_sleep(20)', query_timeout: 1000 }, assert.calls(function (err, result) { assert(err) assert(err.message === 'Query read timeout') client.release() pool.end(cb) }) ) }) }) suite.test('callback API', (done) => { const client = new helper.Client() client.query('CREATE TEMP TABLE peep(name text)') client.query('INSERT INTO peep(name) VALUES ($1)', ['brianc']) const config = { text: 'INSERT INTO peep(name) VALUES ($1)', values: ['brian'], } client.query(config) client.query('INSERT INTO peep(name) VALUES ($1)', ['aaron']) client.query('SELECT * FROM peep ORDER BY name COLLATE "C"', (err, res) => { assert(!err) assert.equal(res.rowCount, 3) assert.deepEqual(res.rows, [ { name: 'aaron', }, { name: 'brian', }, { name: 'brianc', }, ]) done() }) client.connect((err) => { assert(!err) client.once('drain', () => client.end()) }) }) suite.test('executing nested queries', function (done) { const pool = new pg.Pool() pool.connect( assert.calls(function (err, client, release) { assert(!err) client.query( 'select now as now from NOW()', assert.calls(function (err, result) { assert.equal(new Date().getYear(), result.rows[0].now.getYear()) client.query( 'select now as now_again FROM NOW()', assert.calls(function () { client.query( 'select * FROM NOW()', assert.calls(function () { assert.ok('all queries hit') release() pool.end(done) }) ) }) ) }) ) }) ) }) suite.test('raises error if cannot connect', function () { var connectionString = 'pg://sfalsdkf:asdf@localhost/ieieie' const pool = new pg.Pool({ connectionString: connectionString }) pool.connect( assert.calls(function (err, client, done) { assert.ok(err, 'should have raised an error') done() }) ) }) suite.test('query errors are handled and do not bubble if callback is provided', function (done) { const pool = new pg.Pool() pool.connect( assert.calls(function (err, client, release) { assert(!err) client.query( 'SELECT OISDJF FROM LEIWLISEJLSE', assert.calls(function (err, result) { assert.ok(err) release() pool.end(done) }) ) }) ) }) suite.test('callback is fired once and only once', function (done) { const pool = new pg.Pool() pool.connect( assert.calls(function (err, client, release) { assert(!err) client.query('CREATE TEMP TABLE boom(name varchar(10))') var callCount = 0 client.query( [ "INSERT INTO boom(name) VALUES('hai')", "INSERT INTO boom(name) VALUES('boom')", "INSERT INTO boom(name) VALUES('zoom')", ].join(';'), function (err, callback) { assert.equal(callCount++, 0, 'Call count should be 0. More means this callback fired more than once.') release() pool.end(done) } ) }) ) }) suite.test('can provide callback and config object', function (done) { const pool = new pg.Pool() pool.connect( assert.calls(function (err, client, release) { assert(!err) client.query( { name: 'boom', text: 'select NOW()', }, assert.calls(function (err, result) { assert(!err) assert.equal(result.rows[0].now.getYear(), new Date().getYear()) release() pool.end(done) }) ) }) ) }) suite.test('can provide callback and config and parameters', function (done) { const pool = new pg.Pool() pool.connect( assert.calls(function (err, client, release) { assert(!err) var config = { text: 'select $1::text as val', } client.query( config, ['hi'], assert.calls(function (err, result) { assert(!err) assert.equal(result.rows.length, 1) assert.equal(result.rows[0].val, 'hi') release() pool.end(done) }) ) }) ) }) node-postgres-pg-8.14.1/packages/pg/test/integration/client/appname-tests.js000066400000000000000000000046151476604072200271030ustar00rootroot00000000000000'use strict' var helper = require('./test-helper') var Client = helper.Client const assert = require('assert') var suite = new helper.Suite() var conInfo = helper.config function getConInfo(override) { return Object.assign({}, conInfo, override) } function getAppName(conf, cb) { var client = new Client(conf) client.connect( assert.success(function () { client.query( 'SHOW application_name', assert.success(function (res) { var appName = res.rows[0].application_name cb(appName) client.end() }) ) }) ) } suite.test('No default appliation_name ', function (done) { getAppName({}, function (res) { assert.strictEqual(res, '') done() }) }) suite.test('fallback_application_name is used', function (done) { var fbAppName = 'this is my app' var conf = getConInfo({ fallback_application_name: fbAppName, }) getAppName(conf, function (res) { assert.strictEqual(res, fbAppName) done() }) }) suite.test('application_name is used', function (done) { var appName = 'some wired !@#$% application_name' var conf = getConInfo({ application_name: appName, }) getAppName(conf, function (res) { assert.strictEqual(res, appName) done() }) }) suite.test('application_name has precedence over fallback_application_name', function (done) { var appName = 'some wired !@#$% application_name' var fbAppName = 'some other strange $$test$$ appname' var conf = getConInfo({ application_name: appName, fallback_application_name: fbAppName, }) getAppName(conf, function (res) { assert.strictEqual(res, appName) done() }) }) suite.test('application_name from connection string', function (done) { var appName = 'my app' var conParams = require('../../../lib/connection-parameters') var conf if (process.argv[2]) { conf = new conParams(process.argv[2] + '?application_name=' + appName) } else { conf = 'postgres://?application_name=' + appName } getAppName(conf, function (res) { assert.strictEqual(res, appName) done() }) }) // TODO: make the test work for native client too if (!helper.args.native) { suite.test('application_name is read from the env', function (done) { var appName = (process.env.PGAPPNAME = 'testest') getAppName({}, function (res) { delete process.env.PGAPPNAME assert.strictEqual(res, appName) done() }) }) } node-postgres-pg-8.14.1/packages/pg/test/integration/client/array-tests.js000066400000000000000000000155701476604072200266020ustar00rootroot00000000000000'use strict' var helper = require('./test-helper') var pg = helper.pg const assert = require('assert') var suite = new helper.Suite() const pool = new pg.Pool() pool.connect( assert.calls(function (err, client, release) { assert(!err) suite.test('nulls', function (done) { client.query( 'SELECT $1::text[] as array', [[null]], assert.success(function (result) { var array = result.rows[0].array assert.lengthIs(array, 1) assert.isNull(array[0]) done() }) ) }) suite.test('elements containing JSON-escaped characters', function (done) { var param = '\\"\\"' for (var i = 1; i <= 0x1f; i++) { param += String.fromCharCode(i) } client.query( 'SELECT $1::text[] as array', [[param]], assert.success(function (result) { var array = result.rows[0].array assert.lengthIs(array, 1) assert.equal(array[0], param) done() }) ) }) suite.test('cleanup', () => release()) pool.connect( assert.calls(function (err, client, release) { assert(!err) client.query('CREATE TEMP TABLE why(names text[], numbors integer[])') client .query(new pg.Query('INSERT INTO why(names, numbors) VALUES(\'{"aaron", "brian","a b c" }\', \'{1, 2, 3}\')')) .on('error', console.log) suite.test('numbers', function (done) { // client.connection.on('message', console.log) client.query( 'SELECT numbors FROM why', assert.success(function (result) { assert.lengthIs(result.rows[0].numbors, 3) assert.equal(result.rows[0].numbors[0], 1) assert.equal(result.rows[0].numbors[1], 2) assert.equal(result.rows[0].numbors[2], 3) done() }) ) }) suite.test('parses string arrays', function (done) { client.query( 'SELECT names FROM why', assert.success(function (result) { var names = result.rows[0].names assert.lengthIs(names, 3) assert.equal(names[0], 'aaron') assert.equal(names[1], 'brian') assert.equal(names[2], 'a b c') done() }) ) }) suite.test('empty array', function (done) { client.query( "SELECT '{}'::text[] as names", assert.success(function (result) { var names = result.rows[0].names assert.lengthIs(names, 0) done() }) ) }) suite.test('element containing comma', function (done) { client.query( 'SELECT \'{"joe,bob",jim}\'::text[] as names', assert.success(function (result) { var names = result.rows[0].names assert.lengthIs(names, 2) assert.equal(names[0], 'joe,bob') assert.equal(names[1], 'jim') done() }) ) }) suite.test('bracket in quotes', function (done) { client.query( 'SELECT \'{"{","}"}\'::text[] as names', assert.success(function (result) { var names = result.rows[0].names assert.lengthIs(names, 2) assert.equal(names[0], '{') assert.equal(names[1], '}') done() }) ) }) suite.test('null value', function (done) { client.query( 'SELECT \'{joe,null,bob,"NULL"}\'::text[] as names', assert.success(function (result) { var names = result.rows[0].names assert.lengthIs(names, 4) assert.equal(names[0], 'joe') assert.equal(names[1], null) assert.equal(names[2], 'bob') assert.equal(names[3], 'NULL') done() }) ) }) suite.test('element containing quote char', function (done) { client.query( "SELECT ARRAY['joe''', 'jim', 'bob\"'] AS names", assert.success(function (result) { var names = result.rows[0].names assert.lengthIs(names, 3) assert.equal(names[0], "joe'") assert.equal(names[1], 'jim') assert.equal(names[2], 'bob"') done() }) ) }) suite.test('nested array', function (done) { client.query( "SELECT '{{1,joe},{2,bob}}'::text[] as names", assert.success(function (result) { var names = result.rows[0].names assert.lengthIs(names, 2) assert.lengthIs(names[0], 2) assert.equal(names[0][0], '1') assert.equal(names[0][1], 'joe') assert.lengthIs(names[1], 2) assert.equal(names[1][0], '2') assert.equal(names[1][1], 'bob') done() }) ) }) suite.test('integer array', function (done) { client.query( "SELECT '{1,2,3}'::integer[] as names", assert.success(function (result) { var names = result.rows[0].names assert.lengthIs(names, 3) assert.equal(names[0], 1) assert.equal(names[1], 2) assert.equal(names[2], 3) done() }) ) }) suite.test('integer nested array', function (done) { client.query( "SELECT '{{1,100},{2,100},{3,100}}'::integer[] as names", assert.success(function (result) { var names = result.rows[0].names assert.lengthIs(names, 3) assert.equal(names[0][0], 1) assert.equal(names[0][1], 100) assert.equal(names[1][0], 2) assert.equal(names[1][1], 100) assert.equal(names[2][0], 3) assert.equal(names[2][1], 100) done() }) ) }) suite.test('JS array parameter', function (done) { client.query( 'SELECT $1::integer[] as names', [ [ [1, 100], [2, 100], [3, 100], ], ], assert.success(function (result) { var names = result.rows[0].names assert.lengthIs(names, 3) assert.equal(names[0][0], 1) assert.equal(names[0][1], 100) assert.equal(names[1][0], 2) assert.equal(names[1][1], 100) assert.equal(names[2][0], 3) assert.equal(names[2][1], 100) release() pool.end(() => { done() }) }) ) }) }) ) }) ) node-postgres-pg-8.14.1/packages/pg/test/integration/client/async-stack-trace-tests.js000066400000000000000000000030521476604072200307700ustar00rootroot00000000000000'use strict' var helper = require('../test-helper') var pg = helper.pg process.on('unhandledRejection', function (e) { console.error(e, e.stack) process.exit(1) }) const suite = new helper.Suite() // these tests will only work for if --async-stack-traces is on, which is the default starting in node 16. const NODE_MAJOR_VERSION = +process.versions.node.split('.')[0] if (NODE_MAJOR_VERSION >= 16) { suite.testAsync('promise API async stack trace in pool', async function outerFunction() { async function innerFunction() { const pool = new pg.Pool() await pool.query('SELECT test from nonexistent') } try { await innerFunction() throw Error('should have errored') } catch (e) { const stack = e.stack if (!e.stack.includes('innerFunction') || !e.stack.includes('outerFunction')) { throw Error('async stack trace does not contain wanted values: ' + stack) } } }) suite.testAsync('promise API async stack trace in client', async function outerFunction() { async function innerFunction() { const client = new pg.Client() await client.connect() try { await client.query('SELECT test from nonexistent') } finally { client.end() } } try { await innerFunction() throw Error('should have errored') } catch (e) { const stack = e.stack if (!e.stack.includes('innerFunction') || !e.stack.includes('outerFunction')) { throw Error('async stack trace does not contain wanted values: ' + stack) } } }) } node-postgres-pg-8.14.1/packages/pg/test/integration/client/big-simple-query-tests.js000066400000000000000000000253601476604072200306550ustar00rootroot00000000000000'use strict' var helper = require('./test-helper') var Query = helper.pg.Query const assert = require('assert') const suite = new helper.Suite() /* Test to trigger a bug. I really dont know what's wrong but it seams that its triggered by multable big queryies with supplied values. The test bellow can trigger the bug. */ // Big query with a where clouse from supplied value var big_query_rows_1 = [] var big_query_rows_2 = [] var big_query_rows_3 = [] // Works suite.test('big simple query 1', function (done) { var client = helper.client() client .query( new Query( "select 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' as bla from person where name = '' or 1 = 1" ) ) .on('row', function (row) { big_query_rows_1.push(row) }) .on('error', function (error) { console.log('big simple query 1 error') console.log(error) }) client.on('drain', () => { client.end() done() }) }) // Works suite.test('big simple query 2', function (done) { var client = helper.client() client .query( new Query( "select 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' as bla from person where name = $1 or 1 = 1", [''] ) ) .on('row', function (row) { big_query_rows_2.push(row) }) .on('error', function (error) { console.log('big simple query 2 error') console.log(error) }) client.on('drain', () => { client.end() done() }) }) // Fails most of the time with 'invalid byte sequence for encoding "UTF8": 0xb9' or 'insufficient data left in message' // If test 1 and 2 are commented out it works suite.test('big simple query 3', function (done) { var client = helper.client() client .query( new Query( "select 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' as bla from person where name = $1 or 1 = 1", [''] ) ) .on('row', function (row) { big_query_rows_3.push(row) }) .on('error', function (error) { console.log('big simple query 3 error') console.log(error) }) client.on('drain', () => { client.end() done() }) }) process.on('exit', function () { assert.equal(big_query_rows_1.length, 26, 'big simple query 1 should return 26 rows') assert.equal(big_query_rows_2.length, 26, 'big simple query 2 should return 26 rows') assert.equal(big_query_rows_3.length, 26, 'big simple query 3 should return 26 rows') }) var runBigQuery = function (client) { client.query( "select 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' as bla from person where name = $1 or 1 = 1", [''], function (err, result) { if (err != null) { console.log(err) throw Err } assert.lengthIs(result.rows, 26) } ) } suite.test('many times', function (done) { var client = helper.client() for (var i = 0; i < 20; i++) { runBigQuery(client) } client.on('drain', function () { client.end() setTimeout(function () { done() // let client disconnect fully }, 100) }) }) node-postgres-pg-8.14.1/packages/pg/test/integration/client/configuration-tests.js000066400000000000000000000033541476604072200303300ustar00rootroot00000000000000'use strict' var helper = require('./test-helper') var pg = helper.pg const assert = require('assert') const { Client } = helper var suite = new helper.Suite() // clear process.env var realEnv = {} for (var key in process.env) { realEnv[key] = process.env[key] if (!key.indexOf('PG')) delete process.env[key] } suite.test('default values are used in new clients', function () { assert.same(pg.defaults, { user: process.env.USER, database: undefined, password: null, port: 5432, rows: 0, max: 10, binary: false, idleTimeoutMillis: 30000, client_encoding: '', ssl: false, application_name: undefined, fallback_application_name: undefined, parseInputDatesAsUTC: false, }) var client = new pg.Client() assert.same(client, { user: process.env.USER, password: null, port: 5432, database: process.env.USER, }) }) suite.test('modified values are passed to created clients', function () { pg.defaults.user = 'boom' pg.defaults.password = 'zap' pg.defaults.host = 'blam' pg.defaults.port = 1234 pg.defaults.database = 'pow' var client = new Client() assert.same(client, { user: 'boom', password: 'zap', host: 'blam', port: 1234, database: 'pow', }) }) suite.test('database defaults to user when user is non-default', () => { { pg.defaults.database = undefined const client = new Client({ user: 'foo', }) assert.strictEqual(client.database, 'foo') } { pg.defaults.database = 'bar' const client = new Client({ user: 'foo', }) assert.strictEqual(client.database, 'bar') } }) suite.test('cleanup', () => { // restore process.env for (var key in realEnv) { process.env[key] = realEnv[key] } }) node-postgres-pg-8.14.1/packages/pg/test/integration/client/connection-parameter-tests.js000066400000000000000000000010041476604072200315640ustar00rootroot00000000000000const assert = require('assert') const helper = require('../test-helper') const suite = new helper.Suite() const { Client } = helper.pg suite.test('it sends options', async () => { const client = new Client({ options: '--default_transaction_isolation=serializable', }) await client.connect() const { rows } = await client.query('SHOW default_transaction_isolation') assert.strictEqual(rows.length, 1) assert.strictEqual(rows[0].default_transaction_isolation, 'serializable') await client.end() }) node-postgres-pg-8.14.1/packages/pg/test/integration/client/connection-timeout-tests.js000066400000000000000000000051141476604072200313000ustar00rootroot00000000000000'use strict' const net = require('net') const buffers = require('../../test-buffers') const helper = require('./test-helper') const assert = require('assert') const suite = new helper.Suite() const options = { host: 'localhost', port: Math.floor(Math.random() * 2000) + 2000, connectionTimeoutMillis: 2000, user: 'not', database: 'existing', } const serverWithConnectionTimeout = (port, timeout, callback) => { const sockets = new Set() const server = net.createServer((socket) => { sockets.add(socket) socket.once('end', () => sockets.delete(socket)) socket.on('data', (data) => { // deny request for SSL if (data.length === 8) { socket.write(Buffer.from('N', 'utf8')) // consider all authentication requests as good } else if (!data[0]) { socket.write(buffers.authenticationOk()) // send ReadyForQuery `timeout` ms after authentication setTimeout(() => socket.write(buffers.readyForQuery()), timeout).unref() // respond with our canned response } else { socket.write(buffers.readyForQuery()) } }) }) let closing = false const closeServer = (done) => { if (closing) return closing = true server.close(done) for (const socket of sockets) { socket.destroy() } } server.listen(port, options.host, () => callback(closeServer)) } suite.test('successful connection', (done) => { serverWithConnectionTimeout(options.port, 0, (closeServer) => { const timeoutId = setTimeout(() => { throw new Error('Client should have connected successfully but it did not.') }, 3000) const client = new helper.Client(options) client .connect() .then(() => client.end()) .then(() => closeServer(done)) .catch((err) => closeServer(() => done(err))) .then(() => clearTimeout(timeoutId)) }) }) suite.test('expired connection timeout', (done) => { const opts = { ...options, port: options.port + 1 } serverWithConnectionTimeout(opts.port, opts.connectionTimeoutMillis * 2, (closeServer) => { const timeoutId = setTimeout(() => { throw new Error('Client should have emitted an error but it did not.') }, 3000) const client = new helper.Client(opts) client .connect() .then(() => client.end()) .then(() => closeServer(() => done(new Error('Connection timeout should have expired but it did not.')))) .catch((err) => { assert(err instanceof Error) assert(/timeout expired\s*/.test(err.message)) closeServer(done) }) .then(() => clearTimeout(timeoutId)) }) }) node-postgres-pg-8.14.1/packages/pg/test/integration/client/custom-types-tests.js000066400000000000000000000027001476604072200301270ustar00rootroot00000000000000'use strict' const helper = require('./test-helper') const Client = helper.pg.Client const suite = new helper.Suite() const assert = require('assert') const customTypes = { getTypeParser: () => () => 'okay!', } suite.test('custom type parser in client config', (done) => { const client = new Client({ types: customTypes }) client.connect().then(() => { client.query( 'SELECT NOW() as val', assert.success(function (res) { assert.equal(res.rows[0].val, 'okay!') client.end().then(done) }) ) }) }) suite.test('custom type parser in client config with multiple results', (done) => { const client = new Client({ types: customTypes }) client.connect().then(() => { client.query( `SELECT 'foo'::text as name; SELECT 'bar'::text as baz`, assert.success(function (res) { assert.equal(res[0].rows[0].name, 'okay!') assert.equal(res[1].rows[0].baz, 'okay!') client.end().then(done) }) ) }) }) // Custom type-parsers per query are not supported in native if (!helper.args.native) { suite.test('custom type parser in query', (done) => { const client = new Client() client.connect().then(() => { client.query( { text: 'SELECT NOW() as val', types: customTypes, }, assert.success(function (res) { assert.equal(res.rows[0].val, 'okay!') client.end().then(done) }) ) }) }) } node-postgres-pg-8.14.1/packages/pg/test/integration/client/empty-query-tests.js000066400000000000000000000010111476604072200277460ustar00rootroot00000000000000'use strict' var helper = require('./test-helper') const suite = new helper.Suite() const assert = require('assert') suite.test('empty query message handling', function (done) { const client = helper.client() assert.emits(client, 'drain', function () { client.end(done) }) client.query({ text: '' }) }) suite.test('callback supported', function (done) { const client = helper.client() client.query('', function (err, result) { assert(!err) assert.empty(result.rows) client.end(done) }) }) node-postgres-pg-8.14.1/packages/pg/test/integration/client/error-handling-tests.js000066400000000000000000000143551476604072200303770ustar00rootroot00000000000000'use strict' var helper = require('./test-helper') var pg = helper.pg const assert = require('assert') const Client = pg.Client const DatabaseError = pg.DatabaseError var createErorrClient = function () { var client = helper.client() client.once('error', function (err) { assert.fail('Client shoud not throw error during query execution') }) client.on('drain', client.end.bind(client)) return client } const suite = new helper.Suite('error handling') suite.test('sending non-array argument as values causes an error callback', (done) => { const client = new Client() client.connect((err) => { if (err) { return done(err) } client.query('select $1::text as name', 'foo', (err) => { assert(err instanceof Error) client.query('SELECT $1::text as name', ['foo'], (err, res) => { assert.equal(res.rows[0].name, 'foo') client.end(done) }) }) }) }) suite.test('re-using connections results in error callback', (done) => { const client = new Client() client.connect((err) => { if (err) { return done(err) } client.connect((err) => { assert(err instanceof Error) client.end(done) }) }) }) suite.testAsync('re-using connections results in promise rejection', () => { const client = new Client() return client.connect().then(() => { return helper.rejection(client.connect()).then((err) => { assert(err instanceof Error) return client.end() }) }) }) suite.test('using a client after closing it results in error', (done) => { const client = new Client() client.connect((err) => { if (err) { return done(err) } client.end( assert.calls(() => { client.query( 'SELECT 1', assert.calls((err) => { assert.equal(err.message, 'Client was closed and is not queryable') done() }) ) }) ) }) }) suite.test('query receives error on client shutdown', function (done) { var client = new Client() client.connect( assert.success(function () { const config = { text: 'select pg_sleep(5)', name: 'foobar', } let queryError client.query( new pg.Query(config), assert.calls(function (err, res) { assert(err instanceof Error) queryError = err }) ) setTimeout(() => client.end(), 50) client.once('end', () => { assert(queryError instanceof Error) done() }) }) ) }) var ensureFuture = function (testClient, done) { var goodQuery = testClient.query(new pg.Query('select age from boom')) assert.emits(goodQuery, 'row', function (row) { assert.equal(row.age, 28) done() }) } suite.test('when query is parsing', (done) => { var client = createErorrClient() client.query({ text: 'CREATE TEMP TABLE boom(age integer); INSERT INTO boom (age) VALUES (28);' }) // this query wont parse since there isn't a table named bang var query = client.query( new pg.Query({ text: 'select * from bang where name = $1', values: ['0'], }) ) assert.emits(query, 'error', function (err) { ensureFuture(client, done) }) }) suite.test('when a query is binding', function (done) { var client = createErorrClient() client.query({ text: 'CREATE TEMP TABLE boom(age integer); INSERT INTO boom (age) VALUES (28);' }) var query = client.query( new pg.Query({ text: 'select * from boom where age = $1', values: ['asldkfjasdf'], }) ) assert.emits(query, 'error', function (err) { if (!helper.config.native) { assert(err instanceof DatabaseError) } assert.equal(err.severity, 'ERROR') ensureFuture(client, done) }) }) suite.test('non-query error with callback', function (done) { var client = new Client({ user: 'asldkfjsadlfkj', }) client.connect( assert.calls(function (error, client) { assert(error instanceof Error) done() }) ) }) suite.test('non-error calls supplied callback', function (done) { var client = new Client({ user: helper.args.user, password: helper.args.password, host: helper.args.host, port: helper.args.port, database: helper.args.database, }) client.connect( assert.calls(function (err) { assert.ifError(err) client.end(done) }) ) }) suite.test('when connecting to an invalid host with callback', function (done) { var client = new Client({ user: 'very invalid username', }) client.on('error', () => { assert.fail('unexpected error event when connecting') }) client.connect(function (error, client) { assert(error instanceof Error) done() }) }) suite.test('when connecting to invalid host with promise', function (done) { var client = new Client({ user: 'very invalid username', }) client.on('error', () => { assert.fail('unexpected error event when connecting') }) client.connect().catch((e) => done()) }) suite.test('non-query error', function (done) { var client = new Client({ user: 'asldkfjsadlfkj', }) client.connect().catch((e) => { assert(e instanceof Error) done() }) }) suite.test('within a simple query', (done) => { var client = createErorrClient() var query = client.query(new pg.Query("select eeeee from yodas_dsflsd where pixistix = 'zoiks!!!'")) assert.emits(query, 'error', function (error) { if (!helper.config.native) { assert(error instanceof DatabaseError) } assert.equal(error.severity, 'ERROR') done() }) }) suite.test('connected, idle client error', (done) => { const client = new Client() client.connect((err) => { if (err) { throw new Error('Should not receive error callback after connection') } setImmediate(() => { ;(client.connection || client.native).emit('error', new Error('expected')) }) }) client.on('error', (err) => { assert.equal(err.message, 'expected') client.end(done) }) }) suite.test('cannot pass non-string values to query as text', (done) => { const client = new Client() client.connect((err) => { if (err) { return done(err) } client.query({ text: {} }, (err) => { assert(err) client.query({}, (err) => { client.on('drain', () => { client.end(done) }) }) }) }) }) node-postgres-pg-8.14.1/packages/pg/test/integration/client/field-name-escape-tests.js000066400000000000000000000003661476604072200307200ustar00rootroot00000000000000var pg = require('./test-helper').pg var sql = 'SELECT 1 AS "\\\'/*", 2 AS "\\\'*/\n + process.exit(-1)] = null;\n//"' var client = new pg.Client() client.connect() client.query(sql, function (err, res) { if (err) throw err client.end() }) node-postgres-pg-8.14.1/packages/pg/test/integration/client/huge-numeric-tests.js000066400000000000000000000013731476604072200300500ustar00rootroot00000000000000'use strict' var helper = require('./test-helper') const pool = new helper.pg.Pool() const assert = require('assert') pool.connect( assert.success(function (client, done) { var types = require('pg-types') // 1231 = numericOID types.setTypeParser(1700, function () { return 'yes' }) types.setTypeParser(1700, 'binary', function () { return 'yes' }) var bignum = '294733346389144765940638005275322203805' client.query('CREATE TEMP TABLE bignumz(id numeric)') client.query('INSERT INTO bignumz(id) VALUES ($1)', [bignum]) client.query( 'SELECT * FROM bignumz', assert.success(function (result) { assert.equal(result.rows[0].id, 'yes') done() pool.end() }) ) }) ) idle_in_transaction_session_timeout-tests.js000066400000000000000000000050221476604072200347150ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg/test/integration/client'use strict' var helper = require('./test-helper') var Client = helper.Client const assert = require('assert') var suite = new helper.Suite() var conInfo = helper.config function getConInfo(override) { return Object.assign({}, conInfo, override) } function testClientVersion(cb) { var client = new Client({}) client.connect( assert.success(function () { helper.versionGTE( client, 100000, assert.success(function (isGreater) { return client.end( assert.success(function () { if (!isGreater) { console.log( 'skip idle_in_transaction_session_timeout at client-level is only available in v10 and above' ) return } cb() }) ) }) ) }) ) } function getIdleTransactionSessionTimeout(conf, cb) { var client = new Client(conf) client.connect( assert.success(function () { client.query( 'SHOW idle_in_transaction_session_timeout', assert.success(function (res) { var timeout = res.rows[0].idle_in_transaction_session_timeout cb(timeout) client.end() }) ) }) ) } if (!helper.args.native) { // idle_in_transaction_session_timeout is not supported with the native client testClientVersion(function () { suite.test('No default idle_in_transaction_session_timeout ', function (done) { getConInfo() getIdleTransactionSessionTimeout({}, function (res) { assert.strictEqual(res, '0') // 0 = no timeout done() }) }) suite.test('idle_in_transaction_session_timeout integer is used', function (done) { var conf = getConInfo({ idle_in_transaction_session_timeout: 3000, }) getIdleTransactionSessionTimeout(conf, function (res) { assert.strictEqual(res, '3s') done() }) }) suite.test('idle_in_transaction_session_timeout float is used', function (done) { var conf = getConInfo({ idle_in_transaction_session_timeout: 3000.7, }) getIdleTransactionSessionTimeout(conf, function (res) { assert.strictEqual(res, '3s') done() }) }) suite.test('idle_in_transaction_session_timeout string is used', function (done) { var conf = getConInfo({ idle_in_transaction_session_timeout: '3000', }) getIdleTransactionSessionTimeout(conf, function (res) { assert.strictEqual(res, '3s') done() }) }) }) } node-postgres-pg-8.14.1/packages/pg/test/integration/client/json-type-parsing-tests.js000066400000000000000000000023211476604072200310430ustar00rootroot00000000000000'use strict' var helper = require('./test-helper') var assert = require('assert') const pool = new helper.pg.Pool() pool.connect( assert.success(function (client, done) { helper.versionGTE( client, 90200, assert.success(function (jsonSupported) { if (!jsonSupported) { console.log('skip json test on older versions of postgres') done() return pool.end() } client.query('CREATE TEMP TABLE stuff(id SERIAL PRIMARY KEY, data JSON)') var value = { name: 'Brian', age: 250, alive: true, now: new Date() } client.query('INSERT INTO stuff (data) VALUES ($1)', [value]) client.query( 'SELECT * FROM stuff', assert.success(function (result) { assert.equal(result.rows.length, 1) assert.equal(typeof result.rows[0].data, 'object') var row = result.rows[0].data assert.strictEqual(row.name, value.name) assert.strictEqual(row.age, value.age) assert.strictEqual(row.alive, value.alive) assert.equal(JSON.stringify(row.now), JSON.stringify(value.now)) done() pool.end() }) ) }) ) }) ) node-postgres-pg-8.14.1/packages/pg/test/integration/client/multiple-results-tests.js000066400000000000000000000052201476604072200310050ustar00rootroot00000000000000'use strict' const assert = require('assert') const co = require('co') const helper = require('./test-helper') const suite = new helper.Suite('multiple result sets') suite.test( 'two select results work', co.wrap(function* () { const client = new helper.Client() yield client.connect() const results = yield client.query(`SELECT 'foo'::text as name; SELECT 'bar'::text as baz`) assert(Array.isArray(results)) assert.equal(results[0].fields[0].name, 'name') assert.deepEqual(results[0].rows, [{ name: 'foo' }]) assert.equal(results[1].fields[0].name, 'baz') assert.deepEqual(results[1].rows, [{ baz: 'bar' }]) return client.end() }) ) suite.test( 'throws if queryMode set to "extended"', co.wrap(function* () { const client = new helper.Client() yield client.connect() // TODO should be text or sql? try { yield client.query({ text: `SELECT 'foo'::text as name; SELECT 'bar'::text as baz`, queryMode: 'extended', }) assert.fail('Should have thrown') } catch (err) { if (err instanceof assert.AssertionError) throw err assert.equal(err.severity, 'ERROR') assert.equal(err.code, '42601') assert.equal(err.message, 'cannot insert multiple commands into a prepared statement') } return client.end() }) ) suite.test( 'multiple selects work', co.wrap(function* () { const client = new helper.Client() yield client.connect() const text = ` SELECT * FROM generate_series(2, 4) as foo; SELECT * FROM generate_series(8, 10) as bar; SELECT * FROM generate_series(20, 22) as baz; ` const results = yield client.query(text) assert(Array.isArray(results)) assert.equal(results[0].fields[0].name, 'foo') assert.deepEqual(results[0].rows, [{ foo: 2 }, { foo: 3 }, { foo: 4 }]) assert.equal(results[1].fields[0].name, 'bar') assert.deepEqual(results[1].rows, [{ bar: 8 }, { bar: 9 }, { bar: 10 }]) assert.equal(results[2].fields[0].name, 'baz') assert.deepEqual(results[2].rows, [{ baz: 20 }, { baz: 21 }, { baz: 22 }]) assert.equal(results.length, 3) return client.end() }) ) suite.test( 'mixed queries and statements', co.wrap(function* () { const client = new helper.Client() yield client.connect() const text = ` CREATE TEMP TABLE weather(type text); INSERT INTO weather(type) VALUES ('rain'); SELECT * FROM weather; ` const results = yield client.query(text) assert(Array.isArray(results)) assert.equal(results[0].command, 'CREATE') assert.equal(results[1].command, 'INSERT') assert.equal(results[2].command, 'SELECT') return client.end() }) ) node-postgres-pg-8.14.1/packages/pg/test/integration/client/network-partition-tests.js000066400000000000000000000047021476604072200311570ustar00rootroot00000000000000'use strict' var buffers = require('../../test-buffers') var helper = require('./test-helper') var suite = new helper.Suite() const assert = require('assert') var net = require('net') var Server = function (response) { this.server = undefined this.socket = undefined this.response = response } Server.prototype.start = function (cb) { // this is our fake postgres server // it responds with our specified response immediatley after receiving every buffer // this is sufficient into convincing the client its connectet to a valid backend // if we respond with a readyForQuery message this.server = net.createServer( function (socket) { this.socket = socket if (this.response) { this.socket.on( 'data', function (data) { // deny request for SSL if (data.length == 8) { this.socket.write(Buffer.from('N', 'utf8')) // consider all authentication requests as good } else if (!data[0]) { this.socket.write(buffers.authenticationOk()) // respond with our canned response } else { this.socket.write(this.response) } }.bind(this) ) } }.bind(this) ) const host = 'localhost' this.server.listen({ host, port: 0 }, () => { const port = this.server.address().port cb({ host, port, }) }) } Server.prototype.drop = function () { this.socket.destroy() } Server.prototype.close = function (cb) { this.server.close(cb) } var testServer = function (server, cb) { // wait for our server to start server.start(function (options) { // connect a client to it var client = new helper.Client(options) client.connect().catch((err) => { assert(err instanceof Error) clearTimeout(timeoutId) server.close(cb) }) server.server.on('connection', () => { // after 50 milliseconds, drop the client setTimeout(function () { server.drop() }, 50) }) // blow up if we don't receive an error var timeoutId = setTimeout(function () { throw new Error('Client should have emitted an error but it did not.') }, 5000) }) } suite.test('readyForQuery server', (done) => { const respondingServer = new Server(buffers.readyForQuery()) testServer(respondingServer, done) }) suite.test('silent server', (done) => { const silentServer = new Server() testServer(silentServer, done) }) node-postgres-pg-8.14.1/packages/pg/test/integration/client/no-data-tests.js000066400000000000000000000015431476604072200270020ustar00rootroot00000000000000'use strict' var helper = require('./test-helper') const suite = new helper.Suite() const assert = require('assert') suite.test('noData message handling', function () { var client = helper.client() client.query({ name: 'boom', text: 'create temp table boom(id serial, size integer)', }) client.query( { name: 'insert', text: 'insert into boom(size) values($1)', values: [100], }, function (err, result) { if (err) { console.log(err) throw err } } ) client.query({ name: 'insert', values: [101], }) client.query( { name: 'fetch', text: 'select size from boom where size < $1', values: [101], }, (err, res) => { var row = res.rows[0] assert.strictEqual(row.size, 100) } ) client.on('drain', client.end.bind(client)) }) node-postgres-pg-8.14.1/packages/pg/test/integration/client/no-row-result-tests.js000066400000000000000000000015341476604072200302140ustar00rootroot00000000000000'use strict' var helper = require('./test-helper') var pg = helper.pg const suite = new helper.Suite() const pool = new pg.Pool() const assert = require('assert') suite.test('can access results when no rows are returned', function (done) { var checkResult = function (result) { assert(result.fields, 'should have fields definition') assert.equal(result.fields.length, 1) assert.equal(result.fields[0].name, 'val') assert.equal(result.fields[0].dataTypeID, 25) } pool.connect( assert.success(function (client, release) { const q = new pg.Query('select $1::text as val limit 0', ['hi']) var query = client.query( q, assert.success(function (result) { checkResult(result) release() pool.end(done) }) ) assert.emits(query, 'end', checkResult) }) ) }) node-postgres-pg-8.14.1/packages/pg/test/integration/client/notice-tests.js000066400000000000000000000044451476604072200267440ustar00rootroot00000000000000'use strict' const helper = require('./test-helper') const assert = require('assert') const suite = new helper.Suite() suite.test('emits notify message', function (done) { const client = helper.client() client.query( 'LISTEN boom', assert.calls(function () { const otherClient = helper.client() let bothEmitted = -1 otherClient.query( 'LISTEN boom', assert.calls(function () { assert.emits(client, 'notification', function (msg) { // make sure PQfreemem doesn't invalidate string pointers setTimeout(function () { assert.equal(msg.channel, 'boom') assert.ok( msg.payload == 'omg!' /* 9.x */ || msg.payload == '' /* 8.x */, 'expected blank payload or correct payload but got ' + msg.message ) client.end(++bothEmitted ? done : undefined) }, 100) }) assert.emits(otherClient, 'notification', function (msg) { assert.equal(msg.channel, 'boom') otherClient.end(++bothEmitted ? done : undefined) }) client.query("NOTIFY boom, 'omg!'", function (err, q) { if (err) { // notify not supported with payload on 8.x client.query('NOTIFY boom') } }) }) ) }) ) }) // this test fails on travis due to their config suite.test('emits notice message', function (done) { if (helper.args.native) { console.error('notice messages do not work curreintly with node-libpq') return done() } const client = helper.client() const text = ` DO language plpgsql $$ BEGIN RAISE NOTICE 'hello, world!' USING ERRCODE = '23505', DETAIL = 'this is a test'; END $$; ` client.query('SET SESSION client_min_messages=notice', (err) => { assert.ifError(err) client.query(text, () => { client.end() }) }) assert.emits(client, 'notice', function (notice) { assert.ok(notice != null) // notice messages should not be error instances assert(notice instanceof Error === false) assert.strictEqual(notice.name, 'notice') assert.strictEqual(notice.message, 'hello, world!') assert.strictEqual(notice.detail, 'this is a test') assert.strictEqual(notice.code, '23505') done() }) }) node-postgres-pg-8.14.1/packages/pg/test/integration/client/parse-int-8-tests.js000066400000000000000000000024641476604072200275310ustar00rootroot00000000000000'use strict' var helper = require('../test-helper') var pg = helper.pg const suite = new helper.Suite() const assert = require('assert') const pool = new pg.Pool(helper.config) suite.test('ability to turn on and off parser', function () { if (helper.args.binary) return false pool.connect( assert.success(function (client, done) { pg.defaults.parseInt8 = true client.query('CREATE TEMP TABLE asdf(id SERIAL PRIMARY KEY)') client.query( 'SELECT COUNT(*) as "count", \'{1,2,3}\'::bigint[] as array FROM asdf', assert.success(function (res) { assert.strictEqual(0, res.rows[0].count) assert.strictEqual(1, res.rows[0].array[0]) assert.strictEqual(2, res.rows[0].array[1]) assert.strictEqual(3, res.rows[0].array[2]) pg.defaults.parseInt8 = false client.query( 'SELECT COUNT(*) as "count", \'{1,2,3}\'::bigint[] as array FROM asdf', assert.success(function (res) { done() assert.strictEqual('0', res.rows[0].count) assert.strictEqual('1', res.rows[0].array[0]) assert.strictEqual('2', res.rows[0].array[1]) assert.strictEqual('3', res.rows[0].array[2]) pool.end() }) ) }) ) }) ) }) node-postgres-pg-8.14.1/packages/pg/test/integration/client/prepared-statement-tests.js000066400000000000000000000106721476604072200312660ustar00rootroot00000000000000'use strict' var helper = require('./test-helper') var Query = helper.pg.Query const assert = require('assert') var suite = new helper.Suite() ;(function () { var client = helper.client() client.on('drain', client.end.bind(client)) var queryName = 'user by age and like name' suite.test('first named prepared statement', function (done) { var query = client.query( new Query({ text: 'select name from person where age <= $1 and name LIKE $2', values: [20, 'Bri%'], name: queryName, }) ) assert.emits(query, 'row', function (row) { assert.equal(row.name, 'Brian') }) query.on('end', () => done()) }) suite.test('second named prepared statement with same name & text', function (done) { var cachedQuery = client.query( new Query({ text: 'select name from person where age <= $1 and name LIKE $2', name: queryName, values: [10, 'A%'], }) ) assert.emits(cachedQuery, 'row', function (row) { assert.equal(row.name, 'Aaron') }) cachedQuery.on('end', () => done()) }) suite.test('with same name, but without query text', function (done) { var q = client.query( new Query({ name: queryName, values: [30, '%n%'], }) ) assert.emits(q, 'row', function (row) { assert.equal(row.name, 'Aaron') // test second row is emitted as well assert.emits(q, 'row', function (row) { assert.equal(row.name, 'Brian') }) }) q.on('end', () => done()) }) suite.test('with same name, but with different text', function (done) { client.query( new Query({ text: 'select name from person where age >= $1 and name LIKE $2', name: queryName, values: [30, '%n%'], }), assert.calls((err) => { assert.equal( err.message, `Prepared statements must be unique - '${queryName}' was used for a different statement` ) done() }) ) }) })() ;(function () { var statementName = 'differ' var statement1 = 'select count(*)::int4 as count from person' var statement2 = 'select count(*)::int4 as count from person where age < $1' var client1 = helper.client() var client2 = helper.client() suite.test('client 1 execution', function (done) { client1.query( { name: statementName, text: statement1, }, (err, res) => { assert(!err) assert.equal(res.rows[0].count, 26) done() } ) }) suite.test('client 2 execution', function (done) { var query = client2.query( new Query({ name: statementName, text: statement2, values: [11], }) ) assert.emits(query, 'row', function (row) { assert.equal(row.count, 1) }) assert.emits(query, 'end', function () { done() }) }) suite.test('clean up clients', () => { return client1.end().then(() => client2.end()) }) })() ;(function () { var client = helper.client() client.query('CREATE TEMP TABLE zoom(name varchar(100));') client.query("INSERT INTO zoom (name) VALUES ('zed')") client.query("INSERT INTO zoom (name) VALUES ('postgres')") client.query("INSERT INTO zoom (name) VALUES ('node postgres')") var checkForResults = function (q) { assert.emits(q, 'row', function (row) { assert.equal(row.name, 'node postgres') assert.emits(q, 'row', function (row) { assert.equal(row.name, 'postgres') assert.emits(q, 'row', function (row) { assert.equal(row.name, 'zed') }) }) }) } suite.test('with small row count', function (done) { var query = client.query( new Query( { name: 'get names', text: 'SELECT name FROM zoom ORDER BY name COLLATE "C"', rows: 1, }, done ) ) checkForResults(query) }) suite.test('with large row count', function (done) { var query = client.query( new Query( { name: 'get names', text: 'SELECT name FROM zoom ORDER BY name COLLATE "C"', rows: 1000, }, done ) ) checkForResults(query) }) suite.testAsync('with no data response and rows', async function () { const result = await client.query({ name: 'some insert', text: '', values: [], rows: 1, }) assert.equal(result.rows.length, 0) }) suite.test('cleanup', () => client.end()) })() node-postgres-pg-8.14.1/packages/pg/test/integration/client/promise-api-tests.js000066400000000000000000000022001476604072200276730ustar00rootroot00000000000000'use strict' const helper = require('./test-helper') const pg = helper.pg const assert = require('assert') const suite = new helper.Suite() suite.test('valid connection completes promise', () => { const client = new pg.Client() return client.connect().then(() => { return client.end().then(() => {}) }) }) suite.test('valid connection completes promise', () => { const client = new pg.Client() return client.connect().then(() => { return client.end().then(() => {}) }) }) suite.test('invalid connection rejects promise', (done) => { const client = new pg.Client({ host: 'alksdjflaskdfj', port: 1234 }) return client.connect().catch((e) => { assert(e instanceof Error) done() }) }) suite.test('connected client does not reject promise after connection', (done) => { const client = new pg.Client() return client.connect().then(() => { setTimeout(() => { client.on('error', (e) => { assert(e instanceof Error) client.end() done() }) // manually kill the connection client.emit('error', new Error('something bad happened...but not really')) }, 50) }) }) node-postgres-pg-8.14.1/packages/pg/test/integration/client/query-as-promise-tests.js000066400000000000000000000027161476604072200307040ustar00rootroot00000000000000'use strict' var bluebird = require('bluebird') var helper = require('../test-helper') var pg = helper.pg const assert = require('assert') process.on('unhandledRejection', function (e) { console.error(e, e.stack) process.exit(1) }) const suite = new helper.Suite() suite.test('promise API', (cb) => { const pool = new pg.Pool() pool.connect().then((client) => { client .query('SELECT $1::text as name', ['foo']) .then(function (result) { assert.equal(result.rows[0].name, 'foo') return client }) .then(function (client) { client.query('ALKJSDF').catch(function (e) { assert(e instanceof Error) client.query('SELECT 1 as num').then(function (result) { assert.equal(result.rows[0].num, 1) client.release() pool.end(cb) }) }) }) }) }) suite.test('promise API with configurable promise type', (cb) => { const client = new pg.Client({ Promise: bluebird }) const connectPromise = client.connect() assert(connectPromise instanceof bluebird, 'Client connect() returns configured promise') connectPromise .then(() => { const queryPromise = client.query('SELECT 1') assert(queryPromise instanceof bluebird, 'Client query() returns configured promise') return queryPromise.then(() => { client.end(cb) }) }) .catch((error) => { process.nextTick(() => { throw error }) }) }) node-postgres-pg-8.14.1/packages/pg/test/integration/client/query-column-names-tests.js000066400000000000000000000010661476604072200312200ustar00rootroot00000000000000'use strict' var helper = require('../test-helper') var pg = helper.pg const assert = require('assert') new helper.Suite().test('support for complex column names', function () { const pool = new pg.Pool() pool.connect( assert.success(function (client, done) { client.query('CREATE TEMP TABLE t ( "complex\'\'column" TEXT )') client.query( 'SELECT * FROM t', assert.success(function (res) { done() assert.strictEqual(res.fields[0].name, "complex''column") pool.end() }) ) }) ) }) query-error-handling-prepared-statement-tests.js000066400000000000000000000063511476604072200352620ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg/test/integration/client'use strict' var helper = require('./test-helper') var Query = helper.pg.Query const { Client } = helper const assert = require('assert') var suite = new helper.Suite() suite.test('client end during query execution of prepared statement', function (done) { var client = new Client() client.connect( assert.success(function () { var sleepQuery = 'select pg_sleep($1)' var queryConfig = { name: 'sleep query', text: sleepQuery, values: [5], } var queryInstance = new Query( queryConfig, assert.calls(function (err, result) { assert.equal(err.message, 'Connection terminated') done() }) ) var query1 = client.query(queryInstance) query1.on('error', function (err) { assert.fail('Prepared statement should not emit error') }) query1.on('row', function (row) { assert.fail('Prepared statement should not emit row') }) query1.on('end', function (err) { assert.fail('Prepared statement when executed should not return before being killed') }) client.end() }) ) }) function killIdleQuery(targetQuery, cb) { var client2 = new Client(helper.args) var pidColName = 'procpid' var queryColName = 'current_query' client2.connect( assert.success(function () { helper.versionGTE( client2, 90200, assert.success(function (isGreater) { if (isGreater) { pidColName = 'pid' queryColName = 'query' } var killIdleQuery = 'SELECT ' + pidColName + ', (SELECT pg_terminate_backend(' + pidColName + ')) AS killed FROM pg_stat_activity WHERE ' + queryColName + ' = $1' client2.query( killIdleQuery, [targetQuery], assert.calls(function (err, res) { assert.ifError(err) assert.equal(res.rows.length, 1) client2.end(cb) assert.emits(client2, 'end') }) ) }) ) }) ) } suite.test('query killed during query execution of prepared statement', function (done) { if (helper.args.native) { return done() } var client = new Client(helper.args) client.connect( assert.success(function () { var sleepQuery = 'select pg_sleep($1)' const queryConfig = { name: 'sleep query', text: sleepQuery, values: [5], } // client should emit an error because it is unexpectedly disconnected assert.emits(client, 'error') var query1 = client.query( new Query(queryConfig), assert.calls(function (err, result) { assert.equal(err.message, 'terminating connection due to administrator command') }) ) query1.on('error', function (err) { assert.fail('Prepared statement should not emit error') }) query1.on('row', function (row) { assert.fail('Prepared statement should not emit row') }) query1.on('end', function (err) { assert.fail('Prepared statement when executed should not return before being killed') }) killIdleQuery(sleepQuery, done) }) ) }) node-postgres-pg-8.14.1/packages/pg/test/integration/client/query-error-handling-tests.js000066400000000000000000000075321476604072200315410ustar00rootroot00000000000000'use strict' var helper = require('./test-helper') var Query = helper.pg.Query var DatabaseError = helper.pg.DatabaseError const assert = require('assert') const { Client } = helper const suite = new helper.Suite() suite.test('error during query execution', function () { var client = new Client(helper.args) client.connect( assert.success(function () { var queryText = 'select pg_sleep(10)' var sleepQuery = new Query(queryText) var pidColName = 'procpid' var queryColName = 'current_query' helper.versionGTE( client, 90200, assert.success(function (isGreater) { if (isGreater) { pidColName = 'pid' queryColName = 'query' } var query1 = client.query( sleepQuery, assert.calls(function (err, result) { assert(err) client.end() }) ) //ensure query1 does not emit an 'end' event //because it was killed and received an error //https://github.com/brianc/node-postgres/issues/547 query1.on('end', function () { assert.fail('Query with an error should not emit "end" event') }) setTimeout(function () { var client2 = new Client(helper.args) client2.connect( assert.success(function () { var killIdleQuery = `SELECT ${pidColName}, (SELECT pg_cancel_backend(${pidColName})) AS killed FROM pg_stat_activity WHERE ${queryColName} LIKE $1` client2.query( killIdleQuery, [queryText], assert.calls(function (err, res) { assert.ifError(err) assert(res.rows.length > 0) client2.end() assert.emits(client2, 'end') }) ) }) ) }, 300) }) ) }) ) }) if (helper.config.native) { return } suite.test('9.3 column error fields', function () { var client = new Client(helper.args) client.connect( assert.success(function () { helper.versionGTE( client, 90300, assert.success(function (isGreater) { if (!isGreater) { return client.end() } client.query('CREATE TEMP TABLE column_err_test(a int NOT NULL)') client.query('INSERT INTO column_err_test(a) VALUES (NULL)', function (err) { if (!helper.config.native) { assert(err instanceof DatabaseError) } assert.equal(err.severity, 'ERROR') assert.equal(err.code, '23502') assert.equal(err.table, 'column_err_test') assert.equal(err.column, 'a') return client.end() }) }) ) }) ) }) suite.test('9.3 constraint error fields', function () { var client = new Client(helper.args) client.connect( assert.success(function () { helper.versionGTE( client, 90300, assert.success(function (isGreater) { if (!isGreater) { console.log('skip 9.3 error field on older versions of postgres') return client.end() } client.query('CREATE TEMP TABLE constraint_err_test(a int PRIMARY KEY)') client.query('INSERT INTO constraint_err_test(a) VALUES (1)') client.query('INSERT INTO constraint_err_test(a) VALUES (1)', function (err) { if (!helper.config.native) { assert(err instanceof DatabaseError) } assert.equal(err.severity, 'ERROR') assert.equal(err.code, '23505') assert.equal(err.table, 'constraint_err_test') assert.equal(err.constraint, 'constraint_err_test_pkey') return client.end() }) }) ) }) ) }) node-postgres-pg-8.14.1/packages/pg/test/integration/client/quick-disconnect-tests.js000066400000000000000000000002351476604072200307170ustar00rootroot00000000000000'use strict' // test for issue #320 // var helper = require('./test-helper') var client = new helper.pg.Client(helper.config) client.connect() client.end() node-postgres-pg-8.14.1/packages/pg/test/integration/client/result-metadata-tests.js000066400000000000000000000026701476604072200305550ustar00rootroot00000000000000'use strict' var helper = require('./test-helper') var pg = helper.pg const assert = require('assert') const pool = new pg.Pool() new helper.Suite().test('should return insert metadata', function () { pool.connect( assert.calls(function (err, client, done) { assert(!err) helper.versionGTE( client, 90000, assert.success(function (hasRowCount) { client.query( 'CREATE TEMP TABLE zugzug(name varchar(10))', assert.calls(function (err, result) { assert(!err) assert.equal(result.oid, null) assert.equal(result.command, 'CREATE') client.query( "INSERT INTO zugzug(name) VALUES('more work?')", assert.calls(function (err, result) { assert(!err) assert.equal(result.command, 'INSERT') assert.equal(result.rowCount, 1) client.query( 'SELECT * FROM zugzug', assert.calls(function (err, result) { assert(!err) if (hasRowCount) assert.equal(result.rowCount, 1) assert.equal(result.command, 'SELECT') done() process.nextTick(pool.end.bind(pool)) }) ) }) ) }) ) }) ) }) ) }) node-postgres-pg-8.14.1/packages/pg/test/integration/client/results-as-array-tests.js000066400000000000000000000017371476604072200307020ustar00rootroot00000000000000'use strict' var util = require('util') var helper = require('./test-helper') const assert = require('assert') const suite = new helper.Suite() var Client = helper.Client var conInfo = helper.config suite.test('returns results as array', function () { var client = new Client(conInfo) var checkRow = function (row) { assert(util.isArray(row), 'row should be an array') assert.equal(row.length, 4) assert.equal(row[0].getFullYear(), new Date().getFullYear()) assert.strictEqual(row[1], 1) assert.strictEqual(row[2], 'hai') assert.strictEqual(row[3], null) } client.connect( assert.success(function () { var config = { text: 'SELECT NOW(), 1::int, $1::text, null', values: ['hai'], rowMode: 'array', } client.query( config, assert.success(function (result) { assert.equal(result.rows.length, 1) checkRow(result.rows[0]) client.end() }) ) }) ) }) node-postgres-pg-8.14.1/packages/pg/test/integration/client/row-description-on-results-tests.js000066400000000000000000000024421476604072200327170ustar00rootroot00000000000000'use strict' var helper = require('./test-helper') const assert = require('assert') const suite = new helper.Suite() var Client = helper.Client var conInfo = helper.config var checkResult = function (result) { assert(result.fields) assert.equal(result.fields.length, 3) var fields = result.fields assert.equal(fields[0].name, 'now') assert.equal(fields[1].name, 'num') assert.equal(fields[2].name, 'texty') assert.equal(fields[0].dataTypeID, 1184) assert.equal(fields[1].dataTypeID, 23) assert.equal(fields[2].dataTypeID, 25) } suite.test('row descriptions on result object', function () { var client = new Client(conInfo) client.connect( assert.success(function () { client.query( 'SELECT NOW() as now, 1::int as num, $1::text as texty', ['hello'], assert.success(function (result) { checkResult(result) client.end() }) ) }) ) }) suite.test('row description on no rows', function () { var client = new Client(conInfo) client.connect( assert.success(function () { client.query( 'SELECT NOW() as now, 1::int as num, $1::text as texty LIMIT 0', ['hello'], assert.success(function (result) { checkResult(result) client.end() }) ) }) ) }) node-postgres-pg-8.14.1/packages/pg/test/integration/client/sasl-scram-tests.js000066400000000000000000000072631476604072200275310ustar00rootroot00000000000000'use strict' const helper = require('./../test-helper') const pg = helper.pg const suite = new helper.Suite() const { native } = helper.args const assert = require('assert') /** * This test only executes if the env variables SCRAM_TEST_PGUSER and * SCRAM_TEST_PGPASSWORD are defined. You can override additional values * for the host, port and database with other SCRAM_TEST_ prefixed vars. * If the variables are not defined the test will be skipped. * * SQL to create test role: * * SET password_encryption = 'scram-sha-256'; * CREATE ROLE scram_test login password 'test4scram'; * * Add the following entries to pg_hba.conf: * * host all scram_test ::1/128 scram-sha-256 * host all scram_test 0.0.0.0/0 scram-sha-256 * * Then run this file with after exporting: * * SCRAM_TEST_PGUSER=scram_test * SCRAM_TEST_PGPASSWORD=test4scram */ // Base config for SCRAM tests const config = { user: process.env.SCRAM_TEST_PGUSER, password: process.env.SCRAM_TEST_PGPASSWORD, host: process.env.SCRAM_TEST_PGHOST, // optional port: process.env.SCRAM_TEST_PGPORT, // optional database: process.env.SCRAM_TEST_PGDATABASE, // optional } if (native) { suite.testAsync('skipping SCRAM tests (on native)', () => {}) return } if (!config.user || !config.password) { suite.testAsync('skipping SCRAM tests (missing env)', () => {}) return } suite.testAsync('can connect using sasl/scram with channel binding enabled (if using SSL)', async () => { const client = new pg.Client({ ...config, enableChannelBinding: true }) let usingChannelBinding = false let hasPeerCert = false client.connection.once('authenticationSASLContinue', () => { hasPeerCert = client.connection.stream.getPeerCertificate === 'function' usingChannelBinding = client.saslSession.mechanism === 'SCRAM-SHA-256-PLUS' }) await client.connect() assert.ok(usingChannelBinding || !hasPeerCert, 'Should be using SCRAM-SHA-256-PLUS for authentication if using SSL') await client.end() }) suite.testAsync('can connect using sasl/scram with channel binding disabled', async () => { const client = new pg.Client({ ...config, enableChannelBinding: false }) let usingSASLWithoutChannelBinding = false client.connection.once('authenticationSASLContinue', () => { usingSASLWithoutChannelBinding = client.saslSession.mechanism === 'SCRAM-SHA-256' }) await client.connect() assert.ok(usingSASLWithoutChannelBinding, 'Should be using SCRAM-SHA-256 (no channel binding) for authentication') await client.end() }) suite.testAsync('sasl/scram fails when password is wrong', async () => { const client = new pg.Client({ ...config, password: config.password + 'append-something-to-make-it-bad', }) let usingSasl = false client.connection.once('authenticationSASL', () => { usingSasl = true }) await assert.rejects( () => client.connect(), { code: '28P01', }, 'Error code should be for a password error' ) assert.ok(usingSasl, 'Should be using SASL for authentication') }) suite.testAsync('sasl/scram fails when password is empty', async () => { const client = new pg.Client({ ...config, // We use a password function here so the connection defaults do not // override the empty string value with one from process.env.PGPASSWORD password: () => '', }) let usingSasl = false client.connection.once('authenticationSASL', () => { usingSasl = true }) await assert.rejects( () => client.connect(), { message: 'SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a non-empty string', }, 'Error code should be for a password error' ) assert.ok(usingSasl, 'Should be using SASL for authentication') }) node-postgres-pg-8.14.1/packages/pg/test/integration/client/simple-query-tests.js000066400000000000000000000062311476604072200301120ustar00rootroot00000000000000'use strict' var helper = require('./test-helper') var Query = helper.pg.Query const assert = require('assert') const suite = new helper.Suite() const test = suite.test.bind(suite) // before running this test make sure you run the script create-test-tables test('simple query interface', function () { var client = helper.client() var query = client.query(new Query('select name from person order by name collate "C"')) client.on('drain', client.end.bind(client)) var rows = [] query.on('row', function (row, result) { assert.ok(result) rows.push(row['name']) }) query.once('row', function (row) { test('Can iterate through columns', function () { var columnCount = 0 // eslint-disable-next-line @typescript-eslint/no-unused-vars for (var column in row) { columnCount++ } if ('length' in row) { assert.lengthIs( row, columnCount, 'Iterating through the columns gives a different length from calling .length.' ) } }) }) assert.emits(query, 'end', function () { test('returned right number of rows', function () { assert.lengthIs(rows, 26) }) test('row ordering', function () { assert.equal(rows[0], 'Aaron') assert.equal(rows[25], 'Zanzabar') }) }) }) test('prepared statements do not mutate params', function () { var client = helper.client() var params = [1] var query = client.query(new Query('select name from person where $1 = 1 order by name collate "C"', params)) assert.deepEqual(params, [1]) client.on('drain', client.end.bind(client)) const rows = [] query.on('row', function (row, result) { assert.ok(result) rows.push(row) }) query.on('end', function (result) { assert.lengthIs(rows, 26, 'result returned wrong number of rows') assert.lengthIs(rows, result.rowCount) assert.equal(rows[0].name, 'Aaron') assert.equal(rows[25].name, 'Zanzabar') }) }) test('multiple simple queries', function () { var client = helper.client() client.query({ text: "create temp table bang(id serial, name varchar(5));insert into bang(name) VALUES('boom');" }) client.query("insert into bang(name) VALUES ('yes');") var query = client.query(new Query('select name from bang')) assert.emits(query, 'row', function (row) { assert.equal(row['name'], 'boom') assert.emits(query, 'row', function (row) { assert.equal(row['name'], 'yes') }) }) client.on('drain', client.end.bind(client)) }) test('multiple select statements', function () { var client = helper.client() client.query( 'create temp table boom(age integer); insert into boom(age) values(1); insert into boom(age) values(2); insert into boom(age) values(3)' ) client.query({ text: "create temp table bang(name varchar(5)); insert into bang(name) values('zoom');" }) var result = client.query(new Query({ text: 'select age from boom where age < 2; select name from bang' })) assert.emits(result, 'row', function (row) { assert.strictEqual(row['age'], 1) assert.emits(result, 'row', function (row) { assert.strictEqual(row['name'], 'zoom') }) }) client.on('drain', client.end.bind(client)) }) node-postgres-pg-8.14.1/packages/pg/test/integration/client/ssl-tests.js000066400000000000000000000007631476604072200262630ustar00rootroot00000000000000'use strict' const helper = require('./test-helper') const assert = require('assert') const suite = new helper.Suite() suite.test('can connect with ssl', function () { const config = { ...helper.config, ssl: { rejectUnauthorized: false, }, } const client = new helper.pg.Client(config) client.connect( assert.success(function () { client.query( 'SELECT NOW()', assert.success(function () { client.end() }) ) }) ) }) node-postgres-pg-8.14.1/packages/pg/test/integration/client/statement_timeout-tests.js000066400000000000000000000041251476604072200312300ustar00rootroot00000000000000'use strict' var helper = require('./test-helper') var Client = helper.Client const assert = require('assert') var suite = new helper.Suite() var conInfo = helper.config function getConInfo(override) { return Object.assign({}, conInfo, override) } function getStatementTimeout(conf, cb) { var client = new Client(conf) client.connect( assert.success(function () { client.query( 'SHOW statement_timeout', assert.success(function (res) { var statementTimeout = res.rows[0].statement_timeout cb(statementTimeout) client.end() }) ) }) ) } if (!helper.args.native) { // statement_timeout is not supported with the native client suite.test('No default statement_timeout ', function (done) { getConInfo() getStatementTimeout({}, function (res) { assert.strictEqual(res, '0') // 0 = no timeout done() }) }) suite.test('statement_timeout integer is used', function (done) { var conf = getConInfo({ statement_timeout: 3000, }) getStatementTimeout(conf, function (res) { assert.strictEqual(res, '3s') done() }) }) suite.test('statement_timeout float is used', function (done) { var conf = getConInfo({ statement_timeout: 3000.7, }) getStatementTimeout(conf, function (res) { assert.strictEqual(res, '3s') done() }) }) suite.test('statement_timeout string is used', function (done) { var conf = getConInfo({ statement_timeout: '3000', }) getStatementTimeout(conf, function (res) { assert.strictEqual(res, '3s') done() }) }) suite.test('statement_timeout actually cancels long running queries', function (done) { var conf = getConInfo({ statement_timeout: '10', // 10ms to keep tests running fast }) var client = new Client(conf) client.connect( assert.success(function () { client.query('SELECT pg_sleep( 1 )', function (error) { client.end() assert.strictEqual(error.code, '57014') // query_cancelled done() }) }) ) }) } node-postgres-pg-8.14.1/packages/pg/test/integration/client/test-helper.js000066400000000000000000000001171476604072200265470ustar00rootroot00000000000000'use strict' var helper = require('./../test-helper') module.exports = helper node-postgres-pg-8.14.1/packages/pg/test/integration/client/timezone-tests.js000066400000000000000000000020741476604072200273110ustar00rootroot00000000000000'use strict' var helper = require('./../test-helper') const assert = require('assert') var oldTz = process.env.TZ process.env.TZ = 'Europe/Berlin' var date = new Date() const pool = new helper.pg.Pool() const suite = new helper.Suite() pool.connect(function (err, client, done) { assert(!err) suite.test('timestamp without time zone', function (cb) { client.query('SELECT CAST($1 AS TIMESTAMP WITHOUT TIME ZONE) AS "val"', [date], function (err, result) { assert(!err) assert.equal(result.rows[0].val.getTime(), date.getTime()) cb() }) }) suite.testAsync('date comes out as a date', async function () { const { rows } = await client.query('SELECT NOW()::DATE AS date') assert(rows[0].date instanceof Date) }) suite.test('timestamp with time zone', function (cb) { client.query('SELECT CAST($1 AS TIMESTAMP WITH TIME ZONE) AS "val"', [date], function (err, result) { assert(!err) assert.equal(result.rows[0].val.getTime(), date.getTime()) done() pool.end(cb) process.env.TZ = oldTz }) }) }) node-postgres-pg-8.14.1/packages/pg/test/integration/client/transaction-tests.js000066400000000000000000000043411476604072200300030ustar00rootroot00000000000000'use strict' var helper = require('./test-helper') const suite = new helper.Suite() const pg = helper.pg const assert = require('assert') const client = new pg.Client() client.connect( assert.success(function () { client.query('begin') var getZed = { text: 'SELECT * FROM person WHERE name = $1', values: ['Zed'], } suite.test('name should not exist in the database', function (done) { client.query( getZed, assert.calls(function (err, result) { assert(!err) assert.empty(result.rows) done() }) ) }) suite.test('can insert name', (done) => { client.query( 'INSERT INTO person(name, age) VALUES($1, $2)', ['Zed', 270], assert.calls(function (err, result) { assert(!err) done() }) ) }) suite.test('name should exist in the database', function (done) { client.query( getZed, assert.calls(function (err, result) { assert(!err) assert.equal(result.rows[0].name, 'Zed') done() }) ) }) suite.test('rollback', (done) => { client.query('rollback', done) }) suite.test('name should not exist in the database', function (done) { client.query( getZed, assert.calls(function (err, result) { assert(!err) assert.empty(result.rows) client.end(done) }) ) }) }) ) suite.test('gh#36', function (cb) { const pool = new pg.Pool() pool.connect( assert.success(function (client, done) { client.query('BEGIN') client.query( { name: 'X', text: 'SELECT $1::INTEGER', values: [0], }, assert.calls(function (err, result) { if (err) throw err assert.equal(result.rows.length, 1) }) ) client.query( { name: 'X', text: 'SELECT $1::INTEGER', values: [0], }, assert.calls(function (err, result) { if (err) throw err assert.equal(result.rows.length, 1) }) ) client.query('COMMIT', function () { done() pool.end(cb) }) }) ) }) node-postgres-pg-8.14.1/packages/pg/test/integration/client/type-coercion-tests.js000066400000000000000000000141551476604072200302420ustar00rootroot00000000000000'use strict' var helper = require('./test-helper') var pg = helper.pg const suite = new helper.Suite() const assert = require('assert') var testForTypeCoercion = function (type) { const pool = new pg.Pool() suite.test(`test type coercion ${type.name}`, (cb) => { pool.connect(function (err, client, done) { assert(!err) client.query( 'create temp table test_type(col ' + type.name + ')', assert.calls(function (err, result) { assert(!err) type.values.forEach(function (val) { client.query( 'insert into test_type(col) VALUES($1)', [val], assert.calls(function (err, result) { assert(!err) }) ) var query = client.query( new pg.Query({ name: 'get type ' + type.name, text: 'select col from test_type', }) ) query.on('error', function (err) { console.log(err) throw err }) assert.emits( query, 'row', function (row) { var expected = val + ' (' + typeof val + ')' var returned = row.col + ' (' + typeof row.col + ')' assert.strictEqual(row.col, val, 'expected ' + type.name + ' of ' + expected + ' but got ' + returned) }, 'row should have been called for ' + type.name + ' of ' + val ) client.query('delete from test_type') }) client.query('drop table test_type', function () { done() pool.end(cb) }) }) ) }) }) } var types = [ { name: 'integer', values: [-2147483648, -1, 0, 1, 2147483647, null], }, { name: 'smallint', values: [-32768, -1, 0, 1, 32767, null], }, { name: 'bigint', values: [ '-9223372036854775808', '-9007199254740992', '0', '9007199254740992', '72057594037928030', '9223372036854775807', null, ], }, { name: 'varchar(5)', values: ['yo', '', 'zomg!', null], }, { name: 'oid', values: [0, 204410, null], }, { name: 'bool', values: [true, false, null], }, { name: 'numeric', values: [ '-12.34', '0', '12.34', '-3141592653589793238462643383279502.1618033988749894848204586834365638', '3141592653589793238462643383279502.1618033988749894848204586834365638', null, ], }, { name: 'real', values: [-101.3, -1.2, 0, 1.2, 101.1, null], }, { name: 'double precision', values: [-101.3, -1.2, 0, 1.2, 101.1, null], }, { name: 'timestamptz', values: [null], }, { name: 'timestamp', values: [null], }, { name: 'timetz', values: ['13:11:12.1234-05:30', null], }, { name: 'time', values: ['13:12:12.321', null], }, ] // ignore some tests in binary mode if (helper.config.binary) { types = types.filter(function (type) { return !(type.name in { real: 1, timetz: 1, time: 1, numeric: 1, bigint: 1 }) }) } types.forEach(function (type) { testForTypeCoercion(type) }) suite.test('timestamptz round trip', function (cb) { var now = new Date() var client = helper.client() client.query('create temp table date_tests(name varchar(10), tstz timestamptz(3))') client.query({ text: 'insert into date_tests(name, tstz)VALUES($1, $2)', name: 'add date', values: ['now', now], }) var result = client.query( new pg.Query({ name: 'get date', text: 'select * from date_tests where name = $1', values: ['now'], }) ) assert.emits(result, 'row', function (row) { var date = row.tstz assert.equal(date.getYear(), now.getYear()) assert.equal(date.getMonth(), now.getMonth()) assert.equal(date.getDate(), now.getDate()) assert.equal(date.getHours(), now.getHours()) assert.equal(date.getMinutes(), now.getMinutes()) assert.equal(date.getSeconds(), now.getSeconds()) assert.equal(date.getMilliseconds(), now.getMilliseconds()) }) client.on('drain', () => { client.end(cb) }) }) suite.test('selecting nulls', (cb) => { const pool = new pg.Pool() pool.connect( assert.calls(function (err, client, done) { assert.ifError(err) client.query( 'select null as res;', assert.calls(function (err, res) { assert(!err) assert.strictEqual(res.rows[0].res, null) }) ) client.query('select 7 <> $1 as res;', [null], function (err, res) { assert(!err) assert.strictEqual(res.rows[0].res, null) done() pool.end(cb) }) }) ) }) suite.test('date range extremes', function (done) { var client = helper.client() // Set the server timeszone to the same as used for the test, // otherwise (if server's timezone is ahead of GMT) in // textParsers.js::parseDate() the timezone offest is added to the date; // in the case of "275760-09-13 00:00:00 GMT" the timevalue overflows. client.query( 'SET TIMEZONE TO GMT', assert.success(function (res) { // PostgreSQL supports date range of 4713 BCE to 294276 CE // http://www.postgresql.org/docs/9.2/static/datatype-datetime.html // ECMAScript supports date range of Apr 20 271821 BCE to Sep 13 275760 CE // http://ecma-international.org/ecma-262/5.1/#sec-15.9.1.1 client.query( 'SELECT $1::TIMESTAMPTZ as when', ['275760-09-13 00:00:00 GMT'], assert.success(function (res) { assert.equal(res.rows[0].when.getFullYear(), 275760) }) ) client.query( 'SELECT $1::TIMESTAMPTZ as when', ['4713-12-31 12:31:59 BC GMT'], assert.success(function (res) { assert.equal(res.rows[0].when.getFullYear(), -4712) }) ) client.query( 'SELECT $1::TIMESTAMPTZ as when', ['275760-09-13 00:00:00 -15:00'], assert.success(function (res) { assert(isNaN(res.rows[0].when.getTime())) }) ) client.on('drain', () => { client.end(done) }) }) ) }) node-postgres-pg-8.14.1/packages/pg/test/integration/client/type-parser-override-tests.js000066400000000000000000000024331476604072200315460ustar00rootroot00000000000000'use strict' var helper = require('./test-helper') const assert = require('assert') function testTypeParser(client, expectedResult, done) { var boolValue = true client.query('CREATE TEMP TABLE parserOverrideTest(id bool)') client.query('INSERT INTO parserOverrideTest(id) VALUES ($1)', [boolValue]) client.query( 'SELECT * FROM parserOverrideTest', assert.success(function (result) { assert.equal(result.rows[0].id, expectedResult) done() }) ) } const pool = new helper.pg.Pool(helper.config) pool.connect( assert.success(function (client1, done1) { pool.connect( assert.success(function (client2, done2) { var boolTypeOID = 16 client1.setTypeParser(boolTypeOID, function () { return 'first client' }) client2.setTypeParser(boolTypeOID, function () { return 'second client' }) client1.setTypeParser(boolTypeOID, 'binary', function () { return 'first client binary' }) client2.setTypeParser(boolTypeOID, 'binary', function () { return 'second client binary' }) testTypeParser(client1, 'first client', () => { done1() testTypeParser(client2, 'second client', () => done2(), pool.end()) }) }) ) }) ) node-postgres-pg-8.14.1/packages/pg/test/integration/connection-pool/000077500000000000000000000000001476604072200256065ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg/test/integration/connection-pool/connection-pool-size-tests.js000066400000000000000000000017231476604072200333650ustar00rootroot00000000000000'use strict' const helper = require('../test-helper') const assert = require('assert') const suite = new helper.Suite() const testPoolSize = function (max) { suite.testAsync(`test ${max} queries executed on a pool rapidly`, async () => { const pool = new helper.pg.Pool({ max: 10 }) let count = 0 return new Promise((resolve) => { for (var i = 0; i < max; i++) { pool.connect(function (err, client, release) { assert(!err) client.query('SELECT * FROM NOW()') client.query('select generate_series(0, 25)', function (err, result) { assert.strictEqual(result.rows.length, 26) }) client.query('SELECT * FROM NOW()', (err) => { assert(!err) release() if (++count === max) { resolve() pool.end() } }) }) } }) }) } testPoolSize(1) testPoolSize(2) testPoolSize(40) testPoolSize(200) node-postgres-pg-8.14.1/packages/pg/test/integration/connection-pool/error-tests.js000066400000000000000000000110201476604072200304270ustar00rootroot00000000000000'use strict' var helper = require('./test-helper') const pg = helper.pg const native = helper.args.native const assert = require('assert') const suite = new helper.Suite() suite.test('connecting to invalid port', (cb) => { const pool = new pg.Pool({ port: 13801 }) pool.connect().catch((e) => cb()) }) suite.test('errors emitted on checked-out clients', (cb) => { // make pool hold 2 clients const pool = new pg.Pool({ max: 2 }) // get first client pool.connect( assert.success(function (client, done) { client.query('SELECT NOW()', function () { pool.connect( assert.success(function (client2, done2) { helper.versionGTE( client2, 90200, assert.success(function (isGreater) { var killIdleQuery = 'SELECT pid, (SELECT pg_terminate_backend(pid)) AS killed FROM pg_stat_activity WHERE state = $1' var params = ['idle'] if (!isGreater) { killIdleQuery = 'SELECT procpid, (SELECT pg_terminate_backend(procpid)) AS killed FROM pg_stat_activity WHERE current_query LIKE $1' params = ['%IDLE%'] } client.once('error', (err) => { client.on('error', (err) => {}) done(err) cb() }) // kill the connection from client client2.query( killIdleQuery, params, assert.success(function (res) { // check to make sure client connection actually was killed // return client2 to the pool done2() pool.end() }) ) }) ) }) ) }) }) ) }) suite.test('connection-level errors cause queued queries to fail', (cb) => { const pool = new pg.Pool() pool.connect( assert.success((client, done) => { client.query( 'SELECT pg_terminate_backend(pg_backend_pid())', assert.calls((err) => { if (helper.args.native) { assert.ok(err) } else { assert.equal(err.code, '57P01') } }) ) client.once( 'error', assert.calls((err) => { client.on('error', (err) => {}) }) ) client.query( 'SELECT 1', assert.calls((err) => { if (helper.args.native) { assert.equal(err.message, 'terminating connection due to administrator command') } else { assert.equal(err.message, 'Connection terminated unexpectedly') } done(err) pool.end() cb() }) ) }) ) }) suite.test('connection-level errors cause future queries to fail', (cb) => { const pool = new pg.Pool() pool.connect( assert.success((client, done) => { client.query( 'SELECT pg_terminate_backend(pg_backend_pid())', assert.calls((err) => { if (helper.args.native) { assert.ok(err) } else { assert.equal(err.code, '57P01') } }) ) client.once( 'error', assert.calls((err) => { client.on('error', (err) => {}) client.query( 'SELECT 1', assert.calls((err) => { if (helper.args.native) { assert.equal(err.message, 'terminating connection due to administrator command') } else { assert.equal(err.message, 'Client has encountered a connection error and is not queryable') } done(err) pool.end() cb() }) ) }) ) }) ) }) suite.test('handles socket error during pool.query and destroys it immediately', (cb) => { const pool = new pg.Pool({ max: 1 }) if (native) { pool.query('SELECT pg_sleep(10)', [], (err) => { assert.equal(err.message, 'canceling statement due to user request') cb() }) setTimeout(() => { pool._clients[0].native.cancel((err) => { assert.ifError(err) }) }, 100) } else { pool.query('SELECT pg_sleep(10)', [], (err) => { assert.equal(err.message, 'network issue') assert.equal(stream.destroyed, true) cb() }) const stream = pool._clients[0].connection.stream setTimeout(() => { stream.emit('error', new Error('network issue')) }, 100) } }) node-postgres-pg-8.14.1/packages/pg/test/integration/connection-pool/idle-timeout-tests.js000066400000000000000000000006231476604072200317060ustar00rootroot00000000000000'use strict' var helper = require('./test-helper') const assert = require('assert') new helper.Suite().test('idle timeout', function () { const config = Object.assign({}, helper.config, { idleTimeoutMillis: 50 }) const pool = new helper.pg.Pool(config) pool.connect( assert.calls(function (err, client, done) { assert(!err) client.query('SELECT NOW()') done() }) ) }) node-postgres-pg-8.14.1/packages/pg/test/integration/connection-pool/native-instance-tests.js000066400000000000000000000005401476604072200323730ustar00rootroot00000000000000'use strict' var helper = require('./../test-helper') var pg = helper.pg var native = helper.args.native const assert = require('assert') var pool = new pg.Pool() pool.connect( assert.calls(function (err, client, done) { if (native) { assert(client.native) } else { assert(!client.native) } done() pool.end() }) ) node-postgres-pg-8.14.1/packages/pg/test/integration/connection-pool/test-helper.js000066400000000000000000000001171476604072200303770ustar00rootroot00000000000000'use strict' var helper = require('./../test-helper') module.exports = helper node-postgres-pg-8.14.1/packages/pg/test/integration/connection-pool/tls-tests.js000066400000000000000000000010011476604072200300760ustar00rootroot00000000000000'use strict' const fs = require('fs') const helper = require('./test-helper') const pg = helper.pg const suite = new helper.Suite() if (process.env.PG_CLIENT_CERT_TEST) { suite.testAsync('client certificate', async () => { const pool = new pg.Pool({ ssl: { ca: fs.readFileSync(process.env.PGSSLROOTCERT), cert: fs.readFileSync(process.env.PGSSLCERT), key: fs.readFileSync(process.env.PGSSLKEY), }, }) await pool.query('SELECT 1') await pool.end() }) } node-postgres-pg-8.14.1/packages/pg/test/integration/connection-pool/yield-support-tests.js000066400000000000000000000010751476604072200321270ustar00rootroot00000000000000'use strict' var helper = require('./test-helper') var co = require('co') const assert = require('assert') const pool = new helper.pg.Pool() new helper.Suite().test( 'using coroutines works with promises', co.wrap(function* () { var client = yield pool.connect() var res = yield client.query('SELECT $1::text as name', ['foo']) assert.equal(res.rows[0].name, 'foo') var threw = false try { yield client.query('SELECT LKDSJDSLKFJ') } catch (e) { threw = true } assert(threw) client.release() yield pool.end() }) ) node-postgres-pg-8.14.1/packages/pg/test/integration/domain-tests.js000066400000000000000000000031431476604072200254460ustar00rootroot00000000000000'use strict' var helper = require('./test-helper') var Query = helper.pg.Query var suite = new helper.Suite() const assert = require('assert') const Pool = helper.pg.Pool suite.test('no domain', function (cb) { assert(!process.domain) const pool = new Pool() pool.connect( assert.success(function (client, done) { assert(!process.domain) done() pool.end(cb) }) ) }) suite.test('with domain', function (cb) { assert(!process.domain) const pool = new Pool() var domain = require('domain').create() domain.run(function () { var startingDomain = process.domain assert(startingDomain) pool.connect( assert.success(function (client, done) { assert(process.domain, 'no domain exists in connect callback') assert.equal(startingDomain, process.domain, 'domain was lost when checking out a client') client.query( 'SELECT NOW()', assert.success(function () { assert(process.domain, 'no domain exists in query callback') assert.equal(startingDomain, process.domain, 'domain was lost when checking out a client') done(true) process.domain.exit() pool.end(cb) }) ) }) ) }) }) suite.test('error on domain', function (cb) { var domain = require('domain').create() const pool = new Pool() domain.on('error', function () { pool.end(cb) }) domain.run(function () { pool.connect( assert.success(function (client, done) { client.query(new Query('SELECT SLDKJFLSKDJF')) client.on('drain', done) }) ) }) }) node-postgres-pg-8.14.1/packages/pg/test/integration/gh-issues/000077500000000000000000000000001476604072200244075ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg/test/integration/gh-issues/1105-tests.js000066400000000000000000000011401476604072200264670ustar00rootroot00000000000000const helper = require('../test-helper') const suite = new helper.Suite() suite.testAsync('timeout causing query crashes', async () => { const client = new helper.Client() await client.connect() await client.query('CREATE TEMP TABLE foobar( name TEXT NOT NULL, id SERIAL)') await client.query('BEGIN') await client.query("SET LOCAL statement_timeout TO '1ms'") let count = 0 while (count++ < 5000) { try { await client.query('INSERT INTO foobar(name) VALUES ($1)', [Math.random() * 1000 + '']) } catch (e) { await client.query('ROLLBACK') } } await client.end() }) node-postgres-pg-8.14.1/packages/pg/test/integration/gh-issues/130-tests.js000066400000000000000000000016161476604072200264140ustar00rootroot00000000000000'use strict' var helper = require('../test-helper') var exec = require('child_process').exec const assert = require('assert') helper.pg.defaults.poolIdleTimeout = 1000 const pool = new helper.pg.Pool() pool.connect(function (err, client, done) { assert.ifError(err) client.once('error', function (err) { client.on('error', (err) => {}) done(err) }) client.query('SELECT pg_backend_pid()', function (err, result) { assert.ifError(err) var pid = result.rows[0].pg_backend_pid var psql = 'psql' if (helper.args.host) psql = psql + ' -h ' + helper.args.host if (helper.args.port) psql = psql + ' -p ' + helper.args.port if (helper.args.user) psql = psql + ' -U ' + helper.args.user exec( psql + ' -c "select pg_terminate_backend(' + pid + ')" template1', assert.calls(function (error, stdout, stderr) { assert.ifError(error) }) ) }) }) node-postgres-pg-8.14.1/packages/pg/test/integration/gh-issues/131-tests.js000066400000000000000000000020511476604072200264070ustar00rootroot00000000000000'use strict' var helper = require('../test-helper') var pg = helper.pg const assert = require('assert') var suite = new helper.Suite() suite.test('parsing array decimal results', function (done) { const pool = new pg.Pool() pool.connect( assert.calls(function (err, client, release) { assert(!err) client.query('CREATE TEMP TABLE why(names text[], numbors integer[], decimals double precision[])') client .query( new pg.Query( 'INSERT INTO why(names, numbors, decimals) VALUES(\'{"aaron", "brian","a b c" }\', \'{1, 2, 3}\', \'{.1, 0.05, 3.654}\')' ) ) .on('error', console.log) client.query( 'SELECT decimals FROM why', assert.success(function (result) { assert.lengthIs(result.rows[0].decimals, 3) assert.equal(result.rows[0].decimals[0], 0.1) assert.equal(result.rows[0].decimals[1], 0.05) assert.equal(result.rows[0].decimals[2], 3.654) release() pool.end(done) }) ) }) ) }) node-postgres-pg-8.14.1/packages/pg/test/integration/gh-issues/1382-tests.js000066400000000000000000000015531476604072200265060ustar00rootroot00000000000000'use strict' var helper = require('./../test-helper') const suite = new helper.Suite() suite.test('calling end during active query should return a promise', (done) => { const client = new helper.pg.Client() let callCount = 0 // ensure both the query rejects and the end promise resolves const after = () => { if (++callCount > 1) { done() } } client.connect().then(() => { client.query('SELECT NOW()').catch(after) client.end().then(after) }) }) suite.test('calling end during an active query should call end callback', (done) => { const client = new helper.pg.Client() let callCount = 0 // ensure both the query rejects and the end callback fires const after = () => { if (++callCount > 1) { done() } } client.connect().then(() => { client.query('SELECT NOW()').catch(after) client.end(after) }) }) node-postgres-pg-8.14.1/packages/pg/test/integration/gh-issues/1542-tests.js000066400000000000000000000010331476604072200264750ustar00rootroot00000000000000'use strict' const helper = require('./../test-helper') const assert = require('assert') const suite = new helper.Suite() suite.testAsync('BoundPool can be subclassed', async () => { const Pool = helper.pg.Pool class SubPool extends Pool {} const subPool = new SubPool() const client = await subPool.connect() client.release() await subPool.end() assert(subPool instanceof helper.pg.Pool) }) suite.test('calling pg.Pool without new throws', () => { const Pool = helper.pg.Pool assert.throws(() => { Pool() }) }) node-postgres-pg-8.14.1/packages/pg/test/integration/gh-issues/1854-tests.js000066400000000000000000000016601476604072200265110ustar00rootroot00000000000000'use strict' var helper = require('./../test-helper') const suite = new helper.Suite() suite.test('Parameter serialization errors should not cause query to hang', (done) => { if (helper.config.native) { // pg-native cannot handle non-string parameters so skip this entirely return done() } const client = new helper.pg.Client() const expectedErr = new Error('Serialization error') client .connect() .then(() => { const obj = { toPostgres: function () { throw expectedErr }, } return client.query('SELECT $1::text', [obj]).then(() => { throw new Error('Expected a serialization error to be thrown but no error was thrown') }) }) .catch((err) => { client.end(() => {}) if (err !== expectedErr) { done(new Error('Expected a serialization error to be thrown but instead caught: ' + err)) return } done() }) }) node-postgres-pg-8.14.1/packages/pg/test/integration/gh-issues/199-tests.js000066400000000000000000000011671476604072200264340ustar00rootroot00000000000000'use strict' var helper = require('../test-helper') var client = helper.client() const assert = require('assert') client.query('CREATE TEMP TABLE arrtest (n integer, s varchar)') client.query("INSERT INTO arrtest VALUES (4, 'foo'), (5, 'bar'), (6, 'baz');") var qText = "SELECT \ ARRAY[1, 2, 3] AS b,\ ARRAY['xx', 'yy', 'zz'] AS c,\ ARRAY(SELECT n FROM arrtest) AS d,\ ARRAY(SELECT s FROM arrtest) AS e;" client.query(qText, function (err, result) { if (err) throw err var row = result.rows[0] for (var key in row) { assert.equal(typeof row[key], 'object') assert.equal(row[key].length, 3) } client.end() }) node-postgres-pg-8.14.1/packages/pg/test/integration/gh-issues/1992-tests.js000066400000000000000000000004141476604072200265100ustar00rootroot00000000000000'use strict' const helper = require('./../test-helper') const assert = require('assert') const suite = new helper.Suite() suite.test('Native should not be enumerable', () => { const keys = Object.keys(helper.pg) assert.strictEqual(keys.indexOf('native'), -1) }) node-postgres-pg-8.14.1/packages/pg/test/integration/gh-issues/2056-tests.js000066400000000000000000000012371476604072200265040ustar00rootroot00000000000000'use strict' var helper = require('./../test-helper') var assert = require('assert') const suite = new helper.Suite() suite.test('All queries should return a result array', (done) => { const client = new helper.pg.Client() client.connect() const promises = [] promises.push(client.query('CREATE TEMP TABLE foo(bar TEXT)')) promises.push(client.query('INSERT INTO foo(bar) VALUES($1)', ['qux'])) promises.push(client.query('SELECT * FROM foo WHERE bar = $1', ['foo'])) Promise.all(promises).then((results) => { results.forEach((res) => { assert(Array.isArray(res.fields)) assert(Array.isArray(res.rows)) }) client.end(done) }) }) node-postgres-pg-8.14.1/packages/pg/test/integration/gh-issues/2064-tests.js000066400000000000000000000020701476604072200264770ustar00rootroot00000000000000'use strict' const helper = require('./../test-helper') const assert = require('assert') const util = require('util') const suite = new helper.Suite() const password = 'FAIL THIS TEST' suite.test('Password should not exist in toString() output', () => { const pool = new helper.pg.Pool({ password }) const client = new helper.pg.Client({ password }) assert(pool.toString().indexOf(password) === -1) assert(client.toString().indexOf(password) === -1) }) suite.test('Password should not exist in util.inspect output', () => { const pool = new helper.pg.Pool({ password }) const client = new helper.pg.Client({ password }) const depth = 20 assert(util.inspect(pool, { depth }).indexOf(password) === -1) assert(util.inspect(client, { depth }).indexOf(password) === -1) }) suite.test('Password should not exist in json.stringfy output', () => { const pool = new helper.pg.Pool({ password }) const client = new helper.pg.Client({ password }) assert(JSON.stringify(pool).indexOf(password) === -1) assert(JSON.stringify(client).indexOf(password) === -1) }) node-postgres-pg-8.14.1/packages/pg/test/integration/gh-issues/2079-tests.js000066400000000000000000000032751476604072200265150ustar00rootroot00000000000000'use strict' var helper = require('./../test-helper') var assert = require('assert') const suite = new helper.Suite() // makes a backend server that responds with a non 'S' ssl response buffer let makeTerminatingBackend = (byte) => { const { createServer } = require('net') const server = createServer((socket) => { // attach a listener so the socket can drain // https://www.postgresql.org/docs/9.3/protocol-message-formats.html socket.on('data', (buff) => { const code = buff.readInt32BE(4) // I don't see anything in the docs about 80877104 // but libpq is sending it... if (code === 80877103 || code === 80877104) { const packet = Buffer.from(byte, 'utf-8') socket.write(packet) } }) socket.on('close', () => { server.close() }) }) server.listen() const { port } = server.address() return port } suite.test('SSL connection error allows event loop to exit', (done) => { const port = makeTerminatingBackend('N') const client = new helper.pg.Client({ ssl: 'require', port, host: 'localhost' }) // since there was a connection error the client's socket should be closed // and the event loop will have no refs and exit cleanly client.connect((err) => { assert(err instanceof Error) done() }) }) suite.test('Non "S" response code allows event loop to exit', (done) => { const port = makeTerminatingBackend('X') const client = new helper.pg.Client({ ssl: 'require', host: 'localhost', port }) // since there was a connection error the client's socket should be closed // and the event loop will have no refs and exit cleanly client.connect((err) => { assert(err instanceof Error) done() }) }) node-postgres-pg-8.14.1/packages/pg/test/integration/gh-issues/2085-tests.js000066400000000000000000000017111476604072200265030ustar00rootroot00000000000000'use strict' var helper = require('./../test-helper') var assert = require('assert') const suite = new helper.Suite() // allow skipping of this test via env var for // local testing when you don't have SSL set up if (process.env.PGTESTNOSSL) { return } suite.testAsync('it should connect over ssl', async () => { const ssl = helper.args.native ? 'require' : { rejectUnauthorized: false, } const client = new helper.pg.Client({ ssl }) await client.connect() const { rows } = await client.query('SELECT NOW()') assert.strictEqual(rows.length, 1) await client.end() }) suite.testAsync('it should fail with self-signed cert error w/o rejectUnauthorized being passed', async () => { const ssl = helper.args.native ? 'verify-ca' : {} const client = new helper.pg.Client({ ssl }) try { await client.connect() } catch (e) { return } throw new Error('this test should have thrown an error due to self-signed cert') }) node-postgres-pg-8.14.1/packages/pg/test/integration/gh-issues/2108-tests.js000066400000000000000000000005511476604072200265000ustar00rootroot00000000000000'use strict' var helper = require('./../test-helper') const suite = new helper.Suite() suite.test('Closing an unconnected client calls callback', (done) => { const client = new helper.pg.Client() client.end(done) }) suite.testAsync('Closing an unconnected client resolves promise', () => { const client = new helper.pg.Client() return client.end() }) node-postgres-pg-8.14.1/packages/pg/test/integration/gh-issues/2303-tests.js000066400000000000000000000036261476604072200265030ustar00rootroot00000000000000'use strict' const helper = require('./../test-helper') const assert = require('assert') const util = require('util') const suite = new helper.Suite() const secret_value = 'FAIL THIS TEST' suite.test('SSL Key should not exist in toString() output', () => { const pool = new helper.pg.Pool({ ssl: { key: secret_value } }) const client = new helper.pg.Client({ ssl: { key: secret_value } }) assert(pool.toString().indexOf(secret_value) === -1) assert(client.toString().indexOf(secret_value) === -1) }) suite.test('SSL Key should not exist in util.inspect output', () => { const pool = new helper.pg.Pool({ ssl: { key: secret_value } }) const client = new helper.pg.Client({ ssl: { key: secret_value } }) const depth = 20 assert(util.inspect(pool, { depth }).indexOf(secret_value) === -1) assert(util.inspect(client, { depth }).indexOf(secret_value) === -1) }) suite.test('SSL Key should not exist in json.stringfy output', () => { const pool = new helper.pg.Pool({ ssl: { key: secret_value } }) const client = new helper.pg.Client({ ssl: { key: secret_value } }) assert(JSON.stringify(pool).indexOf(secret_value) === -1) assert(JSON.stringify(client).indexOf(secret_value) === -1) }) suite.test('SSL Key should exist for direct access', () => { const pool = new helper.pg.Pool({ ssl: { key: secret_value } }) const client = new helper.pg.Client({ ssl: { key: secret_value } }) assert(pool.options.ssl.key === secret_value) assert(client.connectionParameters.ssl.key === secret_value) }) suite.test('SSL Key should exist for direct access even when non-enumerable custom config', () => { const config = { ssl: { key: secret_value } } Object.defineProperty(config.ssl, 'key', { enumerable: false }) const pool = new helper.pg.Pool(config) const client = new helper.pg.Client(config) assert(pool.options.ssl.key === secret_value) assert(client.connectionParameters.ssl.key === secret_value) }) node-postgres-pg-8.14.1/packages/pg/test/integration/gh-issues/2307-tests.js000066400000000000000000000007251476604072200265040ustar00rootroot00000000000000'use strict' const pg = require('../../../lib') const helper = require('../test-helper') const assert = require('assert') const suite = new helper.Suite() suite.test('bad ssl credentials do not cause crash', (done) => { const config = { ssl: { ca: 'invalid_value', key: 'invalid_value', cert: 'invalid_value', }, } const client = new pg.Client(config) client.connect((err) => { assert(err) client.end() done() }) }) node-postgres-pg-8.14.1/packages/pg/test/integration/gh-issues/2416-tests.js000066400000000000000000000007001476604072200264760ustar00rootroot00000000000000const helper = require('../test-helper') const assert = require('assert') const suite = new helper.Suite() suite.testAsync('it sets search_path on connection', async () => { const client = new helper.pg.Client({ options: '--search_path=foo', }) await client.connect() const { rows } = await client.query('SHOW search_path') assert.strictEqual(rows.length, 1) assert.strictEqual(rows[0].search_path, 'foo') await client.end() }) node-postgres-pg-8.14.1/packages/pg/test/integration/gh-issues/2556-tests.js000066400000000000000000000022241476604072200265060ustar00rootroot00000000000000'use strict' var helper = require('./../test-helper') var assert = require('assert') var callbackError = new Error('TEST: Throw in callback') const suite = new helper.Suite() suite.test('it should cleanup client even if an error is thrown in a callback', (done) => { // temporarily replace the test framework's uncaughtException handlers // with a custom one that ignores the callbackError let original_handlers = process.listeners('uncaughtException') process.removeAllListeners('uncaughtException') process.on('uncaughtException', (err) => { if (err != callbackError) { original_handlers[0](err) } }) // throw an error in a callback and verify that a subsequent query works without error var client = helper.client() client.query('SELECT NOW()', (err) => { assert(!err) setTimeout(reuseClient, 50) throw callbackError }) function reuseClient() { client.query('SELECT NOW()', (err) => { assert(!err) // restore the test framework's uncaughtException handlers for (let handler of original_handlers) { process.on('uncaughtException', handler) } client.end(done) }) } }) node-postgres-pg-8.14.1/packages/pg/test/integration/gh-issues/2627-tests.js000066400000000000000000000031631476604072200265100ustar00rootroot00000000000000'use strict' const net = require('net') const helper = require('./../test-helper') const assert = require('assert') const suite = new helper.Suite() const options = { host: 'localhost', port: Math.floor(Math.random() * 2000) + 2000, connectionTimeoutMillis: 2000, user: 'not', database: 'existing', } // This is the content of the packets sent by a MySQL server during the handshake. // Those were captured with the `mysql:8.0.33` docker image. const MySqlHandshake = Buffer.from( 'SgAAAAo4LjAuMjgAHwAAAB4dKyUJZ2p6AP///wIA/98VAAAAAAAAAAAA' + 'AAo1YiNJajgKKGkpfgBjYWNoaW5nX3NoYTJfcGFzc3dvcmQAIQAAAf+EBC' + 'MwOFMwMUdvdCBwYWNrZXRzIG91dCBvZiBvcmRlcg==', 'base64' ) const serverWithInvalidResponse = (port, callback) => { const sockets = new Set() const server = net.createServer((socket) => { socket.write(MySqlHandshake) // This server sends an invalid response which should throw in pg-protocol sockets.add(socket) }) let closing = false const closeServer = (done) => { if (closing) return closing = true server.close(done) for (const socket of sockets) { socket.destroy() } } server.listen(port, options.host, () => callback(closeServer)) } suite.test('client should fail to connect', (done) => { serverWithInvalidResponse(options.port, (closeServer) => { const client = new helper.Client(options) client .connect() .then(() => { done(new Error('Expected client.connect() to fail')) }) .catch((err) => { assert(err) assert(err.message.includes('invalid response')) closeServer(done) }) }) }) node-postgres-pg-8.14.1/packages/pg/test/integration/gh-issues/2716-tests.js000066400000000000000000000024041476604072200265040ustar00rootroot00000000000000'use strict' const helper = require('../test-helper') const suite = new helper.Suite() // https://github.com/brianc/node-postgres/issues/2716 suite.testAsync('client.end() should resolve if already ended', async () => { const client = new helper.pg.Client() await client.connect() // this should resolve only when the underlying socket is fully closed, both // the readable part ("end" event) & writable part ("close" event). // https://nodejs.org/docs/latest-v16.x/api/net.html#event-end // > Emitted when the other end of the socket signals the end of // > transmission, thus ending the readable side of the socket. // https://nodejs.org/docs/latest-v16.x/api/net.html#event-close_1 // > Emitted once the socket is fully closed. // here: stream = socket await client.end() // connection.end() // stream.end() // ... // stream emits "end" // not listening to this event anymore so the promise doesn't resolve yet // stream emits "close"; no more events will be emitted from the stream // connection emits "end" // promise resolved // This should now resolve immediately, rather than wait for connection.on('end') await client.end() // this should resolve immediately, rather than waiting forever await client.end() }) node-postgres-pg-8.14.1/packages/pg/test/integration/gh-issues/3062-tests.js000066400000000000000000000015101476604072200264740ustar00rootroot00000000000000'use strict' const helper = require('../test-helper') var assert = require('assert') const suite = new helper.Suite() // https://github.com/brianc/node-postgres/issues/3062 suite.testAsync('result fields with the same name should pick the last value', async () => { const client = new helper.pg.Client() await client.connect() const { rows: [shouldBeNullRow], } = await client.query('SELECT NULL AS test, 10 AS test, NULL AS test') assert.equal(shouldBeNullRow.test, null) const { rows: [shouldBeTwelveRow], } = await client.query('SELECT NULL AS test, 10 AS test, 12 AS test') assert.equal(shouldBeTwelveRow.test, 12) const { rows: [shouldBeAbcRow], } = await client.query(`SELECT NULL AS test, 10 AS test, 12 AS test, 'ABC' AS test`) assert.equal(shouldBeAbcRow.test, 'ABC') await client.end() }) node-postgres-pg-8.14.1/packages/pg/test/integration/gh-issues/3174-tests.js000066400000000000000000000120701476604072200265030ustar00rootroot00000000000000const net = require('net') const buffers = require('../../test-buffers') const helper = require('../test-helper') const assert = require('assert') const cli = require('../../cli') const suite = new helper.Suite() const options = { host: 'localhost', port: Math.floor(Math.random() * 2000) + 2000, connectionTimeoutMillis: 2000, user: 'not', database: 'existing', } const startMockServer = (port, badBuffer, callback) => { const sockets = new Set() const server = net.createServer((socket) => { sockets.add(socket) socket.once('end', () => sockets.delete(socket)) socket.on('data', (data) => { // deny request for SSL if (data.length === 8) { socket.write(Buffer.from('N', 'utf8')) return // consider all authentication requests as good } // the initial message coming in has a 0 message type for authentication negotiation if (!data[0]) { socket.write(buffers.authenticationOk()) // send ReadyForQuery `timeout` ms after authentication socket.write(buffers.readyForQuery()) return // respond with our canned response } const code = data.toString('utf8', 0, 1) switch (code) { // parse case 'P': socket.write(buffers.parseComplete()) socket.write(buffers.bindComplete()) socket.write(buffers.rowDescription()) socket.write(buffers.dataRow()) socket.write(buffers.commandComplete('FOO BAR')) socket.write(buffers.readyForQuery()) // this message is invalid, but sometimes sent out of order when using proxies or pg-bouncer setImmediate(() => { socket.write(badBuffer) }) break case 'Q': socket.write(buffers.rowDescription()) socket.write(buffers.dataRow()) socket.write(buffers.commandComplete('FOO BAR')) socket.write(buffers.readyForQuery()) // this message is invalid, but sometimes sent out of order when using proxies or pg-bouncer setImmediate(() => { socket.write(badBuffer) }) default: // console.log('got code', code) } }) }) const closeServer = () => { for (const socket of sockets) { socket.destroy() } return new Promise((resolve) => { server.close(resolve) }) } server.listen(port, options.host, () => callback(closeServer)) } const delay = (ms) => new Promise((resolve) => { setTimeout(resolve, ms) }) const testErrorBuffer = (bufferName, errorBuffer) => { suite.testAsync(`Out of order ${bufferName} on simple query is catchable`, async () => { const closeServer = await new Promise((resolve, reject) => { return startMockServer(options.port, errorBuffer, (closeServer) => resolve(closeServer)) }) const client = new helper.Client(options) await client.connect() let errorHit = false client.on('error', () => { errorHit = true }) await client.query('SELECT NOW()') await delay(50) // the native client only emits a notice message and keeps on its merry way if (!cli.native) { assert(errorHit) // further queries on the client should fail since its in an invalid state await assert.rejects(() => client.query('SELECTR NOW()'), 'Further queries on the client should reject') } await closeServer() }) suite.testAsync(`Out of order ${bufferName} on extended query is catchable`, async () => { const closeServer = await new Promise((resolve, reject) => { return startMockServer(options.port, errorBuffer, (closeServer) => resolve(closeServer)) }) const client = new helper.Client(options) await client.connect() let errorHit = false client.on('error', () => { errorHit = true }) await client.query('SELECT $1', ['foo']) await delay(40) // the native client only emits a notice message and keeps on its merry way if (!cli.native) { assert(errorHit) // further queries on the client should fail since its in an invalid state await assert.rejects(() => client.query('SELECTR NOW()'), 'Further queries on the client should reject') } await client.end() await closeServer() }) suite.testAsync(`Out of order ${bufferName} on pool is catchable`, async () => { const closeServer = await new Promise((resolve, reject) => { return startMockServer(options.port, errorBuffer, (closeServer) => resolve(closeServer)) }) const pool = new helper.pg.Pool(options) let errorHit = false pool.on('error', () => { errorHit = true }) await pool.query('SELECT $1', ['foo']) await delay(100) if (!cli.native) { assert(errorHit) assert.strictEqual(pool.idleCount, 0, 'Pool should have no idle clients') assert.strictEqual(pool.totalCount, 0, 'Pool should have no connected clients') } await pool.end() await closeServer() }) } if (!helper.args.native) { testErrorBuffer('parseComplete', buffers.parseComplete()) testErrorBuffer('commandComplete', buffers.commandComplete('f')) } node-postgres-pg-8.14.1/packages/pg/test/integration/gh-issues/507-tests.js000066400000000000000000000012031476604072200264140ustar00rootroot00000000000000'use strict' var helper = require('../test-helper') var pg = helper.pg const assert = require('assert') new helper.Suite().test('parsing array results', function (cb) { const pool = new pg.Pool() pool.connect( assert.success(function (client, done) { client.query('CREATE TEMP TABLE test_table(bar integer, "baz\'s" integer)') client.query('INSERT INTO test_table(bar, "baz\'s") VALUES(1, 1), (2, 2)') client.query('SELECT * FROM test_table', function (err, res) { assert.equal(res.rows[0]["baz's"], 1) assert.equal(res.rows[1]["baz's"], 2) done() pool.end(cb) }) }) ) }) node-postgres-pg-8.14.1/packages/pg/test/integration/gh-issues/600-tests.js000066400000000000000000000036041476604072200264150ustar00rootroot00000000000000'use strict' var async = require('async') var helper = require('../test-helper') const suite = new helper.Suite() const assert = require('assert') var db = helper.client() function createTableFoo(callback) { db.query('create temp table foo(column1 int, column2 int)', callback) } function createTableBar(callback) { db.query('create temp table bar(column1 text, column2 text)', callback) } function insertDataFoo(callback) { db.query( { name: 'insertFoo', text: 'insert into foo values($1,$2)', values: ['one', 'two'], }, callback ) } function insertDataBar(callback) { db.query( { name: 'insertBar', text: 'insert into bar values($1,$2)', values: ['one', 'two'], }, callback ) } function startTransaction(callback) { db.query('BEGIN', callback) } function endTransaction(callback) { db.query('COMMIT', callback) } function doTransaction(callback) { // The transaction runs startTransaction, then all queries, then endTransaction, // no matter if there has been an error in a query in the middle. startTransaction(function () { insertDataFoo(function () { insertDataBar(function () { endTransaction(callback) }) }) }) } var steps = [createTableFoo, createTableBar, doTransaction, insertDataBar] suite.test('test if query fails', function (done) { async.series( steps, assert.success(function () { db.end() done() }) ) }) suite.test('test if prepare works but bind fails', function (done) { var client = helper.client() var q = { text: 'SELECT $1::int as name', values: ['brian'], name: 'test', } client.query( q, assert.calls(function (err, res) { q.values = [1] client.query( q, assert.calls(function (err, res) { assert.ifError(err) client.end() done() }) ) }) ) }) node-postgres-pg-8.14.1/packages/pg/test/integration/gh-issues/675-tests.js000066400000000000000000000012331476604072200264250ustar00rootroot00000000000000'use strict' var helper = require('../test-helper') var assert = require('assert') const pool = new helper.pg.Pool() pool.connect(function (err, client, done) { if (err) throw err var c = 'CREATE TEMP TABLE posts (body TEXT)' client.query(c, function (err) { if (err) throw err c = 'INSERT INTO posts (body) VALUES ($1) RETURNING *' var body = Buffer.from('foo') client.query(c, [body], function (err) { if (err) throw err body = Buffer.from([]) client.query(c, [body], function (err, res) { done() if (err) throw err assert.equal(res.rows[0].body, '') pool.end() }) }) }) }) node-postgres-pg-8.14.1/packages/pg/test/integration/gh-issues/699-tests.js000066400000000000000000000013141476604072200264330ustar00rootroot00000000000000'use strict' var helper = require('../test-helper') var copyFrom = require('pg-copy-streams').from if (helper.args.native) return const pool = new helper.pg.Pool() pool.connect(function (err, client, done) { if (err) throw err var c = 'CREATE TEMP TABLE employee (id integer, fname varchar(400), lname varchar(400))' client.query(c, function (err) { if (err) throw err var stream = client.query(copyFrom('COPY employee FROM STDIN')) stream.on('end', function () { done() setTimeout(() => { pool.end() }, 50) }) for (var i = 1; i <= 5; i++) { var line = ['1\ttest', i, '\tuser', i, '\n'] stream.write(line.join('')) } stream.end() }) }) node-postgres-pg-8.14.1/packages/pg/test/integration/gh-issues/787-tests.js000066400000000000000000000006061476604072200264340ustar00rootroot00000000000000'use strict' var helper = require('../test-helper') const pool = new helper.pg.Pool() pool.connect(function (err, client) { var q = { name: 'This is a super long query name just so I can test that an error message is properly spit out to console.error without throwing an exception or anything', text: 'SELECT NOW()', } client.query(q, function () { client.end() }) }) node-postgres-pg-8.14.1/packages/pg/test/integration/gh-issues/882-tests.js000066400000000000000000000004451476604072200264310ustar00rootroot00000000000000'use strict' // client should not hang on an empty query var helper = require('../test-helper') var client = helper.client() client.query({ name: 'foo1', text: null }) client.query({ name: 'foo2', text: ' ' }) client.query({ name: 'foo3', text: '' }, function (err, res) { client.end() }) node-postgres-pg-8.14.1/packages/pg/test/integration/gh-issues/981-tests.js000066400000000000000000000016001476604072200264230ustar00rootroot00000000000000'use strict' var helper = require('./../test-helper') //native bindings are only installed for native tests if (!helper.args.native) { return } var assert = require('assert') var pg = require('../../../lib') var native = require('../../../lib').native var JsClient = require('../../../lib/client') var NativeClient = require('../../../lib/native') assert(pg.Client === JsClient) assert(native.Client === NativeClient) const jsPool = new pg.Pool() const nativePool = new native.Pool() const suite = new helper.Suite() suite.test('js pool returns js client', (cb) => { jsPool.connect(function (err, client, done) { assert(client instanceof JsClient) done() jsPool.end(cb) }) }) suite.test('native pool returns native client', (cb) => { nativePool.connect(function (err, client, done) { assert(client instanceof NativeClient) done() nativePool.end(cb) }) }) node-postgres-pg-8.14.1/packages/pg/test/integration/test-helper.js000066400000000000000000000013631476604072200252750ustar00rootroot00000000000000'use strict' var helper = require('./../test-helper') let { Client } = helper const assert = require('assert') if (helper.args.native) { Client = require('./../../lib/native') helper.Client = Client helper.pg = helper.pg.native } // creates a client from cli parameters helper.client = function (cb) { var client = new Client() client.connect(cb) return client } helper.versionGTE = function (client, testVersion, callback) { client.query( 'SHOW server_version_num', assert.calls(function (err, result) { if (err) return callback(err) var version = parseInt(result.rows[0].server_version_num, 10) return callback(null, version >= testVersion) }) ) } // export parent helper stuffs module.exports = helper node-postgres-pg-8.14.1/packages/pg/test/native/000077500000000000000000000000001476604072200214435ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg/test/native/callback-api-tests.js000066400000000000000000000022131476604072200254420ustar00rootroot00000000000000'use strict' var domain = require('domain') var helper = require('./../test-helper') var Client = require('./../../lib/native') const suite = new helper.Suite() const assert = require('assert') suite.test('fires callback with results', function (done) { var client = new Client(helper.config) client.connect() client.query( 'SELECT 1 as num', assert.calls(function (err, result) { assert(!err) assert.equal(result.rows[0].num, 1) assert.strictEqual(result.rowCount, 1) client.query( 'SELECT * FROM person WHERE name = $1', ['Brian'], assert.calls(function (err, result) { assert(!err) assert.equal(result.rows[0].name, 'Brian') client.end(done) }) ) }) ) }) suite.test('preserves domain', function (done) { var dom = domain.create() dom.run(function () { var client = new Client(helper.config) assert.ok(dom === require('domain').active, 'domain is active') client.connect() client.query('select 1', function () { assert.ok(dom === require('domain').active, 'domain is still active') client.end(done) }) }) }) node-postgres-pg-8.14.1/packages/pg/test/native/evented-api-tests.js000066400000000000000000000054541476604072200253520ustar00rootroot00000000000000'use strict' var helper = require('../test-helper') var Client = require('../../lib/native') var Query = Client.Query const assert = require('assert') const suite = new helper.Suite() const test = suite.test.bind(suite) var setupClient = function () { var client = new Client(helper.config) client.connect() client.query('CREATE TEMP TABLE boom(name varchar(10), age integer)') client.query("INSERT INTO boom(name, age) VALUES('Aaron', 26)") client.query("INSERT INTO boom(name, age) VALUES('Brian', 28)") return client } test('multiple results', function () { test('queued queries', function () { var client = setupClient() var q = client.query(new Query('SELECT name FROM BOOM')) assert.emits(q, 'row', function (row) { assert.equal(row.name, 'Aaron') assert.emits(q, 'row', function (row) { assert.equal(row.name, 'Brian') }) }) assert.emits(q, 'end', function () { test('query with config', function () { var q2 = client.query(new Query({ text: 'SELECT 1 as num' })) assert.emits(q2, 'row', function (row) { assert.strictEqual(row.num, 1) assert.emits(q2, 'end', function () { client.end() }) }) }) }) }) }) test('parameterized queries', function () { test('with a single string param', function () { var client = setupClient() var q = client.query(new Query('SELECT * FROM boom WHERE name = $1', ['Aaron'])) assert.emits(q, 'row', function (row) { assert.equal(row.name, 'Aaron') }) assert.emits(q, 'end', function () { client.end() }) }) test('with object config for query', function () { var client = setupClient() var q = client.query( new Query({ text: 'SELECT name FROM boom WHERE name = $1', values: ['Brian'], }) ) assert.emits(q, 'row', function (row) { assert.equal(row.name, 'Brian') }) assert.emits(q, 'end', function () { client.end() }) }) test('multiple parameters', function () { var client = setupClient() var q = client.query( new Query('SELECT name FROM boom WHERE name = $1 or name = $2 ORDER BY name COLLATE "C"', ['Aaron', 'Brian']) ) assert.emits(q, 'row', function (row) { assert.equal(row.name, 'Aaron') assert.emits(q, 'row', function (row) { assert.equal(row.name, 'Brian') assert.emits(q, 'end', function () { client.end() }) }) }) }) test('integer parameters', function () { var client = setupClient() var q = client.query(new Query('SELECT * FROM boom WHERE age > $1', [27])) assert.emits(q, 'row', function (row) { assert.equal(row.name, 'Brian') assert.equal(row.age, 28) }) assert.emits(q, 'end', function () { client.end() }) }) }) node-postgres-pg-8.14.1/packages/pg/test/native/native-connection-string-tests.js000066400000000000000000000027371476604072200301010ustar00rootroot00000000000000'use strict' var helper = require('../test-helper') var Client = require('../../lib/native') const suite = new helper.Suite() const assert = require('assert') suite.test('respects nativeConnectionString in config', function (done) { const realPort = helper.config.port const nativeConnectionString = `host=${helper.config.host} port=${helper.config.port} dbname=${helper.config.database} user=${helper.config.user} password=${helper.config.password}` // setting wrong port to make sure config is take from nativeConnectionString and not env helper.config.port = '90929' var client = new Client({ ...helper.config, nativeConnectionString, }) client.connect(function (err) { assert(!err) client.query( 'SELECT 1 as num', assert.calls(function (err, result) { assert(!err) assert.equal(result.rows[0].num, 1) assert.strictEqual(result.rowCount, 1) // restore post in case helper config will be reused helper.config.port = realPort client.end(done) }) ) }) }) suite.test('respects nativeConnectionString in config even when it is corrupted', function (done) { const nativeConnectionString = `foobar` var client = new Client({ nativeConnectionString, }) client.connect(function (err) { assert(err) assert.equal( err.message, 'missing "=" after "foobar" in connection info string\n', 'Connection error should have been thrown' ) client.end(done) }) }) node-postgres-pg-8.14.1/packages/pg/test/native/native-vs-js-error-tests.js000066400000000000000000000010451476604072200266160ustar00rootroot00000000000000'use strict' var assert = require('assert') var Client = require('../../lib/client') var NativeClient = require('../../lib/native') var client = new Client() var nativeClient = new NativeClient() client.connect() nativeClient.connect((err) => { client.query('SELECT alsdkfj', (err) => { client.end() nativeClient.query('SELECT lkdasjfasd', (nativeErr) => { for (var key in nativeErr) { assert.equal(err[key], nativeErr[key], `Expected err.${key} to equal nativeErr.${key}`) } nativeClient.end() }) }) }) node-postgres-pg-8.14.1/packages/pg/test/native/stress-tests.js000066400000000000000000000024021476604072200244620ustar00rootroot00000000000000'use strict' var helper = require('../test-helper') var Client = require('../../lib/native') var Query = Client.Query const assert = require('assert') const suite = new helper.Suite() suite.test('many rows', function () { var client = new Client(helper.config) client.connect() var q = client.query(new Query('SELECT * FROM person')) var rows = [] q.on('row', function (row) { rows.push(row) }) assert.emits(q, 'end', function () { client.end() assert.lengthIs(rows, 26) }) }) suite.test('many queries', function () { var client = new Client(helper.config) client.connect() var count = 0 var expected = 100 for (var i = 0; i < expected; i++) { var q = client.query(new Query('SELECT * FROM person')) assert.emits(q, 'end', function () { count++ }) } assert.emits(client, 'drain', function () { client.end() assert.equal(count, expected) }) }) suite.test('many clients', function () { var clients = [] for (var i = 0; i < 10; i++) { clients.push(new Client(helper.config)) } clients.forEach(function (client) { client.connect() for (var i = 0; i < 20; i++) { client.query('SELECT * FROM person') } assert.emits(client, 'drain', function () { client.end() }) }) }) node-postgres-pg-8.14.1/packages/pg/test/suite.js000066400000000000000000000037561476604072200216570ustar00rootroot00000000000000'use strict' const async = require('async') class Test { constructor(name, cb) { this.name = name this.action = cb this.timeout = 5000 } run(cb) { try { this._run(cb) } catch (e) { cb(e) } } _run(cb) { if (!this.action) { console.log(`${this.name} skipped`) return cb() } if (!this.action.length) { const result = this.action.call(this) if (!(result || 0).then) { return cb() } result.then(() => cb()).catch((err) => cb(err || new Error('Unhandled promise rejection'))) } else { this.action.call(this, cb) } } } class Suite { constructor(name) { console.log('') this._queue = async.queue(this.run.bind(this), 1) this._queue.drain = () => {} } run(test, cb) { process.stdout.write(' ' + test.name + ' ') if (!test.action) { process.stdout.write('? - SKIPPED\n') return cb() } const tid = setTimeout(() => { const err = Error(`test: ${test.name} did not complete withint ${test.timeout}ms`) console.log('\n' + err.stack) process.exit(-1) }, test.timeout) test.run((err) => { clearTimeout(tid) if (err) { process.stdout.write(`FAILED!\n\n${err.stack}\n`) process.exit(-1) } else { process.stdout.write('✔\n') cb() } }) } test(name, cb) { const test = new Test(name, cb) this._queue.push(test) } /** * Run an async test that can return a Promise. If the Promise resolves * successfully then the test will pass. If the Promise rejects with an * error then the test will be considered failed. */ testAsync(name, action) { const test = new Test(name, (cb) => { Promise.resolve() .then(action) .then(() => cb(null), cb) }) this._queue.push(test) } } process.on('unhandledRejection', (e) => { setImmediate(() => { console.error('Unhandled promise rejection') throw e }) }) module.exports = Suite node-postgres-pg-8.14.1/packages/pg/test/test-buffers.js000066400000000000000000000062001476604072200231220ustar00rootroot00000000000000'use strict' require('./test-helper') const BufferList = require('./buffer-list') // http://developer.postgresql.org/pgdocs/postgres/protocol-message-formats.html var buffers = {} buffers.readyForQuery = function () { return new BufferList().add(Buffer.from('I')).join(true, 'Z') } buffers.authenticationOk = function () { return new BufferList().addInt32(0).join(true, 'R') } buffers.authenticationCleartextPassword = function () { return new BufferList().addInt32(3).join(true, 'R') } buffers.authenticationMD5Password = function () { return new BufferList() .addInt32(5) .add(Buffer.from([1, 2, 3, 4])) .join(true, 'R') } buffers.authenticationSASL = function () { return new BufferList().addInt32(10).addCString('SCRAM-SHA-256').addCString('').join(true, 'R') } buffers.authenticationSASLContinue = function () { return new BufferList().addInt32(11).addString('data').join(true, 'R') } buffers.authenticationSASLFinal = function () { return new BufferList().addInt32(12).addString('data').join(true, 'R') } buffers.parameterStatus = function (name, value) { return new BufferList().addCString(name).addCString(value).join(true, 'S') } buffers.backendKeyData = function (processID, secretKey) { return new BufferList().addInt32(processID).addInt32(secretKey).join(true, 'K') } buffers.commandComplete = function (string) { return new BufferList().addCString(string).join(true, 'C') } buffers.rowDescription = function (fields) { fields = fields || [] var buf = new BufferList() buf.addInt16(fields.length) fields.forEach(function (field) { buf .addCString(field.name) .addInt32(field.tableID || 0) .addInt16(field.attributeNumber || 0) .addInt32(field.dataTypeID || 0) .addInt16(field.dataTypeSize || 0) .addInt32(field.typeModifier || 0) .addInt16(field.formatCode || 0) }) return buf.join(true, 'T') } buffers.dataRow = function (columns) { columns = columns || [] var buf = new BufferList() buf.addInt16(columns.length) columns.forEach(function (col) { if (col == null) { buf.addInt32(-1) } else { var strBuf = Buffer.from(col, 'utf8') buf.addInt32(strBuf.length) buf.add(strBuf) } }) return buf.join(true, 'D') } buffers.error = function (fields) { return errorOrNotice(fields).join(true, 'E') } buffers.notice = function (fields) { return errorOrNotice(fields).join(true, 'N') } var errorOrNotice = function (fields) { fields = fields || [] var buf = new BufferList() fields.forEach(function (field) { buf.addChar(field.type) buf.addCString(field.value) }) return buf.add(Buffer.from([0])) // terminator } buffers.parseComplete = function () { return new BufferList().join(true, '1') } buffers.bindComplete = function () { return new BufferList().join(true, '2') } buffers.notification = function (id, channel, payload) { return new BufferList().addInt32(id).addCString(channel).addCString(payload).join(true, 'A') } buffers.emptyQuery = function () { return new BufferList().join(true, 'I') } buffers.portalSuspended = function () { return new BufferList().join(true, 's') } module.exports = buffers node-postgres-pg-8.14.1/packages/pg/test/test-helper.js000066400000000000000000000133011476604072200227450ustar00rootroot00000000000000'use strict' const assert = require('assert') var sys = require('util') const Suite = require('./suite') const args = require('./cli') const Client = require('./../lib').Client process.on('uncaughtException', function (d) { if ('stack' in d && 'message' in d) { console.log('Message: ' + d.message) console.log(d.stack) } else { console.log(d) } process.exit(-1) }) assert.same = function (actual, expected) { for (var key in expected) { assert.equal(actual[key], expected[key]) } } assert.emits = function (item, eventName, callback, message) { var called = false var id = setTimeout(function () { test("Should have called '" + eventName + "' event", function () { assert.ok(called, message || "Expected '" + eventName + "' to be called.") }) }, 5000) item.once(eventName, function () { if (eventName === 'error') { // belt and braces test to ensure all error events return an error assert.ok( arguments[0] instanceof Error, 'Expected error events to throw instances of Error but found: ' + sys.inspect(arguments[0]) ) } called = true clearTimeout(id) assert.ok(true) if (callback) { callback.apply(item, arguments) } }) } assert.UTCDate = function (actual, year, month, day, hours, min, sec, milisecond) { var actualYear = actual.getUTCFullYear() assert.equal(actualYear, year, 'expected year ' + year + ' but got ' + actualYear) var actualMonth = actual.getUTCMonth() assert.equal(actualMonth, month, 'expected month ' + month + ' but got ' + actualMonth) var actualDate = actual.getUTCDate() assert.equal(actualDate, day, 'expected day ' + day + ' but got ' + actualDate) var actualHours = actual.getUTCHours() assert.equal(actualHours, hours, 'expected hours ' + hours + ' but got ' + actualHours) var actualMin = actual.getUTCMinutes() assert.equal(actualMin, min, 'expected min ' + min + ' but got ' + actualMin) var actualSec = actual.getUTCSeconds() assert.equal(actualSec, sec, 'expected sec ' + sec + ' but got ' + actualSec) var actualMili = actual.getUTCMilliseconds() assert.equal(actualMili, milisecond, 'expected milisecond ' + milisecond + ' but got ' + actualMili) } const spit = function (actual, expected) { console.log('') console.log('actual ' + sys.inspect(actual)) console.log('expect ' + sys.inspect(expected)) console.log('') } assert.equalBuffers = function (actual, expected) { if (actual.length != expected.length) { spit(actual, expected) assert.equal(actual.length, expected.length) } for (var i = 0; i < actual.length; i++) { if (actual[i] != expected[i]) { spit(actual, expected) } assert.equal(actual[i], expected[i]) } } assert.empty = function (actual) { assert.lengthIs(actual, 0) } assert.success = function (callback) { if (callback.length === 1 || callback.length === 0) { return assert.calls(function (err, arg) { if (err) { console.log(err) } assert(!err) callback(arg) }) } else if (callback.length === 2) { return assert.calls(function (err, arg1, arg2) { if (err) { console.log(err) } assert(!err) callback(arg1, arg2) }) } else { throw new Error('need to preserve arrity of wrapped function') } } assert.lengthIs = function (actual, expectedLength) { assert.equal(actual.length, expectedLength) } var expect = function (callback, timeout) { var executed = false timeout = timeout || parseInt(process.env.TEST_TIMEOUT) || 5000 var id = setTimeout(function () { assert.ok( executed, 'Expected execution of function to be fired within ' + timeout + ' milliseconds ' + ' (hint: export TEST_TIMEOUT=' + ' to change timeout globally)' + callback.toString() ) }, timeout) if (callback.length < 3) { return function (err, queryResult) { clearTimeout(id) if (err) { assert.ok(err instanceof Error, 'Expected errors to be instances of Error: ' + sys.inspect(err)) } callback.apply(this, arguments) } } else if (callback.length == 3) { return function (err, arg1, arg2) { clearTimeout(id) if (err) { assert.ok(err instanceof Error, 'Expected errors to be instances of Error: ' + sys.inspect(err)) } callback.apply(this, arguments) } } else { throw new Error('Unsupported arrity ' + callback.length) } } assert.calls = expect assert.isNull = function (item, message) { message = message || 'expected ' + item + ' to be null' assert.ok(item === null, message) } // print out the filename process.stdout.write(require('path').basename(process.argv[1])) if (args.binary) process.stdout.write(' (binary)') if (args.native) process.stdout.write(' (native)') process.on('exit', function () { console.log('') }) process.on('uncaughtException', function (err) { console.error('\n %s', err.stack || err.toString()) // causes xargs to abort right away process.exit(255) }) var getTimezoneOffset = Date.prototype.getTimezoneOffset var setTimezoneOffset = function (minutesOffset) { Date.prototype.getTimezoneOffset = function () { return minutesOffset } } var resetTimezoneOffset = function () { Date.prototype.getTimezoneOffset = getTimezoneOffset } const rejection = (promise) => promise.then( (value) => { throw new Error(`Promise resolved when rejection was expected; value: ${sys.inspect(value)}`) }, (error) => error ) module.exports = { Suite: Suite, pg: require('./../lib/'), args: args, config: args, sys: sys, Client: Client, setTimezoneOffset: setTimezoneOffset, resetTimezoneOffset: resetTimezoneOffset, rejection: rejection, } node-postgres-pg-8.14.1/packages/pg/test/tls/000077500000000000000000000000001476604072200207575ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg/test/tls/GNUmakefile000066400000000000000000000025511476604072200230340ustar00rootroot00000000000000DESTDIR ::= /var/lib/postgres/data POSTGRES_USER ::= postgres POSTGRES_GROUP ::= postgres DATABASE_HOST ::= localhost DATABASE_USER ::= postgres all: \ test-server-ca.crt \ test-client-ca.crt \ test-server.key \ test-server.crt \ test-client.key \ test-client.crt clean: rm -f \ test-server-ca.key \ test-client-ca.key \ test-server-ca.crt \ test-client-ca.crt \ test-server.key \ test-server.crt \ test-client.key \ test-client.crt install: test-server.crt test-server.key test-client-ca.crt install \ --owner=$(POSTGRES_USER) \ --group=$(POSTGRES_GROUP) \ --mode=0600 \ -t $(DESTDIR) \ $^ test-%-ca.crt: test-%-ca.key openssl req -new -x509 \ -subj '/CN=node-postgres test $* CA' \ -days 3650 \ -key $< \ -out $@ test-server.csr: test-server.key openssl req -new \ -subj '/CN=$(DATABASE_HOST)' \ -key $< \ -out $@ test-client.csr: test-client.key openssl req -new \ -subj '/CN=$(DATABASE_USER)' \ -key $< \ -out $@ test-%.crt: test-%.csr test-%-ca.crt test-%-ca.key openssl x509 -req \ -CA test-$*-ca.crt \ -CAkey test-$*-ca.key \ -set_serial 1 \ -days 3650 \ -in $< \ -out $@ %.key: openssl genpkey \ -algorithm EC \ -pkeyopt ec_paramgen_curve:prime256v1 \ -out $@ .PHONY: all clean install .SECONDARY: test-server-ca.key test-client-ca.key .INTERMEDIATE: test-server.csr test-client.csr .POSIX: node-postgres-pg-8.14.1/packages/pg/test/tls/test-client-ca.crt000066400000000000000000000011631476604072200243060ustar00rootroot00000000000000-----BEGIN CERTIFICATE----- MIIBozCCAUmgAwIBAgIUNYMF06PrmjsMR6x+C8k5YZn9heAwCgYIKoZIzj0EAwIw JzElMCMGA1UEAwwcbm9kZS1wb3N0Z3JlcyB0ZXN0IGNsaWVudCBDQTAeFw0yMDEw MzExOTI1NDdaFw0zMDEwMjkxOTI1NDdaMCcxJTAjBgNVBAMMHG5vZGUtcG9zdGdy ZXMgdGVzdCBjbGllbnQgQ0EwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAASI/Efx Pq0P54VKPkTUOTwBH1iuYbnLpd4kAGjb1E334/p9CEBbDREVSqDjYjWswFybxKIF ooKXtMpEMJfymJAUo1MwUTAdBgNVHQ4EFgQU/b/FRwYZ5/VMjdesIolksiqNYK4w HwYDVR0jBBgwFoAU/b/FRwYZ5/VMjdesIolksiqNYK4wDwYDVR0TAQH/BAUwAwEB /zAKBggqhkjOPQQDAgNIADBFAiEApHFCAWGbRGqYkyiBO+gMyX6gF5oFJywUupZP LfgIRDACIDBZotzPe6+BIl2fU9Xgm7CxV6cCoX8bPEJKveKMnOaN -----END CERTIFICATE----- node-postgres-pg-8.14.1/packages/pg/test/tls/test-client-ca.key000066400000000000000000000003611476604072200243050ustar00rootroot00000000000000-----BEGIN PRIVATE KEY----- MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgKsipfQWM+41FriF7 kRxVaiNi8qY1fzLx6Dp/gUQQPG6hRANCAASI/EfxPq0P54VKPkTUOTwBH1iuYbnL pd4kAGjb1E334/p9CEBbDREVSqDjYjWswFybxKIFooKXtMpEMJfymJAU -----END PRIVATE KEY----- node-postgres-pg-8.14.1/packages/pg/test/tls/test-client.crt000066400000000000000000000007051476604072200237260ustar00rootroot00000000000000-----BEGIN CERTIFICATE----- MIIBITCByAIBATAKBggqhkjOPQQDAjAnMSUwIwYDVQQDDBxub2RlLXBvc3RncmVz IHRlc3QgY2xpZW50IENBMB4XDTIwMTAzMTE5MjU0N1oXDTMwMTAyOTE5MjU0N1ow EzERMA8GA1UEAwwIcG9zdGdyZXMwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAARY 4j5AgTLi/O/UTB8l1mX+nD9u3SW9RwN1mekcqEZqCpOPMsQEQ/HLxaKnoSTD6w/G NqrBnHlbMGPwEdKvV96bMAoGCCqGSM49BAMCA0gAMEUCIQDzfjm+BzmjrsIO4QRu Et0ShHBK3Kley3oqnzoJHCUSmAIgdF5gELQ5mlJVX3bAI8h1cKiC/L6awwg7eBDU S1gBTaI= -----END CERTIFICATE----- node-postgres-pg-8.14.1/packages/pg/test/tls/test-client.key000066400000000000000000000003611476604072200237240ustar00rootroot00000000000000-----BEGIN PRIVATE KEY----- MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgL9jW07+fXy/74Ub3 579RXm0Xpo7lnNnQleSzkTEXCrmhRANCAARY4j5AgTLi/O/UTB8l1mX+nD9u3SW9 RwN1mekcqEZqCpOPMsQEQ/HLxaKnoSTD6w/GNqrBnHlbMGPwEdKvV96b -----END PRIVATE KEY----- node-postgres-pg-8.14.1/packages/pg/test/tls/test-server-ca.crt000066400000000000000000000011631476604072200243360ustar00rootroot00000000000000-----BEGIN CERTIFICATE----- MIIBozCCAUmgAwIBAgIUD582G2ou0Lg9q7AJeAMpiQVaiPQwCgYIKoZIzj0EAwIw JzElMCMGA1UEAwwcbm9kZS1wb3N0Z3JlcyB0ZXN0IHNlcnZlciBDQTAeFw0yMDEw MzExOTI1NDdaFw0zMDEwMjkxOTI1NDdaMCcxJTAjBgNVBAMMHG5vZGUtcG9zdGdy ZXMgdGVzdCBzZXJ2ZXIgQ0EwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAT/jGRh FiZu96o0hfgIkep4PusTwI6P1ASFh8LgnUu2bMcIlYakQK0ap2XvCaSl9675+Lu9 yNZaSZVA5LpFICXto1MwUTAdBgNVHQ4EFgQUHI1BK+6u7r9r1XhighuP2/eGcQUw HwYDVR0jBBgwFoAUHI1BK+6u7r9r1XhighuP2/eGcQUwDwYDVR0TAQH/BAUwAwEB /zAKBggqhkjOPQQDAgNIADBFAiALwBWN9pRpaGQ12G9ERACn8/6RtAoO4lI5RmaR rsTHtAIhAJxMfzNIgBAgX7vBSjHaqA08CozIctDSVag/rDlAzgy0 -----END CERTIFICATE----- node-postgres-pg-8.14.1/packages/pg/test/tls/test-server-ca.key000066400000000000000000000003611476604072200243350ustar00rootroot00000000000000-----BEGIN PRIVATE KEY----- MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgyUd4vHDNrEFzfttP z+AFp3Tbyui+b3i9YDW7VqpMOIKhRANCAAT/jGRhFiZu96o0hfgIkep4PusTwI6P 1ASFh8LgnUu2bMcIlYakQK0ap2XvCaSl9675+Lu9yNZaSZVA5LpFICXt -----END PRIVATE KEY----- node-postgres-pg-8.14.1/packages/pg/test/tls/test-server.crt000066400000000000000000000007051476604072200237560ustar00rootroot00000000000000-----BEGIN CERTIFICATE----- MIIBITCByQIBATAKBggqhkjOPQQDAjAnMSUwIwYDVQQDDBxub2RlLXBvc3RncmVz IHRlc3Qgc2VydmVyIENBMB4XDTIwMTAzMTE5MjU0N1oXDTMwMTAyOTE5MjU0N1ow FDESMBAGA1UEAwwJbG9jYWxob3N0MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE 4Mwi6dHeWRZ2QU19a5ykq6gJfIVJDEaJqNlWXk/5/laiGy8ScBV0YAlvk9xsfAyU YDxcQTjQkeC0bbzhdEPjNjAKBggqhkjOPQQDAgNHADBEAiB+DW/8Kg3tuoovAE+8 1Pv/8OkF3MD4A1ztULkW3KJ4PwIgMn7ea3HrEQJoeSKFe1kKIgNrHftdC5kZQYj5 uNXYpLo= -----END CERTIFICATE----- node-postgres-pg-8.14.1/packages/pg/test/tls/test-server.key000066400000000000000000000003611476604072200237540ustar00rootroot00000000000000-----BEGIN PRIVATE KEY----- MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgBoW9xxWBH2tHiPFk 9ajPALHyw0lHAY1DF8WvHQNodx2hRANCAATgzCLp0d5ZFnZBTX1rnKSrqAl8hUkM Romo2VZeT/n+VqIbLxJwFXRgCW+T3Gx8DJRgPFxBONCR4LRtvOF0Q+M2 -----END PRIVATE KEY----- node-postgres-pg-8.14.1/packages/pg/test/unit/000077500000000000000000000000001476604072200211345ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg/test/unit/client/000077500000000000000000000000001476604072200224125ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg/test/unit/client/cleartext-password-tests.js000066400000000000000000000017321476604072200277460ustar00rootroot00000000000000'use strict' const helper = require('./test-helper') const createClient = require('./test-helper').createClient const assert = require('assert') const suite = new helper.Suite() const { MemoryStream } = helper suite.test('cleartext password auth responds with password', function () { var client = createClient() client.password = '!' client.connection.stream.packets = [] client.connection.emit('authenticationCleartextPassword') var packets = client.connection.stream.packets assert.lengthIs(packets, 1) var packet = packets[0] assert.equalBuffers(packet, [0x70, 0, 0, 0, 6, 33, 0]) }) suite.test('cleartext password auth does not crash with null password using pg-pass', function () { process.env.PGPASSFILE = `${__dirname}/pgpass.file` var client = new helper.Client({ host: 'foo', port: 5432, database: 'bar', user: 'baz', stream: new MemoryStream(), }) client.connect() client.connection.emit('authenticationCleartextPassword') }) node-postgres-pg-8.14.1/packages/pg/test/unit/client/configuration-tests.js000066400000000000000000000123011476604072200267540ustar00rootroot00000000000000'use strict' const helper = require('./test-helper') const { Client } = helper var assert = require('assert') const suite = new helper.Suite() const test = suite.test.bind(suite) var pguser = process.env['PGUSER'] || process.env.USER var pgdatabase = process.env['PGDATABASE'] || process.env.USER var pgport = process.env['PGPORT'] || 5432 test('client settings', function () { test('defaults', function () { var client = new Client() assert.equal(client.user, pguser) assert.equal(client.database, pgdatabase) assert.equal(client.port, pgport) assert.equal(client.ssl, false) }) test('custom', function () { var user = 'brian' var database = 'pgjstest' var password = 'boom' var client = new Client({ user: user, database: database, port: 321, password: password, ssl: true, }) assert.equal(client.user, user) assert.equal(client.database, database) assert.equal(client.port, 321) assert.equal(client.password, password) assert.equal(client.ssl, true) }) test('custom ssl default on', function () { var old = process.env.PGSSLMODE process.env.PGSSLMODE = 'prefer' var client = new Client() process.env.PGSSLMODE = old assert.equal(client.ssl, true) }) test('custom ssl force off', function () { var old = process.env.PGSSLMODE process.env.PGSSLMODE = 'prefer' var client = new Client({ ssl: false, }) process.env.PGSSLMODE = old assert.equal(client.ssl, false) }) }) test('initializing from a config string', function () { test('uses connectionString property', function () { var client = new Client({ connectionString: 'postgres://brian:pass@host1:333/databasename', }) assert.equal(client.user, 'brian') assert.equal(client.password, 'pass') assert.equal(client.host, 'host1') assert.equal(client.port, 333) assert.equal(client.database, 'databasename') }) test('uses the correct values from the config string', function () { var client = new Client('postgres://brian:pass@host1:333/databasename') assert.equal(client.user, 'brian') assert.equal(client.password, 'pass') assert.equal(client.host, 'host1') assert.equal(client.port, 333) assert.equal(client.database, 'databasename') }) test('uses the correct values from the config string with space in password', function () { var client = new Client('postgres://brian:pass word@host1:333/databasename') assert.equal(client.user, 'brian') assert.equal(client.password, 'pass word') assert.equal(client.host, 'host1') assert.equal(client.port, 333) assert.equal(client.database, 'databasename') }) test('when not including all values the defaults are used', function () { var client = new Client('postgres://host1') assert.equal(client.user, process.env['PGUSER'] || process.env.USER) assert.equal(client.password, process.env['PGPASSWORD'] || null) assert.equal(client.host, 'host1') assert.equal(client.port, process.env['PGPORT'] || 5432) assert.equal(client.database, process.env['PGDATABASE'] || process.env.USER) }) test('when not including all values the environment variables are used', function () { var envUserDefined = process.env['PGUSER'] !== undefined var envPasswordDefined = process.env['PGPASSWORD'] !== undefined var envHostDefined = process.env['PGHOST'] !== undefined var envPortDefined = process.env['PGPORT'] !== undefined var envDBDefined = process.env['PGDATABASE'] !== undefined var savedEnvUser = process.env['PGUSER'] var savedEnvPassword = process.env['PGPASSWORD'] var savedEnvHost = process.env['PGHOST'] var savedEnvPort = process.env['PGPORT'] var savedEnvDB = process.env['PGDATABASE'] process.env['PGUSER'] = 'utUser1' process.env['PGPASSWORD'] = 'utPass1' process.env['PGHOST'] = 'utHost1' process.env['PGPORT'] = 5464 process.env['PGDATABASE'] = 'utDB1' var client = new Client('postgres://host1') assert.equal(client.user, process.env['PGUSER']) assert.equal(client.password, process.env['PGPASSWORD']) assert.equal(client.host, 'host1') assert.equal(client.port, process.env['PGPORT']) assert.equal(client.database, process.env['PGDATABASE']) if (envUserDefined) { process.env['PGUSER'] = savedEnvUser } else { delete process.env['PGUSER'] } if (envPasswordDefined) { process.env['PGPASSWORD'] = savedEnvPassword } else { delete process.env['PGPASSWORD'] } if (envDBDefined) { process.env['PGDATABASE'] = savedEnvDB } else { delete process.env['PGDATABASE'] } if (envHostDefined) { process.env['PGHOST'] = savedEnvHost } else { delete process.env['PGHOST'] } if (envPortDefined) { process.env['PGPORT'] = savedEnvPort } else { delete process.env['PGPORT'] } }) }) test('calls connect correctly on connection', function () { var client = new Client('/tmp') var usedPort = '' var usedHost = '' client.connection.connect = function (port, host) { usedPort = port usedHost = host } client.connect() assert.equal(usedPort, '/tmp/.s.PGSQL.' + pgport) assert.strictEqual(usedHost, undefined) }) node-postgres-pg-8.14.1/packages/pg/test/unit/client/early-disconnect-tests.js000066400000000000000000000007251476604072200273570ustar00rootroot00000000000000'use strict' require('./test-helper') var net = require('net') var pg = require('../../../lib/index.js') const assert = require('assert') /* console.log() messages show up in `make test` output. TODO: fix it. */ var server = net.createServer(function (c) { c.destroy() server.close() }) server.listen(7777, function () { var client = new pg.Client('postgres://localhost:7777') client.connect( assert.calls(function (err) { assert(err) }) ) }) node-postgres-pg-8.14.1/packages/pg/test/unit/client/escape-tests.js000066400000000000000000000055461476604072200253620ustar00rootroot00000000000000'use strict' var helper = require('./test-helper') var utils = require('../../../lib/utils') const assert = require('assert') const { Client, Suite } = helper const suite = new Suite() const test = suite.test.bind(suite) var testLit = function (testName, input, expected) { test(testName, function () { var client = new Client(helper.config) var actual = client.escapeLiteral(input) assert.equal(expected, actual) }) test('Client.prototype.' + testName, function () { var actual = Client.prototype.escapeLiteral(input) assert.equal(expected, actual) }) test('utils.' + testName, function () { var actual = utils.escapeLiteral(input) assert.equal(expected, actual) }) } var testIdent = function (testName, input, expected) { test(testName, function () { var client = new Client(helper.config) var actual = client.escapeIdentifier(input) assert.equal(expected, actual) }) test('Client.prototype.' + testName, function () { var actual = Client.prototype.escapeIdentifier(input) assert.equal(expected, actual) }) test('utils.' + testName, function () { var actual = utils.escapeIdentifier(input) assert.equal(expected, actual) }) } testLit('escapeLiteral: no special characters', 'hello world', "'hello world'") testLit('escapeLiteral: contains double quotes only', 'hello " world', "'hello \" world'") testLit('escapeLiteral: contains single quotes only', "hello ' world", "'hello '' world'") testLit('escapeLiteral: contains backslashes only', 'hello \\ world', " E'hello \\\\ world'") testLit('escapeLiteral: contains single quotes and double quotes', 'hello \' " world', "'hello '' \" world'") testLit('escapeLiteral: contains double quotes and backslashes', 'hello \\ " world', " E'hello \\\\ \" world'") testLit('escapeLiteral: contains single quotes and backslashes', "hello \\ ' world", " E'hello \\\\ '' world'") testLit( 'escapeLiteral: contains single quotes, double quotes, and backslashes', 'hello \\ \' " world', " E'hello \\\\ '' \" world'" ) testIdent('escapeIdentifier: no special characters', 'hello world', '"hello world"') testIdent('escapeIdentifier: contains double quotes only', 'hello " world', '"hello "" world"') testIdent('escapeIdentifier: contains single quotes only', "hello ' world", '"hello \' world"') testIdent('escapeIdentifier: contains backslashes only', 'hello \\ world', '"hello \\ world"') testIdent('escapeIdentifier: contains single quotes and double quotes', 'hello \' " world', '"hello \' "" world"') testIdent('escapeIdentifier: contains double quotes and backslashes', 'hello \\ " world', '"hello \\ "" world"') testIdent('escapeIdentifier: contains single quotes and backslashes', "hello \\ ' world", '"hello \\ \' world"') testIdent( 'escapeIdentifier: contains single quotes, double quotes, and backslashes', 'hello \\ \' " world', '"hello \\ \' "" world"' ) node-postgres-pg-8.14.1/packages/pg/test/unit/client/md5-password-tests.js000066400000000000000000000020531476604072200264350ustar00rootroot00000000000000'use strict' var helper = require('./test-helper') const BufferList = require('../../buffer-list') var crypto = require('../../../lib/crypto/utils') const assert = require('assert') const suite = new helper.Suite() const test = suite.test.bind(suite) test('md5 authentication', async function () { var client = helper.createClient() client.password = '!' var salt = Buffer.from([1, 2, 3, 4]) await client.connection.emit('authenticationMD5Password', { salt: salt }) setTimeout(() => test('responds', function () { assert.lengthIs(client.connection.stream.packets, 1) test('should have correct encrypted data', async function () { var password = await crypto.postgresMd5PasswordHash(client.user, client.password, salt) // how do we want to test this? assert.equalBuffers(client.connection.stream.packets[0], new BufferList().addCString(password).join(true, 'p')) }) }) ) }) test('md5 of utf-8 strings', async function () { assert.equal(await crypto.md5('😊'), '5deda34cd95f304948d2bc1b4a62c11e') }) node-postgres-pg-8.14.1/packages/pg/test/unit/client/notification-tests.js000066400000000000000000000005251476604072200266000ustar00rootroot00000000000000'use strict' var helper = require('./test-helper') const assert = require('assert') const suite = new helper.Suite() suite.test('passes connection notification', function () { var client = helper.client() assert.emits(client, 'notice', function (msg) { assert.equal(msg, 'HAY!!') }) client.connection.emit('notice', 'HAY!!') }) node-postgres-pg-8.14.1/packages/pg/test/unit/client/pgpass.file000066400000000000000000000000251476604072200245450ustar00rootroot00000000000000foo:5432:bar:baz:quz node-postgres-pg-8.14.1/packages/pg/test/unit/client/prepared-statement-tests.js000066400000000000000000000072361476604072200277240ustar00rootroot00000000000000'use strict' var helper = require('./test-helper') var Query = require('../../../lib/query') const assert = require('assert') var client = helper.client() const suite = new helper.Suite() const test = suite.test.bind(suite) var con = client.connection var parseArg = null con.parse = function (arg) { parseArg = arg process.nextTick(function () { con.emit('parseComplete') }) } var bindArg = null con.bind = function (arg) { bindArg = arg process.nextTick(function () { con.emit('bindComplete') }) } var executeArg = null con.execute = function (arg) { executeArg = arg process.nextTick(function () { con.emit('rowData', { fields: [] }) con.emit('commandComplete', { text: '' }) }) } var describeArg = null con.describe = function (arg) { describeArg = arg process.nextTick(function () { con.emit('rowDescription', { fields: [] }) }) } var syncCalled = false con.flush = function () {} con.sync = function () { syncCalled = true process.nextTick(function () { con.emit('readyForQuery') }) } test('bound command', function () { test('simple, unnamed bound command', function () { assert.ok(client.connection.emit('readyForQuery')) var query = client.query( new Query({ text: 'select * from X where name = $1', values: ['hi'], }) ) assert.emits(query, 'end', function () { test('parse argument', function () { assert.equal(parseArg.name, null) assert.equal(parseArg.text, 'select * from X where name = $1') assert.equal(parseArg.types, null) }) test('bind argument', function () { assert.equal(bindArg.statement, null) assert.equal(bindArg.portal, '') assert.lengthIs(bindArg.values, 1) assert.equal(bindArg.values[0], 'hi') }) test('describe argument', function () { assert.equal(describeArg.type, 'P') assert.equal(describeArg.name, '') }) test('execute argument', function () { assert.equal(executeArg.portal, '') assert.equal(executeArg.rows, null) }) test('sync called', function () { assert.ok(syncCalled) }) }) }) }) var portalClient = helper.client() var portalCon = portalClient.connection portalCon.parse = function (arg) { process.nextTick(function () { portalCon.emit('parseComplete') }) } var portalBindArg = null portalCon.bind = function (arg) { portalBindArg = arg process.nextTick(function () { portalCon.emit('bindComplete') }) } var portalExecuteArg = null portalCon.execute = function (arg) { portalExecuteArg = arg process.nextTick(function () { portalCon.emit('rowData', { fields: [] }) portalCon.emit('commandComplete', { text: '' }) }) } var portalDescribeArg = null portalCon.describe = function (arg) { portalDescribeArg = arg process.nextTick(function () { portalCon.emit('rowDescription', { fields: [] }) }) } portalCon.flush = function () {} portalCon.sync = function () { process.nextTick(function () { portalCon.emit('readyForQuery') }) } test('prepared statement with explicit portal', function () { assert.ok(portalClient.connection.emit('readyForQuery')) var query = portalClient.query( new Query({ text: 'select * from X where name = $1', portal: 'myportal', values: ['hi'], }) ) assert.emits(query, 'end', function () { test('bind argument', function () { assert.equal(portalBindArg.portal, 'myportal') }) test('describe argument', function () { assert.equal(portalDescribeArg.name, 'myportal') }) test('execute argument', function () { assert.equal(portalExecuteArg.portal, 'myportal') }) }) }) node-postgres-pg-8.14.1/packages/pg/test/unit/client/query-queue-tests.js000066400000000000000000000016131476604072200264000ustar00rootroot00000000000000'use strict' const helper = require('./test-helper') const { Client } = helper var Connection = require('../../../lib/connection') const assert = require('assert') const suite = new helper.Suite() const test = suite.test.bind(suite) test('drain', function () { var con = new Connection({ stream: 'NO' }) var client = new Client({ connection: con }) con.connect = function () { con.emit('connect') } con.query = function () {} client.connect() var raisedDrain = false client.on('drain', function () { raisedDrain = true }) client.query('hello') client.query('sup') client.query('boom') assert.equal(raisedDrain, false) con.emit('readyForQuery') assert.equal(raisedDrain, false) con.emit('readyForQuery') con.emit('readyForQuery') assert.equal(raisedDrain, false) con.emit('readyForQuery') process.nextTick(function () { assert.ok(raisedDrain) }) }) node-postgres-pg-8.14.1/packages/pg/test/unit/client/result-metadata-tests.js000066400000000000000000000024271476604072200272110ustar00rootroot00000000000000'use strict' var helper = require('./test-helper') const assert = require('assert') const suite = new helper.Suite() const test = suite.test.bind(suite) var testForTag = function (tagText, callback) { test('includes command tag data for tag ' + tagText, function () { var client = helper.client() client.connection.emit('readyForQuery') client.query( 'whatever', assert.calls((err, result) => { assert.ok(result != null, 'should pass something to this event') callback(result) }) ) assert.lengthIs(client.connection.queries, 1) client.connection.emit('commandComplete', { text: tagText, }) client.connection.emit('readyForQuery') }) } var check = function (oid, rowCount, command) { return function (result) { if (oid != null) { assert.equal(result.oid, oid) } assert.equal(result.rowCount, rowCount) assert.equal(result.command, command) } } testForTag('INSERT 0 3', check(0, 3, 'INSERT')) testForTag('INSERT 841 1', check(841, 1, 'INSERT')) testForTag('DELETE 10', check(null, 10, 'DELETE')) testForTag('UPDATE 11', check(null, 11, 'UPDATE')) testForTag('SELECT 20', check(null, 20, 'SELECT')) testForTag('COPY', check(null, null, 'COPY')) testForTag('COPY 12345', check(null, 12345, 'COPY')) node-postgres-pg-8.14.1/packages/pg/test/unit/client/sasl-scram-tests.js000066400000000000000000000226401476604072200261610ustar00rootroot00000000000000'use strict' const helper = require('./test-helper') const assert = require('assert') var sasl = require('../../../lib/crypto/sasl') const suite = new helper.Suite() suite.test('sasl/scram', function () { suite.test('startSession', function () { suite.test('fails when mechanisms does not include SCRAM-SHA-256', function () { assert.throws( function () { sasl.startSession([]) }, { message: 'SASL: Only mechanism(s) SCRAM-SHA-256 are supported', } ) }) suite.test('returns expected session data for SCRAM-SHA-256 (channel binding disabled, offered)', function () { const session = sasl.startSession(['SCRAM-SHA-256', 'SCRAM-SHA-256-PLUS']) assert.equal(session.mechanism, 'SCRAM-SHA-256') assert.equal(String(session.clientNonce).length, 24) assert.equal(session.message, 'SASLInitialResponse') assert(session.response.match(/^n,,n=\*,r=.{24}$/)) }) suite.test('returns expected session data for SCRAM-SHA-256 (channel binding enabled, not offered)', function () { const session = sasl.startSession(['SCRAM-SHA-256'], { getPeerCertificate() {} }) assert.equal(session.mechanism, 'SCRAM-SHA-256') assert.equal(String(session.clientNonce).length, 24) assert.equal(session.message, 'SASLInitialResponse') assert(session.response.match(/^y,,n=\*,r=.{24}$/)) }) suite.test('returns expected session data for SCRAM-SHA-256 (channel binding enabled, offered)', function () { const session = sasl.startSession(['SCRAM-SHA-256', 'SCRAM-SHA-256-PLUS'], { getPeerCertificate() {} }) assert.equal(session.mechanism, 'SCRAM-SHA-256-PLUS') assert.equal(String(session.clientNonce).length, 24) assert.equal(session.message, 'SASLInitialResponse') assert(session.response.match(/^p=tls-server-end-point,,n=\*,r=.{24}$/)) }) suite.test('creates random nonces', function () { const session1 = sasl.startSession(['SCRAM-SHA-256']) const session2 = sasl.startSession(['SCRAM-SHA-256']) assert(session1.clientNonce != session2.clientNonce) }) }) suite.test('continueSession', function () { suite.testAsync('fails when last session message was not SASLInitialResponse', async function () { assert.rejects( function () { return sasl.continueSession({}, '', '') }, { message: 'SASL: Last message was not SASLInitialResponse', } ) }) suite.testAsync('fails when nonce is missing in server message', function () { assert.rejects( function () { return sasl.continueSession( { message: 'SASLInitialResponse', }, 'bad-password', 's=1,i=1' ) }, { message: 'SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing', } ) }) suite.testAsync('fails when salt is missing in server message', function () { assert.rejects( function () { return sasl.continueSession( { message: 'SASLInitialResponse', }, 'bad-password', 'r=1,i=1' ) }, { message: 'SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing', } ) }) suite.testAsync('fails when client password is not a string', function () { for (const badPasswordValue of [null, undefined, 123, new Date(), {}]) { assert.rejects( function () { return sasl.continueSession( { message: 'SASLInitialResponse', clientNonce: 'a', }, badPasswordValue, 'r=1,i=1' ) }, { message: 'SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string', } ) } }) suite.testAsync('fails when client password is an empty string', function () { assert.rejects( function () { return sasl.continueSession( { message: 'SASLInitialResponse', clientNonce: 'a', }, '', 'r=1,i=1' ) }, { message: 'SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a non-empty string', } ) }) suite.testAsync('fails when iteration is missing in server message', function () { assert.rejects( function () { return sasl.continueSession( { message: 'SASLInitialResponse', }, 'bad-password', 'r=1,s=abcd' ) }, { message: 'SASL: SCRAM-SERVER-FIRST-MESSAGE: iteration missing', } ) }) suite.testAsync('fails when server nonce does not start with client nonce', function () { assert.rejects( function () { return sasl.continueSession( { message: 'SASLInitialResponse', clientNonce: '2', }, 'bad-password', 'r=1,s=abcd,i=1' ) }, { message: 'SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce', } ) }) suite.testAsync('sets expected session data (SCRAM-SHA-256)', async function () { const session = { message: 'SASLInitialResponse', clientNonce: 'a', } await sasl.continueSession(session, 'password', 'r=ab,s=abcd,i=1') assert.equal(session.message, 'SASLResponse') assert.equal(session.serverSignature, 'jwt97IHWFn7FEqHykPTxsoQrKGOMXJl/PJyJ1JXTBKc=') assert.equal(session.response, 'c=biws,r=ab,p=mU8grLfTjDrJer9ITsdHk0igMRDejG10EJPFbIBL3D0=') }) suite.testAsync('sets expected session data (SCRAM-SHA-256, channel binding enabled)', async function () { const session = { message: 'SASLInitialResponse', clientNonce: 'a', } await sasl.continueSession(session, 'password', 'r=ab,s=abcd,i=1', { getPeerCertificate() {} }) assert.equal(session.message, 'SASLResponse') assert.equal(session.serverSignature, 'ETpURSc5OpddrPRSW3LaDPJzUzhh+rciM4uYwXSsohU=') assert.equal(session.response, 'c=eSws,r=ab,p=YVTEOwOD7khu/NulscjFegHrZoTXJBFI/7L61AN9khc=') }) suite.testAsync('sets expected session data (SCRAM-SHA-256-PLUS)', async function () { const session = { message: 'SASLInitialResponse', mechanism: 'SCRAM-SHA-256-PLUS', clientNonce: 'a', } await sasl.continueSession(session, 'password', 'r=ab,s=abcd,i=1', { getPeerCertificate() { return { raw: Buffer.from([ // a minimal ASN.1 certificate structure which can be parsed for a hash type 0x30, // cert ASN.1 seq 0x16, // cert length (all bytes below) 0x30, // cert info ASN.1 seq 0x01, // cert info length 0x00, // cert info (skipped) 0x30, // signature algorithm ASN.1 seq 0x0d, // signature algorithm length 0x06, // ASN.1 OID 0x09, // OID length 0x2a, // OID: 1.2.840.113549.1.1.11 (RSASSA-PKCS1-v1_5 / SHA-256​) 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, // ASN.1 null (no algorithm parameters) 0x00, // null length 0x03, // ASN.1 bitstring (signature) 0x02, // bitstring length 0x00, // zero right-padding bits 0xff, // one-byte signature ]), } }, }) assert.equal(session.message, 'SASLResponse') assert.equal(session.serverSignature, 'pU1hc6JkjvjO8Wd+o0/jyGjc1DpITtsx1UF+ZPa5u5M=') assert.equal( session.response, 'c=cD10bHMtc2VydmVyLWVuZC1wb2ludCwsmwepqKDDRcOvo3BN0rplYMfLUTpbaf38btkM5aAXBhQ=,r=ab,p=j0v2LsthoNaIBrKV4YipskF/lV8zWEt6acNRtt99MA4=' ) }) }) suite.test('finalizeSession', function () { suite.test('fails when last session message was not SASLResponse', function () { assert.throws( function () { sasl.finalizeSession({}) }, { message: 'SASL: Last message was not SASLResponse', } ) }) suite.test('fails when server signature is not valid base64', function () { assert.throws( function () { sasl.finalizeSession( { message: 'SASLResponse', serverSignature: 'abcd', }, 'v=x1' // Purposefully invalid base64 ) }, { message: 'SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature must be base64', } ) }) suite.test('fails when server signature does not match', function () { assert.throws( function () { sasl.finalizeSession( { message: 'SASLResponse', serverSignature: 'abcd', }, 'v=xyzq' ) }, { message: 'SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature does not match', } ) }) suite.test('does not fail when eveything is ok', function () { sasl.finalizeSession( { message: 'SASLResponse', serverSignature: 'abcd', }, 'v=abcd' ) }) }) }) node-postgres-pg-8.14.1/packages/pg/test/unit/client/set-keepalives-tests.js000066400000000000000000000013421476604072200270310ustar00rootroot00000000000000'use strict' const net = require('net') const pg = require('../../../lib/index.js') const helper = require('./test-helper') const assert = require('assert') const suite = new helper.Suite() suite.test('setting keep alive', (done) => { const server = net.createServer((c) => { c.destroy() server.close() }) server.listen(7777, () => { const stream = new net.Socket() stream.setKeepAlive = (enable, initialDelay) => { assert(enable === true) assert(initialDelay === 10000) done() } const client = new pg.Client({ host: 'localhost', port: 7777, keepAlive: true, keepAliveInitialDelayMillis: 10000, stream, }) client.connect().catch(() => {}) }) }) node-postgres-pg-8.14.1/packages/pg/test/unit/client/simple-query-tests.js000066400000000000000000000102201476604072200265370ustar00rootroot00000000000000'use strict' var helper = require('./test-helper') var Query = require('../../../lib/query') const assert = require('assert') const suite = new helper.Suite() const test = suite.test.bind(suite) test('executing query', function () { test('queing query', function () { test('when connection is ready', function () { var client = helper.client() assert.empty(client.connection.queries) client.connection.emit('readyForQuery') client.query('yes') assert.lengthIs(client.connection.queries, 1) assert.equal(client.connection.queries, 'yes') }) test('when connection is not ready', function () { var client = helper.client() test('query is not sent', function () { client.query('boom') assert.empty(client.connection.queries) }) test('sends query to connection once ready', function () { assert.ok(client.connection.emit('readyForQuery')) assert.lengthIs(client.connection.queries, 1) assert.equal(client.connection.queries[0], 'boom') }) }) test('multiple in the queue', function () { var client = helper.client() var connection = client.connection var queries = connection.queries client.query('one') client.query('two') client.query('three') assert.empty(queries) test('after one ready for query', function () { connection.emit('readyForQuery') assert.lengthIs(queries, 1) assert.equal(queries[0], 'one') }) test('after two ready for query', function () { connection.emit('readyForQuery') assert.lengthIs(queries, 2) }) test('after a bunch more', function () { connection.emit('readyForQuery') connection.emit('readyForQuery') connection.emit('readyForQuery') assert.lengthIs(queries, 3) assert.equal(queries[0], 'one') assert.equal(queries[1], 'two') assert.equal(queries[2], 'three') }) }) }) test('query event binding and flow', function () { var client = helper.client() var con = client.connection var query = client.query(new Query('whatever')) test('has no queries sent before ready', function () { assert.empty(con.queries) }) test('sends query on readyForQuery event', function () { con.emit('readyForQuery') assert.lengthIs(con.queries, 1) assert.equal(con.queries[0], 'whatever') }) test('handles rowDescription message', function () { var handled = con.emit('rowDescription', { fields: [ { name: 'boom', }, ], }) assert.ok(handled, 'should have handlded rowDescription') }) test('handles dataRow messages', function () { assert.emits(query, 'row', function (row) { assert.equal(row['boom'], 'hi') }) var handled = con.emit('dataRow', { fields: ['hi'] }) assert.ok(handled, 'should have handled first data row message') assert.emits(query, 'row', function (row) { assert.equal(row['boom'], 'bye') }) var handledAgain = con.emit('dataRow', { fields: ['bye'] }) assert.ok(handledAgain, 'should have handled seciond data row message') }) // multiple command complete messages will be sent // when multiple queries are in a simple command test('handles command complete messages', function () { con.emit('commandComplete', { text: 'INSERT 31 1', }) }) }) test('handles errors', function () { var client = helper.client() test('throws an error when config is null', function () { try { client.query(null, undefined) } catch (error) { assert.equal( error.message, 'Client was passed a null or undefined query', 'Should have thrown an Error for null queries' ) } }) test('throws an error when config is undefined', function () { try { client.query() } catch (error) { assert.equal( error.message, 'Client was passed a null or undefined query', 'Should have thrown an Error for null queries' ) } }) }) }) node-postgres-pg-8.14.1/packages/pg/test/unit/client/stream-and-query-error-interaction-tests.js000066400000000000000000000020771476604072200327600ustar00rootroot00000000000000'use strict' const helper = require('./test-helper') var Connection = require('../../../lib/connection') var Client = require('../../../lib/client') const assert = require('assert') const suite = new helper.Suite() suite.test('emits end when not in query', function () { var stream = new (require('events').EventEmitter)() stream.setNoDelay = () => {} stream.connect = function () { // NOOP } stream.write = function () { // NOOP } var client = new Client({ connection: new Connection({ stream: stream }) }) client.connect( assert.calls(function () { client.query( 'SELECT NOW()', assert.calls(function (err, result) { assert(err) }) ) }) ) assert.emits(client, 'error') assert.emits(client, 'end') client.connection.emit('connect') process.nextTick(function () { client.connection.emit('readyForQuery') assert.equal(client.queryQueue.length, 0) assert(client.activeQuery, 'client should have issued query') process.nextTick(function () { stream.emit('close') }) }) }) node-postgres-pg-8.14.1/packages/pg/test/unit/client/test-helper.js000066400000000000000000000011171476604072200252040ustar00rootroot00000000000000'use strict' var helper = require('../test-helper') var Connection = require('../../../lib/connection') const { Client } = helper var makeClient = function () { var connection = new Connection({ stream: 'no' }) connection.startup = function () {} connection.connect = function () {} connection.query = function (text) { this.queries.push(text) } connection.queries = [] var client = new Client({ connection: connection }) client.connect() client.connection.emit('connect') return client } module.exports = Object.assign( { client: makeClient, }, helper ) node-postgres-pg-8.14.1/packages/pg/test/unit/client/throw-in-type-parser-tests.js000066400000000000000000000030261476604072200301310ustar00rootroot00000000000000'use strict' var helper = require('./test-helper') var Query = require('../../../lib/query') var types = require('pg-types') const assert = require('assert') const suite = new helper.Suite() var typeParserError = new Error('TEST: Throw in type parsers') types.setTypeParser('special oid that will throw', function () { throw typeParserError }) const emitFakeEvents = (con) => { setImmediate(() => { con.emit('readyForQuery') con.emit('rowDescription', { fields: [ { name: 'boom', dataTypeID: 'special oid that will throw', }, ], }) con.emit('dataRow', { fields: ['hi'] }) con.emit('dataRow', { fields: ['hi'] }) con.emit('commandComplete', { text: 'INSERT 31 1' }) con.emit('readyForQuery') }) } suite.test('emits error', function (done) { var client = helper.client() var con = client.connection var query = client.query(new Query('whatever')) emitFakeEvents(con) assert.emits(query, 'error', function (err) { assert.equal(err, typeParserError) done() }) }) suite.test('calls callback with error', function (done) { var client = helper.client() var con = client.connection emitFakeEvents(con) client.query('whatever', function (err) { assert.equal(err, typeParserError) done() }) }) suite.test('rejects promise with error', function (done) { var client = helper.client() var con = client.connection emitFakeEvents(con) client.query('whatever').catch((err) => { assert.equal(err, typeParserError) done() }) }) node-postgres-pg-8.14.1/packages/pg/test/unit/connection-parameters/000077500000000000000000000000001476604072200254345ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg/test/unit/connection-parameters/creation-tests.js000066400000000000000000000261631476604072200307460ustar00rootroot00000000000000'use strict' const helper = require('../test-helper') const assert = require('assert') const ConnectionParameters = require('../../../lib/connection-parameters') const defaults = require('../../../lib').defaults const dns = require('dns') // clear process.env for (var key in process.env) { delete process.env[key] } const suite = new helper.Suite() suite.test('ConnectionParameters construction', function () { assert.ok(new ConnectionParameters(), 'with null config') assert.ok(new ConnectionParameters({ user: 'asdf' }), 'with config object') assert.ok(new ConnectionParameters('postgres://localhost/postgres'), 'with connection string') }) var compare = function (actual, expected, type) { const expectedDatabase = expected.database === undefined ? expected.user : expected.database assert.equal(actual.user, expected.user, type + ' user') assert.equal(actual.database, expectedDatabase, type + ' database') assert.equal(actual.port, expected.port, type + ' port') assert.equal(actual.host, expected.host, type + ' host') assert.equal(actual.password, expected.password, type + ' password') assert.equal(actual.binary, expected.binary, type + ' binary') assert.equal(actual.statement_timeout, expected.statement_timeout, type + ' statement_timeout') assert.equal(actual.lock_timeout, expected.lock_timeout, type + ' lock_timeout') assert.equal(actual.options, expected.options, type + ' options') assert.equal( actual.idle_in_transaction_session_timeout, expected.idle_in_transaction_session_timeout, type + ' idle_in_transaction_session_timeout' ) } suite.test('ConnectionParameters initializing from defaults', function () { var subject = new ConnectionParameters() compare(subject, defaults, 'defaults') assert.ok(subject.isDomainSocket === false) }) suite.test('ConnectionParameters initializing from defaults with connectionString set', function () { var config = { user: 'brians-are-the-best', database: 'scoobysnacks', port: 7777, password: 'mypassword', host: 'foo.bar.net', binary: defaults.binary, statement_timeout: false, lock_timeout: false, idle_in_transaction_session_timeout: false, options: '-c geqo=off', } var original_value = defaults.connectionString // Just changing this here doesn't actually work because it's no longer in scope when viewed inside of // of ConnectionParameters() so we have to pass in the defaults explicitly to test it defaults.connectionString = 'postgres://brians-are-the-best:mypassword@foo.bar.net:7777/scoobysnacks?options=-c geqo=off' var subject = new ConnectionParameters(defaults) defaults.connectionString = original_value compare(subject, config, 'defaults-connectionString') }) suite.test('ConnectionParameters initializing from config', function () { var config = { user: 'brian', database: 'home', port: 7777, password: 'pizza', binary: true, encoding: 'utf8', host: 'yo', ssl: { asdf: 'blah', }, statement_timeout: 15000, lock_timeout: 15000, idle_in_transaction_session_timeout: 15000, options: '-c geqo=off', } var subject = new ConnectionParameters(config) compare(subject, config, 'config') assert.ok(subject.isDomainSocket === false) }) suite.test('ConnectionParameters initializing from config and config.connectionString', function () { var subject1 = new ConnectionParameters({ connectionString: 'postgres://test@host/db', }) var subject2 = new ConnectionParameters({ connectionString: 'postgres://test@host/db?ssl=1', }) var subject3 = new ConnectionParameters({ connectionString: 'postgres://test@host/db', ssl: true, }) var subject4 = new ConnectionParameters({ connectionString: 'postgres://test@host/db?ssl=1', ssl: false, }) assert.equal(subject1.ssl, false) assert.equal(subject2.ssl, true) assert.equal(subject3.ssl, true) assert.equal(subject4.ssl, true) }) suite.test('escape spaces if present', function () { var subject = new ConnectionParameters('postgres://localhost/post gres') assert.equal(subject.database, 'post gres') }) suite.test('do not double escape spaces', function () { var subject = new ConnectionParameters('postgres://localhost/post%20gres') assert.equal(subject.database, 'post gres') }) suite.test('initializing with unix domain socket', function () { var subject = new ConnectionParameters('/var/run/') assert.ok(subject.isDomainSocket) assert.equal(subject.host, '/var/run/') assert.equal(subject.database, defaults.user) }) suite.test('initializing with unix domain socket and a specific database, the simple way', function () { var subject = new ConnectionParameters('/var/run/ mydb') assert.ok(subject.isDomainSocket) assert.equal(subject.host, '/var/run/') assert.equal(subject.database, 'mydb') }) suite.test('initializing with unix domain socket, the health way', function () { var subject = new ConnectionParameters('socket:/some path/?db=my[db]&encoding=utf8') assert.ok(subject.isDomainSocket) assert.equal(subject.host, '/some path/') assert.equal(subject.database, 'my[db]', 'must to be escaped and unescaped trough "my%5Bdb%5D"') assert.equal(subject.client_encoding, 'utf8') }) suite.test('initializing with unix domain socket, the escaped health way', function () { var subject = new ConnectionParameters('socket:/some%20path/?db=my%2Bdb&encoding=utf8') assert.ok(subject.isDomainSocket) assert.equal(subject.host, '/some path/') assert.equal(subject.database, 'my+db') assert.equal(subject.client_encoding, 'utf8') }) var checkForPart = function (array, part) { assert.ok(array.indexOf(part) > -1, array.join(' ') + ' did not contain ' + part) } const getDNSHost = async function (host) { return new Promise((resolve, reject) => { dns.lookup(host, (err, addresses) => { err ? reject(err) : resolve(addresses) }) }) } suite.testAsync('builds simple string', async function () { var config = { user: 'brian', password: 'xyz', host: 'localhost', port: 888, database: 'bam', } var subject = new ConnectionParameters(config) const dnsHost = await getDNSHost(config.host) return new Promise((resolve) => { subject.getLibpqConnectionString(function (err, constring) { assert(!err) var parts = constring.split(' ') checkForPart(parts, "user='brian'") checkForPart(parts, "password='xyz'") checkForPart(parts, `hostaddr='${dnsHost}'`) checkForPart(parts, "port='888'") checkForPart(parts, "dbname='bam'") resolve() }) }) }) suite.test('builds dns string', async function () { var config = { user: 'brian', password: 'asdf', host: 'localhost', port: 5432, } var subject = new ConnectionParameters(config) const dnsHost = await getDNSHost(config.host) return new Promise((resolve) => { subject.getLibpqConnectionString(function (err, constring) { assert(!err) var parts = constring.split(' ') checkForPart(parts, "user='brian'") checkForPart(parts, `hostaddr='${dnsHost}'`) resolve() }) }) }) suite.test('error when dns fails', function () { var config = { user: 'brian', password: 'asf', host: 'asdlfkjasldfkksfd#!$!!!!..com', port: 5432, } var subject = new ConnectionParameters(config) subject.getLibpqConnectionString( assert.calls(function (err, constring) { assert.ok(err) assert.isNull(constring) }) ) }) suite.test('connecting to unix domain socket', function () { var config = { user: 'brian', password: 'asf', host: '/tmp/', port: 5432, } var subject = new ConnectionParameters(config) subject.getLibpqConnectionString( assert.calls(function (err, constring) { assert(!err) var parts = constring.split(' ') checkForPart(parts, "user='brian'") checkForPart(parts, "host='/tmp/'") }) ) }) suite.test('config contains quotes and backslashes', function () { var config = { user: 'not\\brian', password: "bad'chars", host: '/tmp/', port: 5432, } var subject = new ConnectionParameters(config) subject.getLibpqConnectionString( assert.calls(function (err, constring) { assert(!err) var parts = constring.split(' ') checkForPart(parts, "user='not\\\\brian'") checkForPart(parts, "password='bad\\'chars'") }) ) }) suite.test('encoding can be specified by config', function () { var config = { client_encoding: 'utf-8', } var subject = new ConnectionParameters(config) subject.getLibpqConnectionString( assert.calls(function (err, constring) { assert(!err) var parts = constring.split(' ') checkForPart(parts, "client_encoding='utf-8'") }) ) }) suite.test('password contains < and/or > characters', function () { var sourceConfig = { user: 'brian', password: 'helloe', host: 'localhost', port: 5432, database: 'postgres', } var connectionString = 'postgres://' + sourceConfig.user + ':' + sourceConfig.password + '@' + sourceConfig.host + ':' + sourceConfig.port + '/' + sourceConfig.database var subject = new ConnectionParameters(connectionString) assert.equal(subject.password, sourceConfig.password) }) suite.test('username or password contains weird characters', function () { var defaults = require('../../../lib/defaults') defaults.ssl = true var strang = 'pg://my f%irst name:is&%awesome!@localhost:9000' var subject = new ConnectionParameters(strang) assert.equal(subject.user, 'my f%irst name') assert.equal(subject.password, 'is&%awesome!') assert.equal(subject.host, 'localhost') assert.equal(subject.ssl, true) }) suite.test('url is properly encoded', function () { var encoded = 'pg://bi%25na%25%25ry%20:s%40f%23@localhost/%20u%2520rl' var subject = new ConnectionParameters(encoded) assert.equal(subject.user, 'bi%na%%ry ') assert.equal(subject.password, 's@f#') assert.equal(subject.host, 'localhost') assert.equal(subject.database, ' u%20rl') }) suite.test('ssl is set on client', function () { var Client = require('../../../lib/client') var defaults = require('../../../lib/defaults') defaults.ssl = true var c = new Client('postgres://user:password@host/database') assert(c.ssl, 'Client should have ssl enabled via defaults') }) suite.test('coercing string "true" to boolean', function () { const subject = new ConnectionParameters({ ssl: 'true' }) assert.strictEqual(subject.ssl, true) }) suite.test('ssl is set on client', function () { var sourceConfig = { user: 'brian', password: 'helloe', host: 'localhost', port: 5432, database: 'postgres', ssl: { sslmode: 'verify-ca', sslca: '/path/ca.pem', sslkey: '/path/cert.key', sslcert: '/path/cert.crt', sslrootcert: '/path/root.crt', }, } var defaults = require('../../../lib/defaults') defaults.ssl = true var c = new ConnectionParameters(sourceConfig) c.getLibpqConnectionString( assert.calls(function (err, pgCString) { assert(!err) assert.equal( pgCString.indexOf("sslrootcert='/path/root.crt'") !== -1, true, 'libpqConnectionString should contain sslrootcert' ) }) ) }) node-postgres-pg-8.14.1/packages/pg/test/unit/connection-parameters/environment-variable-tests.js000066400000000000000000000076221476604072200332700ustar00rootroot00000000000000'use strict' const Suite = require('../../suite') var assert = require('assert') var ConnectionParameters = require('../../../lib/connection-parameters') var defaults = require('../../../lib').defaults // clear process.env var realEnv = {} for (var key in process.env) { realEnv[key] = process.env[key] delete process.env[key] } const suite = new Suite('ConnectionParameters') const clearEnv = () => { // clear process.env for (var key in process.env) { delete process.env[key] } } suite.test('ConnectionParameters initialized from environment variables', function () { clearEnv() process.env['PGHOST'] = 'local' process.env['PGUSER'] = 'bmc2' process.env['PGPORT'] = 7890 process.env['PGDATABASE'] = 'allyerbase' process.env['PGPASSWORD'] = 'open' var subject = new ConnectionParameters() assert.equal(subject.host, 'local', 'env host') assert.equal(subject.user, 'bmc2', 'env user') assert.equal(subject.port, 7890, 'env port') assert.equal(subject.database, 'allyerbase', 'env database') assert.equal(subject.password, 'open', 'env password') }) suite.test('ConnectionParameters initialized from mix', function () { clearEnv() process.env['PGHOST'] = 'local' process.env['PGUSER'] = 'bmc2' process.env['PGPORT'] = 7890 process.env['PGDATABASE'] = 'allyerbase' process.env['PGPASSWORD'] = 'open' delete process.env['PGPASSWORD'] delete process.env['PGDATABASE'] var subject = new ConnectionParameters({ user: 'testing', database: 'zugzug', }) assert.equal(subject.host, 'local', 'env host') assert.equal(subject.user, 'testing', 'config user') assert.equal(subject.port, 7890, 'env port') assert.equal(subject.database, 'zugzug', 'config database') assert.equal(subject.password, defaults.password, 'defaults password') }) suite.test('connection string parsing', function () { clearEnv() var string = 'postgres://brian:pw@boom:381/lala' var subject = new ConnectionParameters(string) assert.equal(subject.host, 'boom', 'string host') assert.equal(subject.user, 'brian', 'string user') assert.equal(subject.password, 'pw', 'string password') assert.equal(subject.port, 381, 'string port') assert.equal(subject.database, 'lala', 'string database') }) suite.test('connection string parsing - ssl', function () { // clear process.env clearEnv() var string = 'postgres://brian:pw@boom:381/lala?ssl=true' var subject = new ConnectionParameters(string) assert.equal(subject.ssl, true, 'ssl') string = 'postgres://brian:pw@boom:381/lala?ssl=1' subject = new ConnectionParameters(string) assert.equal(subject.ssl, true, 'ssl') string = 'postgres://brian:pw@boom:381/lala?other&ssl=true' subject = new ConnectionParameters(string) assert.equal(subject.ssl, true, 'ssl') string = 'postgres://brian:pw@boom:381/lala?ssl=0' subject = new ConnectionParameters(string) assert.equal(!!subject.ssl, false, 'ssl') string = 'postgres://brian:pw@boom:381/lala' subject = new ConnectionParameters(string) assert.equal(!!subject.ssl, false, 'ssl') string = 'postgres://brian:pw@boom:381/lala?ssl=no-verify' subject = new ConnectionParameters(string) assert.deepStrictEqual(subject.ssl, { rejectUnauthorized: false }, 'ssl') }) suite.test('ssl is false by default', function () { clearEnv() var subject = new ConnectionParameters() assert.equal(subject.ssl, false) }) var testVal = function (mode, expected) { suite.test('ssl is ' + expected + ' when $PGSSLMODE=' + mode, function () { clearEnv() process.env.PGSSLMODE = mode var subject = new ConnectionParameters() assert.deepStrictEqual(subject.ssl, expected) }) } testVal('', false) testVal('disable', false) testVal('allow', false) testVal('prefer', true) testVal('require', true) testVal('verify-ca', true) testVal('verify-full', true) testVal('no-verify', { rejectUnauthorized: false }) // restore process.env for (var key in realEnv) { process.env[key] = realEnv[key] } node-postgres-pg-8.14.1/packages/pg/test/unit/connection-pool/000077500000000000000000000000001476604072200242425ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg/test/unit/connection-pool/configuration-tests.js000066400000000000000000000005561476604072200306150ustar00rootroot00000000000000'use strict' const assert = require('assert') const helper = require('../test-helper') const suite = new helper.Suite() suite.test('pool with copied settings includes password', () => { const original = new helper.pg.Pool({ password: 'original', }) const copy = new helper.pg.Pool(original.options) assert.equal(copy.options.password, 'original') }) node-postgres-pg-8.14.1/packages/pg/test/unit/connection/000077500000000000000000000000001476604072200232735ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg/test/unit/connection/error-tests.js000066400000000000000000000047231476604072200261300ustar00rootroot00000000000000'use strict' var helper = require('./test-helper') var Connection = require('../../../lib/connection') var net = require('net') const assert = require('assert') const suite = new helper.Suite() const { MemoryStream } = helper suite.test('connection emits stream errors', function (done) { var con = new Connection({ stream: new MemoryStream() }) assert.emits(con, 'error', function (err) { assert.equal(err.message, 'OMG!') done() }) con.connect() con.stream.emit('error', new Error('OMG!')) }) suite.test('connection emits ECONNRESET errors during normal operation', function (done) { var con = new Connection({ stream: new MemoryStream() }) con.connect() assert.emits(con, 'error', function (err) { assert.equal(err.code, 'ECONNRESET') done() }) var e = new Error('Connection Reset') e.code = 'ECONNRESET' con.stream.emit('error', e) }) suite.test('connection does not emit ECONNRESET errors during disconnect', function (done) { var con = new Connection({ stream: new MemoryStream() }) con.connect() var e = new Error('Connection Reset') e.code = 'ECONNRESET' con.end() con.stream.emit('error', e) done() }) var SSLNegotiationPacketTests = [ { testName: 'connection does not emit ECONNRESET errors during disconnect also when using SSL', errorMessage: null, response: 'S', responseType: 'sslconnect', }, { testName: 'connection emits an error when SSL is not supported', errorMessage: 'The server does not support SSL connections', response: 'N', responseType: 'error', }, { testName: 'connection emits an error when postmaster responds to SSL negotiation packet', errorMessage: 'There was an error establishing an SSL connection', response: 'E', responseType: 'error', }, ] for (const tc of SSLNegotiationPacketTests) { suite.test(tc.testName, function (done) { // our fake postgres server var socket var server = net.createServer(function (c) { socket = c c.once('data', function (data) { c.write(Buffer.from(tc.response)) }) }) server.listen(7778, function () { var con = new Connection({ ssl: true }) con.connect(7778, 'localhost') assert.emits(con, tc.responseType, function (err) { if (tc.errorMessage !== null || err) { assert.equal(err.message, tc.errorMessage) } con.end() socket.destroy() server.close() done() }) con.requestSsl() }) }) } node-postgres-pg-8.14.1/packages/pg/test/unit/connection/startup-tests.js000066400000000000000000000037451476604072200265040ustar00rootroot00000000000000'use strict' const helper = require('./test-helper') const assert = require('assert') var Connection = require('../../../lib/connection') const suite = new helper.Suite() const test = suite.test.bind(suite) const { MemoryStream } = helper test('connection can take existing stream', function () { var stream = new MemoryStream() var con = new Connection({ stream: stream }) assert.equal(con.stream, stream) }) test('connection can take stream factory method', function () { var stream = new MemoryStream() var connectionOpts = {} var makeStream = function (opts) { assert.equal(connectionOpts, opts) return stream } connectionOpts.stream = makeStream var con = new Connection(connectionOpts) assert.equal(con.stream, stream) }) test('using any stream', function () { var makeStream = function () { var stream = new MemoryStream() stream.connect = function (port, host) { this.connectCalled = true this.port = port this.host = host } return stream } var stream = makeStream() var con = new Connection({ stream: stream }) con.connect(1234, 'bang') test('makes stream connect', function () { assert.equal(stream.connectCalled, true) }) test('uses configured port', function () { assert.equal(stream.port, 1234) }) test('uses configured host', function () { assert.equal(stream.host, 'bang') }) test('after stream connects client emits connected event', function () { var hit = false con.once('connect', function () { hit = true }) assert.ok(stream.emit('connect')) assert.ok(hit) }) test('after stream emits connected event init TCP-keepalive', function () { var stream = makeStream() var con = new Connection({ stream: stream, keepAlive: true }) con.connect(123, 'test') var res = false stream.setKeepAlive = function (bit) { res = bit } assert.ok(stream.emit('connect')) setTimeout(function () { assert.equal(res, true) }) }) }) node-postgres-pg-8.14.1/packages/pg/test/unit/connection/test-helper.js000066400000000000000000000000701476604072200260620ustar00rootroot00000000000000'use strict' module.exports = require('../test-helper') node-postgres-pg-8.14.1/packages/pg/test/unit/test-helper.js000066400000000000000000000016151476604072200237310ustar00rootroot00000000000000'use strict' var EventEmitter = require('events').EventEmitter var helper = require('../test-helper') var Connection = require('../../lib/connection') const { Client } = helper const MemoryStream = function () { EventEmitter.call(this) this.packets = [] } helper.sys.inherits(MemoryStream, EventEmitter) var p = MemoryStream.prototype p.connect = function () { // NOOP } p.setNoDelay = () => {} p.write = function (packet, cb) { this.packets.push(packet) if (cb) { cb() } } p.end = function () { p.closed = true } p.setKeepAlive = function () {} p.closed = false p.writable = true const createClient = function () { var stream = new MemoryStream() var client = new Client({ connection: new Connection({ stream: stream }), }) client.connect() return client } module.exports = Object.assign({}, helper, { createClient: createClient, MemoryStream: MemoryStream, }) node-postgres-pg-8.14.1/packages/pg/test/unit/utils-tests.js000066400000000000000000000221761476604072200240020ustar00rootroot00000000000000'use strict' var helper = require('./test-helper') var utils = require('./../../lib/utils') var defaults = require('./../../lib').defaults const assert = require('assert') const suite = new helper.Suite() const test = suite.test.bind(suite) test('ensure types is exported on root object', function () { var pg = require('../../lib') assert(pg.types) assert(pg.types.getTypeParser) assert(pg.types.setTypeParser) }) test('normalizing query configs', function () { var config var callback = function () {} config = utils.normalizeQueryConfig({ text: 'TEXT' }) assert.same(config, { text: 'TEXT' }) config = utils.normalizeQueryConfig({ text: 'TEXT' }, [10]) assert.deepEqual(config, { text: 'TEXT', values: [10] }) config = utils.normalizeQueryConfig({ text: 'TEXT', values: [10] }) assert.deepEqual(config, { text: 'TEXT', values: [10] }) config = utils.normalizeQueryConfig('TEXT', [10], callback) assert.deepEqual(config, { text: 'TEXT', values: [10], callback: callback }) config = utils.normalizeQueryConfig({ text: 'TEXT', values: [10] }, callback) assert.deepEqual(config, { text: 'TEXT', values: [10], callback: callback }) }) test('prepareValues: buffer prepared properly', function () { var buf = Buffer.from('quack') var out = utils.prepareValue(buf) assert.strictEqual(buf, out) }) test('prepareValues: Uint8Array prepared properly', function () { var buf = new Uint8Array([1, 2, 3]).subarray(1, 2) var out = utils.prepareValue(buf) assert.ok(Buffer.isBuffer(out)) assert.equal(out.length, 1) assert.deepEqual(out[0], 2) }) test('prepareValues: date prepared properly', function () { helper.setTimezoneOffset(-330) var date = new Date(2014, 1, 1, 11, 11, 1, 7) var out = utils.prepareValue(date) assert.strictEqual(out, '2014-02-01T11:11:01.007+05:30') helper.resetTimezoneOffset() }) test('prepareValues: date prepared properly as UTC', function () { defaults.parseInputDatesAsUTC = true // make a date in the local timezone that represents a specific UTC point in time var date = new Date(Date.UTC(2014, 1, 1, 11, 11, 1, 7)) var out = utils.prepareValue(date) assert.strictEqual(out, '2014-02-01T11:11:01.007+00:00') defaults.parseInputDatesAsUTC = false }) test('prepareValues: BC date prepared properly', function () { helper.setTimezoneOffset(-330) var date = new Date(-3245, 1, 1, 11, 11, 1, 7) var out = utils.prepareValue(date) assert.strictEqual(out, '3246-02-01T11:11:01.007+05:30 BC') helper.resetTimezoneOffset() }) test('prepareValues: 1 BC date prepared properly', function () { helper.setTimezoneOffset(-330) // can't use the multi-argument constructor as year 0 would be interpreted as 1900 var date = new Date('0000-02-01T11:11:01.007') var out = utils.prepareValue(date) assert.strictEqual(out, '0001-02-01T11:11:01.007+05:30 BC') helper.resetTimezoneOffset() }) test('prepareValues: undefined prepared properly', function () { var out = utils.prepareValue(void 0) assert.strictEqual(out, null) }) test('prepareValue: null prepared properly', function () { var out = utils.prepareValue(null) assert.strictEqual(out, null) }) test('prepareValue: true prepared properly', function () { var out = utils.prepareValue(true) assert.strictEqual(out, 'true') }) test('prepareValue: false prepared properly', function () { var out = utils.prepareValue(false) assert.strictEqual(out, 'false') }) test('prepareValue: number prepared properly', function () { var out = utils.prepareValue(3.042) assert.strictEqual(out, '3.042') }) test('prepareValue: string prepared properly', function () { var out = utils.prepareValue('big bad wolf') assert.strictEqual(out, 'big bad wolf') }) test('prepareValue: simple array prepared properly', function () { var out = utils.prepareValue([1, null, 3, undefined, [5, 6, 'squ,awk']]) assert.strictEqual(out, '{"1",NULL,"3",NULL,{"5","6","squ,awk"}}') }) test('prepareValue: complex array prepared properly', function () { var out = utils.prepareValue([{ x: 42 }, { y: 84 }]) assert.strictEqual(out, '{"{\\"x\\":42}","{\\"y\\":84}"}') }) test('prepareValue: date array prepared properly', function () { helper.setTimezoneOffset(-330) var date = new Date(2014, 1, 1, 11, 11, 1, 7) var out = utils.prepareValue([date]) assert.strictEqual(out, '{"2014-02-01T11:11:01.007+05:30"}') helper.resetTimezoneOffset() }) test('prepareValue: arbitrary objects prepared properly', function () { var out = utils.prepareValue({ x: 42 }) assert.strictEqual(out, '{"x":42}') }) test('prepareValue: objects with simple toPostgres prepared properly', function () { var customType = { toPostgres: function () { return 'zomgcustom!' }, } var out = utils.prepareValue(customType) assert.strictEqual(out, 'zomgcustom!') }) test('prepareValue: buffer array prepared properly', function () { var buffer1 = Buffer.from('dead', 'hex') var buffer2 = Buffer.from('beef', 'hex') var out = utils.prepareValue([buffer1, buffer2]) assert.strictEqual(out, '{\\\\xdead,\\\\xbeef}') }) test('prepareValue: Uint8Array array prepared properly', function () { var buffer1 = Uint8Array.from(Buffer.from('dead', 'hex')) var buffer2 = Uint8Array.from(Buffer.from('beef', 'hex')) var out = utils.prepareValue([buffer1, buffer2]) assert.strictEqual(out, '{\\\\xdead,\\\\xbeef}') }) test('prepareValue: objects with complex toPostgres prepared properly', function () { var customType = { toPostgres: function () { return [1, 2] }, } var out = utils.prepareValue(customType) assert.strictEqual(out, '{"1","2"}') }) test('prepareValue: objects with toPostgres receive prepareValue', function () { var customRange = { lower: { toPostgres: function () { return 5 }, }, upper: { toPostgres: function () { return 10 }, }, toPostgres: function (prepare) { return '[' + prepare(this.lower) + ',' + prepare(this.upper) + ']' }, } var out = utils.prepareValue(customRange) assert.strictEqual(out, '[5,10]') }) test('prepareValue: objects with circular toPostgres rejected', function () { var customType = { toPostgres: function () { return { toPostgres: function () { return customType }, } }, } // can't use `assert.throws` since we need to distinguish circular reference // errors from call stack exceeded errors try { utils.prepareValue(customType) } catch (e) { assert.ok(e.message.match(/circular/), 'Expected circular reference error but got ' + e) return } throw new Error('Expected prepareValue to throw exception') }) test('prepareValue: can safely be used to map an array of values including those with toPostgres functions', function () { var customType = { toPostgres: function () { return 'zomgcustom!' }, } var values = [1, 'test', customType] var out = values.map(utils.prepareValue) assert.deepEqual(out, [1, 'test', 'zomgcustom!']) }) var testEscapeLiteral = function (testName, input, expected) { test(testName, function () { var actual = utils.escapeLiteral(input) assert.equal(expected, actual) }) } testEscapeLiteral('escapeLiteral: no special characters', 'hello world', "'hello world'") testEscapeLiteral('escapeLiteral: contains double quotes only', 'hello " world', "'hello \" world'") testEscapeLiteral('escapeLiteral: contains single quotes only', "hello ' world", "'hello '' world'") testEscapeLiteral('escapeLiteral: contains backslashes only', 'hello \\ world', " E'hello \\\\ world'") testEscapeLiteral('escapeLiteral: contains single quotes and double quotes', 'hello \' " world', "'hello '' \" world'") testEscapeLiteral( 'escapeLiteral: contains double quotes and backslashes', 'hello \\ " world', " E'hello \\\\ \" world'" ) testEscapeLiteral( 'escapeLiteral: contains single quotes and backslashes', "hello \\ ' world", " E'hello \\\\ '' world'" ) testEscapeLiteral( 'escapeLiteral: contains single quotes, double quotes, and backslashes', 'hello \\ \' " world', " E'hello \\\\ '' \" world'" ) var testEscapeIdentifier = function (testName, input, expected) { test(testName, function () { var actual = utils.escapeIdentifier(input) assert.equal(expected, actual) }) } testEscapeIdentifier('escapeIdentifier: no special characters', 'hello world', '"hello world"') testEscapeIdentifier('escapeIdentifier: contains double quotes only', 'hello " world', '"hello "" world"') testEscapeIdentifier('escapeIdentifier: contains single quotes only', "hello ' world", '"hello \' world"') testEscapeIdentifier('escapeIdentifier: contains backslashes only', 'hello \\ world', '"hello \\ world"') testEscapeIdentifier( 'escapeIdentifier: contains single quotes and double quotes', 'hello \' " world', '"hello \' "" world"' ) testEscapeIdentifier( 'escapeIdentifier: contains double quotes and backslashes', 'hello \\ " world', '"hello \\ "" world"' ) testEscapeIdentifier( 'escapeIdentifier: contains single quotes and backslashes', "hello \\ ' world", '"hello \\ \' world"' ) testEscapeIdentifier( 'escapeIdentifier: contains single quotes, double quotes, and backslashes', 'hello \\ \' " world', '"hello \\ \' "" world"' ) node-postgres-pg-8.14.1/packages/pg/test/worker/000077500000000000000000000000001476604072200214665ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg/test/worker/src/000077500000000000000000000000001476604072200222555ustar00rootroot00000000000000node-postgres-pg-8.14.1/packages/pg/test/worker/src/index.test.js000066400000000000000000000014661476604072200247070ustar00rootroot00000000000000if (parseInt(process.versions.node.split('.')[0]) < 20) { process.exit(0) } var helper = require('../../test-helper') const path = require('path') const { unstable_dev } = require('wrangler') var suite = new helper.Suite() const assert = require('assert') suite.testAsync('Can run in Cloudflare Worker?', test()) async function test() { const worker = await unstable_dev(path.resolve(__dirname, './index.ts'), { config: path.resolve(__dirname, '../wrangler.toml'), vars: { ...process.env, }, experimental: { experimentalLocal: true, disableExperimentalWarning: true, }, logLevel: 'ERROR', }) try { const resp = await worker.fetch('/') const { rows } = await resp.json() assert.same(rows[0].text, 'Hello, World!') } finally { await worker.stop() } } node-postgres-pg-8.14.1/packages/pg/test/worker/src/index.ts000066400000000000000000000014131476604072200237330ustar00rootroot00000000000000import { Client } from 'pg' export interface Env { USER: string PGUSER: string PGPASSWORD: string } export default { async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise { const url = new URL(request.url) if (url.pathname === '/favicon.ico') return new Response(null, { status: 404 }) const params = url.searchParams const ssl = params.has('ssl') var client = new Client({ user: env.PGUSER || env.USER, password: env.PGPASSWORD, ssl, }) await client.connect() const resp = Response.json(await client.query('SELECT $1::text', ['Hello, World!'])) // Clean up the client, ensuring we don't kill the worker before that is completed. ctx.waitUntil(client.end()) return resp }, } node-postgres-pg-8.14.1/packages/pg/test/worker/tsconfig.json000066400000000000000000000006431476604072200242000ustar00rootroot00000000000000{ "compilerOptions": { "target": "es2021", "lib": [ "es2021" ], "module": "es2022", "moduleResolution": "node", "types": [ "@cloudflare/workers-types" ], "resolveJsonModule": true, "allowJs": true, "checkJs": false, "noEmit": true, "isolatedModules": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, "strict": true, "skipLibCheck": true, } } node-postgres-pg-8.14.1/packages/pg/test/worker/wrangler.toml000066400000000000000000000002151476604072200242020ustar00rootroot00000000000000name = "pg-cf-test" main = "src/index.ts" compatibility_date = "2023-04-04" compatibility_flags = ["tcp_sockets_support"] node_compat = true node-postgres-pg-8.14.1/tea.yaml000066400000000000000000000001761476604072200164530ustar00rootroot00000000000000# https://tea.xyz/what-is-this-file --- version: 1.0.0 codeOwners: - '0x7e65e980B1409f21E2eb2FF341B2235A8B615122' quorum: 1 node-postgres-pg-8.14.1/tsconfig.json000066400000000000000000000004071476604072200175220ustar00rootroot00000000000000{ "compilerOptions": { "strict": true, "incremental": true, "composite": true }, "include": [], "references": [ {"path": "./packages/pg-cloudflare"}, {"path": "./packages/pg-query-stream"}, {"path": "./packages/pg-protocol"} ] } node-postgres-pg-8.14.1/yarn.lock000066400000000000000000010706041476604072200166450ustar00rootroot00000000000000# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. # yarn lockfile v1 "@aashutoshrathi/word-wrap@^1.2.3": version "1.2.6" resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf" integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== "@babel/code-frame@^7.0.0": version "7.10.4" resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz" integrity sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg== dependencies: "@babel/highlight" "^7.10.4" "@babel/helper-validator-identifier@^7.10.4": version "7.10.4" resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz" integrity sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw== "@babel/highlight@^7.10.4": version "7.10.4" resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz" integrity sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA== dependencies: "@babel/helper-validator-identifier" "^7.10.4" chalk "^2.0.0" js-tokens "^4.0.0" "@cloudflare/kv-asset-handler@0.3.2": version "0.3.2" resolved "https://registry.yarnpkg.com/@cloudflare/kv-asset-handler/-/kv-asset-handler-0.3.2.tgz#06437b75664729823ac9033b89f06a3b078e4f55" integrity sha512-EeEjMobfuJrwoctj7FA1y1KEbM0+Q1xSjobIEyie9k4haVEBB7vkDvsasw1pM3rO39mL2akxIAzLMUAtrMHZhA== dependencies: mime "^3.0.0" "@cloudflare/workerd-darwin-64@1.20240524.0": version "1.20240524.0" resolved "https://registry.yarnpkg.com/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20240524.0.tgz#506ebc544d4677e2fe3819f182e949e4feadcb6d" integrity sha512-ATaXjefbTsrv4mpn4Fdua114RRDXcX5Ky+Mv+f4JTUllgalmqC4CYMN4jxRz9IpJU/fNMN8IEfvUyuJBAcl9Iw== "@cloudflare/workerd-darwin-64@1.20250129.0": version "1.20250129.0" resolved "https://registry.yarnpkg.com/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20250129.0.tgz#bb7c018d3f36a01579a7b41f11fd6eaa68ffcb4e" integrity sha512-M+xETVnl+xy2dfDDWmp0XXr2rttl70a6bljQygl0EmYmNswFTcYbQWCaBuNBo9kabU59rLKr4a/b3QZ07NoL/g== "@cloudflare/workerd-darwin-arm64@1.20240524.0": version "1.20240524.0" resolved "https://registry.yarnpkg.com/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20240524.0.tgz#1001c1d77b02b8d714249f0569c95ba5898bdf90" integrity sha512-wnbsZI4CS0QPCd+wnBHQ40C28A/2Qo4ESi1YhE2735G3UNcc876MWksZhsubd+XH0XPIra6eNFqyw6wRMpQOXA== "@cloudflare/workerd-darwin-arm64@1.20250129.0": version "1.20250129.0" resolved "https://registry.yarnpkg.com/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20250129.0.tgz#89ba28fbbe32b4dd0227f1df64f3bd766f772c0b" integrity sha512-c4PQUyIMp+bCMxZkAMBzXgTHjRZxeYCujDbb3staestqgRbenzcfauXsMd6np35ng+EE1uBgHNPV4+7fC0ZBfg== "@cloudflare/workerd-linux-64@1.20240524.0": version "1.20240524.0" resolved "https://registry.yarnpkg.com/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20240524.0.tgz#f7cf44294b61a15eb5e98fd94cf17e61845e3d7f" integrity sha512-E8mj+HPBryKwaJAiNsYzXtVjKCL0KvUBZbtxJxlWM4mLSQhT+uwGT3nydb/hFY59rZnQgZslw0oqEWht5TEYiQ== "@cloudflare/workerd-linux-64@1.20250129.0": version "1.20250129.0" resolved "https://registry.yarnpkg.com/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20250129.0.tgz#6a800402c0ab9f7025517c5e19fa308f74d4fd6f" integrity sha512-xJx8LwWFxsm5U3DETJwRuOmT5RWBqm4FmA4itYXvcEICca9pWJDB641kT4PnpypwDNmYOebhU7A+JUrCRucG0w== "@cloudflare/workerd-linux-arm64@1.20240524.0": version "1.20240524.0" resolved "https://registry.yarnpkg.com/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20240524.0.tgz#46678255e98acd8f30d2a63415b7aeb7cd933e77" integrity sha512-/Fr1W671t2triNCDCBWdStxngnbUfZunZ/2e4kaMLzJDJLYDtYdmvOUCBDzUD4ssqmIMbn9RCQQ0U+CLEoqBqw== "@cloudflare/workerd-linux-arm64@1.20250129.0": version "1.20250129.0" resolved "https://registry.yarnpkg.com/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20250129.0.tgz#f828e47ba5c219d4bbdfbe9b0cee64b5155f20b1" integrity sha512-dR//npbaX5p323huBVNIy5gaWubQx6CC3aiXeK0yX4aD5ar8AjxQFb2U/Sgjeo65Rkt53hJWqC7IwRpK/eOxrA== "@cloudflare/workerd-windows-64@1.20240524.0": version "1.20240524.0" resolved "https://registry.yarnpkg.com/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20240524.0.tgz#aad79b9f6fd53a769355605903481d699a8789ce" integrity sha512-G+ThDEx57g9mAEKqhWnHaaJgpeGYtyhkmwM/BDpLqPks/rAY5YEfZbY4YL1pNk1kkcZDXGrwIsY8xe9Apf5JdA== "@cloudflare/workerd-windows-64@1.20250129.0": version "1.20250129.0" resolved "https://registry.yarnpkg.com/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20250129.0.tgz#15b581c421064cf997f4eefef8a87286ac56469d" integrity sha512-OeO+1nPj/ocAE3adFar/tRFGRkbCrBnrOYXq0FUBSpyNHpDdA9/U3PAw5CN4zvjfTnqXZfTxTFeqoruqzRzbtg== "@cloudflare/workers-types@^4.20230404.0": version "4.20230404.0" resolved "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20230404.0.tgz" integrity sha512-fG3oaJX1icfsGV74nhx1+AC6opvZsGqnpx6FvrcVqQaBmCNkjKNqDRFrpasXWFiOIvysBXHKQAzsAJkBZgnM+A== "@cspotcode/source-map-support@0.8.1": version "0.8.1" resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== dependencies: "@jridgewell/trace-mapping" "0.3.9" "@esbuild-plugins/node-globals-polyfill@^0.2.3": version "0.2.3" resolved "https://registry.yarnpkg.com/@esbuild-plugins/node-globals-polyfill/-/node-globals-polyfill-0.2.3.tgz#0e4497a2b53c9e9485e149bc92ddb228438d6bcf" integrity sha512-r3MIryXDeXDOZh7ih1l/yE9ZLORCd5e8vWg02azWRGj5SPTuoh69A2AIyn0Z31V/kHBfZ4HgWJ+OK3GTTwLmnw== "@esbuild-plugins/node-modules-polyfill@^0.2.2": version "0.2.2" resolved "https://registry.yarnpkg.com/@esbuild-plugins/node-modules-polyfill/-/node-modules-polyfill-0.2.2.tgz#cefa3dc0bd1c16277a8338b52833420c94987327" integrity sha512-LXV7QsWJxRuMYvKbiznh+U1ilIop3g2TeKRzUxOG5X3YITc8JyyTa90BmLwqqv0YnX4v32CSlG+vsziZp9dMvA== dependencies: escape-string-regexp "^4.0.0" rollup-plugin-node-polyfills "^0.2.1" "@esbuild/android-arm64@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.17.19.tgz#bafb75234a5d3d1b690e7c2956a599345e84a2fd" integrity sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA== "@esbuild/android-arm@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.17.19.tgz#5898f7832c2298bc7d0ab53701c57beb74d78b4d" integrity sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A== "@esbuild/android-x64@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.17.19.tgz#658368ef92067866d95fb268719f98f363d13ae1" integrity sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww== "@esbuild/darwin-arm64@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz#584c34c5991b95d4d48d333300b1a4e2ff7be276" integrity sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg== "@esbuild/darwin-x64@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.17.19.tgz#7751d236dfe6ce136cce343dce69f52d76b7f6cb" integrity sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw== "@esbuild/freebsd-arm64@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.19.tgz#cacd171665dd1d500f45c167d50c6b7e539d5fd2" integrity sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ== "@esbuild/freebsd-x64@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.17.19.tgz#0769456eee2a08b8d925d7c00b79e861cb3162e4" integrity sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ== "@esbuild/linux-arm64@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.17.19.tgz#38e162ecb723862c6be1c27d6389f48960b68edb" integrity sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg== "@esbuild/linux-arm@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.17.19.tgz#1a2cd399c50040184a805174a6d89097d9d1559a" integrity sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA== "@esbuild/linux-ia32@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.17.19.tgz#e28c25266b036ce1cabca3c30155222841dc035a" integrity sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ== "@esbuild/linux-loong64@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.17.19.tgz#0f887b8bb3f90658d1a0117283e55dbd4c9dcf72" integrity sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ== "@esbuild/linux-mips64el@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.17.19.tgz#f5d2a0b8047ea9a5d9f592a178ea054053a70289" integrity sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A== "@esbuild/linux-ppc64@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.17.19.tgz#876590e3acbd9fa7f57a2c7d86f83717dbbac8c7" integrity sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg== "@esbuild/linux-riscv64@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.17.19.tgz#7f49373df463cd9f41dc34f9b2262d771688bf09" integrity sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA== "@esbuild/linux-s390x@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.17.19.tgz#e2afd1afcaf63afe2c7d9ceacd28ec57c77f8829" integrity sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q== "@esbuild/linux-x64@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz#8a0e9738b1635f0c53389e515ae83826dec22aa4" integrity sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw== "@esbuild/netbsd-x64@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.17.19.tgz#c29fb2453c6b7ddef9a35e2c18b37bda1ae5c462" integrity sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q== "@esbuild/openbsd-x64@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.17.19.tgz#95e75a391403cb10297280d524d66ce04c920691" integrity sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g== "@esbuild/sunos-x64@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.17.19.tgz#722eaf057b83c2575937d3ffe5aeb16540da7273" integrity sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg== "@esbuild/win32-arm64@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.17.19.tgz#9aa9dc074399288bdcdd283443e9aeb6b9552b6f" integrity sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag== "@esbuild/win32-ia32@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.17.19.tgz#95ad43c62ad62485e210f6299c7b2571e48d2b03" integrity sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw== "@esbuild/win32-x64@0.17.19": version "0.17.19" resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.17.19.tgz#8cfaf2ff603e9aabb910e9c0558c26cf32744061" integrity sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA== "@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.0": version "4.4.0" resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" integrity sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA== dependencies: eslint-visitor-keys "^3.3.0" "@eslint-community/regexpp@^4.5.1", "@eslint-community/regexpp@^4.6.1": version "4.10.0" resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.10.0.tgz#548f6de556857c8bb73bbee70c35dc82a2e74d63" integrity sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA== "@eslint/eslintrc@^2.1.4": version "2.1.4" resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.4.tgz#388a269f0f25c1b6adc317b5a2c55714894c70ad" integrity sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ== dependencies: ajv "^6.12.4" debug "^4.3.2" espree "^9.6.0" globals "^13.19.0" ignore "^5.2.0" import-fresh "^3.2.1" js-yaml "^4.1.0" minimatch "^3.1.2" strip-json-comments "^3.1.1" "@eslint/js@8.57.0": version "8.57.0" resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.57.0.tgz#a5417ae8427873f1dd08b70b3574b453e67b5f7f" integrity sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g== "@evocateur/libnpmaccess@^3.1.2": version "3.1.2" resolved "https://registry.npmjs.org/@evocateur/libnpmaccess/-/libnpmaccess-3.1.2.tgz" integrity sha512-KSCAHwNWro0CF2ukxufCitT9K5LjL/KuMmNzSu8wuwN2rjyKHD8+cmOsiybK+W5hdnwc5M1SmRlVCaMHQo+3rg== dependencies: "@evocateur/npm-registry-fetch" "^4.0.0" aproba "^2.0.0" figgy-pudding "^3.5.1" get-stream "^4.0.0" npm-package-arg "^6.1.0" "@evocateur/libnpmpublish@^1.2.2": version "1.2.2" resolved "https://registry.npmjs.org/@evocateur/libnpmpublish/-/libnpmpublish-1.2.2.tgz" integrity sha512-MJrrk9ct1FeY9zRlyeoyMieBjGDG9ihyyD9/Ft6MMrTxql9NyoEx2hw9casTIP4CdqEVu+3nQ2nXxoJ8RCXyFg== dependencies: "@evocateur/npm-registry-fetch" "^4.0.0" aproba "^2.0.0" figgy-pudding "^3.5.1" get-stream "^4.0.0" lodash.clonedeep "^4.5.0" normalize-package-data "^2.4.0" npm-package-arg "^6.1.0" semver "^5.5.1" ssri "^6.0.1" "@evocateur/npm-registry-fetch@^4.0.0": version "4.0.0" resolved "https://registry.npmjs.org/@evocateur/npm-registry-fetch/-/npm-registry-fetch-4.0.0.tgz" integrity sha512-k1WGfKRQyhJpIr+P17O5vLIo2ko1PFLKwoetatdduUSt/aQ4J2sJrJwwatdI5Z3SiYk/mRH9S3JpdmMFd/IK4g== dependencies: JSONStream "^1.3.4" bluebird "^3.5.1" figgy-pudding "^3.4.1" lru-cache "^5.1.1" make-fetch-happen "^5.0.0" npm-package-arg "^6.1.0" safe-buffer "^5.1.2" "@evocateur/pacote@^9.6.3": version "9.6.5" resolved "https://registry.npmjs.org/@evocateur/pacote/-/pacote-9.6.5.tgz" integrity sha512-EI552lf0aG2nOV8NnZpTxNo2PcXKPmDbF9K8eCBFQdIZwHNGN/mi815fxtmUMa2wTa1yndotICIDt/V0vpEx2w== dependencies: "@evocateur/npm-registry-fetch" "^4.0.0" bluebird "^3.5.3" cacache "^12.0.3" chownr "^1.1.2" figgy-pudding "^3.5.1" get-stream "^4.1.0" glob "^7.1.4" infer-owner "^1.0.4" lru-cache "^5.1.1" make-fetch-happen "^5.0.0" minimatch "^3.0.4" minipass "^2.3.5" mississippi "^3.0.0" mkdirp "^0.5.1" normalize-package-data "^2.5.0" npm-package-arg "^6.1.0" npm-packlist "^1.4.4" npm-pick-manifest "^3.0.0" osenv "^0.1.5" promise-inflight "^1.0.1" promise-retry "^1.1.1" protoduck "^5.0.1" rimraf "^2.6.3" safe-buffer "^5.2.0" semver "^5.7.0" ssri "^6.0.1" tar "^4.4.10" unique-filename "^1.1.1" which "^1.3.1" "@fastify/busboy@^2.0.0": version "2.1.1" resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-2.1.1.tgz#b9da6a878a371829a0502c9b6c1c143ef6663f4d" integrity sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA== "@humanwhocodes/config-array@^0.11.14": version "0.11.14" resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.14.tgz#d78e481a039f7566ecc9660b4ea7fe6b1fec442b" integrity sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg== dependencies: "@humanwhocodes/object-schema" "^2.0.2" debug "^4.3.1" minimatch "^3.0.5" "@humanwhocodes/module-importer@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== "@humanwhocodes/object-schema@^2.0.2": version "2.0.2" resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz#d9fae00a2d5cb40f92cfe64b47ad749fbc38f917" integrity sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw== "@isaacs/cliui@^8.0.2": version "8.0.2" resolved "https://registry.yarnpkg.com/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550" integrity sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA== dependencies: string-width "^5.1.2" string-width-cjs "npm:string-width@^4.2.0" strip-ansi "^7.0.1" strip-ansi-cjs "npm:strip-ansi@^6.0.1" wrap-ansi "^8.1.0" wrap-ansi-cjs "npm:wrap-ansi@^7.0.0" "@jridgewell/resolve-uri@^3.0.3": version "3.1.2" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz#7a0ee601f60f99a20c7c7c5ff0c80388c1189bd6" integrity sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw== "@jridgewell/sourcemap-codec@^1.4.10": version "1.4.15" resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== "@jridgewell/trace-mapping@0.3.9": version "0.3.9" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== dependencies: "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" "@lerna/add@3.21.0": version "3.21.0" resolved "https://registry.npmjs.org/@lerna/add/-/add-3.21.0.tgz" integrity sha512-vhUXXF6SpufBE1EkNEXwz1VLW03f177G9uMOFMQkp6OJ30/PWg4Ekifuz9/3YfgB2/GH8Tu4Lk3O51P2Hskg/A== dependencies: "@evocateur/pacote" "^9.6.3" "@lerna/bootstrap" "3.21.0" "@lerna/command" "3.21.0" "@lerna/filter-options" "3.20.0" "@lerna/npm-conf" "3.16.0" "@lerna/validation-error" "3.13.0" dedent "^0.7.0" npm-package-arg "^6.1.0" p-map "^2.1.0" semver "^6.2.0" "@lerna/bootstrap@3.21.0": version "3.21.0" resolved "https://registry.npmjs.org/@lerna/bootstrap/-/bootstrap-3.21.0.tgz" integrity sha512-mtNHlXpmvJn6JTu0KcuTTPl2jLsDNud0QacV/h++qsaKbhAaJr/FElNZ5s7MwZFUM3XaDmvWzHKaszeBMHIbBw== dependencies: "@lerna/command" "3.21.0" "@lerna/filter-options" "3.20.0" "@lerna/has-npm-version" "3.16.5" "@lerna/npm-install" "3.16.5" "@lerna/package-graph" "3.18.5" "@lerna/pulse-till-done" "3.13.0" "@lerna/rimraf-dir" "3.16.5" "@lerna/run-lifecycle" "3.16.2" "@lerna/run-topologically" "3.18.5" "@lerna/symlink-binary" "3.17.0" "@lerna/symlink-dependencies" "3.17.0" "@lerna/validation-error" "3.13.0" dedent "^0.7.0" get-port "^4.2.0" multimatch "^3.0.0" npm-package-arg "^6.1.0" npmlog "^4.1.2" p-finally "^1.0.0" p-map "^2.1.0" p-map-series "^1.0.0" p-waterfall "^1.0.0" read-package-tree "^5.1.6" semver "^6.2.0" "@lerna/changed@3.21.0": version "3.21.0" resolved "https://registry.npmjs.org/@lerna/changed/-/changed-3.21.0.tgz" integrity sha512-hzqoyf8MSHVjZp0gfJ7G8jaz+++mgXYiNs9iViQGA8JlN/dnWLI5sWDptEH3/B30Izo+fdVz0S0s7ydVE3pWIw== dependencies: "@lerna/collect-updates" "3.20.0" "@lerna/command" "3.21.0" "@lerna/listable" "3.18.5" "@lerna/output" "3.13.0" "@lerna/check-working-tree@3.16.5": version "3.16.5" resolved "https://registry.npmjs.org/@lerna/check-working-tree/-/check-working-tree-3.16.5.tgz" integrity sha512-xWjVBcuhvB8+UmCSb5tKVLB5OuzSpw96WEhS2uz6hkWVa/Euh1A0/HJwn2cemyK47wUrCQXtczBUiqnq9yX5VQ== dependencies: "@lerna/collect-uncommitted" "3.16.5" "@lerna/describe-ref" "3.16.5" "@lerna/validation-error" "3.13.0" "@lerna/child-process@3.16.5": version "3.16.5" resolved "https://registry.npmjs.org/@lerna/child-process/-/child-process-3.16.5.tgz" integrity sha512-vdcI7mzei9ERRV4oO8Y1LHBZ3A5+ampRKg1wq5nutLsUA4mEBN6H7JqjWOMY9xZemv6+kATm2ofjJ3lW5TszQg== dependencies: chalk "^2.3.1" execa "^1.0.0" strong-log-transformer "^2.0.0" "@lerna/clean@3.21.0": version "3.21.0" resolved "https://registry.npmjs.org/@lerna/clean/-/clean-3.21.0.tgz" integrity sha512-b/L9l+MDgE/7oGbrav6rG8RTQvRiZLO1zTcG17zgJAAuhlsPxJExMlh2DFwJEVi2les70vMhHfST3Ue1IMMjpg== dependencies: "@lerna/command" "3.21.0" "@lerna/filter-options" "3.20.0" "@lerna/prompt" "3.18.5" "@lerna/pulse-till-done" "3.13.0" "@lerna/rimraf-dir" "3.16.5" p-map "^2.1.0" p-map-series "^1.0.0" p-waterfall "^1.0.0" "@lerna/cli@3.18.5": version "3.18.5" resolved "https://registry.npmjs.org/@lerna/cli/-/cli-3.18.5.tgz" integrity sha512-erkbxkj9jfc89vVs/jBLY/fM0I80oLmJkFUV3Q3wk9J3miYhP14zgVEBsPZY68IZlEjT6T3Xlq2xO1AVaatHsA== dependencies: "@lerna/global-options" "3.13.0" dedent "^0.7.0" npmlog "^4.1.2" yargs "^14.2.2" "@lerna/collect-uncommitted@3.16.5": version "3.16.5" resolved "https://registry.npmjs.org/@lerna/collect-uncommitted/-/collect-uncommitted-3.16.5.tgz" integrity sha512-ZgqnGwpDZiWyzIQVZtQaj9tRizsL4dUOhuOStWgTAw1EMe47cvAY2kL709DzxFhjr6JpJSjXV5rZEAeU3VE0Hg== dependencies: "@lerna/child-process" "3.16.5" chalk "^2.3.1" figgy-pudding "^3.5.1" npmlog "^4.1.2" "@lerna/collect-updates@3.20.0": version "3.20.0" resolved "https://registry.npmjs.org/@lerna/collect-updates/-/collect-updates-3.20.0.tgz" integrity sha512-qBTVT5g4fupVhBFuY4nI/3FSJtQVcDh7/gEPOpRxoXB/yCSnT38MFHXWl+y4einLciCjt/+0x6/4AG80fjay2Q== dependencies: "@lerna/child-process" "3.16.5" "@lerna/describe-ref" "3.16.5" minimatch "^3.0.4" npmlog "^4.1.2" slash "^2.0.0" "@lerna/command@3.21.0": version "3.21.0" resolved "https://registry.npmjs.org/@lerna/command/-/command-3.21.0.tgz" integrity sha512-T2bu6R8R3KkH5YoCKdutKv123iUgUbW8efVjdGCDnCMthAQzoentOJfDeodBwn0P2OqCl3ohsiNVtSn9h78fyQ== dependencies: "@lerna/child-process" "3.16.5" "@lerna/package-graph" "3.18.5" "@lerna/project" "3.21.0" "@lerna/validation-error" "3.13.0" "@lerna/write-log-file" "3.13.0" clone-deep "^4.0.1" dedent "^0.7.0" execa "^1.0.0" is-ci "^2.0.0" npmlog "^4.1.2" "@lerna/conventional-commits@3.22.0": version "3.22.0" resolved "https://registry.npmjs.org/@lerna/conventional-commits/-/conventional-commits-3.22.0.tgz" integrity sha512-z4ZZk1e8Mhz7+IS8NxHr64wyklHctCJyWpJKEZZPJiLFJ8yKto/x38O80R10pIzC0rr8Sy/OsjSH4bl0TbbgqA== dependencies: "@lerna/validation-error" "3.13.0" conventional-changelog-angular "^5.0.3" conventional-changelog-core "^3.1.6" conventional-recommended-bump "^5.0.0" fs-extra "^8.1.0" get-stream "^4.0.0" lodash.template "^4.5.0" npm-package-arg "^6.1.0" npmlog "^4.1.2" pify "^4.0.1" semver "^6.2.0" "@lerna/create-symlink@3.16.2": version "3.16.2" resolved "https://registry.npmjs.org/@lerna/create-symlink/-/create-symlink-3.16.2.tgz" integrity sha512-pzXIJp6av15P325sgiIRpsPXLFmkisLhMBCy4764d+7yjf2bzrJ4gkWVMhsv4AdF0NN3OyZ5jjzzTtLNqfR+Jw== dependencies: "@zkochan/cmd-shim" "^3.1.0" fs-extra "^8.1.0" npmlog "^4.1.2" "@lerna/create@3.22.0": version "3.22.0" resolved "https://registry.npmjs.org/@lerna/create/-/create-3.22.0.tgz" integrity sha512-MdiQQzCcB4E9fBF1TyMOaAEz9lUjIHp1Ju9H7f3lXze5JK6Fl5NYkouAvsLgY6YSIhXMY8AHW2zzXeBDY4yWkw== dependencies: "@evocateur/pacote" "^9.6.3" "@lerna/child-process" "3.16.5" "@lerna/command" "3.21.0" "@lerna/npm-conf" "3.16.0" "@lerna/validation-error" "3.13.0" camelcase "^5.0.0" dedent "^0.7.0" fs-extra "^8.1.0" globby "^9.2.0" init-package-json "^1.10.3" npm-package-arg "^6.1.0" p-reduce "^1.0.0" pify "^4.0.1" semver "^6.2.0" slash "^2.0.0" validate-npm-package-license "^3.0.3" validate-npm-package-name "^3.0.0" whatwg-url "^7.0.0" "@lerna/describe-ref@3.16.5": version "3.16.5" resolved "https://registry.npmjs.org/@lerna/describe-ref/-/describe-ref-3.16.5.tgz" integrity sha512-c01+4gUF0saOOtDBzbLMFOTJDHTKbDFNErEY6q6i9QaXuzy9LNN62z+Hw4acAAZuJQhrVWncVathcmkkjvSVGw== dependencies: "@lerna/child-process" "3.16.5" npmlog "^4.1.2" "@lerna/diff@3.21.0": version "3.21.0" resolved "https://registry.npmjs.org/@lerna/diff/-/diff-3.21.0.tgz" integrity sha512-5viTR33QV3S7O+bjruo1SaR40m7F2aUHJaDAC7fL9Ca6xji+aw1KFkpCtVlISS0G8vikUREGMJh+c/VMSc8Usw== dependencies: "@lerna/child-process" "3.16.5" "@lerna/command" "3.21.0" "@lerna/validation-error" "3.13.0" npmlog "^4.1.2" "@lerna/exec@3.21.0": version "3.21.0" resolved "https://registry.npmjs.org/@lerna/exec/-/exec-3.21.0.tgz" integrity sha512-iLvDBrIE6rpdd4GIKTY9mkXyhwsJ2RvQdB9ZU+/NhR3okXfqKc6py/24tV111jqpXTtZUW6HNydT4dMao2hi1Q== dependencies: "@lerna/child-process" "3.16.5" "@lerna/command" "3.21.0" "@lerna/filter-options" "3.20.0" "@lerna/profiler" "3.20.0" "@lerna/run-topologically" "3.18.5" "@lerna/validation-error" "3.13.0" p-map "^2.1.0" "@lerna/filter-options@3.20.0": version "3.20.0" resolved "https://registry.npmjs.org/@lerna/filter-options/-/filter-options-3.20.0.tgz" integrity sha512-bmcHtvxn7SIl/R9gpiNMVG7yjx7WyT0HSGw34YVZ9B+3xF/83N3r5Rgtjh4hheLZ+Q91Or0Jyu5O3Nr+AwZe2g== dependencies: "@lerna/collect-updates" "3.20.0" "@lerna/filter-packages" "3.18.0" dedent "^0.7.0" figgy-pudding "^3.5.1" npmlog "^4.1.2" "@lerna/filter-packages@3.18.0": version "3.18.0" resolved "https://registry.npmjs.org/@lerna/filter-packages/-/filter-packages-3.18.0.tgz" integrity sha512-6/0pMM04bCHNATIOkouuYmPg6KH3VkPCIgTfQmdkPJTullERyEQfNUKikrefjxo1vHOoCACDpy65JYyKiAbdwQ== dependencies: "@lerna/validation-error" "3.13.0" multimatch "^3.0.0" npmlog "^4.1.2" "@lerna/get-npm-exec-opts@3.13.0": version "3.13.0" resolved "https://registry.npmjs.org/@lerna/get-npm-exec-opts/-/get-npm-exec-opts-3.13.0.tgz" integrity sha512-Y0xWL0rg3boVyJk6An/vurKzubyJKtrxYv2sj4bB8Mc5zZ3tqtv0ccbOkmkXKqbzvNNF7VeUt1OJ3DRgtC/QZw== dependencies: npmlog "^4.1.2" "@lerna/get-packed@3.16.0": version "3.16.0" resolved "https://registry.npmjs.org/@lerna/get-packed/-/get-packed-3.16.0.tgz" integrity sha512-AjsFiaJzo1GCPnJUJZiTW6J1EihrPkc2y3nMu6m3uWFxoleklsSCyImumzVZJssxMi3CPpztj8LmADLedl9kXw== dependencies: fs-extra "^8.1.0" ssri "^6.0.1" tar "^4.4.8" "@lerna/github-client@3.22.0": version "3.22.0" resolved "https://registry.npmjs.org/@lerna/github-client/-/github-client-3.22.0.tgz" integrity sha512-O/GwPW+Gzr3Eb5bk+nTzTJ3uv+jh5jGho9BOqKlajXaOkMYGBELEAqV5+uARNGWZFvYAiF4PgqHb6aCUu7XdXg== dependencies: "@lerna/child-process" "3.16.5" "@octokit/plugin-enterprise-rest" "^6.0.1" "@octokit/rest" "^16.28.4" git-url-parse "^11.1.2" npmlog "^4.1.2" "@lerna/gitlab-client@3.15.0": version "3.15.0" resolved "https://registry.npmjs.org/@lerna/gitlab-client/-/gitlab-client-3.15.0.tgz" integrity sha512-OsBvRSejHXUBMgwWQqNoioB8sgzL/Pf1pOUhHKtkiMl6aAWjklaaq5HPMvTIsZPfS6DJ9L5OK2GGZuooP/5c8Q== dependencies: node-fetch "^2.5.0" npmlog "^4.1.2" whatwg-url "^7.0.0" "@lerna/global-options@3.13.0": version "3.13.0" resolved "https://registry.npmjs.org/@lerna/global-options/-/global-options-3.13.0.tgz" integrity sha512-SlZvh1gVRRzYLVluz9fryY1nJpZ0FHDGB66U9tFfvnnxmueckRQxLopn3tXj3NU1kc3QANT2I5BsQkOqZ4TEFQ== "@lerna/has-npm-version@3.16.5": version "3.16.5" resolved "https://registry.npmjs.org/@lerna/has-npm-version/-/has-npm-version-3.16.5.tgz" integrity sha512-WL7LycR9bkftyqbYop5rEGJ9sRFIV55tSGmbN1HLrF9idwOCD7CLrT64t235t3t4O5gehDnwKI5h2U3oxTrF8Q== dependencies: "@lerna/child-process" "3.16.5" semver "^6.2.0" "@lerna/import@3.22.0": version "3.22.0" resolved "https://registry.npmjs.org/@lerna/import/-/import-3.22.0.tgz" integrity sha512-uWOlexasM5XR6tXi4YehODtH9Y3OZrFht3mGUFFT3OIl2s+V85xIGFfqFGMTipMPAGb2oF1UBLL48kR43hRsOg== dependencies: "@lerna/child-process" "3.16.5" "@lerna/command" "3.21.0" "@lerna/prompt" "3.18.5" "@lerna/pulse-till-done" "3.13.0" "@lerna/validation-error" "3.13.0" dedent "^0.7.0" fs-extra "^8.1.0" p-map-series "^1.0.0" "@lerna/info@3.21.0": version "3.21.0" resolved "https://registry.npmjs.org/@lerna/info/-/info-3.21.0.tgz" integrity sha512-0XDqGYVBgWxUquFaIptW2bYSIu6jOs1BtkvRTWDDhw4zyEdp6q4eaMvqdSap1CG+7wM5jeLCi6z94wS0AuiuwA== dependencies: "@lerna/command" "3.21.0" "@lerna/output" "3.13.0" envinfo "^7.3.1" "@lerna/init@3.21.0": version "3.21.0" resolved "https://registry.npmjs.org/@lerna/init/-/init-3.21.0.tgz" integrity sha512-6CM0z+EFUkFfurwdJCR+LQQF6MqHbYDCBPyhu/d086LRf58GtYZYj49J8mKG9ktayp/TOIxL/pKKjgLD8QBPOg== dependencies: "@lerna/child-process" "3.16.5" "@lerna/command" "3.21.0" fs-extra "^8.1.0" p-map "^2.1.0" write-json-file "^3.2.0" "@lerna/link@3.21.0": version "3.21.0" resolved "https://registry.npmjs.org/@lerna/link/-/link-3.21.0.tgz" integrity sha512-tGu9GxrX7Ivs+Wl3w1+jrLi1nQ36kNI32dcOssij6bg0oZ2M2MDEFI9UF2gmoypTaN9uO5TSsjCFS7aR79HbdQ== dependencies: "@lerna/command" "3.21.0" "@lerna/package-graph" "3.18.5" "@lerna/symlink-dependencies" "3.17.0" p-map "^2.1.0" slash "^2.0.0" "@lerna/list@3.21.0": version "3.21.0" resolved "https://registry.npmjs.org/@lerna/list/-/list-3.21.0.tgz" integrity sha512-KehRjE83B1VaAbRRkRy6jLX1Cin8ltsrQ7FHf2bhwhRHK0S54YuA6LOoBnY/NtA8bHDX/Z+G5sMY78X30NS9tg== dependencies: "@lerna/command" "3.21.0" "@lerna/filter-options" "3.20.0" "@lerna/listable" "3.18.5" "@lerna/output" "3.13.0" "@lerna/listable@3.18.5": version "3.18.5" resolved "https://registry.npmjs.org/@lerna/listable/-/listable-3.18.5.tgz" integrity sha512-Sdr3pVyaEv5A7ZkGGYR7zN+tTl2iDcinryBPvtuv20VJrXBE8wYcOks1edBTcOWsPjCE/rMP4bo1pseyk3UTsg== dependencies: "@lerna/query-graph" "3.18.5" chalk "^2.3.1" columnify "^1.5.4" "@lerna/log-packed@3.16.0": version "3.16.0" resolved "https://registry.npmjs.org/@lerna/log-packed/-/log-packed-3.16.0.tgz" integrity sha512-Fp+McSNBV/P2mnLUYTaSlG8GSmpXM7krKWcllqElGxvAqv6chk2K3c2k80MeVB4WvJ9tRjUUf+i7HUTiQ9/ckQ== dependencies: byte-size "^5.0.1" columnify "^1.5.4" has-unicode "^2.0.1" npmlog "^4.1.2" "@lerna/npm-conf@3.16.0": version "3.16.0" resolved "https://registry.npmjs.org/@lerna/npm-conf/-/npm-conf-3.16.0.tgz" integrity sha512-HbO3DUrTkCAn2iQ9+FF/eisDpWY5POQAOF1m7q//CZjdC2HSW3UYbKEGsSisFxSfaF9Z4jtrV+F/wX6qWs3CuA== dependencies: config-chain "^1.1.11" pify "^4.0.1" "@lerna/npm-dist-tag@3.18.5": version "3.18.5" resolved "https://registry.npmjs.org/@lerna/npm-dist-tag/-/npm-dist-tag-3.18.5.tgz" integrity sha512-xw0HDoIG6HreVsJND9/dGls1c+lf6vhu7yJoo56Sz5bvncTloYGLUppIfDHQr4ZvmPCK8rsh0euCVh2giPxzKQ== dependencies: "@evocateur/npm-registry-fetch" "^4.0.0" "@lerna/otplease" "3.18.5" figgy-pudding "^3.5.1" npm-package-arg "^6.1.0" npmlog "^4.1.2" "@lerna/npm-install@3.16.5": version "3.16.5" resolved "https://registry.npmjs.org/@lerna/npm-install/-/npm-install-3.16.5.tgz" integrity sha512-hfiKk8Eku6rB9uApqsalHHTHY+mOrrHeWEs+gtg7+meQZMTS3kzv4oVp5cBZigndQr3knTLjwthT/FX4KvseFg== dependencies: "@lerna/child-process" "3.16.5" "@lerna/get-npm-exec-opts" "3.13.0" fs-extra "^8.1.0" npm-package-arg "^6.1.0" npmlog "^4.1.2" signal-exit "^3.0.2" write-pkg "^3.1.0" "@lerna/npm-publish@3.18.5": version "3.18.5" resolved "https://registry.npmjs.org/@lerna/npm-publish/-/npm-publish-3.18.5.tgz" integrity sha512-3etLT9+2L8JAx5F8uf7qp6iAtOLSMj+ZYWY6oUgozPi/uLqU0/gsMsEXh3F0+YVW33q0M61RpduBoAlOOZnaTg== dependencies: "@evocateur/libnpmpublish" "^1.2.2" "@lerna/otplease" "3.18.5" "@lerna/run-lifecycle" "3.16.2" figgy-pudding "^3.5.1" fs-extra "^8.1.0" npm-package-arg "^6.1.0" npmlog "^4.1.2" pify "^4.0.1" read-package-json "^2.0.13" "@lerna/npm-run-script@3.16.5": version "3.16.5" resolved "https://registry.npmjs.org/@lerna/npm-run-script/-/npm-run-script-3.16.5.tgz" integrity sha512-1asRi+LjmVn3pMjEdpqKJZFT/3ZNpb+VVeJMwrJaV/3DivdNg7XlPK9LTrORuKU4PSvhdEZvJmSlxCKyDpiXsQ== dependencies: "@lerna/child-process" "3.16.5" "@lerna/get-npm-exec-opts" "3.13.0" npmlog "^4.1.2" "@lerna/otplease@3.18.5": version "3.18.5" resolved "https://registry.npmjs.org/@lerna/otplease/-/otplease-3.18.5.tgz" integrity sha512-S+SldXAbcXTEDhzdxYLU0ZBKuYyURP/ND2/dK6IpKgLxQYh/z4ScljPDMyKymmEvgiEJmBsPZAAPfmNPEzxjog== dependencies: "@lerna/prompt" "3.18.5" figgy-pudding "^3.5.1" "@lerna/output@3.13.0": version "3.13.0" resolved "https://registry.npmjs.org/@lerna/output/-/output-3.13.0.tgz" integrity sha512-7ZnQ9nvUDu/WD+bNsypmPG5MwZBwu86iRoiW6C1WBuXXDxM5cnIAC1m2WxHeFnjyMrYlRXM9PzOQ9VDD+C15Rg== dependencies: npmlog "^4.1.2" "@lerna/pack-directory@3.16.4": version "3.16.4" resolved "https://registry.npmjs.org/@lerna/pack-directory/-/pack-directory-3.16.4.tgz" integrity sha512-uxSF0HZeGyKaaVHz5FroDY9A5NDDiCibrbYR6+khmrhZtY0Bgn6hWq8Gswl9iIlymA+VzCbshWIMX4o2O8C8ng== dependencies: "@lerna/get-packed" "3.16.0" "@lerna/package" "3.16.0" "@lerna/run-lifecycle" "3.16.2" figgy-pudding "^3.5.1" npm-packlist "^1.4.4" npmlog "^4.1.2" tar "^4.4.10" temp-write "^3.4.0" "@lerna/package-graph@3.18.5": version "3.18.5" resolved "https://registry.npmjs.org/@lerna/package-graph/-/package-graph-3.18.5.tgz" integrity sha512-8QDrR9T+dBegjeLr+n9WZTVxUYUhIUjUgZ0gvNxUBN8S1WB9r6H5Yk56/MVaB64tA3oGAN9IIxX6w0WvTfFudA== dependencies: "@lerna/prerelease-id-from-version" "3.16.0" "@lerna/validation-error" "3.13.0" npm-package-arg "^6.1.0" npmlog "^4.1.2" semver "^6.2.0" "@lerna/package@3.16.0": version "3.16.0" resolved "https://registry.npmjs.org/@lerna/package/-/package-3.16.0.tgz" integrity sha512-2lHBWpaxcBoiNVbtyLtPUuTYEaB/Z+eEqRS9duxpZs6D+mTTZMNy6/5vpEVSCBmzvdYpyqhqaYjjSLvjjr5Riw== dependencies: load-json-file "^5.3.0" npm-package-arg "^6.1.0" write-pkg "^3.1.0" "@lerna/prerelease-id-from-version@3.16.0": version "3.16.0" resolved "https://registry.npmjs.org/@lerna/prerelease-id-from-version/-/prerelease-id-from-version-3.16.0.tgz" integrity sha512-qZyeUyrE59uOK8rKdGn7jQz+9uOpAaF/3hbslJVFL1NqF9ELDTqjCPXivuejMX/lN4OgD6BugTO4cR7UTq/sZA== dependencies: semver "^6.2.0" "@lerna/profiler@3.20.0": version "3.20.0" resolved "https://registry.npmjs.org/@lerna/profiler/-/profiler-3.20.0.tgz" integrity sha512-bh8hKxAlm6yu8WEOvbLENm42i2v9SsR4WbrCWSbsmOElx3foRnMlYk7NkGECa+U5c3K4C6GeBbwgqs54PP7Ljg== dependencies: figgy-pudding "^3.5.1" fs-extra "^8.1.0" npmlog "^4.1.2" upath "^1.2.0" "@lerna/project@3.21.0": version "3.21.0" resolved "https://registry.npmjs.org/@lerna/project/-/project-3.21.0.tgz" integrity sha512-xT1mrpET2BF11CY32uypV2GPtPVm6Hgtha7D81GQP9iAitk9EccrdNjYGt5UBYASl4CIDXBRxwmTTVGfrCx82A== dependencies: "@lerna/package" "3.16.0" "@lerna/validation-error" "3.13.0" cosmiconfig "^5.1.0" dedent "^0.7.0" dot-prop "^4.2.0" glob-parent "^5.0.0" globby "^9.2.0" load-json-file "^5.3.0" npmlog "^4.1.2" p-map "^2.1.0" resolve-from "^4.0.0" write-json-file "^3.2.0" "@lerna/prompt@3.18.5": version "3.18.5" resolved "https://registry.npmjs.org/@lerna/prompt/-/prompt-3.18.5.tgz" integrity sha512-rkKj4nm1twSbBEb69+Em/2jAERK8htUuV8/xSjN0NPC+6UjzAwY52/x9n5cfmpa9lyKf/uItp7chCI7eDmNTKQ== dependencies: inquirer "^6.2.0" npmlog "^4.1.2" "@lerna/publish@3.22.1": version "3.22.1" resolved "https://registry.npmjs.org/@lerna/publish/-/publish-3.22.1.tgz" integrity sha512-PG9CM9HUYDreb1FbJwFg90TCBQooGjj+n/pb3gw/eH5mEDq0p8wKdLFe0qkiqUkm/Ub5C8DbVFertIo0Vd0zcw== dependencies: "@evocateur/libnpmaccess" "^3.1.2" "@evocateur/npm-registry-fetch" "^4.0.0" "@evocateur/pacote" "^9.6.3" "@lerna/check-working-tree" "3.16.5" "@lerna/child-process" "3.16.5" "@lerna/collect-updates" "3.20.0" "@lerna/command" "3.21.0" "@lerna/describe-ref" "3.16.5" "@lerna/log-packed" "3.16.0" "@lerna/npm-conf" "3.16.0" "@lerna/npm-dist-tag" "3.18.5" "@lerna/npm-publish" "3.18.5" "@lerna/otplease" "3.18.5" "@lerna/output" "3.13.0" "@lerna/pack-directory" "3.16.4" "@lerna/prerelease-id-from-version" "3.16.0" "@lerna/prompt" "3.18.5" "@lerna/pulse-till-done" "3.13.0" "@lerna/run-lifecycle" "3.16.2" "@lerna/run-topologically" "3.18.5" "@lerna/validation-error" "3.13.0" "@lerna/version" "3.22.1" figgy-pudding "^3.5.1" fs-extra "^8.1.0" npm-package-arg "^6.1.0" npmlog "^4.1.2" p-finally "^1.0.0" p-map "^2.1.0" p-pipe "^1.2.0" semver "^6.2.0" "@lerna/pulse-till-done@3.13.0": version "3.13.0" resolved "https://registry.npmjs.org/@lerna/pulse-till-done/-/pulse-till-done-3.13.0.tgz" integrity sha512-1SOHpy7ZNTPulzIbargrgaJX387csN7cF1cLOGZiJQA6VqnS5eWs2CIrG8i8wmaUavj2QlQ5oEbRMVVXSsGrzA== dependencies: npmlog "^4.1.2" "@lerna/query-graph@3.18.5": version "3.18.5" resolved "https://registry.npmjs.org/@lerna/query-graph/-/query-graph-3.18.5.tgz" integrity sha512-50Lf4uuMpMWvJ306be3oQDHrWV42nai9gbIVByPBYJuVW8dT8O8pA3EzitNYBUdLL9/qEVbrR0ry1HD7EXwtRA== dependencies: "@lerna/package-graph" "3.18.5" figgy-pudding "^3.5.1" "@lerna/resolve-symlink@3.16.0": version "3.16.0" resolved "https://registry.npmjs.org/@lerna/resolve-symlink/-/resolve-symlink-3.16.0.tgz" integrity sha512-Ibj5e7njVHNJ/NOqT4HlEgPFPtPLWsO7iu59AM5bJDcAJcR96mLZ7KGVIsS2tvaO7akMEJvt2P+ErwCdloG3jQ== dependencies: fs-extra "^8.1.0" npmlog "^4.1.2" read-cmd-shim "^1.0.1" "@lerna/rimraf-dir@3.16.5": version "3.16.5" resolved "https://registry.npmjs.org/@lerna/rimraf-dir/-/rimraf-dir-3.16.5.tgz" integrity sha512-bQlKmO0pXUsXoF8lOLknhyQjOZsCc0bosQDoX4lujBXSWxHVTg1VxURtWf2lUjz/ACsJVDfvHZbDm8kyBk5okA== dependencies: "@lerna/child-process" "3.16.5" npmlog "^4.1.2" path-exists "^3.0.0" rimraf "^2.6.2" "@lerna/run-lifecycle@3.16.2": version "3.16.2" resolved "https://registry.npmjs.org/@lerna/run-lifecycle/-/run-lifecycle-3.16.2.tgz" integrity sha512-RqFoznE8rDpyyF0rOJy3+KjZCeTkO8y/OB9orPauR7G2xQ7PTdCpgo7EO6ZNdz3Al+k1BydClZz/j78gNCmL2A== dependencies: "@lerna/npm-conf" "3.16.0" figgy-pudding "^3.5.1" npm-lifecycle "^3.1.2" npmlog "^4.1.2" "@lerna/run-topologically@3.18.5": version "3.18.5" resolved "https://registry.npmjs.org/@lerna/run-topologically/-/run-topologically-3.18.5.tgz" integrity sha512-6N1I+6wf4hLOnPW+XDZqwufyIQ6gqoPfHZFkfWlvTQ+Ue7CuF8qIVQ1Eddw5HKQMkxqN10thKOFfq/9NQZ4NUg== dependencies: "@lerna/query-graph" "3.18.5" figgy-pudding "^3.5.1" p-queue "^4.0.0" "@lerna/run@3.21.0": version "3.21.0" resolved "https://registry.npmjs.org/@lerna/run/-/run-3.21.0.tgz" integrity sha512-fJF68rT3veh+hkToFsBmUJ9MHc9yGXA7LSDvhziAojzOb0AI/jBDp6cEcDQyJ7dbnplba2Lj02IH61QUf9oW0Q== dependencies: "@lerna/command" "3.21.0" "@lerna/filter-options" "3.20.0" "@lerna/npm-run-script" "3.16.5" "@lerna/output" "3.13.0" "@lerna/profiler" "3.20.0" "@lerna/run-topologically" "3.18.5" "@lerna/timer" "3.13.0" "@lerna/validation-error" "3.13.0" p-map "^2.1.0" "@lerna/symlink-binary@3.17.0": version "3.17.0" resolved "https://registry.npmjs.org/@lerna/symlink-binary/-/symlink-binary-3.17.0.tgz" integrity sha512-RLpy9UY6+3nT5J+5jkM5MZyMmjNHxZIZvXLV+Q3MXrf7Eaa1hNqyynyj4RO95fxbS+EZc4XVSk25DGFQbcRNSQ== dependencies: "@lerna/create-symlink" "3.16.2" "@lerna/package" "3.16.0" fs-extra "^8.1.0" p-map "^2.1.0" "@lerna/symlink-dependencies@3.17.0": version "3.17.0" resolved "https://registry.npmjs.org/@lerna/symlink-dependencies/-/symlink-dependencies-3.17.0.tgz" integrity sha512-KmjU5YT1bpt6coOmdFueTJ7DFJL4H1w5eF8yAQ2zsGNTtZ+i5SGFBWpb9AQaw168dydc3s4eu0W0Sirda+F59Q== dependencies: "@lerna/create-symlink" "3.16.2" "@lerna/resolve-symlink" "3.16.0" "@lerna/symlink-binary" "3.17.0" fs-extra "^8.1.0" p-finally "^1.0.0" p-map "^2.1.0" p-map-series "^1.0.0" "@lerna/timer@3.13.0": version "3.13.0" resolved "https://registry.npmjs.org/@lerna/timer/-/timer-3.13.0.tgz" integrity sha512-RHWrDl8U4XNPqY5MQHkToWS9jHPnkLZEt5VD+uunCKTfzlxGnRCr3/zVr8VGy/uENMYpVP3wJa4RKGY6M0vkRw== "@lerna/validation-error@3.13.0": version "3.13.0" resolved "https://registry.npmjs.org/@lerna/validation-error/-/validation-error-3.13.0.tgz" integrity sha512-SiJP75nwB8GhgwLKQfdkSnDufAaCbkZWJqEDlKOUPUvVOplRGnfL+BPQZH5nvq2BYSRXsksXWZ4UHVnQZI/HYA== dependencies: npmlog "^4.1.2" "@lerna/version@3.22.1": version "3.22.1" resolved "https://registry.npmjs.org/@lerna/version/-/version-3.22.1.tgz" integrity sha512-PSGt/K1hVqreAFoi3zjD0VEDupQ2WZVlVIwesrE5GbrL2BjXowjCsTDPqblahDUPy0hp6h7E2kG855yLTp62+g== dependencies: "@lerna/check-working-tree" "3.16.5" "@lerna/child-process" "3.16.5" "@lerna/collect-updates" "3.20.0" "@lerna/command" "3.21.0" "@lerna/conventional-commits" "3.22.0" "@lerna/github-client" "3.22.0" "@lerna/gitlab-client" "3.15.0" "@lerna/output" "3.13.0" "@lerna/prerelease-id-from-version" "3.16.0" "@lerna/prompt" "3.18.5" "@lerna/run-lifecycle" "3.16.2" "@lerna/run-topologically" "3.18.5" "@lerna/validation-error" "3.13.0" chalk "^2.3.1" dedent "^0.7.0" load-json-file "^5.3.0" minimatch "^3.0.4" npmlog "^4.1.2" p-map "^2.1.0" p-pipe "^1.2.0" p-reduce "^1.0.0" p-waterfall "^1.0.0" semver "^6.2.0" slash "^2.0.0" temp-write "^3.4.0" write-json-file "^3.2.0" "@lerna/write-log-file@3.13.0": version "3.13.0" resolved "https://registry.npmjs.org/@lerna/write-log-file/-/write-log-file-3.13.0.tgz" integrity sha512-RibeMnDPvlL8bFYW5C8cs4mbI3AHfQef73tnJCQ/SgrXZHehmHnsyWUiE7qDQCAo+B1RfTapvSyFF69iPj326A== dependencies: npmlog "^4.1.2" write-file-atomic "^2.3.0" "@mrmlnc/readdir-enhanced@^2.2.1": version "2.2.1" resolved "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz" integrity sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g== dependencies: call-me-maybe "^1.0.1" glob-to-regexp "^0.3.0" "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== dependencies: "@nodelib/fs.stat" "2.0.5" run-parallel "^1.1.9" "@nodelib/fs.stat@2.0.5": version "2.0.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== "@nodelib/fs.stat@^1.1.2": version "1.1.3" resolved "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz" integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw== "@nodelib/fs.stat@^2.0.2": version "2.0.3" resolved "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz" integrity sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA== "@nodelib/fs.walk@^1.2.3", "@nodelib/fs.walk@^1.2.8": version "1.2.8" resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== dependencies: "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" "@npmcli/agent@^2.0.0": version "2.2.2" resolved "https://registry.yarnpkg.com/@npmcli/agent/-/agent-2.2.2.tgz#967604918e62f620a648c7975461c9c9e74fc5d5" integrity sha512-OrcNPXdpSl9UX7qPVRWbmWMCSXrcDa2M9DvrbOTj7ao1S4PlqVFYv9/yLKMkrJKZ/V5A/kDBC690or307i26Og== dependencies: agent-base "^7.1.0" http-proxy-agent "^7.0.0" https-proxy-agent "^7.0.1" lru-cache "^10.0.1" socks-proxy-agent "^8.0.3" "@npmcli/fs@^3.1.0": version "3.1.1" resolved "https://registry.yarnpkg.com/@npmcli/fs/-/fs-3.1.1.tgz#59cdaa5adca95d135fc00f2bb53f5771575ce726" integrity sha512-q9CRWjpHCMIh5sVyefoD1cA7PkvILqCZsnSOEUUivORLjxCO/Irmue2DprETiNgEqktDBZaM1Bi+jrarx1XdCg== dependencies: semver "^7.3.5" "@octokit/auth-token@^2.4.0": version "2.4.2" resolved "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.2.tgz" integrity sha512-jE/lE/IKIz2v1+/P0u4fJqv0kYwXOTujKemJMFr6FeopsxlIK3+wKDCJGnysg81XID5TgZQbIfuJ5J0lnTiuyQ== dependencies: "@octokit/types" "^5.0.0" "@octokit/endpoint@^6.0.1": version "6.0.8" resolved "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.8.tgz" integrity sha512-MuRrgv+bM4Q+e9uEvxAB/Kf+Sj0O2JAOBA131uo1o6lgdq1iS8ejKwtqHgdfY91V3rN9R/hdGKFiQYMzVzVBEQ== dependencies: "@octokit/types" "^5.0.0" is-plain-object "^5.0.0" universal-user-agent "^6.0.0" "@octokit/plugin-enterprise-rest@^6.0.1": version "6.0.1" resolved "https://registry.npmjs.org/@octokit/plugin-enterprise-rest/-/plugin-enterprise-rest-6.0.1.tgz" integrity sha512-93uGjlhUD+iNg1iWhUENAtJata6w5nE+V4urXOAlIXdco6xNZtUSfYY8dzp3Udy74aqO/B5UZL80x/YMa5PKRw== "@octokit/plugin-paginate-rest@^1.1.1": version "1.1.2" resolved "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-1.1.2.tgz" integrity sha512-jbsSoi5Q1pj63sC16XIUboklNw+8tL9VOnJsWycWYR78TKss5PVpIPb1TUUcMQ+bBh7cY579cVAWmf5qG+dw+Q== dependencies: "@octokit/types" "^2.0.1" "@octokit/plugin-request-log@^1.0.0": version "1.0.0" resolved "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.0.tgz" integrity sha512-ywoxP68aOT3zHCLgWZgwUJatiENeHE7xJzYjfz8WI0goynp96wETBF+d95b8g/uL4QmS6owPVlaxiz3wyMAzcw== "@octokit/plugin-rest-endpoint-methods@2.4.0": version "2.4.0" resolved "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-2.4.0.tgz" integrity sha512-EZi/AWhtkdfAYi01obpX0DF7U6b1VRr30QNQ5xSFPITMdLSfhcBqjamE3F+sKcxPbD7eZuMHu3Qkk2V+JGxBDQ== dependencies: "@octokit/types" "^2.0.1" deprecation "^2.3.1" "@octokit/request-error@^1.0.2": version "1.2.1" resolved "https://registry.npmjs.org/@octokit/request-error/-/request-error-1.2.1.tgz" integrity sha512-+6yDyk1EES6WK+l3viRDElw96MvwfJxCt45GvmjDUKWjYIb3PJZQkq3i46TwGwoPD4h8NmTrENmtyA1FwbmhRA== dependencies: "@octokit/types" "^2.0.0" deprecation "^2.0.0" once "^1.4.0" "@octokit/request-error@^2.0.0": version "2.0.2" resolved "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.0.2.tgz" integrity sha512-2BrmnvVSV1MXQvEkrb9zwzP0wXFNbPJij922kYBTLIlIafukrGOb+ABBT2+c6wZiuyWDH1K1zmjGQ0toN/wMWw== dependencies: "@octokit/types" "^5.0.1" deprecation "^2.0.0" once "^1.4.0" "@octokit/request@^5.2.0": version "5.4.9" resolved "https://registry.npmjs.org/@octokit/request/-/request-5.4.9.tgz" integrity sha512-CzwVvRyimIM1h2n9pLVYfTDmX9m+KHSgCpqPsY8F1NdEK8IaWqXhSBXsdjOBFZSpEcxNEeg4p0UO9cQ8EnOCLA== dependencies: "@octokit/endpoint" "^6.0.1" "@octokit/request-error" "^2.0.0" "@octokit/types" "^5.0.0" deprecation "^2.0.0" is-plain-object "^5.0.0" node-fetch "^2.6.1" once "^1.4.0" universal-user-agent "^6.0.0" "@octokit/rest@^16.28.4": version "16.43.2" resolved "https://registry.npmjs.org/@octokit/rest/-/rest-16.43.2.tgz" integrity sha512-ngDBevLbBTFfrHZeiS7SAMAZ6ssuVmXuya+F/7RaVvlysgGa1JKJkKWY+jV6TCJYcW0OALfJ7nTIGXcBXzycfQ== dependencies: "@octokit/auth-token" "^2.4.0" "@octokit/plugin-paginate-rest" "^1.1.1" "@octokit/plugin-request-log" "^1.0.0" "@octokit/plugin-rest-endpoint-methods" "2.4.0" "@octokit/request" "^5.2.0" "@octokit/request-error" "^1.0.2" atob-lite "^2.0.0" before-after-hook "^2.0.0" btoa-lite "^1.0.0" deprecation "^2.0.0" lodash.get "^4.4.2" lodash.set "^4.3.2" lodash.uniq "^4.5.0" octokit-pagination-methods "^1.1.0" once "^1.4.0" universal-user-agent "^4.0.0" "@octokit/types@^2.0.0", "@octokit/types@^2.0.1": version "2.16.2" resolved "https://registry.npmjs.org/@octokit/types/-/types-2.16.2.tgz" integrity sha512-O75k56TYvJ8WpAakWwYRN8Bgu60KrmX0z1KqFp1kNiFNkgW+JW+9EBKZ+S33PU6SLvbihqd+3drvPxKK68Ee8Q== dependencies: "@types/node" ">= 8" "@octokit/types@^5.0.0", "@octokit/types@^5.0.1": version "5.5.0" resolved "https://registry.npmjs.org/@octokit/types/-/types-5.5.0.tgz" integrity sha512-UZ1pErDue6bZNjYOotCNveTXArOMZQFG6hKJfOnGnulVCMcVVi7YIIuuR4WfBhjo7zgpmzn/BkPDnUXtNx+PcQ== dependencies: "@types/node" ">= 8" "@pkgjs/parseargs@^0.11.0": version "0.11.0" resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== "@pkgr/core@^0.1.0": version "0.1.0" resolved "https://registry.yarnpkg.com/@pkgr/core/-/core-0.1.0.tgz#7d8dacb7fdef0e4387caf7396cbd77f179867d06" integrity sha512-Zwq5OCzuwJC2jwqmpEQt7Ds1DTi6BWSwoGkbb1n9pO3hzb35BoJELx7c0T23iDkBGkh2e7tvOtjF3tr3OaQHDQ== "@types/chai@^4.2.13", "@types/chai@^4.2.7": version "4.3.3" resolved "https://registry.npmjs.org/@types/chai/-/chai-4.3.3.tgz" integrity sha512-hC7OMnszpxhZPduX+m+nrx+uFoLkWOMiR4oa/AZF3MuSETYTZmFfJAHqZEM8MVlvfG7BEUcgvtwoCTxBp6hm3g== "@types/glob@^7.1.1": version "7.1.3" resolved "https://registry.npmjs.org/@types/glob/-/glob-7.1.3.tgz" integrity sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w== dependencies: "@types/minimatch" "*" "@types/node" "*" "@types/json-schema@^7.0.12": version "7.0.15" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== "@types/minimatch@*": version "3.0.3" resolved "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz" integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== "@types/minimist@^1.2.0": version "1.2.0" resolved "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.0.tgz" integrity sha1-aaI6OtKcrwCX8G7aWbNh7i8GOfY= "@types/mocha@^10.0.7": version "10.0.7" resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-10.0.7.tgz#4c620090f28ca7f905a94b706f74dc5b57b44f2f" integrity sha512-GN8yJ1mNTcFcah/wKEFIJckJx9iJLoMSzWcfRRuxz/Jk+U6KQNnml+etbtxFK8lPjzOw3zp4Ha/kjSst9fsHYw== "@types/node@*", "@types/node@>= 8": version "12.12.21" resolved "https://registry.npmjs.org/@types/node/-/node-12.12.21.tgz" integrity sha512-8sRGhbpU+ck1n0PGAUgVrWrWdjSW2aqNeyC15W88GRsMpSwzv6RJGlLhE7s2RhVSOdyDmxbqlWSeThq4/7xqlA== "@types/node@^12.12.21": version "12.12.67" resolved "https://registry.npmjs.org/@types/node/-/node-12.12.67.tgz" integrity sha512-R48tgL2izApf+9rYNH+3RBMbRpPeW3N8f0I9HMhggeq4UXwBDqumJ14SDs4ctTMhG11pIOduZ4z3QWGOiMc9Vg== "@types/node@^14.0.0": version "14.11.8" resolved "https://registry.npmjs.org/@types/node/-/node-14.11.8.tgz" integrity sha512-KPcKqKm5UKDkaYPTuXSx8wEP7vE9GnuaXIZKijwRYcePpZFDVuy2a57LarFKiORbHOuTOOwYzxVxcUzsh2P2Pw== "@types/normalize-package-data@^2.4.0": version "2.4.0" resolved "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz" integrity sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA== "@types/pg-types@*": version "1.11.5" resolved "https://registry.npmjs.org/@types/pg-types/-/pg-types-1.11.5.tgz" integrity sha512-L8ogeT6vDzT1vxlW3KITTCt+BVXXVkLXfZ/XNm6UqbcJgxf+KPO7yjWx7dQQE8RW07KopL10x2gNMs41+IkMGQ== "@types/pg@^7.14.5": version "7.14.5" resolved "https://registry.npmjs.org/@types/pg/-/pg-7.14.5.tgz" integrity sha512-wqTKZmqkqXd1YiVRBT2poRrMIojwEi2bKTAAjUX6nEbzr98jc3cfR/7o7ZtubhH5xT7YJ6LRdRr1GZOgs8OUjg== dependencies: "@types/node" "*" "@types/pg-types" "*" "@types/semver@^7.5.0": version "7.5.6" resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.6.tgz#c65b2bfce1bec346582c07724e3f8c1017a20339" integrity sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A== "@typescript-eslint/eslint-plugin@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.0.0.tgz#62cda0d35bbf601683c6e58cf5d04f0275caca4e" integrity sha512-M72SJ0DkcQVmmsbqlzc6EJgb/3Oz2Wdm6AyESB4YkGgCxP8u5jt5jn4/OBMPK3HLOxcttZq5xbBBU7e2By4SZQ== dependencies: "@eslint-community/regexpp" "^4.5.1" "@typescript-eslint/scope-manager" "7.0.0" "@typescript-eslint/type-utils" "7.0.0" "@typescript-eslint/utils" "7.0.0" "@typescript-eslint/visitor-keys" "7.0.0" debug "^4.3.4" graphemer "^1.4.0" ignore "^5.2.4" natural-compare "^1.4.0" semver "^7.5.4" ts-api-utils "^1.0.1" "@typescript-eslint/parser@^6.17.0": version "6.17.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.17.0.tgz#8cd7a0599888ca6056082225b2fdf9a635bf32a1" integrity sha512-C4bBaX2orvhK+LlwrY8oWGmSl4WolCfYm513gEccdWZj0CwGadbIADb0FtVEcI+WzUyjyoBj2JRP8g25E6IB8A== dependencies: "@typescript-eslint/scope-manager" "6.17.0" "@typescript-eslint/types" "6.17.0" "@typescript-eslint/typescript-estree" "6.17.0" "@typescript-eslint/visitor-keys" "6.17.0" debug "^4.3.4" "@typescript-eslint/scope-manager@6.17.0": version "6.17.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.17.0.tgz#70e6c1334d0d76562dfa61aed9009c140a7601b4" integrity sha512-RX7a8lwgOi7am0k17NUO0+ZmMOX4PpjLtLRgLmT1d3lBYdWH4ssBUbwdmc5pdRX8rXon8v9x8vaoOSpkHfcXGA== dependencies: "@typescript-eslint/types" "6.17.0" "@typescript-eslint/visitor-keys" "6.17.0" "@typescript-eslint/scope-manager@7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-7.0.0.tgz#15ea9abad2b56fc8f5c0b516775f41c86c5c8685" integrity sha512-IxTStwhNDPO07CCrYuAqjuJ3Xf5MrMaNgbAZPxFXAUpAtwqFxiuItxUaVtP/SJQeCdJjwDGh9/lMOluAndkKeg== dependencies: "@typescript-eslint/types" "7.0.0" "@typescript-eslint/visitor-keys" "7.0.0" "@typescript-eslint/type-utils@7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-7.0.0.tgz#a4c7ae114414e09dbbd3c823b5924793f7483252" integrity sha512-FIM8HPxj1P2G7qfrpiXvbHeHypgo2mFpFGoh5I73ZlqmJOsloSa1x0ZyXCer43++P1doxCgNqIOLqmZR6SOT8g== dependencies: "@typescript-eslint/typescript-estree" "7.0.0" "@typescript-eslint/utils" "7.0.0" debug "^4.3.4" ts-api-utils "^1.0.1" "@typescript-eslint/types@6.17.0": version "6.17.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.17.0.tgz#844a92eb7c527110bf9a7d177e3f22bd5a2f40cb" integrity sha512-qRKs9tvc3a4RBcL/9PXtKSehI/q8wuU9xYJxe97WFxnzH8NWWtcW3ffNS+EWg8uPvIerhjsEZ+rHtDqOCiH57A== "@typescript-eslint/types@7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-7.0.0.tgz#2e5889c7fe3c873fc6dc6420aa77775f17cd5dc6" integrity sha512-9ZIJDqagK1TTs4W9IyeB2sH/s1fFhN9958ycW8NRTg1vXGzzH5PQNzq6KbsbVGMT+oyyfa17DfchHDidcmf5cg== "@typescript-eslint/typescript-estree@6.17.0": version "6.17.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.17.0.tgz#b913d19886c52d8dc3db856903a36c6c64fd62aa" integrity sha512-gVQe+SLdNPfjlJn5VNGhlOhrXz4cajwFd5kAgWtZ9dCZf4XJf8xmgCTLIqec7aha3JwgLI2CK6GY1043FRxZwg== dependencies: "@typescript-eslint/types" "6.17.0" "@typescript-eslint/visitor-keys" "6.17.0" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" minimatch "9.0.3" semver "^7.5.4" ts-api-utils "^1.0.1" "@typescript-eslint/typescript-estree@7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-7.0.0.tgz#7ce66f2ce068517f034f73fba9029300302fdae9" integrity sha512-JzsOzhJJm74aQ3c9um/aDryHgSHfaX8SHFIu9x4Gpik/+qxLvxUylhTsO9abcNu39JIdhY2LgYrFxTii3IajLA== dependencies: "@typescript-eslint/types" "7.0.0" "@typescript-eslint/visitor-keys" "7.0.0" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" minimatch "9.0.3" semver "^7.5.4" ts-api-utils "^1.0.1" "@typescript-eslint/utils@7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-7.0.0.tgz#e43710af746c6ae08484f7afc68abc0212782c7e" integrity sha512-kuPZcPAdGcDBAyqDn/JVeJVhySvpkxzfXjJq1X1BFSTYo1TTuo4iyb937u457q4K0In84p6u2VHQGaFnv7VYqg== dependencies: "@eslint-community/eslint-utils" "^4.4.0" "@types/json-schema" "^7.0.12" "@types/semver" "^7.5.0" "@typescript-eslint/scope-manager" "7.0.0" "@typescript-eslint/types" "7.0.0" "@typescript-eslint/typescript-estree" "7.0.0" semver "^7.5.4" "@typescript-eslint/visitor-keys@6.17.0": version "6.17.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.17.0.tgz#3ed043709c39b43ec1e58694f329e0b0430c26b6" integrity sha512-H6VwB/k3IuIeQOyYczyyKN8wH6ed8EwliaYHLxOIhyF0dYEIsN8+Bk3GE19qafeMKyZJJHP8+O1HiFhFLUNKSg== dependencies: "@typescript-eslint/types" "6.17.0" eslint-visitor-keys "^3.4.1" "@typescript-eslint/visitor-keys@7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-7.0.0.tgz#83cdadd193ee735fe9ea541f6a2b4d76dfe62081" integrity sha512-JZP0uw59PRHp7sHQl3aF/lFgwOW2rgNVnXUksj1d932PMita9wFBd3621vHQRDvHwPsSY9FMAAHVc8gTvLYY4w== dependencies: "@typescript-eslint/types" "7.0.0" eslint-visitor-keys "^3.4.1" "@ungap/structured-clone@^1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== "@zkochan/cmd-shim@^3.1.0": version "3.1.0" resolved "https://registry.npmjs.org/@zkochan/cmd-shim/-/cmd-shim-3.1.0.tgz" integrity sha512-o8l0+x7C7sMZU3v9GuJIAU10qQLtwR1dtRQIOmlNMtyaqhmpXOzx1HWiYoWfmmf9HHZoAkXpc9TM9PQYF9d4Jg== dependencies: is-windows "^1.0.0" mkdirp-promise "^5.0.1" mz "^2.5.0" JSONStream@^1.0.4, JSONStream@^1.3.4, JSONStream@~1.3.5: version "1.3.5" resolved "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz" integrity sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ== dependencies: jsonparse "^1.2.0" through ">=2.2.7 <3" abbrev@1: version "1.1.1" resolved "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== abbrev@1.0.x: version "1.0.9" resolved "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz" integrity sha1-kbR5JYinc4wl813W9jdSovh3YTU= abbrev@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-2.0.0.tgz#cf59829b8b4f03f89dda2771cb7f3653828c89bf" integrity sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ== acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== acorn-walk@^8.2.0: version "8.3.2" resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.2.tgz#7703af9415f1b6db9315d6895503862e231d34aa" integrity sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A== acorn@^8.8.0, acorn@^8.9.0: version "8.11.3" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a" integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== agent-base@4, agent-base@^4.3.0: version "4.3.0" resolved "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz" integrity sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg== dependencies: es6-promisify "^5.0.0" agent-base@^7.0.2, agent-base@^7.1.0, agent-base@^7.1.1: version "7.1.1" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-7.1.1.tgz#bdbded7dfb096b751a2a087eeeb9664725b2e317" integrity sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA== dependencies: debug "^4.3.4" agent-base@~4.2.1: version "4.2.1" resolved "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz" integrity sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg== dependencies: es6-promisify "^5.0.0" agentkeepalive@^3.4.1: version "3.5.2" resolved "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-3.5.2.tgz" integrity sha512-e0L/HNe6qkQ7H19kTlRRqUibEAwDK5AFk6y3PtMsuut2VAH6+Q4xZml1tNDJD7kSAyqmbG/K08K5WEJYtUrSlQ== dependencies: humanize-ms "^1.2.1" aggregate-error@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.1.0.tgz#92670ff50f5359bdb7a3e0d40d0ec30c5737687a" integrity sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA== dependencies: clean-stack "^2.0.0" indent-string "^4.0.0" ajv@^6.12.3, ajv@^6.12.4: version "6.12.6" resolved "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== dependencies: fast-deep-equal "^3.1.1" fast-json-stable-stringify "^2.0.0" json-schema-traverse "^0.4.1" uri-js "^4.2.2" amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz" integrity sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU= ansi-colors@4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== ansi-escapes@^3.2.0: version "3.2.0" resolved "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz" integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== ansi-regex@^2.0.0: version "2.1.1" resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz" integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= ansi-regex@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz" integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= ansi-regex@^4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz" integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== ansi-regex@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== ansi-regex@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.0.1.tgz#3183e38fae9a65d7cb5e53945cd5897d0260a06a" integrity sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA== ansi-styles@^3.2.0, ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz" integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== dependencies: color-convert "^1.9.0" ansi-styles@^4.0.0, ansi-styles@^4.1.0: version "4.3.0" resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz" integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== dependencies: color-convert "^2.0.1" ansi-styles@^6.1.0: version "6.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5" integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug== any-promise@^1.0.0: version "1.3.0" resolved "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz" integrity sha1-q8av7tzqUugJzcA3au0845Y10X8= anymatch@~3.1.2: version "3.1.3" resolved "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz" integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== dependencies: normalize-path "^3.0.0" picomatch "^2.0.4" aproba@^1.0.3, aproba@^1.1.1: version "1.2.0" resolved "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz" integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== aproba@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz" integrity sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ== are-we-there-yet@~1.1.2: version "1.1.5" resolved "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz" integrity sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w== dependencies: delegates "^1.0.0" readable-stream "^2.0.6" arg@^4.1.0: version "4.1.3" resolved "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz" integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== argparse@^1.0.7: version "1.0.10" resolved "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz" integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== dependencies: sprintf-js "~1.0.2" argparse@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== arr-diff@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz" integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= arr-flatten@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz" integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== arr-union@^3.1.0: version "3.1.0" resolved "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz" integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= array-differ@^2.0.3: version "2.1.0" resolved "https://registry.npmjs.org/array-differ/-/array-differ-2.1.0.tgz" integrity sha512-KbUpJgx909ZscOc/7CLATBFam7P1Z1QRQInvgT0UztM9Q72aGKCunKASAl7WNW0tnPmPyEMeMhdsfWhfmW037w== array-find-index@^1.0.1: version "1.0.2" resolved "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz" integrity sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E= array-ify@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz" integrity sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4= array-union@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz" integrity sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk= dependencies: array-uniq "^1.0.1" array-union@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz" integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== array-uniq@^1.0.1: version "1.0.3" resolved "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz" integrity sha1-r2rId6Jcx/dOBYiUdThY39sk/bY= array-unique@^0.3.2: version "0.3.2" resolved "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz" integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= arrify@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz" integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= as-table@^1.0.36: version "1.0.55" resolved "https://registry.yarnpkg.com/as-table/-/as-table-1.0.55.tgz#dc984da3937745de902cea1d45843c01bdbbec4f" integrity sha512-xvsWESUJn0JN421Xb9MQw6AsMHRCUknCe0Wjlxvjud80mU4E6hQf1A6NzQKcYNmYw62MfzEtXc+badstZP3JpQ== dependencies: printable-characters "^1.0.42" asap@^2.0.0: version "2.0.6" resolved "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz" integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY= asn1@~0.2.3: version "0.2.4" resolved "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz" integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== dependencies: safer-buffer "~2.1.0" assert-plus@1.0.0, assert-plus@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz" integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= assertion-error@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz" integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== assign-symbols@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz" integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= async@1.x: version "1.5.2" resolved "https://registry.npmjs.org/async/-/async-1.5.2.tgz" integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo= async@2.6.4: version "2.6.4" resolved "https://registry.npmjs.org/async/-/async-2.6.4.tgz" integrity sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA== dependencies: lodash "^4.17.14" async@^0.9.0: version "0.9.2" resolved "https://registry.yarnpkg.com/async/-/async-0.9.2.tgz#aea74d5e61c1f899613bf64bda66d4c78f2fd17d" integrity sha512-l6ToIJIotphWahxxHyzK9bnLR6kM4jJIIgLShZeqLY7iboHoGkdgFl7W2/Ivi4SkMJYGKqW8vSuk0uKUj6qsSw== asynckit@^0.4.0: version "0.4.0" resolved "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz" integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= atob-lite@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/atob-lite/-/atob-lite-2.0.0.tgz" integrity sha1-D+9a1G8b16hQLGVyfwNn1e5D1pY= atob@^2.1.2: version "2.1.2" resolved "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz" integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== aws-sign2@~0.7.0: version "0.7.0" resolved "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz" integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= aws4@^1.8.0: version "1.10.1" resolved "https://registry.npmjs.org/aws4/-/aws4-1.10.1.tgz" integrity sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA== balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz" integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= base64-js@0.0.2: version "0.0.2" resolved "https://registry.npmjs.org/base64-js/-/base64-js-0.0.2.tgz" integrity sha1-Ak8Pcq+iW3X5wO5zzU9V7Bvtl4Q= base@^0.11.1: version "0.11.2" resolved "https://registry.npmjs.org/base/-/base-0.11.2.tgz" integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== dependencies: cache-base "^1.0.1" class-utils "^0.3.5" component-emitter "^1.2.1" define-property "^1.0.0" isobject "^3.0.1" mixin-deep "^1.2.0" pascalcase "^0.1.1" bcrypt-pbkdf@^1.0.0: version "1.0.2" resolved "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz" integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= dependencies: tweetnacl "^0.14.3" before-after-hook@^2.0.0: version "2.1.0" resolved "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.1.0.tgz" integrity sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A== binary-extensions@^2.0.0: version "2.1.0" resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz" integrity sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ== bindings@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== dependencies: file-uri-to-path "1.0.0" blake3-wasm@^2.1.5: version "2.1.5" resolved "https://registry.npmjs.org/blake3-wasm/-/blake3-wasm-2.1.5.tgz" integrity sha512-F1+K8EbfOZE49dtoPtmxUQrpXaBIl3ICvasLh+nJta0xkz+9kF/7uet9fLnwKqhDrmj6g+6K3Tw9yQPUg2ka5g== bluebird@3.7.2, bluebird@^3.5.1, bluebird@^3.5.3, bluebird@^3.5.5: version "3.7.2" resolved "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz" integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== bops@0.0.6: version "0.0.6" resolved "https://registry.npmjs.org/bops/-/bops-0.0.6.tgz" integrity sha1-CC0dVfoB5g29wuvC26N/ZZVUzzo= dependencies: base64-js "0.0.2" to-utf8 "0.0.1" brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz" integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== dependencies: balanced-match "^1.0.0" concat-map "0.0.1" brace-expansion@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== dependencies: balanced-match "^1.0.0" braces@^2.3.1: version "2.3.2" resolved "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz" integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== dependencies: arr-flatten "^1.1.0" array-unique "^0.3.2" extend-shallow "^2.0.1" fill-range "^4.0.0" isobject "^3.0.1" repeat-element "^1.1.2" snapdragon "^0.8.1" snapdragon-node "^2.0.1" split-string "^3.0.2" to-regex "^3.0.1" braces@^3.0.2, braces@~3.0.2: version "3.0.2" resolved "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz" integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== dependencies: fill-range "^7.0.1" browser-stdout@1.3.1: version "1.3.1" resolved "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz" integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== btoa-lite@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/btoa-lite/-/btoa-lite-1.0.0.tgz" integrity sha1-M3dm2hWAEhD92VbCLpxokaudAzc= buffer-from@^1.0.0: version "1.1.1" resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz" integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== builtins@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/builtins/-/builtins-1.0.3.tgz" integrity sha1-y5T662HIaWRR2zZTThQi+U8K7og= byline@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/byline/-/byline-5.0.0.tgz" integrity sha1-dBxSFkaOrcRXsDQQEYrXfejB3bE= byte-size@^5.0.1: version "5.0.1" resolved "https://registry.npmjs.org/byte-size/-/byte-size-5.0.1.tgz" integrity sha512-/XuKeqWocKsYa/cBY1YbSJSWWqTi4cFgr9S6OyM7PBaPbr9zvNGwWP33vt0uqGhwDdN+y3yhbXVILEUpnwEWGw== cacache@^12.0.0, cacache@^12.0.3: version "12.0.4" resolved "https://registry.npmjs.org/cacache/-/cacache-12.0.4.tgz" integrity sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ== dependencies: bluebird "^3.5.5" chownr "^1.1.1" figgy-pudding "^3.5.1" glob "^7.1.4" graceful-fs "^4.1.15" infer-owner "^1.0.3" lru-cache "^5.1.1" mississippi "^3.0.0" mkdirp "^0.5.1" move-concurrently "^1.0.1" promise-inflight "^1.0.1" rimraf "^2.6.3" ssri "^6.0.1" unique-filename "^1.1.1" y18n "^4.0.0" cacache@^18.0.0: version "18.0.3" resolved "https://registry.yarnpkg.com/cacache/-/cacache-18.0.3.tgz#864e2c18414e1e141ae8763f31e46c2cb96d1b21" integrity sha512-qXCd4rh6I07cnDqh8V48/94Tc/WSfj+o3Gn6NZ0aZovS255bUx8O13uKxRFd2eWG0xgsco7+YItQNPaa5E85hg== dependencies: "@npmcli/fs" "^3.1.0" fs-minipass "^3.0.0" glob "^10.2.2" lru-cache "^10.0.1" minipass "^7.0.3" minipass-collect "^2.0.1" minipass-flush "^1.0.5" minipass-pipeline "^1.2.4" p-map "^4.0.0" ssri "^10.0.0" tar "^6.1.11" unique-filename "^3.0.0" cache-base@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz" integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== dependencies: collection-visit "^1.0.0" component-emitter "^1.2.1" get-value "^2.0.6" has-value "^1.0.0" isobject "^3.0.1" set-value "^2.0.0" to-object-path "^0.3.0" union-value "^1.0.0" unset-value "^1.0.0" call-me-maybe@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz" integrity sha1-JtII6onje1y95gJQoV8DHBak1ms= caller-callsite@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz" integrity sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ= dependencies: callsites "^2.0.0" caller-path@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/caller-path/-/caller-path-2.0.0.tgz" integrity sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ= dependencies: caller-callsite "^2.0.0" callsites@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz" integrity sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA= callsites@^3.0.0: version "3.1.0" resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== camelcase-keys@^2.0.0: version "2.1.0" resolved "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz" integrity sha1-MIvur/3ygRkFHvodkyITyRuPkuc= dependencies: camelcase "^2.0.0" map-obj "^1.0.0" camelcase-keys@^4.0.0: version "4.2.0" resolved "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz" integrity sha1-oqpfsa9oh1glnDLBQUJteJI7m3c= dependencies: camelcase "^4.1.0" map-obj "^2.0.0" quick-lru "^1.0.0" camelcase-keys@^6.2.2: version "6.2.2" resolved "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz" integrity sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg== dependencies: camelcase "^5.3.1" map-obj "^4.0.0" quick-lru "^4.0.1" camelcase@^2.0.0: version "2.1.1" resolved "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz" integrity sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8= camelcase@^4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz" integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= camelcase@^5.0.0, camelcase@^5.3.1: version "5.3.1" resolved "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== camelcase@^6.0.0: version "6.3.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== capnp-ts@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/capnp-ts/-/capnp-ts-0.7.0.tgz#16fd8e76b667d002af8fcf4bf92bf15d1a7b54a9" integrity sha512-XKxXAC3HVPv7r674zP0VC3RTXz+/JKhfyw94ljvF80yynK6VkTnqE3jMuN8b3dUVmmc43TjyxjW4KTsmB3c86g== dependencies: debug "^4.3.1" tslib "^2.2.0" caseless@~0.12.0: version "0.12.0" resolved "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= chai@^4.1.1, chai@^4.2.0: version "4.3.6" resolved "https://registry.npmjs.org/chai/-/chai-4.3.6.tgz" integrity sha512-bbcp3YfHCUzMOvKqsztczerVgBKSsEijCySNlHHbX3VG1nskvqjz5Rfso1gGwD6w6oOV3eI60pKuMOV5MV7p3Q== dependencies: assertion-error "^1.1.0" check-error "^1.0.2" deep-eql "^3.0.1" get-func-name "^2.0.0" loupe "^2.3.1" pathval "^1.1.1" type-detect "^4.0.5" chalk@^2.0.0, chalk@^2.3.1, chalk@^2.4.2: version "2.4.2" resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== dependencies: ansi-styles "^3.2.1" escape-string-regexp "^1.0.5" supports-color "^5.3.0" chalk@^4.0.0: version "4.1.0" resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz" integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A== dependencies: ansi-styles "^4.1.0" supports-color "^7.1.0" chalk@^4.1.0: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== dependencies: ansi-styles "^4.1.0" supports-color "^7.1.0" chardet@^0.7.0: version "0.7.0" resolved "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== check-error@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz" integrity sha1-V00xLt2Iu13YkS6Sht1sCu1KrII= chokidar@^3.5.3: version "3.5.3" resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz" integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== dependencies: anymatch "~3.1.2" braces "~3.0.2" glob-parent "~5.1.2" is-binary-path "~2.1.0" is-glob "~4.0.1" normalize-path "~3.0.0" readdirp "~3.6.0" optionalDependencies: fsevents "~2.3.2" chownr@^1.1.1, chownr@^1.1.2, chownr@^1.1.4: version "1.1.4" resolved "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz" integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== chownr@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/chownr/-/chownr-2.0.0.tgz#15bfbe53d2eab4cf70f18a8cd68ebe5b3cb1dece" integrity sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ== chunky@^0.0.0: version "0.0.0" resolved "https://registry.npmjs.org/chunky/-/chunky-0.0.0.tgz" integrity sha1-HnWAojwIOJfSrWYkWefv2EZfYIo= ci-info@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz" integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== class-utils@^0.3.5: version "0.3.6" resolved "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz" integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== dependencies: arr-union "^3.1.0" define-property "^0.2.5" isobject "^3.0.0" static-extend "^0.1.1" clean-stack@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== cli-cursor@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz" integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= dependencies: restore-cursor "^2.0.0" cli-width@^2.0.0: version "2.2.1" resolved "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz" integrity sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw== cliui@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz" integrity sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA== dependencies: string-width "^3.1.0" strip-ansi "^5.2.0" wrap-ansi "^5.1.0" cliui@^7.0.2: version "7.0.4" resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== dependencies: string-width "^4.2.0" strip-ansi "^6.0.0" wrap-ansi "^7.0.0" clone-deep@^4.0.1: version "4.0.1" resolved "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz" integrity sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ== dependencies: is-plain-object "^2.0.4" kind-of "^6.0.2" shallow-clone "^3.0.0" clone@^1.0.2: version "1.0.4" resolved "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz" integrity sha1-2jCcwmPfFZlMaIypAheco8fNfH4= co@4.6.0: version "4.6.0" resolved "https://registry.npmjs.org/co/-/co-4.6.0.tgz" integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz" integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= collection-visit@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz" integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= dependencies: map-visit "^1.0.0" object-visit "^1.0.0" color-convert@^1.9.0: version "1.9.3" resolved "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz" integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== dependencies: color-name "1.1.3" color-convert@^2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz" integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== dependencies: color-name "~1.1.4" color-name@1.1.3: version "1.1.3" resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz" integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= color-name@~1.1.4: version "1.1.4" resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== columnify@^1.5.4: version "1.5.4" resolved "https://registry.npmjs.org/columnify/-/columnify-1.5.4.tgz" integrity sha1-Rzfd8ce2mop8NAVweC6UfuyOeLs= dependencies: strip-ansi "^3.0.0" wcwidth "^1.0.0" combined-stream@^1.0.6, combined-stream@~1.0.6: version "1.0.8" resolved "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz" integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== dependencies: delayed-stream "~1.0.0" compare-func@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz" integrity sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA== dependencies: array-ify "^1.0.0" dot-prop "^5.1.0" component-emitter@^1.2.1: version "1.3.0" resolved "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz" integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== concat-map@0.0.1: version "0.0.1" resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= concat-stream@^1.4.6, concat-stream@^1.5.0: version "1.6.2" resolved "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz" integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== dependencies: buffer-from "^1.0.0" inherits "^2.0.3" readable-stream "^2.2.2" typedarray "^0.0.6" concat-stream@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz" integrity sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A== dependencies: buffer-from "^1.0.0" inherits "^2.0.3" readable-stream "^3.0.2" typedarray "^0.0.6" concat-stream@~1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/concat-stream/-/concat-stream-1.0.1.tgz" integrity sha1-AYsYvBx9BzotyCqkhEI0GixN158= dependencies: bops "0.0.6" config-chain@^1.1.11: version "1.1.12" resolved "https://registry.npmjs.org/config-chain/-/config-chain-1.1.12.tgz" integrity sha512-a1eOIcu8+7lUInge4Rpf/n4Krkf3Dd9lqhljRzII1/Zno/kRtUWnznPO3jOKBmTEktkt3fkxisUcivoj0ebzoA== dependencies: ini "^1.3.4" proto-list "~1.2.1" console-control-strings@^1.0.0, console-control-strings@~1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz" integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= conventional-changelog-angular@^5.0.3: version "5.0.11" resolved "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.11.tgz" integrity sha512-nSLypht/1yEflhuTogC03i7DX7sOrXGsRn14g131Potqi6cbGbGEE9PSDEHKldabB6N76HiSyw9Ph+kLmC04Qw== dependencies: compare-func "^2.0.0" q "^1.5.1" conventional-changelog-core@^3.1.6: version "3.2.3" resolved "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-3.2.3.tgz" integrity sha512-LMMX1JlxPIq/Ez5aYAYS5CpuwbOk6QFp8O4HLAcZxe3vxoCtABkhfjetk8IYdRB9CDQGwJFLR3Dr55Za6XKgUQ== dependencies: conventional-changelog-writer "^4.0.6" conventional-commits-parser "^3.0.3" dateformat "^3.0.0" get-pkg-repo "^1.0.0" git-raw-commits "2.0.0" git-remote-origin-url "^2.0.0" git-semver-tags "^2.0.3" lodash "^4.2.1" normalize-package-data "^2.3.5" q "^1.5.1" read-pkg "^3.0.0" read-pkg-up "^3.0.0" through2 "^3.0.0" conventional-changelog-preset-loader@^2.1.1: version "2.3.4" resolved "https://registry.npmjs.org/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.3.4.tgz" integrity sha512-GEKRWkrSAZeTq5+YjUZOYxdHq+ci4dNwHvpaBC3+ENalzFWuCWa9EZXSuZBpkr72sMdKB+1fyDV4takK1Lf58g== conventional-changelog-writer@^4.0.6: version "4.0.17" resolved "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-4.0.17.tgz" integrity sha512-IKQuK3bib/n032KWaSb8YlBFds+aLmzENtnKtxJy3+HqDq5kohu3g/UdNbIHeJWygfnEbZjnCKFxAW0y7ArZAw== dependencies: compare-func "^2.0.0" conventional-commits-filter "^2.0.6" dateformat "^3.0.0" handlebars "^4.7.6" json-stringify-safe "^5.0.1" lodash "^4.17.15" meow "^7.0.0" semver "^6.0.0" split "^1.0.0" through2 "^3.0.0" conventional-commits-filter@^2.0.2, conventional-commits-filter@^2.0.6: version "2.0.6" resolved "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.6.tgz" integrity sha512-4g+sw8+KA50/Qwzfr0hL5k5NWxqtrOVw4DDk3/h6L85a9Gz0/Eqp3oP+CWCNfesBvZZZEFHF7OTEbRe+yYSyKw== dependencies: lodash.ismatch "^4.4.0" modify-values "^1.0.0" conventional-commits-parser@^3.0.3: version "3.1.0" resolved "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.1.0.tgz" integrity sha512-RSo5S0WIwXZiRxUGTPuYFbqvrR4vpJ1BDdTlthFgvHt5kEdnd1+pdvwWphWn57/oIl4V72NMmOocFqqJ8mFFhA== dependencies: JSONStream "^1.0.4" is-text-path "^1.0.1" lodash "^4.17.15" meow "^7.0.0" split2 "^2.0.0" through2 "^3.0.0" trim-off-newlines "^1.0.0" conventional-recommended-bump@^5.0.0: version "5.0.1" resolved "https://registry.npmjs.org/conventional-recommended-bump/-/conventional-recommended-bump-5.0.1.tgz" integrity sha512-RVdt0elRcCxL90IrNP0fYCpq1uGt2MALko0eyeQ+zQuDVWtMGAy9ng6yYn3kax42lCj9+XBxQ8ZN6S9bdKxDhQ== dependencies: concat-stream "^2.0.0" conventional-changelog-preset-loader "^2.1.1" conventional-commits-filter "^2.0.2" conventional-commits-parser "^3.0.3" git-raw-commits "2.0.0" git-semver-tags "^2.0.3" meow "^4.0.0" q "^1.5.1" cookie@^0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b" integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw== copy-concurrently@^1.0.0: version "1.0.5" resolved "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz" integrity sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A== dependencies: aproba "^1.1.1" fs-write-stream-atomic "^1.0.8" iferr "^0.1.5" mkdirp "^0.5.1" rimraf "^2.5.4" run-queue "^1.0.0" copy-descriptor@^0.1.0: version "0.1.1" resolved "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz" integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz" integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= cosmiconfig@^5.1.0: version "5.2.1" resolved "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz" integrity sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA== dependencies: import-fresh "^2.0.0" is-directory "^0.3.1" js-yaml "^3.13.1" parse-json "^4.0.0" coveralls@^3.0.4: version "3.1.1" resolved "https://registry.npmjs.org/coveralls/-/coveralls-3.1.1.tgz" integrity sha512-+dxnG2NHncSD1NrqbSM3dn/lE57O6Qf/koe9+I7c+wzkqRmEvcp0kgJdxKInzYzkICKkFMZsX3Vct3++tsF9ww== dependencies: js-yaml "^3.13.1" lcov-parse "^1.0.0" log-driver "^1.2.7" minimist "^1.2.5" request "^2.88.2" cross-spawn@^6.0.0: version "6.0.5" resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz" integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== dependencies: nice-try "^1.0.4" path-key "^2.0.1" semver "^5.5.0" shebang-command "^1.2.0" which "^1.2.9" cross-spawn@^7.0.0, cross-spawn@^7.0.2: version "7.0.3" resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== dependencies: path-key "^3.1.0" shebang-command "^2.0.0" which "^2.0.1" currently-unhandled@^0.4.1: version "0.4.1" resolved "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz" integrity sha1-mI3zP+qxke95mmE2nddsF635V+o= dependencies: array-find-index "^1.0.1" cyclist@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz" integrity sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk= dargs@^4.0.1: version "4.1.0" resolved "https://registry.npmjs.org/dargs/-/dargs-4.1.0.tgz" integrity sha1-A6nbtLXC8Tm/FK5T8LiipqhvThc= dependencies: number-is-nan "^1.0.0" dashdash@^1.12.0: version "1.14.1" resolved "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz" integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= dependencies: assert-plus "^1.0.0" data-uri-to-buffer@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-2.0.2.tgz#d296973d5a4897a5dbe31716d118211921f04770" integrity sha512-ND9qDTLc6diwj+Xe5cdAgVTbLVdXbtxTJRXRhli8Mowuaan+0EJOtdqJ0QCHNSSPyoXGx9HX2/VMnKeC34AChA== dateformat@^3.0.0: version "3.0.3" resolved "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz" integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q== debug@3.1.0: version "3.1.0" resolved "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz" integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== dependencies: ms "2.0.0" debug@4, debug@4.3.4, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== dependencies: ms "2.1.2" debug@^2.2.0, debug@^2.3.3: version "2.6.9" resolved "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz" integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== dependencies: ms "2.0.0" debug@^3.1.0: version "3.2.6" resolved "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz" integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== dependencies: ms "^2.1.1" debuglog@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz" integrity sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI= decamelize-keys@^1.0.0, decamelize-keys@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz" integrity sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk= dependencies: decamelize "^1.1.0" map-obj "^1.0.0" decamelize@^1.1.0, decamelize@^1.1.2, decamelize@^1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz" integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= decamelize@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== decode-uri-component@^0.2.0: version "0.2.0" resolved "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz" integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= dedent@^0.7.0: version "0.7.0" resolved "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz" integrity sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw= deep-eql@^3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz" integrity sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw== dependencies: type-detect "^4.0.0" deep-is@^0.1.3, deep-is@~0.1.3: version "0.1.3" resolved "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz" integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= defaults@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz" integrity sha1-xlYFHpgX2f8I7YgUd/P+QBnz730= dependencies: clone "^1.0.2" define-properties@^1.1.3: version "1.1.3" resolved "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz" integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== dependencies: object-keys "^1.0.12" define-property@^0.2.5: version "0.2.5" resolved "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz" integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= dependencies: is-descriptor "^0.1.0" define-property@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz" integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= dependencies: is-descriptor "^1.0.0" define-property@^2.0.2: version "2.0.2" resolved "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz" integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== dependencies: is-descriptor "^1.0.2" isobject "^3.0.1" delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz" integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= delegates@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz" integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= deprecation@^2.0.0, deprecation@^2.3.1: version "2.3.1" resolved "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz" integrity sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ== detect-indent@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz" integrity sha1-OHHMCmoALow+Wzz38zYmRnXwa50= dezalgo@^1.0.0: version "1.0.3" resolved "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.3.tgz" integrity sha1-f3Qt4Gb8dIvI24IFad3c5Jvw1FY= dependencies: asap "^2.0.0" wrappy "1" diff@5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== diff@^4.0.1: version "4.0.2" resolved "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz" integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== dir-glob@^2.2.2: version "2.2.2" resolved "https://registry.npmjs.org/dir-glob/-/dir-glob-2.2.2.tgz" integrity sha512-f9LBi5QWzIW3I6e//uxZoLBlUt9kcp66qo0sSCxL6YZKc75R1c4MFCoe/LaZiBGmgujvQdxc5Bn3QhfyvK5Hsw== dependencies: path-type "^3.0.0" dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz" integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== dependencies: path-type "^4.0.0" doctrine@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz" integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== dependencies: esutils "^2.0.2" dot-prop@^4.2.0: version "4.2.1" resolved "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.1.tgz" integrity sha512-l0p4+mIuJIua0mhxGoh4a+iNL9bmeK5DvnSVQa6T0OhrVmaEa1XScX5Etc673FePCJOArq/4Pa2cLGODUWTPOQ== dependencies: is-obj "^1.0.0" dot-prop@^5.1.0: version "5.3.0" resolved "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz" integrity sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q== dependencies: is-obj "^2.0.0" duplexer@^0.1.1: version "0.1.2" resolved "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz" integrity sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg== duplexify@^3.4.2, duplexify@^3.6.0: version "3.7.1" resolved "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz" integrity sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g== dependencies: end-of-stream "^1.0.0" inherits "^2.0.1" readable-stream "^2.0.0" stream-shift "^1.0.0" eastasianwidth@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== ecc-jsbn@~0.1.1: version "0.1.2" resolved "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz" integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= dependencies: jsbn "~0.1.0" safer-buffer "^2.1.0" emoji-regex@^7.0.1: version "7.0.3" resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz" integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== emoji-regex@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== emoji-regex@^9.2.2: version "9.2.2" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== encoding@^0.1.11, encoding@^0.1.13: version "0.1.13" resolved "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz" integrity sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A== dependencies: iconv-lite "^0.6.2" end-of-stream@^1.0.0, end-of-stream@^1.1.0: version "1.4.4" resolved "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz" integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== dependencies: once "^1.4.0" env-paths@^2.2.0: version "2.2.0" resolved "https://registry.npmjs.org/env-paths/-/env-paths-2.2.0.tgz" integrity sha512-6u0VYSCo/OW6IoD5WCLLy9JUGARbamfSavcNXry/eu8aHVFei6CD3Sw+VGX5alea1i9pgPHW0mbu6Xj0uBh7gA== envinfo@^7.3.1: version "7.7.3" resolved "https://registry.npmjs.org/envinfo/-/envinfo-7.7.3.tgz" integrity sha512-46+j5QxbPWza0PB1i15nZx0xQ4I/EfQxg9J8Had3b408SV63nEtor2e+oiY63amTo9KTuh2a3XLObNwduxYwwA== err-code@^1.0.0: version "1.1.2" resolved "https://registry.npmjs.org/err-code/-/err-code-1.1.2.tgz" integrity sha1-BuARbTAo9q70gGhJ6w6mp0iuaWA= err-code@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/err-code/-/err-code-2.0.3.tgz#23c2f3b756ffdfc608d30e27c9a941024807e7f9" integrity sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA== error-ex@^1.2.0, error-ex@^1.3.1: version "1.3.2" resolved "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz" integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== dependencies: is-arrayish "^0.2.1" es-abstract@^1.17.0-next.1, es-abstract@^1.17.5: version "1.17.7" resolved "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz" integrity sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g== dependencies: es-to-primitive "^1.2.1" function-bind "^1.1.1" has "^1.0.3" has-symbols "^1.0.1" is-callable "^1.2.2" is-regex "^1.1.1" object-inspect "^1.8.0" object-keys "^1.1.1" object.assign "^4.1.1" string.prototype.trimend "^1.0.1" string.prototype.trimstart "^1.0.1" es-abstract@^1.18.0-next.0: version "1.18.0-next.1" resolved "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz" integrity sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA== dependencies: es-to-primitive "^1.2.1" function-bind "^1.1.1" has "^1.0.3" has-symbols "^1.0.1" is-callable "^1.2.2" is-negative-zero "^2.0.0" is-regex "^1.1.1" object-inspect "^1.8.0" object-keys "^1.1.1" object.assign "^4.1.1" string.prototype.trimend "^1.0.1" string.prototype.trimstart "^1.0.1" es-to-primitive@^1.2.1: version "1.2.1" resolved "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz" integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== dependencies: is-callable "^1.1.4" is-date-object "^1.0.1" is-symbol "^1.0.2" es6-promise@^4.0.3: version "4.2.8" resolved "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz" integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w== es6-promisify@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz" integrity sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM= dependencies: es6-promise "^4.0.3" esbuild@0.17.19: version "0.17.19" resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.17.19.tgz#087a727e98299f0462a3d0bcdd9cd7ff100bd955" integrity sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw== optionalDependencies: "@esbuild/android-arm" "0.17.19" "@esbuild/android-arm64" "0.17.19" "@esbuild/android-x64" "0.17.19" "@esbuild/darwin-arm64" "0.17.19" "@esbuild/darwin-x64" "0.17.19" "@esbuild/freebsd-arm64" "0.17.19" "@esbuild/freebsd-x64" "0.17.19" "@esbuild/linux-arm" "0.17.19" "@esbuild/linux-arm64" "0.17.19" "@esbuild/linux-ia32" "0.17.19" "@esbuild/linux-loong64" "0.17.19" "@esbuild/linux-mips64el" "0.17.19" "@esbuild/linux-ppc64" "0.17.19" "@esbuild/linux-riscv64" "0.17.19" "@esbuild/linux-s390x" "0.17.19" "@esbuild/linux-x64" "0.17.19" "@esbuild/netbsd-x64" "0.17.19" "@esbuild/openbsd-x64" "0.17.19" "@esbuild/sunos-x64" "0.17.19" "@esbuild/win32-arm64" "0.17.19" "@esbuild/win32-ia32" "0.17.19" "@esbuild/win32-x64" "0.17.19" escalade@^3.1.1: version "3.1.2" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.2.tgz#54076e9ab29ea5bf3d8f1ed62acffbb88272df27" integrity sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA== escape-string-regexp@4.0.0, escape-string-regexp@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= escodegen@1.8.x: version "1.8.1" resolved "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz" integrity sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg= dependencies: esprima "^2.7.1" estraverse "^1.9.1" esutils "^2.0.2" optionator "^0.8.1" optionalDependencies: source-map "~0.2.0" eslint-config-prettier@^9.1.0: version "9.1.0" resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz#31af3d94578645966c082fcb71a5846d3c94867f" integrity sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw== eslint-plugin-es@^3.0.0: version "3.0.1" resolved "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-3.0.1.tgz" integrity sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ== dependencies: eslint-utils "^2.0.0" regexpp "^3.0.0" eslint-plugin-node@^11.1.0: version "11.1.0" resolved "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz" integrity sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g== dependencies: eslint-plugin-es "^3.0.0" eslint-utils "^2.0.0" ignore "^5.1.1" minimatch "^3.0.4" resolve "^1.10.1" semver "^6.1.0" eslint-plugin-prettier@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-5.1.2.tgz#584c94d4bf31329b2d4cbeb10fd600d17d6de742" integrity sha512-dhlpWc9vOwohcWmClFcA+HjlvUpuyynYs0Rf+L/P6/0iQE6vlHW9l5bkfzN62/Stm9fbq8ku46qzde76T1xlSg== dependencies: prettier-linter-helpers "^1.0.0" synckit "^0.8.6" eslint-plugin-promise@^6.0.1: version "6.2.0" resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-6.2.0.tgz#e24ab0e3c0a25fa227d98d9ff612156b5af15945" integrity sha512-QmAqwizauvnKOlifxyDj2ObfULpHQawlg/zQdgEixur9vl0CvZGv/LCJV2rtj3210QCoeGBzVMfMXqGAOr/4fA== eslint-scope@^7.2.2: version "7.2.2" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.2.tgz#deb4f92563390f32006894af62a22dba1c46423f" integrity sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg== dependencies: esrecurse "^4.3.0" estraverse "^5.2.0" eslint-utils@^2.0.0: version "2.1.0" resolved "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz" integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg== dependencies: eslint-visitor-keys "^1.1.0" eslint-visitor-keys@^1.1.0: version "1.3.0" resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz" integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.3: version "3.4.3" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== eslint@^8.56.0: version "8.57.0" resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.57.0.tgz#c786a6fd0e0b68941aaf624596fb987089195668" integrity sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.6.1" "@eslint/eslintrc" "^2.1.4" "@eslint/js" "8.57.0" "@humanwhocodes/config-array" "^0.11.14" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" "@ungap/structured-clone" "^1.2.0" ajv "^6.12.4" chalk "^4.0.0" cross-spawn "^7.0.2" debug "^4.3.2" doctrine "^3.0.0" escape-string-regexp "^4.0.0" eslint-scope "^7.2.2" eslint-visitor-keys "^3.4.3" espree "^9.6.1" esquery "^1.4.2" esutils "^2.0.2" fast-deep-equal "^3.1.3" file-entry-cache "^6.0.1" find-up "^5.0.0" glob-parent "^6.0.2" globals "^13.19.0" graphemer "^1.4.0" ignore "^5.2.0" imurmurhash "^0.1.4" is-glob "^4.0.0" is-path-inside "^3.0.3" js-yaml "^4.1.0" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.4.1" lodash.merge "^4.6.2" minimatch "^3.1.2" natural-compare "^1.4.0" optionator "^0.9.3" strip-ansi "^6.0.1" text-table "^0.2.0" espree@^9.6.0, espree@^9.6.1: version "9.6.1" resolved "https://registry.yarnpkg.com/espree/-/espree-9.6.1.tgz#a2a17b8e434690a5432f2f8018ce71d331a48c6f" integrity sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ== dependencies: acorn "^8.9.0" acorn-jsx "^5.3.2" eslint-visitor-keys "^3.4.1" esprima@2.7.x, esprima@^2.7.1: version "2.7.3" resolved "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz" integrity sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE= esprima@^4.0.0: version "4.0.1" resolved "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== esquery@^1.4.2: version "1.5.0" resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.5.0.tgz#6ce17738de8577694edd7361c57182ac8cb0db0b" integrity sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg== dependencies: estraverse "^5.1.0" esrecurse@^4.3.0: version "4.3.0" resolved "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz" integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== dependencies: estraverse "^5.2.0" estraverse@^1.9.1: version "1.9.3" resolved "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz" integrity sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q= estraverse@^5.1.0, estraverse@^5.2.0: version "5.2.0" resolved "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz" integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ== estree-walker@^0.6.1: version "0.6.1" resolved "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz" integrity sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w== esutils@^2.0.2: version "2.0.3" resolved "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== eventemitter3@^3.1.0: version "3.1.2" resolved "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.2.tgz" integrity sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q== execa@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz" integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA== dependencies: cross-spawn "^6.0.0" get-stream "^4.0.0" is-stream "^1.1.0" npm-run-path "^2.0.0" p-finally "^1.0.0" signal-exit "^3.0.0" strip-eof "^1.0.0" exit-hook@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-2.2.1.tgz#007b2d92c6428eda2b76e7016a34351586934593" integrity sha512-eNTPlAD67BmP31LDINZ3U7HSF8l57TxOY2PmBJ1shpCvpnxBF93mWCE8YHBnXs8qiUZJc9WDcWIeC3a2HIAMfw== expand-brackets@^2.1.4: version "2.1.4" resolved "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz" integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= dependencies: debug "^2.3.3" define-property "^0.2.5" extend-shallow "^2.0.1" posix-character-classes "^0.1.0" regex-not "^1.0.0" snapdragon "^0.8.1" to-regex "^3.0.1" expect.js@0.3.1: version "0.3.1" resolved "https://registry.npmjs.org/expect.js/-/expect.js-0.3.1.tgz" integrity sha1-sKWaDS7/VDdUTr8M6qYBWEHQm1s= exponential-backoff@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/exponential-backoff/-/exponential-backoff-3.1.1.tgz#64ac7526fe341ab18a39016cd22c787d01e00bf6" integrity sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw== extend-shallow@^2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz" integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= dependencies: is-extendable "^0.1.0" extend-shallow@^3.0.0, extend-shallow@^3.0.2: version "3.0.2" resolved "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz" integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= dependencies: assign-symbols "^1.0.0" is-extendable "^1.0.1" extend@~3.0.2: version "3.0.2" resolved "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz" integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== external-editor@^3.0.3: version "3.1.0" resolved "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz" integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== dependencies: chardet "^0.7.0" iconv-lite "^0.4.24" tmp "^0.0.33" extglob@^2.0.4: version "2.0.4" resolved "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz" integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== dependencies: array-unique "^0.3.2" define-property "^1.0.0" expand-brackets "^2.1.4" extend-shallow "^2.0.1" fragment-cache "^0.2.1" regex-not "^1.0.0" snapdragon "^0.8.1" to-regex "^3.0.1" extsprintf@1.3.0: version "1.3.0" resolved "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz" integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= extsprintf@^1.2.0: version "1.4.0" resolved "https://registry.npmjs.org/extsprintf/-/extsprintf-1.4.0.tgz" integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== fast-diff@^1.1.2: version "1.2.0" resolved "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz" integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== fast-glob@^2.2.6: version "2.2.7" resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.7.tgz" integrity sha512-g1KuQwHOZAmOZMuBtHdxDtju+T2RT8jgCC9aANsbpdiDDTSnjgfuVsIBNKbUeJI3oKMRExcfNDtJl4OhbffMsw== dependencies: "@mrmlnc/readdir-enhanced" "^2.2.1" "@nodelib/fs.stat" "^1.1.2" glob-parent "^3.1.0" is-glob "^4.0.0" merge2 "^1.2.3" micromatch "^3.1.10" fast-glob@^3.2.9: version "3.2.12" resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz" integrity sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w== dependencies: "@nodelib/fs.stat" "^2.0.2" "@nodelib/fs.walk" "^1.2.3" glob-parent "^5.1.2" merge2 "^1.3.0" micromatch "^4.0.4" fast-json-stable-stringify@^2.0.0: version "2.1.0" resolved "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6: version "2.0.6" resolved "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= fastq@^1.6.0: version "1.8.0" resolved "https://registry.npmjs.org/fastq/-/fastq-1.8.0.tgz" integrity sha512-SMIZoZdLh/fgofivvIkmknUXyPnvxRE3DhtZ5Me3Mrsk5gyPL42F0xr51TdRXskBxHfMp+07bcYzfsYEsSQA9Q== dependencies: reusify "^1.0.4" figgy-pudding@^3.4.1, figgy-pudding@^3.5.1: version "3.5.2" resolved "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz" integrity sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw== figures@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz" integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= dependencies: escape-string-regexp "^1.0.5" file-entry-cache@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== dependencies: flat-cache "^3.0.4" file-uri-to-path@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== fill-range@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz" integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= dependencies: extend-shallow "^2.0.1" is-number "^3.0.0" repeat-string "^1.6.1" to-regex-range "^2.1.0" fill-range@^7.0.1: version "7.0.1" resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz" integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== dependencies: to-regex-range "^5.0.1" find-up@5.0.0, find-up@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== dependencies: locate-path "^6.0.0" path-exists "^4.0.0" find-up@^1.0.0: version "1.1.2" resolved "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz" integrity sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8= dependencies: path-exists "^2.0.0" pinkie-promise "^2.0.0" find-up@^2.0.0: version "2.1.0" resolved "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz" integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= dependencies: locate-path "^2.0.0" find-up@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz" integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== dependencies: locate-path "^3.0.0" find-up@^4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz" integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== dependencies: locate-path "^5.0.0" path-exists "^4.0.0" flat-cache@^3.0.4: version "3.2.0" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.2.0.tgz#2c0c2d5040c99b1632771a9d105725c0115363ee" integrity sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw== dependencies: flatted "^3.2.9" keyv "^4.5.3" rimraf "^3.0.2" flat@^5.0.2: version "5.0.2" resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== flatted@^3.2.9: version "3.2.9" resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.9.tgz#7eb4c67ca1ba34232ca9d2d93e9886e611ad7daf" integrity sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ== flush-write-stream@^1.0.0: version "1.1.1" resolved "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz" integrity sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w== dependencies: inherits "^2.0.3" readable-stream "^2.3.6" for-in@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz" integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= foreground-child@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-3.1.1.tgz#1d173e776d75d2772fed08efe4a0de1ea1b12d0d" integrity sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg== dependencies: cross-spawn "^7.0.0" signal-exit "^4.0.1" forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz" integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= form-data@~2.3.2: version "2.3.3" resolved "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz" integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== dependencies: asynckit "^0.4.0" combined-stream "^1.0.6" mime-types "^2.1.12" fragment-cache@^0.2.1: version "0.2.1" resolved "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz" integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= dependencies: map-cache "^0.2.2" from2@^2.1.0: version "2.3.0" resolved "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz" integrity sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8= dependencies: inherits "^2.0.1" readable-stream "^2.0.0" fs-extra@^8.1.0: version "8.1.0" resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz" integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g== dependencies: graceful-fs "^4.2.0" jsonfile "^4.0.0" universalify "^0.1.0" fs-minipass@^1.2.7: version "1.2.7" resolved "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz" integrity sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA== dependencies: minipass "^2.6.0" fs-minipass@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb" integrity sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg== dependencies: minipass "^3.0.0" fs-minipass@^3.0.0: version "3.0.3" resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-3.0.3.tgz#79a85981c4dc120065e96f62086bf6f9dc26cc54" integrity sha512-XUBA9XClHbnJWSfBzjkm6RvPsyg3sryZt06BEQoXcF7EK/xpGaQYJgQKDJSUH5SGZ76Y7pFx1QBnXz09rU5Fbw== dependencies: minipass "^7.0.3" fs-write-stream-atomic@^1.0.8: version "1.0.10" resolved "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz" integrity sha1-tH31NJPvkR33VzHnCp3tAYnbQMk= dependencies: graceful-fs "^4.1.2" iferr "^0.1.5" imurmurhash "^0.1.4" readable-stream "1 || 2" fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= fsevents@~2.3.2: version "2.3.2" resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== function-bind@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== function-bind@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== gauge@~2.7.3: version "2.7.4" resolved "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz" integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c= dependencies: aproba "^1.0.3" console-control-strings "^1.0.0" has-unicode "^2.0.0" object-assign "^4.1.0" signal-exit "^3.0.0" string-width "^1.0.1" strip-ansi "^3.0.1" wide-align "^1.1.0" generic-pool@^2.1.1: version "2.5.4" resolved "https://registry.yarnpkg.com/generic-pool/-/generic-pool-2.5.4.tgz#38c6188513e14030948ec6e5cf65523d9779299b" integrity sha512-K2jozechYi0U3CNYlCWFGccmgjYhyqxOQVehL03l+gJ75LWDocM2qJeAaIneFd30ncD965WXnyM04jDgXzTMPw== genfun@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/genfun/-/genfun-5.0.0.tgz" integrity sha512-KGDOARWVga7+rnB3z9Sd2Letx515owfk0hSxHGuqjANb1M+x2bGZGqHLiozPsYMdM2OubeMni/Hpwmjq6qIUhA== get-caller-file@^2.0.1, get-caller-file@^2.0.5: version "2.0.5" resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== get-func-name@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz" integrity sha1-6td0q+5y4gQJQzoGY2YCPdaIekE= get-pkg-repo@^1.0.0: version "1.4.0" resolved "https://registry.npmjs.org/get-pkg-repo/-/get-pkg-repo-1.4.0.tgz" integrity sha1-xztInAbYDMVTbCyFP54FIyBWly0= dependencies: hosted-git-info "^2.1.4" meow "^3.3.0" normalize-package-data "^2.3.0" parse-github-repo-url "^1.3.0" through2 "^2.0.0" get-port@^4.2.0: version "4.2.0" resolved "https://registry.npmjs.org/get-port/-/get-port-4.2.0.tgz" integrity sha512-/b3jarXkH8KJoOMQc3uVGHASwGLPq3gSFJ7tgJm2diza+bydJPTGOibin2steecKeOylE8oY2JERlVWkAJO6yw== get-source@^2.0.12: version "2.0.12" resolved "https://registry.yarnpkg.com/get-source/-/get-source-2.0.12.tgz#0b47d57ea1e53ce0d3a69f4f3d277eb8047da944" integrity sha512-X5+4+iD+HoSeEED+uwrQ07BOQr0kEDFMVqqpBuI+RaZBpBpHCuXxo70bjar6f0b0u/DQJsJ7ssurpP0V60Az+w== dependencies: data-uri-to-buffer "^2.0.0" source-map "^0.6.1" get-stdin@^4.0.1: version "4.0.1" resolved "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz" integrity sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4= get-stream@^4.0.0, get-stream@^4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz" integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== dependencies: pump "^3.0.0" get-value@^2.0.3, get-value@^2.0.6: version "2.0.6" resolved "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz" integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= getpass@^0.1.1: version "0.1.7" resolved "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz" integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= dependencies: assert-plus "^1.0.0" git-raw-commits@2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.0.tgz" integrity sha512-w4jFEJFgKXMQJ0H0ikBk2S+4KP2VEjhCvLCNqbNRQC8BgGWgLKNCO7a9K9LI+TVT7Gfoloje502sEnctibffgg== dependencies: dargs "^4.0.1" lodash.template "^4.0.2" meow "^4.0.0" split2 "^2.0.0" through2 "^2.0.0" git-remote-origin-url@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/git-remote-origin-url/-/git-remote-origin-url-2.0.0.tgz" integrity sha1-UoJlna4hBxRaERJhEq0yFuxfpl8= dependencies: gitconfiglocal "^1.0.0" pify "^2.3.0" git-semver-tags@^2.0.3: version "2.0.3" resolved "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-2.0.3.tgz" integrity sha512-tj4FD4ww2RX2ae//jSrXZzrocla9db5h0V7ikPl1P/WwoZar9epdUhwR7XHXSgc+ZkNq72BEEerqQuicoEQfzA== dependencies: meow "^4.0.0" semver "^6.0.0" git-up@^4.0.0: version "4.0.2" resolved "https://registry.npmjs.org/git-up/-/git-up-4.0.2.tgz" integrity sha512-kbuvus1dWQB2sSW4cbfTeGpCMd8ge9jx9RKnhXhuJ7tnvT+NIrTVfYZxjtflZddQYcmdOTlkAcjmx7bor+15AQ== dependencies: is-ssh "^1.3.0" parse-url "^5.0.0" git-url-parse@^11.1.2: version "11.3.0" resolved "https://registry.npmjs.org/git-url-parse/-/git-url-parse-11.3.0.tgz" integrity sha512-i3XNa8IKmqnUqWBcdWBjOcnyZYfN3C1WRvnKI6ouFWwsXCZEnlgbwbm55ZpJ3OJMhfEP/ryFhqW8bBhej3C5Ug== dependencies: git-up "^4.0.0" gitconfiglocal@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz" integrity sha1-QdBF84UaXqiPA/JMocYXgRRGS5s= dependencies: ini "^1.3.2" glob-parent@^3.1.0: version "3.1.0" resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz" integrity sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4= dependencies: is-glob "^3.1.0" path-dirname "^1.0.0" glob-parent@^5.0.0, glob-parent@^5.1.2, glob-parent@~5.1.2: version "5.1.2" resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== dependencies: is-glob "^4.0.1" glob-parent@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== dependencies: is-glob "^4.0.3" glob-to-regexp@^0.3.0: version "0.3.0" resolved "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz" integrity sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs= glob-to-regexp@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== glob@8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/glob/-/glob-8.1.0.tgz#d388f656593ef708ee3e34640fdfb99a9fd1c33e" integrity sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" inherits "2" minimatch "^5.0.1" once "^1.3.0" glob@^10.2.2, glob@^10.3.10: version "10.4.1" resolved "https://registry.yarnpkg.com/glob/-/glob-10.4.1.tgz#0cfb01ab6a6b438177bfe6a58e2576f6efe909c2" integrity sha512-2jelhlq3E4ho74ZyVLN03oKdAZVUa6UDZzFLVH1H7dnoax+y9qyaq8zBkfDIggjniU19z0wU18y16jMB2eyVIw== dependencies: foreground-child "^3.1.0" jackspeak "^3.1.2" minimatch "^9.0.4" minipass "^7.1.2" path-scurry "^1.11.1" glob@^5.0.15: version "5.0.15" resolved "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz" integrity sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E= dependencies: inflight "^1.0.4" inherits "2" minimatch "2 || 3" once "^1.3.0" path-is-absolute "^1.0.0" glob@^7.1.1, glob@^7.1.3, glob@^7.1.4: version "7.1.6" resolved "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz" integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" inherits "2" minimatch "^3.0.4" once "^1.3.0" path-is-absolute "^1.0.0" globals@^13.19.0: version "13.24.0" resolved "https://registry.yarnpkg.com/globals/-/globals-13.24.0.tgz#8432a19d78ce0c1e833949c36adb345400bb1171" integrity sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ== dependencies: type-fest "^0.20.2" globby@^11.1.0: version "11.1.0" resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== dependencies: array-union "^2.1.0" dir-glob "^3.0.1" fast-glob "^3.2.9" ignore "^5.2.0" merge2 "^1.4.1" slash "^3.0.0" globby@^9.2.0: version "9.2.0" resolved "https://registry.npmjs.org/globby/-/globby-9.2.0.tgz" integrity sha512-ollPHROa5mcxDEkwg6bPt3QbEf4pDQSNtd6JPL1YvOvAo/7/0VAm9TccUeoTmarjPw4pfUthSCqcyfNB1I3ZSg== dependencies: "@types/glob" "^7.1.1" array-union "^1.0.2" dir-glob "^2.2.2" fast-glob "^2.2.6" glob "^7.1.3" ignore "^4.0.3" pify "^4.0.1" slash "^2.0.0" graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.6: version "4.2.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== graphemer@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== handlebars@^4.0.1, handlebars@^4.7.6: version "4.7.7" resolved "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz" integrity sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA== dependencies: minimist "^1.2.5" neo-async "^2.6.0" source-map "^0.6.1" wordwrap "^1.0.0" optionalDependencies: uglify-js "^3.1.4" har-schema@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz" integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= har-validator@~5.1.3: version "5.1.5" resolved "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz" integrity sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w== dependencies: ajv "^6.12.3" har-schema "^2.0.0" hard-rejection@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz" integrity sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA== has-flag@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz" integrity sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo= has-flag@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz" integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= has-flag@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== has-symbols@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz" integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg== has-unicode@^2.0.0, has-unicode@^2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz" integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk= has-value@^0.3.1: version "0.3.1" resolved "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz" integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= dependencies: get-value "^2.0.3" has-values "^0.1.4" isobject "^2.0.0" has-value@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz" integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= dependencies: get-value "^2.0.6" has-values "^1.0.0" isobject "^3.0.0" has-values@^0.1.4: version "0.1.4" resolved "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz" integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= has-values@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz" integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= dependencies: is-number "^3.0.0" kind-of "^4.0.0" has@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/has/-/has-1.0.3.tgz" integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== dependencies: function-bind "^1.1.1" hasown@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== dependencies: function-bind "^1.1.2" he@1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/he/-/he-1.2.0.tgz" integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== hosted-git-info@^2.1.4, hosted-git-info@^2.7.1: version "2.8.8" resolved "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz" integrity sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg== http-cache-semantics@^3.8.1: version "3.8.1" resolved "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz" integrity sha512-5ai2iksyV8ZXmnZhHH4rWPoxxistEexSi5936zIQ1bnNTW5VnA85B6P/VpXiRM017IgRvb2kKo1a//y+0wSp3w== http-cache-semantics@^4.1.1: version "4.1.1" resolved "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz" integrity sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ== http-proxy-agent@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz" integrity sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg== dependencies: agent-base "4" debug "3.1.0" http-proxy-agent@^7.0.0: version "7.0.2" resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz#9a8b1f246866c028509486585f62b8f2c18c270e" integrity sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig== dependencies: agent-base "^7.1.0" debug "^4.3.4" http-signature@~1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz" integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= dependencies: assert-plus "^1.0.0" jsprim "^1.2.2" sshpk "^1.7.0" https-proxy-agent@^2.2.3: version "2.2.4" resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz" integrity sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg== dependencies: agent-base "^4.3.0" debug "^3.1.0" https-proxy-agent@^7.0.1: version "7.0.4" resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz#8e97b841a029ad8ddc8731f26595bad868cb4168" integrity sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg== dependencies: agent-base "^7.0.2" debug "4" humanize-ms@^1.2.1: version "1.2.1" resolved "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz" integrity sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0= dependencies: ms "^2.0.0" iconv-lite@^0.4.24: version "0.4.24" resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz" integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== dependencies: safer-buffer ">= 2.1.2 < 3" iconv-lite@^0.6.2: version "0.6.2" resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.2.tgz" integrity sha512-2y91h5OpQlolefMPmUlivelittSWy0rP+oYVpn6A7GwVHNE8AWzoYOBNmlwks3LobaJxgHCYZAnyNo2GgpNRNQ== dependencies: safer-buffer ">= 2.1.2 < 3.0.0" iferr@^0.1.5: version "0.1.5" resolved "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz" integrity sha1-xg7taebY/bazEEofy8ocGS3FtQE= ignore-walk@^3.0.1: version "3.0.3" resolved "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.3.tgz" integrity sha512-m7o6xuOaT1aqheYHKf8W6J5pYH85ZI9w077erOzLje3JsB1gkafkAhHHY19dqjulgIZHFm32Cp5uNZgcQqdJKw== dependencies: minimatch "^3.0.4" ignore@^4.0.3: version "4.0.6" resolved "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== ignore@^5.1.1, ignore@^5.2.0, ignore@^5.2.4: version "5.3.0" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.0.tgz#67418ae40d34d6999c95ff56016759c718c82f78" integrity sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg== import-fresh@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz" integrity sha1-2BNVwVYS04bGH53dOSLUMEgipUY= dependencies: caller-path "^2.0.0" resolve-from "^3.0.0" import-fresh@^3.2.1: version "3.2.1" resolved "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz" integrity sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ== dependencies: parent-module "^1.0.0" resolve-from "^4.0.0" import-local@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz" integrity sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ== dependencies: pkg-dir "^3.0.0" resolve-cwd "^2.0.0" imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz" integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= indent-string@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz" integrity sha1-ji1INIdCEhtKghi3oTfppSBJ3IA= dependencies: repeating "^2.0.0" indent-string@^3.0.0: version "3.2.0" resolved "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz" integrity sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok= indent-string@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz" integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== infer-owner@^1.0.3, infer-owner@^1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz" integrity sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A== inflight@^1.0.4: version "1.0.6" resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz" integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= dependencies: once "^1.3.0" wrappy "1" inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3: version "2.0.4" resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== ini@^1.3.2, ini@^1.3.4: version "1.3.8" resolved "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz" integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== init-package-json@^1.10.3: version "1.10.3" resolved "https://registry.npmjs.org/init-package-json/-/init-package-json-1.10.3.tgz" integrity sha512-zKSiXKhQveNteyhcj1CoOP8tqp1QuxPIPBl8Bid99DGLFqA1p87M6lNgfjJHSBoWJJlidGOv5rWjyYKEB3g2Jw== dependencies: glob "^7.1.1" npm-package-arg "^4.0.0 || ^5.0.0 || ^6.0.0" promzard "^0.3.0" read "~1.0.1" read-package-json "1 || 2" semver "2.x || 3.x || 4 || 5" validate-npm-package-license "^3.0.1" validate-npm-package-name "^3.0.0" inquirer@^6.2.0: version "6.5.2" resolved "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz" integrity sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ== dependencies: ansi-escapes "^3.2.0" chalk "^2.4.2" cli-cursor "^2.1.0" cli-width "^2.0.0" external-editor "^3.0.3" figures "^2.0.0" lodash "^4.17.12" mute-stream "0.0.7" run-async "^2.2.0" rxjs "^6.4.0" string-width "^2.1.0" strip-ansi "^5.1.0" through "^2.3.6" ip-address@^9.0.5: version "9.0.5" resolved "https://registry.yarnpkg.com/ip-address/-/ip-address-9.0.5.tgz#117a960819b08780c3bd1f14ef3c1cc1d3f3ea5a" integrity sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g== dependencies: jsbn "1.1.0" sprintf-js "^1.1.3" ip@1.1.5: version "1.1.5" resolved "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz" integrity sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo= is-accessor-descriptor@^0.1.6: version "0.1.6" resolved "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz" integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= dependencies: kind-of "^3.0.2" is-accessor-descriptor@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz" integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== dependencies: kind-of "^6.0.0" is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz" integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= is-binary-path@~2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz" integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== dependencies: binary-extensions "^2.0.0" is-buffer@^1.1.5: version "1.1.6" resolved "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== is-callable@^1.1.4, is-callable@^1.2.2: version "1.2.2" resolved "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz" integrity sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA== is-ci@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz" integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w== dependencies: ci-info "^2.0.0" is-core-module@^2.13.0: version "2.13.1" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.13.1.tgz#ad0d7532c6fea9da1ebdc82742d74525c6273384" integrity sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw== dependencies: hasown "^2.0.0" is-data-descriptor@^0.1.4: version "0.1.4" resolved "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz" integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= dependencies: kind-of "^3.0.2" is-data-descriptor@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz" integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== dependencies: kind-of "^6.0.0" is-date-object@^1.0.1: version "1.0.2" resolved "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz" integrity sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g== is-descriptor@^0.1.0: version "0.1.6" resolved "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz" integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== dependencies: is-accessor-descriptor "^0.1.6" is-data-descriptor "^0.1.4" kind-of "^5.0.0" is-descriptor@^1.0.0, is-descriptor@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz" integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== dependencies: is-accessor-descriptor "^1.0.0" is-data-descriptor "^1.0.0" kind-of "^6.0.2" is-directory@^0.3.1: version "0.3.1" resolved "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz" integrity sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE= is-extendable@^0.1.0, is-extendable@^0.1.1: version "0.1.1" resolved "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz" integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= is-extendable@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz" integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== dependencies: is-plain-object "^2.0.4" is-extglob@^2.1.0, is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz" integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= is-finite@^1.0.0: version "1.1.0" resolved "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz" integrity sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w== is-fullwidth-code-point@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz" integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= dependencies: number-is-nan "^1.0.0" is-fullwidth-code-point@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz" integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= is-fullwidth-code-point@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== is-glob@^3.1.0: version "3.1.0" resolved "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz" integrity sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= dependencies: is-extglob "^2.1.0" is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: version "4.0.3" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== dependencies: is-extglob "^2.1.1" is-lambda@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-lambda/-/is-lambda-1.0.1.tgz#3d9877899e6a53efc0160504cde15f82e6f061d5" integrity sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ== is-negative-zero@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.0.tgz" integrity sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE= is-number@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz" integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= dependencies: kind-of "^3.0.2" is-number@^7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== is-obj@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz" integrity sha1-PkcprB9f3gJc19g6iW2rn09n2w8= is-obj@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz" integrity sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w== is-path-inside@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== is-plain-obj@^1.0.0, is-plain-obj@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz" integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= is-plain-obj@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== is-plain-object@^2.0.3, is-plain-object@^2.0.4: version "2.0.4" resolved "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz" integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== dependencies: isobject "^3.0.1" is-plain-object@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz" integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== is-regex@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz" integrity sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg== dependencies: has-symbols "^1.0.1" is-ssh@^1.3.0: version "1.3.2" resolved "https://registry.npmjs.org/is-ssh/-/is-ssh-1.3.2.tgz" integrity sha512-elEw0/0c2UscLrNG+OAorbP539E3rhliKPg+hDMWN9VwrDXfYK+4PBEykDPfxlYYtQvl84TascnQyobfQLHEhQ== dependencies: protocols "^1.1.0" is-stream@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz" integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= is-symbol@^1.0.2: version "1.0.3" resolved "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz" integrity sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ== dependencies: has-symbols "^1.0.1" is-text-path@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/is-text-path/-/is-text-path-1.0.1.tgz" integrity sha1-Thqg+1G/vLPpJogAE5cgLBd1tm4= dependencies: text-extensions "^1.0.0" is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz" integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= is-unicode-supported@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== is-utf8@^0.2.0: version "0.2.1" resolved "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz" integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI= is-windows@^1.0.0, is-windows@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz" integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== isarray@1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= isexe@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz" integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= isexe@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/isexe/-/isexe-3.1.1.tgz#4a407e2bd78ddfb14bea0c27c6f7072dde775f0d" integrity sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ== isobject@^2.0.0: version "2.1.0" resolved "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz" integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= dependencies: isarray "1.0.0" isobject@^3.0.0, isobject@^3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz" integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= isstream@~0.1.2: version "0.1.2" resolved "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz" integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= istanbul@^0.4.5: version "0.4.5" resolved "https://registry.npmjs.org/istanbul/-/istanbul-0.4.5.tgz" integrity sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs= dependencies: abbrev "1.0.x" async "1.x" escodegen "1.8.x" esprima "2.7.x" glob "^5.0.15" handlebars "^4.0.1" js-yaml "3.x" mkdirp "0.5.x" nopt "3.x" once "1.x" resolve "1.1.x" supports-color "^3.1.0" which "^1.1.1" wordwrap "^1.0.0" jackspeak@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-3.1.2.tgz#eada67ea949c6b71de50f1b09c92a961897b90ab" integrity sha512-kWmLKn2tRtfYMF/BakihVVRzBKOxz4gJMiL2Rj91WnAB5TPZumSH99R/Yf1qE1u4uRimvCSJfm6hnxohXeEXjQ== dependencies: "@isaacs/cliui" "^8.0.2" optionalDependencies: "@pkgjs/parseargs" "^0.11.0" js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== js-yaml@3.x, js-yaml@^3.13.1: version "3.14.0" resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz" integrity sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A== dependencies: argparse "^1.0.7" esprima "^4.0.0" js-yaml@4.1.0, js-yaml@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== dependencies: argparse "^2.0.1" jsbn@1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-1.1.0.tgz#b01307cb29b618a1ed26ec79e911f803c4da0040" integrity sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A== jsbn@~0.1.0: version "0.1.1" resolved "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz" integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= json-buffer@3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== json-parse-better-errors@^1.0.0, json-parse-better-errors@^1.0.1: version "1.0.2" resolved "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz" integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== json-parse-even-better-errors@^2.3.0: version "2.3.1" resolved "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz" integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz" integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== json-schema@0.2.3: version "0.2.3" resolved "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz" integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz" integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz" integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= jsonfile@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz" integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= optionalDependencies: graceful-fs "^4.1.6" jsonparse@^1.2.0: version "1.3.1" resolved "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz" integrity sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA= jsprim@^1.2.2: version "1.4.1" resolved "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz" integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= dependencies: assert-plus "1.0.0" extsprintf "1.3.0" json-schema "0.2.3" verror "1.10.0" keyv@^4.5.3: version "4.5.4" resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93" integrity sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw== dependencies: json-buffer "3.0.1" kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: version "3.2.2" resolved "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz" integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= dependencies: is-buffer "^1.1.5" kind-of@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz" integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= dependencies: is-buffer "^1.1.5" kind-of@^5.0.0: version "5.1.0" resolved "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz" integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== kind-of@^6.0.0, kind-of@^6.0.2, kind-of@^6.0.3: version "6.0.3" resolved "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== lcov-parse@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/lcov-parse/-/lcov-parse-1.0.0.tgz" integrity sha1-6w1GtUER68VhrLTECO+TY73I9+A= lerna@^3.19.0: version "3.22.1" resolved "https://registry.npmjs.org/lerna/-/lerna-3.22.1.tgz" integrity sha512-vk1lfVRFm+UuEFA7wkLKeSF7Iz13W+N/vFd48aW2yuS7Kv0RbNm2/qcDPV863056LMfkRlsEe+QYOw3palj5Lg== dependencies: "@lerna/add" "3.21.0" "@lerna/bootstrap" "3.21.0" "@lerna/changed" "3.21.0" "@lerna/clean" "3.21.0" "@lerna/cli" "3.18.5" "@lerna/create" "3.22.0" "@lerna/diff" "3.21.0" "@lerna/exec" "3.21.0" "@lerna/import" "3.22.0" "@lerna/info" "3.21.0" "@lerna/init" "3.21.0" "@lerna/link" "3.21.0" "@lerna/list" "3.21.0" "@lerna/publish" "3.22.1" "@lerna/run" "3.21.0" "@lerna/version" "3.22.1" import-local "^2.0.0" npmlog "^4.1.2" levn@^0.4.1: version "0.4.1" resolved "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz" integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== dependencies: prelude-ls "^1.2.1" type-check "~0.4.0" levn@~0.3.0: version "0.3.0" resolved "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz" integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= dependencies: prelude-ls "~1.1.2" type-check "~0.3.2" libpq@1.8.14: version "1.8.14" resolved "https://registry.yarnpkg.com/libpq/-/libpq-1.8.14.tgz#1cc404b887c2bf1a6c9ffdb7245aca4a7b44f2ff" integrity sha512-/DDvQCiXP0KBMZ31U2mmURKaxoKt9kNqqgrSO2RuBKS+OJjw5b7uHi5jFoV8zPAUa2TNtq2XfcWL1OWDEyjwlg== dependencies: bindings "1.5.0" nan "2.22.0" lines-and-columns@^1.1.6: version "1.1.6" resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz" integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= load-json-file@^1.0.0: version "1.1.0" resolved "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz" integrity sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA= dependencies: graceful-fs "^4.1.2" parse-json "^2.2.0" pify "^2.0.0" pinkie-promise "^2.0.0" strip-bom "^2.0.0" load-json-file@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz" integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs= dependencies: graceful-fs "^4.1.2" parse-json "^4.0.0" pify "^3.0.0" strip-bom "^3.0.0" load-json-file@^5.3.0: version "5.3.0" resolved "https://registry.npmjs.org/load-json-file/-/load-json-file-5.3.0.tgz" integrity sha512-cJGP40Jc/VXUsp8/OrnyKyTZ1y6v/dphm3bioS+RrKXjK2BB6wHUd6JptZEFDGgGahMT+InnZO5i1Ei9mpC8Bw== dependencies: graceful-fs "^4.1.15" parse-json "^4.0.0" pify "^4.0.1" strip-bom "^3.0.0" type-fest "^0.3.0" locate-path@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz" integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= dependencies: p-locate "^2.0.0" path-exists "^3.0.0" locate-path@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz" integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== dependencies: p-locate "^3.0.0" path-exists "^3.0.0" locate-path@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz" integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== dependencies: p-locate "^4.1.0" locate-path@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== dependencies: p-locate "^5.0.0" lodash._reinterpolate@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz" integrity sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0= lodash.clonedeep@^4.5.0: version "4.5.0" resolved "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz" integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8= lodash.get@^4.4.2: version "4.4.2" resolved "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz" integrity sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk= lodash.ismatch@^4.4.0: version "4.4.0" resolved "https://registry.npmjs.org/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz" integrity sha1-dWy1FQyjum8RCFp4hJZF8Yj4Xzc= lodash.merge@^4.6.2: version "4.6.2" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== lodash.set@^4.3.2: version "4.3.2" resolved "https://registry.npmjs.org/lodash.set/-/lodash.set-4.3.2.tgz" integrity sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM= lodash.sortby@^4.7.0: version "4.7.0" resolved "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz" integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= lodash.template@^4.0.2, lodash.template@^4.5.0: version "4.5.0" resolved "https://registry.npmjs.org/lodash.template/-/lodash.template-4.5.0.tgz" integrity sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A== dependencies: lodash._reinterpolate "^3.0.0" lodash.templatesettings "^4.0.0" lodash.templatesettings@^4.0.0: version "4.2.0" resolved "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz" integrity sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ== dependencies: lodash._reinterpolate "^3.0.0" lodash.uniq@^4.5.0: version "4.5.0" resolved "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.21, lodash@^4.2.1: version "4.17.21" resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== log-driver@^1.2.7: version "1.2.7" resolved "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz" integrity sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg== log-symbols@4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== dependencies: chalk "^4.1.0" is-unicode-supported "^0.1.0" loud-rejection@^1.0.0: version "1.6.0" resolved "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz" integrity sha1-W0b4AUft7leIcPCG0Eghz5mOVR8= dependencies: currently-unhandled "^0.4.1" signal-exit "^3.0.0" loupe@^2.3.1: version "2.3.4" resolved "https://registry.npmjs.org/loupe/-/loupe-2.3.4.tgz" integrity sha512-OvKfgCC2Ndby6aSTREl5aCCPTNIzlDfQZvZxNUrBrihDhL3xcrYegTblhmEiCrg2kKQz4XsFIaemE5BF4ybSaQ== dependencies: get-func-name "^2.0.0" lru-cache@^10.0.1, lru-cache@^10.2.0: version "10.2.2" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.2.2.tgz#48206bc114c1252940c41b25b41af5b545aca878" integrity sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ== lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz" integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== dependencies: yallist "^3.0.2" macgyver@~1.10: version "1.10.1" resolved "https://registry.npmjs.org/macgyver/-/macgyver-1.10.1.tgz" integrity sha1-sJ0VmdizbtWxb1lYlRXZ0UvC/Yg= macos-release@^2.2.0: version "2.4.1" resolved "https://registry.npmjs.org/macos-release/-/macos-release-2.4.1.tgz" integrity sha512-H/QHeBIN1fIGJX517pvK8IEK53yQOW7YcEI55oYtgjDdoCQQz7eJS94qt5kNrscReEyuD/JcdFCm2XBEcGOITg== magic-string@^0.25.3: version "0.25.9" resolved "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz" integrity sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ== dependencies: sourcemap-codec "^1.4.8" make-dir@^1.0.0: version "1.3.0" resolved "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz" integrity sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ== dependencies: pify "^3.0.0" make-dir@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz" integrity sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA== dependencies: pify "^4.0.1" semver "^5.6.0" make-error@^1.1.1: version "1.3.6" resolved "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== make-fetch-happen@^13.0.0: version "13.0.1" resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-13.0.1.tgz#273ba2f78f45e1f3a6dca91cede87d9fa4821e36" integrity sha512-cKTUFc/rbKUd/9meOvgrpJ2WrNzymt6jfRDdwg5UCnVzv9dTpEj9JS5m3wtziXVCjluIXyL8pcaukYqezIzZQA== dependencies: "@npmcli/agent" "^2.0.0" cacache "^18.0.0" http-cache-semantics "^4.1.1" is-lambda "^1.0.1" minipass "^7.0.2" minipass-fetch "^3.0.0" minipass-flush "^1.0.5" minipass-pipeline "^1.2.4" negotiator "^0.6.3" proc-log "^4.2.0" promise-retry "^2.0.1" ssri "^10.0.0" make-fetch-happen@^5.0.0: version "5.0.2" resolved "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-5.0.2.tgz" integrity sha512-07JHC0r1ykIoruKO8ifMXu+xEU8qOXDFETylktdug6vJDACnP+HKevOu3PXyNPzFyTSlz8vrBYlBO1JZRe8Cag== dependencies: agentkeepalive "^3.4.1" cacache "^12.0.0" http-cache-semantics "^3.8.1" http-proxy-agent "^2.1.0" https-proxy-agent "^2.2.3" lru-cache "^5.1.1" mississippi "^3.0.0" node-fetch-npm "^2.0.2" promise-retry "^1.1.1" socks-proxy-agent "^4.0.0" ssri "^6.0.0" map-cache@^0.2.2: version "0.2.2" resolved "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz" integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= map-obj@^1.0.0, map-obj@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz" integrity sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0= map-obj@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz" integrity sha1-plzSkIepJZi4eRJXpSPgISIqwfk= map-obj@^4.0.0: version "4.1.0" resolved "https://registry.npmjs.org/map-obj/-/map-obj-4.1.0.tgz" integrity sha512-glc9y00wgtwcDmp7GaE/0b0OnxpNJsVf3ael/An6Fe2Q51LLwN1er6sdomLRzz5h0+yMpiYLhWYF5R7HeqVd4g== map-visit@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz" integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= dependencies: object-visit "^1.0.0" meow@^3.3.0: version "3.7.0" resolved "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz" integrity sha1-cstmi0JSKCkKu/qFaJJYcwioAfs= dependencies: camelcase-keys "^2.0.0" decamelize "^1.1.2" loud-rejection "^1.0.0" map-obj "^1.0.1" minimist "^1.1.3" normalize-package-data "^2.3.4" object-assign "^4.0.1" read-pkg-up "^1.0.1" redent "^1.0.0" trim-newlines "^1.0.0" meow@^4.0.0: version "4.0.1" resolved "https://registry.npmjs.org/meow/-/meow-4.0.1.tgz" integrity sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A== dependencies: camelcase-keys "^4.0.0" decamelize-keys "^1.0.0" loud-rejection "^1.0.0" minimist "^1.1.3" minimist-options "^3.0.1" normalize-package-data "^2.3.4" read-pkg-up "^3.0.0" redent "^2.0.0" trim-newlines "^2.0.0" meow@^7.0.0: version "7.1.1" resolved "https://registry.npmjs.org/meow/-/meow-7.1.1.tgz" integrity sha512-GWHvA5QOcS412WCo8vwKDlTelGLsCGBVevQB5Kva961rmNfun0PCbv5+xta2kUMFJyR8/oWnn7ddeKdosbAPbA== dependencies: "@types/minimist" "^1.2.0" camelcase-keys "^6.2.2" decamelize-keys "^1.1.0" hard-rejection "^2.1.0" minimist-options "4.1.0" normalize-package-data "^2.5.0" read-pkg-up "^7.0.1" redent "^3.0.0" trim-newlines "^3.0.0" type-fest "^0.13.1" yargs-parser "^18.1.3" merge2@^1.2.3, merge2@^1.3.0, merge2@^1.4.1: version "1.4.1" resolved "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== micromatch@^3.1.10: version "3.1.10" resolved "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz" integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== dependencies: arr-diff "^4.0.0" array-unique "^0.3.2" braces "^2.3.1" define-property "^2.0.2" extend-shallow "^3.0.2" extglob "^2.0.4" fragment-cache "^0.2.1" kind-of "^6.0.2" nanomatch "^1.2.9" object.pick "^1.3.0" regex-not "^1.0.0" snapdragon "^0.8.1" to-regex "^3.0.2" micromatch@^4.0.4: version "4.0.5" resolved "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz" integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== dependencies: braces "^3.0.2" picomatch "^2.3.1" mime-db@1.44.0: version "1.44.0" resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz" integrity sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg== mime-types@^2.1.12, mime-types@~2.1.19: version "2.1.27" resolved "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz" integrity sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w== dependencies: mime-db "1.44.0" mime@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz" integrity sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A== mimic-fn@^1.0.0: version "1.2.0" resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz" integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== min-indent@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz" integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== miniflare@3.20240524.1: version "3.20240524.1" resolved "https://registry.yarnpkg.com/miniflare/-/miniflare-3.20240524.1.tgz#38477cce5123d05ae87ac68e9addf0d0d30534d2" integrity sha512-5d3pRxvd5pT7lX1SsBH9+AjXuyHJnChSNOnYhubfi7pxMek4ZfULwhnUmNUp1R7b2xKuzqdFDZa0fsZuUoFxlw== dependencies: "@cspotcode/source-map-support" "0.8.1" acorn "^8.8.0" acorn-walk "^8.2.0" capnp-ts "^0.7.0" exit-hook "^2.2.1" glob-to-regexp "^0.4.1" stoppable "^1.1.0" undici "^5.28.2" workerd "1.20240524.0" ws "^8.11.0" youch "^3.2.2" zod "^3.20.6" "minimatch@2 || 3", minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== dependencies: brace-expansion "^1.1.7" minimatch@5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.0.1.tgz#fb9022f7528125187c92bd9e9b6366be1cf3415b" integrity sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g== dependencies: brace-expansion "^2.0.1" minimatch@9.0.3: version "9.0.3" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825" integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg== dependencies: brace-expansion "^2.0.1" minimatch@^5.0.1: version "5.1.6" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.6.tgz#1cfcb8cf5522ea69952cd2af95ae09477f122a96" integrity sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g== dependencies: brace-expansion "^2.0.1" minimatch@^9.0.4: version "9.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.4.tgz#8e49c731d1749cbec05050ee5145147b32496a51" integrity sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw== dependencies: brace-expansion "^2.0.1" minimist-options@4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz" integrity sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A== dependencies: arrify "^1.0.1" is-plain-obj "^1.1.0" kind-of "^6.0.3" minimist-options@^3.0.1: version "3.0.2" resolved "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz" integrity sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ== dependencies: arrify "^1.0.1" is-plain-obj "^1.1.0" minimist@^1.1.3, minimist@^1.2.0, minimist@^1.2.5: version "1.2.6" resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz" integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== minipass-collect@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/minipass-collect/-/minipass-collect-2.0.1.tgz#1621bc77e12258a12c60d34e2276ec5c20680863" integrity sha512-D7V8PO9oaz7PWGLbCACuI1qEOsq7UKfLotx/C0Aet43fCUB/wfQ7DYeq2oR/svFJGYDHPr38SHATeaj/ZoKHKw== dependencies: minipass "^7.0.3" minipass-fetch@^3.0.0: version "3.0.5" resolved "https://registry.yarnpkg.com/minipass-fetch/-/minipass-fetch-3.0.5.tgz#f0f97e40580affc4a35cc4a1349f05ae36cb1e4c" integrity sha512-2N8elDQAtSnFV0Dk7gt15KHsS0Fyz6CbYZ360h0WTYV1Ty46li3rAXVOQj1THMNLdmrD9Vt5pBPtWtVkpwGBqg== dependencies: minipass "^7.0.3" minipass-sized "^1.0.3" minizlib "^2.1.2" optionalDependencies: encoding "^0.1.13" minipass-flush@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/minipass-flush/-/minipass-flush-1.0.5.tgz#82e7135d7e89a50ffe64610a787953c4c4cbb373" integrity sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw== dependencies: minipass "^3.0.0" minipass-pipeline@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz#68472f79711c084657c067c5c6ad93cddea8214c" integrity sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A== dependencies: minipass "^3.0.0" minipass-sized@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/minipass-sized/-/minipass-sized-1.0.3.tgz#70ee5a7c5052070afacfbc22977ea79def353b70" integrity sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g== dependencies: minipass "^3.0.0" minipass@^2.3.5, minipass@^2.6.0, minipass@^2.9.0: version "2.9.0" resolved "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz" integrity sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg== dependencies: safe-buffer "^5.1.2" yallist "^3.0.0" minipass@^3.0.0: version "3.3.6" resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.3.6.tgz#7bba384db3a1520d18c9c0e5251c3444e95dd94a" integrity sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw== dependencies: yallist "^4.0.0" minipass@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/minipass/-/minipass-5.0.0.tgz#3e9788ffb90b694a5d0ec94479a45b5d8738133d" integrity sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ== "minipass@^5.0.0 || ^6.0.2 || ^7.0.0", minipass@^7.0.2, minipass@^7.0.3, minipass@^7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.1.2.tgz#93a9626ce5e5e66bd4db86849e7515e92340a707" integrity sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw== minizlib@^1.3.3: version "1.3.3" resolved "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz" integrity sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q== dependencies: minipass "^2.9.0" minizlib@^2.1.1, minizlib@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931" integrity sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg== dependencies: minipass "^3.0.0" yallist "^4.0.0" mississippi@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz" integrity sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA== dependencies: concat-stream "^1.5.0" duplexify "^3.4.2" end-of-stream "^1.1.0" flush-write-stream "^1.0.0" from2 "^2.1.0" parallel-transform "^1.1.0" pump "^3.0.0" pumpify "^1.3.3" stream-each "^1.1.0" through2 "^2.0.0" mixin-deep@^1.2.0: version "1.3.2" resolved "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz" integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== dependencies: for-in "^1.0.2" is-extendable "^1.0.1" mkdirp-promise@^5.0.1: version "5.0.1" resolved "https://registry.npmjs.org/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz" integrity sha1-6bj2jlUsaKnBcTuEiD96HdA5uKE= dependencies: mkdirp "*" mkdirp@*, mkdirp@^1.0.3: version "1.0.4" resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== mkdirp@0.5.x, mkdirp@^0.5.1, mkdirp@^0.5.5: version "0.5.5" resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz" integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== dependencies: minimist "^1.2.5" mocha@10.5.2, mocha@^10.5.2: version "10.5.2" resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.5.2.tgz#0a3481fb67c0a7fc144a909b2d6a9fec35ec5989" integrity sha512-9btlN3JKCefPf+vKd/kcKz2SXxi12z6JswkGfaAF0saQvnsqLJk504ZmbxhSoENge08E9dsymozKgFMTl5PQsA== dependencies: ansi-colors "4.1.1" browser-stdout "1.3.1" chokidar "^3.5.3" debug "4.3.4" diff "5.0.0" escape-string-regexp "4.0.0" find-up "5.0.0" glob "8.1.0" he "1.2.0" js-yaml "4.1.0" log-symbols "4.1.0" minimatch "5.0.1" ms "2.1.3" serialize-javascript "6.0.0" strip-json-comments "3.1.1" supports-color "8.1.1" workerpool "6.2.1" yargs "16.2.0" yargs-parser "20.2.4" yargs-unparser "2.0.0" modify-values@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz" integrity sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw== move-concurrently@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz" integrity sha1-viwAX9oy4LKa8fBdfEszIUxwH5I= dependencies: aproba "^1.1.1" copy-concurrently "^1.0.0" fs-write-stream-atomic "^1.0.8" mkdirp "^0.5.1" rimraf "^2.5.4" run-queue "^1.0.3" ms@2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz" integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= ms@2.1.2: version "2.1.2" resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== ms@2.1.3, ms@^2.0.0, ms@^2.1.1: version "2.1.3" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== multimatch@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/multimatch/-/multimatch-3.0.0.tgz" integrity sha512-22foS/gqQfANZ3o+W7ST2x25ueHDVNWl/b9OlGcLpy/iKxjCpvcNCM51YCenUi7Mt/jAjjqv8JwZRs8YP5sRjA== dependencies: array-differ "^2.0.3" array-union "^1.0.2" arrify "^1.0.1" minimatch "^3.0.4" mustache@^4.2.0: version "4.2.0" resolved "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz" integrity sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ== mute-stream@0.0.7: version "0.0.7" resolved "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz" integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= mute-stream@~0.0.4: version "0.0.8" resolved "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz" integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== mz@^2.5.0: version "2.7.0" resolved "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz" integrity sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q== dependencies: any-promise "^1.0.0" object-assign "^4.0.1" thenify-all "^1.0.0" nan@2.22.0: version "2.22.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.22.0.tgz#31bc433fc33213c97bad36404bb68063de604de3" integrity sha512-nbajikzWTMwsW+eSsNm3QwlOs7het9gGJU5dDZzRTQGk03vyBOauxgI4VakDzE0PtsGTmXPsXTbbjVhRwR5mpw== nanoid@^3.3.3: version "3.3.6" resolved "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz" integrity sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA== nanomatch@^1.2.9: version "1.2.13" resolved "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz" integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== dependencies: arr-diff "^4.0.0" array-unique "^0.3.2" define-property "^2.0.2" extend-shallow "^3.0.2" fragment-cache "^0.2.1" is-windows "^1.0.2" kind-of "^6.0.2" object.pick "^1.3.0" regex-not "^1.0.0" snapdragon "^0.8.1" to-regex "^3.0.1" natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz" integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= negotiator@^0.6.3: version "0.6.3" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== neo-async@^2.6.0: version "2.6.2" resolved "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== nice-try@^1.0.4: version "1.0.5" resolved "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz" integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== node-fetch-npm@^2.0.2: version "2.0.4" resolved "https://registry.npmjs.org/node-fetch-npm/-/node-fetch-npm-2.0.4.tgz" integrity sha512-iOuIQDWDyjhv9qSDrj9aq/klt6F9z1p2otB3AV7v3zBDcL/x+OfGsvGQZZCcMZbUf4Ujw1xGNQkjvGnVT22cKg== dependencies: encoding "^0.1.11" json-parse-better-errors "^1.0.0" safe-buffer "^5.1.1" node-fetch@^2.5.0, node-fetch@^2.6.1: version "2.6.7" resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz" integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== dependencies: whatwg-url "^5.0.0" node-forge@^1: version "1.3.1" resolved "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz" integrity sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA== node-gyp@>=10.x: version "10.2.0" resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-10.2.0.tgz#80101c4aa4f7ab225f13fcc8daaaac4eb1a8dd86" integrity sha512-sp3FonBAaFe4aYTcFdZUn2NYkbP7xroPGYvQmP4Nl5PxamznItBnNCgjrVTKrEfQynInMsJvZrdmqUnysCJ8rw== dependencies: env-paths "^2.2.0" exponential-backoff "^3.1.1" glob "^10.3.10" graceful-fs "^4.2.6" make-fetch-happen "^13.0.0" nopt "^7.0.0" proc-log "^4.1.0" semver "^7.3.5" tar "^6.2.1" which "^4.0.0" node-gyp@^5.0.2: version "5.1.1" resolved "https://registry.npmjs.org/node-gyp/-/node-gyp-5.1.1.tgz" integrity sha512-WH0WKGi+a4i4DUt2mHnvocex/xPLp9pYt5R6M2JdFB7pJ7Z34hveZ4nDTGTiLXCkitA9T8HFZjhinBCiVHYcWw== dependencies: env-paths "^2.2.0" glob "^7.1.4" graceful-fs "^4.2.2" mkdirp "^0.5.1" nopt "^4.0.1" npmlog "^4.1.2" request "^2.88.0" rimraf "^2.6.3" semver "^5.7.1" tar "^4.4.12" which "^1.3.1" nopt@3.x: version "3.0.6" resolved "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz" integrity sha1-xkZdvwirzU2zWTF/eaxopkayj/k= dependencies: abbrev "1" nopt@^4.0.1: version "4.0.3" resolved "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz" integrity sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg== dependencies: abbrev "1" osenv "^0.1.4" nopt@^7.0.0: version "7.2.1" resolved "https://registry.yarnpkg.com/nopt/-/nopt-7.2.1.tgz#1cac0eab9b8e97c9093338446eddd40b2c8ca1e7" integrity sha512-taM24ViiimT/XntxbPyJQzCG+p4EKOpgD3mxFwW38mGjVUrfERQOeY4EDHjdnptttfHuHQXFx+lTP08Q+mLa/w== dependencies: abbrev "^2.0.0" normalize-package-data@^2.0.0, normalize-package-data@^2.3.0, normalize-package-data@^2.3.2, normalize-package-data@^2.3.4, normalize-package-data@^2.3.5, normalize-package-data@^2.4.0, normalize-package-data@^2.5.0: version "2.5.0" resolved "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz" integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== dependencies: hosted-git-info "^2.1.4" resolve "^1.10.0" semver "2 || 3 || 4 || 5" validate-npm-package-license "^3.0.1" normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== normalize-url@^3.3.0: version "3.3.0" resolved "https://registry.npmjs.org/normalize-url/-/normalize-url-3.3.0.tgz" integrity sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg== npm-bundled@^1.0.1: version "1.1.1" resolved "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.1.tgz" integrity sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA== dependencies: npm-normalize-package-bin "^1.0.1" npm-lifecycle@^3.1.2: version "3.1.5" resolved "https://registry.npmjs.org/npm-lifecycle/-/npm-lifecycle-3.1.5.tgz" integrity sha512-lDLVkjfZmvmfvpvBzA4vzee9cn+Me4orq0QF8glbswJVEbIcSNWib7qGOffolysc3teCqbbPZZkzbr3GQZTL1g== dependencies: byline "^5.0.0" graceful-fs "^4.1.15" node-gyp "^5.0.2" resolve-from "^4.0.0" slide "^1.1.6" uid-number "0.0.6" umask "^1.1.0" which "^1.3.1" npm-normalize-package-bin@^1.0.0, npm-normalize-package-bin@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz" integrity sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA== "npm-package-arg@^4.0.0 || ^5.0.0 || ^6.0.0", npm-package-arg@^6.0.0, npm-package-arg@^6.1.0: version "6.1.1" resolved "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz" integrity sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg== dependencies: hosted-git-info "^2.7.1" osenv "^0.1.5" semver "^5.6.0" validate-npm-package-name "^3.0.0" npm-packlist@^1.4.4: version "1.4.8" resolved "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.8.tgz" integrity sha512-5+AZgwru5IevF5ZdnFglB5wNlHG1AOOuw28WhUq8/8emhBmLv6jX5by4WJCh7lW0uSYZYS6DXqIsyZVIXRZU9A== dependencies: ignore-walk "^3.0.1" npm-bundled "^1.0.1" npm-normalize-package-bin "^1.0.1" npm-pick-manifest@^3.0.0: version "3.0.2" resolved "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-3.0.2.tgz" integrity sha512-wNprTNg+X5nf+tDi+hbjdHhM4bX+mKqv6XmPh7B5eG+QY9VARfQPfCEH013H5GqfNj6ee8Ij2fg8yk0mzps1Vw== dependencies: figgy-pudding "^3.5.1" npm-package-arg "^6.0.0" semver "^5.4.1" npm-run-path@^2.0.0: version "2.0.2" resolved "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz" integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= dependencies: path-key "^2.0.0" npmlog@^4.1.2: version "4.1.2" resolved "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz" integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== dependencies: are-we-there-yet "~1.1.2" console-control-strings "~1.1.0" gauge "~2.7.3" set-blocking "~2.0.0" number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz" integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= oauth-sign@~0.9.0: version "0.9.0" resolved "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz" integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== object-assign@^4.0.1, object-assign@^4.1.0: version "4.1.1" resolved "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz" integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= object-copy@^0.1.0: version "0.1.0" resolved "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz" integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= dependencies: copy-descriptor "^0.1.0" define-property "^0.2.5" kind-of "^3.0.3" object-inspect@^1.8.0: version "1.8.0" resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz" integrity sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA== object-keys@^1.0.12, object-keys@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== object-visit@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz" integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= dependencies: isobject "^3.0.0" object.assign@^4.1.1: version "4.1.1" resolved "https://registry.npmjs.org/object.assign/-/object.assign-4.1.1.tgz" integrity sha512-VT/cxmx5yaoHSOTSyrCygIDFco+RsibY2NM0a4RdEeY/4KgqezwFtK1yr3U67xYhqJSlASm2pKhLVzPj2lr4bA== dependencies: define-properties "^1.1.3" es-abstract "^1.18.0-next.0" has-symbols "^1.0.1" object-keys "^1.1.1" object.getownpropertydescriptors@^2.0.3: version "2.1.0" resolved "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz" integrity sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg== dependencies: define-properties "^1.1.3" es-abstract "^1.17.0-next.1" object.pick@^1.3.0: version "1.3.0" resolved "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz" integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= dependencies: isobject "^3.0.1" octokit-pagination-methods@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/octokit-pagination-methods/-/octokit-pagination-methods-1.1.0.tgz" integrity sha512-fZ4qZdQ2nxJvtcasX7Ghl+WlWS/d9IgnBIwFZXVNNZUmzpno91SX5bc5vuxiuKoCtK78XxGGNuSCrDC7xYB3OQ== okay@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/okay/-/okay-0.3.0.tgz#de2840310df9805d6c0506d8dbb8d9ba09129d28" integrity sha512-9Jtrbe/gncY/uRSRYD+VbaTiLuDX+Zm6uRg06itpkU82ZDcuOv+sWgRRvQXU3n7ZSHgltWHUw9EFkLsN4nEOeQ== dependencies: sliced "0.0.5" once@1.x, once@^1.3.0, once@^1.3.1, once@^1.4.0: version "1.4.0" resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz" integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= dependencies: wrappy "1" onetime@^2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz" integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= dependencies: mimic-fn "^1.0.0" optionator@^0.8.1: version "0.8.3" resolved "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz" integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== dependencies: deep-is "~0.1.3" fast-levenshtein "~2.0.6" levn "~0.3.0" prelude-ls "~1.1.2" type-check "~0.3.2" word-wrap "~1.2.3" optionator@^0.9.3: version "0.9.3" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.3.tgz#007397d44ed1872fdc6ed31360190f81814e2c64" integrity sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg== dependencies: "@aashutoshrathi/word-wrap" "^1.2.3" deep-is "^0.1.3" fast-levenshtein "^2.0.6" levn "^0.4.1" prelude-ls "^1.2.1" type-check "^0.4.0" os-homedir@^1.0.0: version "1.0.2" resolved "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz" integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= os-name@^3.1.0: version "3.1.0" resolved "https://registry.npmjs.org/os-name/-/os-name-3.1.0.tgz" integrity sha512-h8L+8aNjNcMpo/mAIBPn5PXCM16iyPGjHNWo6U1YO8sJTMHtEtyczI6QJnLoplswm6goopQkqc7OAnjhWcugVg== dependencies: macos-release "^2.2.0" windows-release "^3.1.0" os-tmpdir@^1.0.0, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz" integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= osenv@^0.1.4, osenv@^0.1.5: version "0.1.5" resolved "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz" integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== dependencies: os-homedir "^1.0.0" os-tmpdir "^1.0.0" p-finally@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz" integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= p-limit@^1.1.0: version "1.3.0" resolved "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz" integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== dependencies: p-try "^1.0.0" p-limit@^2.0.0, p-limit@^2.2.0: version "2.3.0" resolved "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz" integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== dependencies: p-try "^2.0.0" p-limit@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== dependencies: yocto-queue "^0.1.0" p-locate@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz" integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= dependencies: p-limit "^1.1.0" p-locate@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz" integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== dependencies: p-limit "^2.0.0" p-locate@^4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz" integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== dependencies: p-limit "^2.2.0" p-locate@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== dependencies: p-limit "^3.0.2" p-map-series@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/p-map-series/-/p-map-series-1.0.0.tgz" integrity sha1-v5j+V1cFZYqeE1G++4WuTB8Hvco= dependencies: p-reduce "^1.0.0" p-map@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz" integrity sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw== p-map@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/p-map/-/p-map-4.0.0.tgz#bb2f95a5eda2ec168ec9274e06a747c3e2904d2b" integrity sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ== dependencies: aggregate-error "^3.0.0" p-pipe@^1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/p-pipe/-/p-pipe-1.2.0.tgz" integrity sha1-SxoROZoRUgpneQ7loMHViB1r7+k= p-queue@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/p-queue/-/p-queue-4.0.0.tgz" integrity sha512-3cRXXn3/O0o3+eVmUroJPSj/esxoEFIm0ZOno/T+NzG/VZgPOqQ8WKmlNqubSEpZmCIngEy34unkHGg83ZIBmg== dependencies: eventemitter3 "^3.1.0" p-reduce@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/p-reduce/-/p-reduce-1.0.0.tgz" integrity sha1-GMKw3ZNqRpClKfgjH1ig/bakffo= p-try@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz" integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= p-try@^2.0.0: version "2.2.0" resolved "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz" integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== p-waterfall@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/p-waterfall/-/p-waterfall-1.0.0.tgz" integrity sha1-ftlLPOszMngjU69qrhGqn8I1uwA= dependencies: p-reduce "^1.0.0" parallel-transform@^1.1.0: version "1.2.0" resolved "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.2.0.tgz" integrity sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg== dependencies: cyclist "^1.0.1" inherits "^2.0.3" readable-stream "^2.1.5" parent-module@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz" integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== dependencies: callsites "^3.0.0" parse-github-repo-url@^1.3.0: version "1.4.1" resolved "https://registry.npmjs.org/parse-github-repo-url/-/parse-github-repo-url-1.4.1.tgz" integrity sha1-nn2LslKmy2ukJZUGC3v23z28H1A= parse-json@^2.2.0: version "2.2.0" resolved "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz" integrity sha1-9ID0BDTvgHQfhGkJn43qGPVaTck= dependencies: error-ex "^1.2.0" parse-json@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz" integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= dependencies: error-ex "^1.3.1" json-parse-better-errors "^1.0.1" parse-json@^5.0.0: version "5.1.0" resolved "https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz" integrity sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ== dependencies: "@babel/code-frame" "^7.0.0" error-ex "^1.3.1" json-parse-even-better-errors "^2.3.0" lines-and-columns "^1.1.6" parse-path@^4.0.0: version "4.0.2" resolved "https://registry.npmjs.org/parse-path/-/parse-path-4.0.2.tgz" integrity sha512-HSqVz6iuXSiL8C1ku5Gl1Z5cwDd9Wo0q8CoffdAghP6bz8pJa1tcMC+m4N+z6VAS8QdksnIGq1TB6EgR4vPR6w== dependencies: is-ssh "^1.3.0" protocols "^1.4.0" parse-url@^5.0.0: version "5.0.2" resolved "https://registry.npmjs.org/parse-url/-/parse-url-5.0.2.tgz" integrity sha512-Czj+GIit4cdWtxo3ISZCvLiUjErSo0iI3wJ+q9Oi3QuMYTI6OZu+7cewMWZ+C1YAnKhYTk6/TLuhIgCypLthPA== dependencies: is-ssh "^1.3.0" normalize-url "^3.3.0" parse-path "^4.0.0" protocols "^1.4.0" pascalcase@^0.1.1: version "0.1.1" resolved "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz" integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= path-dirname@^1.0.0: version "1.0.2" resolved "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz" integrity sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA= path-exists@^2.0.0: version "2.1.0" resolved "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz" integrity sha1-D+tsZPD8UY2adU3V77YscCJ2H0s= dependencies: pinkie-promise "^2.0.0" path-exists@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz" integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= path-exists@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz" integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= path-key@^2.0.0, path-key@^2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz" integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= path-key@^3.1.0: version "3.1.1" resolved "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz" integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== path-parse@^1.0.6, path-parse@^1.0.7: version "1.0.7" resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== path-scurry@^1.11.1: version "1.11.1" resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.11.1.tgz#7960a668888594a0720b12a911d1a742ab9f11d2" integrity sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA== dependencies: lru-cache "^10.2.0" minipass "^5.0.0 || ^6.0.2 || ^7.0.0" path-to-regexp@^6.2.0: version "6.2.1" resolved "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.1.tgz" integrity sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw== path-type@^1.0.0: version "1.1.0" resolved "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz" integrity sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE= dependencies: graceful-fs "^4.1.2" pify "^2.0.0" pinkie-promise "^2.0.0" path-type@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz" integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== dependencies: pify "^3.0.0" path-type@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== pathval@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz" integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== performance-now@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz" integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= pg-copy-streams@0.3.0: version "0.3.0" resolved "https://registry.npmjs.org/pg-copy-streams/-/pg-copy-streams-0.3.0.tgz" integrity sha1-pPvCo7eI1Onab3fOs1Qi2NcEO38= pg-cursor@^1.3.0: version "1.3.0" resolved "https://registry.npmjs.org/pg-cursor/-/pg-cursor-1.3.0.tgz" integrity sha1-siDxkIl2t7QNqjc8etpfyoI6sNk= pg-int8@1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz" integrity sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw== pg-types@^2.1.0: version "2.2.0" resolved "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz" integrity sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA== dependencies: pg-int8 "1.0.1" postgres-array "~2.0.0" postgres-bytea "~1.0.0" postgres-date "~1.0.4" postgres-interval "^1.1.0" pgpass@1.x: version "1.0.5" resolved "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz" integrity sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug== dependencies: split2 "^4.1.0" picomatch@^2.0.4, picomatch@^2.2.1: version "2.2.2" resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz" integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== picomatch@^2.3.1: version "2.3.1" resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== pify@^2.0.0, pify@^2.3.0: version "2.3.0" resolved "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz" integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= pify@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz" integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= pify@^4.0.1: version "4.0.1" resolved "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz" integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== pinkie-promise@^2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz" integrity sha1-ITXW36ejWMBprJsXh3YogihFD/o= dependencies: pinkie "^2.0.0" pinkie@^2.0.0: version "2.0.4" resolved "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz" integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= pkg-dir@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz" integrity sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw== dependencies: find-up "^3.0.0" posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz" integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= postgres-array@~2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz" integrity sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA== postgres-bytea@~1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz" integrity sha1-AntTPAqokOJtFy1Hz5zOzFIazTU= postgres-date@~1.0.4: version "1.0.7" resolved "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz" integrity sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q== postgres-interval@^1.1.0: version "1.2.0" resolved "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz" integrity sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ== dependencies: xtend "^4.0.0" prelude-ls@^1.2.1: version "1.2.1" resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz" integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= prettier-linter-helpers@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz" integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== dependencies: fast-diff "^1.1.2" prettier@3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.3.tgz#432a51f7ba422d1469096c0fdc28e235db8f9643" integrity sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg== printable-characters@^1.0.42: version "1.0.42" resolved "https://registry.yarnpkg.com/printable-characters/-/printable-characters-1.0.42.tgz#3f18e977a9bd8eb37fcc4ff5659d7be90868b3d8" integrity sha512-dKp+C4iXWK4vVYZmYSd0KBH5F/h1HoZRsbJ82AVKRO3PEo8L4lBS/vLwhVtpwwuYcoIsVY+1JYKR268yn480uQ== proc-log@^4.1.0, proc-log@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/proc-log/-/proc-log-4.2.0.tgz#b6f461e4026e75fdfe228b265e9f7a00779d7034" integrity sha512-g8+OnU/L2v+wyiVK+D5fA34J7EH8jZ8DDlvwhRCMxmMj7UCBvxiO1mGeN+36JXIKF4zevU4kRBd8lVgG9vLelA== process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz" integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== promise-inflight@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz" integrity sha1-mEcocL8igTL8vdhoEputEsPAKeM= promise-retry@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/promise-retry/-/promise-retry-1.1.1.tgz" integrity sha1-ZznpaOMFHaIM5kl/srUPaRHfPW0= dependencies: err-code "^1.0.0" retry "^0.10.0" promise-retry@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/promise-retry/-/promise-retry-2.0.1.tgz#ff747a13620ab57ba688f5fc67855410c370da22" integrity sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g== dependencies: err-code "^2.0.2" retry "^0.12.0" promzard@^0.3.0: version "0.3.0" resolved "https://registry.npmjs.org/promzard/-/promzard-0.3.0.tgz" integrity sha1-JqXW7ox97kyxIggwWs+5O6OCqe4= dependencies: read "1" proto-list@~1.2.1: version "1.2.4" resolved "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz" integrity sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk= protocols@^1.1.0, protocols@^1.4.0: version "1.4.8" resolved "https://registry.npmjs.org/protocols/-/protocols-1.4.8.tgz" integrity sha512-IgjKyaUSjsROSO8/D49Ab7hP8mJgTYcqApOqdPhLoPxAplXmkp+zRvsrSQjFn5by0rhm4VH0GAUELIPpx7B1yg== protoduck@^5.0.1: version "5.0.1" resolved "https://registry.npmjs.org/protoduck/-/protoduck-5.0.1.tgz" integrity sha512-WxoCeDCoCBY55BMvj4cAEjdVUFGRWed9ZxPlqTKYyw1nDDTQ4pqmnIMAGfJlg7Dx35uB/M+PHJPTmGOvaCaPTg== dependencies: genfun "^5.0.0" psl@^1.1.28: version "1.8.0" resolved "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz" integrity sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ== pump@^2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz" integrity sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA== dependencies: end-of-stream "^1.1.0" once "^1.3.1" pump@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz" integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== dependencies: end-of-stream "^1.1.0" once "^1.3.1" pumpify@^1.3.3: version "1.5.1" resolved "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz" integrity sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ== dependencies: duplexify "^3.6.0" inherits "^2.0.3" pump "^2.0.0" punycode@^2.1.0, punycode@^2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== q@^1.5.1: version "1.5.1" resolved "https://registry.npmjs.org/q/-/q-1.5.1.tgz" integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc= qs@~6.5.2: version "6.5.2" resolved "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz" integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== quick-lru@^1.0.0: version "1.1.0" resolved "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz" integrity sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g= quick-lru@^4.0.1: version "4.0.1" resolved "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz" integrity sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g== randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== dependencies: safe-buffer "^5.1.0" read-cmd-shim@^1.0.1: version "1.0.5" resolved "https://registry.npmjs.org/read-cmd-shim/-/read-cmd-shim-1.0.5.tgz" integrity sha512-v5yCqQ/7okKoZZkBQUAfTsQ3sVJtXdNfbPnI5cceppoxEVLYA3k+VtV2omkeo8MS94JCy4fSiUwlRBAwCVRPUA== dependencies: graceful-fs "^4.1.2" "read-package-json@1 || 2", read-package-json@^2.0.0, read-package-json@^2.0.13: version "2.1.2" resolved "https://registry.npmjs.org/read-package-json/-/read-package-json-2.1.2.tgz" integrity sha512-D1KmuLQr6ZSJS0tW8hf3WGpRlwszJOXZ3E8Yd/DNRaM5d+1wVRZdHlpGBLAuovjr28LbWvjpWkBHMxpRGGjzNA== dependencies: glob "^7.1.1" json-parse-even-better-errors "^2.3.0" normalize-package-data "^2.0.0" npm-normalize-package-bin "^1.0.0" read-package-tree@^5.1.6: version "5.3.1" resolved "https://registry.npmjs.org/read-package-tree/-/read-package-tree-5.3.1.tgz" integrity sha512-mLUDsD5JVtlZxjSlPPx1RETkNjjvQYuweKwNVt1Sn8kP5Jh44pvYuUHCp6xSVDZWbNxVxG5lyZJ921aJH61sTw== dependencies: read-package-json "^2.0.0" readdir-scoped-modules "^1.0.0" util-promisify "^2.1.0" read-pkg-up@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz" integrity sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI= dependencies: find-up "^1.0.0" read-pkg "^1.0.0" read-pkg-up@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz" integrity sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc= dependencies: find-up "^2.0.0" read-pkg "^3.0.0" read-pkg-up@^7.0.1: version "7.0.1" resolved "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz" integrity sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg== dependencies: find-up "^4.1.0" read-pkg "^5.2.0" type-fest "^0.8.1" read-pkg@^1.0.0: version "1.1.0" resolved "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz" integrity sha1-9f+qXs0pyzHAR0vKfXVra7KePyg= dependencies: load-json-file "^1.0.0" normalize-package-data "^2.3.2" path-type "^1.0.0" read-pkg@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz" integrity sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k= dependencies: load-json-file "^4.0.0" normalize-package-data "^2.3.2" path-type "^3.0.0" read-pkg@^5.2.0: version "5.2.0" resolved "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz" integrity sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg== dependencies: "@types/normalize-package-data" "^2.4.0" normalize-package-data "^2.5.0" parse-json "^5.0.0" type-fest "^0.6.0" read@1, read@~1.0.1: version "1.0.7" resolved "https://registry.npmjs.org/read/-/read-1.0.7.tgz" integrity sha1-s9oZvQUkMal2cdRKQmNK33ELQMQ= dependencies: mute-stream "~0.0.4" "readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.6, readable-stream@~2.3.6: version "2.3.7" resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz" integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== dependencies: core-util-is "~1.0.0" inherits "~2.0.3" isarray "~1.0.0" process-nextick-args "~2.0.0" safe-buffer "~5.1.1" string_decoder "~1.1.1" util-deprecate "~1.0.1" "readable-stream@2 || 3", readable-stream@^3.0.2: version "3.6.0" resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz" integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== dependencies: inherits "^2.0.3" string_decoder "^1.1.1" util-deprecate "^1.0.1" readdir-scoped-modules@^1.0.0: version "1.1.0" resolved "https://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.1.0.tgz" integrity sha512-asaikDeqAQg7JifRsZn1NJZXo9E+VwlyCfbkZhwyISinqk5zNS6266HS5kah6P0SaQKGF6SkNnZVHUzHFYxYDw== dependencies: debuglog "^1.0.1" dezalgo "^1.0.0" graceful-fs "^4.1.2" once "^1.3.0" readdirp@~3.6.0: version "3.6.0" resolved "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz" integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== dependencies: picomatch "^2.2.1" redent@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz" integrity sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94= dependencies: indent-string "^2.1.0" strip-indent "^1.0.1" redent@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz" integrity sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo= dependencies: indent-string "^3.0.0" strip-indent "^2.0.0" redent@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz" integrity sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg== dependencies: indent-string "^4.0.0" strip-indent "^3.0.0" regex-not@^1.0.0, regex-not@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz" integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== dependencies: extend-shallow "^3.0.2" safe-regex "^1.1.0" regexpp@^3.0.0: version "3.1.0" resolved "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz" integrity sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q== repeat-element@^1.1.2: version "1.1.3" resolved "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz" integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== repeat-string@^1.6.1: version "1.6.1" resolved "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz" integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= repeating@^2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz" integrity sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo= dependencies: is-finite "^1.0.0" request@^2.88.0, request@^2.88.2: version "2.88.2" resolved "https://registry.npmjs.org/request/-/request-2.88.2.tgz" integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== dependencies: aws-sign2 "~0.7.0" aws4 "^1.8.0" caseless "~0.12.0" combined-stream "~1.0.6" extend "~3.0.2" forever-agent "~0.6.1" form-data "~2.3.2" har-validator "~5.1.3" http-signature "~1.2.0" is-typedarray "~1.0.0" isstream "~0.1.2" json-stringify-safe "~5.0.1" mime-types "~2.1.19" oauth-sign "~0.9.0" performance-now "^2.1.0" qs "~6.5.2" safe-buffer "^5.1.2" tough-cookie "~2.5.0" tunnel-agent "^0.6.0" uuid "^3.3.2" require-directory@^2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz" integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= require-main-filename@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz" integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== resolve-cwd@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz" integrity sha1-AKn3OHVW4nA46uIyyqNypqWbZlo= dependencies: resolve-from "^3.0.0" resolve-from@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz" integrity sha1-six699nWiBvItuZTM17rywoYh0g= resolve-from@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz" integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== resolve-url@^0.2.1: version "0.2.1" resolved "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz" integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= resolve.exports@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-2.0.2.tgz#f8c934b8e6a13f539e38b7098e2e36134f01e800" integrity sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg== resolve@1.1.x: version "1.1.7" resolved "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz" integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= resolve@^1.10.0, resolve@^1.10.1: version "1.17.0" resolved "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz" integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== dependencies: path-parse "^1.0.6" resolve@^1.22.8: version "1.22.8" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d" integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== dependencies: is-core-module "^2.13.0" path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" restore-cursor@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz" integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= dependencies: onetime "^2.0.0" signal-exit "^3.0.2" ret@~0.1.10: version "0.1.15" resolved "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz" integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== retry@^0.10.0: version "0.10.1" resolved "https://registry.npmjs.org/retry/-/retry-0.10.1.tgz" integrity sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q= retry@^0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" integrity sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow== reusify@^1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== rimraf@^2.5.4, rimraf@^2.6.2, rimraf@^2.6.3: version "2.7.1" resolved "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz" integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== dependencies: glob "^7.1.3" rimraf@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== dependencies: glob "^7.1.3" rollup-plugin-inject@^3.0.0: version "3.0.2" resolved "https://registry.npmjs.org/rollup-plugin-inject/-/rollup-plugin-inject-3.0.2.tgz" integrity sha512-ptg9PQwzs3orn4jkgXJ74bfs5vYz1NCZlSQMBUA0wKcGp5i5pA1AO3fOUEte8enhGUC+iapTCzEWw2jEFFUO/w== dependencies: estree-walker "^0.6.1" magic-string "^0.25.3" rollup-pluginutils "^2.8.1" rollup-plugin-node-polyfills@^0.2.1: version "0.2.1" resolved "https://registry.npmjs.org/rollup-plugin-node-polyfills/-/rollup-plugin-node-polyfills-0.2.1.tgz" integrity sha512-4kCrKPTJ6sK4/gLL/U5QzVT8cxJcofO0OU74tnB19F40cmuAKSzH5/siithxlofFEjwvw1YAhPmbvGNA6jEroA== dependencies: rollup-plugin-inject "^3.0.0" rollup-pluginutils@^2.8.1: version "2.8.2" resolved "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz" integrity sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ== dependencies: estree-walker "^0.6.1" run-async@^2.2.0: version "2.4.1" resolved "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz" integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== run-parallel@^1.1.9: version "1.1.9" resolved "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz" integrity sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q== run-queue@^1.0.0, run-queue@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz" integrity sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec= dependencies: aproba "^1.1.1" rxjs@^6.4.0: version "6.6.3" resolved "https://registry.npmjs.org/rxjs/-/rxjs-6.6.3.tgz" integrity sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ== dependencies: tslib "^1.9.0" safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@^5.2.1, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== safe-regex@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz" integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= dependencies: ret "~0.1.10" "safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== selfsigned@^2.0.1: version "2.1.1" resolved "https://registry.npmjs.org/selfsigned/-/selfsigned-2.1.1.tgz" integrity sha512-GSL3aowiF7wa/WtSFwnUrludWFoNhftq8bUkH9pkzjpN2XSPOAYEgg6e0sS9s0rZwgJzJiQRPU18A6clnoW5wQ== dependencies: node-forge "^1" "semver@2 || 3 || 4 || 5", "semver@2.x || 3.x || 4 || 5", semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0, semver@^5.7.0, semver@^5.7.1: version "5.7.1" resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== semver@^4.1.0: version "4.3.6" resolved "https://registry.yarnpkg.com/semver/-/semver-4.3.6.tgz#300bc6e0e86374f7ba61068b5b1ecd57fc6532da" integrity sha512-IrpJ+yoG4EOH8DFWuVg+8H1kW1Oaof0Wxe7cPcXW3x9BjkN/eVo54F15LyqemnDIUYskQWr9qvl/RihmSy6+xQ== semver@^6.0.0, semver@^6.1.0, semver@^6.2.0: version "6.3.0" resolved "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== semver@^7.3.5, semver@^7.5.4: version "7.6.2" resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.2.tgz#1e3b34759f896e8f14d6134732ce798aeb0c6e13" integrity sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w== serialize-javascript@6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== dependencies: randombytes "^2.1.0" set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz" integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= set-value@^2.0.0, set-value@^2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz" integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw== dependencies: extend-shallow "^2.0.1" is-extendable "^0.1.1" is-plain-object "^2.0.3" split-string "^3.0.1" shallow-clone@^3.0.0: version "3.0.1" resolved "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz" integrity sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA== dependencies: kind-of "^6.0.2" shebang-command@^1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz" integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= dependencies: shebang-regex "^1.0.0" shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz" integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== dependencies: shebang-regex "^3.0.0" shebang-regex@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz" integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= shebang-regex@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.3" resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz" integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== signal-exit@^4.0.1: version "4.1.0" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== slash@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz" integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A== slash@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== sliced@0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/sliced/-/sliced-0.0.5.tgz#5edc044ca4eb6f7816d50ba2fc63e25d8fe4707f" integrity sha512-9bYT917D6H3+q8GlQBJmLVz3bc4OeVGfZ2BB12wvLnluTGfG6/8UdOUbKJDW1EEx9SZMDbjnatkau5/XcUeyOw== slide@^1.1.6: version "1.1.6" resolved "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz" integrity sha1-VusCfWW00tzmyy4tMsTUr8nh1wc= smart-buffer@^4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.1.0.tgz" integrity sha512-iVICrxOzCynf/SNaBQCw34eM9jROU/s5rzIhpOvzhzuYHfJR/DhZfDkXiZSgKXfgv26HT3Yni3AV/DGw0cGnnw== smart-buffer@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.2.0.tgz#6e1d71fa4f18c05f7d0ff216dd16a481d0e8d9ae" integrity sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg== snapdragon-node@^2.0.1: version "2.1.1" resolved "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz" integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== dependencies: define-property "^1.0.0" isobject "^3.0.0" snapdragon-util "^3.0.1" snapdragon-util@^3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz" integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== dependencies: kind-of "^3.2.0" snapdragon@^0.8.1: version "0.8.2" resolved "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz" integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== dependencies: base "^0.11.1" debug "^2.2.0" define-property "^0.2.5" extend-shallow "^2.0.1" map-cache "^0.2.2" source-map "^0.5.6" source-map-resolve "^0.5.0" use "^3.1.0" socks-proxy-agent@^4.0.0: version "4.0.2" resolved "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-4.0.2.tgz" integrity sha512-NT6syHhI9LmuEMSK6Kd2V7gNv5KFZoLE7V5udWmn0de+3Mkj3UMA/AJPLyeNUVmElCurSHtUdM3ETpR3z770Wg== dependencies: agent-base "~4.2.1" socks "~2.3.2" socks-proxy-agent@^8.0.3: version "8.0.3" resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-8.0.3.tgz#6b2da3d77364fde6292e810b496cb70440b9b89d" integrity sha512-VNegTZKhuGq5vSD6XNKlbqWhyt/40CgoEw8XxD6dhnm8Jq9IEa3nIa4HwnM8XOqU0CdB0BwWVXusqiFXfHB3+A== dependencies: agent-base "^7.1.1" debug "^4.3.4" socks "^2.7.1" socks@^2.7.1: version "2.8.3" resolved "https://registry.yarnpkg.com/socks/-/socks-2.8.3.tgz#1ebd0f09c52ba95a09750afe3f3f9f724a800cb5" integrity sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw== dependencies: ip-address "^9.0.5" smart-buffer "^4.2.0" socks@~2.3.2: version "2.3.3" resolved "https://registry.npmjs.org/socks/-/socks-2.3.3.tgz" integrity sha512-o5t52PCNtVdiOvzMry7wU4aOqYWL0PeCXRWBEiJow4/i/wr+wpsJQ9awEu1EonLIqsfGd5qSgDdxEOvCdmBEpA== dependencies: ip "1.1.5" smart-buffer "^4.1.0" sort-keys@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz" integrity sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg= dependencies: is-plain-obj "^1.0.0" source-map-resolve@^0.5.0: version "0.5.3" resolved "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz" integrity sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw== dependencies: atob "^2.1.2" decode-uri-component "^0.2.0" resolve-url "^0.2.1" source-map-url "^0.4.0" urix "^0.1.0" source-map-support@^0.5.17: version "0.5.19" resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz" integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" source-map-url@^0.4.0: version "0.4.0" resolved "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz" integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= source-map@0.6.1, source-map@^0.6.0, source-map@^0.6.1: version "0.6.1" resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== source-map@^0.5.6: version "0.5.7" resolved "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz" integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= source-map@~0.2.0: version "0.2.0" resolved "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz" integrity sha1-2rc/vPwrqBm03gO9b26qSBZLP50= dependencies: amdefine ">=0.0.4" sourcemap-codec@^1.4.8: version "1.4.8" resolved "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz" integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== spdx-correct@^3.0.0: version "3.1.1" resolved "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz" integrity sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w== dependencies: spdx-expression-parse "^3.0.0" spdx-license-ids "^3.0.0" spdx-exceptions@^2.1.0: version "2.3.0" resolved "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz" integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== spdx-expression-parse@^3.0.0: version "3.0.1" resolved "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz" integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== dependencies: spdx-exceptions "^2.1.0" spdx-license-ids "^3.0.0" spdx-license-ids@^3.0.0: version "3.0.6" resolved "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.6.tgz" integrity sha512-+orQK83kyMva3WyPf59k1+Y525csj5JejicWut55zeTWANuN17qSiSLUXWtzHeNWORSvT7GLDJ/E/XiIWoXBTw== split-string@^3.0.1, split-string@^3.0.2: version "3.1.0" resolved "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz" integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== dependencies: extend-shallow "^3.0.0" split2@^2.0.0: version "2.2.0" resolved "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz" integrity sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw== dependencies: through2 "^2.0.2" split2@^4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/split2/-/split2-4.1.0.tgz" integrity sha512-VBiJxFkxiXRlUIeyMQi8s4hgvKCSjtknJv/LVYbrgALPwf5zSKmEwV9Lst25AkvMDnvxODugjdl6KZgwKM1WYQ== split@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/split/-/split-1.0.1.tgz" integrity sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg== dependencies: through "2" sprintf-js@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.1.3.tgz#4914b903a2f8b685d17fdf78a70e917e872e444a" integrity sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA== sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz" integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= sshpk@^1.7.0: version "1.16.1" resolved "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz" integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== dependencies: asn1 "~0.2.3" assert-plus "^1.0.0" bcrypt-pbkdf "^1.0.0" dashdash "^1.12.0" ecc-jsbn "~0.1.1" getpass "^0.1.1" jsbn "~0.1.0" safer-buffer "^2.0.2" tweetnacl "~0.14.0" ssri@^10.0.0: version "10.0.6" resolved "https://registry.yarnpkg.com/ssri/-/ssri-10.0.6.tgz#a8aade2de60ba2bce8688e3fa349bad05c7dc1e5" integrity sha512-MGrFH9Z4NP9Iyhqn16sDtBpRRNJ0Y2hNa6D65h736fVSaPCHr4DM4sWUNvVaSuC+0OBGhwsrydQwmgfg5LncqQ== dependencies: minipass "^7.0.3" ssri@^6.0.0, ssri@^6.0.1: version "6.0.2" resolved "https://registry.npmjs.org/ssri/-/ssri-6.0.2.tgz" integrity sha512-cepbSq/neFK7xB6A50KHN0xHDotYzq58wWCa5LeWqnPrHG8GzfEjO/4O8kpmcGW+oaxkvhEJCWgbgNk4/ZV93Q== dependencies: figgy-pudding "^3.5.1" stacktracey@^2.1.8: version "2.1.8" resolved "https://registry.yarnpkg.com/stacktracey/-/stacktracey-2.1.8.tgz#bf9916020738ce3700d1323b32bd2c91ea71199d" integrity sha512-Kpij9riA+UNg7TnphqjH7/CzctQ/owJGNbFkfEeve4Z4uxT5+JapVLFXcsurIfN34gnTWZNJ/f7NMG0E8JDzTw== dependencies: as-table "^1.0.36" get-source "^2.0.12" static-extend@^0.1.1: version "0.1.2" resolved "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz" integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= dependencies: define-property "^0.2.5" object-copy "^0.1.0" stoppable@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/stoppable/-/stoppable-1.1.0.tgz#32da568e83ea488b08e4d7ea2c3bcc9d75015d5b" integrity sha512-KXDYZ9dszj6bzvnEMRYvxgeTHU74QBFL54XKtP3nyMuJ81CFYtABZ3bAzL2EdFUaEwJOBOgENyFj3R7oTzDyyw== stream-each@^1.1.0: version "1.2.3" resolved "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz" integrity sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw== dependencies: end-of-stream "^1.1.0" stream-shift "^1.0.0" stream-shift@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz" integrity sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ== stream-spec@~0.3.5: version "0.3.6" resolved "https://registry.npmjs.org/stream-spec/-/stream-spec-0.3.6.tgz" integrity sha1-L92sSge/Pp+JY8Z3prWmzCEVJV4= dependencies: macgyver "~1.10" "string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== dependencies: emoji-regex "^8.0.0" is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" string-width@^1.0.1: version "1.0.2" resolved "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz" integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= dependencies: code-point-at "^1.0.0" is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" "string-width@^1.0.2 || 2", string-width@^2.1.0: version "2.1.1" resolved "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz" integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== dependencies: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" string-width@^3.0.0, string-width@^3.1.0: version "3.1.0" resolved "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz" integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== dependencies: emoji-regex "^7.0.1" is-fullwidth-code-point "^2.0.0" strip-ansi "^5.1.0" string-width@^5.0.1, string-width@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" integrity sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA== dependencies: eastasianwidth "^0.2.0" emoji-regex "^9.2.2" strip-ansi "^7.0.1" string.prototype.trimend@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz" integrity sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g== dependencies: define-properties "^1.1.3" es-abstract "^1.17.5" string.prototype.trimstart@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz" integrity sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw== dependencies: define-properties "^1.1.3" es-abstract "^1.17.5" string_decoder@^1.1.1: version "1.3.0" resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== dependencies: safe-buffer "~5.2.0" string_decoder@~1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz" integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== dependencies: safe-buffer "~5.1.0" "strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== dependencies: ansi-regex "^5.0.1" strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= dependencies: ansi-regex "^2.0.0" strip-ansi@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz" integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= dependencies: ansi-regex "^3.0.0" strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: version "5.2.0" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz" integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== dependencies: ansi-regex "^4.1.0" strip-ansi@^7.0.1: version "7.1.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" integrity sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ== dependencies: ansi-regex "^6.0.1" strip-bom@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz" integrity sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4= dependencies: is-utf8 "^0.2.0" strip-bom@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz" integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= strip-eof@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz" integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= strip-indent@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz" integrity sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI= dependencies: get-stdin "^4.0.1" strip-indent@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz" integrity sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g= strip-indent@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz" integrity sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ== dependencies: min-indent "^1.0.0" strip-json-comments@3.1.1, strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== strong-log-transformer@^2.0.0: version "2.1.0" resolved "https://registry.npmjs.org/strong-log-transformer/-/strong-log-transformer-2.1.0.tgz" integrity sha512-B3Hgul+z0L9a236FAUC9iZsL+nVHgoCJnqCbN588DjYxvGXaXaaFbfmQ/JhvKjZwsOukuR72XbHv71Qkug0HxA== dependencies: duplexer "^0.1.1" minimist "^1.2.0" through "^2.3.4" supports-color@8.1.1: version "8.1.1" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== dependencies: has-flag "^4.0.0" supports-color@^3.1.0: version "3.2.3" resolved "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz" integrity sha1-ZawFBLOVQXHYpklGsq48u4pfVPY= dependencies: has-flag "^1.0.0" supports-color@^5.3.0: version "5.5.0" resolved "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz" integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== dependencies: has-flag "^3.0.0" supports-color@^7.1.0: version "7.2.0" resolved "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz" integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== dependencies: has-flag "^4.0.0" supports-preserve-symlinks-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== synckit@^0.8.6: version "0.8.8" resolved "https://registry.yarnpkg.com/synckit/-/synckit-0.8.8.tgz#fe7fe446518e3d3d49f5e429f443cf08b6edfcd7" integrity sha512-HwOKAP7Wc5aRGYdKH+dw0PRRpbO841v2DENBtjnR5HFWoiNByAl7vrx3p0G/rCyYXQsrxqtX48TImFtPcIHSpQ== dependencies: "@pkgr/core" "^0.1.0" tslib "^2.6.2" tar@^4.4.10, tar@^4.4.12, tar@^4.4.8: version "4.4.19" resolved "https://registry.npmjs.org/tar/-/tar-4.4.19.tgz" integrity sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA== dependencies: chownr "^1.1.4" fs-minipass "^1.2.7" minipass "^2.9.0" minizlib "^1.3.3" mkdirp "^0.5.5" safe-buffer "^5.2.1" yallist "^3.1.1" tar@^6.1.11, tar@^6.2.1: version "6.2.1" resolved "https://registry.yarnpkg.com/tar/-/tar-6.2.1.tgz#717549c541bc3c2af15751bea94b1dd068d4b03a" integrity sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A== dependencies: chownr "^2.0.0" fs-minipass "^2.0.0" minipass "^5.0.0" minizlib "^2.1.1" mkdirp "^1.0.3" yallist "^4.0.0" temp-dir@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/temp-dir/-/temp-dir-1.0.0.tgz" integrity sha1-CnwOom06Oa+n4OvqnB/AvE2qAR0= temp-write@^3.4.0: version "3.4.0" resolved "https://registry.npmjs.org/temp-write/-/temp-write-3.4.0.tgz" integrity sha1-jP9jD7fp2gXwR8dM5M5NaFRX1JI= dependencies: graceful-fs "^4.1.2" is-stream "^1.1.0" make-dir "^1.0.0" pify "^3.0.0" temp-dir "^1.0.0" uuid "^3.0.1" text-extensions@^1.0.0: version "1.9.0" resolved "https://registry.npmjs.org/text-extensions/-/text-extensions-1.9.0.tgz" integrity sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ== text-table@^0.2.0: version "0.2.0" resolved "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz" integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= thenify-all@^1.0.0: version "1.6.0" resolved "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz" integrity sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY= dependencies: thenify ">= 3.1.0 < 4" "thenify@>= 3.1.0 < 4": version "3.3.1" resolved "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz" integrity sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw== dependencies: any-promise "^1.0.0" through2@^2.0.0, through2@^2.0.2: version "2.0.5" resolved "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz" integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ== dependencies: readable-stream "~2.3.6" xtend "~4.0.1" through2@^3.0.0: version "3.0.2" resolved "https://registry.npmjs.org/through2/-/through2-3.0.2.tgz" integrity sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ== dependencies: inherits "^2.0.4" readable-stream "2 || 3" through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6: version "2.3.8" resolved "https://registry.npmjs.org/through/-/through-2.3.8.tgz" integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= tmp@^0.0.33: version "0.0.33" resolved "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz" integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== dependencies: os-tmpdir "~1.0.2" to-object-path@^0.3.0: version "0.3.0" resolved "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz" integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= dependencies: kind-of "^3.0.2" to-regex-range@^2.1.0: version "2.1.1" resolved "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz" integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= dependencies: is-number "^3.0.0" repeat-string "^1.6.1" to-regex-range@^5.0.1: version "5.0.1" resolved "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz" integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== dependencies: is-number "^7.0.0" to-regex@^3.0.1, to-regex@^3.0.2: version "3.0.2" resolved "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz" integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== dependencies: define-property "^2.0.2" extend-shallow "^3.0.2" regex-not "^1.0.2" safe-regex "^1.1.0" to-utf8@0.0.1: version "0.0.1" resolved "https://registry.npmjs.org/to-utf8/-/to-utf8-0.0.1.tgz" integrity sha1-0Xrqcv8vujm55DYBvns/9y4ImFI= tough-cookie@~2.5.0: version "2.5.0" resolved "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz" integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== dependencies: psl "^1.1.28" punycode "^2.1.1" tr46@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz" integrity sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk= dependencies: punycode "^2.1.0" tr46@~0.0.3: version "0.0.3" resolved "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz" integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= trim-newlines@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz" integrity sha1-WIeWa7WCpFA6QetST301ARgVphM= trim-newlines@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz" integrity sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA= trim-newlines@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.0.tgz" integrity sha512-C4+gOpvmxaSMKuEf9Qc134F1ZuOHVXKRbtEflf4NTtuuJDEIJ9p5PXsalL8SkeRw+qit1Mo+yuvMPAKwWg/1hA== trim-off-newlines@^1.0.0: version "1.0.3" resolved "https://registry.npmjs.org/trim-off-newlines/-/trim-off-newlines-1.0.3.tgz" integrity sha512-kh6Tu6GbeSNMGfrrZh6Bb/4ZEHV1QlB4xNDBeog8Y9/QwFlKTRyWvY3Fs9tRDAMZliVUwieMgEdIeL/FtqjkJg== ts-api-utils@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.0.3.tgz#f12c1c781d04427313dbac808f453f050e54a331" integrity sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg== ts-node@^8.5.4: version "8.10.2" resolved "https://registry.npmjs.org/ts-node/-/ts-node-8.10.2.tgz" integrity sha512-ISJJGgkIpDdBhWVu3jufsWpK3Rzo7bdiIXJjQc0ynKxVOVcg2oIrf2H2cejminGrptVc6q6/uynAHNCuWGbpVA== dependencies: arg "^4.1.0" diff "^4.0.1" make-error "^1.1.1" source-map-support "^0.5.17" yn "3.1.1" tslib@^1.9.0: version "1.14.1" resolved "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== tslib@^2.2.0, tslib@^2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz" integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= dependencies: safe-buffer "^5.0.1" tweetnacl@^0.14.3, tweetnacl@~0.14.0: version "0.14.5" resolved "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz" integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" resolved "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz" integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== dependencies: prelude-ls "^1.2.1" type-check@~0.3.2: version "0.3.2" resolved "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz" integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= dependencies: prelude-ls "~1.1.2" type-detect@^4.0.0, type-detect@^4.0.5: version "4.0.8" resolved "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz" integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== type-fest@^0.13.1: version "0.13.1" resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz" integrity sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg== type-fest@^0.20.2: version "0.20.2" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== type-fest@^0.3.0: version "0.3.1" resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.3.1.tgz" integrity sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ== type-fest@^0.6.0: version "0.6.0" resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz" integrity sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg== type-fest@^0.8.1: version "0.8.1" resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz" integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== typedarray@^0.0.6: version "0.0.6" resolved "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= typescript@^4.0.3: version "4.8.4" resolved "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz" integrity sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ== uglify-js@^3.1.4: version "3.13.5" resolved "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.5.tgz" integrity sha512-xtB8yEqIkn7zmOyS2zUNBsYCBRhDkvlNxMMY2smuJ/qA8NCHeQvKCF3i9Z4k8FJH4+PJvZRtMrPynfZ75+CSZw== uid-number@0.0.6: version "0.0.6" resolved "https://registry.npmjs.org/uid-number/-/uid-number-0.0.6.tgz" integrity sha1-DqEOgDXo61uOREnwbaHHMGY7qoE= umask@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/umask/-/umask-1.1.0.tgz" integrity sha1-8pzr8B31F5ErtY/5xOUP3o4zMg0= undici@^5.28.2: version "5.28.4" resolved "https://registry.yarnpkg.com/undici/-/undici-5.28.4.tgz#6b280408edb6a1a604a9b20340f45b422e373068" integrity sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g== dependencies: "@fastify/busboy" "^2.0.0" union-value@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz" integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg== dependencies: arr-union "^3.1.0" get-value "^2.0.6" is-extendable "^0.1.1" set-value "^2.0.1" unique-filename@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz" integrity sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ== dependencies: unique-slug "^2.0.0" unique-filename@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-3.0.0.tgz#48ba7a5a16849f5080d26c760c86cf5cf05770ea" integrity sha512-afXhuC55wkAmZ0P18QsVE6kp8JaxrEokN2HGIoIVv2ijHQd419H0+6EigAFcIzXeMIkcIkNBpB3L/DXB3cTS/g== dependencies: unique-slug "^4.0.0" unique-slug@^2.0.0: version "2.0.2" resolved "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz" integrity sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w== dependencies: imurmurhash "^0.1.4" unique-slug@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/unique-slug/-/unique-slug-4.0.0.tgz#6bae6bb16be91351badd24cdce741f892a6532e3" integrity sha512-WrcA6AyEfqDX5bWige/4NQfPZMtASNVxdmWR76WESYQVAACSgWcR6e9i0mofqqBxYFtL4oAxPIptY73/0YE1DQ== dependencies: imurmurhash "^0.1.4" universal-user-agent@^4.0.0: version "4.0.1" resolved "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-4.0.1.tgz" integrity sha512-LnST3ebHwVL2aNe4mejI9IQh2HfZ1RLo8Io2HugSif8ekzD1TlWpHpColOB/eh8JHMLkGH3Akqf040I+4ylNxg== dependencies: os-name "^3.1.0" universal-user-agent@^6.0.0: version "6.0.0" resolved "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz" integrity sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w== universalify@^0.1.0: version "0.1.2" resolved "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz" integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== unset-value@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz" integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= dependencies: has-value "^0.3.1" isobject "^3.0.0" upath@^1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz" integrity sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg== uri-js@^4.2.2: version "4.4.0" resolved "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz" integrity sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g== dependencies: punycode "^2.1.0" urix@^0.1.0: version "0.1.0" resolved "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz" integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= use@^3.1.0: version "3.1.1" resolved "https://registry.npmjs.org/use/-/use-3.1.1.tgz" integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== util-deprecate@^1.0.1, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= util-promisify@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/util-promisify/-/util-promisify-2.1.0.tgz" integrity sha1-PCI2R2xNMsX/PEcAKt18E7moKlM= dependencies: object.getownpropertydescriptors "^2.0.3" uuid@^3.0.1, uuid@^3.3.2: version "3.4.0" resolved "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz" integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== validate-npm-package-license@^3.0.1, validate-npm-package-license@^3.0.3: version "3.0.4" resolved "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz" integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== dependencies: spdx-correct "^3.0.0" spdx-expression-parse "^3.0.0" validate-npm-package-name@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz" integrity sha1-X6kS2B630MdK/BQN5zF/DKffQ34= dependencies: builtins "^1.0.3" verror@1.10.0: version "1.10.0" resolved "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz" integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= dependencies: assert-plus "^1.0.0" core-util-is "1.0.2" extsprintf "^1.2.0" wcwidth@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz" integrity sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g= dependencies: defaults "^1.0.3" webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz" integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= webidl-conversions@^4.0.2: version "4.0.2" resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz" integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== whatwg-url@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz" integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= dependencies: tr46 "~0.0.3" webidl-conversions "^3.0.0" whatwg-url@^7.0.0: version "7.1.0" resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz" integrity sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg== dependencies: lodash.sortby "^4.7.0" tr46 "^1.0.1" webidl-conversions "^4.0.2" which-module@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz" integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= which@^1.1.1, which@^1.2.9, which@^1.3.1: version "1.3.1" resolved "https://registry.npmjs.org/which/-/which-1.3.1.tgz" integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== dependencies: isexe "^2.0.0" which@^2.0.1: version "2.0.2" resolved "https://registry.npmjs.org/which/-/which-2.0.2.tgz" integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== dependencies: isexe "^2.0.0" which@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/which/-/which-4.0.0.tgz#cd60b5e74503a3fbcfbf6cd6b4138a8bae644c1a" integrity sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg== dependencies: isexe "^3.1.1" wide-align@^1.1.0: version "1.1.3" resolved "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz" integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== dependencies: string-width "^1.0.2 || 2" windows-release@^3.1.0: version "3.3.3" resolved "https://registry.npmjs.org/windows-release/-/windows-release-3.3.3.tgz" integrity sha512-OSOGH1QYiW5yVor9TtmXKQvt2vjQqbYS+DqmsZw+r7xDwLXEeT3JGW0ZppFmHx4diyXmxt238KFR3N9jzevBRg== dependencies: execa "^1.0.0" word-wrap@~1.2.3: version "1.2.3" resolved "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz" integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== wordwrap@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz" integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= workerd@1.20240524.0: version "1.20240524.0" resolved "https://registry.yarnpkg.com/workerd/-/workerd-1.20240524.0.tgz#b5550ceecdd566475db9dcec2787d8deb91d1acb" integrity sha512-LWLe5D8PVHBcqturmBbwgI71r7YPpIMYZoVEH6S4G35EqIJ55cb0n3FipoSyraoIfpcCxCFxX1K6WsRHbP3pFA== optionalDependencies: "@cloudflare/workerd-darwin-64" "1.20240524.0" "@cloudflare/workerd-darwin-arm64" "1.20240524.0" "@cloudflare/workerd-linux-64" "1.20240524.0" "@cloudflare/workerd-linux-arm64" "1.20240524.0" "@cloudflare/workerd-windows-64" "1.20240524.0" workerd@^1.20230419.0: version "1.20250129.0" resolved "https://registry.yarnpkg.com/workerd/-/workerd-1.20250129.0.tgz#319070f1fe0ce8be9866efac496b650e3901c401" integrity sha512-Rprz8rxKTF4l6q/nYYI07lBetJnR19mGipx+u/a27GZOPKMG5SLIzA2NciZlJaB2Qd5YY+4p/eHOeKqo5keVWA== optionalDependencies: "@cloudflare/workerd-darwin-64" "1.20250129.0" "@cloudflare/workerd-darwin-arm64" "1.20250129.0" "@cloudflare/workerd-linux-64" "1.20250129.0" "@cloudflare/workerd-linux-arm64" "1.20250129.0" "@cloudflare/workerd-windows-64" "1.20250129.0" workerpool@6.2.1: version "6.2.1" resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== wrangler@3.58.0: version "3.58.0" resolved "https://registry.yarnpkg.com/wrangler/-/wrangler-3.58.0.tgz#b2ce3ac2d2b86f31f3b33a496ef9c9656f41f2ea" integrity sha512-h9gWER7LXLnmHABDNP1p3aqXtchlvSBN8Dp22ZurnkxaLMZ3L3H1Ze1ftiFSs0VRWv0BUnz7AWIUqZmzuBY4Nw== dependencies: "@cloudflare/kv-asset-handler" "0.3.2" "@esbuild-plugins/node-globals-polyfill" "^0.2.3" "@esbuild-plugins/node-modules-polyfill" "^0.2.2" blake3-wasm "^2.1.5" chokidar "^3.5.3" esbuild "0.17.19" miniflare "3.20240524.1" nanoid "^3.3.3" path-to-regexp "^6.2.0" resolve "^1.22.8" resolve.exports "^2.0.2" selfsigned "^2.0.1" source-map "0.6.1" xxhash-wasm "^1.0.1" optionalDependencies: fsevents "~2.3.2" "wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== dependencies: ansi-styles "^4.0.0" string-width "^4.1.0" strip-ansi "^6.0.0" wrap-ansi@^5.1.0: version "5.1.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz" integrity sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q== dependencies: ansi-styles "^3.2.0" string-width "^3.0.0" strip-ansi "^5.0.0" wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" integrity sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ== dependencies: ansi-styles "^6.1.0" string-width "^5.0.1" strip-ansi "^7.0.1" wrappy@1: version "1.0.2" resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= write-file-atomic@^2.0.0, write-file-atomic@^2.3.0, write-file-atomic@^2.4.2: version "2.4.3" resolved "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz" integrity sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ== dependencies: graceful-fs "^4.1.11" imurmurhash "^0.1.4" signal-exit "^3.0.2" write-json-file@^2.2.0: version "2.3.0" resolved "https://registry.npmjs.org/write-json-file/-/write-json-file-2.3.0.tgz" integrity sha1-K2TIozAE1UuGmMdtWFp3zrYdoy8= dependencies: detect-indent "^5.0.0" graceful-fs "^4.1.2" make-dir "^1.0.0" pify "^3.0.0" sort-keys "^2.0.0" write-file-atomic "^2.0.0" write-json-file@^3.2.0: version "3.2.0" resolved "https://registry.npmjs.org/write-json-file/-/write-json-file-3.2.0.tgz" integrity sha512-3xZqT7Byc2uORAatYiP3DHUUAVEkNOswEWNs9H5KXiicRTvzYzYqKjYc4G7p+8pltvAw641lVByKVtMpf+4sYQ== dependencies: detect-indent "^5.0.0" graceful-fs "^4.1.15" make-dir "^2.1.0" pify "^4.0.1" sort-keys "^2.0.0" write-file-atomic "^2.4.2" write-pkg@^3.1.0: version "3.2.0" resolved "https://registry.npmjs.org/write-pkg/-/write-pkg-3.2.0.tgz" integrity sha512-tX2ifZ0YqEFOF1wjRW2Pk93NLsj02+n1UP5RvO6rCs0K6R2g1padvf006cY74PQJKMGS2r42NK7FD0dG6Y6paw== dependencies: sort-keys "^2.0.0" write-json-file "^2.2.0" ws@^8.11.0: version "8.17.0" resolved "https://registry.yarnpkg.com/ws/-/ws-8.17.0.tgz#d145d18eca2ed25aaf791a183903f7be5e295fea" integrity sha512-uJq6108EgZMAl20KagGkzCKfMEjxmKvZHG7Tlq0Z6nOky7YF7aq4mOx6xK8TJ/i1LeK4Qus7INktacctDgY8Ow== xtend@^4.0.0, xtend@~4.0.1: version "4.0.2" resolved "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz" integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== xxhash-wasm@^1.0.1: version "1.0.2" resolved "https://registry.npmjs.org/xxhash-wasm/-/xxhash-wasm-1.0.2.tgz" integrity sha512-ibF0Or+FivM9lNrg+HGJfVX8WJqgo+kCLDc4vx6xMeTce7Aj+DLttKbxxRR/gNLSAelRc1omAPlJ77N/Jem07A== y18n@^4.0.0: version "4.0.1" resolved "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz" integrity sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ== y18n@^5.0.5: version "5.0.8" resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== yallist@^3.0.0, yallist@^3.0.2, yallist@^3.1.1: version "3.1.1" resolved "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz" integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== yallist@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== yargs-parser@20.2.4: version "20.2.4" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== yargs-parser@^15.0.1: version "15.0.1" resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-15.0.1.tgz" integrity sha512-0OAMV2mAZQrs3FkNpDQcBk1x5HXb8X4twADss4S0Iuk+2dGnLOE/fRHrsYm542GduMveyA77OF4wrNJuanRCWw== dependencies: camelcase "^5.0.0" decamelize "^1.2.0" yargs-parser@^18.1.3: version "18.1.3" resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz" integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== dependencies: camelcase "^5.0.0" decamelize "^1.2.0" yargs-parser@^20.2.2: version "20.2.9" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== yargs-unparser@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== dependencies: camelcase "^6.0.0" decamelize "^4.0.0" flat "^5.0.2" is-plain-obj "^2.1.0" yargs@16.2.0: version "16.2.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== dependencies: cliui "^7.0.2" escalade "^3.1.1" get-caller-file "^2.0.5" require-directory "^2.1.1" string-width "^4.2.0" y18n "^5.0.5" yargs-parser "^20.2.2" yargs@^14.2.2: version "14.2.3" resolved "https://registry.npmjs.org/yargs/-/yargs-14.2.3.tgz" integrity sha512-ZbotRWhF+lkjijC/VhmOT9wSgyBQ7+zr13+YLkhfsSiTriYsMzkTUFP18pFhWwBeMa5gUc1MzbhrO6/VB7c9Xg== dependencies: cliui "^5.0.0" decamelize "^1.2.0" find-up "^3.0.0" get-caller-file "^2.0.1" require-directory "^2.1.1" require-main-filename "^2.0.0" set-blocking "^2.0.0" string-width "^3.0.0" which-module "^2.0.0" y18n "^4.0.0" yargs-parser "^15.0.1" yn@3.1.1: version "3.1.1" resolved "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz" integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== youch@^3.2.2: version "3.3.3" resolved "https://registry.yarnpkg.com/youch/-/youch-3.3.3.tgz#50cfdf5bc395ce664a5073e31b712ff4a859d928" integrity sha512-qSFXUk3UZBLfggAW3dJKg0BMblG5biqSF8M34E06o5CSsZtH92u9Hqmj2RzGiHDi64fhe83+4tENFP2DB6t6ZA== dependencies: cookie "^0.5.0" mustache "^4.2.0" stacktracey "^2.1.8" zod@^3.20.6: version "3.23.8" resolved "https://registry.yarnpkg.com/zod/-/zod-3.23.8.tgz#e37b957b5d52079769fb8097099b592f0ef4067d" integrity sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==