This commit is contained in:
5
node_modules/node-notifier/.prettierrc
generated
vendored
Normal file
5
node_modules/node-notifier/.prettierrc
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"printWidth": 80,
|
||||
"singleQuote": true,
|
||||
"trailingComma": "none"
|
||||
}
|
||||
328
node_modules/node-notifier/CHANGELOG.md
generated
vendored
Normal file
328
node_modules/node-notifier/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,328 @@
|
||||
# Changelog
|
||||
|
||||
### `v8.0.1`
|
||||
|
||||
- fixes possible injection issue for notify-send
|
||||
|
||||
### `v8.0.0`
|
||||
|
||||
Breaking changes:
|
||||
|
||||
- Expire time for notify-send is made to match macOS and Windows with default time of 10 seconds. The API is changed to take seconds as input and converting it to milliseconds before passing it on to notify-send. See [#341](https://github.com/mikaelbr/node-notifier/pull/341).
|
||||
|
||||
### `v7.0.2`
|
||||
|
||||
- Updates dependencies
|
||||
- Fixes issue with haning Windows notifications when disabled ([#335](https://github.com/mikaelbr/node-notifier/pull/335))
|
||||
|
||||
### `v7.0.1`
|
||||
|
||||
- Fixes import of uuid, removes deprecation warnings
|
||||
|
||||
### `v7.0.0`
|
||||
|
||||
#### Features
|
||||
|
||||
- NotifySend support for app-name ([#299](https://github.com/mikaelbr/node-notifier/pull/299), see docs)
|
||||
|
||||
#### Breaking Changes
|
||||
|
||||
- All notify messages now have auto bound context to make it easier to pass as variables/arguments ([#306](https://github.com/mikaelbr/node-notifier/pull/306))
|
||||
- Updated snoreToast to version `0.7.0` with new input features ([#293](https://github.com/mikaelbr/node-notifier/pull/293))
|
||||
- Breaking snoreToast: Sanitizing data now changes "timedout" to "timeout"
|
||||
|
||||
### `v6.0.0`
|
||||
|
||||
#### Breaking Changes
|
||||
|
||||
- Dropped support for node v6. As of v6 we currently support node versions 8, 10, and 12 (latest).
|
||||
- Updated to the latest version of SnoreToast. This removes support for the `wait` option in that environment as it is now always on. Prepares the way for other new features added to the WindowsToaster.
|
||||
|
||||
#### Other
|
||||
|
||||
- Update to latest version of dependencies.
|
||||
|
||||
### `v5.4.3`
|
||||
|
||||
- Reverts breaking dependency upgrades from `v5.4.2` as some dependencies has removed Node 6 which is a breaking change.
|
||||
|
||||
### `v5.4.2`
|
||||
|
||||
- Updates dependencies
|
||||
|
||||
### `v5.4.1`
|
||||
|
||||
- Reverts changes to default timeout as they are causing some issues. See [#271](https://github.com/mikaelbr/node-notifier/pull/271)
|
||||
|
||||
### `v5.4.0`
|
||||
|
||||
- Prevent Spotlight from indexing terminal-notifier.app ([#238](https://github.com/mikaelbr/node-notifier/pull/238))
|
||||
- Changes from legacy url.parse api
|
||||
- Adds default timeout to notification center
|
||||
- Adds mapping from timeout to expire time for linux
|
||||
- Enables the use of WindowsToaster when using WSL ([#260](https://github.com/mikaelbr/node-notifier/pull/260))
|
||||
|
||||
### `v5.3.0`
|
||||
|
||||
- Re-adds `notifu` update.
|
||||
|
||||
### `v5.2.1`
|
||||
|
||||
- Rollback `notifu` update as it triggered Avast virus scan.
|
||||
|
||||
### `v5.2.0`
|
||||
|
||||
- Updates `terminal-notifier` dependency to `v1.7.2`, fixing memory leak. But not to `v1.8.0` as this breaks how icons work.
|
||||
- Updates `notifu` with new subtitle "Notification"
|
||||
- Fix: issue with `appID` by removing default empty string (see README Windows section)
|
||||
- Fix: link notifier time property to notify-send expire-time flag
|
||||
|
||||
- Minor change: use a more specific condition for enabling debug logging ([#171](https://github.com/mikaelbr/node-notifier/pull/171))
|
||||
|
||||
### `v5.1.2`
|
||||
|
||||
- Adds temporary workaround for `terminal-notifier` memory leak as seen in https://github.com/facebook/jest/issues/2999 and https://github.com/julienXX/terminal-notifier/issues/173.
|
||||
- Add appName option and hide snoreToast if not setted ([#158](https://github.com/mikaelbr/node-notifier/pull/158))
|
||||
|
||||
### `v5.0.2`
|
||||
|
||||
Non-obligatory fail. Fixes issue with multiple actions for macOS.
|
||||
|
||||
### `v5.0.1`
|
||||
|
||||
Obligatory fail. Fixes minor issue with non-JSON output for macOS.
|
||||
|
||||
### `v5.0.0`
|
||||
|
||||
#### Breaking Changes
|
||||
|
||||
_Note/TL;DR_: If you are just using `node-notifier` with things like `message`, `title` and `icon`, v5 should work just as before.
|
||||
|
||||
1. CLI is now removed. Can be found in separate project: https://github.com/mikaelbr/node-notifier-cli. This means you no longer get the `notify` bin when installing `node-notifier`. To get this do `npm i [-g] node-notifier-cli`
|
||||
2. Changed toaster implementation from `toast.exe` to [Snoretoast](https://github.com/KDE/snoretoast). This means if you are using your custom fork, you need to change. SnoreToast has some better default implemented functionality.
|
||||
3. [terminal-notifier](https://github.com/julienXX/terminal-notifier) dependency has been bumped to `v1.7.1`. With that there can be changes in the API, and supports now reply and buttons. Output has changed to JSON by default, this means the output of some functions of the terminal-notifier has broken. See https://github.com/julienXX/terminal-notifier for more details. See [README](https://github.com/mikaelbr/node-notifier#usage-notificationcenter) for documentation on how to use the new features, or [an example file](https://github.com/mikaelbr/node-notifier/blob/master/example/macInput.js).
|
||||
4. `notify` method will now throw error if second argument is something else than function (still optional): [#138](https://github.com/mikaelbr/node-notifier/pull/138).
|
||||
|
||||
#### Additions
|
||||
|
||||
1. Now supports \*BSD systems: [#142](https://github.com/mikaelbr/node-notifier/pull/142).
|
||||
2. With the new toaster implementation you can do more! For instance customize sound and close notification. See all options:
|
||||
|
||||
```javascript
|
||||
{
|
||||
title: void 0, // String. Required
|
||||
message: void 0, // String. Required if remove is not defined
|
||||
icon: void 0, // String. Absolute path to Icon
|
||||
sound: false, // Bool | String (as defined by http://msdn.microsoft.com/en-us/library/windows/apps/hh761492.aspx)
|
||||
wait: false, // Bool. Wait for User Action against Notification or times out
|
||||
id: void 0, // Number. ID to use for closing notification.
|
||||
appID: void 0, // String. App.ID. Don't create a shortcut but use the provided app id.
|
||||
remove: void 0, // Number. Refer to previously created notification to close.
|
||||
install: void 0 // String (path, application, app id). Creates a shortcut <path> in the start menu which point to the executable <application>, appID used for the notifications.
|
||||
}
|
||||
```
|
||||
|
||||
#### Fixes
|
||||
|
||||
1. Fixes new lines on messages on Windows: [#123](https://github.com/mikaelbr/node-notifier/issues/123)
|
||||
|
||||
#### Technical Changes
|
||||
|
||||
_Internal changes for those who might be interested_.
|
||||
|
||||
1. Dependencies bumped
|
||||
2. Unnecessary dependencies removed (`lodash.deepClone`). Now uses JSON serialize/deserialize instead.
|
||||
3. Project is auto-formatted by [`prettier`](https://github.com/jlongster/prettier).
|
||||
4. [Linting is added](https://github.com/mikaelbr/node-notifier/blob/master/.eslintrc)
|
||||
5. Added way to better debug what is happening by setting `DEBUG` env-var to `true`. See [CONTRIBUTE.md](https://github.com/mikaelbr/node-notifier/blob/master/CONTRIBUTE.md) for more details.
|
||||
|
||||
### `v4.6.1`
|
||||
|
||||
1. Adds npm ignore file, ignoring tests and examples from package.
|
||||
2. Fixes CI builds.
|
||||
|
||||
### `v4.6.0`
|
||||
|
||||
1. Adds support for Icon URL in Growl ([by @gucong3000](https://github.com/mikaelbr/node-notifier/pull/115))
|
||||
2. Adds options for passing host and port to cli tool ([reported by @el-davo](https://github.com/mikaelbr/node-notifier/issues/106))
|
||||
3. Fixes sanitize response on `notify` callback ([by @MadLittleMods](https://github.com/mikaelbr/node-notifier/commit/a44454a11eff452a8b55f9fbe291e189ed088708))
|
||||
4. Fixes use of new line in messages ([by @gucong3000](https://github.com/mikaelbr/node-notifier/pull/115))
|
||||
5. Fixes use of `file:///xxx` protocol icon paths for Windows 8.1 ([by @gucong3000](https://github.com/mikaelbr/node-notifier/pull/118))
|
||||
6. Fixes non-TTY usage and piping messages ([reported by @simensen](https://github.com/mikaelbr/node-notifier/issues/109))
|
||||
7. Updates vendor terminal-notifier version to 1.6.3 ([reported by @kid-icarus](https://github.com/mikaelbr/node-notifier/pull/120))
|
||||
|
||||
### `v4.5.0`
|
||||
|
||||
#### Additions
|
||||
|
||||
1. Adds syntactic sugar for `notify`. Now able to just pass message:
|
||||
|
||||
```js
|
||||
notifier.notify('My message');
|
||||
```
|
||||
|
||||
See [#45](https://github.com/mikaelbr/node-notifier/issues/45) for more info.
|
||||
|
||||
#### Fixes
|
||||
|
||||
1. Improvements to docs and examples
|
||||
2. Updates `semver` dependency to support Webpacking with Electron.
|
||||
|
||||
### `v4.4.0`
|
||||
|
||||
1. Changes to exec terminal-notifier through execFile to allow for asar-packages
|
||||
2. Adds support for remote growl server
|
||||
3. Adds support for win7 with electron asar-package
|
||||
|
||||
### `v4.3.1`
|
||||
|
||||
Obligatory patch fix:
|
||||
|
||||
1. Adds new stdin CLI options to docs
|
||||
|
||||
### `v4.3.0`
|
||||
|
||||
1. Adds support for piping messages in to CLI.
|
||||
(With `node-notifier` installed as a CLI `npm i -g node-notifier`)
|
||||
|
||||
```shell
|
||||
➜ echo "Message" | notify
|
||||
➜ echo "Message" | notify -t "My Title"
|
||||
➜ echo "Some message" | notify -t "My Title" -s
|
||||
```
|
||||
|
||||
### `v4.2.3`
|
||||
|
||||
1. Fixed input arguments to CLI to be strings where they should be strings.
|
||||
|
||||
### `v4.2.2`
|
||||
|
||||
1. Fixed no notification when no message for the CLI. [#58](https://github.com/mikaelbr/node-notifier/pull/58)
|
||||
2. Changes `which` test to be sync, avoiding some edge cases with multiple notifications.
|
||||
|
||||
### `v4.2.1`
|
||||
|
||||
1. Minor fix for docs in CLI usage
|
||||
|
||||
### `v4.2.0`
|
||||
|
||||
1. Adds CLI support.
|
||||
2. Fixes Debug "HRESULT : 0xC00CE508" exception on Win8. PR [#49](https://github.com/mikaelbr/node-notifier/pull/49)
|
||||
|
||||
### `v4.1.2`
|
||||
|
||||
1. Fixes correct terminal-notifier (own fork https://github.com/mikaelbr/terminal-notifier)
|
||||
to support activate / click.
|
||||
|
||||
### `v4.1.1`
|
||||
|
||||
1. Fixes proper error codes for balloon: #42
|
||||
2. Removes unused debug files: #41
|
||||
3. Patches differences between subtitle for notify-send: #43
|
||||
4. Updates terminal-notifier dependency (removing black borders) #44 #18
|
||||
|
||||
### `v4.1.0`
|
||||
|
||||
1. Adds support for changing host and port for Growl.
|
||||
|
||||
### `v4.0.3`
|
||||
|
||||
1. Fixes Notification center issue with multiple callback events.
|
||||
2. Fixes error in source code: Fixes long-spaces to proper spaces
|
||||
|
||||
### `v4.0.2`
|
||||
|
||||
1. Fixes issue with immidiate notifu notifications (with `wait : false`)
|
||||
2. Fixes issue with boolean flags for notifu.
|
||||
3. Restructures directories. Making it easier to require notifiers directly.
|
||||
|
||||
### `v4.0.1`
|
||||
|
||||
1. Fixes issue with optional callback for notify-send
|
||||
|
||||
### `v4.0.0`
|
||||
|
||||
Major changes and breaking API.
|
||||
|
||||
1. require('node-notifier') now returns an instance with fallbackable notifications.
|
||||
|
||||
```js
|
||||
var notifier = require('node-notifier');
|
||||
notifier.notify();
|
||||
```
|
||||
|
||||
2. Introduced a `wait` property (default `false`), to get user input for
|
||||
Notification Center, Windows Toaster, Windows Balloons and Growl. Sadly not
|
||||
for notify-send.
|
||||
|
||||
```js
|
||||
var notifier = require('node-notifier');
|
||||
notifier.notify({ wait: true }, function (err, response) {
|
||||
// response is response after user have interacted
|
||||
// with the notification or the notification has timed out.
|
||||
});
|
||||
```
|
||||
|
||||
3. All notification instances are now event emitters, emitting events
|
||||
`click` or `timeout`. This is only applicable if `{ wait: true }`.
|
||||
|
||||
```js
|
||||
var notifier = require('node-notifier');
|
||||
notifier.on('click', function (notificationObject, options) {
|
||||
// options.someArbitraryData === 'foo'
|
||||
});
|
||||
notifier.notify({ wait: true, someArbitraryData: 'foo' });
|
||||
```
|
||||
|
||||
4. WindowsToaster and NotificationCenter now can have sounds by doing `{ sound: true }`.
|
||||
Default NotificationCenter sound is Bottle. Can still use define sound on
|
||||
Mac:
|
||||
|
||||
```js
|
||||
var notifier = require('node-notifier');
|
||||
notifier.notify({ sound: true });
|
||||
// For mac (same as sound: true on Windows 8)
|
||||
notifier.notify({ sound: 'Morse' });
|
||||
```
|
||||
|
||||
### `v3.4.0`
|
||||
|
||||
1. Adds Growl as priority over Balloons
|
||||
|
||||
### `v3.3.0`
|
||||
|
||||
1. Adds support for native Windows 7 and earlier (through task bar balloons)
|
||||
2. Changes growl implementation. Adds better support for GNTP
|
||||
|
||||
### `v3.2.1`
|
||||
|
||||
1. Fixes support for notifications from folders with spaces on Windows.
|
||||
|
||||
### `v3.2.0`
|
||||
|
||||
1. Adds native Windows 8 support.
|
||||
|
||||
### `v3.1.0`
|
||||
|
||||
1. Adds Growl as fallback for Mac OS X pre 10.8.
|
||||
|
||||
### `v3.0.6`
|
||||
|
||||
1. Fixes typo: Changes Growl app name from `Gulp` to `Node`.
|
||||
|
||||
### `v3.0.5`
|
||||
|
||||
1. Maps common options between the different notifiers. Allowing for common usage with different notifiers.
|
||||
|
||||
### `v3.0.4`
|
||||
|
||||
1. Fixes expires for notify-send (Issue #13)
|
||||
|
||||
### `v3.0.2`
|
||||
|
||||
1. Fixes version check for Mac OS X Yosemite
|
||||
|
||||
### `v3.0.0`
|
||||
|
||||
1. Updates terminal-notifier to version 1.6.0; adding support for appIcon and contentImage
|
||||
2. Removes parsing of output sent from notifier (Notification Center)
|
||||
21
node_modules/node-notifier/LICENSE
generated
vendored
Normal file
21
node_modules/node-notifier/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017 Mikael Brevik
|
||||
|
||||
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.
|
||||
461
node_modules/node-notifier/README.md
generated
vendored
Normal file
461
node_modules/node-notifier/README.md
generated
vendored
Normal file
@@ -0,0 +1,461 @@
|
||||
# node-notifier [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url]
|
||||
|
||||
Send cross platform native notifications using Node.js. Notification Center for macOS,
|
||||
`notify-osd`/`libnotify-bin` for Linux, Toasters for Windows 8/10, or taskbar balloons for
|
||||
earlier Windows versions. Growl is used if none of these requirements are met.
|
||||
[Works well with Electron](#within-electron-packaging).
|
||||
|
||||

|
||||

|
||||
|
||||
## Input Example macOS Notification Center
|
||||
|
||||

|
||||
|
||||
## Actions Example Windows SnoreToast
|
||||
|
||||

|
||||
|
||||
## Quick Usage
|
||||
|
||||
Show a native notification on macOS, Windows, Linux:
|
||||
|
||||
```javascript
|
||||
const notifier = require('node-notifier');
|
||||
// String
|
||||
notifier.notify('Message');
|
||||
|
||||
// Object
|
||||
notifier.notify({
|
||||
title: 'My notification',
|
||||
message: 'Hello, there!'
|
||||
});
|
||||
```
|
||||
|
||||
## Requirements
|
||||
|
||||
- **macOS**: >= 10.8 for native notifications, or Growl if earlier.
|
||||
- **Linux**: `notify-osd` or `libnotify-bin` installed (Ubuntu should have this by default)
|
||||
- **Windows**: >= 8, or task bar balloons for Windows < 8. Growl as fallback. Growl takes precedence over Windows balloons.
|
||||
- **General Fallback**: Growl
|
||||
|
||||
See [documentation and flow chart for reporter choice](./DECISION_FLOW.md).
|
||||
|
||||
## Install
|
||||
|
||||
```shell
|
||||
npm install --save node-notifier
|
||||
```
|
||||
|
||||
## <abbr title="Command Line Interface">CLI</abbr>
|
||||
|
||||
<abbr title="Command Line Interface">CLI</abbr> has moved to separate project:
|
||||
<https://github.com/mikaelbr/node-notifier-cli>
|
||||
|
||||
## Cross-Platform Advanced Usage
|
||||
|
||||
Standard usage, with cross-platform fallbacks as defined in the
|
||||
[reporter flow chart](./DECISION_FLOW.md). All of the options
|
||||
below will work in some way or another on most platforms.
|
||||
|
||||
```javascript
|
||||
const notifier = require('node-notifier');
|
||||
const path = require('path');
|
||||
|
||||
notifier.notify(
|
||||
{
|
||||
title: 'My awesome title',
|
||||
message: 'Hello from node, Mr. User!',
|
||||
icon: path.join(__dirname, 'coulson.jpg'), // Absolute path (doesn't work on balloons)
|
||||
sound: true, // Only Notification Center or Windows Toasters
|
||||
wait: true // Wait with callback, until user action is taken against notification, does not apply to Windows Toasters as they always wait or notify-send as it does not support the wait option
|
||||
},
|
||||
function (err, response) {
|
||||
// Response is response from notification
|
||||
}
|
||||
);
|
||||
|
||||
notifier.on('click', function (notifierObject, options, event) {
|
||||
// Triggers if `wait: true` and user clicks notification
|
||||
});
|
||||
|
||||
notifier.on('timeout', function (notifierObject, options) {
|
||||
// Triggers if `wait: true` and notification closes
|
||||
});
|
||||
```
|
||||
|
||||
If you want super fine-grained control, you can customize each reporter individually,
|
||||
allowing you to tune specific options for different systems.
|
||||
|
||||
See below for documentation on each reporter.
|
||||
|
||||
**Example:**
|
||||
|
||||
```javascript
|
||||
const NotificationCenter = require('node-notifier/notifiers/notificationcenter');
|
||||
new NotificationCenter(options).notify();
|
||||
|
||||
const NotifySend = require('node-notifier/notifiers/notifysend');
|
||||
new NotifySend(options).notify();
|
||||
|
||||
const WindowsToaster = require('node-notifier/notifiers/toaster');
|
||||
new WindowsToaster(options).notify();
|
||||
|
||||
const Growl = require('node-notifier/notifiers/growl');
|
||||
new Growl(options).notify();
|
||||
|
||||
const WindowsBalloon = require('node-notifier/notifiers/balloon');
|
||||
new WindowsBalloon(options).notify();
|
||||
```
|
||||
|
||||
Or, if you are using several reporters (or you're lazy):
|
||||
|
||||
```javascript
|
||||
// NOTE: Technically, this takes longer to require
|
||||
const nn = require('node-notifier');
|
||||
|
||||
new nn.NotificationCenter(options).notify();
|
||||
new nn.NotifySend(options).notify();
|
||||
new nn.WindowsToaster(options).notify(options);
|
||||
new nn.WindowsBalloon(options).notify(options);
|
||||
new nn.Growl(options).notify(options);
|
||||
```
|
||||
|
||||
## Contents
|
||||
|
||||
- [Notification Center documentation](#usage-notificationcenter)
|
||||
- [Windows Toaster documentation](#usage-windowstoaster)
|
||||
- [Windows Balloon documentation](#usage-windowsballoon)
|
||||
- [Growl documentation](#usage-growl)
|
||||
- [Notify-send documentation](#usage-notifysend)
|
||||
|
||||
### Usage: `NotificationCenter`
|
||||
|
||||
Same usage and parameter setup as [**`terminal-notifier`**](https://github.com/julienXX/terminal-notifier).
|
||||
|
||||
Native Notification Center requires macOS version 10.8 or higher. If you have
|
||||
an earlier version, Growl will be the fallback. If Growl isn't installed, an
|
||||
error will be returned in the callback.
|
||||
|
||||
#### Example
|
||||
|
||||
Because `node-notifier` wraps around [**`terminal-notifier`**](https://github.com/julienXX/terminal-notifier),
|
||||
you can do anything `terminal-notifier` can, just by passing properties to the `notify`
|
||||
method.
|
||||
|
||||
For example:
|
||||
|
||||
- if `terminal-notifier` says `-message`, you can do `{message: 'Foo'}`
|
||||
- if `terminal-notifier` says `-list ALL`, you can do `{list: 'ALL'}`.
|
||||
|
||||
Notification is the primary focus of this module, so listing and activating do work,
|
||||
but they aren't documented.
|
||||
|
||||
### All notification options with their defaults:
|
||||
|
||||
```javascript
|
||||
const NotificationCenter = require('node-notifier').NotificationCenter;
|
||||
|
||||
var notifier = new NotificationCenter({
|
||||
withFallback: false, // Use Growl Fallback if <= 10.8
|
||||
customPath: undefined // Relative/Absolute path to binary if you want to use your own fork of terminal-notifier
|
||||
});
|
||||
|
||||
notifier.notify(
|
||||
{
|
||||
title: undefined,
|
||||
subtitle: undefined,
|
||||
message: undefined,
|
||||
sound: false, // Case Sensitive string for location of sound file, or use one of macOS' native sounds (see below)
|
||||
icon: 'Terminal Icon', // Absolute Path to Triggering Icon
|
||||
contentImage: undefined, // Absolute Path to Attached Image (Content Image)
|
||||
open: undefined, // URL to open on Click
|
||||
wait: false, // Wait for User Action against Notification or times out. Same as timeout = 5 seconds
|
||||
|
||||
// New in latest version. See `example/macInput.js` for usage
|
||||
timeout: 5, // Takes precedence over wait if both are defined.
|
||||
closeLabel: undefined, // String. Label for cancel button
|
||||
actions: undefined, // String | Array<String>. Action label or list of labels in case of dropdown
|
||||
dropdownLabel: undefined, // String. Label to be used if multiple actions
|
||||
reply: false // Boolean. If notification should take input. Value passed as third argument in callback and event emitter.
|
||||
},
|
||||
function (error, response, metadata) {
|
||||
console.log(response, metadata);
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
**Note:** The `wait` option is shorthand for `timeout: 5`. This just sets a timeout
|
||||
for 5 seconds. It does _not_ make the notification sticky!
|
||||
|
||||
As of Version 6.0 there is a default `timeout` set of `10` to ensure that the application closes properly. In order to remove the `timeout` and have an instantly closing notification (does not support actions), set `timeout` to `false`. If you are using `action` it is recommended to set `timeout` to a high value to ensure the user has time to respond.
|
||||
|
||||
_Exception:_ If `reply` is defined, it's recommended to set `timeout` to a either
|
||||
high value, or to nothing at all.
|
||||
|
||||
---
|
||||
|
||||
**For macOS notifications: `icon`, `contentImage`, and all forms of `reply`/`actions` require macOS 10.9.**
|
||||
|
||||
Sound can be one of these: `Basso`, `Blow`, `Bottle`, `Frog`, `Funk`, `Glass`,
|
||||
`Hero`, `Morse`, `Ping`, `Pop`, `Purr`, `Sosumi`, `Submarine`, `Tink`.
|
||||
|
||||
If `sound` is simply `true`, `Bottle` is used.
|
||||
|
||||
---
|
||||
|
||||
**See Also:**
|
||||
|
||||
- [Example: specific Notification Centers](./example/advanced.js)
|
||||
- [Example: input](./example/macInput.js).
|
||||
|
||||
---
|
||||
|
||||
**Custom Path clarification**
|
||||
|
||||
`customPath` takes a value of a relative or absolute path to the binary of your
|
||||
fork/custom version of **`terminal-notifier`**.
|
||||
|
||||
**Example:** `./vendor/mac.noindex/terminal-notifier.app/Contents/MacOS/terminal-notifier`
|
||||
|
||||
**Spotlight clarification**
|
||||
|
||||
`terminal-notifier.app` resides in a `mac.noindex` folder to prevent Spotlight from indexing the app.
|
||||
|
||||
### Usage: `WindowsToaster`
|
||||
|
||||
**Note:** There are some limitations for images in native Windows 8 notifications:
|
||||
|
||||
- The image must be a PNG image
|
||||
- The image must be smaller than 1024×1024 px
|
||||
- The image must be less than 200kb
|
||||
- The image must be specified using an absolute path
|
||||
|
||||
These limitations are due to the Toast notification system. A good tip is to use
|
||||
something like `path.join` or `path.delimiter` to keep your paths cross-platform.
|
||||
|
||||
From [mikaelbr/gulp-notify#90 (comment)](https://github.com/mikaelbr/gulp-notify/issues/90#issuecomment-129333034)
|
||||
|
||||
> You can make it work by going to System > Notifications & Actions. The 'toast'
|
||||
> app needs to have Banners enabled. (You can activate banners by clicking on the
|
||||
> 'toast' app and setting the 'Show notification banners' to On)
|
||||
|
||||
---
|
||||
|
||||
**Windows 10 Fall Creators Update (Version 1709) Note:**
|
||||
|
||||
[**Snoretoast**](https://github.com/KDE/snoretoast) is used to get native Windows Toasts!
|
||||
|
||||
The default behaviour is to have the underlying toaster applicaton as `appID`.
|
||||
This works as expected, but shows `SnoreToast` as text in the notification.
|
||||
|
||||
With the Fall Creators Update, Notifications on Windows 10 will only work as
|
||||
expected if a valid `appID` is specified. Your `appID` must be exactly the same
|
||||
value that was registered during the installation of your app.
|
||||
|
||||
You can find the ID of your App by searching the registry for the `appID` you
|
||||
specified at installation of your app. For example: If you use the squirrel
|
||||
framework, your `appID` will be something like `com.squirrel.your.app`.
|
||||
|
||||
```javascript
|
||||
const WindowsToaster = require('node-notifier').WindowsToaster;
|
||||
|
||||
var notifier = new WindowsToaster({
|
||||
withFallback: false, // Fallback to Growl or Balloons?
|
||||
customPath: undefined // Relative/Absolute path if you want to use your fork of SnoreToast.exe
|
||||
});
|
||||
|
||||
notifier.notify(
|
||||
{
|
||||
title: undefined, // String. Required
|
||||
message: undefined, // String. Required if remove is not defined
|
||||
icon: undefined, // String. Absolute path to Icon
|
||||
sound: false, // Bool | String (as defined by http://msdn.microsoft.com/en-us/library/windows/apps/hh761492.aspx)
|
||||
id: undefined, // Number. ID to use for closing notification.
|
||||
appID: undefined, // String. App.ID and app Name. Defaults to no value, causing SnoreToast text to be visible.
|
||||
remove: undefined, // Number. Refer to previously created notification to close.
|
||||
install: undefined // String (path, application, app id). Creates a shortcut <path> in the start menu which point to the executable <application>, appID used for the notifications.
|
||||
},
|
||||
function (error, response) {
|
||||
console.log(response);
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
### Usage: `Growl`
|
||||
|
||||
```javascript
|
||||
const Growl = require('node-notifier').Growl;
|
||||
|
||||
var notifier = new Growl({
|
||||
name: 'Growl Name Used', // Defaults as 'Node'
|
||||
host: 'localhost',
|
||||
port: 23053
|
||||
});
|
||||
|
||||
notifier.notify({
|
||||
title: 'Foo',
|
||||
message: 'Hello World',
|
||||
icon: fs.readFileSync(__dirname + '/coulson.jpg'),
|
||||
wait: false, // Wait for User Action against Notification
|
||||
|
||||
// and other growl options like sticky etc.
|
||||
sticky: false,
|
||||
label: undefined,
|
||||
priority: undefined
|
||||
});
|
||||
```
|
||||
|
||||
See more information about using [growly](https://github.com/theabraham/growly/).
|
||||
|
||||
### Usage: `WindowsBalloon`
|
||||
|
||||
For earlier versions of Windows, taskbar balloons are used (unless
|
||||
fallback is activated and Growl is running). The balloons notifier uses a great
|
||||
project called [**`notifu`**](http://www.paralint.com/projects/notifu/).
|
||||
|
||||
```javascript
|
||||
const WindowsBalloon = require('node-notifier').WindowsBalloon;
|
||||
|
||||
var notifier = new WindowsBalloon({
|
||||
withFallback: false, // Try Windows Toast and Growl first?
|
||||
customPath: undefined // Relative/Absolute path if you want to use your fork of notifu
|
||||
});
|
||||
|
||||
notifier.notify(
|
||||
{
|
||||
title: undefined,
|
||||
message: undefined,
|
||||
sound: false, // true | false.
|
||||
time: 5000, // How long to show balloon in ms
|
||||
wait: false, // Wait for User Action against Notification
|
||||
type: 'info' // The notification type : info | warn | error
|
||||
},
|
||||
function (error, response) {
|
||||
console.log(response);
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
See full usage on the [project homepage: **`notifu`**](http://www.paralint.com/projects/notifu/).
|
||||
|
||||
### Usage: `NotifySend`
|
||||
|
||||
**Note:** `notify-send` doesn't support the `wait` flag.
|
||||
|
||||
```javascript
|
||||
const NotifySend = require('node-notifier').NotifySend;
|
||||
|
||||
var notifier = new NotifySend();
|
||||
|
||||
notifier.notify({
|
||||
title: 'Foo',
|
||||
message: 'Hello World',
|
||||
icon: __dirname + '/coulson.jpg',
|
||||
|
||||
wait: false, // Defaults no exipre time set. If true expire time of 5 seconds is used
|
||||
timeout: 10, // Alias for expire-time, time etc. Time before notify-send expires. Defaults to 10 seconds.
|
||||
|
||||
// .. and other notify-send flags:
|
||||
'app-name': 'node-notifier',
|
||||
urgency: undefined,
|
||||
category: undefined,
|
||||
hint: undefined
|
||||
});
|
||||
```
|
||||
|
||||
See flags and options on the man page [`notify-send(1)`](http://manpages.ubuntu.com/manpages/gutsy/man1/notify-send.1.html)
|
||||
|
||||
## Thanks to OSS
|
||||
|
||||
`node-notifier` is made possible through Open Source Software.
|
||||
A very special thanks to all the modules `node-notifier` uses.
|
||||
|
||||
- [`terminal-notifier`](https://github.com/julienXX/terminal-notifier)
|
||||
- [`Snoretoast`](https://github.com/KDE/snoretoast)
|
||||
- [`notifu`](http://www.paralint.com/projects/notifu/)
|
||||
- [`growly`](https://github.com/theabraham/growly/)
|
||||
|
||||
[![NPM downloads][npm-downloads]][npm-url]
|
||||
|
||||
## Common Issues
|
||||
|
||||
### Windows: `SnoreToast` text
|
||||
|
||||
See note on "Windows 10 Fall Creators Update" in Windows section.
|
||||
_**Short answer:** update your `appID`._
|
||||
|
||||
### Use inside tmux session
|
||||
|
||||
When using `node-notifier` within a tmux session, it can cause a hang in the system.
|
||||
This can be solved by following the steps described in [this comment](https://github.com/julienXX/terminal-notifier/issues/115#issuecomment-104214742)
|
||||
|
||||
There’s even more info [here](https://github.com/mikaelbr/node-notifier/issues/61#issuecomment-163560801)
|
||||
<https://github.com/mikaelbr/node-notifier/issues/61#issuecomment-163560801>.
|
||||
|
||||
### macOS: Custom icon without Terminal icon
|
||||
|
||||
Even if you define an icon in the configuration object for `node-notifier`, you will
|
||||
see a small Terminal icon in the notification (see the example at the top of this
|
||||
document).
|
||||
|
||||
This is the way notifications on macOS work. They always show the icon of the
|
||||
parent application initiating the notification. For `node-notifier`, `terminal-notifier`
|
||||
is the initiator, and it has the Terminal icon defined as its icon.
|
||||
|
||||
To define your custom icon, you need to fork `terminal-notifier` and build your
|
||||
custom version with your icon.
|
||||
|
||||
See [Issue #71 for more info](https://github.com/mikaelbr/node-notifier/issues/71)
|
||||
<https://github.com/mikaelbr/node-notifier/issues/71>.
|
||||
|
||||
### Within Electron Packaging
|
||||
|
||||
If packaging your Electron app as an `asar`, you will find `node-notifier` will fail to load.
|
||||
|
||||
Due to the way asar works, you cannot execute a binary from within an `asar`.
|
||||
As a simple solution, when packaging the app into an asar please make sure you
|
||||
`--unpack` the `vendor/` folder of `node-notifier`, so the module still has access to
|
||||
the notification binaries.
|
||||
|
||||
You can do so with the following command:
|
||||
|
||||
```bash
|
||||
asar pack . app.asar --unpack "./node_modules/node-notifier/vendor/**"
|
||||
```
|
||||
|
||||
### Using with pkg
|
||||
|
||||
For issues using with the pkg module. Check this issue out: https://github.com/mikaelbr/node-notifier/issues/220#issuecomment-425963752
|
||||
|
||||
### Using Webpack
|
||||
|
||||
When using `node-notifier` inside of `webpack`, you must add the snippet below to your `webpack.config.js`.
|
||||
|
||||
This is necessary because `node-notifier` loads the notifiers from a binary, so it
|
||||
needs a relative file path. When webpack compiles the modules, it supresses file
|
||||
directories, causing `node-notifier` to error on certain platforms.
|
||||
|
||||
To fix this, you can configure webpack to keep the relative file directories.
|
||||
Do so by append the following code to your `webpack.config.js`:
|
||||
|
||||
```javascript
|
||||
node: {
|
||||
__filename: true,
|
||||
__dirname: true
|
||||
}
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
This package is licensed using the [MIT License](http://en.wikipedia.org/wiki/MIT_License).
|
||||
|
||||
[SnoreToast](https://raw.githubusercontent.com/mikaelbr/node-notifier/master/vendor/snoreToast/LICENSE) and [Notifu](https://raw.githubusercontent.com/mikaelbr/node-notifier/master/vendor/notifu/LICENSE) have licenses in their vendored versions which do not match the MIT license, LGPL-3 and BSD 3-Clause to be specific. We are not lawyers, but have made our best efforts to conform to the terms in those licenses while releasing this package using the license we chose.
|
||||
|
||||
[npm-url]: https://npmjs.org/package/node-notifier
|
||||
[npm-image]: http://img.shields.io/npm/v/node-notifier.svg?style=flat
|
||||
[npm-downloads]: http://img.shields.io/npm/dm/node-notifier.svg?style=flat
|
||||
[travis-url]: http://travis-ci.org/mikaelbr/node-notifier
|
||||
[travis-image]: http://img.shields.io/travis/mikaelbr/node-notifier.svg?style=flat
|
||||
52
node_modules/node-notifier/index.js
generated
vendored
Normal file
52
node_modules/node-notifier/index.js
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
var os = require('os');
|
||||
var utils = require('./lib/utils');
|
||||
|
||||
// All notifiers
|
||||
var NotifySend = require('./notifiers/notifysend');
|
||||
var NotificationCenter = require('./notifiers/notificationcenter');
|
||||
var WindowsToaster = require('./notifiers/toaster');
|
||||
var Growl = require('./notifiers/growl');
|
||||
var WindowsBalloon = require('./notifiers/balloon');
|
||||
|
||||
var options = { withFallback: true };
|
||||
|
||||
var osType = utils.isWSL() ? 'WSL' : os.type();
|
||||
|
||||
switch (osType) {
|
||||
case 'Linux':
|
||||
module.exports = new NotifySend(options);
|
||||
module.exports.Notification = NotifySend;
|
||||
break;
|
||||
case 'Darwin':
|
||||
module.exports = new NotificationCenter(options);
|
||||
module.exports.Notification = NotificationCenter;
|
||||
break;
|
||||
case 'Windows_NT':
|
||||
if (utils.isLessThanWin8()) {
|
||||
module.exports = new WindowsBalloon(options);
|
||||
module.exports.Notification = WindowsBalloon;
|
||||
} else {
|
||||
module.exports = new WindowsToaster(options);
|
||||
module.exports.Notification = WindowsToaster;
|
||||
}
|
||||
break;
|
||||
case 'WSL':
|
||||
module.exports = new WindowsToaster(options);
|
||||
module.exports.Notification = WindowsToaster;
|
||||
break;
|
||||
default:
|
||||
if (os.type().match(/BSD$/)) {
|
||||
module.exports = new NotifySend(options);
|
||||
module.exports.Notification = NotifySend;
|
||||
} else {
|
||||
module.exports = new Growl(options);
|
||||
module.exports.Notification = Growl;
|
||||
}
|
||||
}
|
||||
|
||||
// Expose notifiers to give full control.
|
||||
module.exports.NotifySend = NotifySend;
|
||||
module.exports.NotificationCenter = NotificationCenter;
|
||||
module.exports.WindowsToaster = WindowsToaster;
|
||||
module.exports.WindowsBalloon = WindowsBalloon;
|
||||
module.exports.Growl = Growl;
|
||||
24
node_modules/node-notifier/lib/checkGrowl.js
generated
vendored
Normal file
24
node_modules/node-notifier/lib/checkGrowl.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
var net = require('net');
|
||||
|
||||
var hasGrowl = false;
|
||||
module.exports = function(growlConfig, cb) {
|
||||
if (typeof cb === 'undefined') {
|
||||
cb = growlConfig;
|
||||
growlConfig = {};
|
||||
}
|
||||
if (hasGrowl) return cb(null, hasGrowl);
|
||||
var port = growlConfig.port || 23053;
|
||||
var host = growlConfig.host || 'localhost';
|
||||
var socket = net.connect(port, host);
|
||||
socket.setTimeout(100);
|
||||
|
||||
socket.once('connect', function() {
|
||||
socket.end();
|
||||
cb(null, true);
|
||||
});
|
||||
|
||||
socket.once('error', function() {
|
||||
socket.end();
|
||||
cb(null, false);
|
||||
});
|
||||
};
|
||||
570
node_modules/node-notifier/lib/utils.js
generated
vendored
Normal file
570
node_modules/node-notifier/lib/utils.js
generated
vendored
Normal file
@@ -0,0 +1,570 @@
|
||||
var shellwords = require('shellwords');
|
||||
var cp = require('child_process');
|
||||
var semver = require('semver');
|
||||
var isWSL = require('is-wsl');
|
||||
var path = require('path');
|
||||
var url = require('url');
|
||||
var os = require('os');
|
||||
var fs = require('fs');
|
||||
var net = require('net');
|
||||
|
||||
const BUFFER_SIZE = 1024;
|
||||
|
||||
function clone(obj) {
|
||||
return JSON.parse(JSON.stringify(obj));
|
||||
}
|
||||
|
||||
module.exports.clone = clone;
|
||||
|
||||
var escapeQuotes = function (str) {
|
||||
if (typeof str === 'string') {
|
||||
return str.replace(/(["$`\\])/g, '\\$1');
|
||||
} else {
|
||||
return str;
|
||||
}
|
||||
};
|
||||
|
||||
var inArray = function (arr, val) {
|
||||
return arr.indexOf(val) !== -1;
|
||||
};
|
||||
|
||||
var notifySendFlags = {
|
||||
u: 'urgency',
|
||||
urgency: 'urgency',
|
||||
t: 'expire-time',
|
||||
time: 'expire-time',
|
||||
timeout: 'expire-time',
|
||||
e: 'expire-time',
|
||||
expire: 'expire-time',
|
||||
'expire-time': 'expire-time',
|
||||
i: 'icon',
|
||||
icon: 'icon',
|
||||
c: 'category',
|
||||
category: 'category',
|
||||
subtitle: 'category',
|
||||
h: 'hint',
|
||||
hint: 'hint',
|
||||
a: 'app-name',
|
||||
'app-name': 'app-name'
|
||||
};
|
||||
|
||||
module.exports.command = function (notifier, options, cb) {
|
||||
notifier = shellwords.escape(notifier);
|
||||
if (process.env.DEBUG && process.env.DEBUG.indexOf('notifier') !== -1) {
|
||||
console.info('node-notifier debug info (command):');
|
||||
console.info('[notifier path]', notifier);
|
||||
console.info('[notifier options]', options.join(' '));
|
||||
}
|
||||
|
||||
return cp.exec(notifier + ' ' + options.join(' '), function (
|
||||
error,
|
||||
stdout,
|
||||
stderr
|
||||
) {
|
||||
if (error) return cb(error);
|
||||
cb(stderr, stdout);
|
||||
});
|
||||
};
|
||||
|
||||
module.exports.fileCommand = function (notifier, options, cb) {
|
||||
if (process.env.DEBUG && process.env.DEBUG.indexOf('notifier') !== -1) {
|
||||
console.info('node-notifier debug info (fileCommand):');
|
||||
console.info('[notifier path]', notifier);
|
||||
console.info('[notifier options]', options.join(' '));
|
||||
}
|
||||
|
||||
return cp.execFile(notifier, options, function (error, stdout, stderr) {
|
||||
if (error) return cb(error, stdout);
|
||||
cb(stderr, stdout);
|
||||
});
|
||||
};
|
||||
|
||||
module.exports.fileCommandJson = function (notifier, options, cb) {
|
||||
if (process.env.DEBUG && process.env.DEBUG.indexOf('notifier') !== -1) {
|
||||
console.info('node-notifier debug info (fileCommandJson):');
|
||||
console.info('[notifier path]', notifier);
|
||||
console.info('[notifier options]', options.join(' '));
|
||||
}
|
||||
return cp.execFile(notifier, options, function (error, stdout, stderr) {
|
||||
if (error) return cb(error, stdout);
|
||||
if (!stdout) return cb(error, {});
|
||||
|
||||
try {
|
||||
var data = JSON.parse(stdout);
|
||||
cb(!stderr ? null : stderr, data);
|
||||
} catch (e) {
|
||||
cb(e, stdout);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
module.exports.immediateFileCommand = function (notifier, options, cb) {
|
||||
if (process.env.DEBUG && process.env.DEBUG.indexOf('notifier') !== -1) {
|
||||
console.info('node-notifier debug info (notifier):');
|
||||
console.info('[notifier path]', notifier);
|
||||
}
|
||||
|
||||
notifierExists(notifier, function (_, exists) {
|
||||
if (!exists) {
|
||||
return cb(new Error('Notifier (' + notifier + ') not found on system.'));
|
||||
}
|
||||
cp.execFile(notifier, options);
|
||||
cb();
|
||||
});
|
||||
};
|
||||
|
||||
function notifierExists(notifier, cb) {
|
||||
return fs.stat(notifier, function (err, stat) {
|
||||
if (!err) return cb(err, stat.isFile());
|
||||
|
||||
// Check if Windows alias
|
||||
if (path.extname(notifier)) {
|
||||
// Has extentioon, no need to check more
|
||||
return cb(err, false);
|
||||
}
|
||||
|
||||
// Check if there is an exe file in the directory
|
||||
return fs.stat(notifier + '.exe', function (err, stat) {
|
||||
if (err) return cb(err, false);
|
||||
cb(err, stat.isFile());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
var mapAppIcon = function (options) {
|
||||
if (options.appIcon) {
|
||||
options.icon = options.appIcon;
|
||||
delete options.appIcon;
|
||||
}
|
||||
|
||||
return options;
|
||||
};
|
||||
|
||||
var mapText = function (options) {
|
||||
if (options.text) {
|
||||
options.message = options.text;
|
||||
delete options.text;
|
||||
}
|
||||
|
||||
return options;
|
||||
};
|
||||
|
||||
var mapIconShorthand = function (options) {
|
||||
if (options.i) {
|
||||
options.icon = options.i;
|
||||
delete options.i;
|
||||
}
|
||||
|
||||
return options;
|
||||
};
|
||||
|
||||
module.exports.mapToNotifySend = function (options) {
|
||||
options = mapAppIcon(options);
|
||||
options = mapText(options);
|
||||
|
||||
if (options.timeout === false) {
|
||||
delete options.timeout;
|
||||
}
|
||||
if (options.wait === true) {
|
||||
options['expire-time'] = 5; // 5 seconds default time (multipled below)
|
||||
}
|
||||
for (var key in options) {
|
||||
if (key === 'message' || key === 'title') continue;
|
||||
if (options.hasOwnProperty(key) && notifySendFlags[key] !== key) {
|
||||
options[notifySendFlags[key]] = options[key];
|
||||
delete options[key];
|
||||
}
|
||||
}
|
||||
if (typeof options['expire-time'] === 'undefined') {
|
||||
options['expire-time'] = 10 * 1000; // 10 sec timeout by default
|
||||
} else if (typeof options['expire-time'] === 'number') {
|
||||
options['expire-time'] = options['expire-time'] * 1000; // notify send uses milliseconds
|
||||
}
|
||||
|
||||
return options;
|
||||
};
|
||||
|
||||
module.exports.mapToGrowl = function (options) {
|
||||
options = mapAppIcon(options);
|
||||
options = mapIconShorthand(options);
|
||||
options = mapText(options);
|
||||
|
||||
if (options.icon && !Buffer.isBuffer(options.icon)) {
|
||||
try {
|
||||
options.icon = fs.readFileSync(options.icon);
|
||||
} catch (ex) {}
|
||||
}
|
||||
|
||||
return options;
|
||||
};
|
||||
|
||||
module.exports.mapToMac = function (options) {
|
||||
options = mapIconShorthand(options);
|
||||
options = mapText(options);
|
||||
|
||||
if (options.icon) {
|
||||
options.appIcon = options.icon;
|
||||
delete options.icon;
|
||||
}
|
||||
|
||||
if (options.sound === true) {
|
||||
options.sound = 'Bottle';
|
||||
}
|
||||
|
||||
if (options.sound === false) {
|
||||
delete options.sound;
|
||||
}
|
||||
|
||||
if (options.sound && options.sound.indexOf('Notification.') === 0) {
|
||||
options.sound = 'Bottle';
|
||||
}
|
||||
|
||||
if (options.wait === true) {
|
||||
if (!options.timeout) {
|
||||
options.timeout = 5;
|
||||
}
|
||||
delete options.wait;
|
||||
}
|
||||
|
||||
if (!options.wait && !options.timeout) {
|
||||
if (options.timeout === false) {
|
||||
delete options.timeout;
|
||||
} else {
|
||||
options.timeout = 10;
|
||||
}
|
||||
}
|
||||
|
||||
options.json = true;
|
||||
return options;
|
||||
};
|
||||
|
||||
function isArray(arr) {
|
||||
return Object.prototype.toString.call(arr) === '[object Array]';
|
||||
}
|
||||
module.exports.isArray = isArray;
|
||||
|
||||
function noop() {}
|
||||
module.exports.actionJackerDecorator = function (emitter, options, fn, mapper) {
|
||||
options = clone(options);
|
||||
fn = fn || noop;
|
||||
|
||||
if (typeof fn !== 'function') {
|
||||
throw new TypeError(
|
||||
'The second argument must be a function callback. You have passed ' +
|
||||
typeof fn
|
||||
);
|
||||
}
|
||||
|
||||
return function (err, data) {
|
||||
var resultantData = data;
|
||||
var metadata = {};
|
||||
// Allow for extra data if resultantData is an object
|
||||
if (resultantData && typeof resultantData === 'object') {
|
||||
metadata = resultantData;
|
||||
resultantData = resultantData.activationType;
|
||||
}
|
||||
|
||||
// Sanitize the data
|
||||
if (resultantData) {
|
||||
resultantData = resultantData.toLowerCase().trim();
|
||||
if (resultantData.match(/^activate|clicked$/)) {
|
||||
resultantData = 'activate';
|
||||
}
|
||||
if (resultantData.match(/^timedout$/)) {
|
||||
resultantData = 'timeout';
|
||||
}
|
||||
}
|
||||
|
||||
fn.apply(emitter, [err, resultantData, metadata]);
|
||||
if (!mapper || !resultantData) return;
|
||||
|
||||
var key = mapper(resultantData);
|
||||
if (!key) return;
|
||||
emitter.emit(key, emitter, options, metadata);
|
||||
};
|
||||
};
|
||||
|
||||
module.exports.constructArgumentList = function (options, extra) {
|
||||
var args = [];
|
||||
extra = extra || {};
|
||||
|
||||
// Massive ugly setup. Default args
|
||||
var initial = extra.initial || [];
|
||||
var keyExtra = extra.keyExtra || '';
|
||||
var allowedArguments = extra.allowedArguments || [];
|
||||
var noEscape = extra.noEscape !== undefined;
|
||||
var checkForAllowed = extra.allowedArguments !== undefined;
|
||||
var explicitTrue = !!extra.explicitTrue;
|
||||
var keepNewlines = !!extra.keepNewlines;
|
||||
var wrapper = extra.wrapper === undefined ? '"' : extra.wrapper;
|
||||
|
||||
var escapeFn = function (arg) {
|
||||
if (isArray(arg)) {
|
||||
return removeNewLines(arg.join(','));
|
||||
}
|
||||
|
||||
if (!noEscape) {
|
||||
arg = escapeQuotes(arg);
|
||||
}
|
||||
if (typeof arg === 'string' && !keepNewlines) {
|
||||
arg = removeNewLines(arg);
|
||||
}
|
||||
return wrapper + arg + wrapper;
|
||||
};
|
||||
|
||||
initial.forEach(function (val) {
|
||||
if (typeof val === 'string') {
|
||||
args.push(escapeFn(val));
|
||||
}
|
||||
});
|
||||
for (var key in options) {
|
||||
if (
|
||||
options.hasOwnProperty(key) &&
|
||||
(!checkForAllowed || inArray(allowedArguments, key))
|
||||
) {
|
||||
if (explicitTrue && options[key] === true) {
|
||||
args.push('-' + keyExtra + key);
|
||||
} else if (explicitTrue && options[key] === false) continue;
|
||||
else args.push('-' + keyExtra + key, escapeFn(options[key]));
|
||||
}
|
||||
}
|
||||
return args;
|
||||
};
|
||||
|
||||
function removeNewLines(str) {
|
||||
var excapedNewline = process.platform === 'win32' ? '\\r\\n' : '\\n';
|
||||
return str.replace(/\r?\n/g, excapedNewline);
|
||||
}
|
||||
|
||||
/*
|
||||
---- Options ----
|
||||
[-t] <title string> | Displayed on the first line of the toast.
|
||||
[-m] <message string> | Displayed on the remaining lines, wrapped.
|
||||
[-b] <button1;button2 string>| Displayed on the bottom line, can list multiple buttons separated by ";"
|
||||
[-tb] | Displayed a textbox on the bottom line, only if buttons are not presented.
|
||||
[-p] <image URI> | Display toast with an image, local files only.
|
||||
[-id] <id> | sets the id for a notification to be able to close it later.
|
||||
[-s] <sound URI> | Sets the sound of the notifications, for possible values see http://msdn.microsoft.com/en-us/library/windows/apps/hh761492.aspx.
|
||||
[-silent] | Don't play a sound file when showing the notifications.
|
||||
[-appID] <App.ID> | Don't create a shortcut but use the provided app id.
|
||||
[-pid] <pid> | Query the appid for the process <pid>, use -appID as fallback. (Only relevant for applications that might be packaged for the store)
|
||||
[-pipeName] <\.\pipe\pipeName\> | Provide a name pipe which is used for callbacks.
|
||||
[-application] <C:\foo.exe> | Provide a application that might be started if the pipe does not exist.
|
||||
-close <id> | Closes a currently displayed notification.
|
||||
*/
|
||||
var allowedToasterFlags = [
|
||||
't',
|
||||
'm',
|
||||
'b',
|
||||
'tb',
|
||||
'p',
|
||||
'id',
|
||||
's',
|
||||
'silent',
|
||||
'appID',
|
||||
'pid',
|
||||
'pipeName',
|
||||
'close',
|
||||
'install'
|
||||
];
|
||||
var toasterSoundPrefix = 'Notification.';
|
||||
var toasterDefaultSound = 'Notification.Default';
|
||||
module.exports.mapToWin8 = function (options) {
|
||||
options = mapAppIcon(options);
|
||||
options = mapText(options);
|
||||
|
||||
if (options.icon) {
|
||||
if (/^file:\/+/.test(options.icon)) {
|
||||
// should parse file protocol URL to path
|
||||
options.p = new url.URL(options.icon).pathname
|
||||
.replace(/^\/(\w:\/)/, '$1')
|
||||
.replace(/\//g, '\\');
|
||||
} else {
|
||||
options.p = options.icon;
|
||||
}
|
||||
delete options.icon;
|
||||
}
|
||||
|
||||
if (options.message) {
|
||||
// Remove escape char to debug "HRESULT : 0xC00CE508" exception
|
||||
options.m = options.message.replace(/\x1b/g, '');
|
||||
delete options.message;
|
||||
}
|
||||
|
||||
if (options.title) {
|
||||
options.t = options.title;
|
||||
delete options.title;
|
||||
}
|
||||
|
||||
if (options.appName) {
|
||||
options.appID = options.appName;
|
||||
delete options.appName;
|
||||
}
|
||||
|
||||
if (typeof options.remove !== 'undefined') {
|
||||
options.close = options.remove;
|
||||
delete options.remove;
|
||||
}
|
||||
|
||||
if (options.quiet || options.silent) {
|
||||
options.silent = options.quiet || options.silent;
|
||||
delete options.quiet;
|
||||
}
|
||||
|
||||
if (typeof options.sound !== 'undefined') {
|
||||
options.s = options.sound;
|
||||
delete options.sound;
|
||||
}
|
||||
|
||||
if (options.s === false) {
|
||||
options.silent = true;
|
||||
delete options.s;
|
||||
}
|
||||
|
||||
// Silent takes precedence. Remove sound.
|
||||
if (options.s && options.silent) {
|
||||
delete options.s;
|
||||
}
|
||||
|
||||
if (options.s === true) {
|
||||
options.s = toasterDefaultSound;
|
||||
}
|
||||
|
||||
if (options.s && options.s.indexOf(toasterSoundPrefix) !== 0) {
|
||||
options.s = toasterDefaultSound;
|
||||
}
|
||||
|
||||
if (options.actions && isArray(options.actions)) {
|
||||
options.b = options.actions.join(';');
|
||||
delete options.actions;
|
||||
}
|
||||
|
||||
for (var key in options) {
|
||||
// Check if is allowed. If not, delete!
|
||||
if (
|
||||
options.hasOwnProperty(key) &&
|
||||
allowedToasterFlags.indexOf(key) === -1
|
||||
) {
|
||||
delete options[key];
|
||||
}
|
||||
}
|
||||
|
||||
return options;
|
||||
};
|
||||
|
||||
module.exports.mapToNotifu = function (options) {
|
||||
options = mapAppIcon(options);
|
||||
options = mapText(options);
|
||||
|
||||
if (options.icon) {
|
||||
options.i = options.icon;
|
||||
delete options.icon;
|
||||
}
|
||||
|
||||
if (options.message) {
|
||||
options.m = options.message;
|
||||
delete options.message;
|
||||
}
|
||||
|
||||
if (options.title) {
|
||||
options.p = options.title;
|
||||
delete options.title;
|
||||
}
|
||||
|
||||
if (options.time) {
|
||||
options.d = options.time;
|
||||
delete options.time;
|
||||
}
|
||||
|
||||
if (options.q !== false) {
|
||||
options.q = true;
|
||||
} else {
|
||||
delete options.q;
|
||||
}
|
||||
|
||||
if (options.quiet === false) {
|
||||
delete options.q;
|
||||
delete options.quiet;
|
||||
}
|
||||
|
||||
if (options.sound) {
|
||||
delete options.q;
|
||||
delete options.sound;
|
||||
}
|
||||
|
||||
if (options.t) {
|
||||
options.d = options.t;
|
||||
delete options.t;
|
||||
}
|
||||
|
||||
if (options.type) {
|
||||
options.t = sanitizeNotifuTypeArgument(options.type);
|
||||
delete options.type;
|
||||
}
|
||||
|
||||
return options;
|
||||
};
|
||||
|
||||
module.exports.isMac = function () {
|
||||
return os.type() === 'Darwin';
|
||||
};
|
||||
|
||||
module.exports.isMountainLion = function () {
|
||||
return (
|
||||
os.type() === 'Darwin' &&
|
||||
semver.satisfies(garanteeSemverFormat(os.release()), '>=12.0.0')
|
||||
);
|
||||
};
|
||||
|
||||
module.exports.isWin8 = function () {
|
||||
return (
|
||||
os.type() === 'Windows_NT' &&
|
||||
semver.satisfies(garanteeSemverFormat(os.release()), '>=6.2.9200')
|
||||
);
|
||||
};
|
||||
|
||||
module.exports.isWSL = function () {
|
||||
return isWSL;
|
||||
};
|
||||
|
||||
module.exports.isLessThanWin8 = function () {
|
||||
return (
|
||||
os.type() === 'Windows_NT' &&
|
||||
semver.satisfies(garanteeSemverFormat(os.release()), '<6.2.9200')
|
||||
);
|
||||
};
|
||||
|
||||
function garanteeSemverFormat(version) {
|
||||
if (version.split('.').length === 2) {
|
||||
version += '.0';
|
||||
}
|
||||
return version;
|
||||
}
|
||||
|
||||
function sanitizeNotifuTypeArgument(type) {
|
||||
if (typeof type === 'string' || type instanceof String) {
|
||||
if (type.toLowerCase() === 'info') return 'info';
|
||||
if (type.toLowerCase() === 'warn') return 'warn';
|
||||
if (type.toLowerCase() === 'error') return 'error';
|
||||
}
|
||||
|
||||
return 'info';
|
||||
}
|
||||
|
||||
module.exports.createNamedPipe = (server) => {
|
||||
const buf = Buffer.alloc(BUFFER_SIZE);
|
||||
|
||||
return new Promise((resolve) => {
|
||||
server.instance = net.createServer((stream) => {
|
||||
stream.on('data', (c) => {
|
||||
buf.write(c.toString());
|
||||
});
|
||||
stream.on('end', () => {
|
||||
server.instance.close();
|
||||
});
|
||||
});
|
||||
server.instance.listen(server.namedPipe, () => {
|
||||
resolve(buf);
|
||||
});
|
||||
});
|
||||
};
|
||||
1
node_modules/node-notifier/node_modules/.bin/node-which
generated
vendored
Symbolic link
1
node_modules/node-notifier/node_modules/.bin/node-which
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../which/bin/node-which
|
||||
1
node_modules/node-notifier/node_modules/.bin/semver
generated
vendored
Symbolic link
1
node_modules/node-notifier/node_modules/.bin/semver
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../semver/bin/semver.js
|
||||
1
node_modules/node-notifier/node_modules/.bin/uuid
generated
vendored
Symbolic link
1
node_modules/node-notifier/node_modules/.bin/uuid
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../uuid/dist/bin/uuid
|
||||
111
node_modules/node-notifier/node_modules/semver/CHANGELOG.md
generated
vendored
Normal file
111
node_modules/node-notifier/node_modules/semver/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
# changes log
|
||||
|
||||
## 7.3.0
|
||||
|
||||
* Add `subset(r1, r2)` method to determine if `r1` range is entirely
|
||||
contained by `r2` range.
|
||||
|
||||
## 7.2.3
|
||||
|
||||
* Fix handling of `includePrelease` mode where version ranges like `1.0.0 -
|
||||
2.0.0` would include `3.0.0-pre` and not `1.0.0-pre`.
|
||||
|
||||
## 7.2.2
|
||||
|
||||
* Fix bug where `2.0.0-pre` would be included in `^1.0.0` if
|
||||
`includePrerelease` was set to true.
|
||||
|
||||
## 7.2.0
|
||||
|
||||
* Add `simplifyRange` method to attempt to generate a more human-readable
|
||||
range expression that is equivalent to a supplied range, for a given set
|
||||
of versions.
|
||||
|
||||
## 7.1.2
|
||||
|
||||
* Remove fancy lazy-loading logic, as it was causing problems for webpack
|
||||
users.
|
||||
|
||||
## 7.1.0
|
||||
|
||||
* Add `require('semver/preload')` to load the entire module without using
|
||||
lazy getter methods.
|
||||
|
||||
## 7.0.0
|
||||
|
||||
* Refactor module into separate files for better tree-shaking
|
||||
* Drop support for very old node versions, use const/let, `=>` functions,
|
||||
and classes.
|
||||
|
||||
## 6.3.0
|
||||
|
||||
* Expose the token enum on the exports
|
||||
|
||||
## 6.2.0
|
||||
|
||||
* Coerce numbers to strings when passed to semver.coerce()
|
||||
* Add `rtl` option to coerce from right to left
|
||||
|
||||
## 6.1.3
|
||||
|
||||
* Handle X-ranges properly in includePrerelease mode
|
||||
|
||||
## 6.1.2
|
||||
|
||||
* Do not throw when testing invalid version strings
|
||||
|
||||
## 6.1.1
|
||||
|
||||
* Add options support for semver.coerce()
|
||||
* Handle undefined version passed to Range.test
|
||||
|
||||
## 6.1.0
|
||||
|
||||
* Add semver.compareBuild function
|
||||
* Support `*` in semver.intersects
|
||||
|
||||
## 6.0
|
||||
|
||||
* Fix `intersects` logic.
|
||||
|
||||
This is technically a bug fix, but since it is also a change to behavior
|
||||
that may require users updating their code, it is marked as a major
|
||||
version increment.
|
||||
|
||||
## 5.7
|
||||
|
||||
* Add `minVersion` method
|
||||
|
||||
## 5.6
|
||||
|
||||
* Move boolean `loose` param to an options object, with
|
||||
backwards-compatibility protection.
|
||||
* Add ability to opt out of special prerelease version handling with
|
||||
the `includePrerelease` option flag.
|
||||
|
||||
## 5.5
|
||||
|
||||
* Add version coercion capabilities
|
||||
|
||||
## 5.4
|
||||
|
||||
* Add intersection checking
|
||||
|
||||
## 5.3
|
||||
|
||||
* Add `minSatisfying` method
|
||||
|
||||
## 5.2
|
||||
|
||||
* Add `prerelease(v)` that returns prerelease components
|
||||
|
||||
## 5.1
|
||||
|
||||
* Add Backus-Naur for ranges
|
||||
* Remove excessively cute inspection methods
|
||||
|
||||
## 5.0
|
||||
|
||||
* Remove AMD/Browserified build artifacts
|
||||
* Fix ltr and gtr when using the `*` range
|
||||
* Fix for range `*` with a prerelease identifier
|
||||
15
node_modules/node-notifier/node_modules/semver/LICENSE
generated
vendored
Normal file
15
node_modules/node-notifier/node_modules/semver/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
566
node_modules/node-notifier/node_modules/semver/README.md
generated
vendored
Normal file
566
node_modules/node-notifier/node_modules/semver/README.md
generated
vendored
Normal file
@@ -0,0 +1,566 @@
|
||||
semver(1) -- The semantic versioner for npm
|
||||
===========================================
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
npm install semver
|
||||
````
|
||||
|
||||
## Usage
|
||||
|
||||
As a node module:
|
||||
|
||||
```js
|
||||
const semver = require('semver')
|
||||
|
||||
semver.valid('1.2.3') // '1.2.3'
|
||||
semver.valid('a.b.c') // null
|
||||
semver.clean(' =v1.2.3 ') // '1.2.3'
|
||||
semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true
|
||||
semver.gt('1.2.3', '9.8.7') // false
|
||||
semver.lt('1.2.3', '9.8.7') // true
|
||||
semver.minVersion('>=1.0.0') // '1.0.0'
|
||||
semver.valid(semver.coerce('v2')) // '2.0.0'
|
||||
semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7'
|
||||
```
|
||||
|
||||
You can also just load the module for the function that you care about, if
|
||||
you'd like to minimize your footprint.
|
||||
|
||||
```js
|
||||
// load the whole API at once in a single object
|
||||
const semver = require('semver')
|
||||
|
||||
// or just load the bits you need
|
||||
// all of them listed here, just pick and choose what you want
|
||||
|
||||
// classes
|
||||
const SemVer = require('semver/classes/semver')
|
||||
const Comparator = require('semver/classes/comparator')
|
||||
const Range = require('semver/classes/range')
|
||||
|
||||
// functions for working with versions
|
||||
const semverParse = require('semver/functions/parse')
|
||||
const semverValid = require('semver/functions/valid')
|
||||
const semverClean = require('semver/functions/clean')
|
||||
const semverInc = require('semver/functions/inc')
|
||||
const semverDiff = require('semver/functions/diff')
|
||||
const semverMajor = require('semver/functions/major')
|
||||
const semverMinor = require('semver/functions/minor')
|
||||
const semverPatch = require('semver/functions/patch')
|
||||
const semverPrerelease = require('semver/functions/prerelease')
|
||||
const semverCompare = require('semver/functions/compare')
|
||||
const semverRcompare = require('semver/functions/rcompare')
|
||||
const semverCompareLoose = require('semver/functions/compare-loose')
|
||||
const semverCompareBuild = require('semver/functions/compare-build')
|
||||
const semverSort = require('semver/functions/sort')
|
||||
const semverRsort = require('semver/functions/rsort')
|
||||
|
||||
// low-level comparators between versions
|
||||
const semverGt = require('semver/functions/gt')
|
||||
const semverLt = require('semver/functions/lt')
|
||||
const semverEq = require('semver/functions/eq')
|
||||
const semverNeq = require('semver/functions/neq')
|
||||
const semverGte = require('semver/functions/gte')
|
||||
const semverLte = require('semver/functions/lte')
|
||||
const semverCmp = require('semver/functions/cmp')
|
||||
const semverCoerce = require('semver/functions/coerce')
|
||||
|
||||
// working with ranges
|
||||
const semverSatisfies = require('semver/functions/satisfies')
|
||||
const semverMaxSatisfying = require('semver/ranges/max-satisfying')
|
||||
const semverMinSatisfying = require('semver/ranges/min-satisfying')
|
||||
const semverToComparators = require('semver/ranges/to-comparators')
|
||||
const semverMinVersion = require('semver/ranges/min-version')
|
||||
const semverValidRange = require('semver/ranges/valid')
|
||||
const semverOutside = require('semver/ranges/outside')
|
||||
const semverGtr = require('semver/ranges/gtr')
|
||||
const semverLtr = require('semver/ranges/ltr')
|
||||
const semverIntersects = require('semver/ranges/intersects')
|
||||
const simplifyRange = require('semver/ranges/simplify')
|
||||
const rangeSubset = require('semver/ranges/subset')
|
||||
```
|
||||
|
||||
As a command-line utility:
|
||||
|
||||
```
|
||||
$ semver -h
|
||||
|
||||
A JavaScript implementation of the https://semver.org/ specification
|
||||
Copyright Isaac Z. Schlueter
|
||||
|
||||
Usage: semver [options] <version> [<version> [...]]
|
||||
Prints valid versions sorted by SemVer precedence
|
||||
|
||||
Options:
|
||||
-r --range <range>
|
||||
Print versions that match the specified range.
|
||||
|
||||
-i --increment [<level>]
|
||||
Increment a version by the specified level. Level can
|
||||
be one of: major, minor, patch, premajor, preminor,
|
||||
prepatch, or prerelease. Default level is 'patch'.
|
||||
Only one version may be specified.
|
||||
|
||||
--preid <identifier>
|
||||
Identifier to be used to prefix premajor, preminor,
|
||||
prepatch or prerelease version increments.
|
||||
|
||||
-l --loose
|
||||
Interpret versions and ranges loosely
|
||||
|
||||
-p --include-prerelease
|
||||
Always include prerelease versions in range matching
|
||||
|
||||
-c --coerce
|
||||
Coerce a string into SemVer if possible
|
||||
(does not imply --loose)
|
||||
|
||||
--rtl
|
||||
Coerce version strings right to left
|
||||
|
||||
--ltr
|
||||
Coerce version strings left to right (default)
|
||||
|
||||
Program exits successfully if any valid version satisfies
|
||||
all supplied ranges, and prints all satisfying versions.
|
||||
|
||||
If no satisfying versions are found, then exits failure.
|
||||
|
||||
Versions are printed in ascending order, so supplying
|
||||
multiple versions to the utility will just sort them.
|
||||
```
|
||||
|
||||
## Versions
|
||||
|
||||
A "version" is described by the `v2.0.0` specification found at
|
||||
<https://semver.org/>.
|
||||
|
||||
A leading `"="` or `"v"` character is stripped off and ignored.
|
||||
|
||||
## Ranges
|
||||
|
||||
A `version range` is a set of `comparators` which specify versions
|
||||
that satisfy the range.
|
||||
|
||||
A `comparator` is composed of an `operator` and a `version`. The set
|
||||
of primitive `operators` is:
|
||||
|
||||
* `<` Less than
|
||||
* `<=` Less than or equal to
|
||||
* `>` Greater than
|
||||
* `>=` Greater than or equal to
|
||||
* `=` Equal. If no operator is specified, then equality is assumed,
|
||||
so this operator is optional, but MAY be included.
|
||||
|
||||
For example, the comparator `>=1.2.7` would match the versions
|
||||
`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6`
|
||||
or `1.1.0`.
|
||||
|
||||
Comparators can be joined by whitespace to form a `comparator set`,
|
||||
which is satisfied by the **intersection** of all of the comparators
|
||||
it includes.
|
||||
|
||||
A range is composed of one or more comparator sets, joined by `||`. A
|
||||
version matches a range if and only if every comparator in at least
|
||||
one of the `||`-separated comparator sets is satisfied by the version.
|
||||
|
||||
For example, the range `>=1.2.7 <1.3.0` would match the versions
|
||||
`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`,
|
||||
or `1.1.0`.
|
||||
|
||||
The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`,
|
||||
`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`.
|
||||
|
||||
### Prerelease Tags
|
||||
|
||||
If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then
|
||||
it will only be allowed to satisfy comparator sets if at least one
|
||||
comparator with the same `[major, minor, patch]` tuple also has a
|
||||
prerelease tag.
|
||||
|
||||
For example, the range `>1.2.3-alpha.3` would be allowed to match the
|
||||
version `1.2.3-alpha.7`, but it would *not* be satisfied by
|
||||
`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater
|
||||
than" `1.2.3-alpha.3` according to the SemVer sort rules. The version
|
||||
range only accepts prerelease tags on the `1.2.3` version. The
|
||||
version `3.4.5` *would* satisfy the range, because it does not have a
|
||||
prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`.
|
||||
|
||||
The purpose for this behavior is twofold. First, prerelease versions
|
||||
frequently are updated very quickly, and contain many breaking changes
|
||||
that are (by the author's design) not yet fit for public consumption.
|
||||
Therefore, by default, they are excluded from range matching
|
||||
semantics.
|
||||
|
||||
Second, a user who has opted into using a prerelease version has
|
||||
clearly indicated the intent to use *that specific* set of
|
||||
alpha/beta/rc versions. By including a prerelease tag in the range,
|
||||
the user is indicating that they are aware of the risk. However, it
|
||||
is still not appropriate to assume that they have opted into taking a
|
||||
similar risk on the *next* set of prerelease versions.
|
||||
|
||||
Note that this behavior can be suppressed (treating all prerelease
|
||||
versions as if they were normal versions, for the purpose of range
|
||||
matching) by setting the `includePrerelease` flag on the options
|
||||
object to any
|
||||
[functions](https://github.com/npm/node-semver#functions) that do
|
||||
range matching.
|
||||
|
||||
#### Prerelease Identifiers
|
||||
|
||||
The method `.inc` takes an additional `identifier` string argument that
|
||||
will append the value of the string as a prerelease identifier:
|
||||
|
||||
```javascript
|
||||
semver.inc('1.2.3', 'prerelease', 'beta')
|
||||
// '1.2.4-beta.0'
|
||||
```
|
||||
|
||||
command-line example:
|
||||
|
||||
```bash
|
||||
$ semver 1.2.3 -i prerelease --preid beta
|
||||
1.2.4-beta.0
|
||||
```
|
||||
|
||||
Which then can be used to increment further:
|
||||
|
||||
```bash
|
||||
$ semver 1.2.4-beta.0 -i prerelease
|
||||
1.2.4-beta.1
|
||||
```
|
||||
|
||||
### Advanced Range Syntax
|
||||
|
||||
Advanced range syntax desugars to primitive comparators in
|
||||
deterministic ways.
|
||||
|
||||
Advanced ranges may be combined in the same way as primitive
|
||||
comparators using white space or `||`.
|
||||
|
||||
#### Hyphen Ranges `X.Y.Z - A.B.C`
|
||||
|
||||
Specifies an inclusive set.
|
||||
|
||||
* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`
|
||||
|
||||
If a partial version is provided as the first version in the inclusive
|
||||
range, then the missing pieces are replaced with zeroes.
|
||||
|
||||
* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4`
|
||||
|
||||
If a partial version is provided as the second version in the
|
||||
inclusive range, then all versions that start with the supplied parts
|
||||
of the tuple are accepted, but nothing that would be greater than the
|
||||
provided tuple parts.
|
||||
|
||||
* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0-0`
|
||||
* `1.2.3 - 2` := `>=1.2.3 <3.0.0-0`
|
||||
|
||||
#### X-Ranges `1.2.x` `1.X` `1.2.*` `*`
|
||||
|
||||
Any of `X`, `x`, or `*` may be used to "stand in" for one of the
|
||||
numeric values in the `[major, minor, patch]` tuple.
|
||||
|
||||
* `*` := `>=0.0.0` (Any version satisfies)
|
||||
* `1.x` := `>=1.0.0 <2.0.0-0` (Matching major version)
|
||||
* `1.2.x` := `>=1.2.0 <1.3.0-0` (Matching major and minor versions)
|
||||
|
||||
A partial version range is treated as an X-Range, so the special
|
||||
character is in fact optional.
|
||||
|
||||
* `""` (empty string) := `*` := `>=0.0.0`
|
||||
* `1` := `1.x.x` := `>=1.0.0 <2.0.0-0`
|
||||
* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0-0`
|
||||
|
||||
#### Tilde Ranges `~1.2.3` `~1.2` `~1`
|
||||
|
||||
Allows patch-level changes if a minor version is specified on the
|
||||
comparator. Allows minor-level changes if not.
|
||||
|
||||
* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0-0`
|
||||
* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0-0` (Same as `1.2.x`)
|
||||
* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0-0` (Same as `1.x`)
|
||||
* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0-0`
|
||||
* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0-0` (Same as `0.2.x`)
|
||||
* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0-0` (Same as `0.x`)
|
||||
* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0-0` Note that prereleases in
|
||||
the `1.2.3` version will be allowed, if they are greater than or
|
||||
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
|
||||
`1.2.4-beta.2` would not, because it is a prerelease of a
|
||||
different `[major, minor, patch]` tuple.
|
||||
|
||||
#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4`
|
||||
|
||||
Allows changes that do not modify the left-most non-zero element in the
|
||||
`[major, minor, patch]` tuple. In other words, this allows patch and
|
||||
minor updates for versions `1.0.0` and above, patch updates for
|
||||
versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`.
|
||||
|
||||
Many authors treat a `0.x` version as if the `x` were the major
|
||||
"breaking-change" indicator.
|
||||
|
||||
Caret ranges are ideal when an author may make breaking changes
|
||||
between `0.2.4` and `0.3.0` releases, which is a common practice.
|
||||
However, it presumes that there will *not* be breaking changes between
|
||||
`0.2.4` and `0.2.5`. It allows for changes that are presumed to be
|
||||
additive (but non-breaking), according to commonly observed practices.
|
||||
|
||||
* `^1.2.3` := `>=1.2.3 <2.0.0-0`
|
||||
* `^0.2.3` := `>=0.2.3 <0.3.0-0`
|
||||
* `^0.0.3` := `>=0.0.3 <0.0.4-0`
|
||||
* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0-0` Note that prereleases in
|
||||
the `1.2.3` version will be allowed, if they are greater than or
|
||||
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
|
||||
`1.2.4-beta.2` would not, because it is a prerelease of a
|
||||
different `[major, minor, patch]` tuple.
|
||||
* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4-0` Note that prereleases in the
|
||||
`0.0.3` version *only* will be allowed, if they are greater than or
|
||||
equal to `beta`. So, `0.0.3-pr.2` would be allowed.
|
||||
|
||||
When parsing caret ranges, a missing `patch` value desugars to the
|
||||
number `0`, but will allow flexibility within that value, even if the
|
||||
major and minor versions are both `0`.
|
||||
|
||||
* `^1.2.x` := `>=1.2.0 <2.0.0-0`
|
||||
* `^0.0.x` := `>=0.0.0 <0.1.0-0`
|
||||
* `^0.0` := `>=0.0.0 <0.1.0-0`
|
||||
|
||||
A missing `minor` and `patch` values will desugar to zero, but also
|
||||
allow flexibility within those values, even if the major version is
|
||||
zero.
|
||||
|
||||
* `^1.x` := `>=1.0.0 <2.0.0-0`
|
||||
* `^0.x` := `>=0.0.0 <1.0.0-0`
|
||||
|
||||
### Range Grammar
|
||||
|
||||
Putting all this together, here is a Backus-Naur grammar for ranges,
|
||||
for the benefit of parser authors:
|
||||
|
||||
```bnf
|
||||
range-set ::= range ( logical-or range ) *
|
||||
logical-or ::= ( ' ' ) * '||' ( ' ' ) *
|
||||
range ::= hyphen | simple ( ' ' simple ) * | ''
|
||||
hyphen ::= partial ' - ' partial
|
||||
simple ::= primitive | partial | tilde | caret
|
||||
primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
|
||||
partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
|
||||
xr ::= 'x' | 'X' | '*' | nr
|
||||
nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) *
|
||||
tilde ::= '~' partial
|
||||
caret ::= '^' partial
|
||||
qualifier ::= ( '-' pre )? ( '+' build )?
|
||||
pre ::= parts
|
||||
build ::= parts
|
||||
parts ::= part ( '.' part ) *
|
||||
part ::= nr | [-0-9A-Za-z]+
|
||||
```
|
||||
|
||||
## Functions
|
||||
|
||||
All methods and classes take a final `options` object argument. All
|
||||
options in this object are `false` by default. The options supported
|
||||
are:
|
||||
|
||||
- `loose` Be more forgiving about not-quite-valid semver strings.
|
||||
(Any resulting output will always be 100% strict compliant, of
|
||||
course.) For backwards compatibility reasons, if the `options`
|
||||
argument is a boolean value instead of an object, it is interpreted
|
||||
to be the `loose` param.
|
||||
- `includePrerelease` Set to suppress the [default
|
||||
behavior](https://github.com/npm/node-semver#prerelease-tags) of
|
||||
excluding prerelease tagged versions from ranges unless they are
|
||||
explicitly opted into.
|
||||
|
||||
Strict-mode Comparators and Ranges will be strict about the SemVer
|
||||
strings that they parse.
|
||||
|
||||
* `valid(v)`: Return the parsed version, or null if it's not valid.
|
||||
* `inc(v, release)`: Return the version incremented by the release
|
||||
type (`major`, `premajor`, `minor`, `preminor`, `patch`,
|
||||
`prepatch`, or `prerelease`), or null if it's not valid
|
||||
* `premajor` in one call will bump the version up to the next major
|
||||
version and down to a prerelease of that major version.
|
||||
`preminor`, and `prepatch` work the same way.
|
||||
* If called from a non-prerelease version, the `prerelease` will work the
|
||||
same as `prepatch`. It increments the patch version, then makes a
|
||||
prerelease. If the input version is already a prerelease it simply
|
||||
increments it.
|
||||
* `prerelease(v)`: Returns an array of prerelease components, or null
|
||||
if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]`
|
||||
* `major(v)`: Return the major version number.
|
||||
* `minor(v)`: Return the minor version number.
|
||||
* `patch(v)`: Return the patch version number.
|
||||
* `intersects(r1, r2, loose)`: Return true if the two supplied ranges
|
||||
or comparators intersect.
|
||||
* `parse(v)`: Attempt to parse a string as a semantic version, returning either
|
||||
a `SemVer` object or `null`.
|
||||
|
||||
### Comparison
|
||||
|
||||
* `gt(v1, v2)`: `v1 > v2`
|
||||
* `gte(v1, v2)`: `v1 >= v2`
|
||||
* `lt(v1, v2)`: `v1 < v2`
|
||||
* `lte(v1, v2)`: `v1 <= v2`
|
||||
* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent,
|
||||
even if they're not the exact same string. You already know how to
|
||||
compare strings.
|
||||
* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`.
|
||||
* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call
|
||||
the corresponding function above. `"==="` and `"!=="` do simple
|
||||
string comparison, but are included for completeness. Throws if an
|
||||
invalid comparison string is provided.
|
||||
* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if
|
||||
`v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
|
||||
* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions
|
||||
in descending order when passed to `Array.sort()`.
|
||||
* `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions
|
||||
are equal. Sorts in ascending order if passed to `Array.sort()`.
|
||||
`v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
|
||||
* `diff(v1, v2)`: Returns difference between two versions by the release type
|
||||
(`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`),
|
||||
or null if the versions are the same.
|
||||
|
||||
### Comparators
|
||||
|
||||
* `intersects(comparator)`: Return true if the comparators intersect
|
||||
|
||||
### Ranges
|
||||
|
||||
* `validRange(range)`: Return the valid range or null if it's not valid
|
||||
* `satisfies(version, range)`: Return true if the version satisfies the
|
||||
range.
|
||||
* `maxSatisfying(versions, range)`: Return the highest version in the list
|
||||
that satisfies the range, or `null` if none of them do.
|
||||
* `minSatisfying(versions, range)`: Return the lowest version in the list
|
||||
that satisfies the range, or `null` if none of them do.
|
||||
* `minVersion(range)`: Return the lowest version that can possibly match
|
||||
the given range.
|
||||
* `gtr(version, range)`: Return `true` if version is greater than all the
|
||||
versions possible in the range.
|
||||
* `ltr(version, range)`: Return `true` if version is less than all the
|
||||
versions possible in the range.
|
||||
* `outside(version, range, hilo)`: Return true if the version is outside
|
||||
the bounds of the range in either the high or low direction. The
|
||||
`hilo` argument must be either the string `'>'` or `'<'`. (This is
|
||||
the function called by `gtr` and `ltr`.)
|
||||
* `intersects(range)`: Return true if any of the ranges comparators intersect
|
||||
* `simplifyRange(versions, range)`: Return a "simplified" range that
|
||||
matches the same items in `versions` list as the range specified. Note
|
||||
that it does *not* guarantee that it would match the same versions in all
|
||||
cases, only for the set of versions provided. This is useful when
|
||||
generating ranges by joining together multiple versions with `||`
|
||||
programmatically, to provide the user with something a bit more
|
||||
ergonomic. If the provided range is shorter in string-length than the
|
||||
generated range, then that is returned.
|
||||
* `subset(subRange, superRange)`: Return `true` if the `subRange` range is
|
||||
entirely contained by the `superRange` range.
|
||||
|
||||
Note that, since ranges may be non-contiguous, a version might not be
|
||||
greater than a range, less than a range, *or* satisfy a range! For
|
||||
example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9`
|
||||
until `2.0.0`, so the version `1.2.10` would not be greater than the
|
||||
range (because `2.0.1` satisfies, which is higher), nor less than the
|
||||
range (since `1.2.8` satisfies, which is lower), and it also does not
|
||||
satisfy the range.
|
||||
|
||||
If you want to know if a version satisfies or does not satisfy a
|
||||
range, use the `satisfies(version, range)` function.
|
||||
|
||||
### Coercion
|
||||
|
||||
* `coerce(version, options)`: Coerces a string to semver if possible
|
||||
|
||||
This aims to provide a very forgiving translation of a non-semver string to
|
||||
semver. It looks for the first digit in a string, and consumes all
|
||||
remaining characters which satisfy at least a partial semver (e.g., `1`,
|
||||
`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer
|
||||
versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All
|
||||
surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes
|
||||
`3.4.0`). Only text which lacks digits will fail coercion (`version one`
|
||||
is not valid). The maximum length for any semver component considered for
|
||||
coercion is 16 characters; longer components will be ignored
|
||||
(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any
|
||||
semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value
|
||||
components are invalid (`9999999999999999.4.7.4` is likely invalid).
|
||||
|
||||
If the `options.rtl` flag is set, then `coerce` will return the right-most
|
||||
coercible tuple that does not share an ending index with a longer coercible
|
||||
tuple. For example, `1.2.3.4` will return `2.3.4` in rtl mode, not
|
||||
`4.0.0`. `1.2.3/4` will return `4.0.0`, because the `4` is not a part of
|
||||
any other overlapping SemVer tuple.
|
||||
|
||||
### Clean
|
||||
|
||||
* `clean(version)`: Clean a string to be a valid semver if possible
|
||||
|
||||
This will return a cleaned and trimmed semver version. If the provided
|
||||
version is not valid a null will be returned. This does not work for
|
||||
ranges.
|
||||
|
||||
ex.
|
||||
* `s.clean(' = v 2.1.5foo')`: `null`
|
||||
* `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'`
|
||||
* `s.clean(' = v 2.1.5-foo')`: `null`
|
||||
* `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'`
|
||||
* `s.clean('=v2.1.5')`: `'2.1.5'`
|
||||
* `s.clean(' =v2.1.5')`: `2.1.5`
|
||||
* `s.clean(' 2.1.5 ')`: `'2.1.5'`
|
||||
* `s.clean('~1.0.0')`: `null`
|
||||
|
||||
## Exported Modules
|
||||
|
||||
<!--
|
||||
TODO: Make sure that all of these items are documented (classes aren't,
|
||||
eg), and then pull the module name into the documentation for that specific
|
||||
thing.
|
||||
-->
|
||||
|
||||
You may pull in just the part of this semver utility that you need, if you
|
||||
are sensitive to packing and tree-shaking concerns. The main
|
||||
`require('semver')` export uses getter functions to lazily load the parts
|
||||
of the API that are used.
|
||||
|
||||
The following modules are available:
|
||||
|
||||
* `require('semver')`
|
||||
* `require('semver/classes')`
|
||||
* `require('semver/classes/comparator')`
|
||||
* `require('semver/classes/range')`
|
||||
* `require('semver/classes/semver')`
|
||||
* `require('semver/functions/clean')`
|
||||
* `require('semver/functions/cmp')`
|
||||
* `require('semver/functions/coerce')`
|
||||
* `require('semver/functions/compare')`
|
||||
* `require('semver/functions/compare-build')`
|
||||
* `require('semver/functions/compare-loose')`
|
||||
* `require('semver/functions/diff')`
|
||||
* `require('semver/functions/eq')`
|
||||
* `require('semver/functions/gt')`
|
||||
* `require('semver/functions/gte')`
|
||||
* `require('semver/functions/inc')`
|
||||
* `require('semver/functions/lt')`
|
||||
* `require('semver/functions/lte')`
|
||||
* `require('semver/functions/major')`
|
||||
* `require('semver/functions/minor')`
|
||||
* `require('semver/functions/neq')`
|
||||
* `require('semver/functions/parse')`
|
||||
* `require('semver/functions/patch')`
|
||||
* `require('semver/functions/prerelease')`
|
||||
* `require('semver/functions/rcompare')`
|
||||
* `require('semver/functions/rsort')`
|
||||
* `require('semver/functions/satisfies')`
|
||||
* `require('semver/functions/sort')`
|
||||
* `require('semver/functions/valid')`
|
||||
* `require('semver/ranges/gtr')`
|
||||
* `require('semver/ranges/intersects')`
|
||||
* `require('semver/ranges/ltr')`
|
||||
* `require('semver/ranges/max-satisfying')`
|
||||
* `require('semver/ranges/min-satisfying')`
|
||||
* `require('semver/ranges/min-version')`
|
||||
* `require('semver/ranges/outside')`
|
||||
* `require('semver/ranges/to-comparators')`
|
||||
* `require('semver/ranges/valid')`
|
||||
173
node_modules/node-notifier/node_modules/semver/bin/semver.js
generated
vendored
Executable file
173
node_modules/node-notifier/node_modules/semver/bin/semver.js
generated
vendored
Executable file
@@ -0,0 +1,173 @@
|
||||
#!/usr/bin/env node
|
||||
// Standalone semver comparison program.
|
||||
// Exits successfully and prints matching version(s) if
|
||||
// any supplied version is valid and passes all tests.
|
||||
|
||||
const argv = process.argv.slice(2)
|
||||
|
||||
let versions = []
|
||||
|
||||
const range = []
|
||||
|
||||
let inc = null
|
||||
|
||||
const version = require('../package.json').version
|
||||
|
||||
let loose = false
|
||||
|
||||
let includePrerelease = false
|
||||
|
||||
let coerce = false
|
||||
|
||||
let rtl = false
|
||||
|
||||
let identifier
|
||||
|
||||
const semver = require('../')
|
||||
|
||||
let reverse = false
|
||||
|
||||
const options = {}
|
||||
|
||||
const main = () => {
|
||||
if (!argv.length) return help()
|
||||
while (argv.length) {
|
||||
let a = argv.shift()
|
||||
const indexOfEqualSign = a.indexOf('=')
|
||||
if (indexOfEqualSign !== -1) {
|
||||
a = a.slice(0, indexOfEqualSign)
|
||||
argv.unshift(a.slice(indexOfEqualSign + 1))
|
||||
}
|
||||
switch (a) {
|
||||
case '-rv': case '-rev': case '--rev': case '--reverse':
|
||||
reverse = true
|
||||
break
|
||||
case '-l': case '--loose':
|
||||
loose = true
|
||||
break
|
||||
case '-p': case '--include-prerelease':
|
||||
includePrerelease = true
|
||||
break
|
||||
case '-v': case '--version':
|
||||
versions.push(argv.shift())
|
||||
break
|
||||
case '-i': case '--inc': case '--increment':
|
||||
switch (argv[0]) {
|
||||
case 'major': case 'minor': case 'patch': case 'prerelease':
|
||||
case 'premajor': case 'preminor': case 'prepatch':
|
||||
inc = argv.shift()
|
||||
break
|
||||
default:
|
||||
inc = 'patch'
|
||||
break
|
||||
}
|
||||
break
|
||||
case '--preid':
|
||||
identifier = argv.shift()
|
||||
break
|
||||
case '-r': case '--range':
|
||||
range.push(argv.shift())
|
||||
break
|
||||
case '-c': case '--coerce':
|
||||
coerce = true
|
||||
break
|
||||
case '--rtl':
|
||||
rtl = true
|
||||
break
|
||||
case '--ltr':
|
||||
rtl = false
|
||||
break
|
||||
case '-h': case '--help': case '-?':
|
||||
return help()
|
||||
default:
|
||||
versions.push(a)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
const options = { loose: loose, includePrerelease: includePrerelease, rtl: rtl }
|
||||
|
||||
versions = versions.map((v) => {
|
||||
return coerce ? (semver.coerce(v, options) || { version: v }).version : v
|
||||
}).filter((v) => {
|
||||
return semver.valid(v)
|
||||
})
|
||||
if (!versions.length) return fail()
|
||||
if (inc && (versions.length !== 1 || range.length)) { return failInc() }
|
||||
|
||||
for (let i = 0, l = range.length; i < l; i++) {
|
||||
versions = versions.filter((v) => {
|
||||
return semver.satisfies(v, range[i], options)
|
||||
})
|
||||
if (!versions.length) return fail()
|
||||
}
|
||||
return success(versions)
|
||||
}
|
||||
|
||||
|
||||
const failInc = () => {
|
||||
console.error('--inc can only be used on a single version with no range')
|
||||
fail()
|
||||
}
|
||||
|
||||
const fail = () => process.exit(1)
|
||||
|
||||
const success = () => {
|
||||
const compare = reverse ? 'rcompare' : 'compare'
|
||||
versions.sort((a, b) => {
|
||||
return semver[compare](a, b, options)
|
||||
}).map((v) => {
|
||||
return semver.clean(v, options)
|
||||
}).map((v) => {
|
||||
return inc ? semver.inc(v, inc, options, identifier) : v
|
||||
}).forEach((v, i, _) => { console.log(v) })
|
||||
}
|
||||
|
||||
const help = () => console.log(
|
||||
`SemVer ${version}
|
||||
|
||||
A JavaScript implementation of the https://semver.org/ specification
|
||||
Copyright Isaac Z. Schlueter
|
||||
|
||||
Usage: semver [options] <version> [<version> [...]]
|
||||
Prints valid versions sorted by SemVer precedence
|
||||
|
||||
Options:
|
||||
-r --range <range>
|
||||
Print versions that match the specified range.
|
||||
|
||||
-i --increment [<level>]
|
||||
Increment a version by the specified level. Level can
|
||||
be one of: major, minor, patch, premajor, preminor,
|
||||
prepatch, or prerelease. Default level is 'patch'.
|
||||
Only one version may be specified.
|
||||
|
||||
--preid <identifier>
|
||||
Identifier to be used to prefix premajor, preminor,
|
||||
prepatch or prerelease version increments.
|
||||
|
||||
-l --loose
|
||||
Interpret versions and ranges loosely
|
||||
|
||||
-p --include-prerelease
|
||||
Always include prerelease versions in range matching
|
||||
|
||||
-c --coerce
|
||||
Coerce a string into SemVer if possible
|
||||
(does not imply --loose)
|
||||
|
||||
--rtl
|
||||
Coerce version strings right to left
|
||||
|
||||
--ltr
|
||||
Coerce version strings left to right (default)
|
||||
|
||||
Program exits successfully if any valid version satisfies
|
||||
all supplied ranges, and prints all satisfying versions.
|
||||
|
||||
If no satisfying versions are found, then exits failure.
|
||||
|
||||
Versions are printed in ascending order, so supplying
|
||||
multiple versions to the utility will just sort them.`)
|
||||
|
||||
main()
|
||||
135
node_modules/node-notifier/node_modules/semver/classes/comparator.js
generated
vendored
Normal file
135
node_modules/node-notifier/node_modules/semver/classes/comparator.js
generated
vendored
Normal file
@@ -0,0 +1,135 @@
|
||||
const ANY = Symbol('SemVer ANY')
|
||||
// hoisted class for cyclic dependency
|
||||
class Comparator {
|
||||
static get ANY () {
|
||||
return ANY
|
||||
}
|
||||
constructor (comp, options) {
|
||||
options = parseOptions(options)
|
||||
|
||||
if (comp instanceof Comparator) {
|
||||
if (comp.loose === !!options.loose) {
|
||||
return comp
|
||||
} else {
|
||||
comp = comp.value
|
||||
}
|
||||
}
|
||||
|
||||
debug('comparator', comp, options)
|
||||
this.options = options
|
||||
this.loose = !!options.loose
|
||||
this.parse(comp)
|
||||
|
||||
if (this.semver === ANY) {
|
||||
this.value = ''
|
||||
} else {
|
||||
this.value = this.operator + this.semver.version
|
||||
}
|
||||
|
||||
debug('comp', this)
|
||||
}
|
||||
|
||||
parse (comp) {
|
||||
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
|
||||
const m = comp.match(r)
|
||||
|
||||
if (!m) {
|
||||
throw new TypeError(`Invalid comparator: ${comp}`)
|
||||
}
|
||||
|
||||
this.operator = m[1] !== undefined ? m[1] : ''
|
||||
if (this.operator === '=') {
|
||||
this.operator = ''
|
||||
}
|
||||
|
||||
// if it literally is just '>' or '' then allow anything.
|
||||
if (!m[2]) {
|
||||
this.semver = ANY
|
||||
} else {
|
||||
this.semver = new SemVer(m[2], this.options.loose)
|
||||
}
|
||||
}
|
||||
|
||||
toString () {
|
||||
return this.value
|
||||
}
|
||||
|
||||
test (version) {
|
||||
debug('Comparator.test', version, this.options.loose)
|
||||
|
||||
if (this.semver === ANY || version === ANY) {
|
||||
return true
|
||||
}
|
||||
|
||||
if (typeof version === 'string') {
|
||||
try {
|
||||
version = new SemVer(version, this.options)
|
||||
} catch (er) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return cmp(version, this.operator, this.semver, this.options)
|
||||
}
|
||||
|
||||
intersects (comp, options) {
|
||||
if (!(comp instanceof Comparator)) {
|
||||
throw new TypeError('a Comparator is required')
|
||||
}
|
||||
|
||||
if (!options || typeof options !== 'object') {
|
||||
options = {
|
||||
loose: !!options,
|
||||
includePrerelease: false
|
||||
}
|
||||
}
|
||||
|
||||
if (this.operator === '') {
|
||||
if (this.value === '') {
|
||||
return true
|
||||
}
|
||||
return new Range(comp.value, options).test(this.value)
|
||||
} else if (comp.operator === '') {
|
||||
if (comp.value === '') {
|
||||
return true
|
||||
}
|
||||
return new Range(this.value, options).test(comp.semver)
|
||||
}
|
||||
|
||||
const sameDirectionIncreasing =
|
||||
(this.operator === '>=' || this.operator === '>') &&
|
||||
(comp.operator === '>=' || comp.operator === '>')
|
||||
const sameDirectionDecreasing =
|
||||
(this.operator === '<=' || this.operator === '<') &&
|
||||
(comp.operator === '<=' || comp.operator === '<')
|
||||
const sameSemVer = this.semver.version === comp.semver.version
|
||||
const differentDirectionsInclusive =
|
||||
(this.operator === '>=' || this.operator === '<=') &&
|
||||
(comp.operator === '>=' || comp.operator === '<=')
|
||||
const oppositeDirectionsLessThan =
|
||||
cmp(this.semver, '<', comp.semver, options) &&
|
||||
(this.operator === '>=' || this.operator === '>') &&
|
||||
(comp.operator === '<=' || comp.operator === '<')
|
||||
const oppositeDirectionsGreaterThan =
|
||||
cmp(this.semver, '>', comp.semver, options) &&
|
||||
(this.operator === '<=' || this.operator === '<') &&
|
||||
(comp.operator === '>=' || comp.operator === '>')
|
||||
|
||||
return (
|
||||
sameDirectionIncreasing ||
|
||||
sameDirectionDecreasing ||
|
||||
(sameSemVer && differentDirectionsInclusive) ||
|
||||
oppositeDirectionsLessThan ||
|
||||
oppositeDirectionsGreaterThan
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Comparator
|
||||
|
||||
const parseOptions = require('../internal/parse-options')
|
||||
const {re, t} = require('../internal/re')
|
||||
const cmp = require('../functions/cmp')
|
||||
const debug = require('../internal/debug')
|
||||
const SemVer = require('./semver')
|
||||
const Range = require('./range')
|
||||
5
node_modules/node-notifier/node_modules/semver/classes/index.js
generated
vendored
Normal file
5
node_modules/node-notifier/node_modules/semver/classes/index.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
module.exports = {
|
||||
SemVer: require('./semver.js'),
|
||||
Range: require('./range.js'),
|
||||
Comparator: require('./comparator.js')
|
||||
}
|
||||
510
node_modules/node-notifier/node_modules/semver/classes/range.js
generated
vendored
Normal file
510
node_modules/node-notifier/node_modules/semver/classes/range.js
generated
vendored
Normal file
@@ -0,0 +1,510 @@
|
||||
// hoisted class for cyclic dependency
|
||||
class Range {
|
||||
constructor (range, options) {
|
||||
options = parseOptions(options)
|
||||
|
||||
if (range instanceof Range) {
|
||||
if (
|
||||
range.loose === !!options.loose &&
|
||||
range.includePrerelease === !!options.includePrerelease
|
||||
) {
|
||||
return range
|
||||
} else {
|
||||
return new Range(range.raw, options)
|
||||
}
|
||||
}
|
||||
|
||||
if (range instanceof Comparator) {
|
||||
// just put it in the set and return
|
||||
this.raw = range.value
|
||||
this.set = [[range]]
|
||||
this.format()
|
||||
return this
|
||||
}
|
||||
|
||||
this.options = options
|
||||
this.loose = !!options.loose
|
||||
this.includePrerelease = !!options.includePrerelease
|
||||
|
||||
// First, split based on boolean or ||
|
||||
this.raw = range
|
||||
this.set = range
|
||||
.split(/\s*\|\|\s*/)
|
||||
// map the range to a 2d array of comparators
|
||||
.map(range => this.parseRange(range.trim()))
|
||||
// throw out any comparator lists that are empty
|
||||
// this generally means that it was not a valid range, which is allowed
|
||||
// in loose mode, but will still throw if the WHOLE range is invalid.
|
||||
.filter(c => c.length)
|
||||
|
||||
if (!this.set.length) {
|
||||
throw new TypeError(`Invalid SemVer Range: ${range}`)
|
||||
}
|
||||
|
||||
// if we have any that are not the null set, throw out null sets.
|
||||
if (this.set.length > 1) {
|
||||
// keep the first one, in case they're all null sets
|
||||
const first = this.set[0]
|
||||
this.set = this.set.filter(c => !isNullSet(c[0]))
|
||||
if (this.set.length === 0)
|
||||
this.set = [first]
|
||||
else if (this.set.length > 1) {
|
||||
// if we have any that are *, then the range is just *
|
||||
for (const c of this.set) {
|
||||
if (c.length === 1 && isAny(c[0])) {
|
||||
this.set = [c]
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.format()
|
||||
}
|
||||
|
||||
format () {
|
||||
this.range = this.set
|
||||
.map((comps) => {
|
||||
return comps.join(' ').trim()
|
||||
})
|
||||
.join('||')
|
||||
.trim()
|
||||
return this.range
|
||||
}
|
||||
|
||||
toString () {
|
||||
return this.range
|
||||
}
|
||||
|
||||
parseRange (range) {
|
||||
range = range.trim()
|
||||
|
||||
// memoize range parsing for performance.
|
||||
// this is a very hot path, and fully deterministic.
|
||||
const memoOpts = Object.keys(this.options).join(',')
|
||||
const memoKey = `parseRange:${memoOpts}:${range}`
|
||||
const cached = cache.get(memoKey)
|
||||
if (cached)
|
||||
return cached
|
||||
|
||||
const loose = this.options.loose
|
||||
// `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
|
||||
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
|
||||
range = range.replace(hr, hyphenReplace(this.options.includePrerelease))
|
||||
debug('hyphen replace', range)
|
||||
// `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
|
||||
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
|
||||
debug('comparator trim', range, re[t.COMPARATORTRIM])
|
||||
|
||||
// `~ 1.2.3` => `~1.2.3`
|
||||
range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
|
||||
|
||||
// `^ 1.2.3` => `^1.2.3`
|
||||
range = range.replace(re[t.CARETTRIM], caretTrimReplace)
|
||||
|
||||
// normalize spaces
|
||||
range = range.split(/\s+/).join(' ')
|
||||
|
||||
// At this point, the range is completely trimmed and
|
||||
// ready to be split into comparators.
|
||||
|
||||
const compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
|
||||
const rangeList = range
|
||||
.split(' ')
|
||||
.map(comp => parseComparator(comp, this.options))
|
||||
.join(' ')
|
||||
.split(/\s+/)
|
||||
// >=0.0.0 is equivalent to *
|
||||
.map(comp => replaceGTE0(comp, this.options))
|
||||
// in loose mode, throw out any that are not valid comparators
|
||||
.filter(this.options.loose ? comp => !!comp.match(compRe) : () => true)
|
||||
.map(comp => new Comparator(comp, this.options))
|
||||
|
||||
// if any comparators are the null set, then replace with JUST null set
|
||||
// if more than one comparator, remove any * comparators
|
||||
// also, don't include the same comparator more than once
|
||||
const l = rangeList.length
|
||||
const rangeMap = new Map()
|
||||
for (const comp of rangeList) {
|
||||
if (isNullSet(comp))
|
||||
return [comp]
|
||||
rangeMap.set(comp.value, comp)
|
||||
}
|
||||
if (rangeMap.size > 1 && rangeMap.has(''))
|
||||
rangeMap.delete('')
|
||||
|
||||
const result = [...rangeMap.values()]
|
||||
cache.set(memoKey, result)
|
||||
return result
|
||||
}
|
||||
|
||||
intersects (range, options) {
|
||||
if (!(range instanceof Range)) {
|
||||
throw new TypeError('a Range is required')
|
||||
}
|
||||
|
||||
return this.set.some((thisComparators) => {
|
||||
return (
|
||||
isSatisfiable(thisComparators, options) &&
|
||||
range.set.some((rangeComparators) => {
|
||||
return (
|
||||
isSatisfiable(rangeComparators, options) &&
|
||||
thisComparators.every((thisComparator) => {
|
||||
return rangeComparators.every((rangeComparator) => {
|
||||
return thisComparator.intersects(rangeComparator, options)
|
||||
})
|
||||
})
|
||||
)
|
||||
})
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
// if ANY of the sets match ALL of its comparators, then pass
|
||||
test (version) {
|
||||
if (!version) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (typeof version === 'string') {
|
||||
try {
|
||||
version = new SemVer(version, this.options)
|
||||
} catch (er) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
for (let i = 0; i < this.set.length; i++) {
|
||||
if (testSet(this.set[i], version, this.options)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
module.exports = Range
|
||||
|
||||
const LRU = require('lru-cache')
|
||||
const cache = new LRU({ max: 1000 })
|
||||
|
||||
const parseOptions = require('../internal/parse-options')
|
||||
const Comparator = require('./comparator')
|
||||
const debug = require('../internal/debug')
|
||||
const SemVer = require('./semver')
|
||||
const {
|
||||
re,
|
||||
t,
|
||||
comparatorTrimReplace,
|
||||
tildeTrimReplace,
|
||||
caretTrimReplace
|
||||
} = require('../internal/re')
|
||||
|
||||
const isNullSet = c => c.value === '<0.0.0-0'
|
||||
const isAny = c => c.value === ''
|
||||
|
||||
// take a set of comparators and determine whether there
|
||||
// exists a version which can satisfy it
|
||||
const isSatisfiable = (comparators, options) => {
|
||||
let result = true
|
||||
const remainingComparators = comparators.slice()
|
||||
let testComparator = remainingComparators.pop()
|
||||
|
||||
while (result && remainingComparators.length) {
|
||||
result = remainingComparators.every((otherComparator) => {
|
||||
return testComparator.intersects(otherComparator, options)
|
||||
})
|
||||
|
||||
testComparator = remainingComparators.pop()
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
// comprised of xranges, tildes, stars, and gtlt's at this point.
|
||||
// already replaced the hyphen ranges
|
||||
// turn into a set of JUST comparators.
|
||||
const parseComparator = (comp, options) => {
|
||||
debug('comp', comp, options)
|
||||
comp = replaceCarets(comp, options)
|
||||
debug('caret', comp)
|
||||
comp = replaceTildes(comp, options)
|
||||
debug('tildes', comp)
|
||||
comp = replaceXRanges(comp, options)
|
||||
debug('xrange', comp)
|
||||
comp = replaceStars(comp, options)
|
||||
debug('stars', comp)
|
||||
return comp
|
||||
}
|
||||
|
||||
const isX = id => !id || id.toLowerCase() === 'x' || id === '*'
|
||||
|
||||
// ~, ~> --> * (any, kinda silly)
|
||||
// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0
|
||||
// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0
|
||||
// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0
|
||||
// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0
|
||||
// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0
|
||||
const replaceTildes = (comp, options) =>
|
||||
comp.trim().split(/\s+/).map((comp) => {
|
||||
return replaceTilde(comp, options)
|
||||
}).join(' ')
|
||||
|
||||
const replaceTilde = (comp, options) => {
|
||||
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
|
||||
return comp.replace(r, (_, M, m, p, pr) => {
|
||||
debug('tilde', comp, _, M, m, p, pr)
|
||||
let ret
|
||||
|
||||
if (isX(M)) {
|
||||
ret = ''
|
||||
} else if (isX(m)) {
|
||||
ret = `>=${M}.0.0 <${+M + 1}.0.0-0`
|
||||
} else if (isX(p)) {
|
||||
// ~1.2 == >=1.2.0 <1.3.0-0
|
||||
ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`
|
||||
} else if (pr) {
|
||||
debug('replaceTilde pr', pr)
|
||||
ret = `>=${M}.${m}.${p}-${pr
|
||||
} <${M}.${+m + 1}.0-0`
|
||||
} else {
|
||||
// ~1.2.3 == >=1.2.3 <1.3.0-0
|
||||
ret = `>=${M}.${m}.${p
|
||||
} <${M}.${+m + 1}.0-0`
|
||||
}
|
||||
|
||||
debug('tilde return', ret)
|
||||
return ret
|
||||
})
|
||||
}
|
||||
|
||||
// ^ --> * (any, kinda silly)
|
||||
// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0
|
||||
// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0
|
||||
// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0
|
||||
// ^1.2.3 --> >=1.2.3 <2.0.0-0
|
||||
// ^1.2.0 --> >=1.2.0 <2.0.0-0
|
||||
const replaceCarets = (comp, options) =>
|
||||
comp.trim().split(/\s+/).map((comp) => {
|
||||
return replaceCaret(comp, options)
|
||||
}).join(' ')
|
||||
|
||||
const replaceCaret = (comp, options) => {
|
||||
debug('caret', comp, options)
|
||||
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
|
||||
const z = options.includePrerelease ? '-0' : ''
|
||||
return comp.replace(r, (_, M, m, p, pr) => {
|
||||
debug('caret', comp, _, M, m, p, pr)
|
||||
let ret
|
||||
|
||||
if (isX(M)) {
|
||||
ret = ''
|
||||
} else if (isX(m)) {
|
||||
ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`
|
||||
} else if (isX(p)) {
|
||||
if (M === '0') {
|
||||
ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`
|
||||
} else {
|
||||
ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`
|
||||
}
|
||||
} else if (pr) {
|
||||
debug('replaceCaret pr', pr)
|
||||
if (M === '0') {
|
||||
if (m === '0') {
|
||||
ret = `>=${M}.${m}.${p}-${pr
|
||||
} <${M}.${m}.${+p + 1}-0`
|
||||
} else {
|
||||
ret = `>=${M}.${m}.${p}-${pr
|
||||
} <${M}.${+m + 1}.0-0`
|
||||
}
|
||||
} else {
|
||||
ret = `>=${M}.${m}.${p}-${pr
|
||||
} <${+M + 1}.0.0-0`
|
||||
}
|
||||
} else {
|
||||
debug('no pr')
|
||||
if (M === '0') {
|
||||
if (m === '0') {
|
||||
ret = `>=${M}.${m}.${p
|
||||
}${z} <${M}.${m}.${+p + 1}-0`
|
||||
} else {
|
||||
ret = `>=${M}.${m}.${p
|
||||
}${z} <${M}.${+m + 1}.0-0`
|
||||
}
|
||||
} else {
|
||||
ret = `>=${M}.${m}.${p
|
||||
} <${+M + 1}.0.0-0`
|
||||
}
|
||||
}
|
||||
|
||||
debug('caret return', ret)
|
||||
return ret
|
||||
})
|
||||
}
|
||||
|
||||
const replaceXRanges = (comp, options) => {
|
||||
debug('replaceXRanges', comp, options)
|
||||
return comp.split(/\s+/).map((comp) => {
|
||||
return replaceXRange(comp, options)
|
||||
}).join(' ')
|
||||
}
|
||||
|
||||
const replaceXRange = (comp, options) => {
|
||||
comp = comp.trim()
|
||||
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
|
||||
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
||||
debug('xRange', comp, ret, gtlt, M, m, p, pr)
|
||||
const xM = isX(M)
|
||||
const xm = xM || isX(m)
|
||||
const xp = xm || isX(p)
|
||||
const anyX = xp
|
||||
|
||||
if (gtlt === '=' && anyX) {
|
||||
gtlt = ''
|
||||
}
|
||||
|
||||
// if we're including prereleases in the match, then we need
|
||||
// to fix this to -0, the lowest possible prerelease value
|
||||
pr = options.includePrerelease ? '-0' : ''
|
||||
|
||||
if (xM) {
|
||||
if (gtlt === '>' || gtlt === '<') {
|
||||
// nothing is allowed
|
||||
ret = '<0.0.0-0'
|
||||
} else {
|
||||
// nothing is forbidden
|
||||
ret = '*'
|
||||
}
|
||||
} else if (gtlt && anyX) {
|
||||
// we know patch is an x, because we have any x at all.
|
||||
// replace X with 0
|
||||
if (xm) {
|
||||
m = 0
|
||||
}
|
||||
p = 0
|
||||
|
||||
if (gtlt === '>') {
|
||||
// >1 => >=2.0.0
|
||||
// >1.2 => >=1.3.0
|
||||
gtlt = '>='
|
||||
if (xm) {
|
||||
M = +M + 1
|
||||
m = 0
|
||||
p = 0
|
||||
} else {
|
||||
m = +m + 1
|
||||
p = 0
|
||||
}
|
||||
} else if (gtlt === '<=') {
|
||||
// <=0.7.x is actually <0.8.0, since any 0.7.x should
|
||||
// pass. Similarly, <=7.x is actually <8.0.0, etc.
|
||||
gtlt = '<'
|
||||
if (xm) {
|
||||
M = +M + 1
|
||||
} else {
|
||||
m = +m + 1
|
||||
}
|
||||
}
|
||||
|
||||
if (gtlt === '<')
|
||||
pr = '-0'
|
||||
|
||||
ret = `${gtlt + M}.${m}.${p}${pr}`
|
||||
} else if (xm) {
|
||||
ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`
|
||||
} else if (xp) {
|
||||
ret = `>=${M}.${m}.0${pr
|
||||
} <${M}.${+m + 1}.0-0`
|
||||
}
|
||||
|
||||
debug('xRange return', ret)
|
||||
|
||||
return ret
|
||||
})
|
||||
}
|
||||
|
||||
// Because * is AND-ed with everything else in the comparator,
|
||||
// and '' means "any version", just remove the *s entirely.
|
||||
const replaceStars = (comp, options) => {
|
||||
debug('replaceStars', comp, options)
|
||||
// Looseness is ignored here. star is always as loose as it gets!
|
||||
return comp.trim().replace(re[t.STAR], '')
|
||||
}
|
||||
|
||||
const replaceGTE0 = (comp, options) => {
|
||||
debug('replaceGTE0', comp, options)
|
||||
return comp.trim()
|
||||
.replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '')
|
||||
}
|
||||
|
||||
// This function is passed to string.replace(re[t.HYPHENRANGE])
|
||||
// M, m, patch, prerelease, build
|
||||
// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
|
||||
// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do
|
||||
// 1.2 - 3.4 => >=1.2.0 <3.5.0-0
|
||||
const hyphenReplace = incPr => ($0,
|
||||
from, fM, fm, fp, fpr, fb,
|
||||
to, tM, tm, tp, tpr, tb) => {
|
||||
if (isX(fM)) {
|
||||
from = ''
|
||||
} else if (isX(fm)) {
|
||||
from = `>=${fM}.0.0${incPr ? '-0' : ''}`
|
||||
} else if (isX(fp)) {
|
||||
from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`
|
||||
} else if (fpr) {
|
||||
from = `>=${from}`
|
||||
} else {
|
||||
from = `>=${from}${incPr ? '-0' : ''}`
|
||||
}
|
||||
|
||||
if (isX(tM)) {
|
||||
to = ''
|
||||
} else if (isX(tm)) {
|
||||
to = `<${+tM + 1}.0.0-0`
|
||||
} else if (isX(tp)) {
|
||||
to = `<${tM}.${+tm + 1}.0-0`
|
||||
} else if (tpr) {
|
||||
to = `<=${tM}.${tm}.${tp}-${tpr}`
|
||||
} else if (incPr) {
|
||||
to = `<${tM}.${tm}.${+tp + 1}-0`
|
||||
} else {
|
||||
to = `<=${to}`
|
||||
}
|
||||
|
||||
return (`${from} ${to}`).trim()
|
||||
}
|
||||
|
||||
const testSet = (set, version, options) => {
|
||||
for (let i = 0; i < set.length; i++) {
|
||||
if (!set[i].test(version)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
if (version.prerelease.length && !options.includePrerelease) {
|
||||
// Find the set of versions that are allowed to have prereleases
|
||||
// For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
|
||||
// That should allow `1.2.3-pr.2` to pass.
|
||||
// However, `1.2.4-alpha.notready` should NOT be allowed,
|
||||
// even though it's within the range set by the comparators.
|
||||
for (let i = 0; i < set.length; i++) {
|
||||
debug(set[i].semver)
|
||||
if (set[i].semver === Comparator.ANY) {
|
||||
continue
|
||||
}
|
||||
|
||||
if (set[i].semver.prerelease.length > 0) {
|
||||
const allowed = set[i].semver
|
||||
if (allowed.major === version.major &&
|
||||
allowed.minor === version.minor &&
|
||||
allowed.patch === version.patch) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Version has a -pre, but it's not one of the ones we like.
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
287
node_modules/node-notifier/node_modules/semver/classes/semver.js
generated
vendored
Normal file
287
node_modules/node-notifier/node_modules/semver/classes/semver.js
generated
vendored
Normal file
@@ -0,0 +1,287 @@
|
||||
const debug = require('../internal/debug')
|
||||
const { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')
|
||||
const { re, t } = require('../internal/re')
|
||||
|
||||
const parseOptions = require('../internal/parse-options')
|
||||
const { compareIdentifiers } = require('../internal/identifiers')
|
||||
class SemVer {
|
||||
constructor (version, options) {
|
||||
options = parseOptions(options)
|
||||
|
||||
if (version instanceof SemVer) {
|
||||
if (version.loose === !!options.loose &&
|
||||
version.includePrerelease === !!options.includePrerelease) {
|
||||
return version
|
||||
} else {
|
||||
version = version.version
|
||||
}
|
||||
} else if (typeof version !== 'string') {
|
||||
throw new TypeError(`Invalid Version: ${version}`)
|
||||
}
|
||||
|
||||
if (version.length > MAX_LENGTH) {
|
||||
throw new TypeError(
|
||||
`version is longer than ${MAX_LENGTH} characters`
|
||||
)
|
||||
}
|
||||
|
||||
debug('SemVer', version, options)
|
||||
this.options = options
|
||||
this.loose = !!options.loose
|
||||
// this isn't actually relevant for versions, but keep it so that we
|
||||
// don't run into trouble passing this.options around.
|
||||
this.includePrerelease = !!options.includePrerelease
|
||||
|
||||
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
|
||||
|
||||
if (!m) {
|
||||
throw new TypeError(`Invalid Version: ${version}`)
|
||||
}
|
||||
|
||||
this.raw = version
|
||||
|
||||
// these are actually numbers
|
||||
this.major = +m[1]
|
||||
this.minor = +m[2]
|
||||
this.patch = +m[3]
|
||||
|
||||
if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
|
||||
throw new TypeError('Invalid major version')
|
||||
}
|
||||
|
||||
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
|
||||
throw new TypeError('Invalid minor version')
|
||||
}
|
||||
|
||||
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
|
||||
throw new TypeError('Invalid patch version')
|
||||
}
|
||||
|
||||
// numberify any prerelease numeric ids
|
||||
if (!m[4]) {
|
||||
this.prerelease = []
|
||||
} else {
|
||||
this.prerelease = m[4].split('.').map((id) => {
|
||||
if (/^[0-9]+$/.test(id)) {
|
||||
const num = +id
|
||||
if (num >= 0 && num < MAX_SAFE_INTEGER) {
|
||||
return num
|
||||
}
|
||||
}
|
||||
return id
|
||||
})
|
||||
}
|
||||
|
||||
this.build = m[5] ? m[5].split('.') : []
|
||||
this.format()
|
||||
}
|
||||
|
||||
format () {
|
||||
this.version = `${this.major}.${this.minor}.${this.patch}`
|
||||
if (this.prerelease.length) {
|
||||
this.version += `-${this.prerelease.join('.')}`
|
||||
}
|
||||
return this.version
|
||||
}
|
||||
|
||||
toString () {
|
||||
return this.version
|
||||
}
|
||||
|
||||
compare (other) {
|
||||
debug('SemVer.compare', this.version, this.options, other)
|
||||
if (!(other instanceof SemVer)) {
|
||||
if (typeof other === 'string' && other === this.version) {
|
||||
return 0
|
||||
}
|
||||
other = new SemVer(other, this.options)
|
||||
}
|
||||
|
||||
if (other.version === this.version) {
|
||||
return 0
|
||||
}
|
||||
|
||||
return this.compareMain(other) || this.comparePre(other)
|
||||
}
|
||||
|
||||
compareMain (other) {
|
||||
if (!(other instanceof SemVer)) {
|
||||
other = new SemVer(other, this.options)
|
||||
}
|
||||
|
||||
return (
|
||||
compareIdentifiers(this.major, other.major) ||
|
||||
compareIdentifiers(this.minor, other.minor) ||
|
||||
compareIdentifiers(this.patch, other.patch)
|
||||
)
|
||||
}
|
||||
|
||||
comparePre (other) {
|
||||
if (!(other instanceof SemVer)) {
|
||||
other = new SemVer(other, this.options)
|
||||
}
|
||||
|
||||
// NOT having a prerelease is > having one
|
||||
if (this.prerelease.length && !other.prerelease.length) {
|
||||
return -1
|
||||
} else if (!this.prerelease.length && other.prerelease.length) {
|
||||
return 1
|
||||
} else if (!this.prerelease.length && !other.prerelease.length) {
|
||||
return 0
|
||||
}
|
||||
|
||||
let i = 0
|
||||
do {
|
||||
const a = this.prerelease[i]
|
||||
const b = other.prerelease[i]
|
||||
debug('prerelease compare', i, a, b)
|
||||
if (a === undefined && b === undefined) {
|
||||
return 0
|
||||
} else if (b === undefined) {
|
||||
return 1
|
||||
} else if (a === undefined) {
|
||||
return -1
|
||||
} else if (a === b) {
|
||||
continue
|
||||
} else {
|
||||
return compareIdentifiers(a, b)
|
||||
}
|
||||
} while (++i)
|
||||
}
|
||||
|
||||
compareBuild (other) {
|
||||
if (!(other instanceof SemVer)) {
|
||||
other = new SemVer(other, this.options)
|
||||
}
|
||||
|
||||
let i = 0
|
||||
do {
|
||||
const a = this.build[i]
|
||||
const b = other.build[i]
|
||||
debug('prerelease compare', i, a, b)
|
||||
if (a === undefined && b === undefined) {
|
||||
return 0
|
||||
} else if (b === undefined) {
|
||||
return 1
|
||||
} else if (a === undefined) {
|
||||
return -1
|
||||
} else if (a === b) {
|
||||
continue
|
||||
} else {
|
||||
return compareIdentifiers(a, b)
|
||||
}
|
||||
} while (++i)
|
||||
}
|
||||
|
||||
// preminor will bump the version up to the next minor release, and immediately
|
||||
// down to pre-release. premajor and prepatch work the same way.
|
||||
inc (release, identifier) {
|
||||
switch (release) {
|
||||
case 'premajor':
|
||||
this.prerelease.length = 0
|
||||
this.patch = 0
|
||||
this.minor = 0
|
||||
this.major++
|
||||
this.inc('pre', identifier)
|
||||
break
|
||||
case 'preminor':
|
||||
this.prerelease.length = 0
|
||||
this.patch = 0
|
||||
this.minor++
|
||||
this.inc('pre', identifier)
|
||||
break
|
||||
case 'prepatch':
|
||||
// If this is already a prerelease, it will bump to the next version
|
||||
// drop any prereleases that might already exist, since they are not
|
||||
// relevant at this point.
|
||||
this.prerelease.length = 0
|
||||
this.inc('patch', identifier)
|
||||
this.inc('pre', identifier)
|
||||
break
|
||||
// If the input is a non-prerelease version, this acts the same as
|
||||
// prepatch.
|
||||
case 'prerelease':
|
||||
if (this.prerelease.length === 0) {
|
||||
this.inc('patch', identifier)
|
||||
}
|
||||
this.inc('pre', identifier)
|
||||
break
|
||||
|
||||
case 'major':
|
||||
// If this is a pre-major version, bump up to the same major version.
|
||||
// Otherwise increment major.
|
||||
// 1.0.0-5 bumps to 1.0.0
|
||||
// 1.1.0 bumps to 2.0.0
|
||||
if (
|
||||
this.minor !== 0 ||
|
||||
this.patch !== 0 ||
|
||||
this.prerelease.length === 0
|
||||
) {
|
||||
this.major++
|
||||
}
|
||||
this.minor = 0
|
||||
this.patch = 0
|
||||
this.prerelease = []
|
||||
break
|
||||
case 'minor':
|
||||
// If this is a pre-minor version, bump up to the same minor version.
|
||||
// Otherwise increment minor.
|
||||
// 1.2.0-5 bumps to 1.2.0
|
||||
// 1.2.1 bumps to 1.3.0
|
||||
if (this.patch !== 0 || this.prerelease.length === 0) {
|
||||
this.minor++
|
||||
}
|
||||
this.patch = 0
|
||||
this.prerelease = []
|
||||
break
|
||||
case 'patch':
|
||||
// If this is not a pre-release version, it will increment the patch.
|
||||
// If it is a pre-release it will bump up to the same patch version.
|
||||
// 1.2.0-5 patches to 1.2.0
|
||||
// 1.2.0 patches to 1.2.1
|
||||
if (this.prerelease.length === 0) {
|
||||
this.patch++
|
||||
}
|
||||
this.prerelease = []
|
||||
break
|
||||
// This probably shouldn't be used publicly.
|
||||
// 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
|
||||
case 'pre':
|
||||
if (this.prerelease.length === 0) {
|
||||
this.prerelease = [0]
|
||||
} else {
|
||||
let i = this.prerelease.length
|
||||
while (--i >= 0) {
|
||||
if (typeof this.prerelease[i] === 'number') {
|
||||
this.prerelease[i]++
|
||||
i = -2
|
||||
}
|
||||
}
|
||||
if (i === -1) {
|
||||
// didn't increment anything
|
||||
this.prerelease.push(0)
|
||||
}
|
||||
}
|
||||
if (identifier) {
|
||||
// 1.2.0-beta.1 bumps to 1.2.0-beta.2,
|
||||
// 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
|
||||
if (this.prerelease[0] === identifier) {
|
||||
if (isNaN(this.prerelease[1])) {
|
||||
this.prerelease = [identifier, 0]
|
||||
}
|
||||
} else {
|
||||
this.prerelease = [identifier, 0]
|
||||
}
|
||||
}
|
||||
break
|
||||
|
||||
default:
|
||||
throw new Error(`invalid increment argument: ${release}`)
|
||||
}
|
||||
this.format()
|
||||
this.raw = this.version
|
||||
return this
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = SemVer
|
||||
6
node_modules/node-notifier/node_modules/semver/functions/clean.js
generated
vendored
Normal file
6
node_modules/node-notifier/node_modules/semver/functions/clean.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
const parse = require('./parse')
|
||||
const clean = (version, options) => {
|
||||
const s = parse(version.trim().replace(/^[=v]+/, ''), options)
|
||||
return s ? s.version : null
|
||||
}
|
||||
module.exports = clean
|
||||
48
node_modules/node-notifier/node_modules/semver/functions/cmp.js
generated
vendored
Normal file
48
node_modules/node-notifier/node_modules/semver/functions/cmp.js
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
const eq = require('./eq')
|
||||
const neq = require('./neq')
|
||||
const gt = require('./gt')
|
||||
const gte = require('./gte')
|
||||
const lt = require('./lt')
|
||||
const lte = require('./lte')
|
||||
|
||||
const cmp = (a, op, b, loose) => {
|
||||
switch (op) {
|
||||
case '===':
|
||||
if (typeof a === 'object')
|
||||
a = a.version
|
||||
if (typeof b === 'object')
|
||||
b = b.version
|
||||
return a === b
|
||||
|
||||
case '!==':
|
||||
if (typeof a === 'object')
|
||||
a = a.version
|
||||
if (typeof b === 'object')
|
||||
b = b.version
|
||||
return a !== b
|
||||
|
||||
case '':
|
||||
case '=':
|
||||
case '==':
|
||||
return eq(a, b, loose)
|
||||
|
||||
case '!=':
|
||||
return neq(a, b, loose)
|
||||
|
||||
case '>':
|
||||
return gt(a, b, loose)
|
||||
|
||||
case '>=':
|
||||
return gte(a, b, loose)
|
||||
|
||||
case '<':
|
||||
return lt(a, b, loose)
|
||||
|
||||
case '<=':
|
||||
return lte(a, b, loose)
|
||||
|
||||
default:
|
||||
throw new TypeError(`Invalid operator: ${op}`)
|
||||
}
|
||||
}
|
||||
module.exports = cmp
|
||||
51
node_modules/node-notifier/node_modules/semver/functions/coerce.js
generated
vendored
Normal file
51
node_modules/node-notifier/node_modules/semver/functions/coerce.js
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
const SemVer = require('../classes/semver')
|
||||
const parse = require('./parse')
|
||||
const {re, t} = require('../internal/re')
|
||||
|
||||
const coerce = (version, options) => {
|
||||
if (version instanceof SemVer) {
|
||||
return version
|
||||
}
|
||||
|
||||
if (typeof version === 'number') {
|
||||
version = String(version)
|
||||
}
|
||||
|
||||
if (typeof version !== 'string') {
|
||||
return null
|
||||
}
|
||||
|
||||
options = options || {}
|
||||
|
||||
let match = null
|
||||
if (!options.rtl) {
|
||||
match = version.match(re[t.COERCE])
|
||||
} else {
|
||||
// Find the right-most coercible string that does not share
|
||||
// a terminus with a more left-ward coercible string.
|
||||
// Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
|
||||
//
|
||||
// Walk through the string checking with a /g regexp
|
||||
// Manually set the index so as to pick up overlapping matches.
|
||||
// Stop when we get a match that ends at the string end, since no
|
||||
// coercible string can be more right-ward without the same terminus.
|
||||
let next
|
||||
while ((next = re[t.COERCERTL].exec(version)) &&
|
||||
(!match || match.index + match[0].length !== version.length)
|
||||
) {
|
||||
if (!match ||
|
||||
next.index + next[0].length !== match.index + match[0].length) {
|
||||
match = next
|
||||
}
|
||||
re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
|
||||
}
|
||||
// leave it in a clean state
|
||||
re[t.COERCERTL].lastIndex = -1
|
||||
}
|
||||
|
||||
if (match === null)
|
||||
return null
|
||||
|
||||
return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options)
|
||||
}
|
||||
module.exports = coerce
|
||||
7
node_modules/node-notifier/node_modules/semver/functions/compare-build.js
generated
vendored
Normal file
7
node_modules/node-notifier/node_modules/semver/functions/compare-build.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
const SemVer = require('../classes/semver')
|
||||
const compareBuild = (a, b, loose) => {
|
||||
const versionA = new SemVer(a, loose)
|
||||
const versionB = new SemVer(b, loose)
|
||||
return versionA.compare(versionB) || versionA.compareBuild(versionB)
|
||||
}
|
||||
module.exports = compareBuild
|
||||
3
node_modules/node-notifier/node_modules/semver/functions/compare-loose.js
generated
vendored
Normal file
3
node_modules/node-notifier/node_modules/semver/functions/compare-loose.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
const compare = require('./compare')
|
||||
const compareLoose = (a, b) => compare(a, b, true)
|
||||
module.exports = compareLoose
|
||||
5
node_modules/node-notifier/node_modules/semver/functions/compare.js
generated
vendored
Normal file
5
node_modules/node-notifier/node_modules/semver/functions/compare.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
const SemVer = require('../classes/semver')
|
||||
const compare = (a, b, loose) =>
|
||||
new SemVer(a, loose).compare(new SemVer(b, loose))
|
||||
|
||||
module.exports = compare
|
||||
23
node_modules/node-notifier/node_modules/semver/functions/diff.js
generated
vendored
Normal file
23
node_modules/node-notifier/node_modules/semver/functions/diff.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
const parse = require('./parse')
|
||||
const eq = require('./eq')
|
||||
|
||||
const diff = (version1, version2) => {
|
||||
if (eq(version1, version2)) {
|
||||
return null
|
||||
} else {
|
||||
const v1 = parse(version1)
|
||||
const v2 = parse(version2)
|
||||
const hasPre = v1.prerelease.length || v2.prerelease.length
|
||||
const prefix = hasPre ? 'pre' : ''
|
||||
const defaultResult = hasPre ? 'prerelease' : ''
|
||||
for (const key in v1) {
|
||||
if (key === 'major' || key === 'minor' || key === 'patch') {
|
||||
if (v1[key] !== v2[key]) {
|
||||
return prefix + key
|
||||
}
|
||||
}
|
||||
}
|
||||
return defaultResult // may be undefined
|
||||
}
|
||||
}
|
||||
module.exports = diff
|
||||
3
node_modules/node-notifier/node_modules/semver/functions/eq.js
generated
vendored
Normal file
3
node_modules/node-notifier/node_modules/semver/functions/eq.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
const compare = require('./compare')
|
||||
const eq = (a, b, loose) => compare(a, b, loose) === 0
|
||||
module.exports = eq
|
||||
3
node_modules/node-notifier/node_modules/semver/functions/gt.js
generated
vendored
Normal file
3
node_modules/node-notifier/node_modules/semver/functions/gt.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
const compare = require('./compare')
|
||||
const gt = (a, b, loose) => compare(a, b, loose) > 0
|
||||
module.exports = gt
|
||||
3
node_modules/node-notifier/node_modules/semver/functions/gte.js
generated
vendored
Normal file
3
node_modules/node-notifier/node_modules/semver/functions/gte.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
const compare = require('./compare')
|
||||
const gte = (a, b, loose) => compare(a, b, loose) >= 0
|
||||
module.exports = gte
|
||||
15
node_modules/node-notifier/node_modules/semver/functions/inc.js
generated
vendored
Normal file
15
node_modules/node-notifier/node_modules/semver/functions/inc.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
const SemVer = require('../classes/semver')
|
||||
|
||||
const inc = (version, release, options, identifier) => {
|
||||
if (typeof (options) === 'string') {
|
||||
identifier = options
|
||||
options = undefined
|
||||
}
|
||||
|
||||
try {
|
||||
return new SemVer(version, options).inc(release, identifier).version
|
||||
} catch (er) {
|
||||
return null
|
||||
}
|
||||
}
|
||||
module.exports = inc
|
||||
3
node_modules/node-notifier/node_modules/semver/functions/lt.js
generated
vendored
Normal file
3
node_modules/node-notifier/node_modules/semver/functions/lt.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
const compare = require('./compare')
|
||||
const lt = (a, b, loose) => compare(a, b, loose) < 0
|
||||
module.exports = lt
|
||||
3
node_modules/node-notifier/node_modules/semver/functions/lte.js
generated
vendored
Normal file
3
node_modules/node-notifier/node_modules/semver/functions/lte.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
const compare = require('./compare')
|
||||
const lte = (a, b, loose) => compare(a, b, loose) <= 0
|
||||
module.exports = lte
|
||||
3
node_modules/node-notifier/node_modules/semver/functions/major.js
generated
vendored
Normal file
3
node_modules/node-notifier/node_modules/semver/functions/major.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
const SemVer = require('../classes/semver')
|
||||
const major = (a, loose) => new SemVer(a, loose).major
|
||||
module.exports = major
|
||||
3
node_modules/node-notifier/node_modules/semver/functions/minor.js
generated
vendored
Normal file
3
node_modules/node-notifier/node_modules/semver/functions/minor.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
const SemVer = require('../classes/semver')
|
||||
const minor = (a, loose) => new SemVer(a, loose).minor
|
||||
module.exports = minor
|
||||
3
node_modules/node-notifier/node_modules/semver/functions/neq.js
generated
vendored
Normal file
3
node_modules/node-notifier/node_modules/semver/functions/neq.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
const compare = require('./compare')
|
||||
const neq = (a, b, loose) => compare(a, b, loose) !== 0
|
||||
module.exports = neq
|
||||
33
node_modules/node-notifier/node_modules/semver/functions/parse.js
generated
vendored
Normal file
33
node_modules/node-notifier/node_modules/semver/functions/parse.js
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
const {MAX_LENGTH} = require('../internal/constants')
|
||||
const { re, t } = require('../internal/re')
|
||||
const SemVer = require('../classes/semver')
|
||||
|
||||
const parseOptions = require('../internal/parse-options')
|
||||
const parse = (version, options) => {
|
||||
options = parseOptions(options)
|
||||
|
||||
if (version instanceof SemVer) {
|
||||
return version
|
||||
}
|
||||
|
||||
if (typeof version !== 'string') {
|
||||
return null
|
||||
}
|
||||
|
||||
if (version.length > MAX_LENGTH) {
|
||||
return null
|
||||
}
|
||||
|
||||
const r = options.loose ? re[t.LOOSE] : re[t.FULL]
|
||||
if (!r.test(version)) {
|
||||
return null
|
||||
}
|
||||
|
||||
try {
|
||||
return new SemVer(version, options)
|
||||
} catch (er) {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = parse
|
||||
3
node_modules/node-notifier/node_modules/semver/functions/patch.js
generated
vendored
Normal file
3
node_modules/node-notifier/node_modules/semver/functions/patch.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
const SemVer = require('../classes/semver')
|
||||
const patch = (a, loose) => new SemVer(a, loose).patch
|
||||
module.exports = patch
|
||||
6
node_modules/node-notifier/node_modules/semver/functions/prerelease.js
generated
vendored
Normal file
6
node_modules/node-notifier/node_modules/semver/functions/prerelease.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
const parse = require('./parse')
|
||||
const prerelease = (version, options) => {
|
||||
const parsed = parse(version, options)
|
||||
return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
|
||||
}
|
||||
module.exports = prerelease
|
||||
3
node_modules/node-notifier/node_modules/semver/functions/rcompare.js
generated
vendored
Normal file
3
node_modules/node-notifier/node_modules/semver/functions/rcompare.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
const compare = require('./compare')
|
||||
const rcompare = (a, b, loose) => compare(b, a, loose)
|
||||
module.exports = rcompare
|
||||
3
node_modules/node-notifier/node_modules/semver/functions/rsort.js
generated
vendored
Normal file
3
node_modules/node-notifier/node_modules/semver/functions/rsort.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
const compareBuild = require('./compare-build')
|
||||
const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose))
|
||||
module.exports = rsort
|
||||
10
node_modules/node-notifier/node_modules/semver/functions/satisfies.js
generated
vendored
Normal file
10
node_modules/node-notifier/node_modules/semver/functions/satisfies.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
const Range = require('../classes/range')
|
||||
const satisfies = (version, range, options) => {
|
||||
try {
|
||||
range = new Range(range, options)
|
||||
} catch (er) {
|
||||
return false
|
||||
}
|
||||
return range.test(version)
|
||||
}
|
||||
module.exports = satisfies
|
||||
3
node_modules/node-notifier/node_modules/semver/functions/sort.js
generated
vendored
Normal file
3
node_modules/node-notifier/node_modules/semver/functions/sort.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
const compareBuild = require('./compare-build')
|
||||
const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose))
|
||||
module.exports = sort
|
||||
6
node_modules/node-notifier/node_modules/semver/functions/valid.js
generated
vendored
Normal file
6
node_modules/node-notifier/node_modules/semver/functions/valid.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
const parse = require('./parse')
|
||||
const valid = (version, options) => {
|
||||
const v = parse(version, options)
|
||||
return v ? v.version : null
|
||||
}
|
||||
module.exports = valid
|
||||
48
node_modules/node-notifier/node_modules/semver/index.js
generated
vendored
Normal file
48
node_modules/node-notifier/node_modules/semver/index.js
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
// just pre-load all the stuff that index.js lazily exports
|
||||
const internalRe = require('./internal/re')
|
||||
module.exports = {
|
||||
re: internalRe.re,
|
||||
src: internalRe.src,
|
||||
tokens: internalRe.t,
|
||||
SEMVER_SPEC_VERSION: require('./internal/constants').SEMVER_SPEC_VERSION,
|
||||
SemVer: require('./classes/semver'),
|
||||
compareIdentifiers: require('./internal/identifiers').compareIdentifiers,
|
||||
rcompareIdentifiers: require('./internal/identifiers').rcompareIdentifiers,
|
||||
parse: require('./functions/parse'),
|
||||
valid: require('./functions/valid'),
|
||||
clean: require('./functions/clean'),
|
||||
inc: require('./functions/inc'),
|
||||
diff: require('./functions/diff'),
|
||||
major: require('./functions/major'),
|
||||
minor: require('./functions/minor'),
|
||||
patch: require('./functions/patch'),
|
||||
prerelease: require('./functions/prerelease'),
|
||||
compare: require('./functions/compare'),
|
||||
rcompare: require('./functions/rcompare'),
|
||||
compareLoose: require('./functions/compare-loose'),
|
||||
compareBuild: require('./functions/compare-build'),
|
||||
sort: require('./functions/sort'),
|
||||
rsort: require('./functions/rsort'),
|
||||
gt: require('./functions/gt'),
|
||||
lt: require('./functions/lt'),
|
||||
eq: require('./functions/eq'),
|
||||
neq: require('./functions/neq'),
|
||||
gte: require('./functions/gte'),
|
||||
lte: require('./functions/lte'),
|
||||
cmp: require('./functions/cmp'),
|
||||
coerce: require('./functions/coerce'),
|
||||
Comparator: require('./classes/comparator'),
|
||||
Range: require('./classes/range'),
|
||||
satisfies: require('./functions/satisfies'),
|
||||
toComparators: require('./ranges/to-comparators'),
|
||||
maxSatisfying: require('./ranges/max-satisfying'),
|
||||
minSatisfying: require('./ranges/min-satisfying'),
|
||||
minVersion: require('./ranges/min-version'),
|
||||
validRange: require('./ranges/valid'),
|
||||
outside: require('./ranges/outside'),
|
||||
gtr: require('./ranges/gtr'),
|
||||
ltr: require('./ranges/ltr'),
|
||||
intersects: require('./ranges/intersects'),
|
||||
simplifyRange: require('./ranges/simplify'),
|
||||
subset: require('./ranges/subset'),
|
||||
}
|
||||
17
node_modules/node-notifier/node_modules/semver/internal/constants.js
generated
vendored
Normal file
17
node_modules/node-notifier/node_modules/semver/internal/constants.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
// Note: this is the semver.org version of the spec that it implements
|
||||
// Not necessarily the package version of this code.
|
||||
const SEMVER_SPEC_VERSION = '2.0.0'
|
||||
|
||||
const MAX_LENGTH = 256
|
||||
const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
|
||||
/* istanbul ignore next */ 9007199254740991
|
||||
|
||||
// Max safe segment length for coercion.
|
||||
const MAX_SAFE_COMPONENT_LENGTH = 16
|
||||
|
||||
module.exports = {
|
||||
SEMVER_SPEC_VERSION,
|
||||
MAX_LENGTH,
|
||||
MAX_SAFE_INTEGER,
|
||||
MAX_SAFE_COMPONENT_LENGTH
|
||||
}
|
||||
9
node_modules/node-notifier/node_modules/semver/internal/debug.js
generated
vendored
Normal file
9
node_modules/node-notifier/node_modules/semver/internal/debug.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
const debug = (
|
||||
typeof process === 'object' &&
|
||||
process.env &&
|
||||
process.env.NODE_DEBUG &&
|
||||
/\bsemver\b/i.test(process.env.NODE_DEBUG)
|
||||
) ? (...args) => console.error('SEMVER', ...args)
|
||||
: () => {}
|
||||
|
||||
module.exports = debug
|
||||
23
node_modules/node-notifier/node_modules/semver/internal/identifiers.js
generated
vendored
Normal file
23
node_modules/node-notifier/node_modules/semver/internal/identifiers.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
const numeric = /^[0-9]+$/
|
||||
const compareIdentifiers = (a, b) => {
|
||||
const anum = numeric.test(a)
|
||||
const bnum = numeric.test(b)
|
||||
|
||||
if (anum && bnum) {
|
||||
a = +a
|
||||
b = +b
|
||||
}
|
||||
|
||||
return a === b ? 0
|
||||
: (anum && !bnum) ? -1
|
||||
: (bnum && !anum) ? 1
|
||||
: a < b ? -1
|
||||
: 1
|
||||
}
|
||||
|
||||
const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a)
|
||||
|
||||
module.exports = {
|
||||
compareIdentifiers,
|
||||
rcompareIdentifiers
|
||||
}
|
||||
11
node_modules/node-notifier/node_modules/semver/internal/parse-options.js
generated
vendored
Normal file
11
node_modules/node-notifier/node_modules/semver/internal/parse-options.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
// parse out just the options we care about so we always get a consistent
|
||||
// obj with keys in a consistent order.
|
||||
const opts = ['includePrerelease', 'loose', 'rtl']
|
||||
const parseOptions = options =>
|
||||
!options ? {}
|
||||
: typeof options !== 'object' ? { loose: true }
|
||||
: opts.filter(k => options[k]).reduce((options, k) => {
|
||||
options[k] = true
|
||||
return options
|
||||
}, {})
|
||||
module.exports = parseOptions
|
||||
182
node_modules/node-notifier/node_modules/semver/internal/re.js
generated
vendored
Normal file
182
node_modules/node-notifier/node_modules/semver/internal/re.js
generated
vendored
Normal file
@@ -0,0 +1,182 @@
|
||||
const { MAX_SAFE_COMPONENT_LENGTH } = require('./constants')
|
||||
const debug = require('./debug')
|
||||
exports = module.exports = {}
|
||||
|
||||
// The actual regexps go on exports.re
|
||||
const re = exports.re = []
|
||||
const src = exports.src = []
|
||||
const t = exports.t = {}
|
||||
let R = 0
|
||||
|
||||
const createToken = (name, value, isGlobal) => {
|
||||
const index = R++
|
||||
debug(index, value)
|
||||
t[name] = index
|
||||
src[index] = value
|
||||
re[index] = new RegExp(value, isGlobal ? 'g' : undefined)
|
||||
}
|
||||
|
||||
// The following Regular Expressions can be used for tokenizing,
|
||||
// validating, and parsing SemVer version strings.
|
||||
|
||||
// ## Numeric Identifier
|
||||
// A single `0`, or a non-zero digit followed by zero or more digits.
|
||||
|
||||
createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*')
|
||||
createToken('NUMERICIDENTIFIERLOOSE', '[0-9]+')
|
||||
|
||||
// ## Non-numeric Identifier
|
||||
// Zero or more digits, followed by a letter or hyphen, and then zero or
|
||||
// more letters, digits, or hyphens.
|
||||
|
||||
createToken('NONNUMERICIDENTIFIER', '\\d*[a-zA-Z-][a-zA-Z0-9-]*')
|
||||
|
||||
// ## Main Version
|
||||
// Three dot-separated numeric identifiers.
|
||||
|
||||
createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` +
|
||||
`(${src[t.NUMERICIDENTIFIER]})\\.` +
|
||||
`(${src[t.NUMERICIDENTIFIER]})`)
|
||||
|
||||
createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
|
||||
`(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
|
||||
`(${src[t.NUMERICIDENTIFIERLOOSE]})`)
|
||||
|
||||
// ## Pre-release Version Identifier
|
||||
// A numeric identifier, or a non-numeric identifier.
|
||||
|
||||
createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]
|
||||
}|${src[t.NONNUMERICIDENTIFIER]})`)
|
||||
|
||||
createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]
|
||||
}|${src[t.NONNUMERICIDENTIFIER]})`)
|
||||
|
||||
// ## Pre-release Version
|
||||
// Hyphen, followed by one or more dot-separated pre-release version
|
||||
// identifiers.
|
||||
|
||||
createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]
|
||||
}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`)
|
||||
|
||||
createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]
|
||||
}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`)
|
||||
|
||||
// ## Build Metadata Identifier
|
||||
// Any combination of digits, letters, or hyphens.
|
||||
|
||||
createToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+')
|
||||
|
||||
// ## Build Metadata
|
||||
// Plus sign, followed by one or more period-separated build metadata
|
||||
// identifiers.
|
||||
|
||||
createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER]
|
||||
}(?:\\.${src[t.BUILDIDENTIFIER]})*))`)
|
||||
|
||||
// ## Full Version String
|
||||
// A main version, followed optionally by a pre-release version and
|
||||
// build metadata.
|
||||
|
||||
// Note that the only major, minor, patch, and pre-release sections of
|
||||
// the version string are capturing groups. The build metadata is not a
|
||||
// capturing group, because it should not ever be used in version
|
||||
// comparison.
|
||||
|
||||
createToken('FULLPLAIN', `v?${src[t.MAINVERSION]
|
||||
}${src[t.PRERELEASE]}?${
|
||||
src[t.BUILD]}?`)
|
||||
|
||||
createToken('FULL', `^${src[t.FULLPLAIN]}$`)
|
||||
|
||||
// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
|
||||
// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
|
||||
// common in the npm registry.
|
||||
createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE]
|
||||
}${src[t.PRERELEASELOOSE]}?${
|
||||
src[t.BUILD]}?`)
|
||||
|
||||
createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`)
|
||||
|
||||
createToken('GTLT', '((?:<|>)?=?)')
|
||||
|
||||
// Something like "2.*" or "1.2.x".
|
||||
// Note that "x.x" is a valid xRange identifer, meaning "any version"
|
||||
// Only the first item is strictly required.
|
||||
createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`)
|
||||
createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`)
|
||||
|
||||
createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` +
|
||||
`(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
|
||||
`(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
|
||||
`(?:${src[t.PRERELEASE]})?${
|
||||
src[t.BUILD]}?` +
|
||||
`)?)?`)
|
||||
|
||||
createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +
|
||||
`(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
|
||||
`(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
|
||||
`(?:${src[t.PRERELEASELOOSE]})?${
|
||||
src[t.BUILD]}?` +
|
||||
`)?)?`)
|
||||
|
||||
createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`)
|
||||
createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`)
|
||||
|
||||
// Coercion.
|
||||
// Extract anything that could conceivably be a part of a valid semver
|
||||
createToken('COERCE', `${'(^|[^\\d])' +
|
||||
'(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +
|
||||
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
|
||||
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
|
||||
`(?:$|[^\\d])`)
|
||||
createToken('COERCERTL', src[t.COERCE], true)
|
||||
|
||||
// Tilde ranges.
|
||||
// Meaning is "reasonably at or greater than"
|
||||
createToken('LONETILDE', '(?:~>?)')
|
||||
|
||||
createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true)
|
||||
exports.tildeTrimReplace = '$1~'
|
||||
|
||||
createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`)
|
||||
createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`)
|
||||
|
||||
// Caret ranges.
|
||||
// Meaning is "at least and backwards compatible with"
|
||||
createToken('LONECARET', '(?:\\^)')
|
||||
|
||||
createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true)
|
||||
exports.caretTrimReplace = '$1^'
|
||||
|
||||
createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`)
|
||||
createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`)
|
||||
|
||||
// A simple gt/lt/eq thing, or just "" to indicate "any version"
|
||||
createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`)
|
||||
createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`)
|
||||
|
||||
// An expression to strip any whitespace between the gtlt and the thing
|
||||
// it modifies, so that `> 1.2.3` ==> `>1.2.3`
|
||||
createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT]
|
||||
}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true)
|
||||
exports.comparatorTrimReplace = '$1$2$3'
|
||||
|
||||
// Something like `1.2.3 - 1.2.4`
|
||||
// Note that these all use the loose form, because they'll be
|
||||
// checked against either the strict or loose comparator form
|
||||
// later.
|
||||
createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` +
|
||||
`\\s+-\\s+` +
|
||||
`(${src[t.XRANGEPLAIN]})` +
|
||||
`\\s*$`)
|
||||
|
||||
createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` +
|
||||
`\\s+-\\s+` +
|
||||
`(${src[t.XRANGEPLAINLOOSE]})` +
|
||||
`\\s*$`)
|
||||
|
||||
// Star ranges basically just allow anything at all.
|
||||
createToken('STAR', '(<|>)?=?\\s*\\*')
|
||||
// >=0.0.0 is like a star
|
||||
createToken('GTE0', '^\\s*>=\\s*0\.0\.0\\s*$')
|
||||
createToken('GTE0PRE', '^\\s*>=\\s*0\.0\.0-0\\s*$')
|
||||
41
node_modules/node-notifier/node_modules/semver/package.json
generated
vendored
Normal file
41
node_modules/node-notifier/node_modules/semver/package.json
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"name": "semver",
|
||||
"version": "7.3.4",
|
||||
"description": "The semantic version parser used by npm.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "tap",
|
||||
"snap": "tap",
|
||||
"preversion": "npm test",
|
||||
"postversion": "npm publish",
|
||||
"postpublish": "git push origin --follow-tags"
|
||||
},
|
||||
"devDependencies": {
|
||||
"tap": "^14.10.7"
|
||||
},
|
||||
"license": "ISC",
|
||||
"repository": "https://github.com/npm/node-semver",
|
||||
"bin": {
|
||||
"semver": "bin/semver.js"
|
||||
},
|
||||
"files": [
|
||||
"bin/**/*.js",
|
||||
"range.bnf",
|
||||
"classes/**/*.js",
|
||||
"functions/**/*.js",
|
||||
"internal/**/*.js",
|
||||
"ranges/**/*.js",
|
||||
"index.js",
|
||||
"preload.js"
|
||||
],
|
||||
"tap": {
|
||||
"check-coverage": true,
|
||||
"coverage-map": "map.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"dependencies": {
|
||||
"lru-cache": "^6.0.0"
|
||||
}
|
||||
}
|
||||
2
node_modules/node-notifier/node_modules/semver/preload.js
generated
vendored
Normal file
2
node_modules/node-notifier/node_modules/semver/preload.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
// XXX remove in v8 or beyond
|
||||
module.exports = require('./index.js')
|
||||
16
node_modules/node-notifier/node_modules/semver/range.bnf
generated
vendored
Normal file
16
node_modules/node-notifier/node_modules/semver/range.bnf
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
range-set ::= range ( logical-or range ) *
|
||||
logical-or ::= ( ' ' ) * '||' ( ' ' ) *
|
||||
range ::= hyphen | simple ( ' ' simple ) * | ''
|
||||
hyphen ::= partial ' - ' partial
|
||||
simple ::= primitive | partial | tilde | caret
|
||||
primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
|
||||
partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
|
||||
xr ::= 'x' | 'X' | '*' | nr
|
||||
nr ::= '0' | [1-9] ( [0-9] ) *
|
||||
tilde ::= '~' partial
|
||||
caret ::= '^' partial
|
||||
qualifier ::= ( '-' pre )? ( '+' build )?
|
||||
pre ::= parts
|
||||
build ::= parts
|
||||
parts ::= part ( '.' part ) *
|
||||
part ::= nr | [-0-9A-Za-z]+
|
||||
4
node_modules/node-notifier/node_modules/semver/ranges/gtr.js
generated
vendored
Normal file
4
node_modules/node-notifier/node_modules/semver/ranges/gtr.js
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
// Determine if version is greater than all the versions possible in the range.
|
||||
const outside = require('./outside')
|
||||
const gtr = (version, range, options) => outside(version, range, '>', options)
|
||||
module.exports = gtr
|
||||
7
node_modules/node-notifier/node_modules/semver/ranges/intersects.js
generated
vendored
Normal file
7
node_modules/node-notifier/node_modules/semver/ranges/intersects.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
const Range = require('../classes/range')
|
||||
const intersects = (r1, r2, options) => {
|
||||
r1 = new Range(r1, options)
|
||||
r2 = new Range(r2, options)
|
||||
return r1.intersects(r2)
|
||||
}
|
||||
module.exports = intersects
|
||||
4
node_modules/node-notifier/node_modules/semver/ranges/ltr.js
generated
vendored
Normal file
4
node_modules/node-notifier/node_modules/semver/ranges/ltr.js
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
const outside = require('./outside')
|
||||
// Determine if version is less than all the versions possible in the range
|
||||
const ltr = (version, range, options) => outside(version, range, '<', options)
|
||||
module.exports = ltr
|
||||
25
node_modules/node-notifier/node_modules/semver/ranges/max-satisfying.js
generated
vendored
Normal file
25
node_modules/node-notifier/node_modules/semver/ranges/max-satisfying.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
const SemVer = require('../classes/semver')
|
||||
const Range = require('../classes/range')
|
||||
|
||||
const maxSatisfying = (versions, range, options) => {
|
||||
let max = null
|
||||
let maxSV = null
|
||||
let rangeObj = null
|
||||
try {
|
||||
rangeObj = new Range(range, options)
|
||||
} catch (er) {
|
||||
return null
|
||||
}
|
||||
versions.forEach((v) => {
|
||||
if (rangeObj.test(v)) {
|
||||
// satisfies(v, range, options)
|
||||
if (!max || maxSV.compare(v) === -1) {
|
||||
// compare(max, v, true)
|
||||
max = v
|
||||
maxSV = new SemVer(max, options)
|
||||
}
|
||||
}
|
||||
})
|
||||
return max
|
||||
}
|
||||
module.exports = maxSatisfying
|
||||
24
node_modules/node-notifier/node_modules/semver/ranges/min-satisfying.js
generated
vendored
Normal file
24
node_modules/node-notifier/node_modules/semver/ranges/min-satisfying.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
const SemVer = require('../classes/semver')
|
||||
const Range = require('../classes/range')
|
||||
const minSatisfying = (versions, range, options) => {
|
||||
let min = null
|
||||
let minSV = null
|
||||
let rangeObj = null
|
||||
try {
|
||||
rangeObj = new Range(range, options)
|
||||
} catch (er) {
|
||||
return null
|
||||
}
|
||||
versions.forEach((v) => {
|
||||
if (rangeObj.test(v)) {
|
||||
// satisfies(v, range, options)
|
||||
if (!min || minSV.compare(v) === 1) {
|
||||
// compare(min, v, true)
|
||||
min = v
|
||||
minSV = new SemVer(min, options)
|
||||
}
|
||||
}
|
||||
})
|
||||
return min
|
||||
}
|
||||
module.exports = minSatisfying
|
||||
60
node_modules/node-notifier/node_modules/semver/ranges/min-version.js
generated
vendored
Normal file
60
node_modules/node-notifier/node_modules/semver/ranges/min-version.js
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
const SemVer = require('../classes/semver')
|
||||
const Range = require('../classes/range')
|
||||
const gt = require('../functions/gt')
|
||||
|
||||
const minVersion = (range, loose) => {
|
||||
range = new Range(range, loose)
|
||||
|
||||
let minver = new SemVer('0.0.0')
|
||||
if (range.test(minver)) {
|
||||
return minver
|
||||
}
|
||||
|
||||
minver = new SemVer('0.0.0-0')
|
||||
if (range.test(minver)) {
|
||||
return minver
|
||||
}
|
||||
|
||||
minver = null
|
||||
for (let i = 0; i < range.set.length; ++i) {
|
||||
const comparators = range.set[i]
|
||||
|
||||
let setMin = null
|
||||
comparators.forEach((comparator) => {
|
||||
// Clone to avoid manipulating the comparator's semver object.
|
||||
const compver = new SemVer(comparator.semver.version)
|
||||
switch (comparator.operator) {
|
||||
case '>':
|
||||
if (compver.prerelease.length === 0) {
|
||||
compver.patch++
|
||||
} else {
|
||||
compver.prerelease.push(0)
|
||||
}
|
||||
compver.raw = compver.format()
|
||||
/* fallthrough */
|
||||
case '':
|
||||
case '>=':
|
||||
if (!setMin || gt(compver, setMin)) {
|
||||
setMin = compver
|
||||
}
|
||||
break
|
||||
case '<':
|
||||
case '<=':
|
||||
/* Ignore maximum versions */
|
||||
break
|
||||
/* istanbul ignore next */
|
||||
default:
|
||||
throw new Error(`Unexpected operation: ${comparator.operator}`)
|
||||
}
|
||||
})
|
||||
if (setMin && (!minver || gt(minver, setMin)))
|
||||
minver = setMin
|
||||
}
|
||||
|
||||
if (minver && range.test(minver)) {
|
||||
return minver
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
module.exports = minVersion
|
||||
80
node_modules/node-notifier/node_modules/semver/ranges/outside.js
generated
vendored
Normal file
80
node_modules/node-notifier/node_modules/semver/ranges/outside.js
generated
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
const SemVer = require('../classes/semver')
|
||||
const Comparator = require('../classes/comparator')
|
||||
const {ANY} = Comparator
|
||||
const Range = require('../classes/range')
|
||||
const satisfies = require('../functions/satisfies')
|
||||
const gt = require('../functions/gt')
|
||||
const lt = require('../functions/lt')
|
||||
const lte = require('../functions/lte')
|
||||
const gte = require('../functions/gte')
|
||||
|
||||
const outside = (version, range, hilo, options) => {
|
||||
version = new SemVer(version, options)
|
||||
range = new Range(range, options)
|
||||
|
||||
let gtfn, ltefn, ltfn, comp, ecomp
|
||||
switch (hilo) {
|
||||
case '>':
|
||||
gtfn = gt
|
||||
ltefn = lte
|
||||
ltfn = lt
|
||||
comp = '>'
|
||||
ecomp = '>='
|
||||
break
|
||||
case '<':
|
||||
gtfn = lt
|
||||
ltefn = gte
|
||||
ltfn = gt
|
||||
comp = '<'
|
||||
ecomp = '<='
|
||||
break
|
||||
default:
|
||||
throw new TypeError('Must provide a hilo val of "<" or ">"')
|
||||
}
|
||||
|
||||
// If it satisfies the range it is not outside
|
||||
if (satisfies(version, range, options)) {
|
||||
return false
|
||||
}
|
||||
|
||||
// From now on, variable terms are as if we're in "gtr" mode.
|
||||
// but note that everything is flipped for the "ltr" function.
|
||||
|
||||
for (let i = 0; i < range.set.length; ++i) {
|
||||
const comparators = range.set[i]
|
||||
|
||||
let high = null
|
||||
let low = null
|
||||
|
||||
comparators.forEach((comparator) => {
|
||||
if (comparator.semver === ANY) {
|
||||
comparator = new Comparator('>=0.0.0')
|
||||
}
|
||||
high = high || comparator
|
||||
low = low || comparator
|
||||
if (gtfn(comparator.semver, high.semver, options)) {
|
||||
high = comparator
|
||||
} else if (ltfn(comparator.semver, low.semver, options)) {
|
||||
low = comparator
|
||||
}
|
||||
})
|
||||
|
||||
// If the edge version comparator has a operator then our version
|
||||
// isn't outside it
|
||||
if (high.operator === comp || high.operator === ecomp) {
|
||||
return false
|
||||
}
|
||||
|
||||
// If the lowest version comparator has an operator and our version
|
||||
// is less than it then it isn't higher than the range
|
||||
if ((!low.operator || low.operator === comp) &&
|
||||
ltefn(version, low.semver)) {
|
||||
return false
|
||||
} else if (low.operator === ecomp && ltfn(version, low.semver)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
module.exports = outside
|
||||
44
node_modules/node-notifier/node_modules/semver/ranges/simplify.js
generated
vendored
Normal file
44
node_modules/node-notifier/node_modules/semver/ranges/simplify.js
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
// given a set of versions and a range, create a "simplified" range
|
||||
// that includes the same versions that the original range does
|
||||
// If the original range is shorter than the simplified one, return that.
|
||||
const satisfies = require('../functions/satisfies.js')
|
||||
const compare = require('../functions/compare.js')
|
||||
module.exports = (versions, range, options) => {
|
||||
const set = []
|
||||
let min = null
|
||||
let prev = null
|
||||
const v = versions.sort((a, b) => compare(a, b, options))
|
||||
for (const version of v) {
|
||||
const included = satisfies(version, range, options)
|
||||
if (included) {
|
||||
prev = version
|
||||
if (!min)
|
||||
min = version
|
||||
} else {
|
||||
if (prev) {
|
||||
set.push([min, prev])
|
||||
}
|
||||
prev = null
|
||||
min = null
|
||||
}
|
||||
}
|
||||
if (min)
|
||||
set.push([min, null])
|
||||
|
||||
const ranges = []
|
||||
for (const [min, max] of set) {
|
||||
if (min === max)
|
||||
ranges.push(min)
|
||||
else if (!max && min === v[0])
|
||||
ranges.push('*')
|
||||
else if (!max)
|
||||
ranges.push(`>=${min}`)
|
||||
else if (min === v[0])
|
||||
ranges.push(`<=${max}`)
|
||||
else
|
||||
ranges.push(`${min} - ${max}`)
|
||||
}
|
||||
const simplified = ranges.join(' || ')
|
||||
const original = typeof range.raw === 'string' ? range.raw : String(range)
|
||||
return simplified.length < original.length ? simplified : range
|
||||
}
|
||||
162
node_modules/node-notifier/node_modules/semver/ranges/subset.js
generated
vendored
Normal file
162
node_modules/node-notifier/node_modules/semver/ranges/subset.js
generated
vendored
Normal file
@@ -0,0 +1,162 @@
|
||||
const Range = require('../classes/range.js')
|
||||
const { ANY } = require('../classes/comparator.js')
|
||||
const satisfies = require('../functions/satisfies.js')
|
||||
const compare = require('../functions/compare.js')
|
||||
|
||||
// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff:
|
||||
// - Every simple range `r1, r2, ...` is a subset of some `R1, R2, ...`
|
||||
//
|
||||
// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff:
|
||||
// - If c is only the ANY comparator
|
||||
// - If C is only the ANY comparator, return true
|
||||
// - Else return false
|
||||
// - Let EQ be the set of = comparators in c
|
||||
// - If EQ is more than one, return true (null set)
|
||||
// - Let GT be the highest > or >= comparator in c
|
||||
// - Let LT be the lowest < or <= comparator in c
|
||||
// - If GT and LT, and GT.semver > LT.semver, return true (null set)
|
||||
// - If EQ
|
||||
// - If GT, and EQ does not satisfy GT, return true (null set)
|
||||
// - If LT, and EQ does not satisfy LT, return true (null set)
|
||||
// - If EQ satisfies every C, return true
|
||||
// - Else return false
|
||||
// - If GT
|
||||
// - If GT.semver is lower than any > or >= comp in C, return false
|
||||
// - If GT is >=, and GT.semver does not satisfy every C, return false
|
||||
// - If LT
|
||||
// - If LT.semver is greater than any < or <= comp in C, return false
|
||||
// - If LT is <=, and LT.semver does not satisfy every C, return false
|
||||
// - If any C is a = range, and GT or LT are set, return false
|
||||
// - Else return true
|
||||
|
||||
const subset = (sub, dom, options) => {
|
||||
if (sub === dom)
|
||||
return true
|
||||
|
||||
sub = new Range(sub, options)
|
||||
dom = new Range(dom, options)
|
||||
let sawNonNull = false
|
||||
|
||||
OUTER: for (const simpleSub of sub.set) {
|
||||
for (const simpleDom of dom.set) {
|
||||
const isSub = simpleSubset(simpleSub, simpleDom, options)
|
||||
sawNonNull = sawNonNull || isSub !== null
|
||||
if (isSub)
|
||||
continue OUTER
|
||||
}
|
||||
// the null set is a subset of everything, but null simple ranges in
|
||||
// a complex range should be ignored. so if we saw a non-null range,
|
||||
// then we know this isn't a subset, but if EVERY simple range was null,
|
||||
// then it is a subset.
|
||||
if (sawNonNull)
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
const simpleSubset = (sub, dom, options) => {
|
||||
if (sub === dom)
|
||||
return true
|
||||
|
||||
if (sub.length === 1 && sub[0].semver === ANY)
|
||||
return dom.length === 1 && dom[0].semver === ANY
|
||||
|
||||
const eqSet = new Set()
|
||||
let gt, lt
|
||||
for (const c of sub) {
|
||||
if (c.operator === '>' || c.operator === '>=')
|
||||
gt = higherGT(gt, c, options)
|
||||
else if (c.operator === '<' || c.operator === '<=')
|
||||
lt = lowerLT(lt, c, options)
|
||||
else
|
||||
eqSet.add(c.semver)
|
||||
}
|
||||
|
||||
if (eqSet.size > 1)
|
||||
return null
|
||||
|
||||
let gtltComp
|
||||
if (gt && lt) {
|
||||
gtltComp = compare(gt.semver, lt.semver, options)
|
||||
if (gtltComp > 0)
|
||||
return null
|
||||
else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<='))
|
||||
return null
|
||||
}
|
||||
|
||||
// will iterate one or zero times
|
||||
for (const eq of eqSet) {
|
||||
if (gt && !satisfies(eq, String(gt), options))
|
||||
return null
|
||||
|
||||
if (lt && !satisfies(eq, String(lt), options))
|
||||
return null
|
||||
|
||||
for (const c of dom) {
|
||||
if (!satisfies(eq, String(c), options))
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
let higher, lower
|
||||
let hasDomLT, hasDomGT
|
||||
for (const c of dom) {
|
||||
hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>='
|
||||
hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<='
|
||||
if (gt) {
|
||||
if (c.operator === '>' || c.operator === '>=') {
|
||||
higher = higherGT(gt, c, options)
|
||||
if (higher === c && higher !== gt)
|
||||
return false
|
||||
} else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options))
|
||||
return false
|
||||
}
|
||||
if (lt) {
|
||||
if (c.operator === '<' || c.operator === '<=') {
|
||||
lower = lowerLT(lt, c, options)
|
||||
if (lower === c && lower !== lt)
|
||||
return false
|
||||
} else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options))
|
||||
return false
|
||||
}
|
||||
if (!c.operator && (lt || gt) && gtltComp !== 0)
|
||||
return false
|
||||
}
|
||||
|
||||
// if there was a < or >, and nothing in the dom, then must be false
|
||||
// UNLESS it was limited by another range in the other direction.
|
||||
// Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0
|
||||
if (gt && hasDomLT && !lt && gtltComp !== 0)
|
||||
return false
|
||||
|
||||
if (lt && hasDomGT && !gt && gtltComp !== 0)
|
||||
return false
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
// >=1.2.3 is lower than >1.2.3
|
||||
const higherGT = (a, b, options) => {
|
||||
if (!a)
|
||||
return b
|
||||
const comp = compare(a.semver, b.semver, options)
|
||||
return comp > 0 ? a
|
||||
: comp < 0 ? b
|
||||
: b.operator === '>' && a.operator === '>=' ? b
|
||||
: a
|
||||
}
|
||||
|
||||
// <=1.2.3 is higher than <1.2.3
|
||||
const lowerLT = (a, b, options) => {
|
||||
if (!a)
|
||||
return b
|
||||
const comp = compare(a.semver, b.semver, options)
|
||||
return comp < 0 ? a
|
||||
: comp > 0 ? b
|
||||
: b.operator === '<' && a.operator === '<=' ? b
|
||||
: a
|
||||
}
|
||||
|
||||
module.exports = subset
|
||||
8
node_modules/node-notifier/node_modules/semver/ranges/to-comparators.js
generated
vendored
Normal file
8
node_modules/node-notifier/node_modules/semver/ranges/to-comparators.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
const Range = require('../classes/range')
|
||||
|
||||
// Mostly just for testing and legacy API reasons
|
||||
const toComparators = (range, options) =>
|
||||
new Range(range, options).set
|
||||
.map(comp => comp.map(c => c.value).join(' ').trim().split(' '))
|
||||
|
||||
module.exports = toComparators
|
||||
11
node_modules/node-notifier/node_modules/semver/ranges/valid.js
generated
vendored
Normal file
11
node_modules/node-notifier/node_modules/semver/ranges/valid.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
const Range = require('../classes/range')
|
||||
const validRange = (range, options) => {
|
||||
try {
|
||||
// Return '*' instead of '' so that truthiness works.
|
||||
// This will throw if it's invalid anyway
|
||||
return new Range(range, options).range || '*'
|
||||
} catch (er) {
|
||||
return null
|
||||
}
|
||||
}
|
||||
module.exports = validRange
|
||||
164
node_modules/node-notifier/notifiers/balloon.js
generated
vendored
Normal file
164
node_modules/node-notifier/notifiers/balloon.js
generated
vendored
Normal file
@@ -0,0 +1,164 @@
|
||||
/**
|
||||
* Wrapper for the notifu 1.6 (http://www.paralint.com/projects/notifu/)
|
||||
|
||||
Usage
|
||||
/t <value> The type of message to display values are:
|
||||
info The message is an informational message
|
||||
warn The message is an warning message
|
||||
error The message is an error message
|
||||
/d <value> The number of milliseconds to display (omit or 0 for infinit)
|
||||
/p <value> The title (or prompt) of the ballon
|
||||
/m <value> The message text
|
||||
/i <value> Specify an icon to use ("parent" uses the icon of the parent process)
|
||||
/e Enable ballon tips in the registry (for this user only)
|
||||
/q Do not play a sound when the tooltip is displayed
|
||||
/w Show the tooltip even if the user is in the quiet period that follows his very first login (Windows 7 and up)
|
||||
/xp Use IUserNotification interface event when IUserNotification2 is available
|
||||
/l Display license for notifu
|
||||
|
||||
// Kill codes:
|
||||
2 = Timeout
|
||||
3 = Clicked
|
||||
4 = Closed or faded out
|
||||
|
||||
*/
|
||||
var path = require('path');
|
||||
var notifier = path.resolve(__dirname, '../vendor/notifu/notifu');
|
||||
var checkGrowl = require('../lib/checkGrowl');
|
||||
var utils = require('../lib/utils');
|
||||
var Toaster = require('./toaster');
|
||||
var Growl = require('./growl');
|
||||
var os = require('os');
|
||||
|
||||
var EventEmitter = require('events').EventEmitter;
|
||||
var util = require('util');
|
||||
|
||||
var hasGrowl;
|
||||
|
||||
module.exports = WindowsBalloon;
|
||||
|
||||
function WindowsBalloon(options) {
|
||||
options = utils.clone(options || {});
|
||||
if (!(this instanceof WindowsBalloon)) {
|
||||
return new WindowsBalloon(options);
|
||||
}
|
||||
|
||||
this.options = options;
|
||||
|
||||
EventEmitter.call(this);
|
||||
}
|
||||
util.inherits(WindowsBalloon, EventEmitter);
|
||||
|
||||
function noop() {}
|
||||
function notifyRaw(options, callback) {
|
||||
var fallback;
|
||||
var notifierOptions = this.options;
|
||||
options = utils.clone(options || {});
|
||||
callback = callback || noop;
|
||||
|
||||
if (typeof options === 'string') {
|
||||
options = { title: 'node-notifier', message: options };
|
||||
}
|
||||
|
||||
var actionJackedCallback = utils.actionJackerDecorator(
|
||||
this,
|
||||
options,
|
||||
callback,
|
||||
function(data) {
|
||||
if (data === 'activate') {
|
||||
return 'click';
|
||||
}
|
||||
if (data === 'timeout') {
|
||||
return 'timeout';
|
||||
}
|
||||
return false;
|
||||
}
|
||||
);
|
||||
|
||||
if (!!this.options.withFallback && utils.isWin8()) {
|
||||
fallback = fallback || new Toaster(notifierOptions);
|
||||
return fallback.notify(options, callback);
|
||||
}
|
||||
|
||||
if (
|
||||
!!this.options.withFallback &&
|
||||
(!utils.isLessThanWin8() || hasGrowl === true)
|
||||
) {
|
||||
fallback = fallback || new Growl(notifierOptions);
|
||||
return fallback.notify(options, callback);
|
||||
}
|
||||
|
||||
if (!this.options.withFallback || hasGrowl === false) {
|
||||
doNotification(options, notifierOptions, actionJackedCallback);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkGrowl(notifierOptions, function(_, hasGrowlResult) {
|
||||
hasGrowl = hasGrowlResult;
|
||||
|
||||
if (hasGrowl) {
|
||||
fallback = fallback || new Growl(notifierOptions);
|
||||
return fallback.notify(options, callback);
|
||||
}
|
||||
|
||||
doNotification(options, notifierOptions, actionJackedCallback);
|
||||
});
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
Object.defineProperty(WindowsBalloon.prototype, 'notify', {
|
||||
get: function() {
|
||||
if (!this._notify) this._notify = notifyRaw.bind(this);
|
||||
return this._notify;
|
||||
}
|
||||
});
|
||||
|
||||
var allowedArguments = ['t', 'd', 'p', 'm', 'i', 'e', 'q', 'w', 'xp'];
|
||||
|
||||
function doNotification(options, notifierOptions, callback) {
|
||||
var is64Bit = os.arch() === 'x64';
|
||||
options = options || {};
|
||||
options = utils.mapToNotifu(options);
|
||||
options.p = options.p || 'Node Notification:';
|
||||
|
||||
var fullNotifierPath = notifier + (is64Bit ? '64' : '') + '.exe';
|
||||
var localNotifier = notifierOptions.customPath || fullNotifierPath;
|
||||
|
||||
if (!options.m) {
|
||||
callback(new Error('Message is required.'));
|
||||
return this;
|
||||
}
|
||||
|
||||
var argsList = utils.constructArgumentList(options, {
|
||||
wrapper: '',
|
||||
noEscape: true,
|
||||
explicitTrue: true,
|
||||
allowedArguments: allowedArguments
|
||||
});
|
||||
|
||||
if (options.wait) {
|
||||
return utils.fileCommand(localNotifier, argsList, function(error, data) {
|
||||
var action = fromErrorCodeToAction(error.code);
|
||||
if (action === 'error') return callback(error, data);
|
||||
|
||||
return callback(null, action);
|
||||
});
|
||||
}
|
||||
utils.immediateFileCommand(localNotifier, argsList, callback);
|
||||
}
|
||||
|
||||
function fromErrorCodeToAction(errorCode) {
|
||||
switch (errorCode) {
|
||||
case 2:
|
||||
return 'timeout';
|
||||
case 3:
|
||||
case 6:
|
||||
case 7:
|
||||
return 'activate';
|
||||
case 4:
|
||||
return 'close';
|
||||
default:
|
||||
return 'error';
|
||||
}
|
||||
}
|
||||
83
node_modules/node-notifier/notifiers/growl.js
generated
vendored
Normal file
83
node_modules/node-notifier/notifiers/growl.js
generated
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
/**
|
||||
* Wrapper for the growly module
|
||||
*/
|
||||
var checkGrowl = require('../lib/checkGrowl');
|
||||
var utils = require('../lib/utils');
|
||||
var growly = require('growly');
|
||||
|
||||
var EventEmitter = require('events').EventEmitter;
|
||||
var util = require('util');
|
||||
|
||||
var errorMessageNotFound =
|
||||
"Couldn't connect to growl (might be used as a fallback). Make sure it is running";
|
||||
|
||||
module.exports = Growl;
|
||||
|
||||
var hasGrowl;
|
||||
|
||||
function Growl(options) {
|
||||
options = utils.clone(options || {});
|
||||
if (!(this instanceof Growl)) {
|
||||
return new Growl(options);
|
||||
}
|
||||
|
||||
growly.appname = options.name || 'Node';
|
||||
this.options = options;
|
||||
|
||||
EventEmitter.call(this);
|
||||
}
|
||||
util.inherits(Growl, EventEmitter);
|
||||
|
||||
function notifyRaw(options, callback) {
|
||||
growly.setHost(this.options.host, this.options.port);
|
||||
options = utils.clone(options || {});
|
||||
|
||||
if (typeof options === 'string') {
|
||||
options = { title: 'node-notifier', message: options };
|
||||
}
|
||||
|
||||
callback = utils.actionJackerDecorator(this, options, callback, function(
|
||||
data
|
||||
) {
|
||||
if (data === 'click') {
|
||||
return 'click';
|
||||
}
|
||||
if (data === 'timedout') {
|
||||
return 'timeout';
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
options = utils.mapToGrowl(options);
|
||||
|
||||
if (!options.message) {
|
||||
callback(new Error('Message is required.'));
|
||||
return this;
|
||||
}
|
||||
|
||||
options.title = options.title || 'Node Notification:';
|
||||
|
||||
if (hasGrowl || !!options.wait) {
|
||||
var localCallback = options.wait ? callback : noop;
|
||||
growly.notify(options.message, options, localCallback);
|
||||
if (!options.wait) callback();
|
||||
return this;
|
||||
}
|
||||
|
||||
checkGrowl(growly, function(_, didHaveGrowl) {
|
||||
hasGrowl = didHaveGrowl;
|
||||
if (!didHaveGrowl) return callback(new Error(errorMessageNotFound));
|
||||
growly.notify(options.message, options);
|
||||
callback();
|
||||
});
|
||||
return this;
|
||||
}
|
||||
|
||||
Object.defineProperty(Growl.prototype, 'notify', {
|
||||
get: function() {
|
||||
if (!this._notify) this._notify = notifyRaw.bind(this);
|
||||
return this._notify;
|
||||
}
|
||||
});
|
||||
|
||||
function noop() {}
|
||||
107
node_modules/node-notifier/notifiers/notificationcenter.js
generated
vendored
Normal file
107
node_modules/node-notifier/notifiers/notificationcenter.js
generated
vendored
Normal file
@@ -0,0 +1,107 @@
|
||||
/**
|
||||
* A Node.js wrapper for terminal-notify (with fallback).
|
||||
*/
|
||||
var utils = require('../lib/utils');
|
||||
var Growl = require('./growl');
|
||||
var path = require('path');
|
||||
var notifier = path.join(
|
||||
__dirname,
|
||||
'../vendor/mac.noindex/terminal-notifier.app/Contents/MacOS/terminal-notifier'
|
||||
);
|
||||
|
||||
var EventEmitter = require('events').EventEmitter;
|
||||
var util = require('util');
|
||||
|
||||
var errorMessageOsX =
|
||||
'You need Mac OS X 10.8 or above to use NotificationCenter,' +
|
||||
' or use Growl fallback with constructor option {withFallback: true}.';
|
||||
|
||||
module.exports = NotificationCenter;
|
||||
|
||||
function NotificationCenter(options) {
|
||||
options = utils.clone(options || {});
|
||||
if (!(this instanceof NotificationCenter)) {
|
||||
return new NotificationCenter(options);
|
||||
}
|
||||
this.options = options;
|
||||
|
||||
EventEmitter.call(this);
|
||||
}
|
||||
util.inherits(NotificationCenter, EventEmitter);
|
||||
var activeId = null;
|
||||
|
||||
function noop() {}
|
||||
function notifyRaw(options, callback) {
|
||||
var fallbackNotifier;
|
||||
var id = identificator();
|
||||
options = utils.clone(options || {});
|
||||
activeId = id;
|
||||
|
||||
if (typeof options === 'string') {
|
||||
options = { title: 'node-notifier', message: options };
|
||||
}
|
||||
callback = callback || noop;
|
||||
|
||||
if (typeof callback !== 'function') {
|
||||
throw new TypeError(
|
||||
'The second argument must be a function callback. You have passed ' +
|
||||
typeof fn
|
||||
);
|
||||
}
|
||||
|
||||
var actionJackedCallback = utils.actionJackerDecorator(
|
||||
this,
|
||||
options,
|
||||
callback,
|
||||
function(data) {
|
||||
if (activeId !== id) return false;
|
||||
|
||||
if (data === 'activate') {
|
||||
return 'click';
|
||||
}
|
||||
if (data === 'timeout') {
|
||||
return 'timeout';
|
||||
}
|
||||
if (data === 'replied') {
|
||||
return 'replied';
|
||||
}
|
||||
return false;
|
||||
}
|
||||
);
|
||||
|
||||
options = utils.mapToMac(options);
|
||||
|
||||
if (!options.message && !options.group && !options.list && !options.remove) {
|
||||
callback(new Error('Message, group, remove or list property is required.'));
|
||||
return this;
|
||||
}
|
||||
|
||||
var argsList = utils.constructArgumentList(options);
|
||||
if (utils.isMountainLion()) {
|
||||
utils.fileCommandJson(
|
||||
this.options.customPath || notifier,
|
||||
argsList,
|
||||
actionJackedCallback
|
||||
);
|
||||
return this;
|
||||
}
|
||||
|
||||
if (fallbackNotifier || !!this.options.withFallback) {
|
||||
fallbackNotifier = fallbackNotifier || new Growl(this.options);
|
||||
return fallbackNotifier.notify(options, callback);
|
||||
}
|
||||
|
||||
callback(new Error(errorMessageOsX));
|
||||
return this;
|
||||
}
|
||||
|
||||
Object.defineProperty(NotificationCenter.prototype, 'notify', {
|
||||
get: function() {
|
||||
if (!this._notify) this._notify = notifyRaw.bind(this);
|
||||
return this._notify;
|
||||
}
|
||||
});
|
||||
|
||||
function identificator() {
|
||||
return { _ref: 'val' };
|
||||
}
|
||||
101
node_modules/node-notifier/notifiers/notifysend.js
generated
vendored
Normal file
101
node_modules/node-notifier/notifiers/notifysend.js
generated
vendored
Normal file
@@ -0,0 +1,101 @@
|
||||
/**
|
||||
* Node.js wrapper for "notify-send".
|
||||
*/
|
||||
var os = require('os');
|
||||
var which = require('which');
|
||||
var utils = require('../lib/utils');
|
||||
|
||||
var EventEmitter = require('events').EventEmitter;
|
||||
var util = require('util');
|
||||
|
||||
var notifier = 'notify-send';
|
||||
var hasNotifier;
|
||||
|
||||
module.exports = NotifySend;
|
||||
|
||||
function NotifySend(options) {
|
||||
options = utils.clone(options || {});
|
||||
if (!(this instanceof NotifySend)) {
|
||||
return new NotifySend(options);
|
||||
}
|
||||
|
||||
this.options = options;
|
||||
|
||||
EventEmitter.call(this);
|
||||
}
|
||||
util.inherits(NotifySend, EventEmitter);
|
||||
|
||||
function noop() {}
|
||||
function notifyRaw(options, callback) {
|
||||
options = utils.clone(options || {});
|
||||
callback = callback || noop;
|
||||
|
||||
if (typeof callback !== 'function') {
|
||||
throw new TypeError(
|
||||
'The second argument must be a function callback. You have passed ' +
|
||||
typeof callback
|
||||
);
|
||||
}
|
||||
|
||||
if (typeof options === 'string') {
|
||||
options = { title: 'node-notifier', message: options };
|
||||
}
|
||||
|
||||
if (!options.message) {
|
||||
callback(new Error('Message is required.'));
|
||||
return this;
|
||||
}
|
||||
|
||||
if (os.type() !== 'Linux' && !os.type().match(/BSD$/)) {
|
||||
callback(new Error('Only supported on Linux and *BSD systems'));
|
||||
return this;
|
||||
}
|
||||
|
||||
if (hasNotifier === false) {
|
||||
callback(new Error('notify-send must be installed on the system.'));
|
||||
return this;
|
||||
}
|
||||
|
||||
if (hasNotifier || !!this.options.suppressOsdCheck) {
|
||||
doNotification(options, callback);
|
||||
return this;
|
||||
}
|
||||
|
||||
try {
|
||||
hasNotifier = !!which.sync(notifier);
|
||||
doNotification(options, callback);
|
||||
} catch (err) {
|
||||
hasNotifier = false;
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
Object.defineProperty(NotifySend.prototype, 'notify', {
|
||||
get: function() {
|
||||
if (!this._notify) this._notify = notifyRaw.bind(this);
|
||||
return this._notify;
|
||||
}
|
||||
});
|
||||
|
||||
var allowedArguments = ['urgency', 'expire-time', 'icon', 'category', 'hint', 'app-name'];
|
||||
|
||||
function doNotification(options, callback) {
|
||||
var initial, argsList;
|
||||
|
||||
options = utils.mapToNotifySend(options);
|
||||
options.title = options.title || 'Node Notification:';
|
||||
|
||||
initial = [options.title, options.message];
|
||||
delete options.title;
|
||||
delete options.message;
|
||||
|
||||
argsList = utils.constructArgumentList(options, {
|
||||
initial: initial,
|
||||
keyExtra: '-',
|
||||
allowedArguments: allowedArguments
|
||||
});
|
||||
|
||||
utils.command(notifier, argsList, callback);
|
||||
}
|
||||
160
node_modules/node-notifier/notifiers/toaster.js
generated
vendored
Normal file
160
node_modules/node-notifier/notifiers/toaster.js
generated
vendored
Normal file
@@ -0,0 +1,160 @@
|
||||
/**
|
||||
* Wrapper for the toaster (https://github.com/nels-o/toaster)
|
||||
*/
|
||||
var path = require('path');
|
||||
var notifier = path.resolve(__dirname, '../vendor/snoreToast/snoretoast');
|
||||
var utils = require('../lib/utils');
|
||||
var Balloon = require('./balloon');
|
||||
var os = require('os');
|
||||
const { v4: uuid } = require('uuid');
|
||||
|
||||
var EventEmitter = require('events').EventEmitter;
|
||||
var util = require('util');
|
||||
|
||||
var fallback;
|
||||
|
||||
const PIPE_NAME = 'notifierPipe';
|
||||
const PIPE_PATH_PREFIX = '\\\\.\\pipe\\';
|
||||
|
||||
module.exports = WindowsToaster;
|
||||
|
||||
function WindowsToaster(options) {
|
||||
options = utils.clone(options || {});
|
||||
if (!(this instanceof WindowsToaster)) {
|
||||
return new WindowsToaster(options);
|
||||
}
|
||||
|
||||
this.options = options;
|
||||
|
||||
EventEmitter.call(this);
|
||||
}
|
||||
util.inherits(WindowsToaster, EventEmitter);
|
||||
|
||||
function noop() {}
|
||||
|
||||
function parseResult(data) {
|
||||
if (!data) {
|
||||
return {};
|
||||
}
|
||||
return data.split(';').reduce((acc, cur) => {
|
||||
const split = cur.split('=');
|
||||
if (split && split.length === 2) {
|
||||
acc[split[0]] = split[1];
|
||||
}
|
||||
return acc;
|
||||
}, {});
|
||||
}
|
||||
|
||||
function getPipeName() {
|
||||
return `${PIPE_PATH_PREFIX}${PIPE_NAME}-${uuid()}`;
|
||||
}
|
||||
|
||||
function notifyRaw(options, callback) {
|
||||
options = utils.clone(options || {});
|
||||
callback = callback || noop;
|
||||
var is64Bit = os.arch() === 'x64';
|
||||
var resultBuffer;
|
||||
const server = {
|
||||
namedPipe: getPipeName()
|
||||
};
|
||||
|
||||
if (typeof options === 'string') {
|
||||
options = { title: 'node-notifier', message: options };
|
||||
}
|
||||
|
||||
if (typeof callback !== 'function') {
|
||||
throw new TypeError(
|
||||
'The second argument must be a function callback. You have passed ' +
|
||||
typeof fn
|
||||
);
|
||||
}
|
||||
|
||||
var snoreToastResultParser = (err, callback) => {
|
||||
/* Possible exit statuses from SnoreToast, we only want to include err if it's -1 code
|
||||
Exit Status : Exit Code
|
||||
Failed : -1
|
||||
|
||||
Success : 0
|
||||
Hidden : 1
|
||||
Dismissed : 2
|
||||
TimedOut : 3
|
||||
ButtonPressed : 4
|
||||
TextEntered : 5
|
||||
*/
|
||||
const result = parseResult(
|
||||
resultBuffer && resultBuffer.toString('utf16le')
|
||||
);
|
||||
|
||||
// parse action
|
||||
if (result.action === 'buttonClicked' && result.button) {
|
||||
result.activationType = result.button;
|
||||
} else if (result.action) {
|
||||
result.activationType = result.action;
|
||||
}
|
||||
|
||||
if (err && err.code === -1) {
|
||||
callback(err, result);
|
||||
}
|
||||
callback(null, result);
|
||||
|
||||
// https://github.com/mikaelbr/node-notifier/issues/334
|
||||
// Due to an issue with snoretoast not using stdio and pipe
|
||||
// when notifications are disabled, make sure named pipe server
|
||||
// is closed before exiting.
|
||||
server.instance && server.instance.close();
|
||||
};
|
||||
|
||||
var actionJackedCallback = (err) =>
|
||||
snoreToastResultParser(
|
||||
err,
|
||||
utils.actionJackerDecorator(
|
||||
this,
|
||||
options,
|
||||
callback,
|
||||
(data) => data || false
|
||||
)
|
||||
);
|
||||
|
||||
options.title = options.title || 'Node Notification:';
|
||||
if (
|
||||
typeof options.message === 'undefined' &&
|
||||
typeof options.close === 'undefined'
|
||||
) {
|
||||
callback(new Error('Message or ID to close is required.'));
|
||||
return this;
|
||||
}
|
||||
|
||||
if (!utils.isWin8() && !utils.isWSL() && !!this.options.withFallback) {
|
||||
fallback = fallback || new Balloon(this.options);
|
||||
return fallback.notify(options, callback);
|
||||
}
|
||||
|
||||
// Add pipeName option, to get the output
|
||||
utils.createNamedPipe(server).then((out) => {
|
||||
resultBuffer = out;
|
||||
options.pipeName = server.namedPipe;
|
||||
|
||||
options = utils.mapToWin8(options);
|
||||
var argsList = utils.constructArgumentList(options, {
|
||||
explicitTrue: true,
|
||||
wrapper: '',
|
||||
keepNewlines: true,
|
||||
noEscape: true
|
||||
});
|
||||
|
||||
var notifierWithArch = notifier + '-x' + (is64Bit ? '64' : '86') + '.exe';
|
||||
utils.fileCommand(
|
||||
this.options.customPath || notifierWithArch,
|
||||
argsList,
|
||||
actionJackedCallback
|
||||
);
|
||||
});
|
||||
return this;
|
||||
}
|
||||
|
||||
Object.defineProperty(WindowsToaster.prototype, 'notify', {
|
||||
get: function () {
|
||||
if (!this._notify) this._notify = notifyRaw.bind(this);
|
||||
return this._notify;
|
||||
}
|
||||
});
|
||||
80
node_modules/node-notifier/package.json
generated
vendored
Normal file
80
node_modules/node-notifier/package.json
generated
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
{
|
||||
"name": "node-notifier",
|
||||
"version": "8.0.1",
|
||||
"description": "A Node.js module for sending notifications on native Mac, Windows (post and pre 8) and Linux (or Growl as fallback)",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"pretest": "npm run lint",
|
||||
"test": "jest",
|
||||
"example": "node ./example/message.js",
|
||||
"example:mac": "node ./example/advanced.js",
|
||||
"example:mac:input": "node ./example/macInput.js",
|
||||
"example:windows": "node ./example/toaster.js",
|
||||
"example:windows:actions": "node ./example/toaster-with-actions.js",
|
||||
"lint": "eslint example/*.js lib/*.js notifiers/*.js test/**/*.js index.js"
|
||||
},
|
||||
"jest": {
|
||||
"testRegex": "/test/[^_]*.js",
|
||||
"testEnvironment": "node",
|
||||
"setupFilesAfterEnv": [
|
||||
"./test/_test-matchers.js"
|
||||
]
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+ssh://git@github.com/mikaelbr/node-notifier.git"
|
||||
},
|
||||
"keywords": [
|
||||
"notification center",
|
||||
"mac os x 10.8",
|
||||
"notify",
|
||||
"terminal-notifier",
|
||||
"notify-send",
|
||||
"growl",
|
||||
"windows 8 notification",
|
||||
"toaster",
|
||||
"notification"
|
||||
],
|
||||
"author": "Mikael Brevik",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"eslint": "^7.6.0",
|
||||
"eslint-config-semistandard": "^15.0.1",
|
||||
"eslint-config-standard": "^14.1.1",
|
||||
"eslint-plugin-import": "^2.22.0",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"eslint-plugin-promise": "^4.2.1",
|
||||
"eslint-plugin-standard": "^4.0.1",
|
||||
"husky": "^4.2.5",
|
||||
"jest": "^26.4.0",
|
||||
"lint-staged": "^10.2.11",
|
||||
"prettier": "^2.0.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"growly": "^1.3.0",
|
||||
"is-wsl": "^2.2.0",
|
||||
"semver": "^7.3.2",
|
||||
"shellwords": "^0.1.1",
|
||||
"uuid": "^8.3.0",
|
||||
"which": "^2.0.2"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{js,json,css,md}": [
|
||||
"prettier --write",
|
||||
"git add"
|
||||
]
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/mikaelbr/node-notifier/issues"
|
||||
},
|
||||
"homepage": "https://github.com/mikaelbr/node-notifier#readme",
|
||||
"directories": {
|
||||
"example": "example",
|
||||
"test": "test"
|
||||
}
|
||||
}
|
||||
63
node_modules/node-notifier/vendor/mac.noindex/terminal-notifier.app/Contents/Info.plist
generated
vendored
Normal file
63
node_modules/node-notifier/vendor/mac.noindex/terminal-notifier.app/Contents/Info.plist
generated
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>BuildMachineOSBuild</key>
|
||||
<string>16E195</string>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>terminal-notifier</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>Terminal</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>nl.superalloy.oss.terminal-notifier</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>terminal-notifier</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.7.2</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleSupportedPlatforms</key>
|
||||
<array>
|
||||
<string>MacOSX</string>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>17</string>
|
||||
<key>DTCompiler</key>
|
||||
<string>com.apple.compilers.llvm.clang.1_0</string>
|
||||
<key>DTPlatformBuild</key>
|
||||
<string>8B62</string>
|
||||
<key>DTPlatformVersion</key>
|
||||
<string>GM</string>
|
||||
<key>DTSDKBuild</key>
|
||||
<string>16B2649</string>
|
||||
<key>DTSDKName</key>
|
||||
<string>macosx10.12</string>
|
||||
<key>DTXcode</key>
|
||||
<string>0810</string>
|
||||
<key>DTXcodeBuild</key>
|
||||
<string>8B62</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>10.8</string>
|
||||
<key>LSUIElement</key>
|
||||
<true/>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2012-2016 Eloy Durán, Julien Blanchard. All rights reserved.</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
<key>NSUserNotificationAlertStyle</key>
|
||||
<string>alert</string>
|
||||
</dict>
|
||||
</plist>
|
||||
BIN
node_modules/node-notifier/vendor/mac.noindex/terminal-notifier.app/Contents/MacOS/terminal-notifier
generated
vendored
Executable file
BIN
node_modules/node-notifier/vendor/mac.noindex/terminal-notifier.app/Contents/MacOS/terminal-notifier
generated
vendored
Executable file
Binary file not shown.
1
node_modules/node-notifier/vendor/mac.noindex/terminal-notifier.app/Contents/PkgInfo
generated
vendored
Normal file
1
node_modules/node-notifier/vendor/mac.noindex/terminal-notifier.app/Contents/PkgInfo
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
APPL????
|
||||
BIN
node_modules/node-notifier/vendor/mac.noindex/terminal-notifier.app/Contents/Resources/Terminal.icns
generated
vendored
Normal file
BIN
node_modules/node-notifier/vendor/mac.noindex/terminal-notifier.app/Contents/Resources/Terminal.icns
generated
vendored
Normal file
Binary file not shown.
29
node_modules/node-notifier/vendor/mac.noindex/terminal-notifier.app/Contents/Resources/en.lproj/Credits.rtf
generated
vendored
Normal file
29
node_modules/node-notifier/vendor/mac.noindex/terminal-notifier.app/Contents/Resources/en.lproj/Credits.rtf
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
\paperw9840\paperh8400
|
||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
|
||||
|
||||
\f0\b\fs24 \cf0 Engineering:
|
||||
\b0 \
|
||||
Some people\
|
||||
\
|
||||
|
||||
\b Human Interface Design:
|
||||
\b0 \
|
||||
Some other people\
|
||||
\
|
||||
|
||||
\b Testing:
|
||||
\b0 \
|
||||
Hopefully not nobody\
|
||||
\
|
||||
|
||||
\b Documentation:
|
||||
\b0 \
|
||||
Whoever\
|
||||
\
|
||||
|
||||
\b With special thanks to:
|
||||
\b0 \
|
||||
Mom\
|
||||
}
|
||||
BIN
node_modules/node-notifier/vendor/mac.noindex/terminal-notifier.app/Contents/Resources/en.lproj/InfoPlist.strings
generated
vendored
Normal file
BIN
node_modules/node-notifier/vendor/mac.noindex/terminal-notifier.app/Contents/Resources/en.lproj/InfoPlist.strings
generated
vendored
Normal file
Binary file not shown.
BIN
node_modules/node-notifier/vendor/mac.noindex/terminal-notifier.app/Contents/Resources/en.lproj/MainMenu.nib
generated
vendored
Normal file
BIN
node_modules/node-notifier/vendor/mac.noindex/terminal-notifier.app/Contents/Resources/en.lproj/MainMenu.nib
generated
vendored
Normal file
Binary file not shown.
25
node_modules/node-notifier/vendor/notifu/LICENSE
generated
vendored
Normal file
25
node_modules/node-notifier/vendor/notifu/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
// Retrieved from notifu 1.7.0 ( http://www.paralint.com/projects/notifu/index.html )
|
||||
Copyright (c) 2019, Solutions Paralint inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the <organization> nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
BIN
node_modules/node-notifier/vendor/notifu/notifu.exe
generated
vendored
Executable file
BIN
node_modules/node-notifier/vendor/notifu/notifu.exe
generated
vendored
Executable file
Binary file not shown.
BIN
node_modules/node-notifier/vendor/notifu/notifu64.exe
generated
vendored
Executable file
BIN
node_modules/node-notifier/vendor/notifu/notifu64.exe
generated
vendored
Executable file
Binary file not shown.
166
node_modules/node-notifier/vendor/snoreToast/LICENSE
generated
vendored
Normal file
166
node_modules/node-notifier/vendor/snoreToast/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,166 @@
|
||||
// Retrieved from https://github.com/KDE/snoretoast/blob/master/COPYING.LGPL-3 version 0.7.0
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
||||
BIN
node_modules/node-notifier/vendor/snoreToast/snoretoast-x64.exe
generated
vendored
Normal file
BIN
node_modules/node-notifier/vendor/snoreToast/snoretoast-x64.exe
generated
vendored
Normal file
Binary file not shown.
BIN
node_modules/node-notifier/vendor/snoreToast/snoretoast-x86.exe
generated
vendored
Normal file
BIN
node_modules/node-notifier/vendor/snoreToast/snoretoast-x86.exe
generated
vendored
Normal file
Binary file not shown.
9
node_modules/node-notifier/vendor/terminal-notifier-LICENSE
generated
vendored
Normal file
9
node_modules/node-notifier/vendor/terminal-notifier-LICENSE
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
All the works are available under the MIT license. Except for ‘Terminal.icns’, which is a copy of Apple’s Terminal.app icon and as such is copyright of Apple.
|
||||
|
||||
Copyright (C) 2012-2016 Eloy Durán eloy.de.enige@gmail.com, Julien Blanchard julien@sideburns.eu
|
||||
|
||||
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.
|
||||
Reference in New Issue
Block a user