From 27554b3fa229675e12c9a63852a851a2b54c2624 Mon Sep 17 00:00:00 2001 From: Kira Sotnikov Date: Tue, 26 Nov 2024 23:51:02 +0300 Subject: [PATCH 1/7] WIP grpc API xray --- Cargo.lock | 433 +++++++++++++++++-- Cargo.toml | 9 + build.rs | 38 ++ proto-api-files-sync.sh | 40 ++ proto-files-sync.sh | 28 ++ src/main.rs | 1 + src/proto/app/log/command/config.proto | 17 + src/proto/app/log/config.proto | 27 ++ src/proto/app/proxyman/command/command.proto | 90 ++++ src/proto/app/proxyman/config.proto | 98 +++++ src/proto/app/stats/command/command.proto | 56 +++ src/proto/app/stats/config.proto | 15 + src/proto/common/log/log.proto | 15 + src/proto/common/net/address.proto | 19 + src/proto/common/net/port.proto | 20 + src/proto/common/protocol/user.proto | 19 + src/proto/common/serial/typed_message.proto | 15 + src/proto/core/config.proto | 57 +++ src/proto/transport/internet/config.proto | 119 +++++ src/xray_api/app/mod.rs | 3 + src/xray_api/common/mod.rs | 12 + src/xray_api/mod.rs | 45 ++ src/xray_api/transport/mod.rs | 1 + 23 files changed, 1149 insertions(+), 28 deletions(-) create mode 100644 build.rs create mode 100755 proto-api-files-sync.sh create mode 100755 proto-files-sync.sh create mode 100644 src/proto/app/log/command/config.proto create mode 100644 src/proto/app/log/config.proto create mode 100644 src/proto/app/proxyman/command/command.proto create mode 100644 src/proto/app/proxyman/config.proto create mode 100644 src/proto/app/stats/command/command.proto create mode 100644 src/proto/app/stats/config.proto create mode 100644 src/proto/common/log/log.proto create mode 100644 src/proto/common/net/address.proto create mode 100644 src/proto/common/net/port.proto create mode 100644 src/proto/common/protocol/user.proto create mode 100644 src/proto/common/serial/typed_message.proto create mode 100644 src/proto/core/config.proto create mode 100644 src/proto/transport/internet/config.proto create mode 100644 src/xray_api/app/mod.rs create mode 100644 src/xray_api/common/mod.rs create mode 100644 src/xray_api/mod.rs create mode 100644 src/xray_api/transport/mod.rs diff --git a/Cargo.lock b/Cargo.lock index d58729e7..c7424e7f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -65,7 +65,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" dependencies = [ "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -182,7 +182,7 @@ dependencies = [ "actix-router", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -316,6 +316,34 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "anyhow" +version = "1.0.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" + +[[package]] +name = "async-stream" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "async-trait" version = "0.1.83" @@ -324,7 +352,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -339,6 +367,53 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +[[package]] +name = "axum" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" +dependencies = [ + "async-trait", + "axum-core", + "bytes", + "futures-util", + "http 1.1.0", + "http-body", + "http-body-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "sync_wrapper 1.0.1", + "tower 0.5.1", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-core" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http 1.1.0", + "http-body", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper 1.0.1", + "tower-layer", + "tower-service", +] + [[package]] name = "backtrace" version = "0.3.74" @@ -521,7 +596,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -564,7 +639,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -733,7 +808,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -801,6 +876,12 @@ dependencies = [ "log", ] +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + [[package]] name = "flate2" version = "1.0.34" @@ -897,7 +978,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -969,7 +1050,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap", + "indexmap 2.6.0", "slab", "tokio", "tokio-util", @@ -988,13 +1069,19 @@ dependencies = [ "futures-core", "futures-sink", "http 1.1.0", - "indexmap", + "indexmap 2.6.0", "slab", "tokio", "tokio-util", "tracing", ] +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + [[package]] name = "hashbrown" version = "0.13.2" @@ -1095,6 +1182,7 @@ dependencies = [ "http 1.1.0", "http-body", "httparse", + "httpdate", "itoa", "pin-project-lite", "smallvec", @@ -1119,6 +1207,19 @@ dependencies = [ "tower-service", ] +[[package]] +name = "hyper-timeout" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0" +dependencies = [ + "hyper", + "hyper-util", + "pin-project-lite", + "tokio", + "tower-service", +] + [[package]] name = "hyper-tls" version = "0.6.0" @@ -1137,9 +1238,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" dependencies = [ "bytes", "futures-channel", @@ -1193,6 +1294,16 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e658178c10c747241199382079c0f195ce229866fbf4aa0d46fa6107fe33d2ec" +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", +] + [[package]] name = "indexmap" version = "2.6.0" @@ -1215,6 +1326,15 @@ version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.11" @@ -1319,6 +1439,12 @@ version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75761162ae2b0e580d7e7c390558127e5f01b4194debd6221fd8c207fc80e3f5" +[[package]] +name = "matchit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + [[package]] name = "memchr" version = "2.7.4" @@ -1359,6 +1485,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "multimap" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" + [[package]] name = "native-tls" version = "0.2.12" @@ -1473,7 +1605,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -1586,7 +1718,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -1600,6 +1732,36 @@ dependencies = [ "sha2", ] +[[package]] +name = "petgraph" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +dependencies = [ + "fixedbitset", + "indexmap 2.6.0", +] + +[[package]] +name = "pin-project" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "pin-project-lite" version = "0.2.14" @@ -1633,6 +1795,8 @@ dependencies = [ "log", "netstat2", "openssl", + "prost", + "prost-derive", "reqwest", "serde", "serde_json", @@ -1640,6 +1804,9 @@ dependencies = [ "time", "tokio", "toml 0.7.8", + "tonic", + "tonic-build", + "walkdir", ] [[package]] @@ -1657,6 +1824,16 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "prettyplease" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" +dependencies = [ + "proc-macro2", + "syn 2.0.87", +] + [[package]] name = "proc-macro2" version = "1.0.87" @@ -1666,6 +1843,59 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "prost" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b0487d90e047de87f984913713b85c601c05609aad5b0df4b4573fbf69aa13f" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-build" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c1318b19085f08681016926435853bbf7858f9c082d0999b80550ff5d9abe15" +dependencies = [ + "bytes", + "heck 0.5.0", + "itertools", + "log", + "multimap", + "once_cell", + "petgraph", + "prettyplease", + "prost", + "prost-types", + "regex", + "syn 2.0.87", + "tempfile", +] + +[[package]] +name = "prost-derive" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9552f850d5f0964a4e4d0bf306459ac29323ddfbae05e35a7c0d35cb0803cc5" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "prost-types" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4759aa0d3a6232fb8dbdb97b61de2c20047c68aca932c7ed76da9d788508d670" +dependencies = [ + "prost", +] + [[package]] name = "quote" version = "1.0.37" @@ -1806,7 +2036,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", + "sync_wrapper 1.0.1", "system-configuration", "tokio", "tokio-native-tls", @@ -1922,12 +2152,27 @@ dependencies = [ "untrusted", ] +[[package]] +name = "rustversion" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" + [[package]] name = "ryu" version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + [[package]] name = "schannel" version = "0.1.26" @@ -1952,7 +2197,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -2001,7 +2246,7 @@ checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -2012,7 +2257,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -2147,15 +2392,21 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.79" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + [[package]] name = "sync_wrapper" version = "1.0.1" @@ -2230,7 +2481,7 @@ checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -2314,7 +2565,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -2338,6 +2589,17 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-stream" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + [[package]] name = "tokio-util" version = "0.7.12" @@ -2390,7 +2652,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap", + "indexmap 2.6.0", "serde", "serde_spanned", "toml_datetime", @@ -2403,13 +2665,97 @@ version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "indexmap", + "indexmap 2.6.0", "serde", "serde_spanned", "toml_datetime", "winnow 0.6.20", ] +[[package]] +name = "tonic" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52" +dependencies = [ + "async-stream", + "async-trait", + "axum", + "base64 0.22.1", + "bytes", + "h2 0.4.6", + "http 1.1.0", + "http-body", + "http-body-util", + "hyper", + "hyper-timeout", + "hyper-util", + "percent-encoding", + "pin-project", + "prost", + "socket2", + "tokio", + "tokio-stream", + "tower 0.4.13", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tonic-build" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9557ce109ea773b399c9b9e5dca39294110b74f1f342cb347a80d1fce8c26a11" +dependencies = [ + "prettyplease", + "proc-macro2", + "prost-build", + "prost-types", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "indexmap 1.9.3", + "pin-project", + "pin-project-lite", + "rand", + "slab", + "tokio", + "tokio-util", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2873938d487c3cfb9aed7546dc9f2711d867c9f90c46b889989a2cb84eba6b4f" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper 0.1.2", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + [[package]] name = "tower-service" version = "0.3.3" @@ -2424,9 +2770,21 @@ checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ "log", "pin-project-lite", + "tracing-attributes", "tracing-core", ] +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "tracing-core" version = "0.1.32" @@ -2516,6 +2874,16 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + [[package]] name = "want" version = "0.3.1" @@ -2553,7 +2921,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", "wasm-bindgen-shared", ] @@ -2587,7 +2955,7 @@ checksum = "4c74f6e152a76a2ad448e223b0fc0b6b5747649c3d769cc6bf45737bf97d0ed6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2624,6 +2992,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys 0.59.0", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -2669,7 +3046,7 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -2680,7 +3057,7 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -2849,7 +3226,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 5d21d672..f964fae5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,7 @@ name = "pony" version = "0.0.23" edition = "2021" +build = "build.rs" [dependencies] sysinfo = "0.31.4" @@ -22,3 +23,11 @@ actix-web-httpauth = "0.7" clickhouse = "0.13.0" clap = { version = "4.0", features = ["derive"] } time = "0.3" +tonic = "0.12" +prost = "0.13" +prost-derive = "0.13" + +[build-dependencies] +tonic-build = "0.12" +walkdir = "2.0" + diff --git a/build.rs b/build.rs new file mode 100644 index 00000000..bae3cf6b --- /dev/null +++ b/build.rs @@ -0,0 +1,38 @@ +use std::fs; +use tonic_build; +use walkdir::WalkDir; + +fn main() { + // Указываем директорию с .proto файлами + let proto_dir = "src/proto"; + + // Используем WalkDir для рекурсивного поиска всех .proto файлов + let proto_files: Vec = WalkDir::new(proto_dir) + .into_iter() + .filter_map(|entry| entry.ok()) // Игнорируем ошибки + .filter(|entry| { + entry + .path() + .extension() + .map(|ext| ext == "proto") + .unwrap_or(false) + }) // Оставляем только .proto файлы + .map(|entry| entry.path().to_str().unwrap().to_string()) // Преобразуем путь в строку + .collect(); + + let out_dir = "src/xray_api"; + + if let Err(e) = fs::create_dir_all(out_dir) { + eprintln!("Failed to create directory {:?}: {}", out_dir, e); + std::process::exit(1); + } + + // Компилируем все найденные .proto файлы + tonic_build::configure() + .build_client(true) // Генерируем код для клиента + .build_server(false) // Не генерируем код для сервера (если он не нужен) + .compile_protos(&proto_files, &[proto_dir]) // Указываем все .proto файлы и исходную директорию + .unwrap_or_else(|e| panic!("Failed to compile protos {:?}", e)); + + println!("cargo:rerun-if-changed={}", proto_dir); // Перегенерация при изменении файлов в директории +} diff --git a/proto-api-files-sync.sh b/proto-api-files-sync.sh new file mode 100755 index 00000000..989baecb --- /dev/null +++ b/proto-api-files-sync.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +### The script syncs specific API .proto files from Xray-core repo to dst dir ./src/proto + +if [ "$#" -ne 1 ]; then + echo "Usage: $0 " + exit 1 +fi + +SOURCE_DIR="$1" +DEST_DIR="./src/proto" + +if [ ! -d "$SOURCE_DIR" ]; then + echo "Error: Source directory '$SOURCE_DIR' does not exist." + exit 1 +fi + +FILES_TO_COPY=( + "app/proxyman/command/command.proto" + "app/proxyman/config.proto" + "common/protocol/user.proto" + "common/serial/typed_message.proto" + "core/config.proto" + "common/net/address.proto" + "common/net/port.proto" + "transport/internet/config.proto" + "app/log/command/config.proto" + "app/log/config.proto" + "common/log/log.proto" + "app/stats/command/command.proto" + "app/stats/config.proto" +) + +for file in "${FILES_TO_COPY[@]}"; do + dest_file="$DEST_DIR/$file" + mkdir -p "$(dirname "$dest_file")" + cp "$SOURCE_DIR/$file" "$dest_file" +done + +echo "Copying completed." diff --git a/proto-files-sync.sh b/proto-files-sync.sh new file mode 100755 index 00000000..fdb5c2c3 --- /dev/null +++ b/proto-files-sync.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +if [ "$#" -ne 1 ]; then + echo "Usage: $0 " + exit 1 +fi + +SOURCE_DIR="$1" +DEST_DIR="src/proto" + +if [ ! -d "$SOURCE_DIR" ]; then + echo "Error: Source directory '$SOURCE_DIR' does not exist." + exit 1 +fi + +mkdir -p "$DEST_DIR" + +find "$SOURCE_DIR" -type f -name "*.proto" | while read -r file; do + relative_path="${file#$SOURCE_DIR/}" + + target_path="$DEST_DIR/$relative_path" + + mkdir -p "$(dirname "$target_path")" + + cp "$file" "$target_path" +done + +echo "Copying completed." diff --git a/src/main.rs b/src/main.rs index 07389eb1..b6b5df72 100644 --- a/src/main.rs +++ b/src/main.rs @@ -22,6 +22,7 @@ mod metrics; mod utils; mod web; mod webhook; +mod xray_api; use crate::bandwidth::bandwidth_metrics; use crate::config2::{read_config, Settings}; diff --git a/src/proto/app/log/command/config.proto b/src/proto/app/log/command/config.proto new file mode 100644 index 00000000..2ebf40aa --- /dev/null +++ b/src/proto/app/log/command/config.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +package xray.app.log.command; +option csharp_namespace = "Xray.App.Log.Command"; +option go_package = "github.com/xtls/xray-core/app/log/command"; +option java_package = "com.xray.app.log.command"; +option java_multiple_files = true; + +message Config {} + +message RestartLoggerRequest {} + +message RestartLoggerResponse {} + +service LoggerService { + rpc RestartLogger(RestartLoggerRequest) returns (RestartLoggerResponse) {} +} diff --git a/src/proto/app/log/config.proto b/src/proto/app/log/config.proto new file mode 100644 index 00000000..8dc729d0 --- /dev/null +++ b/src/proto/app/log/config.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; + +package xray.app.log; +option csharp_namespace = "Xray.App.Log"; +option go_package = "github.com/xtls/xray-core/app/log"; +option java_package = "com.xray.app.log"; +option java_multiple_files = true; + +import "common/log/log.proto"; + +enum LogType { + None = 0; + Console = 1; + File = 2; + Event = 3; +} + +message Config { + LogType error_log_type = 1; + xray.common.log.Severity error_log_level = 2; + string error_log_path = 3; + + LogType access_log_type = 4; + string access_log_path = 5; + bool enable_dns_log = 6; + string mask_address= 7; +} diff --git a/src/proto/app/proxyman/command/command.proto b/src/proto/app/proxyman/command/command.proto new file mode 100644 index 00000000..9a2d0142 --- /dev/null +++ b/src/proto/app/proxyman/command/command.proto @@ -0,0 +1,90 @@ +syntax = "proto3"; + +package xray.app.proxyman.command; +option csharp_namespace = "Xray.App.Proxyman.Command"; +option go_package = "github.com/xtls/xray-core/app/proxyman/command"; +option java_package = "com.xray.app.proxyman.command"; +option java_multiple_files = true; + +import "common/protocol/user.proto"; +import "common/serial/typed_message.proto"; +import "core/config.proto"; + +message AddUserOperation { + xray.common.protocol.User user = 1; +} + +message RemoveUserOperation { + string email = 1; +} + +message AddInboundRequest { + core.InboundHandlerConfig inbound = 1; +} + +message AddInboundResponse {} + +message RemoveInboundRequest { + string tag = 1; +} + +message RemoveInboundResponse {} + +message AlterInboundRequest { + string tag = 1; + xray.common.serial.TypedMessage operation = 2; +} + +message AlterInboundResponse {} + +message GetInboundUserRequest { + string tag = 1; + string email = 2; +} + +message GetInboundUserResponse { + repeated xray.common.protocol.User users = 1; +} + +message GetInboundUsersCountResponse { + int64 count = 1; +} + +message AddOutboundRequest { + core.OutboundHandlerConfig outbound = 1; +} + +message AddOutboundResponse {} + +message RemoveOutboundRequest { + string tag = 1; +} + +message RemoveOutboundResponse {} + +message AlterOutboundRequest { + string tag = 1; + xray.common.serial.TypedMessage operation = 2; +} + +message AlterOutboundResponse {} + +service HandlerService { + rpc AddInbound(AddInboundRequest) returns (AddInboundResponse) {} + + rpc RemoveInbound(RemoveInboundRequest) returns (RemoveInboundResponse) {} + + rpc AlterInbound(AlterInboundRequest) returns (AlterInboundResponse) {} + + rpc GetInboundUsers(GetInboundUserRequest) returns (GetInboundUserResponse) {} + + rpc GetInboundUsersCount(GetInboundUserRequest) returns (GetInboundUsersCountResponse) {} + + rpc AddOutbound(AddOutboundRequest) returns (AddOutboundResponse) {} + + rpc RemoveOutbound(RemoveOutboundRequest) returns (RemoveOutboundResponse) {} + + rpc AlterOutbound(AlterOutboundRequest) returns (AlterOutboundResponse) {} +} + +message Config {} diff --git a/src/proto/app/proxyman/config.proto b/src/proto/app/proxyman/config.proto new file mode 100644 index 00000000..635ffad2 --- /dev/null +++ b/src/proto/app/proxyman/config.proto @@ -0,0 +1,98 @@ +syntax = "proto3"; + +package xray.app.proxyman; +option csharp_namespace = "Xray.App.Proxyman"; +option go_package = "github.com/xtls/xray-core/app/proxyman"; +option java_package = "com.xray.app.proxyman"; +option java_multiple_files = true; + +import "common/net/address.proto"; +import "common/net/port.proto"; +import "transport/internet/config.proto"; +import "common/serial/typed_message.proto"; + +message InboundConfig {} + +message AllocationStrategy { + enum Type { + // Always allocate all connection handlers. + Always = 0; + + // Randomly allocate specific range of handlers. + Random = 1; + + // External. Not supported yet. + External = 2; + } + + Type type = 1; + + message AllocationStrategyConcurrency { uint32 value = 1; } + + // Number of handlers (ports) running in parallel. + // Default value is 3 if unset. + AllocationStrategyConcurrency concurrency = 2; + + message AllocationStrategyRefresh { uint32 value = 1; } + + // Number of minutes before a handler is regenerated. + // Default value is 5 if unset. + AllocationStrategyRefresh refresh = 3; +} + +message SniffingConfig { + // Whether or not to enable content sniffing on an inbound connection. + bool enabled = 1; + + // Override target destination if sniff'ed protocol is in the given list. + // Supported values are "http", "tls", "fakedns". + repeated string destination_override = 2; + repeated string domains_excluded = 3; + + // Whether should only try to sniff metadata without waiting for client input. + // Can be used to support SMTP like protocol where server send the first + // message. + bool metadata_only = 4; + + bool route_only = 5; +} + +message ReceiverConfig { + // PortList specifies the ports which the Receiver should listen on. + xray.common.net.PortList port_list = 1; + // Listen specifies the IP address that the Receiver should listen on. + xray.common.net.IPOrDomain listen = 2; + AllocationStrategy allocation_strategy = 3; + xray.transport.internet.StreamConfig stream_settings = 4; + bool receive_original_destination = 5; + reserved 6; + SniffingConfig sniffing_settings = 7; +} + +message InboundHandlerConfig { + string tag = 1; + xray.common.serial.TypedMessage receiver_settings = 2; + xray.common.serial.TypedMessage proxy_settings = 3; +} + +message OutboundConfig {} + +message SenderConfig { + // Send traffic through the given IP. Only IP is allowed. + xray.common.net.IPOrDomain via = 1; + xray.transport.internet.StreamConfig stream_settings = 2; + xray.transport.internet.ProxyConfig proxy_settings = 3; + MultiplexingConfig multiplex_settings = 4; + string via_cidr = 5; +} + +message MultiplexingConfig { + // Whether or not Mux is enabled. + bool enabled = 1; + // Max number of concurrent connections that one Mux connection can handle. + int32 concurrency = 2; + // Transport XUDP in another Mux. + int32 xudpConcurrency = 3; + // "reject" (default), "allow" or "skip". + string xudpProxyUDP443 = 4; +} diff --git a/src/proto/app/stats/command/command.proto b/src/proto/app/stats/command/command.proto new file mode 100644 index 00000000..1d2ed867 --- /dev/null +++ b/src/proto/app/stats/command/command.proto @@ -0,0 +1,56 @@ +syntax = "proto3"; + +package xray.app.stats.command; +option csharp_namespace = "Xray.App.Stats.Command"; +option go_package = "github.com/xtls/xray-core/app/stats/command"; +option java_package = "com.xray.app.stats.command"; +option java_multiple_files = true; + +message GetStatsRequest { + // Name of the stat counter. + string name = 1; + // Whether or not to reset the counter to fetching its value. + bool reset = 2; +} + +message Stat { + string name = 1; + int64 value = 2; +} + +message GetStatsResponse { + Stat stat = 1; +} + +message QueryStatsRequest { + string pattern = 1; + bool reset = 2; +} + +message QueryStatsResponse { + repeated Stat stat = 1; +} + +message SysStatsRequest {} + +message SysStatsResponse { + uint32 NumGoroutine = 1; + uint32 NumGC = 2; + uint64 Alloc = 3; + uint64 TotalAlloc = 4; + uint64 Sys = 5; + uint64 Mallocs = 6; + uint64 Frees = 7; + uint64 LiveObjects = 8; + uint64 PauseTotalNs = 9; + uint32 Uptime = 10; +} + +service StatsService { + rpc GetStats(GetStatsRequest) returns (GetStatsResponse) {} + rpc GetStatsOnline(GetStatsRequest) returns (GetStatsResponse) {} + rpc QueryStats(QueryStatsRequest) returns (QueryStatsResponse) {} + rpc GetSysStats(SysStatsRequest) returns (SysStatsResponse) {} +} + +message Config {} diff --git a/src/proto/app/stats/config.proto b/src/proto/app/stats/config.proto new file mode 100644 index 00000000..378d4ee8 --- /dev/null +++ b/src/proto/app/stats/config.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; + +package xray.app.stats; +option csharp_namespace = "Xray.App.Stats"; +option go_package = "github.com/xtls/xray-core/app/stats"; +option java_package = "com.xray.app.stats"; +option java_multiple_files = true; + +message Config {} + +message ChannelConfig { + bool Blocking = 1; + int32 SubscriberLimit = 2; + int32 BufferSize = 3; +} diff --git a/src/proto/common/log/log.proto b/src/proto/common/log/log.proto new file mode 100644 index 00000000..e2145dc8 --- /dev/null +++ b/src/proto/common/log/log.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; + +package xray.common.log; +option csharp_namespace = "Xray.Common.Log"; +option go_package = "github.com/xtls/xray-core/common/log"; +option java_package = "com.xray.common.log"; +option java_multiple_files = true; + +enum Severity { + Unknown = 0; + Error = 1; + Warning = 2; + Info = 3; + Debug = 4; +} diff --git a/src/proto/common/net/address.proto b/src/proto/common/net/address.proto new file mode 100644 index 00000000..d83f0dfe --- /dev/null +++ b/src/proto/common/net/address.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; + +package xray.common.net; +option csharp_namespace = "Xray.Common.Net"; +option go_package = "github.com/xtls/xray-core/common/net"; +option java_package = "com.xray.common.net"; +option java_multiple_files = true; + +// Address of a network host. It may be either an IP address or a domain +// address. +message IPOrDomain { + oneof address { + // IP address. Must by either 4 or 16 bytes. + bytes ip = 1; + + // Domain address. + string domain = 2; + } +} diff --git a/src/proto/common/net/port.proto b/src/proto/common/net/port.proto new file mode 100644 index 00000000..0b626f9e --- /dev/null +++ b/src/proto/common/net/port.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +package xray.common.net; +option csharp_namespace = "Xray.Common.Net"; +option go_package = "github.com/xtls/xray-core/common/net"; +option java_package = "com.xray.common.net"; +option java_multiple_files = true; + +// PortRange represents a range of ports. +message PortRange { + // The port that this range starts from. + uint32 From = 1; + // The port that this range ends with (inclusive). + uint32 To = 2; +} + +// PortList is a list of ports. +message PortList { + repeated PortRange range = 1; +} diff --git a/src/proto/common/protocol/user.proto b/src/proto/common/protocol/user.proto new file mode 100644 index 00000000..14cf995b --- /dev/null +++ b/src/proto/common/protocol/user.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; + +package xray.common.protocol; +option csharp_namespace = "Xray.Common.Protocol"; +option go_package = "github.com/xtls/xray-core/common/protocol"; +option java_package = "com.xray.common.protocol"; +option java_multiple_files = true; + +import "common/serial/typed_message.proto"; + +// User is a generic user for all protocols. +message User { + uint32 level = 1; + string email = 2; + + // Protocol specific account information. Must be the account proto in one of + // the proxies. + xray.common.serial.TypedMessage account = 3; +} diff --git a/src/proto/common/serial/typed_message.proto b/src/proto/common/serial/typed_message.proto new file mode 100644 index 00000000..558de64b --- /dev/null +++ b/src/proto/common/serial/typed_message.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; + +package xray.common.serial; +option csharp_namespace = "Xray.Common.Serial"; +option go_package = "github.com/xtls/xray-core/common/serial"; +option java_package = "com.xray.common.serial"; +option java_multiple_files = true; + +// TypedMessage is a serialized proto message along with its type name. +message TypedMessage { + // The name of the message type, retrieved from protobuf API. + string type = 1; + // Serialized proto message. + bytes value = 2; +} diff --git a/src/proto/core/config.proto b/src/proto/core/config.proto new file mode 100644 index 00000000..32595d6d --- /dev/null +++ b/src/proto/core/config.proto @@ -0,0 +1,57 @@ +syntax = "proto3"; + +package xray.core; +option csharp_namespace = "Xray.Core"; +option go_package = "github.com/xtls/xray-core/core"; +option java_package = "com.xray.core"; +option java_multiple_files = true; + +import "common/serial/typed_message.proto"; + +// Config is the master config of Xray. Xray takes this config as input and +// functions accordingly. +message Config { + // Inbound handler configurations. Must have at least one item. + repeated InboundHandlerConfig inbound = 1; + + // Outbound handler configurations. Must have at least one item. The first + // item is used as default for routing. + repeated OutboundHandlerConfig outbound = 2; + + reserved 3; + + // App is for configurations of all features in Xray. A feature must + // implement the Feature interface, and its config type must be registered + // through common.RegisterConfig. + repeated xray.common.serial.TypedMessage app = 4; + + // Configuration for extensions. The config may not work if corresponding + // extension is not loaded into Xray. Xray will ignore such config during + // initialization. + repeated xray.common.serial.TypedMessage extension = 6; +} + +// InboundHandlerConfig is the configuration for inbound handler. +message InboundHandlerConfig { + // Tag of the inbound handler. The tag must be unique among all inbound + // handlers + string tag = 1; + // Settings for how this inbound proxy is handled. + xray.common.serial.TypedMessage receiver_settings = 2; + // Settings for inbound proxy. Must be one of the inbound proxies. + xray.common.serial.TypedMessage proxy_settings = 3; +} + +// OutboundHandlerConfig is the configuration for outbound handler. +message OutboundHandlerConfig { + // Tag of this outbound handler. + string tag = 1; + // Settings for how to dial connection for this outbound handler. + xray.common.serial.TypedMessage sender_settings = 2; + // Settings for this outbound proxy. Must be one of the outbound proxies. + xray.common.serial.TypedMessage proxy_settings = 3; + // If not zero, this outbound will be expired in seconds. Not used for now. + int64 expire = 4; + // Comment of this outbound handler. Not used for now. + string comment = 5; +} diff --git a/src/proto/transport/internet/config.proto b/src/proto/transport/internet/config.proto new file mode 100644 index 00000000..008e33c6 --- /dev/null +++ b/src/proto/transport/internet/config.proto @@ -0,0 +1,119 @@ +syntax = "proto3"; + +package xray.transport.internet; +option csharp_namespace = "Xray.Transport.Internet"; +option go_package = "github.com/xtls/xray-core/transport/internet"; +option java_package = "com.xray.transport.internet"; +option java_multiple_files = true; + +import "common/serial/typed_message.proto"; +import "common/net/address.proto"; + +enum DomainStrategy { + AS_IS = 0; + USE_IP = 1; + USE_IP4 = 2; + USE_IP6 = 3; + USE_IP46 = 4; + USE_IP64 = 5; + FORCE_IP = 6; + FORCE_IP4 = 7; + FORCE_IP6 = 8; + FORCE_IP46 = 9; + FORCE_IP64 = 10; +} + +message TransportConfig { + // Type of network that this settings supports. + string protocol_name = 3; + + // Specific settings. Must be of the transports. + xray.common.serial.TypedMessage settings = 2; +} + +message StreamConfig { + xray.common.net.IPOrDomain address = 8; + uint32 port = 9; + + // Effective network. + string protocol_name = 5; + + repeated TransportConfig transport_settings = 2; + + // Type of security. Must be a message name of the settings proto. + string security_type = 3; + + // Settings for transport security. For now the only choice is TLS. + repeated xray.common.serial.TypedMessage security_settings = 4; + + SocketConfig socket_settings = 6; +} + +message ProxyConfig { + string tag = 1; + bool transportLayerProxy = 2; +} + +message CustomSockopt { + string level = 1; + string opt = 2; + string value = 3; + string type = 4; +} + +// SocketConfig is options to be applied on network sockets. +message SocketConfig { + // Mark of the connection. If non-zero, the value will be set to SO_MARK. + int32 mark = 1; + + // TFO is the state of TFO settings. + int32 tfo = 2; + + enum TProxyMode { + // TProxy is off. + Off = 0; + // TProxy mode. + TProxy = 1; + // Redirect mode. + Redirect = 2; + } + + // TProxy is for enabling TProxy socket option. + TProxyMode tproxy = 3; + + // ReceiveOriginalDestAddress is for enabling IP_RECVORIGDSTADDR socket + // option. This option is for UDP only. + bool receive_original_dest_address = 4; + + bytes bind_address = 5; + + uint32 bind_port = 6; + + bool accept_proxy_protocol = 7; + + DomainStrategy domain_strategy = 8; + + string dialer_proxy = 9; + + int32 tcp_keep_alive_interval = 10; + + int32 tcp_keep_alive_idle = 11; + + string tcp_congestion = 12; + + string interface = 13; + + bool v6only = 14; + + int32 tcp_window_clamp = 15; + + int32 tcp_user_timeout = 16; + + int32 tcp_max_seg = 17; + + bool tcp_no_delay = 18; + + bool tcp_mptcp = 19; + + repeated CustomSockopt customSockopt = 20; +} diff --git a/src/xray_api/app/mod.rs b/src/xray_api/app/mod.rs new file mode 100644 index 00000000..32aa1180 --- /dev/null +++ b/src/xray_api/app/mod.rs @@ -0,0 +1,3 @@ +pub mod log; +pub mod proxyman; +pub mod stats; diff --git a/src/xray_api/common/mod.rs b/src/xray_api/common/mod.rs new file mode 100644 index 00000000..663c44cc --- /dev/null +++ b/src/xray_api/common/mod.rs @@ -0,0 +1,12 @@ +pub mod log { + tonic::include_proto!("xray.common.log"); +} +pub mod net { + tonic::include_proto!("xray.common.net"); +} +pub mod protocol { + tonic::include_proto!("xray.common.protocol"); +} +pub mod serial { + tonic::include_proto!("xray.common.serial"); +} diff --git a/src/xray_api/mod.rs b/src/xray_api/mod.rs new file mode 100644 index 00000000..0f704fd2 --- /dev/null +++ b/src/xray_api/mod.rs @@ -0,0 +1,45 @@ +pub mod xray { + pub mod common { + pub mod log { + tonic::include_proto!("xray.common.log"); + } + pub mod net { + tonic::include_proto!("xray.common.net"); + } + pub mod protocol { + tonic::include_proto!("xray.common.protocol"); + } + pub mod serial { + tonic::include_proto!("xray.common.serial"); + } + } + pub mod transport { + pub mod internet { + tonic::include_proto!("xray.transport.internet"); + } + } + pub mod app { + pub mod proxyman { + tonic::include_proto!("xray.app.proxyman"); + pub mod command { + tonic::include_proto!("xray.app.proxyman.command"); + } + } + pub mod log { + tonic::include_proto!("xray.app.log"); + pub mod command { + tonic::include_proto!("xray.app.log.command"); + } + } + pub mod stats { + tonic::include_proto!("xray.app.stats"); + pub mod command { + tonic::include_proto!("xray.app.stats.command"); + } + } + } + + pub mod core { + tonic::include_proto!("xray.core"); + } +} diff --git a/src/xray_api/transport/mod.rs b/src/xray_api/transport/mod.rs new file mode 100644 index 00000000..60aa1810 --- /dev/null +++ b/src/xray_api/transport/mod.rs @@ -0,0 +1 @@ +pub mod internet; From ddd69d7d5aea7eeac1788c264515f60332540c76 Mon Sep 17 00:00:00 2001 From: Kira Sotnikov Date: Thu, 28 Nov 2024 19:48:27 +0300 Subject: [PATCH 2/7] WIP add xray user operations --- build.rs | 25 +- out/xray.app.log.command.rs | 129 +++++++ out/xray.app.log.rs | 50 +++ out/xray.app.proxyman.command.rs | 407 ++++++++++++++++++++ out/xray.app.proxyman.rs | 159 ++++++++ out/xray.app.stats.command.rs | 261 +++++++++++++ out/xray.app.stats.rs | 12 + out/xray.common.log.rs | 36 ++ out/xray.common.net.rs | 36 ++ out/xray.common.protocol.rs | 13 + out/xray.common.serial.rs | 11 + out/xray.core.rs | 56 +++ out/xray.transport.internet.rs | 197 ++++++++++ proto-api-files-sync.sh | 8 + src/config2.rs | 8 + src/main.rs | 61 ++- src/proto/README.md | 3 + src/proto/common/net/network.proto | 18 + src/proto/common/protocol/headers.proto | 20 + src/proto/common/protocol/server_spec.proto | 16 + src/proto/proxy/shadowsocks/config.proto | 36 ++ src/proto/proxy/vless/account.proto | 16 + src/proto/proxy/vless/inbound/config.proto | 26 ++ src/proto/proxy/vmess/account.proto | 19 + src/proto/proxy/vmess/inbound/config.proto | 24 ++ src/proto/transport/internet/config.proto | 6 +- src/xray_api/app/mod.rs | 3 - src/xray_api/common/mod.rs | 12 - src/xray_api/mod.rs | 19 +- src/xray_api/transport/mod.rs | 1 - src/xray_op/client.rs | 16 + src/xray_op/mod.rs | 2 + src/xray_op/vmess.rs | 89 +++++ 33 files changed, 1742 insertions(+), 53 deletions(-) create mode 100644 out/xray.app.log.command.rs create mode 100644 out/xray.app.log.rs create mode 100644 out/xray.app.proxyman.command.rs create mode 100644 out/xray.app.proxyman.rs create mode 100644 out/xray.app.stats.command.rs create mode 100644 out/xray.app.stats.rs create mode 100644 out/xray.common.log.rs create mode 100644 out/xray.common.net.rs create mode 100644 out/xray.common.protocol.rs create mode 100644 out/xray.common.serial.rs create mode 100644 out/xray.core.rs create mode 100644 out/xray.transport.internet.rs create mode 100644 src/proto/README.md create mode 100644 src/proto/common/net/network.proto create mode 100644 src/proto/common/protocol/headers.proto create mode 100644 src/proto/common/protocol/server_spec.proto create mode 100644 src/proto/proxy/shadowsocks/config.proto create mode 100644 src/proto/proxy/vless/account.proto create mode 100644 src/proto/proxy/vless/inbound/config.proto create mode 100644 src/proto/proxy/vmess/account.proto create mode 100644 src/proto/proxy/vmess/inbound/config.proto delete mode 100644 src/xray_api/app/mod.rs delete mode 100644 src/xray_api/common/mod.rs delete mode 100644 src/xray_api/transport/mod.rs create mode 100644 src/xray_op/client.rs create mode 100644 src/xray_op/mod.rs create mode 100644 src/xray_op/vmess.rs diff --git a/build.rs b/build.rs index bae3cf6b..e88d478b 100644 --- a/build.rs +++ b/build.rs @@ -1,38 +1,27 @@ -use std::fs; use tonic_build; use walkdir::WalkDir; fn main() { - // Указываем директорию с .proto файлами let proto_dir = "src/proto"; - // Используем WalkDir для рекурсивного поиска всех .proto файлов let proto_files: Vec = WalkDir::new(proto_dir) .into_iter() - .filter_map(|entry| entry.ok()) // Игнорируем ошибки + .filter_map(|entry| entry.ok()) .filter(|entry| { entry .path() .extension() .map(|ext| ext == "proto") .unwrap_or(false) - }) // Оставляем только .proto файлы - .map(|entry| entry.path().to_str().unwrap().to_string()) // Преобразуем путь в строку + }) + .map(|entry| entry.path().to_str().unwrap().to_string()) .collect(); - let out_dir = "src/xray_api"; - - if let Err(e) = fs::create_dir_all(out_dir) { - eprintln!("Failed to create directory {:?}: {}", out_dir, e); - std::process::exit(1); - } - - // Компилируем все найденные .proto файлы tonic_build::configure() - .build_client(true) // Генерируем код для клиента - .build_server(false) // Не генерируем код для сервера (если он не нужен) - .compile_protos(&proto_files, &[proto_dir]) // Указываем все .proto файлы и исходную директорию + .build_client(true) + .build_server(false) + .compile_protos(&proto_files, &[proto_dir]) .unwrap_or_else(|e| panic!("Failed to compile protos {:?}", e)); - println!("cargo:rerun-if-changed={}", proto_dir); // Перегенерация при изменении файлов в директории + println!("cargo:rerun-if-changed={}", proto_dir); } diff --git a/out/xray.app.log.command.rs b/out/xray.app.log.command.rs new file mode 100644 index 00000000..d7bd312a --- /dev/null +++ b/out/xray.app.log.command.rs @@ -0,0 +1,129 @@ +// This file is @generated by prost-build. +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct Config {} +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct RestartLoggerRequest {} +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct RestartLoggerResponse {} +/// Generated client implementations. +pub mod logger_service_client { + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] + use tonic::codegen::*; + use tonic::codegen::http::Uri; + #[derive(Debug, Clone)] + pub struct LoggerServiceClient { + inner: tonic::client::Grpc, + } + impl LoggerServiceClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl LoggerServiceClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> LoggerServiceClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + std::marker::Send + std::marker::Sync, + { + LoggerServiceClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn restart_logger( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/xray.app.log.command.LoggerService/RestartLogger", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "xray.app.log.command.LoggerService", + "RestartLogger", + ), + ); + self.inner.unary(req, path, codec).await + } + } +} diff --git a/out/xray.app.log.rs b/out/xray.app.log.rs new file mode 100644 index 00000000..68119581 --- /dev/null +++ b/out/xray.app.log.rs @@ -0,0 +1,50 @@ +// This file is @generated by prost-build. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Config { + #[prost(enumeration = "LogType", tag = "1")] + pub error_log_type: i32, + #[prost(enumeration = "super::super::common::log::Severity", tag = "2")] + pub error_log_level: i32, + #[prost(string, tag = "3")] + pub error_log_path: ::prost::alloc::string::String, + #[prost(enumeration = "LogType", tag = "4")] + pub access_log_type: i32, + #[prost(string, tag = "5")] + pub access_log_path: ::prost::alloc::string::String, + #[prost(bool, tag = "6")] + pub enable_dns_log: bool, + #[prost(string, tag = "7")] + pub mask_address: ::prost::alloc::string::String, +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum LogType { + None = 0, + Console = 1, + File = 2, + Event = 3, +} +impl LogType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::None => "None", + Self::Console => "Console", + Self::File => "File", + Self::Event => "Event", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "None" => Some(Self::None), + "Console" => Some(Self::Console), + "File" => Some(Self::File), + "Event" => Some(Self::Event), + _ => None, + } + } +} diff --git a/out/xray.app.proxyman.command.rs b/out/xray.app.proxyman.command.rs new file mode 100644 index 00000000..6f874abe --- /dev/null +++ b/out/xray.app.proxyman.command.rs @@ -0,0 +1,407 @@ +// This file is @generated by prost-build. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AddUserOperation { + #[prost(message, optional, tag = "1")] + pub user: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RemoveUserOperation { + #[prost(string, tag = "1")] + pub email: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AddInboundRequest { + #[prost(message, optional, tag = "1")] + pub inbound: ::core::option::Option, +} +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct AddInboundResponse {} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RemoveInboundRequest { + #[prost(string, tag = "1")] + pub tag: ::prost::alloc::string::String, +} +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct RemoveInboundResponse {} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AlterInboundRequest { + #[prost(string, tag = "1")] + pub tag: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub operation: ::core::option::Option< + super::super::super::common::serial::TypedMessage, + >, +} +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct AlterInboundResponse {} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetInboundUserRequest { + #[prost(string, tag = "1")] + pub tag: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub email: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetInboundUserResponse { + #[prost(message, repeated, tag = "1")] + pub users: ::prost::alloc::vec::Vec, +} +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct GetInboundUsersCountResponse { + #[prost(int64, tag = "1")] + pub count: i64, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AddOutboundRequest { + #[prost(message, optional, tag = "1")] + pub outbound: ::core::option::Option< + super::super::super::core::OutboundHandlerConfig, + >, +} +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct AddOutboundResponse {} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RemoveOutboundRequest { + #[prost(string, tag = "1")] + pub tag: ::prost::alloc::string::String, +} +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct RemoveOutboundResponse {} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AlterOutboundRequest { + #[prost(string, tag = "1")] + pub tag: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub operation: ::core::option::Option< + super::super::super::common::serial::TypedMessage, + >, +} +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct AlterOutboundResponse {} +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct Config {} +/// Generated client implementations. +pub mod handler_service_client { + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] + use tonic::codegen::*; + use tonic::codegen::http::Uri; + #[derive(Debug, Clone)] + pub struct HandlerServiceClient { + inner: tonic::client::Grpc, + } + impl HandlerServiceClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl HandlerServiceClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> HandlerServiceClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + std::marker::Send + std::marker::Sync, + { + HandlerServiceClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn add_inbound( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/xray.app.proxyman.command.HandlerService/AddInbound", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "xray.app.proxyman.command.HandlerService", + "AddInbound", + ), + ); + self.inner.unary(req, path, codec).await + } + pub async fn remove_inbound( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/xray.app.proxyman.command.HandlerService/RemoveInbound", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "xray.app.proxyman.command.HandlerService", + "RemoveInbound", + ), + ); + self.inner.unary(req, path, codec).await + } + pub async fn alter_inbound( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/xray.app.proxyman.command.HandlerService/AlterInbound", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "xray.app.proxyman.command.HandlerService", + "AlterInbound", + ), + ); + self.inner.unary(req, path, codec).await + } + pub async fn get_inbound_users( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/xray.app.proxyman.command.HandlerService/GetInboundUsers", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "xray.app.proxyman.command.HandlerService", + "GetInboundUsers", + ), + ); + self.inner.unary(req, path, codec).await + } + pub async fn get_inbound_users_count( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/xray.app.proxyman.command.HandlerService/GetInboundUsersCount", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "xray.app.proxyman.command.HandlerService", + "GetInboundUsersCount", + ), + ); + self.inner.unary(req, path, codec).await + } + pub async fn add_outbound( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/xray.app.proxyman.command.HandlerService/AddOutbound", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "xray.app.proxyman.command.HandlerService", + "AddOutbound", + ), + ); + self.inner.unary(req, path, codec).await + } + pub async fn remove_outbound( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/xray.app.proxyman.command.HandlerService/RemoveOutbound", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "xray.app.proxyman.command.HandlerService", + "RemoveOutbound", + ), + ); + self.inner.unary(req, path, codec).await + } + pub async fn alter_outbound( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/xray.app.proxyman.command.HandlerService/AlterOutbound", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "xray.app.proxyman.command.HandlerService", + "AlterOutbound", + ), + ); + self.inner.unary(req, path, codec).await + } + } +} diff --git a/out/xray.app.proxyman.rs b/out/xray.app.proxyman.rs new file mode 100644 index 00000000..cc8e318a --- /dev/null +++ b/out/xray.app.proxyman.rs @@ -0,0 +1,159 @@ +// This file is @generated by prost-build. +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct InboundConfig {} +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct AllocationStrategy { + #[prost(enumeration = "allocation_strategy::Type", tag = "1")] + pub r#type: i32, + /// Number of handlers (ports) running in parallel. + /// Default value is 3 if unset. + #[prost(message, optional, tag = "2")] + pub concurrency: ::core::option::Option< + allocation_strategy::AllocationStrategyConcurrency, + >, + /// Number of minutes before a handler is regenerated. + /// Default value is 5 if unset. + #[prost(message, optional, tag = "3")] + pub refresh: ::core::option::Option, +} +/// Nested message and enum types in `AllocationStrategy`. +pub mod allocation_strategy { + #[derive(Clone, Copy, PartialEq, ::prost::Message)] + pub struct AllocationStrategyConcurrency { + #[prost(uint32, tag = "1")] + pub value: u32, + } + #[derive(Clone, Copy, PartialEq, ::prost::Message)] + pub struct AllocationStrategyRefresh { + #[prost(uint32, tag = "1")] + pub value: u32, + } + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum Type { + /// Always allocate all connection handlers. + Always = 0, + /// Randomly allocate specific range of handlers. + Random = 1, + /// External. Not supported yet. + External = 2, + } + impl Type { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::Always => "Always", + Self::Random => "Random", + Self::External => "External", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "Always" => Some(Self::Always), + "Random" => Some(Self::Random), + "External" => Some(Self::External), + _ => None, + } + } + } +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SniffingConfig { + /// Whether or not to enable content sniffing on an inbound connection. + #[prost(bool, tag = "1")] + pub enabled: bool, + /// Override target destination if sniff'ed protocol is in the given list. + /// Supported values are "http", "tls", "fakedns". + #[prost(string, repeated, tag = "2")] + pub destination_override: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(string, repeated, tag = "3")] + pub domains_excluded: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// Whether should only try to sniff metadata without waiting for client input. + /// Can be used to support SMTP like protocol where server send the first + /// message. + #[prost(bool, tag = "4")] + pub metadata_only: bool, + #[prost(bool, tag = "5")] + pub route_only: bool, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ReceiverConfig { + /// PortList specifies the ports which the Receiver should listen on. + #[prost(message, optional, tag = "1")] + pub port_list: ::core::option::Option, + /// Listen specifies the IP address that the Receiver should listen on. + #[prost(message, optional, tag = "2")] + pub listen: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub allocation_strategy: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub stream_settings: ::core::option::Option< + super::super::transport::internet::StreamConfig, + >, + #[prost(bool, tag = "5")] + pub receive_original_destination: bool, + #[prost(message, optional, tag = "7")] + pub sniffing_settings: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct InboundHandlerConfig { + #[prost(string, tag = "1")] + pub tag: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub receiver_settings: ::core::option::Option< + super::super::common::serial::TypedMessage, + >, + #[prost(message, optional, tag = "3")] + pub proxy_settings: ::core::option::Option< + super::super::common::serial::TypedMessage, + >, +} +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct OutboundConfig {} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SenderConfig { + /// Send traffic through the given IP. Only IP is allowed. + #[prost(message, optional, tag = "1")] + pub via: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub stream_settings: ::core::option::Option< + super::super::transport::internet::StreamConfig, + >, + #[prost(message, optional, tag = "3")] + pub proxy_settings: ::core::option::Option< + super::super::transport::internet::ProxyConfig, + >, + #[prost(message, optional, tag = "4")] + pub multiplex_settings: ::core::option::Option, + #[prost(string, tag = "5")] + pub via_cidr: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MultiplexingConfig { + /// Whether or not Mux is enabled. + #[prost(bool, tag = "1")] + pub enabled: bool, + /// Max number of concurrent connections that one Mux connection can handle. + #[prost(int32, tag = "2")] + pub concurrency: i32, + /// Transport XUDP in another Mux. + #[prost(int32, tag = "3")] + pub xudp_concurrency: i32, + /// "reject" (default), "allow" or "skip". + #[prost(string, tag = "4")] + pub xudp_proxy_udp443: ::prost::alloc::string::String, +} diff --git a/out/xray.app.stats.command.rs b/out/xray.app.stats.command.rs new file mode 100644 index 00000000..c97d40ec --- /dev/null +++ b/out/xray.app.stats.command.rs @@ -0,0 +1,261 @@ +// This file is @generated by prost-build. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetStatsRequest { + /// Name of the stat counter. + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + /// Whether or not to reset the counter to fetching its value. + #[prost(bool, tag = "2")] + pub reset: bool, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Stat { + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + #[prost(int64, tag = "2")] + pub value: i64, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetStatsResponse { + #[prost(message, optional, tag = "1")] + pub stat: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryStatsRequest { + #[prost(string, tag = "1")] + pub pattern: ::prost::alloc::string::String, + #[prost(bool, tag = "2")] + pub reset: bool, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryStatsResponse { + #[prost(message, repeated, tag = "1")] + pub stat: ::prost::alloc::vec::Vec, +} +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct SysStatsRequest {} +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct SysStatsResponse { + #[prost(uint32, tag = "1")] + pub num_goroutine: u32, + #[prost(uint32, tag = "2")] + pub num_gc: u32, + #[prost(uint64, tag = "3")] + pub alloc: u64, + #[prost(uint64, tag = "4")] + pub total_alloc: u64, + #[prost(uint64, tag = "5")] + pub sys: u64, + #[prost(uint64, tag = "6")] + pub mallocs: u64, + #[prost(uint64, tag = "7")] + pub frees: u64, + #[prost(uint64, tag = "8")] + pub live_objects: u64, + #[prost(uint64, tag = "9")] + pub pause_total_ns: u64, + #[prost(uint32, tag = "10")] + pub uptime: u32, +} +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct Config {} +/// Generated client implementations. +pub mod stats_service_client { + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] + use tonic::codegen::*; + use tonic::codegen::http::Uri; + #[derive(Debug, Clone)] + pub struct StatsServiceClient { + inner: tonic::client::Grpc, + } + impl StatsServiceClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl StatsServiceClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> StatsServiceClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + std::marker::Send + std::marker::Sync, + { + StatsServiceClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn get_stats( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/xray.app.stats.command.StatsService/GetStats", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("xray.app.stats.command.StatsService", "GetStats"), + ); + self.inner.unary(req, path, codec).await + } + pub async fn get_stats_online( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/xray.app.stats.command.StatsService/GetStatsOnline", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "xray.app.stats.command.StatsService", + "GetStatsOnline", + ), + ); + self.inner.unary(req, path, codec).await + } + pub async fn query_stats( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/xray.app.stats.command.StatsService/QueryStats", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("xray.app.stats.command.StatsService", "QueryStats"), + ); + self.inner.unary(req, path, codec).await + } + pub async fn get_sys_stats( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/xray.app.stats.command.StatsService/GetSysStats", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("xray.app.stats.command.StatsService", "GetSysStats"), + ); + self.inner.unary(req, path, codec).await + } + } +} diff --git a/out/xray.app.stats.rs b/out/xray.app.stats.rs new file mode 100644 index 00000000..d4e80188 --- /dev/null +++ b/out/xray.app.stats.rs @@ -0,0 +1,12 @@ +// This file is @generated by prost-build. +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct Config {} +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct ChannelConfig { + #[prost(bool, tag = "1")] + pub blocking: bool, + #[prost(int32, tag = "2")] + pub subscriber_limit: i32, + #[prost(int32, tag = "3")] + pub buffer_size: i32, +} diff --git a/out/xray.common.log.rs b/out/xray.common.log.rs new file mode 100644 index 00000000..14c7cd48 --- /dev/null +++ b/out/xray.common.log.rs @@ -0,0 +1,36 @@ +// This file is @generated by prost-build. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum Severity { + Unknown = 0, + Error = 1, + Warning = 2, + Info = 3, + Debug = 4, +} +impl Severity { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::Unknown => "Unknown", + Self::Error => "Error", + Self::Warning => "Warning", + Self::Info => "Info", + Self::Debug => "Debug", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "Unknown" => Some(Self::Unknown), + "Error" => Some(Self::Error), + "Warning" => Some(Self::Warning), + "Info" => Some(Self::Info), + "Debug" => Some(Self::Debug), + _ => None, + } + } +} diff --git a/out/xray.common.net.rs b/out/xray.common.net.rs new file mode 100644 index 00000000..0e09c942 --- /dev/null +++ b/out/xray.common.net.rs @@ -0,0 +1,36 @@ +// This file is @generated by prost-build. +/// Address of a network host. It may be either an IP address or a domain +/// address. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct IpOrDomain { + #[prost(oneof = "ip_or_domain::Address", tags = "1, 2")] + pub address: ::core::option::Option, +} +/// Nested message and enum types in `IPOrDomain`. +pub mod ip_or_domain { + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Address { + /// IP address. Must by either 4 or 16 bytes. + #[prost(bytes, tag = "1")] + Ip(::prost::alloc::vec::Vec), + /// Domain address. + #[prost(string, tag = "2")] + Domain(::prost::alloc::string::String), + } +} +/// PortRange represents a range of ports. +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct PortRange { + /// The port that this range starts from. + #[prost(uint32, tag = "1")] + pub from: u32, + /// The port that this range ends with (inclusive). + #[prost(uint32, tag = "2")] + pub to: u32, +} +/// PortList is a list of ports. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PortList { + #[prost(message, repeated, tag = "1")] + pub range: ::prost::alloc::vec::Vec, +} diff --git a/out/xray.common.protocol.rs b/out/xray.common.protocol.rs new file mode 100644 index 00000000..e29a0be8 --- /dev/null +++ b/out/xray.common.protocol.rs @@ -0,0 +1,13 @@ +// This file is @generated by prost-build. +/// User is a generic user for all protocols. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct User { + #[prost(uint32, tag = "1")] + pub level: u32, + #[prost(string, tag = "2")] + pub email: ::prost::alloc::string::String, + /// Protocol specific account information. Must be the account proto in one of + /// the proxies. + #[prost(message, optional, tag = "3")] + pub account: ::core::option::Option, +} diff --git a/out/xray.common.serial.rs b/out/xray.common.serial.rs new file mode 100644 index 00000000..c7de5bed --- /dev/null +++ b/out/xray.common.serial.rs @@ -0,0 +1,11 @@ +// This file is @generated by prost-build. +/// TypedMessage is a serialized proto message along with its type name. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TypedMessage { + /// The name of the message type, retrieved from protobuf API. + #[prost(string, tag = "1")] + pub r#type: ::prost::alloc::string::String, + /// Serialized proto message. + #[prost(bytes = "vec", tag = "2")] + pub value: ::prost::alloc::vec::Vec, +} diff --git a/out/xray.core.rs b/out/xray.core.rs new file mode 100644 index 00000000..0fd7ec6b --- /dev/null +++ b/out/xray.core.rs @@ -0,0 +1,56 @@ +// This file is @generated by prost-build. +/// Config is the master config of Xray. Xray takes this config as input and +/// functions accordingly. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Config { + /// Inbound handler configurations. Must have at least one item. + #[prost(message, repeated, tag = "1")] + pub inbound: ::prost::alloc::vec::Vec, + /// Outbound handler configurations. Must have at least one item. The first + /// item is used as default for routing. + #[prost(message, repeated, tag = "2")] + pub outbound: ::prost::alloc::vec::Vec, + /// App is for configurations of all features in Xray. A feature must + /// implement the Feature interface, and its config type must be registered + /// through common.RegisterConfig. + #[prost(message, repeated, tag = "4")] + pub app: ::prost::alloc::vec::Vec, + /// Configuration for extensions. The config may not work if corresponding + /// extension is not loaded into Xray. Xray will ignore such config during + /// initialization. + #[prost(message, repeated, tag = "6")] + pub extension: ::prost::alloc::vec::Vec, +} +/// InboundHandlerConfig is the configuration for inbound handler. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct InboundHandlerConfig { + /// Tag of the inbound handler. The tag must be unique among all inbound + /// handlers + #[prost(string, tag = "1")] + pub tag: ::prost::alloc::string::String, + /// Settings for how this inbound proxy is handled. + #[prost(message, optional, tag = "2")] + pub receiver_settings: ::core::option::Option, + /// Settings for inbound proxy. Must be one of the inbound proxies. + #[prost(message, optional, tag = "3")] + pub proxy_settings: ::core::option::Option, +} +/// OutboundHandlerConfig is the configuration for outbound handler. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct OutboundHandlerConfig { + /// Tag of this outbound handler. + #[prost(string, tag = "1")] + pub tag: ::prost::alloc::string::String, + /// Settings for how to dial connection for this outbound handler. + #[prost(message, optional, tag = "2")] + pub sender_settings: ::core::option::Option, + /// Settings for this outbound proxy. Must be one of the outbound proxies. + #[prost(message, optional, tag = "3")] + pub proxy_settings: ::core::option::Option, + /// If not zero, this outbound will be expired in seconds. Not used for now. + #[prost(int64, tag = "4")] + pub expire: i64, + /// Comment of this outbound handler. Not used for now. + #[prost(string, tag = "5")] + pub comment: ::prost::alloc::string::String, +} diff --git a/out/xray.transport.internet.rs b/out/xray.transport.internet.rs new file mode 100644 index 00000000..c51dfce8 --- /dev/null +++ b/out/xray.transport.internet.rs @@ -0,0 +1,197 @@ +// This file is @generated by prost-build. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TransportConfig { + /// Type of network that this settings supports. + #[prost(string, tag = "3")] + pub protocol_name: ::prost::alloc::string::String, + /// Specific settings. Must be of the transports. + #[prost(message, optional, tag = "2")] + pub settings: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct StreamConfig { + #[prost(message, optional, tag = "8")] + pub address: ::core::option::Option, + #[prost(uint32, tag = "9")] + pub port: u32, + /// Effective network. + #[prost(string, tag = "5")] + pub protocol_name: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub transport_settings: ::prost::alloc::vec::Vec, + /// Type of security. Must be a message name of the settings proto. + #[prost(string, tag = "3")] + pub security_type: ::prost::alloc::string::String, + /// Settings for transport security. For now the only choice is TLS. + #[prost(message, repeated, tag = "4")] + pub security_settings: ::prost::alloc::vec::Vec< + super::super::common::serial::TypedMessage, + >, + #[prost(message, optional, tag = "6")] + pub socket_settings: ::core::option::Option, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ProxyConfig { + #[prost(string, tag = "1")] + pub tag: ::prost::alloc::string::String, + #[prost(bool, tag = "2")] + pub transport_layer_proxy: bool, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CustomSockopt { + #[prost(string, tag = "1")] + pub level: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub opt: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub value: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub r#type: ::prost::alloc::string::String, +} +/// SocketConfig is options to be applied on network sockets. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SocketConfig { + /// Mark of the connection. If non-zero, the value will be set to SO_MARK. + #[prost(int32, tag = "1")] + pub mark: i32, + /// TFO is the state of TFO settings. + #[prost(int32, tag = "2")] + pub tfo: i32, + /// TProxy is for enabling TProxy socket option. + #[prost(enumeration = "socket_config::TProxyMode", tag = "3")] + pub tproxy: i32, + /// ReceiveOriginalDestAddress is for enabling IP_RECVORIGDSTADDR socket + /// option. This option is for UDP only. + #[prost(bool, tag = "4")] + pub receive_original_dest_address: bool, + #[prost(bytes = "vec", tag = "5")] + pub bind_address: ::prost::alloc::vec::Vec, + #[prost(uint32, tag = "6")] + pub bind_port: u32, + #[prost(bool, tag = "7")] + pub accept_proxy_protocol: bool, + #[prost(enumeration = "DomainStrategy", tag = "8")] + pub domain_strategy: i32, + #[prost(string, tag = "9")] + pub dialer_proxy: ::prost::alloc::string::String, + #[prost(int32, tag = "10")] + pub tcp_keep_alive_interval: i32, + #[prost(int32, tag = "11")] + pub tcp_keep_alive_idle: i32, + #[prost(string, tag = "12")] + pub tcp_congestion: ::prost::alloc::string::String, + #[prost(string, tag = "13")] + pub interface: ::prost::alloc::string::String, + #[prost(bool, tag = "14")] + pub v6only: bool, + #[prost(int32, tag = "15")] + pub tcp_window_clamp: i32, + #[prost(int32, tag = "16")] + pub tcp_user_timeout: i32, + #[prost(int32, tag = "17")] + pub tcp_max_seg: i32, + #[prost(bool, tag = "18")] + pub tcp_no_delay: bool, + #[prost(bool, tag = "19")] + pub tcp_mptcp: bool, + #[prost(message, repeated, tag = "20")] + pub custom_sockopt: ::prost::alloc::vec::Vec, +} +/// Nested message and enum types in `SocketConfig`. +pub mod socket_config { + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum TProxyMode { + /// TProxy is off. + Off = 0, + /// TProxy mode. + TProxy = 1, + /// Redirect mode. + Redirect = 2, + } + impl TProxyMode { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::Off => "Off", + Self::TProxy => "TProxy", + Self::Redirect => "Redirect", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "Off" => Some(Self::Off), + "TProxy" => Some(Self::TProxy), + "Redirect" => Some(Self::Redirect), + _ => None, + } + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum DomainStrategy { + AsIs = 0, + UseIp = 1, + UseIp4 = 2, + UseIp6 = 3, + UseIp46 = 4, + UseIp64 = 5, + ForceIp = 6, + ForceIp4 = 7, + ForceIp6 = 8, + ForceIp46 = 9, + ForceIp64 = 10, +} +impl DomainStrategy { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::AsIs => "AS_IS", + Self::UseIp => "USE_IP", + Self::UseIp4 => "USE_IP4", + Self::UseIp6 => "USE_IP6", + Self::UseIp46 => "USE_IP46", + Self::UseIp64 => "USE_IP64", + Self::ForceIp => "FORCE_IP", + Self::ForceIp4 => "FORCE_IP4", + Self::ForceIp6 => "FORCE_IP6", + Self::ForceIp46 => "FORCE_IP46", + Self::ForceIp64 => "FORCE_IP64", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "AS_IS" => Some(Self::AsIs), + "USE_IP" => Some(Self::UseIp), + "USE_IP4" => Some(Self::UseIp4), + "USE_IP6" => Some(Self::UseIp6), + "USE_IP46" => Some(Self::UseIp46), + "USE_IP64" => Some(Self::UseIp64), + "FORCE_IP" => Some(Self::ForceIp), + "FORCE_IP4" => Some(Self::ForceIp4), + "FORCE_IP6" => Some(Self::ForceIp6), + "FORCE_IP46" => Some(Self::ForceIp46), + "FORCE_IP64" => Some(Self::ForceIp64), + _ => None, + } + } +} diff --git a/proto-api-files-sync.sh b/proto-api-files-sync.sh index 989baecb..bf9cf87a 100755 --- a/proto-api-files-sync.sh +++ b/proto-api-files-sync.sh @@ -29,6 +29,14 @@ FILES_TO_COPY=( "common/log/log.proto" "app/stats/command/command.proto" "app/stats/config.proto" + "proxy/vmess/inbound/config.proto" + "proxy/vmess/account.proto" + "proxy/vless/account.proto" + "proxy/shadowsocks/config.proto" + "common/net/network.proto" + "common/protocol/server_spec.proto" + "common/protocol/headers.proto" + ) for file in "${FILES_TO_COPY[@]}"; do diff --git a/src/config2.rs b/src/config2.rs index 80f14cdb..7737c5c5 100644 --- a/src/config2.rs +++ b/src/config2.rs @@ -57,6 +57,10 @@ fn default_ch_server() -> String { "http://localhost:8123".to_string() } +fn default_xray_api_endpoint() -> String { + "localhost:23456".to_string() +} + fn default_loglevel() -> String { "debug".to_string() } @@ -114,6 +118,8 @@ pub struct AppConfig { pub api_bind_addr: String, #[serde(default = "default_api_bind_port")] pub api_bind_port: u16, + #[serde(default = "default_enabled")] + pub xray_api_mode: bool, } #[derive(Clone, Debug, Deserialize, Default)] @@ -126,6 +132,8 @@ pub struct XrayConfig { pub vless_port: u16, #[serde(default = "default_ss_port")] pub ss_port: u16, + #[serde(default = "default_xray_api_endpoint")] + pub xray_api_endpoint: String, } #[derive(Clone, Debug, Deserialize, Default)] diff --git a/src/main.rs b/src/main.rs index b6b5df72..a94bb9bf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -23,21 +23,20 @@ mod utils; mod web; mod webhook; mod xray_api; +mod xray_op; use crate::bandwidth::bandwidth_metrics; use crate::config2::{read_config, Settings}; use crate::connections::connections_metric; use crate::cpuusage::cpu_metrics; + use crate::loadavg::loadavg_metrics; use crate::memory::mem_metrics; use crate::utils::{current_timestamp, human_readable_date, level_from_settings}; use crate::web::not_found; #[derive(Parser)] -#[command( - version = "0.0.23", - about = "Pony - montiroing tool for Xray/Wireguard" -)] +#[command(version = "0.0.23", about = "Pony - control tool for Xray/Wireguard")] struct Cli { #[arg(short, long, default_value = "config.toml")] config: String, @@ -78,25 +77,22 @@ async fn main() -> std::io::Result<()> { std::process::exit(1); } else { info!(">>> Settings: {:?}", settings); - info!(">>> Version: 0.0.23"); + info!(">>> Pony Version: 0.0.23"); } let carbon_server = settings.carbon.address.clone(); - if settings.app.metrics_mode && settings.app.api_mode - || !settings.app.metrics_mode && !settings.app.api_mode - { - error!("Api and metrics mode enabled in the same time, choose mode"); - std::process::exit(1); - } + //if settings.app.metrics_mode && settings.app.api_mode + // || !settings.app.metrics_mode && !settings.app.api_mode + //{ + // error!("Api and metrics mode enabled in the same time, choose mode"); + // std::process::exit(1); + //} let mut tasks: Vec> = vec![]; if settings.app.metrics_mode { - info!( - ">>> Running metric collector pony sends to {:?}", - carbon_server - ); + info!(">>> Running metric collector sends to {:?}", carbon_server); let mut metrics_tasks: Vec> = vec![ tokio::spawn(bandwidth_metrics(carbon_server.clone(), settings.clone())), tokio::spawn(cpu_metrics(carbon_server.clone(), settings.clone())), @@ -144,6 +140,41 @@ async fn main() -> std::io::Result<()> { .expect("Run web server") } + if settings.app.xray_api_mode { + let _settings_clone = settings.clone(); + + let xray_api_client = xray_op::client::create_client(settings).await; + + let user_info = xray_op::vmess::UserInfo { + in_tag: "VMess TCP".to_string(), + level: 0, + email: "550e8400-e29b-41d4-a716-446655440000".to_string(), + uuid: "550e8400-e29b-41d4-a716-446655440000".to_string(), + }; + + match xray_op::vmess::remove_user(xray_api_client.clone(), user_info.clone()).await { + Ok(()) => info!("User remove successfully {:?}", user_info.uuid), + Err(e) => error!("User remove failed: {:?}", e), + } + + match xray_op::vmess::add_user(xray_api_client, user_info.clone()).await { + Ok(()) => info!("User add completed successfully {:?}", user_info.uuid), + Err(e) => error!("User add operations failed: {:?}", e), + } + + //let client_task = tokio::spawn(async move { + // match client_operations(settings_clone).await { + // Ok(_) => info!("Client operations completed successfully"), + // Err(e) => error!("Client operations failed: {:?}", e), + // } + //}); + + //grpcurl -plaintext -d '{"uuid": "550e8400-e29b-41d4-a716-446655440000"}' localhost:23456 xray.app.proxyman.command.HandlerService/GetUser + //xray api statsquery --server=127.0.0.1:23456 -pattern "user_id:ebd8a62e-631f-49a8-979f-b1e0744891a3" + + //tasks.push(client_task); + } + let _ = futures::future::try_join_all(tasks).await; Ok(()) } diff --git a/src/proto/README.md b/src/proto/README.md new file mode 100644 index 00000000..8595fa4f --- /dev/null +++ b/src/proto/README.md @@ -0,0 +1,3 @@ + + +### DO NOT EDIT: The folder created automatically by proto-api-files-sync.sh, diff --git a/src/proto/common/net/network.proto b/src/proto/common/net/network.proto new file mode 100644 index 00000000..e7579a21 --- /dev/null +++ b/src/proto/common/net/network.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; + +package xray.common.net; +option csharp_namespace = "Xray.Common.Net"; +option go_package = "github.com/xtls/xray-core/common/net"; +option java_package = "com.xray.common.net"; +option java_multiple_files = true; + +enum Network { + Unknown = 0; + + TCP = 2; + UDP = 3; + UNIX = 4; +} + +// NetworkList is a list of Networks. +message NetworkList { repeated Network network = 1; } diff --git a/src/proto/common/protocol/headers.proto b/src/proto/common/protocol/headers.proto new file mode 100644 index 00000000..1ae3537f --- /dev/null +++ b/src/proto/common/protocol/headers.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +package xray.common.protocol; +option csharp_namespace = "Xray.Common.Protocol"; +option go_package = "github.com/xtls/xray-core/common/protocol"; +option java_package = "com.xray.common.protocol"; +option java_multiple_files = true; + +enum SecurityType { + UNKNOWN = 0; + AUTO = 2; + AES128_GCM = 3; + CHACHA20_POLY1305 = 4; + NONE = 5; // [DEPRECATED 2023-06] + ZERO = 6; +} + +message SecurityConfig { + SecurityType type = 1; +} diff --git a/src/proto/common/protocol/server_spec.proto b/src/proto/common/protocol/server_spec.proto new file mode 100644 index 00000000..6b9cc04c --- /dev/null +++ b/src/proto/common/protocol/server_spec.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; + +package xray.common.protocol; +option csharp_namespace = "Xray.Common.Protocol"; +option go_package = "github.com/xtls/xray-core/common/protocol"; +option java_package = "com.xray.common.protocol"; +option java_multiple_files = true; + +import "common/net/address.proto"; +import "common/protocol/user.proto"; + +message ServerEndpoint { + xray.common.net.IPOrDomain address = 1; + uint32 port = 2; + repeated xray.common.protocol.User user = 3; +} diff --git a/src/proto/proxy/shadowsocks/config.proto b/src/proto/proxy/shadowsocks/config.proto new file mode 100644 index 00000000..8f9fb891 --- /dev/null +++ b/src/proto/proxy/shadowsocks/config.proto @@ -0,0 +1,36 @@ +syntax = "proto3"; + +package xray.proxy.shadowsocks; +option csharp_namespace = "Xray.Proxy.Shadowsocks"; +option go_package = "github.com/xtls/xray-core/proxy/shadowsocks"; +option java_package = "com.xray.proxy.shadowsocks"; +option java_multiple_files = true; + +import "common/net/network.proto"; +import "common/protocol/user.proto"; +import "common/protocol/server_spec.proto"; + +message Account { + string password = 1; + CipherType cipher_type = 2; + + bool iv_check = 3; +} + +enum CipherType { + UNKNOWN = 0; + AES_128_GCM = 5; + AES_256_GCM = 6; + CHACHA20_POLY1305 = 7; + XCHACHA20_POLY1305 = 8; + NONE = 9; +} + +message ServerConfig { + repeated xray.common.protocol.User users = 1; + repeated xray.common.net.Network network = 2; +} + +message ClientConfig { + repeated xray.common.protocol.ServerEndpoint server = 1; +} diff --git a/src/proto/proxy/vless/account.proto b/src/proto/proxy/vless/account.proto new file mode 100644 index 00000000..51d2cb7d --- /dev/null +++ b/src/proto/proxy/vless/account.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; + +package xray.proxy.vless; +option csharp_namespace = "Xray.Proxy.Vless"; +option go_package = "github.com/xtls/xray-core/proxy/vless"; +option java_package = "com.xray.proxy.vless"; +option java_multiple_files = true; + +message Account { + // ID of the account, in the form of a UUID, e.g., "66ad4540-b58c-4ad2-9926-ea63445a9b57". + string id = 1; + // Flow settings. May be "xtls-rprx-vision". + string flow = 2; + // Encryption settings. Only applies to client side, and only accepts "none" for now. + string encryption = 3; +} diff --git a/src/proto/proxy/vless/inbound/config.proto b/src/proto/proxy/vless/inbound/config.proto new file mode 100644 index 00000000..94b5551c --- /dev/null +++ b/src/proto/proxy/vless/inbound/config.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; + +package xray.proxy.vless.inbound; +option csharp_namespace = "Xray.Proxy.Vless.Inbound"; +option go_package = "github.com/xtls/xray-core/proxy/vless/inbound"; +option java_package = "com.xray.proxy.vless.inbound"; +option java_multiple_files = true; + +import "common/protocol/user.proto"; + +message Fallback { + string name = 1; + string alpn = 2; + string path = 3; + string type = 4; + string dest = 5; + uint64 xver = 6; +} + +message Config { + repeated xray.common.protocol.User clients = 1; + // Decryption settings. Only applies to server side, and only accepts "none" + // for now. + string decryption = 2; + repeated Fallback fallbacks = 3; +} diff --git a/src/proto/proxy/vmess/account.proto b/src/proto/proxy/vmess/account.proto new file mode 100644 index 00000000..3fac6399 --- /dev/null +++ b/src/proto/proxy/vmess/account.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; + +package xray.proxy.vmess; +option csharp_namespace = "Xray.Proxy.Vmess"; +option go_package = "github.com/xtls/xray-core/proxy/vmess"; +option java_package = "com.xray.proxy.vmess"; +option java_multiple_files = true; + +import "common/protocol/headers.proto"; + +message Account { + // ID of the account, in the form of a UUID, e.g., + // "66ad4540-b58c-4ad2-9926-ea63445a9b57". + string id = 1; + // Security settings. Only applies to client side. + xray.common.protocol.SecurityConfig security_settings = 3; + // Define tests enabled for this account + string tests_enabled = 4; +} diff --git a/src/proto/proxy/vmess/inbound/config.proto b/src/proto/proxy/vmess/inbound/config.proto new file mode 100644 index 00000000..7da1d581 --- /dev/null +++ b/src/proto/proxy/vmess/inbound/config.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; + +package xray.proxy.vmess.inbound; +option csharp_namespace = "Xray.Proxy.Vmess.Inbound"; +option go_package = "github.com/xtls/xray-core/proxy/vmess/inbound"; +option java_package = "com.xray.proxy.vmess.inbound"; +option java_multiple_files = true; + +import "common/protocol/user.proto"; + +message DetourConfig { + string to = 1; +} + +message DefaultConfig { + uint32 level = 2; +} + +message Config { + repeated xray.common.protocol.User user = 1; + DefaultConfig default = 2; + DetourConfig detour = 3; + // 4 is for legacy setting +} diff --git a/src/proto/transport/internet/config.proto b/src/proto/transport/internet/config.proto index 008e33c6..61812644 100644 --- a/src/proto/transport/internet/config.proto +++ b/src/proto/transport/internet/config.proto @@ -24,10 +24,10 @@ enum DomainStrategy { } message TransportConfig { - // Type of network that this settings supports. + // Transport protocol name. string protocol_name = 3; - // Specific settings. Must be of the transports. + // Specific transport protocol settings. xray.common.serial.TypedMessage settings = 2; } @@ -43,7 +43,7 @@ message StreamConfig { // Type of security. Must be a message name of the settings proto. string security_type = 3; - // Settings for transport security. For now the only choice is TLS. + // Transport security settings. They can be either TLS or REALITY. repeated xray.common.serial.TypedMessage security_settings = 4; SocketConfig socket_settings = 6; diff --git a/src/xray_api/app/mod.rs b/src/xray_api/app/mod.rs deleted file mode 100644 index 32aa1180..00000000 --- a/src/xray_api/app/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -pub mod log; -pub mod proxyman; -pub mod stats; diff --git a/src/xray_api/common/mod.rs b/src/xray_api/common/mod.rs deleted file mode 100644 index 663c44cc..00000000 --- a/src/xray_api/common/mod.rs +++ /dev/null @@ -1,12 +0,0 @@ -pub mod log { - tonic::include_proto!("xray.common.log"); -} -pub mod net { - tonic::include_proto!("xray.common.net"); -} -pub mod protocol { - tonic::include_proto!("xray.common.protocol"); -} -pub mod serial { - tonic::include_proto!("xray.common.serial"); -} diff --git a/src/xray_api/mod.rs b/src/xray_api/mod.rs index 0f704fd2..6d1c0e64 100644 --- a/src/xray_api/mod.rs +++ b/src/xray_api/mod.rs @@ -38,8 +38,25 @@ pub mod xray { } } } - pub mod core { tonic::include_proto!("xray.core"); } + pub mod proxy { + pub mod vless { + tonic::include_proto!("xray.proxy.vless"); + pub mod inbound { + tonic::include_proto!("xray.proxy.vless.inbound"); + } + } + pub mod vmess { + tonic::include_proto!("xray.proxy.vmess"); + pub mod inbound { + tonic::include_proto!("xray.proxy.vmess.inbound"); + } + } + pub mod shadowsocks { + + tonic::include_proto!("xray.proxy.shadowsocks"); + } + } } diff --git a/src/xray_api/transport/mod.rs b/src/xray_api/transport/mod.rs deleted file mode 100644 index 60aa1810..00000000 --- a/src/xray_api/transport/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod internet; diff --git a/src/xray_op/client.rs b/src/xray_op/client.rs new file mode 100644 index 00000000..47aef5e9 --- /dev/null +++ b/src/xray_op/client.rs @@ -0,0 +1,16 @@ +use crate::config2::Settings; +use crate::xray_api::xray::app::proxyman::command::handler_service_client::HandlerServiceClient; +use std::sync::Arc; +use tonic::transport::Channel; + +use tokio::sync::Mutex; + +pub async fn create_client(settings: Settings) -> Arc>> { + let channel = Channel::from_shared(settings.xray.xray_api_endpoint) + .unwrap() + .connect() + .await + .unwrap(); + + Arc::new(Mutex::new(HandlerServiceClient::new(channel))) +} diff --git a/src/xray_op/mod.rs b/src/xray_op/mod.rs new file mode 100644 index 00000000..1824381a --- /dev/null +++ b/src/xray_op/mod.rs @@ -0,0 +1,2 @@ +pub mod client; +pub mod vmess; diff --git a/src/xray_op/vmess.rs b/src/xray_op/vmess.rs new file mode 100644 index 00000000..62937a07 --- /dev/null +++ b/src/xray_op/vmess.rs @@ -0,0 +1,89 @@ +use crate::xray_api::xray::app::proxyman::command::{ + handler_service_client::HandlerServiceClient, AddUserOperation, AlterInboundRequest, + RemoveUserOperation, +}; + +use std::sync::Arc; +use tokio::sync::Mutex; +use tonic::transport::Channel; +use tonic::Request; + +use crate::xray_api::xray::common::protocol::User; +use crate::xray_api::xray::common::serial::TypedMessage; +use crate::xray_api::xray::proxy::vmess::Account; + +#[derive(Clone)] +pub struct UserInfo { + pub in_tag: String, + pub level: u32, + pub email: String, + pub uuid: String, +} + +pub async fn add_user( + client: Arc>>, + user_info: UserInfo, +) -> Result<(), tonic::Status> { + let vmess_account = Account { + id: user_info.uuid.clone(), + security_settings: None, + tests_enabled: String::new(), + }; + + let vmess_account_bytes = prost::Message::encode_to_vec(&vmess_account); + + let user = User { + level: user_info.level, + email: user_info.email.clone(), + account: Some(TypedMessage { + r#type: "xray.proxy.vmess.Account".to_string(), + value: vmess_account_bytes, + }), + }; + + let add_user_operation = AddUserOperation { user: Some(user) }; + + let add_user_operation_bytes = prost::Message::encode_to_vec(&add_user_operation); + + let operation_message = TypedMessage { + r#type: "xray.app.proxyman.command.AddUserOperation".to_string(), + value: add_user_operation_bytes, + }; + + let request = AlterInboundRequest { + tag: user_info.in_tag.clone(), + operation: Some(operation_message), + }; + + let mut client = client.lock().await; + + client + .alter_inbound(Request::new(request)) + .await + .map(|_| ()) +} + +pub async fn remove_user( + client: Arc>>, + user_info: UserInfo, +) -> Result<(), tonic::Status> { + let operation = RemoveUserOperation { + email: user_info.email, + }; + + let operation_message = TypedMessage { + r#type: "xray.app.proxyman.command.RemoveUserOperation".to_string(), + value: prost::Message::encode_to_vec(&operation), + }; + + let request = AlterInboundRequest { + tag: user_info.in_tag, + operation: Some(operation_message), + }; + + let mut client = client.lock().await; + client + .alter_inbound(Request::new(request)) + .await + .map(|_| ()) +} From 143c50843170ac42192bfced597424d64e577b26 Mon Sep 17 00:00:00 2001 From: Kira Sotnikov Date: Thu, 28 Nov 2024 23:56:54 +0300 Subject: [PATCH 3/7] WIP test user create --- src/main.rs | 27 ++++++++++++------------ src/xray_op/client.rs | 25 +++++++++++++++++----- src/xray_op/mod.rs | 1 + src/xray_op/stats.rs | 48 +++++++++++++++++++++++++++++++++++++++++++ src/xray_op/vmess.rs | 24 ++++++++-------------- 5 files changed, 91 insertions(+), 34 deletions(-) create mode 100644 src/xray_op/stats.rs diff --git a/src/main.rs b/src/main.rs index a94bb9bf..5ee98026 100644 --- a/src/main.rs +++ b/src/main.rs @@ -143,36 +143,37 @@ async fn main() -> std::io::Result<()> { if settings.app.xray_api_mode { let _settings_clone = settings.clone(); - let xray_api_client = xray_op::client::create_client(settings).await; + let xray_api_clients = match xray_op::client::create_clients(settings).await { + Ok(clients) => clients, + Err(e) => panic!("Не удалось создать клиентов: {}", e), + }; let user_info = xray_op::vmess::UserInfo { in_tag: "VMess TCP".to_string(), level: 0, - email: "550e8400-e29b-41d4-a716-446655440000".to_string(), + email: "550e8400-e29b-41d4-a716-446655440000@vmess".to_string(), uuid: "550e8400-e29b-41d4-a716-446655440000".to_string(), }; - match xray_op::vmess::remove_user(xray_api_client.clone(), user_info.clone()).await { + match xray_op::vmess::remove_user(xray_api_clients.clone(), user_info.clone()).await { Ok(()) => info!("User remove successfully {:?}", user_info.uuid), Err(e) => error!("User remove failed: {:?}", e), } - match xray_op::vmess::add_user(xray_api_client, user_info.clone()).await { + match xray_op::vmess::add_user(xray_api_clients.clone(), user_info.clone()).await { Ok(()) => info!("User add completed successfully {:?}", user_info.uuid), Err(e) => error!("User add operations failed: {:?}", e), } - //let client_task = tokio::spawn(async move { - // match client_operations(settings_clone).await { - // Ok(_) => info!("Client operations completed successfully"), - // Err(e) => error!("Client operations failed: {:?}", e), - // } - //}); + let xray_stat_task = tokio::spawn(xray_op::stats::get_stats_task( + xray_api_clients.stats_client, + "user>>>550e8400-e29b-41d4-a716-446655440000@vmess>>>traffic>>>uplink".to_string(), + false, + )); - //grpcurl -plaintext -d '{"uuid": "550e8400-e29b-41d4-a716-446655440000"}' localhost:23456 xray.app.proxyman.command.HandlerService/GetUser - //xray api statsquery --server=127.0.0.1:23456 -pattern "user_id:ebd8a62e-631f-49a8-979f-b1e0744891a3" + //xray api --server=127.0.0.1:23456 StatsService.GetStats 'name: "inbound>>>statin>>>traffic>>>downlink" reset: false' - //tasks.push(client_task); + tasks.push(xray_stat_task); } let _ = futures::future::try_join_all(tasks).await; diff --git a/src/xray_op/client.rs b/src/xray_op/client.rs index 47aef5e9..2c19e014 100644 --- a/src/xray_op/client.rs +++ b/src/xray_op/client.rs @@ -1,16 +1,31 @@ use crate::config2::Settings; use crate::xray_api::xray::app::proxyman::command::handler_service_client::HandlerServiceClient; +use crate::xray_api::xray::app::stats::command::stats_service_client::StatsServiceClient; +use crate::xray_api::xray::app::stats::command::GetStatsRequest; +use crate::xray_api::xray::app::stats::command::GetStatsResponse; use std::sync::Arc; +use tokio::sync::Mutex; use tonic::transport::Channel; +use tonic::Request; -use tokio::sync::Mutex; +#[derive(Clone)] +pub struct XrayClients { + pub handler_client: Arc>>, + pub stats_client: Arc>>, +} -pub async fn create_client(settings: Settings) -> Arc>> { +pub async fn create_clients(settings: Settings) -> Result> { let channel = Channel::from_shared(settings.xray.xray_api_endpoint) .unwrap() .connect() - .await - .unwrap(); + .await?; + + let handler_client = Arc::new(Mutex::new(HandlerServiceClient::new(channel.clone()))); + + let stats_client = Arc::new(Mutex::new(StatsServiceClient::new(channel))); - Arc::new(Mutex::new(HandlerServiceClient::new(channel))) + Ok(XrayClients { + handler_client, + stats_client, + }) } diff --git a/src/xray_op/mod.rs b/src/xray_op/mod.rs index 1824381a..3916120b 100644 --- a/src/xray_op/mod.rs +++ b/src/xray_op/mod.rs @@ -1,2 +1,3 @@ pub mod client; +pub mod stats; pub mod vmess; diff --git a/src/xray_op/stats.rs b/src/xray_op/stats.rs new file mode 100644 index 00000000..ef2c975c --- /dev/null +++ b/src/xray_op/stats.rs @@ -0,0 +1,48 @@ +use crate::xray_api::xray::app::stats::command::stats_service_client::StatsServiceClient; +use crate::xray_api::xray::app::stats::command::GetStatsRequest; +use crate::xray_api::xray::app::stats::command::GetStatsResponse; +use log::error; +use log::info; +use tokio::time::sleep; +use tokio::time::Duration; + +use std::sync::Arc; +use tokio::sync::Mutex; +use tonic::transport::Channel; +use tonic::Request; + +pub async fn get_stats( + stats_client: Arc>>, + stat_name: String, + reset: bool, +) -> Result { + let mut client = stats_client.lock().await; + + let request = Request::new(GetStatsRequest { + name: stat_name, + reset, + }); + + let response = client.get_stats(request).await?; + + Ok(response.into_inner()) +} + +pub async fn get_stats_task( + stats_client: Arc>>, + stat_name: String, + reset: bool, +) { + loop { + match get_stats(stats_client.clone(), stat_name.clone(), reset).await { + Ok(response) => { + info!("Received stats: {:?}", response); + } + Err(e) => { + error!("Failed to get stats: {}", e); + } + } + + sleep(Duration::from_secs(10)).await; + } +} diff --git a/src/xray_op/vmess.rs b/src/xray_op/vmess.rs index 62937a07..4dda50b0 100644 --- a/src/xray_op/vmess.rs +++ b/src/xray_op/vmess.rs @@ -1,16 +1,14 @@ use crate::xray_api::xray::app::proxyman::command::{ - handler_service_client::HandlerServiceClient, AddUserOperation, AlterInboundRequest, - RemoveUserOperation, + AddUserOperation, AlterInboundRequest, RemoveUserOperation, }; use std::sync::Arc; -use tokio::sync::Mutex; -use tonic::transport::Channel; use tonic::Request; use crate::xray_api::xray::common::protocol::User; use crate::xray_api::xray::common::serial::TypedMessage; use crate::xray_api::xray::proxy::vmess::Account; +use crate::xray_op::client::XrayClients; #[derive(Clone)] pub struct UserInfo { @@ -20,10 +18,7 @@ pub struct UserInfo { pub uuid: String, } -pub async fn add_user( - client: Arc>>, - user_info: UserInfo, -) -> Result<(), tonic::Status> { +pub async fn add_user(clients: XrayClients, user_info: UserInfo) -> Result<(), tonic::Status> { let vmess_account = Account { id: user_info.uuid.clone(), security_settings: None, @@ -55,18 +50,15 @@ pub async fn add_user( operation: Some(operation_message), }; - let mut client = client.lock().await; + let mut handler_client = clients.handler_client.lock().await; - client + handler_client .alter_inbound(Request::new(request)) .await .map(|_| ()) } -pub async fn remove_user( - client: Arc>>, - user_info: UserInfo, -) -> Result<(), tonic::Status> { +pub async fn remove_user(clients: XrayClients, user_info: UserInfo) -> Result<(), tonic::Status> { let operation = RemoveUserOperation { email: user_info.email, }; @@ -81,8 +73,8 @@ pub async fn remove_user( operation: Some(operation_message), }; - let mut client = client.lock().await; - client + let mut handler_client = clients.handler_client.lock().await; + handler_client .alter_inbound(Request::new(request)) .await .map(|_| ()) From 12c61edf6dec9ac2b1bf9dd11eaca14bdaefb33b Mon Sep 17 00:00:00 2001 From: Kira Sotnikov Date: Fri, 29 Nov 2024 02:20:59 +0300 Subject: [PATCH 4/7] WIP reorg metrics code --- Cargo.lock | 122 ++++++++++++++++++++++++++++++- Cargo.toml | 1 + src/clickhouse.rs | 14 ++-- src/main.rs | 31 +++----- src/{ => metrics}/bandwidth.rs | 2 +- src/{ => metrics}/connections.rs | 2 +- src/{ => metrics}/cpuusage.rs | 2 +- src/{ => metrics}/loadavg.rs | 2 +- src/{ => metrics}/memory.rs | 2 +- src/{ => metrics}/metrics.rs | 0 src/metrics/mod.rs | 6 ++ src/utils.rs | 7 +- src/webhook.rs | 2 +- src/xray_op/client.rs | 3 - src/xray_op/vmess.rs | 1 - 15 files changed, 156 insertions(+), 41 deletions(-) rename src/{ => metrics}/bandwidth.rs (98%) rename src/{ => metrics}/connections.rs (99%) rename src/{ => metrics}/cpuusage.rs (97%) rename src/{ => metrics}/loadavg.rs (96%) rename src/{ => metrics}/memory.rs (96%) rename src/{ => metrics}/metrics.rs (100%) create mode 100644 src/metrics/mod.rs diff --git a/Cargo.lock b/Cargo.lock index c7424e7f..3559f025 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "actix-codec" @@ -539,6 +539,16 @@ dependencies = [ "shlex", ] +[[package]] +name = "cfg-expr" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" +dependencies = [ + "smallvec", + "target-lexicon", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -748,6 +758,28 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "crossbeam" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-epoch", + "crossbeam-queue", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "crossbeam-deque" version = "0.8.5" @@ -767,6 +799,15 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "crossbeam-queue" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "crossbeam-utils" version = "0.8.20" @@ -821,6 +862,17 @@ dependencies = [ "crypto-common", ] +[[package]] +name = "dircpy" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a88521b0517f5f9d51d11925d8ab4523497dcf947073fa3231a311b63941131c" +dependencies = [ + "jwalk", + "log", + "walkdir", +] + [[package]] name = "dlv-list" version = "0.5.2" @@ -1370,6 +1422,16 @@ dependencies = [ "serde", ] +[[package]] +name = "jwalk" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2735847566356cd2179a2a38264839308f7079fa96e6bd5a42d740460e003c56" +dependencies = [ + "crossbeam", + "rayon", +] + [[package]] name = "language-tags" version = "0.3.2" @@ -1807,6 +1869,7 @@ dependencies = [ "tonic", "tonic-build", "walkdir", + "zmq", ] [[package]] @@ -2451,6 +2514,25 @@ dependencies = [ "libc", ] +[[package]] +name = "system-deps" +version = "6.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" +dependencies = [ + "cfg-expr", + "heck 0.5.0", + "pkg-config", + "toml 0.8.19", + "version-compare", +] + +[[package]] +name = "target-lexicon" +version = "0.12.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" + [[package]] name = "tempfile" version = "3.13.0" @@ -2868,6 +2950,12 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" +[[package]] +name = "version-compare" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b" + [[package]] name = "version_check" version = "0.9.5" @@ -3235,6 +3323,38 @@ version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +[[package]] +name = "zeromq-src" +version = "0.2.6+4.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc120b771270365d5ed0dfb4baf1005f2243ae1ae83703265cb3504070f4160b" +dependencies = [ + "cc", + "dircpy", +] + +[[package]] +name = "zmq" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd3091dd571fb84a9b3e5e5c6a807d186c411c812c8618786c3c30e5349234e7" +dependencies = [ + "bitflags 1.3.2", + "libc", + "zmq-sys", +] + +[[package]] +name = "zmq-sys" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e8351dc72494b4d7f5652a681c33634063bbad58046c1689e75270908fdc864" +dependencies = [ + "libc", + "system-deps", + "zeromq-src", +] + [[package]] name = "zstd" version = "0.13.2" diff --git a/Cargo.toml b/Cargo.toml index f964fae5..c6e0260a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,6 +26,7 @@ time = "0.3" tonic = "0.12" prost = "0.13" prost-derive = "0.13" +zmq = "0.10" [build-dependencies] tonic-build = "0.12" diff --git a/src/clickhouse.rs b/src/clickhouse.rs index dac2db93..18437d2c 100644 --- a/src/clickhouse.rs +++ b/src/clickhouse.rs @@ -19,13 +19,13 @@ pub async fn fetch_metrics_value( ) -> Result, Box> { let metric_value_req = format!( "SELECT - toInt64(toUnixTimestamp(toDateTime(anyLast(Timestamp)))) AS latest, - Path AS metric, - toFloat64(anyLast(Value)) AS value - FROM default.graphite_data - WHERE metric LIKE '{env}.{cluster}%.{metric_postfix}' - AND Timestamp >= now() - INTERVAL {fetch_interval} MINUTE - GROUP BY metric" + toInt64(toUnixTimestamp(toDateTime(anyLast(Timestamp)))) AS latest, + Path AS metric, + toFloat64(anyLast(Value)) AS value + FROM default.graphite_data + WHERE metric LIKE '{env}.{cluster}%.{metric_postfix}' + AND Timestamp >= now() - INTERVAL {fetch_interval} MINUTE + GROUP BY metric" ); debug!("Running query - {metric_value_req}"); diff --git a/src/main.rs b/src/main.rs index 5ee98026..8119bdc6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,14 +10,9 @@ use std::fmt; use std::sync::Arc; use tokio::task::JoinHandle; -mod bandwidth; mod clickhouse; mod config2; -mod connections; -mod cpuusage; mod geoip; -mod loadavg; -mod memory; mod metrics; mod utils; mod web; @@ -25,13 +20,13 @@ mod webhook; mod xray_api; mod xray_op; -use crate::bandwidth::bandwidth_metrics; use crate::config2::{read_config, Settings}; -use crate::connections::connections_metric; -use crate::cpuusage::cpu_metrics; +use crate::metrics::bandwidth::bandwidth_metrics; +use crate::metrics::connections::connections_metric; +use crate::metrics::cpuusage::cpu_metrics; +use crate::metrics::loadavg::loadavg_metrics; +use crate::metrics::memory::mem_metrics; -use crate::loadavg::loadavg_metrics; -use crate::memory::mem_metrics; use crate::utils::{current_timestamp, human_readable_date, level_from_settings}; use crate::web::not_found; @@ -82,12 +77,12 @@ async fn main() -> std::io::Result<()> { let carbon_server = settings.carbon.address.clone(); - //if settings.app.metrics_mode && settings.app.api_mode - // || !settings.app.metrics_mode && !settings.app.api_mode - //{ - // error!("Api and metrics mode enabled in the same time, choose mode"); - // std::process::exit(1); - //} + if settings.app.metrics_mode && settings.app.api_mode + || !settings.app.metrics_mode && !settings.app.api_mode + { + error!("Api and metrics mode enabled in the same time, choose mode"); + std::process::exit(1); + } let mut tasks: Vec> = vec![]; @@ -141,11 +136,9 @@ async fn main() -> std::io::Result<()> { } if settings.app.xray_api_mode { - let _settings_clone = settings.clone(); - let xray_api_clients = match xray_op::client::create_clients(settings).await { Ok(clients) => clients, - Err(e) => panic!("Не удалось создать клиентов: {}", e), + Err(e) => panic!("Can't create clients: {}", e), }; let user_info = xray_op::vmess::UserInfo { diff --git a/src/bandwidth.rs b/src/metrics/bandwidth.rs similarity index 98% rename from src/bandwidth.rs rename to src/metrics/bandwidth.rs index ac5c32ee..7006170f 100644 --- a/src/bandwidth.rs +++ b/src/metrics/bandwidth.rs @@ -5,7 +5,7 @@ use sysinfo::Networks; use tokio::time::sleep; use crate::config2::Settings; -use crate::metrics::{AsMetric, Metric}; +use crate::metrics::metrics::{AsMetric, Metric}; use crate::utils::{current_timestamp, send_to_carbon}; #[derive(Debug)] diff --git a/src/connections.rs b/src/metrics/connections.rs similarity index 99% rename from src/connections.rs rename to src/metrics/connections.rs index f5ba0be6..9f1d4795 100644 --- a/src/connections.rs +++ b/src/metrics/connections.rs @@ -6,7 +6,7 @@ use tokio::task::JoinHandle; use tokio::time::sleep; use crate::config2::Settings; -use crate::metrics::{AsMetric, Metric}; +use crate::metrics::metrics::{AsMetric, Metric}; use crate::utils::{country, current_timestamp, send_to_carbon}; #[derive(Hash, Eq, PartialEq, Clone, Debug)] diff --git a/src/cpuusage.rs b/src/metrics/cpuusage.rs similarity index 97% rename from src/cpuusage.rs rename to src/metrics/cpuusage.rs index 2ae10151..f5029692 100644 --- a/src/cpuusage.rs +++ b/src/metrics/cpuusage.rs @@ -5,7 +5,7 @@ use sysinfo::{CpuRefreshKind, RefreshKind, System}; use tokio::time::sleep; use crate::config2::Settings; -use crate::metrics::{AsMetric, Metric}; +use crate::metrics::metrics::{AsMetric, Metric}; use crate::utils::{current_timestamp, round_to_two_decimal_places, send_to_carbon}; struct CpuUsage<'a> { diff --git a/src/loadavg.rs b/src/metrics/loadavg.rs similarity index 96% rename from src/loadavg.rs rename to src/metrics/loadavg.rs index ff000bfa..b76fca07 100644 --- a/src/loadavg.rs +++ b/src/metrics/loadavg.rs @@ -4,7 +4,7 @@ use sysinfo::{LoadAvg, System}; use tokio::time::sleep; use crate::config2::Settings; -use crate::metrics::{AsMetric, Metric}; +use crate::metrics::metrics::{AsMetric, Metric}; use crate::utils::{current_timestamp, send_to_carbon}; struct LoadAvgWrapper { diff --git a/src/memory.rs b/src/metrics/memory.rs similarity index 96% rename from src/memory.rs rename to src/metrics/memory.rs index 18912ef2..5429699d 100644 --- a/src/memory.rs +++ b/src/metrics/memory.rs @@ -4,7 +4,7 @@ use sysinfo::{MemoryRefreshKind, System}; use tokio::time::sleep; use crate::config2::Settings; -use crate::metrics::{AsMetric, Metric}; +use crate::metrics::metrics::{AsMetric, Metric}; use crate::utils::{current_timestamp, send_to_carbon}; struct MemUsage { diff --git a/src/metrics.rs b/src/metrics/metrics.rs similarity index 100% rename from src/metrics.rs rename to src/metrics/metrics.rs diff --git a/src/metrics/mod.rs b/src/metrics/mod.rs new file mode 100644 index 00000000..4ea64ffe --- /dev/null +++ b/src/metrics/mod.rs @@ -0,0 +1,6 @@ +pub mod bandwidth; +pub mod connections; +pub mod cpuusage; +pub mod loadavg; +pub mod memory; +pub mod metrics; diff --git a/src/utils.rs b/src/utils.rs index e8bff772..3b6783bd 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -1,16 +1,15 @@ +use chrono::{TimeZone, Utc}; use log::{error, info, warn, LevelFilter}; use std::error::Error; use std::io; +use std::net::IpAddr; use std::net::SocketAddr; - -use chrono::{TimeZone, Utc}; use std::time::{SystemTime, UNIX_EPOCH}; use tokio::io::AsyncWriteExt; use tokio::net::TcpStream; use crate::geoip; -use crate::metrics::Metric; -use std::net::IpAddr; +use crate::metrics::metrics::Metric; pub async fn send_to_carbon( metric: &Metric, diff --git a/src/webhook.rs b/src/webhook.rs index 9719b3f5..17f6e442 100644 --- a/src/webhook.rs +++ b/src/webhook.rs @@ -9,7 +9,7 @@ use std::str::FromStr; use std::sync::Arc; use crate::config2::Settings; -use crate::metrics::{AsMetric, Metric}; +use crate::metrics::metrics::{AsMetric, Metric}; use crate::utils::send_to_carbon; #[derive(Deserialize)] diff --git a/src/xray_op/client.rs b/src/xray_op/client.rs index 2c19e014..35705c16 100644 --- a/src/xray_op/client.rs +++ b/src/xray_op/client.rs @@ -1,12 +1,9 @@ use crate::config2::Settings; use crate::xray_api::xray::app::proxyman::command::handler_service_client::HandlerServiceClient; use crate::xray_api::xray::app::stats::command::stats_service_client::StatsServiceClient; -use crate::xray_api::xray::app::stats::command::GetStatsRequest; -use crate::xray_api::xray::app::stats::command::GetStatsResponse; use std::sync::Arc; use tokio::sync::Mutex; use tonic::transport::Channel; -use tonic::Request; #[derive(Clone)] pub struct XrayClients { diff --git a/src/xray_op/vmess.rs b/src/xray_op/vmess.rs index 4dda50b0..289a5e1f 100644 --- a/src/xray_op/vmess.rs +++ b/src/xray_op/vmess.rs @@ -2,7 +2,6 @@ use crate::xray_api::xray::app::proxyman::command::{ AddUserOperation, AlterInboundRequest, RemoveUserOperation, }; -use std::sync::Arc; use tonic::Request; use crate::xray_api::xray::common::protocol::User; From 1097f82de38c7bfcf8c858387399b3c04aad4782 Mon Sep 17 00:00:00 2001 From: Kira Sotnikov Date: Fri, 29 Nov 2024 19:44:44 +0300 Subject: [PATCH 5/7] WIP pubsub + state --- Cargo.lock | 586 +- Cargo.toml | 3 - publisher/node_modules/.bin/cmake-ts | 1 + publisher/node_modules/.bin/color-support | 1 + publisher/node_modules/.bin/mkdirp | 1 + publisher/node_modules/.bin/node-which | 1 + publisher/node_modules/.bin/resolve | 1 + publisher/node_modules/.bin/semver | 1 + publisher/node_modules/.bin/sshpk-conv | 1 + publisher/node_modules/.bin/sshpk-sign | 1 + publisher/node_modules/.bin/sshpk-verify | 1 + publisher/node_modules/.bin/tldts | 1 + publisher/node_modules/.bin/uuid | 1 + publisher/node_modules/.package-lock.json | 1395 ++ .../node_modules/@aminya/cmake-ts/README.md | 75 + .../cmake-ts/build/argumentBuilder.d.ts | 12 + .../cmake-ts/build/argumentBuilder.d.ts.map | 1 + .../@aminya/cmake-ts/build/argumentBuilder.js | 116 + .../cmake-ts/build/argumentBuilder.js.map | 1 + .../@aminya/cmake-ts/build/buildMode.d.ts | 14 + .../@aminya/cmake-ts/build/buildMode.d.ts.map | 1 + .../@aminya/cmake-ts/build/buildMode.js | 30 + .../@aminya/cmake-ts/build/buildMode.js.map | 1 + .../@aminya/cmake-ts/build/download.d.ts | 14 + .../@aminya/cmake-ts/build/download.d.ts.map | 1 + .../@aminya/cmake-ts/build/download.js | 104 + .../@aminya/cmake-ts/build/download.js.map | 1 + .../@aminya/cmake-ts/build/lib.d.ts | 47 + .../@aminya/cmake-ts/build/lib.d.ts.map | 1 + .../@aminya/cmake-ts/build/lib.js | 207 + .../@aminya/cmake-ts/build/lib.js.map | 1 + .../@aminya/cmake-ts/build/main.d.ts | 3 + .../@aminya/cmake-ts/build/main.d.ts.map | 1 + .../@aminya/cmake-ts/build/main.js | 114 + .../@aminya/cmake-ts/build/main.js.map | 1 + .../cmake-ts/build/nodeAPIInclude/index.d.ts | 2 + .../build/nodeAPIInclude/index.d.ts.map | 1 + .../cmake-ts/build/nodeAPIInclude/index.js | 28 + .../build/nodeAPIInclude/index.js.map | 1 + .../build/nodeAPIInclude/resolve.d.ts | 3 + .../build/nodeAPIInclude/resolve.d.ts.map | 1 + .../cmake-ts/build/nodeAPIInclude/resolve.js | 67 + .../build/nodeAPIInclude/resolve.js.map | 1 + .../cmake-ts/build/nodeAPIInclude/search.d.ts | 2 + .../build/nodeAPIInclude/search.d.ts.map | 1 + .../cmake-ts/build/nodeAPIInclude/search.js | 55 + .../build/nodeAPIInclude/search.js.map | 1 + .../@aminya/cmake-ts/build/override.d.ts | 3 + .../@aminya/cmake-ts/build/override.d.ts.map | 1 + .../@aminya/cmake-ts/build/override.js | 74 + .../@aminya/cmake-ts/build/override.js.map | 1 + .../cmake-ts/build/runtimeDistribution.d.ts | 24 + .../build/runtimeDistribution.d.ts.map | 1 + .../cmake-ts/build/runtimeDistribution.js | 219 + .../cmake-ts/build/runtimeDistribution.js.map | 1 + .../@aminya/cmake-ts/build/urlRegistry.d.ts | 12 + .../cmake-ts/build/urlRegistry.d.ts.map | 1 + .../@aminya/cmake-ts/build/urlRegistry.js | 69 + .../@aminya/cmake-ts/build/urlRegistry.js.map | 1 + .../@aminya/cmake-ts/build/util.d.ts | 9 + .../@aminya/cmake-ts/build/util.d.ts.map | 1 + .../@aminya/cmake-ts/build/util.js | 117 + .../@aminya/cmake-ts/build/util.js.map | 1 + .../@aminya/cmake-ts/package.json | 75 + .../node_modules/@cypress/request/LICENSE | 55 + .../node_modules/@cypress/request/README.md | 1032 + .../node_modules/@cypress/request/index.js | 155 + .../node_modules/@cypress/request/lib/auth.js | 167 + .../@cypress/request/lib/cookies.js | 38 + .../@cypress/request/lib/getProxyFromURI.js | 79 + .../node_modules/@cypress/request/lib/har.js | 200 + .../node_modules/@cypress/request/lib/hawk.js | 89 + .../@cypress/request/lib/helpers.js | 66 + .../@cypress/request/lib/multipart.js | 112 + .../@cypress/request/lib/querystring.js | 50 + .../@cypress/request/lib/redirect.js | 179 + .../@cypress/request/lib/tunnel.js | 175 + .../@cypress/request/package.json | 84 + .../node_modules/@cypress/request/request.js | 1548 ++ .../node_modules/@nodelib/fs.scandir/LICENSE | 21 + .../@nodelib/fs.scandir/README.md | 171 + .../@nodelib/fs.scandir/out/adapters/fs.d.ts | 20 + .../@nodelib/fs.scandir/out/adapters/fs.js | 19 + .../@nodelib/fs.scandir/out/constants.d.ts | 4 + .../@nodelib/fs.scandir/out/constants.js | 17 + .../@nodelib/fs.scandir/out/index.d.ts | 12 + .../@nodelib/fs.scandir/out/index.js | 26 + .../fs.scandir/out/providers/async.d.ts | 7 + .../fs.scandir/out/providers/async.js | 104 + .../fs.scandir/out/providers/common.d.ts | 1 + .../fs.scandir/out/providers/common.js | 13 + .../fs.scandir/out/providers/sync.d.ts | 5 + .../@nodelib/fs.scandir/out/providers/sync.js | 54 + .../@nodelib/fs.scandir/out/settings.d.ts | 20 + .../@nodelib/fs.scandir/out/settings.js | 24 + .../@nodelib/fs.scandir/out/types/index.d.ts | 20 + .../@nodelib/fs.scandir/out/types/index.js | 2 + .../@nodelib/fs.scandir/out/utils/fs.d.ts | 2 + .../@nodelib/fs.scandir/out/utils/fs.js | 19 + .../@nodelib/fs.scandir/out/utils/index.d.ts | 2 + .../@nodelib/fs.scandir/out/utils/index.js | 5 + .../@nodelib/fs.scandir/package.json | 44 + .../node_modules/@nodelib/fs.stat/LICENSE | 21 + .../node_modules/@nodelib/fs.stat/README.md | 126 + .../@nodelib/fs.stat/out/adapters/fs.d.ts | 13 + .../@nodelib/fs.stat/out/adapters/fs.js | 17 + .../@nodelib/fs.stat/out/index.d.ts | 12 + .../@nodelib/fs.stat/out/index.js | 26 + .../@nodelib/fs.stat/out/providers/async.d.ts | 4 + .../@nodelib/fs.stat/out/providers/async.js | 36 + .../@nodelib/fs.stat/out/providers/sync.d.ts | 3 + .../@nodelib/fs.stat/out/providers/sync.js | 23 + .../@nodelib/fs.stat/out/settings.d.ts | 16 + .../@nodelib/fs.stat/out/settings.js | 16 + .../@nodelib/fs.stat/out/types/index.d.ts | 4 + .../@nodelib/fs.stat/out/types/index.js | 2 + .../@nodelib/fs.stat/package.json | 37 + .../node_modules/@nodelib/fs.walk/LICENSE | 21 + .../node_modules/@nodelib/fs.walk/README.md | 215 + .../@nodelib/fs.walk/out/index.d.ts | 14 + .../@nodelib/fs.walk/out/index.js | 34 + .../@nodelib/fs.walk/out/providers/async.d.ts | 12 + .../@nodelib/fs.walk/out/providers/async.js | 30 + .../@nodelib/fs.walk/out/providers/index.d.ts | 4 + .../@nodelib/fs.walk/out/providers/index.js | 9 + .../fs.walk/out/providers/stream.d.ts | 12 + .../@nodelib/fs.walk/out/providers/stream.js | 34 + .../@nodelib/fs.walk/out/providers/sync.d.ts | 10 + .../@nodelib/fs.walk/out/providers/sync.js | 14 + .../@nodelib/fs.walk/out/readers/async.d.ts | 30 + .../@nodelib/fs.walk/out/readers/async.js | 97 + .../@nodelib/fs.walk/out/readers/common.d.ts | 7 + .../@nodelib/fs.walk/out/readers/common.js | 31 + .../@nodelib/fs.walk/out/readers/reader.d.ts | 6 + .../@nodelib/fs.walk/out/readers/reader.js | 11 + .../@nodelib/fs.walk/out/readers/sync.d.ts | 15 + .../@nodelib/fs.walk/out/readers/sync.js | 59 + .../@nodelib/fs.walk/out/settings.d.ts | 30 + .../@nodelib/fs.walk/out/settings.js | 26 + .../@nodelib/fs.walk/out/types/index.d.ts | 8 + .../@nodelib/fs.walk/out/types/index.js | 2 + .../@nodelib/fs.walk/package.json | 44 + publisher/node_modules/ansi-regex/index.d.ts | 37 + publisher/node_modules/ansi-regex/index.js | 10 + publisher/node_modules/ansi-regex/license | 9 + .../node_modules/ansi-regex/package.json | 55 + publisher/node_modules/ansi-regex/readme.md | 78 + publisher/node_modules/aproba/CHANGELOG.md | 4 + publisher/node_modules/aproba/LICENSE | 14 + publisher/node_modules/aproba/README.md | 94 + publisher/node_modules/aproba/index.js | 105 + publisher/node_modules/aproba/package.json | 35 + .../node_modules/are-we-there-yet/LICENSE.md | 18 + .../node_modules/are-we-there-yet/README.md | 208 + .../are-we-there-yet/lib/index.js | 4 + .../are-we-there-yet/lib/tracker-base.js | 11 + .../are-we-there-yet/lib/tracker-group.js | 116 + .../are-we-there-yet/lib/tracker-stream.js | 36 + .../are-we-there-yet/lib/tracker.js | 32 + .../are-we-there-yet/package.json | 56 + publisher/node_modules/asn1/Jenkinsfile | 65 + publisher/node_modules/asn1/LICENSE | 19 + publisher/node_modules/asn1/README.md | 50 + publisher/node_modules/asn1/lib/ber/errors.js | 13 + publisher/node_modules/asn1/lib/ber/index.js | 27 + publisher/node_modules/asn1/lib/ber/reader.js | 262 + publisher/node_modules/asn1/lib/ber/types.js | 36 + publisher/node_modules/asn1/lib/ber/writer.js | 317 + publisher/node_modules/asn1/lib/index.js | 20 + publisher/node_modules/asn1/package.json | 31 + publisher/node_modules/assert-plus/AUTHORS | 6 + publisher/node_modules/assert-plus/CHANGES.md | 14 + publisher/node_modules/assert-plus/README.md | 162 + publisher/node_modules/assert-plus/assert.js | 211 + .../node_modules/assert-plus/package.json | 23 + publisher/node_modules/asynckit/LICENSE | 21 + publisher/node_modules/asynckit/README.md | 233 + publisher/node_modules/asynckit/bench.js | 76 + publisher/node_modules/asynckit/index.js | 6 + publisher/node_modules/asynckit/lib/abort.js | 29 + publisher/node_modules/asynckit/lib/async.js | 34 + publisher/node_modules/asynckit/lib/defer.js | 26 + .../node_modules/asynckit/lib/iterate.js | 75 + .../asynckit/lib/readable_asynckit.js | 91 + .../asynckit/lib/readable_parallel.js | 25 + .../asynckit/lib/readable_serial.js | 25 + .../asynckit/lib/readable_serial_ordered.js | 29 + publisher/node_modules/asynckit/lib/state.js | 37 + .../node_modules/asynckit/lib/streamify.js | 141 + .../node_modules/asynckit/lib/terminator.js | 29 + publisher/node_modules/asynckit/package.json | 63 + publisher/node_modules/asynckit/parallel.js | 43 + publisher/node_modules/asynckit/serial.js | 17 + .../node_modules/asynckit/serialOrdered.js | 75 + publisher/node_modules/asynckit/stream.js | 21 + publisher/node_modules/aws-sign2/LICENSE | 55 + publisher/node_modules/aws-sign2/README.md | 4 + publisher/node_modules/aws-sign2/index.js | 212 + publisher/node_modules/aws-sign2/package.json | 17 + publisher/node_modules/aws4/LICENSE | 19 + publisher/node_modules/aws4/README.md | 211 + publisher/node_modules/aws4/aws4.js | 383 + publisher/node_modules/aws4/lru.js | 96 + publisher/node_modules/aws4/package.json | 21 + .../node_modules/bcrypt-pbkdf/CONTRIBUTING.md | 13 + publisher/node_modules/bcrypt-pbkdf/LICENSE | 66 + publisher/node_modules/bcrypt-pbkdf/README.md | 45 + publisher/node_modules/bcrypt-pbkdf/index.js | 556 + .../node_modules/bcrypt-pbkdf/package.json | 15 + publisher/node_modules/bluebird/LICENSE | 21 + publisher/node_modules/bluebird/README.md | 57 + publisher/node_modules/bluebird/changelog.md | 1 + .../bluebird/js/browser/bluebird.core.js | 3914 ++++ .../bluebird/js/browser/bluebird.core.min.js | 31 + .../bluebird/js/browser/bluebird.js | 5778 ++++++ .../bluebird/js/browser/bluebird.min.js | 31 + .../node_modules/bluebird/js/release/any.js | 21 + .../bluebird/js/release/assert.js | 55 + .../node_modules/bluebird/js/release/async.js | 120 + .../node_modules/bluebird/js/release/bind.js | 67 + .../bluebird/js/release/bluebird.js | 11 + .../bluebird/js/release/call_get.js | 123 + .../bluebird/js/release/cancel.js | 129 + .../bluebird/js/release/catch_filter.js | 42 + .../bluebird/js/release/context.js | 69 + .../bluebird/js/release/debuggability.js | 1009 + .../bluebird/js/release/direct_resolve.js | 46 + .../node_modules/bluebird/js/release/each.js | 30 + .../bluebird/js/release/errors.js | 116 + .../node_modules/bluebird/js/release/es5.js | 80 + .../bluebird/js/release/filter.js | 12 + .../bluebird/js/release/finally.js | 146 + .../bluebird/js/release/generators.js | 223 + .../node_modules/bluebird/js/release/join.js | 165 + .../node_modules/bluebird/js/release/map.js | 175 + .../bluebird/js/release/method.js | 55 + .../bluebird/js/release/nodeback.js | 51 + .../bluebird/js/release/nodeify.js | 58 + .../bluebird/js/release/promise.js | 819 + .../bluebird/js/release/promise_array.js | 186 + .../bluebird/js/release/promisify.js | 314 + .../node_modules/bluebird/js/release/props.js | 118 + .../node_modules/bluebird/js/release/queue.js | 73 + .../node_modules/bluebird/js/release/race.js | 49 + .../bluebird/js/release/reduce.js | 183 + .../bluebird/js/release/schedule.js | 62 + .../bluebird/js/release/settle.js | 47 + .../node_modules/bluebird/js/release/some.js | 148 + .../js/release/synchronous_inspection.js | 103 + .../bluebird/js/release/thenables.js | 86 + .../bluebird/js/release/timers.js | 93 + .../node_modules/bluebird/js/release/using.js | 226 + .../node_modules/bluebird/js/release/util.js | 421 + publisher/node_modules/bluebird/package.json | 78 + publisher/node_modules/braces/LICENSE | 21 + publisher/node_modules/braces/README.md | 586 + publisher/node_modules/braces/index.js | 170 + publisher/node_modules/braces/lib/compile.js | 60 + .../node_modules/braces/lib/constants.js | 57 + publisher/node_modules/braces/lib/expand.js | 113 + publisher/node_modules/braces/lib/parse.js | 331 + .../node_modules/braces/lib/stringify.js | 32 + publisher/node_modules/braces/lib/utils.js | 122 + publisher/node_modules/braces/package.json | 77 + .../node_modules/call-bind/.eslintignore | 1 + publisher/node_modules/call-bind/.eslintrc | 16 + .../call-bind/.github/FUNDING.yml | 12 + publisher/node_modules/call-bind/.nycrc | 9 + publisher/node_modules/call-bind/CHANGELOG.md | 93 + publisher/node_modules/call-bind/LICENSE | 21 + publisher/node_modules/call-bind/README.md | 64 + publisher/node_modules/call-bind/callBound.js | 15 + publisher/node_modules/call-bind/index.js | 35 + publisher/node_modules/call-bind/package.json | 95 + .../node_modules/call-bind/test/callBound.js | 54 + .../node_modules/call-bind/test/index.js | 80 + publisher/node_modules/caseless/LICENSE | 28 + publisher/node_modules/caseless/README.md | 45 + publisher/node_modules/caseless/index.js | 67 + publisher/node_modules/caseless/package.json | 27 + publisher/node_modules/caseless/test.js | 67 + publisher/node_modules/chownr/LICENSE | 15 + publisher/node_modules/chownr/README.md | 3 + publisher/node_modules/chownr/chownr.js | 167 + publisher/node_modules/chownr/package.json | 32 + publisher/node_modules/color-support/LICENSE | 15 + .../node_modules/color-support/README.md | 129 + publisher/node_modules/color-support/bin.js | 3 + .../node_modules/color-support/browser.js | 14 + publisher/node_modules/color-support/index.js | 134 + .../node_modules/color-support/package.json | 36 + .../node_modules/combined-stream/License | 19 + .../node_modules/combined-stream/Readme.md | 138 + .../combined-stream/lib/combined_stream.js | 208 + .../node_modules/combined-stream/package.json | 25 + .../node_modules/combined-stream/yarn.lock | 17 + .../console-control-strings/LICENSE | 13 + .../console-control-strings/README.md | 145 + .../console-control-strings/README.md~ | 140 + .../console-control-strings/index.js | 125 + .../console-control-strings/package.json | 27 + publisher/node_modules/core-util-is/LICENSE | 19 + publisher/node_modules/core-util-is/README.md | 3 + .../node_modules/core-util-is/float.patch | 604 + .../node_modules/core-util-is/lib/util.js | 107 + .../node_modules/core-util-is/package.json | 32 + publisher/node_modules/core-util-is/test.js | 68 + publisher/node_modules/dashdash/CHANGES.md | 364 + publisher/node_modules/dashdash/LICENSE.txt | 24 + publisher/node_modules/dashdash/README.md | 574 + .../dashdash/etc/dashdash.bash_completion.in | 389 + .../node_modules/dashdash/lib/dashdash.js | 1055 + publisher/node_modules/dashdash/package.json | 26 + .../define-data-property/.eslintrc | 24 + .../define-data-property/.github/FUNDING.yml | 12 + .../node_modules/define-data-property/.nycrc | 13 + .../define-data-property/CHANGELOG.md | 70 + .../node_modules/define-data-property/LICENSE | 21 + .../define-data-property/README.md | 67 + .../define-data-property/index.d.ts | 12 + .../define-data-property/index.js | 56 + .../define-data-property/package.json | 106 + .../define-data-property/test/index.js | 392 + .../define-data-property/tsconfig.json | 59 + .../node_modules/delayed-stream/.npmignore | 1 + publisher/node_modules/delayed-stream/License | 19 + .../node_modules/delayed-stream/Makefile | 7 + .../node_modules/delayed-stream/Readme.md | 141 + .../delayed-stream/lib/delayed_stream.js | 107 + .../node_modules/delayed-stream/package.json | 27 + publisher/node_modules/delegates/.npmignore | 1 + publisher/node_modules/delegates/History.md | 22 + publisher/node_modules/delegates/License | 20 + publisher/node_modules/delegates/Makefile | 8 + publisher/node_modules/delegates/Readme.md | 94 + publisher/node_modules/delegates/index.js | 121 + publisher/node_modules/delegates/package.json | 13 + .../node_modules/delegates/test/index.js | 94 + publisher/node_modules/duplexer2/LICENSE.md | 26 + publisher/node_modules/duplexer2/README.md | 115 + publisher/node_modules/duplexer2/index.js | 76 + .../node_modules/readable-stream/.travis.yml | 34 + .../readable-stream/CONTRIBUTING.md | 38 + .../readable-stream/GOVERNANCE.md | 136 + .../node_modules/readable-stream/LICENSE | 47 + .../node_modules/readable-stream/README.md | 58 + .../doc/wg-meetings/2015-01-30.md | 60 + .../readable-stream/duplex-browser.js | 1 + .../node_modules/readable-stream/duplex.js | 1 + .../readable-stream/lib/_stream_duplex.js | 131 + .../lib/_stream_passthrough.js | 47 + .../readable-stream/lib/_stream_readable.js | 1019 + .../readable-stream/lib/_stream_transform.js | 214 + .../readable-stream/lib/_stream_writable.js | 685 + .../lib/internal/streams/BufferList.js | 78 + .../lib/internal/streams/destroy.js | 84 + .../lib/internal/streams/stream-browser.js | 1 + .../lib/internal/streams/stream.js | 1 + .../node_modules/readable-stream/package.json | 52 + .../readable-stream/passthrough.js | 1 + .../readable-stream/readable-browser.js | 7 + .../node_modules/readable-stream/readable.js | 19 + .../node_modules/readable-stream/transform.js | 1 + .../readable-stream/writable-browser.js | 1 + .../node_modules/readable-stream/writable.js | 8 + .../node_modules/safe-buffer/LICENSE | 21 + .../node_modules/safe-buffer/README.md | 584 + .../node_modules/safe-buffer/index.d.ts | 187 + .../node_modules/safe-buffer/index.js | 62 + .../node_modules/safe-buffer/package.json | 37 + .../node_modules/string_decoder/.travis.yml | 50 + .../node_modules/string_decoder/LICENSE | 48 + .../node_modules/string_decoder/README.md | 47 + .../string_decoder/lib/string_decoder.js | 296 + .../node_modules/string_decoder/package.json | 31 + publisher/node_modules/duplexer2/package.json | 28 + publisher/node_modules/ecc-jsbn/LICENSE | 21 + publisher/node_modules/ecc-jsbn/README.md | 8 + publisher/node_modules/ecc-jsbn/index.js | 58 + .../node_modules/ecc-jsbn/lib/LICENSE-jsbn | 40 + publisher/node_modules/ecc-jsbn/lib/ec.js | 561 + publisher/node_modules/ecc-jsbn/lib/sec.js | 170 + publisher/node_modules/ecc-jsbn/package.json | 40 + publisher/node_modules/ecc-jsbn/test.js | 14 + .../node_modules/emoji-regex/LICENSE-MIT.txt | 20 + publisher/node_modules/emoji-regex/README.md | 73 + .../node_modules/emoji-regex/es2015/index.js | 6 + .../node_modules/emoji-regex/es2015/text.js | 6 + publisher/node_modules/emoji-regex/index.d.ts | 23 + publisher/node_modules/emoji-regex/index.js | 6 + .../node_modules/emoji-regex/package.json | 50 + publisher/node_modules/emoji-regex/text.js | 6 + .../node_modules/es-define-property/.eslintrc | 13 + .../es-define-property/.github/FUNDING.yml | 12 + .../node_modules/es-define-property/.nycrc | 9 + .../es-define-property/CHANGELOG.md | 15 + .../node_modules/es-define-property/LICENSE | 21 + .../node_modules/es-define-property/README.md | 49 + .../es-define-property/index.d.ts | 3 + .../node_modules/es-define-property/index.js | 16 + .../es-define-property/package.json | 81 + .../es-define-property/test/index.js | 55 + .../es-define-property/tsconfig.json | 50 + publisher/node_modules/es-errors/.eslintrc | 5 + .../es-errors/.github/FUNDING.yml | 12 + publisher/node_modules/es-errors/CHANGELOG.md | 40 + publisher/node_modules/es-errors/LICENSE | 21 + publisher/node_modules/es-errors/README.md | 55 + publisher/node_modules/es-errors/eval.d.ts | 3 + publisher/node_modules/es-errors/eval.js | 4 + publisher/node_modules/es-errors/index.d.ts | 3 + publisher/node_modules/es-errors/index.js | 4 + publisher/node_modules/es-errors/package.json | 80 + publisher/node_modules/es-errors/range.d.ts | 3 + publisher/node_modules/es-errors/range.js | 4 + publisher/node_modules/es-errors/ref.d.ts | 3 + publisher/node_modules/es-errors/ref.js | 4 + publisher/node_modules/es-errors/syntax.d.ts | 3 + publisher/node_modules/es-errors/syntax.js | 4 + .../node_modules/es-errors/test/index.js | 19 + .../node_modules/es-errors/tsconfig.json | 49 + publisher/node_modules/es-errors/type.d.ts | 3 + publisher/node_modules/es-errors/type.js | 4 + publisher/node_modules/es-errors/uri.d.ts | 3 + publisher/node_modules/es-errors/uri.js | 4 + publisher/node_modules/extend/.editorconfig | 20 + publisher/node_modules/extend/.eslintrc | 17 + publisher/node_modules/extend/.jscs.json | 175 + publisher/node_modules/extend/.travis.yml | 230 + publisher/node_modules/extend/CHANGELOG.md | 83 + publisher/node_modules/extend/LICENSE | 23 + publisher/node_modules/extend/README.md | 81 + publisher/node_modules/extend/component.json | 32 + publisher/node_modules/extend/index.js | 117 + publisher/node_modules/extend/package.json | 42 + publisher/node_modules/extsprintf/.gitmodules | 0 publisher/node_modules/extsprintf/.npmignore | 2 + publisher/node_modules/extsprintf/LICENSE | 19 + publisher/node_modules/extsprintf/Makefile | 24 + .../node_modules/extsprintf/Makefile.targ | 285 + publisher/node_modules/extsprintf/README.md | 46 + .../node_modules/extsprintf/jsl.node.conf | 137 + .../node_modules/extsprintf/lib/extsprintf.js | 183 + .../node_modules/extsprintf/package.json | 14 + publisher/node_modules/fast-glob/LICENSE | 21 + publisher/node_modules/fast-glob/README.md | 830 + .../node_modules/fast-glob/out/index.d.ts | 40 + publisher/node_modules/fast-glob/out/index.js | 102 + .../fast-glob/out/managers/tasks.d.ts | 22 + .../fast-glob/out/managers/tasks.js | 110 + .../fast-glob/out/providers/async.d.ts | 9 + .../fast-glob/out/providers/async.js | 23 + .../fast-glob/out/providers/filters/deep.d.ts | 16 + .../fast-glob/out/providers/filters/deep.js | 62 + .../out/providers/filters/entry.d.ts | 16 + .../fast-glob/out/providers/filters/entry.js | 63 + .../out/providers/filters/error.d.ts | 8 + .../fast-glob/out/providers/filters/error.js | 15 + .../out/providers/matchers/matcher.d.ts | 33 + .../out/providers/matchers/matcher.js | 45 + .../out/providers/matchers/partial.d.ts | 4 + .../out/providers/matchers/partial.js | 38 + .../fast-glob/out/providers/provider.d.ts | 19 + .../fast-glob/out/providers/provider.js | 48 + .../fast-glob/out/providers/stream.d.ts | 11 + .../fast-glob/out/providers/stream.js | 31 + .../fast-glob/out/providers/sync.d.ts | 9 + .../fast-glob/out/providers/sync.js | 23 + .../out/providers/transformers/entry.d.ts | 8 + .../out/providers/transformers/entry.js | 26 + .../fast-glob/out/readers/async.d.ts | 10 + .../fast-glob/out/readers/async.js | 35 + .../fast-glob/out/readers/reader.d.ts | 15 + .../fast-glob/out/readers/reader.js | 33 + .../fast-glob/out/readers/stream.d.ts | 14 + .../fast-glob/out/readers/stream.js | 55 + .../fast-glob/out/readers/sync.d.ts | 12 + .../fast-glob/out/readers/sync.js | 43 + .../node_modules/fast-glob/out/settings.d.ts | 164 + .../node_modules/fast-glob/out/settings.js | 59 + .../fast-glob/out/types/index.d.ts | 31 + .../node_modules/fast-glob/out/types/index.js | 2 + .../fast-glob/out/utils/array.d.ts | 2 + .../node_modules/fast-glob/out/utils/array.js | 22 + .../fast-glob/out/utils/errno.d.ts | 2 + .../node_modules/fast-glob/out/utils/errno.js | 7 + .../node_modules/fast-glob/out/utils/fs.d.ts | 4 + .../node_modules/fast-glob/out/utils/fs.js | 19 + .../fast-glob/out/utils/index.d.ts | 8 + .../node_modules/fast-glob/out/utils/index.js | 17 + .../fast-glob/out/utils/path.d.ts | 13 + .../node_modules/fast-glob/out/utils/path.js | 68 + .../fast-glob/out/utils/pattern.d.ts | 47 + .../fast-glob/out/utils/pattern.js | 188 + .../fast-glob/out/utils/stream.d.ts | 4 + .../fast-glob/out/utils/stream.js | 17 + .../fast-glob/out/utils/string.d.ts | 2 + .../fast-glob/out/utils/string.js | 11 + publisher/node_modules/fast-glob/package.json | 81 + .../node_modules/fastq/.github/dependabot.yml | 11 + .../fastq/.github/workflows/ci.yml | 75 + publisher/node_modules/fastq/LICENSE | 13 + publisher/node_modules/fastq/README.md | 306 + publisher/node_modules/fastq/bench.js | 66 + publisher/node_modules/fastq/example.js | 14 + publisher/node_modules/fastq/example.mjs | 11 + publisher/node_modules/fastq/index.d.ts | 38 + publisher/node_modules/fastq/package.json | 53 + publisher/node_modules/fastq/queue.js | 311 + publisher/node_modules/fastq/test/example.ts | 83 + publisher/node_modules/fastq/test/promise.js | 248 + publisher/node_modules/fastq/test/test.js | 642 + .../node_modules/fastq/test/tsconfig.json | 11 + publisher/node_modules/fill-range/LICENSE | 21 + publisher/node_modules/fill-range/README.md | 237 + publisher/node_modules/fill-range/index.js | 248 + .../node_modules/fill-range/package.json | 74 + publisher/node_modules/forever-agent/LICENSE | 55 + .../node_modules/forever-agent/README.md | 4 + publisher/node_modules/forever-agent/index.js | 138 + .../node_modules/forever-agent/package.json | 17 + publisher/node_modules/form-data/License | 19 + publisher/node_modules/form-data/Readme.md | 358 + publisher/node_modules/form-data/index.d.ts | 62 + .../node_modules/form-data/lib/browser.js | 2 + .../node_modules/form-data/lib/form_data.js | 501 + .../node_modules/form-data/lib/populate.js | 10 + publisher/node_modules/form-data/package.json | 71 + publisher/node_modules/fs-extra/LICENSE | 15 + publisher/node_modules/fs-extra/README.md | 262 + .../fs-extra/lib/copy/copy-sync.js | 169 + .../node_modules/fs-extra/lib/copy/copy.js | 235 + .../node_modules/fs-extra/lib/copy/index.js | 7 + .../node_modules/fs-extra/lib/empty/index.js | 39 + .../node_modules/fs-extra/lib/ensure/file.js | 69 + .../node_modules/fs-extra/lib/ensure/index.js | 23 + .../node_modules/fs-extra/lib/ensure/link.js | 64 + .../fs-extra/lib/ensure/symlink-paths.js | 99 + .../fs-extra/lib/ensure/symlink-type.js | 31 + .../fs-extra/lib/ensure/symlink.js | 82 + .../node_modules/fs-extra/lib/fs/index.js | 128 + publisher/node_modules/fs-extra/lib/index.js | 16 + .../node_modules/fs-extra/lib/json/index.js | 16 + .../fs-extra/lib/json/jsonfile.js | 11 + .../fs-extra/lib/json/output-json-sync.js | 12 + .../fs-extra/lib/json/output-json.js | 12 + .../node_modules/fs-extra/lib/mkdirs/index.js | 14 + .../fs-extra/lib/mkdirs/make-dir.js | 27 + .../node_modules/fs-extra/lib/mkdirs/utils.js | 21 + .../node_modules/fs-extra/lib/move/index.js | 7 + .../fs-extra/lib/move/move-sync.js | 54 + .../node_modules/fs-extra/lib/move/move.js | 75 + .../fs-extra/lib/output-file/index.js | 40 + .../fs-extra/lib/path-exists/index.js | 12 + .../node_modules/fs-extra/lib/remove/index.js | 22 + .../fs-extra/lib/remove/rimraf.js | 302 + .../node_modules/fs-extra/lib/util/stat.js | 154 + .../node_modules/fs-extra/lib/util/utimes.js | 26 + publisher/node_modules/fs-extra/package.json | 67 + publisher/node_modules/fs-minipass/LICENSE | 15 + publisher/node_modules/fs-minipass/README.md | 70 + publisher/node_modules/fs-minipass/index.js | 422 + .../node_modules/fs-minipass/package.json | 39 + .../node_modules/function-bind/.eslintrc | 21 + .../function-bind/.github/FUNDING.yml | 12 + .../function-bind/.github/SECURITY.md | 3 + publisher/node_modules/function-bind/.nycrc | 13 + .../node_modules/function-bind/CHANGELOG.md | 136 + publisher/node_modules/function-bind/LICENSE | 20 + .../node_modules/function-bind/README.md | 46 + .../function-bind/implementation.js | 84 + publisher/node_modules/function-bind/index.js | 5 + .../node_modules/function-bind/package.json | 87 + .../node_modules/function-bind/test/.eslintrc | 9 + .../node_modules/function-bind/test/index.js | 252 + publisher/node_modules/gauge/LICENSE.md | 20 + publisher/node_modules/gauge/README.md | 402 + .../node_modules/gauge/lib/base-theme.js | 18 + publisher/node_modules/gauge/lib/error.js | 24 + publisher/node_modules/gauge/lib/has-color.js | 4 + publisher/node_modules/gauge/lib/index.js | 289 + publisher/node_modules/gauge/lib/plumbing.js | 50 + publisher/node_modules/gauge/lib/process.js | 3 + .../node_modules/gauge/lib/progress-bar.js | 41 + .../node_modules/gauge/lib/render-template.js | 222 + .../node_modules/gauge/lib/set-immediate.js | 7 + .../node_modules/gauge/lib/set-interval.js | 3 + publisher/node_modules/gauge/lib/spin.js | 5 + .../node_modules/gauge/lib/template-item.js | 87 + publisher/node_modules/gauge/lib/theme-set.js | 122 + publisher/node_modules/gauge/lib/themes.js | 56 + .../node_modules/gauge/lib/wide-truncate.js | 31 + publisher/node_modules/gauge/package.json | 66 + .../node_modules/get-intrinsic/.eslintrc | 38 + .../get-intrinsic/.github/FUNDING.yml | 12 + publisher/node_modules/get-intrinsic/.nycrc | 9 + .../node_modules/get-intrinsic/CHANGELOG.md | 143 + publisher/node_modules/get-intrinsic/LICENSE | 21 + .../node_modules/get-intrinsic/README.md | 71 + publisher/node_modules/get-intrinsic/index.js | 359 + .../node_modules/get-intrinsic/package.json | 93 + .../get-intrinsic/test/GetIntrinsic.js | 274 + publisher/node_modules/getpass/.npmignore | 8 + publisher/node_modules/getpass/.travis.yml | 9 + publisher/node_modules/getpass/LICENSE | 18 + publisher/node_modules/getpass/README.md | 32 + publisher/node_modules/getpass/lib/index.js | 123 + publisher/node_modules/getpass/package.json | 18 + .../node_modules/glob-parent/CHANGELOG.md | 110 + publisher/node_modules/glob-parent/LICENSE | 15 + publisher/node_modules/glob-parent/README.md | 137 + publisher/node_modules/glob-parent/index.js | 42 + .../node_modules/glob-parent/package.json | 48 + publisher/node_modules/gopd/.eslintrc | 16 + .../node_modules/gopd/.github/FUNDING.yml | 12 + publisher/node_modules/gopd/CHANGELOG.md | 25 + publisher/node_modules/gopd/LICENSE | 21 + publisher/node_modules/gopd/README.md | 40 + publisher/node_modules/gopd/index.js | 16 + publisher/node_modules/gopd/package.json | 71 + publisher/node_modules/gopd/test/index.js | 35 + publisher/node_modules/graceful-fs/LICENSE | 15 + publisher/node_modules/graceful-fs/README.md | 143 + publisher/node_modules/graceful-fs/clone.js | 23 + .../node_modules/graceful-fs/graceful-fs.js | 448 + .../graceful-fs/legacy-streams.js | 118 + .../node_modules/graceful-fs/package.json | 53 + .../node_modules/graceful-fs/polyfills.js | 355 + .../has-property-descriptors/.eslintrc | 13 + .../.github/FUNDING.yml | 12 + .../has-property-descriptors/.nycrc | 9 + .../has-property-descriptors/CHANGELOG.md | 35 + .../has-property-descriptors/LICENSE | 21 + .../has-property-descriptors/README.md | 43 + .../has-property-descriptors/index.js | 22 + .../has-property-descriptors/package.json | 77 + .../has-property-descriptors/test/index.js | 57 + publisher/node_modules/has-proto/.eslintrc | 5 + .../has-proto/.github/FUNDING.yml | 12 + publisher/node_modules/has-proto/CHANGELOG.md | 38 + publisher/node_modules/has-proto/LICENSE | 21 + publisher/node_modules/has-proto/README.md | 38 + publisher/node_modules/has-proto/index.d.ts | 3 + publisher/node_modules/has-proto/index.js | 15 + publisher/node_modules/has-proto/package.json | 78 + .../node_modules/has-proto/test/index.js | 19 + .../node_modules/has-proto/tsconfig.json | 49 + publisher/node_modules/has-symbols/.eslintrc | 11 + .../has-symbols/.github/FUNDING.yml | 12 + publisher/node_modules/has-symbols/.nycrc | 9 + .../node_modules/has-symbols/CHANGELOG.md | 75 + publisher/node_modules/has-symbols/LICENSE | 21 + publisher/node_modules/has-symbols/README.md | 46 + publisher/node_modules/has-symbols/index.js | 13 + .../node_modules/has-symbols/package.json | 101 + publisher/node_modules/has-symbols/shams.js | 42 + .../node_modules/has-symbols/test/index.js | 22 + .../has-symbols/test/shams/core-js.js | 28 + .../test/shams/get-own-property-symbols.js | 28 + .../node_modules/has-symbols/test/tests.js | 56 + publisher/node_modules/has-unicode/LICENSE | 14 + publisher/node_modules/has-unicode/README.md | 43 + publisher/node_modules/has-unicode/index.js | 16 + .../node_modules/has-unicode/package.json | 30 + publisher/node_modules/hasown/.eslintrc | 5 + .../node_modules/hasown/.github/FUNDING.yml | 12 + publisher/node_modules/hasown/.nycrc | 13 + publisher/node_modules/hasown/CHANGELOG.md | 40 + publisher/node_modules/hasown/LICENSE | 21 + publisher/node_modules/hasown/README.md | 40 + publisher/node_modules/hasown/index.d.ts | 3 + publisher/node_modules/hasown/index.js | 8 + publisher/node_modules/hasown/package.json | 92 + publisher/node_modules/hasown/tsconfig.json | 6 + publisher/node_modules/http-signature/LICENSE | 18 + .../node_modules/http-signature/README.md | 80 + .../node_modules/http-signature/lib/index.js | 29 + .../node_modules/http-signature/lib/parser.js | 377 + .../node_modules/http-signature/lib/signer.js | 483 + .../node_modules/http-signature/lib/utils.js | 119 + .../node_modules/http-signature/lib/verify.js | 88 + .../node_modules/http-signature/package.json | 41 + publisher/node_modules/inherits/LICENSE | 16 + publisher/node_modules/inherits/README.md | 42 + publisher/node_modules/inherits/inherits.js | 9 + .../node_modules/inherits/inherits_browser.js | 27 + publisher/node_modules/inherits/package.json | 29 + .../node_modules/is-core-module/.eslintrc | 18 + publisher/node_modules/is-core-module/.nycrc | 9 + .../node_modules/is-core-module/CHANGELOG.md | 205 + publisher/node_modules/is-core-module/LICENSE | 20 + .../node_modules/is-core-module/README.md | 40 + .../node_modules/is-core-module/core.json | 161 + .../node_modules/is-core-module/index.js | 69 + .../node_modules/is-core-module/package.json | 76 + .../node_modules/is-core-module/test/index.js | 154 + publisher/node_modules/is-extglob/LICENSE | 21 + publisher/node_modules/is-extglob/README.md | 107 + publisher/node_modules/is-extglob/index.js | 20 + .../node_modules/is-extglob/package.json | 69 + .../is-fullwidth-code-point/index.d.ts | 17 + .../is-fullwidth-code-point/index.js | 50 + .../is-fullwidth-code-point/license | 9 + .../is-fullwidth-code-point/package.json | 42 + .../is-fullwidth-code-point/readme.md | 39 + publisher/node_modules/is-glob/LICENSE | 21 + publisher/node_modules/is-glob/README.md | 206 + publisher/node_modules/is-glob/index.js | 150 + publisher/node_modules/is-glob/package.json | 81 + publisher/node_modules/is-number/LICENSE | 21 + publisher/node_modules/is-number/README.md | 187 + publisher/node_modules/is-number/index.js | 18 + publisher/node_modules/is-number/package.json | 82 + .../node_modules/is-typedarray/LICENSE.md | 18 + .../node_modules/is-typedarray/README.md | 16 + publisher/node_modules/is-typedarray/index.js | 41 + .../node_modules/is-typedarray/package.json | 30 + publisher/node_modules/is-typedarray/test.js | 34 + publisher/node_modules/isarray/.npmignore | 1 + publisher/node_modules/isarray/.travis.yml | 4 + publisher/node_modules/isarray/Makefile | 6 + publisher/node_modules/isarray/README.md | 60 + publisher/node_modules/isarray/component.json | 19 + publisher/node_modules/isarray/index.js | 5 + publisher/node_modules/isarray/package.json | 45 + publisher/node_modules/isarray/test.js | 20 + publisher/node_modules/isexe/.npmignore | 2 + publisher/node_modules/isexe/LICENSE | 15 + publisher/node_modules/isexe/README.md | 51 + publisher/node_modules/isexe/index.js | 57 + publisher/node_modules/isexe/mode.js | 41 + publisher/node_modules/isexe/package.json | 31 + publisher/node_modules/isexe/test/basic.js | 221 + publisher/node_modules/isexe/windows.js | 42 + publisher/node_modules/isstream/.jshintrc | 59 + publisher/node_modules/isstream/.npmignore | 1 + publisher/node_modules/isstream/.travis.yml | 12 + publisher/node_modules/isstream/LICENSE.md | 11 + publisher/node_modules/isstream/README.md | 66 + publisher/node_modules/isstream/isstream.js | 27 + publisher/node_modules/isstream/package.json | 33 + publisher/node_modules/isstream/test.js | 168 + publisher/node_modules/jsbn/.npmignore | 2 + publisher/node_modules/jsbn/LICENSE | 40 + publisher/node_modules/jsbn/README.md | 175 + publisher/node_modules/jsbn/example.html | 12 + publisher/node_modules/jsbn/example.js | 3 + publisher/node_modules/jsbn/index.js | 1357 ++ publisher/node_modules/jsbn/package.json | 21 + publisher/node_modules/json-schema/LICENSE | 195 + publisher/node_modules/json-schema/README.md | 3 + .../node_modules/json-schema/lib/links.js | 65 + .../node_modules/json-schema/lib/validate.js | 271 + .../node_modules/json-schema/package.json | 24 + .../json-stringify-safe/.npmignore | 1 + .../json-stringify-safe/CHANGELOG.md | 14 + .../node_modules/json-stringify-safe/LICENSE | 15 + .../node_modules/json-stringify-safe/Makefile | 35 + .../json-stringify-safe/README.md | 52 + .../json-stringify-safe/package.json | 31 + .../json-stringify-safe/stringify.js | 27 + .../json-stringify-safe/test/mocha.opts | 2 + .../test/stringify_test.js | 246 + publisher/node_modules/jsonfile/CHANGELOG.md | 171 + publisher/node_modules/jsonfile/LICENSE | 15 + publisher/node_modules/jsonfile/README.md | 230 + publisher/node_modules/jsonfile/index.js | 88 + publisher/node_modules/jsonfile/package.json | 40 + publisher/node_modules/jsonfile/utils.js | 14 + publisher/node_modules/jsprim/CHANGES.md | 65 + publisher/node_modules/jsprim/CONTRIBUTING.md | 16 + publisher/node_modules/jsprim/LICENSE | 19 + publisher/node_modules/jsprim/README.md | 287 + publisher/node_modules/jsprim/lib/jsprim.js | 735 + publisher/node_modules/jsprim/package.json | 20 + publisher/node_modules/lodash/LICENSE | 47 + publisher/node_modules/lodash/README.md | 39 + publisher/node_modules/lodash/_DataView.js | 7 + publisher/node_modules/lodash/_Hash.js | 32 + publisher/node_modules/lodash/_LazyWrapper.js | 28 + publisher/node_modules/lodash/_ListCache.js | 32 + .../node_modules/lodash/_LodashWrapper.js | 22 + publisher/node_modules/lodash/_Map.js | 7 + publisher/node_modules/lodash/_MapCache.js | 32 + publisher/node_modules/lodash/_Promise.js | 7 + publisher/node_modules/lodash/_Set.js | 7 + publisher/node_modules/lodash/_SetCache.js | 27 + publisher/node_modules/lodash/_Stack.js | 27 + publisher/node_modules/lodash/_Symbol.js | 6 + publisher/node_modules/lodash/_Uint8Array.js | 6 + publisher/node_modules/lodash/_WeakMap.js | 7 + publisher/node_modules/lodash/_apply.js | 21 + .../node_modules/lodash/_arrayAggregator.js | 22 + publisher/node_modules/lodash/_arrayEach.js | 22 + .../node_modules/lodash/_arrayEachRight.js | 21 + publisher/node_modules/lodash/_arrayEvery.js | 23 + publisher/node_modules/lodash/_arrayFilter.js | 25 + .../node_modules/lodash/_arrayIncludes.js | 17 + .../node_modules/lodash/_arrayIncludesWith.js | 22 + .../node_modules/lodash/_arrayLikeKeys.js | 49 + publisher/node_modules/lodash/_arrayMap.js | 21 + publisher/node_modules/lodash/_arrayPush.js | 20 + publisher/node_modules/lodash/_arrayReduce.js | 26 + .../node_modules/lodash/_arrayReduceRight.js | 24 + publisher/node_modules/lodash/_arraySample.js | 15 + .../node_modules/lodash/_arraySampleSize.js | 17 + .../node_modules/lodash/_arrayShuffle.js | 15 + publisher/node_modules/lodash/_arraySome.js | 23 + publisher/node_modules/lodash/_asciiSize.js | 12 + .../node_modules/lodash/_asciiToArray.js | 12 + publisher/node_modules/lodash/_asciiWords.js | 15 + .../node_modules/lodash/_assignMergeValue.js | 20 + publisher/node_modules/lodash/_assignValue.js | 28 + .../node_modules/lodash/_assocIndexOf.js | 21 + .../node_modules/lodash/_baseAggregator.js | 21 + publisher/node_modules/lodash/_baseAssign.js | 17 + .../node_modules/lodash/_baseAssignIn.js | 17 + .../node_modules/lodash/_baseAssignValue.js | 25 + publisher/node_modules/lodash/_baseAt.js | 23 + publisher/node_modules/lodash/_baseClamp.js | 22 + publisher/node_modules/lodash/_baseClone.js | 166 + .../node_modules/lodash/_baseConforms.js | 18 + .../node_modules/lodash/_baseConformsTo.js | 27 + publisher/node_modules/lodash/_baseCreate.js | 30 + publisher/node_modules/lodash/_baseDelay.js | 21 + .../node_modules/lodash/_baseDifference.js | 67 + publisher/node_modules/lodash/_baseEach.js | 14 + .../node_modules/lodash/_baseEachRight.js | 14 + publisher/node_modules/lodash/_baseEvery.js | 21 + .../node_modules/lodash/_baseExtremum.js | 32 + publisher/node_modules/lodash/_baseFill.js | 32 + publisher/node_modules/lodash/_baseFilter.js | 21 + .../node_modules/lodash/_baseFindIndex.js | 24 + publisher/node_modules/lodash/_baseFindKey.js | 23 + publisher/node_modules/lodash/_baseFlatten.js | 38 + publisher/node_modules/lodash/_baseFor.js | 16 + publisher/node_modules/lodash/_baseForOwn.js | 16 + .../node_modules/lodash/_baseForOwnRight.js | 16 + .../node_modules/lodash/_baseForRight.js | 15 + .../node_modules/lodash/_baseFunctions.js | 19 + publisher/node_modules/lodash/_baseGet.js | 24 + .../node_modules/lodash/_baseGetAllKeys.js | 20 + publisher/node_modules/lodash/_baseGetTag.js | 28 + publisher/node_modules/lodash/_baseGt.js | 14 + publisher/node_modules/lodash/_baseHas.js | 19 + publisher/node_modules/lodash/_baseHasIn.js | 13 + publisher/node_modules/lodash/_baseInRange.js | 18 + publisher/node_modules/lodash/_baseIndexOf.js | 20 + .../node_modules/lodash/_baseIndexOfWith.js | 23 + .../node_modules/lodash/_baseIntersection.js | 74 + .../node_modules/lodash/_baseInverter.js | 21 + publisher/node_modules/lodash/_baseInvoke.js | 24 + .../node_modules/lodash/_baseIsArguments.js | 18 + .../node_modules/lodash/_baseIsArrayBuffer.js | 17 + publisher/node_modules/lodash/_baseIsDate.js | 18 + publisher/node_modules/lodash/_baseIsEqual.js | 28 + .../node_modules/lodash/_baseIsEqualDeep.js | 83 + publisher/node_modules/lodash/_baseIsMap.js | 18 + publisher/node_modules/lodash/_baseIsMatch.js | 62 + publisher/node_modules/lodash/_baseIsNaN.js | 12 + .../node_modules/lodash/_baseIsNative.js | 47 + .../node_modules/lodash/_baseIsRegExp.js | 18 + publisher/node_modules/lodash/_baseIsSet.js | 18 + .../node_modules/lodash/_baseIsTypedArray.js | 60 + .../node_modules/lodash/_baseIteratee.js | 31 + publisher/node_modules/lodash/_baseKeys.js | 30 + publisher/node_modules/lodash/_baseKeysIn.js | 33 + publisher/node_modules/lodash/_baseLodash.js | 10 + publisher/node_modules/lodash/_baseLt.js | 14 + publisher/node_modules/lodash/_baseMap.js | 22 + publisher/node_modules/lodash/_baseMatches.js | 22 + .../lodash/_baseMatchesProperty.js | 33 + publisher/node_modules/lodash/_baseMean.js | 20 + publisher/node_modules/lodash/_baseMerge.js | 42 + .../node_modules/lodash/_baseMergeDeep.js | 94 + publisher/node_modules/lodash/_baseNth.js | 20 + publisher/node_modules/lodash/_baseOrderBy.js | 49 + publisher/node_modules/lodash/_basePick.js | 19 + publisher/node_modules/lodash/_basePickBy.js | 30 + .../node_modules/lodash/_baseProperty.js | 14 + .../node_modules/lodash/_basePropertyDeep.js | 16 + .../node_modules/lodash/_basePropertyOf.js | 14 + publisher/node_modules/lodash/_basePullAll.js | 51 + publisher/node_modules/lodash/_basePullAt.js | 37 + publisher/node_modules/lodash/_baseRandom.js | 18 + publisher/node_modules/lodash/_baseRange.js | 28 + publisher/node_modules/lodash/_baseReduce.js | 23 + publisher/node_modules/lodash/_baseRepeat.js | 35 + publisher/node_modules/lodash/_baseRest.js | 17 + publisher/node_modules/lodash/_baseSample.js | 15 + .../node_modules/lodash/_baseSampleSize.js | 18 + publisher/node_modules/lodash/_baseSet.js | 51 + publisher/node_modules/lodash/_baseSetData.js | 17 + .../node_modules/lodash/_baseSetToString.js | 22 + publisher/node_modules/lodash/_baseShuffle.js | 15 + publisher/node_modules/lodash/_baseSlice.js | 31 + publisher/node_modules/lodash/_baseSome.js | 22 + publisher/node_modules/lodash/_baseSortBy.js | 21 + .../node_modules/lodash/_baseSortedIndex.js | 42 + .../node_modules/lodash/_baseSortedIndexBy.js | 67 + .../node_modules/lodash/_baseSortedUniq.js | 30 + publisher/node_modules/lodash/_baseSum.js | 24 + publisher/node_modules/lodash/_baseTimes.js | 20 + .../node_modules/lodash/_baseToNumber.js | 24 + publisher/node_modules/lodash/_baseToPairs.js | 18 + .../node_modules/lodash/_baseToString.js | 37 + publisher/node_modules/lodash/_baseTrim.js | 19 + publisher/node_modules/lodash/_baseUnary.js | 14 + publisher/node_modules/lodash/_baseUniq.js | 72 + publisher/node_modules/lodash/_baseUnset.js | 20 + publisher/node_modules/lodash/_baseUpdate.js | 18 + publisher/node_modules/lodash/_baseValues.js | 19 + publisher/node_modules/lodash/_baseWhile.js | 26 + .../node_modules/lodash/_baseWrapperValue.js | 25 + publisher/node_modules/lodash/_baseXor.js | 36 + .../node_modules/lodash/_baseZipObject.js | 23 + publisher/node_modules/lodash/_cacheHas.js | 13 + .../lodash/_castArrayLikeObject.js | 14 + .../node_modules/lodash/_castFunction.js | 14 + publisher/node_modules/lodash/_castPath.js | 21 + publisher/node_modules/lodash/_castRest.js | 14 + publisher/node_modules/lodash/_castSlice.js | 18 + .../node_modules/lodash/_charsEndIndex.js | 19 + .../node_modules/lodash/_charsStartIndex.js | 20 + .../node_modules/lodash/_cloneArrayBuffer.js | 16 + publisher/node_modules/lodash/_cloneBuffer.js | 35 + .../node_modules/lodash/_cloneDataView.js | 16 + publisher/node_modules/lodash/_cloneRegExp.js | 17 + publisher/node_modules/lodash/_cloneSymbol.js | 18 + .../node_modules/lodash/_cloneTypedArray.js | 16 + .../node_modules/lodash/_compareAscending.js | 41 + .../node_modules/lodash/_compareMultiple.js | 44 + publisher/node_modules/lodash/_composeArgs.js | 39 + .../node_modules/lodash/_composeArgsRight.js | 41 + publisher/node_modules/lodash/_copyArray.js | 20 + publisher/node_modules/lodash/_copyObject.js | 40 + publisher/node_modules/lodash/_copySymbols.js | 16 + .../node_modules/lodash/_copySymbolsIn.js | 16 + publisher/node_modules/lodash/_coreJsData.js | 6 + .../node_modules/lodash/_countHolders.js | 21 + .../node_modules/lodash/_createAggregator.js | 23 + .../node_modules/lodash/_createAssigner.js | 37 + .../node_modules/lodash/_createBaseEach.js | 32 + .../node_modules/lodash/_createBaseFor.js | 25 + publisher/node_modules/lodash/_createBind.js | 28 + .../node_modules/lodash/_createCaseFirst.js | 33 + .../node_modules/lodash/_createCompounder.js | 24 + publisher/node_modules/lodash/_createCtor.js | 37 + publisher/node_modules/lodash/_createCurry.js | 46 + publisher/node_modules/lodash/_createFind.js | 25 + publisher/node_modules/lodash/_createFlow.js | 78 + .../node_modules/lodash/_createHybrid.js | 92 + .../node_modules/lodash/_createInverter.js | 17 + .../lodash/_createMathOperation.js | 38 + publisher/node_modules/lodash/_createOver.js | 27 + .../node_modules/lodash/_createPadding.js | 33 + .../node_modules/lodash/_createPartial.js | 43 + publisher/node_modules/lodash/_createRange.js | 30 + .../node_modules/lodash/_createRecurry.js | 56 + .../lodash/_createRelationalOperation.js | 20 + publisher/node_modules/lodash/_createRound.js | 35 + publisher/node_modules/lodash/_createSet.js | 19 + .../node_modules/lodash/_createToPairs.js | 30 + publisher/node_modules/lodash/_createWrap.js | 106 + .../lodash/_customDefaultsAssignIn.js | 29 + .../lodash/_customDefaultsMerge.js | 28 + .../node_modules/lodash/_customOmitClone.js | 16 + .../node_modules/lodash/_deburrLetter.js | 71 + .../node_modules/lodash/_defineProperty.js | 11 + publisher/node_modules/lodash/_equalArrays.js | 84 + publisher/node_modules/lodash/_equalByTag.js | 112 + .../node_modules/lodash/_equalObjects.js | 90 + .../node_modules/lodash/_escapeHtmlChar.js | 21 + .../node_modules/lodash/_escapeStringChar.js | 22 + publisher/node_modules/lodash/_flatRest.js | 16 + publisher/node_modules/lodash/_freeGlobal.js | 4 + publisher/node_modules/lodash/_getAllKeys.js | 16 + .../node_modules/lodash/_getAllKeysIn.js | 17 + publisher/node_modules/lodash/_getData.js | 15 + publisher/node_modules/lodash/_getFuncName.js | 31 + publisher/node_modules/lodash/_getHolder.js | 13 + publisher/node_modules/lodash/_getMapData.js | 18 + .../node_modules/lodash/_getMatchData.js | 24 + publisher/node_modules/lodash/_getNative.js | 17 + .../node_modules/lodash/_getPrototype.js | 6 + publisher/node_modules/lodash/_getRawTag.js | 46 + publisher/node_modules/lodash/_getSymbols.js | 30 + .../node_modules/lodash/_getSymbolsIn.js | 25 + publisher/node_modules/lodash/_getTag.js | 58 + publisher/node_modules/lodash/_getValue.js | 13 + publisher/node_modules/lodash/_getView.js | 33 + .../node_modules/lodash/_getWrapDetails.js | 17 + publisher/node_modules/lodash/_hasPath.js | 39 + publisher/node_modules/lodash/_hasUnicode.js | 26 + .../node_modules/lodash/_hasUnicodeWord.js | 15 + publisher/node_modules/lodash/_hashClear.js | 15 + publisher/node_modules/lodash/_hashDelete.js | 17 + publisher/node_modules/lodash/_hashGet.js | 30 + publisher/node_modules/lodash/_hashHas.js | 23 + publisher/node_modules/lodash/_hashSet.js | 23 + .../node_modules/lodash/_initCloneArray.js | 26 + .../node_modules/lodash/_initCloneByTag.js | 77 + .../node_modules/lodash/_initCloneObject.js | 18 + .../node_modules/lodash/_insertWrapDetails.js | 23 + .../node_modules/lodash/_isFlattenable.js | 20 + publisher/node_modules/lodash/_isIndex.js | 25 + .../node_modules/lodash/_isIterateeCall.js | 30 + publisher/node_modules/lodash/_isKey.js | 29 + publisher/node_modules/lodash/_isKeyable.js | 15 + publisher/node_modules/lodash/_isLaziable.js | 28 + publisher/node_modules/lodash/_isMaskable.js | 14 + publisher/node_modules/lodash/_isMasked.js | 20 + publisher/node_modules/lodash/_isPrototype.js | 18 + .../lodash/_isStrictComparable.js | 15 + .../node_modules/lodash/_iteratorToArray.js | 18 + publisher/node_modules/lodash/_lazyClone.js | 23 + publisher/node_modules/lodash/_lazyReverse.js | 23 + publisher/node_modules/lodash/_lazyValue.js | 69 + .../node_modules/lodash/_listCacheClear.js | 13 + .../node_modules/lodash/_listCacheDelete.js | 35 + .../node_modules/lodash/_listCacheGet.js | 19 + .../node_modules/lodash/_listCacheHas.js | 16 + .../node_modules/lodash/_listCacheSet.js | 26 + .../node_modules/lodash/_mapCacheClear.js | 21 + .../node_modules/lodash/_mapCacheDelete.js | 18 + publisher/node_modules/lodash/_mapCacheGet.js | 16 + publisher/node_modules/lodash/_mapCacheHas.js | 16 + publisher/node_modules/lodash/_mapCacheSet.js | 22 + publisher/node_modules/lodash/_mapToArray.js | 18 + .../lodash/_matchesStrictComparable.js | 20 + .../node_modules/lodash/_memoizeCapped.js | 26 + publisher/node_modules/lodash/_mergeData.js | 90 + publisher/node_modules/lodash/_metaMap.js | 6 + .../node_modules/lodash/_nativeCreate.js | 6 + publisher/node_modules/lodash/_nativeKeys.js | 6 + .../node_modules/lodash/_nativeKeysIn.js | 20 + publisher/node_modules/lodash/_nodeUtil.js | 30 + .../node_modules/lodash/_objectToString.js | 22 + publisher/node_modules/lodash/_overArg.js | 15 + publisher/node_modules/lodash/_overRest.js | 36 + publisher/node_modules/lodash/_parent.js | 16 + publisher/node_modules/lodash/_reEscape.js | 4 + publisher/node_modules/lodash/_reEvaluate.js | 4 + .../node_modules/lodash/_reInterpolate.js | 4 + publisher/node_modules/lodash/_realNames.js | 4 + publisher/node_modules/lodash/_reorder.js | 29 + .../node_modules/lodash/_replaceHolders.js | 29 + publisher/node_modules/lodash/_root.js | 9 + publisher/node_modules/lodash/_safeGet.js | 21 + publisher/node_modules/lodash/_setCacheAdd.js | 19 + publisher/node_modules/lodash/_setCacheHas.js | 14 + publisher/node_modules/lodash/_setData.js | 20 + publisher/node_modules/lodash/_setToArray.js | 18 + publisher/node_modules/lodash/_setToPairs.js | 18 + publisher/node_modules/lodash/_setToString.js | 14 + .../node_modules/lodash/_setWrapToString.js | 21 + publisher/node_modules/lodash/_shortOut.js | 37 + publisher/node_modules/lodash/_shuffleSelf.js | 28 + publisher/node_modules/lodash/_stackClear.js | 15 + publisher/node_modules/lodash/_stackDelete.js | 18 + publisher/node_modules/lodash/_stackGet.js | 14 + publisher/node_modules/lodash/_stackHas.js | 14 + publisher/node_modules/lodash/_stackSet.js | 34 + .../node_modules/lodash/_strictIndexOf.js | 23 + .../node_modules/lodash/_strictLastIndexOf.js | 21 + publisher/node_modules/lodash/_stringSize.js | 18 + .../node_modules/lodash/_stringToArray.js | 18 + .../node_modules/lodash/_stringToPath.js | 27 + publisher/node_modules/lodash/_toKey.js | 21 + publisher/node_modules/lodash/_toSource.js | 26 + .../node_modules/lodash/_trimmedEndIndex.js | 19 + .../node_modules/lodash/_unescapeHtmlChar.js | 21 + publisher/node_modules/lodash/_unicodeSize.js | 44 + .../node_modules/lodash/_unicodeToArray.js | 40 + .../node_modules/lodash/_unicodeWords.js | 69 + .../node_modules/lodash/_updateWrapDetails.js | 46 + .../node_modules/lodash/_wrapperClone.js | 23 + publisher/node_modules/lodash/add.js | 22 + publisher/node_modules/lodash/after.js | 42 + publisher/node_modules/lodash/array.js | 67 + publisher/node_modules/lodash/ary.js | 29 + publisher/node_modules/lodash/assign.js | 58 + publisher/node_modules/lodash/assignIn.js | 40 + publisher/node_modules/lodash/assignInWith.js | 38 + publisher/node_modules/lodash/assignWith.js | 37 + publisher/node_modules/lodash/at.js | 23 + publisher/node_modules/lodash/attempt.js | 35 + publisher/node_modules/lodash/before.js | 40 + publisher/node_modules/lodash/bind.js | 57 + publisher/node_modules/lodash/bindAll.js | 41 + publisher/node_modules/lodash/bindKey.js | 68 + publisher/node_modules/lodash/camelCase.js | 29 + publisher/node_modules/lodash/capitalize.js | 23 + publisher/node_modules/lodash/castArray.js | 44 + publisher/node_modules/lodash/ceil.js | 26 + publisher/node_modules/lodash/chain.js | 38 + publisher/node_modules/lodash/chunk.js | 50 + publisher/node_modules/lodash/clamp.js | 39 + publisher/node_modules/lodash/clone.js | 36 + publisher/node_modules/lodash/cloneDeep.js | 29 + .../node_modules/lodash/cloneDeepWith.js | 40 + publisher/node_modules/lodash/cloneWith.js | 42 + publisher/node_modules/lodash/collection.js | 30 + publisher/node_modules/lodash/commit.js | 33 + publisher/node_modules/lodash/compact.js | 31 + publisher/node_modules/lodash/concat.js | 43 + publisher/node_modules/lodash/cond.js | 60 + publisher/node_modules/lodash/conforms.js | 35 + publisher/node_modules/lodash/conformsTo.js | 32 + publisher/node_modules/lodash/constant.js | 26 + publisher/node_modules/lodash/core.js | 3877 ++++ publisher/node_modules/lodash/core.min.js | 29 + publisher/node_modules/lodash/countBy.js | 40 + publisher/node_modules/lodash/create.js | 43 + publisher/node_modules/lodash/curry.js | 57 + publisher/node_modules/lodash/curryRight.js | 54 + publisher/node_modules/lodash/date.js | 3 + publisher/node_modules/lodash/debounce.js | 191 + publisher/node_modules/lodash/deburr.js | 45 + publisher/node_modules/lodash/defaultTo.js | 25 + publisher/node_modules/lodash/defaults.js | 64 + publisher/node_modules/lodash/defaultsDeep.js | 30 + publisher/node_modules/lodash/defer.js | 26 + publisher/node_modules/lodash/delay.js | 28 + publisher/node_modules/lodash/difference.js | 33 + publisher/node_modules/lodash/differenceBy.js | 44 + .../node_modules/lodash/differenceWith.js | 40 + publisher/node_modules/lodash/divide.js | 22 + publisher/node_modules/lodash/drop.js | 38 + publisher/node_modules/lodash/dropRight.js | 39 + .../node_modules/lodash/dropRightWhile.js | 45 + publisher/node_modules/lodash/dropWhile.js | 45 + publisher/node_modules/lodash/each.js | 1 + publisher/node_modules/lodash/eachRight.js | 1 + publisher/node_modules/lodash/endsWith.js | 43 + publisher/node_modules/lodash/entries.js | 1 + publisher/node_modules/lodash/entriesIn.js | 1 + publisher/node_modules/lodash/eq.js | 37 + publisher/node_modules/lodash/escape.js | 43 + publisher/node_modules/lodash/escapeRegExp.js | 32 + publisher/node_modules/lodash/every.js | 56 + publisher/node_modules/lodash/extend.js | 1 + publisher/node_modules/lodash/extendWith.js | 1 + publisher/node_modules/lodash/fill.js | 45 + publisher/node_modules/lodash/filter.js | 52 + publisher/node_modules/lodash/find.js | 42 + publisher/node_modules/lodash/findIndex.js | 55 + publisher/node_modules/lodash/findKey.js | 44 + publisher/node_modules/lodash/findLast.js | 25 + .../node_modules/lodash/findLastIndex.js | 59 + publisher/node_modules/lodash/findLastKey.js | 44 + publisher/node_modules/lodash/first.js | 1 + publisher/node_modules/lodash/flake.lock | 40 + publisher/node_modules/lodash/flake.nix | 20 + publisher/node_modules/lodash/flatMap.js | 29 + publisher/node_modules/lodash/flatMapDeep.js | 31 + publisher/node_modules/lodash/flatMapDepth.js | 31 + publisher/node_modules/lodash/flatten.js | 22 + publisher/node_modules/lodash/flattenDeep.js | 25 + publisher/node_modules/lodash/flattenDepth.js | 33 + publisher/node_modules/lodash/flip.js | 28 + publisher/node_modules/lodash/floor.js | 26 + publisher/node_modules/lodash/flow.js | 27 + publisher/node_modules/lodash/flowRight.js | 26 + publisher/node_modules/lodash/forEach.js | 41 + publisher/node_modules/lodash/forEachRight.js | 31 + publisher/node_modules/lodash/forIn.js | 39 + publisher/node_modules/lodash/forInRight.js | 37 + publisher/node_modules/lodash/forOwn.js | 36 + publisher/node_modules/lodash/forOwnRight.js | 34 + publisher/node_modules/lodash/fp.js | 2 + publisher/node_modules/lodash/fp/F.js | 1 + publisher/node_modules/lodash/fp/T.js | 1 + publisher/node_modules/lodash/fp/__.js | 1 + .../node_modules/lodash/fp/_baseConvert.js | 569 + .../node_modules/lodash/fp/_convertBrowser.js | 18 + .../node_modules/lodash/fp/_falseOptions.js | 7 + publisher/node_modules/lodash/fp/_mapping.js | 358 + publisher/node_modules/lodash/fp/_util.js | 16 + publisher/node_modules/lodash/fp/add.js | 5 + publisher/node_modules/lodash/fp/after.js | 5 + publisher/node_modules/lodash/fp/all.js | 1 + publisher/node_modules/lodash/fp/allPass.js | 1 + publisher/node_modules/lodash/fp/always.js | 1 + publisher/node_modules/lodash/fp/any.js | 1 + publisher/node_modules/lodash/fp/anyPass.js | 1 + publisher/node_modules/lodash/fp/apply.js | 1 + publisher/node_modules/lodash/fp/array.js | 2 + publisher/node_modules/lodash/fp/ary.js | 5 + publisher/node_modules/lodash/fp/assign.js | 5 + publisher/node_modules/lodash/fp/assignAll.js | 5 + .../node_modules/lodash/fp/assignAllWith.js | 5 + publisher/node_modules/lodash/fp/assignIn.js | 5 + .../node_modules/lodash/fp/assignInAll.js | 5 + .../node_modules/lodash/fp/assignInAllWith.js | 5 + .../node_modules/lodash/fp/assignInWith.js | 5 + .../node_modules/lodash/fp/assignWith.js | 5 + publisher/node_modules/lodash/fp/assoc.js | 1 + publisher/node_modules/lodash/fp/assocPath.js | 1 + publisher/node_modules/lodash/fp/at.js | 5 + publisher/node_modules/lodash/fp/attempt.js | 5 + publisher/node_modules/lodash/fp/before.js | 5 + publisher/node_modules/lodash/fp/bind.js | 5 + publisher/node_modules/lodash/fp/bindAll.js | 5 + publisher/node_modules/lodash/fp/bindKey.js | 5 + publisher/node_modules/lodash/fp/camelCase.js | 5 + .../node_modules/lodash/fp/capitalize.js | 5 + publisher/node_modules/lodash/fp/castArray.js | 5 + publisher/node_modules/lodash/fp/ceil.js | 5 + publisher/node_modules/lodash/fp/chain.js | 5 + publisher/node_modules/lodash/fp/chunk.js | 5 + publisher/node_modules/lodash/fp/clamp.js | 5 + publisher/node_modules/lodash/fp/clone.js | 5 + publisher/node_modules/lodash/fp/cloneDeep.js | 5 + .../node_modules/lodash/fp/cloneDeepWith.js | 5 + publisher/node_modules/lodash/fp/cloneWith.js | 5 + .../node_modules/lodash/fp/collection.js | 2 + publisher/node_modules/lodash/fp/commit.js | 5 + publisher/node_modules/lodash/fp/compact.js | 5 + .../node_modules/lodash/fp/complement.js | 1 + publisher/node_modules/lodash/fp/compose.js | 1 + publisher/node_modules/lodash/fp/concat.js | 5 + publisher/node_modules/lodash/fp/cond.js | 5 + publisher/node_modules/lodash/fp/conforms.js | 1 + .../node_modules/lodash/fp/conformsTo.js | 5 + publisher/node_modules/lodash/fp/constant.js | 5 + publisher/node_modules/lodash/fp/contains.js | 1 + publisher/node_modules/lodash/fp/convert.js | 18 + publisher/node_modules/lodash/fp/countBy.js | 5 + publisher/node_modules/lodash/fp/create.js | 5 + publisher/node_modules/lodash/fp/curry.js | 5 + publisher/node_modules/lodash/fp/curryN.js | 5 + .../node_modules/lodash/fp/curryRight.js | 5 + .../node_modules/lodash/fp/curryRightN.js | 5 + publisher/node_modules/lodash/fp/date.js | 2 + publisher/node_modules/lodash/fp/debounce.js | 5 + publisher/node_modules/lodash/fp/deburr.js | 5 + publisher/node_modules/lodash/fp/defaultTo.js | 5 + publisher/node_modules/lodash/fp/defaults.js | 5 + .../node_modules/lodash/fp/defaultsAll.js | 5 + .../node_modules/lodash/fp/defaultsDeep.js | 5 + .../node_modules/lodash/fp/defaultsDeepAll.js | 5 + publisher/node_modules/lodash/fp/defer.js | 5 + publisher/node_modules/lodash/fp/delay.js | 5 + .../node_modules/lodash/fp/difference.js | 5 + .../node_modules/lodash/fp/differenceBy.js | 5 + .../node_modules/lodash/fp/differenceWith.js | 5 + publisher/node_modules/lodash/fp/dissoc.js | 1 + .../node_modules/lodash/fp/dissocPath.js | 1 + publisher/node_modules/lodash/fp/divide.js | 5 + publisher/node_modules/lodash/fp/drop.js | 5 + publisher/node_modules/lodash/fp/dropLast.js | 1 + .../node_modules/lodash/fp/dropLastWhile.js | 1 + publisher/node_modules/lodash/fp/dropRight.js | 5 + .../node_modules/lodash/fp/dropRightWhile.js | 5 + publisher/node_modules/lodash/fp/dropWhile.js | 5 + publisher/node_modules/lodash/fp/each.js | 1 + publisher/node_modules/lodash/fp/eachRight.js | 1 + publisher/node_modules/lodash/fp/endsWith.js | 5 + publisher/node_modules/lodash/fp/entries.js | 1 + publisher/node_modules/lodash/fp/entriesIn.js | 1 + publisher/node_modules/lodash/fp/eq.js | 5 + publisher/node_modules/lodash/fp/equals.js | 1 + publisher/node_modules/lodash/fp/escape.js | 5 + .../node_modules/lodash/fp/escapeRegExp.js | 5 + publisher/node_modules/lodash/fp/every.js | 5 + publisher/node_modules/lodash/fp/extend.js | 1 + publisher/node_modules/lodash/fp/extendAll.js | 1 + .../node_modules/lodash/fp/extendAllWith.js | 1 + .../node_modules/lodash/fp/extendWith.js | 1 + publisher/node_modules/lodash/fp/fill.js | 5 + publisher/node_modules/lodash/fp/filter.js | 5 + publisher/node_modules/lodash/fp/find.js | 5 + publisher/node_modules/lodash/fp/findFrom.js | 5 + publisher/node_modules/lodash/fp/findIndex.js | 5 + .../node_modules/lodash/fp/findIndexFrom.js | 5 + publisher/node_modules/lodash/fp/findKey.js | 5 + publisher/node_modules/lodash/fp/findLast.js | 5 + .../node_modules/lodash/fp/findLastFrom.js | 5 + .../node_modules/lodash/fp/findLastIndex.js | 5 + .../lodash/fp/findLastIndexFrom.js | 5 + .../node_modules/lodash/fp/findLastKey.js | 5 + publisher/node_modules/lodash/fp/first.js | 1 + publisher/node_modules/lodash/fp/flatMap.js | 5 + .../node_modules/lodash/fp/flatMapDeep.js | 5 + .../node_modules/lodash/fp/flatMapDepth.js | 5 + publisher/node_modules/lodash/fp/flatten.js | 5 + .../node_modules/lodash/fp/flattenDeep.js | 5 + .../node_modules/lodash/fp/flattenDepth.js | 5 + publisher/node_modules/lodash/fp/flip.js | 5 + publisher/node_modules/lodash/fp/floor.js | 5 + publisher/node_modules/lodash/fp/flow.js | 5 + publisher/node_modules/lodash/fp/flowRight.js | 5 + publisher/node_modules/lodash/fp/forEach.js | 5 + .../node_modules/lodash/fp/forEachRight.js | 5 + publisher/node_modules/lodash/fp/forIn.js | 5 + .../node_modules/lodash/fp/forInRight.js | 5 + publisher/node_modules/lodash/fp/forOwn.js | 5 + .../node_modules/lodash/fp/forOwnRight.js | 5 + publisher/node_modules/lodash/fp/fromPairs.js | 5 + publisher/node_modules/lodash/fp/function.js | 2 + publisher/node_modules/lodash/fp/functions.js | 5 + .../node_modules/lodash/fp/functionsIn.js | 5 + publisher/node_modules/lodash/fp/get.js | 5 + publisher/node_modules/lodash/fp/getOr.js | 5 + publisher/node_modules/lodash/fp/groupBy.js | 5 + publisher/node_modules/lodash/fp/gt.js | 5 + publisher/node_modules/lodash/fp/gte.js | 5 + publisher/node_modules/lodash/fp/has.js | 5 + publisher/node_modules/lodash/fp/hasIn.js | 5 + publisher/node_modules/lodash/fp/head.js | 5 + publisher/node_modules/lodash/fp/identical.js | 1 + publisher/node_modules/lodash/fp/identity.js | 5 + publisher/node_modules/lodash/fp/inRange.js | 5 + publisher/node_modules/lodash/fp/includes.js | 5 + .../node_modules/lodash/fp/includesFrom.js | 5 + publisher/node_modules/lodash/fp/indexBy.js | 1 + publisher/node_modules/lodash/fp/indexOf.js | 5 + .../node_modules/lodash/fp/indexOfFrom.js | 5 + publisher/node_modules/lodash/fp/init.js | 1 + publisher/node_modules/lodash/fp/initial.js | 5 + .../node_modules/lodash/fp/intersection.js | 5 + .../node_modules/lodash/fp/intersectionBy.js | 5 + .../lodash/fp/intersectionWith.js | 5 + publisher/node_modules/lodash/fp/invert.js | 5 + publisher/node_modules/lodash/fp/invertBy.js | 5 + publisher/node_modules/lodash/fp/invertObj.js | 1 + publisher/node_modules/lodash/fp/invoke.js | 5 + .../node_modules/lodash/fp/invokeArgs.js | 5 + .../node_modules/lodash/fp/invokeArgsMap.js | 5 + publisher/node_modules/lodash/fp/invokeMap.js | 5 + .../node_modules/lodash/fp/isArguments.js | 5 + publisher/node_modules/lodash/fp/isArray.js | 5 + .../node_modules/lodash/fp/isArrayBuffer.js | 5 + .../node_modules/lodash/fp/isArrayLike.js | 5 + .../lodash/fp/isArrayLikeObject.js | 5 + publisher/node_modules/lodash/fp/isBoolean.js | 5 + publisher/node_modules/lodash/fp/isBuffer.js | 5 + publisher/node_modules/lodash/fp/isDate.js | 5 + publisher/node_modules/lodash/fp/isElement.js | 5 + publisher/node_modules/lodash/fp/isEmpty.js | 5 + publisher/node_modules/lodash/fp/isEqual.js | 5 + .../node_modules/lodash/fp/isEqualWith.js | 5 + publisher/node_modules/lodash/fp/isError.js | 5 + publisher/node_modules/lodash/fp/isFinite.js | 5 + .../node_modules/lodash/fp/isFunction.js | 5 + publisher/node_modules/lodash/fp/isInteger.js | 5 + publisher/node_modules/lodash/fp/isLength.js | 5 + publisher/node_modules/lodash/fp/isMap.js | 5 + publisher/node_modules/lodash/fp/isMatch.js | 5 + .../node_modules/lodash/fp/isMatchWith.js | 5 + publisher/node_modules/lodash/fp/isNaN.js | 5 + publisher/node_modules/lodash/fp/isNative.js | 5 + publisher/node_modules/lodash/fp/isNil.js | 5 + publisher/node_modules/lodash/fp/isNull.js | 5 + publisher/node_modules/lodash/fp/isNumber.js | 5 + publisher/node_modules/lodash/fp/isObject.js | 5 + .../node_modules/lodash/fp/isObjectLike.js | 5 + .../node_modules/lodash/fp/isPlainObject.js | 5 + publisher/node_modules/lodash/fp/isRegExp.js | 5 + .../node_modules/lodash/fp/isSafeInteger.js | 5 + publisher/node_modules/lodash/fp/isSet.js | 5 + publisher/node_modules/lodash/fp/isString.js | 5 + publisher/node_modules/lodash/fp/isSymbol.js | 5 + .../node_modules/lodash/fp/isTypedArray.js | 5 + .../node_modules/lodash/fp/isUndefined.js | 5 + publisher/node_modules/lodash/fp/isWeakMap.js | 5 + publisher/node_modules/lodash/fp/isWeakSet.js | 5 + publisher/node_modules/lodash/fp/iteratee.js | 5 + publisher/node_modules/lodash/fp/join.js | 5 + publisher/node_modules/lodash/fp/juxt.js | 1 + publisher/node_modules/lodash/fp/kebabCase.js | 5 + publisher/node_modules/lodash/fp/keyBy.js | 5 + publisher/node_modules/lodash/fp/keys.js | 5 + publisher/node_modules/lodash/fp/keysIn.js | 5 + publisher/node_modules/lodash/fp/lang.js | 2 + publisher/node_modules/lodash/fp/last.js | 5 + .../node_modules/lodash/fp/lastIndexOf.js | 5 + .../node_modules/lodash/fp/lastIndexOfFrom.js | 5 + publisher/node_modules/lodash/fp/lowerCase.js | 5 + .../node_modules/lodash/fp/lowerFirst.js | 5 + publisher/node_modules/lodash/fp/lt.js | 5 + publisher/node_modules/lodash/fp/lte.js | 5 + publisher/node_modules/lodash/fp/map.js | 5 + publisher/node_modules/lodash/fp/mapKeys.js | 5 + publisher/node_modules/lodash/fp/mapValues.js | 5 + publisher/node_modules/lodash/fp/matches.js | 1 + .../node_modules/lodash/fp/matchesProperty.js | 5 + publisher/node_modules/lodash/fp/math.js | 2 + publisher/node_modules/lodash/fp/max.js | 5 + publisher/node_modules/lodash/fp/maxBy.js | 5 + publisher/node_modules/lodash/fp/mean.js | 5 + publisher/node_modules/lodash/fp/meanBy.js | 5 + publisher/node_modules/lodash/fp/memoize.js | 5 + publisher/node_modules/lodash/fp/merge.js | 5 + publisher/node_modules/lodash/fp/mergeAll.js | 5 + .../node_modules/lodash/fp/mergeAllWith.js | 5 + publisher/node_modules/lodash/fp/mergeWith.js | 5 + publisher/node_modules/lodash/fp/method.js | 5 + publisher/node_modules/lodash/fp/methodOf.js | 5 + publisher/node_modules/lodash/fp/min.js | 5 + publisher/node_modules/lodash/fp/minBy.js | 5 + publisher/node_modules/lodash/fp/mixin.js | 5 + publisher/node_modules/lodash/fp/multiply.js | 5 + publisher/node_modules/lodash/fp/nAry.js | 1 + publisher/node_modules/lodash/fp/negate.js | 5 + publisher/node_modules/lodash/fp/next.js | 5 + publisher/node_modules/lodash/fp/noop.js | 5 + publisher/node_modules/lodash/fp/now.js | 5 + publisher/node_modules/lodash/fp/nth.js | 5 + publisher/node_modules/lodash/fp/nthArg.js | 5 + publisher/node_modules/lodash/fp/number.js | 2 + publisher/node_modules/lodash/fp/object.js | 2 + publisher/node_modules/lodash/fp/omit.js | 5 + publisher/node_modules/lodash/fp/omitAll.js | 1 + publisher/node_modules/lodash/fp/omitBy.js | 5 + publisher/node_modules/lodash/fp/once.js | 5 + publisher/node_modules/lodash/fp/orderBy.js | 5 + publisher/node_modules/lodash/fp/over.js | 5 + publisher/node_modules/lodash/fp/overArgs.js | 5 + publisher/node_modules/lodash/fp/overEvery.js | 5 + publisher/node_modules/lodash/fp/overSome.js | 5 + publisher/node_modules/lodash/fp/pad.js | 5 + publisher/node_modules/lodash/fp/padChars.js | 5 + .../node_modules/lodash/fp/padCharsEnd.js | 5 + .../node_modules/lodash/fp/padCharsStart.js | 5 + publisher/node_modules/lodash/fp/padEnd.js | 5 + publisher/node_modules/lodash/fp/padStart.js | 5 + publisher/node_modules/lodash/fp/parseInt.js | 5 + publisher/node_modules/lodash/fp/partial.js | 5 + .../node_modules/lodash/fp/partialRight.js | 5 + publisher/node_modules/lodash/fp/partition.js | 5 + publisher/node_modules/lodash/fp/path.js | 1 + publisher/node_modules/lodash/fp/pathEq.js | 1 + publisher/node_modules/lodash/fp/pathOr.js | 1 + publisher/node_modules/lodash/fp/paths.js | 1 + publisher/node_modules/lodash/fp/pick.js | 5 + publisher/node_modules/lodash/fp/pickAll.js | 1 + publisher/node_modules/lodash/fp/pickBy.js | 5 + publisher/node_modules/lodash/fp/pipe.js | 1 + .../node_modules/lodash/fp/placeholder.js | 6 + publisher/node_modules/lodash/fp/plant.js | 5 + publisher/node_modules/lodash/fp/pluck.js | 1 + publisher/node_modules/lodash/fp/prop.js | 1 + publisher/node_modules/lodash/fp/propEq.js | 1 + publisher/node_modules/lodash/fp/propOr.js | 1 + publisher/node_modules/lodash/fp/property.js | 1 + .../node_modules/lodash/fp/propertyOf.js | 5 + publisher/node_modules/lodash/fp/props.js | 1 + publisher/node_modules/lodash/fp/pull.js | 5 + publisher/node_modules/lodash/fp/pullAll.js | 5 + publisher/node_modules/lodash/fp/pullAllBy.js | 5 + .../node_modules/lodash/fp/pullAllWith.js | 5 + publisher/node_modules/lodash/fp/pullAt.js | 5 + publisher/node_modules/lodash/fp/random.js | 5 + publisher/node_modules/lodash/fp/range.js | 5 + .../node_modules/lodash/fp/rangeRight.js | 5 + publisher/node_modules/lodash/fp/rangeStep.js | 5 + .../node_modules/lodash/fp/rangeStepRight.js | 5 + publisher/node_modules/lodash/fp/rearg.js | 5 + publisher/node_modules/lodash/fp/reduce.js | 5 + .../node_modules/lodash/fp/reduceRight.js | 5 + publisher/node_modules/lodash/fp/reject.js | 5 + publisher/node_modules/lodash/fp/remove.js | 5 + publisher/node_modules/lodash/fp/repeat.js | 5 + publisher/node_modules/lodash/fp/replace.js | 5 + publisher/node_modules/lodash/fp/rest.js | 5 + publisher/node_modules/lodash/fp/restFrom.js | 5 + publisher/node_modules/lodash/fp/result.js | 5 + publisher/node_modules/lodash/fp/reverse.js | 5 + publisher/node_modules/lodash/fp/round.js | 5 + publisher/node_modules/lodash/fp/sample.js | 5 + .../node_modules/lodash/fp/sampleSize.js | 5 + publisher/node_modules/lodash/fp/seq.js | 2 + publisher/node_modules/lodash/fp/set.js | 5 + publisher/node_modules/lodash/fp/setWith.js | 5 + publisher/node_modules/lodash/fp/shuffle.js | 5 + publisher/node_modules/lodash/fp/size.js | 5 + publisher/node_modules/lodash/fp/slice.js | 5 + publisher/node_modules/lodash/fp/snakeCase.js | 5 + publisher/node_modules/lodash/fp/some.js | 5 + publisher/node_modules/lodash/fp/sortBy.js | 5 + .../node_modules/lodash/fp/sortedIndex.js | 5 + .../node_modules/lodash/fp/sortedIndexBy.js | 5 + .../node_modules/lodash/fp/sortedIndexOf.js | 5 + .../node_modules/lodash/fp/sortedLastIndex.js | 5 + .../lodash/fp/sortedLastIndexBy.js | 5 + .../lodash/fp/sortedLastIndexOf.js | 5 + .../node_modules/lodash/fp/sortedUniq.js | 5 + .../node_modules/lodash/fp/sortedUniqBy.js | 5 + publisher/node_modules/lodash/fp/split.js | 5 + publisher/node_modules/lodash/fp/spread.js | 5 + .../node_modules/lodash/fp/spreadFrom.js | 5 + publisher/node_modules/lodash/fp/startCase.js | 5 + .../node_modules/lodash/fp/startsWith.js | 5 + publisher/node_modules/lodash/fp/string.js | 2 + publisher/node_modules/lodash/fp/stubArray.js | 5 + publisher/node_modules/lodash/fp/stubFalse.js | 5 + .../node_modules/lodash/fp/stubObject.js | 5 + .../node_modules/lodash/fp/stubString.js | 5 + publisher/node_modules/lodash/fp/stubTrue.js | 5 + publisher/node_modules/lodash/fp/subtract.js | 5 + publisher/node_modules/lodash/fp/sum.js | 5 + publisher/node_modules/lodash/fp/sumBy.js | 5 + .../lodash/fp/symmetricDifference.js | 1 + .../lodash/fp/symmetricDifferenceBy.js | 1 + .../lodash/fp/symmetricDifferenceWith.js | 1 + publisher/node_modules/lodash/fp/tail.js | 5 + publisher/node_modules/lodash/fp/take.js | 5 + publisher/node_modules/lodash/fp/takeLast.js | 1 + .../node_modules/lodash/fp/takeLastWhile.js | 1 + publisher/node_modules/lodash/fp/takeRight.js | 5 + .../node_modules/lodash/fp/takeRightWhile.js | 5 + publisher/node_modules/lodash/fp/takeWhile.js | 5 + publisher/node_modules/lodash/fp/tap.js | 5 + publisher/node_modules/lodash/fp/template.js | 5 + .../lodash/fp/templateSettings.js | 5 + publisher/node_modules/lodash/fp/throttle.js | 5 + publisher/node_modules/lodash/fp/thru.js | 5 + publisher/node_modules/lodash/fp/times.js | 5 + publisher/node_modules/lodash/fp/toArray.js | 5 + publisher/node_modules/lodash/fp/toFinite.js | 5 + publisher/node_modules/lodash/fp/toInteger.js | 5 + .../node_modules/lodash/fp/toIterator.js | 5 + publisher/node_modules/lodash/fp/toJSON.js | 5 + publisher/node_modules/lodash/fp/toLength.js | 5 + publisher/node_modules/lodash/fp/toLower.js | 5 + publisher/node_modules/lodash/fp/toNumber.js | 5 + publisher/node_modules/lodash/fp/toPairs.js | 5 + publisher/node_modules/lodash/fp/toPairsIn.js | 5 + publisher/node_modules/lodash/fp/toPath.js | 5 + .../node_modules/lodash/fp/toPlainObject.js | 5 + .../node_modules/lodash/fp/toSafeInteger.js | 5 + publisher/node_modules/lodash/fp/toString.js | 5 + publisher/node_modules/lodash/fp/toUpper.js | 5 + publisher/node_modules/lodash/fp/transform.js | 5 + publisher/node_modules/lodash/fp/trim.js | 5 + publisher/node_modules/lodash/fp/trimChars.js | 5 + .../node_modules/lodash/fp/trimCharsEnd.js | 5 + .../node_modules/lodash/fp/trimCharsStart.js | 5 + publisher/node_modules/lodash/fp/trimEnd.js | 5 + publisher/node_modules/lodash/fp/trimStart.js | 5 + publisher/node_modules/lodash/fp/truncate.js | 5 + publisher/node_modules/lodash/fp/unapply.js | 1 + publisher/node_modules/lodash/fp/unary.js | 5 + publisher/node_modules/lodash/fp/unescape.js | 5 + publisher/node_modules/lodash/fp/union.js | 5 + publisher/node_modules/lodash/fp/unionBy.js | 5 + publisher/node_modules/lodash/fp/unionWith.js | 5 + publisher/node_modules/lodash/fp/uniq.js | 5 + publisher/node_modules/lodash/fp/uniqBy.js | 5 + publisher/node_modules/lodash/fp/uniqWith.js | 5 + publisher/node_modules/lodash/fp/uniqueId.js | 5 + publisher/node_modules/lodash/fp/unnest.js | 1 + publisher/node_modules/lodash/fp/unset.js | 5 + publisher/node_modules/lodash/fp/unzip.js | 5 + publisher/node_modules/lodash/fp/unzipWith.js | 5 + publisher/node_modules/lodash/fp/update.js | 5 + .../node_modules/lodash/fp/updateWith.js | 5 + publisher/node_modules/lodash/fp/upperCase.js | 5 + .../node_modules/lodash/fp/upperFirst.js | 5 + publisher/node_modules/lodash/fp/useWith.js | 1 + publisher/node_modules/lodash/fp/util.js | 2 + publisher/node_modules/lodash/fp/value.js | 5 + publisher/node_modules/lodash/fp/valueOf.js | 5 + publisher/node_modules/lodash/fp/values.js | 5 + publisher/node_modules/lodash/fp/valuesIn.js | 5 + publisher/node_modules/lodash/fp/where.js | 1 + publisher/node_modules/lodash/fp/whereEq.js | 1 + publisher/node_modules/lodash/fp/without.js | 5 + publisher/node_modules/lodash/fp/words.js | 5 + publisher/node_modules/lodash/fp/wrap.js | 5 + publisher/node_modules/lodash/fp/wrapperAt.js | 5 + .../node_modules/lodash/fp/wrapperChain.js | 5 + .../node_modules/lodash/fp/wrapperLodash.js | 5 + .../node_modules/lodash/fp/wrapperReverse.js | 5 + .../node_modules/lodash/fp/wrapperValue.js | 5 + publisher/node_modules/lodash/fp/xor.js | 5 + publisher/node_modules/lodash/fp/xorBy.js | 5 + publisher/node_modules/lodash/fp/xorWith.js | 5 + publisher/node_modules/lodash/fp/zip.js | 5 + publisher/node_modules/lodash/fp/zipAll.js | 5 + publisher/node_modules/lodash/fp/zipObj.js | 1 + publisher/node_modules/lodash/fp/zipObject.js | 5 + .../node_modules/lodash/fp/zipObjectDeep.js | 5 + publisher/node_modules/lodash/fp/zipWith.js | 5 + publisher/node_modules/lodash/fromPairs.js | 28 + publisher/node_modules/lodash/function.js | 25 + publisher/node_modules/lodash/functions.js | 31 + publisher/node_modules/lodash/functionsIn.js | 31 + publisher/node_modules/lodash/get.js | 33 + publisher/node_modules/lodash/groupBy.js | 41 + publisher/node_modules/lodash/gt.js | 29 + publisher/node_modules/lodash/gte.js | 30 + publisher/node_modules/lodash/has.js | 35 + publisher/node_modules/lodash/hasIn.js | 34 + publisher/node_modules/lodash/head.js | 23 + publisher/node_modules/lodash/identity.js | 21 + publisher/node_modules/lodash/inRange.js | 55 + publisher/node_modules/lodash/includes.js | 53 + publisher/node_modules/lodash/index.js | 1 + publisher/node_modules/lodash/indexOf.js | 42 + publisher/node_modules/lodash/initial.js | 22 + publisher/node_modules/lodash/intersection.js | 30 + .../node_modules/lodash/intersectionBy.js | 45 + .../node_modules/lodash/intersectionWith.js | 41 + publisher/node_modules/lodash/invert.js | 42 + publisher/node_modules/lodash/invertBy.js | 56 + publisher/node_modules/lodash/invoke.js | 24 + publisher/node_modules/lodash/invokeMap.js | 41 + publisher/node_modules/lodash/isArguments.js | 36 + publisher/node_modules/lodash/isArray.js | 26 + .../node_modules/lodash/isArrayBuffer.js | 27 + publisher/node_modules/lodash/isArrayLike.js | 33 + .../node_modules/lodash/isArrayLikeObject.js | 33 + publisher/node_modules/lodash/isBoolean.js | 29 + publisher/node_modules/lodash/isBuffer.js | 38 + publisher/node_modules/lodash/isDate.js | 27 + publisher/node_modules/lodash/isElement.js | 25 + publisher/node_modules/lodash/isEmpty.js | 77 + publisher/node_modules/lodash/isEqual.js | 35 + publisher/node_modules/lodash/isEqualWith.js | 41 + publisher/node_modules/lodash/isError.js | 36 + publisher/node_modules/lodash/isFinite.js | 36 + publisher/node_modules/lodash/isFunction.js | 37 + publisher/node_modules/lodash/isInteger.js | 33 + publisher/node_modules/lodash/isLength.js | 35 + publisher/node_modules/lodash/isMap.js | 27 + publisher/node_modules/lodash/isMatch.js | 36 + publisher/node_modules/lodash/isMatchWith.js | 41 + publisher/node_modules/lodash/isNaN.js | 38 + publisher/node_modules/lodash/isNative.js | 40 + publisher/node_modules/lodash/isNil.js | 25 + publisher/node_modules/lodash/isNull.js | 22 + publisher/node_modules/lodash/isNumber.js | 38 + publisher/node_modules/lodash/isObject.js | 31 + publisher/node_modules/lodash/isObjectLike.js | 29 + .../node_modules/lodash/isPlainObject.js | 62 + publisher/node_modules/lodash/isRegExp.js | 27 + .../node_modules/lodash/isSafeInteger.js | 37 + publisher/node_modules/lodash/isSet.js | 27 + publisher/node_modules/lodash/isString.js | 30 + publisher/node_modules/lodash/isSymbol.js | 29 + publisher/node_modules/lodash/isTypedArray.js | 27 + publisher/node_modules/lodash/isUndefined.js | 22 + publisher/node_modules/lodash/isWeakMap.js | 28 + publisher/node_modules/lodash/isWeakSet.js | 28 + publisher/node_modules/lodash/iteratee.js | 53 + publisher/node_modules/lodash/join.js | 26 + publisher/node_modules/lodash/kebabCase.js | 28 + publisher/node_modules/lodash/keyBy.js | 36 + publisher/node_modules/lodash/keys.js | 37 + publisher/node_modules/lodash/keysIn.js | 32 + publisher/node_modules/lodash/lang.js | 58 + publisher/node_modules/lodash/last.js | 20 + publisher/node_modules/lodash/lastIndexOf.js | 46 + publisher/node_modules/lodash/lodash.js | 17209 ++++++++++++++++ publisher/node_modules/lodash/lodash.min.js | 140 + publisher/node_modules/lodash/lowerCase.js | 27 + publisher/node_modules/lodash/lowerFirst.js | 22 + publisher/node_modules/lodash/lt.js | 29 + publisher/node_modules/lodash/lte.js | 30 + publisher/node_modules/lodash/map.js | 53 + publisher/node_modules/lodash/mapKeys.js | 36 + publisher/node_modules/lodash/mapValues.js | 43 + publisher/node_modules/lodash/matches.js | 46 + .../node_modules/lodash/matchesProperty.js | 44 + publisher/node_modules/lodash/math.js | 17 + publisher/node_modules/lodash/max.js | 29 + publisher/node_modules/lodash/maxBy.js | 34 + publisher/node_modules/lodash/mean.js | 22 + publisher/node_modules/lodash/meanBy.js | 31 + publisher/node_modules/lodash/memoize.js | 73 + publisher/node_modules/lodash/merge.js | 39 + publisher/node_modules/lodash/mergeWith.js | 39 + publisher/node_modules/lodash/method.js | 34 + publisher/node_modules/lodash/methodOf.js | 33 + publisher/node_modules/lodash/min.js | 29 + publisher/node_modules/lodash/minBy.js | 34 + publisher/node_modules/lodash/mixin.js | 74 + publisher/node_modules/lodash/multiply.js | 22 + publisher/node_modules/lodash/negate.js | 40 + publisher/node_modules/lodash/next.js | 35 + publisher/node_modules/lodash/noop.js | 17 + publisher/node_modules/lodash/now.js | 23 + publisher/node_modules/lodash/nth.js | 29 + publisher/node_modules/lodash/nthArg.js | 32 + publisher/node_modules/lodash/number.js | 5 + publisher/node_modules/lodash/object.js | 49 + publisher/node_modules/lodash/omit.js | 57 + publisher/node_modules/lodash/omitBy.js | 29 + publisher/node_modules/lodash/once.js | 25 + publisher/node_modules/lodash/orderBy.js | 47 + publisher/node_modules/lodash/over.js | 24 + publisher/node_modules/lodash/overArgs.js | 61 + publisher/node_modules/lodash/overEvery.js | 34 + publisher/node_modules/lodash/overSome.js | 37 + publisher/node_modules/lodash/package.json | 17 + publisher/node_modules/lodash/pad.js | 49 + publisher/node_modules/lodash/padEnd.js | 39 + publisher/node_modules/lodash/padStart.js | 39 + publisher/node_modules/lodash/parseInt.js | 43 + publisher/node_modules/lodash/partial.js | 50 + publisher/node_modules/lodash/partialRight.js | 49 + publisher/node_modules/lodash/partition.js | 43 + publisher/node_modules/lodash/pick.js | 25 + publisher/node_modules/lodash/pickBy.js | 37 + publisher/node_modules/lodash/plant.js | 48 + publisher/node_modules/lodash/property.js | 32 + publisher/node_modules/lodash/propertyOf.js | 30 + publisher/node_modules/lodash/pull.js | 29 + publisher/node_modules/lodash/pullAll.js | 29 + publisher/node_modules/lodash/pullAllBy.js | 33 + publisher/node_modules/lodash/pullAllWith.js | 32 + publisher/node_modules/lodash/pullAt.js | 43 + publisher/node_modules/lodash/random.js | 82 + publisher/node_modules/lodash/range.js | 46 + publisher/node_modules/lodash/rangeRight.js | 41 + publisher/node_modules/lodash/rearg.js | 33 + publisher/node_modules/lodash/reduce.js | 51 + publisher/node_modules/lodash/reduceRight.js | 36 + publisher/node_modules/lodash/reject.js | 46 + publisher/node_modules/lodash/release.md | 48 + publisher/node_modules/lodash/remove.js | 53 + publisher/node_modules/lodash/repeat.js | 37 + publisher/node_modules/lodash/replace.js | 29 + publisher/node_modules/lodash/rest.js | 40 + publisher/node_modules/lodash/result.js | 56 + publisher/node_modules/lodash/reverse.js | 34 + publisher/node_modules/lodash/round.js | 26 + publisher/node_modules/lodash/sample.js | 24 + publisher/node_modules/lodash/sampleSize.js | 37 + publisher/node_modules/lodash/seq.js | 16 + publisher/node_modules/lodash/set.js | 35 + publisher/node_modules/lodash/setWith.js | 32 + publisher/node_modules/lodash/shuffle.js | 25 + publisher/node_modules/lodash/size.js | 46 + publisher/node_modules/lodash/slice.js | 37 + publisher/node_modules/lodash/snakeCase.js | 28 + publisher/node_modules/lodash/some.js | 51 + publisher/node_modules/lodash/sortBy.js | 48 + publisher/node_modules/lodash/sortedIndex.js | 24 + .../node_modules/lodash/sortedIndexBy.js | 33 + .../node_modules/lodash/sortedIndexOf.js | 31 + .../node_modules/lodash/sortedLastIndex.js | 25 + .../node_modules/lodash/sortedLastIndexBy.js | 33 + .../node_modules/lodash/sortedLastIndexOf.js | 31 + publisher/node_modules/lodash/sortedUniq.js | 24 + publisher/node_modules/lodash/sortedUniqBy.js | 26 + publisher/node_modules/lodash/split.js | 52 + publisher/node_modules/lodash/spread.js | 63 + publisher/node_modules/lodash/startCase.js | 29 + publisher/node_modules/lodash/startsWith.js | 39 + publisher/node_modules/lodash/string.js | 33 + publisher/node_modules/lodash/stubArray.js | 23 + publisher/node_modules/lodash/stubFalse.js | 18 + publisher/node_modules/lodash/stubObject.js | 23 + publisher/node_modules/lodash/stubString.js | 18 + publisher/node_modules/lodash/stubTrue.js | 18 + publisher/node_modules/lodash/subtract.js | 22 + publisher/node_modules/lodash/sum.js | 24 + publisher/node_modules/lodash/sumBy.js | 33 + publisher/node_modules/lodash/tail.js | 22 + publisher/node_modules/lodash/take.js | 37 + publisher/node_modules/lodash/takeRight.js | 39 + .../node_modules/lodash/takeRightWhile.js | 45 + publisher/node_modules/lodash/takeWhile.js | 45 + publisher/node_modules/lodash/tap.js | 29 + publisher/node_modules/lodash/template.js | 272 + .../node_modules/lodash/templateSettings.js | 67 + publisher/node_modules/lodash/throttle.js | 69 + publisher/node_modules/lodash/thru.js | 28 + publisher/node_modules/lodash/times.js | 51 + publisher/node_modules/lodash/toArray.js | 58 + publisher/node_modules/lodash/toFinite.js | 42 + publisher/node_modules/lodash/toInteger.js | 36 + publisher/node_modules/lodash/toIterator.js | 23 + publisher/node_modules/lodash/toJSON.js | 1 + publisher/node_modules/lodash/toLength.js | 38 + publisher/node_modules/lodash/toLower.js | 28 + publisher/node_modules/lodash/toNumber.js | 64 + publisher/node_modules/lodash/toPairs.js | 30 + publisher/node_modules/lodash/toPairsIn.js | 30 + publisher/node_modules/lodash/toPath.js | 33 + .../node_modules/lodash/toPlainObject.js | 32 + .../node_modules/lodash/toSafeInteger.js | 37 + publisher/node_modules/lodash/toString.js | 28 + publisher/node_modules/lodash/toUpper.js | 28 + publisher/node_modules/lodash/transform.js | 65 + publisher/node_modules/lodash/trim.js | 47 + publisher/node_modules/lodash/trimEnd.js | 41 + publisher/node_modules/lodash/trimStart.js | 43 + publisher/node_modules/lodash/truncate.js | 111 + publisher/node_modules/lodash/unary.js | 22 + publisher/node_modules/lodash/unescape.js | 34 + publisher/node_modules/lodash/union.js | 26 + publisher/node_modules/lodash/unionBy.js | 39 + publisher/node_modules/lodash/unionWith.js | 34 + publisher/node_modules/lodash/uniq.js | 25 + publisher/node_modules/lodash/uniqBy.js | 31 + publisher/node_modules/lodash/uniqWith.js | 28 + publisher/node_modules/lodash/uniqueId.js | 28 + publisher/node_modules/lodash/unset.js | 34 + publisher/node_modules/lodash/unzip.js | 45 + publisher/node_modules/lodash/unzipWith.js | 39 + publisher/node_modules/lodash/update.js | 35 + publisher/node_modules/lodash/updateWith.js | 33 + publisher/node_modules/lodash/upperCase.js | 27 + publisher/node_modules/lodash/upperFirst.js | 22 + publisher/node_modules/lodash/util.js | 34 + publisher/node_modules/lodash/value.js | 1 + publisher/node_modules/lodash/valueOf.js | 1 + publisher/node_modules/lodash/values.js | 34 + publisher/node_modules/lodash/valuesIn.js | 32 + publisher/node_modules/lodash/without.js | 31 + publisher/node_modules/lodash/words.js | 35 + publisher/node_modules/lodash/wrap.js | 30 + publisher/node_modules/lodash/wrapperAt.js | 48 + publisher/node_modules/lodash/wrapperChain.js | 34 + .../node_modules/lodash/wrapperLodash.js | 147 + .../node_modules/lodash/wrapperReverse.js | 44 + publisher/node_modules/lodash/wrapperValue.js | 21 + publisher/node_modules/lodash/xor.js | 28 + publisher/node_modules/lodash/xorBy.js | 39 + publisher/node_modules/lodash/xorWith.js | 34 + publisher/node_modules/lodash/zip.js | 22 + publisher/node_modules/lodash/zipObject.js | 24 + .../node_modules/lodash/zipObjectDeep.js | 23 + publisher/node_modules/lodash/zipWith.js | 32 + publisher/node_modules/memory-stream/LICENSE | 21 + .../node_modules/memory-stream/README.md | 20 + publisher/node_modules/memory-stream/index.js | 62 + .../node_modules/memory-stream/package.json | 31 + .../memory-stream/test/object.json | 4 + .../memory-stream/test/source.txt | 1 + .../memory-stream/test/tests/unit.js | 39 + publisher/node_modules/merge2/LICENSE | 21 + publisher/node_modules/merge2/README.md | 144 + publisher/node_modules/merge2/index.js | 144 + publisher/node_modules/merge2/package.json | 43 + publisher/node_modules/micromatch/LICENSE | 21 + publisher/node_modules/micromatch/README.md | 1024 + publisher/node_modules/micromatch/index.js | 474 + .../node_modules/micromatch/package.json | 119 + publisher/node_modules/mime-db/HISTORY.md | 507 + publisher/node_modules/mime-db/LICENSE | 23 + publisher/node_modules/mime-db/README.md | 100 + publisher/node_modules/mime-db/db.json | 8519 ++++++++ publisher/node_modules/mime-db/index.js | 12 + publisher/node_modules/mime-db/package.json | 60 + publisher/node_modules/mime-types/HISTORY.md | 397 + publisher/node_modules/mime-types/LICENSE | 23 + publisher/node_modules/mime-types/README.md | 113 + publisher/node_modules/mime-types/index.js | 188 + .../node_modules/mime-types/package.json | 44 + publisher/node_modules/minipass/LICENSE | 15 + publisher/node_modules/minipass/README.md | 728 + publisher/node_modules/minipass/index.d.ts | 155 + publisher/node_modules/minipass/index.js | 649 + publisher/node_modules/minipass/package.json | 56 + publisher/node_modules/minizlib/LICENSE | 26 + publisher/node_modules/minizlib/README.md | 60 + publisher/node_modules/minizlib/constants.js | 115 + publisher/node_modules/minizlib/index.js | 348 + publisher/node_modules/minizlib/package.json | 42 + publisher/node_modules/mkdirp/CHANGELOG.md | 15 + publisher/node_modules/mkdirp/LICENSE | 21 + publisher/node_modules/mkdirp/bin/cmd.js | 68 + publisher/node_modules/mkdirp/index.js | 31 + .../node_modules/mkdirp/lib/find-made.js | 29 + .../node_modules/mkdirp/lib/mkdirp-manual.js | 64 + .../node_modules/mkdirp/lib/mkdirp-native.js | 39 + publisher/node_modules/mkdirp/lib/opts-arg.js | 23 + publisher/node_modules/mkdirp/lib/path-arg.js | 29 + .../node_modules/mkdirp/lib/use-native.js | 10 + publisher/node_modules/mkdirp/package.json | 44 + publisher/node_modules/mkdirp/readme.markdown | 266 + .../node_modules/node-addon-api/LICENSE.md | 9 + .../node_modules/node-addon-api/README.md | 95 + .../node_modules/node-addon-api/common.gypi | 21 + .../node_modules/node-addon-api/except.gypi | 25 + .../node_modules/node-addon-api/index.js | 14 + .../node-addon-api/napi-inl.deprecated.h | 186 + .../node_modules/node-addon-api/napi-inl.h | 6896 +++++++ publisher/node_modules/node-addon-api/napi.h | 3276 +++ .../node-addon-api/node_addon_api.gyp | 32 + .../node_modules/node-addon-api/node_api.gyp | 9 + .../node_modules/node-addon-api/noexcept.gypi | 26 + .../node_modules/node-addon-api/nothing.c | 0 .../node-addon-api/package-support.json | 21 + .../node_modules/node-addon-api/package.json | 486 + .../node-addon-api/tools/README.md | 73 + .../node-addon-api/tools/check-napi.js | 99 + .../node-addon-api/tools/clang-format.js | 71 + .../node-addon-api/tools/conversion.js | 301 + .../node-addon-api/tools/eslint-format.js | 79 + publisher/node_modules/node-int64/.npmignore | 3 + publisher/node_modules/node-int64/Int64.js | 268 + publisher/node_modules/node-int64/LICENSE | 19 + publisher/node_modules/node-int64/README.md | 78 + .../node_modules/node-int64/package.json | 27 + publisher/node_modules/node-int64/test.js | 120 + publisher/node_modules/npmlog/LICENSE.md | 20 + publisher/node_modules/npmlog/README.md | 216 + publisher/node_modules/npmlog/lib/log.js | 404 + publisher/node_modules/npmlog/package.json | 51 + .../node_modules/object-inspect/.eslintrc | 53 + .../object-inspect/.github/FUNDING.yml | 12 + publisher/node_modules/object-inspect/.nycrc | 13 + .../node_modules/object-inspect/CHANGELOG.md | 416 + publisher/node_modules/object-inspect/LICENSE | 21 + .../object-inspect/example/all.js | 23 + .../object-inspect/example/circular.js | 6 + .../node_modules/object-inspect/example/fn.js | 5 + .../object-inspect/example/inspect.js | 10 + .../node_modules/object-inspect/index.js | 541 + .../object-inspect/package-support.json | 20 + .../node_modules/object-inspect/package.json | 104 + .../object-inspect/readme.markdown | 84 + .../object-inspect/test-core-js.js | 26 + .../object-inspect/test/bigint.js | 58 + .../object-inspect/test/browser/dom.js | 15 + .../object-inspect/test/circular.js | 16 + .../node_modules/object-inspect/test/deep.js | 12 + .../object-inspect/test/element.js | 53 + .../node_modules/object-inspect/test/err.js | 48 + .../node_modules/object-inspect/test/fakes.js | 29 + .../node_modules/object-inspect/test/fn.js | 76 + .../object-inspect/test/global.js | 17 + .../node_modules/object-inspect/test/has.js | 15 + .../node_modules/object-inspect/test/holes.js | 15 + .../object-inspect/test/indent-option.js | 271 + .../object-inspect/test/inspect.js | 139 + .../object-inspect/test/lowbyte.js | 12 + .../object-inspect/test/number.js | 58 + .../object-inspect/test/quoteStyle.js | 26 + .../object-inspect/test/toStringTag.js | 40 + .../node_modules/object-inspect/test/undef.js | 12 + .../object-inspect/test/values.js | 211 + .../object-inspect/util.inspect.js | 1 + publisher/node_modules/path-parse/LICENSE | 21 + publisher/node_modules/path-parse/README.md | 42 + publisher/node_modules/path-parse/index.js | 75 + .../node_modules/path-parse/package.json | 33 + .../node_modules/performance-now/.npmignore | 1 + .../performance-now/.tm_properties | 7 + .../node_modules/performance-now/.travis.yml | 6 + .../node_modules/performance-now/README.md | 30 + .../performance-now/lib/performance-now.js | 36 + .../lib/performance-now.js.map | 10 + .../node_modules/performance-now/license.txt | 7 + .../node_modules/performance-now/package.json | 35 + .../performance-now/src/index.d.ts | 8 + .../src/performance-now.coffee | 17 + .../performance-now/test/mocha.opts | 3 + .../test/performance-now.coffee | 43 + .../performance-now/test/scripts.coffee | 27 + .../test/scripts/delayed-call.coffee | 11 + .../test/scripts/delayed-require.coffee | 12 + .../test/scripts/difference.coffee | 6 + .../test/scripts/initial-value.coffee | 10 + publisher/node_modules/picomatch/CHANGELOG.md | 136 + publisher/node_modules/picomatch/LICENSE | 21 + publisher/node_modules/picomatch/README.md | 708 + publisher/node_modules/picomatch/index.js | 3 + .../node_modules/picomatch/lib/constants.js | 179 + publisher/node_modules/picomatch/lib/parse.js | 1091 + .../node_modules/picomatch/lib/picomatch.js | 342 + publisher/node_modules/picomatch/lib/scan.js | 391 + publisher/node_modules/picomatch/lib/utils.js | 64 + publisher/node_modules/picomatch/package.json | 81 + .../process-nextick-args/index.js | 45 + .../process-nextick-args/license.md | 19 + .../process-nextick-args/package.json | 25 + .../process-nextick-args/readme.md | 18 + publisher/node_modules/qs/.editorconfig | 46 + publisher/node_modules/qs/.eslintrc | 38 + publisher/node_modules/qs/.github/FUNDING.yml | 12 + publisher/node_modules/qs/.nycrc | 13 + publisher/node_modules/qs/CHANGELOG.md | 600 + publisher/node_modules/qs/LICENSE.md | 29 + publisher/node_modules/qs/README.md | 709 + publisher/node_modules/qs/dist/qs.js | 90 + publisher/node_modules/qs/lib/formats.js | 23 + publisher/node_modules/qs/lib/index.js | 11 + publisher/node_modules/qs/lib/parse.js | 296 + publisher/node_modules/qs/lib/stringify.js | 351 + publisher/node_modules/qs/lib/utils.js | 265 + publisher/node_modules/qs/package.json | 91 + .../node_modules/qs/test/empty-keys-cases.js | 267 + publisher/node_modules/qs/test/parse.js | 1170 ++ publisher/node_modules/qs/test/stringify.js | 1298 ++ publisher/node_modules/qs/test/utils.js | 136 + .../node_modules/queue-microtask/LICENSE | 20 + .../node_modules/queue-microtask/README.md | 90 + .../node_modules/queue-microtask/index.d.ts | 2 + .../node_modules/queue-microtask/index.js | 9 + .../node_modules/queue-microtask/package.json | 55 + .../readable-stream/CONTRIBUTING.md | 38 + .../readable-stream/GOVERNANCE.md | 136 + .../node_modules/readable-stream/LICENSE | 47 + .../node_modules/readable-stream/README.md | 106 + .../readable-stream/errors-browser.js | 127 + .../node_modules/readable-stream/errors.js | 116 + .../readable-stream/experimentalWarning.js | 17 + .../readable-stream/lib/_stream_duplex.js | 126 + .../lib/_stream_passthrough.js | 37 + .../readable-stream/lib/_stream_readable.js | 1027 + .../readable-stream/lib/_stream_transform.js | 190 + .../readable-stream/lib/_stream_writable.js | 641 + .../lib/internal/streams/async_iterator.js | 180 + .../lib/internal/streams/buffer_list.js | 183 + .../lib/internal/streams/destroy.js | 96 + .../lib/internal/streams/end-of-stream.js | 86 + .../lib/internal/streams/from-browser.js | 3 + .../lib/internal/streams/from.js | 52 + .../lib/internal/streams/pipeline.js | 86 + .../lib/internal/streams/state.js | 22 + .../lib/internal/streams/stream-browser.js | 1 + .../lib/internal/streams/stream.js | 1 + .../node_modules/readable-stream/package.json | 68 + .../readable-stream/readable-browser.js | 9 + .../node_modules/readable-stream/readable.js | 16 + publisher/node_modules/resolve/.editorconfig | 37 + publisher/node_modules/resolve/.eslintrc | 65 + .../node_modules/resolve/.github/FUNDING.yml | 12 + publisher/node_modules/resolve/LICENSE | 21 + publisher/node_modules/resolve/SECURITY.md | 3 + publisher/node_modules/resolve/async.js | 3 + publisher/node_modules/resolve/bin/resolve | 50 + .../node_modules/resolve/example/async.js | 5 + .../node_modules/resolve/example/sync.js | 3 + publisher/node_modules/resolve/index.js | 6 + publisher/node_modules/resolve/lib/async.js | 329 + publisher/node_modules/resolve/lib/caller.js | 8 + publisher/node_modules/resolve/lib/core.js | 12 + publisher/node_modules/resolve/lib/core.json | 158 + publisher/node_modules/resolve/lib/homedir.js | 24 + publisher/node_modules/resolve/lib/is-core.js | 5 + .../resolve/lib/node-modules-paths.js | 42 + .../resolve/lib/normalize-options.js | 10 + publisher/node_modules/resolve/lib/sync.js | 208 + publisher/node_modules/resolve/package.json | 72 + .../node_modules/resolve/readme.markdown | 301 + publisher/node_modules/resolve/sync.js | 3 + publisher/node_modules/resolve/test/core.js | 88 + publisher/node_modules/resolve/test/dotdot.js | 29 + .../resolve/test/dotdot/abc/index.js | 2 + .../node_modules/resolve/test/dotdot/index.js | 1 + .../resolve/test/faulty_basedir.js | 29 + publisher/node_modules/resolve/test/filter.js | 34 + .../node_modules/resolve/test/filter_sync.js | 33 + .../node_modules/resolve/test/home_paths.js | 127 + .../resolve/test/home_paths_sync.js | 114 + publisher/node_modules/resolve/test/mock.js | 315 + .../node_modules/resolve/test/mock_sync.js | 214 + .../node_modules/resolve/test/module_dir.js | 56 + .../test/module_dir/xmodules/aaa/index.js | 1 + .../test/module_dir/ymodules/aaa/index.js | 1 + .../test/module_dir/zmodules/bbb/main.js | 1 + .../test/module_dir/zmodules/bbb/package.json | 3 + .../resolve/test/node-modules-paths.js | 143 + .../node_modules/resolve/test/node_path.js | 70 + .../resolve/test/node_path/x/aaa/index.js | 1 + .../resolve/test/node_path/x/ccc/index.js | 1 + .../resolve/test/node_path/y/bbb/index.js | 1 + .../resolve/test/node_path/y/ccc/index.js | 1 + .../node_modules/resolve/test/nonstring.js | 9 + .../node_modules/resolve/test/pathfilter.js | 75 + .../resolve/test/pathfilter/deep_ref/main.js | 0 .../node_modules/resolve/test/precedence.js | 23 + .../resolve/test/precedence/aaa.js | 1 + .../resolve/test/precedence/aaa/index.js | 1 + .../resolve/test/precedence/aaa/main.js | 1 + .../resolve/test/precedence/bbb.js | 1 + .../resolve/test/precedence/bbb/main.js | 1 + .../node_modules/resolve/test/resolver.js | 597 + .../resolve/test/resolver/baz/doom.js | 0 .../resolve/test/resolver/baz/package.json | 4 + .../resolve/test/resolver/baz/quux.js | 1 + .../resolve/test/resolver/browser_field/a.js | 0 .../resolve/test/resolver/browser_field/b.js | 0 .../test/resolver/browser_field/package.json | 5 + .../resolve/test/resolver/cup.coffee | 1 + .../resolve/test/resolver/dot_main/index.js | 1 + .../test/resolver/dot_main/package.json | 3 + .../test/resolver/dot_slash_main/index.js | 1 + .../test/resolver/dot_slash_main/package.json | 3 + .../resolve/test/resolver/false_main/index.js | 0 .../test/resolver/false_main/package.json | 4 + .../node_modules/resolve/test/resolver/foo.js | 1 + .../test/resolver/incorrect_main/index.js | 2 + .../test/resolver/incorrect_main/package.json | 3 + .../test/resolver/invalid_main/package.json | 7 + .../resolve/test/resolver/mug.coffee | 0 .../node_modules/resolve/test/resolver/mug.js | 0 .../test/resolver/multirepo/lerna.json | 6 + .../test/resolver/multirepo/package.json | 20 + .../multirepo/packages/package-a/index.js | 35 + .../multirepo/packages/package-a/package.json | 14 + .../multirepo/packages/package-b/index.js | 0 .../multirepo/packages/package-b/package.json | 14 + .../resolver/nested_symlinks/mylib/async.js | 26 + .../nested_symlinks/mylib/package.json | 15 + .../resolver/nested_symlinks/mylib/sync.js | 12 + .../test/resolver/other_path/lib/other-lib.js | 0 .../resolve/test/resolver/other_path/root.js | 0 .../resolve/test/resolver/quux/foo/index.js | 1 + .../resolve/test/resolver/same_names/foo.js | 1 + .../test/resolver/same_names/foo/index.js | 1 + .../resolver/symlinked/_/node_modules/foo.js | 0 .../symlinked/_/symlink_target/.gitkeep | 0 .../test/resolver/symlinked/package/bar.js | 1 + .../resolver/symlinked/package/package.json | 3 + .../test/resolver/without_basedir/main.js | 5 + .../resolve/test/resolver_sync.js | 730 + .../resolve/test/shadowed_core.js | 54 + .../shadowed_core/node_modules/util/index.js | 0 .../node_modules/resolve/test/subdirs.js | 13 + .../node_modules/resolve/test/symlinks.js | 176 + publisher/node_modules/reusify/.coveralls.yml | 1 + publisher/node_modules/reusify/.travis.yml | 28 + publisher/node_modules/reusify/LICENSE | 22 + publisher/node_modules/reusify/README.md | 145 + .../benchmarks/createNoCodeFunction.js | 30 + .../node_modules/reusify/benchmarks/fib.js | 13 + .../reusify/benchmarks/reuseNoCodeFunction.js | 38 + publisher/node_modules/reusify/package.json | 45 + publisher/node_modules/reusify/reusify.js | 33 + publisher/node_modules/reusify/test.js | 66 + publisher/node_modules/run-parallel/LICENSE | 20 + publisher/node_modules/run-parallel/README.md | 85 + publisher/node_modules/run-parallel/index.js | 51 + .../node_modules/run-parallel/package.json | 58 + publisher/node_modules/safe-buffer/LICENSE | 21 + publisher/node_modules/safe-buffer/README.md | 584 + publisher/node_modules/safe-buffer/index.d.ts | 187 + publisher/node_modules/safe-buffer/index.js | 65 + .../node_modules/safe-buffer/package.json | 51 + publisher/node_modules/safer-buffer/LICENSE | 21 + .../safer-buffer/Porting-Buffer.md | 268 + publisher/node_modules/safer-buffer/Readme.md | 156 + .../node_modules/safer-buffer/dangerous.js | 58 + .../node_modules/safer-buffer/package.json | 34 + publisher/node_modules/safer-buffer/safer.js | 77 + publisher/node_modules/safer-buffer/tests.js | 406 + publisher/node_modules/semver/LICENSE | 15 + publisher/node_modules/semver/README.md | 654 + publisher/node_modules/semver/bin/semver.js | 188 + .../node_modules/semver/classes/comparator.js | 141 + .../node_modules/semver/classes/index.js | 5 + .../node_modules/semver/classes/range.js | 554 + .../node_modules/semver/classes/semver.js | 302 + .../node_modules/semver/functions/clean.js | 6 + .../node_modules/semver/functions/cmp.js | 52 + .../node_modules/semver/functions/coerce.js | 60 + .../semver/functions/compare-build.js | 7 + .../semver/functions/compare-loose.js | 3 + .../node_modules/semver/functions/compare.js | 5 + .../node_modules/semver/functions/diff.js | 65 + publisher/node_modules/semver/functions/eq.js | 3 + publisher/node_modules/semver/functions/gt.js | 3 + .../node_modules/semver/functions/gte.js | 3 + .../node_modules/semver/functions/inc.js | 19 + publisher/node_modules/semver/functions/lt.js | 3 + .../node_modules/semver/functions/lte.js | 3 + .../node_modules/semver/functions/major.js | 3 + .../node_modules/semver/functions/minor.js | 3 + .../node_modules/semver/functions/neq.js | 3 + .../node_modules/semver/functions/parse.js | 16 + .../node_modules/semver/functions/patch.js | 3 + .../semver/functions/prerelease.js | 6 + .../node_modules/semver/functions/rcompare.js | 3 + .../node_modules/semver/functions/rsort.js | 3 + .../semver/functions/satisfies.js | 10 + .../node_modules/semver/functions/sort.js | 3 + .../node_modules/semver/functions/valid.js | 6 + publisher/node_modules/semver/index.js | 89 + .../node_modules/semver/internal/constants.js | 35 + .../node_modules/semver/internal/debug.js | 9 + .../semver/internal/identifiers.js | 23 + .../node_modules/semver/internal/lrucache.js | 40 + .../semver/internal/parse-options.js | 15 + publisher/node_modules/semver/internal/re.js | 217 + publisher/node_modules/semver/package.json | 77 + publisher/node_modules/semver/preload.js | 2 + publisher/node_modules/semver/range.bnf | 16 + publisher/node_modules/semver/ranges/gtr.js | 4 + .../node_modules/semver/ranges/intersects.js | 7 + publisher/node_modules/semver/ranges/ltr.js | 4 + .../semver/ranges/max-satisfying.js | 25 + .../semver/ranges/min-satisfying.js | 24 + .../node_modules/semver/ranges/min-version.js | 61 + .../node_modules/semver/ranges/outside.js | 80 + .../node_modules/semver/ranges/simplify.js | 47 + .../node_modules/semver/ranges/subset.js | 247 + .../semver/ranges/to-comparators.js | 8 + publisher/node_modules/semver/ranges/valid.js | 11 + .../node_modules/set-blocking/CHANGELOG.md | 26 + .../node_modules/set-blocking/LICENSE.txt | 14 + publisher/node_modules/set-blocking/README.md | 31 + publisher/node_modules/set-blocking/index.js | 7 + .../node_modules/set-blocking/package.json | 42 + .../set-function-length/.eslintrc | 27 + .../set-function-length/.github/FUNDING.yml | 12 + .../node_modules/set-function-length/.nycrc | 13 + .../set-function-length/CHANGELOG.md | 70 + .../node_modules/set-function-length/LICENSE | 21 + .../set-function-length/README.md | 56 + .../node_modules/set-function-length/env.d.ts | 9 + .../node_modules/set-function-length/env.js | 25 + .../set-function-length/index.d.ts | 7 + .../node_modules/set-function-length/index.js | 42 + .../set-function-length/package.json | 102 + .../set-function-length/tsconfig.json | 9 + .../node_modules/side-channel/.editorconfig | 9 + publisher/node_modules/side-channel/.eslintrc | 11 + .../side-channel/.github/FUNDING.yml | 12 + publisher/node_modules/side-channel/.nycrc | 13 + .../node_modules/side-channel/CHANGELOG.md | 95 + publisher/node_modules/side-channel/LICENSE | 21 + publisher/node_modules/side-channel/README.md | 2 + .../node_modules/side-channel/index.d.ts | 27 + publisher/node_modules/side-channel/index.js | 129 + .../node_modules/side-channel/package.json | 84 + .../node_modules/side-channel/test/index.js | 83 + .../node_modules/side-channel/tsconfig.json | 50 + .../node_modules/signal-exit/LICENSE.txt | 16 + publisher/node_modules/signal-exit/README.md | 39 + publisher/node_modules/signal-exit/index.js | 202 + .../node_modules/signal-exit/package.json | 38 + publisher/node_modules/signal-exit/signals.js | 53 + publisher/node_modules/splitargs2/LICENSE | 5 + publisher/node_modules/splitargs2/README.md | 48 + .../node_modules/splitargs2/package.json | 27 + .../node_modules/splitargs2/splitargs2.d.ts | 11 + .../node_modules/splitargs2/splitargs2.js | 48 + publisher/node_modules/sshpk/.travis.yml | 11 + publisher/node_modules/sshpk/Jenkinsfile | 86 + publisher/node_modules/sshpk/LICENSE | 18 + publisher/node_modules/sshpk/README.md | 804 + publisher/node_modules/sshpk/bin/sshpk-conv | 243 + publisher/node_modules/sshpk/bin/sshpk-sign | 191 + publisher/node_modules/sshpk/bin/sshpk-verify | 167 + publisher/node_modules/sshpk/lib/algs.js | 168 + .../node_modules/sshpk/lib/certificate.js | 410 + publisher/node_modules/sshpk/lib/dhe.js | 397 + publisher/node_modules/sshpk/lib/ed-compat.js | 92 + publisher/node_modules/sshpk/lib/errors.js | 84 + .../node_modules/sshpk/lib/fingerprint.js | 220 + .../node_modules/sshpk/lib/formats/auto.js | 124 + .../node_modules/sshpk/lib/formats/dnssec.js | 287 + .../sshpk/lib/formats/openssh-cert.js | 352 + .../node_modules/sshpk/lib/formats/pem.js | 290 + .../node_modules/sshpk/lib/formats/pkcs1.js | 373 + .../node_modules/sshpk/lib/formats/pkcs8.js | 643 + .../node_modules/sshpk/lib/formats/putty.js | 194 + .../node_modules/sshpk/lib/formats/rfc4253.js | 166 + .../sshpk/lib/formats/ssh-private.js | 262 + .../node_modules/sshpk/lib/formats/ssh.js | 115 + .../sshpk/lib/formats/x509-pem.js | 88 + .../node_modules/sshpk/lib/formats/x509.js | 752 + publisher/node_modules/sshpk/lib/identity.js | 373 + publisher/node_modules/sshpk/lib/index.js | 40 + publisher/node_modules/sshpk/lib/key.js | 294 + .../node_modules/sshpk/lib/private-key.js | 247 + publisher/node_modules/sshpk/lib/signature.js | 314 + .../node_modules/sshpk/lib/ssh-buffer.js | 149 + publisher/node_modules/sshpk/lib/utils.js | 404 + .../node_modules/sshpk/man/man1/sshpk-conv.1 | 135 + .../node_modules/sshpk/man/man1/sshpk-sign.1 | 81 + .../sshpk/man/man1/sshpk-verify.1 | 68 + publisher/node_modules/sshpk/package.json | 59 + .../node_modules/string-width/index.d.ts | 29 + publisher/node_modules/string-width/index.js | 47 + publisher/node_modules/string-width/license | 9 + .../node_modules/string-width/package.json | 56 + publisher/node_modules/string-width/readme.md | 50 + publisher/node_modules/string_decoder/LICENSE | 48 + .../node_modules/string_decoder/README.md | 47 + .../string_decoder/lib/string_decoder.js | 296 + .../node_modules/string_decoder/package.json | 34 + publisher/node_modules/strip-ansi/index.d.ts | 17 + publisher/node_modules/strip-ansi/index.js | 4 + publisher/node_modules/strip-ansi/license | 9 + .../node_modules/strip-ansi/package.json | 54 + publisher/node_modules/strip-ansi/readme.md | 46 + .../supports-preserve-symlinks-flag/.eslintrc | 14 + .../.github/FUNDING.yml | 12 + .../supports-preserve-symlinks-flag/.nycrc | 9 + .../CHANGELOG.md | 22 + .../supports-preserve-symlinks-flag/LICENSE | 21 + .../supports-preserve-symlinks-flag/README.md | 42 + .../browser.js | 3 + .../supports-preserve-symlinks-flag/index.js | 9 + .../package.json | 70 + .../test/index.js | 29 + publisher/node_modules/tar/LICENSE | 15 + publisher/node_modules/tar/README.md | 1080 + publisher/node_modules/tar/index.js | 18 + publisher/node_modules/tar/lib/create.js | 111 + publisher/node_modules/tar/lib/extract.js | 113 + .../node_modules/tar/lib/get-write-flag.js | 20 + publisher/node_modules/tar/lib/header.js | 304 + .../node_modules/tar/lib/high-level-opt.js | 29 + .../node_modules/tar/lib/large-numbers.js | 104 + publisher/node_modules/tar/lib/list.js | 139 + publisher/node_modules/tar/lib/mkdir.js | 229 + publisher/node_modules/tar/lib/mode-fix.js | 27 + .../node_modules/tar/lib/normalize-unicode.js | 12 + .../tar/lib/normalize-windows-path.js | 8 + publisher/node_modules/tar/lib/pack.js | 432 + publisher/node_modules/tar/lib/parse.js | 552 + .../node_modules/tar/lib/path-reservations.js | 156 + publisher/node_modules/tar/lib/pax.js | 150 + publisher/node_modules/tar/lib/read-entry.js | 107 + publisher/node_modules/tar/lib/replace.js | 246 + .../tar/lib/strip-absolute-path.js | 24 + .../tar/lib/strip-trailing-slashes.js | 13 + publisher/node_modules/tar/lib/types.js | 44 + publisher/node_modules/tar/lib/unpack.js | 923 + publisher/node_modules/tar/lib/update.js | 40 + publisher/node_modules/tar/lib/warn-mixin.js | 24 + publisher/node_modules/tar/lib/winchars.js | 23 + publisher/node_modules/tar/lib/write-entry.js | 546 + .../tar/node_modules/minipass/LICENSE | 15 + .../tar/node_modules/minipass/README.md | 769 + .../tar/node_modules/minipass/index.d.ts | 152 + .../tar/node_modules/minipass/index.js | 702 + .../tar/node_modules/minipass/index.mjs | 702 + .../tar/node_modules/minipass/package.json | 76 + publisher/node_modules/tar/package.json | 70 + publisher/node_modules/tldts-core/LICENSE | 13 + publisher/node_modules/tldts-core/README.md | 3 + .../node_modules/tldts-core/dist/cjs/index.js | 561 + .../tldts-core/dist/cjs/index.js.map | 1 + .../dist/cjs/src/domain-without-suffix.js | 15 + .../dist/cjs/src/domain-without-suffix.js.map | 1 + .../tldts-core/dist/cjs/src/domain.js | 83 + .../tldts-core/dist/cjs/src/domain.js.map | 1 + .../dist/cjs/src/extract-hostname.js | 149 + .../dist/cjs/src/extract-hostname.js.map | 1 + .../tldts-core/dist/cjs/src/factory.js | 104 + .../tldts-core/dist/cjs/src/factory.js.map | 1 + .../tldts-core/dist/cjs/src/is-ip.js | 72 + .../tldts-core/dist/cjs/src/is-ip.js.map | 1 + .../tldts-core/dist/cjs/src/is-valid.js | 69 + .../tldts-core/dist/cjs/src/is-valid.js.map | 1 + .../dist/cjs/src/lookup/fast-path.js | 69 + .../dist/cjs/src/lookup/fast-path.js.map | 1 + .../dist/cjs/src/lookup/interface.js | 3 + .../dist/cjs/src/lookup/interface.js.map | 1 + .../tldts-core/dist/cjs/src/options.js | 22 + .../tldts-core/dist/cjs/src/options.js.map | 1 + .../tldts-core/dist/cjs/src/subdomain.js | 14 + .../tldts-core/dist/cjs/src/subdomain.js.map | 1 + .../tldts-core/dist/cjs/tsconfig.tsbuildinfo | 1 + .../node_modules/tldts-core/dist/es6/index.js | 4 + .../tldts-core/dist/es6/index.js.map | 1 + .../dist/es6/src/domain-without-suffix.js | 12 + .../dist/es6/src/domain-without-suffix.js.map | 1 + .../tldts-core/dist/es6/src/domain.js | 80 + .../tldts-core/dist/es6/src/domain.js.map | 1 + .../dist/es6/src/extract-hostname.js | 146 + .../dist/es6/src/extract-hostname.js.map | 1 + .../tldts-core/dist/es6/src/factory.js | 99 + .../tldts-core/dist/es6/src/factory.js.map | 1 + .../tldts-core/dist/es6/src/is-ip.js | 69 + .../tldts-core/dist/es6/src/is-ip.js.map | 1 + .../tldts-core/dist/es6/src/is-valid.js | 66 + .../tldts-core/dist/es6/src/is-valid.js.map | 1 + .../dist/es6/src/lookup/fast-path.js | 66 + .../dist/es6/src/lookup/fast-path.js.map | 1 + .../dist/es6/src/lookup/interface.js | 2 + .../dist/es6/src/lookup/interface.js.map | 1 + .../tldts-core/dist/es6/src/options.js | 19 + .../tldts-core/dist/es6/src/options.js.map | 1 + .../tldts-core/dist/es6/src/subdomain.js | 11 + .../tldts-core/dist/es6/src/subdomain.js.map | 1 + .../dist/es6/tsconfig.bundle.tsbuildinfo | 1 + .../tldts-core/dist/types/index.d.ts | 4 + .../dist/types/src/domain-without-suffix.d.ts | 6 + .../tldts-core/dist/types/src/domain.d.ts | 5 + .../dist/types/src/extract-hostname.d.ts | 5 + .../tldts-core/dist/types/src/factory.d.ts | 28 + .../tldts-core/dist/types/src/is-ip.d.ts | 6 + .../tldts-core/dist/types/src/is-valid.d.ts | 15 + .../dist/types/src/lookup/fast-path.d.ts | 2 + .../dist/types/src/lookup/interface.d.ts | 9 + .../tldts-core/dist/types/src/options.d.ts | 10 + .../tldts-core/dist/types/src/subdomain.d.ts | 4 + publisher/node_modules/tldts-core/index.ts | 10 + .../node_modules/tldts-core/package.json | 68 + .../tldts-core/src/domain-without-suffix.ts | 14 + .../node_modules/tldts-core/src/domain.ts | 100 + .../tldts-core/src/extract-hostname.ts | 170 + .../node_modules/tldts-core/src/factory.ts | 160 + .../node_modules/tldts-core/src/is-ip.ts | 87 + .../node_modules/tldts-core/src/is-valid.ts | 79 + .../tldts-core/src/lookup/fast-path.ts | 80 + .../tldts-core/src/lookup/interface.ts | 10 + .../node_modules/tldts-core/src/options.ts | 39 + .../node_modules/tldts-core/src/subdomain.ts | 11 + publisher/node_modules/tldts/LICENSE | 13 + publisher/node_modules/tldts/README.md | 327 + publisher/node_modules/tldts/bin/cli.js | 21 + .../node_modules/tldts/dist/cjs/index.js | 666 + .../node_modules/tldts/dist/cjs/index.js.map | 1 + .../tldts/dist/cjs/src/data/trie.js | 14 + .../tldts/dist/cjs/src/data/trie.js.map | 1 + .../tldts/dist/cjs/src/suffix-trie.js | 67 + .../tldts/dist/cjs/src/suffix-trie.js.map | 1 + .../tldts/dist/cjs/tsconfig.tsbuildinfo | 1 + .../node_modules/tldts/dist/es6/index.js | 33 + .../node_modules/tldts/dist/es6/index.js.map | 1 + .../tldts/dist/es6/src/data/trie.js | 11 + .../tldts/dist/es6/src/data/trie.js.map | 1 + .../tldts/dist/es6/src/suffix-trie.js | 64 + .../tldts/dist/es6/src/suffix-trie.js.map | 1 + .../dist/es6/tsconfig.bundle.tsbuildinfo | 1 + .../node_modules/tldts/dist/index.cjs.min.js | 2 + .../tldts/dist/index.cjs.min.js.map | 1 + .../node_modules/tldts/dist/index.esm.min.js | 2 + .../tldts/dist/index.esm.min.js.map | 1 + .../node_modules/tldts/dist/index.umd.min.js | 2 + .../tldts/dist/index.umd.min.js.map | 1 + .../node_modules/tldts/dist/types/index.d.ts | 7 + .../tldts/dist/types/src/data/trie.d.ts | 5 + .../tldts/dist/types/src/suffix-trie.d.ts | 5 + publisher/node_modules/tldts/index.ts | 62 + publisher/node_modules/tldts/package.json | 91 + publisher/node_modules/tldts/src/data/trie.ts | 14 + .../node_modules/tldts/src/suffix-trie.ts | 110 + publisher/node_modules/to-regex-range/LICENSE | 21 + .../node_modules/to-regex-range/README.md | 305 + .../node_modules/to-regex-range/index.js | 288 + .../node_modules/to-regex-range/package.json | 88 + publisher/node_modules/tough-cookie/LICENSE | 12 + publisher/node_modules/tough-cookie/README.md | 144 + .../dist/cookie/canonicalDomain.d.ts | 33 + .../dist/cookie/canonicalDomain.js | 58 + .../tough-cookie/dist/cookie/constants.d.ts | 54 + .../tough-cookie/dist/cookie/constants.js | 37 + .../tough-cookie/dist/cookie/cookie.d.ts | 315 + .../tough-cookie/dist/cookie/cookie.js | 801 + .../dist/cookie/cookieCompare.d.ts | 58 + .../tough-cookie/dist/cookie/cookieCompare.js | 84 + .../tough-cookie/dist/cookie/cookieJar.d.ts | 621 + .../tough-cookie/dist/cookie/cookieJar.js | 1000 + .../tough-cookie/dist/cookie/defaultPath.d.ts | 40 + .../tough-cookie/dist/cookie/defaultPath.js | 60 + .../tough-cookie/dist/cookie/domainMatch.d.ts | 38 + .../tough-cookie/dist/cookie/domainMatch.js | 94 + .../tough-cookie/dist/cookie/formatDate.d.ts | 15 + .../tough-cookie/dist/cookie/formatDate.js | 20 + .../tough-cookie/dist/cookie/index.d.ts | 29 + .../tough-cookie/dist/cookie/index.js | 54 + .../tough-cookie/dist/cookie/parseDate.d.ts | 103 + .../tough-cookie/dist/cookie/parseDate.js | 323 + .../tough-cookie/dist/cookie/permutePath.d.ts | 14 + .../tough-cookie/dist/cookie/permutePath.js | 32 + .../tough-cookie/dist/getPublicSuffix.d.ts | 55 + .../tough-cookie/dist/getPublicSuffix.js | 71 + .../tough-cookie/dist/memstore.d.ts | 220 + .../tough-cookie/dist/memstore.js | 187 + .../tough-cookie/dist/pathMatch.d.ts | 17 + .../tough-cookie/dist/pathMatch.js | 41 + .../tough-cookie/dist/permuteDomain.d.ts | 15 + .../tough-cookie/dist/permuteDomain.js | 44 + .../node_modules/tough-cookie/dist/store.d.ts | 211 + .../node_modules/tough-cookie/dist/store.js | 76 + .../node_modules/tough-cookie/dist/utils.d.ts | 34 + .../node_modules/tough-cookie/dist/utils.js | 98 + .../tough-cookie/dist/validators.d.ts | 24 + .../tough-cookie/dist/validators.js | 90 + .../tough-cookie/dist/version.d.ts | 5 + .../node_modules/tough-cookie/dist/version.js | 8 + .../node_modules/tough-cookie/package.json | 138 + publisher/node_modules/tunnel-agent/LICENSE | 55 + publisher/node_modules/tunnel-agent/README.md | 4 + publisher/node_modules/tunnel-agent/index.js | 244 + .../node_modules/tunnel-agent/package.json | 22 + publisher/node_modules/tweetnacl/.npmignore | 4 + publisher/node_modules/tweetnacl/AUTHORS.md | 28 + publisher/node_modules/tweetnacl/CHANGELOG.md | 221 + publisher/node_modules/tweetnacl/LICENSE | 24 + .../tweetnacl/PULL_REQUEST_TEMPLATE.md | 20 + publisher/node_modules/tweetnacl/README.md | 459 + publisher/node_modules/tweetnacl/nacl-fast.js | 2388 +++ .../node_modules/tweetnacl/nacl-fast.min.js | 2 + publisher/node_modules/tweetnacl/nacl.d.ts | 98 + publisher/node_modules/tweetnacl/nacl.js | 1175 ++ publisher/node_modules/tweetnacl/nacl.min.js | 1 + publisher/node_modules/tweetnacl/package.json | 58 + publisher/node_modules/universalify/LICENSE | 20 + publisher/node_modules/universalify/README.md | 76 + publisher/node_modules/universalify/index.js | 24 + .../node_modules/universalify/package.json | 34 + .../node_modules/unzipper/.gitattributes | 1 + publisher/node_modules/unzipper/LICENSE | 25 + publisher/node_modules/unzipper/README.md | 397 + .../node_modules/unzipper/eslint.config.mjs | 29 + .../node_modules/unzipper/lib/BufferStream.js | 19 + .../node_modules/unzipper/lib/Decrypt.js | 94 + .../node_modules/unzipper/lib/NoopStream.js | 14 + .../unzipper/lib/Open/directory.js | 243 + .../node_modules/unzipper/lib/Open/index.js | 141 + .../node_modules/unzipper/lib/Open/unzip.js | 120 + .../node_modules/unzipper/lib/PullStream.js | 139 + .../node_modules/unzipper/lib/extract.js | 62 + publisher/node_modules/unzipper/lib/parse.js | 288 + .../node_modules/unzipper/lib/parseBuffer.js | 55 + .../unzipper/lib/parseDateTime.js | 13 + .../unzipper/lib/parseExtraField.js | 40 + .../node_modules/unzipper/lib/parseOne.js | 54 + .../unzipper/node_modules/fs-extra/LICENSE | 15 + .../unzipper/node_modules/fs-extra/README.md | 292 + .../fs-extra/lib/copy/copy-sync.js | 161 + .../node_modules/fs-extra/lib/copy/copy.js | 177 + .../node_modules/fs-extra/lib/copy/index.js | 7 + .../node_modules/fs-extra/lib/empty/index.js | 39 + .../node_modules/fs-extra/lib/ensure/file.js | 66 + .../node_modules/fs-extra/lib/ensure/index.js | 23 + .../node_modules/fs-extra/lib/ensure/link.js | 64 + .../fs-extra/lib/ensure/symlink-paths.js | 101 + .../fs-extra/lib/ensure/symlink-type.js | 34 + .../fs-extra/lib/ensure/symlink.js | 67 + .../node_modules/fs-extra/lib/esm.mjs | 68 + .../node_modules/fs-extra/lib/fs/index.js | 140 + .../node_modules/fs-extra/lib/index.js | 16 + .../node_modules/fs-extra/lib/json/index.js | 16 + .../fs-extra/lib/json/jsonfile.js | 11 + .../fs-extra/lib/json/output-json-sync.js | 12 + .../fs-extra/lib/json/output-json.js | 12 + .../node_modules/fs-extra/lib/mkdirs/index.js | 14 + .../fs-extra/lib/mkdirs/make-dir.js | 27 + .../node_modules/fs-extra/lib/mkdirs/utils.js | 21 + .../node_modules/fs-extra/lib/move/index.js | 7 + .../fs-extra/lib/move/move-sync.js | 55 + .../node_modules/fs-extra/lib/move/move.js | 59 + .../fs-extra/lib/output-file/index.js | 31 + .../fs-extra/lib/path-exists/index.js | 12 + .../node_modules/fs-extra/lib/remove/index.js | 17 + .../node_modules/fs-extra/lib/util/stat.js | 158 + .../node_modules/fs-extra/lib/util/utimes.js | 36 + .../node_modules/fs-extra/package.json | 71 + publisher/node_modules/unzipper/package.json | 62 + publisher/node_modules/unzipper/unzip.js | 5 + publisher/node_modules/url-join/.travis.yml | 5 + publisher/node_modules/url-join/CHANGELOG.md | 88 + publisher/node_modules/url-join/LICENSE | 21 + publisher/node_modules/url-join/README.md | 47 + publisher/node_modules/url-join/bin/changelog | 28 + .../node_modules/url-join/lib/url-join.js | 78 + publisher/node_modules/url-join/package.json | 24 + publisher/node_modules/url-join/test/tests.js | 151 + .../node_modules/util-deprecate/History.md | 16 + publisher/node_modules/util-deprecate/LICENSE | 24 + .../node_modules/util-deprecate/README.md | 53 + .../node_modules/util-deprecate/browser.js | 67 + publisher/node_modules/util-deprecate/node.js | 6 + .../node_modules/util-deprecate/package.json | 27 + publisher/node_modules/uuid/CHANGELOG.md | 229 + publisher/node_modules/uuid/CONTRIBUTING.md | 18 + publisher/node_modules/uuid/LICENSE.md | 9 + publisher/node_modules/uuid/README.md | 505 + publisher/node_modules/uuid/dist/bin/uuid | 2 + .../uuid/dist/esm-browser/index.js | 9 + .../node_modules/uuid/dist/esm-browser/md5.js | 215 + .../node_modules/uuid/dist/esm-browser/nil.js | 1 + .../uuid/dist/esm-browser/parse.js | 35 + .../uuid/dist/esm-browser/regex.js | 1 + .../node_modules/uuid/dist/esm-browser/rng.js | 19 + .../uuid/dist/esm-browser/sha1.js | 96 + .../uuid/dist/esm-browser/stringify.js | 30 + .../node_modules/uuid/dist/esm-browser/v1.js | 95 + .../node_modules/uuid/dist/esm-browser/v3.js | 4 + .../node_modules/uuid/dist/esm-browser/v35.js | 64 + .../node_modules/uuid/dist/esm-browser/v4.js | 24 + .../node_modules/uuid/dist/esm-browser/v5.js | 4 + .../uuid/dist/esm-browser/validate.js | 7 + .../uuid/dist/esm-browser/version.js | 11 + .../node_modules/uuid/dist/esm-node/index.js | 9 + .../node_modules/uuid/dist/esm-node/md5.js | 13 + .../node_modules/uuid/dist/esm-node/nil.js | 1 + .../node_modules/uuid/dist/esm-node/parse.js | 35 + .../node_modules/uuid/dist/esm-node/regex.js | 1 + .../node_modules/uuid/dist/esm-node/rng.js | 12 + .../node_modules/uuid/dist/esm-node/sha1.js | 13 + .../uuid/dist/esm-node/stringify.js | 29 + .../node_modules/uuid/dist/esm-node/v1.js | 95 + .../node_modules/uuid/dist/esm-node/v3.js | 4 + .../node_modules/uuid/dist/esm-node/v35.js | 64 + .../node_modules/uuid/dist/esm-node/v4.js | 24 + .../node_modules/uuid/dist/esm-node/v5.js | 4 + .../uuid/dist/esm-node/validate.js | 7 + .../uuid/dist/esm-node/version.js | 11 + publisher/node_modules/uuid/dist/index.js | 79 + .../node_modules/uuid/dist/md5-browser.js | 223 + publisher/node_modules/uuid/dist/md5.js | 23 + publisher/node_modules/uuid/dist/nil.js | 8 + publisher/node_modules/uuid/dist/parse.js | 45 + publisher/node_modules/uuid/dist/regex.js | 8 + .../node_modules/uuid/dist/rng-browser.js | 26 + publisher/node_modules/uuid/dist/rng.js | 24 + .../node_modules/uuid/dist/sha1-browser.js | 104 + publisher/node_modules/uuid/dist/sha1.js | 23 + publisher/node_modules/uuid/dist/stringify.js | 39 + .../node_modules/uuid/dist/umd/uuid.min.js | 1 + .../node_modules/uuid/dist/umd/uuidNIL.min.js | 1 + .../uuid/dist/umd/uuidParse.min.js | 1 + .../uuid/dist/umd/uuidStringify.min.js | 1 + .../uuid/dist/umd/uuidValidate.min.js | 1 + .../uuid/dist/umd/uuidVersion.min.js | 1 + .../node_modules/uuid/dist/umd/uuidv1.min.js | 1 + .../node_modules/uuid/dist/umd/uuidv3.min.js | 1 + .../node_modules/uuid/dist/umd/uuidv4.min.js | 1 + .../node_modules/uuid/dist/umd/uuidv5.min.js | 1 + publisher/node_modules/uuid/dist/uuid-bin.js | 85 + publisher/node_modules/uuid/dist/v1.js | 107 + publisher/node_modules/uuid/dist/v3.js | 16 + publisher/node_modules/uuid/dist/v35.js | 78 + publisher/node_modules/uuid/dist/v4.js | 37 + publisher/node_modules/uuid/dist/v5.js | 16 + publisher/node_modules/uuid/dist/validate.js | 17 + publisher/node_modules/uuid/dist/version.js | 21 + publisher/node_modules/uuid/package.json | 135 + publisher/node_modules/uuid/wrapper.mjs | 10 + publisher/node_modules/verror/.npmignore | 9 + publisher/node_modules/verror/CHANGES.md | 28 + publisher/node_modules/verror/CONTRIBUTING.md | 19 + publisher/node_modules/verror/LICENSE | 19 + publisher/node_modules/verror/README.md | 528 + publisher/node_modules/verror/lib/verror.js | 451 + publisher/node_modules/verror/package.json | 22 + publisher/node_modules/which/CHANGELOG.md | 166 + publisher/node_modules/which/LICENSE | 15 + publisher/node_modules/which/README.md | 54 + publisher/node_modules/which/bin/node-which | 52 + publisher/node_modules/which/package.json | 43 + publisher/node_modules/which/which.js | 125 + publisher/node_modules/wide-align/LICENSE | 14 + publisher/node_modules/wide-align/README.md | 47 + publisher/node_modules/wide-align/align.js | 65 + .../node_modules/wide-align/package.json | 33 + publisher/node_modules/yallist/LICENSE | 15 + publisher/node_modules/yallist/README.md | 204 + publisher/node_modules/yallist/iterator.js | 8 + publisher/node_modules/yallist/package.json | 29 + publisher/node_modules/yallist/yallist.js | 426 + publisher/node_modules/zeromq/.mocharc.js | 16 + publisher/node_modules/zeromq/CMakeLists.txt | 154 + publisher/node_modules/zeromq/LICENSE.txt | 21 + .../node_modules/zeromq/LICENSE_MPL-2.0.txt | 7 + publisher/node_modules/zeromq/README.md | 516 + .../build/darwin/arm64/node/115/addon.node | Bin 0 -> 975816 bytes .../build/darwin/x64/node/115/addon.node | Bin 0 -> 974704 bytes .../build/darwin/x64/node/64/addon.node | Bin 0 -> 974760 bytes .../build/linux/x64/node/108/addon.node | Bin 0 -> 1545960 bytes .../build/linux/x64/node/115/addon.node | Bin 0 -> 1508648 bytes .../zeromq/build/linux/x64/node/64/addon.node | Bin 0 -> 1508784 bytes .../build/win32/ia32/node/115/addon.node | Bin 0 -> 712704 bytes .../build/win32/ia32/node/72/addon.node | Bin 0 -> 712704 bytes .../build/win32/x64/node/115/addon.node | Bin 0 -> 858112 bytes .../zeromq/build/win32/x64/node/64/addon.node | Bin 0 -> 858624 bytes publisher/node_modules/zeromq/draft.d.ts | 1 + publisher/node_modules/zeromq/draft.js | 12 + publisher/node_modules/zeromq/lib/compat.d.ts | 89 + publisher/node_modules/zeromq/lib/compat.js | 756 + .../node_modules/zeromq/lib/compat.js.map | 1 + .../zeromq/lib/compat/capabilities.d.ts | 4 + .../zeromq/lib/compat/capabilities.js | 8 + .../zeromq/lib/compat/capabilities.js.map | 1 + .../zeromq/lib/compat/long-options.d.ts | 51 + .../zeromq/lib/compat/long-options.js | 56 + .../zeromq/lib/compat/long-options.js.map | 1 + .../zeromq/lib/compat/poll-states.d.ts | 3 + .../zeromq/lib/compat/poll-states.js | 7 + .../zeromq/lib/compat/poll-states.js.map | 1 + .../zeromq/lib/compat/send-options.d.ts | 1 + .../zeromq/lib/compat/send-options.js | 5 + .../zeromq/lib/compat/send-options.js.map | 1 + .../zeromq/lib/compat/socket-states.d.ts | 3 + .../zeromq/lib/compat/socket-states.js | 7 + .../zeromq/lib/compat/socket-states.js.map | 1 + .../node_modules/zeromq/lib/compat/types.d.ts | 14 + .../node_modules/zeromq/lib/compat/types.js | 18 + .../zeromq/lib/compat/types.js.map | 1 + publisher/node_modules/zeromq/lib/draft.d.ts | 53 + publisher/node_modules/zeromq/lib/draft.js | 69 + .../node_modules/zeromq/lib/draft.js.map | 1 + publisher/node_modules/zeromq/lib/errors.d.ts | 6 + publisher/node_modules/zeromq/lib/errors.js | 8 + .../node_modules/zeromq/lib/errors.js.map | 1 + publisher/node_modules/zeromq/lib/index.d.ts | 1269 ++ publisher/node_modules/zeromq/lib/index.js | 628 + .../node_modules/zeromq/lib/index.js.map | 1 + .../node_modules/zeromq/lib/load-addon.d.ts | 2 + .../node_modules/zeromq/lib/load-addon.js | 52 + .../node_modules/zeromq/lib/load-addon.js.map | 1 + publisher/node_modules/zeromq/lib/native.d.ts | 546 + publisher/node_modules/zeromq/lib/native.js | 10 + .../node_modules/zeromq/lib/native.js.map | 1 + .../node_modules/zeromq/lib/ts3.7/compat.d.ts | 89 + .../zeromq/lib/ts3.7/compat/capabilities.d.ts | 4 + .../zeromq/lib/ts3.7/compat/long-options.d.ts | 51 + .../zeromq/lib/ts3.7/compat/poll-states.d.ts | 3 + .../zeromq/lib/ts3.7/compat/send-options.d.ts | 1 + .../lib/ts3.7/compat/socket-states.d.ts | 3 + .../zeromq/lib/ts3.7/compat/types.d.ts | 14 + .../node_modules/zeromq/lib/ts3.7/draft.d.ts | 72 + .../node_modules/zeromq/lib/ts3.7/errors.d.ts | 6 + .../node_modules/zeromq/lib/ts3.7/index.d.ts | 1277 ++ .../zeromq/lib/ts3.7/load-addon.d.ts | 2 + .../node_modules/zeromq/lib/ts3.7/native.d.ts | 545 + .../node_modules/zeromq/lib/ts3.7/util.d.ts | 9 + .../zeromq/lib/tsconfig.tsbuildinfo | 1 + publisher/node_modules/zeromq/lib/util.d.ts | 9 + publisher/node_modules/zeromq/lib/util.js | 19 + publisher/node_modules/zeromq/lib/util.js.map | 1 + publisher/node_modules/zeromq/package.json | 215 + .../node_modules/zeromq/script/install.js | 34 + .../zeromq/script/macos-arm-deps.sh | 46 + .../zeromq/script/smoke-test.bash | 39 + .../zeromq/script/tsconfig.esm.tsbuildinfo | 1 + .../zeromq/script/tsconfig.tsbuildinfo | 1 + publisher/node_modules/zeromq/src/.eslintrc | 3 + publisher/node_modules/zeromq/src/closable.h | 16 + publisher/node_modules/zeromq/src/compat.ts | 834 + .../zeromq/src/compat/capabilities.ts | 4 + .../zeromq/src/compat/long-options.ts | 51 + .../zeromq/src/compat/poll-states.ts | 3 + .../zeromq/src/compat/send-options.ts | 1 + .../zeromq/src/compat/socket-states.ts | 3 + .../node_modules/zeromq/src/compat/types.ts | 14 + publisher/node_modules/zeromq/src/context.cc | 181 + publisher/node_modules/zeromq/src/context.h | 42 + publisher/node_modules/zeromq/src/draft.ts | 109 + publisher/node_modules/zeromq/src/errors.ts | 9 + .../node_modules/zeromq/src/incoming_msg.cc | 72 + .../node_modules/zeromq/src/incoming_msg.h | 47 + publisher/node_modules/zeromq/src/index.ts | 1867 ++ publisher/node_modules/zeromq/src/inline.h | 7 + .../node_modules/zeromq/src/load-addon.ts | 61 + publisher/node_modules/zeromq/src/module.cc | 129 + publisher/node_modules/zeromq/src/module.h | 109 + publisher/node_modules/zeromq/src/native.ts | 644 + publisher/node_modules/zeromq/src/observer.cc | 383 + publisher/node_modules/zeromq/src/observer.h | 77 + .../node_modules/zeromq/src/outgoing_msg.cc | 163 + .../node_modules/zeromq/src/outgoing_msg.h | 80 + publisher/node_modules/zeromq/src/poller.h | 176 + publisher/node_modules/zeromq/src/proxy.cc | 226 + publisher/node_modules/zeromq/src/proxy.h | 54 + publisher/node_modules/zeromq/src/socket.cc | 990 + publisher/node_modules/zeromq/src/socket.h | 129 + .../node_modules/zeromq/src/tsconfig.json | 7 + publisher/node_modules/zeromq/src/util.ts | 17 + .../node_modules/zeromq/src/util/arguments.h | 105 + .../zeromq/src/util/async_scope.h | 14 + .../zeromq/src/util/electron_helper.h | 48 + .../node_modules/zeromq/src/util/error.h | 506 + .../node_modules/zeromq/src/util/object.h | 20 + .../node_modules/zeromq/src/util/reaper.h | 68 + publisher/node_modules/zeromq/src/util/take.h | 13 + .../node_modules/zeromq/src/util/trash.h | 60 + .../node_modules/zeromq/src/util/uvdelayed.h | 53 + .../node_modules/zeromq/src/util/uvhandle.h | 50 + .../node_modules/zeromq/src/util/uvloop.h | 15 + .../node_modules/zeromq/src/util/uvwork.h | 49 + .../zeromq/src/win_delay_load_hook.cc | 79 + publisher/node_modules/zeromq/src/zmq_inc.h | 30 + publisher/node_modules/zeromq/tsconfig.json | 29 + publisher/node_modules/zeromq/v5-compat.d.ts | 1 + publisher/node_modules/zeromq/v5-compat.js | 1 + publisher/node_modules/zeromq/vcpkg.json | 59 + publisher/package-lock.json | 1400 ++ publisher/package.json | 5 + publisher/publisher.js | 41 + src/{config2.rs => appconfig.rs} | 62 +- src/clickhouse.rs | 43 - src/main.rs | 102 +- src/metrics/bandwidth.rs | 2 +- src/metrics/connections.rs | 2 +- src/metrics/cpuusage.rs | 2 +- src/metrics/loadavg.rs | 2 +- src/metrics/memory.rs | 2 +- src/metrics/metrics.rs | 2 +- src/web.rs | 271 - src/webhook.rs | 104 - src/xray_op/client.rs | 2 +- src/xray_op/mod.rs | 1 + src/xray_op/users.rs | 96 + src/xray_op/vmess.rs | 9 +- src/zmq.rs | 147 + users.json | 154 + 2796 files changed, 227445 insertions(+), 1113 deletions(-) create mode 120000 publisher/node_modules/.bin/cmake-ts create mode 120000 publisher/node_modules/.bin/color-support create mode 120000 publisher/node_modules/.bin/mkdirp create mode 120000 publisher/node_modules/.bin/node-which create mode 120000 publisher/node_modules/.bin/resolve create mode 120000 publisher/node_modules/.bin/semver create mode 120000 publisher/node_modules/.bin/sshpk-conv create mode 120000 publisher/node_modules/.bin/sshpk-sign create mode 120000 publisher/node_modules/.bin/sshpk-verify create mode 120000 publisher/node_modules/.bin/tldts create mode 120000 publisher/node_modules/.bin/uuid create mode 100644 publisher/node_modules/.package-lock.json create mode 100644 publisher/node_modules/@aminya/cmake-ts/README.md create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/argumentBuilder.d.ts create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/argumentBuilder.d.ts.map create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/argumentBuilder.js create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/argumentBuilder.js.map create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/buildMode.d.ts create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/buildMode.d.ts.map create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/buildMode.js create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/buildMode.js.map create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/download.d.ts create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/download.d.ts.map create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/download.js create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/download.js.map create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/lib.d.ts create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/lib.d.ts.map create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/lib.js create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/lib.js.map create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/main.d.ts create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/main.d.ts.map create mode 100755 publisher/node_modules/@aminya/cmake-ts/build/main.js create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/main.js.map create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/index.d.ts create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/index.d.ts.map create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/index.js create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/index.js.map create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/resolve.d.ts create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/resolve.d.ts.map create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/resolve.js create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/resolve.js.map create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/search.d.ts create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/search.d.ts.map create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/search.js create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/search.js.map create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/override.d.ts create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/override.d.ts.map create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/override.js create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/override.js.map create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/runtimeDistribution.d.ts create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/runtimeDistribution.d.ts.map create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/runtimeDistribution.js create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/runtimeDistribution.js.map create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/urlRegistry.d.ts create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/urlRegistry.d.ts.map create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/urlRegistry.js create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/urlRegistry.js.map create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/util.d.ts create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/util.d.ts.map create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/util.js create mode 100644 publisher/node_modules/@aminya/cmake-ts/build/util.js.map create mode 100644 publisher/node_modules/@aminya/cmake-ts/package.json create mode 100644 publisher/node_modules/@cypress/request/LICENSE create mode 100644 publisher/node_modules/@cypress/request/README.md create mode 100755 publisher/node_modules/@cypress/request/index.js create mode 100644 publisher/node_modules/@cypress/request/lib/auth.js create mode 100644 publisher/node_modules/@cypress/request/lib/cookies.js create mode 100644 publisher/node_modules/@cypress/request/lib/getProxyFromURI.js create mode 100644 publisher/node_modules/@cypress/request/lib/har.js create mode 100644 publisher/node_modules/@cypress/request/lib/hawk.js create mode 100644 publisher/node_modules/@cypress/request/lib/helpers.js create mode 100644 publisher/node_modules/@cypress/request/lib/multipart.js create mode 100644 publisher/node_modules/@cypress/request/lib/querystring.js create mode 100644 publisher/node_modules/@cypress/request/lib/redirect.js create mode 100644 publisher/node_modules/@cypress/request/lib/tunnel.js create mode 100644 publisher/node_modules/@cypress/request/package.json create mode 100644 publisher/node_modules/@cypress/request/request.js create mode 100644 publisher/node_modules/@nodelib/fs.scandir/LICENSE create mode 100644 publisher/node_modules/@nodelib/fs.scandir/README.md create mode 100644 publisher/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts create mode 100644 publisher/node_modules/@nodelib/fs.scandir/out/adapters/fs.js create mode 100644 publisher/node_modules/@nodelib/fs.scandir/out/constants.d.ts create mode 100644 publisher/node_modules/@nodelib/fs.scandir/out/constants.js create mode 100644 publisher/node_modules/@nodelib/fs.scandir/out/index.d.ts create mode 100644 publisher/node_modules/@nodelib/fs.scandir/out/index.js create mode 100644 publisher/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts create mode 100644 publisher/node_modules/@nodelib/fs.scandir/out/providers/async.js create mode 100644 publisher/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts create mode 100644 publisher/node_modules/@nodelib/fs.scandir/out/providers/common.js create mode 100644 publisher/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts create mode 100644 publisher/node_modules/@nodelib/fs.scandir/out/providers/sync.js create mode 100644 publisher/node_modules/@nodelib/fs.scandir/out/settings.d.ts create mode 100644 publisher/node_modules/@nodelib/fs.scandir/out/settings.js create mode 100644 publisher/node_modules/@nodelib/fs.scandir/out/types/index.d.ts create mode 100644 publisher/node_modules/@nodelib/fs.scandir/out/types/index.js create mode 100644 publisher/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts create mode 100644 publisher/node_modules/@nodelib/fs.scandir/out/utils/fs.js create mode 100644 publisher/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts create mode 100644 publisher/node_modules/@nodelib/fs.scandir/out/utils/index.js create mode 100644 publisher/node_modules/@nodelib/fs.scandir/package.json create mode 100644 publisher/node_modules/@nodelib/fs.stat/LICENSE create mode 100644 publisher/node_modules/@nodelib/fs.stat/README.md create mode 100644 publisher/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts create mode 100644 publisher/node_modules/@nodelib/fs.stat/out/adapters/fs.js create mode 100644 publisher/node_modules/@nodelib/fs.stat/out/index.d.ts create mode 100644 publisher/node_modules/@nodelib/fs.stat/out/index.js create mode 100644 publisher/node_modules/@nodelib/fs.stat/out/providers/async.d.ts create mode 100644 publisher/node_modules/@nodelib/fs.stat/out/providers/async.js create mode 100644 publisher/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts create mode 100644 publisher/node_modules/@nodelib/fs.stat/out/providers/sync.js create mode 100644 publisher/node_modules/@nodelib/fs.stat/out/settings.d.ts create mode 100644 publisher/node_modules/@nodelib/fs.stat/out/settings.js create mode 100644 publisher/node_modules/@nodelib/fs.stat/out/types/index.d.ts create mode 100644 publisher/node_modules/@nodelib/fs.stat/out/types/index.js create mode 100644 publisher/node_modules/@nodelib/fs.stat/package.json create mode 100644 publisher/node_modules/@nodelib/fs.walk/LICENSE create mode 100644 publisher/node_modules/@nodelib/fs.walk/README.md create mode 100644 publisher/node_modules/@nodelib/fs.walk/out/index.d.ts create mode 100644 publisher/node_modules/@nodelib/fs.walk/out/index.js create mode 100644 publisher/node_modules/@nodelib/fs.walk/out/providers/async.d.ts create mode 100644 publisher/node_modules/@nodelib/fs.walk/out/providers/async.js create mode 100644 publisher/node_modules/@nodelib/fs.walk/out/providers/index.d.ts create mode 100644 publisher/node_modules/@nodelib/fs.walk/out/providers/index.js create mode 100644 publisher/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts create mode 100644 publisher/node_modules/@nodelib/fs.walk/out/providers/stream.js create mode 100644 publisher/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts create mode 100644 publisher/node_modules/@nodelib/fs.walk/out/providers/sync.js create mode 100644 publisher/node_modules/@nodelib/fs.walk/out/readers/async.d.ts create mode 100644 publisher/node_modules/@nodelib/fs.walk/out/readers/async.js create mode 100644 publisher/node_modules/@nodelib/fs.walk/out/readers/common.d.ts create mode 100644 publisher/node_modules/@nodelib/fs.walk/out/readers/common.js create mode 100644 publisher/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts create mode 100644 publisher/node_modules/@nodelib/fs.walk/out/readers/reader.js create mode 100644 publisher/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts create mode 100644 publisher/node_modules/@nodelib/fs.walk/out/readers/sync.js create mode 100644 publisher/node_modules/@nodelib/fs.walk/out/settings.d.ts create mode 100644 publisher/node_modules/@nodelib/fs.walk/out/settings.js create mode 100644 publisher/node_modules/@nodelib/fs.walk/out/types/index.d.ts create mode 100644 publisher/node_modules/@nodelib/fs.walk/out/types/index.js create mode 100644 publisher/node_modules/@nodelib/fs.walk/package.json create mode 100644 publisher/node_modules/ansi-regex/index.d.ts create mode 100644 publisher/node_modules/ansi-regex/index.js create mode 100644 publisher/node_modules/ansi-regex/license create mode 100644 publisher/node_modules/ansi-regex/package.json create mode 100644 publisher/node_modules/ansi-regex/readme.md create mode 100644 publisher/node_modules/aproba/CHANGELOG.md create mode 100644 publisher/node_modules/aproba/LICENSE create mode 100644 publisher/node_modules/aproba/README.md create mode 100644 publisher/node_modules/aproba/index.js create mode 100644 publisher/node_modules/aproba/package.json create mode 100644 publisher/node_modules/are-we-there-yet/LICENSE.md create mode 100644 publisher/node_modules/are-we-there-yet/README.md create mode 100644 publisher/node_modules/are-we-there-yet/lib/index.js create mode 100644 publisher/node_modules/are-we-there-yet/lib/tracker-base.js create mode 100644 publisher/node_modules/are-we-there-yet/lib/tracker-group.js create mode 100644 publisher/node_modules/are-we-there-yet/lib/tracker-stream.js create mode 100644 publisher/node_modules/are-we-there-yet/lib/tracker.js create mode 100644 publisher/node_modules/are-we-there-yet/package.json create mode 100644 publisher/node_modules/asn1/Jenkinsfile create mode 100644 publisher/node_modules/asn1/LICENSE create mode 100644 publisher/node_modules/asn1/README.md create mode 100644 publisher/node_modules/asn1/lib/ber/errors.js create mode 100644 publisher/node_modules/asn1/lib/ber/index.js create mode 100644 publisher/node_modules/asn1/lib/ber/reader.js create mode 100644 publisher/node_modules/asn1/lib/ber/types.js create mode 100644 publisher/node_modules/asn1/lib/ber/writer.js create mode 100644 publisher/node_modules/asn1/lib/index.js create mode 100644 publisher/node_modules/asn1/package.json create mode 100644 publisher/node_modules/assert-plus/AUTHORS create mode 100644 publisher/node_modules/assert-plus/CHANGES.md create mode 100644 publisher/node_modules/assert-plus/README.md create mode 100644 publisher/node_modules/assert-plus/assert.js create mode 100644 publisher/node_modules/assert-plus/package.json create mode 100644 publisher/node_modules/asynckit/LICENSE create mode 100644 publisher/node_modules/asynckit/README.md create mode 100644 publisher/node_modules/asynckit/bench.js create mode 100644 publisher/node_modules/asynckit/index.js create mode 100644 publisher/node_modules/asynckit/lib/abort.js create mode 100644 publisher/node_modules/asynckit/lib/async.js create mode 100644 publisher/node_modules/asynckit/lib/defer.js create mode 100644 publisher/node_modules/asynckit/lib/iterate.js create mode 100644 publisher/node_modules/asynckit/lib/readable_asynckit.js create mode 100644 publisher/node_modules/asynckit/lib/readable_parallel.js create mode 100644 publisher/node_modules/asynckit/lib/readable_serial.js create mode 100644 publisher/node_modules/asynckit/lib/readable_serial_ordered.js create mode 100644 publisher/node_modules/asynckit/lib/state.js create mode 100644 publisher/node_modules/asynckit/lib/streamify.js create mode 100644 publisher/node_modules/asynckit/lib/terminator.js create mode 100644 publisher/node_modules/asynckit/package.json create mode 100644 publisher/node_modules/asynckit/parallel.js create mode 100644 publisher/node_modules/asynckit/serial.js create mode 100644 publisher/node_modules/asynckit/serialOrdered.js create mode 100644 publisher/node_modules/asynckit/stream.js create mode 100644 publisher/node_modules/aws-sign2/LICENSE create mode 100644 publisher/node_modules/aws-sign2/README.md create mode 100644 publisher/node_modules/aws-sign2/index.js create mode 100644 publisher/node_modules/aws-sign2/package.json create mode 100644 publisher/node_modules/aws4/LICENSE create mode 100644 publisher/node_modules/aws4/README.md create mode 100644 publisher/node_modules/aws4/aws4.js create mode 100644 publisher/node_modules/aws4/lru.js create mode 100644 publisher/node_modules/aws4/package.json create mode 100644 publisher/node_modules/bcrypt-pbkdf/CONTRIBUTING.md create mode 100644 publisher/node_modules/bcrypt-pbkdf/LICENSE create mode 100644 publisher/node_modules/bcrypt-pbkdf/README.md create mode 100644 publisher/node_modules/bcrypt-pbkdf/index.js create mode 100644 publisher/node_modules/bcrypt-pbkdf/package.json create mode 100644 publisher/node_modules/bluebird/LICENSE create mode 100644 publisher/node_modules/bluebird/README.md create mode 100644 publisher/node_modules/bluebird/changelog.md create mode 100644 publisher/node_modules/bluebird/js/browser/bluebird.core.js create mode 100644 publisher/node_modules/bluebird/js/browser/bluebird.core.min.js create mode 100644 publisher/node_modules/bluebird/js/browser/bluebird.js create mode 100644 publisher/node_modules/bluebird/js/browser/bluebird.min.js create mode 100644 publisher/node_modules/bluebird/js/release/any.js create mode 100644 publisher/node_modules/bluebird/js/release/assert.js create mode 100644 publisher/node_modules/bluebird/js/release/async.js create mode 100644 publisher/node_modules/bluebird/js/release/bind.js create mode 100644 publisher/node_modules/bluebird/js/release/bluebird.js create mode 100644 publisher/node_modules/bluebird/js/release/call_get.js create mode 100644 publisher/node_modules/bluebird/js/release/cancel.js create mode 100644 publisher/node_modules/bluebird/js/release/catch_filter.js create mode 100644 publisher/node_modules/bluebird/js/release/context.js create mode 100644 publisher/node_modules/bluebird/js/release/debuggability.js create mode 100644 publisher/node_modules/bluebird/js/release/direct_resolve.js create mode 100644 publisher/node_modules/bluebird/js/release/each.js create mode 100644 publisher/node_modules/bluebird/js/release/errors.js create mode 100644 publisher/node_modules/bluebird/js/release/es5.js create mode 100644 publisher/node_modules/bluebird/js/release/filter.js create mode 100644 publisher/node_modules/bluebird/js/release/finally.js create mode 100644 publisher/node_modules/bluebird/js/release/generators.js create mode 100644 publisher/node_modules/bluebird/js/release/join.js create mode 100644 publisher/node_modules/bluebird/js/release/map.js create mode 100644 publisher/node_modules/bluebird/js/release/method.js create mode 100644 publisher/node_modules/bluebird/js/release/nodeback.js create mode 100644 publisher/node_modules/bluebird/js/release/nodeify.js create mode 100644 publisher/node_modules/bluebird/js/release/promise.js create mode 100644 publisher/node_modules/bluebird/js/release/promise_array.js create mode 100644 publisher/node_modules/bluebird/js/release/promisify.js create mode 100644 publisher/node_modules/bluebird/js/release/props.js create mode 100644 publisher/node_modules/bluebird/js/release/queue.js create mode 100644 publisher/node_modules/bluebird/js/release/race.js create mode 100644 publisher/node_modules/bluebird/js/release/reduce.js create mode 100644 publisher/node_modules/bluebird/js/release/schedule.js create mode 100644 publisher/node_modules/bluebird/js/release/settle.js create mode 100644 publisher/node_modules/bluebird/js/release/some.js create mode 100644 publisher/node_modules/bluebird/js/release/synchronous_inspection.js create mode 100644 publisher/node_modules/bluebird/js/release/thenables.js create mode 100644 publisher/node_modules/bluebird/js/release/timers.js create mode 100644 publisher/node_modules/bluebird/js/release/using.js create mode 100644 publisher/node_modules/bluebird/js/release/util.js create mode 100644 publisher/node_modules/bluebird/package.json create mode 100644 publisher/node_modules/braces/LICENSE create mode 100644 publisher/node_modules/braces/README.md create mode 100644 publisher/node_modules/braces/index.js create mode 100644 publisher/node_modules/braces/lib/compile.js create mode 100644 publisher/node_modules/braces/lib/constants.js create mode 100644 publisher/node_modules/braces/lib/expand.js create mode 100644 publisher/node_modules/braces/lib/parse.js create mode 100644 publisher/node_modules/braces/lib/stringify.js create mode 100644 publisher/node_modules/braces/lib/utils.js create mode 100644 publisher/node_modules/braces/package.json create mode 100644 publisher/node_modules/call-bind/.eslintignore create mode 100644 publisher/node_modules/call-bind/.eslintrc create mode 100644 publisher/node_modules/call-bind/.github/FUNDING.yml create mode 100644 publisher/node_modules/call-bind/.nycrc create mode 100644 publisher/node_modules/call-bind/CHANGELOG.md create mode 100644 publisher/node_modules/call-bind/LICENSE create mode 100644 publisher/node_modules/call-bind/README.md create mode 100644 publisher/node_modules/call-bind/callBound.js create mode 100644 publisher/node_modules/call-bind/index.js create mode 100644 publisher/node_modules/call-bind/package.json create mode 100644 publisher/node_modules/call-bind/test/callBound.js create mode 100644 publisher/node_modules/call-bind/test/index.js create mode 100644 publisher/node_modules/caseless/LICENSE create mode 100644 publisher/node_modules/caseless/README.md create mode 100644 publisher/node_modules/caseless/index.js create mode 100644 publisher/node_modules/caseless/package.json create mode 100644 publisher/node_modules/caseless/test.js create mode 100644 publisher/node_modules/chownr/LICENSE create mode 100644 publisher/node_modules/chownr/README.md create mode 100644 publisher/node_modules/chownr/chownr.js create mode 100644 publisher/node_modules/chownr/package.json create mode 100644 publisher/node_modules/color-support/LICENSE create mode 100644 publisher/node_modules/color-support/README.md create mode 100755 publisher/node_modules/color-support/bin.js create mode 100644 publisher/node_modules/color-support/browser.js create mode 100644 publisher/node_modules/color-support/index.js create mode 100644 publisher/node_modules/color-support/package.json create mode 100644 publisher/node_modules/combined-stream/License create mode 100644 publisher/node_modules/combined-stream/Readme.md create mode 100644 publisher/node_modules/combined-stream/lib/combined_stream.js create mode 100644 publisher/node_modules/combined-stream/package.json create mode 100644 publisher/node_modules/combined-stream/yarn.lock create mode 100644 publisher/node_modules/console-control-strings/LICENSE create mode 100644 publisher/node_modules/console-control-strings/README.md create mode 100644 publisher/node_modules/console-control-strings/README.md~ create mode 100644 publisher/node_modules/console-control-strings/index.js create mode 100644 publisher/node_modules/console-control-strings/package.json create mode 100644 publisher/node_modules/core-util-is/LICENSE create mode 100644 publisher/node_modules/core-util-is/README.md create mode 100644 publisher/node_modules/core-util-is/float.patch create mode 100644 publisher/node_modules/core-util-is/lib/util.js create mode 100644 publisher/node_modules/core-util-is/package.json create mode 100644 publisher/node_modules/core-util-is/test.js create mode 100644 publisher/node_modules/dashdash/CHANGES.md create mode 100644 publisher/node_modules/dashdash/LICENSE.txt create mode 100644 publisher/node_modules/dashdash/README.md create mode 100644 publisher/node_modules/dashdash/etc/dashdash.bash_completion.in create mode 100644 publisher/node_modules/dashdash/lib/dashdash.js create mode 100644 publisher/node_modules/dashdash/package.json create mode 100644 publisher/node_modules/define-data-property/.eslintrc create mode 100644 publisher/node_modules/define-data-property/.github/FUNDING.yml create mode 100644 publisher/node_modules/define-data-property/.nycrc create mode 100644 publisher/node_modules/define-data-property/CHANGELOG.md create mode 100644 publisher/node_modules/define-data-property/LICENSE create mode 100644 publisher/node_modules/define-data-property/README.md create mode 100644 publisher/node_modules/define-data-property/index.d.ts create mode 100644 publisher/node_modules/define-data-property/index.js create mode 100644 publisher/node_modules/define-data-property/package.json create mode 100644 publisher/node_modules/define-data-property/test/index.js create mode 100644 publisher/node_modules/define-data-property/tsconfig.json create mode 100644 publisher/node_modules/delayed-stream/.npmignore create mode 100644 publisher/node_modules/delayed-stream/License create mode 100644 publisher/node_modules/delayed-stream/Makefile create mode 100644 publisher/node_modules/delayed-stream/Readme.md create mode 100644 publisher/node_modules/delayed-stream/lib/delayed_stream.js create mode 100644 publisher/node_modules/delayed-stream/package.json create mode 100644 publisher/node_modules/delegates/.npmignore create mode 100644 publisher/node_modules/delegates/History.md create mode 100644 publisher/node_modules/delegates/License create mode 100644 publisher/node_modules/delegates/Makefile create mode 100644 publisher/node_modules/delegates/Readme.md create mode 100644 publisher/node_modules/delegates/index.js create mode 100644 publisher/node_modules/delegates/package.json create mode 100644 publisher/node_modules/delegates/test/index.js create mode 100644 publisher/node_modules/duplexer2/LICENSE.md create mode 100644 publisher/node_modules/duplexer2/README.md create mode 100644 publisher/node_modules/duplexer2/index.js create mode 100644 publisher/node_modules/duplexer2/node_modules/readable-stream/.travis.yml create mode 100644 publisher/node_modules/duplexer2/node_modules/readable-stream/CONTRIBUTING.md create mode 100644 publisher/node_modules/duplexer2/node_modules/readable-stream/GOVERNANCE.md create mode 100644 publisher/node_modules/duplexer2/node_modules/readable-stream/LICENSE create mode 100644 publisher/node_modules/duplexer2/node_modules/readable-stream/README.md create mode 100644 publisher/node_modules/duplexer2/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md create mode 100644 publisher/node_modules/duplexer2/node_modules/readable-stream/duplex-browser.js create mode 100644 publisher/node_modules/duplexer2/node_modules/readable-stream/duplex.js create mode 100644 publisher/node_modules/duplexer2/node_modules/readable-stream/lib/_stream_duplex.js create mode 100644 publisher/node_modules/duplexer2/node_modules/readable-stream/lib/_stream_passthrough.js create mode 100644 publisher/node_modules/duplexer2/node_modules/readable-stream/lib/_stream_readable.js create mode 100644 publisher/node_modules/duplexer2/node_modules/readable-stream/lib/_stream_transform.js create mode 100644 publisher/node_modules/duplexer2/node_modules/readable-stream/lib/_stream_writable.js create mode 100644 publisher/node_modules/duplexer2/node_modules/readable-stream/lib/internal/streams/BufferList.js create mode 100644 publisher/node_modules/duplexer2/node_modules/readable-stream/lib/internal/streams/destroy.js create mode 100644 publisher/node_modules/duplexer2/node_modules/readable-stream/lib/internal/streams/stream-browser.js create mode 100644 publisher/node_modules/duplexer2/node_modules/readable-stream/lib/internal/streams/stream.js create mode 100644 publisher/node_modules/duplexer2/node_modules/readable-stream/package.json create mode 100644 publisher/node_modules/duplexer2/node_modules/readable-stream/passthrough.js create mode 100644 publisher/node_modules/duplexer2/node_modules/readable-stream/readable-browser.js create mode 100644 publisher/node_modules/duplexer2/node_modules/readable-stream/readable.js create mode 100644 publisher/node_modules/duplexer2/node_modules/readable-stream/transform.js create mode 100644 publisher/node_modules/duplexer2/node_modules/readable-stream/writable-browser.js create mode 100644 publisher/node_modules/duplexer2/node_modules/readable-stream/writable.js create mode 100644 publisher/node_modules/duplexer2/node_modules/safe-buffer/LICENSE create mode 100644 publisher/node_modules/duplexer2/node_modules/safe-buffer/README.md create mode 100644 publisher/node_modules/duplexer2/node_modules/safe-buffer/index.d.ts create mode 100644 publisher/node_modules/duplexer2/node_modules/safe-buffer/index.js create mode 100644 publisher/node_modules/duplexer2/node_modules/safe-buffer/package.json create mode 100644 publisher/node_modules/duplexer2/node_modules/string_decoder/.travis.yml create mode 100644 publisher/node_modules/duplexer2/node_modules/string_decoder/LICENSE create mode 100644 publisher/node_modules/duplexer2/node_modules/string_decoder/README.md create mode 100644 publisher/node_modules/duplexer2/node_modules/string_decoder/lib/string_decoder.js create mode 100644 publisher/node_modules/duplexer2/node_modules/string_decoder/package.json create mode 100644 publisher/node_modules/duplexer2/package.json create mode 100755 publisher/node_modules/ecc-jsbn/LICENSE create mode 100755 publisher/node_modules/ecc-jsbn/README.md create mode 100755 publisher/node_modules/ecc-jsbn/index.js create mode 100755 publisher/node_modules/ecc-jsbn/lib/LICENSE-jsbn create mode 100755 publisher/node_modules/ecc-jsbn/lib/ec.js create mode 100755 publisher/node_modules/ecc-jsbn/lib/sec.js create mode 100755 publisher/node_modules/ecc-jsbn/package.json create mode 100755 publisher/node_modules/ecc-jsbn/test.js create mode 100644 publisher/node_modules/emoji-regex/LICENSE-MIT.txt create mode 100644 publisher/node_modules/emoji-regex/README.md create mode 100644 publisher/node_modules/emoji-regex/es2015/index.js create mode 100644 publisher/node_modules/emoji-regex/es2015/text.js create mode 100644 publisher/node_modules/emoji-regex/index.d.ts create mode 100644 publisher/node_modules/emoji-regex/index.js create mode 100644 publisher/node_modules/emoji-regex/package.json create mode 100644 publisher/node_modules/emoji-regex/text.js create mode 100644 publisher/node_modules/es-define-property/.eslintrc create mode 100644 publisher/node_modules/es-define-property/.github/FUNDING.yml create mode 100644 publisher/node_modules/es-define-property/.nycrc create mode 100644 publisher/node_modules/es-define-property/CHANGELOG.md create mode 100644 publisher/node_modules/es-define-property/LICENSE create mode 100644 publisher/node_modules/es-define-property/README.md create mode 100644 publisher/node_modules/es-define-property/index.d.ts create mode 100644 publisher/node_modules/es-define-property/index.js create mode 100644 publisher/node_modules/es-define-property/package.json create mode 100644 publisher/node_modules/es-define-property/test/index.js create mode 100644 publisher/node_modules/es-define-property/tsconfig.json create mode 100644 publisher/node_modules/es-errors/.eslintrc create mode 100644 publisher/node_modules/es-errors/.github/FUNDING.yml create mode 100644 publisher/node_modules/es-errors/CHANGELOG.md create mode 100644 publisher/node_modules/es-errors/LICENSE create mode 100644 publisher/node_modules/es-errors/README.md create mode 100644 publisher/node_modules/es-errors/eval.d.ts create mode 100644 publisher/node_modules/es-errors/eval.js create mode 100644 publisher/node_modules/es-errors/index.d.ts create mode 100644 publisher/node_modules/es-errors/index.js create mode 100644 publisher/node_modules/es-errors/package.json create mode 100644 publisher/node_modules/es-errors/range.d.ts create mode 100644 publisher/node_modules/es-errors/range.js create mode 100644 publisher/node_modules/es-errors/ref.d.ts create mode 100644 publisher/node_modules/es-errors/ref.js create mode 100644 publisher/node_modules/es-errors/syntax.d.ts create mode 100644 publisher/node_modules/es-errors/syntax.js create mode 100644 publisher/node_modules/es-errors/test/index.js create mode 100644 publisher/node_modules/es-errors/tsconfig.json create mode 100644 publisher/node_modules/es-errors/type.d.ts create mode 100644 publisher/node_modules/es-errors/type.js create mode 100644 publisher/node_modules/es-errors/uri.d.ts create mode 100644 publisher/node_modules/es-errors/uri.js create mode 100644 publisher/node_modules/extend/.editorconfig create mode 100644 publisher/node_modules/extend/.eslintrc create mode 100644 publisher/node_modules/extend/.jscs.json create mode 100644 publisher/node_modules/extend/.travis.yml create mode 100644 publisher/node_modules/extend/CHANGELOG.md create mode 100644 publisher/node_modules/extend/LICENSE create mode 100644 publisher/node_modules/extend/README.md create mode 100644 publisher/node_modules/extend/component.json create mode 100644 publisher/node_modules/extend/index.js create mode 100644 publisher/node_modules/extend/package.json create mode 100644 publisher/node_modules/extsprintf/.gitmodules create mode 100644 publisher/node_modules/extsprintf/.npmignore create mode 100644 publisher/node_modules/extsprintf/LICENSE create mode 100644 publisher/node_modules/extsprintf/Makefile create mode 100644 publisher/node_modules/extsprintf/Makefile.targ create mode 100644 publisher/node_modules/extsprintf/README.md create mode 100644 publisher/node_modules/extsprintf/jsl.node.conf create mode 100644 publisher/node_modules/extsprintf/lib/extsprintf.js create mode 100644 publisher/node_modules/extsprintf/package.json create mode 100644 publisher/node_modules/fast-glob/LICENSE create mode 100644 publisher/node_modules/fast-glob/README.md create mode 100644 publisher/node_modules/fast-glob/out/index.d.ts create mode 100644 publisher/node_modules/fast-glob/out/index.js create mode 100644 publisher/node_modules/fast-glob/out/managers/tasks.d.ts create mode 100644 publisher/node_modules/fast-glob/out/managers/tasks.js create mode 100644 publisher/node_modules/fast-glob/out/providers/async.d.ts create mode 100644 publisher/node_modules/fast-glob/out/providers/async.js create mode 100644 publisher/node_modules/fast-glob/out/providers/filters/deep.d.ts create mode 100644 publisher/node_modules/fast-glob/out/providers/filters/deep.js create mode 100644 publisher/node_modules/fast-glob/out/providers/filters/entry.d.ts create mode 100644 publisher/node_modules/fast-glob/out/providers/filters/entry.js create mode 100644 publisher/node_modules/fast-glob/out/providers/filters/error.d.ts create mode 100644 publisher/node_modules/fast-glob/out/providers/filters/error.js create mode 100644 publisher/node_modules/fast-glob/out/providers/matchers/matcher.d.ts create mode 100644 publisher/node_modules/fast-glob/out/providers/matchers/matcher.js create mode 100644 publisher/node_modules/fast-glob/out/providers/matchers/partial.d.ts create mode 100644 publisher/node_modules/fast-glob/out/providers/matchers/partial.js create mode 100644 publisher/node_modules/fast-glob/out/providers/provider.d.ts create mode 100644 publisher/node_modules/fast-glob/out/providers/provider.js create mode 100644 publisher/node_modules/fast-glob/out/providers/stream.d.ts create mode 100644 publisher/node_modules/fast-glob/out/providers/stream.js create mode 100644 publisher/node_modules/fast-glob/out/providers/sync.d.ts create mode 100644 publisher/node_modules/fast-glob/out/providers/sync.js create mode 100644 publisher/node_modules/fast-glob/out/providers/transformers/entry.d.ts create mode 100644 publisher/node_modules/fast-glob/out/providers/transformers/entry.js create mode 100644 publisher/node_modules/fast-glob/out/readers/async.d.ts create mode 100644 publisher/node_modules/fast-glob/out/readers/async.js create mode 100644 publisher/node_modules/fast-glob/out/readers/reader.d.ts create mode 100644 publisher/node_modules/fast-glob/out/readers/reader.js create mode 100644 publisher/node_modules/fast-glob/out/readers/stream.d.ts create mode 100644 publisher/node_modules/fast-glob/out/readers/stream.js create mode 100644 publisher/node_modules/fast-glob/out/readers/sync.d.ts create mode 100644 publisher/node_modules/fast-glob/out/readers/sync.js create mode 100644 publisher/node_modules/fast-glob/out/settings.d.ts create mode 100644 publisher/node_modules/fast-glob/out/settings.js create mode 100644 publisher/node_modules/fast-glob/out/types/index.d.ts create mode 100644 publisher/node_modules/fast-glob/out/types/index.js create mode 100644 publisher/node_modules/fast-glob/out/utils/array.d.ts create mode 100644 publisher/node_modules/fast-glob/out/utils/array.js create mode 100644 publisher/node_modules/fast-glob/out/utils/errno.d.ts create mode 100644 publisher/node_modules/fast-glob/out/utils/errno.js create mode 100644 publisher/node_modules/fast-glob/out/utils/fs.d.ts create mode 100644 publisher/node_modules/fast-glob/out/utils/fs.js create mode 100644 publisher/node_modules/fast-glob/out/utils/index.d.ts create mode 100644 publisher/node_modules/fast-glob/out/utils/index.js create mode 100644 publisher/node_modules/fast-glob/out/utils/path.d.ts create mode 100644 publisher/node_modules/fast-glob/out/utils/path.js create mode 100644 publisher/node_modules/fast-glob/out/utils/pattern.d.ts create mode 100644 publisher/node_modules/fast-glob/out/utils/pattern.js create mode 100644 publisher/node_modules/fast-glob/out/utils/stream.d.ts create mode 100644 publisher/node_modules/fast-glob/out/utils/stream.js create mode 100644 publisher/node_modules/fast-glob/out/utils/string.d.ts create mode 100644 publisher/node_modules/fast-glob/out/utils/string.js create mode 100644 publisher/node_modules/fast-glob/package.json create mode 100644 publisher/node_modules/fastq/.github/dependabot.yml create mode 100644 publisher/node_modules/fastq/.github/workflows/ci.yml create mode 100644 publisher/node_modules/fastq/LICENSE create mode 100644 publisher/node_modules/fastq/README.md create mode 100644 publisher/node_modules/fastq/bench.js create mode 100644 publisher/node_modules/fastq/example.js create mode 100644 publisher/node_modules/fastq/example.mjs create mode 100644 publisher/node_modules/fastq/index.d.ts create mode 100644 publisher/node_modules/fastq/package.json create mode 100644 publisher/node_modules/fastq/queue.js create mode 100644 publisher/node_modules/fastq/test/example.ts create mode 100644 publisher/node_modules/fastq/test/promise.js create mode 100644 publisher/node_modules/fastq/test/test.js create mode 100644 publisher/node_modules/fastq/test/tsconfig.json create mode 100644 publisher/node_modules/fill-range/LICENSE create mode 100644 publisher/node_modules/fill-range/README.md create mode 100644 publisher/node_modules/fill-range/index.js create mode 100644 publisher/node_modules/fill-range/package.json create mode 100644 publisher/node_modules/forever-agent/LICENSE create mode 100644 publisher/node_modules/forever-agent/README.md create mode 100644 publisher/node_modules/forever-agent/index.js create mode 100644 publisher/node_modules/forever-agent/package.json create mode 100644 publisher/node_modules/form-data/License create mode 100644 publisher/node_modules/form-data/Readme.md create mode 100644 publisher/node_modules/form-data/index.d.ts create mode 100644 publisher/node_modules/form-data/lib/browser.js create mode 100644 publisher/node_modules/form-data/lib/form_data.js create mode 100644 publisher/node_modules/form-data/lib/populate.js create mode 100644 publisher/node_modules/form-data/package.json create mode 100644 publisher/node_modules/fs-extra/LICENSE create mode 100644 publisher/node_modules/fs-extra/README.md create mode 100644 publisher/node_modules/fs-extra/lib/copy/copy-sync.js create mode 100644 publisher/node_modules/fs-extra/lib/copy/copy.js create mode 100644 publisher/node_modules/fs-extra/lib/copy/index.js create mode 100644 publisher/node_modules/fs-extra/lib/empty/index.js create mode 100644 publisher/node_modules/fs-extra/lib/ensure/file.js create mode 100644 publisher/node_modules/fs-extra/lib/ensure/index.js create mode 100644 publisher/node_modules/fs-extra/lib/ensure/link.js create mode 100644 publisher/node_modules/fs-extra/lib/ensure/symlink-paths.js create mode 100644 publisher/node_modules/fs-extra/lib/ensure/symlink-type.js create mode 100644 publisher/node_modules/fs-extra/lib/ensure/symlink.js create mode 100644 publisher/node_modules/fs-extra/lib/fs/index.js create mode 100644 publisher/node_modules/fs-extra/lib/index.js create mode 100644 publisher/node_modules/fs-extra/lib/json/index.js create mode 100644 publisher/node_modules/fs-extra/lib/json/jsonfile.js create mode 100644 publisher/node_modules/fs-extra/lib/json/output-json-sync.js create mode 100644 publisher/node_modules/fs-extra/lib/json/output-json.js create mode 100644 publisher/node_modules/fs-extra/lib/mkdirs/index.js create mode 100644 publisher/node_modules/fs-extra/lib/mkdirs/make-dir.js create mode 100644 publisher/node_modules/fs-extra/lib/mkdirs/utils.js create mode 100644 publisher/node_modules/fs-extra/lib/move/index.js create mode 100644 publisher/node_modules/fs-extra/lib/move/move-sync.js create mode 100644 publisher/node_modules/fs-extra/lib/move/move.js create mode 100644 publisher/node_modules/fs-extra/lib/output-file/index.js create mode 100644 publisher/node_modules/fs-extra/lib/path-exists/index.js create mode 100644 publisher/node_modules/fs-extra/lib/remove/index.js create mode 100644 publisher/node_modules/fs-extra/lib/remove/rimraf.js create mode 100644 publisher/node_modules/fs-extra/lib/util/stat.js create mode 100644 publisher/node_modules/fs-extra/lib/util/utimes.js create mode 100644 publisher/node_modules/fs-extra/package.json create mode 100644 publisher/node_modules/fs-minipass/LICENSE create mode 100644 publisher/node_modules/fs-minipass/README.md create mode 100644 publisher/node_modules/fs-minipass/index.js create mode 100644 publisher/node_modules/fs-minipass/package.json create mode 100644 publisher/node_modules/function-bind/.eslintrc create mode 100644 publisher/node_modules/function-bind/.github/FUNDING.yml create mode 100644 publisher/node_modules/function-bind/.github/SECURITY.md create mode 100644 publisher/node_modules/function-bind/.nycrc create mode 100644 publisher/node_modules/function-bind/CHANGELOG.md create mode 100644 publisher/node_modules/function-bind/LICENSE create mode 100644 publisher/node_modules/function-bind/README.md create mode 100644 publisher/node_modules/function-bind/implementation.js create mode 100644 publisher/node_modules/function-bind/index.js create mode 100644 publisher/node_modules/function-bind/package.json create mode 100644 publisher/node_modules/function-bind/test/.eslintrc create mode 100644 publisher/node_modules/function-bind/test/index.js create mode 100644 publisher/node_modules/gauge/LICENSE.md create mode 100644 publisher/node_modules/gauge/README.md create mode 100644 publisher/node_modules/gauge/lib/base-theme.js create mode 100644 publisher/node_modules/gauge/lib/error.js create mode 100644 publisher/node_modules/gauge/lib/has-color.js create mode 100644 publisher/node_modules/gauge/lib/index.js create mode 100644 publisher/node_modules/gauge/lib/plumbing.js create mode 100644 publisher/node_modules/gauge/lib/process.js create mode 100644 publisher/node_modules/gauge/lib/progress-bar.js create mode 100644 publisher/node_modules/gauge/lib/render-template.js create mode 100644 publisher/node_modules/gauge/lib/set-immediate.js create mode 100644 publisher/node_modules/gauge/lib/set-interval.js create mode 100644 publisher/node_modules/gauge/lib/spin.js create mode 100644 publisher/node_modules/gauge/lib/template-item.js create mode 100644 publisher/node_modules/gauge/lib/theme-set.js create mode 100644 publisher/node_modules/gauge/lib/themes.js create mode 100644 publisher/node_modules/gauge/lib/wide-truncate.js create mode 100644 publisher/node_modules/gauge/package.json create mode 100644 publisher/node_modules/get-intrinsic/.eslintrc create mode 100644 publisher/node_modules/get-intrinsic/.github/FUNDING.yml create mode 100644 publisher/node_modules/get-intrinsic/.nycrc create mode 100644 publisher/node_modules/get-intrinsic/CHANGELOG.md create mode 100644 publisher/node_modules/get-intrinsic/LICENSE create mode 100644 publisher/node_modules/get-intrinsic/README.md create mode 100644 publisher/node_modules/get-intrinsic/index.js create mode 100644 publisher/node_modules/get-intrinsic/package.json create mode 100644 publisher/node_modules/get-intrinsic/test/GetIntrinsic.js create mode 100644 publisher/node_modules/getpass/.npmignore create mode 100644 publisher/node_modules/getpass/.travis.yml create mode 100644 publisher/node_modules/getpass/LICENSE create mode 100644 publisher/node_modules/getpass/README.md create mode 100644 publisher/node_modules/getpass/lib/index.js create mode 100644 publisher/node_modules/getpass/package.json create mode 100644 publisher/node_modules/glob-parent/CHANGELOG.md create mode 100644 publisher/node_modules/glob-parent/LICENSE create mode 100644 publisher/node_modules/glob-parent/README.md create mode 100644 publisher/node_modules/glob-parent/index.js create mode 100644 publisher/node_modules/glob-parent/package.json create mode 100644 publisher/node_modules/gopd/.eslintrc create mode 100644 publisher/node_modules/gopd/.github/FUNDING.yml create mode 100644 publisher/node_modules/gopd/CHANGELOG.md create mode 100644 publisher/node_modules/gopd/LICENSE create mode 100644 publisher/node_modules/gopd/README.md create mode 100644 publisher/node_modules/gopd/index.js create mode 100644 publisher/node_modules/gopd/package.json create mode 100644 publisher/node_modules/gopd/test/index.js create mode 100644 publisher/node_modules/graceful-fs/LICENSE create mode 100644 publisher/node_modules/graceful-fs/README.md create mode 100644 publisher/node_modules/graceful-fs/clone.js create mode 100644 publisher/node_modules/graceful-fs/graceful-fs.js create mode 100644 publisher/node_modules/graceful-fs/legacy-streams.js create mode 100644 publisher/node_modules/graceful-fs/package.json create mode 100644 publisher/node_modules/graceful-fs/polyfills.js create mode 100644 publisher/node_modules/has-property-descriptors/.eslintrc create mode 100644 publisher/node_modules/has-property-descriptors/.github/FUNDING.yml create mode 100644 publisher/node_modules/has-property-descriptors/.nycrc create mode 100644 publisher/node_modules/has-property-descriptors/CHANGELOG.md create mode 100644 publisher/node_modules/has-property-descriptors/LICENSE create mode 100644 publisher/node_modules/has-property-descriptors/README.md create mode 100644 publisher/node_modules/has-property-descriptors/index.js create mode 100644 publisher/node_modules/has-property-descriptors/package.json create mode 100644 publisher/node_modules/has-property-descriptors/test/index.js create mode 100644 publisher/node_modules/has-proto/.eslintrc create mode 100644 publisher/node_modules/has-proto/.github/FUNDING.yml create mode 100644 publisher/node_modules/has-proto/CHANGELOG.md create mode 100644 publisher/node_modules/has-proto/LICENSE create mode 100644 publisher/node_modules/has-proto/README.md create mode 100644 publisher/node_modules/has-proto/index.d.ts create mode 100644 publisher/node_modules/has-proto/index.js create mode 100644 publisher/node_modules/has-proto/package.json create mode 100644 publisher/node_modules/has-proto/test/index.js create mode 100644 publisher/node_modules/has-proto/tsconfig.json create mode 100644 publisher/node_modules/has-symbols/.eslintrc create mode 100644 publisher/node_modules/has-symbols/.github/FUNDING.yml create mode 100644 publisher/node_modules/has-symbols/.nycrc create mode 100644 publisher/node_modules/has-symbols/CHANGELOG.md create mode 100644 publisher/node_modules/has-symbols/LICENSE create mode 100644 publisher/node_modules/has-symbols/README.md create mode 100644 publisher/node_modules/has-symbols/index.js create mode 100644 publisher/node_modules/has-symbols/package.json create mode 100644 publisher/node_modules/has-symbols/shams.js create mode 100644 publisher/node_modules/has-symbols/test/index.js create mode 100644 publisher/node_modules/has-symbols/test/shams/core-js.js create mode 100644 publisher/node_modules/has-symbols/test/shams/get-own-property-symbols.js create mode 100644 publisher/node_modules/has-symbols/test/tests.js create mode 100644 publisher/node_modules/has-unicode/LICENSE create mode 100644 publisher/node_modules/has-unicode/README.md create mode 100644 publisher/node_modules/has-unicode/index.js create mode 100644 publisher/node_modules/has-unicode/package.json create mode 100644 publisher/node_modules/hasown/.eslintrc create mode 100644 publisher/node_modules/hasown/.github/FUNDING.yml create mode 100644 publisher/node_modules/hasown/.nycrc create mode 100644 publisher/node_modules/hasown/CHANGELOG.md create mode 100644 publisher/node_modules/hasown/LICENSE create mode 100644 publisher/node_modules/hasown/README.md create mode 100644 publisher/node_modules/hasown/index.d.ts create mode 100644 publisher/node_modules/hasown/index.js create mode 100644 publisher/node_modules/hasown/package.json create mode 100644 publisher/node_modules/hasown/tsconfig.json create mode 100644 publisher/node_modules/http-signature/LICENSE create mode 100644 publisher/node_modules/http-signature/README.md create mode 100644 publisher/node_modules/http-signature/lib/index.js create mode 100644 publisher/node_modules/http-signature/lib/parser.js create mode 100644 publisher/node_modules/http-signature/lib/signer.js create mode 100644 publisher/node_modules/http-signature/lib/utils.js create mode 100644 publisher/node_modules/http-signature/lib/verify.js create mode 100644 publisher/node_modules/http-signature/package.json create mode 100644 publisher/node_modules/inherits/LICENSE create mode 100644 publisher/node_modules/inherits/README.md create mode 100644 publisher/node_modules/inherits/inherits.js create mode 100644 publisher/node_modules/inherits/inherits_browser.js create mode 100644 publisher/node_modules/inherits/package.json create mode 100644 publisher/node_modules/is-core-module/.eslintrc create mode 100644 publisher/node_modules/is-core-module/.nycrc create mode 100644 publisher/node_modules/is-core-module/CHANGELOG.md create mode 100644 publisher/node_modules/is-core-module/LICENSE create mode 100644 publisher/node_modules/is-core-module/README.md create mode 100644 publisher/node_modules/is-core-module/core.json create mode 100644 publisher/node_modules/is-core-module/index.js create mode 100644 publisher/node_modules/is-core-module/package.json create mode 100644 publisher/node_modules/is-core-module/test/index.js create mode 100644 publisher/node_modules/is-extglob/LICENSE create mode 100644 publisher/node_modules/is-extglob/README.md create mode 100644 publisher/node_modules/is-extglob/index.js create mode 100644 publisher/node_modules/is-extglob/package.json create mode 100644 publisher/node_modules/is-fullwidth-code-point/index.d.ts create mode 100644 publisher/node_modules/is-fullwidth-code-point/index.js create mode 100644 publisher/node_modules/is-fullwidth-code-point/license create mode 100644 publisher/node_modules/is-fullwidth-code-point/package.json create mode 100644 publisher/node_modules/is-fullwidth-code-point/readme.md create mode 100644 publisher/node_modules/is-glob/LICENSE create mode 100644 publisher/node_modules/is-glob/README.md create mode 100644 publisher/node_modules/is-glob/index.js create mode 100644 publisher/node_modules/is-glob/package.json create mode 100644 publisher/node_modules/is-number/LICENSE create mode 100644 publisher/node_modules/is-number/README.md create mode 100644 publisher/node_modules/is-number/index.js create mode 100644 publisher/node_modules/is-number/package.json create mode 100644 publisher/node_modules/is-typedarray/LICENSE.md create mode 100644 publisher/node_modules/is-typedarray/README.md create mode 100644 publisher/node_modules/is-typedarray/index.js create mode 100644 publisher/node_modules/is-typedarray/package.json create mode 100644 publisher/node_modules/is-typedarray/test.js create mode 100644 publisher/node_modules/isarray/.npmignore create mode 100644 publisher/node_modules/isarray/.travis.yml create mode 100644 publisher/node_modules/isarray/Makefile create mode 100644 publisher/node_modules/isarray/README.md create mode 100644 publisher/node_modules/isarray/component.json create mode 100644 publisher/node_modules/isarray/index.js create mode 100644 publisher/node_modules/isarray/package.json create mode 100644 publisher/node_modules/isarray/test.js create mode 100644 publisher/node_modules/isexe/.npmignore create mode 100644 publisher/node_modules/isexe/LICENSE create mode 100644 publisher/node_modules/isexe/README.md create mode 100644 publisher/node_modules/isexe/index.js create mode 100644 publisher/node_modules/isexe/mode.js create mode 100644 publisher/node_modules/isexe/package.json create mode 100644 publisher/node_modules/isexe/test/basic.js create mode 100644 publisher/node_modules/isexe/windows.js create mode 100644 publisher/node_modules/isstream/.jshintrc create mode 100644 publisher/node_modules/isstream/.npmignore create mode 100644 publisher/node_modules/isstream/.travis.yml create mode 100644 publisher/node_modules/isstream/LICENSE.md create mode 100644 publisher/node_modules/isstream/README.md create mode 100644 publisher/node_modules/isstream/isstream.js create mode 100644 publisher/node_modules/isstream/package.json create mode 100644 publisher/node_modules/isstream/test.js create mode 100644 publisher/node_modules/jsbn/.npmignore create mode 100644 publisher/node_modules/jsbn/LICENSE create mode 100644 publisher/node_modules/jsbn/README.md create mode 100644 publisher/node_modules/jsbn/example.html create mode 100644 publisher/node_modules/jsbn/example.js create mode 100644 publisher/node_modules/jsbn/index.js create mode 100644 publisher/node_modules/jsbn/package.json create mode 100644 publisher/node_modules/json-schema/LICENSE create mode 100644 publisher/node_modules/json-schema/README.md create mode 100644 publisher/node_modules/json-schema/lib/links.js create mode 100644 publisher/node_modules/json-schema/lib/validate.js create mode 100644 publisher/node_modules/json-schema/package.json create mode 100644 publisher/node_modules/json-stringify-safe/.npmignore create mode 100644 publisher/node_modules/json-stringify-safe/CHANGELOG.md create mode 100644 publisher/node_modules/json-stringify-safe/LICENSE create mode 100644 publisher/node_modules/json-stringify-safe/Makefile create mode 100644 publisher/node_modules/json-stringify-safe/README.md create mode 100644 publisher/node_modules/json-stringify-safe/package.json create mode 100644 publisher/node_modules/json-stringify-safe/stringify.js create mode 100644 publisher/node_modules/json-stringify-safe/test/mocha.opts create mode 100644 publisher/node_modules/json-stringify-safe/test/stringify_test.js create mode 100644 publisher/node_modules/jsonfile/CHANGELOG.md create mode 100644 publisher/node_modules/jsonfile/LICENSE create mode 100644 publisher/node_modules/jsonfile/README.md create mode 100644 publisher/node_modules/jsonfile/index.js create mode 100644 publisher/node_modules/jsonfile/package.json create mode 100644 publisher/node_modules/jsonfile/utils.js create mode 100644 publisher/node_modules/jsprim/CHANGES.md create mode 100644 publisher/node_modules/jsprim/CONTRIBUTING.md create mode 100644 publisher/node_modules/jsprim/LICENSE create mode 100644 publisher/node_modules/jsprim/README.md create mode 100644 publisher/node_modules/jsprim/lib/jsprim.js create mode 100644 publisher/node_modules/jsprim/package.json create mode 100644 publisher/node_modules/lodash/LICENSE create mode 100644 publisher/node_modules/lodash/README.md create mode 100644 publisher/node_modules/lodash/_DataView.js create mode 100644 publisher/node_modules/lodash/_Hash.js create mode 100644 publisher/node_modules/lodash/_LazyWrapper.js create mode 100644 publisher/node_modules/lodash/_ListCache.js create mode 100644 publisher/node_modules/lodash/_LodashWrapper.js create mode 100644 publisher/node_modules/lodash/_Map.js create mode 100644 publisher/node_modules/lodash/_MapCache.js create mode 100644 publisher/node_modules/lodash/_Promise.js create mode 100644 publisher/node_modules/lodash/_Set.js create mode 100644 publisher/node_modules/lodash/_SetCache.js create mode 100644 publisher/node_modules/lodash/_Stack.js create mode 100644 publisher/node_modules/lodash/_Symbol.js create mode 100644 publisher/node_modules/lodash/_Uint8Array.js create mode 100644 publisher/node_modules/lodash/_WeakMap.js create mode 100644 publisher/node_modules/lodash/_apply.js create mode 100644 publisher/node_modules/lodash/_arrayAggregator.js create mode 100644 publisher/node_modules/lodash/_arrayEach.js create mode 100644 publisher/node_modules/lodash/_arrayEachRight.js create mode 100644 publisher/node_modules/lodash/_arrayEvery.js create mode 100644 publisher/node_modules/lodash/_arrayFilter.js create mode 100644 publisher/node_modules/lodash/_arrayIncludes.js create mode 100644 publisher/node_modules/lodash/_arrayIncludesWith.js create mode 100644 publisher/node_modules/lodash/_arrayLikeKeys.js create mode 100644 publisher/node_modules/lodash/_arrayMap.js create mode 100644 publisher/node_modules/lodash/_arrayPush.js create mode 100644 publisher/node_modules/lodash/_arrayReduce.js create mode 100644 publisher/node_modules/lodash/_arrayReduceRight.js create mode 100644 publisher/node_modules/lodash/_arraySample.js create mode 100644 publisher/node_modules/lodash/_arraySampleSize.js create mode 100644 publisher/node_modules/lodash/_arrayShuffle.js create mode 100644 publisher/node_modules/lodash/_arraySome.js create mode 100644 publisher/node_modules/lodash/_asciiSize.js create mode 100644 publisher/node_modules/lodash/_asciiToArray.js create mode 100644 publisher/node_modules/lodash/_asciiWords.js create mode 100644 publisher/node_modules/lodash/_assignMergeValue.js create mode 100644 publisher/node_modules/lodash/_assignValue.js create mode 100644 publisher/node_modules/lodash/_assocIndexOf.js create mode 100644 publisher/node_modules/lodash/_baseAggregator.js create mode 100644 publisher/node_modules/lodash/_baseAssign.js create mode 100644 publisher/node_modules/lodash/_baseAssignIn.js create mode 100644 publisher/node_modules/lodash/_baseAssignValue.js create mode 100644 publisher/node_modules/lodash/_baseAt.js create mode 100644 publisher/node_modules/lodash/_baseClamp.js create mode 100644 publisher/node_modules/lodash/_baseClone.js create mode 100644 publisher/node_modules/lodash/_baseConforms.js create mode 100644 publisher/node_modules/lodash/_baseConformsTo.js create mode 100644 publisher/node_modules/lodash/_baseCreate.js create mode 100644 publisher/node_modules/lodash/_baseDelay.js create mode 100644 publisher/node_modules/lodash/_baseDifference.js create mode 100644 publisher/node_modules/lodash/_baseEach.js create mode 100644 publisher/node_modules/lodash/_baseEachRight.js create mode 100644 publisher/node_modules/lodash/_baseEvery.js create mode 100644 publisher/node_modules/lodash/_baseExtremum.js create mode 100644 publisher/node_modules/lodash/_baseFill.js create mode 100644 publisher/node_modules/lodash/_baseFilter.js create mode 100644 publisher/node_modules/lodash/_baseFindIndex.js create mode 100644 publisher/node_modules/lodash/_baseFindKey.js create mode 100644 publisher/node_modules/lodash/_baseFlatten.js create mode 100644 publisher/node_modules/lodash/_baseFor.js create mode 100644 publisher/node_modules/lodash/_baseForOwn.js create mode 100644 publisher/node_modules/lodash/_baseForOwnRight.js create mode 100644 publisher/node_modules/lodash/_baseForRight.js create mode 100644 publisher/node_modules/lodash/_baseFunctions.js create mode 100644 publisher/node_modules/lodash/_baseGet.js create mode 100644 publisher/node_modules/lodash/_baseGetAllKeys.js create mode 100644 publisher/node_modules/lodash/_baseGetTag.js create mode 100644 publisher/node_modules/lodash/_baseGt.js create mode 100644 publisher/node_modules/lodash/_baseHas.js create mode 100644 publisher/node_modules/lodash/_baseHasIn.js create mode 100644 publisher/node_modules/lodash/_baseInRange.js create mode 100644 publisher/node_modules/lodash/_baseIndexOf.js create mode 100644 publisher/node_modules/lodash/_baseIndexOfWith.js create mode 100644 publisher/node_modules/lodash/_baseIntersection.js create mode 100644 publisher/node_modules/lodash/_baseInverter.js create mode 100644 publisher/node_modules/lodash/_baseInvoke.js create mode 100644 publisher/node_modules/lodash/_baseIsArguments.js create mode 100644 publisher/node_modules/lodash/_baseIsArrayBuffer.js create mode 100644 publisher/node_modules/lodash/_baseIsDate.js create mode 100644 publisher/node_modules/lodash/_baseIsEqual.js create mode 100644 publisher/node_modules/lodash/_baseIsEqualDeep.js create mode 100644 publisher/node_modules/lodash/_baseIsMap.js create mode 100644 publisher/node_modules/lodash/_baseIsMatch.js create mode 100644 publisher/node_modules/lodash/_baseIsNaN.js create mode 100644 publisher/node_modules/lodash/_baseIsNative.js create mode 100644 publisher/node_modules/lodash/_baseIsRegExp.js create mode 100644 publisher/node_modules/lodash/_baseIsSet.js create mode 100644 publisher/node_modules/lodash/_baseIsTypedArray.js create mode 100644 publisher/node_modules/lodash/_baseIteratee.js create mode 100644 publisher/node_modules/lodash/_baseKeys.js create mode 100644 publisher/node_modules/lodash/_baseKeysIn.js create mode 100644 publisher/node_modules/lodash/_baseLodash.js create mode 100644 publisher/node_modules/lodash/_baseLt.js create mode 100644 publisher/node_modules/lodash/_baseMap.js create mode 100644 publisher/node_modules/lodash/_baseMatches.js create mode 100644 publisher/node_modules/lodash/_baseMatchesProperty.js create mode 100644 publisher/node_modules/lodash/_baseMean.js create mode 100644 publisher/node_modules/lodash/_baseMerge.js create mode 100644 publisher/node_modules/lodash/_baseMergeDeep.js create mode 100644 publisher/node_modules/lodash/_baseNth.js create mode 100644 publisher/node_modules/lodash/_baseOrderBy.js create mode 100644 publisher/node_modules/lodash/_basePick.js create mode 100644 publisher/node_modules/lodash/_basePickBy.js create mode 100644 publisher/node_modules/lodash/_baseProperty.js create mode 100644 publisher/node_modules/lodash/_basePropertyDeep.js create mode 100644 publisher/node_modules/lodash/_basePropertyOf.js create mode 100644 publisher/node_modules/lodash/_basePullAll.js create mode 100644 publisher/node_modules/lodash/_basePullAt.js create mode 100644 publisher/node_modules/lodash/_baseRandom.js create mode 100644 publisher/node_modules/lodash/_baseRange.js create mode 100644 publisher/node_modules/lodash/_baseReduce.js create mode 100644 publisher/node_modules/lodash/_baseRepeat.js create mode 100644 publisher/node_modules/lodash/_baseRest.js create mode 100644 publisher/node_modules/lodash/_baseSample.js create mode 100644 publisher/node_modules/lodash/_baseSampleSize.js create mode 100644 publisher/node_modules/lodash/_baseSet.js create mode 100644 publisher/node_modules/lodash/_baseSetData.js create mode 100644 publisher/node_modules/lodash/_baseSetToString.js create mode 100644 publisher/node_modules/lodash/_baseShuffle.js create mode 100644 publisher/node_modules/lodash/_baseSlice.js create mode 100644 publisher/node_modules/lodash/_baseSome.js create mode 100644 publisher/node_modules/lodash/_baseSortBy.js create mode 100644 publisher/node_modules/lodash/_baseSortedIndex.js create mode 100644 publisher/node_modules/lodash/_baseSortedIndexBy.js create mode 100644 publisher/node_modules/lodash/_baseSortedUniq.js create mode 100644 publisher/node_modules/lodash/_baseSum.js create mode 100644 publisher/node_modules/lodash/_baseTimes.js create mode 100644 publisher/node_modules/lodash/_baseToNumber.js create mode 100644 publisher/node_modules/lodash/_baseToPairs.js create mode 100644 publisher/node_modules/lodash/_baseToString.js create mode 100644 publisher/node_modules/lodash/_baseTrim.js create mode 100644 publisher/node_modules/lodash/_baseUnary.js create mode 100644 publisher/node_modules/lodash/_baseUniq.js create mode 100644 publisher/node_modules/lodash/_baseUnset.js create mode 100644 publisher/node_modules/lodash/_baseUpdate.js create mode 100644 publisher/node_modules/lodash/_baseValues.js create mode 100644 publisher/node_modules/lodash/_baseWhile.js create mode 100644 publisher/node_modules/lodash/_baseWrapperValue.js create mode 100644 publisher/node_modules/lodash/_baseXor.js create mode 100644 publisher/node_modules/lodash/_baseZipObject.js create mode 100644 publisher/node_modules/lodash/_cacheHas.js create mode 100644 publisher/node_modules/lodash/_castArrayLikeObject.js create mode 100644 publisher/node_modules/lodash/_castFunction.js create mode 100644 publisher/node_modules/lodash/_castPath.js create mode 100644 publisher/node_modules/lodash/_castRest.js create mode 100644 publisher/node_modules/lodash/_castSlice.js create mode 100644 publisher/node_modules/lodash/_charsEndIndex.js create mode 100644 publisher/node_modules/lodash/_charsStartIndex.js create mode 100644 publisher/node_modules/lodash/_cloneArrayBuffer.js create mode 100644 publisher/node_modules/lodash/_cloneBuffer.js create mode 100644 publisher/node_modules/lodash/_cloneDataView.js create mode 100644 publisher/node_modules/lodash/_cloneRegExp.js create mode 100644 publisher/node_modules/lodash/_cloneSymbol.js create mode 100644 publisher/node_modules/lodash/_cloneTypedArray.js create mode 100644 publisher/node_modules/lodash/_compareAscending.js create mode 100644 publisher/node_modules/lodash/_compareMultiple.js create mode 100644 publisher/node_modules/lodash/_composeArgs.js create mode 100644 publisher/node_modules/lodash/_composeArgsRight.js create mode 100644 publisher/node_modules/lodash/_copyArray.js create mode 100644 publisher/node_modules/lodash/_copyObject.js create mode 100644 publisher/node_modules/lodash/_copySymbols.js create mode 100644 publisher/node_modules/lodash/_copySymbolsIn.js create mode 100644 publisher/node_modules/lodash/_coreJsData.js create mode 100644 publisher/node_modules/lodash/_countHolders.js create mode 100644 publisher/node_modules/lodash/_createAggregator.js create mode 100644 publisher/node_modules/lodash/_createAssigner.js create mode 100644 publisher/node_modules/lodash/_createBaseEach.js create mode 100644 publisher/node_modules/lodash/_createBaseFor.js create mode 100644 publisher/node_modules/lodash/_createBind.js create mode 100644 publisher/node_modules/lodash/_createCaseFirst.js create mode 100644 publisher/node_modules/lodash/_createCompounder.js create mode 100644 publisher/node_modules/lodash/_createCtor.js create mode 100644 publisher/node_modules/lodash/_createCurry.js create mode 100644 publisher/node_modules/lodash/_createFind.js create mode 100644 publisher/node_modules/lodash/_createFlow.js create mode 100644 publisher/node_modules/lodash/_createHybrid.js create mode 100644 publisher/node_modules/lodash/_createInverter.js create mode 100644 publisher/node_modules/lodash/_createMathOperation.js create mode 100644 publisher/node_modules/lodash/_createOver.js create mode 100644 publisher/node_modules/lodash/_createPadding.js create mode 100644 publisher/node_modules/lodash/_createPartial.js create mode 100644 publisher/node_modules/lodash/_createRange.js create mode 100644 publisher/node_modules/lodash/_createRecurry.js create mode 100644 publisher/node_modules/lodash/_createRelationalOperation.js create mode 100644 publisher/node_modules/lodash/_createRound.js create mode 100644 publisher/node_modules/lodash/_createSet.js create mode 100644 publisher/node_modules/lodash/_createToPairs.js create mode 100644 publisher/node_modules/lodash/_createWrap.js create mode 100644 publisher/node_modules/lodash/_customDefaultsAssignIn.js create mode 100644 publisher/node_modules/lodash/_customDefaultsMerge.js create mode 100644 publisher/node_modules/lodash/_customOmitClone.js create mode 100644 publisher/node_modules/lodash/_deburrLetter.js create mode 100644 publisher/node_modules/lodash/_defineProperty.js create mode 100644 publisher/node_modules/lodash/_equalArrays.js create mode 100644 publisher/node_modules/lodash/_equalByTag.js create mode 100644 publisher/node_modules/lodash/_equalObjects.js create mode 100644 publisher/node_modules/lodash/_escapeHtmlChar.js create mode 100644 publisher/node_modules/lodash/_escapeStringChar.js create mode 100644 publisher/node_modules/lodash/_flatRest.js create mode 100644 publisher/node_modules/lodash/_freeGlobal.js create mode 100644 publisher/node_modules/lodash/_getAllKeys.js create mode 100644 publisher/node_modules/lodash/_getAllKeysIn.js create mode 100644 publisher/node_modules/lodash/_getData.js create mode 100644 publisher/node_modules/lodash/_getFuncName.js create mode 100644 publisher/node_modules/lodash/_getHolder.js create mode 100644 publisher/node_modules/lodash/_getMapData.js create mode 100644 publisher/node_modules/lodash/_getMatchData.js create mode 100644 publisher/node_modules/lodash/_getNative.js create mode 100644 publisher/node_modules/lodash/_getPrototype.js create mode 100644 publisher/node_modules/lodash/_getRawTag.js create mode 100644 publisher/node_modules/lodash/_getSymbols.js create mode 100644 publisher/node_modules/lodash/_getSymbolsIn.js create mode 100644 publisher/node_modules/lodash/_getTag.js create mode 100644 publisher/node_modules/lodash/_getValue.js create mode 100644 publisher/node_modules/lodash/_getView.js create mode 100644 publisher/node_modules/lodash/_getWrapDetails.js create mode 100644 publisher/node_modules/lodash/_hasPath.js create mode 100644 publisher/node_modules/lodash/_hasUnicode.js create mode 100644 publisher/node_modules/lodash/_hasUnicodeWord.js create mode 100644 publisher/node_modules/lodash/_hashClear.js create mode 100644 publisher/node_modules/lodash/_hashDelete.js create mode 100644 publisher/node_modules/lodash/_hashGet.js create mode 100644 publisher/node_modules/lodash/_hashHas.js create mode 100644 publisher/node_modules/lodash/_hashSet.js create mode 100644 publisher/node_modules/lodash/_initCloneArray.js create mode 100644 publisher/node_modules/lodash/_initCloneByTag.js create mode 100644 publisher/node_modules/lodash/_initCloneObject.js create mode 100644 publisher/node_modules/lodash/_insertWrapDetails.js create mode 100644 publisher/node_modules/lodash/_isFlattenable.js create mode 100644 publisher/node_modules/lodash/_isIndex.js create mode 100644 publisher/node_modules/lodash/_isIterateeCall.js create mode 100644 publisher/node_modules/lodash/_isKey.js create mode 100644 publisher/node_modules/lodash/_isKeyable.js create mode 100644 publisher/node_modules/lodash/_isLaziable.js create mode 100644 publisher/node_modules/lodash/_isMaskable.js create mode 100644 publisher/node_modules/lodash/_isMasked.js create mode 100644 publisher/node_modules/lodash/_isPrototype.js create mode 100644 publisher/node_modules/lodash/_isStrictComparable.js create mode 100644 publisher/node_modules/lodash/_iteratorToArray.js create mode 100644 publisher/node_modules/lodash/_lazyClone.js create mode 100644 publisher/node_modules/lodash/_lazyReverse.js create mode 100644 publisher/node_modules/lodash/_lazyValue.js create mode 100644 publisher/node_modules/lodash/_listCacheClear.js create mode 100644 publisher/node_modules/lodash/_listCacheDelete.js create mode 100644 publisher/node_modules/lodash/_listCacheGet.js create mode 100644 publisher/node_modules/lodash/_listCacheHas.js create mode 100644 publisher/node_modules/lodash/_listCacheSet.js create mode 100644 publisher/node_modules/lodash/_mapCacheClear.js create mode 100644 publisher/node_modules/lodash/_mapCacheDelete.js create mode 100644 publisher/node_modules/lodash/_mapCacheGet.js create mode 100644 publisher/node_modules/lodash/_mapCacheHas.js create mode 100644 publisher/node_modules/lodash/_mapCacheSet.js create mode 100644 publisher/node_modules/lodash/_mapToArray.js create mode 100644 publisher/node_modules/lodash/_matchesStrictComparable.js create mode 100644 publisher/node_modules/lodash/_memoizeCapped.js create mode 100644 publisher/node_modules/lodash/_mergeData.js create mode 100644 publisher/node_modules/lodash/_metaMap.js create mode 100644 publisher/node_modules/lodash/_nativeCreate.js create mode 100644 publisher/node_modules/lodash/_nativeKeys.js create mode 100644 publisher/node_modules/lodash/_nativeKeysIn.js create mode 100644 publisher/node_modules/lodash/_nodeUtil.js create mode 100644 publisher/node_modules/lodash/_objectToString.js create mode 100644 publisher/node_modules/lodash/_overArg.js create mode 100644 publisher/node_modules/lodash/_overRest.js create mode 100644 publisher/node_modules/lodash/_parent.js create mode 100644 publisher/node_modules/lodash/_reEscape.js create mode 100644 publisher/node_modules/lodash/_reEvaluate.js create mode 100644 publisher/node_modules/lodash/_reInterpolate.js create mode 100644 publisher/node_modules/lodash/_realNames.js create mode 100644 publisher/node_modules/lodash/_reorder.js create mode 100644 publisher/node_modules/lodash/_replaceHolders.js create mode 100644 publisher/node_modules/lodash/_root.js create mode 100644 publisher/node_modules/lodash/_safeGet.js create mode 100644 publisher/node_modules/lodash/_setCacheAdd.js create mode 100644 publisher/node_modules/lodash/_setCacheHas.js create mode 100644 publisher/node_modules/lodash/_setData.js create mode 100644 publisher/node_modules/lodash/_setToArray.js create mode 100644 publisher/node_modules/lodash/_setToPairs.js create mode 100644 publisher/node_modules/lodash/_setToString.js create mode 100644 publisher/node_modules/lodash/_setWrapToString.js create mode 100644 publisher/node_modules/lodash/_shortOut.js create mode 100644 publisher/node_modules/lodash/_shuffleSelf.js create mode 100644 publisher/node_modules/lodash/_stackClear.js create mode 100644 publisher/node_modules/lodash/_stackDelete.js create mode 100644 publisher/node_modules/lodash/_stackGet.js create mode 100644 publisher/node_modules/lodash/_stackHas.js create mode 100644 publisher/node_modules/lodash/_stackSet.js create mode 100644 publisher/node_modules/lodash/_strictIndexOf.js create mode 100644 publisher/node_modules/lodash/_strictLastIndexOf.js create mode 100644 publisher/node_modules/lodash/_stringSize.js create mode 100644 publisher/node_modules/lodash/_stringToArray.js create mode 100644 publisher/node_modules/lodash/_stringToPath.js create mode 100644 publisher/node_modules/lodash/_toKey.js create mode 100644 publisher/node_modules/lodash/_toSource.js create mode 100644 publisher/node_modules/lodash/_trimmedEndIndex.js create mode 100644 publisher/node_modules/lodash/_unescapeHtmlChar.js create mode 100644 publisher/node_modules/lodash/_unicodeSize.js create mode 100644 publisher/node_modules/lodash/_unicodeToArray.js create mode 100644 publisher/node_modules/lodash/_unicodeWords.js create mode 100644 publisher/node_modules/lodash/_updateWrapDetails.js create mode 100644 publisher/node_modules/lodash/_wrapperClone.js create mode 100644 publisher/node_modules/lodash/add.js create mode 100644 publisher/node_modules/lodash/after.js create mode 100644 publisher/node_modules/lodash/array.js create mode 100644 publisher/node_modules/lodash/ary.js create mode 100644 publisher/node_modules/lodash/assign.js create mode 100644 publisher/node_modules/lodash/assignIn.js create mode 100644 publisher/node_modules/lodash/assignInWith.js create mode 100644 publisher/node_modules/lodash/assignWith.js create mode 100644 publisher/node_modules/lodash/at.js create mode 100644 publisher/node_modules/lodash/attempt.js create mode 100644 publisher/node_modules/lodash/before.js create mode 100644 publisher/node_modules/lodash/bind.js create mode 100644 publisher/node_modules/lodash/bindAll.js create mode 100644 publisher/node_modules/lodash/bindKey.js create mode 100644 publisher/node_modules/lodash/camelCase.js create mode 100644 publisher/node_modules/lodash/capitalize.js create mode 100644 publisher/node_modules/lodash/castArray.js create mode 100644 publisher/node_modules/lodash/ceil.js create mode 100644 publisher/node_modules/lodash/chain.js create mode 100644 publisher/node_modules/lodash/chunk.js create mode 100644 publisher/node_modules/lodash/clamp.js create mode 100644 publisher/node_modules/lodash/clone.js create mode 100644 publisher/node_modules/lodash/cloneDeep.js create mode 100644 publisher/node_modules/lodash/cloneDeepWith.js create mode 100644 publisher/node_modules/lodash/cloneWith.js create mode 100644 publisher/node_modules/lodash/collection.js create mode 100644 publisher/node_modules/lodash/commit.js create mode 100644 publisher/node_modules/lodash/compact.js create mode 100644 publisher/node_modules/lodash/concat.js create mode 100644 publisher/node_modules/lodash/cond.js create mode 100644 publisher/node_modules/lodash/conforms.js create mode 100644 publisher/node_modules/lodash/conformsTo.js create mode 100644 publisher/node_modules/lodash/constant.js create mode 100644 publisher/node_modules/lodash/core.js create mode 100644 publisher/node_modules/lodash/core.min.js create mode 100644 publisher/node_modules/lodash/countBy.js create mode 100644 publisher/node_modules/lodash/create.js create mode 100644 publisher/node_modules/lodash/curry.js create mode 100644 publisher/node_modules/lodash/curryRight.js create mode 100644 publisher/node_modules/lodash/date.js create mode 100644 publisher/node_modules/lodash/debounce.js create mode 100644 publisher/node_modules/lodash/deburr.js create mode 100644 publisher/node_modules/lodash/defaultTo.js create mode 100644 publisher/node_modules/lodash/defaults.js create mode 100644 publisher/node_modules/lodash/defaultsDeep.js create mode 100644 publisher/node_modules/lodash/defer.js create mode 100644 publisher/node_modules/lodash/delay.js create mode 100644 publisher/node_modules/lodash/difference.js create mode 100644 publisher/node_modules/lodash/differenceBy.js create mode 100644 publisher/node_modules/lodash/differenceWith.js create mode 100644 publisher/node_modules/lodash/divide.js create mode 100644 publisher/node_modules/lodash/drop.js create mode 100644 publisher/node_modules/lodash/dropRight.js create mode 100644 publisher/node_modules/lodash/dropRightWhile.js create mode 100644 publisher/node_modules/lodash/dropWhile.js create mode 100644 publisher/node_modules/lodash/each.js create mode 100644 publisher/node_modules/lodash/eachRight.js create mode 100644 publisher/node_modules/lodash/endsWith.js create mode 100644 publisher/node_modules/lodash/entries.js create mode 100644 publisher/node_modules/lodash/entriesIn.js create mode 100644 publisher/node_modules/lodash/eq.js create mode 100644 publisher/node_modules/lodash/escape.js create mode 100644 publisher/node_modules/lodash/escapeRegExp.js create mode 100644 publisher/node_modules/lodash/every.js create mode 100644 publisher/node_modules/lodash/extend.js create mode 100644 publisher/node_modules/lodash/extendWith.js create mode 100644 publisher/node_modules/lodash/fill.js create mode 100644 publisher/node_modules/lodash/filter.js create mode 100644 publisher/node_modules/lodash/find.js create mode 100644 publisher/node_modules/lodash/findIndex.js create mode 100644 publisher/node_modules/lodash/findKey.js create mode 100644 publisher/node_modules/lodash/findLast.js create mode 100644 publisher/node_modules/lodash/findLastIndex.js create mode 100644 publisher/node_modules/lodash/findLastKey.js create mode 100644 publisher/node_modules/lodash/first.js create mode 100644 publisher/node_modules/lodash/flake.lock create mode 100644 publisher/node_modules/lodash/flake.nix create mode 100644 publisher/node_modules/lodash/flatMap.js create mode 100644 publisher/node_modules/lodash/flatMapDeep.js create mode 100644 publisher/node_modules/lodash/flatMapDepth.js create mode 100644 publisher/node_modules/lodash/flatten.js create mode 100644 publisher/node_modules/lodash/flattenDeep.js create mode 100644 publisher/node_modules/lodash/flattenDepth.js create mode 100644 publisher/node_modules/lodash/flip.js create mode 100644 publisher/node_modules/lodash/floor.js create mode 100644 publisher/node_modules/lodash/flow.js create mode 100644 publisher/node_modules/lodash/flowRight.js create mode 100644 publisher/node_modules/lodash/forEach.js create mode 100644 publisher/node_modules/lodash/forEachRight.js create mode 100644 publisher/node_modules/lodash/forIn.js create mode 100644 publisher/node_modules/lodash/forInRight.js create mode 100644 publisher/node_modules/lodash/forOwn.js create mode 100644 publisher/node_modules/lodash/forOwnRight.js create mode 100644 publisher/node_modules/lodash/fp.js create mode 100644 publisher/node_modules/lodash/fp/F.js create mode 100644 publisher/node_modules/lodash/fp/T.js create mode 100644 publisher/node_modules/lodash/fp/__.js create mode 100644 publisher/node_modules/lodash/fp/_baseConvert.js create mode 100644 publisher/node_modules/lodash/fp/_convertBrowser.js create mode 100644 publisher/node_modules/lodash/fp/_falseOptions.js create mode 100644 publisher/node_modules/lodash/fp/_mapping.js create mode 100644 publisher/node_modules/lodash/fp/_util.js create mode 100644 publisher/node_modules/lodash/fp/add.js create mode 100644 publisher/node_modules/lodash/fp/after.js create mode 100644 publisher/node_modules/lodash/fp/all.js create mode 100644 publisher/node_modules/lodash/fp/allPass.js create mode 100644 publisher/node_modules/lodash/fp/always.js create mode 100644 publisher/node_modules/lodash/fp/any.js create mode 100644 publisher/node_modules/lodash/fp/anyPass.js create mode 100644 publisher/node_modules/lodash/fp/apply.js create mode 100644 publisher/node_modules/lodash/fp/array.js create mode 100644 publisher/node_modules/lodash/fp/ary.js create mode 100644 publisher/node_modules/lodash/fp/assign.js create mode 100644 publisher/node_modules/lodash/fp/assignAll.js create mode 100644 publisher/node_modules/lodash/fp/assignAllWith.js create mode 100644 publisher/node_modules/lodash/fp/assignIn.js create mode 100644 publisher/node_modules/lodash/fp/assignInAll.js create mode 100644 publisher/node_modules/lodash/fp/assignInAllWith.js create mode 100644 publisher/node_modules/lodash/fp/assignInWith.js create mode 100644 publisher/node_modules/lodash/fp/assignWith.js create mode 100644 publisher/node_modules/lodash/fp/assoc.js create mode 100644 publisher/node_modules/lodash/fp/assocPath.js create mode 100644 publisher/node_modules/lodash/fp/at.js create mode 100644 publisher/node_modules/lodash/fp/attempt.js create mode 100644 publisher/node_modules/lodash/fp/before.js create mode 100644 publisher/node_modules/lodash/fp/bind.js create mode 100644 publisher/node_modules/lodash/fp/bindAll.js create mode 100644 publisher/node_modules/lodash/fp/bindKey.js create mode 100644 publisher/node_modules/lodash/fp/camelCase.js create mode 100644 publisher/node_modules/lodash/fp/capitalize.js create mode 100644 publisher/node_modules/lodash/fp/castArray.js create mode 100644 publisher/node_modules/lodash/fp/ceil.js create mode 100644 publisher/node_modules/lodash/fp/chain.js create mode 100644 publisher/node_modules/lodash/fp/chunk.js create mode 100644 publisher/node_modules/lodash/fp/clamp.js create mode 100644 publisher/node_modules/lodash/fp/clone.js create mode 100644 publisher/node_modules/lodash/fp/cloneDeep.js create mode 100644 publisher/node_modules/lodash/fp/cloneDeepWith.js create mode 100644 publisher/node_modules/lodash/fp/cloneWith.js create mode 100644 publisher/node_modules/lodash/fp/collection.js create mode 100644 publisher/node_modules/lodash/fp/commit.js create mode 100644 publisher/node_modules/lodash/fp/compact.js create mode 100644 publisher/node_modules/lodash/fp/complement.js create mode 100644 publisher/node_modules/lodash/fp/compose.js create mode 100644 publisher/node_modules/lodash/fp/concat.js create mode 100644 publisher/node_modules/lodash/fp/cond.js create mode 100644 publisher/node_modules/lodash/fp/conforms.js create mode 100644 publisher/node_modules/lodash/fp/conformsTo.js create mode 100644 publisher/node_modules/lodash/fp/constant.js create mode 100644 publisher/node_modules/lodash/fp/contains.js create mode 100644 publisher/node_modules/lodash/fp/convert.js create mode 100644 publisher/node_modules/lodash/fp/countBy.js create mode 100644 publisher/node_modules/lodash/fp/create.js create mode 100644 publisher/node_modules/lodash/fp/curry.js create mode 100644 publisher/node_modules/lodash/fp/curryN.js create mode 100644 publisher/node_modules/lodash/fp/curryRight.js create mode 100644 publisher/node_modules/lodash/fp/curryRightN.js create mode 100644 publisher/node_modules/lodash/fp/date.js create mode 100644 publisher/node_modules/lodash/fp/debounce.js create mode 100644 publisher/node_modules/lodash/fp/deburr.js create mode 100644 publisher/node_modules/lodash/fp/defaultTo.js create mode 100644 publisher/node_modules/lodash/fp/defaults.js create mode 100644 publisher/node_modules/lodash/fp/defaultsAll.js create mode 100644 publisher/node_modules/lodash/fp/defaultsDeep.js create mode 100644 publisher/node_modules/lodash/fp/defaultsDeepAll.js create mode 100644 publisher/node_modules/lodash/fp/defer.js create mode 100644 publisher/node_modules/lodash/fp/delay.js create mode 100644 publisher/node_modules/lodash/fp/difference.js create mode 100644 publisher/node_modules/lodash/fp/differenceBy.js create mode 100644 publisher/node_modules/lodash/fp/differenceWith.js create mode 100644 publisher/node_modules/lodash/fp/dissoc.js create mode 100644 publisher/node_modules/lodash/fp/dissocPath.js create mode 100644 publisher/node_modules/lodash/fp/divide.js create mode 100644 publisher/node_modules/lodash/fp/drop.js create mode 100644 publisher/node_modules/lodash/fp/dropLast.js create mode 100644 publisher/node_modules/lodash/fp/dropLastWhile.js create mode 100644 publisher/node_modules/lodash/fp/dropRight.js create mode 100644 publisher/node_modules/lodash/fp/dropRightWhile.js create mode 100644 publisher/node_modules/lodash/fp/dropWhile.js create mode 100644 publisher/node_modules/lodash/fp/each.js create mode 100644 publisher/node_modules/lodash/fp/eachRight.js create mode 100644 publisher/node_modules/lodash/fp/endsWith.js create mode 100644 publisher/node_modules/lodash/fp/entries.js create mode 100644 publisher/node_modules/lodash/fp/entriesIn.js create mode 100644 publisher/node_modules/lodash/fp/eq.js create mode 100644 publisher/node_modules/lodash/fp/equals.js create mode 100644 publisher/node_modules/lodash/fp/escape.js create mode 100644 publisher/node_modules/lodash/fp/escapeRegExp.js create mode 100644 publisher/node_modules/lodash/fp/every.js create mode 100644 publisher/node_modules/lodash/fp/extend.js create mode 100644 publisher/node_modules/lodash/fp/extendAll.js create mode 100644 publisher/node_modules/lodash/fp/extendAllWith.js create mode 100644 publisher/node_modules/lodash/fp/extendWith.js create mode 100644 publisher/node_modules/lodash/fp/fill.js create mode 100644 publisher/node_modules/lodash/fp/filter.js create mode 100644 publisher/node_modules/lodash/fp/find.js create mode 100644 publisher/node_modules/lodash/fp/findFrom.js create mode 100644 publisher/node_modules/lodash/fp/findIndex.js create mode 100644 publisher/node_modules/lodash/fp/findIndexFrom.js create mode 100644 publisher/node_modules/lodash/fp/findKey.js create mode 100644 publisher/node_modules/lodash/fp/findLast.js create mode 100644 publisher/node_modules/lodash/fp/findLastFrom.js create mode 100644 publisher/node_modules/lodash/fp/findLastIndex.js create mode 100644 publisher/node_modules/lodash/fp/findLastIndexFrom.js create mode 100644 publisher/node_modules/lodash/fp/findLastKey.js create mode 100644 publisher/node_modules/lodash/fp/first.js create mode 100644 publisher/node_modules/lodash/fp/flatMap.js create mode 100644 publisher/node_modules/lodash/fp/flatMapDeep.js create mode 100644 publisher/node_modules/lodash/fp/flatMapDepth.js create mode 100644 publisher/node_modules/lodash/fp/flatten.js create mode 100644 publisher/node_modules/lodash/fp/flattenDeep.js create mode 100644 publisher/node_modules/lodash/fp/flattenDepth.js create mode 100644 publisher/node_modules/lodash/fp/flip.js create mode 100644 publisher/node_modules/lodash/fp/floor.js create mode 100644 publisher/node_modules/lodash/fp/flow.js create mode 100644 publisher/node_modules/lodash/fp/flowRight.js create mode 100644 publisher/node_modules/lodash/fp/forEach.js create mode 100644 publisher/node_modules/lodash/fp/forEachRight.js create mode 100644 publisher/node_modules/lodash/fp/forIn.js create mode 100644 publisher/node_modules/lodash/fp/forInRight.js create mode 100644 publisher/node_modules/lodash/fp/forOwn.js create mode 100644 publisher/node_modules/lodash/fp/forOwnRight.js create mode 100644 publisher/node_modules/lodash/fp/fromPairs.js create mode 100644 publisher/node_modules/lodash/fp/function.js create mode 100644 publisher/node_modules/lodash/fp/functions.js create mode 100644 publisher/node_modules/lodash/fp/functionsIn.js create mode 100644 publisher/node_modules/lodash/fp/get.js create mode 100644 publisher/node_modules/lodash/fp/getOr.js create mode 100644 publisher/node_modules/lodash/fp/groupBy.js create mode 100644 publisher/node_modules/lodash/fp/gt.js create mode 100644 publisher/node_modules/lodash/fp/gte.js create mode 100644 publisher/node_modules/lodash/fp/has.js create mode 100644 publisher/node_modules/lodash/fp/hasIn.js create mode 100644 publisher/node_modules/lodash/fp/head.js create mode 100644 publisher/node_modules/lodash/fp/identical.js create mode 100644 publisher/node_modules/lodash/fp/identity.js create mode 100644 publisher/node_modules/lodash/fp/inRange.js create mode 100644 publisher/node_modules/lodash/fp/includes.js create mode 100644 publisher/node_modules/lodash/fp/includesFrom.js create mode 100644 publisher/node_modules/lodash/fp/indexBy.js create mode 100644 publisher/node_modules/lodash/fp/indexOf.js create mode 100644 publisher/node_modules/lodash/fp/indexOfFrom.js create mode 100644 publisher/node_modules/lodash/fp/init.js create mode 100644 publisher/node_modules/lodash/fp/initial.js create mode 100644 publisher/node_modules/lodash/fp/intersection.js create mode 100644 publisher/node_modules/lodash/fp/intersectionBy.js create mode 100644 publisher/node_modules/lodash/fp/intersectionWith.js create mode 100644 publisher/node_modules/lodash/fp/invert.js create mode 100644 publisher/node_modules/lodash/fp/invertBy.js create mode 100644 publisher/node_modules/lodash/fp/invertObj.js create mode 100644 publisher/node_modules/lodash/fp/invoke.js create mode 100644 publisher/node_modules/lodash/fp/invokeArgs.js create mode 100644 publisher/node_modules/lodash/fp/invokeArgsMap.js create mode 100644 publisher/node_modules/lodash/fp/invokeMap.js create mode 100644 publisher/node_modules/lodash/fp/isArguments.js create mode 100644 publisher/node_modules/lodash/fp/isArray.js create mode 100644 publisher/node_modules/lodash/fp/isArrayBuffer.js create mode 100644 publisher/node_modules/lodash/fp/isArrayLike.js create mode 100644 publisher/node_modules/lodash/fp/isArrayLikeObject.js create mode 100644 publisher/node_modules/lodash/fp/isBoolean.js create mode 100644 publisher/node_modules/lodash/fp/isBuffer.js create mode 100644 publisher/node_modules/lodash/fp/isDate.js create mode 100644 publisher/node_modules/lodash/fp/isElement.js create mode 100644 publisher/node_modules/lodash/fp/isEmpty.js create mode 100644 publisher/node_modules/lodash/fp/isEqual.js create mode 100644 publisher/node_modules/lodash/fp/isEqualWith.js create mode 100644 publisher/node_modules/lodash/fp/isError.js create mode 100644 publisher/node_modules/lodash/fp/isFinite.js create mode 100644 publisher/node_modules/lodash/fp/isFunction.js create mode 100644 publisher/node_modules/lodash/fp/isInteger.js create mode 100644 publisher/node_modules/lodash/fp/isLength.js create mode 100644 publisher/node_modules/lodash/fp/isMap.js create mode 100644 publisher/node_modules/lodash/fp/isMatch.js create mode 100644 publisher/node_modules/lodash/fp/isMatchWith.js create mode 100644 publisher/node_modules/lodash/fp/isNaN.js create mode 100644 publisher/node_modules/lodash/fp/isNative.js create mode 100644 publisher/node_modules/lodash/fp/isNil.js create mode 100644 publisher/node_modules/lodash/fp/isNull.js create mode 100644 publisher/node_modules/lodash/fp/isNumber.js create mode 100644 publisher/node_modules/lodash/fp/isObject.js create mode 100644 publisher/node_modules/lodash/fp/isObjectLike.js create mode 100644 publisher/node_modules/lodash/fp/isPlainObject.js create mode 100644 publisher/node_modules/lodash/fp/isRegExp.js create mode 100644 publisher/node_modules/lodash/fp/isSafeInteger.js create mode 100644 publisher/node_modules/lodash/fp/isSet.js create mode 100644 publisher/node_modules/lodash/fp/isString.js create mode 100644 publisher/node_modules/lodash/fp/isSymbol.js create mode 100644 publisher/node_modules/lodash/fp/isTypedArray.js create mode 100644 publisher/node_modules/lodash/fp/isUndefined.js create mode 100644 publisher/node_modules/lodash/fp/isWeakMap.js create mode 100644 publisher/node_modules/lodash/fp/isWeakSet.js create mode 100644 publisher/node_modules/lodash/fp/iteratee.js create mode 100644 publisher/node_modules/lodash/fp/join.js create mode 100644 publisher/node_modules/lodash/fp/juxt.js create mode 100644 publisher/node_modules/lodash/fp/kebabCase.js create mode 100644 publisher/node_modules/lodash/fp/keyBy.js create mode 100644 publisher/node_modules/lodash/fp/keys.js create mode 100644 publisher/node_modules/lodash/fp/keysIn.js create mode 100644 publisher/node_modules/lodash/fp/lang.js create mode 100644 publisher/node_modules/lodash/fp/last.js create mode 100644 publisher/node_modules/lodash/fp/lastIndexOf.js create mode 100644 publisher/node_modules/lodash/fp/lastIndexOfFrom.js create mode 100644 publisher/node_modules/lodash/fp/lowerCase.js create mode 100644 publisher/node_modules/lodash/fp/lowerFirst.js create mode 100644 publisher/node_modules/lodash/fp/lt.js create mode 100644 publisher/node_modules/lodash/fp/lte.js create mode 100644 publisher/node_modules/lodash/fp/map.js create mode 100644 publisher/node_modules/lodash/fp/mapKeys.js create mode 100644 publisher/node_modules/lodash/fp/mapValues.js create mode 100644 publisher/node_modules/lodash/fp/matches.js create mode 100644 publisher/node_modules/lodash/fp/matchesProperty.js create mode 100644 publisher/node_modules/lodash/fp/math.js create mode 100644 publisher/node_modules/lodash/fp/max.js create mode 100644 publisher/node_modules/lodash/fp/maxBy.js create mode 100644 publisher/node_modules/lodash/fp/mean.js create mode 100644 publisher/node_modules/lodash/fp/meanBy.js create mode 100644 publisher/node_modules/lodash/fp/memoize.js create mode 100644 publisher/node_modules/lodash/fp/merge.js create mode 100644 publisher/node_modules/lodash/fp/mergeAll.js create mode 100644 publisher/node_modules/lodash/fp/mergeAllWith.js create mode 100644 publisher/node_modules/lodash/fp/mergeWith.js create mode 100644 publisher/node_modules/lodash/fp/method.js create mode 100644 publisher/node_modules/lodash/fp/methodOf.js create mode 100644 publisher/node_modules/lodash/fp/min.js create mode 100644 publisher/node_modules/lodash/fp/minBy.js create mode 100644 publisher/node_modules/lodash/fp/mixin.js create mode 100644 publisher/node_modules/lodash/fp/multiply.js create mode 100644 publisher/node_modules/lodash/fp/nAry.js create mode 100644 publisher/node_modules/lodash/fp/negate.js create mode 100644 publisher/node_modules/lodash/fp/next.js create mode 100644 publisher/node_modules/lodash/fp/noop.js create mode 100644 publisher/node_modules/lodash/fp/now.js create mode 100644 publisher/node_modules/lodash/fp/nth.js create mode 100644 publisher/node_modules/lodash/fp/nthArg.js create mode 100644 publisher/node_modules/lodash/fp/number.js create mode 100644 publisher/node_modules/lodash/fp/object.js create mode 100644 publisher/node_modules/lodash/fp/omit.js create mode 100644 publisher/node_modules/lodash/fp/omitAll.js create mode 100644 publisher/node_modules/lodash/fp/omitBy.js create mode 100644 publisher/node_modules/lodash/fp/once.js create mode 100644 publisher/node_modules/lodash/fp/orderBy.js create mode 100644 publisher/node_modules/lodash/fp/over.js create mode 100644 publisher/node_modules/lodash/fp/overArgs.js create mode 100644 publisher/node_modules/lodash/fp/overEvery.js create mode 100644 publisher/node_modules/lodash/fp/overSome.js create mode 100644 publisher/node_modules/lodash/fp/pad.js create mode 100644 publisher/node_modules/lodash/fp/padChars.js create mode 100644 publisher/node_modules/lodash/fp/padCharsEnd.js create mode 100644 publisher/node_modules/lodash/fp/padCharsStart.js create mode 100644 publisher/node_modules/lodash/fp/padEnd.js create mode 100644 publisher/node_modules/lodash/fp/padStart.js create mode 100644 publisher/node_modules/lodash/fp/parseInt.js create mode 100644 publisher/node_modules/lodash/fp/partial.js create mode 100644 publisher/node_modules/lodash/fp/partialRight.js create mode 100644 publisher/node_modules/lodash/fp/partition.js create mode 100644 publisher/node_modules/lodash/fp/path.js create mode 100644 publisher/node_modules/lodash/fp/pathEq.js create mode 100644 publisher/node_modules/lodash/fp/pathOr.js create mode 100644 publisher/node_modules/lodash/fp/paths.js create mode 100644 publisher/node_modules/lodash/fp/pick.js create mode 100644 publisher/node_modules/lodash/fp/pickAll.js create mode 100644 publisher/node_modules/lodash/fp/pickBy.js create mode 100644 publisher/node_modules/lodash/fp/pipe.js create mode 100644 publisher/node_modules/lodash/fp/placeholder.js create mode 100644 publisher/node_modules/lodash/fp/plant.js create mode 100644 publisher/node_modules/lodash/fp/pluck.js create mode 100644 publisher/node_modules/lodash/fp/prop.js create mode 100644 publisher/node_modules/lodash/fp/propEq.js create mode 100644 publisher/node_modules/lodash/fp/propOr.js create mode 100644 publisher/node_modules/lodash/fp/property.js create mode 100644 publisher/node_modules/lodash/fp/propertyOf.js create mode 100644 publisher/node_modules/lodash/fp/props.js create mode 100644 publisher/node_modules/lodash/fp/pull.js create mode 100644 publisher/node_modules/lodash/fp/pullAll.js create mode 100644 publisher/node_modules/lodash/fp/pullAllBy.js create mode 100644 publisher/node_modules/lodash/fp/pullAllWith.js create mode 100644 publisher/node_modules/lodash/fp/pullAt.js create mode 100644 publisher/node_modules/lodash/fp/random.js create mode 100644 publisher/node_modules/lodash/fp/range.js create mode 100644 publisher/node_modules/lodash/fp/rangeRight.js create mode 100644 publisher/node_modules/lodash/fp/rangeStep.js create mode 100644 publisher/node_modules/lodash/fp/rangeStepRight.js create mode 100644 publisher/node_modules/lodash/fp/rearg.js create mode 100644 publisher/node_modules/lodash/fp/reduce.js create mode 100644 publisher/node_modules/lodash/fp/reduceRight.js create mode 100644 publisher/node_modules/lodash/fp/reject.js create mode 100644 publisher/node_modules/lodash/fp/remove.js create mode 100644 publisher/node_modules/lodash/fp/repeat.js create mode 100644 publisher/node_modules/lodash/fp/replace.js create mode 100644 publisher/node_modules/lodash/fp/rest.js create mode 100644 publisher/node_modules/lodash/fp/restFrom.js create mode 100644 publisher/node_modules/lodash/fp/result.js create mode 100644 publisher/node_modules/lodash/fp/reverse.js create mode 100644 publisher/node_modules/lodash/fp/round.js create mode 100644 publisher/node_modules/lodash/fp/sample.js create mode 100644 publisher/node_modules/lodash/fp/sampleSize.js create mode 100644 publisher/node_modules/lodash/fp/seq.js create mode 100644 publisher/node_modules/lodash/fp/set.js create mode 100644 publisher/node_modules/lodash/fp/setWith.js create mode 100644 publisher/node_modules/lodash/fp/shuffle.js create mode 100644 publisher/node_modules/lodash/fp/size.js create mode 100644 publisher/node_modules/lodash/fp/slice.js create mode 100644 publisher/node_modules/lodash/fp/snakeCase.js create mode 100644 publisher/node_modules/lodash/fp/some.js create mode 100644 publisher/node_modules/lodash/fp/sortBy.js create mode 100644 publisher/node_modules/lodash/fp/sortedIndex.js create mode 100644 publisher/node_modules/lodash/fp/sortedIndexBy.js create mode 100644 publisher/node_modules/lodash/fp/sortedIndexOf.js create mode 100644 publisher/node_modules/lodash/fp/sortedLastIndex.js create mode 100644 publisher/node_modules/lodash/fp/sortedLastIndexBy.js create mode 100644 publisher/node_modules/lodash/fp/sortedLastIndexOf.js create mode 100644 publisher/node_modules/lodash/fp/sortedUniq.js create mode 100644 publisher/node_modules/lodash/fp/sortedUniqBy.js create mode 100644 publisher/node_modules/lodash/fp/split.js create mode 100644 publisher/node_modules/lodash/fp/spread.js create mode 100644 publisher/node_modules/lodash/fp/spreadFrom.js create mode 100644 publisher/node_modules/lodash/fp/startCase.js create mode 100644 publisher/node_modules/lodash/fp/startsWith.js create mode 100644 publisher/node_modules/lodash/fp/string.js create mode 100644 publisher/node_modules/lodash/fp/stubArray.js create mode 100644 publisher/node_modules/lodash/fp/stubFalse.js create mode 100644 publisher/node_modules/lodash/fp/stubObject.js create mode 100644 publisher/node_modules/lodash/fp/stubString.js create mode 100644 publisher/node_modules/lodash/fp/stubTrue.js create mode 100644 publisher/node_modules/lodash/fp/subtract.js create mode 100644 publisher/node_modules/lodash/fp/sum.js create mode 100644 publisher/node_modules/lodash/fp/sumBy.js create mode 100644 publisher/node_modules/lodash/fp/symmetricDifference.js create mode 100644 publisher/node_modules/lodash/fp/symmetricDifferenceBy.js create mode 100644 publisher/node_modules/lodash/fp/symmetricDifferenceWith.js create mode 100644 publisher/node_modules/lodash/fp/tail.js create mode 100644 publisher/node_modules/lodash/fp/take.js create mode 100644 publisher/node_modules/lodash/fp/takeLast.js create mode 100644 publisher/node_modules/lodash/fp/takeLastWhile.js create mode 100644 publisher/node_modules/lodash/fp/takeRight.js create mode 100644 publisher/node_modules/lodash/fp/takeRightWhile.js create mode 100644 publisher/node_modules/lodash/fp/takeWhile.js create mode 100644 publisher/node_modules/lodash/fp/tap.js create mode 100644 publisher/node_modules/lodash/fp/template.js create mode 100644 publisher/node_modules/lodash/fp/templateSettings.js create mode 100644 publisher/node_modules/lodash/fp/throttle.js create mode 100644 publisher/node_modules/lodash/fp/thru.js create mode 100644 publisher/node_modules/lodash/fp/times.js create mode 100644 publisher/node_modules/lodash/fp/toArray.js create mode 100644 publisher/node_modules/lodash/fp/toFinite.js create mode 100644 publisher/node_modules/lodash/fp/toInteger.js create mode 100644 publisher/node_modules/lodash/fp/toIterator.js create mode 100644 publisher/node_modules/lodash/fp/toJSON.js create mode 100644 publisher/node_modules/lodash/fp/toLength.js create mode 100644 publisher/node_modules/lodash/fp/toLower.js create mode 100644 publisher/node_modules/lodash/fp/toNumber.js create mode 100644 publisher/node_modules/lodash/fp/toPairs.js create mode 100644 publisher/node_modules/lodash/fp/toPairsIn.js create mode 100644 publisher/node_modules/lodash/fp/toPath.js create mode 100644 publisher/node_modules/lodash/fp/toPlainObject.js create mode 100644 publisher/node_modules/lodash/fp/toSafeInteger.js create mode 100644 publisher/node_modules/lodash/fp/toString.js create mode 100644 publisher/node_modules/lodash/fp/toUpper.js create mode 100644 publisher/node_modules/lodash/fp/transform.js create mode 100644 publisher/node_modules/lodash/fp/trim.js create mode 100644 publisher/node_modules/lodash/fp/trimChars.js create mode 100644 publisher/node_modules/lodash/fp/trimCharsEnd.js create mode 100644 publisher/node_modules/lodash/fp/trimCharsStart.js create mode 100644 publisher/node_modules/lodash/fp/trimEnd.js create mode 100644 publisher/node_modules/lodash/fp/trimStart.js create mode 100644 publisher/node_modules/lodash/fp/truncate.js create mode 100644 publisher/node_modules/lodash/fp/unapply.js create mode 100644 publisher/node_modules/lodash/fp/unary.js create mode 100644 publisher/node_modules/lodash/fp/unescape.js create mode 100644 publisher/node_modules/lodash/fp/union.js create mode 100644 publisher/node_modules/lodash/fp/unionBy.js create mode 100644 publisher/node_modules/lodash/fp/unionWith.js create mode 100644 publisher/node_modules/lodash/fp/uniq.js create mode 100644 publisher/node_modules/lodash/fp/uniqBy.js create mode 100644 publisher/node_modules/lodash/fp/uniqWith.js create mode 100644 publisher/node_modules/lodash/fp/uniqueId.js create mode 100644 publisher/node_modules/lodash/fp/unnest.js create mode 100644 publisher/node_modules/lodash/fp/unset.js create mode 100644 publisher/node_modules/lodash/fp/unzip.js create mode 100644 publisher/node_modules/lodash/fp/unzipWith.js create mode 100644 publisher/node_modules/lodash/fp/update.js create mode 100644 publisher/node_modules/lodash/fp/updateWith.js create mode 100644 publisher/node_modules/lodash/fp/upperCase.js create mode 100644 publisher/node_modules/lodash/fp/upperFirst.js create mode 100644 publisher/node_modules/lodash/fp/useWith.js create mode 100644 publisher/node_modules/lodash/fp/util.js create mode 100644 publisher/node_modules/lodash/fp/value.js create mode 100644 publisher/node_modules/lodash/fp/valueOf.js create mode 100644 publisher/node_modules/lodash/fp/values.js create mode 100644 publisher/node_modules/lodash/fp/valuesIn.js create mode 100644 publisher/node_modules/lodash/fp/where.js create mode 100644 publisher/node_modules/lodash/fp/whereEq.js create mode 100644 publisher/node_modules/lodash/fp/without.js create mode 100644 publisher/node_modules/lodash/fp/words.js create mode 100644 publisher/node_modules/lodash/fp/wrap.js create mode 100644 publisher/node_modules/lodash/fp/wrapperAt.js create mode 100644 publisher/node_modules/lodash/fp/wrapperChain.js create mode 100644 publisher/node_modules/lodash/fp/wrapperLodash.js create mode 100644 publisher/node_modules/lodash/fp/wrapperReverse.js create mode 100644 publisher/node_modules/lodash/fp/wrapperValue.js create mode 100644 publisher/node_modules/lodash/fp/xor.js create mode 100644 publisher/node_modules/lodash/fp/xorBy.js create mode 100644 publisher/node_modules/lodash/fp/xorWith.js create mode 100644 publisher/node_modules/lodash/fp/zip.js create mode 100644 publisher/node_modules/lodash/fp/zipAll.js create mode 100644 publisher/node_modules/lodash/fp/zipObj.js create mode 100644 publisher/node_modules/lodash/fp/zipObject.js create mode 100644 publisher/node_modules/lodash/fp/zipObjectDeep.js create mode 100644 publisher/node_modules/lodash/fp/zipWith.js create mode 100644 publisher/node_modules/lodash/fromPairs.js create mode 100644 publisher/node_modules/lodash/function.js create mode 100644 publisher/node_modules/lodash/functions.js create mode 100644 publisher/node_modules/lodash/functionsIn.js create mode 100644 publisher/node_modules/lodash/get.js create mode 100644 publisher/node_modules/lodash/groupBy.js create mode 100644 publisher/node_modules/lodash/gt.js create mode 100644 publisher/node_modules/lodash/gte.js create mode 100644 publisher/node_modules/lodash/has.js create mode 100644 publisher/node_modules/lodash/hasIn.js create mode 100644 publisher/node_modules/lodash/head.js create mode 100644 publisher/node_modules/lodash/identity.js create mode 100644 publisher/node_modules/lodash/inRange.js create mode 100644 publisher/node_modules/lodash/includes.js create mode 100644 publisher/node_modules/lodash/index.js create mode 100644 publisher/node_modules/lodash/indexOf.js create mode 100644 publisher/node_modules/lodash/initial.js create mode 100644 publisher/node_modules/lodash/intersection.js create mode 100644 publisher/node_modules/lodash/intersectionBy.js create mode 100644 publisher/node_modules/lodash/intersectionWith.js create mode 100644 publisher/node_modules/lodash/invert.js create mode 100644 publisher/node_modules/lodash/invertBy.js create mode 100644 publisher/node_modules/lodash/invoke.js create mode 100644 publisher/node_modules/lodash/invokeMap.js create mode 100644 publisher/node_modules/lodash/isArguments.js create mode 100644 publisher/node_modules/lodash/isArray.js create mode 100644 publisher/node_modules/lodash/isArrayBuffer.js create mode 100644 publisher/node_modules/lodash/isArrayLike.js create mode 100644 publisher/node_modules/lodash/isArrayLikeObject.js create mode 100644 publisher/node_modules/lodash/isBoolean.js create mode 100644 publisher/node_modules/lodash/isBuffer.js create mode 100644 publisher/node_modules/lodash/isDate.js create mode 100644 publisher/node_modules/lodash/isElement.js create mode 100644 publisher/node_modules/lodash/isEmpty.js create mode 100644 publisher/node_modules/lodash/isEqual.js create mode 100644 publisher/node_modules/lodash/isEqualWith.js create mode 100644 publisher/node_modules/lodash/isError.js create mode 100644 publisher/node_modules/lodash/isFinite.js create mode 100644 publisher/node_modules/lodash/isFunction.js create mode 100644 publisher/node_modules/lodash/isInteger.js create mode 100644 publisher/node_modules/lodash/isLength.js create mode 100644 publisher/node_modules/lodash/isMap.js create mode 100644 publisher/node_modules/lodash/isMatch.js create mode 100644 publisher/node_modules/lodash/isMatchWith.js create mode 100644 publisher/node_modules/lodash/isNaN.js create mode 100644 publisher/node_modules/lodash/isNative.js create mode 100644 publisher/node_modules/lodash/isNil.js create mode 100644 publisher/node_modules/lodash/isNull.js create mode 100644 publisher/node_modules/lodash/isNumber.js create mode 100644 publisher/node_modules/lodash/isObject.js create mode 100644 publisher/node_modules/lodash/isObjectLike.js create mode 100644 publisher/node_modules/lodash/isPlainObject.js create mode 100644 publisher/node_modules/lodash/isRegExp.js create mode 100644 publisher/node_modules/lodash/isSafeInteger.js create mode 100644 publisher/node_modules/lodash/isSet.js create mode 100644 publisher/node_modules/lodash/isString.js create mode 100644 publisher/node_modules/lodash/isSymbol.js create mode 100644 publisher/node_modules/lodash/isTypedArray.js create mode 100644 publisher/node_modules/lodash/isUndefined.js create mode 100644 publisher/node_modules/lodash/isWeakMap.js create mode 100644 publisher/node_modules/lodash/isWeakSet.js create mode 100644 publisher/node_modules/lodash/iteratee.js create mode 100644 publisher/node_modules/lodash/join.js create mode 100644 publisher/node_modules/lodash/kebabCase.js create mode 100644 publisher/node_modules/lodash/keyBy.js create mode 100644 publisher/node_modules/lodash/keys.js create mode 100644 publisher/node_modules/lodash/keysIn.js create mode 100644 publisher/node_modules/lodash/lang.js create mode 100644 publisher/node_modules/lodash/last.js create mode 100644 publisher/node_modules/lodash/lastIndexOf.js create mode 100644 publisher/node_modules/lodash/lodash.js create mode 100644 publisher/node_modules/lodash/lodash.min.js create mode 100644 publisher/node_modules/lodash/lowerCase.js create mode 100644 publisher/node_modules/lodash/lowerFirst.js create mode 100644 publisher/node_modules/lodash/lt.js create mode 100644 publisher/node_modules/lodash/lte.js create mode 100644 publisher/node_modules/lodash/map.js create mode 100644 publisher/node_modules/lodash/mapKeys.js create mode 100644 publisher/node_modules/lodash/mapValues.js create mode 100644 publisher/node_modules/lodash/matches.js create mode 100644 publisher/node_modules/lodash/matchesProperty.js create mode 100644 publisher/node_modules/lodash/math.js create mode 100644 publisher/node_modules/lodash/max.js create mode 100644 publisher/node_modules/lodash/maxBy.js create mode 100644 publisher/node_modules/lodash/mean.js create mode 100644 publisher/node_modules/lodash/meanBy.js create mode 100644 publisher/node_modules/lodash/memoize.js create mode 100644 publisher/node_modules/lodash/merge.js create mode 100644 publisher/node_modules/lodash/mergeWith.js create mode 100644 publisher/node_modules/lodash/method.js create mode 100644 publisher/node_modules/lodash/methodOf.js create mode 100644 publisher/node_modules/lodash/min.js create mode 100644 publisher/node_modules/lodash/minBy.js create mode 100644 publisher/node_modules/lodash/mixin.js create mode 100644 publisher/node_modules/lodash/multiply.js create mode 100644 publisher/node_modules/lodash/negate.js create mode 100644 publisher/node_modules/lodash/next.js create mode 100644 publisher/node_modules/lodash/noop.js create mode 100644 publisher/node_modules/lodash/now.js create mode 100644 publisher/node_modules/lodash/nth.js create mode 100644 publisher/node_modules/lodash/nthArg.js create mode 100644 publisher/node_modules/lodash/number.js create mode 100644 publisher/node_modules/lodash/object.js create mode 100644 publisher/node_modules/lodash/omit.js create mode 100644 publisher/node_modules/lodash/omitBy.js create mode 100644 publisher/node_modules/lodash/once.js create mode 100644 publisher/node_modules/lodash/orderBy.js create mode 100644 publisher/node_modules/lodash/over.js create mode 100644 publisher/node_modules/lodash/overArgs.js create mode 100644 publisher/node_modules/lodash/overEvery.js create mode 100644 publisher/node_modules/lodash/overSome.js create mode 100644 publisher/node_modules/lodash/package.json create mode 100644 publisher/node_modules/lodash/pad.js create mode 100644 publisher/node_modules/lodash/padEnd.js create mode 100644 publisher/node_modules/lodash/padStart.js create mode 100644 publisher/node_modules/lodash/parseInt.js create mode 100644 publisher/node_modules/lodash/partial.js create mode 100644 publisher/node_modules/lodash/partialRight.js create mode 100644 publisher/node_modules/lodash/partition.js create mode 100644 publisher/node_modules/lodash/pick.js create mode 100644 publisher/node_modules/lodash/pickBy.js create mode 100644 publisher/node_modules/lodash/plant.js create mode 100644 publisher/node_modules/lodash/property.js create mode 100644 publisher/node_modules/lodash/propertyOf.js create mode 100644 publisher/node_modules/lodash/pull.js create mode 100644 publisher/node_modules/lodash/pullAll.js create mode 100644 publisher/node_modules/lodash/pullAllBy.js create mode 100644 publisher/node_modules/lodash/pullAllWith.js create mode 100644 publisher/node_modules/lodash/pullAt.js create mode 100644 publisher/node_modules/lodash/random.js create mode 100644 publisher/node_modules/lodash/range.js create mode 100644 publisher/node_modules/lodash/rangeRight.js create mode 100644 publisher/node_modules/lodash/rearg.js create mode 100644 publisher/node_modules/lodash/reduce.js create mode 100644 publisher/node_modules/lodash/reduceRight.js create mode 100644 publisher/node_modules/lodash/reject.js create mode 100644 publisher/node_modules/lodash/release.md create mode 100644 publisher/node_modules/lodash/remove.js create mode 100644 publisher/node_modules/lodash/repeat.js create mode 100644 publisher/node_modules/lodash/replace.js create mode 100644 publisher/node_modules/lodash/rest.js create mode 100644 publisher/node_modules/lodash/result.js create mode 100644 publisher/node_modules/lodash/reverse.js create mode 100644 publisher/node_modules/lodash/round.js create mode 100644 publisher/node_modules/lodash/sample.js create mode 100644 publisher/node_modules/lodash/sampleSize.js create mode 100644 publisher/node_modules/lodash/seq.js create mode 100644 publisher/node_modules/lodash/set.js create mode 100644 publisher/node_modules/lodash/setWith.js create mode 100644 publisher/node_modules/lodash/shuffle.js create mode 100644 publisher/node_modules/lodash/size.js create mode 100644 publisher/node_modules/lodash/slice.js create mode 100644 publisher/node_modules/lodash/snakeCase.js create mode 100644 publisher/node_modules/lodash/some.js create mode 100644 publisher/node_modules/lodash/sortBy.js create mode 100644 publisher/node_modules/lodash/sortedIndex.js create mode 100644 publisher/node_modules/lodash/sortedIndexBy.js create mode 100644 publisher/node_modules/lodash/sortedIndexOf.js create mode 100644 publisher/node_modules/lodash/sortedLastIndex.js create mode 100644 publisher/node_modules/lodash/sortedLastIndexBy.js create mode 100644 publisher/node_modules/lodash/sortedLastIndexOf.js create mode 100644 publisher/node_modules/lodash/sortedUniq.js create mode 100644 publisher/node_modules/lodash/sortedUniqBy.js create mode 100644 publisher/node_modules/lodash/split.js create mode 100644 publisher/node_modules/lodash/spread.js create mode 100644 publisher/node_modules/lodash/startCase.js create mode 100644 publisher/node_modules/lodash/startsWith.js create mode 100644 publisher/node_modules/lodash/string.js create mode 100644 publisher/node_modules/lodash/stubArray.js create mode 100644 publisher/node_modules/lodash/stubFalse.js create mode 100644 publisher/node_modules/lodash/stubObject.js create mode 100644 publisher/node_modules/lodash/stubString.js create mode 100644 publisher/node_modules/lodash/stubTrue.js create mode 100644 publisher/node_modules/lodash/subtract.js create mode 100644 publisher/node_modules/lodash/sum.js create mode 100644 publisher/node_modules/lodash/sumBy.js create mode 100644 publisher/node_modules/lodash/tail.js create mode 100644 publisher/node_modules/lodash/take.js create mode 100644 publisher/node_modules/lodash/takeRight.js create mode 100644 publisher/node_modules/lodash/takeRightWhile.js create mode 100644 publisher/node_modules/lodash/takeWhile.js create mode 100644 publisher/node_modules/lodash/tap.js create mode 100644 publisher/node_modules/lodash/template.js create mode 100644 publisher/node_modules/lodash/templateSettings.js create mode 100644 publisher/node_modules/lodash/throttle.js create mode 100644 publisher/node_modules/lodash/thru.js create mode 100644 publisher/node_modules/lodash/times.js create mode 100644 publisher/node_modules/lodash/toArray.js create mode 100644 publisher/node_modules/lodash/toFinite.js create mode 100644 publisher/node_modules/lodash/toInteger.js create mode 100644 publisher/node_modules/lodash/toIterator.js create mode 100644 publisher/node_modules/lodash/toJSON.js create mode 100644 publisher/node_modules/lodash/toLength.js create mode 100644 publisher/node_modules/lodash/toLower.js create mode 100644 publisher/node_modules/lodash/toNumber.js create mode 100644 publisher/node_modules/lodash/toPairs.js create mode 100644 publisher/node_modules/lodash/toPairsIn.js create mode 100644 publisher/node_modules/lodash/toPath.js create mode 100644 publisher/node_modules/lodash/toPlainObject.js create mode 100644 publisher/node_modules/lodash/toSafeInteger.js create mode 100644 publisher/node_modules/lodash/toString.js create mode 100644 publisher/node_modules/lodash/toUpper.js create mode 100644 publisher/node_modules/lodash/transform.js create mode 100644 publisher/node_modules/lodash/trim.js create mode 100644 publisher/node_modules/lodash/trimEnd.js create mode 100644 publisher/node_modules/lodash/trimStart.js create mode 100644 publisher/node_modules/lodash/truncate.js create mode 100644 publisher/node_modules/lodash/unary.js create mode 100644 publisher/node_modules/lodash/unescape.js create mode 100644 publisher/node_modules/lodash/union.js create mode 100644 publisher/node_modules/lodash/unionBy.js create mode 100644 publisher/node_modules/lodash/unionWith.js create mode 100644 publisher/node_modules/lodash/uniq.js create mode 100644 publisher/node_modules/lodash/uniqBy.js create mode 100644 publisher/node_modules/lodash/uniqWith.js create mode 100644 publisher/node_modules/lodash/uniqueId.js create mode 100644 publisher/node_modules/lodash/unset.js create mode 100644 publisher/node_modules/lodash/unzip.js create mode 100644 publisher/node_modules/lodash/unzipWith.js create mode 100644 publisher/node_modules/lodash/update.js create mode 100644 publisher/node_modules/lodash/updateWith.js create mode 100644 publisher/node_modules/lodash/upperCase.js create mode 100644 publisher/node_modules/lodash/upperFirst.js create mode 100644 publisher/node_modules/lodash/util.js create mode 100644 publisher/node_modules/lodash/value.js create mode 100644 publisher/node_modules/lodash/valueOf.js create mode 100644 publisher/node_modules/lodash/values.js create mode 100644 publisher/node_modules/lodash/valuesIn.js create mode 100644 publisher/node_modules/lodash/without.js create mode 100644 publisher/node_modules/lodash/words.js create mode 100644 publisher/node_modules/lodash/wrap.js create mode 100644 publisher/node_modules/lodash/wrapperAt.js create mode 100644 publisher/node_modules/lodash/wrapperChain.js create mode 100644 publisher/node_modules/lodash/wrapperLodash.js create mode 100644 publisher/node_modules/lodash/wrapperReverse.js create mode 100644 publisher/node_modules/lodash/wrapperValue.js create mode 100644 publisher/node_modules/lodash/xor.js create mode 100644 publisher/node_modules/lodash/xorBy.js create mode 100644 publisher/node_modules/lodash/xorWith.js create mode 100644 publisher/node_modules/lodash/zip.js create mode 100644 publisher/node_modules/lodash/zipObject.js create mode 100644 publisher/node_modules/lodash/zipObjectDeep.js create mode 100644 publisher/node_modules/lodash/zipWith.js create mode 100644 publisher/node_modules/memory-stream/LICENSE create mode 100644 publisher/node_modules/memory-stream/README.md create mode 100644 publisher/node_modules/memory-stream/index.js create mode 100644 publisher/node_modules/memory-stream/package.json create mode 100644 publisher/node_modules/memory-stream/test/object.json create mode 100644 publisher/node_modules/memory-stream/test/source.txt create mode 100644 publisher/node_modules/memory-stream/test/tests/unit.js create mode 100644 publisher/node_modules/merge2/LICENSE create mode 100644 publisher/node_modules/merge2/README.md create mode 100644 publisher/node_modules/merge2/index.js create mode 100644 publisher/node_modules/merge2/package.json create mode 100755 publisher/node_modules/micromatch/LICENSE create mode 100644 publisher/node_modules/micromatch/README.md create mode 100644 publisher/node_modules/micromatch/index.js create mode 100644 publisher/node_modules/micromatch/package.json create mode 100644 publisher/node_modules/mime-db/HISTORY.md create mode 100644 publisher/node_modules/mime-db/LICENSE create mode 100644 publisher/node_modules/mime-db/README.md create mode 100644 publisher/node_modules/mime-db/db.json create mode 100644 publisher/node_modules/mime-db/index.js create mode 100644 publisher/node_modules/mime-db/package.json create mode 100644 publisher/node_modules/mime-types/HISTORY.md create mode 100644 publisher/node_modules/mime-types/LICENSE create mode 100644 publisher/node_modules/mime-types/README.md create mode 100644 publisher/node_modules/mime-types/index.js create mode 100644 publisher/node_modules/mime-types/package.json create mode 100644 publisher/node_modules/minipass/LICENSE create mode 100644 publisher/node_modules/minipass/README.md create mode 100644 publisher/node_modules/minipass/index.d.ts create mode 100644 publisher/node_modules/minipass/index.js create mode 100644 publisher/node_modules/minipass/package.json create mode 100644 publisher/node_modules/minizlib/LICENSE create mode 100644 publisher/node_modules/minizlib/README.md create mode 100644 publisher/node_modules/minizlib/constants.js create mode 100644 publisher/node_modules/minizlib/index.js create mode 100644 publisher/node_modules/minizlib/package.json create mode 100644 publisher/node_modules/mkdirp/CHANGELOG.md create mode 100644 publisher/node_modules/mkdirp/LICENSE create mode 100755 publisher/node_modules/mkdirp/bin/cmd.js create mode 100644 publisher/node_modules/mkdirp/index.js create mode 100644 publisher/node_modules/mkdirp/lib/find-made.js create mode 100644 publisher/node_modules/mkdirp/lib/mkdirp-manual.js create mode 100644 publisher/node_modules/mkdirp/lib/mkdirp-native.js create mode 100644 publisher/node_modules/mkdirp/lib/opts-arg.js create mode 100644 publisher/node_modules/mkdirp/lib/path-arg.js create mode 100644 publisher/node_modules/mkdirp/lib/use-native.js create mode 100644 publisher/node_modules/mkdirp/package.json create mode 100644 publisher/node_modules/mkdirp/readme.markdown create mode 100644 publisher/node_modules/node-addon-api/LICENSE.md create mode 100644 publisher/node_modules/node-addon-api/README.md create mode 100644 publisher/node_modules/node-addon-api/common.gypi create mode 100644 publisher/node_modules/node-addon-api/except.gypi create mode 100644 publisher/node_modules/node-addon-api/index.js create mode 100644 publisher/node_modules/node-addon-api/napi-inl.deprecated.h create mode 100644 publisher/node_modules/node-addon-api/napi-inl.h create mode 100644 publisher/node_modules/node-addon-api/napi.h create mode 100644 publisher/node_modules/node-addon-api/node_addon_api.gyp create mode 100644 publisher/node_modules/node-addon-api/node_api.gyp create mode 100644 publisher/node_modules/node-addon-api/noexcept.gypi create mode 100644 publisher/node_modules/node-addon-api/nothing.c create mode 100644 publisher/node_modules/node-addon-api/package-support.json create mode 100644 publisher/node_modules/node-addon-api/package.json create mode 100644 publisher/node_modules/node-addon-api/tools/README.md create mode 100644 publisher/node_modules/node-addon-api/tools/check-napi.js create mode 100644 publisher/node_modules/node-addon-api/tools/clang-format.js create mode 100755 publisher/node_modules/node-addon-api/tools/conversion.js create mode 100644 publisher/node_modules/node-addon-api/tools/eslint-format.js create mode 100644 publisher/node_modules/node-int64/.npmignore create mode 100644 publisher/node_modules/node-int64/Int64.js create mode 100644 publisher/node_modules/node-int64/LICENSE create mode 100644 publisher/node_modules/node-int64/README.md create mode 100644 publisher/node_modules/node-int64/package.json create mode 100644 publisher/node_modules/node-int64/test.js create mode 100644 publisher/node_modules/npmlog/LICENSE.md create mode 100644 publisher/node_modules/npmlog/README.md create mode 100644 publisher/node_modules/npmlog/lib/log.js create mode 100644 publisher/node_modules/npmlog/package.json create mode 100644 publisher/node_modules/object-inspect/.eslintrc create mode 100644 publisher/node_modules/object-inspect/.github/FUNDING.yml create mode 100644 publisher/node_modules/object-inspect/.nycrc create mode 100644 publisher/node_modules/object-inspect/CHANGELOG.md create mode 100644 publisher/node_modules/object-inspect/LICENSE create mode 100644 publisher/node_modules/object-inspect/example/all.js create mode 100644 publisher/node_modules/object-inspect/example/circular.js create mode 100644 publisher/node_modules/object-inspect/example/fn.js create mode 100644 publisher/node_modules/object-inspect/example/inspect.js create mode 100644 publisher/node_modules/object-inspect/index.js create mode 100644 publisher/node_modules/object-inspect/package-support.json create mode 100644 publisher/node_modules/object-inspect/package.json create mode 100644 publisher/node_modules/object-inspect/readme.markdown create mode 100644 publisher/node_modules/object-inspect/test-core-js.js create mode 100644 publisher/node_modules/object-inspect/test/bigint.js create mode 100644 publisher/node_modules/object-inspect/test/browser/dom.js create mode 100644 publisher/node_modules/object-inspect/test/circular.js create mode 100644 publisher/node_modules/object-inspect/test/deep.js create mode 100644 publisher/node_modules/object-inspect/test/element.js create mode 100644 publisher/node_modules/object-inspect/test/err.js create mode 100644 publisher/node_modules/object-inspect/test/fakes.js create mode 100644 publisher/node_modules/object-inspect/test/fn.js create mode 100644 publisher/node_modules/object-inspect/test/global.js create mode 100644 publisher/node_modules/object-inspect/test/has.js create mode 100644 publisher/node_modules/object-inspect/test/holes.js create mode 100644 publisher/node_modules/object-inspect/test/indent-option.js create mode 100644 publisher/node_modules/object-inspect/test/inspect.js create mode 100644 publisher/node_modules/object-inspect/test/lowbyte.js create mode 100644 publisher/node_modules/object-inspect/test/number.js create mode 100644 publisher/node_modules/object-inspect/test/quoteStyle.js create mode 100644 publisher/node_modules/object-inspect/test/toStringTag.js create mode 100644 publisher/node_modules/object-inspect/test/undef.js create mode 100644 publisher/node_modules/object-inspect/test/values.js create mode 100644 publisher/node_modules/object-inspect/util.inspect.js create mode 100644 publisher/node_modules/path-parse/LICENSE create mode 100644 publisher/node_modules/path-parse/README.md create mode 100644 publisher/node_modules/path-parse/index.js create mode 100644 publisher/node_modules/path-parse/package.json create mode 100644 publisher/node_modules/performance-now/.npmignore create mode 100644 publisher/node_modules/performance-now/.tm_properties create mode 100644 publisher/node_modules/performance-now/.travis.yml create mode 100644 publisher/node_modules/performance-now/README.md create mode 100644 publisher/node_modules/performance-now/lib/performance-now.js create mode 100644 publisher/node_modules/performance-now/lib/performance-now.js.map create mode 100644 publisher/node_modules/performance-now/license.txt create mode 100644 publisher/node_modules/performance-now/package.json create mode 100644 publisher/node_modules/performance-now/src/index.d.ts create mode 100644 publisher/node_modules/performance-now/src/performance-now.coffee create mode 100644 publisher/node_modules/performance-now/test/mocha.opts create mode 100644 publisher/node_modules/performance-now/test/performance-now.coffee create mode 100644 publisher/node_modules/performance-now/test/scripts.coffee create mode 100755 publisher/node_modules/performance-now/test/scripts/delayed-call.coffee create mode 100755 publisher/node_modules/performance-now/test/scripts/delayed-require.coffee create mode 100755 publisher/node_modules/performance-now/test/scripts/difference.coffee create mode 100755 publisher/node_modules/performance-now/test/scripts/initial-value.coffee create mode 100644 publisher/node_modules/picomatch/CHANGELOG.md create mode 100644 publisher/node_modules/picomatch/LICENSE create mode 100644 publisher/node_modules/picomatch/README.md create mode 100644 publisher/node_modules/picomatch/index.js create mode 100644 publisher/node_modules/picomatch/lib/constants.js create mode 100644 publisher/node_modules/picomatch/lib/parse.js create mode 100644 publisher/node_modules/picomatch/lib/picomatch.js create mode 100644 publisher/node_modules/picomatch/lib/scan.js create mode 100644 publisher/node_modules/picomatch/lib/utils.js create mode 100644 publisher/node_modules/picomatch/package.json create mode 100644 publisher/node_modules/process-nextick-args/index.js create mode 100644 publisher/node_modules/process-nextick-args/license.md create mode 100644 publisher/node_modules/process-nextick-args/package.json create mode 100644 publisher/node_modules/process-nextick-args/readme.md create mode 100644 publisher/node_modules/qs/.editorconfig create mode 100644 publisher/node_modules/qs/.eslintrc create mode 100644 publisher/node_modules/qs/.github/FUNDING.yml create mode 100644 publisher/node_modules/qs/.nycrc create mode 100644 publisher/node_modules/qs/CHANGELOG.md create mode 100644 publisher/node_modules/qs/LICENSE.md create mode 100644 publisher/node_modules/qs/README.md create mode 100644 publisher/node_modules/qs/dist/qs.js create mode 100644 publisher/node_modules/qs/lib/formats.js create mode 100644 publisher/node_modules/qs/lib/index.js create mode 100644 publisher/node_modules/qs/lib/parse.js create mode 100644 publisher/node_modules/qs/lib/stringify.js create mode 100644 publisher/node_modules/qs/lib/utils.js create mode 100644 publisher/node_modules/qs/package.json create mode 100644 publisher/node_modules/qs/test/empty-keys-cases.js create mode 100644 publisher/node_modules/qs/test/parse.js create mode 100644 publisher/node_modules/qs/test/stringify.js create mode 100644 publisher/node_modules/qs/test/utils.js create mode 100755 publisher/node_modules/queue-microtask/LICENSE create mode 100644 publisher/node_modules/queue-microtask/README.md create mode 100644 publisher/node_modules/queue-microtask/index.d.ts create mode 100644 publisher/node_modules/queue-microtask/index.js create mode 100644 publisher/node_modules/queue-microtask/package.json create mode 100644 publisher/node_modules/readable-stream/CONTRIBUTING.md create mode 100644 publisher/node_modules/readable-stream/GOVERNANCE.md create mode 100644 publisher/node_modules/readable-stream/LICENSE create mode 100644 publisher/node_modules/readable-stream/README.md create mode 100644 publisher/node_modules/readable-stream/errors-browser.js create mode 100644 publisher/node_modules/readable-stream/errors.js create mode 100644 publisher/node_modules/readable-stream/experimentalWarning.js create mode 100644 publisher/node_modules/readable-stream/lib/_stream_duplex.js create mode 100644 publisher/node_modules/readable-stream/lib/_stream_passthrough.js create mode 100644 publisher/node_modules/readable-stream/lib/_stream_readable.js create mode 100644 publisher/node_modules/readable-stream/lib/_stream_transform.js create mode 100644 publisher/node_modules/readable-stream/lib/_stream_writable.js create mode 100644 publisher/node_modules/readable-stream/lib/internal/streams/async_iterator.js create mode 100644 publisher/node_modules/readable-stream/lib/internal/streams/buffer_list.js create mode 100644 publisher/node_modules/readable-stream/lib/internal/streams/destroy.js create mode 100644 publisher/node_modules/readable-stream/lib/internal/streams/end-of-stream.js create mode 100644 publisher/node_modules/readable-stream/lib/internal/streams/from-browser.js create mode 100644 publisher/node_modules/readable-stream/lib/internal/streams/from.js create mode 100644 publisher/node_modules/readable-stream/lib/internal/streams/pipeline.js create mode 100644 publisher/node_modules/readable-stream/lib/internal/streams/state.js create mode 100644 publisher/node_modules/readable-stream/lib/internal/streams/stream-browser.js create mode 100644 publisher/node_modules/readable-stream/lib/internal/streams/stream.js create mode 100644 publisher/node_modules/readable-stream/package.json create mode 100644 publisher/node_modules/readable-stream/readable-browser.js create mode 100644 publisher/node_modules/readable-stream/readable.js create mode 100644 publisher/node_modules/resolve/.editorconfig create mode 100644 publisher/node_modules/resolve/.eslintrc create mode 100644 publisher/node_modules/resolve/.github/FUNDING.yml create mode 100644 publisher/node_modules/resolve/LICENSE create mode 100644 publisher/node_modules/resolve/SECURITY.md create mode 100644 publisher/node_modules/resolve/async.js create mode 100755 publisher/node_modules/resolve/bin/resolve create mode 100644 publisher/node_modules/resolve/example/async.js create mode 100644 publisher/node_modules/resolve/example/sync.js create mode 100644 publisher/node_modules/resolve/index.js create mode 100644 publisher/node_modules/resolve/lib/async.js create mode 100644 publisher/node_modules/resolve/lib/caller.js create mode 100644 publisher/node_modules/resolve/lib/core.js create mode 100644 publisher/node_modules/resolve/lib/core.json create mode 100644 publisher/node_modules/resolve/lib/homedir.js create mode 100644 publisher/node_modules/resolve/lib/is-core.js create mode 100644 publisher/node_modules/resolve/lib/node-modules-paths.js create mode 100644 publisher/node_modules/resolve/lib/normalize-options.js create mode 100644 publisher/node_modules/resolve/lib/sync.js create mode 100644 publisher/node_modules/resolve/package.json create mode 100644 publisher/node_modules/resolve/readme.markdown create mode 100644 publisher/node_modules/resolve/sync.js create mode 100644 publisher/node_modules/resolve/test/core.js create mode 100644 publisher/node_modules/resolve/test/dotdot.js create mode 100644 publisher/node_modules/resolve/test/dotdot/abc/index.js create mode 100644 publisher/node_modules/resolve/test/dotdot/index.js create mode 100644 publisher/node_modules/resolve/test/faulty_basedir.js create mode 100644 publisher/node_modules/resolve/test/filter.js create mode 100644 publisher/node_modules/resolve/test/filter_sync.js create mode 100644 publisher/node_modules/resolve/test/home_paths.js create mode 100644 publisher/node_modules/resolve/test/home_paths_sync.js create mode 100644 publisher/node_modules/resolve/test/mock.js create mode 100644 publisher/node_modules/resolve/test/mock_sync.js create mode 100644 publisher/node_modules/resolve/test/module_dir.js create mode 100644 publisher/node_modules/resolve/test/module_dir/xmodules/aaa/index.js create mode 100644 publisher/node_modules/resolve/test/module_dir/ymodules/aaa/index.js create mode 100644 publisher/node_modules/resolve/test/module_dir/zmodules/bbb/main.js create mode 100644 publisher/node_modules/resolve/test/module_dir/zmodules/bbb/package.json create mode 100644 publisher/node_modules/resolve/test/node-modules-paths.js create mode 100644 publisher/node_modules/resolve/test/node_path.js create mode 100644 publisher/node_modules/resolve/test/node_path/x/aaa/index.js create mode 100644 publisher/node_modules/resolve/test/node_path/x/ccc/index.js create mode 100644 publisher/node_modules/resolve/test/node_path/y/bbb/index.js create mode 100644 publisher/node_modules/resolve/test/node_path/y/ccc/index.js create mode 100644 publisher/node_modules/resolve/test/nonstring.js create mode 100644 publisher/node_modules/resolve/test/pathfilter.js create mode 100644 publisher/node_modules/resolve/test/pathfilter/deep_ref/main.js create mode 100644 publisher/node_modules/resolve/test/precedence.js create mode 100644 publisher/node_modules/resolve/test/precedence/aaa.js create mode 100644 publisher/node_modules/resolve/test/precedence/aaa/index.js create mode 100644 publisher/node_modules/resolve/test/precedence/aaa/main.js create mode 100644 publisher/node_modules/resolve/test/precedence/bbb.js create mode 100644 publisher/node_modules/resolve/test/precedence/bbb/main.js create mode 100644 publisher/node_modules/resolve/test/resolver.js create mode 100644 publisher/node_modules/resolve/test/resolver/baz/doom.js create mode 100644 publisher/node_modules/resolve/test/resolver/baz/package.json create mode 100644 publisher/node_modules/resolve/test/resolver/baz/quux.js create mode 100644 publisher/node_modules/resolve/test/resolver/browser_field/a.js create mode 100644 publisher/node_modules/resolve/test/resolver/browser_field/b.js create mode 100644 publisher/node_modules/resolve/test/resolver/browser_field/package.json create mode 100644 publisher/node_modules/resolve/test/resolver/cup.coffee create mode 100644 publisher/node_modules/resolve/test/resolver/dot_main/index.js create mode 100644 publisher/node_modules/resolve/test/resolver/dot_main/package.json create mode 100644 publisher/node_modules/resolve/test/resolver/dot_slash_main/index.js create mode 100644 publisher/node_modules/resolve/test/resolver/dot_slash_main/package.json create mode 100644 publisher/node_modules/resolve/test/resolver/false_main/index.js create mode 100644 publisher/node_modules/resolve/test/resolver/false_main/package.json create mode 100644 publisher/node_modules/resolve/test/resolver/foo.js create mode 100644 publisher/node_modules/resolve/test/resolver/incorrect_main/index.js create mode 100644 publisher/node_modules/resolve/test/resolver/incorrect_main/package.json create mode 100644 publisher/node_modules/resolve/test/resolver/invalid_main/package.json create mode 100644 publisher/node_modules/resolve/test/resolver/mug.coffee create mode 100644 publisher/node_modules/resolve/test/resolver/mug.js create mode 100644 publisher/node_modules/resolve/test/resolver/multirepo/lerna.json create mode 100644 publisher/node_modules/resolve/test/resolver/multirepo/package.json create mode 100644 publisher/node_modules/resolve/test/resolver/multirepo/packages/package-a/index.js create mode 100644 publisher/node_modules/resolve/test/resolver/multirepo/packages/package-a/package.json create mode 100644 publisher/node_modules/resolve/test/resolver/multirepo/packages/package-b/index.js create mode 100644 publisher/node_modules/resolve/test/resolver/multirepo/packages/package-b/package.json create mode 100644 publisher/node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js create mode 100644 publisher/node_modules/resolve/test/resolver/nested_symlinks/mylib/package.json create mode 100644 publisher/node_modules/resolve/test/resolver/nested_symlinks/mylib/sync.js create mode 100644 publisher/node_modules/resolve/test/resolver/other_path/lib/other-lib.js create mode 100644 publisher/node_modules/resolve/test/resolver/other_path/root.js create mode 100644 publisher/node_modules/resolve/test/resolver/quux/foo/index.js create mode 100644 publisher/node_modules/resolve/test/resolver/same_names/foo.js create mode 100644 publisher/node_modules/resolve/test/resolver/same_names/foo/index.js create mode 100644 publisher/node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js create mode 100644 publisher/node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep create mode 100644 publisher/node_modules/resolve/test/resolver/symlinked/package/bar.js create mode 100644 publisher/node_modules/resolve/test/resolver/symlinked/package/package.json create mode 100644 publisher/node_modules/resolve/test/resolver/without_basedir/main.js create mode 100644 publisher/node_modules/resolve/test/resolver_sync.js create mode 100644 publisher/node_modules/resolve/test/shadowed_core.js create mode 100644 publisher/node_modules/resolve/test/shadowed_core/node_modules/util/index.js create mode 100644 publisher/node_modules/resolve/test/subdirs.js create mode 100644 publisher/node_modules/resolve/test/symlinks.js create mode 100644 publisher/node_modules/reusify/.coveralls.yml create mode 100644 publisher/node_modules/reusify/.travis.yml create mode 100644 publisher/node_modules/reusify/LICENSE create mode 100644 publisher/node_modules/reusify/README.md create mode 100644 publisher/node_modules/reusify/benchmarks/createNoCodeFunction.js create mode 100644 publisher/node_modules/reusify/benchmarks/fib.js create mode 100644 publisher/node_modules/reusify/benchmarks/reuseNoCodeFunction.js create mode 100644 publisher/node_modules/reusify/package.json create mode 100644 publisher/node_modules/reusify/reusify.js create mode 100644 publisher/node_modules/reusify/test.js create mode 100644 publisher/node_modules/run-parallel/LICENSE create mode 100644 publisher/node_modules/run-parallel/README.md create mode 100644 publisher/node_modules/run-parallel/index.js create mode 100644 publisher/node_modules/run-parallel/package.json create mode 100644 publisher/node_modules/safe-buffer/LICENSE create mode 100644 publisher/node_modules/safe-buffer/README.md create mode 100644 publisher/node_modules/safe-buffer/index.d.ts create mode 100644 publisher/node_modules/safe-buffer/index.js create mode 100644 publisher/node_modules/safe-buffer/package.json create mode 100644 publisher/node_modules/safer-buffer/LICENSE create mode 100644 publisher/node_modules/safer-buffer/Porting-Buffer.md create mode 100644 publisher/node_modules/safer-buffer/Readme.md create mode 100644 publisher/node_modules/safer-buffer/dangerous.js create mode 100644 publisher/node_modules/safer-buffer/package.json create mode 100644 publisher/node_modules/safer-buffer/safer.js create mode 100644 publisher/node_modules/safer-buffer/tests.js create mode 100644 publisher/node_modules/semver/LICENSE create mode 100644 publisher/node_modules/semver/README.md create mode 100755 publisher/node_modules/semver/bin/semver.js create mode 100644 publisher/node_modules/semver/classes/comparator.js create mode 100644 publisher/node_modules/semver/classes/index.js create mode 100644 publisher/node_modules/semver/classes/range.js create mode 100644 publisher/node_modules/semver/classes/semver.js create mode 100644 publisher/node_modules/semver/functions/clean.js create mode 100644 publisher/node_modules/semver/functions/cmp.js create mode 100644 publisher/node_modules/semver/functions/coerce.js create mode 100644 publisher/node_modules/semver/functions/compare-build.js create mode 100644 publisher/node_modules/semver/functions/compare-loose.js create mode 100644 publisher/node_modules/semver/functions/compare.js create mode 100644 publisher/node_modules/semver/functions/diff.js create mode 100644 publisher/node_modules/semver/functions/eq.js create mode 100644 publisher/node_modules/semver/functions/gt.js create mode 100644 publisher/node_modules/semver/functions/gte.js create mode 100644 publisher/node_modules/semver/functions/inc.js create mode 100644 publisher/node_modules/semver/functions/lt.js create mode 100644 publisher/node_modules/semver/functions/lte.js create mode 100644 publisher/node_modules/semver/functions/major.js create mode 100644 publisher/node_modules/semver/functions/minor.js create mode 100644 publisher/node_modules/semver/functions/neq.js create mode 100644 publisher/node_modules/semver/functions/parse.js create mode 100644 publisher/node_modules/semver/functions/patch.js create mode 100644 publisher/node_modules/semver/functions/prerelease.js create mode 100644 publisher/node_modules/semver/functions/rcompare.js create mode 100644 publisher/node_modules/semver/functions/rsort.js create mode 100644 publisher/node_modules/semver/functions/satisfies.js create mode 100644 publisher/node_modules/semver/functions/sort.js create mode 100644 publisher/node_modules/semver/functions/valid.js create mode 100644 publisher/node_modules/semver/index.js create mode 100644 publisher/node_modules/semver/internal/constants.js create mode 100644 publisher/node_modules/semver/internal/debug.js create mode 100644 publisher/node_modules/semver/internal/identifiers.js create mode 100644 publisher/node_modules/semver/internal/lrucache.js create mode 100644 publisher/node_modules/semver/internal/parse-options.js create mode 100644 publisher/node_modules/semver/internal/re.js create mode 100644 publisher/node_modules/semver/package.json create mode 100644 publisher/node_modules/semver/preload.js create mode 100644 publisher/node_modules/semver/range.bnf create mode 100644 publisher/node_modules/semver/ranges/gtr.js create mode 100644 publisher/node_modules/semver/ranges/intersects.js create mode 100644 publisher/node_modules/semver/ranges/ltr.js create mode 100644 publisher/node_modules/semver/ranges/max-satisfying.js create mode 100644 publisher/node_modules/semver/ranges/min-satisfying.js create mode 100644 publisher/node_modules/semver/ranges/min-version.js create mode 100644 publisher/node_modules/semver/ranges/outside.js create mode 100644 publisher/node_modules/semver/ranges/simplify.js create mode 100644 publisher/node_modules/semver/ranges/subset.js create mode 100644 publisher/node_modules/semver/ranges/to-comparators.js create mode 100644 publisher/node_modules/semver/ranges/valid.js create mode 100644 publisher/node_modules/set-blocking/CHANGELOG.md create mode 100644 publisher/node_modules/set-blocking/LICENSE.txt create mode 100644 publisher/node_modules/set-blocking/README.md create mode 100644 publisher/node_modules/set-blocking/index.js create mode 100644 publisher/node_modules/set-blocking/package.json create mode 100644 publisher/node_modules/set-function-length/.eslintrc create mode 100644 publisher/node_modules/set-function-length/.github/FUNDING.yml create mode 100644 publisher/node_modules/set-function-length/.nycrc create mode 100644 publisher/node_modules/set-function-length/CHANGELOG.md create mode 100644 publisher/node_modules/set-function-length/LICENSE create mode 100644 publisher/node_modules/set-function-length/README.md create mode 100644 publisher/node_modules/set-function-length/env.d.ts create mode 100644 publisher/node_modules/set-function-length/env.js create mode 100644 publisher/node_modules/set-function-length/index.d.ts create mode 100644 publisher/node_modules/set-function-length/index.js create mode 100644 publisher/node_modules/set-function-length/package.json create mode 100644 publisher/node_modules/set-function-length/tsconfig.json create mode 100644 publisher/node_modules/side-channel/.editorconfig create mode 100644 publisher/node_modules/side-channel/.eslintrc create mode 100644 publisher/node_modules/side-channel/.github/FUNDING.yml create mode 100644 publisher/node_modules/side-channel/.nycrc create mode 100644 publisher/node_modules/side-channel/CHANGELOG.md create mode 100644 publisher/node_modules/side-channel/LICENSE create mode 100644 publisher/node_modules/side-channel/README.md create mode 100644 publisher/node_modules/side-channel/index.d.ts create mode 100644 publisher/node_modules/side-channel/index.js create mode 100644 publisher/node_modules/side-channel/package.json create mode 100644 publisher/node_modules/side-channel/test/index.js create mode 100644 publisher/node_modules/side-channel/tsconfig.json create mode 100644 publisher/node_modules/signal-exit/LICENSE.txt create mode 100644 publisher/node_modules/signal-exit/README.md create mode 100644 publisher/node_modules/signal-exit/index.js create mode 100644 publisher/node_modules/signal-exit/package.json create mode 100644 publisher/node_modules/signal-exit/signals.js create mode 100644 publisher/node_modules/splitargs2/LICENSE create mode 100644 publisher/node_modules/splitargs2/README.md create mode 100644 publisher/node_modules/splitargs2/package.json create mode 100644 publisher/node_modules/splitargs2/splitargs2.d.ts create mode 100644 publisher/node_modules/splitargs2/splitargs2.js create mode 100644 publisher/node_modules/sshpk/.travis.yml create mode 100644 publisher/node_modules/sshpk/Jenkinsfile create mode 100644 publisher/node_modules/sshpk/LICENSE create mode 100644 publisher/node_modules/sshpk/README.md create mode 100755 publisher/node_modules/sshpk/bin/sshpk-conv create mode 100755 publisher/node_modules/sshpk/bin/sshpk-sign create mode 100755 publisher/node_modules/sshpk/bin/sshpk-verify create mode 100644 publisher/node_modules/sshpk/lib/algs.js create mode 100644 publisher/node_modules/sshpk/lib/certificate.js create mode 100644 publisher/node_modules/sshpk/lib/dhe.js create mode 100644 publisher/node_modules/sshpk/lib/ed-compat.js create mode 100644 publisher/node_modules/sshpk/lib/errors.js create mode 100644 publisher/node_modules/sshpk/lib/fingerprint.js create mode 100644 publisher/node_modules/sshpk/lib/formats/auto.js create mode 100644 publisher/node_modules/sshpk/lib/formats/dnssec.js create mode 100644 publisher/node_modules/sshpk/lib/formats/openssh-cert.js create mode 100644 publisher/node_modules/sshpk/lib/formats/pem.js create mode 100644 publisher/node_modules/sshpk/lib/formats/pkcs1.js create mode 100644 publisher/node_modules/sshpk/lib/formats/pkcs8.js create mode 100644 publisher/node_modules/sshpk/lib/formats/putty.js create mode 100644 publisher/node_modules/sshpk/lib/formats/rfc4253.js create mode 100644 publisher/node_modules/sshpk/lib/formats/ssh-private.js create mode 100644 publisher/node_modules/sshpk/lib/formats/ssh.js create mode 100644 publisher/node_modules/sshpk/lib/formats/x509-pem.js create mode 100644 publisher/node_modules/sshpk/lib/formats/x509.js create mode 100644 publisher/node_modules/sshpk/lib/identity.js create mode 100644 publisher/node_modules/sshpk/lib/index.js create mode 100644 publisher/node_modules/sshpk/lib/key.js create mode 100644 publisher/node_modules/sshpk/lib/private-key.js create mode 100644 publisher/node_modules/sshpk/lib/signature.js create mode 100644 publisher/node_modules/sshpk/lib/ssh-buffer.js create mode 100644 publisher/node_modules/sshpk/lib/utils.js create mode 100644 publisher/node_modules/sshpk/man/man1/sshpk-conv.1 create mode 100644 publisher/node_modules/sshpk/man/man1/sshpk-sign.1 create mode 100644 publisher/node_modules/sshpk/man/man1/sshpk-verify.1 create mode 100644 publisher/node_modules/sshpk/package.json create mode 100644 publisher/node_modules/string-width/index.d.ts create mode 100644 publisher/node_modules/string-width/index.js create mode 100644 publisher/node_modules/string-width/license create mode 100644 publisher/node_modules/string-width/package.json create mode 100644 publisher/node_modules/string-width/readme.md create mode 100644 publisher/node_modules/string_decoder/LICENSE create mode 100644 publisher/node_modules/string_decoder/README.md create mode 100644 publisher/node_modules/string_decoder/lib/string_decoder.js create mode 100644 publisher/node_modules/string_decoder/package.json create mode 100644 publisher/node_modules/strip-ansi/index.d.ts create mode 100644 publisher/node_modules/strip-ansi/index.js create mode 100644 publisher/node_modules/strip-ansi/license create mode 100644 publisher/node_modules/strip-ansi/package.json create mode 100644 publisher/node_modules/strip-ansi/readme.md create mode 100644 publisher/node_modules/supports-preserve-symlinks-flag/.eslintrc create mode 100644 publisher/node_modules/supports-preserve-symlinks-flag/.github/FUNDING.yml create mode 100644 publisher/node_modules/supports-preserve-symlinks-flag/.nycrc create mode 100644 publisher/node_modules/supports-preserve-symlinks-flag/CHANGELOG.md create mode 100644 publisher/node_modules/supports-preserve-symlinks-flag/LICENSE create mode 100644 publisher/node_modules/supports-preserve-symlinks-flag/README.md create mode 100644 publisher/node_modules/supports-preserve-symlinks-flag/browser.js create mode 100644 publisher/node_modules/supports-preserve-symlinks-flag/index.js create mode 100644 publisher/node_modules/supports-preserve-symlinks-flag/package.json create mode 100644 publisher/node_modules/supports-preserve-symlinks-flag/test/index.js create mode 100644 publisher/node_modules/tar/LICENSE create mode 100644 publisher/node_modules/tar/README.md create mode 100644 publisher/node_modules/tar/index.js create mode 100644 publisher/node_modules/tar/lib/create.js create mode 100644 publisher/node_modules/tar/lib/extract.js create mode 100644 publisher/node_modules/tar/lib/get-write-flag.js create mode 100644 publisher/node_modules/tar/lib/header.js create mode 100644 publisher/node_modules/tar/lib/high-level-opt.js create mode 100644 publisher/node_modules/tar/lib/large-numbers.js create mode 100644 publisher/node_modules/tar/lib/list.js create mode 100644 publisher/node_modules/tar/lib/mkdir.js create mode 100644 publisher/node_modules/tar/lib/mode-fix.js create mode 100644 publisher/node_modules/tar/lib/normalize-unicode.js create mode 100644 publisher/node_modules/tar/lib/normalize-windows-path.js create mode 100644 publisher/node_modules/tar/lib/pack.js create mode 100644 publisher/node_modules/tar/lib/parse.js create mode 100644 publisher/node_modules/tar/lib/path-reservations.js create mode 100644 publisher/node_modules/tar/lib/pax.js create mode 100644 publisher/node_modules/tar/lib/read-entry.js create mode 100644 publisher/node_modules/tar/lib/replace.js create mode 100644 publisher/node_modules/tar/lib/strip-absolute-path.js create mode 100644 publisher/node_modules/tar/lib/strip-trailing-slashes.js create mode 100644 publisher/node_modules/tar/lib/types.js create mode 100644 publisher/node_modules/tar/lib/unpack.js create mode 100644 publisher/node_modules/tar/lib/update.js create mode 100644 publisher/node_modules/tar/lib/warn-mixin.js create mode 100644 publisher/node_modules/tar/lib/winchars.js create mode 100644 publisher/node_modules/tar/lib/write-entry.js create mode 100644 publisher/node_modules/tar/node_modules/minipass/LICENSE create mode 100644 publisher/node_modules/tar/node_modules/minipass/README.md create mode 100644 publisher/node_modules/tar/node_modules/minipass/index.d.ts create mode 100644 publisher/node_modules/tar/node_modules/minipass/index.js create mode 100644 publisher/node_modules/tar/node_modules/minipass/index.mjs create mode 100644 publisher/node_modules/tar/node_modules/minipass/package.json create mode 100644 publisher/node_modules/tar/package.json create mode 100644 publisher/node_modules/tldts-core/LICENSE create mode 100644 publisher/node_modules/tldts-core/README.md create mode 100644 publisher/node_modules/tldts-core/dist/cjs/index.js create mode 100644 publisher/node_modules/tldts-core/dist/cjs/index.js.map create mode 100644 publisher/node_modules/tldts-core/dist/cjs/src/domain-without-suffix.js create mode 100644 publisher/node_modules/tldts-core/dist/cjs/src/domain-without-suffix.js.map create mode 100644 publisher/node_modules/tldts-core/dist/cjs/src/domain.js create mode 100644 publisher/node_modules/tldts-core/dist/cjs/src/domain.js.map create mode 100644 publisher/node_modules/tldts-core/dist/cjs/src/extract-hostname.js create mode 100644 publisher/node_modules/tldts-core/dist/cjs/src/extract-hostname.js.map create mode 100644 publisher/node_modules/tldts-core/dist/cjs/src/factory.js create mode 100644 publisher/node_modules/tldts-core/dist/cjs/src/factory.js.map create mode 100644 publisher/node_modules/tldts-core/dist/cjs/src/is-ip.js create mode 100644 publisher/node_modules/tldts-core/dist/cjs/src/is-ip.js.map create mode 100644 publisher/node_modules/tldts-core/dist/cjs/src/is-valid.js create mode 100644 publisher/node_modules/tldts-core/dist/cjs/src/is-valid.js.map create mode 100644 publisher/node_modules/tldts-core/dist/cjs/src/lookup/fast-path.js create mode 100644 publisher/node_modules/tldts-core/dist/cjs/src/lookup/fast-path.js.map create mode 100644 publisher/node_modules/tldts-core/dist/cjs/src/lookup/interface.js create mode 100644 publisher/node_modules/tldts-core/dist/cjs/src/lookup/interface.js.map create mode 100644 publisher/node_modules/tldts-core/dist/cjs/src/options.js create mode 100644 publisher/node_modules/tldts-core/dist/cjs/src/options.js.map create mode 100644 publisher/node_modules/tldts-core/dist/cjs/src/subdomain.js create mode 100644 publisher/node_modules/tldts-core/dist/cjs/src/subdomain.js.map create mode 100644 publisher/node_modules/tldts-core/dist/cjs/tsconfig.tsbuildinfo create mode 100644 publisher/node_modules/tldts-core/dist/es6/index.js create mode 100644 publisher/node_modules/tldts-core/dist/es6/index.js.map create mode 100644 publisher/node_modules/tldts-core/dist/es6/src/domain-without-suffix.js create mode 100644 publisher/node_modules/tldts-core/dist/es6/src/domain-without-suffix.js.map create mode 100644 publisher/node_modules/tldts-core/dist/es6/src/domain.js create mode 100644 publisher/node_modules/tldts-core/dist/es6/src/domain.js.map create mode 100644 publisher/node_modules/tldts-core/dist/es6/src/extract-hostname.js create mode 100644 publisher/node_modules/tldts-core/dist/es6/src/extract-hostname.js.map create mode 100644 publisher/node_modules/tldts-core/dist/es6/src/factory.js create mode 100644 publisher/node_modules/tldts-core/dist/es6/src/factory.js.map create mode 100644 publisher/node_modules/tldts-core/dist/es6/src/is-ip.js create mode 100644 publisher/node_modules/tldts-core/dist/es6/src/is-ip.js.map create mode 100644 publisher/node_modules/tldts-core/dist/es6/src/is-valid.js create mode 100644 publisher/node_modules/tldts-core/dist/es6/src/is-valid.js.map create mode 100644 publisher/node_modules/tldts-core/dist/es6/src/lookup/fast-path.js create mode 100644 publisher/node_modules/tldts-core/dist/es6/src/lookup/fast-path.js.map create mode 100644 publisher/node_modules/tldts-core/dist/es6/src/lookup/interface.js create mode 100644 publisher/node_modules/tldts-core/dist/es6/src/lookup/interface.js.map create mode 100644 publisher/node_modules/tldts-core/dist/es6/src/options.js create mode 100644 publisher/node_modules/tldts-core/dist/es6/src/options.js.map create mode 100644 publisher/node_modules/tldts-core/dist/es6/src/subdomain.js create mode 100644 publisher/node_modules/tldts-core/dist/es6/src/subdomain.js.map create mode 100644 publisher/node_modules/tldts-core/dist/es6/tsconfig.bundle.tsbuildinfo create mode 100644 publisher/node_modules/tldts-core/dist/types/index.d.ts create mode 100644 publisher/node_modules/tldts-core/dist/types/src/domain-without-suffix.d.ts create mode 100644 publisher/node_modules/tldts-core/dist/types/src/domain.d.ts create mode 100644 publisher/node_modules/tldts-core/dist/types/src/extract-hostname.d.ts create mode 100644 publisher/node_modules/tldts-core/dist/types/src/factory.d.ts create mode 100644 publisher/node_modules/tldts-core/dist/types/src/is-ip.d.ts create mode 100644 publisher/node_modules/tldts-core/dist/types/src/is-valid.d.ts create mode 100644 publisher/node_modules/tldts-core/dist/types/src/lookup/fast-path.d.ts create mode 100644 publisher/node_modules/tldts-core/dist/types/src/lookup/interface.d.ts create mode 100644 publisher/node_modules/tldts-core/dist/types/src/options.d.ts create mode 100644 publisher/node_modules/tldts-core/dist/types/src/subdomain.d.ts create mode 100644 publisher/node_modules/tldts-core/index.ts create mode 100644 publisher/node_modules/tldts-core/package.json create mode 100644 publisher/node_modules/tldts-core/src/domain-without-suffix.ts create mode 100644 publisher/node_modules/tldts-core/src/domain.ts create mode 100644 publisher/node_modules/tldts-core/src/extract-hostname.ts create mode 100644 publisher/node_modules/tldts-core/src/factory.ts create mode 100644 publisher/node_modules/tldts-core/src/is-ip.ts create mode 100644 publisher/node_modules/tldts-core/src/is-valid.ts create mode 100644 publisher/node_modules/tldts-core/src/lookup/fast-path.ts create mode 100644 publisher/node_modules/tldts-core/src/lookup/interface.ts create mode 100644 publisher/node_modules/tldts-core/src/options.ts create mode 100644 publisher/node_modules/tldts-core/src/subdomain.ts create mode 100644 publisher/node_modules/tldts/LICENSE create mode 100644 publisher/node_modules/tldts/README.md create mode 100755 publisher/node_modules/tldts/bin/cli.js create mode 100644 publisher/node_modules/tldts/dist/cjs/index.js create mode 100644 publisher/node_modules/tldts/dist/cjs/index.js.map create mode 100644 publisher/node_modules/tldts/dist/cjs/src/data/trie.js create mode 100644 publisher/node_modules/tldts/dist/cjs/src/data/trie.js.map create mode 100644 publisher/node_modules/tldts/dist/cjs/src/suffix-trie.js create mode 100644 publisher/node_modules/tldts/dist/cjs/src/suffix-trie.js.map create mode 100644 publisher/node_modules/tldts/dist/cjs/tsconfig.tsbuildinfo create mode 100644 publisher/node_modules/tldts/dist/es6/index.js create mode 100644 publisher/node_modules/tldts/dist/es6/index.js.map create mode 100644 publisher/node_modules/tldts/dist/es6/src/data/trie.js create mode 100644 publisher/node_modules/tldts/dist/es6/src/data/trie.js.map create mode 100644 publisher/node_modules/tldts/dist/es6/src/suffix-trie.js create mode 100644 publisher/node_modules/tldts/dist/es6/src/suffix-trie.js.map create mode 100644 publisher/node_modules/tldts/dist/es6/tsconfig.bundle.tsbuildinfo create mode 100644 publisher/node_modules/tldts/dist/index.cjs.min.js create mode 100644 publisher/node_modules/tldts/dist/index.cjs.min.js.map create mode 100644 publisher/node_modules/tldts/dist/index.esm.min.js create mode 100644 publisher/node_modules/tldts/dist/index.esm.min.js.map create mode 100644 publisher/node_modules/tldts/dist/index.umd.min.js create mode 100644 publisher/node_modules/tldts/dist/index.umd.min.js.map create mode 100644 publisher/node_modules/tldts/dist/types/index.d.ts create mode 100644 publisher/node_modules/tldts/dist/types/src/data/trie.d.ts create mode 100644 publisher/node_modules/tldts/dist/types/src/suffix-trie.d.ts create mode 100644 publisher/node_modules/tldts/index.ts create mode 100644 publisher/node_modules/tldts/package.json create mode 100644 publisher/node_modules/tldts/src/data/trie.ts create mode 100644 publisher/node_modules/tldts/src/suffix-trie.ts create mode 100644 publisher/node_modules/to-regex-range/LICENSE create mode 100644 publisher/node_modules/to-regex-range/README.md create mode 100644 publisher/node_modules/to-regex-range/index.js create mode 100644 publisher/node_modules/to-regex-range/package.json create mode 100644 publisher/node_modules/tough-cookie/LICENSE create mode 100644 publisher/node_modules/tough-cookie/README.md create mode 100644 publisher/node_modules/tough-cookie/dist/cookie/canonicalDomain.d.ts create mode 100644 publisher/node_modules/tough-cookie/dist/cookie/canonicalDomain.js create mode 100644 publisher/node_modules/tough-cookie/dist/cookie/constants.d.ts create mode 100644 publisher/node_modules/tough-cookie/dist/cookie/constants.js create mode 100644 publisher/node_modules/tough-cookie/dist/cookie/cookie.d.ts create mode 100644 publisher/node_modules/tough-cookie/dist/cookie/cookie.js create mode 100644 publisher/node_modules/tough-cookie/dist/cookie/cookieCompare.d.ts create mode 100644 publisher/node_modules/tough-cookie/dist/cookie/cookieCompare.js create mode 100644 publisher/node_modules/tough-cookie/dist/cookie/cookieJar.d.ts create mode 100644 publisher/node_modules/tough-cookie/dist/cookie/cookieJar.js create mode 100644 publisher/node_modules/tough-cookie/dist/cookie/defaultPath.d.ts create mode 100644 publisher/node_modules/tough-cookie/dist/cookie/defaultPath.js create mode 100644 publisher/node_modules/tough-cookie/dist/cookie/domainMatch.d.ts create mode 100644 publisher/node_modules/tough-cookie/dist/cookie/domainMatch.js create mode 100644 publisher/node_modules/tough-cookie/dist/cookie/formatDate.d.ts create mode 100644 publisher/node_modules/tough-cookie/dist/cookie/formatDate.js create mode 100644 publisher/node_modules/tough-cookie/dist/cookie/index.d.ts create mode 100644 publisher/node_modules/tough-cookie/dist/cookie/index.js create mode 100644 publisher/node_modules/tough-cookie/dist/cookie/parseDate.d.ts create mode 100644 publisher/node_modules/tough-cookie/dist/cookie/parseDate.js create mode 100644 publisher/node_modules/tough-cookie/dist/cookie/permutePath.d.ts create mode 100644 publisher/node_modules/tough-cookie/dist/cookie/permutePath.js create mode 100644 publisher/node_modules/tough-cookie/dist/getPublicSuffix.d.ts create mode 100644 publisher/node_modules/tough-cookie/dist/getPublicSuffix.js create mode 100644 publisher/node_modules/tough-cookie/dist/memstore.d.ts create mode 100644 publisher/node_modules/tough-cookie/dist/memstore.js create mode 100644 publisher/node_modules/tough-cookie/dist/pathMatch.d.ts create mode 100644 publisher/node_modules/tough-cookie/dist/pathMatch.js create mode 100644 publisher/node_modules/tough-cookie/dist/permuteDomain.d.ts create mode 100644 publisher/node_modules/tough-cookie/dist/permuteDomain.js create mode 100644 publisher/node_modules/tough-cookie/dist/store.d.ts create mode 100644 publisher/node_modules/tough-cookie/dist/store.js create mode 100644 publisher/node_modules/tough-cookie/dist/utils.d.ts create mode 100644 publisher/node_modules/tough-cookie/dist/utils.js create mode 100644 publisher/node_modules/tough-cookie/dist/validators.d.ts create mode 100644 publisher/node_modules/tough-cookie/dist/validators.js create mode 100644 publisher/node_modules/tough-cookie/dist/version.d.ts create mode 100644 publisher/node_modules/tough-cookie/dist/version.js create mode 100644 publisher/node_modules/tough-cookie/package.json create mode 100644 publisher/node_modules/tunnel-agent/LICENSE create mode 100644 publisher/node_modules/tunnel-agent/README.md create mode 100644 publisher/node_modules/tunnel-agent/index.js create mode 100644 publisher/node_modules/tunnel-agent/package.json create mode 100644 publisher/node_modules/tweetnacl/.npmignore create mode 100644 publisher/node_modules/tweetnacl/AUTHORS.md create mode 100644 publisher/node_modules/tweetnacl/CHANGELOG.md create mode 100644 publisher/node_modules/tweetnacl/LICENSE create mode 100644 publisher/node_modules/tweetnacl/PULL_REQUEST_TEMPLATE.md create mode 100644 publisher/node_modules/tweetnacl/README.md create mode 100644 publisher/node_modules/tweetnacl/nacl-fast.js create mode 100644 publisher/node_modules/tweetnacl/nacl-fast.min.js create mode 100644 publisher/node_modules/tweetnacl/nacl.d.ts create mode 100644 publisher/node_modules/tweetnacl/nacl.js create mode 100644 publisher/node_modules/tweetnacl/nacl.min.js create mode 100644 publisher/node_modules/tweetnacl/package.json create mode 100644 publisher/node_modules/universalify/LICENSE create mode 100644 publisher/node_modules/universalify/README.md create mode 100644 publisher/node_modules/universalify/index.js create mode 100644 publisher/node_modules/universalify/package.json create mode 100644 publisher/node_modules/unzipper/.gitattributes create mode 100644 publisher/node_modules/unzipper/LICENSE create mode 100644 publisher/node_modules/unzipper/README.md create mode 100644 publisher/node_modules/unzipper/eslint.config.mjs create mode 100644 publisher/node_modules/unzipper/lib/BufferStream.js create mode 100644 publisher/node_modules/unzipper/lib/Decrypt.js create mode 100644 publisher/node_modules/unzipper/lib/NoopStream.js create mode 100644 publisher/node_modules/unzipper/lib/Open/directory.js create mode 100644 publisher/node_modules/unzipper/lib/Open/index.js create mode 100644 publisher/node_modules/unzipper/lib/Open/unzip.js create mode 100644 publisher/node_modules/unzipper/lib/PullStream.js create mode 100644 publisher/node_modules/unzipper/lib/extract.js create mode 100644 publisher/node_modules/unzipper/lib/parse.js create mode 100644 publisher/node_modules/unzipper/lib/parseBuffer.js create mode 100644 publisher/node_modules/unzipper/lib/parseDateTime.js create mode 100644 publisher/node_modules/unzipper/lib/parseExtraField.js create mode 100644 publisher/node_modules/unzipper/lib/parseOne.js create mode 100644 publisher/node_modules/unzipper/node_modules/fs-extra/LICENSE create mode 100644 publisher/node_modules/unzipper/node_modules/fs-extra/README.md create mode 100644 publisher/node_modules/unzipper/node_modules/fs-extra/lib/copy/copy-sync.js create mode 100644 publisher/node_modules/unzipper/node_modules/fs-extra/lib/copy/copy.js create mode 100644 publisher/node_modules/unzipper/node_modules/fs-extra/lib/copy/index.js create mode 100644 publisher/node_modules/unzipper/node_modules/fs-extra/lib/empty/index.js create mode 100644 publisher/node_modules/unzipper/node_modules/fs-extra/lib/ensure/file.js create mode 100644 publisher/node_modules/unzipper/node_modules/fs-extra/lib/ensure/index.js create mode 100644 publisher/node_modules/unzipper/node_modules/fs-extra/lib/ensure/link.js create mode 100644 publisher/node_modules/unzipper/node_modules/fs-extra/lib/ensure/symlink-paths.js create mode 100644 publisher/node_modules/unzipper/node_modules/fs-extra/lib/ensure/symlink-type.js create mode 100644 publisher/node_modules/unzipper/node_modules/fs-extra/lib/ensure/symlink.js create mode 100644 publisher/node_modules/unzipper/node_modules/fs-extra/lib/esm.mjs create mode 100644 publisher/node_modules/unzipper/node_modules/fs-extra/lib/fs/index.js create mode 100644 publisher/node_modules/unzipper/node_modules/fs-extra/lib/index.js create mode 100644 publisher/node_modules/unzipper/node_modules/fs-extra/lib/json/index.js create mode 100644 publisher/node_modules/unzipper/node_modules/fs-extra/lib/json/jsonfile.js create mode 100644 publisher/node_modules/unzipper/node_modules/fs-extra/lib/json/output-json-sync.js create mode 100644 publisher/node_modules/unzipper/node_modules/fs-extra/lib/json/output-json.js create mode 100644 publisher/node_modules/unzipper/node_modules/fs-extra/lib/mkdirs/index.js create mode 100644 publisher/node_modules/unzipper/node_modules/fs-extra/lib/mkdirs/make-dir.js create mode 100644 publisher/node_modules/unzipper/node_modules/fs-extra/lib/mkdirs/utils.js create mode 100644 publisher/node_modules/unzipper/node_modules/fs-extra/lib/move/index.js create mode 100644 publisher/node_modules/unzipper/node_modules/fs-extra/lib/move/move-sync.js create mode 100644 publisher/node_modules/unzipper/node_modules/fs-extra/lib/move/move.js create mode 100644 publisher/node_modules/unzipper/node_modules/fs-extra/lib/output-file/index.js create mode 100644 publisher/node_modules/unzipper/node_modules/fs-extra/lib/path-exists/index.js create mode 100644 publisher/node_modules/unzipper/node_modules/fs-extra/lib/remove/index.js create mode 100644 publisher/node_modules/unzipper/node_modules/fs-extra/lib/util/stat.js create mode 100644 publisher/node_modules/unzipper/node_modules/fs-extra/lib/util/utimes.js create mode 100644 publisher/node_modules/unzipper/node_modules/fs-extra/package.json create mode 100644 publisher/node_modules/unzipper/package.json create mode 100644 publisher/node_modules/unzipper/unzip.js create mode 100644 publisher/node_modules/url-join/.travis.yml create mode 100644 publisher/node_modules/url-join/CHANGELOG.md create mode 100644 publisher/node_modules/url-join/LICENSE create mode 100644 publisher/node_modules/url-join/README.md create mode 100755 publisher/node_modules/url-join/bin/changelog create mode 100644 publisher/node_modules/url-join/lib/url-join.js create mode 100644 publisher/node_modules/url-join/package.json create mode 100644 publisher/node_modules/url-join/test/tests.js create mode 100644 publisher/node_modules/util-deprecate/History.md create mode 100644 publisher/node_modules/util-deprecate/LICENSE create mode 100644 publisher/node_modules/util-deprecate/README.md create mode 100644 publisher/node_modules/util-deprecate/browser.js create mode 100644 publisher/node_modules/util-deprecate/node.js create mode 100644 publisher/node_modules/util-deprecate/package.json create mode 100644 publisher/node_modules/uuid/CHANGELOG.md create mode 100644 publisher/node_modules/uuid/CONTRIBUTING.md create mode 100644 publisher/node_modules/uuid/LICENSE.md create mode 100644 publisher/node_modules/uuid/README.md create mode 100755 publisher/node_modules/uuid/dist/bin/uuid create mode 100644 publisher/node_modules/uuid/dist/esm-browser/index.js create mode 100644 publisher/node_modules/uuid/dist/esm-browser/md5.js create mode 100644 publisher/node_modules/uuid/dist/esm-browser/nil.js create mode 100644 publisher/node_modules/uuid/dist/esm-browser/parse.js create mode 100644 publisher/node_modules/uuid/dist/esm-browser/regex.js create mode 100644 publisher/node_modules/uuid/dist/esm-browser/rng.js create mode 100644 publisher/node_modules/uuid/dist/esm-browser/sha1.js create mode 100644 publisher/node_modules/uuid/dist/esm-browser/stringify.js create mode 100644 publisher/node_modules/uuid/dist/esm-browser/v1.js create mode 100644 publisher/node_modules/uuid/dist/esm-browser/v3.js create mode 100644 publisher/node_modules/uuid/dist/esm-browser/v35.js create mode 100644 publisher/node_modules/uuid/dist/esm-browser/v4.js create mode 100644 publisher/node_modules/uuid/dist/esm-browser/v5.js create mode 100644 publisher/node_modules/uuid/dist/esm-browser/validate.js create mode 100644 publisher/node_modules/uuid/dist/esm-browser/version.js create mode 100644 publisher/node_modules/uuid/dist/esm-node/index.js create mode 100644 publisher/node_modules/uuid/dist/esm-node/md5.js create mode 100644 publisher/node_modules/uuid/dist/esm-node/nil.js create mode 100644 publisher/node_modules/uuid/dist/esm-node/parse.js create mode 100644 publisher/node_modules/uuid/dist/esm-node/regex.js create mode 100644 publisher/node_modules/uuid/dist/esm-node/rng.js create mode 100644 publisher/node_modules/uuid/dist/esm-node/sha1.js create mode 100644 publisher/node_modules/uuid/dist/esm-node/stringify.js create mode 100644 publisher/node_modules/uuid/dist/esm-node/v1.js create mode 100644 publisher/node_modules/uuid/dist/esm-node/v3.js create mode 100644 publisher/node_modules/uuid/dist/esm-node/v35.js create mode 100644 publisher/node_modules/uuid/dist/esm-node/v4.js create mode 100644 publisher/node_modules/uuid/dist/esm-node/v5.js create mode 100644 publisher/node_modules/uuid/dist/esm-node/validate.js create mode 100644 publisher/node_modules/uuid/dist/esm-node/version.js create mode 100644 publisher/node_modules/uuid/dist/index.js create mode 100644 publisher/node_modules/uuid/dist/md5-browser.js create mode 100644 publisher/node_modules/uuid/dist/md5.js create mode 100644 publisher/node_modules/uuid/dist/nil.js create mode 100644 publisher/node_modules/uuid/dist/parse.js create mode 100644 publisher/node_modules/uuid/dist/regex.js create mode 100644 publisher/node_modules/uuid/dist/rng-browser.js create mode 100644 publisher/node_modules/uuid/dist/rng.js create mode 100644 publisher/node_modules/uuid/dist/sha1-browser.js create mode 100644 publisher/node_modules/uuid/dist/sha1.js create mode 100644 publisher/node_modules/uuid/dist/stringify.js create mode 100644 publisher/node_modules/uuid/dist/umd/uuid.min.js create mode 100644 publisher/node_modules/uuid/dist/umd/uuidNIL.min.js create mode 100644 publisher/node_modules/uuid/dist/umd/uuidParse.min.js create mode 100644 publisher/node_modules/uuid/dist/umd/uuidStringify.min.js create mode 100644 publisher/node_modules/uuid/dist/umd/uuidValidate.min.js create mode 100644 publisher/node_modules/uuid/dist/umd/uuidVersion.min.js create mode 100644 publisher/node_modules/uuid/dist/umd/uuidv1.min.js create mode 100644 publisher/node_modules/uuid/dist/umd/uuidv3.min.js create mode 100644 publisher/node_modules/uuid/dist/umd/uuidv4.min.js create mode 100644 publisher/node_modules/uuid/dist/umd/uuidv5.min.js create mode 100644 publisher/node_modules/uuid/dist/uuid-bin.js create mode 100644 publisher/node_modules/uuid/dist/v1.js create mode 100644 publisher/node_modules/uuid/dist/v3.js create mode 100644 publisher/node_modules/uuid/dist/v35.js create mode 100644 publisher/node_modules/uuid/dist/v4.js create mode 100644 publisher/node_modules/uuid/dist/v5.js create mode 100644 publisher/node_modules/uuid/dist/validate.js create mode 100644 publisher/node_modules/uuid/dist/version.js create mode 100644 publisher/node_modules/uuid/package.json create mode 100644 publisher/node_modules/uuid/wrapper.mjs create mode 100644 publisher/node_modules/verror/.npmignore create mode 100644 publisher/node_modules/verror/CHANGES.md create mode 100644 publisher/node_modules/verror/CONTRIBUTING.md create mode 100644 publisher/node_modules/verror/LICENSE create mode 100644 publisher/node_modules/verror/README.md create mode 100644 publisher/node_modules/verror/lib/verror.js create mode 100644 publisher/node_modules/verror/package.json create mode 100644 publisher/node_modules/which/CHANGELOG.md create mode 100644 publisher/node_modules/which/LICENSE create mode 100644 publisher/node_modules/which/README.md create mode 100755 publisher/node_modules/which/bin/node-which create mode 100644 publisher/node_modules/which/package.json create mode 100644 publisher/node_modules/which/which.js create mode 100755 publisher/node_modules/wide-align/LICENSE create mode 100755 publisher/node_modules/wide-align/README.md create mode 100755 publisher/node_modules/wide-align/align.js create mode 100755 publisher/node_modules/wide-align/package.json create mode 100644 publisher/node_modules/yallist/LICENSE create mode 100644 publisher/node_modules/yallist/README.md create mode 100644 publisher/node_modules/yallist/iterator.js create mode 100644 publisher/node_modules/yallist/package.json create mode 100644 publisher/node_modules/yallist/yallist.js create mode 100644 publisher/node_modules/zeromq/.mocharc.js create mode 100644 publisher/node_modules/zeromq/CMakeLists.txt create mode 100644 publisher/node_modules/zeromq/LICENSE.txt create mode 100644 publisher/node_modules/zeromq/LICENSE_MPL-2.0.txt create mode 100644 publisher/node_modules/zeromq/README.md create mode 100644 publisher/node_modules/zeromq/build/darwin/arm64/node/115/addon.node create mode 100644 publisher/node_modules/zeromq/build/darwin/x64/node/115/addon.node create mode 100644 publisher/node_modules/zeromq/build/darwin/x64/node/64/addon.node create mode 100644 publisher/node_modules/zeromq/build/linux/x64/node/108/addon.node create mode 100644 publisher/node_modules/zeromq/build/linux/x64/node/115/addon.node create mode 100644 publisher/node_modules/zeromq/build/linux/x64/node/64/addon.node create mode 100644 publisher/node_modules/zeromq/build/win32/ia32/node/115/addon.node create mode 100644 publisher/node_modules/zeromq/build/win32/ia32/node/72/addon.node create mode 100644 publisher/node_modules/zeromq/build/win32/x64/node/115/addon.node create mode 100644 publisher/node_modules/zeromq/build/win32/x64/node/64/addon.node create mode 100644 publisher/node_modules/zeromq/draft.d.ts create mode 100644 publisher/node_modules/zeromq/draft.js create mode 100644 publisher/node_modules/zeromq/lib/compat.d.ts create mode 100644 publisher/node_modules/zeromq/lib/compat.js create mode 100644 publisher/node_modules/zeromq/lib/compat.js.map create mode 100644 publisher/node_modules/zeromq/lib/compat/capabilities.d.ts create mode 100644 publisher/node_modules/zeromq/lib/compat/capabilities.js create mode 100644 publisher/node_modules/zeromq/lib/compat/capabilities.js.map create mode 100644 publisher/node_modules/zeromq/lib/compat/long-options.d.ts create mode 100644 publisher/node_modules/zeromq/lib/compat/long-options.js create mode 100644 publisher/node_modules/zeromq/lib/compat/long-options.js.map create mode 100644 publisher/node_modules/zeromq/lib/compat/poll-states.d.ts create mode 100644 publisher/node_modules/zeromq/lib/compat/poll-states.js create mode 100644 publisher/node_modules/zeromq/lib/compat/poll-states.js.map create mode 100644 publisher/node_modules/zeromq/lib/compat/send-options.d.ts create mode 100644 publisher/node_modules/zeromq/lib/compat/send-options.js create mode 100644 publisher/node_modules/zeromq/lib/compat/send-options.js.map create mode 100644 publisher/node_modules/zeromq/lib/compat/socket-states.d.ts create mode 100644 publisher/node_modules/zeromq/lib/compat/socket-states.js create mode 100644 publisher/node_modules/zeromq/lib/compat/socket-states.js.map create mode 100644 publisher/node_modules/zeromq/lib/compat/types.d.ts create mode 100644 publisher/node_modules/zeromq/lib/compat/types.js create mode 100644 publisher/node_modules/zeromq/lib/compat/types.js.map create mode 100644 publisher/node_modules/zeromq/lib/draft.d.ts create mode 100644 publisher/node_modules/zeromq/lib/draft.js create mode 100644 publisher/node_modules/zeromq/lib/draft.js.map create mode 100644 publisher/node_modules/zeromq/lib/errors.d.ts create mode 100644 publisher/node_modules/zeromq/lib/errors.js create mode 100644 publisher/node_modules/zeromq/lib/errors.js.map create mode 100644 publisher/node_modules/zeromq/lib/index.d.ts create mode 100644 publisher/node_modules/zeromq/lib/index.js create mode 100644 publisher/node_modules/zeromq/lib/index.js.map create mode 100644 publisher/node_modules/zeromq/lib/load-addon.d.ts create mode 100644 publisher/node_modules/zeromq/lib/load-addon.js create mode 100644 publisher/node_modules/zeromq/lib/load-addon.js.map create mode 100644 publisher/node_modules/zeromq/lib/native.d.ts create mode 100644 publisher/node_modules/zeromq/lib/native.js create mode 100644 publisher/node_modules/zeromq/lib/native.js.map create mode 100644 publisher/node_modules/zeromq/lib/ts3.7/compat.d.ts create mode 100644 publisher/node_modules/zeromq/lib/ts3.7/compat/capabilities.d.ts create mode 100644 publisher/node_modules/zeromq/lib/ts3.7/compat/long-options.d.ts create mode 100644 publisher/node_modules/zeromq/lib/ts3.7/compat/poll-states.d.ts create mode 100644 publisher/node_modules/zeromq/lib/ts3.7/compat/send-options.d.ts create mode 100644 publisher/node_modules/zeromq/lib/ts3.7/compat/socket-states.d.ts create mode 100644 publisher/node_modules/zeromq/lib/ts3.7/compat/types.d.ts create mode 100644 publisher/node_modules/zeromq/lib/ts3.7/draft.d.ts create mode 100644 publisher/node_modules/zeromq/lib/ts3.7/errors.d.ts create mode 100644 publisher/node_modules/zeromq/lib/ts3.7/index.d.ts create mode 100644 publisher/node_modules/zeromq/lib/ts3.7/load-addon.d.ts create mode 100644 publisher/node_modules/zeromq/lib/ts3.7/native.d.ts create mode 100644 publisher/node_modules/zeromq/lib/ts3.7/util.d.ts create mode 100644 publisher/node_modules/zeromq/lib/tsconfig.tsbuildinfo create mode 100644 publisher/node_modules/zeromq/lib/util.d.ts create mode 100644 publisher/node_modules/zeromq/lib/util.js create mode 100644 publisher/node_modules/zeromq/lib/util.js.map create mode 100644 publisher/node_modules/zeromq/package.json create mode 100644 publisher/node_modules/zeromq/script/install.js create mode 100644 publisher/node_modules/zeromq/script/macos-arm-deps.sh create mode 100644 publisher/node_modules/zeromq/script/smoke-test.bash create mode 100644 publisher/node_modules/zeromq/script/tsconfig.esm.tsbuildinfo create mode 100644 publisher/node_modules/zeromq/script/tsconfig.tsbuildinfo create mode 100644 publisher/node_modules/zeromq/src/.eslintrc create mode 100644 publisher/node_modules/zeromq/src/closable.h create mode 100644 publisher/node_modules/zeromq/src/compat.ts create mode 100644 publisher/node_modules/zeromq/src/compat/capabilities.ts create mode 100644 publisher/node_modules/zeromq/src/compat/long-options.ts create mode 100644 publisher/node_modules/zeromq/src/compat/poll-states.ts create mode 100644 publisher/node_modules/zeromq/src/compat/send-options.ts create mode 100644 publisher/node_modules/zeromq/src/compat/socket-states.ts create mode 100644 publisher/node_modules/zeromq/src/compat/types.ts create mode 100644 publisher/node_modules/zeromq/src/context.cc create mode 100644 publisher/node_modules/zeromq/src/context.h create mode 100644 publisher/node_modules/zeromq/src/draft.ts create mode 100644 publisher/node_modules/zeromq/src/errors.ts create mode 100644 publisher/node_modules/zeromq/src/incoming_msg.cc create mode 100644 publisher/node_modules/zeromq/src/incoming_msg.h create mode 100644 publisher/node_modules/zeromq/src/index.ts create mode 100644 publisher/node_modules/zeromq/src/inline.h create mode 100644 publisher/node_modules/zeromq/src/load-addon.ts create mode 100644 publisher/node_modules/zeromq/src/module.cc create mode 100644 publisher/node_modules/zeromq/src/module.h create mode 100644 publisher/node_modules/zeromq/src/native.ts create mode 100644 publisher/node_modules/zeromq/src/observer.cc create mode 100644 publisher/node_modules/zeromq/src/observer.h create mode 100644 publisher/node_modules/zeromq/src/outgoing_msg.cc create mode 100644 publisher/node_modules/zeromq/src/outgoing_msg.h create mode 100644 publisher/node_modules/zeromq/src/poller.h create mode 100644 publisher/node_modules/zeromq/src/proxy.cc create mode 100644 publisher/node_modules/zeromq/src/proxy.h create mode 100644 publisher/node_modules/zeromq/src/socket.cc create mode 100644 publisher/node_modules/zeromq/src/socket.h create mode 100644 publisher/node_modules/zeromq/src/tsconfig.json create mode 100644 publisher/node_modules/zeromq/src/util.ts create mode 100644 publisher/node_modules/zeromq/src/util/arguments.h create mode 100644 publisher/node_modules/zeromq/src/util/async_scope.h create mode 100644 publisher/node_modules/zeromq/src/util/electron_helper.h create mode 100644 publisher/node_modules/zeromq/src/util/error.h create mode 100644 publisher/node_modules/zeromq/src/util/object.h create mode 100644 publisher/node_modules/zeromq/src/util/reaper.h create mode 100644 publisher/node_modules/zeromq/src/util/take.h create mode 100644 publisher/node_modules/zeromq/src/util/trash.h create mode 100644 publisher/node_modules/zeromq/src/util/uvdelayed.h create mode 100644 publisher/node_modules/zeromq/src/util/uvhandle.h create mode 100644 publisher/node_modules/zeromq/src/util/uvloop.h create mode 100644 publisher/node_modules/zeromq/src/util/uvwork.h create mode 100644 publisher/node_modules/zeromq/src/win_delay_load_hook.cc create mode 100644 publisher/node_modules/zeromq/src/zmq_inc.h create mode 100644 publisher/node_modules/zeromq/tsconfig.json create mode 100644 publisher/node_modules/zeromq/v5-compat.d.ts create mode 100644 publisher/node_modules/zeromq/v5-compat.js create mode 100644 publisher/node_modules/zeromq/vcpkg.json create mode 100644 publisher/package-lock.json create mode 100644 publisher/package.json create mode 100644 publisher/publisher.js rename src/{config2.rs => appconfig.rs} (80%) delete mode 100644 src/clickhouse.rs delete mode 100644 src/web.rs delete mode 100644 src/webhook.rs create mode 100644 src/xray_op/users.rs create mode 100644 src/zmq.rs create mode 100644 users.json diff --git a/Cargo.lock b/Cargo.lock index 3559f025..96f098a7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,204 +2,6 @@ # It is not intended for manual editing. version = 4 -[[package]] -name = "actix-codec" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f7b0a21988c1bf877cf4759ef5ddaac04c1c9fe808c9142ecb78ba97d97a28a" -dependencies = [ - "bitflags 2.6.0", - "bytes", - "futures-core", - "futures-sink", - "memchr", - "pin-project-lite", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "actix-http" -version = "3.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d48f96fc3003717aeb9856ca3d02a8c7de502667ad76eeacd830b48d2e91fac4" -dependencies = [ - "actix-codec", - "actix-rt", - "actix-service", - "actix-utils", - "ahash", - "base64 0.22.1", - "bitflags 2.6.0", - "brotli", - "bytes", - "bytestring", - "derive_more", - "encoding_rs", - "flate2", - "futures-core", - "h2 0.3.26", - "http 0.2.12", - "httparse", - "httpdate", - "itoa", - "language-tags", - "local-channel", - "mime", - "percent-encoding", - "pin-project-lite", - "rand", - "sha1", - "smallvec", - "tokio", - "tokio-util", - "tracing", - "zstd", -] - -[[package]] -name = "actix-macros" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" -dependencies = [ - "quote", - "syn 2.0.87", -] - -[[package]] -name = "actix-router" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13d324164c51f63867b57e73ba5936ea151b8a41a1d23d1031eeb9f70d0236f8" -dependencies = [ - "bytestring", - "cfg-if", - "http 0.2.12", - "regex", - "regex-lite", - "serde", - "tracing", -] - -[[package]] -name = "actix-rt" -version = "2.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eda4e2a6e042aa4e55ac438a2ae052d3b5da0ecf83d7411e1a368946925208" -dependencies = [ - "futures-core", - "tokio", -] - -[[package]] -name = "actix-server" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ca2549781d8dd6d75c40cf6b6051260a2cc2f3c62343d761a969a0640646894" -dependencies = [ - "actix-rt", - "actix-service", - "actix-utils", - "futures-core", - "futures-util", - "mio", - "socket2", - "tokio", - "tracing", -] - -[[package]] -name = "actix-service" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b894941f818cfdc7ccc4b9e60fa7e53b5042a2e8567270f9147d5591893373a" -dependencies = [ - "futures-core", - "paste", - "pin-project-lite", -] - -[[package]] -name = "actix-utils" -version = "3.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88a1dcdff1466e3c2488e1cb5c36a71822750ad43839937f85d2f4d9f8b705d8" -dependencies = [ - "local-waker", - "pin-project-lite", -] - -[[package]] -name = "actix-web" -version = "4.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9180d76e5cc7ccbc4d60a506f2c727730b154010262df5b910eb17dbe4b8cb38" -dependencies = [ - "actix-codec", - "actix-http", - "actix-macros", - "actix-router", - "actix-rt", - "actix-server", - "actix-service", - "actix-utils", - "actix-web-codegen", - "ahash", - "bytes", - "bytestring", - "cfg-if", - "cookie", - "derive_more", - "encoding_rs", - "futures-core", - "futures-util", - "impl-more", - "itoa", - "language-tags", - "log", - "mime", - "once_cell", - "pin-project-lite", - "regex", - "regex-lite", - "serde", - "serde_json", - "serde_urlencoded", - "smallvec", - "socket2", - "time", - "url", -] - -[[package]] -name = "actix-web-codegen" -version = "4.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f591380e2e68490b5dfaf1dd1aa0ebe78d84ba7067078512b4ea6e4492d622b8" -dependencies = [ - "actix-router", - "proc-macro2", - "quote", - "syn 2.0.87", -] - -[[package]] -name = "actix-web-httpauth" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6dc1123f18b3548b9fe90c15e9bd77819701b047c6b62c152230aa39243d40d" -dependencies = [ - "actix-service", - "actix-utils", - "actix-web", - "base64 0.13.1", - "futures-core", - "futures-util", - "pin-project-lite", -] - [[package]] name = "addr2line" version = "0.24.2" @@ -215,19 +17,6 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" -[[package]] -name = "ahash" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "getrandom", - "once_cell", - "version_check", - "zerocopy", -] - [[package]] name = "aho-corasick" version = "1.1.3" @@ -237,21 +26,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "alloc-no-stdlib" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" - -[[package]] -name = "alloc-stdlib" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" -dependencies = [ - "alloc-no-stdlib", -] - [[package]] name = "android-tzdata" version = "0.1.1" @@ -377,7 +151,7 @@ dependencies = [ "axum-core", "bytes", "futures-util", - "http 1.1.0", + "http", "http-body", "http-body-util", "itoa", @@ -403,7 +177,7 @@ dependencies = [ "async-trait", "bytes", "futures-util", - "http 1.1.0", + "http", "http-body", "http-body-util", "mime", @@ -429,12 +203,6 @@ dependencies = [ "windows-targets", ] -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - [[package]] name = "base64" version = "0.21.7" @@ -471,36 +239,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "brotli" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f7971dbd9326d58187408ab83117d8ac1bb9c17b085fdacd1cf2f598719b6b" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", - "brotli-decompressor", -] - -[[package]] -name = "brotli-decompressor" -version = "4.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a45bd2e4095a8b518033b128020dd4a55aab1c0a381ba4404a472630f4bc362" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", -] - -[[package]] -name = "bstr" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40723b8fb387abc38f4f4a37c09073622e41dd12327033091ef8950659e6dc0c" -dependencies = [ - "memchr", -] - [[package]] name = "bumpalo" version = "3.16.0" @@ -519,15 +257,6 @@ version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" -[[package]] -name = "bytestring" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d80203ea6b29df88012294f62733de21cfeab47f17b41af3a38bc30a03ee72" -dependencies = [ - "bytes", -] - [[package]] name = "cc" version = "1.1.28" @@ -569,12 +298,6 @@ dependencies = [ "windows-targets", ] -[[package]] -name = "cityhash-rs" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93a719913643003b84bd13022b4b7e703c09342cd03b679c4641c7d2e50dc34d" - [[package]] name = "clap" version = "4.5.20" @@ -603,7 +326,7 @@ version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", "syn 2.0.87", @@ -615,43 +338,6 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" -[[package]] -name = "clickhouse" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbbda6a46e0d129d51a808b75e92c209d45313d506dc1734811ca51b4d671f9d" -dependencies = [ - "bstr", - "bytes", - "cityhash-rs", - "clickhouse-derive", - "futures", - "futures-channel", - "http-body-util", - "hyper", - "hyper-util", - "lz4_flex", - "replace_with", - "sealed", - "serde", - "static_assertions", - "thiserror", - "tokio", - "url", -] - -[[package]] -name = "clickhouse-derive" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d70f3e2893f7d3e017eeacdc9a708fbc29a10488e3ebca21f9df6a5d2b616dbb" -dependencies = [ - "proc-macro2", - "quote", - "serde_derive_internals", - "syn 2.0.87", -] - [[package]] name = "colorchoice" version = "1.0.2" @@ -665,7 +351,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7328b20597b53c2454f0b1919720c25c7339051c02b72b7e05409e00b14132be" dependencies = [ "async-trait", - "convert_case 0.6.0", + "convert_case", "json5", "lazy_static", "nom", @@ -698,12 +384,6 @@ dependencies = [ "tiny-keccak", ] -[[package]] -name = "convert_case" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" - [[package]] name = "convert_case" version = "0.6.0" @@ -713,17 +393,6 @@ dependencies = [ "unicode-segmentation", ] -[[package]] -name = "cookie" -version = "0.16.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb" -dependencies = [ - "percent-encoding", - "time", - "version_check", -] - [[package]] name = "core-foundation" version = "0.9.4" @@ -749,15 +418,6 @@ dependencies = [ "libc", ] -[[package]] -name = "crc32fast" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" -dependencies = [ - "cfg-if", -] - [[package]] name = "crossbeam" version = "0.8.4" @@ -839,19 +499,6 @@ dependencies = [ "powerfmt", ] -[[package]] -name = "derive_more" -version = "0.99.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" -dependencies = [ - "convert_case 0.4.0", - "proc-macro2", - "quote", - "rustc_version", - "syn 2.0.87", -] - [[package]] name = "digest" version = "0.10.7" @@ -934,16 +581,6 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" -[[package]] -name = "flate2" -version = "1.0.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - [[package]] name = "fnv" version = "1.0.7" @@ -1090,25 +727,6 @@ version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" -[[package]] -name = "h2" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http 0.2.12", - "indexmap 2.6.0", - "slab", - "tokio", - "tokio-util", - "tracing", -] - [[package]] name = "h2" version = "0.4.6" @@ -1120,7 +738,7 @@ dependencies = [ "fnv", "futures-core", "futures-sink", - "http 1.1.0", + "http", "indexmap 2.6.0", "slab", "tokio", @@ -1146,12 +764,6 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - [[package]] name = "heck" version = "0.5.0" @@ -1164,17 +776,6 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" -[[package]] -name = "http" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - [[package]] name = "http" version = "1.1.0" @@ -1193,7 +794,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", - "http 1.1.0", + "http", ] [[package]] @@ -1204,7 +805,7 @@ checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", "futures-util", - "http 1.1.0", + "http", "http-body", "pin-project-lite", ] @@ -1230,8 +831,8 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.6", - "http 1.1.0", + "h2", + "http", "http-body", "httparse", "httpdate", @@ -1249,7 +850,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", - "http 1.1.0", + "http", "hyper", "hyper-util", "rustls", @@ -1297,7 +898,7 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "http 1.1.0", + "http", "http-body", "hyper", "pin-project-lite", @@ -1340,12 +941,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "impl-more" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e658178c10c747241199382079c0f195ce229866fbf4aa0d46fa6107fe33d2ec" - [[package]] name = "indexmap" version = "1.9.3" @@ -1432,12 +1027,6 @@ dependencies = [ "rayon", ] -[[package]] -name = "language-tags" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4345964bb142484797b161f473a503a434de77149dd8c7427788c6e13379388" - [[package]] name = "lazy_static" version = "1.5.0" @@ -1462,23 +1051,6 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" -[[package]] -name = "local-channel" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6cbc85e69b8df4b8bb8b89ec634e7189099cea8927a276b7384ce5488e53ec8" -dependencies = [ - "futures-core", - "futures-sink", - "local-waker", -] - -[[package]] -name = "local-waker" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d873d7c67ce09b42110d801813efbc9364414e356be9935700d368351657487" - [[package]] name = "lock_api" version = "0.4.12" @@ -1495,12 +1067,6 @@ version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" -[[package]] -name = "lz4_flex" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75761162ae2b0e580d7e7c390558127e5f01b4194debd6221fd8c207fc80e3f5" - [[package]] name = "matchit" version = "0.7.3" @@ -1542,7 +1108,6 @@ checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ "hermit-abi", "libc", - "log", "wasi", "windows-sys 0.52.0", ] @@ -1731,12 +1296,6 @@ dependencies = [ "windows-targets", ] -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - [[package]] name = "pathdiff" version = "0.2.1" @@ -1846,11 +1405,8 @@ checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" name = "pony" version = "0.0.23" dependencies = [ - "actix-web", - "actix-web-httpauth", "chrono", "clap", - "clickhouse", "config", "fern", "futures", @@ -1923,7 +1479,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c1318b19085f08681016926435853bbf7858f9c082d0999b80550ff5d9abe15" dependencies = [ "bytes", - "heck 0.5.0", + "heck", "itertools", "log", "multimap", @@ -2050,24 +1606,12 @@ dependencies = [ "regex-syntax", ] -[[package]] -name = "regex-lite" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53a49587ad06b26609c52e423de037e7f57f20d53535d66e08c695f347df952a" - [[package]] name = "regex-syntax" version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" -[[package]] -name = "replace_with" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3a8614ee435691de62bcffcf4a66d91b3594bf1428a5722e79103249a095690" - [[package]] name = "reqwest" version = "0.12.8" @@ -2079,8 +1623,8 @@ dependencies = [ "encoding_rs", "futures-core", "futures-util", - "h2 0.4.6", - "http 1.1.0", + "h2", + "http", "http-body", "http-body-util", "hyper", @@ -2154,15 +1698,6 @@ version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" -[[package]] -name = "rustc_version" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" -dependencies = [ - "semver", -] - [[package]] name = "rustix" version = "0.38.37" @@ -2251,18 +1786,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "sealed" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4a8caec23b7800fb97971a1c6ae365b6239aaeddfb934d6265f8505e795699d" -dependencies = [ - "heck 0.4.1", - "proc-macro2", - "quote", - "syn 2.0.87", -] - [[package]] name = "security-framework" version = "2.11.1" @@ -2286,12 +1809,6 @@ dependencies = [ "libc", ] -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - [[package]] name = "serde" version = "1.0.210" @@ -2312,17 +1829,6 @@ dependencies = [ "syn 2.0.87", ] -[[package]] -name = "serde_derive_internals" -version = "0.29.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - [[package]] name = "serde_json" version = "1.0.128" @@ -2356,17 +1862,6 @@ dependencies = [ "serde", ] -[[package]] -name = "sha1" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - [[package]] name = "sha2" version = "0.10.8" @@ -2424,12 +1919,6 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - [[package]] name = "strsim" version = "0.11.1" @@ -2521,7 +2010,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" dependencies = [ "cfg-expr", - "heck 0.5.0", + "heck", "pkg-config", "toml 0.8.19", "version-compare", @@ -2573,12 +2062,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", - "itoa", "num-conv", "powerfmt", "serde", "time-core", - "time-macros", ] [[package]] @@ -2587,16 +2074,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" -[[package]] -name = "time-macros" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" -dependencies = [ - "num-conv", - "time-core", -] - [[package]] name = "tiny-keccak" version = "2.0.2" @@ -2765,8 +2242,8 @@ dependencies = [ "axum", "base64 0.22.1", "bytes", - "h2 0.4.6", - "http 1.1.0", + "h2", + "http", "http-body", "http-body-util", "hyper", @@ -2850,7 +2327,6 @@ version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -3354,31 +2830,3 @@ dependencies = [ "system-deps", "zeromq-src", ] - -[[package]] -name = "zstd" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcf2b778a664581e31e389454a7072dab1647606d44f7feea22cd5abb9c9f3f9" -dependencies = [ - "zstd-safe", -] - -[[package]] -name = "zstd-safe" -version = "7.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54a3ab4db68cea366acc5c897c7b4d4d1b8994a9cd6e6f841f8964566a419059" -dependencies = [ - "zstd-sys", -] - -[[package]] -name = "zstd-sys" -version = "2.0.13+zstd.1.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" -dependencies = [ - "cc", - "pkg-config", -] diff --git a/Cargo.toml b/Cargo.toml index c6e0260a..d474c00f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,9 +18,6 @@ chrono = "0.4" reqwest = "0.12" toml = "0.7" futures = "0.3" -actix-web = "4" -actix-web-httpauth = "0.7" -clickhouse = "0.13.0" clap = { version = "4.0", features = ["derive"] } time = "0.3" tonic = "0.12" diff --git a/publisher/node_modules/.bin/cmake-ts b/publisher/node_modules/.bin/cmake-ts new file mode 120000 index 00000000..7510d2bd --- /dev/null +++ b/publisher/node_modules/.bin/cmake-ts @@ -0,0 +1 @@ +../@aminya/cmake-ts/build/main.js \ No newline at end of file diff --git a/publisher/node_modules/.bin/color-support b/publisher/node_modules/.bin/color-support new file mode 120000 index 00000000..fcbcb286 --- /dev/null +++ b/publisher/node_modules/.bin/color-support @@ -0,0 +1 @@ +../color-support/bin.js \ No newline at end of file diff --git a/publisher/node_modules/.bin/mkdirp b/publisher/node_modules/.bin/mkdirp new file mode 120000 index 00000000..017896ce --- /dev/null +++ b/publisher/node_modules/.bin/mkdirp @@ -0,0 +1 @@ +../mkdirp/bin/cmd.js \ No newline at end of file diff --git a/publisher/node_modules/.bin/node-which b/publisher/node_modules/.bin/node-which new file mode 120000 index 00000000..6f8415ec --- /dev/null +++ b/publisher/node_modules/.bin/node-which @@ -0,0 +1 @@ +../which/bin/node-which \ No newline at end of file diff --git a/publisher/node_modules/.bin/resolve b/publisher/node_modules/.bin/resolve new file mode 120000 index 00000000..b6afda6c --- /dev/null +++ b/publisher/node_modules/.bin/resolve @@ -0,0 +1 @@ +../resolve/bin/resolve \ No newline at end of file diff --git a/publisher/node_modules/.bin/semver b/publisher/node_modules/.bin/semver new file mode 120000 index 00000000..5aaadf42 --- /dev/null +++ b/publisher/node_modules/.bin/semver @@ -0,0 +1 @@ +../semver/bin/semver.js \ No newline at end of file diff --git a/publisher/node_modules/.bin/sshpk-conv b/publisher/node_modules/.bin/sshpk-conv new file mode 120000 index 00000000..a2a295c8 --- /dev/null +++ b/publisher/node_modules/.bin/sshpk-conv @@ -0,0 +1 @@ +../sshpk/bin/sshpk-conv \ No newline at end of file diff --git a/publisher/node_modules/.bin/sshpk-sign b/publisher/node_modules/.bin/sshpk-sign new file mode 120000 index 00000000..766b9b3a --- /dev/null +++ b/publisher/node_modules/.bin/sshpk-sign @@ -0,0 +1 @@ +../sshpk/bin/sshpk-sign \ No newline at end of file diff --git a/publisher/node_modules/.bin/sshpk-verify b/publisher/node_modules/.bin/sshpk-verify new file mode 120000 index 00000000..bfd7e3ad --- /dev/null +++ b/publisher/node_modules/.bin/sshpk-verify @@ -0,0 +1 @@ +../sshpk/bin/sshpk-verify \ No newline at end of file diff --git a/publisher/node_modules/.bin/tldts b/publisher/node_modules/.bin/tldts new file mode 120000 index 00000000..85001241 --- /dev/null +++ b/publisher/node_modules/.bin/tldts @@ -0,0 +1 @@ +../tldts/bin/cli.js \ No newline at end of file diff --git a/publisher/node_modules/.bin/uuid b/publisher/node_modules/.bin/uuid new file mode 120000 index 00000000..588f70ec --- /dev/null +++ b/publisher/node_modules/.bin/uuid @@ -0,0 +1 @@ +../uuid/dist/bin/uuid \ No newline at end of file diff --git a/publisher/node_modules/.package-lock.json b/publisher/node_modules/.package-lock.json new file mode 100644 index 00000000..98a108d5 --- /dev/null +++ b/publisher/node_modules/.package-lock.json @@ -0,0 +1,1395 @@ +{ + "name": "publisher", + "lockfileVersion": 3, + "requires": true, + "packages": { + "node_modules/@aminya/cmake-ts": { + "version": "0.3.0-aminya.7", + "resolved": "https://registry.npmjs.org/@aminya/cmake-ts/-/cmake-ts-0.3.0-aminya.7.tgz", + "integrity": "sha512-y6a2Nq1Pj+3Y0tOLob2q0LbCB4cGIbcXJqDO10W51XpqUdB30OU0Xvl6ZDHFluHm/8nY5Vx/Ua9mxobG975//Q==", + "license": "MIT", + "dependencies": { + "@cypress/request": "^3.0.5", + "fast-glob": "^3.3.2", + "fs-extra": "^10", + "lodash": "^4.17.21", + "memory-stream": "1.0.0", + "minizlib": "^2", + "npmlog": "^6", + "resolve": "^1.22.8", + "semver": "^7.6.3", + "splitargs2": "^0.1.3", + "tar": "^6", + "unzipper": "^0.12.3", + "url-join": "^4.0.1", + "which": "^2" + }, + "bin": { + "cmake-ts": "build/main.js" + } + }, + "node_modules/@cypress/request": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@cypress/request/-/request-3.0.6.tgz", + "integrity": "sha512-fi0eVdCOtKu5Ed6+E8mYxUF6ZTFJDZvHogCBelM0xVXmrDEkyM22gRArQzq1YcHPm1V47Vf/iAD+WgVdUlJCGg==", + "license": "Apache-2.0", + "dependencies": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~4.0.0", + "http-signature": "~1.4.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "performance-now": "^2.1.0", + "qs": "6.13.0", + "safe-buffer": "^5.1.2", + "tough-cookie": "^5.0.0", + "tunnel-agent": "^0.6.0", + "uuid": "^8.3.2" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/aproba": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", + "license": "ISC" + }, + "node_modules/are-we-there-yet": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz", + "integrity": "sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/asn1": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", + "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", + "license": "MIT", + "dependencies": { + "safer-buffer": "~2.1.0" + } + }, + "node_modules/assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", + "license": "MIT", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" + }, + "node_modules/aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", + "license": "Apache-2.0", + "engines": { + "node": "*" + } + }, + "node_modules/aws4": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.13.2.tgz", + "integrity": "sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw==", + "license": "MIT" + }, + "node_modules/bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", + "license": "BSD-3-Clause", + "dependencies": { + "tweetnacl": "^0.14.3" + } + }, + "node_modules/bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", + "license": "MIT" + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", + "license": "Apache-2.0" + }, + "node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "license": "ISC", + "bin": { + "color-support": "bin.js" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", + "license": "ISC" + }, + "node_modules/core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", + "license": "MIT" + }, + "node_modules/dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", + "license": "MIT", + "dependencies": { + "assert-plus": "^1.0.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", + "license": "MIT" + }, + "node_modules/duplexer2": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", + "integrity": "sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==", + "license": "BSD-3-Clause", + "dependencies": { + "readable-stream": "^2.0.2" + } + }, + "node_modules/duplexer2/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/duplexer2/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "license": "MIT" + }, + "node_modules/duplexer2/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", + "license": "MIT", + "dependencies": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "license": "MIT" + }, + "node_modules/extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", + "engines": [ + "node >=0.6.0" + ], + "license": "MIT" + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", + "license": "Apache-2.0", + "engines": { + "node": "*" + } + }, + "node_modules/form-data": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", + "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gauge": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", + "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "dependencies": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.3", + "console-control-strings": "^1.1.0", + "has-unicode": "^2.0.1", + "signal-exit": "^3.0.7", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.5" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", + "license": "MIT", + "dependencies": { + "assert-plus": "^1.0.0" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "license": "ISC" + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", + "license": "ISC" + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/http-signature": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.4.0.tgz", + "integrity": "sha512-G5akfn7eKbpDN+8nPS/cb57YeA1jLTVxjpCj7tmm3QKPdyDy7T+qSC40e9ptydSWvkwjSXw1VbkpyEm39ukeAg==", + "license": "MIT", + "dependencies": { + "assert-plus": "^1.0.0", + "jsprim": "^2.0.2", + "sshpk": "^1.18.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/is-core-module": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", + "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", + "license": "MIT" + }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "license": "MIT" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "license": "ISC" + }, + "node_modules/isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", + "license": "MIT" + }, + "node_modules/jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", + "license": "MIT" + }, + "node_modules/json-schema": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", + "license": "(AFL-2.1 OR BSD-3-Clause)" + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "license": "ISC" + }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "license": "MIT", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/jsprim": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-2.0.2.tgz", + "integrity": "sha512-gqXddjPqQ6G40VdnI6T6yObEC+pDNvyP95wdQhkWkg7crHH3km5qP1FsOXEkzEQwnz6gz5qGTn1c2Y52wP3OyQ==", + "engines": [ + "node >=0.6.0" + ], + "license": "MIT", + "dependencies": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.4.0", + "verror": "1.10.0" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "license": "MIT" + }, + "node_modules/memory-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/memory-stream/-/memory-stream-1.0.0.tgz", + "integrity": "sha512-Wm13VcsPIMdG96dzILfij09PvuS3APtcKNh7M28FsCA/w6+1mjR7hhPmfFNoilX9xU7wTdhsH5lJAm6XNzdtww==", + "license": "MIT", + "dependencies": { + "readable-stream": "^3.4.0" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "license": "MIT", + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "license": "MIT", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-addon-api": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-8.2.2.tgz", + "integrity": "sha512-9emqXAKhVoNrQ792nLI/wpzPpJ/bj/YXxW0CvAau1+RdGBcCRF1Dmz7719zgVsQNrzHl9Tzn3ImZ4qWFarWL0A==", + "license": "MIT", + "engines": { + "node": "^18 || ^20 || >= 21" + } + }, + "node_modules/node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", + "license": "MIT" + }, + "node_modules/npmlog": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", + "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "dependencies": { + "are-we-there-yet": "^3.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^4.0.3", + "set-blocking": "^2.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", + "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "license": "MIT" + }, + "node_modules/performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", + "license": "MIT" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "license": "MIT" + }, + "node_modules/qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "license": "MIT", + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "license": "ISC" + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "license": "ISC" + }, + "node_modules/splitargs2": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/splitargs2/-/splitargs2-0.1.3.tgz", + "integrity": "sha512-7Lt7+Z0YwyhFCbhkXMI3AT5qLcH6rKZgWnmlk0+R4ObjqhTZ3kGB4VMTerMuTmMayJnAuDHYTSomAYtlYq0vbg==", + "license": "ISC" + }, + "node_modules/sshpk": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", + "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", + "license": "MIT", + "dependencies": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + }, + "bin": { + "sshpk-conv": "bin/sshpk-conv", + "sshpk-sign": "bin/sshpk-sign", + "sshpk-verify": "bin/sshpk-verify" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/tar": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", + "license": "ISC", + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/tar/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "license": "ISC", + "engines": { + "node": ">=8" + } + }, + "node_modules/tldts": { + "version": "6.1.64", + "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.64.tgz", + "integrity": "sha512-ph4AE5BXWIOsSy9stpoeo7bYe/Cy7VfpciIH4RhVZUPItCJmhqWCN0EVzxd8BOHiyNb42vuJc6NWTjJkg91Tuw==", + "license": "MIT", + "dependencies": { + "tldts-core": "^6.1.64" + }, + "bin": { + "tldts": "bin/cli.js" + } + }, + "node_modules/tldts-core": { + "version": "6.1.64", + "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.64.tgz", + "integrity": "sha512-uqnl8vGV16KsyflHOzqrYjjArjfXaU6rMPXYy2/ZWoRKCkXtghgB4VwTDXUG+t0OTGeSewNAG31/x1gCTfLt+Q==", + "license": "MIT" + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tough-cookie": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-5.0.0.tgz", + "integrity": "sha512-FRKsF7cz96xIIeMZ82ehjC3xW2E+O2+v11udrDYewUbszngYhsGa8z6YUMMzO9QJZzzyd0nGGXnML/TReX6W8Q==", + "license": "BSD-3-Clause", + "dependencies": { + "tldts": "^6.1.32" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, + "node_modules/tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", + "license": "Unlicense" + }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/unzipper": { + "version": "0.12.3", + "resolved": "https://registry.npmjs.org/unzipper/-/unzipper-0.12.3.tgz", + "integrity": "sha512-PZ8hTS+AqcGxsaQntl3IRBw65QrBI6lxzqDEL7IAo/XCEqRTKGfOX56Vea5TH9SZczRVxuzk1re04z/YjuYCJA==", + "license": "MIT", + "dependencies": { + "bluebird": "~3.7.2", + "duplexer2": "~0.1.4", + "fs-extra": "^11.2.0", + "graceful-fs": "^4.2.2", + "node-int64": "^0.4.0" + } + }, + "node_modules/unzipper/node_modules/fs-extra": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", + "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, + "node_modules/url-join": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/url-join/-/url-join-4.0.1.tgz", + "integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==", + "license": "MIT" + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "license": "MIT" + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", + "engines": [ + "node >=0.6.0" + ], + "license": "MIT", + "dependencies": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "license": "ISC", + "dependencies": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC" + }, + "node_modules/zeromq": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/zeromq/-/zeromq-6.1.2.tgz", + "integrity": "sha512-5lqsW2UXnKhFhBbIm0wzrRnZmWaGI2b2bm4E03rYMK1c1jBMN0wbPnuyqqhGg7QkzBUmpqf+LyjLhg2TRJmvow==", + "hasInstallScript": true, + "license": "MIT AND MPL-2.0", + "dependencies": { + "@aminya/cmake-ts": "^0.3.0-aminya.7", + "node-addon-api": "^8.2.1" + }, + "engines": { + "node": ">= 10", + "pnpm": ">= 9" + } + } + } +} diff --git a/publisher/node_modules/@aminya/cmake-ts/README.md b/publisher/node_modules/@aminya/cmake-ts/README.md new file mode 100644 index 00000000..becab3aa --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/README.md @@ -0,0 +1,75 @@ +# cmake-ts + +A CMake-based build system for native NodeJS and Electron addons. + +This project is loosely inspired by [cmake-js](https://github.com/cmake-js/cmake-js) but attempts to fix several design flaws. + +It is intended to prebuild addons for different versions of NodeJS and Electron and ship a binary version. + +## Configuration + +Configuration is done entirely via `package.json`. You can specify multiple build configurations under the `cmake-ts` key: + +```js +"cmake-ts": { + "nodeAPI": "node-addon-api" // Specify the node API package such as `node-addon-api`, `nan`, or the path to a directory that has the nodeAPI header. Default is `node-addon-api`, a warning is emitted if nan is used + "configurations": [ + { + "name": "win-x64", // name for named-configs mode + "os": "win32", // win32, linux and darwin are supported + "arch": "x64", // x64, x86 should work + "runtime": "electron", // node or electron + "runtimeVersion": "4.0.1", // Version of the runtime which it is built + "toolchainFile": "/windows.cmake", // CMake Toolchain file to use for crosscompiling + "CMakeOptions": [ //Same syntax as for the globalCMakeOptions + { + "name": "MY_CMAKE_OPTION", + "value": "my_value", + } + ], + "addonSubdirectory": "avx2-generic" // if you build addons for multiple architectures in high performance scenarios, you can put the addon inside another subdirectory + }, // more build configurations... + { + "dev": true, // whether this configuration is eligible to be used in a dev test build + "os": "linux", // win32, linux and darwin are supported + "arch": "x64", // x64, x86 should work + "runtime": "node", // node or electron + "runtimeVersion": "10.3.0", // Version of the runtime which it is built + } // more build configurations ... + ], + "targetDirectory": "build", // where to build your project + "buildType": "Release", // Debug or Release build, most likely set it to Release + "projectName": "addon" // The name of your CMake project. + "globalCMakeOptions": [{ // this might be omitted of no further options should be passed to CMake + "name": "CMAKE_CXX_FLAGS", + "value": "-Og" + }, { + "name": "CMAKE_CXX_FLAGS", + "value": "-I$ROOT$/include", // $ROOT$ will be replaced by the package.json directory + }, { + "name": "CMAKE_EXPORT_COMPILE_COMMANDS", + "value": "1" + }] +} +``` + +## Workflow + +While it is desirable to perform a full build (all configurations) within a CI environment, long build times hinder local package development. Therefore cmake-ts knows multiple build modes: + +- **TODO** `nativeonly` -> Builds the native code **only** for the runtime cmake-ts is currently running on, ignoring all previously specified configurations. This is useful if you'd like to run some unit tests against the compiled code. When running `cmake-ts nativeonly`, cmake-ts will determine the runtime, ABI, and platform from the environment, and build only the configuration required to run on this platform. + - *Example using the configuration above* + - You run `cmake-ts nativeonly` on **NodeJS 11.7 on MacOS**, `cmake-ts` will **ignore** all specified configurations above and build the native addon for **NodeJS 11.7 on MacOS** +- **TODO** `osonly` -> Builds the native code for all configurations which match the current operating system. This is useful for those developing for example an electron addon and want to test their code in electron. In such a case, you would specify electron and NodeJS runtimes for several platforms in your configuration and you can use `cmake-ts osonly` to build a local package you can install in your application. + - *Example using the configuration above* + - You run `cmake-ts osonly` on **NodeJS 11.7 on Linux**, `cmake-ts` will **ignore** all configurations above where `os != linux` and build the native addon for **all** remaining configurations, in this case it will build for **NodeJS 10.3 on Linux**. +- **TODO** **HINT**: For both `osonly` and `nativeonly`, the specified CMake Toolchain files are ignored since I assume you got your toolchain set up correctly for your **own** operating system. +- None / Omitted: Builds all configs +- `dev-os-only` builds the first config that has `dev == true` and `os` matches the current OS +- `named-configs arg1 arg2 ...` builds all configs for which `name` is one of the args + +## Cross Compilation + +This module supports cross-compilation from Linux to macOS and Windows, given a correct toolchain setup. There is a docker container that has a cross-toolchain based on CLang 7 setup for Windows and macOS which might be used in a CI. + +[Docker Image](https://hub.docker.com/r/martin31821/crossdev) diff --git a/publisher/node_modules/@aminya/cmake-ts/build/argumentBuilder.d.ts b/publisher/node_modules/@aminya/cmake-ts/build/argumentBuilder.d.ts new file mode 100644 index 00000000..4e986e5a --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/argumentBuilder.d.ts @@ -0,0 +1,12 @@ +import { BuildConfigurationDefaulted, BuildOptionsDefaulted } from './lib'; +import { RuntimeDistribution } from './runtimeDistribution'; +export declare class ArgumentBuilder { + private config; + private options; + private rtd; + constructor(config: BuildConfigurationDefaulted, options: BuildOptionsDefaulted, rtd: RuntimeDistribution); + buildCmakeCommandLine(): Promise; + buildGeneratorCommandLine(stagingDir: string): string; + buildDefines(): Promise<[string, string][]>; +} +//# sourceMappingURL=argumentBuilder.d.ts.map \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/argumentBuilder.d.ts.map b/publisher/node_modules/@aminya/cmake-ts/build/argumentBuilder.d.ts.map new file mode 100644 index 00000000..39a7c55b --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/argumentBuilder.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"argumentBuilder.d.ts","sourceRoot":"","sources":["../src/argumentBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAK5D,qBAAa,eAAe;IAMb,OAAO,CAAC,MAAM;IAA+B,OAAO,CAAC,OAAO;IAAyB,OAAO,CAAC,GAAG;gBAAxF,MAAM,EAAE,2BAA2B,EAAU,OAAO,EAAE,qBAAqB,EAAU,GAAG,EAAE,mBAAmB;IAK5H,qBAAqB,IAAI,OAAO,CAAC,MAAM,CAAC;IAW9C,yBAAyB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAI/C,YAAY,IAAI,OAAO,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;CAyElD"} \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/argumentBuilder.js b/publisher/node_modules/@aminya/cmake-ts/build/argumentBuilder.js new file mode 100644 index 00000000..3570969a --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/argumentBuilder.js @@ -0,0 +1,116 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ArgumentBuilder = void 0; +const path_1 = require("path"); +const URL_REGISTRY = __importStar(require("./urlRegistry")); +const nodeAPIInclude_1 = require("./nodeAPIInclude"); +class ArgumentBuilder { + constructor(config, options, rtd) { + this.config = config; + this.options = options; + this.rtd = rtd; + } + buildCmakeCommandLine() { + return __awaiter(this, void 0, void 0, function* () { + let baseCommand = `"${this.options.cmakeToUse}" "${this.options.packageDirectory}" --no-warn-unused-cli`; + const defines = yield this.buildDefines(); + baseCommand += ` ${defines.map(d => `-D${d[0]}="${d[1]}"`).join(" ")}`; + if (this.options.generatorToUse !== 'native') { + baseCommand += ` -G"${this.options.generatorToUse}"`; + } + console.log(baseCommand); + return baseCommand; + }); + } + buildGeneratorCommandLine(stagingDir) { + return `"${this.options.cmakeToUse}" --build "${stagingDir}" --config "${this.options.buildType}"`; + } + buildDefines() { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b; + const pathConfig = URL_REGISTRY.getPathsForConfig(this.config); + const retVal = []; + retVal.push(['CMAKE_BUILD_TYPE', this.options.buildType]); + if (this.config.toolchainFile) { + retVal.push(['CMAKE_TOOLCHAIN_FILE', (0, path_1.resolve)(this.config.toolchainFile)]); + } + if (this.config.os === 'win32') { + const libs = this.rtd.winLibs; + if (libs === null || libs === void 0 ? void 0 : libs.length) { + retVal.push(['CMAKE_JS_LIB', libs.join(';')]); + } + } + else if (this.config.os === 'darwin') { + retVal.push(['CMAKE_JS_CXX_FLAGS', `-undefined dynamic_lookup`]); + } + const includes = []; + if (pathConfig.headerOnly) { + includes.push((0, path_1.join)(this.rtd.internalPath, '/include/node')); + } + else { + includes.push((0, path_1.join)(this.rtd.internalPath, '/src'), (0, path_1.join)(this.rtd.internalPath, '/deps/v8/include'), (0, path_1.join)(this.rtd.internalPath, '/deps/uv/include')); + } + if ((_a = this.options.nodeAPI) === null || _a === void 0 ? void 0 : _a.includes('nan')) { + console.warn(`WARNING: specified nodeAPI ${this.options.nodeAPI} seems to be nan - The usage of nan is discouraged due to subtle and hard-to-fix ABI issues! Consider using node-addon-api / N-API instead!`); + } + if (!this.options.nodeAPI) { + console.warn('WARNING: nodeAPI was not specified. The default changed from "nan" to "node-addon-api" in v0.3.0! Please make sure this is intended.'); + } + const nodeApiInclude = yield (0, nodeAPIInclude_1.getNodeApiInclude)(this.options.packageDirectory, (_b = this.options.nodeAPI) !== null && _b !== void 0 ? _b : "node-addon-api"); + if (this.options.nodeAPI && !nodeApiInclude) { + console.log(`WARNING: nodeAPI was specified, but module "${this.options.nodeAPI}" could not be found!`); + } + if (nodeApiInclude) { + includes.push(nodeApiInclude); + } + retVal.push(['CMAKE_JS_INC', includes.join(';')]); + retVal.push(['NODE_RUNTIME', this.config.runtime], ['NODE_ARCH', this.config.arch], ['NODE_PLATFORM', this.config.os], ['NODE_RUNTIMEVERSION', this.config.runtimeVersion], ['NODE_ABI_VERSION', `${this.rtd.abi}`]); + retVal.push(['CMAKE_JS_DEFINES', this.config.additionalDefines.join(';')]); + if (this.options.globalCMakeOptions && this.options.globalCMakeOptions.length > 0) { + this.options.globalCMakeOptions.forEach(j => { + retVal.push([j.name, j.value.replace(/\$ROOT\$/g, (0, path_1.resolve)(this.options.packageDirectory))]); + }); + } + if (this.config.CMakeOptions && this.config.CMakeOptions.length > 0) { + this.config.CMakeOptions.forEach(j => { + retVal.push([j.name, j.value.replace(/\$ROOT\$/g, (0, path_1.resolve)(this.options.packageDirectory))]); + }); + } + return retVal; + }); + } +} +exports.ArgumentBuilder = ArgumentBuilder; +//# sourceMappingURL=argumentBuilder.js.map \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/argumentBuilder.js.map b/publisher/node_modules/@aminya/cmake-ts/build/argumentBuilder.js.map new file mode 100644 index 00000000..5dc1470a --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/argumentBuilder.js.map @@ -0,0 +1 @@ +{"version":3,"file":"argumentBuilder.js","sourceRoot":"","sources":["../src/argumentBuilder.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,+BAAqC;AACrC,4DAA8C;AAC9C,qDAAqD;AAErD,MAAa,eAAe;IAM1B,YAAqB,MAAmC,EAAU,OAA8B,EAAU,GAAwB;QAA7G,WAAM,GAAN,MAAM,CAA6B;QAAU,YAAO,GAAP,OAAO,CAAuB;QAAU,QAAG,GAAH,GAAG,CAAqB;IAGlI,CAAC;IAEK,qBAAqB;;YACzB,IAAI,WAAW,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,MAAM,IAAI,CAAC,OAAO,CAAC,gBAAgB,wBAAwB,CAAC;YACzG,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;YAC1C,WAAW,IAAI,IAAK,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YACxE,IAAI,IAAI,CAAC,OAAO,CAAC,cAAc,KAAK,QAAQ,EAAE,CAAC;gBAC7C,WAAW,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,GAAG,CAAC;YACvD,CAAC;YACD,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;YACxB,OAAO,WAAW,CAAC;QACrB,CAAC;KAAA;IAED,yBAAyB,CAAC,UAAkB;QAC1C,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,cAAc,UAAU,eAAe,IAAI,CAAC,OAAO,CAAC,SAAS,GAAG,CAAC;IACrG,CAAC;IAEK,YAAY;;;YAChB,MAAM,UAAU,GAAG,YAAY,CAAC,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAC/D,MAAM,MAAM,GAAuB,EAAE,CAAC;YACtC,MAAM,CAAC,IAAI,CAAC,CAAC,kBAAkB,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;YAE1D,IAAI,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC;gBAC9B,MAAM,CAAC,IAAI,CAAC,CAAC,sBAAsB,EAAE,IAAA,cAAO,EAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;YAC5E,CAAC;YAGD,IAAI,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,OAAO,EAAE,CAAC;gBAC/B,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC;gBAC9B,IAAI,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,EAAE,CAAC;oBACjB,MAAM,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBAChD,CAAC;YACH,CAAC;iBAAM,IAAI,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,QAAQ,EAAE,CAAC;gBAEvC,MAAM,CAAC,IAAI,CAAC,CAAC,oBAAoB,EAAE,2BAA2B,CAAC,CAAC,CAAC;YACnE,CAAC;YAGD,MAAM,QAAQ,GAAa,EAAE,CAAC;YAC9B,IAAI,UAAU,CAAC,UAAU,EAAE,CAAC;gBAC1B,QAAQ,CAAC,IAAI,CAAC,IAAA,WAAI,EAAC,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC,CAAC;YAC9D,CAAC;iBAAM,CAAC;gBAEN,QAAQ,CAAC,IAAI,CACX,IAAA,WAAI,EAAC,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,MAAM,CAAC,EACnC,IAAA,WAAI,EAAC,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,kBAAkB,CAAC,EAC/C,IAAA,WAAI,EAAC,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,kBAAkB,CAAC,CAChD,CAAC;YACJ,CAAC;YAGD,IAAI,MAAA,IAAI,CAAC,OAAO,CAAC,OAAO,0CAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC1C,OAAO,CAAC,IAAI,CAAC,8BAA8B,IAAI,CAAC,OAAO,CAAC,OAAO,6IAA6I,CAAC,CAAA;YAC/M,CAAC;YACD,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;gBAC1B,OAAO,CAAC,IAAI,CAAC,sIAAsI,CAAC,CAAC;YACvJ,CAAC;YACD,MAAM,cAAc,GAAG,MAAM,IAAA,kCAAiB,EAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,MAAA,IAAI,CAAC,OAAO,CAAC,OAAO,mCAAI,gBAAgB,CAAC,CAAC;YACxH,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,CAAC,cAAc,EAAE,CAAC;gBAC5C,OAAO,CAAC,GAAG,CAAC,+CAA+C,IAAI,CAAC,OAAO,CAAC,OAAO,uBAAuB,CAAC,CAAC;YAC1G,CAAC;YACD,IAAI,cAAc,EAAE,CAAC;gBACnB,QAAQ,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YAChC,CAAC;YAED,MAAM,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAElD,MAAM,CAAC,IAAI,CACT,CAAC,cAAc,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EACrC,CAAC,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAC/B,CAAC,eAAe,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,EACjC,CAAC,qBAAqB,EAAE,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EACnD,CAAC,kBAAkB,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CACxC,CAAC;YAGF,MAAM,CAAC,IAAI,CAAC,CAAC,kBAAkB,EAAE,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAE3E,IAAI,IAAI,CAAC,OAAO,CAAC,kBAAkB,IAAI,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAClF,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;oBAC1C,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,IAAA,cAAO,EAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC9F,CAAC,CAAC,CAAC;YACL,CAAC;YACD,IAAI,IAAI,CAAC,MAAM,CAAC,YAAY,IAAI,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACpE,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;oBACnC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,IAAA,cAAO,EAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC9F,CAAC,CAAC,CAAC;YACL,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;KAAA;CACF;AAnGD,0CAmGC"} \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/buildMode.d.ts b/publisher/node_modules/@aminya/cmake-ts/build/buildMode.d.ts new file mode 100644 index 00000000..9f2827d0 --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/buildMode.d.ts @@ -0,0 +1,14 @@ +export type BuildMode = { + type: 'osonly'; +} | { + type: 'nativeonly'; +} | { + type: 'all'; +} | { + type: 'dev-os-only'; +} | { + type: 'named-configs'; + configsToBuild: string[]; +}; +export declare function determineBuildMode(argv: string[]): BuildMode; +//# sourceMappingURL=buildMode.d.ts.map \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/buildMode.d.ts.map b/publisher/node_modules/@aminya/cmake-ts/build/buildMode.d.ts.map new file mode 100644 index 00000000..ba302211 --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/buildMode.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"buildMode.d.ts","sourceRoot":"","sources":["../src/buildMode.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG;IACpB,IAAI,EAAE,QAAQ,CAAA;CACf,GAAG;IACF,IAAI,EAAE,YAAY,CAAA;CACnB,GAAG;IACF,IAAI,EAAE,KAAK,CAAA;CACZ,GAAG;IACF,IAAI,EAAE,aAAa,CAAA;CACpB,GAAG;IACF,IAAI,EAAE,eAAe,CAAC;IACtB,cAAc,EAAE,MAAM,EAAE,CAAA;CACzB,CAAA;AAEH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,SAAS,CAiC5D"} \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/buildMode.js b/publisher/node_modules/@aminya/cmake-ts/build/buildMode.js new file mode 100644 index 00000000..a48224ed --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/buildMode.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.determineBuildMode = determineBuildMode; +function determineBuildMode(argv) { + if (argv.length === 0) { + return { type: 'all' }; + } + if (argv[0] === 'nativeonly') { + return { type: 'nativeonly' }; + } + if (argv[0] === 'osonly') { + return { type: 'osonly' }; + } + if (argv[0] === 'dev-os-only') { + return { type: 'dev-os-only' }; + } + if (argv[0] === 'named-configs') { + if (argv.length < 2) { + console.error(`'named-configs' needs at least one config name`); + process.exit(1); + } + return { + type: 'named-configs', + configsToBuild: argv.slice(1), + }; + } + console.error(`Unknown command line option ${argv[0]} - Valid are none/omitted, 'nativeonly', 'osonly', 'dev-os-only' and 'named-configs'`); + process.exit(1); +} +//# sourceMappingURL=buildMode.js.map \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/buildMode.js.map b/publisher/node_modules/@aminya/cmake-ts/build/buildMode.js.map new file mode 100644 index 00000000..cfc54184 --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/buildMode.js.map @@ -0,0 +1 @@ +{"version":3,"file":"buildMode.js","sourceRoot":"","sources":["../src/buildMode.ts"],"names":[],"mappings":";;AAaA,gDAiCC;AAjCD,SAAgB,kBAAkB,CAAC,IAAc;IAG7C,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IACzB,CAAC;IAED,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,YAAY,EAAE,CAAC;QAC7B,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;IAChC,CAAC;IAED,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE,CAAC;QACzB,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IAC5B,CAAC;IAED,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,aAAa,EAAE,CAAC;QAC9B,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;IACjC,CAAC;IAED,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,eAAe,EAAE,CAAC;QAChC,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACpB,OAAO,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC;YAChE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,OAAO;YACL,IAAI,EAAE,eAAe;YACrB,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;SAC9B,CAAC;IACJ,CAAC;IAGD,OAAO,CAAC,KAAK,CAAC,+BAA+B,IAAI,CAAC,CAAC,CAAC,sFAAsF,CAAC,CAAC;IAC5I,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC"} \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/download.d.ts b/publisher/node_modules/@aminya/cmake-ts/build/download.d.ts new file mode 100644 index 00000000..41ec602f --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/download.d.ts @@ -0,0 +1,14 @@ +export type DownloadOptions = { + path?: string; + cwd?: string; + hashType?: string | null; + hashSum?: string; +}; +type AnyStream = NodeJS.WritableStream | NodeJS.ReadWriteStream; +export declare function downloadToStream(url: string, stream: AnyStream, hashType: string | null | undefined): Promise; +export declare function downloadToString(url: string): Promise; +export declare function downloadFile(url: string, opts: string | DownloadOptions): Promise; +export declare function downloadTgz(url: string, opts: string | DownloadOptions): Promise; +export declare function downloadZip(url: string, opts: string | DownloadOptions): Promise; +export {}; +//# sourceMappingURL=download.d.ts.map \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/download.d.ts.map b/publisher/node_modules/@aminya/cmake-ts/build/download.d.ts.map new file mode 100644 index 00000000..70d2a979 --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/download.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../src/download.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAA;AAED,KAAK,SAAS,GAAG,MAAM,CAAC,cAAc,GAAG,MAAM,CAAC,eAAe,CAAC;AAEhE,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA8B5H;AAED,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAInE;AAED,wBAAsB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAStG;AAED,wBAAsB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAWrG;AAED,wBAAsB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CASrG"} \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/download.js b/publisher/node_modules/@aminya/cmake-ts/build/download.js new file mode 100644 index 00000000..767854c0 --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/download.js @@ -0,0 +1,104 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.downloadToStream = downloadToStream; +exports.downloadToString = downloadToString; +exports.downloadFile = downloadFile; +exports.downloadTgz = downloadTgz; +exports.downloadZip = downloadZip; +const request_1 = require("@cypress/request"); +const crypto_1 = __importDefault(require("crypto")); +const lodash_1 = require("lodash"); +const npmlog_1 = require("npmlog"); +const fs_1 = require("fs"); +const tar_1 = require("tar"); +const unzipper_1 = require("unzipper"); +const minizlib_1 = require("minizlib"); +const memory_stream_1 = __importDefault(require("memory-stream")); +function downloadToStream(url, stream, hashType) { + return new Promise((resolve, reject) => { + const shasum = typeof hashType === "string" ? crypto_1.default.createHash(hashType) : null; + let length = 0; + let done = 0; + let lastPercent = 0; + (0, request_1.get)(url, { allowInsecureRedirect: true, followAllRedirects: true }).on('error', err => { + reject(err); + }).on('response', data => { + length = parseInt(data.headers['content-length'] || '0', 10); + if (!(0, lodash_1.isNumber)(length)) { + length = 0; + } + }).on('data', chunk => { + if (shasum) { + shasum.update(chunk); + } + if (length) { + done += chunk.length; + const pc = Math.round(done / length * 10) * 10 + 10; + if (pc > lastPercent) { + (0, npmlog_1.log)('verbose', 'DWNL', `${lastPercent}%`); + lastPercent = pc; + } + } + }).pipe(stream); + stream.once('error', (err) => reject(err)); + stream.once('finish', () => resolve(shasum ? shasum.digest('hex') : null)); + }); +} +function downloadToString(url) { + return __awaiter(this, void 0, void 0, function* () { + const result = new memory_stream_1.default(); + yield downloadToStream(url, result, null); + return result.toString(); + }); +} +function downloadFile(url, opts) { + return __awaiter(this, void 0, void 0, function* () { + const options = (0, lodash_1.isString)(opts) ? { path: opts } : opts; + const result = (0, fs_1.createWriteStream)(options.path); + const sum = yield downloadToStream(url, result, options.hashType); + if (!checkHashSum(sum, options)) { + throw new Error(`Checksum mismatch for download ${url}`); + } + return sum; + }); +} +function downloadTgz(url, opts) { + return __awaiter(this, void 0, void 0, function* () { + const options = (0, lodash_1.isString)(opts) ? { path: opts } : opts; + const gunzip = new minizlib_1.Gunzip({}); + const extractor = (0, tar_1.extract)(options); + gunzip.pipe(extractor); + const sum = yield downloadToStream(url, gunzip, options.hashType); + if (!checkHashSum(sum, options)) { + throw new Error(`Checksum mismatch for download ${url}`); + } + return sum; + }); +} +function downloadZip(url, opts) { + return __awaiter(this, void 0, void 0, function* () { + const options = (0, lodash_1.isString)(opts) ? { path: opts } : opts; + const extractor = (0, unzipper_1.Extract)({ path: options.path }); + const sum = yield downloadToStream(url, extractor, options.hashType); + if (!checkHashSum(sum, options)) { + throw new Error(`Checksum mismatch for download ${url}`); + } + return sum; + }); +} +function checkHashSum(sum, options) { + return !options.hashType || !options.hashSum || options.hashSum === sum; +} +//# sourceMappingURL=download.js.map \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/download.js.map b/publisher/node_modules/@aminya/cmake-ts/build/download.js.map new file mode 100644 index 00000000..637a06e2 --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/download.js.map @@ -0,0 +1 @@ +{"version":3,"file":"download.js","sourceRoot":"","sources":["../src/download.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAsBA,4CA8BC;AAED,4CAIC;AAED,oCASC;AAED,kCAWC;AAED,kCASC;AA3FD,8CAAuC;AACvC,oDAA4B;AAC5B,mCAA4C;AAC5C,mCAA6B;AAC7B,2BAAuC;AACvC,6BAA4C;AAC5C,uCAAiD;AACjD,uCAAiC;AAEjC,kEAAyC;AAWzC,SAAgB,gBAAgB,CAAC,GAAW,EAAE,MAAiB,EAAE,QAAmC;IAClG,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,MAAM,GAAG,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,gBAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACjF,IAAI,MAAM,GAAG,CAAC,CAAC;QACf,IAAI,IAAI,GAAG,CAAC,CAAC;QACb,IAAI,WAAW,GAAG,CAAC,CAAC;QAEpB,IAAA,aAAG,EAAC,GAAG,EAAE,EAAE,qBAAqB,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE;YACpF,MAAM,CAAC,GAAG,CAAC,CAAC;QACd,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC,EAAE;YACvB,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,IAAI,GAAG,EAAE,EAAE,CAAC,CAAC;YAC7D,IAAI,CAAC,IAAA,iBAAQ,EAAC,MAAM,CAAC,EAAE,CAAC;gBACtB,MAAM,GAAG,CAAC,CAAC;YACb,CAAC;QACH,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE;YACpB,IAAI,MAAM,EAAE,CAAC;gBACX,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvB,CAAC;YACD,IAAI,MAAM,EAAE,CAAC;gBACX,IAAI,IAAI,KAAK,CAAC,MAAM,CAAC;gBACrB,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,MAAM,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC;gBACpD,IAAI,EAAE,GAAG,WAAW,EAAE,CAAC;oBACrB,IAAA,YAAG,EAAC,SAAS,EAAE,MAAM,EAAE,GAAG,WAAW,GAAG,CAAC,CAAC;oBAC1C,WAAW,GAAG,EAAE,CAAC;gBACnB,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAChB,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QAC3C,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7E,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAsB,gBAAgB,CAAC,GAAW;;QAChD,MAAM,MAAM,GAAG,IAAI,uBAAY,EAAE,CAAC;QAClC,MAAM,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QAC1C,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAA;IAC1B,CAAC;CAAA;AAED,SAAsB,YAAY,CAAC,GAAW,EAAE,IAA8B;;QAC5E,MAAM,OAAO,GAAG,IAAA,iBAAQ,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QAEvD,MAAM,MAAM,GAAG,IAAA,sBAAiB,EAAC,OAAO,CAAC,IAAc,CAAC,CAAC;QACzD,MAAM,GAAG,GAAG,MAAM,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;QAClE,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,kCAAkC,GAAG,EAAE,CAAC,CAAC;QAC3D,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;CAAA;AAED,SAAsB,WAAW,CAAC,GAAW,EAAE,IAA8B;;QAC3E,MAAM,OAAO,GAAG,IAAA,iBAAQ,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QAEvD,MAAM,MAAM,GAAG,IAAI,iBAAM,CAAC,EAAE,CAAC,CAAC;QAC9B,MAAM,SAAS,GAAG,IAAA,aAAU,EAAC,OAAO,CAAC,CAAC;QACtC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACvB,MAAM,GAAG,GAAG,MAAM,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;QAClE,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,kCAAkC,GAAG,EAAE,CAAC,CAAC;QAC3D,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;CAAA;AAED,SAAsB,WAAW,CAAC,GAAW,EAAE,IAA8B;;QAC3E,MAAM,OAAO,GAAG,IAAA,iBAAQ,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QAEvD,MAAM,SAAS,GAAG,IAAA,kBAAU,EAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAc,EAAE,CAAC,CAAC;QAC/D,MAAM,GAAG,GAAG,MAAM,gBAAgB,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;QACrE,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,kCAAkC,GAAG,EAAE,CAAC,CAAC;QAC3D,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;CAAA;AAED,SAAS,YAAY,CAAC,GAAkB,EAAE,OAAwB;IAChE,OAAO,CAAC,OAAO,CAAC,QAAQ,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,KAAK,GAAG,CAAC;AAC1E,CAAC"} \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/lib.d.ts b/publisher/node_modules/@aminya/cmake-ts/build/lib.d.ts new file mode 100644 index 00000000..a7122d34 --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/lib.d.ts @@ -0,0 +1,47 @@ +import { BuildMode } from './buildMode'; +export type ArrayOrSingle = T | T[]; +export type BuildConfigurationDefaulted = { + name: string; + dev: boolean; + os: typeof process.platform; + arch: typeof process.arch; + runtime: string; + runtimeVersion: string; + toolchainFile: string | null; + CMakeOptions?: { + name: string; + value: string; + }[]; + addonSubdirectory: string; + additionalDefines: string[]; +}; +export type BuildConfiguration = Partial; +export declare function defaultBuildConfiguration(config: BuildConfiguration): BuildConfigurationDefaulted; +export type BuildOptionsDefaulted = { + configurations: BuildConfiguration[]; + packageDirectory: string; + projectName: string; + targetDirectory: string; + stagingDirectory: string; + cmakeToUse: string; + generatorToUse: string; + generatorBinary: string; + buildType: string; + globalCMakeOptions?: { + name: string; + value: string; + }[]; + nodeAPI?: string; +}; +export type OverrideConfig = { + match: { + os?: ArrayOrSingle; + arch?: ArrayOrSingle; + runtime?: ArrayOrSingle; + runtimeVersion?: ArrayOrSingle; + }; + addDefines: ArrayOrSingle; +}; +export type BuildOptions = Partial; +export declare function defaultBuildOptions(configs: BuildOptions, buildmode: BuildMode): Promise; +//# sourceMappingURL=lib.d.ts.map \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/lib.d.ts.map b/publisher/node_modules/@aminya/cmake-ts/build/lib.d.ts.map new file mode 100644 index 00000000..a5d3297d --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/lib.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;AAEvC,MAAM,MAAM,2BAA2B,GAAG;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,OAAO,CAAC;IACb,EAAE,EAAE,OAAO,OAAO,CAAC,QAAQ,CAAC;IAC5B,IAAI,EAAE,OAAO,OAAO,CAAC,IAAI,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,YAAY,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACjD,iBAAiB,EAAE,MAAM,CAAC;IAG1B,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;AAEtE,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,kBAAkB,GAAG,2BAA2B,CA8CjG;AAED,MAAM,MAAM,qBAAqB,GAAG;IAElC,cAAc,EAAE,kBAAkB,EAAE,CAAC;IAErC,gBAAgB,EAAE,MAAM,CAAC;IAEzB,WAAW,EAAE,MAAM,CAAC;IAEpB,eAAe,EAAE,MAAM,CAAC;IAExB,gBAAgB,EAAE,MAAM,CAAC;IAEzB,UAAU,EAAE,MAAM,CAAC;IAEnB,cAAc,EAAE,MAAM,CAAC;IAEvB,eAAe,EAAE,MAAM,CAAC;IAExB,SAAS,EAAE,MAAM,CAAC;IAElB,kBAAkB,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAEvD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE;QACL,EAAE,CAAC,EAAE,aAAa,CAAC,OAAO,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC5C,IAAI,CAAC,EAAE,aAAa,CAAC,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;QAC1C,OAAO,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;QAChC,cAAc,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;KACxC,CAAC;IACF,UAAU,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CACnC,CAAA;AAED,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAU1D,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,qBAAqB,CAAC,CA+JrH"} \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/lib.js b/publisher/node_modules/@aminya/cmake-ts/build/lib.js new file mode 100644 index 00000000..b051b4fb --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/lib.js @@ -0,0 +1,207 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.defaultBuildConfiguration = defaultBuildConfiguration; +exports.defaultBuildOptions = defaultBuildOptions; +const which_1 = __importDefault(require("which")); +const util_1 = require("./util"); +function defaultBuildConfiguration(config) { + if (config.name === undefined) { + config.name = ''; + } + if (config.dev === undefined) { + config.dev = false; + } + if (config.os === undefined) { + config.os = process.platform; + console.warn(`'os' was missing in the 'configurations'. Defaulting to the current operating system ${config.os}`); + } + if (config.arch === undefined) { + config.arch = process.arch; + console.warn(`'arch' was missing in the 'configurations'. Defaulting to the current architecture ${config.arch}`); + } + if (config.runtime === undefined) { + config.runtime = "node"; + console.warn("`runtime` was missing in the `configurations`. Defaulting to `node`"); + } + if (config.runtimeVersion === undefined) { + config.runtimeVersion = process.versions.node; + console.warn(`'runtimeVersion' was missing in the 'configurations'. Defaulting to the current runtimeVersion ${config.runtimeVersion}`); + } + if (config.toolchainFile === undefined) { + config.toolchainFile = null; + } + if (config.CMakeOptions === undefined) { + config.CMakeOptions = []; + } + if (config.cmakeOptions !== undefined) { + console.warn('cmakeOptions was specified which was disabled in the 0.3.0 release. Please rename it to CMakeOptions'); + } + if (config.addonSubdirectory === undefined) { + config.addonSubdirectory = ''; + } + config.additionalDefines = []; + return config; +} +function whichWrapped(cmd) { + return __awaiter(this, void 0, void 0, function* () { + try { + return yield (0, which_1.default)(cmd); + } + catch (err) { + return null; + } + }); +} +function defaultBuildOptions(configs, buildmode) { + return __awaiter(this, void 0, void 0, function* () { + var _a; + if (buildmode.type === 'nativeonly') { + console.log(`-------------------------------------------------- + WARNING: Building only for the current runtime. + WARNING: DO NOT SHIP THE RESULTING PACKAGE + --------------------------------------------------`); + configs.configurations = [defaultBuildConfiguration({})]; + } + if (buildmode.type === 'osonly') { + console.log(`-------------------------------------------------- + WARNING: Building only for the current OS. + WARNING: DO NOT SHIP THE RESULTING PACKAGE + --------------------------------------------------`); + if (configs.configurations === undefined) { + console.error('No `configurations` entry was found in the package.json'); + process.exit(1); + } + configs.configurations = configs.configurations.filter(j => j.os === process.platform); + if (configs.configurations.length === 0) { + console.error(`No configuration left to build!`); + process.exit(1); + } + for (const config of configs.configurations) { + config.toolchainFile = null; + } + } + if (buildmode.type === 'dev-os-only') { + console.log(`-------------------------------------------------- + WARNING: Building dev-os-only package + WARNING: DO NOT SHIP THE RESULTING PACKAGE + --------------------------------------------------`); + if (configs.configurations === undefined) { + console.error('No `configurations` entry was found in the package.json'); + process.exit(1); + } + const candidateConfig = configs.configurations.find(j => j.os === process.platform && j.dev); + if (candidateConfig === undefined) { + console.error(`No matching entry with \`dev == true\` and \`os == ${process.platform}\` in \`configurations\``); + process.exit(1); + } + configs.configurations = [candidateConfig]; + } + if (buildmode.type === 'named-configs') { + if (configs.configurations === undefined) { + console.error('No `configurations` entry was found in the package.json'); + process.exit(1); + } + configs.configurations = configs.configurations.filter(j => (j.name ? buildmode.configsToBuild.includes(j.name) : false)); + if (configs.configurations.length === 0) { + console.error(`No configuration left to build!`); + process.exit(1); + } + } + if (configs.packageDirectory === undefined) { + configs.packageDirectory = process.cwd(); + } + if (configs.projectName === undefined) { + configs.projectName = 'addon'; + } + if (configs.targetDirectory === undefined) { + configs.targetDirectory = 'build'; + } + if (configs.stagingDirectory === undefined) { + configs.stagingDirectory = 'staging'; + } + if (configs.cmakeToUse === undefined) { + const cmake = yield whichWrapped('cmake'); + if (!cmake) { + console.error('cmake binary not found, try to specify \'cmakeToUse\''); + process.exit(1); + } + configs.cmakeToUse = cmake; + } + const ninjaP = whichWrapped('ninja'); + const makeP = whichWrapped('make'); + let ninja; + let make; + if (configs.generatorToUse === undefined) { + console.log('no generator specified, checking ninja'); + ninja = yield ninjaP; + if (!ninja) { + console.log('ninja not found, checking make'); + make = yield makeP; + if (!make) { + console.log('make not found, using native'); + if (process.platform === 'win32') { + const generator = yield (0, util_1.GET_CMAKE_VS_GENERATOR)(configs.cmakeToUse, process.arch); + configs.generatorToUse = generator; + configs.generatorBinary = 'native'; + } + else { + configs.generatorToUse = 'native'; + configs.generatorBinary = 'native'; + } + } + else { + console.log('found make at', make, '(fallback)'); + configs.generatorToUse = 'Unix Makefiles'; + configs.generatorBinary = make; + } + } + else { + console.log('found ninja at', ninja); + configs.generatorToUse = 'Ninja'; + configs.generatorBinary = ninja; + } + } + if (configs.generatorBinary === undefined) { + if (configs.generatorToUse === 'Ninja') { + ninja = yield ninjaP; + if (!ninja) { + console.error('Ninja was specified as generator but no ninja binary could be found. Specify it via \'generatorBinary\''); + process.exit(1); + } + configs.generatorBinary = ninja; + } + else if (configs.generatorToUse === 'Unix Makefiles') { + make = yield makeP; + if (!make) { + console.error('Unix Makefiles was specified as generator but no make binary could be found. Specify it via \'generatorBinary\''); + process.exit(1); + } + configs.generatorBinary = make; + } + else { + console.error(`Unsupported generator ${configs.generatorToUse}`); + process.exit(1); + } + ; + } + if (configs.buildType === undefined) { + configs.buildType = "Release"; + console.warn("`buildType` was missing. Considering 'Release'"); + } + (_a = configs.configurations) === null || _a === void 0 ? void 0 : _a.forEach(v => { v.additionalDefines = []; }); + return configs; + }); +} +//# sourceMappingURL=lib.js.map \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/lib.js.map b/publisher/node_modules/@aminya/cmake-ts/build/lib.js.map new file mode 100644 index 00000000..6ba0b6bf --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/lib.js.map @@ -0,0 +1 @@ +{"version":3,"file":"lib.js","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAuBA,8DA8CC;AA+CD,kDA+JC;AAnRD,kDAA0B;AAC1B,iCAAgD;AAsBhD,SAAgB,yBAAyB,CAAC,MAA0B;IAClE,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC9B,MAAM,CAAC,IAAI,GAAG,EAAE,CAAA;IAClB,CAAC;IACD,IAAI,MAAM,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;QAC7B,MAAM,CAAC,GAAG,GAAG,KAAK,CAAA;IACpB,CAAC;IACD,IAAI,MAAM,CAAC,EAAE,KAAK,SAAS,EAAE,CAAC;QAC5B,MAAM,CAAC,EAAE,GAAG,OAAO,CAAC,QAAQ,CAAC;QAC7B,OAAO,CAAC,IAAI,CAAC,wFAAwF,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;IACpH,CAAC;IAED,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC9B,MAAM,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAC3B,OAAO,CAAC,IAAI,CAAC,sFAAsF,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;IACpH,CAAC;IAED,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QACjC,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC;QACxB,OAAO,CAAC,IAAI,CAAC,qEAAqE,CAAC,CAAC;IACtF,CAAC;IAED,IAAI,MAAM,CAAC,cAAc,KAAK,SAAS,EAAE,CAAC;QACxC,MAAM,CAAC,cAAc,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;QAC9C,OAAO,CAAC,IAAI,CAAC,kGAAkG,MAAM,CAAC,cAAc,EAAE,CAAC,CAAC;IAC1I,CAAC;IAED,IAAI,MAAM,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;QACvC,MAAM,CAAC,aAAa,GAAG,IAAI,CAAC;IAC9B,CAAC;IAED,IAAI,MAAM,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;QACtC,MAAM,CAAC,YAAY,GAAG,EAAE,CAAC;IAC3B,CAAC;IAED,IAAK,MAAc,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;QAC/C,OAAO,CAAC,IAAI,CAAC,sGAAsG,CAAC,CAAC;IACvH,CAAC;IAED,IAAI,MAAM,CAAC,iBAAiB,KAAK,SAAS,EAAE,CAAC;QAC3C,MAAM,CAAC,iBAAiB,GAAG,EAAE,CAAA;IAC/B,CAAC;IAED,MAAM,CAAC,iBAAiB,GAAG,EAAE,CAAC;IAE9B,OAAO,MAAqC,CAAC;AAC/C,CAAC;AAuCD,SAAe,YAAY,CAAC,GAAW;;QACrC,IAAI,CAAC;YACH,OAAO,MAAM,IAAA,eAAK,EAAC,GAAG,CAAC,CAAC;QAC1B,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;CAAA;AAED,SAAsB,mBAAmB,CAAC,OAAqB,EAAE,SAAoB;;;QAInF,IAAI,SAAS,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;YACpC,OAAO,CAAC,GAAG,CACX;;;wDAGoD,CAAC,CAAC;YAEtD,OAAO,CAAC,cAAc,GAAG,CAAC,yBAAyB,CAAC,EAAE,CAAC,CAAC,CAAC;QAC3D,CAAC;QACD,IAAI,SAAS,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAChC,OAAO,CAAC,GAAG,CACX;;;wDAGoD,CAAC,CAAC;YACtD,IAAI,OAAO,CAAC,cAAc,KAAK,SAAS,EAAE,CAAC;gBACzC,OAAO,CAAC,KAAK,CAAC,yDAAyD,CAAC,CAAC;gBACzE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;YACD,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;YACvF,IAAG,OAAO,CAAC,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACvC,OAAO,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;gBACjD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;YACD,KAAK,MAAM,MAAM,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;gBAE5C,MAAM,CAAC,aAAa,GAAG,IAAI,CAAC;YAC9B,CAAC;QACH,CAAC;QACD,IAAI,SAAS,CAAC,IAAI,KAAK,aAAa,EAAE,CAAC;YACrC,OAAO,CAAC,GAAG,CACT;;;0DAGoD,CAAC,CAAC;YACxD,IAAI,OAAO,CAAC,cAAc,KAAK,SAAS,EAAE,CAAC;gBACzC,OAAO,CAAC,KAAK,CAAC,yDAAyD,CAAC,CAAC;gBACzE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;YACD,MAAM,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,OAAO,CAAC,QAAQ,IAAI,CAAC,CAAC,GAAG,CAAC,CAAA;YAC5F,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;gBAClC,OAAO,CAAC,KAAK,CAAC,sDAAsD,OAAO,CAAC,QAAQ,0BAA0B,CAAC,CAAC;gBAChH,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;YACD,OAAO,CAAC,cAAc,GAAG,CAAC,eAAe,CAAC,CAAA;QAE5C,CAAC;QACD,IAAG,SAAS,CAAC,IAAI,KAAK,eAAe,EAAE,CAAC;YACtC,IAAI,OAAO,CAAC,cAAc,KAAK,SAAS,EAAE,CAAC;gBACzC,OAAO,CAAC,KAAK,CAAC,yDAAyD,CAAC,CAAC;gBACzE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;YAED,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAA;YACzH,IAAG,OAAO,CAAC,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACvC,OAAO,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;gBACjD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;QACH,CAAC;QAGD,IAAI,OAAO,CAAC,gBAAgB,KAAK,SAAS,EAAE,CAAC;YAC3C,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QAC3C,CAAC;QAED,IAAI,OAAO,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;YACtC,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC;QAChC,CAAC;QAED,IAAI,OAAO,CAAC,eAAe,KAAK,SAAS,EAAE,CAAC;YAC1C,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC;QACpC,CAAC;QAED,IAAI,OAAO,CAAC,gBAAgB,KAAK,SAAS,EAAE,CAAC;YAC3C,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;QACvC,CAAC;QAID,IAAI,OAAO,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;YACrC,MAAM,KAAK,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,CAAC;YAC1C,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,OAAO,CAAC,KAAK,CAAC,uDAAuD,CAAC,CAAC;gBACvE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;YACD,OAAO,CAAC,UAAU,GAAG,KAAK,CAAC;QAC7B,CAAC;QAGD,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;QACrC,MAAM,KAAK,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;QACnC,IAAI,KAAoB,CAAC;QACzB,IAAI,IAAmB,CAAC;QACxB,IAAI,OAAO,CAAC,cAAc,KAAK,SAAS,EAAE,CAAC;YACzC,OAAO,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAC;YACtD,KAAK,GAAG,MAAM,MAAM,CAAC;YACrB,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;gBAC9C,IAAI,GAAG,MAAM,KAAK,CAAC;gBACnB,IAAI,CAAC,IAAI,EAAE,CAAC;oBACV,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;oBAC5C,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;wBAEjC,MAAM,SAAS,GAAG,MAAM,IAAA,6BAAsB,EAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;wBACjF,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC;wBACnC,OAAO,CAAC,eAAe,GAAG,QAAQ,CAAC;oBACrC,CAAC;yBAAM,CAAC;wBACN,OAAO,CAAC,cAAc,GAAG,QAAQ,CAAC;wBAClC,OAAO,CAAC,eAAe,GAAG,QAAQ,CAAC;oBACrC,CAAC;gBACH,CAAC;qBAAM,CAAC;oBACN,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;oBACjD,OAAO,CAAC,cAAc,GAAG,gBAAgB,CAAC;oBAC1C,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;gBACjC,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;gBACrC,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC;gBACjC,OAAO,CAAC,eAAe,GAAG,KAAK,CAAC;YAClC,CAAC;QACH,CAAC;QAGD,IAAI,OAAO,CAAC,eAAe,KAAK,SAAS,EAAE,CAAC;YAC1C,IAAI,OAAO,CAAC,cAAc,KAAK,OAAO,EAAE,CAAC;gBACvC,KAAK,GAAG,MAAM,MAAM,CAAC;gBACrB,IAAI,CAAC,KAAK,EAAE,CAAC;oBACX,OAAO,CAAC,KAAK,CAAC,yGAAyG,CAAC,CAAC;oBACzH,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBAClB,CAAC;gBACD,OAAO,CAAC,eAAe,GAAG,KAAK,CAAC;YAClC,CAAC;iBAAM,IAAI,OAAO,CAAC,cAAc,KAAK,gBAAgB,EAAE,CAAC;gBACvD,IAAI,GAAG,MAAM,KAAK,CAAC;gBACnB,IAAI,CAAC,IAAI,EAAE,CAAC;oBACV,OAAO,CAAC,KAAK,CAAC,iHAAiH,CAAC,CAAC;oBACjI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBAClB,CAAC;gBACD,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;YACjC,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,KAAK,CAAC,yBAAyB,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;gBACjE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;YAAA,CAAC;QACJ,CAAC;QAED,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;YACpC,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;YAC9B,OAAO,CAAC,IAAI,CAAC,gDAAgD,CAAC,CAAC;QACjE,CAAC;QAED,MAAA,OAAO,CAAC,cAAc,0CAAE,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,iBAAiB,GAAG,EAAE,CAAA,CAAC,CAAC,CAAC,CAAC;QAKnE,OAAO,OAAgC,CAAC;IAC1C,CAAC;CAAA"} \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/main.d.ts b/publisher/node_modules/@aminya/cmake-ts/build/main.d.ts new file mode 100644 index 00000000..5d7cc144 --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/main.d.ts @@ -0,0 +1,3 @@ +#!/usr/bin/env node +export {}; +//# sourceMappingURL=main.d.ts.map \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/main.d.ts.map b/publisher/node_modules/@aminya/cmake-ts/build/main.d.ts.map new file mode 100644 index 00000000..28b87d89 --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/main.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/main.js b/publisher/node_modules/@aminya/cmake-ts/build/main.js new file mode 100755 index 00000000..18b744de --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/main.js @@ -0,0 +1,114 @@ +#!/usr/bin/env node +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const lib_1 = require("./lib"); +const path_1 = require("path"); +const runtimeDistribution_1 = require("./runtimeDistribution"); +const argumentBuilder_1 = require("./argumentBuilder"); +const util_1 = require("./util"); +const fs_extra_1 = require("fs-extra"); +const override_1 = require("./override"); +const buildMode_1 = require("./buildMode"); +const DEBUG_LOG = Boolean(process.env.CMAKETSDEBUG); +(() => __awaiter(void 0, void 0, void 0, function* () { + const argv = process.argv.slice(2); + let packJson; + try { + packJson = require((0, path_1.resolve)((0, path_1.join)(process.cwd(), 'package.json'))); + } + catch (err) { + console.error('Failed to load package.json, maybe your cwd is wrong:', err); + process.exit(1); + } + const configsGiven = packJson['cmake-ts']; + if (configsGiven === undefined) { + console.error('Package.json does not have cmake-ts key defined!'); + process.exit(1); + } + const buildMode = yield (0, buildMode_1.determineBuildMode)(argv); + const configs = yield (0, lib_1.defaultBuildOptions)(configsGiven, buildMode); + configs.targetDirectory = (0, path_1.resolve)((0, path_1.join)(configs.packageDirectory, configs.targetDirectory)); + configs.stagingDirectory = (0, path_1.resolve)((0, path_1.join)(configs.packageDirectory, configs.stagingDirectory)); + const stagingExists = yield (0, fs_extra_1.pathExists)(configs.stagingDirectory); + console.log('running in', configs.packageDirectory, 'command', argv); + process.stdout.write('> Setting up staging directory... '); + if (stagingExists) { + yield (0, fs_extra_1.remove)(configs.stagingDirectory); + process.stdout.write('[ CLEARED ]'); + } + yield (0, fs_extra_1.ensureDir)(configs.stagingDirectory); + console.log('[ DONE ]'); + for (const configGiven of configs.configurations) { + const config = (0, lib_1.defaultBuildConfiguration)(configGiven); + const dist = new runtimeDistribution_1.RuntimeDistribution(config); + console.log('---------------- BEGIN CONFIG ----------------'); + process.stdout.write('> Distribution File Download... '); + yield dist.ensureDownloaded(); + console.log('[ DONE ]'); + process.stdout.write('> Determining ABI... '); + yield dist.determineABI(); + console.log('[ DONE ]'); + process.stdout.write('> Building directories... '); + const stagingDir = (0, path_1.resolve)((0, path_1.join)(configs.stagingDirectory, config.os, config.arch, config.runtime, `${dist.abi}`, config.addonSubdirectory)); + const targetDir = (0, path_1.resolve)((0, path_1.join)(configs.targetDirectory, config.os, config.arch, config.runtime, `${dist.abi}`, config.addonSubdirectory)); + console.log('[ DONE ]'); + process.stdout.write('> Applying overrides... '); + const appliedOverrides = (0, override_1.applyOverrides)(config); + console.log(`[ DONE, ${appliedOverrides} applied ]`); + console.log('--------------- CONFIG SUMMARY ---------------'); + console.log('Name: ', config.name ? config.name : "N/A"); + console.log('OS/Arch:', config.os, config.arch); + console.log('Runtime:', config.runtime, config.runtimeVersion); + console.log('Target ABI:', dist.abi); + console.log('Toolchain File:', config.toolchainFile); + console.log('Custom CMake options:', (config.CMakeOptions && config.CMakeOptions.length > 0) ? 'yes' : 'no'); + console.log('Staging area:', stagingDir); + console.log('Target directory:', targetDir); + console.log('Build Type', configs.buildType); + console.log('----------------------------------------------'); + process.stdout.write('> Setting up config specific staging directory... '); + yield (0, fs_extra_1.ensureDir)(stagingDir); + console.log('[ DONE ]'); + const argBuilder = new argumentBuilder_1.ArgumentBuilder(config, configs, dist); + process.stdout.write('> Building CMake command line... '); + const cmdline = yield argBuilder.buildCmakeCommandLine(); + const buildcmdline = argBuilder.buildGeneratorCommandLine(stagingDir); + console.log('[ DONE ]'); + if (DEBUG_LOG) { + console.log('====> configure: ', cmdline); + console.log('====> build: ', buildcmdline); + } + process.stdout.write('> Invoking CMake... '); + yield (0, util_1.RUN)(cmdline, stagingDir, false); + console.log('[ DONE ]'); + process.stdout.write(`> Invoking ${configs.generatorBinary}... `); + yield (0, util_1.RUN)(buildcmdline, stagingDir, false); + console.log('[ DONE ]'); + process.stdout.write(`> Copying ${configs.projectName}.node to target directory... `); + yield (0, fs_extra_1.ensureDir)(targetDir); + if (configs.generatorToUse.includes('Visual Studio')) { + if (DEBUG_LOG) { + console.log(`Applying copy fix for MSVC projects`); + } + yield (0, fs_extra_1.copy)((0, path_1.join)(stagingDir, configs.buildType, `${configs.projectName}.node`), (0, path_1.join)(targetDir, `${configs.projectName}.node`)); + } + else { + yield (0, fs_extra_1.copy)((0, path_1.join)(stagingDir, `${configs.projectName}.node`), (0, path_1.join)(targetDir, `${configs.projectName}.node`)); + } + console.log('[ DONE ]'); + console.log('----------------- END CONFIG -----------------'); + } +}))().catch((err) => { + console.log("Generic error occured", err); + process.exit(1); +}); +//# sourceMappingURL=main.js.map \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/main.js.map b/publisher/node_modules/@aminya/cmake-ts/build/main.js.map new file mode 100644 index 00000000..66048788 --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/main.js.map @@ -0,0 +1 @@ +{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;;;;;;;;;;;AAIA,+BAAqF;AACrF,+BAAqC;AACrC,+DAA4D;AAC5D,uDAAoD;AACpD,iCAA6B;AAC7B,uCAA+D;AAC/D,yCAA4C;AAC5C,2CAAgD;AAEhD,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;AAEpD,CAAC,GAAwB,EAAE;IAEzB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACnC,IAAI,QAAsE,CAAC;IAC3E,IAAI,CAAC;QAEH,QAAQ,GAAG,OAAO,CAAC,IAAA,cAAO,EAAC,IAAA,WAAI,EAAC,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;IACnE,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,uDAAuD,EAAE,GAAG,CAAC,CAAC;QAC5E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,YAAY,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC;IAC1C,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAC/B,OAAO,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAAC;QAClE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAGD,MAAM,SAAS,GAAG,MAAM,IAAA,8BAAkB,EAAC,IAAI,CAAC,CAAC;IAGjD,MAAM,OAAO,GAAG,MAAM,IAAA,yBAAmB,EAAC,YAAY,EAAE,SAAS,CAAC,CAAC;IAInE,OAAO,CAAC,eAAe,GAAG,IAAA,cAAO,EAAC,IAAA,WAAI,EAAC,OAAO,CAAC,gBAAgB,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC;IAE3F,OAAO,CAAC,gBAAgB,GAAG,IAAA,cAAO,EAAC,IAAA,WAAI,EAAC,OAAO,CAAC,gBAAgB,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAE7F,MAAM,aAAa,GAAG,MAAM,IAAA,qBAAU,EAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAEjE,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,gBAAgB,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;IAErE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAC;IAC3D,IAAI,aAAa,EAAE,CAAC;QAClB,MAAM,IAAA,iBAAM,EAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;QACvC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;IACtC,CAAC;IACD,MAAM,IAAA,oBAAS,EAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC1C,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAExB,KAAK,MAAM,WAAW,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;QAIjD,MAAM,MAAM,GAAG,IAAA,+BAAyB,EAAC,WAAW,CAAC,CAAC;QAEtD,MAAM,IAAI,GAAG,IAAI,yCAAmB,CAAC,MAAM,CAAC,CAAC;QAC7C,OAAO,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;QAG9D,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;QACzD,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC9B,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACxB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC;QAC9C,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;QAC1B,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAExB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;QACnD,MAAM,UAAU,GAAG,IAAA,cAAO,EAAC,IAAA,WAAI,EAAC,OAAO,CAAC,gBAAgB,EAAE,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC;QAC5I,MAAM,SAAS,GAAG,IAAA,cAAO,EAAC,IAAA,WAAI,EAAC,OAAO,CAAC,eAAe,EAAE,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC;QAC1I,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAExB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;QACjD,MAAM,gBAAgB,GAAG,IAAA,yBAAc,EAAC,MAAM,CAAC,CAAC;QAChD,OAAO,CAAC,GAAG,CAAC,WAAW,gBAAgB,YAAY,CAAC,CAAC;QAErD,OAAO,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;QAC9D,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QACzD,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;QAChD,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC;QAC/D,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;QACrC,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC;QACrD,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,CAAC,MAAM,CAAC,YAAY,IAAI,MAAM,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAC7G,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;QACzC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC;QAC5C,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;QAC7C,OAAO,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;QAI9D,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,oDAAoD,CAAC,CAAC;QAC3E,MAAM,IAAA,oBAAS,EAAC,UAAU,CAAC,CAAC;QAC5B,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAGxB,MAAM,UAAU,GAAG,IAAI,iCAAe,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;QAC9D,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;QAC1D,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC,qBAAqB,EAAE,CAAC;QACzD,MAAM,YAAY,GAAG,UAAU,CAAC,yBAAyB,CAAC,UAAU,CAAC,CAAC;QACtE,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACxB,IAAI,SAAS,EAAE,CAAC;YACd,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;YAC1C,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,YAAY,CAAC,CAAC;QACjD,CAAC;QAGD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;QAE7C,MAAM,IAAA,UAAG,EAAC,OAAO,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;QACtC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAGxB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,cAAc,OAAO,CAAC,eAAe,MAAM,CAAC,CAAC;QAClE,MAAM,IAAA,UAAG,EAAC,YAAY,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;QAC3C,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAGxB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,OAAO,CAAC,WAAW,+BAA+B,CAAC,CAAC;QACtF,MAAM,IAAA,oBAAS,EAAC,SAAS,CAAC,CAAC;QAC3B,IAAI,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;YACrD,IAAI,SAAS,EAAE,CAAC;gBACd,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;YACrD,CAAC;YACD,MAAM,IAAA,eAAI,EAAC,IAAA,WAAI,EAAC,UAAU,EAAE,OAAO,CAAC,SAAS,EAAE,GAAG,OAAO,CAAC,WAAW,OAAO,CAAC,EAAE,IAAA,WAAI,EAAC,SAAS,EAAE,GAAG,OAAO,CAAC,WAAW,OAAO,CAAC,CAAC,CAAC;QACjI,CAAC;aAAM,CAAC;YACN,MAAM,IAAA,eAAI,EAAC,IAAA,WAAI,EAAC,UAAU,EAAE,GAAG,OAAO,CAAC,WAAW,OAAO,CAAC,EAAE,IAAA,WAAI,EAAC,SAAS,EAAE,GAAG,OAAO,CAAC,WAAW,OAAO,CAAC,CAAC,CAAC;QAC9G,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAExB,OAAO,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;IAChE,CAAC;AACH,CAAC,CAAA,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,GAAU,EAAE,EAAE;IACxB,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,GAAG,CAAC,CAAC;IAC1C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/index.d.ts b/publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/index.d.ts new file mode 100644 index 00000000..5ccd53b6 --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/index.d.ts @@ -0,0 +1,2 @@ +export declare function getNodeApiInclude(projectRoot: string, nodeAPI: string): Promise; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/index.d.ts.map b/publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/index.d.ts.map new file mode 100644 index 00000000..ed69e3f2 --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/nodeAPIInclude/index.ts"],"names":[],"mappings":"AAIA,wBAAsB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAYpG"} \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/index.js b/publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/index.js new file mode 100644 index 00000000..92e1dbe5 --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/index.js @@ -0,0 +1,28 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getNodeApiInclude = getNodeApiInclude; +const fs_extra_1 = require("fs-extra"); +const resolve_1 = require("./resolve"); +const search_1 = require("./search"); +function getNodeApiInclude(projectRoot, nodeAPI) { + return __awaiter(this, void 0, void 0, function* () { + if (yield (0, fs_extra_1.pathExists)(nodeAPI)) { + return nodeAPI; + } + const resolvedPath = yield (0, resolve_1.resolvePackage)(projectRoot, nodeAPI); + if (typeof resolvedPath === "string") { + return (0, resolve_1.requireInclude)(resolvedPath); + } + return (0, search_1.searchPackage)(projectRoot, nodeAPI); + }); +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/index.js.map b/publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/index.js.map new file mode 100644 index 00000000..e19f2a67 --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/nodeAPIInclude/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAIA,8CAYC;AAhBD,uCAAsC;AACtC,uCAA2D;AAC3D,qCAAyC;AAEzC,SAAsB,iBAAiB,CAAC,WAAmB,EAAE,OAAe;;QAE1E,IAAI,MAAM,IAAA,qBAAU,EAAC,OAAO,CAAC,EAAE,CAAC;YAC9B,OAAO,OAAO,CAAC;QACjB,CAAC;QAED,MAAM,YAAY,GAAG,MAAM,IAAA,wBAAc,EAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAChE,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE,CAAC;YACrC,OAAO,IAAA,wBAAc,EAAC,YAAY,CAAC,CAAC;QACtC,CAAC;QAED,OAAO,IAAA,sBAAa,EAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC;CAAA"} \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/resolve.d.ts b/publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/resolve.d.ts new file mode 100644 index 00000000..70d44957 --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/resolve.d.ts @@ -0,0 +1,3 @@ +export declare function requireInclude(resolvedPath: string): any; +export declare function resolvePackage(projectRoot: string, packageName: string): Promise; +//# sourceMappingURL=resolve.d.ts.map \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/resolve.d.ts.map b/publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/resolve.d.ts.map new file mode 100644 index 00000000..963ecd81 --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/resolve.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/nodeAPIInclude/resolve.ts"],"names":[],"mappings":"AAEA,wBAAgB,cAAc,CAAC,YAAY,EAAE,MAAM,OA4BlD;AAED,wBAAsB,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,0BAU5E"} \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/resolve.js b/publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/resolve.js new file mode 100644 index 00000000..4a4bfafd --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/resolve.js @@ -0,0 +1,67 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.requireInclude = requireInclude; +exports.resolvePackage = resolvePackage; +const resolve_1 = __importDefault(require("resolve")); +function requireInclude(resolvedPath) { + try { + let consoleOutput = null; + const origConsole = console.log; + console.log = (msg) => { consoleOutput = msg; }; + const requireResult = require(resolvedPath); + console.log = origConsole; + if (typeof requireResult === "string") { + return requireResult; + } + else if (typeof requireResult === "object") { + if (typeof requireResult.include_dir === "string") { + return requireResult.include_dir; + } + else if (typeof requireResult.include === "string") { + return requireResult.include; + } + else if (consoleOutput !== null) { + return consoleOutput; + } + } + } + catch (_a) { + } + return resolvedPath; +} +function resolvePackage(projectRoot, packageName) { + return __awaiter(this, void 0, void 0, function* () { + try { + const resolvedPath = yield resolveAsync(packageName, projectRoot); + if (resolvedPath !== undefined) { + return resolvedPath; + } + } + catch (_a) { + } + return null; + }); +} +function resolveAsync(name, basedir) { + return new Promise((promiseResolve) => { + (0, resolve_1.default)(name, { basedir }, (err, res) => { + if (err) { + throw err; + } + return promiseResolve(res); + }); + }); +} +//# sourceMappingURL=resolve.js.map \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/resolve.js.map b/publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/resolve.js.map new file mode 100644 index 00000000..56aaffcf --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/resolve.js.map @@ -0,0 +1 @@ +{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../src/nodeAPIInclude/resolve.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAEA,wCA4BC;AAED,wCAUC;AA1CD,sDAA8B;AAE9B,SAAgB,cAAc,CAAC,YAAoB;IACjD,IAAI,CAAC;QACH,IAAI,aAAa,GAAkB,IAAI,CAAC;QACxC,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC;QAChC,OAAO,CAAC,GAAG,GAAG,CAAC,GAAW,EAAE,EAAE,GAAG,aAAa,GAAG,GAAG,CAAA,CAAC,CAAC,CAAC;QAEvD,MAAM,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;QAC5C,OAAO,CAAC,GAAG,GAAG,WAAW,CAAC;QAE1B,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE,CAAC;YAEtC,OAAO,aAAa,CAAC;QACvB,CAAC;aAAM,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE,CAAC;YAC7C,IAAI,OAAO,aAAa,CAAC,WAAW,KAAK,QAAQ,EAAE,CAAC;gBAElD,OAAO,aAAa,CAAC,WAAW,CAAC;YACnC,CAAC;iBAAM,IAAI,OAAO,aAAa,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;gBAErD,OAAO,aAAa,CAAC,OAAO,CAAC;YAC/B,CAAC;iBAAM,IAAI,aAAa,KAAK,IAAI,EAAE,CAAC;gBAElC,OAAO,aAAa,CAAC;YACvB,CAAC;QACH,CAAC;IACH,CAAC;IAAC,WAAM,CAAC;IAET,CAAC;IACD,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,SAAsB,cAAc,CAAC,WAAmB,EAAE,WAAmB;;QAC3E,IAAI,CAAC;YACH,MAAM,YAAY,GAAG,MAAM,YAAY,CAAC,WAAW,EAAE,WAAW,CAAC,CAAA;YACjE,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;gBAC/B,OAAO,YAAY,CAAC;YACtB,CAAC;QACH,CAAC;QAAC,WAAM,CAAC;QAET,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CAAA;AAED,SAAS,YAAY,CAAC,IAAY,EAAE,OAAe;IACjD,OAAO,IAAI,OAAO,CAAqB,CAAC,cAAc,EAAE,EAAE;QACxD,IAAA,iBAAO,EAAC,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;YACtC,IAAI,GAAG,EAAE,CAAC;gBACR,MAAM,GAAG,CAAC;YACZ,CAAC;YACD,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC"} \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/search.d.ts b/publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/search.d.ts new file mode 100644 index 00000000..8e8de384 --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/search.d.ts @@ -0,0 +1,2 @@ +export declare function searchPackage(projectRoot: string, packageName: string): Promise; +//# sourceMappingURL=search.d.ts.map \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/search.d.ts.map b/publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/search.d.ts.map new file mode 100644 index 00000000..53f5d373 --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/search.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/nodeAPIInclude/search.ts"],"names":[],"mappings":"AAGA,wBAAsB,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAYpG"} \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/search.js b/publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/search.js new file mode 100644 index 00000000..7536dab8 --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/search.js @@ -0,0 +1,55 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.searchPackage = searchPackage; +const path_1 = require("path"); +const util_1 = require("../util"); +function searchPackage(projectRoot, packageName) { + return __awaiter(this, void 0, void 0, function* () { + const isNode = yield isNodeProject(projectRoot); + if (!isNode) { + return null; + } + const packagePath = (0, path_1.join)(projectRoot, 'node_modules', packageName); + const hasHeader = yield dirHasFile(packagePath, packageName === "node-addon-api" ? "napi.h" : `${packageName}.h`); + if (hasHeader) { + console.log(`Found package "${packageName}" at path ${packagePath}!`); + return packagePath; + } + return searchPackage(goUp(projectRoot), packageName); + }); +} +function isNodeProject(dir) { + return __awaiter(this, void 0, void 0, function* () { + const pjson = (0, path_1.join)(dir, 'package.json'); + const node_modules = (0, path_1.join)(dir, 'node_modules'); + return (yield (0, util_1.stat)(pjson)).isFile() || (yield (0, util_1.stat)(node_modules)).isDirectory(); + }); +} +; +function dirHasFile(dir, fileName) { + return __awaiter(this, void 0, void 0, function* () { + const filePath = (0, path_1.join)(dir, fileName); + return (yield (0, util_1.stat)(filePath)).isFile(); + }); +} +; +function goUp(dir) { + let myDir = dir; + const items = myDir.split(path_1.sep); + const scope = items[items.length - 2]; + if (scope && scope.charAt(0) === '@') { + myDir = (0, path_1.join)(myDir, '..'); + } + myDir = (0, path_1.join)(myDir, '..', '..'); + return (0, path_1.normalize)(myDir); +} +//# sourceMappingURL=search.js.map \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/search.js.map b/publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/search.js.map new file mode 100644 index 00000000..d7c2a2d3 --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/nodeAPIInclude/search.js.map @@ -0,0 +1 @@ +{"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/nodeAPIInclude/search.ts"],"names":[],"mappings":";;;;;;;;;;;AAGA,sCAYC;AAfD,+BAA0F;AAC1F,kCAA+B;AAE/B,SAAsB,aAAa,CAAC,WAAmB,EAAE,WAAmB;;QAC1E,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,WAAW,CAAC,CAAC;QAChD,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,WAAW,GAAG,IAAA,WAAQ,EAAC,WAAW,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC;QACvE,MAAM,SAAS,GAAG,MAAM,UAAU,CAAC,WAAW,EAAE,WAAW,KAAK,gBAAgB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,WAAW,IAAI,CAAC,CAAC;QAClH,IAAI,SAAS,EAAE,CAAC;YACd,OAAO,CAAC,GAAG,CAAC,kBAAkB,WAAW,aAAa,WAAW,GAAG,CAAC,CAAC;YACtE,OAAO,WAAW,CAAC;QACrB,CAAC;QACD,OAAO,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC,CAAC;IACvD,CAAC;CAAA;AAED,SAAe,aAAa,CAAC,GAAW;;QACtC,MAAM,KAAK,GAAG,IAAA,WAAQ,EAAC,GAAG,EAAE,cAAc,CAAC,CAAC;QAC5C,MAAM,YAAY,GAAG,IAAA,WAAQ,EAAC,GAAG,EAAE,cAAc,CAAC,CAAC;QACnD,OAAO,CAAC,MAAM,IAAA,WAAI,EAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,IAAA,WAAI,EAAC,YAAY,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IAClF,CAAC;CAAA;AAAA,CAAC;AAEF,SAAe,UAAU,CAAC,GAAW,EAAE,QAAgB;;QACrD,MAAM,QAAQ,GAAG,IAAA,WAAQ,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QACzC,OAAO,CAAC,MAAM,IAAA,WAAI,EAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACzC,CAAC;CAAA;AAAA,CAAC;AAEF,SAAS,IAAI,CAAC,GAAW;IACvB,IAAI,KAAK,GAAG,GAAG,CAAC;IAChB,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,UAAa,CAAC,CAAC;IACzC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACtC,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;QACrC,KAAK,GAAG,IAAA,WAAQ,EAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAChC,CAAC;IACD,KAAK,GAAG,IAAA,WAAQ,EAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IACpC,OAAO,IAAA,gBAAa,EAAC,KAAK,CAAC,CAAC;AAC9B,CAAC"} \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/override.d.ts b/publisher/node_modules/@aminya/cmake-ts/build/override.d.ts new file mode 100644 index 00000000..7c6c6d79 --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/override.d.ts @@ -0,0 +1,3 @@ +import { BuildConfigurationDefaulted } from 'lib'; +export declare function applyOverrides(config: BuildConfigurationDefaulted): number; +//# sourceMappingURL=override.d.ts.map \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/override.d.ts.map b/publisher/node_modules/@aminya/cmake-ts/build/override.d.ts.map new file mode 100644 index 00000000..f4b83b36 --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/override.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"override.d.ts","sourceRoot":"","sources":["../src/override.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,2BAA2B,EAAkB,MAAM,KAAK,CAAC;AAsEjF,wBAAgB,cAAc,CAAC,MAAM,EAAE,2BAA2B,UAOjE"} \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/override.js b/publisher/node_modules/@aminya/cmake-ts/build/override.js new file mode 100644 index 00000000..5110eddb --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/override.js @@ -0,0 +1,74 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.applyOverrides = applyOverrides; +const semver_1 = require("semver"); +const knownOverrides = [{ + match: { + arch: ['x64', 'arm64'], + runtime: 'electron', + runtimeVersion: '>=9', + }, + addDefines: 'V8_COMPRESS_POINTERS', + }, { + match: { + runtime: 'electron', + runtimeVersion: '>=9', + }, + addDefines: 'V8_31BIT_SMIS_ON_64BIT_ARCH' + }, { + match: { + runtime: 'electron', + runtimeVersion: '>=11', + }, + addDefines: 'V8_REVERSE_JSARGS', + }, { + match: { + runtime: 'electron', + runtimeVersion: '>=16', + arch: ['x64', 'arm64'], + }, + addDefines: 'V8_COMPRESS_POINTERS_IN_ISOLATE_CAGE', + }]; +function matchAgainstArray(value, target) { + if (!target) { + return true; + } + let compare; + if (!Array.isArray(target)) { + compare = [target]; + } + else { + compare = target; + } + return compare.includes(value); +} +function matchOverride(config, ov) { + const archMatch = matchAgainstArray(config.arch, ov.match.arch); + const osMath = matchAgainstArray(config.os, ov.match.os); + const runtimeMatch = matchAgainstArray(config.runtime, ov.match.runtime); + if (!archMatch || !osMath || !runtimeMatch) { + return false; + } + if (ov.match.runtimeVersion) { + const compares = Array.isArray(ov.match.runtimeVersion) ? ov.match.runtimeVersion : [ov.match.runtimeVersion]; + if (!compares.some(v => (0, semver_1.satisfies)(config.runtimeVersion, v, { includePrerelease: true }))) { + return false; + } + } + if (Array.isArray(ov.addDefines)) { + config.additionalDefines.push(...ov.addDefines); + } + else { + config.additionalDefines.push(ov.addDefines); + } + return true; +} +function applyOverrides(config) { + return knownOverrides.reduce((prev, curr) => { + if (matchOverride(config, curr)) { + return prev + 1; + } + return prev; + }, 0); +} +//# sourceMappingURL=override.js.map \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/override.js.map b/publisher/node_modules/@aminya/cmake-ts/build/override.js.map new file mode 100644 index 00000000..10bc7b4a --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/override.js.map @@ -0,0 +1 @@ +{"version":3,"file":"override.js","sourceRoot":"","sources":["../src/override.ts"],"names":[],"mappings":";;AAsEA,wCAOC;AA5ED,mCAAmC;AAEnC,MAAM,cAAc,GAAqB,CAAC;QACxC,KAAK,EAAE;YACL,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC;YACtB,OAAO,EAAE,UAAU;YACnB,cAAc,EAAE,KAAK;SACtB;QACD,UAAU,EAAE,sBAAsB;KACnC,EAAE;QACD,KAAK,EAAE;YACL,OAAO,EAAE,UAAU;YACnB,cAAc,EAAE,KAAK;SACtB;QACD,UAAU,EAAE,6BAA6B;KAC1C,EAAE;QACD,KAAK,EAAE;YACL,OAAO,EAAE,UAAU;YACnB,cAAc,EAAE,MAAM;SACvB;QACD,UAAU,EAAE,mBAAmB;KAChC,EAAE;QACD,KAAK,EAAE;YACL,OAAO,EAAE,UAAU;YACnB,cAAc,EAAE,MAAM;YACtB,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC;SACvB;QACD,UAAU,EAAE,sCAAsC;KACnD,CAAC,CAAC;AAEH,SAAS,iBAAiB,CAAI,KAAQ,EAAE,MAAyB;IAC/D,IAAI,CAAC,MAAM,EAAE,CAAC;QAEZ,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,OAAY,CAAC;IACjB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3B,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC;IACrB,CAAC;SAAM,CAAC;QACN,OAAO,GAAG,MAAM,CAAC;IACnB,CAAC;IACD,OAAO,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACjC,CAAC;AAED,SAAS,aAAa,CAAC,MAAmC,EAAE,EAAkB;IAC5E,MAAM,SAAS,GAAG,iBAAiB,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAChE,MAAM,MAAM,GAAG,iBAAiB,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACzD,MAAM,YAAY,GAAG,iBAAiB,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAEzE,IAAI,CAAC,SAAS,IAAI,CAAC,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;QAC3C,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,EAAE,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC;QAC5B,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;QAE9G,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAA,kBAAS,EAAC,MAAM,CAAC,cAAc,EAAE,CAAC,EAAE,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;YAC1F,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC;QACjC,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,CAAC;IAClD,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC;IAC/C,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAgB,cAAc,CAAC,MAAmC;IAChE,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE;QAC1C,IAAI,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC;YAChC,OAAO,IAAI,GAAG,CAAC,CAAC;QAClB,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC,EAAE,CAAC,CAAC,CAAC;AACR,CAAC"} \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/runtimeDistribution.d.ts b/publisher/node_modules/@aminya/cmake-ts/build/runtimeDistribution.d.ts new file mode 100644 index 00000000..baa0dc58 --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/runtimeDistribution.d.ts @@ -0,0 +1,24 @@ +import { BuildConfigurationDefaulted } from './lib'; +export type HashSum = { + getPath: string; + sum: string; +}; +export declare class RuntimeDistribution { + private config; + private _abi; + constructor(config: BuildConfigurationDefaulted); + get internalPath(): string; + get externalPath(): string; + get winLibs(): string[]; + get headerOnly(): boolean; + get abi(): number | null; + checkDownloaded(): Promise; + determineABI(): Promise; + ensureDownloaded(): Promise; + download(): Promise; + downloadHashSums(): Promise; + downloadTar(sums: HashSum[] | null): Promise; + downloadLibs(sums: HashSum[] | null): Promise; + private downloadLib; +} +//# sourceMappingURL=runtimeDistribution.d.ts.map \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/runtimeDistribution.d.ts.map b/publisher/node_modules/@aminya/cmake-ts/build/runtimeDistribution.d.ts.map new file mode 100644 index 00000000..221694c9 --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/runtimeDistribution.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"runtimeDistribution.d.ts","sourceRoot":"","sources":["../src/runtimeDistribution.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,2BAA2B,EAAE,MAAM,OAAO,CAAC;AAKpD,MAAM,MAAM,OAAO,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AASvD,qBAAa,mBAAmB;IAKlB,OAAO,CAAC,MAAM;IAJ1B,OAAO,CAAC,IAAI,CAAuB;gBAIf,MAAM,EAAE,2BAA2B;IAEvD,IAAI,YAAY,WASf;IAED,IAAI,YAAY,WAEf;IAED,IAAI,OAAO,aAEV;IAED,IAAI,UAAU,YAEb;IAED,IAAI,GAAG,kBAEN;IAEK,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC;IAyBnC,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAwC7B,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAKjC,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAOzB,gBAAgB,IAAI,OAAO,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC;IAe7C,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAoBlD,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;YAS3C,WAAW;CAY1B"} \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/runtimeDistribution.js b/publisher/node_modules/@aminya/cmake-ts/build/runtimeDistribution.js new file mode 100644 index 00000000..922b77c7 --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/runtimeDistribution.js @@ -0,0 +1,219 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RuntimeDistribution = void 0; +const path_1 = require("path"); +const fs_extra_1 = require("fs-extra"); +const util_1 = require("./util"); +const url_join_1 = __importDefault(require("url-join")); +const URL_REGISTRY = __importStar(require("./urlRegistry")); +const DOWNLOADER = __importStar(require("./download")); +const fast_glob_1 = __importDefault(require("fast-glob")); +const TEST_SUM = (sums, sum, fPath) => { + const serverSum = sums.find(s => s.getPath === fPath); + if (serverSum && serverSum.sum === sum) { + return true; + } + return false; +}; +class RuntimeDistribution { + constructor(config) { + this.config = config; + this._abi = null; + } + get internalPath() { + return (0, path_1.join)(URL_REGISTRY.HOME_DIRECTORY, '.cmake-ts', this.config.runtime, this.config.os, this.config.arch, `v${this.config.runtimeVersion}`); + } + get externalPath() { + return URL_REGISTRY.getPathsForConfig(this.config).externalPath; + } + get winLibs() { + return URL_REGISTRY.getPathsForConfig(this.config).winLibs.map(lib => (0, path_1.join)(this.internalPath, lib.dir, lib.name)); + } + get headerOnly() { + return URL_REGISTRY.getPathsForConfig(this.config).headerOnly; + } + get abi() { + return this._abi; + } + checkDownloaded() { + return __awaiter(this, void 0, void 0, function* () { + let headers = false; + let libs = true; + let stats = yield (0, util_1.stat)(this.internalPath); + if (!stats.isDirectory()) { + headers = false; + } + if (this.headerOnly) { + stats = yield (0, util_1.stat)((0, path_1.join)(this.internalPath, "include/node/node.h")); + headers = stats.isFile(); + } + else { + stats = yield (0, util_1.stat)((0, path_1.join)(this.internalPath, "src/node.h")); + if (stats.isFile()) { + stats = yield (0, util_1.stat)((0, path_1.join)(this.internalPath, "deps/v8/include/v8.h")); + headers = stats.isFile(); + } + } + if (this.config.os === 'win32') { + const libStats = yield Promise.all(this.winLibs.map(lib => (0, util_1.stat)(lib))); + const libsAreFile = libStats.every(libStat => libStat.isFile()); + libs = libsAreFile; + } + return headers && libs; + }); + } + determineABI() { + return __awaiter(this, void 0, void 0, function* () { + const files = yield (0, fast_glob_1.default)("*/node_version.h", { + cwd: (0, path_1.join)(this.internalPath, "include"), + absolute: true, + onlyFiles: true, + braceExpansion: false, + }); + const filesNum = files.length; + if (filesNum === 0) { + return Promise.reject(new Error("couldn't find node_version.h")); + return; + } + if (filesNum !== 1) { + return Promise.reject(new Error("more than one node_version.h was found.")); + return; + } + const fName = files[0]; + let contents; + try { + contents = yield (0, fs_extra_1.readFile)(fName, 'utf8'); + } + catch (err) { + if (err instanceof Error) { + return Promise.reject(err); + } + throw err; + } + const match = contents.match(/#define\s+NODE_MODULE_VERSION\s+(\d+)/); + if (!match) { + return Promise.reject(new Error('Failed to find NODE_MODULE_VERSION macro')); + return; + } + const version = parseInt(match[1], 10); + if (isNaN(version)) { + return Promise.reject(new Error('Invalid version specified by NODE_MODULE_VERSION macro')); + return; + } + this._abi = version; + return Promise.resolve(); + }); + } + ensureDownloaded() { + return __awaiter(this, void 0, void 0, function* () { + if (!(yield this.checkDownloaded())) { + yield this.download(); + } + }); + } + download() { + return __awaiter(this, void 0, void 0, function* () { + yield (0, fs_extra_1.ensureDir)(this.internalPath); + const sums = yield this.downloadHashSums(); + yield this.downloadTar(sums); + yield this.downloadLibs(sums); + }); + } + downloadHashSums() { + return __awaiter(this, void 0, void 0, function* () { + if (this.config.runtime === 'node' || this.config.runtime === 'iojs') { + const sumurl = (0, url_join_1.default)(this.externalPath, "SHASUMS256.txt"); + const str = yield DOWNLOADER.downloadToString(sumurl); + return str.split('\n').map(line => { + const parts = line.split(/\s+/); + return { + getPath: parts[1], + sum: parts[0], + }; + }).filter(i => i.getPath && i.sum); + } + return null; + }); + } + downloadTar(sums) { + return __awaiter(this, void 0, void 0, function* () { + const tarLocalPath = URL_REGISTRY.getPathsForConfig(this.config).tarPath; + const tarUrl = (0, url_join_1.default)(this.externalPath, tarLocalPath); + const sum = yield DOWNLOADER.downloadTgz(tarUrl, { + cwd: this.internalPath, + hashType: sums ? 'sha256' : null, + strip: 1, + filter: (p) => { + if (p === this.internalPath) { + return true; + } + const ext = (0, path_1.extname)(p); + return ext && ext.toLowerCase() === '.h'; + }, + }); + if (sums && !TEST_SUM(sums, sum, tarLocalPath)) { + throw new Error("Checksum mismatch"); + } + }); + } + downloadLibs(sums) { + return __awaiter(this, void 0, void 0, function* () { + if (this.config.os !== 'win32') { + return; + } + const paths = URL_REGISTRY.getPathsForConfig(this.config); + yield Promise.all(paths.winLibs.map(path => this.downloadLib(path, sums))); + }); + } + downloadLib(path, sums) { + return __awaiter(this, void 0, void 0, function* () { + const fPath = path.dir ? (0, url_join_1.default)(path.dir, path.name) : path.name; + const libUrl = (0, url_join_1.default)(this.externalPath, fPath); + yield (0, fs_extra_1.ensureDir)((0, path_1.join)(this.internalPath, path.dir)); + const sum = yield DOWNLOADER.downloadFile(libUrl, { + path: (0, path_1.join)(this.internalPath, fPath), + hashType: sums ? "sha256" : null, + }); + if (sums && !TEST_SUM(sums, sum, fPath)) { + throw new Error("Checksum mismatch"); + } + }); + } +} +exports.RuntimeDistribution = RuntimeDistribution; +//# sourceMappingURL=runtimeDistribution.js.map \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/runtimeDistribution.js.map b/publisher/node_modules/@aminya/cmake-ts/build/runtimeDistribution.js.map new file mode 100644 index 00000000..5f3f8ea9 --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/runtimeDistribution.js.map @@ -0,0 +1 @@ +{"version":3,"file":"runtimeDistribution.js","sourceRoot":"","sources":["../src/runtimeDistribution.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAiD;AACjD,uCAA+C;AAC/C,iCAA8B;AAC9B,wDAA+B;AAE/B,4DAA8C;AAC9C,uDAAyC;AACzC,0DAA4B;AAG5B,MAAM,QAAQ,GAAG,CAAC,IAAe,EAAE,GAAkB,EAAE,KAAa,EAAE,EAAE;IACtE,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,KAAK,CAAC,CAAC;IACtD,IAAI,SAAS,IAAI,SAAS,CAAC,GAAG,KAAK,GAAG,EAAE,CAAC;QACvC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAA;AAED,MAAa,mBAAmB;IAK9B,YAAoB,MAAmC;QAAnC,WAAM,GAAN,MAAM,CAA6B;QAJ/C,SAAI,GAAkB,IAAI,CAAC;IAIwB,CAAC;IAE5D,IAAI,YAAY;QACd,OAAO,IAAA,WAAQ,EACb,YAAY,CAAC,cAAc,EAC3B,WAAW,EACX,IAAI,CAAC,MAAM,CAAC,OAAO,EACnB,IAAI,CAAC,MAAM,CAAC,EAAE,EACd,IAAI,CAAC,MAAM,CAAC,IAAI,EAChB,IAAI,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,CACjC,CAAC;IACJ,CAAC;IAED,IAAI,YAAY;QACd,OAAO,YAAY,CAAC,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC;IAClE,CAAC;IAED,IAAI,OAAO;QACT,OAAO,YAAY,CAAC,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,IAAA,WAAQ,EAAC,IAAI,CAAC,YAAY,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IACxH,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,YAAY,CAAC,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC;IAChE,CAAC;IAED,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAEK,eAAe;;YACnB,IAAI,OAAO,GAAG,KAAK,CAAC;YACpB,IAAI,IAAI,GAAG,IAAI,CAAC;YAChB,IAAI,KAAK,GAAG,MAAM,IAAA,WAAI,EAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YAC1C,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;gBACzB,OAAO,GAAG,KAAK,CAAC;YAClB,CAAC;YACD,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;gBACpB,KAAK,GAAG,MAAM,IAAA,WAAI,EAAC,IAAA,WAAQ,EAAC,IAAI,CAAC,YAAY,EAAE,qBAAqB,CAAC,CAAC,CAAC;gBACvE,OAAO,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;YAC3B,CAAC;iBAAM,CAAC;gBACN,KAAK,GAAG,MAAM,IAAA,WAAI,EAAC,IAAA,WAAQ,EAAC,IAAI,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC;gBAC9D,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;oBACnB,KAAK,GAAG,MAAM,IAAA,WAAI,EAAC,IAAA,WAAQ,EAAC,IAAI,CAAC,YAAY,EAAE,sBAAsB,CAAC,CAAC,CAAC;oBACxE,OAAO,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;gBAC3B,CAAC;YACH,CAAC;YACD,IAAI,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,OAAO,EAAE,CAAC;gBAC/B,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,IAAA,WAAI,EAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBACvE,MAAM,WAAW,GAAG,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;gBAC/D,IAAI,GAAG,WAAW,CAAA;YACpB,CAAC;YACD,OAAO,OAAO,IAAI,IAAI,CAAC;QACzB,CAAC;KAAA;IAEK,YAAY;;YAChB,MAAM,KAAK,GAAG,MAAM,IAAA,mBAAI,EAAC,kBAAkB,EAAE;gBAC3C,GAAG,EAAE,IAAA,WAAQ,EAAC,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC;gBAC3C,QAAQ,EAAE,IAAI;gBACd,SAAS,EAAE,IAAI;gBACf,cAAc,EAAE,KAAK;aACtB,CAAC,CAAC;YACH,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC;YAC9B,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;gBACnB,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC,CAAC;gBACjE,OAAO;YACT,CAAC;YACD,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;gBACnB,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC,CAAC;gBAC5E,OAAO;YACT,CAAC;YACD,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;YACvB,IAAI,QAAgB,CAAC;YACrB,IAAI,CAAC;gBACH,QAAQ,GAAG,MAAM,IAAA,mBAAQ,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;YAC3C,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,IAAI,GAAG,YAAY,KAAK,EAAE,CAAC;oBACzB,OAAO,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;gBAC7B,CAAC;gBACD,MAAM,GAAG,CAAC;YACZ,CAAC;YACD,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;YACtE,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC,CAAC;gBAC7E,OAAO;YACT,CAAC;YACD,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACvC,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;gBACnB,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC,CAAC;gBAC3F,OAAO;YACT,CAAC;YACD,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC;YACpB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;QAC3B,CAAC;KAAA;IAEK,gBAAgB;;YACpB,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,eAAe,EAAE,CAAC,EAAE,CAAC;gBACpC,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;YACxB,CAAC;QACH,CAAC;KAAA;IACK,QAAQ;;YACZ,MAAM,IAAA,oBAAS,EAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YACnC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC;YAC3C,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YAC7B,MAAM,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QAChC,CAAC;KAAA;IAEK,gBAAgB;;YACpB,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,KAAK,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,KAAK,MAAM,EAAE,CAAC;gBACrE,MAAM,MAAM,GAAG,IAAA,kBAAO,EAAC,IAAI,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAC;gBAC5D,MAAM,GAAG,GAAG,MAAM,UAAU,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;gBACtD,OAAO,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;oBAChC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;oBAChC,OAAO;wBACL,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;wBACjB,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;qBACd,CAAC;gBACJ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;YACrC,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;KAAA;IAEK,WAAW,CAAC,IAAsB;;YACtC,MAAM,YAAY,GAAG,YAAY,CAAC,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;YACzE,MAAM,MAAM,GAAG,IAAA,kBAAO,EAAC,IAAI,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;YACxD,MAAM,GAAG,GAAG,MAAM,UAAU,CAAC,WAAW,CAAC,MAAM,EAAE;gBAC/C,GAAG,EAAE,IAAI,CAAC,YAAY;gBACtB,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI;gBAChC,KAAK,EAAE,CAAC;gBACR,MAAM,EAAE,CAAC,CAAS,EAAE,EAAE;oBACpB,IAAI,CAAC,KAAK,IAAI,CAAC,YAAY,EAAE,CAAC;wBAC5B,OAAO,IAAI,CAAC;oBACd,CAAC;oBACD,MAAM,GAAG,GAAG,IAAA,cAAO,EAAC,CAAC,CAAC,CAAC;oBACvB,OAAO,GAAG,IAAI,GAAG,CAAC,WAAW,EAAE,KAAK,IAAI,CAAC;gBAC3C,CAAC;aAC4B,CAAC,CAAC;YACjC,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,YAAY,CAAC,EAAE,CAAC;gBAC/C,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;YACvC,CAAC;QACH,CAAC;KAAA;IAEK,YAAY,CAAC,IAAsB;;YACvC,IAAI,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,OAAO,EAAE,CAAC;gBAC/B,OAAO;YACT,CAAC;YACD,MAAM,KAAK,GAAG,YAAY,CAAC,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAE1D,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;QAC7E,CAAC;KAAA;IAEa,WAAW,CAAC,IAAmC,EAAE,IAAsB;;YACnF,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAA,kBAAO,EAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;YAClE,MAAM,MAAM,GAAG,IAAA,kBAAO,EAAC,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;YACjD,MAAM,IAAA,oBAAS,EAAC,IAAA,WAAQ,EAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;YACvD,MAAM,GAAG,GAAG,MAAM,UAAU,CAAC,YAAY,CAAC,MAAM,EAAE;gBAChD,IAAI,EAAE,IAAA,WAAQ,EAAC,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC;gBACxC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI;aACjC,CAAC,CAAC;YACH,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC;gBACxC,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;YACvC,CAAC;QACH,CAAC;KAAA;CACF;AAvKD,kDAuKC"} \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/urlRegistry.d.ts b/publisher/node_modules/@aminya/cmake-ts/build/urlRegistry.d.ts new file mode 100644 index 00000000..34e46653 --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/urlRegistry.d.ts @@ -0,0 +1,12 @@ +import { BuildConfigurationDefaulted } from './lib'; +export declare const HOME_DIRECTORY: string; +export declare function getPathsForConfig(config: BuildConfigurationDefaulted): { + externalPath: string; + winLibs: { + dir: string; + name: string; + }[]; + tarPath: string; + headerOnly: boolean; +}; +//# sourceMappingURL=urlRegistry.d.ts.map \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/urlRegistry.d.ts.map b/publisher/node_modules/@aminya/cmake-ts/build/urlRegistry.d.ts.map new file mode 100644 index 00000000..c29bcdbb --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/urlRegistry.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"urlRegistry.d.ts","sourceRoot":"","sources":["../src/urlRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,OAAO,CAAC;AASpD,eAAO,MAAM,cAAc,EAAwE,MAAM,CAAC;AAE1G,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,2BAA2B;;;;;;;;EA+BpE"} \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/urlRegistry.js b/publisher/node_modules/@aminya/cmake-ts/build/urlRegistry.js new file mode 100644 index 00000000..ad13f7f0 --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/urlRegistry.js @@ -0,0 +1,69 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.HOME_DIRECTORY = void 0; +exports.getPathsForConfig = getPathsForConfig; +const gte_1 = __importDefault(require("semver/functions/gte")); +const lt_1 = __importDefault(require("semver/functions/lt")); +const os_1 = __importDefault(require("os")); +const NODE_MIRROR = process.env.NVM_NODEJS_ORG_MIRROR || "https://nodejs.org/dist"; +const IOJS_MIRROR = process.env.NVM_IOJS_ORG_MIRROR || "https://iojs.org/dist"; +const ELECTRON_MIRROR = process.env.ELECTRON_MIRROR || "https://atom.io/download/atom-shell"; +exports.HOME_DIRECTORY = process.env[(os_1.default.platform() === "win32") ? "USERPROFILE" : "HOME"]; +function getPathsForConfig(config) { + switch (config.runtime) { + case "node": { + return ((0, lt_1.default)(config.runtimeVersion, "4.0.0") ? nodePrehistoric : nodeModern)(config); + } + case "iojs": { + return { + externalPath: `${IOJS_MIRROR}/v${config.runtimeVersion}/`, + winLibs: [{ + dir: config.arch === 'x64' ? 'win-x64' : 'win-x86', + name: `${config.runtime}.lib`, + }], + tarPath: `${config.runtime}-v${config.runtimeVersion}.tar.gz`, + headerOnly: false, + }; + } + case "electron": { + return { + externalPath: `${ELECTRON_MIRROR}/v${config.runtimeVersion}/`, + winLibs: [{ + dir: config.arch === 'x64' ? 'x64' : '', + name: 'node.lib', + }], + tarPath: `node-v${config.runtimeVersion}.tar.gz`, + headerOnly: (0, gte_1.default)(config.runtimeVersion, "4.0.0-alpha"), + }; + } + default: { + throw new Error(`Unsupported runtime ${config.runtime}`); + } + } +} +function nodePrehistoric(config) { + return { + externalPath: `${NODE_MIRROR}/v${config.runtimeVersion}/`, + winLibs: [{ + dir: config.arch === 'x64' ? 'x64' : '', + name: `${config.runtime}.lib`, + }], + tarPath: `${config.runtime}-v${config.runtimeVersion}.tar.gz`, + headerOnly: false, + }; +} +function nodeModern(config) { + return { + externalPath: `${NODE_MIRROR}/v${config.runtimeVersion}/`, + winLibs: [{ + dir: config.arch === 'x64' ? 'win-x64' : 'win-x86', + name: `${config.runtime}.lib`, + }], + tarPath: `${config.runtime}-v${config.runtimeVersion}-headers.tar.gz`, + headerOnly: true, + }; +} +//# sourceMappingURL=urlRegistry.js.map \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/urlRegistry.js.map b/publisher/node_modules/@aminya/cmake-ts/build/urlRegistry.js.map new file mode 100644 index 00000000..19bd8b60 --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/urlRegistry.js.map @@ -0,0 +1 @@ +{"version":3,"file":"urlRegistry.js","sourceRoot":"","sources":["../src/urlRegistry.ts"],"names":[],"mappings":";;;;;;AAWA,8CA+BC;AAzCD,+DAAuC;AACvC,6DAAqC;AACrC,4CAAoB;AAEpB,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,yBAAyB,CAAC;AACnF,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,uBAAuB,CAAC;AAC/E,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,qCAAqC,CAAC;AAEhF,QAAA,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,YAAE,CAAC,QAAQ,EAAE,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAW,CAAC;AAE1G,SAAgB,iBAAiB,CAAC,MAAmC;IACnE,QAAQ,MAAM,CAAC,OAAO,EAAE,CAAC;QACvB,KAAK,MAAM,CAAC,CAAC,CAAC;YACZ,OAAO,CAAC,IAAA,YAAE,EAAC,MAAM,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;QACrF,CAAC;QACD,KAAK,MAAM,CAAC,CAAC,CAAC;YACZ,OAAO;gBACL,YAAY,EAAE,GAAG,WAAW,KAAK,MAAM,CAAC,cAAc,GAAG;gBACzD,OAAO,EAAE,CAAC;wBACR,GAAG,EAAE,MAAM,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;wBAClD,IAAI,EAAE,GAAG,MAAM,CAAC,OAAO,MAAM;qBAC9B,CAAC;gBACF,OAAO,EAAE,GAAG,MAAM,CAAC,OAAO,KAAK,MAAM,CAAC,cAAc,SAAS;gBAC7D,UAAU,EAAE,KAAK;aAClB,CAAC;QACJ,CAAC;QACD,KAAK,UAAU,CAAC,CAAC,CAAC;YAChB,OAAO;gBACL,YAAY,EAAE,GAAG,eAAe,KAAK,MAAM,CAAC,cAAc,GAAG;gBAC7D,OAAO,EAAE,CAAC;wBACR,GAAG,EAAE,MAAM,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;wBACvC,IAAI,EAAE,UAAU;qBACjB,CAAC;gBACF,OAAO,EAAE,SAAS,MAAM,CAAC,cAAc,SAAS;gBAChD,UAAU,EAAE,IAAA,aAAG,EAAC,MAAM,CAAC,cAAc,EAAE,aAAa,CAAC;aACtD,CAAC;QACJ,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACR,MAAM,IAAI,KAAK,CAAC,uBAAuB,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CAAC,MAAmC;IAC1D,OAAO;QACL,YAAY,EAAE,GAAG,WAAW,KAAK,MAAM,CAAC,cAAc,GAAG;QACzD,OAAO,EAAE,CAAC;gBACR,GAAG,EAAE,MAAM,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;gBACvC,IAAI,EAAE,GAAG,MAAM,CAAC,OAAO,MAAM;aAC9B,CAAC;QACF,OAAO,EAAE,GAAG,MAAM,CAAC,OAAO,KAAK,MAAM,CAAC,cAAc,SAAS;QAC7D,UAAU,EAAE,KAAK;KAClB,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CAAC,MAAmC;IACrD,OAAO;QACL,YAAY,EAAE,GAAG,WAAW,KAAK,MAAM,CAAC,cAAc,GAAG;QACzD,OAAO,EAAE,CAAC;gBACR,GAAG,EAAE,MAAM,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;gBAClD,IAAI,EAAE,GAAG,MAAM,CAAC,OAAO,MAAM;aAC9B,CAAC;QACF,OAAO,EAAE,GAAG,MAAM,CAAC,OAAO,KAAK,MAAM,CAAC,cAAc,iBAAiB;QACrE,UAAU,EAAE,IAAI;KACjB,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/util.d.ts b/publisher/node_modules/@aminya/cmake-ts/build/util.d.ts new file mode 100644 index 00000000..83f9044e --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/util.d.ts @@ -0,0 +1,9 @@ +import { PathLike, StatOptions, Stats } from 'fs-extra'; +export declare const GET_CMAKE_VS_GENERATOR: (cmake: string, arch: string) => Promise; +export declare const EXEC_CAPTURE: (command: string) => Promise; +export declare const EXEC: (command: string) => Promise; +export declare const RUN: (command: string, cwd?: string, silent?: boolean) => Promise; +export declare function stat(path: PathLike, options?: StatOptions & { + bigint: false; +}): Promise; +//# sourceMappingURL=util.d.ts.map \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/util.d.ts.map b/publisher/node_modules/@aminya/cmake-ts/build/util.d.ts.map new file mode 100644 index 00000000..11f2ecff --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/util.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAmB,WAAW,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEzE,eAAO,MAAM,sBAAsB,UAAiB,MAAM,QAAQ,MAAM,KAAG,OAAO,CAAC,MAAM,CAoCxF,CAAA;AAED,eAAO,MAAM,YAAY,YAAa,MAAM,KAAG,OAAO,CAAC,MAAM,CAM5D,CAAC;AAEF,eAAO,MAAM,IAAI,YAAa,MAAM,KAAG,OAAO,CAAC,MAAM,CAUpD,CAAC;AAEF,eAAO,MAAM,GAAG,YAAa,MAAM,QAAO,MAAM,WAA0B,OAAO,KAAW,OAAO,CAAC,IAAI,CA4BvG,CAAC;AAGF,wBAAsB,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG;IAAE,MAAM,EAAE,KAAK,CAAA;CAAE,GAAG,OAAO,CAAC,KAAK,CAAC,CAQpG"} \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/util.js b/publisher/node_modules/@aminya/cmake-ts/build/util.js new file mode 100644 index 00000000..e5d4e9d9 --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/util.js @@ -0,0 +1,117 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RUN = exports.EXEC = exports.EXEC_CAPTURE = exports.GET_CMAKE_VS_GENERATOR = void 0; +exports.stat = stat; +const child_process_1 = require("child_process"); +const splitargs2_1 = __importDefault(require("splitargs2")); +const fs_extra_1 = require("fs-extra"); +const GET_CMAKE_VS_GENERATOR = (cmake, arch) => __awaiter(void 0, void 0, void 0, function* () { + const generators = yield (0, exports.EXEC_CAPTURE)(`"${cmake}" -G`); + const hasCR = generators.includes('\r\n'); + const output = hasCR ? generators.split('\r\n') : generators.split('\n'); + let found = false; + let useVSGen = ""; + for (const line of output) { + if (!found && line.trim() === 'Generators') { + found = true; + continue; + } + const genParts = line.split('='); + if (genParts.length <= 1) { + continue; + } + genParts[0] = genParts[0].trim(); + if (genParts[0].match(/Visual\s+Studio\s+\d+\s+\d+\s+\[arch\]/)) { + console.log('Found generator: ', genParts[0]); + useVSGen = genParts[0]; + break; + } + } + if (arch === 'x64') { + useVSGen = useVSGen.replace('[arch]', 'Win64').trim(); + } + else if (arch === 'x86') { + useVSGen = useVSGen.replace('[arch]', '').trim(); + } + else { + console.error('Failed to find valid VS gen, using native. Good Luck.'); + return 'native'; + } + return useVSGen; +}); +exports.GET_CMAKE_VS_GENERATOR = GET_CMAKE_VS_GENERATOR; +const EXEC_CAPTURE = (command) => { + return new Promise(resolve => { + (0, child_process_1.exec)(command, (_, stdout, stderr) => { + resolve(stdout || stderr); + }); + }); +}; +exports.EXEC_CAPTURE = EXEC_CAPTURE; +const EXEC = (command) => { + return new Promise((resolve, reject) => { + (0, child_process_1.exec)(command, (err, stdout, stderr) => { + if (err) { + reject(new Error(`${err.message}\n${stdout || stderr}`)); + } + else { + resolve(stdout); + } + }); + }); +}; +exports.EXEC = EXEC; +const RUN = (command, cwd = process.cwd(), silent = false) => { + return new Promise((resolve, reject) => { + const args = (0, splitargs2_1.default)(command); + const name = args[0]; + args.splice(0, 1); + const child = (0, child_process_1.spawn)(name, args, { + stdio: silent ? 'ignore' : 'inherit', + cwd, + }); + let ended = false; + child.on('error', e => { + if (!ended) { + reject(e); + ended = true; + } + }); + child.on('exit', (code, signal) => { + if (ended) { + return; + } + if (code === 0) { + resolve(); + } + else { + reject(new Error(`Process terminated: ${code !== null && code !== void 0 ? code : signal}`)); + } + ended = true; + }); + }); +}; +exports.RUN = RUN; +function stat(path, options) { + return __awaiter(this, void 0, void 0, function* () { + try { + return yield (0, fs_extra_1.stat)(path, options); + } + catch (_a) { + return new fs_extra_1.Stats(); + } + }); +} +//# sourceMappingURL=util.js.map \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/build/util.js.map b/publisher/node_modules/@aminya/cmake-ts/build/util.js.map new file mode 100644 index 00000000..d1722225 --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/build/util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AA6FA,oBAQC;AArGD,iDAA4C;AAC5C,4DAAmC;AACnC,uCAAyE;AAElE,MAAM,sBAAsB,GAAG,CAAO,KAAa,EAAE,IAAY,EAAmB,EAAE;IAC3F,MAAM,UAAU,GAAG,MAAM,IAAA,oBAAY,EAAC,IAAI,KAAK,MAAM,CAAC,CAAC;IACvD,MAAM,KAAK,GAAG,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC1C,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACzE,IAAI,KAAK,GAAG,KAAK,CAAC;IAClB,IAAI,QAAQ,GAAG,EAAE,CAAC;IAElB,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QAC1B,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,YAAY,EAAE,CAAC;YAC3C,KAAK,GAAG,IAAI,CAAC;YACb,SAAS;QACX,CAAC;QACD,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACjC,IAAI,QAAQ,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;YAEzB,SAAS;QACX,CAAC;QACD,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAGjC,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,wCAAwC,CAAC,EAAE,CAAC;YAChE,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;YAE9C,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;YACvB,MAAM;QACR,CAAC;IACH,CAAC;IACD,IAAI,IAAI,KAAK,KAAK,EAAE,CAAC;QACnB,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;IACxD,CAAC;SAAM,IAAI,IAAI,KAAK,KAAK,EAAE,CAAC;QAC1B,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACnD,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,KAAK,CAAC,uDAAuD,CAAC,CAAC;QACvE,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAA;AApCY,QAAA,sBAAsB,0BAoClC;AAEM,MAAM,YAAY,GAAG,CAAC,OAAe,EAAmB,EAAE;IAC/D,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;QAC3B,IAAA,oBAAI,EAAC,OAAO,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;YAClC,OAAO,CAAC,MAAM,IAAI,MAAM,CAAC,CAAC;QAC5B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AANW,QAAA,YAAY,gBAMvB;AAEK,MAAM,IAAI,GAAG,CAAC,OAAe,EAAmB,EAAE;IACvD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,IAAA,oBAAI,EAAC,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;YACpC,IAAI,GAAG,EAAE,CAAC;gBACR,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,GAAG,CAAC,OAAO,KAAK,MAAM,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC;YAC3D,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,MAAM,CAAC,CAAC;YAClB,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAVW,QAAA,IAAI,QAUf;AAEK,MAAM,GAAG,GAAG,CAAC,OAAe,EAAE,MAAc,OAAO,CAAC,GAAG,EAAE,EAAE,SAAkB,KAAK,EAAiB,EAAE;IAC1G,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,IAAI,GAAG,IAAA,oBAAS,EAAC,OAAO,CAAC,CAAC;QAChC,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACrB,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAClB,MAAM,KAAK,GAAG,IAAA,qBAAK,EAAC,IAAI,EAAE,IAAI,EAAE;YAC9B,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;YACpC,GAAG;SACJ,CAAC,CAAC;QACH,IAAI,KAAK,GAAG,KAAK,CAAC;QAClB,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE;YACpB,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,MAAM,CAAC,CAAC,CAAC,CAAC;gBACV,KAAK,GAAG,IAAI,CAAC;YACf,CAAC;QACH,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE;YAChC,IAAI,KAAK,EAAE,CAAC;gBACV,OAAO;YACT,CAAC;YACD,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;gBACf,OAAO,EAAE,CAAC;YACZ,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,IAAI,KAAK,CAAC,uBAAuB,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,MAAM,EAAE,CAAC,CAAC,CAAC;YAC7D,CAAC;YACD,KAAK,GAAG,IAAI,CAAC;QACf,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AA5BW,QAAA,GAAG,OA4Bd;AAGF,SAAsB,IAAI,CAAC,IAAc,EAAE,OAAyC;;QAClF,IAAI,CAAC;YACH,OAAO,MAAM,IAAA,eAAO,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACtC,CAAC;QAAC,WAAM,CAAC;YAGP,OAAO,IAAI,gBAAK,EAAE,CAAC;QACrB,CAAC;IACH,CAAC;CAAA"} \ No newline at end of file diff --git a/publisher/node_modules/@aminya/cmake-ts/package.json b/publisher/node_modules/@aminya/cmake-ts/package.json new file mode 100644 index 00000000..1d59a4a5 --- /dev/null +++ b/publisher/node_modules/@aminya/cmake-ts/package.json @@ -0,0 +1,75 @@ +{ + "name": "@aminya/cmake-ts", + "version": "0.3.0-aminya.7", + "description": "cmake-js rewrite in typescript to support advanced build configurations", + "main": "build/lib.js", + "bin": "build/main.js", + "files": [ + "build/**/*.js", + "build/**/*.js.map", + "build/**/*.d.ts", + "build/**/*.d.ts.map" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/EmbeddedEnterprises/cmake-ts.git" + }, + "keywords": [ + "cmake", + "nan", + "node", + "native", + "addon", + "build", + "cmake-js" + ], + "author": "Martin Koppehel", + "license": "MIT", + "bugs": { + "url": "https://github.com/EmbeddedEnterprises/cmake-ts/issues" + }, + "homepage": "https://github.com/EmbeddedEnterprises/cmake-ts#readme", + "devDependencies": { + "@types/fs-extra": "~11.0.4", + "@types/lodash": "~4.17.12", + "@types/minizlib": "~2.1.7", + "@types/node": "^22.7.9", + "@types/npmlog": "~7.0.0", + "@types/request": "~2.48.12", + "@types/resolve": "~1.20.6", + "@types/semver": "~7.5.8", + "@types/tar": "^6.1.13", + "@types/unzipper": "~0.10.10", + "@types/url-join": "~4.0.3", + "@types/which": "~3.0.4", + "eslint-config-atomic": "^1.22.1", + "npm-check": "^6.0.1", + "shx": "^0.3.4", + "typescript": "^5.6.3" + }, + "dependencies": { + "@cypress/request": "^3.0.5", + "fast-glob": "^3.3.2", + "fs-extra": "^10", + "lodash": "^4.17.21", + "memory-stream": "1.0.0", + "minizlib": "^2", + "npmlog": "^6", + "resolve": "^1.22.8", + "semver": "^7.6.3", + "splitargs2": "^0.1.3", + "tar": "^6", + "unzipper": "^0.12.3", + "url-join": "^4.0.1", + "which": "^2" + }, + "scripts": { + "lint": "npm run test.lint -- --fix", + "test.lint": "eslint .", + "deps": "npm-check -p", + "devdeps": "npm-check -ds", + "test": "echo \"Error: no test specified\" && exit 1", + "start": "tsc -w", + "build": "shx rm -rf build && tsc" + } +} \ No newline at end of file diff --git a/publisher/node_modules/@cypress/request/LICENSE b/publisher/node_modules/@cypress/request/LICENSE new file mode 100644 index 00000000..a4a9aee0 --- /dev/null +++ b/publisher/node_modules/@cypress/request/LICENSE @@ -0,0 +1,55 @@ +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and + +You must cause any modified files to carry prominent notices stating that You changed the files; and + +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/publisher/node_modules/@cypress/request/README.md b/publisher/node_modules/@cypress/request/README.md new file mode 100644 index 00000000..47bc4da7 --- /dev/null +++ b/publisher/node_modules/@cypress/request/README.md @@ -0,0 +1,1032 @@ + +# @cypress/request - Simplified HTTP client + +[![npm package](https://nodei.co/npm/@cypress/request.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/@cypress/request/) + +**This is a fork of [`request`](https://github.com/request/request) for use in [Cypress](https://github.com/cypress-io/cypress).** + +## Super simple to use + +Request is designed to be the simplest way possible to make http calls. It supports HTTPS and follows redirects by default. + +```js +const request = require('@cypress/request'); +request('http://www.google.com', function (error, response, body) { + console.error('error:', error); // Print the error if one occurred + console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received + console.log('body:', body); // Print the HTML for the Google homepage. +}); +``` + + +## Table of contents + +- [Streaming](#streaming) +- [Promises & Async/Await](#promises--asyncawait) +- [Forms](#forms) +- [HTTP Authentication](#http-authentication) +- [Custom HTTP Headers](#custom-http-headers) +- [Proxies](#proxies) +- [Unix Domain Sockets](#unix-domain-sockets) +- [TLS/SSL Protocol](#tlsssl-protocol) +- [Support for HAR 1.2](#support-for-har-12) +- [**All Available Options**](#requestoptions-callback) + +Request also offers [convenience methods](#convenience-methods) like +`request.defaults` and `request.post`, and there are +lots of [usage examples](#examples) and several +[debugging techniques](#debugging). + + +--- + + +## Streaming + +You can stream any response to a file stream. + +```js +request('http://google.com/doodle.png').pipe(fs.createWriteStream('doodle.png')) +``` + +You can also stream a file to a PUT or POST request. This method will also check the file extension against a mapping of file extensions to content-types (in this case `application/json`) and use the proper `content-type` in the PUT request (if the headers don’t already provide one). + +```js +fs.createReadStream('file.json').pipe(request.put('http://mysite.com/obj.json')) +``` + +Request can also `pipe` to itself. When doing so, `content-type` and `content-length` are preserved in the PUT headers. + +```js +request.get('http://google.com/img.png').pipe(request.put('http://mysite.com/img.png')) +``` + +Request emits a "response" event when a response is received. The `response` argument will be an instance of [http.IncomingMessage](https://nodejs.org/api/http.html#http_class_http_incomingmessage). + +```js +request + .get('http://google.com/img.png') + .on('response', function(response) { + console.log(response.statusCode) // 200 + console.log(response.headers['content-type']) // 'image/png' + }) + .pipe(request.put('http://mysite.com/img.png')) +``` + +To easily handle errors when streaming requests, listen to the `error` event before piping: + +```js +request + .get('http://mysite.com/doodle.png') + .on('error', function(err) { + console.error(err) + }) + .pipe(fs.createWriteStream('doodle.png')) +``` + +Now let’s get fancy. + +```js +http.createServer(function (req, resp) { + if (req.url === '/doodle.png') { + if (req.method === 'PUT') { + req.pipe(request.put('http://mysite.com/doodle.png')) + } else if (req.method === 'GET' || req.method === 'HEAD') { + request.get('http://mysite.com/doodle.png').pipe(resp) + } + } +}) +``` + +You can also `pipe()` from `http.ServerRequest` instances, as well as to `http.ServerResponse` instances. The HTTP method, headers, and entity-body data will be sent. Which means that, if you don't really care about security, you can do: + +```js +http.createServer(function (req, resp) { + if (req.url === '/doodle.png') { + const x = request('http://mysite.com/doodle.png') + req.pipe(x) + x.pipe(resp) + } +}) +``` + +And since `pipe()` returns the destination stream in ≥ Node 0.5.x you can do one line proxying. :) + +```js +req.pipe(request('http://mysite.com/doodle.png')).pipe(resp) +``` + +Also, none of this new functionality conflicts with requests previous features, it just expands them. + +```js +const r = request.defaults({'proxy':'http://localproxy.com'}) + +http.createServer(function (req, resp) { + if (req.url === '/doodle.png') { + r.get('http://google.com/doodle.png').pipe(resp) + } +}) +``` + +You can still use intermediate proxies, the requests will still follow HTTP forwards, etc. + +[back to top](#table-of-contents) + + +--- + + +## Promises & Async/Await + +`request` supports both streaming and callback interfaces natively. If you'd like `request` to return a Promise instead, you can use an alternative interface wrapper for `request`. These wrappers can be useful if you prefer to work with Promises, or if you'd like to use `async`/`await` in ES2017. + +Several alternative interfaces are provided by the request team, including: +- [`request-promise`](https://github.com/cypress-io/request-promise) (uses [Bluebird](https://github.com/petkaantonov/bluebird) Promises) +- [`request-promise-native`](https://github.com/cypress-io/request-promise-native) (uses native Promises) +- [`request-promise-any`](https://github.com/cypress-io/request-promise-any) (uses [any-promise](https://www.npmjs.com/package/any-promise) Promises) + +Also, [`util.promisify`](https://nodejs.org/api/util.html#util_util_promisify_original), which is available from Node.js v8.0 can be used to convert a regular function that takes a callback to return a promise instead. + + +[back to top](#table-of-contents) + + +--- + + +## Forms + +`request` supports `application/x-www-form-urlencoded` and `multipart/form-data` form uploads. For `multipart/related` refer to the `multipart` API. + + +#### application/x-www-form-urlencoded (URL-Encoded Forms) + +URL-encoded forms are simple. + +```js +request.post('http://service.com/upload', {form:{key:'value'}}) +// or +request.post('http://service.com/upload').form({key:'value'}) +// or +request.post({url:'http://service.com/upload', form: {key:'value'}}, function(err,httpResponse,body){ /* ... */ }) +``` + + +#### multipart/form-data (Multipart Form Uploads) + +For `multipart/form-data` we use the [form-data](https://github.com/form-data/form-data) library by [@felixge](https://github.com/felixge). For the most cases, you can pass your upload form data via the `formData` option. + + +```js +const formData = { + // Pass a simple key-value pair + my_field: 'my_value', + // Pass data via Buffers + my_buffer: Buffer.from([1, 2, 3]), + // Pass data via Streams + my_file: fs.createReadStream(__dirname + '/unicycle.jpg'), + // Pass multiple values /w an Array + attachments: [ + fs.createReadStream(__dirname + '/attachment1.jpg'), + fs.createReadStream(__dirname + '/attachment2.jpg') + ], + // Pass optional meta-data with an 'options' object with style: {value: DATA, options: OPTIONS} + // Use case: for some types of streams, you'll need to provide "file"-related information manually. + // See the `form-data` README for more information about options: https://github.com/form-data/form-data + custom_file: { + value: fs.createReadStream('/dev/urandom'), + options: { + filename: 'topsecret.jpg', + contentType: 'image/jpeg' + } + } +}; +request.post({url:'http://service.com/upload', formData: formData}, function optionalCallback(err, httpResponse, body) { + if (err) { + return console.error('upload failed:', err); + } + console.log('Upload successful! Server responded with:', body); +}); +``` + +For advanced cases, you can access the form-data object itself via `r.form()`. This can be modified until the request is fired on the next cycle of the event-loop. (Note that this calling `form()` will clear the currently set form data for that request.) + +```js +// NOTE: Advanced use-case, for normal use see 'formData' usage above +const r = request.post('http://service.com/upload', function optionalCallback(err, httpResponse, body) {...}) +const form = r.form(); +form.append('my_field', 'my_value'); +form.append('my_buffer', Buffer.from([1, 2, 3])); +form.append('custom_file', fs.createReadStream(__dirname + '/unicycle.jpg'), {filename: 'unicycle.jpg'}); +``` +See the [form-data README](https://github.com/form-data/form-data) for more information & examples. + + +#### multipart/related + +Some variations in different HTTP implementations require a newline/CRLF before, after, or both before and after the boundary of a `multipart/related` request (using the multipart option). This has been observed in the .NET WebAPI version 4.0. You can turn on a boundary preambleCRLF or postamble by passing them as `true` to your request options. + +```js + request({ + method: 'PUT', + preambleCRLF: true, + postambleCRLF: true, + uri: 'http://service.com/upload', + multipart: [ + { + 'content-type': 'application/json', + body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}}) + }, + { body: 'I am an attachment' }, + { body: fs.createReadStream('image.png') } + ], + // alternatively pass an object containing additional options + multipart: { + chunked: false, + data: [ + { + 'content-type': 'application/json', + body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}}) + }, + { body: 'I am an attachment' } + ] + } + }, + function (error, response, body) { + if (error) { + return console.error('upload failed:', error); + } + console.log('Upload successful! Server responded with:', body); + }) +``` + +[back to top](#table-of-contents) + + +--- + + +## HTTP Authentication + +```js +request.get('http://some.server.com/').auth('username', 'password', false); +// or +request.get('http://some.server.com/', { + 'auth': { + 'user': 'username', + 'pass': 'password', + 'sendImmediately': false + } +}); +// or +request.get('http://some.server.com/').auth(null, null, true, 'bearerToken'); +// or +request.get('http://some.server.com/', { + 'auth': { + 'bearer': 'bearerToken' + } +}); +``` + +If passed as an option, `auth` should be a hash containing values: + +- `user` || `username` +- `pass` || `password` +- `sendImmediately` (optional) +- `bearer` (optional) + +The method form takes parameters +`auth(username, password, sendImmediately, bearer)`. + +`sendImmediately` defaults to `true`, which causes a basic or bearer +authentication header to be sent. If `sendImmediately` is `false`, then +`request` will retry with a proper authentication header after receiving a +`401` response from the server (which must contain a `WWW-Authenticate` header +indicating the required authentication method). + +Note that you can also specify basic authentication using the URL itself, as +detailed in [RFC 1738](http://www.ietf.org/rfc/rfc1738.txt). Simply pass the +`user:password` before the host with an `@` sign: + +```js +const username = 'username', + password = 'password', + url = 'http://' + username + ':' + password + '@some.server.com'; + +request({url}, function (error, response, body) { + // Do more stuff with 'body' here +}); +``` + +Digest authentication is supported, but it only works with `sendImmediately` +set to `false`; otherwise `request` will send basic authentication on the +initial request, which will probably cause the request to fail. + +Bearer authentication is supported, and is activated when the `bearer` value is +available. The value may be either a `String` or a `Function` returning a +`String`. Using a function to supply the bearer token is particularly useful if +used in conjunction with `defaults` to allow a single function to supply the +last known token at the time of sending a request, or to compute one on the fly. + +[back to top](#table-of-contents) + + +--- + + +## Custom HTTP Headers + +HTTP Headers, such as `User-Agent`, can be set in the `options` object. +In the example below, we call the github API to find out the number +of stars and forks for the request repository. This requires a +custom `User-Agent` header as well as https. + +```js +const request = require('request'); + +const options = { + url: 'https://api.github.com/repos/cypress-io/request', + headers: { + 'User-Agent': 'request' + } +}; + +function callback(error, response, body) { + if (!error && response.statusCode == 200) { + const info = JSON.parse(body); + console.log(info.stargazers_count + " Stars"); + console.log(info.forks_count + " Forks"); + } +} + +request(options, callback); +``` + +[back to top](#table-of-contents) + + +--- + +## Proxies + +If you specify a `proxy` option, then the request (and any subsequent +redirects) will be sent via a connection to the proxy server. + +If your endpoint is an `https` url, and you are using a proxy, then +request will send a `CONNECT` request to the proxy server *first*, and +then use the supplied connection to connect to the endpoint. + +That is, first it will make a request like: + +``` +HTTP/1.1 CONNECT endpoint-server.com:80 +Host: proxy-server.com +User-Agent: whatever user agent you specify +``` + +and then the proxy server make a TCP connection to `endpoint-server` +on port `80`, and return a response that looks like: + +``` +HTTP/1.1 200 OK +``` + +At this point, the connection is left open, and the client is +communicating directly with the `endpoint-server.com` machine. + +See [the wikipedia page on HTTP Tunneling](https://en.wikipedia.org/wiki/HTTP_tunnel) +for more information. + +By default, when proxying `http` traffic, request will simply make a +standard proxied `http` request. This is done by making the `url` +section of the initial line of the request a fully qualified url to +the endpoint. + +For example, it will make a single request that looks like: + +``` +HTTP/1.1 GET http://endpoint-server.com/some-url +Host: proxy-server.com +Other-Headers: all go here + +request body or whatever +``` + +Because a pure "http over http" tunnel offers no additional security +or other features, it is generally simpler to go with a +straightforward HTTP proxy in this case. However, if you would like +to force a tunneling proxy, you may set the `tunnel` option to `true`. + +You can also make a standard proxied `http` request by explicitly setting +`tunnel : false`, but **note that this will allow the proxy to see the traffic +to/from the destination server**. + +If you are using a tunneling proxy, you may set the +`proxyHeaderWhiteList` to share certain headers with the proxy. + +You can also set the `proxyHeaderExclusiveList` to share certain +headers only with the proxy and not with destination host. + +By default, this set is: + +``` +accept +accept-charset +accept-encoding +accept-language +accept-ranges +cache-control +content-encoding +content-language +content-length +content-location +content-md5 +content-range +content-type +connection +date +expect +max-forwards +pragma +proxy-authorization +referer +te +transfer-encoding +user-agent +via +``` + +Note that, when using a tunneling proxy, the `proxy-authorization` +header and any headers from custom `proxyHeaderExclusiveList` are +*never* sent to the endpoint server, but only to the proxy server. + + +### Controlling proxy behaviour using environment variables + +The following environment variables are respected by `request`: + + * `HTTP_PROXY` / `http_proxy` + * `HTTPS_PROXY` / `https_proxy` + * `NO_PROXY` / `no_proxy` + +When `HTTP_PROXY` / `http_proxy` are set, they will be used to proxy non-SSL requests that do not have an explicit `proxy` configuration option present. Similarly, `HTTPS_PROXY` / `https_proxy` will be respected for SSL requests that do not have an explicit `proxy` configuration option. It is valid to define a proxy in one of the environment variables, but then override it for a specific request, using the `proxy` configuration option. Furthermore, the `proxy` configuration option can be explicitly set to false / null to opt out of proxying altogether for that request. + +`request` is also aware of the `NO_PROXY`/`no_proxy` environment variables. These variables provide a granular way to opt out of proxying, on a per-host basis. It should contain a comma separated list of hosts to opt out of proxying. It is also possible to opt of proxying when a particular destination port is used. Finally, the variable may be set to `*` to opt out of the implicit proxy configuration of the other environment variables. + +Here's some examples of valid `no_proxy` values: + + * `google.com` - don't proxy HTTP/HTTPS requests to Google. + * `google.com:443` - don't proxy HTTPS requests to Google, but *do* proxy HTTP requests to Google. + * `google.com:443, yahoo.com:80` - don't proxy HTTPS requests to Google, and don't proxy HTTP requests to Yahoo! + * `*` - ignore `https_proxy`/`http_proxy` environment variables altogether. + +[back to top](#table-of-contents) + + +--- + + +## UNIX Domain Sockets + +`request` supports making requests to [UNIX Domain Sockets](https://en.wikipedia.org/wiki/Unix_domain_socket). To make one, use the following URL scheme: + +```js +/* Pattern */ 'http://unix:SOCKET:PATH' +/* Example */ request.get('http://unix:/absolute/path/to/unix.socket:/request/path') +``` + +Note: The `SOCKET` path is assumed to be absolute to the root of the host file system. + +[back to top](#table-of-contents) + + +--- + + +## TLS/SSL Protocol + +TLS/SSL Protocol options, such as `cert`, `key` and `passphrase`, can be +set directly in `options` object, in the `agentOptions` property of the `options` object, or even in `https.globalAgent.options`. Keep in mind that, although `agentOptions` allows for a slightly wider range of configurations, the recommended way is via `options` object directly, as using `agentOptions` or `https.globalAgent.options` would not be applied in the same way in proxied environments (as data travels through a TLS connection instead of an http/https agent). + +```js +const fs = require('fs') + , path = require('path') + , certFile = path.resolve(__dirname, 'ssl/client.crt') + , keyFile = path.resolve(__dirname, 'ssl/client.key') + , caFile = path.resolve(__dirname, 'ssl/ca.cert.pem') + , request = require('request'); + +const options = { + url: 'https://api.some-server.com/', + cert: fs.readFileSync(certFile), + key: fs.readFileSync(keyFile), + passphrase: 'password', + ca: fs.readFileSync(caFile) +}; + +request.get(options); +``` + +### Using `options.agentOptions` + +In the example below, we call an API that requires client side SSL certificate +(in PEM format) with passphrase protected private key (in PEM format) and disable the SSLv3 protocol: + +```js +const fs = require('fs') + , path = require('path') + , certFile = path.resolve(__dirname, 'ssl/client.crt') + , keyFile = path.resolve(__dirname, 'ssl/client.key') + , request = require('request'); + +const options = { + url: 'https://api.some-server.com/', + agentOptions: { + cert: fs.readFileSync(certFile), + key: fs.readFileSync(keyFile), + // Or use `pfx` property replacing `cert` and `key` when using private key, certificate and CA certs in PFX or PKCS12 format: + // pfx: fs.readFileSync(pfxFilePath), + passphrase: 'password', + securityOptions: 'SSL_OP_NO_SSLv3' + } +}; + +request.get(options); +``` + +It is able to force using SSLv3 only by specifying `secureProtocol`: + +```js +request.get({ + url: 'https://api.some-server.com/', + agentOptions: { + secureProtocol: 'SSLv3_method' + } +}); +``` + +It is possible to accept other certificates than those signed by generally allowed Certificate Authorities (CAs). +This can be useful, for example, when using self-signed certificates. +To require a different root certificate, you can specify the signing CA by adding the contents of the CA's certificate file to the `agentOptions`. +The certificate the domain presents must be signed by the root certificate specified: + +```js +request.get({ + url: 'https://api.some-server.com/', + agentOptions: { + ca: fs.readFileSync('ca.cert.pem') + } +}); +``` + +The `ca` value can be an array of certificates, in the event you have a private or internal corporate public-key infrastructure hierarchy. For example, if you want to connect to https://api.some-server.com which presents a key chain consisting of: +1. its own public key, which is signed by: +2. an intermediate "Corp Issuing Server", that is in turn signed by: +3. a root CA "Corp Root CA"; + +you can configure your request as follows: + +```js +request.get({ + url: 'https://api.some-server.com/', + agentOptions: { + ca: [ + fs.readFileSync('Corp Issuing Server.pem'), + fs.readFileSync('Corp Root CA.pem') + ] + } +}); +``` + +[back to top](#table-of-contents) + + +--- + +## Support for HAR 1.2 + +The `options.har` property will override the values: `url`, `method`, `qs`, `headers`, `form`, `formData`, `body`, `json`, as well as construct multipart data and read files from disk when `request.postData.params[].fileName` is present without a matching `value`. + +A validation step will check if the HAR Request format matches the latest spec (v1.2) and will skip parsing if not matching. + +```js + const request = require('request') + request({ + // will be ignored + method: 'GET', + uri: 'http://www.google.com', + + // HTTP Archive Request Object + har: { + url: 'http://www.mockbin.com/har', + method: 'POST', + headers: [ + { + name: 'content-type', + value: 'application/x-www-form-urlencoded' + } + ], + postData: { + mimeType: 'application/x-www-form-urlencoded', + params: [ + { + name: 'foo', + value: 'bar' + }, + { + name: 'hello', + value: 'world' + } + ] + } + } + }) + + // a POST request will be sent to http://www.mockbin.com + // with body an application/x-www-form-urlencoded body: + // foo=bar&hello=world +``` + +[back to top](#table-of-contents) + + +--- + +## request(options, callback) + +The first argument can be either a `url` or an `options` object. The only required option is `uri`; all others are optional. + +- `uri` || `url` - fully qualified uri or a parsed url object from `url.parse()` +- `baseUrl` - fully qualified uri string used as the base url. Most useful with `request.defaults`, for example when you want to do many requests to the same domain. If `baseUrl` is `https://example.com/api/`, then requesting `/end/point?test=true` will fetch `https://example.com/api/end/point?test=true`. When `baseUrl` is given, `uri` must also be a string. +- `method` - http method (default: `"GET"`) +- `headers` - http headers (default: `{}`) + +--- + +- `qs` - object containing querystring values to be appended to the `uri` +- `qsParseOptions` - object containing options to pass to the [qs.parse](https://github.com/hapijs/qs#parsing-objects) method. Alternatively pass options to the [querystring.parse](https://nodejs.org/docs/v0.12.0/api/querystring.html#querystring_querystring_parse_str_sep_eq_options) method using this format `{sep:';', eq:':', options:{}}` +- `qsStringifyOptions` - object containing options to pass to the [qs.stringify](https://github.com/hapijs/qs#stringifying) method. Alternatively pass options to the [querystring.stringify](https://nodejs.org/docs/v0.12.0/api/querystring.html#querystring_querystring_stringify_obj_sep_eq_options) method using this format `{sep:';', eq:':', options:{}}`. For example, to change the way arrays are converted to query strings using the `qs` module pass the `arrayFormat` option with one of `indices|brackets|repeat` +- `useQuerystring` - if true, use `querystring` to stringify and parse + querystrings, otherwise use `qs` (default: `false`). Set this option to + `true` if you need arrays to be serialized as `foo=bar&foo=baz` instead of the + default `foo[0]=bar&foo[1]=baz`. + +--- + +- `body` - entity body for PATCH, POST and PUT requests. Must be a `Buffer`, `String` or `ReadStream`. If `json` is `true`, then `body` must be a JSON-serializable object. +- `form` - when passed an object or a querystring, this sets `body` to a querystring representation of value, and adds `Content-type: application/x-www-form-urlencoded` header. When passed no options, a `FormData` instance is returned (and is piped to request). See "Forms" section above. +- `formData` - data to pass for a `multipart/form-data` request. See + [Forms](#forms) section above. +- `multipart` - array of objects which contain their own headers and `body` + attributes. Sends a `multipart/related` request. See [Forms](#forms) section + above. + - Alternatively you can pass in an object `{chunked: false, data: []}` where + `chunked` is used to specify whether the request is sent in + [chunked transfer encoding](https://en.wikipedia.org/wiki/Chunked_transfer_encoding) + In non-chunked requests, data items with body streams are not allowed. +- `preambleCRLF` - append a newline/CRLF before the boundary of your `multipart/form-data` request. +- `postambleCRLF` - append a newline/CRLF at the end of the boundary of your `multipart/form-data` request. +- `json` - sets `body` to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as JSON. +- `jsonReviver` - a [reviver function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) that will be passed to `JSON.parse()` when parsing a JSON response body. +- `jsonReplacer` - a [replacer function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) that will be passed to `JSON.stringify()` when stringifying a JSON request body. + +--- + +- `auth` - a hash containing values `user` || `username`, `pass` || `password`, and `sendImmediately` (optional). See documentation above. +- `hawk` - options for [Hawk signing](https://github.com/hueniverse/hawk). The `credentials` key must contain the necessary signing info, [see hawk docs for details](https://github.com/hueniverse/hawk#usage-example). +- `aws` - `object` containing AWS signing information. Should have the properties `key`, `secret`, and optionally `session` (note that this only works for services that require session as part of the canonical string). Also requires the property `bucket`, unless you’re specifying your `bucket` as part of the path, or the request doesn’t use a bucket (i.e. GET Services). If you want to use AWS sign version 4 use the parameter `sign_version` with value `4` otherwise the default is version 2. If you are using SigV4, you can also include a `service` property that specifies the service name. **Note:** you need to `npm install aws4` first. +- `httpSignature` - options for the [HTTP Signature Scheme](https://github.com/joyent/node-http-signature/blob/master/http_signing.md) using [Joyent's library](https://github.com/joyent/node-http-signature). The `keyId` and `key` properties must be specified. See the docs for other options. + +--- + +- `followRedirect` - follow HTTP 3xx responses as redirects (default: `true`). This property can also be implemented as function which gets `response` object as the first argument. + - *(synchronous usage)* It should return `true` if redirects should continue or `false` otherwise. If it returns a url string, the destination of the redirect will be overridden. + - *(async callback usage)* If the function has two arguments, it will be treated as an asynchronous function and will be passed a callback as the second argument. Invoke the callback with an error (`null` if no error) and the boolean/url result as the second. + - *(async promise usage)* Return a promise that resolves to the boolean/url result. +- `followAllRedirects` - follow non-GET HTTP 3xx responses as redirects (default: `false`) +- `followOriginalHttpMethod` - by default we redirect to HTTP method GET. you can enable this property to redirect to the original HTTP method (default: `false`) +- `maxRedirects` - the maximum number of redirects to follow (default: `10`) +- `removeRefererHeader` - removes the referer header when a redirect happens (default: `false`). **Note:** if true, referer header set in the initial request is preserved during redirect chain. +- `allowInsecureRedirect` - allows cross-protocol redirects (HTTP to HTTPS and vice versa). **Warning:** may lead to bypassing anti SSRF filters (default: `false`) + +--- + +- `encoding` - encoding to be used on `setEncoding` of response data. If `null`, the `body` is returned as a `Buffer`. Anything else **(including the default value of `undefined`)** will be passed as the [encoding](http://nodejs.org/api/buffer.html#buffer_buffer) parameter to `toString()` (meaning this is effectively `utf8` by default). (**Note:** if you expect binary data, you should set `encoding: null`.) +- `gzip` - if `true`, add an `Accept-Encoding` header to request compressed content encodings from the server (if not already present) and decode supported content encodings in the response. **Note:** Automatic decoding of the response content is performed on the body data returned through `request` (both through the `request` stream and passed to the callback function) but is not performed on the `response` stream (available from the `response` event) which is the unmodified `http.IncomingMessage` object which may contain compressed data. See example below. +- `jar` - if `true`, remember cookies for future use (or define your custom cookie jar; see examples section) + +--- + +- `agent` - `http(s).Agent` instance to use +- `agentClass` - alternatively specify your agent's class name +- `agentOptions` - and pass its options. **Note:** for HTTPS see [tls API doc for TLS/SSL options](http://nodejs.org/api/tls.html#tls_tls_connect_options_callback) and the [documentation above](#using-optionsagentoptions). +- `forever` - set to `true` to use the [forever-agent](https://github.com/request/forever-agent) **Note:** Defaults to `http(s).Agent({keepAlive:true})` in node 0.12+ +- `pool` - an object describing which agents to use for the request. If this option is omitted the request will use the global agent (as long as your options allow for it). Otherwise, request will search the pool for your custom agent. If no custom agent is found, a new agent will be created and added to the pool. **Note:** `pool` is used only when the `agent` option is not specified. + - A `maxSockets` property can also be provided on the `pool` object to set the max number of sockets for all agents created (ex: `pool: {maxSockets: Infinity}`). + - Note that if you are sending multiple requests in a loop and creating + multiple new `pool` objects, `maxSockets` will not work as intended. To + work around this, either use [`request.defaults`](#requestdefaultsoptions) + with your pool options or create the pool object with the `maxSockets` + property outside of the loop. +- `timeout` - integer containing number of milliseconds, controls two timeouts. + - **Read timeout**: Time to wait for a server to send response headers (and start the response body) before aborting the request. + - **Connection timeout**: Sets the socket to timeout after `timeout` milliseconds of inactivity. Note that increasing the timeout beyond the OS-wide TCP connection timeout will not have any effect ([the default in Linux can be anywhere from 20-120 seconds][linux-timeout]) + +[linux-timeout]: http://www.sekuda.com/overriding_the_default_linux_kernel_20_second_tcp_socket_connect_timeout + +--- + +- `localAddress` - local interface to bind for network connections. +- `proxy` - an HTTP proxy to be used. Supports proxy Auth with Basic Auth, identical to support for the `url` parameter (by embedding the auth info in the `uri`) +- `strictSSL` - if `true`, requires SSL certificates be valid. **Note:** to use your own certificate authority, you need to specify an agent that was created with that CA as an option. +- `tunnel` - controls the behavior of + [HTTP `CONNECT` tunneling](https://en.wikipedia.org/wiki/HTTP_tunnel#HTTP_CONNECT_tunneling) + as follows: + - `undefined` (default) - `true` if the destination is `https`, `false` otherwise + - `true` - always tunnel to the destination by making a `CONNECT` request to + the proxy + - `false` - request the destination as a `GET` request. +- `proxyHeaderWhiteList` - a whitelist of headers to send to a + tunneling proxy. +- `proxyHeaderExclusiveList` - a whitelist of headers to send + exclusively to a tunneling proxy and not to destination. + +--- + +- `time` - if `true`, the request-response cycle (including all redirects) is timed at millisecond resolution. When set, the following properties are added to the response object: + - `elapsedTime` Duration of the entire request/response in milliseconds (*deprecated*). + - `responseStartTime` Timestamp when the response began (in Unix Epoch milliseconds) (*deprecated*). + - `timingStart` Timestamp of the start of the request (in Unix Epoch milliseconds). + - `timings` Contains event timestamps in millisecond resolution relative to `timingStart`. If there were redirects, the properties reflect the timings of the final request in the redirect chain: + - `socket` Relative timestamp when the [`http`](https://nodejs.org/api/http.html#http_event_socket) module's `socket` event fires. This happens when the socket is assigned to the request. + - `lookup` Relative timestamp when the [`net`](https://nodejs.org/api/net.html#net_event_lookup) module's `lookup` event fires. This happens when the DNS has been resolved. + - `connect`: Relative timestamp when the [`net`](https://nodejs.org/api/net.html#net_event_connect) module's `connect` event fires. This happens when the server acknowledges the TCP connection. + - `response`: Relative timestamp when the [`http`](https://nodejs.org/api/http.html#http_event_response) module's `response` event fires. This happens when the first bytes are received from the server. + - `end`: Relative timestamp when the last bytes of the response are received. + - `timingPhases` Contains the durations of each request phase. If there were redirects, the properties reflect the timings of the final request in the redirect chain: + - `wait`: Duration of socket initialization (`timings.socket`) + - `dns`: Duration of DNS lookup (`timings.lookup` - `timings.socket`) + - `tcp`: Duration of TCP connection (`timings.connect` - `timings.socket`) + - `firstByte`: Duration of HTTP server response (`timings.response` - `timings.connect`) + - `download`: Duration of HTTP download (`timings.end` - `timings.response`) + - `total`: Duration entire HTTP round-trip (`timings.end`) + +- `har` - a [HAR 1.2 Request Object](http://www.softwareishard.com/blog/har-12-spec/#request), will be processed from HAR format into options overwriting matching values *(see the [HAR 1.2 section](#support-for-har-12) for details)* +- `callback` - alternatively pass the request's callback in the options object + +The callback argument gets 3 arguments: + +1. An `error` when applicable (usually from [`http.ClientRequest`](http://nodejs.org/api/http.html#http_class_http_clientrequest) object) +2. An [`http.IncomingMessage`](https://nodejs.org/api/http.html#http_class_http_incomingmessage) object (Response object) +3. The third is the `response` body (`String` or `Buffer`, or JSON object if the `json` option is supplied) + +[back to top](#table-of-contents) + + +--- + +## Convenience methods + +There are also shorthand methods for different HTTP METHODs and some other conveniences. + + +### request.defaults(options) + +This method **returns a wrapper** around the normal request API that defaults +to whatever options you pass to it. + +**Note:** `request.defaults()` **does not** modify the global request API; +instead, it **returns a wrapper** that has your default settings applied to it. + +**Note:** You can call `.defaults()` on the wrapper that is returned from +`request.defaults` to add/override defaults that were previously defaulted. + +For example: +```js +//requests using baseRequest() will set the 'x-token' header +const baseRequest = request.defaults({ + headers: {'x-token': 'my-token'} +}) + +//requests using specialRequest() will include the 'x-token' header set in +//baseRequest and will also include the 'special' header +const specialRequest = baseRequest.defaults({ + headers: {special: 'special value'} +}) +``` + +### request.METHOD() + +These HTTP method convenience functions act just like `request()` but with a default method already set for you: + +- *request.get()*: Defaults to `method: "GET"`. +- *request.post()*: Defaults to `method: "POST"`. +- *request.put()*: Defaults to `method: "PUT"`. +- *request.patch()*: Defaults to `method: "PATCH"`. +- *request.del() / request.delete()*: Defaults to `method: "DELETE"`. +- *request.head()*: Defaults to `method: "HEAD"`. +- *request.options()*: Defaults to `method: "OPTIONS"`. + +### request.cookie() + +Function that creates a new cookie. + +```js +request.cookie('key1=value1') +``` +### request.jar() + +Function that creates a new cookie jar. + +```js +request.jar() +``` + +### response.caseless.get('header-name') + +Function that returns the specified response header field using a [case-insensitive match](https://tools.ietf.org/html/rfc7230#section-3.2) + +```js +request('http://www.google.com', function (error, response, body) { + // print the Content-Type header even if the server returned it as 'content-type' (lowercase) + console.log('Content-Type is:', response.caseless.get('Content-Type')); +}); +``` + +[back to top](#table-of-contents) + + +--- + + +## Debugging + +There are at least three ways to debug the operation of `request`: + +1. Launch the node process like `NODE_DEBUG=request node script.js` + (`lib,request,otherlib` works too). + +2. Set `require('request').debug = true` at any time (this does the same thing + as #1). + +3. Use the [request-debug module](https://github.com/cypress-io/request-debug) to + view request and response headers and bodies. + +[back to top](#table-of-contents) + + +--- + +## Timeouts + +Most requests to external servers should have a timeout attached, in case the +server is not responding in a timely manner. Without a timeout, your code may +have a socket open/consume resources for minutes or more. + +There are two main types of timeouts: **connection timeouts** and **read +timeouts**. A connect timeout occurs if the timeout is hit while your client is +attempting to establish a connection to a remote machine (corresponding to the +[connect() call][connect] on the socket). A read timeout occurs any time the +server is too slow to send back a part of the response. + +These two situations have widely different implications for what went wrong +with the request, so it's useful to be able to distinguish them. You can detect +timeout errors by checking `err.code` for an 'ETIMEDOUT' value. Further, you +can detect whether the timeout was a connection timeout by checking if the +`err.connect` property is set to `true`. + +```js +request.get('http://10.255.255.1', {timeout: 1500}, function(err) { + console.log(err.code === 'ETIMEDOUT'); + // Set to `true` if the timeout was a connection timeout, `false` or + // `undefined` otherwise. + console.log(err.connect === true); + process.exit(0); +}); +``` + +[connect]: http://linux.die.net/man/2/connect + +## Examples: + +```js + const request = require('request') + , rand = Math.floor(Math.random()*100000000).toString() + ; + request( + { method: 'PUT' + , uri: 'http://mikeal.iriscouch.com/testjs/' + rand + , multipart: + [ { 'content-type': 'application/json' + , body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}}) + } + , { body: 'I am an attachment' } + ] + } + , function (error, response, body) { + if(response.statusCode == 201){ + console.log('document saved as: http://mikeal.iriscouch.com/testjs/'+ rand) + } else { + console.log('error: '+ response.statusCode) + console.log(body) + } + } + ) +``` + +For backwards-compatibility, response compression is not supported by default. +To accept gzip-compressed responses, set the `gzip` option to `true`. Note +that the body data passed through `request` is automatically decompressed +while the response object is unmodified and will contain compressed data if +the server sent a compressed response. + +```js + const request = require('request') + request( + { method: 'GET' + , uri: 'http://www.google.com' + , gzip: true + } + , function (error, response, body) { + // body is the decompressed response body + console.log('server encoded the data as: ' + (response.headers['content-encoding'] || 'identity')) + console.log('the decoded data is: ' + body) + } + ) + .on('data', function(data) { + // decompressed data as it is received + console.log('decoded chunk: ' + data) + }) + .on('response', function(response) { + // unmodified http.IncomingMessage object + response.on('data', function(data) { + // compressed data as it is received + console.log('received ' + data.length + ' bytes of compressed data') + }) + }) +``` + +Cookies are disabled by default (else, they would be used in subsequent requests). To enable cookies, set `jar` to `true` (either in `defaults` or `options`). + +```js +const request = request.defaults({jar: true}) +request('http://www.google.com', function () { + request('http://images.google.com') +}) +``` + +To use a custom cookie jar (instead of `request`’s global cookie jar), set `jar` to an instance of `request.jar()` (either in `defaults` or `options`) + +```js +const j = request.jar() +const request = request.defaults({jar:j}) +request('http://www.google.com', function () { + request('http://images.google.com') +}) +``` + +OR + +```js +const j = request.jar(); +const cookie = request.cookie('key1=value1'); +const url = 'http://www.google.com'; +j.setCookie(cookie, url); +request({url: url, jar: j}, function () { + request('http://images.google.com') +}) +``` + +To use a custom cookie store (such as a +[`FileCookieStore`](https://github.com/mitsuru/tough-cookie-filestore) +which supports saving to and restoring from JSON files), pass it as a parameter +to `request.jar()`: + +```js +const FileCookieStore = require('tough-cookie-filestore'); +// NOTE - currently the 'cookies.json' file must already exist! +const j = request.jar(new FileCookieStore('cookies.json')); +request = request.defaults({ jar : j }) +request('http://www.google.com', function() { + request('http://images.google.com') +}) +``` + +The cookie store must be a +[`tough-cookie`](https://github.com/SalesforceEng/tough-cookie) +store and it must support synchronous operations; see the +[`CookieStore` API docs](https://github.com/SalesforceEng/tough-cookie#api) +for details. + +To inspect your cookie jar after a request: + +```js +const j = request.jar() +request({url: 'http://www.google.com', jar: j}, function () { + const cookie_string = j.getCookieString(url); // "key1=value1; key2=value2; ..." + const cookies = j.getCookies(url); + // [{key: 'key1', value: 'value1', domain: "www.google.com", ...}, ...] +}) +``` + +[back to top](#table-of-contents) diff --git a/publisher/node_modules/@cypress/request/index.js b/publisher/node_modules/@cypress/request/index.js new file mode 100755 index 00000000..d50f9917 --- /dev/null +++ b/publisher/node_modules/@cypress/request/index.js @@ -0,0 +1,155 @@ +// Copyright 2010-2012 Mikeal Rogers +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict' + +var extend = require('extend') +var cookies = require('./lib/cookies') +var helpers = require('./lib/helpers') + +var paramsHaveRequestBody = helpers.paramsHaveRequestBody + +// organize params for patch, post, put, head, del +function initParams (uri, options, callback) { + if (typeof options === 'function') { + callback = options + } + + var params = {} + if (options !== null && typeof options === 'object') { + extend(params, options, {uri: uri}) + } else if (typeof uri === 'string') { + extend(params, {uri: uri}) + } else { + extend(params, uri) + } + + params.callback = callback || params.callback + return params +} + +function request (uri, options, callback) { + if (typeof uri === 'undefined') { + throw new Error('undefined is not a valid uri or options object.') + } + + var params = initParams(uri, options, callback) + + if (params.method === 'HEAD' && paramsHaveRequestBody(params)) { + throw new Error('HTTP HEAD requests MUST NOT include a request body.') + } + + return new request.Request(params) +} + +function verbFunc (verb) { + var method = verb.toUpperCase() + return function (uri, options, callback) { + var params = initParams(uri, options, callback) + params.method = method + return request(params, params.callback) + } +} + +// define like this to please codeintel/intellisense IDEs +request.get = verbFunc('get') +request.head = verbFunc('head') +request.options = verbFunc('options') +request.post = verbFunc('post') +request.put = verbFunc('put') +request.patch = verbFunc('patch') +request.del = verbFunc('delete') +request['delete'] = verbFunc('delete') + +request.jar = function (store) { + return cookies.jar(store) +} + +request.cookie = function (str) { + return cookies.parse(str) +} + +function wrapRequestMethod (method, options, requester, verb) { + return function (uri, opts, callback) { + var params = initParams(uri, opts, callback) + + var target = {} + extend(true, target, options, params) + + target.pool = params.pool || options.pool + + if (verb) { + target.method = verb.toUpperCase() + } + + if (typeof requester === 'function') { + method = requester + } + + return method(target, target.callback) + } +} + +request.defaults = function (options, requester) { + var self = this + + options = options || {} + + if (typeof options === 'function') { + requester = options + options = {} + } + + var defaults = wrapRequestMethod(self, options, requester) + + var verbs = ['get', 'head', 'post', 'put', 'patch', 'del', 'delete'] + verbs.forEach(function (verb) { + defaults[verb] = wrapRequestMethod(self[verb], options, requester, verb) + }) + + defaults.cookie = wrapRequestMethod(self.cookie, options, requester) + defaults.jar = self.jar + defaults.defaults = self.defaults + return defaults +} + +request.forever = function (agentOptions, optionsArg) { + var options = {} + if (optionsArg) { + extend(options, optionsArg) + } + if (agentOptions) { + options.agentOptions = agentOptions + } + + options.forever = true + return request.defaults(options) +} + +// Exports + +module.exports = request +request.Request = require('./request') +request.initParams = initParams + +// Backwards compatibility for request.debug +Object.defineProperty(request, 'debug', { + enumerable: true, + get: function () { + return request.Request.debug + }, + set: function (debug) { + request.Request.debug = debug + } +}) diff --git a/publisher/node_modules/@cypress/request/lib/auth.js b/publisher/node_modules/@cypress/request/lib/auth.js new file mode 100644 index 00000000..6f094d68 --- /dev/null +++ b/publisher/node_modules/@cypress/request/lib/auth.js @@ -0,0 +1,167 @@ +'use strict' + +var caseless = require('caseless') +var { v4: uuid } = require('uuid') +var helpers = require('./helpers') + +var md5 = helpers.md5 +var toBase64 = helpers.toBase64 + +function Auth (request) { + // define all public properties here + this.request = request + this.hasAuth = false + this.sentAuth = false + this.bearerToken = null + this.user = null + this.pass = null +} + +Auth.prototype.basic = function (user, pass, sendImmediately) { + var self = this + if (typeof user !== 'string' || (pass !== undefined && typeof pass !== 'string')) { + self.request.emit('error', new Error('auth() received invalid user or password')) + } + self.user = user + self.pass = pass + self.hasAuth = true + var header = user + ':' + (pass || '') + if (sendImmediately || typeof sendImmediately === 'undefined') { + var authHeader = 'Basic ' + toBase64(header) + self.sentAuth = true + return authHeader + } +} + +Auth.prototype.bearer = function (bearer, sendImmediately) { + var self = this + self.bearerToken = bearer + self.hasAuth = true + if (sendImmediately || typeof sendImmediately === 'undefined') { + if (typeof bearer === 'function') { + bearer = bearer() + } + var authHeader = 'Bearer ' + (bearer || '') + self.sentAuth = true + return authHeader + } +} + +Auth.prototype.digest = function (method, path, authHeader) { + // TODO: More complete implementation of RFC 2617. + // - handle challenge.domain + // - support qop="auth-int" only + // - handle Authentication-Info (not necessarily?) + // - check challenge.stale (not necessarily?) + // - increase nc (not necessarily?) + // For reference: + // http://tools.ietf.org/html/rfc2617#section-3 + // https://github.com/bagder/curl/blob/master/lib/http_digest.c + + var self = this + + var challenge = {} + var re = /([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi + while (true) { + var match = re.exec(authHeader) + if (!match) { + break + } + challenge[match[1]] = match[2] || match[3] + } + + /** + * RFC 2617: handle both MD5 and MD5-sess algorithms. + * + * If the algorithm directive's value is "MD5" or unspecified, then HA1 is + * HA1=MD5(username:realm:password) + * If the algorithm directive's value is "MD5-sess", then HA1 is + * HA1=MD5(MD5(username:realm:password):nonce:cnonce) + */ + var ha1Compute = function (algorithm, user, realm, pass, nonce, cnonce) { + var ha1 = md5(user + ':' + realm + ':' + pass) + if (algorithm && algorithm.toLowerCase() === 'md5-sess') { + return md5(ha1 + ':' + nonce + ':' + cnonce) + } else { + return ha1 + } + } + + var qop = /(^|,)\s*auth\s*($|,)/.test(challenge.qop) && 'auth' + var nc = qop && '00000001' + var cnonce = qop && uuid().replace(/-/g, '') + var ha1 = ha1Compute(challenge.algorithm, self.user, challenge.realm, self.pass, challenge.nonce, cnonce) + var ha2 = md5(method + ':' + path) + var digestResponse = qop + ? md5(ha1 + ':' + challenge.nonce + ':' + nc + ':' + cnonce + ':' + qop + ':' + ha2) + : md5(ha1 + ':' + challenge.nonce + ':' + ha2) + var authValues = { + username: self.user, + realm: challenge.realm, + nonce: challenge.nonce, + uri: path, + qop: qop, + response: digestResponse, + nc: nc, + cnonce: cnonce, + algorithm: challenge.algorithm, + opaque: challenge.opaque + } + + authHeader = [] + for (var k in authValues) { + if (authValues[k]) { + if (k === 'qop' || k === 'nc' || k === 'algorithm') { + authHeader.push(k + '=' + authValues[k]) + } else { + authHeader.push(k + '="' + authValues[k] + '"') + } + } + } + authHeader = 'Digest ' + authHeader.join(', ') + self.sentAuth = true + return authHeader +} + +Auth.prototype.onRequest = function (user, pass, sendImmediately, bearer) { + var self = this + var request = self.request + + var authHeader + if (bearer === undefined && user === undefined) { + self.request.emit('error', new Error('no auth mechanism defined')) + } else if (bearer !== undefined) { + authHeader = self.bearer(bearer, sendImmediately) + } else { + authHeader = self.basic(user, pass, sendImmediately) + } + if (authHeader) { + request.setHeader('authorization', authHeader) + } +} + +Auth.prototype.onResponse = function (response) { + var self = this + var request = self.request + + if (!self.hasAuth || self.sentAuth) { return null } + + var c = caseless(response.headers) + + var authHeader = c.get('www-authenticate') + var authVerb = authHeader && authHeader.split(' ')[0].toLowerCase() + request.debug('reauth', authVerb) + + switch (authVerb) { + case 'basic': + return self.basic(self.user, self.pass, true) + + case 'bearer': + return self.bearer(self.bearerToken, true) + + case 'digest': + return self.digest(request.method, request.path, authHeader) + } +} + +exports.Auth = Auth diff --git a/publisher/node_modules/@cypress/request/lib/cookies.js b/publisher/node_modules/@cypress/request/lib/cookies.js new file mode 100644 index 00000000..bd5d46be --- /dev/null +++ b/publisher/node_modules/@cypress/request/lib/cookies.js @@ -0,0 +1,38 @@ +'use strict' + +var tough = require('tough-cookie') + +var Cookie = tough.Cookie +var CookieJar = tough.CookieJar + +exports.parse = function (str) { + if (str && str.uri) { + str = str.uri + } + if (typeof str !== 'string') { + throw new Error('The cookie function only accepts STRING as param') + } + return Cookie.parse(str, {loose: true}) +} + +// Adapt the sometimes-Async api of tough.CookieJar to our requirements +function RequestJar (store) { + var self = this + self._jar = new CookieJar(store, {looseMode: true}) +} +RequestJar.prototype.setCookie = function (cookieOrStr, uri, options) { + var self = this + return self._jar.setCookieSync(cookieOrStr, uri, options || {}) +} +RequestJar.prototype.getCookieString = function (uri) { + var self = this + return self._jar.getCookieStringSync(uri) +} +RequestJar.prototype.getCookies = function (uri) { + var self = this + return self._jar.getCookiesSync(uri) +} + +exports.jar = function (store) { + return new RequestJar(store) +} diff --git a/publisher/node_modules/@cypress/request/lib/getProxyFromURI.js b/publisher/node_modules/@cypress/request/lib/getProxyFromURI.js new file mode 100644 index 00000000..0b9b18e5 --- /dev/null +++ b/publisher/node_modules/@cypress/request/lib/getProxyFromURI.js @@ -0,0 +1,79 @@ +'use strict' + +function formatHostname (hostname) { + // canonicalize the hostname, so that 'oogle.com' won't match 'google.com' + return hostname.replace(/^\.*/, '.').toLowerCase() +} + +function parseNoProxyZone (zone) { + zone = zone.trim().toLowerCase() + + var zoneParts = zone.split(':', 2) + var zoneHost = formatHostname(zoneParts[0]) + var zonePort = zoneParts[1] + var hasPort = zone.indexOf(':') > -1 + + return {hostname: zoneHost, port: zonePort, hasPort: hasPort} +} + +function uriInNoProxy (uri, noProxy) { + var port = uri.port || (uri.protocol === 'https:' ? '443' : '80') + var hostname = formatHostname(uri.hostname) + var noProxyList = noProxy.split(',') + + // iterate through the noProxyList until it finds a match. + return noProxyList.map(parseNoProxyZone).some(function (noProxyZone) { + var isMatchedAt = hostname.indexOf(noProxyZone.hostname) + var hostnameMatched = ( + isMatchedAt > -1 && + (isMatchedAt === hostname.length - noProxyZone.hostname.length) + ) + + if (noProxyZone.hasPort) { + return (port === noProxyZone.port) && hostnameMatched + } + + return hostnameMatched + }) +} + +function getProxyFromURI (uri) { + // Decide the proper request proxy to use based on the request URI object and the + // environmental variables (NO_PROXY, HTTP_PROXY, etc.) + // respect NO_PROXY environment variables (see: https://lynx.invisible-island.net/lynx2.8.7/breakout/lynx_help/keystrokes/environments.html) + + var noProxy = process.env.NO_PROXY || process.env.no_proxy || '' + + // if the noProxy is a wildcard then return null + + if (noProxy === '*') { + return null + } + + // if the noProxy is not empty and the uri is found return null + + if (noProxy !== '' && uriInNoProxy(uri, noProxy)) { + return null + } + + // Check for HTTP or HTTPS Proxy in environment Else default to null + + if (uri.protocol === 'http:') { + return process.env.HTTP_PROXY || + process.env.http_proxy || null + } + + if (uri.protocol === 'https:') { + return process.env.HTTPS_PROXY || + process.env.https_proxy || + process.env.HTTP_PROXY || + process.env.http_proxy || null + } + + // if none of that works, return null + // (What uri protocol are you using then?) + + return null +} + +module.exports = getProxyFromURI diff --git a/publisher/node_modules/@cypress/request/lib/har.js b/publisher/node_modules/@cypress/request/lib/har.js new file mode 100644 index 00000000..03f660dc --- /dev/null +++ b/publisher/node_modules/@cypress/request/lib/har.js @@ -0,0 +1,200 @@ +'use strict' + +var fs = require('fs') +var qs = require('querystring') +var extend = require('extend') + +function Har (request) { + this.request = request +} + +Har.prototype.reducer = function (obj, pair) { + // new property ? + if (obj[pair.name] === undefined) { + obj[pair.name] = pair.value + return obj + } + + // existing? convert to array + var arr = [ + obj[pair.name], + pair.value + ] + + obj[pair.name] = arr + + return obj +} + +Har.prototype.prep = function (data) { + // construct utility properties + data.queryObj = {} + data.headersObj = {} + data.postData.jsonObj = false + data.postData.paramsObj = false + + // construct query objects + if (data.queryString && data.queryString.length) { + data.queryObj = data.queryString.reduce(this.reducer, {}) + } + + // construct headers objects + if (data.headers && data.headers.length) { + // loweCase header keys + data.headersObj = data.headers.reduceRight(function (headers, header) { + headers[header.name] = header.value + return headers + }, {}) + } + + // construct Cookie header + if (data.cookies && data.cookies.length) { + var cookies = data.cookies.map(function (cookie) { + return cookie.name + '=' + cookie.value + }) + + if (cookies.length) { + data.headersObj.cookie = cookies.join('; ') + } + } + + // prep body + function some (arr) { + return arr.some(function (type) { + return data.postData.mimeType.indexOf(type) === 0 + }) + } + + if (some([ + 'multipart/mixed', + 'multipart/related', + 'multipart/form-data', + 'multipart/alternative'])) { + // reset values + data.postData.mimeType = 'multipart/form-data' + } else if (some([ + 'application/x-www-form-urlencoded'])) { + if (!data.postData.params) { + data.postData.text = '' + } else { + data.postData.paramsObj = data.postData.params.reduce(this.reducer, {}) + + // always overwrite + data.postData.text = qs.stringify(data.postData.paramsObj) + } + } else if (some([ + 'text/json', + 'text/x-json', + 'application/json', + 'application/x-json'])) { + data.postData.mimeType = 'application/json' + + if (data.postData.text) { + try { + data.postData.jsonObj = JSON.parse(data.postData.text) + } catch (e) { + this.request.debug(e) + + // force back to text/plain + data.postData.mimeType = 'text/plain' + } + } + } + + return data +} + +Har.prototype.options = function (options) { + // skip if no har property defined + if (!options.har) { + return options + } + + var har = {} + extend(har, options.har) + + // only process the first entry + if (har.log && har.log.entries) { + har = har.log.entries[0] + } + + // add optional properties to make validation successful + har.url = har.url || options.url || options.uri || options.baseUrl || '/' + har.httpVersion = har.httpVersion || 'HTTP/1.1' + har.queryString = har.queryString || [] + har.headers = har.headers || [] + har.cookies = har.cookies || [] + har.postData = har.postData || {} + har.postData.mimeType = har.postData.mimeType || 'application/octet-stream' + + har.bodySize = 0 + har.headersSize = 0 + har.postData.size = 0 + + // clean up and get some utility properties + var req = this.prep(har) + + // construct new options + if (req.url) { + options.url = req.url + } + + if (req.method) { + options.method = req.method + } + + if (Object.keys(req.queryObj).length) { + options.qs = req.queryObj + } + + if (Object.keys(req.headersObj).length) { + options.headers = req.headersObj + } + + function test (type) { + return req.postData.mimeType.indexOf(type) === 0 + } + if (test('application/x-www-form-urlencoded')) { + options.form = req.postData.paramsObj + } else if (test('application/json')) { + if (req.postData.jsonObj) { + options.body = req.postData.jsonObj + options.json = true + } + } else if (test('multipart/form-data')) { + options.formData = {} + + req.postData.params.forEach(function (param) { + var attachment = {} + + if (!param.fileName && !param.contentType) { + options.formData[param.name] = param.value + return + } + + // attempt to read from disk! + if (param.fileName && !param.value) { + attachment.value = fs.createReadStream(param.fileName) + } else if (param.value) { + attachment.value = param.value + } + + if (param.fileName) { + attachment.options = { + filename: param.fileName, + contentType: param.contentType ? param.contentType : null + } + } + + options.formData[param.name] = attachment + }) + } else { + if (req.postData.text) { + options.body = req.postData.text + } + } + + return options +} + +exports.Har = Har diff --git a/publisher/node_modules/@cypress/request/lib/hawk.js b/publisher/node_modules/@cypress/request/lib/hawk.js new file mode 100644 index 00000000..de48a985 --- /dev/null +++ b/publisher/node_modules/@cypress/request/lib/hawk.js @@ -0,0 +1,89 @@ +'use strict' + +var crypto = require('crypto') + +function randomString (size) { + var bits = (size + 1) * 6 + var buffer = crypto.randomBytes(Math.ceil(bits / 8)) + var string = buffer.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '') + return string.slice(0, size) +} + +function calculatePayloadHash (payload, algorithm, contentType) { + var hash = crypto.createHash(algorithm) + hash.update('hawk.1.payload\n') + hash.update((contentType ? contentType.split(';')[0].trim().toLowerCase() : '') + '\n') + hash.update(payload || '') + hash.update('\n') + return hash.digest('base64') +} + +exports.calculateMac = function (credentials, opts) { + var normalized = 'hawk.1.header\n' + + opts.ts + '\n' + + opts.nonce + '\n' + + (opts.method || '').toUpperCase() + '\n' + + opts.resource + '\n' + + opts.host.toLowerCase() + '\n' + + opts.port + '\n' + + (opts.hash || '') + '\n' + + if (opts.ext) { + normalized = normalized + opts.ext.replace('\\', '\\\\').replace('\n', '\\n') + } + + normalized = normalized + '\n' + + if (opts.app) { + normalized = normalized + opts.app + '\n' + (opts.dlg || '') + '\n' + } + + var hmac = crypto.createHmac(credentials.algorithm, credentials.key).update(normalized) + var digest = hmac.digest('base64') + return digest +} + +exports.header = function (uri, method, opts) { + var timestamp = opts.timestamp || Math.floor((Date.now() + (opts.localtimeOffsetMsec || 0)) / 1000) + var credentials = opts.credentials + if (!credentials || !credentials.id || !credentials.key || !credentials.algorithm) { + return '' + } + + if (['sha1', 'sha256'].indexOf(credentials.algorithm) === -1) { + return '' + } + + var artifacts = { + ts: timestamp, + nonce: opts.nonce || randomString(6), + method: method, + resource: uri.pathname + (uri.search || ''), + host: uri.hostname, + port: uri.port || (uri.protocol === 'http:' ? 80 : 443), + hash: opts.hash, + ext: opts.ext, + app: opts.app, + dlg: opts.dlg + } + + if (!artifacts.hash && (opts.payload || opts.payload === '')) { + artifacts.hash = calculatePayloadHash(opts.payload, credentials.algorithm, opts.contentType) + } + + var mac = exports.calculateMac(credentials, artifacts) + + var hasExt = artifacts.ext !== null && artifacts.ext !== undefined && artifacts.ext !== '' + var header = 'Hawk id="' + credentials.id + + '", ts="' + artifacts.ts + + '", nonce="' + artifacts.nonce + + (artifacts.hash ? '", hash="' + artifacts.hash : '') + + (hasExt ? '", ext="' + artifacts.ext.replace(/\\/g, '\\\\').replace(/"/g, '\\"') : '') + + '", mac="' + mac + '"' + + if (artifacts.app) { + header = header + ', app="' + artifacts.app + (artifacts.dlg ? '", dlg="' + artifacts.dlg : '') + '"' + } + + return header +} diff --git a/publisher/node_modules/@cypress/request/lib/helpers.js b/publisher/node_modules/@cypress/request/lib/helpers.js new file mode 100644 index 00000000..8b2a7e6e --- /dev/null +++ b/publisher/node_modules/@cypress/request/lib/helpers.js @@ -0,0 +1,66 @@ +'use strict' + +var jsonSafeStringify = require('json-stringify-safe') +var crypto = require('crypto') +var Buffer = require('safe-buffer').Buffer + +var defer = typeof setImmediate === 'undefined' + ? process.nextTick + : setImmediate + +function paramsHaveRequestBody (params) { + return ( + params.body || + params.requestBodyStream || + (params.json && typeof params.json !== 'boolean') || + params.multipart + ) +} + +function safeStringify (obj, replacer) { + var ret + try { + ret = JSON.stringify(obj, replacer) + } catch (e) { + ret = jsonSafeStringify(obj, replacer) + } + return ret +} + +function md5 (str) { + return crypto.createHash('md5').update(str).digest('hex') +} + +function isReadStream (rs) { + return rs.readable && rs.path && rs.mode +} + +function toBase64 (str) { + return Buffer.from(str || '', 'utf8').toString('base64') +} + +function copy (obj) { + var o = {} + Object.keys(obj).forEach(function (i) { + o[i] = obj[i] + }) + return o +} + +function version () { + var numbers = process.version.replace('v', '').split('.') + return { + major: parseInt(numbers[0], 10), + minor: parseInt(numbers[1], 10), + patch: parseInt(numbers[2], 10) + } +} + +exports.paramsHaveRequestBody = paramsHaveRequestBody +exports.safeStringify = safeStringify +exports.md5 = md5 +exports.isReadStream = isReadStream +exports.toBase64 = toBase64 +exports.copy = copy +exports.version = version +exports.defer = defer diff --git a/publisher/node_modules/@cypress/request/lib/multipart.js b/publisher/node_modules/@cypress/request/lib/multipart.js new file mode 100644 index 00000000..b6f2dcb6 --- /dev/null +++ b/publisher/node_modules/@cypress/request/lib/multipart.js @@ -0,0 +1,112 @@ +'use strict' + +var { v4: uuid } = require('uuid') +var CombinedStream = require('combined-stream') +var isstream = require('isstream') +var Buffer = require('safe-buffer').Buffer + +function Multipart (request) { + this.request = request + this.boundary = uuid() + this.chunked = false + this.body = null +} + +Multipart.prototype.isChunked = function (options) { + var self = this + var chunked = false + var parts = options.data || options + + if (!parts.forEach) { + self.request.emit('error', new Error('Argument error, options.multipart.')) + } + + if (options.chunked !== undefined) { + chunked = options.chunked + } + + if (self.request.getHeader('transfer-encoding') === 'chunked') { + chunked = true + } + + if (!chunked) { + parts.forEach(function (part) { + if (typeof part.body === 'undefined') { + self.request.emit('error', new Error('Body attribute missing in multipart.')) + } + if (isstream(part.body)) { + chunked = true + } + }) + } + + return chunked +} + +Multipart.prototype.setHeaders = function (chunked) { + var self = this + + if (chunked && !self.request.hasHeader('transfer-encoding')) { + self.request.setHeader('transfer-encoding', 'chunked') + } + + var header = self.request.getHeader('content-type') + + if (!header || header.indexOf('multipart') === -1) { + self.request.setHeader('content-type', 'multipart/related; boundary=' + self.boundary) + } else { + if (header.indexOf('boundary') !== -1) { + self.boundary = header.replace(/.*boundary=([^\s;]+).*/, '$1') + } else { + self.request.setHeader('content-type', header + '; boundary=' + self.boundary) + } + } +} + +Multipart.prototype.build = function (parts, chunked) { + var self = this + var body = chunked ? new CombinedStream() : [] + + function add (part) { + if (typeof part === 'number') { + part = part.toString() + } + return chunked ? body.append(part) : body.push(Buffer.from(part)) + } + + if (self.request.preambleCRLF) { + add('\r\n') + } + + parts.forEach(function (part) { + var preamble = '--' + self.boundary + '\r\n' + Object.keys(part).forEach(function (key) { + if (key === 'body') { return } + preamble += key + ': ' + part[key] + '\r\n' + }) + preamble += '\r\n' + add(preamble) + add(part.body) + add('\r\n') + }) + add('--' + self.boundary + '--') + + if (self.request.postambleCRLF) { + add('\r\n') + } + + return body +} + +Multipart.prototype.onRequest = function (options) { + var self = this + + var chunked = self.isChunked(options) + var parts = options.data || options + + self.setHeaders(chunked) + self.chunked = chunked + self.body = self.build(parts, chunked) +} + +exports.Multipart = Multipart diff --git a/publisher/node_modules/@cypress/request/lib/querystring.js b/publisher/node_modules/@cypress/request/lib/querystring.js new file mode 100644 index 00000000..4a32cd14 --- /dev/null +++ b/publisher/node_modules/@cypress/request/lib/querystring.js @@ -0,0 +1,50 @@ +'use strict' + +var qs = require('qs') +var querystring = require('querystring') + +function Querystring (request) { + this.request = request + this.lib = null + this.useQuerystring = null + this.parseOptions = null + this.stringifyOptions = null +} + +Querystring.prototype.init = function (options) { + if (this.lib) { return } + + this.useQuerystring = options.useQuerystring + this.lib = (this.useQuerystring ? querystring : qs) + + this.parseOptions = options.qsParseOptions || {} + this.stringifyOptions = options.qsStringifyOptions || {} +} + +Querystring.prototype.stringify = function (obj) { + return (this.useQuerystring) + ? this.rfc3986(this.lib.stringify(obj, + this.stringifyOptions.sep || null, + this.stringifyOptions.eq || null, + this.stringifyOptions)) + : this.lib.stringify(obj, this.stringifyOptions) +} + +Querystring.prototype.parse = function (str) { + return (this.useQuerystring) + ? this.lib.parse(str, + this.parseOptions.sep || null, + this.parseOptions.eq || null, + this.parseOptions) + : this.lib.parse(str, this.parseOptions) +} + +Querystring.prototype.rfc3986 = function (str) { + return str.replace(/[!'()*]/g, function (c) { + return '%' + c.charCodeAt(0).toString(16).toUpperCase() + }) +} + +Querystring.prototype.unescape = querystring.unescape + +exports.Querystring = Querystring diff --git a/publisher/node_modules/@cypress/request/lib/redirect.js b/publisher/node_modules/@cypress/request/lib/redirect.js new file mode 100644 index 00000000..4634a639 --- /dev/null +++ b/publisher/node_modules/@cypress/request/lib/redirect.js @@ -0,0 +1,179 @@ +'use strict' + +var url = require('url') +var isUrl = /^https?:/ + +function Redirect (request) { + this.request = request + this.followRedirect = true + this.followRedirects = true + this.followAllRedirects = false + this.followOriginalHttpMethod = false + this.allowRedirect = function () { return true } + this.maxRedirects = 10 + this.redirects = [] + this.redirectsFollowed = 0 + this.removeRefererHeader = false + this.allowInsecureRedirect = false +} + +Redirect.prototype.onRequest = function (options) { + var self = this + + if (options.maxRedirects !== undefined) { + self.maxRedirects = options.maxRedirects + } + if (typeof options.followRedirect === 'function') { + self.allowRedirect = options.followRedirect + } + if (options.followRedirect !== undefined) { + self.followRedirects = !!options.followRedirect + } + if (options.followAllRedirects !== undefined) { + self.followAllRedirects = options.followAllRedirects + } + if (self.followRedirects || self.followAllRedirects) { + self.redirects = self.redirects || [] + } + if (options.removeRefererHeader !== undefined) { + self.removeRefererHeader = options.removeRefererHeader + } + if (options.followOriginalHttpMethod !== undefined) { + self.followOriginalHttpMethod = options.followOriginalHttpMethod + } + if (options.allowInsecureRedirect !== undefined) { + self.allowInsecureRedirect = options.allowInsecureRedirect + } +} + +Redirect.prototype.redirectTo = function (response) { + var self = this + var request = self.request + + var redirectTo = null + if (response.statusCode >= 300 && response.statusCode < 400 && response.caseless.has('location')) { + var location = response.caseless.get('location') + request.debug('redirect', location) + + if (self.followAllRedirects) { + redirectTo = location + } else if (self.followRedirects) { + switch (request.method) { + case 'PATCH': + case 'PUT': + case 'POST': + case 'DELETE': + // Do not follow redirects + break + default: + redirectTo = location + break + } + } + } else if (response.statusCode === 401) { + var authHeader = request._auth.onResponse(response) + if (authHeader) { + request.setHeader('authorization', authHeader) + redirectTo = request.uri + } + } + return redirectTo +} + +Redirect.prototype.onResponse = function (response, callback) { + var self = this + var request = self.request + + var redirectTo = self.redirectTo(response) + if (!redirectTo) return callback(null, false) + + function processRedirect (shouldRedirect) { + if (!shouldRedirect) return callback(null, false) + if (typeof shouldRedirect === 'string') { + // overridden redirect url + request.debug('redirect overridden', redirectTo) + redirectTo = shouldRedirect + } + + request.debug('redirect to', redirectTo) + + // ignore any potential response body. it cannot possibly be useful + // to us at this point. + // response.resume should be defined, but check anyway before calling. Workaround for browserify. + if (response.resume) { + response.resume() + } + + if (self.redirectsFollowed >= self.maxRedirects) { + return callback(new Error('Exceeded maxRedirects. Probably stuck in a redirect loop ' + request.uri.href)) + } + self.redirectsFollowed += 1 + + if (!isUrl.test(redirectTo)) { + redirectTo = url.resolve(request.uri.href, redirectTo) + } + + var uriPrev = request.uri + request.uri = url.parse(redirectTo) + + // handle the case where we change protocol from https to http or vice versa + if (request.uri.protocol !== uriPrev.protocol && self.allowInsecureRedirect) { + delete request.agent + } + + self.redirects.push({ statusCode: response.statusCode, redirectUri: redirectTo }) + + if (self.followAllRedirects && request.method !== 'HEAD' && + response.statusCode !== 401 && response.statusCode !== 307) { + request.method = self.followOriginalHttpMethod ? request.method : 'GET' + } + // request.method = 'GET' // Force all redirects to use GET || commented out fixes #215 + delete request.src + delete request.req + delete request._started + if (response.statusCode !== 401 && response.statusCode !== 307) { + // Remove parameters from the previous response, unless this is the second request + // for a server that requires digest authentication. + delete request.body + delete request._form + if (request.headers) { + request.removeHeader('host') + request.removeHeader('content-type') + request.removeHeader('content-length') + if (request.uri.hostname !== request.originalHost.split(':')[0]) { + // Remove authorization if changing hostnames (but not if just + // changing ports or protocols). This matches the behavior of curl: + // https://github.com/bagder/curl/blob/6beb0eee/lib/http.c#L710 + request.removeHeader('authorization') + } + } + } + + if (!self.removeRefererHeader) { + request.setHeader('referer', uriPrev.href) + } + + request.emit('redirect') + request.init() + callback(null, true) + } + + // test allowRedirect arity; if has more than one argument, + // assume it's asynchronous via a callback + if (self.allowRedirect.length > 1) { + return self.allowRedirect.call(request, response, function (err, result) { + if (err) return callback(err) + processRedirect(result) + }) + } + + var allowsRedirect = self.allowRedirect.call(request, response) + if (allowsRedirect && allowsRedirect.then) { + return allowsRedirect.then(processRedirect, callback) + } + + // treat as a regular boolean + processRedirect(allowsRedirect) +} + +exports.Redirect = Redirect diff --git a/publisher/node_modules/@cypress/request/lib/tunnel.js b/publisher/node_modules/@cypress/request/lib/tunnel.js new file mode 100644 index 00000000..4479003f --- /dev/null +++ b/publisher/node_modules/@cypress/request/lib/tunnel.js @@ -0,0 +1,175 @@ +'use strict' + +var url = require('url') +var tunnel = require('tunnel-agent') + +var defaultProxyHeaderWhiteList = [ + 'accept', + 'accept-charset', + 'accept-encoding', + 'accept-language', + 'accept-ranges', + 'cache-control', + 'content-encoding', + 'content-language', + 'content-location', + 'content-md5', + 'content-range', + 'content-type', + 'connection', + 'date', + 'expect', + 'max-forwards', + 'pragma', + 'referer', + 'te', + 'user-agent', + 'via' +] + +var defaultProxyHeaderExclusiveList = [ + 'proxy-authorization' +] + +function constructProxyHost (uriObject) { + var port = uriObject.port + var protocol = uriObject.protocol + var proxyHost = uriObject.hostname + ':' + + if (port) { + proxyHost += port + } else if (protocol === 'https:') { + proxyHost += '443' + } else { + proxyHost += '80' + } + + return proxyHost +} + +function constructProxyHeaderWhiteList (headers, proxyHeaderWhiteList) { + var whiteList = proxyHeaderWhiteList + .reduce(function (set, header) { + set[header.toLowerCase()] = true + return set + }, {}) + + return Object.keys(headers) + .filter(function (header) { + return whiteList[header.toLowerCase()] + }) + .reduce(function (set, header) { + set[header] = headers[header] + return set + }, {}) +} + +function constructTunnelOptions (request, proxyHeaders) { + var proxy = request.proxy + + var tunnelOptions = { + proxy: { + host: proxy.hostname, + port: +proxy.port, + proxyAuth: proxy.auth, + headers: proxyHeaders + }, + headers: request.headers, + ca: request.ca, + cert: request.cert, + key: request.key, + passphrase: request.passphrase, + pfx: request.pfx, + ciphers: request.ciphers, + rejectUnauthorized: request.rejectUnauthorized, + secureOptions: request.secureOptions, + secureProtocol: request.secureProtocol + } + + return tunnelOptions +} + +function constructTunnelFnName (uri, proxy) { + var uriProtocol = (uri.protocol === 'https:' ? 'https' : 'http') + var proxyProtocol = (proxy.protocol === 'https:' ? 'Https' : 'Http') + return [uriProtocol, proxyProtocol].join('Over') +} + +function getTunnelFn (request) { + var uri = request.uri + var proxy = request.proxy + var tunnelFnName = constructTunnelFnName(uri, proxy) + return tunnel[tunnelFnName] +} + +function Tunnel (request) { + this.request = request + this.proxyHeaderWhiteList = defaultProxyHeaderWhiteList + this.proxyHeaderExclusiveList = [] + if (typeof request.tunnel !== 'undefined') { + this.tunnelOverride = request.tunnel + } +} + +Tunnel.prototype.isEnabled = function () { + var self = this + var request = self.request + // Tunnel HTTPS by default. Allow the user to override this setting. + + // If self.tunnelOverride is set (the user specified a value), use it. + if (typeof self.tunnelOverride !== 'undefined') { + return self.tunnelOverride + } + + // If the destination is HTTPS, tunnel. + if (request.uri.protocol === 'https:') { + return true + } + + // Otherwise, do not use tunnel. + return false +} + +Tunnel.prototype.setup = function (options) { + var self = this + var request = self.request + + options = options || {} + + if (typeof request.proxy === 'string') { + request.proxy = url.parse(request.proxy) + } + + if (!request.proxy || !request.tunnel) { + return false + } + + // Setup Proxy Header Exclusive List and White List + if (options.proxyHeaderWhiteList) { + self.proxyHeaderWhiteList = options.proxyHeaderWhiteList + } + if (options.proxyHeaderExclusiveList) { + self.proxyHeaderExclusiveList = options.proxyHeaderExclusiveList + } + + var proxyHeaderExclusiveList = self.proxyHeaderExclusiveList.concat(defaultProxyHeaderExclusiveList) + var proxyHeaderWhiteList = self.proxyHeaderWhiteList.concat(proxyHeaderExclusiveList) + + // Setup Proxy Headers and Proxy Headers Host + // Only send the Proxy White Listed Header names + var proxyHeaders = constructProxyHeaderWhiteList(request.headers, proxyHeaderWhiteList) + proxyHeaders.host = constructProxyHost(request.uri) + + proxyHeaderExclusiveList.forEach(request.removeHeader, request) + + // Set Agent from Tunnel Data + var tunnelFn = getTunnelFn(request) + var tunnelOptions = constructTunnelOptions(request, proxyHeaders) + request.agent = tunnelFn(tunnelOptions) + + return true +} + +Tunnel.defaultProxyHeaderWhiteList = defaultProxyHeaderWhiteList +Tunnel.defaultProxyHeaderExclusiveList = defaultProxyHeaderExclusiveList +exports.Tunnel = Tunnel diff --git a/publisher/node_modules/@cypress/request/package.json b/publisher/node_modules/@cypress/request/package.json new file mode 100644 index 00000000..9d4ce706 --- /dev/null +++ b/publisher/node_modules/@cypress/request/package.json @@ -0,0 +1,84 @@ +{ + "name": "@cypress/request", + "description": "Cypress's fork of a simplified HTTP request client.", + "keywords": [ + "http", + "simple", + "util", + "utility" + ], + "version": "3.0.6", + "author": "Mikeal Rogers ", + "repository": { + "type": "git", + "url": "https://github.com/cypress-io/request.git" + }, + "bugs": { + "url": "http://github.com/cypress-io/request/issues" + }, + "license": "Apache-2.0", + "engines": { + "node": ">= 6" + }, + "main": "index.js", + "files": [ + "lib/", + "index.js", + "request.js" + ], + "dependencies": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~4.0.0", + "http-signature": "~1.4.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "performance-now": "^2.1.0", + "qs": "6.13.0", + "safe-buffer": "^5.1.2", + "tough-cookie": "^5.0.0", + "tunnel-agent": "^0.6.0", + "uuid": "^8.3.2" + }, + "scripts": { + "test": "npm run lint && npm run test-ci && npm run test-browser", + "test-ci": "tap --no-check-coverage tests/test-*.js", + "test-cov": "nyc --reporter=lcov tape tests/test-*.js", + "test-browser": "echo 'Skipping browser tests.' || node tests/browser/start.js", + "lint": "standard" + }, + "devDependencies": { + "bluebird": "^3.2.1", + "browserify": "^13.0.1", + "browserify-istanbul": "^2.0.0", + "buffer-equal": "^1.0.0", + "codecov": "^3.0.4", + "coveralls": "^3.0.2", + "function-bind": "^1.0.2", + "karma": "^3.0.0", + "karma-browserify": "^5.0.1", + "karma-cli": "^2.0.0", + "karma-coverage": "^2.0.3", + "karma-phantomjs-launcher": "^1.0.0", + "karma-tap": "^4.2.0", + "nyc": "^17.0.0", + "phantomjs-prebuilt": "^2.1.3", + "rimraf": "^2.2.8", + "server-destroy": "^1.0.1", + "standard": "^9.0.0", + "tap": "^15.1.5", + "tape": "^4.6.0" + }, + "greenkeeper": { + "ignore": [ + "hawk", + "har-validator" + ] + } +} diff --git a/publisher/node_modules/@cypress/request/request.js b/publisher/node_modules/@cypress/request/request.js new file mode 100644 index 00000000..e6bf2238 --- /dev/null +++ b/publisher/node_modules/@cypress/request/request.js @@ -0,0 +1,1548 @@ +'use strict' + +var http = require('http') +var https = require('https') +var url = require('url') +var util = require('util') +var stream = require('stream') +var zlib = require('zlib') +var aws2 = require('aws-sign2') +var aws4 = require('aws4') +var httpSignature = require('http-signature') +var mime = require('mime-types') +var caseless = require('caseless') +var ForeverAgent = require('forever-agent') +var FormData = require('form-data') +var extend = require('extend') +var isstream = require('isstream') +var isTypedArray = require('is-typedarray').strict +var helpers = require('./lib/helpers') +var cookies = require('./lib/cookies') +var getProxyFromURI = require('./lib/getProxyFromURI') +var Querystring = require('./lib/querystring').Querystring +var Har = require('./lib/har').Har +var Auth = require('./lib/auth').Auth +var hawk = require('./lib/hawk') +var Multipart = require('./lib/multipart').Multipart +var Redirect = require('./lib/redirect').Redirect +var Tunnel = require('./lib/tunnel').Tunnel +var now = require('performance-now') +var Buffer = require('safe-buffer').Buffer + +var safeStringify = helpers.safeStringify +var isReadStream = helpers.isReadStream +var toBase64 = helpers.toBase64 +var defer = helpers.defer +var copy = helpers.copy +var version = helpers.version +var globalCookieJar = cookies.jar() + +var globalPool = {} + +function filterForNonReserved (reserved, options) { + // Filter out properties that are not reserved. + // Reserved values are passed in at call site. + + var object = {} + for (var i in options) { + var notReserved = (reserved.indexOf(i) === -1) + if (notReserved) { + object[i] = options[i] + } + } + return object +} + +function filterOutReservedFunctions (reserved, options) { + // Filter out properties that are functions and are reserved. + // Reserved values are passed in at call site. + + var object = {} + for (var i in options) { + var isReserved = !(reserved.indexOf(i) === -1) + var isFunction = (typeof options[i] === 'function') + if (!(isReserved && isFunction)) { + object[i] = options[i] + } + } + return object +} + +// Return a simpler request object to allow serialization +function requestToJSON () { + var self = this + return { + uri: self.uri, + method: self.method, + headers: self.headers + } +} + +// Return a simpler response object to allow serialization +function responseToJSON () { + var self = this + return { + statusCode: self.statusCode, + body: self.body, + headers: self.headers, + request: requestToJSON.call(self.request) + } +} + +function Request (options) { + // if given the method property in options, set property explicitMethod to true + + // extend the Request instance with any non-reserved properties + // remove any reserved functions from the options object + // set Request instance to be readable and writable + // call init + + var self = this + + // start with HAR, then override with additional options + if (options.har) { + self._har = new Har(self) + options = self._har.options(options) + } + + stream.Stream.call(self) + var reserved = Object.keys(Request.prototype) + var nonReserved = filterForNonReserved(reserved, options) + + extend(self, nonReserved) + options = filterOutReservedFunctions(reserved, options) + + self.readable = true + self.writable = true + if (options.method) { + self.explicitMethod = true + } + self._qs = new Querystring(self) + self._auth = new Auth(self) + self._multipart = new Multipart(self) + self._redirect = new Redirect(self) + self._tunnel = new Tunnel(self) + self.init(options) +} + +util.inherits(Request, stream.Stream) + +// Debugging +Request.debug = process.env.NODE_DEBUG && /\brequest\b/.test(process.env.NODE_DEBUG) +function debug () { + if (Request.debug) { + console.error('REQUEST %s', util.format.apply(util, arguments)) + } +} +Request.prototype.debug = debug + +Request.prototype.init = function (options) { + // init() contains all the code to setup the request object. + // the actual outgoing request is not started until start() is called + // this function is called from both the constructor and on redirect. + var self = this + if (!options) { + options = {} + } + self.headers = self.headers ? copy(self.headers) : {} + + // Delete headers with value undefined since they break + // ClientRequest.OutgoingMessage.setHeader in node 0.12 + for (var headerName in self.headers) { + if (typeof self.headers[headerName] === 'undefined') { + delete self.headers[headerName] + } + } + + caseless.httpify(self, self.headers) + + if (!self.method) { + self.method = options.method || 'GET' + } + if (!self.localAddress) { + self.localAddress = options.localAddress + } + + self._qs.init(options) + + debug(options) + if (!self.pool && self.pool !== false) { + self.pool = globalPool + } + self.dests = self.dests || [] + self.__isRequestRequest = true + + // Protect against double callback + if (!self._callback && self.callback) { + self._callback = self.callback + self.callback = function () { + if (self._callbackCalled) { + return // Print a warning maybe? + } + self._callbackCalled = true + self._callback.apply(self, arguments) + } + self.on('error', self.callback.bind()) + self.on('complete', self.callback.bind(self, null)) + } + + // People use this property instead all the time, so support it + if (!self.uri && self.url) { + self.uri = self.url + delete self.url + } + + // If there's a baseUrl, then use it as the base URL (i.e. uri must be + // specified as a relative path and is appended to baseUrl). + if (self.baseUrl) { + if (typeof self.baseUrl !== 'string') { + return self.emit('error', new Error('options.baseUrl must be a string')) + } + + if (typeof self.uri !== 'string') { + return self.emit('error', new Error('options.uri must be a string when using options.baseUrl')) + } + + if (self.uri.indexOf('//') === 0 || self.uri.indexOf('://') !== -1) { + return self.emit('error', new Error('options.uri must be a path when using options.baseUrl')) + } + + // Handle all cases to make sure that there's only one slash between + // baseUrl and uri. + var baseUrlEndsWithSlash = self.baseUrl.lastIndexOf('/') === self.baseUrl.length - 1 + var uriStartsWithSlash = self.uri.indexOf('/') === 0 + + if (baseUrlEndsWithSlash && uriStartsWithSlash) { + self.uri = self.baseUrl + self.uri.slice(1) + } else if (baseUrlEndsWithSlash || uriStartsWithSlash) { + self.uri = self.baseUrl + self.uri + } else if (self.uri === '') { + self.uri = self.baseUrl + } else { + self.uri = self.baseUrl + '/' + self.uri + } + delete self.baseUrl + } + + // A URI is needed by this point, emit error if we haven't been able to get one + if (!self.uri) { + return self.emit('error', new Error('options.uri is a required argument')) + } + + // If a string URI/URL was given, parse it into a URL object + if (typeof self.uri === 'string') { + self.uri = url.parse(self.uri) + } + + // Some URL objects are not from a URL parsed string and need href added + if (!self.uri.href) { + self.uri.href = url.format(self.uri) + } + + // DEPRECATED: Warning for users of the old Unix Sockets URL Scheme + if (self.uri.protocol === 'unix:') { + return self.emit('error', new Error('`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`')) + } + + // Support Unix Sockets + if (self.uri.host === 'unix') { + self.enableUnixSocket() + } + + if (self.strictSSL === false) { + self.rejectUnauthorized = false + } + + if (!self.uri.pathname) { self.uri.pathname = '/' } + + if (!(self.uri.host || (self.uri.hostname && self.uri.port)) && !self.uri.isUnix) { + // Invalid URI: it may generate lot of bad errors, like 'TypeError: Cannot call method `indexOf` of undefined' in CookieJar + // Detect and reject it as soon as possible + var faultyUri = url.format(self.uri) + var message = 'Invalid URI "' + faultyUri + '"' + if (Object.keys(options).length === 0) { + // No option ? This can be the sign of a redirect + // As this is a case where the user cannot do anything (they didn't call request directly with this URL) + // they should be warned that it can be caused by a redirection (can save some hair) + message += '. This can be caused by a crappy redirection.' + } + // This error was fatal + self.abort() + return self.emit('error', new Error(message)) + } + + if (!self.hasOwnProperty('proxy')) { + self.proxy = getProxyFromURI(self.uri) + } + + self.tunnel = self._tunnel.isEnabled() + if (self.proxy) { + self._tunnel.setup(options) + } + + self._redirect.onRequest(options) + + self.setHost = false + if (!self.hasHeader('host')) { + var hostHeaderName = self.originalHostHeaderName || 'host' + self.setHeader(hostHeaderName, self.uri.host) + // Drop :port suffix from Host header if known protocol. + if (self.uri.port) { + if ((self.uri.port === '80' && self.uri.protocol === 'http:') || + (self.uri.port === '443' && self.uri.protocol === 'https:')) { + self.setHeader(hostHeaderName, self.uri.hostname) + } + } + self.setHost = true + } + + self.jar(self._jar || options.jar) + + if (!self.uri.port) { + if (self.uri.protocol === 'http:') { self.uri.port = 80 } else if (self.uri.protocol === 'https:') { self.uri.port = 443 } + } + + if (self.proxy && !self.tunnel) { + self.port = self.proxy.port + self.host = self.proxy.hostname + } else { + self.port = self.uri.port + self.host = self.uri.hostname + } + + if (options.form) { + self.form(options.form) + } + + if (options.formData) { + var formData = options.formData + var requestForm = self.form() + var appendFormValue = function (key, value) { + if (value && value.hasOwnProperty('value') && value.hasOwnProperty('options')) { + requestForm.append(key, value.value, value.options) + } else { + requestForm.append(key, value) + } + } + for (var formKey in formData) { + if (formData.hasOwnProperty(formKey)) { + var formValue = formData[formKey] + if (formValue instanceof Array) { + for (var j = 0; j < formValue.length; j++) { + appendFormValue(formKey, formValue[j]) + } + } else { + appendFormValue(formKey, formValue) + } + } + } + } + + if (options.qs) { + self.qs(options.qs) + } + + if (self.uri.path) { + self.path = self.uri.path + } else { + self.path = self.uri.pathname + (self.uri.search || '') + } + + if (self.path.length === 0) { + self.path = '/' + } + + // Auth must happen last in case signing is dependent on other headers + if (options.aws) { + self.aws(options.aws) + } + + if (options.hawk) { + self.hawk(options.hawk) + } + + if (options.httpSignature) { + self.httpSignature(options.httpSignature) + } + + if (options.auth) { + if (Object.prototype.hasOwnProperty.call(options.auth, 'username')) { + options.auth.user = options.auth.username + } + if (Object.prototype.hasOwnProperty.call(options.auth, 'password')) { + options.auth.pass = options.auth.password + } + + self.auth( + options.auth.user, + options.auth.pass, + options.auth.sendImmediately, + options.auth.bearer + ) + } + + if (self.gzip && !self.hasHeader('accept-encoding')) { + self.setHeader('accept-encoding', 'gzip, deflate') + } + + if (self.uri.auth && !self.hasHeader('authorization')) { + var uriAuthPieces = self.uri.auth.split(':').map(function (item) { return self._qs.unescape(item) }) + self.auth(uriAuthPieces[0], uriAuthPieces.slice(1).join(':'), true) + } + + if (!self.tunnel && self.proxy && self.proxy.auth && !self.hasHeader('proxy-authorization')) { + var proxyAuthPieces = self.proxy.auth.split(':').map(function (item) { return self._qs.unescape(item) }) + var authHeader = 'Basic ' + toBase64(proxyAuthPieces.join(':')) + self.setHeader('proxy-authorization', authHeader) + } + + if (self.proxy && !self.tunnel) { + self.path = (self.uri.protocol + '//' + self.uri.host + self.path) + } + + if (options.json) { + self.json(options.json) + } + if (options.multipart) { + self.multipart(options.multipart) + } + + if (options.time) { + self.timing = true + + // NOTE: elapsedTime is deprecated in favor of .timings + self.elapsedTime = self.elapsedTime || 0 + } + + function setContentLength () { + if (isTypedArray(self.body)) { + self.body = Buffer.from(self.body) + } + + if (!self.hasHeader('content-length')) { + var length + if (typeof self.body === 'string') { + length = Buffer.byteLength(self.body) + } else if (Array.isArray(self.body)) { + length = self.body.reduce(function (a, b) { return a + b.length }, 0) + } else { + length = self.body.length + } + + if (length) { + self.setHeader('content-length', length) + } else { + self.emit('error', new Error('Argument error, options.body.')) + } + } + } + if (self.body && !isstream(self.body)) { + setContentLength() + } + + var protocol = self.proxy && !self.tunnel ? self.proxy.protocol : self.uri.protocol + var defaultModules = {'http:': http, 'https:': https} + var httpModules = self.httpModules || {} + + self.httpModule = httpModules[protocol] || defaultModules[protocol] + + if (!self.httpModule) { + return self.emit('error', new Error('Invalid protocol: ' + protocol)) + } + + if (options.ca) { + self.ca = options.ca + } + + if (!self.agent) { + if (options.agentOptions) { + self.agentOptions = options.agentOptions + } + + if (options.agentClass) { + self.agentClass = options.agentClass + } else if (options.forever) { + var v = version() + // use ForeverAgent in node 0.10- only + if (v.major === 0 && v.minor <= 10) { + self.agentClass = protocol === 'http:' ? ForeverAgent : ForeverAgent.SSL + } else { + self.agentClass = self.httpModule.Agent + self.agentOptions = self.agentOptions || {} + self.agentOptions.keepAlive = true + } + } else { + self.agentClass = self.httpModule.Agent + } + } + + if (self.pool === false) { + self.agent = false + } else { + self.agent = self.agent || self.getNewAgent() + } + + self.on('pipe', function (src) { + if (self.ntick && self._started) { + self.emit('error', new Error('You cannot pipe to this stream after the outbound request has started.')) + } + self.src = src + if (isReadStream(src)) { + if (!self.hasHeader('content-type')) { + self.setHeader('content-type', mime.lookup(src.path)) + } + } else { + if (src.headers) { + for (var i in src.headers) { + if (!self.hasHeader(i)) { + self.setHeader(i, src.headers[i]) + } + } + } + if (self._json && !self.hasHeader('content-type')) { + self.setHeader('content-type', 'application/json') + } + if (src.method && !self.explicitMethod) { + self.method = src.method + } + } + + // self.on('pipe', function () { + // console.error('You have already piped to this stream. Pipeing twice is likely to break the request.') + // }) + }) + + defer(function () { + if (self._aborted) { + return + } + + var end = function () { + if (self._form) { + if (!self._auth.hasAuth) { + self._form.pipe(self) + } else if (self._auth.hasAuth && self._auth.sentAuth) { + self._form.pipe(self) + } + } + if (self._multipart && self._multipart.chunked) { + self._multipart.body.pipe(self) + } + if (self.body) { + if (isstream(self.body)) { + self.body.pipe(self) + } else { + setContentLength() + if (Array.isArray(self.body)) { + self.body.forEach(function (part) { + self.write(part) + }) + } else { + self.write(self.body) + } + self.end() + } + } else if (self.requestBodyStream) { + console.warn('options.requestBodyStream is deprecated, please pass the request object to stream.pipe.') + self.requestBodyStream.pipe(self) + } else if (!self.src) { + if (self._auth.hasAuth && !self._auth.sentAuth) { + self.end() + return + } + if (self.method !== 'GET' && typeof self.method !== 'undefined') { + self.setHeader('content-length', 0) + } + self.end() + } + } + + if (self._form && !self.hasHeader('content-length')) { + // Before ending the request, we had to compute the length of the whole form, asyncly + self.setHeader(self._form.getHeaders(), true) + self._form.getLength(function (err, length) { + if (!err && !isNaN(length)) { + self.setHeader('content-length', length) + } + end() + }) + } else { + end() + } + + self.ntick = true + }) +} + +Request.prototype.getNewAgent = function () { + var self = this + var Agent = self.agentClass + var options = {} + if (self.agentOptions) { + for (var i in self.agentOptions) { + options[i] = self.agentOptions[i] + } + } + if (self.ca) { + options.ca = self.ca + } + if (self.ciphers) { + options.ciphers = self.ciphers + } + if (self.secureProtocol) { + options.secureProtocol = self.secureProtocol + } + if (self.secureOptions) { + options.secureOptions = self.secureOptions + } + if (typeof self.rejectUnauthorized !== 'undefined') { + options.rejectUnauthorized = self.rejectUnauthorized + } + + if (self.cert && self.key) { + options.key = self.key + options.cert = self.cert + } + + if (self.pfx) { + options.pfx = self.pfx + } + + if (self.passphrase) { + options.passphrase = self.passphrase + } + + var poolKey = '' + + // different types of agents are in different pools + if (Agent !== self.httpModule.Agent) { + poolKey += Agent.name + } + + // ca option is only relevant if proxy or destination are https + var proxy = self.proxy + if (typeof proxy === 'string') { + proxy = url.parse(proxy) + } + var isHttps = (proxy && proxy.protocol === 'https:') || this.uri.protocol === 'https:' + + if (isHttps) { + if (options.ca) { + if (poolKey) { + poolKey += ':' + } + poolKey += options.ca + } + + if (typeof options.rejectUnauthorized !== 'undefined') { + if (poolKey) { + poolKey += ':' + } + poolKey += options.rejectUnauthorized + } + + if (options.cert) { + if (poolKey) { + poolKey += ':' + } + poolKey += options.cert.toString('ascii') + options.key.toString('ascii') + } + + if (options.pfx) { + if (poolKey) { + poolKey += ':' + } + poolKey += options.pfx.toString('ascii') + } + + if (options.ciphers) { + if (poolKey) { + poolKey += ':' + } + poolKey += options.ciphers + } + + if (options.secureProtocol) { + if (poolKey) { + poolKey += ':' + } + poolKey += options.secureProtocol + } + + if (options.secureOptions) { + if (poolKey) { + poolKey += ':' + } + poolKey += options.secureOptions + } + } + + if (self.pool === globalPool && !poolKey && Object.keys(options).length === 0 && self.httpModule.globalAgent) { + // not doing anything special. Use the globalAgent + return self.httpModule.globalAgent + } + + // we're using a stored agent. Make sure it's protocol-specific + poolKey = self.uri.protocol + poolKey + + // generate a new agent for this setting if none yet exists + if (!self.pool[poolKey]) { + self.pool[poolKey] = new Agent(options) + // properly set maxSockets on new agents + if (self.pool.maxSockets) { + self.pool[poolKey].maxSockets = self.pool.maxSockets + } + } + + return self.pool[poolKey] +} + +Request.prototype.start = function () { + // start() is called once we are ready to send the outgoing HTTP request. + // this is usually called on the first write(), end() or on nextTick() + var self = this + + if (self.timing) { + // All timings will be relative to this request's startTime. In order to do this, + // we need to capture the wall-clock start time (via Date), immediately followed + // by the high-resolution timer (via now()). While these two won't be set + // at the _exact_ same time, they should be close enough to be able to calculate + // high-resolution, monotonically non-decreasing timestamps relative to startTime. + var startTime = new Date().getTime() + var startTimeNow = now() + } + + if (self._aborted) { + return + } + + self._started = true + self.method = self.method || 'GET' + self.href = self.uri.href + + if (self.src && self.src.stat && self.src.stat.size && !self.hasHeader('content-length')) { + self.setHeader('content-length', self.src.stat.size) + } + if (self._aws) { + self.aws(self._aws, true) + } + + // We have a method named auth, which is completely different from the http.request + // auth option. If we don't remove it, we're gonna have a bad time. + var reqOptions = copy(self) + delete reqOptions.auth + + debug('make request', self.uri.href) + + // node v6.8.0 now supports a `timeout` value in `http.request()`, but we + // should delete it for now since we handle timeouts manually for better + // consistency with node versions before v6.8.0 + delete reqOptions.timeout + + try { + self.req = self.httpModule.request(reqOptions) + } catch (err) { + self.emit('error', err) + return + } + + if (self.timing) { + self.startTime = startTime + self.startTimeNow = startTimeNow + + // Timing values will all be relative to startTime (by comparing to startTimeNow + // so we have an accurate clock) + self.timings = {} + } + + var timeout + if (self.timeout && !self.timeoutTimer) { + if (self.timeout < 0) { + timeout = 0 + } else if (typeof self.timeout === 'number' && isFinite(self.timeout)) { + timeout = self.timeout + } + } + + self.req.on('response', self.onRequestResponse.bind(self)) + self.req.on('error', self.onRequestError.bind(self)) + self.req.on('drain', function () { + self.emit('drain') + }) + + self.req.on('socket', function (socket) { + // `._connecting` was the old property which was made public in node v6.1.0 + var isConnecting = socket._connecting || socket.connecting + if (self.timing) { + self.timings.socket = now() - self.startTimeNow + + if (isConnecting) { + var onLookupTiming = function () { + self.timings.lookup = now() - self.startTimeNow + } + + var onConnectTiming = function () { + self.timings.connect = now() - self.startTimeNow + } + + socket.once('lookup', onLookupTiming) + socket.once('connect', onConnectTiming) + + // clean up timing event listeners if needed on error + self.req.once('error', function () { + socket.removeListener('lookup', onLookupTiming) + socket.removeListener('connect', onConnectTiming) + }) + } + } + + var setReqTimeout = function () { + // This timeout sets the amount of time to wait *between* bytes sent + // from the server once connected. + // + // In particular, it's useful for erroring if the server fails to send + // data halfway through streaming a response. + self.req.setTimeout(timeout, function () { + if (self.req) { + self.abort() + var e = new Error('ESOCKETTIMEDOUT') + e.code = 'ESOCKETTIMEDOUT' + e.connect = false + self.emit('error', e) + } + }) + } + if (timeout !== undefined) { + // Only start the connection timer if we're actually connecting a new + // socket, otherwise if we're already connected (because this is a + // keep-alive connection) do not bother. This is important since we won't + // get a 'connect' event for an already connected socket. + if (isConnecting) { + var onReqSockConnect = function () { + socket.removeListener('connect', onReqSockConnect) + self.clearTimeout() + setReqTimeout() + } + + socket.on('connect', onReqSockConnect) + + self.req.on('error', function (err) { // eslint-disable-line handle-callback-err + socket.removeListener('connect', onReqSockConnect) + }) + + // Set a timeout in memory - this block will throw if the server takes more + // than `timeout` to write the HTTP status and headers (corresponding to + // the on('response') event on the client). NB: this measures wall-clock + // time, not the time between bytes sent by the server. + self.timeoutTimer = setTimeout(function () { + socket.removeListener('connect', onReqSockConnect) + self.abort() + var e = new Error('ETIMEDOUT') + e.code = 'ETIMEDOUT' + e.connect = true + self.emit('error', e) + }, timeout) + } else { + // We're already connected + setReqTimeout() + } + } + self.emit('socket', socket) + }) + + self.emit('request', self.req) +} + +Request.prototype.onRequestError = function (error) { + var self = this + if (self._aborted) { + return + } + if (self.req && self.req._reusedSocket && error.code === 'ECONNRESET' && + self.agent.addRequestNoreuse) { + self.agent = { addRequest: self.agent.addRequestNoreuse.bind(self.agent) } + self.start() + self.req.end() + return + } + self.clearTimeout() + self.emit('error', error) +} + +Request.prototype.onRequestResponse = function (response) { + var self = this + + if (self.timing) { + self.timings.response = now() - self.startTimeNow + } + + debug('onRequestResponse', self.uri.href, response.statusCode, response.headers) + response.on('end', function () { + if (self.timing) { + self.timings.end = now() - self.startTimeNow + response.timingStart = self.startTime + + // fill in the blanks for any periods that didn't trigger, such as + // no lookup or connect due to keep alive + if (!self.timings.socket) { + self.timings.socket = 0 + } + if (!self.timings.lookup) { + self.timings.lookup = self.timings.socket + } + if (!self.timings.connect) { + self.timings.connect = self.timings.lookup + } + if (!self.timings.response) { + self.timings.response = self.timings.connect + } + + debug('elapsed time', self.timings.end) + + // elapsedTime includes all redirects + self.elapsedTime += Math.round(self.timings.end) + + // NOTE: elapsedTime is deprecated in favor of .timings + response.elapsedTime = self.elapsedTime + + // timings is just for the final fetch + response.timings = self.timings + + // pre-calculate phase timings as well + response.timingPhases = { + wait: self.timings.socket, + dns: self.timings.lookup - self.timings.socket, + tcp: self.timings.connect - self.timings.lookup, + firstByte: self.timings.response - self.timings.connect, + download: self.timings.end - self.timings.response, + total: self.timings.end + } + } + debug('response end', self.uri.href, response.statusCode, response.headers) + }) + + if (self._aborted) { + debug('aborted', self.uri.href) + response.resume() + return + } + + self.response = response + response.request = self + response.toJSON = responseToJSON + + // XXX This is different on 0.10, because SSL is strict by default + if (self.httpModule === https && + self.strictSSL && (!response.hasOwnProperty('socket') || + !response.socket.authorized)) { + debug('strict ssl error', self.uri.href) + var sslErr = response.hasOwnProperty('socket') ? response.socket.authorizationError : self.uri.href + ' does not support SSL' + self.emit('error', new Error('SSL Error: ' + sslErr)) + return + } + + // Save the original host before any redirect (if it changes, we need to + // remove any authorization headers). Also remember the case of the header + // name because lots of broken servers expect Host instead of host and we + // want the caller to be able to specify this. + self.originalHost = self.getHeader('host') + if (!self.originalHostHeaderName) { + self.originalHostHeaderName = self.hasHeader('host') + } + if (self.setHost) { + self.removeHeader('host') + } + self.clearTimeout() + + var targetCookieJar = (self._jar && self._jar.setCookie) ? self._jar : globalCookieJar + var addCookie = function (cookie) { + // set the cookie if it's domain in the href's domain. + try { + targetCookieJar.setCookie(cookie, self.uri.href, {ignoreError: true}) + } catch (e) { + self.emit('error', e) + } + } + + response.caseless = caseless(response.headers) + + if (response.caseless.has('set-cookie') && (!self._disableCookies)) { + var headerName = response.caseless.has('set-cookie') + if (Array.isArray(response.headers[headerName])) { + response.headers[headerName].forEach(addCookie) + } else { + addCookie(response.headers[headerName]) + } + } + + self._redirect.onResponse(response, function (err, followingRedirect) { + if (!err && followingRedirect) return // Ignore the rest of the response + if (err) self.emit('error', err) + + // Be a good stream and emit end when the response is finished. + // Hack to emit end on close because of a core bug that never fires end + response.on('close', function () { + if (!self._ended) { + self._ended = true + self.response.emit('end') + } + }) + + response.once('end', function () { + self._ended = true + }) + + var noBody = function (code) { + return ( + self.method === 'HEAD' || + // Informational + (code >= 100 && code < 200) || + // No Content + code === 204 || + // Not Modified + code === 304 + ) + } + + var responseContent + if (self.gzip && !noBody(response.statusCode)) { + var contentEncoding = response.headers['content-encoding'] || 'identity' + contentEncoding = contentEncoding.trim().toLowerCase() + + // Be more lenient with decoding compressed responses, since (very rarely) + // servers send slightly invalid gzip responses that are still accepted + // by common browsers. + // Always using Z_SYNC_FLUSH is what cURL does. + var zlibOptions = { + flush: zlib.Z_SYNC_FLUSH, + finishFlush: zlib.Z_SYNC_FLUSH + } + + if (contentEncoding === 'gzip') { + responseContent = zlib.createGunzip(zlibOptions) + response.pipe(responseContent) + } else if (contentEncoding === 'deflate') { + responseContent = zlib.createInflate(zlibOptions) + response.pipe(responseContent) + } else { + // Since previous versions didn't check for Content-Encoding header, + // ignore any invalid values to preserve backwards-compatibility + if (contentEncoding !== 'identity') { + debug('ignoring unrecognized Content-Encoding ' + contentEncoding) + } + responseContent = response + } + } else { + responseContent = response + } + + if (self.encoding) { + if (self.dests.length !== 0) { + console.error('Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid.') + } else { + responseContent.setEncoding(self.encoding) + } + } + + if (self._paused) { + responseContent.pause() + } + + self.responseContent = responseContent + + self.emit('response', response) + + self.dests.forEach(function (dest) { + self.pipeDest(dest) + }) + + responseContent.on('data', function (chunk) { + if (self.timing && !self.responseStarted) { + self.responseStartTime = (new Date()).getTime() + + // NOTE: responseStartTime is deprecated in favor of .timings + response.responseStartTime = self.responseStartTime + } + self._destdata = true + self.emit('data', chunk) + }) + responseContent.once('end', function (chunk) { + self.emit('end', chunk) + }) + responseContent.on('error', function (error) { + if (error.code === 'ECONNRESET' && error.message === 'aborted' && self.listenerCount('error') === 0) { + // Node 16 causes aborts to emit errors if there is an error listener. + // Without this short-circuit, it will cause unhandled exceptions since + // there is not always an `error` listener on `self`, but there will + // always be an `error` listener on `responseContent`. + // @see https://github.com/nodejs/node/pull/33172 + return + } + self.emit('error', error) + }) + responseContent.on('close', function () { self.emit('close') }) + + if (self.callback) { + self.readResponseBody(response) + } else { // if no callback + self.on('end', function () { + if (self._aborted) { + debug('aborted', self.uri.href) + return + } + self.emit('complete', response) + }) + } + debug('finish init function', self.uri.href) + }) +} + +Request.prototype.readResponseBody = function (response) { + var self = this + debug("reading response's body") + var buffers = [] + var bufferLength = 0 + var strings = [] + + self.on('data', function (chunk) { + if (!Buffer.isBuffer(chunk)) { + strings.push(chunk) + } else if (chunk.length) { + bufferLength += chunk.length + buffers.push(chunk) + } + }) + self.on('end', function () { + debug('end event', self.uri.href) + if (self._aborted) { + debug('aborted', self.uri.href) + // `buffer` is defined in the parent scope and used in a closure it exists for the life of the request. + // This can lead to leaky behavior if the user retains a reference to the request object. + buffers = [] + bufferLength = 0 + return + } + + if (bufferLength) { + debug('has body', self.uri.href, bufferLength) + response.body = Buffer.concat(buffers, bufferLength) + if (self.encoding !== null) { + response.body = response.body.toString(self.encoding) + } + // `buffer` is defined in the parent scope and used in a closure it exists for the life of the Request. + // This can lead to leaky behavior if the user retains a reference to the request object. + buffers = [] + bufferLength = 0 + } else if (strings.length) { + // The UTF8 BOM [0xEF,0xBB,0xBF] is converted to [0xFE,0xFF] in the JS UTC16/UCS2 representation. + // Strip this value out when the encoding is set to 'utf8', as upstream consumers won't expect it and it breaks JSON.parse(). + if (self.encoding === 'utf8' && strings[0].length > 0 && strings[0][0] === '\uFEFF') { + strings[0] = strings[0].substring(1) + } + response.body = strings.join('') + } + + if (self._json) { + try { + response.body = JSON.parse(response.body, self._jsonReviver) + } catch (e) { + debug('invalid JSON received', self.uri.href) + } + } + debug('emitting complete', self.uri.href) + if (typeof response.body === 'undefined' && !self._json) { + response.body = self.encoding === null ? Buffer.alloc(0) : '' + } + self.emit('complete', response, response.body) + }) +} + +Request.prototype.abort = function () { + var self = this + self._aborted = true + + if (self.req) { + self.req.abort() + } else if (self.response) { + self.response.destroy() + } + + self.clearTimeout() + self.emit('abort') +} + +Request.prototype.pipeDest = function (dest) { + var self = this + var response = self.response + // Called after the response is received + if (dest.headers && !dest.headersSent) { + if (response.caseless.has('content-type')) { + var ctname = response.caseless.has('content-type') + if (dest.setHeader) { + dest.setHeader(ctname, response.headers[ctname]) + } else { + dest.headers[ctname] = response.headers[ctname] + } + } + + if (response.caseless.has('content-length')) { + var clname = response.caseless.has('content-length') + if (dest.setHeader) { + dest.setHeader(clname, response.headers[clname]) + } else { + dest.headers[clname] = response.headers[clname] + } + } + } + if (dest.setHeader && !dest.headersSent) { + for (var i in response.headers) { + // If the response content is being decoded, the Content-Encoding header + // of the response doesn't represent the piped content, so don't pass it. + if (!self.gzip || i !== 'content-encoding') { + dest.setHeader(i, response.headers[i]) + } + } + dest.statusCode = response.statusCode + } + if (self.pipefilter) { + self.pipefilter(response, dest) + } +} + +Request.prototype.qs = function (q, clobber) { + var self = this + var base + if (!clobber && self.uri.query) { + base = self._qs.parse(self.uri.query) + } else { + base = {} + } + + for (var i in q) { + base[i] = q[i] + } + + var qs = self._qs.stringify(base) + + if (qs === '') { + return self + } + + self.uri = url.parse(self.uri.href.split('?')[0] + '?' + qs) + self.url = self.uri + self.path = self.uri.path + + if (self.uri.host === 'unix') { + self.enableUnixSocket() + } + + return self +} +Request.prototype.form = function (form) { + var self = this + if (form) { + if (!/^application\/x-www-form-urlencoded\b/.test(self.getHeader('content-type'))) { + self.setHeader('content-type', 'application/x-www-form-urlencoded') + } + self.body = (typeof form === 'string') + ? self._qs.rfc3986(form.toString('utf8')) + : self._qs.stringify(form).toString('utf8') + return self + } + // create form-data object + self._form = new FormData() + self._form.on('error', function (err) { + err.message = 'form-data: ' + err.message + self.emit('error', err) + self.abort() + }) + return self._form +} +Request.prototype.multipart = function (multipart) { + var self = this + + self._multipart.onRequest(multipart) + + if (!self._multipart.chunked) { + self.body = self._multipart.body + } + + return self +} +Request.prototype.json = function (val) { + var self = this + + if (!self.hasHeader('accept')) { + self.setHeader('accept', 'application/json') + } + + if (typeof self.jsonReplacer === 'function') { + self._jsonReplacer = self.jsonReplacer + } + + self._json = true + if (typeof val === 'boolean') { + if (self.body !== undefined) { + if (!/^application\/x-www-form-urlencoded\b/.test(self.getHeader('content-type'))) { + self.body = safeStringify(self.body, self._jsonReplacer) + } else { + self.body = self._qs.rfc3986(self.body) + } + if (!self.hasHeader('content-type')) { + self.setHeader('content-type', 'application/json') + } + } + } else { + self.body = safeStringify(val, self._jsonReplacer) + if (!self.hasHeader('content-type')) { + self.setHeader('content-type', 'application/json') + } + } + + if (typeof self.jsonReviver === 'function') { + self._jsonReviver = self.jsonReviver + } + + return self +} +Request.prototype.getHeader = function (name, headers) { + var self = this + var result, re, match + if (!headers) { + headers = self.headers + } + Object.keys(headers).forEach(function (key) { + if (key.length !== name.length) { + return + } + re = new RegExp(name, 'i') + match = key.match(re) + if (match) { + result = headers[key] + } + }) + return result +} +Request.prototype.enableUnixSocket = function () { + // Get the socket & request paths from the URL + var unixParts = this.uri.path.split(':') + var host = unixParts[0] + var path = unixParts[1] + // Apply unix properties to request + this.socketPath = host + this.uri.pathname = path + this.uri.path = path + this.uri.host = host + this.uri.hostname = host + this.uri.isUnix = true +} + +Request.prototype.auth = function (user, pass, sendImmediately, bearer) { + var self = this + + self._auth.onRequest(user, pass, sendImmediately, bearer) + + return self +} +Request.prototype.aws = function (opts, now) { + var self = this + + if (!now) { + self._aws = opts + return self + } + + if (opts.sign_version === 4 || opts.sign_version === '4') { + // use aws4 + var options = { + host: self.uri.host, + path: self.uri.path, + method: self.method, + headers: self.headers, + body: self.body + } + if (opts.service) { + options.service = opts.service + } + var signRes = aws4.sign(options, { + accessKeyId: opts.key, + secretAccessKey: opts.secret, + sessionToken: opts.session + }) + self.setHeader('authorization', signRes.headers.Authorization) + self.setHeader('x-amz-date', signRes.headers['X-Amz-Date']) + if (signRes.headers['X-Amz-Security-Token']) { + self.setHeader('x-amz-security-token', signRes.headers['X-Amz-Security-Token']) + } + } else { + // default: use aws-sign2 + var date = new Date() + self.setHeader('date', date.toUTCString()) + var auth = { + key: opts.key, + secret: opts.secret, + verb: self.method.toUpperCase(), + date: date, + contentType: self.getHeader('content-type') || '', + md5: self.getHeader('content-md5') || '', + amazonHeaders: aws2.canonicalizeHeaders(self.headers) + } + var path = self.uri.path + if (opts.bucket && path) { + auth.resource = '/' + opts.bucket + path + } else if (opts.bucket && !path) { + auth.resource = '/' + opts.bucket + } else if (!opts.bucket && path) { + auth.resource = path + } else if (!opts.bucket && !path) { + auth.resource = '/' + } + auth.resource = aws2.canonicalizeResource(auth.resource) + self.setHeader('authorization', aws2.authorization(auth)) + } + + return self +} +Request.prototype.httpSignature = function (opts) { + var self = this + httpSignature.signRequest({ + getHeader: function (header) { + return self.getHeader(header, self.headers) + }, + setHeader: function (header, value) { + self.setHeader(header, value) + }, + method: self.method, + path: self.path + }, opts) + debug('httpSignature authorization', self.getHeader('authorization')) + + return self +} +Request.prototype.hawk = function (opts) { + var self = this + self.setHeader('Authorization', hawk.header(self.uri, self.method, opts)) +} + +Request.prototype.jar = function (jar) { + var self = this + var cookies + + if (self._redirect.redirectsFollowed === 0) { + self.originalCookieHeader = self.getHeader('cookie') + } + + if (!jar) { + // disable cookies + cookies = false + self._disableCookies = true + } else { + var targetCookieJar = jar.getCookieString ? jar : globalCookieJar + var urihref = self.uri.href + // fetch cookie in the Specified host + if (targetCookieJar) { + cookies = targetCookieJar.getCookieString(urihref) + } + } + + // if need cookie and cookie is not empty + if (cookies && cookies.length) { + if (self.originalCookieHeader) { + // Don't overwrite existing Cookie header + self.setHeader('cookie', self.originalCookieHeader + '; ' + cookies) + } else { + self.setHeader('cookie', cookies) + } + } + self._jar = jar + return self +} + +// Stream API +Request.prototype.pipe = function (dest, opts) { + var self = this + + if (self.response) { + if (self._destdata) { + self.emit('error', new Error('You cannot pipe after data has been emitted from the response.')) + } else if (self._ended) { + self.emit('error', new Error('You cannot pipe after the response has been ended.')) + } else { + stream.Stream.prototype.pipe.call(self, dest, opts) + self.pipeDest(dest) + return dest + } + } else { + self.dests.push(dest) + stream.Stream.prototype.pipe.call(self, dest, opts) + return dest + } +} +Request.prototype.write = function () { + var self = this + if (self._aborted) { return } + + if (!self._started) { + self.start() + } + if (self.req) { + return self.req.write.apply(self.req, arguments) + } +} +Request.prototype.end = function (chunk) { + var self = this + if (self._aborted) { return } + + if (chunk) { + self.write(chunk) + } + if (!self._started) { + self.start() + } + if (self.req) { + self.req.end() + } +} +Request.prototype.pause = function () { + var self = this + if (!self.responseContent) { + self._paused = true + } else { + self.responseContent.pause.apply(self.responseContent, arguments) + } +} +Request.prototype.resume = function () { + var self = this + if (!self.responseContent) { + self._paused = false + } else { + self.responseContent.resume.apply(self.responseContent, arguments) + } +} +Request.prototype.destroy = function () { + var self = this + this.clearTimeout() + if (!self._ended) { + self.end() + } else if (self.response) { + self.response.destroy() + } +} + +Request.prototype.clearTimeout = function () { + if (this.timeoutTimer) { + clearTimeout(this.timeoutTimer) + this.timeoutTimer = null + } +} + +Request.defaultProxyHeaderWhiteList = + Tunnel.defaultProxyHeaderWhiteList.slice() + +Request.defaultProxyHeaderExclusiveList = + Tunnel.defaultProxyHeaderExclusiveList.slice() + +// Exports + +Request.prototype.toJSON = requestToJSON +module.exports = Request diff --git a/publisher/node_modules/@nodelib/fs.scandir/LICENSE b/publisher/node_modules/@nodelib/fs.scandir/LICENSE new file mode 100644 index 00000000..65a99946 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.scandir/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Denis Malinochkin + +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. diff --git a/publisher/node_modules/@nodelib/fs.scandir/README.md b/publisher/node_modules/@nodelib/fs.scandir/README.md new file mode 100644 index 00000000..e0b218b9 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.scandir/README.md @@ -0,0 +1,171 @@ +# @nodelib/fs.scandir + +> List files and directories inside the specified directory. + +## :bulb: Highlights + +The package is aimed at obtaining information about entries in the directory. + +* :moneybag: Returns useful information: `name`, `path`, `dirent` and `stats` (optional). +* :gear: On Node.js 10.10+ uses the mechanism without additional calls to determine the entry type. See [`old` and `modern` mode](#old-and-modern-mode). +* :link: Can safely work with broken symbolic links. + +## Install + +```console +npm install @nodelib/fs.scandir +``` + +## Usage + +```ts +import * as fsScandir from '@nodelib/fs.scandir'; + +fsScandir.scandir('path', (error, stats) => { /* … */ }); +``` + +## API + +### .scandir(path, [optionsOrSettings], callback) + +Returns an array of plain objects ([`Entry`](#entry)) with information about entry for provided path with standard callback-style. + +```ts +fsScandir.scandir('path', (error, entries) => { /* … */ }); +fsScandir.scandir('path', {}, (error, entries) => { /* … */ }); +fsScandir.scandir('path', new fsScandir.Settings(), (error, entries) => { /* … */ }); +``` + +### .scandirSync(path, [optionsOrSettings]) + +Returns an array of plain objects ([`Entry`](#entry)) with information about entry for provided path. + +```ts +const entries = fsScandir.scandirSync('path'); +const entries = fsScandir.scandirSync('path', {}); +const entries = fsScandir.scandirSync(('path', new fsScandir.Settings()); +``` + +#### path + +* Required: `true` +* Type: `string | Buffer | URL` + +A path to a file. If a URL is provided, it must use the `file:` protocol. + +#### optionsOrSettings + +* Required: `false` +* Type: `Options | Settings` +* Default: An instance of `Settings` class + +An [`Options`](#options) object or an instance of [`Settings`](#settingsoptions) class. + +> :book: When you pass a plain object, an instance of the `Settings` class will be created automatically. If you plan to call the method frequently, use a pre-created instance of the `Settings` class. + +### Settings([options]) + +A class of full settings of the package. + +```ts +const settings = new fsScandir.Settings({ followSymbolicLinks: false }); + +const entries = fsScandir.scandirSync('path', settings); +``` + +## Entry + +* `name` — The name of the entry (`unknown.txt`). +* `path` — The path of the entry relative to call directory (`root/unknown.txt`). +* `dirent` — An instance of [`fs.Dirent`](./src/types/index.ts) class. On Node.js below 10.10 will be emulated by [`DirentFromStats`](./src/utils/fs.ts) class. +* `stats` (optional) — An instance of `fs.Stats` class. + +For example, the `scandir` call for `tools` directory with one directory inside: + +```ts +{ + dirent: Dirent { name: 'typedoc', /* … */ }, + name: 'typedoc', + path: 'tools/typedoc' +} +``` + +## Options + +### stats + +* Type: `boolean` +* Default: `false` + +Adds an instance of `fs.Stats` class to the [`Entry`](#entry). + +> :book: Always use `fs.readdir` without the `withFileTypes` option. ??TODO?? + +### followSymbolicLinks + +* Type: `boolean` +* Default: `false` + +Follow symbolic links or not. Call `fs.stat` on symbolic link if `true`. + +### `throwErrorOnBrokenSymbolicLink` + +* Type: `boolean` +* Default: `true` + +Throw an error when symbolic link is broken if `true` or safely use `lstat` call if `false`. + +### `pathSegmentSeparator` + +* Type: `string` +* Default: `path.sep` + +By default, this package uses the correct path separator for your OS (`\` on Windows, `/` on Unix-like systems). But you can set this option to any separator character(s) that you want to use instead. + +### `fs` + +* Type: [`FileSystemAdapter`](./src/adapters/fs.ts) +* Default: A default FS methods + +By default, the built-in Node.js module (`fs`) is used to work with the file system. You can replace any method with your own. + +```ts +interface FileSystemAdapter { + lstat?: typeof fs.lstat; + stat?: typeof fs.stat; + lstatSync?: typeof fs.lstatSync; + statSync?: typeof fs.statSync; + readdir?: typeof fs.readdir; + readdirSync?: typeof fs.readdirSync; +} + +const settings = new fsScandir.Settings({ + fs: { lstat: fakeLstat } +}); +``` + +## `old` and `modern` mode + +This package has two modes that are used depending on the environment and parameters of use. + +### old + +* Node.js below `10.10` or when the `stats` option is enabled + +When working in the old mode, the directory is read first (`fs.readdir`), then the type of entries is determined (`fs.lstat` and/or `fs.stat` for symbolic links). + +### modern + +* Node.js 10.10+ and the `stats` option is disabled + +In the modern mode, reading the directory (`fs.readdir` with the `withFileTypes` option) is combined with obtaining information about its entries. An additional call for symbolic links (`fs.stat`) is still present. + +This mode makes fewer calls to the file system. It's faster. + +## Changelog + +See the [Releases section of our GitHub project](https://github.com/nodelib/nodelib/releases) for changelog for each release version. + +## License + +This software is released under the terms of the MIT license. diff --git a/publisher/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts b/publisher/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts new file mode 100644 index 00000000..827f1db0 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts @@ -0,0 +1,20 @@ +import type * as fsStat from '@nodelib/fs.stat'; +import type { Dirent, ErrnoException } from '../types'; +export interface ReaddirAsynchronousMethod { + (filepath: string, options: { + withFileTypes: true; + }, callback: (error: ErrnoException | null, files: Dirent[]) => void): void; + (filepath: string, callback: (error: ErrnoException | null, files: string[]) => void): void; +} +export interface ReaddirSynchronousMethod { + (filepath: string, options: { + withFileTypes: true; + }): Dirent[]; + (filepath: string): string[]; +} +export declare type FileSystemAdapter = fsStat.FileSystemAdapter & { + readdir: ReaddirAsynchronousMethod; + readdirSync: ReaddirSynchronousMethod; +}; +export declare const FILE_SYSTEM_ADAPTER: FileSystemAdapter; +export declare function createFileSystemAdapter(fsMethods?: Partial): FileSystemAdapter; diff --git a/publisher/node_modules/@nodelib/fs.scandir/out/adapters/fs.js b/publisher/node_modules/@nodelib/fs.scandir/out/adapters/fs.js new file mode 100644 index 00000000..f0fe0220 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.scandir/out/adapters/fs.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; +const fs = require("fs"); +exports.FILE_SYSTEM_ADAPTER = { + lstat: fs.lstat, + stat: fs.stat, + lstatSync: fs.lstatSync, + statSync: fs.statSync, + readdir: fs.readdir, + readdirSync: fs.readdirSync +}; +function createFileSystemAdapter(fsMethods) { + if (fsMethods === undefined) { + return exports.FILE_SYSTEM_ADAPTER; + } + return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); +} +exports.createFileSystemAdapter = createFileSystemAdapter; diff --git a/publisher/node_modules/@nodelib/fs.scandir/out/constants.d.ts b/publisher/node_modules/@nodelib/fs.scandir/out/constants.d.ts new file mode 100644 index 00000000..33f17497 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.scandir/out/constants.d.ts @@ -0,0 +1,4 @@ +/** + * IS `true` for Node.js 10.10 and greater. + */ +export declare const IS_SUPPORT_READDIR_WITH_FILE_TYPES: boolean; diff --git a/publisher/node_modules/@nodelib/fs.scandir/out/constants.js b/publisher/node_modules/@nodelib/fs.scandir/out/constants.js new file mode 100644 index 00000000..7e3d4411 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.scandir/out/constants.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0; +const NODE_PROCESS_VERSION_PARTS = process.versions.node.split('.'); +if (NODE_PROCESS_VERSION_PARTS[0] === undefined || NODE_PROCESS_VERSION_PARTS[1] === undefined) { + throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`); +} +const MAJOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[0], 10); +const MINOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[1], 10); +const SUPPORTED_MAJOR_VERSION = 10; +const SUPPORTED_MINOR_VERSION = 10; +const IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION; +const IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION; +/** + * IS `true` for Node.js 10.10 and greater. + */ +exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR; diff --git a/publisher/node_modules/@nodelib/fs.scandir/out/index.d.ts b/publisher/node_modules/@nodelib/fs.scandir/out/index.d.ts new file mode 100644 index 00000000..b9da83ed --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.scandir/out/index.d.ts @@ -0,0 +1,12 @@ +import type { FileSystemAdapter, ReaddirAsynchronousMethod, ReaddirSynchronousMethod } from './adapters/fs'; +import * as async from './providers/async'; +import Settings, { Options } from './settings'; +import type { Dirent, Entry } from './types'; +declare type AsyncCallback = async.AsyncCallback; +declare function scandir(path: string, callback: AsyncCallback): void; +declare function scandir(path: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void; +declare namespace scandir { + function __promisify__(path: string, optionsOrSettings?: Options | Settings): Promise; +} +declare function scandirSync(path: string, optionsOrSettings?: Options | Settings): Entry[]; +export { scandir, scandirSync, Settings, AsyncCallback, Dirent, Entry, FileSystemAdapter, ReaddirAsynchronousMethod, ReaddirSynchronousMethod, Options }; diff --git a/publisher/node_modules/@nodelib/fs.scandir/out/index.js b/publisher/node_modules/@nodelib/fs.scandir/out/index.js new file mode 100644 index 00000000..99c70d3d --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.scandir/out/index.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Settings = exports.scandirSync = exports.scandir = void 0; +const async = require("./providers/async"); +const sync = require("./providers/sync"); +const settings_1 = require("./settings"); +exports.Settings = settings_1.default; +function scandir(path, optionsOrSettingsOrCallback, callback) { + if (typeof optionsOrSettingsOrCallback === 'function') { + async.read(path, getSettings(), optionsOrSettingsOrCallback); + return; + } + async.read(path, getSettings(optionsOrSettingsOrCallback), callback); +} +exports.scandir = scandir; +function scandirSync(path, optionsOrSettings) { + const settings = getSettings(optionsOrSettings); + return sync.read(path, settings); +} +exports.scandirSync = scandirSync; +function getSettings(settingsOrOptions = {}) { + if (settingsOrOptions instanceof settings_1.default) { + return settingsOrOptions; + } + return new settings_1.default(settingsOrOptions); +} diff --git a/publisher/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts b/publisher/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts new file mode 100644 index 00000000..5829676d --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts @@ -0,0 +1,7 @@ +/// +import type Settings from '../settings'; +import type { Entry } from '../types'; +export declare type AsyncCallback = (error: NodeJS.ErrnoException, entries: Entry[]) => void; +export declare function read(directory: string, settings: Settings, callback: AsyncCallback): void; +export declare function readdirWithFileTypes(directory: string, settings: Settings, callback: AsyncCallback): void; +export declare function readdir(directory: string, settings: Settings, callback: AsyncCallback): void; diff --git a/publisher/node_modules/@nodelib/fs.scandir/out/providers/async.js b/publisher/node_modules/@nodelib/fs.scandir/out/providers/async.js new file mode 100644 index 00000000..e8e2f0a9 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.scandir/out/providers/async.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; +const fsStat = require("@nodelib/fs.stat"); +const rpl = require("run-parallel"); +const constants_1 = require("../constants"); +const utils = require("../utils"); +const common = require("./common"); +function read(directory, settings, callback) { + if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { + readdirWithFileTypes(directory, settings, callback); + return; + } + readdir(directory, settings, callback); +} +exports.read = read; +function readdirWithFileTypes(directory, settings, callback) { + settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => { + if (readdirError !== null) { + callFailureCallback(callback, readdirError); + return; + } + const entries = dirents.map((dirent) => ({ + dirent, + name: dirent.name, + path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator) + })); + if (!settings.followSymbolicLinks) { + callSuccessCallback(callback, entries); + return; + } + const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings)); + rpl(tasks, (rplError, rplEntries) => { + if (rplError !== null) { + callFailureCallback(callback, rplError); + return; + } + callSuccessCallback(callback, rplEntries); + }); + }); +} +exports.readdirWithFileTypes = readdirWithFileTypes; +function makeRplTaskEntry(entry, settings) { + return (done) => { + if (!entry.dirent.isSymbolicLink()) { + done(null, entry); + return; + } + settings.fs.stat(entry.path, (statError, stats) => { + if (statError !== null) { + if (settings.throwErrorOnBrokenSymbolicLink) { + done(statError); + return; + } + done(null, entry); + return; + } + entry.dirent = utils.fs.createDirentFromStats(entry.name, stats); + done(null, entry); + }); + }; +} +function readdir(directory, settings, callback) { + settings.fs.readdir(directory, (readdirError, names) => { + if (readdirError !== null) { + callFailureCallback(callback, readdirError); + return; + } + const tasks = names.map((name) => { + const path = common.joinPathSegments(directory, name, settings.pathSegmentSeparator); + return (done) => { + fsStat.stat(path, settings.fsStatSettings, (error, stats) => { + if (error !== null) { + done(error); + return; + } + const entry = { + name, + path, + dirent: utils.fs.createDirentFromStats(name, stats) + }; + if (settings.stats) { + entry.stats = stats; + } + done(null, entry); + }); + }; + }); + rpl(tasks, (rplError, entries) => { + if (rplError !== null) { + callFailureCallback(callback, rplError); + return; + } + callSuccessCallback(callback, entries); + }); + }); +} +exports.readdir = readdir; +function callFailureCallback(callback, error) { + callback(error); +} +function callSuccessCallback(callback, result) { + callback(null, result); +} diff --git a/publisher/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts b/publisher/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts new file mode 100644 index 00000000..2b4d08b5 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts @@ -0,0 +1 @@ +export declare function joinPathSegments(a: string, b: string, separator: string): string; diff --git a/publisher/node_modules/@nodelib/fs.scandir/out/providers/common.js b/publisher/node_modules/@nodelib/fs.scandir/out/providers/common.js new file mode 100644 index 00000000..8724cb59 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.scandir/out/providers/common.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.joinPathSegments = void 0; +function joinPathSegments(a, b, separator) { + /** + * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`). + */ + if (a.endsWith(separator)) { + return a + b; + } + return a + separator + b; +} +exports.joinPathSegments = joinPathSegments; diff --git a/publisher/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts b/publisher/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts new file mode 100644 index 00000000..e05c8f07 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts @@ -0,0 +1,5 @@ +import type Settings from '../settings'; +import type { Entry } from '../types'; +export declare function read(directory: string, settings: Settings): Entry[]; +export declare function readdirWithFileTypes(directory: string, settings: Settings): Entry[]; +export declare function readdir(directory: string, settings: Settings): Entry[]; diff --git a/publisher/node_modules/@nodelib/fs.scandir/out/providers/sync.js b/publisher/node_modules/@nodelib/fs.scandir/out/providers/sync.js new file mode 100644 index 00000000..146db343 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.scandir/out/providers/sync.js @@ -0,0 +1,54 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; +const fsStat = require("@nodelib/fs.stat"); +const constants_1 = require("../constants"); +const utils = require("../utils"); +const common = require("./common"); +function read(directory, settings) { + if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { + return readdirWithFileTypes(directory, settings); + } + return readdir(directory, settings); +} +exports.read = read; +function readdirWithFileTypes(directory, settings) { + const dirents = settings.fs.readdirSync(directory, { withFileTypes: true }); + return dirents.map((dirent) => { + const entry = { + dirent, + name: dirent.name, + path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator) + }; + if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) { + try { + const stats = settings.fs.statSync(entry.path); + entry.dirent = utils.fs.createDirentFromStats(entry.name, stats); + } + catch (error) { + if (settings.throwErrorOnBrokenSymbolicLink) { + throw error; + } + } + } + return entry; + }); +} +exports.readdirWithFileTypes = readdirWithFileTypes; +function readdir(directory, settings) { + const names = settings.fs.readdirSync(directory); + return names.map((name) => { + const entryPath = common.joinPathSegments(directory, name, settings.pathSegmentSeparator); + const stats = fsStat.statSync(entryPath, settings.fsStatSettings); + const entry = { + name, + path: entryPath, + dirent: utils.fs.createDirentFromStats(name, stats) + }; + if (settings.stats) { + entry.stats = stats; + } + return entry; + }); +} +exports.readdir = readdir; diff --git a/publisher/node_modules/@nodelib/fs.scandir/out/settings.d.ts b/publisher/node_modules/@nodelib/fs.scandir/out/settings.d.ts new file mode 100644 index 00000000..a0db1155 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.scandir/out/settings.d.ts @@ -0,0 +1,20 @@ +import * as fsStat from '@nodelib/fs.stat'; +import * as fs from './adapters/fs'; +export interface Options { + followSymbolicLinks?: boolean; + fs?: Partial; + pathSegmentSeparator?: string; + stats?: boolean; + throwErrorOnBrokenSymbolicLink?: boolean; +} +export default class Settings { + private readonly _options; + readonly followSymbolicLinks: boolean; + readonly fs: fs.FileSystemAdapter; + readonly pathSegmentSeparator: string; + readonly stats: boolean; + readonly throwErrorOnBrokenSymbolicLink: boolean; + readonly fsStatSettings: fsStat.Settings; + constructor(_options?: Options); + private _getValue; +} diff --git a/publisher/node_modules/@nodelib/fs.scandir/out/settings.js b/publisher/node_modules/@nodelib/fs.scandir/out/settings.js new file mode 100644 index 00000000..15a3e8cd --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.scandir/out/settings.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const path = require("path"); +const fsStat = require("@nodelib/fs.stat"); +const fs = require("./adapters/fs"); +class Settings { + constructor(_options = {}) { + this._options = _options; + this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false); + this.fs = fs.createFileSystemAdapter(this._options.fs); + this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep); + this.stats = this._getValue(this._options.stats, false); + this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); + this.fsStatSettings = new fsStat.Settings({ + followSymbolicLink: this.followSymbolicLinks, + fs: this.fs, + throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink + }); + } + _getValue(option, value) { + return option !== null && option !== void 0 ? option : value; + } +} +exports.default = Settings; diff --git a/publisher/node_modules/@nodelib/fs.scandir/out/types/index.d.ts b/publisher/node_modules/@nodelib/fs.scandir/out/types/index.d.ts new file mode 100644 index 00000000..f326c5e5 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.scandir/out/types/index.d.ts @@ -0,0 +1,20 @@ +/// +import type * as fs from 'fs'; +export interface Entry { + dirent: Dirent; + name: string; + path: string; + stats?: Stats; +} +export declare type Stats = fs.Stats; +export declare type ErrnoException = NodeJS.ErrnoException; +export interface Dirent { + isBlockDevice: () => boolean; + isCharacterDevice: () => boolean; + isDirectory: () => boolean; + isFIFO: () => boolean; + isFile: () => boolean; + isSocket: () => boolean; + isSymbolicLink: () => boolean; + name: string; +} diff --git a/publisher/node_modules/@nodelib/fs.scandir/out/types/index.js b/publisher/node_modules/@nodelib/fs.scandir/out/types/index.js new file mode 100644 index 00000000..c8ad2e54 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.scandir/out/types/index.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/publisher/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts b/publisher/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts new file mode 100644 index 00000000..bb863f15 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts @@ -0,0 +1,2 @@ +import type { Dirent, Stats } from '../types'; +export declare function createDirentFromStats(name: string, stats: Stats): Dirent; diff --git a/publisher/node_modules/@nodelib/fs.scandir/out/utils/fs.js b/publisher/node_modules/@nodelib/fs.scandir/out/utils/fs.js new file mode 100644 index 00000000..ace7c74d --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.scandir/out/utils/fs.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createDirentFromStats = void 0; +class DirentFromStats { + constructor(name, stats) { + this.name = name; + this.isBlockDevice = stats.isBlockDevice.bind(stats); + this.isCharacterDevice = stats.isCharacterDevice.bind(stats); + this.isDirectory = stats.isDirectory.bind(stats); + this.isFIFO = stats.isFIFO.bind(stats); + this.isFile = stats.isFile.bind(stats); + this.isSocket = stats.isSocket.bind(stats); + this.isSymbolicLink = stats.isSymbolicLink.bind(stats); + } +} +function createDirentFromStats(name, stats) { + return new DirentFromStats(name, stats); +} +exports.createDirentFromStats = createDirentFromStats; diff --git a/publisher/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts b/publisher/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts new file mode 100644 index 00000000..1b41954e --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts @@ -0,0 +1,2 @@ +import * as fs from './fs'; +export { fs }; diff --git a/publisher/node_modules/@nodelib/fs.scandir/out/utils/index.js b/publisher/node_modules/@nodelib/fs.scandir/out/utils/index.js new file mode 100644 index 00000000..f5de129f --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.scandir/out/utils/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fs = void 0; +const fs = require("./fs"); +exports.fs = fs; diff --git a/publisher/node_modules/@nodelib/fs.scandir/package.json b/publisher/node_modules/@nodelib/fs.scandir/package.json new file mode 100644 index 00000000..d3a89241 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.scandir/package.json @@ -0,0 +1,44 @@ +{ + "name": "@nodelib/fs.scandir", + "version": "2.1.5", + "description": "List files and directories inside the specified directory", + "license": "MIT", + "repository": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.scandir", + "keywords": [ + "NodeLib", + "fs", + "FileSystem", + "file system", + "scandir", + "readdir", + "dirent" + ], + "engines": { + "node": ">= 8" + }, + "files": [ + "out/**", + "!out/**/*.map", + "!out/**/*.spec.*" + ], + "main": "out/index.js", + "typings": "out/index.d.ts", + "scripts": { + "clean": "rimraf {tsconfig.tsbuildinfo,out}", + "lint": "eslint \"src/**/*.ts\" --cache", + "compile": "tsc -b .", + "compile:watch": "tsc -p . --watch --sourceMap", + "test": "mocha \"out/**/*.spec.js\" -s 0", + "build": "npm run clean && npm run compile && npm run lint && npm test", + "watch": "npm run clean && npm run compile:watch" + }, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "devDependencies": { + "@nodelib/fs.macchiato": "1.0.4", + "@types/run-parallel": "^1.1.0" + }, + "gitHead": "d6a7960d5281d3dd5f8e2efba49bb552d090f562" +} diff --git a/publisher/node_modules/@nodelib/fs.stat/LICENSE b/publisher/node_modules/@nodelib/fs.stat/LICENSE new file mode 100644 index 00000000..65a99946 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.stat/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Denis Malinochkin + +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. diff --git a/publisher/node_modules/@nodelib/fs.stat/README.md b/publisher/node_modules/@nodelib/fs.stat/README.md new file mode 100644 index 00000000..686f0471 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.stat/README.md @@ -0,0 +1,126 @@ +# @nodelib/fs.stat + +> Get the status of a file with some features. + +## :bulb: Highlights + +Wrapper around standard method `fs.lstat` and `fs.stat` with some features. + +* :beginner: Normally follows symbolic link. +* :gear: Can safely work with broken symbolic link. + +## Install + +```console +npm install @nodelib/fs.stat +``` + +## Usage + +```ts +import * as fsStat from '@nodelib/fs.stat'; + +fsStat.stat('path', (error, stats) => { /* … */ }); +``` + +## API + +### .stat(path, [optionsOrSettings], callback) + +Returns an instance of `fs.Stats` class for provided path with standard callback-style. + +```ts +fsStat.stat('path', (error, stats) => { /* … */ }); +fsStat.stat('path', {}, (error, stats) => { /* … */ }); +fsStat.stat('path', new fsStat.Settings(), (error, stats) => { /* … */ }); +``` + +### .statSync(path, [optionsOrSettings]) + +Returns an instance of `fs.Stats` class for provided path. + +```ts +const stats = fsStat.stat('path'); +const stats = fsStat.stat('path', {}); +const stats = fsStat.stat('path', new fsStat.Settings()); +``` + +#### path + +* Required: `true` +* Type: `string | Buffer | URL` + +A path to a file. If a URL is provided, it must use the `file:` protocol. + +#### optionsOrSettings + +* Required: `false` +* Type: `Options | Settings` +* Default: An instance of `Settings` class + +An [`Options`](#options) object or an instance of [`Settings`](#settings) class. + +> :book: When you pass a plain object, an instance of the `Settings` class will be created automatically. If you plan to call the method frequently, use a pre-created instance of the `Settings` class. + +### Settings([options]) + +A class of full settings of the package. + +```ts +const settings = new fsStat.Settings({ followSymbolicLink: false }); + +const stats = fsStat.stat('path', settings); +``` + +## Options + +### `followSymbolicLink` + +* Type: `boolean` +* Default: `true` + +Follow symbolic link or not. Call `fs.stat` on symbolic link if `true`. + +### `markSymbolicLink` + +* Type: `boolean` +* Default: `false` + +Mark symbolic link by setting the return value of `isSymbolicLink` function to always `true` (even after `fs.stat`). + +> :book: Can be used if you want to know what is hidden behind a symbolic link, but still continue to know that it is a symbolic link. + +### `throwErrorOnBrokenSymbolicLink` + +* Type: `boolean` +* Default: `true` + +Throw an error when symbolic link is broken if `true` or safely return `lstat` call if `false`. + +### `fs` + +* Type: [`FileSystemAdapter`](./src/adapters/fs.ts) +* Default: A default FS methods + +By default, the built-in Node.js module (`fs`) is used to work with the file system. You can replace any method with your own. + +```ts +interface FileSystemAdapter { + lstat?: typeof fs.lstat; + stat?: typeof fs.stat; + lstatSync?: typeof fs.lstatSync; + statSync?: typeof fs.statSync; +} + +const settings = new fsStat.Settings({ + fs: { lstat: fakeLstat } +}); +``` + +## Changelog + +See the [Releases section of our GitHub project](https://github.com/nodelib/nodelib/releases) for changelog for each release version. + +## License + +This software is released under the terms of the MIT license. diff --git a/publisher/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts b/publisher/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts new file mode 100644 index 00000000..3af759c9 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts @@ -0,0 +1,13 @@ +/// +import * as fs from 'fs'; +import type { ErrnoException } from '../types'; +export declare type StatAsynchronousMethod = (path: string, callback: (error: ErrnoException | null, stats: fs.Stats) => void) => void; +export declare type StatSynchronousMethod = (path: string) => fs.Stats; +export interface FileSystemAdapter { + lstat: StatAsynchronousMethod; + stat: StatAsynchronousMethod; + lstatSync: StatSynchronousMethod; + statSync: StatSynchronousMethod; +} +export declare const FILE_SYSTEM_ADAPTER: FileSystemAdapter; +export declare function createFileSystemAdapter(fsMethods?: Partial): FileSystemAdapter; diff --git a/publisher/node_modules/@nodelib/fs.stat/out/adapters/fs.js b/publisher/node_modules/@nodelib/fs.stat/out/adapters/fs.js new file mode 100644 index 00000000..8dc08c8c --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.stat/out/adapters/fs.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; +const fs = require("fs"); +exports.FILE_SYSTEM_ADAPTER = { + lstat: fs.lstat, + stat: fs.stat, + lstatSync: fs.lstatSync, + statSync: fs.statSync +}; +function createFileSystemAdapter(fsMethods) { + if (fsMethods === undefined) { + return exports.FILE_SYSTEM_ADAPTER; + } + return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); +} +exports.createFileSystemAdapter = createFileSystemAdapter; diff --git a/publisher/node_modules/@nodelib/fs.stat/out/index.d.ts b/publisher/node_modules/@nodelib/fs.stat/out/index.d.ts new file mode 100644 index 00000000..f95db995 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.stat/out/index.d.ts @@ -0,0 +1,12 @@ +import type { FileSystemAdapter, StatAsynchronousMethod, StatSynchronousMethod } from './adapters/fs'; +import * as async from './providers/async'; +import Settings, { Options } from './settings'; +import type { Stats } from './types'; +declare type AsyncCallback = async.AsyncCallback; +declare function stat(path: string, callback: AsyncCallback): void; +declare function stat(path: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void; +declare namespace stat { + function __promisify__(path: string, optionsOrSettings?: Options | Settings): Promise; +} +declare function statSync(path: string, optionsOrSettings?: Options | Settings): Stats; +export { Settings, stat, statSync, AsyncCallback, FileSystemAdapter, StatAsynchronousMethod, StatSynchronousMethod, Options, Stats }; diff --git a/publisher/node_modules/@nodelib/fs.stat/out/index.js b/publisher/node_modules/@nodelib/fs.stat/out/index.js new file mode 100644 index 00000000..b23f7510 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.stat/out/index.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.statSync = exports.stat = exports.Settings = void 0; +const async = require("./providers/async"); +const sync = require("./providers/sync"); +const settings_1 = require("./settings"); +exports.Settings = settings_1.default; +function stat(path, optionsOrSettingsOrCallback, callback) { + if (typeof optionsOrSettingsOrCallback === 'function') { + async.read(path, getSettings(), optionsOrSettingsOrCallback); + return; + } + async.read(path, getSettings(optionsOrSettingsOrCallback), callback); +} +exports.stat = stat; +function statSync(path, optionsOrSettings) { + const settings = getSettings(optionsOrSettings); + return sync.read(path, settings); +} +exports.statSync = statSync; +function getSettings(settingsOrOptions = {}) { + if (settingsOrOptions instanceof settings_1.default) { + return settingsOrOptions; + } + return new settings_1.default(settingsOrOptions); +} diff --git a/publisher/node_modules/@nodelib/fs.stat/out/providers/async.d.ts b/publisher/node_modules/@nodelib/fs.stat/out/providers/async.d.ts new file mode 100644 index 00000000..85423ce1 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.stat/out/providers/async.d.ts @@ -0,0 +1,4 @@ +import type Settings from '../settings'; +import type { ErrnoException, Stats } from '../types'; +export declare type AsyncCallback = (error: ErrnoException, stats: Stats) => void; +export declare function read(path: string, settings: Settings, callback: AsyncCallback): void; diff --git a/publisher/node_modules/@nodelib/fs.stat/out/providers/async.js b/publisher/node_modules/@nodelib/fs.stat/out/providers/async.js new file mode 100644 index 00000000..983ff0e6 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.stat/out/providers/async.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.read = void 0; +function read(path, settings, callback) { + settings.fs.lstat(path, (lstatError, lstat) => { + if (lstatError !== null) { + callFailureCallback(callback, lstatError); + return; + } + if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) { + callSuccessCallback(callback, lstat); + return; + } + settings.fs.stat(path, (statError, stat) => { + if (statError !== null) { + if (settings.throwErrorOnBrokenSymbolicLink) { + callFailureCallback(callback, statError); + return; + } + callSuccessCallback(callback, lstat); + return; + } + if (settings.markSymbolicLink) { + stat.isSymbolicLink = () => true; + } + callSuccessCallback(callback, stat); + }); + }); +} +exports.read = read; +function callFailureCallback(callback, error) { + callback(error); +} +function callSuccessCallback(callback, result) { + callback(null, result); +} diff --git a/publisher/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts b/publisher/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts new file mode 100644 index 00000000..428c3d79 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts @@ -0,0 +1,3 @@ +import type Settings from '../settings'; +import type { Stats } from '../types'; +export declare function read(path: string, settings: Settings): Stats; diff --git a/publisher/node_modules/@nodelib/fs.stat/out/providers/sync.js b/publisher/node_modules/@nodelib/fs.stat/out/providers/sync.js new file mode 100644 index 00000000..1521c361 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.stat/out/providers/sync.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.read = void 0; +function read(path, settings) { + const lstat = settings.fs.lstatSync(path); + if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) { + return lstat; + } + try { + const stat = settings.fs.statSync(path); + if (settings.markSymbolicLink) { + stat.isSymbolicLink = () => true; + } + return stat; + } + catch (error) { + if (!settings.throwErrorOnBrokenSymbolicLink) { + return lstat; + } + throw error; + } +} +exports.read = read; diff --git a/publisher/node_modules/@nodelib/fs.stat/out/settings.d.ts b/publisher/node_modules/@nodelib/fs.stat/out/settings.d.ts new file mode 100644 index 00000000..f4b3d444 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.stat/out/settings.d.ts @@ -0,0 +1,16 @@ +import * as fs from './adapters/fs'; +export interface Options { + followSymbolicLink?: boolean; + fs?: Partial; + markSymbolicLink?: boolean; + throwErrorOnBrokenSymbolicLink?: boolean; +} +export default class Settings { + private readonly _options; + readonly followSymbolicLink: boolean; + readonly fs: fs.FileSystemAdapter; + readonly markSymbolicLink: boolean; + readonly throwErrorOnBrokenSymbolicLink: boolean; + constructor(_options?: Options); + private _getValue; +} diff --git a/publisher/node_modules/@nodelib/fs.stat/out/settings.js b/publisher/node_modules/@nodelib/fs.stat/out/settings.js new file mode 100644 index 00000000..111ec09c --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.stat/out/settings.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const fs = require("./adapters/fs"); +class Settings { + constructor(_options = {}) { + this._options = _options; + this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true); + this.fs = fs.createFileSystemAdapter(this._options.fs); + this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false); + this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); + } + _getValue(option, value) { + return option !== null && option !== void 0 ? option : value; + } +} +exports.default = Settings; diff --git a/publisher/node_modules/@nodelib/fs.stat/out/types/index.d.ts b/publisher/node_modules/@nodelib/fs.stat/out/types/index.d.ts new file mode 100644 index 00000000..74c08ed2 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.stat/out/types/index.d.ts @@ -0,0 +1,4 @@ +/// +import type * as fs from 'fs'; +export declare type Stats = fs.Stats; +export declare type ErrnoException = NodeJS.ErrnoException; diff --git a/publisher/node_modules/@nodelib/fs.stat/out/types/index.js b/publisher/node_modules/@nodelib/fs.stat/out/types/index.js new file mode 100644 index 00000000..c8ad2e54 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.stat/out/types/index.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/publisher/node_modules/@nodelib/fs.stat/package.json b/publisher/node_modules/@nodelib/fs.stat/package.json new file mode 100644 index 00000000..f2540c28 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.stat/package.json @@ -0,0 +1,37 @@ +{ + "name": "@nodelib/fs.stat", + "version": "2.0.5", + "description": "Get the status of a file with some features", + "license": "MIT", + "repository": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.stat", + "keywords": [ + "NodeLib", + "fs", + "FileSystem", + "file system", + "stat" + ], + "engines": { + "node": ">= 8" + }, + "files": [ + "out/**", + "!out/**/*.map", + "!out/**/*.spec.*" + ], + "main": "out/index.js", + "typings": "out/index.d.ts", + "scripts": { + "clean": "rimraf {tsconfig.tsbuildinfo,out}", + "lint": "eslint \"src/**/*.ts\" --cache", + "compile": "tsc -b .", + "compile:watch": "tsc -p . --watch --sourceMap", + "test": "mocha \"out/**/*.spec.js\" -s 0", + "build": "npm run clean && npm run compile && npm run lint && npm test", + "watch": "npm run clean && npm run compile:watch" + }, + "devDependencies": { + "@nodelib/fs.macchiato": "1.0.4" + }, + "gitHead": "d6a7960d5281d3dd5f8e2efba49bb552d090f562" +} diff --git a/publisher/node_modules/@nodelib/fs.walk/LICENSE b/publisher/node_modules/@nodelib/fs.walk/LICENSE new file mode 100644 index 00000000..65a99946 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.walk/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Denis Malinochkin + +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. diff --git a/publisher/node_modules/@nodelib/fs.walk/README.md b/publisher/node_modules/@nodelib/fs.walk/README.md new file mode 100644 index 00000000..6ccc08db --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.walk/README.md @@ -0,0 +1,215 @@ +# @nodelib/fs.walk + +> A library for efficiently walking a directory recursively. + +## :bulb: Highlights + +* :moneybag: Returns useful information: `name`, `path`, `dirent` and `stats` (optional). +* :rocket: On Node.js 10.10+ uses the mechanism without additional calls to determine the entry type for performance reasons. See [`old` and `modern` mode](https://github.com/nodelib/nodelib/blob/master/packages/fs/fs.scandir/README.md#old-and-modern-mode). +* :gear: Built-in directories/files and error filtering system. +* :link: Can safely work with broken symbolic links. + +## Install + +```console +npm install @nodelib/fs.walk +``` + +## Usage + +```ts +import * as fsWalk from '@nodelib/fs.walk'; + +fsWalk.walk('path', (error, entries) => { /* … */ }); +``` + +## API + +### .walk(path, [optionsOrSettings], callback) + +Reads the directory recursively and asynchronously. Requires a callback function. + +> :book: If you want to use the Promise API, use `util.promisify`. + +```ts +fsWalk.walk('path', (error, entries) => { /* … */ }); +fsWalk.walk('path', {}, (error, entries) => { /* … */ }); +fsWalk.walk('path', new fsWalk.Settings(), (error, entries) => { /* … */ }); +``` + +### .walkStream(path, [optionsOrSettings]) + +Reads the directory recursively and asynchronously. [Readable Stream](https://nodejs.org/dist/latest-v12.x/docs/api/stream.html#stream_readable_streams) is used as a provider. + +```ts +const stream = fsWalk.walkStream('path'); +const stream = fsWalk.walkStream('path', {}); +const stream = fsWalk.walkStream('path', new fsWalk.Settings()); +``` + +### .walkSync(path, [optionsOrSettings]) + +Reads the directory recursively and synchronously. Returns an array of entries. + +```ts +const entries = fsWalk.walkSync('path'); +const entries = fsWalk.walkSync('path', {}); +const entries = fsWalk.walkSync('path', new fsWalk.Settings()); +``` + +#### path + +* Required: `true` +* Type: `string | Buffer | URL` + +A path to a file. If a URL is provided, it must use the `file:` protocol. + +#### optionsOrSettings + +* Required: `false` +* Type: `Options | Settings` +* Default: An instance of `Settings` class + +An [`Options`](#options) object or an instance of [`Settings`](#settings) class. + +> :book: When you pass a plain object, an instance of the `Settings` class will be created automatically. If you plan to call the method frequently, use a pre-created instance of the `Settings` class. + +### Settings([options]) + +A class of full settings of the package. + +```ts +const settings = new fsWalk.Settings({ followSymbolicLinks: true }); + +const entries = fsWalk.walkSync('path', settings); +``` + +## Entry + +* `name` — The name of the entry (`unknown.txt`). +* `path` — The path of the entry relative to call directory (`root/unknown.txt`). +* `dirent` — An instance of [`fs.Dirent`](./src/types/index.ts) class. +* [`stats`] — An instance of `fs.Stats` class. + +## Options + +### basePath + +* Type: `string` +* Default: `undefined` + +By default, all paths are built relative to the root path. You can use this option to set custom root path. + +In the example below we read the files from the `root` directory, but in the results the root path will be `custom`. + +```ts +fsWalk.walkSync('root'); // → ['root/file.txt'] +fsWalk.walkSync('root', { basePath: 'custom' }); // → ['custom/file.txt'] +``` + +### concurrency + +* Type: `number` +* Default: `Infinity` + +The maximum number of concurrent calls to `fs.readdir`. + +> :book: The higher the number, the higher performance and the load on the File System. If you want to read in quiet mode, set the value to `4 * os.cpus().length` (4 is default size of [thread pool work scheduling](http://docs.libuv.org/en/v1.x/threadpool.html#thread-pool-work-scheduling)). + +### deepFilter + +* Type: [`DeepFilterFunction`](./src/settings.ts) +* Default: `undefined` + +A function that indicates whether the directory will be read deep or not. + +```ts +// Skip all directories that starts with `node_modules` +const filter: DeepFilterFunction = (entry) => !entry.path.startsWith('node_modules'); +``` + +### entryFilter + +* Type: [`EntryFilterFunction`](./src/settings.ts) +* Default: `undefined` + +A function that indicates whether the entry will be included to results or not. + +```ts +// Exclude all `.js` files from results +const filter: EntryFilterFunction = (entry) => !entry.name.endsWith('.js'); +``` + +### errorFilter + +* Type: [`ErrorFilterFunction`](./src/settings.ts) +* Default: `undefined` + +A function that allows you to skip errors that occur when reading directories. + +For example, you can skip `ENOENT` errors if required: + +```ts +// Skip all ENOENT errors +const filter: ErrorFilterFunction = (error) => error.code == 'ENOENT'; +``` + +### stats + +* Type: `boolean` +* Default: `false` + +Adds an instance of `fs.Stats` class to the [`Entry`](#entry). + +> :book: Always use `fs.readdir` with additional `fs.lstat/fs.stat` calls to determine the entry type. + +### followSymbolicLinks + +* Type: `boolean` +* Default: `false` + +Follow symbolic links or not. Call `fs.stat` on symbolic link if `true`. + +### `throwErrorOnBrokenSymbolicLink` + +* Type: `boolean` +* Default: `true` + +Throw an error when symbolic link is broken if `true` or safely return `lstat` call if `false`. + +### `pathSegmentSeparator` + +* Type: `string` +* Default: `path.sep` + +By default, this package uses the correct path separator for your OS (`\` on Windows, `/` on Unix-like systems). But you can set this option to any separator character(s) that you want to use instead. + +### `fs` + +* Type: `FileSystemAdapter` +* Default: A default FS methods + +By default, the built-in Node.js module (`fs`) is used to work with the file system. You can replace any method with your own. + +```ts +interface FileSystemAdapter { + lstat: typeof fs.lstat; + stat: typeof fs.stat; + lstatSync: typeof fs.lstatSync; + statSync: typeof fs.statSync; + readdir: typeof fs.readdir; + readdirSync: typeof fs.readdirSync; +} + +const settings = new fsWalk.Settings({ + fs: { lstat: fakeLstat } +}); +``` + +## Changelog + +See the [Releases section of our GitHub project](https://github.com/nodelib/nodelib/releases) for changelog for each release version. + +## License + +This software is released under the terms of the MIT license. diff --git a/publisher/node_modules/@nodelib/fs.walk/out/index.d.ts b/publisher/node_modules/@nodelib/fs.walk/out/index.d.ts new file mode 100644 index 00000000..8864c7bf --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.walk/out/index.d.ts @@ -0,0 +1,14 @@ +/// +import type { Readable } from 'stream'; +import type { Dirent, FileSystemAdapter } from '@nodelib/fs.scandir'; +import { AsyncCallback } from './providers/async'; +import Settings, { DeepFilterFunction, EntryFilterFunction, ErrorFilterFunction, Options } from './settings'; +import type { Entry } from './types'; +declare function walk(directory: string, callback: AsyncCallback): void; +declare function walk(directory: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void; +declare namespace walk { + function __promisify__(directory: string, optionsOrSettings?: Options | Settings): Promise; +} +declare function walkSync(directory: string, optionsOrSettings?: Options | Settings): Entry[]; +declare function walkStream(directory: string, optionsOrSettings?: Options | Settings): Readable; +export { walk, walkSync, walkStream, Settings, AsyncCallback, Dirent, Entry, FileSystemAdapter, Options, DeepFilterFunction, EntryFilterFunction, ErrorFilterFunction }; diff --git a/publisher/node_modules/@nodelib/fs.walk/out/index.js b/publisher/node_modules/@nodelib/fs.walk/out/index.js new file mode 100644 index 00000000..15207874 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.walk/out/index.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Settings = exports.walkStream = exports.walkSync = exports.walk = void 0; +const async_1 = require("./providers/async"); +const stream_1 = require("./providers/stream"); +const sync_1 = require("./providers/sync"); +const settings_1 = require("./settings"); +exports.Settings = settings_1.default; +function walk(directory, optionsOrSettingsOrCallback, callback) { + if (typeof optionsOrSettingsOrCallback === 'function') { + new async_1.default(directory, getSettings()).read(optionsOrSettingsOrCallback); + return; + } + new async_1.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback); +} +exports.walk = walk; +function walkSync(directory, optionsOrSettings) { + const settings = getSettings(optionsOrSettings); + const provider = new sync_1.default(directory, settings); + return provider.read(); +} +exports.walkSync = walkSync; +function walkStream(directory, optionsOrSettings) { + const settings = getSettings(optionsOrSettings); + const provider = new stream_1.default(directory, settings); + return provider.read(); +} +exports.walkStream = walkStream; +function getSettings(settingsOrOptions = {}) { + if (settingsOrOptions instanceof settings_1.default) { + return settingsOrOptions; + } + return new settings_1.default(settingsOrOptions); +} diff --git a/publisher/node_modules/@nodelib/fs.walk/out/providers/async.d.ts b/publisher/node_modules/@nodelib/fs.walk/out/providers/async.d.ts new file mode 100644 index 00000000..0f6717d7 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.walk/out/providers/async.d.ts @@ -0,0 +1,12 @@ +import AsyncReader from '../readers/async'; +import type Settings from '../settings'; +import type { Entry, Errno } from '../types'; +export declare type AsyncCallback = (error: Errno, entries: Entry[]) => void; +export default class AsyncProvider { + private readonly _root; + private readonly _settings; + protected readonly _reader: AsyncReader; + private readonly _storage; + constructor(_root: string, _settings: Settings); + read(callback: AsyncCallback): void; +} diff --git a/publisher/node_modules/@nodelib/fs.walk/out/providers/async.js b/publisher/node_modules/@nodelib/fs.walk/out/providers/async.js new file mode 100644 index 00000000..51d3be51 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.walk/out/providers/async.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const async_1 = require("../readers/async"); +class AsyncProvider { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._reader = new async_1.default(this._root, this._settings); + this._storage = []; + } + read(callback) { + this._reader.onError((error) => { + callFailureCallback(callback, error); + }); + this._reader.onEntry((entry) => { + this._storage.push(entry); + }); + this._reader.onEnd(() => { + callSuccessCallback(callback, this._storage); + }); + this._reader.read(); + } +} +exports.default = AsyncProvider; +function callFailureCallback(callback, error) { + callback(error); +} +function callSuccessCallback(callback, entries) { + callback(null, entries); +} diff --git a/publisher/node_modules/@nodelib/fs.walk/out/providers/index.d.ts b/publisher/node_modules/@nodelib/fs.walk/out/providers/index.d.ts new file mode 100644 index 00000000..874f60c5 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.walk/out/providers/index.d.ts @@ -0,0 +1,4 @@ +import AsyncProvider from './async'; +import StreamProvider from './stream'; +import SyncProvider from './sync'; +export { AsyncProvider, StreamProvider, SyncProvider }; diff --git a/publisher/node_modules/@nodelib/fs.walk/out/providers/index.js b/publisher/node_modules/@nodelib/fs.walk/out/providers/index.js new file mode 100644 index 00000000..4c2529ce --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.walk/out/providers/index.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SyncProvider = exports.StreamProvider = exports.AsyncProvider = void 0; +const async_1 = require("./async"); +exports.AsyncProvider = async_1.default; +const stream_1 = require("./stream"); +exports.StreamProvider = stream_1.default; +const sync_1 = require("./sync"); +exports.SyncProvider = sync_1.default; diff --git a/publisher/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts b/publisher/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts new file mode 100644 index 00000000..294185f8 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts @@ -0,0 +1,12 @@ +/// +import { Readable } from 'stream'; +import AsyncReader from '../readers/async'; +import type Settings from '../settings'; +export default class StreamProvider { + private readonly _root; + private readonly _settings; + protected readonly _reader: AsyncReader; + protected readonly _stream: Readable; + constructor(_root: string, _settings: Settings); + read(): Readable; +} diff --git a/publisher/node_modules/@nodelib/fs.walk/out/providers/stream.js b/publisher/node_modules/@nodelib/fs.walk/out/providers/stream.js new file mode 100644 index 00000000..51298b0f --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.walk/out/providers/stream.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const stream_1 = require("stream"); +const async_1 = require("../readers/async"); +class StreamProvider { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._reader = new async_1.default(this._root, this._settings); + this._stream = new stream_1.Readable({ + objectMode: true, + read: () => { }, + destroy: () => { + if (!this._reader.isDestroyed) { + this._reader.destroy(); + } + } + }); + } + read() { + this._reader.onError((error) => { + this._stream.emit('error', error); + }); + this._reader.onEntry((entry) => { + this._stream.push(entry); + }); + this._reader.onEnd(() => { + this._stream.push(null); + }); + this._reader.read(); + return this._stream; + } +} +exports.default = StreamProvider; diff --git a/publisher/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts b/publisher/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts new file mode 100644 index 00000000..551c42e4 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts @@ -0,0 +1,10 @@ +import SyncReader from '../readers/sync'; +import type Settings from '../settings'; +import type { Entry } from '../types'; +export default class SyncProvider { + private readonly _root; + private readonly _settings; + protected readonly _reader: SyncReader; + constructor(_root: string, _settings: Settings); + read(): Entry[]; +} diff --git a/publisher/node_modules/@nodelib/fs.walk/out/providers/sync.js b/publisher/node_modules/@nodelib/fs.walk/out/providers/sync.js new file mode 100644 index 00000000..faab6ca2 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.walk/out/providers/sync.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const sync_1 = require("../readers/sync"); +class SyncProvider { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._reader = new sync_1.default(this._root, this._settings); + } + read() { + return this._reader.read(); + } +} +exports.default = SyncProvider; diff --git a/publisher/node_modules/@nodelib/fs.walk/out/readers/async.d.ts b/publisher/node_modules/@nodelib/fs.walk/out/readers/async.d.ts new file mode 100644 index 00000000..9acf4e6c --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.walk/out/readers/async.d.ts @@ -0,0 +1,30 @@ +/// +import { EventEmitter } from 'events'; +import * as fsScandir from '@nodelib/fs.scandir'; +import type Settings from '../settings'; +import type { Entry, Errno } from '../types'; +import Reader from './reader'; +declare type EntryEventCallback = (entry: Entry) => void; +declare type ErrorEventCallback = (error: Errno) => void; +declare type EndEventCallback = () => void; +export default class AsyncReader extends Reader { + protected readonly _settings: Settings; + protected readonly _scandir: typeof fsScandir.scandir; + protected readonly _emitter: EventEmitter; + private readonly _queue; + private _isFatalError; + private _isDestroyed; + constructor(_root: string, _settings: Settings); + read(): EventEmitter; + get isDestroyed(): boolean; + destroy(): void; + onEntry(callback: EntryEventCallback): void; + onError(callback: ErrorEventCallback): void; + onEnd(callback: EndEventCallback): void; + private _pushToQueue; + private _worker; + private _handleError; + private _handleEntry; + private _emitEntry; +} +export {}; diff --git a/publisher/node_modules/@nodelib/fs.walk/out/readers/async.js b/publisher/node_modules/@nodelib/fs.walk/out/readers/async.js new file mode 100644 index 00000000..ebe8dd57 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.walk/out/readers/async.js @@ -0,0 +1,97 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const events_1 = require("events"); +const fsScandir = require("@nodelib/fs.scandir"); +const fastq = require("fastq"); +const common = require("./common"); +const reader_1 = require("./reader"); +class AsyncReader extends reader_1.default { + constructor(_root, _settings) { + super(_root, _settings); + this._settings = _settings; + this._scandir = fsScandir.scandir; + this._emitter = new events_1.EventEmitter(); + this._queue = fastq(this._worker.bind(this), this._settings.concurrency); + this._isFatalError = false; + this._isDestroyed = false; + this._queue.drain = () => { + if (!this._isFatalError) { + this._emitter.emit('end'); + } + }; + } + read() { + this._isFatalError = false; + this._isDestroyed = false; + setImmediate(() => { + this._pushToQueue(this._root, this._settings.basePath); + }); + return this._emitter; + } + get isDestroyed() { + return this._isDestroyed; + } + destroy() { + if (this._isDestroyed) { + throw new Error('The reader is already destroyed'); + } + this._isDestroyed = true; + this._queue.killAndDrain(); + } + onEntry(callback) { + this._emitter.on('entry', callback); + } + onError(callback) { + this._emitter.once('error', callback); + } + onEnd(callback) { + this._emitter.once('end', callback); + } + _pushToQueue(directory, base) { + const queueItem = { directory, base }; + this._queue.push(queueItem, (error) => { + if (error !== null) { + this._handleError(error); + } + }); + } + _worker(item, done) { + this._scandir(item.directory, this._settings.fsScandirSettings, (error, entries) => { + if (error !== null) { + done(error, undefined); + return; + } + for (const entry of entries) { + this._handleEntry(entry, item.base); + } + done(null, undefined); + }); + } + _handleError(error) { + if (this._isDestroyed || !common.isFatalError(this._settings, error)) { + return; + } + this._isFatalError = true; + this._isDestroyed = true; + this._emitter.emit('error', error); + } + _handleEntry(entry, base) { + if (this._isDestroyed || this._isFatalError) { + return; + } + const fullpath = entry.path; + if (base !== undefined) { + entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); + } + if (common.isAppliedFilter(this._settings.entryFilter, entry)) { + this._emitEntry(entry); + } + if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) { + this._pushToQueue(fullpath, base === undefined ? undefined : entry.path); + } + } + _emitEntry(entry) { + this._emitter.emit('entry', entry); + } +} +exports.default = AsyncReader; diff --git a/publisher/node_modules/@nodelib/fs.walk/out/readers/common.d.ts b/publisher/node_modules/@nodelib/fs.walk/out/readers/common.d.ts new file mode 100644 index 00000000..5985f97c --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.walk/out/readers/common.d.ts @@ -0,0 +1,7 @@ +import type { FilterFunction } from '../settings'; +import type Settings from '../settings'; +import type { Errno } from '../types'; +export declare function isFatalError(settings: Settings, error: Errno): boolean; +export declare function isAppliedFilter(filter: FilterFunction | null, value: T): boolean; +export declare function replacePathSegmentSeparator(filepath: string, separator: string): string; +export declare function joinPathSegments(a: string, b: string, separator: string): string; diff --git a/publisher/node_modules/@nodelib/fs.walk/out/readers/common.js b/publisher/node_modules/@nodelib/fs.walk/out/readers/common.js new file mode 100644 index 00000000..a93572f4 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.walk/out/readers/common.js @@ -0,0 +1,31 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0; +function isFatalError(settings, error) { + if (settings.errorFilter === null) { + return true; + } + return !settings.errorFilter(error); +} +exports.isFatalError = isFatalError; +function isAppliedFilter(filter, value) { + return filter === null || filter(value); +} +exports.isAppliedFilter = isAppliedFilter; +function replacePathSegmentSeparator(filepath, separator) { + return filepath.split(/[/\\]/).join(separator); +} +exports.replacePathSegmentSeparator = replacePathSegmentSeparator; +function joinPathSegments(a, b, separator) { + if (a === '') { + return b; + } + /** + * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`). + */ + if (a.endsWith(separator)) { + return a + b; + } + return a + separator + b; +} +exports.joinPathSegments = joinPathSegments; diff --git a/publisher/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts b/publisher/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts new file mode 100644 index 00000000..e1f383b2 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts @@ -0,0 +1,6 @@ +import type Settings from '../settings'; +export default class Reader { + protected readonly _root: string; + protected readonly _settings: Settings; + constructor(_root: string, _settings: Settings); +} diff --git a/publisher/node_modules/@nodelib/fs.walk/out/readers/reader.js b/publisher/node_modules/@nodelib/fs.walk/out/readers/reader.js new file mode 100644 index 00000000..782f07cb --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.walk/out/readers/reader.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const common = require("./common"); +class Reader { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._root = common.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator); + } +} +exports.default = Reader; diff --git a/publisher/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts b/publisher/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts new file mode 100644 index 00000000..af410335 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts @@ -0,0 +1,15 @@ +import * as fsScandir from '@nodelib/fs.scandir'; +import type { Entry } from '../types'; +import Reader from './reader'; +export default class SyncReader extends Reader { + protected readonly _scandir: typeof fsScandir.scandirSync; + private readonly _storage; + private readonly _queue; + read(): Entry[]; + private _pushToQueue; + private _handleQueue; + private _handleDirectory; + private _handleError; + private _handleEntry; + private _pushToStorage; +} diff --git a/publisher/node_modules/@nodelib/fs.walk/out/readers/sync.js b/publisher/node_modules/@nodelib/fs.walk/out/readers/sync.js new file mode 100644 index 00000000..9a8d5a6f --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.walk/out/readers/sync.js @@ -0,0 +1,59 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const fsScandir = require("@nodelib/fs.scandir"); +const common = require("./common"); +const reader_1 = require("./reader"); +class SyncReader extends reader_1.default { + constructor() { + super(...arguments); + this._scandir = fsScandir.scandirSync; + this._storage = []; + this._queue = new Set(); + } + read() { + this._pushToQueue(this._root, this._settings.basePath); + this._handleQueue(); + return this._storage; + } + _pushToQueue(directory, base) { + this._queue.add({ directory, base }); + } + _handleQueue() { + for (const item of this._queue.values()) { + this._handleDirectory(item.directory, item.base); + } + } + _handleDirectory(directory, base) { + try { + const entries = this._scandir(directory, this._settings.fsScandirSettings); + for (const entry of entries) { + this._handleEntry(entry, base); + } + } + catch (error) { + this._handleError(error); + } + } + _handleError(error) { + if (!common.isFatalError(this._settings, error)) { + return; + } + throw error; + } + _handleEntry(entry, base) { + const fullpath = entry.path; + if (base !== undefined) { + entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); + } + if (common.isAppliedFilter(this._settings.entryFilter, entry)) { + this._pushToStorage(entry); + } + if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) { + this._pushToQueue(fullpath, base === undefined ? undefined : entry.path); + } + } + _pushToStorage(entry) { + this._storage.push(entry); + } +} +exports.default = SyncReader; diff --git a/publisher/node_modules/@nodelib/fs.walk/out/settings.d.ts b/publisher/node_modules/@nodelib/fs.walk/out/settings.d.ts new file mode 100644 index 00000000..d1c4b45f --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.walk/out/settings.d.ts @@ -0,0 +1,30 @@ +import * as fsScandir from '@nodelib/fs.scandir'; +import type { Entry, Errno } from './types'; +export declare type FilterFunction = (value: T) => boolean; +export declare type DeepFilterFunction = FilterFunction; +export declare type EntryFilterFunction = FilterFunction; +export declare type ErrorFilterFunction = FilterFunction; +export interface Options { + basePath?: string; + concurrency?: number; + deepFilter?: DeepFilterFunction; + entryFilter?: EntryFilterFunction; + errorFilter?: ErrorFilterFunction; + followSymbolicLinks?: boolean; + fs?: Partial; + pathSegmentSeparator?: string; + stats?: boolean; + throwErrorOnBrokenSymbolicLink?: boolean; +} +export default class Settings { + private readonly _options; + readonly basePath?: string; + readonly concurrency: number; + readonly deepFilter: DeepFilterFunction | null; + readonly entryFilter: EntryFilterFunction | null; + readonly errorFilter: ErrorFilterFunction | null; + readonly pathSegmentSeparator: string; + readonly fsScandirSettings: fsScandir.Settings; + constructor(_options?: Options); + private _getValue; +} diff --git a/publisher/node_modules/@nodelib/fs.walk/out/settings.js b/publisher/node_modules/@nodelib/fs.walk/out/settings.js new file mode 100644 index 00000000..d7a85c81 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.walk/out/settings.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const path = require("path"); +const fsScandir = require("@nodelib/fs.scandir"); +class Settings { + constructor(_options = {}) { + this._options = _options; + this.basePath = this._getValue(this._options.basePath, undefined); + this.concurrency = this._getValue(this._options.concurrency, Number.POSITIVE_INFINITY); + this.deepFilter = this._getValue(this._options.deepFilter, null); + this.entryFilter = this._getValue(this._options.entryFilter, null); + this.errorFilter = this._getValue(this._options.errorFilter, null); + this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep); + this.fsScandirSettings = new fsScandir.Settings({ + followSymbolicLinks: this._options.followSymbolicLinks, + fs: this._options.fs, + pathSegmentSeparator: this._options.pathSegmentSeparator, + stats: this._options.stats, + throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink + }); + } + _getValue(option, value) { + return option !== null && option !== void 0 ? option : value; + } +} +exports.default = Settings; diff --git a/publisher/node_modules/@nodelib/fs.walk/out/types/index.d.ts b/publisher/node_modules/@nodelib/fs.walk/out/types/index.d.ts new file mode 100644 index 00000000..6ee9bd3f --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.walk/out/types/index.d.ts @@ -0,0 +1,8 @@ +/// +import type * as scandir from '@nodelib/fs.scandir'; +export declare type Entry = scandir.Entry; +export declare type Errno = NodeJS.ErrnoException; +export interface QueueItem { + directory: string; + base?: string; +} diff --git a/publisher/node_modules/@nodelib/fs.walk/out/types/index.js b/publisher/node_modules/@nodelib/fs.walk/out/types/index.js new file mode 100644 index 00000000..c8ad2e54 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.walk/out/types/index.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/publisher/node_modules/@nodelib/fs.walk/package.json b/publisher/node_modules/@nodelib/fs.walk/package.json new file mode 100644 index 00000000..86bfce48 --- /dev/null +++ b/publisher/node_modules/@nodelib/fs.walk/package.json @@ -0,0 +1,44 @@ +{ + "name": "@nodelib/fs.walk", + "version": "1.2.8", + "description": "A library for efficiently walking a directory recursively", + "license": "MIT", + "repository": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.walk", + "keywords": [ + "NodeLib", + "fs", + "FileSystem", + "file system", + "walk", + "scanner", + "crawler" + ], + "engines": { + "node": ">= 8" + }, + "files": [ + "out/**", + "!out/**/*.map", + "!out/**/*.spec.*", + "!out/**/tests/**" + ], + "main": "out/index.js", + "typings": "out/index.d.ts", + "scripts": { + "clean": "rimraf {tsconfig.tsbuildinfo,out}", + "lint": "eslint \"src/**/*.ts\" --cache", + "compile": "tsc -b .", + "compile:watch": "tsc -p . --watch --sourceMap", + "test": "mocha \"out/**/*.spec.js\" -s 0", + "build": "npm run clean && npm run compile && npm run lint && npm test", + "watch": "npm run clean && npm run compile:watch" + }, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "devDependencies": { + "@nodelib/fs.macchiato": "1.0.4" + }, + "gitHead": "1e5bad48565da2b06b8600e744324ea240bf49d8" +} diff --git a/publisher/node_modules/ansi-regex/index.d.ts b/publisher/node_modules/ansi-regex/index.d.ts new file mode 100644 index 00000000..2dbf6af2 --- /dev/null +++ b/publisher/node_modules/ansi-regex/index.d.ts @@ -0,0 +1,37 @@ +declare namespace ansiRegex { + interface Options { + /** + Match only the first ANSI escape. + + @default false + */ + onlyFirst: boolean; + } +} + +/** +Regular expression for matching ANSI escape codes. + +@example +``` +import ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001B[4mcake\u001B[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001B[4mcake\u001B[0m'.match(ansiRegex()); +//=> ['\u001B[4m', '\u001B[0m'] + +'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); +//=> ['\u001B[4m'] + +'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); +//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] +``` +*/ +declare function ansiRegex(options?: ansiRegex.Options): RegExp; + +export = ansiRegex; diff --git a/publisher/node_modules/ansi-regex/index.js b/publisher/node_modules/ansi-regex/index.js new file mode 100644 index 00000000..616ff837 --- /dev/null +++ b/publisher/node_modules/ansi-regex/index.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = ({onlyFirst = false} = {}) => { + const pattern = [ + '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', + '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' + ].join('|'); + + return new RegExp(pattern, onlyFirst ? undefined : 'g'); +}; diff --git a/publisher/node_modules/ansi-regex/license b/publisher/node_modules/ansi-regex/license new file mode 100644 index 00000000..e7af2f77 --- /dev/null +++ b/publisher/node_modules/ansi-regex/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/publisher/node_modules/ansi-regex/package.json b/publisher/node_modules/ansi-regex/package.json new file mode 100644 index 00000000..017f5311 --- /dev/null +++ b/publisher/node_modules/ansi-regex/package.json @@ -0,0 +1,55 @@ +{ + "name": "ansi-regex", + "version": "5.0.1", + "description": "Regular expression for matching ANSI escape codes", + "license": "MIT", + "repository": "chalk/ansi-regex", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd", + "view-supported": "node fixtures/view-codes.js" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.9.0", + "xo": "^0.25.3" + } +} diff --git a/publisher/node_modules/ansi-regex/readme.md b/publisher/node_modules/ansi-regex/readme.md new file mode 100644 index 00000000..4d848bc3 --- /dev/null +++ b/publisher/node_modules/ansi-regex/readme.md @@ -0,0 +1,78 @@ +# ansi-regex + +> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +``` +$ npm install ansi-regex +``` + + +## Usage + +```js +const ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001B[4mcake\u001B[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001B[4mcake\u001B[0m'.match(ansiRegex()); +//=> ['\u001B[4m', '\u001B[0m'] + +'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); +//=> ['\u001B[4m'] + +'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); +//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] +``` + + +## API + +### ansiRegex(options?) + +Returns a regex for matching ANSI escape codes. + +#### options + +Type: `object` + +##### onlyFirst + +Type: `boolean`
+Default: `false` *(Matches any ANSI escape codes in a string)* + +Match only the first ANSI escape. + + +## FAQ + +### Why do you test for codes not in the ECMA 48 standard? + +Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them. + +On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out. + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/publisher/node_modules/aproba/CHANGELOG.md b/publisher/node_modules/aproba/CHANGELOG.md new file mode 100644 index 00000000..bab30ecb --- /dev/null +++ b/publisher/node_modules/aproba/CHANGELOG.md @@ -0,0 +1,4 @@ +2.0.0 + * Drop support for 0.10 and 0.12. They haven't been in travis but still, + since we _know_ we'll break with them now it's only polite to do a + major bump. diff --git a/publisher/node_modules/aproba/LICENSE b/publisher/node_modules/aproba/LICENSE new file mode 100644 index 00000000..f4be44d8 --- /dev/null +++ b/publisher/node_modules/aproba/LICENSE @@ -0,0 +1,14 @@ +Copyright (c) 2015, Rebecca Turner + +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. + diff --git a/publisher/node_modules/aproba/README.md b/publisher/node_modules/aproba/README.md new file mode 100644 index 00000000..0bfc594c --- /dev/null +++ b/publisher/node_modules/aproba/README.md @@ -0,0 +1,94 @@ +aproba +====== + +A ridiculously light-weight function argument validator + +``` +var validate = require("aproba") + +function myfunc(a, b, c) { + // `a` must be a string, `b` a number, `c` a function + validate('SNF', arguments) // [a,b,c] is also valid +} + +myfunc('test', 23, function () {}) // ok +myfunc(123, 23, function () {}) // type error +myfunc('test', 23) // missing arg error +myfunc('test', 23, function () {}, true) // too many args error + +``` + +Valid types are: + +| type | description +| :--: | :---------- +| * | matches any type +| A | `Array.isArray` OR an `arguments` object +| S | typeof == string +| N | typeof == number +| F | typeof == function +| O | typeof == object and not type A and not type E +| B | typeof == boolean +| E | `instanceof Error` OR `null` **(special: see below)** +| Z | == `null` + +Validation failures throw one of three exception types, distinguished by a +`code` property of `EMISSINGARG`, `EINVALIDTYPE` or `ETOOMANYARGS`. + +If you pass in an invalid type then it will throw with a code of +`EUNKNOWNTYPE`. + +If an **error** argument is found and is not null then the remaining +arguments are optional. That is, if you say `ESO` then that's like using a +non-magical `E` in: `E|ESO|ZSO`. + +### But I have optional arguments?! + +You can provide more than one signature by separating them with pipes `|`. +If any signature matches the arguments then they'll be considered valid. + +So for example, say you wanted to write a signature for +`fs.createWriteStream`. The docs for it describe it thusly: + +``` +fs.createWriteStream(path[, options]) +``` + +This would be a signature of `SO|S`. That is, a string and and object, or +just a string. + +Now, if you read the full `fs` docs, you'll see that actually path can ALSO +be a buffer. And options can be a string, that is: +``` +path | +options | +``` + +To reproduce this you have to fully enumerate all of the possible +combinations and that implies a signature of `SO|SS|OO|OS|S|O`. The +awkwardness is a feature: It reminds you of the complexity you're adding to +your API when you do this sort of thing. + + +### Browser support + +This has no dependencies and should work in browsers, though you'll have +noisier stack traces. + +### Why this exists + +I wanted a very simple argument validator. It needed to do two things: + +1. Be more concise and easier to use than assertions + +2. Not encourage an infinite bikeshed of DSLs + +This is why types are specified by a single character and there's no such +thing as an optional argument. + +This is not intended to validate user data. This is specifically about +asserting the interface of your functions. + +If you need greater validation, I encourage you to write them by hand or +look elsewhere. + diff --git a/publisher/node_modules/aproba/index.js b/publisher/node_modules/aproba/index.js new file mode 100644 index 00000000..fd947481 --- /dev/null +++ b/publisher/node_modules/aproba/index.js @@ -0,0 +1,105 @@ +'use strict' +module.exports = validate + +function isArguments (thingy) { + return thingy != null && typeof thingy === 'object' && thingy.hasOwnProperty('callee') +} + +const types = { + '*': {label: 'any', check: () => true}, + A: {label: 'array', check: _ => Array.isArray(_) || isArguments(_)}, + S: {label: 'string', check: _ => typeof _ === 'string'}, + N: {label: 'number', check: _ => typeof _ === 'number'}, + F: {label: 'function', check: _ => typeof _ === 'function'}, + O: {label: 'object', check: _ => typeof _ === 'object' && _ != null && !types.A.check(_) && !types.E.check(_)}, + B: {label: 'boolean', check: _ => typeof _ === 'boolean'}, + E: {label: 'error', check: _ => _ instanceof Error}, + Z: {label: 'null', check: _ => _ == null} +} + +function addSchema (schema, arity) { + const group = arity[schema.length] = arity[schema.length] || [] + if (group.indexOf(schema) === -1) group.push(schema) +} + +function validate (rawSchemas, args) { + if (arguments.length !== 2) throw wrongNumberOfArgs(['SA'], arguments.length) + if (!rawSchemas) throw missingRequiredArg(0, 'rawSchemas') + if (!args) throw missingRequiredArg(1, 'args') + if (!types.S.check(rawSchemas)) throw invalidType(0, ['string'], rawSchemas) + if (!types.A.check(args)) throw invalidType(1, ['array'], args) + const schemas = rawSchemas.split('|') + const arity = {} + + schemas.forEach(schema => { + for (let ii = 0; ii < schema.length; ++ii) { + const type = schema[ii] + if (!types[type]) throw unknownType(ii, type) + } + if (/E.*E/.test(schema)) throw moreThanOneError(schema) + addSchema(schema, arity) + if (/E/.test(schema)) { + addSchema(schema.replace(/E.*$/, 'E'), arity) + addSchema(schema.replace(/E/, 'Z'), arity) + if (schema.length === 1) addSchema('', arity) + } + }) + let matching = arity[args.length] + if (!matching) { + throw wrongNumberOfArgs(Object.keys(arity), args.length) + } + for (let ii = 0; ii < args.length; ++ii) { + let newMatching = matching.filter(schema => { + const type = schema[ii] + const typeCheck = types[type].check + return typeCheck(args[ii]) + }) + if (!newMatching.length) { + const labels = matching.map(_ => types[_[ii]].label).filter(_ => _ != null) + throw invalidType(ii, labels, args[ii]) + } + matching = newMatching + } +} + +function missingRequiredArg (num) { + return newException('EMISSINGARG', 'Missing required argument #' + (num + 1)) +} + +function unknownType (num, type) { + return newException('EUNKNOWNTYPE', 'Unknown type ' + type + ' in argument #' + (num + 1)) +} + +function invalidType (num, expectedTypes, value) { + let valueType + Object.keys(types).forEach(typeCode => { + if (types[typeCode].check(value)) valueType = types[typeCode].label + }) + return newException('EINVALIDTYPE', 'Argument #' + (num + 1) + ': Expected ' + + englishList(expectedTypes) + ' but got ' + valueType) +} + +function englishList (list) { + return list.join(', ').replace(/, ([^,]+)$/, ' or $1') +} + +function wrongNumberOfArgs (expected, got) { + const english = englishList(expected) + const args = expected.every(ex => ex.length === 1) + ? 'argument' + : 'arguments' + return newException('EWRONGARGCOUNT', 'Expected ' + english + ' ' + args + ' but got ' + got) +} + +function moreThanOneError (schema) { + return newException('ETOOMANYERRORTYPES', + 'Only one error type per argument signature is allowed, more than one found in "' + schema + '"') +} + +function newException (code, msg) { + const err = new Error(msg) + err.code = code + /* istanbul ignore else */ + if (Error.captureStackTrace) Error.captureStackTrace(err, validate) + return err +} diff --git a/publisher/node_modules/aproba/package.json b/publisher/node_modules/aproba/package.json new file mode 100644 index 00000000..d2212d30 --- /dev/null +++ b/publisher/node_modules/aproba/package.json @@ -0,0 +1,35 @@ +{ + "name": "aproba", + "version": "2.0.0", + "description": "A ridiculously light-weight argument validator (now browser friendly)", + "main": "index.js", + "directories": { + "test": "test" + }, + "dependencies": {}, + "devDependencies": { + "standard": "^11.0.1", + "tap": "^12.0.1" + }, + "files": [ + "index.js" + ], + "scripts": { + "pretest": "standard", + "test": "tap --100 -J test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/iarna/aproba" + }, + "keywords": [ + "argument", + "validate" + ], + "author": "Rebecca Turner ", + "license": "ISC", + "bugs": { + "url": "https://github.com/iarna/aproba/issues" + }, + "homepage": "https://github.com/iarna/aproba" +} diff --git a/publisher/node_modules/are-we-there-yet/LICENSE.md b/publisher/node_modules/are-we-there-yet/LICENSE.md new file mode 100644 index 00000000..845be76f --- /dev/null +++ b/publisher/node_modules/are-we-there-yet/LICENSE.md @@ -0,0 +1,18 @@ +ISC License + +Copyright npm, Inc. + +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 NPM DISCLAIMS ALL +WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO +EVENT SHALL NPM 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. diff --git a/publisher/node_modules/are-we-there-yet/README.md b/publisher/node_modules/are-we-there-yet/README.md new file mode 100644 index 00000000..caae19b0 --- /dev/null +++ b/publisher/node_modules/are-we-there-yet/README.md @@ -0,0 +1,208 @@ +are-we-there-yet +---------------- + +Track complex hierarchies of asynchronous task completion statuses. This is +intended to give you a way of recording and reporting the progress of the big +recursive fan-out and gather type workflows that are so common in async. + +What you do with this completion data is up to you, but the most common use case is to +feed it to one of the many progress bar modules. + +Most progress bar modules include a rudimentary version of this, but my +needs were more complex. + +Usage +===== + +```javascript +var TrackerGroup = require("are-we-there-yet").TrackerGroup + +var top = new TrackerGroup("program") + +var single = top.newItem("one thing", 100) +single.completeWork(20) + +console.log(top.completed()) // 0.2 + +fs.stat("file", function(er, stat) { + if (er) throw er + var stream = top.newStream("file", stat.size) + console.log(top.completed()) // now 0.1 as single is 50% of the job and is 20% complete + // and 50% * 20% == 10% + fs.createReadStream("file").pipe(stream).on("data", function (chunk) { + // do stuff with chunk + }) + top.on("change", function (name) { + // called each time a chunk is read from "file" + // top.completed() will start at 0.1 and fill up to 0.6 as the file is read + }) +}) +``` + +Shared Methods +============== + +* var completed = tracker.completed() + +Implemented in: `Tracker`, `TrackerGroup`, `TrackerStream` + +Returns the ratio of completed work to work to be done. Range of 0 to 1. + +* tracker.finish() + +Implemented in: `Tracker`, `TrackerGroup` + +Marks the tracker as completed. With a TrackerGroup this marks all of its +components as completed. + +Marks all of the components of this tracker as finished, which in turn means +that `tracker.completed()` for this will now be 1. + +This will result in one or more `change` events being emitted. + +Events +====== + +All tracker objects emit `change` events with the following arguments: + +``` +function (name, completed, tracker) +``` + +`name` is the name of the tracker that originally emitted the event, +or if it didn't have one, the first containing tracker group that had one. + +`completed` is the percent complete (as returned by `tracker.completed()` method). + +`tracker` is the tracker object that you are listening for events on. + +TrackerGroup +============ + +* var tracker = new TrackerGroup(**name**) + + * **name** *(optional)* - The name of this tracker group, used in change + notifications if the component updating didn't have a name. Defaults to undefined. + +Creates a new empty tracker aggregation group. These are trackers whose +completion status is determined by the completion status of other trackers added to this aggregation group. + +Ex. + +```javascript +var tracker = new TrackerGroup("parent") +var foo = tracker.newItem("firstChild", 100) +var bar = tracker.newItem("secondChild", 100) + +foo.finish() +console.log(tracker.completed()) // 0.5 +bar.finish() +console.log(tracker.completed()) // 1 +``` + +* tracker.addUnit(**otherTracker**, **weight**) + + * **otherTracker** - Any of the other are-we-there-yet tracker objects + * **weight** *(optional)* - The weight to give the tracker, defaults to 1. + +Adds the **otherTracker** to this aggregation group. The weight determines +how long you expect this tracker to take to complete in proportion to other +units. So for instance, if you add one tracker with a weight of 1 and +another with a weight of 2, you're saying the second will take twice as long +to complete as the first. As such, the first will account for 33% of the +completion of this tracker and the second will account for the other 67%. + +Returns **otherTracker**. + +* var subGroup = tracker.newGroup(**name**, **weight**) + +The above is exactly equivalent to: + +```javascript + var subGroup = tracker.addUnit(new TrackerGroup(name), weight) +``` + +* var subItem = tracker.newItem(**name**, **todo**, **weight**) + +The above is exactly equivalent to: + +```javascript + var subItem = tracker.addUnit(new Tracker(name, todo), weight) +``` + +* var subStream = tracker.newStream(**name**, **todo**, **weight**) + +The above is exactly equivalent to: + +```javascript + var subStream = tracker.addUnit(new TrackerStream(name, todo), weight) +``` + +* console.log( tracker.debug() ) + +Returns a tree showing the completion of this tracker group and all of its +children, including recursively entering all of the children. + +Tracker +======= + +* var tracker = new Tracker(**name**, **todo**) + + * **name** *(optional)* The name of this counter to report in change + events. Defaults to undefined. + * **todo** *(optional)* The amount of work todo (a number). Defaults to 0. + +Ordinarily these are constructed as a part of a tracker group (via +`newItem`). + +* var completed = tracker.completed() + +Returns the ratio of completed work to work to be done. Range of 0 to 1. If +total work to be done is 0 then it will return 0. + +* tracker.addWork(**todo**) + + * **todo** A number to add to the amount of work to be done. + +Increases the amount of work to be done, thus decreasing the completion +percentage. Triggers a `change` event. + +* tracker.completeWork(**completed**) + + * **completed** A number to add to the work complete + +Increase the amount of work complete, thus increasing the completion percentage. +Will never increase the work completed past the amount of work todo. That is, +percentages > 100% are not allowed. Triggers a `change` event. + +* tracker.finish() + +Marks this tracker as finished, tracker.completed() will now be 1. Triggers +a `change` event. + +TrackerStream +============= + +* var tracker = new TrackerStream(**name**, **size**, **options**) + + * **name** *(optional)* The name of this counter to report in change + events. Defaults to undefined. + * **size** *(optional)* The number of bytes being sent through this stream. + * **options** *(optional)* A hash of stream options + +The tracker stream object is a pass through stream that updates an internal +tracker object each time a block passes through. It's intended to track +downloads, file extraction and other related activities. You use it by piping +your data source into it and then using it as your data source. + +If your data has a length attribute then that's used as the amount of work +completed when the chunk is passed through. If it does not (eg, object +streams) then each chunk counts as completing 1 unit of work, so your size +should be the total number of objects being streamed. + +* tracker.addWork(**todo**) + + * **todo** Increase the expected overall size by **todo** bytes. + +Increases the amount of work to be done, thus decreasing the completion +percentage. Triggers a `change` event. diff --git a/publisher/node_modules/are-we-there-yet/lib/index.js b/publisher/node_modules/are-we-there-yet/lib/index.js new file mode 100644 index 00000000..57d8743f --- /dev/null +++ b/publisher/node_modules/are-we-there-yet/lib/index.js @@ -0,0 +1,4 @@ +'use strict' +exports.TrackerGroup = require('./tracker-group.js') +exports.Tracker = require('./tracker.js') +exports.TrackerStream = require('./tracker-stream.js') diff --git a/publisher/node_modules/are-we-there-yet/lib/tracker-base.js b/publisher/node_modules/are-we-there-yet/lib/tracker-base.js new file mode 100644 index 00000000..6f436875 --- /dev/null +++ b/publisher/node_modules/are-we-there-yet/lib/tracker-base.js @@ -0,0 +1,11 @@ +'use strict' +var EventEmitter = require('events').EventEmitter +var util = require('util') + +var trackerId = 0 +var TrackerBase = module.exports = function (name) { + EventEmitter.call(this) + this.id = ++trackerId + this.name = name +} +util.inherits(TrackerBase, EventEmitter) diff --git a/publisher/node_modules/are-we-there-yet/lib/tracker-group.js b/publisher/node_modules/are-we-there-yet/lib/tracker-group.js new file mode 100644 index 00000000..a3c7af80 --- /dev/null +++ b/publisher/node_modules/are-we-there-yet/lib/tracker-group.js @@ -0,0 +1,116 @@ +'use strict' +var util = require('util') +var TrackerBase = require('./tracker-base.js') +var Tracker = require('./tracker.js') +var TrackerStream = require('./tracker-stream.js') + +var TrackerGroup = module.exports = function (name) { + TrackerBase.call(this, name) + this.parentGroup = null + this.trackers = [] + this.completion = {} + this.weight = {} + this.totalWeight = 0 + this.finished = false + this.bubbleChange = bubbleChange(this) +} +util.inherits(TrackerGroup, TrackerBase) + +function bubbleChange (trackerGroup) { + return function (name, completed, tracker) { + trackerGroup.completion[tracker.id] = completed + if (trackerGroup.finished) { + return + } + trackerGroup.emit('change', name || trackerGroup.name, trackerGroup.completed(), trackerGroup) + } +} + +TrackerGroup.prototype.nameInTree = function () { + var names = [] + var from = this + while (from) { + names.unshift(from.name) + from = from.parentGroup + } + return names.join('/') +} + +TrackerGroup.prototype.addUnit = function (unit, weight) { + if (unit.addUnit) { + var toTest = this + while (toTest) { + if (unit === toTest) { + throw new Error( + 'Attempted to add tracker group ' + + unit.name + ' to tree that already includes it ' + + this.nameInTree(this)) + } + toTest = toTest.parentGroup + } + unit.parentGroup = this + } + this.weight[unit.id] = weight || 1 + this.totalWeight += this.weight[unit.id] + this.trackers.push(unit) + this.completion[unit.id] = unit.completed() + unit.on('change', this.bubbleChange) + if (!this.finished) { + this.emit('change', unit.name, this.completion[unit.id], unit) + } + return unit +} + +TrackerGroup.prototype.completed = function () { + if (this.trackers.length === 0) { + return 0 + } + var valPerWeight = 1 / this.totalWeight + var completed = 0 + for (var ii = 0; ii < this.trackers.length; ii++) { + var trackerId = this.trackers[ii].id + completed += + valPerWeight * this.weight[trackerId] * this.completion[trackerId] + } + return completed +} + +TrackerGroup.prototype.newGroup = function (name, weight) { + return this.addUnit(new TrackerGroup(name), weight) +} + +TrackerGroup.prototype.newItem = function (name, todo, weight) { + return this.addUnit(new Tracker(name, todo), weight) +} + +TrackerGroup.prototype.newStream = function (name, todo, weight) { + return this.addUnit(new TrackerStream(name, todo), weight) +} + +TrackerGroup.prototype.finish = function () { + this.finished = true + if (!this.trackers.length) { + this.addUnit(new Tracker(), 1, true) + } + for (var ii = 0; ii < this.trackers.length; ii++) { + var tracker = this.trackers[ii] + tracker.finish() + tracker.removeListener('change', this.bubbleChange) + } + this.emit('change', this.name, 1, this) +} + +var buffer = ' ' +TrackerGroup.prototype.debug = function (depth) { + depth = depth || 0 + var indent = depth ? buffer.slice(0, depth) : '' + var output = indent + (this.name || 'top') + ': ' + this.completed() + '\n' + this.trackers.forEach(function (tracker) { + if (tracker instanceof TrackerGroup) { + output += tracker.debug(depth + 1) + } else { + output += indent + ' ' + tracker.name + ': ' + tracker.completed() + '\n' + } + }) + return output +} diff --git a/publisher/node_modules/are-we-there-yet/lib/tracker-stream.js b/publisher/node_modules/are-we-there-yet/lib/tracker-stream.js new file mode 100644 index 00000000..e1cf8505 --- /dev/null +++ b/publisher/node_modules/are-we-there-yet/lib/tracker-stream.js @@ -0,0 +1,36 @@ +'use strict' +var util = require('util') +var stream = require('readable-stream') +var delegate = require('delegates') +var Tracker = require('./tracker.js') + +var TrackerStream = module.exports = function (name, size, options) { + stream.Transform.call(this, options) + this.tracker = new Tracker(name, size) + this.name = name + this.id = this.tracker.id + this.tracker.on('change', delegateChange(this)) +} +util.inherits(TrackerStream, stream.Transform) + +function delegateChange (trackerStream) { + return function (name, completion, tracker) { + trackerStream.emit('change', name, completion, trackerStream) + } +} + +TrackerStream.prototype._transform = function (data, encoding, cb) { + this.tracker.completeWork(data.length ? data.length : 1) + this.push(data) + cb() +} + +TrackerStream.prototype._flush = function (cb) { + this.tracker.finish() + cb() +} + +delegate(TrackerStream.prototype, 'tracker') + .method('completed') + .method('addWork') + .method('finish') diff --git a/publisher/node_modules/are-we-there-yet/lib/tracker.js b/publisher/node_modules/are-we-there-yet/lib/tracker.js new file mode 100644 index 00000000..a8f8b3ba --- /dev/null +++ b/publisher/node_modules/are-we-there-yet/lib/tracker.js @@ -0,0 +1,32 @@ +'use strict' +var util = require('util') +var TrackerBase = require('./tracker-base.js') + +var Tracker = module.exports = function (name, todo) { + TrackerBase.call(this, name) + this.workDone = 0 + this.workTodo = todo || 0 +} +util.inherits(Tracker, TrackerBase) + +Tracker.prototype.completed = function () { + return this.workTodo === 0 ? 0 : this.workDone / this.workTodo +} + +Tracker.prototype.addWork = function (work) { + this.workTodo += work + this.emit('change', this.name, this.completed(), this) +} + +Tracker.prototype.completeWork = function (work) { + this.workDone += work + if (this.workDone > this.workTodo) { + this.workDone = this.workTodo + } + this.emit('change', this.name, this.completed(), this) +} + +Tracker.prototype.finish = function () { + this.workTodo = this.workDone = 1 + this.emit('change', this.name, 1, this) +} diff --git a/publisher/node_modules/are-we-there-yet/package.json b/publisher/node_modules/are-we-there-yet/package.json new file mode 100644 index 00000000..cc3d7504 --- /dev/null +++ b/publisher/node_modules/are-we-there-yet/package.json @@ -0,0 +1,56 @@ +{ + "name": "are-we-there-yet", + "version": "3.0.1", + "description": "Keep track of the overall completion of many disparate processes", + "main": "lib/index.js", + "scripts": { + "test": "tap", + "npmclilint": "npmcli-lint", + "lint": "eslint \"**/*.js\"", + "lintfix": "npm run lint -- --fix", + "posttest": "npm run lint", + "postsnap": "npm run lintfix --", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "snap": "tap", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/are-we-there-yet.git" + }, + "author": "GitHub Inc.", + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/are-we-there-yet/issues" + }, + "homepage": "https://github.com/npm/are-we-there-yet", + "devDependencies": { + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.5.0", + "tap": "^16.0.1" + }, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "files": [ + "bin/", + "lib/" + ], + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + }, + "tap": { + "branches": 68, + "statements": 92, + "functions": 86, + "lines": 92 + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.5.0" + } +} diff --git a/publisher/node_modules/asn1/Jenkinsfile b/publisher/node_modules/asn1/Jenkinsfile new file mode 100644 index 00000000..d1b45937 --- /dev/null +++ b/publisher/node_modules/asn1/Jenkinsfile @@ -0,0 +1,65 @@ +@Library('jenkins-joylib@v1.0.8') _ + +pipeline { + + agent none + + options { + buildDiscarder(logRotator(numToKeepStr: '45')) + timestamps() + } + + stages { + stage('top') { + parallel { + stage('v4-zone') { + agent { + label joyCommonLabels(image_ver: '15.4.1') + } + tools { + nodejs 'sdcnode-v4-zone' + } + stages { + stage('check') { + steps{ + sh('make check') + } + } + stage('test') { + steps{ + sh('make test') + } + } + } + } + + stage('v6-zone64') { + agent { + label joyCommonLabels(image_ver: '18.4.0') + } + tools { + nodejs 'sdcnode-v6-zone64' + } + stages { + stage('check') { + steps{ + sh('make check') + } + } + stage('test') { + steps{ + sh('make test') + } + } + } + } + } + } + } + + post { + always { + joySlackNotifications() + } + } +} diff --git a/publisher/node_modules/asn1/LICENSE b/publisher/node_modules/asn1/LICENSE new file mode 100644 index 00000000..9b5dcdb7 --- /dev/null +++ b/publisher/node_modules/asn1/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2011 Mark Cavage, All rights reserved. + +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 diff --git a/publisher/node_modules/asn1/README.md b/publisher/node_modules/asn1/README.md new file mode 100644 index 00000000..2208210a --- /dev/null +++ b/publisher/node_modules/asn1/README.md @@ -0,0 +1,50 @@ +node-asn1 is a library for encoding and decoding ASN.1 datatypes in pure JS. +Currently BER encoding is supported; at some point I'll likely have to do DER. + +## Usage + +Mostly, if you're *actually* needing to read and write ASN.1, you probably don't +need this readme to explain what and why. If you have no idea what ASN.1 is, +see this: ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc + +The source is pretty much self-explanatory, and has read/write methods for the +common types out there. + +### Decoding + +The following reads an ASN.1 sequence with a boolean. + + var Ber = require('asn1').Ber; + + var reader = new Ber.Reader(Buffer.from([0x30, 0x03, 0x01, 0x01, 0xff])); + + reader.readSequence(); + console.log('Sequence len: ' + reader.length); + if (reader.peek() === Ber.Boolean) + console.log(reader.readBoolean()); + +### Encoding + +The following generates the same payload as above. + + var Ber = require('asn1').Ber; + + var writer = new Ber.Writer(); + + writer.startSequence(); + writer.writeBoolean(true); + writer.endSequence(); + + console.log(writer.buffer); + +## Installation + + npm install asn1 + +## License + +MIT. + +## Bugs + +See . diff --git a/publisher/node_modules/asn1/lib/ber/errors.js b/publisher/node_modules/asn1/lib/ber/errors.js new file mode 100644 index 00000000..4557b8ae --- /dev/null +++ b/publisher/node_modules/asn1/lib/ber/errors.js @@ -0,0 +1,13 @@ +// Copyright 2011 Mark Cavage All rights reserved. + + +module.exports = { + + newInvalidAsn1Error: function (msg) { + var e = new Error(); + e.name = 'InvalidAsn1Error'; + e.message = msg || ''; + return e; + } + +}; diff --git a/publisher/node_modules/asn1/lib/ber/index.js b/publisher/node_modules/asn1/lib/ber/index.js new file mode 100644 index 00000000..387d1326 --- /dev/null +++ b/publisher/node_modules/asn1/lib/ber/index.js @@ -0,0 +1,27 @@ +// Copyright 2011 Mark Cavage All rights reserved. + +var errors = require('./errors'); +var types = require('./types'); + +var Reader = require('./reader'); +var Writer = require('./writer'); + + +// --- Exports + +module.exports = { + + Reader: Reader, + + Writer: Writer + +}; + +for (var t in types) { + if (types.hasOwnProperty(t)) + module.exports[t] = types[t]; +} +for (var e in errors) { + if (errors.hasOwnProperty(e)) + module.exports[e] = errors[e]; +} diff --git a/publisher/node_modules/asn1/lib/ber/reader.js b/publisher/node_modules/asn1/lib/ber/reader.js new file mode 100644 index 00000000..8a7e4ca0 --- /dev/null +++ b/publisher/node_modules/asn1/lib/ber/reader.js @@ -0,0 +1,262 @@ +// Copyright 2011 Mark Cavage All rights reserved. + +var assert = require('assert'); +var Buffer = require('safer-buffer').Buffer; + +var ASN1 = require('./types'); +var errors = require('./errors'); + + +// --- Globals + +var newInvalidAsn1Error = errors.newInvalidAsn1Error; + + + +// --- API + +function Reader(data) { + if (!data || !Buffer.isBuffer(data)) + throw new TypeError('data must be a node Buffer'); + + this._buf = data; + this._size = data.length; + + // These hold the "current" state + this._len = 0; + this._offset = 0; +} + +Object.defineProperty(Reader.prototype, 'length', { + enumerable: true, + get: function () { return (this._len); } +}); + +Object.defineProperty(Reader.prototype, 'offset', { + enumerable: true, + get: function () { return (this._offset); } +}); + +Object.defineProperty(Reader.prototype, 'remain', { + get: function () { return (this._size - this._offset); } +}); + +Object.defineProperty(Reader.prototype, 'buffer', { + get: function () { return (this._buf.slice(this._offset)); } +}); + + +/** + * Reads a single byte and advances offset; you can pass in `true` to make this + * a "peek" operation (i.e., get the byte, but don't advance the offset). + * + * @param {Boolean} peek true means don't move offset. + * @return {Number} the next byte, null if not enough data. + */ +Reader.prototype.readByte = function (peek) { + if (this._size - this._offset < 1) + return null; + + var b = this._buf[this._offset] & 0xff; + + if (!peek) + this._offset += 1; + + return b; +}; + + +Reader.prototype.peek = function () { + return this.readByte(true); +}; + + +/** + * Reads a (potentially) variable length off the BER buffer. This call is + * not really meant to be called directly, as callers have to manipulate + * the internal buffer afterwards. + * + * As a result of this call, you can call `Reader.length`, until the + * next thing called that does a readLength. + * + * @return {Number} the amount of offset to advance the buffer. + * @throws {InvalidAsn1Error} on bad ASN.1 + */ +Reader.prototype.readLength = function (offset) { + if (offset === undefined) + offset = this._offset; + + if (offset >= this._size) + return null; + + var lenB = this._buf[offset++] & 0xff; + if (lenB === null) + return null; + + if ((lenB & 0x80) === 0x80) { + lenB &= 0x7f; + + if (lenB === 0) + throw newInvalidAsn1Error('Indefinite length not supported'); + + if (lenB > 4) + throw newInvalidAsn1Error('encoding too long'); + + if (this._size - offset < lenB) + return null; + + this._len = 0; + for (var i = 0; i < lenB; i++) + this._len = (this._len << 8) + (this._buf[offset++] & 0xff); + + } else { + // Wasn't a variable length + this._len = lenB; + } + + return offset; +}; + + +/** + * Parses the next sequence in this BER buffer. + * + * To get the length of the sequence, call `Reader.length`. + * + * @return {Number} the sequence's tag. + */ +Reader.prototype.readSequence = function (tag) { + var seq = this.peek(); + if (seq === null) + return null; + if (tag !== undefined && tag !== seq) + throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + + ': got 0x' + seq.toString(16)); + + var o = this.readLength(this._offset + 1); // stored in `length` + if (o === null) + return null; + + this._offset = o; + return seq; +}; + + +Reader.prototype.readInt = function () { + return this._readTag(ASN1.Integer); +}; + + +Reader.prototype.readBoolean = function () { + return (this._readTag(ASN1.Boolean) === 0 ? false : true); +}; + + +Reader.prototype.readEnumeration = function () { + return this._readTag(ASN1.Enumeration); +}; + + +Reader.prototype.readString = function (tag, retbuf) { + if (!tag) + tag = ASN1.OctetString; + + var b = this.peek(); + if (b === null) + return null; + + if (b !== tag) + throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + + ': got 0x' + b.toString(16)); + + var o = this.readLength(this._offset + 1); // stored in `length` + + if (o === null) + return null; + + if (this.length > this._size - o) + return null; + + this._offset = o; + + if (this.length === 0) + return retbuf ? Buffer.alloc(0) : ''; + + var str = this._buf.slice(this._offset, this._offset + this.length); + this._offset += this.length; + + return retbuf ? str : str.toString('utf8'); +}; + +Reader.prototype.readOID = function (tag) { + if (!tag) + tag = ASN1.OID; + + var b = this.readString(tag, true); + if (b === null) + return null; + + var values = []; + var value = 0; + + for (var i = 0; i < b.length; i++) { + var byte = b[i] & 0xff; + + value <<= 7; + value += byte & 0x7f; + if ((byte & 0x80) === 0) { + values.push(value); + value = 0; + } + } + + value = values.shift(); + values.unshift(value % 40); + values.unshift((value / 40) >> 0); + + return values.join('.'); +}; + + +Reader.prototype._readTag = function (tag) { + assert.ok(tag !== undefined); + + var b = this.peek(); + + if (b === null) + return null; + + if (b !== tag) + throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + + ': got 0x' + b.toString(16)); + + var o = this.readLength(this._offset + 1); // stored in `length` + if (o === null) + return null; + + if (this.length > 4) + throw newInvalidAsn1Error('Integer too long: ' + this.length); + + if (this.length > this._size - o) + return null; + this._offset = o; + + var fb = this._buf[this._offset]; + var value = 0; + + for (var i = 0; i < this.length; i++) { + value <<= 8; + value |= (this._buf[this._offset++] & 0xff); + } + + if ((fb & 0x80) === 0x80 && i !== 4) + value -= (1 << (i * 8)); + + return value >> 0; +}; + + + +// --- Exported API + +module.exports = Reader; diff --git a/publisher/node_modules/asn1/lib/ber/types.js b/publisher/node_modules/asn1/lib/ber/types.js new file mode 100644 index 00000000..8aea0001 --- /dev/null +++ b/publisher/node_modules/asn1/lib/ber/types.js @@ -0,0 +1,36 @@ +// Copyright 2011 Mark Cavage All rights reserved. + + +module.exports = { + EOC: 0, + Boolean: 1, + Integer: 2, + BitString: 3, + OctetString: 4, + Null: 5, + OID: 6, + ObjectDescriptor: 7, + External: 8, + Real: 9, // float + Enumeration: 10, + PDV: 11, + Utf8String: 12, + RelativeOID: 13, + Sequence: 16, + Set: 17, + NumericString: 18, + PrintableString: 19, + T61String: 20, + VideotexString: 21, + IA5String: 22, + UTCTime: 23, + GeneralizedTime: 24, + GraphicString: 25, + VisibleString: 26, + GeneralString: 28, + UniversalString: 29, + CharacterString: 30, + BMPString: 31, + Constructor: 32, + Context: 128 +}; diff --git a/publisher/node_modules/asn1/lib/ber/writer.js b/publisher/node_modules/asn1/lib/ber/writer.js new file mode 100644 index 00000000..3515acf7 --- /dev/null +++ b/publisher/node_modules/asn1/lib/ber/writer.js @@ -0,0 +1,317 @@ +// Copyright 2011 Mark Cavage All rights reserved. + +var assert = require('assert'); +var Buffer = require('safer-buffer').Buffer; +var ASN1 = require('./types'); +var errors = require('./errors'); + + +// --- Globals + +var newInvalidAsn1Error = errors.newInvalidAsn1Error; + +var DEFAULT_OPTS = { + size: 1024, + growthFactor: 8 +}; + + +// --- Helpers + +function merge(from, to) { + assert.ok(from); + assert.equal(typeof (from), 'object'); + assert.ok(to); + assert.equal(typeof (to), 'object'); + + var keys = Object.getOwnPropertyNames(from); + keys.forEach(function (key) { + if (to[key]) + return; + + var value = Object.getOwnPropertyDescriptor(from, key); + Object.defineProperty(to, key, value); + }); + + return to; +} + + + +// --- API + +function Writer(options) { + options = merge(DEFAULT_OPTS, options || {}); + + this._buf = Buffer.alloc(options.size || 1024); + this._size = this._buf.length; + this._offset = 0; + this._options = options; + + // A list of offsets in the buffer where we need to insert + // sequence tag/len pairs. + this._seq = []; +} + +Object.defineProperty(Writer.prototype, 'buffer', { + get: function () { + if (this._seq.length) + throw newInvalidAsn1Error(this._seq.length + ' unended sequence(s)'); + + return (this._buf.slice(0, this._offset)); + } +}); + +Writer.prototype.writeByte = function (b) { + if (typeof (b) !== 'number') + throw new TypeError('argument must be a Number'); + + this._ensure(1); + this._buf[this._offset++] = b; +}; + + +Writer.prototype.writeInt = function (i, tag) { + if (typeof (i) !== 'number') + throw new TypeError('argument must be a Number'); + if (typeof (tag) !== 'number') + tag = ASN1.Integer; + + var sz = 4; + + while ((((i & 0xff800000) === 0) || ((i & 0xff800000) === 0xff800000 >> 0)) && + (sz > 1)) { + sz--; + i <<= 8; + } + + if (sz > 4) + throw newInvalidAsn1Error('BER ints cannot be > 0xffffffff'); + + this._ensure(2 + sz); + this._buf[this._offset++] = tag; + this._buf[this._offset++] = sz; + + while (sz-- > 0) { + this._buf[this._offset++] = ((i & 0xff000000) >>> 24); + i <<= 8; + } + +}; + + +Writer.prototype.writeNull = function () { + this.writeByte(ASN1.Null); + this.writeByte(0x00); +}; + + +Writer.prototype.writeEnumeration = function (i, tag) { + if (typeof (i) !== 'number') + throw new TypeError('argument must be a Number'); + if (typeof (tag) !== 'number') + tag = ASN1.Enumeration; + + return this.writeInt(i, tag); +}; + + +Writer.prototype.writeBoolean = function (b, tag) { + if (typeof (b) !== 'boolean') + throw new TypeError('argument must be a Boolean'); + if (typeof (tag) !== 'number') + tag = ASN1.Boolean; + + this._ensure(3); + this._buf[this._offset++] = tag; + this._buf[this._offset++] = 0x01; + this._buf[this._offset++] = b ? 0xff : 0x00; +}; + + +Writer.prototype.writeString = function (s, tag) { + if (typeof (s) !== 'string') + throw new TypeError('argument must be a string (was: ' + typeof (s) + ')'); + if (typeof (tag) !== 'number') + tag = ASN1.OctetString; + + var len = Buffer.byteLength(s); + this.writeByte(tag); + this.writeLength(len); + if (len) { + this._ensure(len); + this._buf.write(s, this._offset); + this._offset += len; + } +}; + + +Writer.prototype.writeBuffer = function (buf, tag) { + if (typeof (tag) !== 'number') + throw new TypeError('tag must be a number'); + if (!Buffer.isBuffer(buf)) + throw new TypeError('argument must be a buffer'); + + this.writeByte(tag); + this.writeLength(buf.length); + this._ensure(buf.length); + buf.copy(this._buf, this._offset, 0, buf.length); + this._offset += buf.length; +}; + + +Writer.prototype.writeStringArray = function (strings) { + if ((!strings instanceof Array)) + throw new TypeError('argument must be an Array[String]'); + + var self = this; + strings.forEach(function (s) { + self.writeString(s); + }); +}; + +// This is really to solve DER cases, but whatever for now +Writer.prototype.writeOID = function (s, tag) { + if (typeof (s) !== 'string') + throw new TypeError('argument must be a string'); + if (typeof (tag) !== 'number') + tag = ASN1.OID; + + if (!/^([0-9]+\.){3,}[0-9]+$/.test(s)) + throw new Error('argument is not a valid OID string'); + + function encodeOctet(bytes, octet) { + if (octet < 128) { + bytes.push(octet); + } else if (octet < 16384) { + bytes.push((octet >>> 7) | 0x80); + bytes.push(octet & 0x7F); + } else if (octet < 2097152) { + bytes.push((octet >>> 14) | 0x80); + bytes.push(((octet >>> 7) | 0x80) & 0xFF); + bytes.push(octet & 0x7F); + } else if (octet < 268435456) { + bytes.push((octet >>> 21) | 0x80); + bytes.push(((octet >>> 14) | 0x80) & 0xFF); + bytes.push(((octet >>> 7) | 0x80) & 0xFF); + bytes.push(octet & 0x7F); + } else { + bytes.push(((octet >>> 28) | 0x80) & 0xFF); + bytes.push(((octet >>> 21) | 0x80) & 0xFF); + bytes.push(((octet >>> 14) | 0x80) & 0xFF); + bytes.push(((octet >>> 7) | 0x80) & 0xFF); + bytes.push(octet & 0x7F); + } + } + + var tmp = s.split('.'); + var bytes = []; + bytes.push(parseInt(tmp[0], 10) * 40 + parseInt(tmp[1], 10)); + tmp.slice(2).forEach(function (b) { + encodeOctet(bytes, parseInt(b, 10)); + }); + + var self = this; + this._ensure(2 + bytes.length); + this.writeByte(tag); + this.writeLength(bytes.length); + bytes.forEach(function (b) { + self.writeByte(b); + }); +}; + + +Writer.prototype.writeLength = function (len) { + if (typeof (len) !== 'number') + throw new TypeError('argument must be a Number'); + + this._ensure(4); + + if (len <= 0x7f) { + this._buf[this._offset++] = len; + } else if (len <= 0xff) { + this._buf[this._offset++] = 0x81; + this._buf[this._offset++] = len; + } else if (len <= 0xffff) { + this._buf[this._offset++] = 0x82; + this._buf[this._offset++] = len >> 8; + this._buf[this._offset++] = len; + } else if (len <= 0xffffff) { + this._buf[this._offset++] = 0x83; + this._buf[this._offset++] = len >> 16; + this._buf[this._offset++] = len >> 8; + this._buf[this._offset++] = len; + } else { + throw newInvalidAsn1Error('Length too long (> 4 bytes)'); + } +}; + +Writer.prototype.startSequence = function (tag) { + if (typeof (tag) !== 'number') + tag = ASN1.Sequence | ASN1.Constructor; + + this.writeByte(tag); + this._seq.push(this._offset); + this._ensure(3); + this._offset += 3; +}; + + +Writer.prototype.endSequence = function () { + var seq = this._seq.pop(); + var start = seq + 3; + var len = this._offset - start; + + if (len <= 0x7f) { + this._shift(start, len, -2); + this._buf[seq] = len; + } else if (len <= 0xff) { + this._shift(start, len, -1); + this._buf[seq] = 0x81; + this._buf[seq + 1] = len; + } else if (len <= 0xffff) { + this._buf[seq] = 0x82; + this._buf[seq + 1] = len >> 8; + this._buf[seq + 2] = len; + } else if (len <= 0xffffff) { + this._shift(start, len, 1); + this._buf[seq] = 0x83; + this._buf[seq + 1] = len >> 16; + this._buf[seq + 2] = len >> 8; + this._buf[seq + 3] = len; + } else { + throw newInvalidAsn1Error('Sequence too long'); + } +}; + + +Writer.prototype._shift = function (start, len, shift) { + assert.ok(start !== undefined); + assert.ok(len !== undefined); + assert.ok(shift); + + this._buf.copy(this._buf, start + shift, start, start + len); + this._offset += shift; +}; + +Writer.prototype._ensure = function (len) { + assert.ok(len); + + if (this._size - this._offset < len) { + var sz = this._size * this._options.growthFactor; + if (sz - this._offset < len) + sz += len; + + var buf = Buffer.alloc(sz); + + this._buf.copy(buf, 0, 0, this._offset); + this._buf = buf; + this._size = sz; + } +}; + + + +// --- Exported API + +module.exports = Writer; diff --git a/publisher/node_modules/asn1/lib/index.js b/publisher/node_modules/asn1/lib/index.js new file mode 100644 index 00000000..ede3ab23 --- /dev/null +++ b/publisher/node_modules/asn1/lib/index.js @@ -0,0 +1,20 @@ +// Copyright 2011 Mark Cavage All rights reserved. + +// If you have no idea what ASN.1 or BER is, see this: +// ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc + +var Ber = require('./ber/index'); + + + +// --- Exported API + +module.exports = { + + Ber: Ber, + + BerReader: Ber.Reader, + + BerWriter: Ber.Writer + +}; diff --git a/publisher/node_modules/asn1/package.json b/publisher/node_modules/asn1/package.json new file mode 100644 index 00000000..e31cce5e --- /dev/null +++ b/publisher/node_modules/asn1/package.json @@ -0,0 +1,31 @@ +{ + "author": "Joyent (joyent.com)", + "contributors": [ + "Mark Cavage ", + "David Gwynne ", + "Yunong Xiao ", + "Alex Wilson " + ], + "name": "asn1", + "description": "Contains parsers and serializers for ASN.1 (currently BER only)", + "version": "0.2.6", + "repository": { + "type": "git", + "url": "https://github.com/joyent/node-asn1.git" + }, + "main": "lib/index.js", + "dependencies": { + "safer-buffer": "~2.1.0" + }, + "devDependencies": { + "istanbul": "^0.3.6", + "faucet": "0.0.1", + "tape": "^3.5.0", + "eslint": "2.13.1", + "eslint-plugin-joyent": "~1.3.0" + }, + "scripts": { + "test": "./node_modules/.bin/tape ./test/ber/*.test.js" + }, + "license": "MIT" +} diff --git a/publisher/node_modules/assert-plus/AUTHORS b/publisher/node_modules/assert-plus/AUTHORS new file mode 100644 index 00000000..1923524f --- /dev/null +++ b/publisher/node_modules/assert-plus/AUTHORS @@ -0,0 +1,6 @@ +Dave Eddy +Fred Kuo +Lars-Magnus Skog +Mark Cavage +Patrick Mooney +Rob Gulewich diff --git a/publisher/node_modules/assert-plus/CHANGES.md b/publisher/node_modules/assert-plus/CHANGES.md new file mode 100644 index 00000000..57d92bfd --- /dev/null +++ b/publisher/node_modules/assert-plus/CHANGES.md @@ -0,0 +1,14 @@ +# assert-plus Changelog + +## 1.0.0 + +- *BREAKING* assert.number (and derivatives) now accept Infinity as valid input +- Add assert.finite check. Previous assert.number callers should use this if + they expect Infinity inputs to throw. + +## 0.2.0 + +- Fix `assert.object(null)` so it throws +- Fix optional/arrayOf exports for non-type-of asserts +- Add optiona/arrayOf exports for Stream/Date/Regex/uuid +- Add basic unit test coverage diff --git a/publisher/node_modules/assert-plus/README.md b/publisher/node_modules/assert-plus/README.md new file mode 100644 index 00000000..ec200d16 --- /dev/null +++ b/publisher/node_modules/assert-plus/README.md @@ -0,0 +1,162 @@ +# assert-plus + +This library is a super small wrapper over node's assert module that has two +things: (1) the ability to disable assertions with the environment variable +NODE\_NDEBUG, and (2) some API wrappers for argument testing. Like +`assert.string(myArg, 'myArg')`. As a simple example, most of my code looks +like this: + +```javascript + var assert = require('assert-plus'); + + function fooAccount(options, callback) { + assert.object(options, 'options'); + assert.number(options.id, 'options.id'); + assert.bool(options.isManager, 'options.isManager'); + assert.string(options.name, 'options.name'); + assert.arrayOfString(options.email, 'options.email'); + assert.func(callback, 'callback'); + + // Do stuff + callback(null, {}); + } +``` + +# API + +All methods that *aren't* part of node's core assert API are simply assumed to +take an argument, and then a string 'name' that's not a message; `AssertionError` +will be thrown if the assertion fails with a message like: + + AssertionError: foo (string) is required + at test (/home/mark/work/foo/foo.js:3:9) + at Object. (/home/mark/work/foo/foo.js:15:1) + at Module._compile (module.js:446:26) + at Object..js (module.js:464:10) + at Module.load (module.js:353:31) + at Function._load (module.js:311:12) + at Array.0 (module.js:484:10) + at EventEmitter._tickCallback (node.js:190:38) + +from: + +```javascript + function test(foo) { + assert.string(foo, 'foo'); + } +``` + +There you go. You can check that arrays are of a homogeneous type with `Arrayof$Type`: + +```javascript + function test(foo) { + assert.arrayOfString(foo, 'foo'); + } +``` + +You can assert IFF an argument is not `undefined` (i.e., an optional arg): + +```javascript + assert.optionalString(foo, 'foo'); +``` + +Lastly, you can opt-out of assertion checking altogether by setting the +environment variable `NODE_NDEBUG=1`. This is pseudo-useful if you have +lots of assertions, and don't want to pay `typeof ()` taxes to v8 in +production. Be advised: The standard functions re-exported from `assert` are +also disabled in assert-plus if NDEBUG is specified. Using them directly from +the `assert` module avoids this behavior. + +The complete list of APIs is: + +* assert.array +* assert.bool +* assert.buffer +* assert.func +* assert.number +* assert.finite +* assert.object +* assert.string +* assert.stream +* assert.date +* assert.regexp +* assert.uuid +* assert.arrayOfArray +* assert.arrayOfBool +* assert.arrayOfBuffer +* assert.arrayOfFunc +* assert.arrayOfNumber +* assert.arrayOfFinite +* assert.arrayOfObject +* assert.arrayOfString +* assert.arrayOfStream +* assert.arrayOfDate +* assert.arrayOfRegexp +* assert.arrayOfUuid +* assert.optionalArray +* assert.optionalBool +* assert.optionalBuffer +* assert.optionalFunc +* assert.optionalNumber +* assert.optionalFinite +* assert.optionalObject +* assert.optionalString +* assert.optionalStream +* assert.optionalDate +* assert.optionalRegexp +* assert.optionalUuid +* assert.optionalArrayOfArray +* assert.optionalArrayOfBool +* assert.optionalArrayOfBuffer +* assert.optionalArrayOfFunc +* assert.optionalArrayOfNumber +* assert.optionalArrayOfFinite +* assert.optionalArrayOfObject +* assert.optionalArrayOfString +* assert.optionalArrayOfStream +* assert.optionalArrayOfDate +* assert.optionalArrayOfRegexp +* assert.optionalArrayOfUuid +* assert.AssertionError +* assert.fail +* assert.ok +* assert.equal +* assert.notEqual +* assert.deepEqual +* assert.notDeepEqual +* assert.strictEqual +* assert.notStrictEqual +* assert.throws +* assert.doesNotThrow +* assert.ifError + +# Installation + + npm install assert-plus + +## License + +The MIT License (MIT) +Copyright (c) 2012 Mark Cavage + +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. + +## Bugs + +See . diff --git a/publisher/node_modules/assert-plus/assert.js b/publisher/node_modules/assert-plus/assert.js new file mode 100644 index 00000000..26f944ee --- /dev/null +++ b/publisher/node_modules/assert-plus/assert.js @@ -0,0 +1,211 @@ +// Copyright (c) 2012, Mark Cavage. All rights reserved. +// Copyright 2015 Joyent, Inc. + +var assert = require('assert'); +var Stream = require('stream').Stream; +var util = require('util'); + + +///--- Globals + +/* JSSTYLED */ +var UUID_REGEXP = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/; + + +///--- Internal + +function _capitalize(str) { + return (str.charAt(0).toUpperCase() + str.slice(1)); +} + +function _toss(name, expected, oper, arg, actual) { + throw new assert.AssertionError({ + message: util.format('%s (%s) is required', name, expected), + actual: (actual === undefined) ? typeof (arg) : actual(arg), + expected: expected, + operator: oper || '===', + stackStartFunction: _toss.caller + }); +} + +function _getClass(arg) { + return (Object.prototype.toString.call(arg).slice(8, -1)); +} + +function noop() { + // Why even bother with asserts? +} + + +///--- Exports + +var types = { + bool: { + check: function (arg) { return typeof (arg) === 'boolean'; } + }, + func: { + check: function (arg) { return typeof (arg) === 'function'; } + }, + string: { + check: function (arg) { return typeof (arg) === 'string'; } + }, + object: { + check: function (arg) { + return typeof (arg) === 'object' && arg !== null; + } + }, + number: { + check: function (arg) { + return typeof (arg) === 'number' && !isNaN(arg); + } + }, + finite: { + check: function (arg) { + return typeof (arg) === 'number' && !isNaN(arg) && isFinite(arg); + } + }, + buffer: { + check: function (arg) { return Buffer.isBuffer(arg); }, + operator: 'Buffer.isBuffer' + }, + array: { + check: function (arg) { return Array.isArray(arg); }, + operator: 'Array.isArray' + }, + stream: { + check: function (arg) { return arg instanceof Stream; }, + operator: 'instanceof', + actual: _getClass + }, + date: { + check: function (arg) { return arg instanceof Date; }, + operator: 'instanceof', + actual: _getClass + }, + regexp: { + check: function (arg) { return arg instanceof RegExp; }, + operator: 'instanceof', + actual: _getClass + }, + uuid: { + check: function (arg) { + return typeof (arg) === 'string' && UUID_REGEXP.test(arg); + }, + operator: 'isUUID' + } +}; + +function _setExports(ndebug) { + var keys = Object.keys(types); + var out; + + /* re-export standard assert */ + if (process.env.NODE_NDEBUG) { + out = noop; + } else { + out = function (arg, msg) { + if (!arg) { + _toss(msg, 'true', arg); + } + }; + } + + /* standard checks */ + keys.forEach(function (k) { + if (ndebug) { + out[k] = noop; + return; + } + var type = types[k]; + out[k] = function (arg, msg) { + if (!type.check(arg)) { + _toss(msg, k, type.operator, arg, type.actual); + } + }; + }); + + /* optional checks */ + keys.forEach(function (k) { + var name = 'optional' + _capitalize(k); + if (ndebug) { + out[name] = noop; + return; + } + var type = types[k]; + out[name] = function (arg, msg) { + if (arg === undefined || arg === null) { + return; + } + if (!type.check(arg)) { + _toss(msg, k, type.operator, arg, type.actual); + } + }; + }); + + /* arrayOf checks */ + keys.forEach(function (k) { + var name = 'arrayOf' + _capitalize(k); + if (ndebug) { + out[name] = noop; + return; + } + var type = types[k]; + var expected = '[' + k + ']'; + out[name] = function (arg, msg) { + if (!Array.isArray(arg)) { + _toss(msg, expected, type.operator, arg, type.actual); + } + var i; + for (i = 0; i < arg.length; i++) { + if (!type.check(arg[i])) { + _toss(msg, expected, type.operator, arg, type.actual); + } + } + }; + }); + + /* optionalArrayOf checks */ + keys.forEach(function (k) { + var name = 'optionalArrayOf' + _capitalize(k); + if (ndebug) { + out[name] = noop; + return; + } + var type = types[k]; + var expected = '[' + k + ']'; + out[name] = function (arg, msg) { + if (arg === undefined || arg === null) { + return; + } + if (!Array.isArray(arg)) { + _toss(msg, expected, type.operator, arg, type.actual); + } + var i; + for (i = 0; i < arg.length; i++) { + if (!type.check(arg[i])) { + _toss(msg, expected, type.operator, arg, type.actual); + } + } + }; + }); + + /* re-export built-in assertions */ + Object.keys(assert).forEach(function (k) { + if (k === 'AssertionError') { + out[k] = assert[k]; + return; + } + if (ndebug) { + out[k] = noop; + return; + } + out[k] = assert[k]; + }); + + /* export ourselves (for unit tests _only_) */ + out._setExports = _setExports; + + return out; +} + +module.exports = _setExports(process.env.NODE_NDEBUG); diff --git a/publisher/node_modules/assert-plus/package.json b/publisher/node_modules/assert-plus/package.json new file mode 100644 index 00000000..40d6a5cd --- /dev/null +++ b/publisher/node_modules/assert-plus/package.json @@ -0,0 +1,23 @@ +{ + "author": "Mark Cavage ", + "name": "assert-plus", + "description": "Extra assertions on top of node's assert module", + "version": "1.0.0", + "license": "MIT", + "main": "./assert.js", + "devDependencies": { + "tape": "4.2.2", + "faucet": "0.0.1" + }, + "optionalDependencies": {}, + "scripts": { + "test": "./node_modules/.bin/tape tests/*.js | ./node_modules/.bin/faucet" + }, + "repository": { + "type": "git", + "url": "https://github.com/mcavage/node-assert-plus.git" + }, + "engines": { + "node": ">=0.8" + } +} diff --git a/publisher/node_modules/asynckit/LICENSE b/publisher/node_modules/asynckit/LICENSE new file mode 100644 index 00000000..c9eca5dd --- /dev/null +++ b/publisher/node_modules/asynckit/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Alex Indigo + +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. diff --git a/publisher/node_modules/asynckit/README.md b/publisher/node_modules/asynckit/README.md new file mode 100644 index 00000000..ddcc7e6b --- /dev/null +++ b/publisher/node_modules/asynckit/README.md @@ -0,0 +1,233 @@ +# asynckit [![NPM Module](https://img.shields.io/npm/v/asynckit.svg?style=flat)](https://www.npmjs.com/package/asynckit) + +Minimal async jobs utility library, with streams support. + +[![PhantomJS Build](https://img.shields.io/travis/alexindigo/asynckit/v0.4.0.svg?label=browser&style=flat)](https://travis-ci.org/alexindigo/asynckit) +[![Linux Build](https://img.shields.io/travis/alexindigo/asynckit/v0.4.0.svg?label=linux:0.12-6.x&style=flat)](https://travis-ci.org/alexindigo/asynckit) +[![Windows Build](https://img.shields.io/appveyor/ci/alexindigo/asynckit/v0.4.0.svg?label=windows:0.12-6.x&style=flat)](https://ci.appveyor.com/project/alexindigo/asynckit) + +[![Coverage Status](https://img.shields.io/coveralls/alexindigo/asynckit/v0.4.0.svg?label=code+coverage&style=flat)](https://coveralls.io/github/alexindigo/asynckit?branch=master) +[![Dependency Status](https://img.shields.io/david/alexindigo/asynckit/v0.4.0.svg?style=flat)](https://david-dm.org/alexindigo/asynckit) +[![bitHound Overall Score](https://www.bithound.io/github/alexindigo/asynckit/badges/score.svg)](https://www.bithound.io/github/alexindigo/asynckit) + + + +AsyncKit provides harness for `parallel` and `serial` iterators over list of items represented by arrays or objects. +Optionally it accepts abort function (should be synchronously return by iterator for each item), and terminates left over jobs upon an error event. For specific iteration order built-in (`ascending` and `descending`) and custom sort helpers also supported, via `asynckit.serialOrdered` method. + +It ensures async operations to keep behavior more stable and prevent `Maximum call stack size exceeded` errors, from sync iterators. + +| compression | size | +| :----------------- | -------: | +| asynckit.js | 12.34 kB | +| asynckit.min.js | 4.11 kB | +| asynckit.min.js.gz | 1.47 kB | + + +## Install + +```sh +$ npm install --save asynckit +``` + +## Examples + +### Parallel Jobs + +Runs iterator over provided array in parallel. Stores output in the `result` array, +on the matching positions. In unlikely event of an error from one of the jobs, +will terminate rest of the active jobs (if abort function is provided) +and return error along with salvaged data to the main callback function. + +#### Input Array + +```javascript +var parallel = require('asynckit').parallel + , assert = require('assert') + ; + +var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ] + , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ] + , expectedTarget = [ 1, 1, 2, 4, 8, 16, 32, 64 ] + , target = [] + ; + +parallel(source, asyncJob, function(err, result) +{ + assert.deepEqual(result, expectedResult); + assert.deepEqual(target, expectedTarget); +}); + +// async job accepts one element from the array +// and a callback function +function asyncJob(item, cb) +{ + // different delays (in ms) per item + var delay = item * 25; + + // pretend different jobs take different time to finish + // and not in consequential order + var timeoutId = setTimeout(function() { + target.push(item); + cb(null, item * 2); + }, delay); + + // allow to cancel "leftover" jobs upon error + // return function, invoking of which will abort this job + return clearTimeout.bind(null, timeoutId); +} +``` + +More examples could be found in [test/test-parallel-array.js](test/test-parallel-array.js). + +#### Input Object + +Also it supports named jobs, listed via object. + +```javascript +var parallel = require('asynckit/parallel') + , assert = require('assert') + ; + +var source = { first: 1, one: 1, four: 4, sixteen: 16, sixtyFour: 64, thirtyTwo: 32, eight: 8, two: 2 } + , expectedResult = { first: 2, one: 2, four: 8, sixteen: 32, sixtyFour: 128, thirtyTwo: 64, eight: 16, two: 4 } + , expectedTarget = [ 1, 1, 2, 4, 8, 16, 32, 64 ] + , expectedKeys = [ 'first', 'one', 'two', 'four', 'eight', 'sixteen', 'thirtyTwo', 'sixtyFour' ] + , target = [] + , keys = [] + ; + +parallel(source, asyncJob, function(err, result) +{ + assert.deepEqual(result, expectedResult); + assert.deepEqual(target, expectedTarget); + assert.deepEqual(keys, expectedKeys); +}); + +// supports full value, key, callback (shortcut) interface +function asyncJob(item, key, cb) +{ + // different delays (in ms) per item + var delay = item * 25; + + // pretend different jobs take different time to finish + // and not in consequential order + var timeoutId = setTimeout(function() { + keys.push(key); + target.push(item); + cb(null, item * 2); + }, delay); + + // allow to cancel "leftover" jobs upon error + // return function, invoking of which will abort this job + return clearTimeout.bind(null, timeoutId); +} +``` + +More examples could be found in [test/test-parallel-object.js](test/test-parallel-object.js). + +### Serial Jobs + +Runs iterator over provided array sequentially. Stores output in the `result` array, +on the matching positions. In unlikely event of an error from one of the jobs, +will not proceed to the rest of the items in the list +and return error along with salvaged data to the main callback function. + +#### Input Array + +```javascript +var serial = require('asynckit/serial') + , assert = require('assert') + ; + +var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ] + , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ] + , expectedTarget = [ 0, 1, 2, 3, 4, 5, 6, 7 ] + , target = [] + ; + +serial(source, asyncJob, function(err, result) +{ + assert.deepEqual(result, expectedResult); + assert.deepEqual(target, expectedTarget); +}); + +// extended interface (item, key, callback) +// also supported for arrays +function asyncJob(item, key, cb) +{ + target.push(key); + + // it will be automatically made async + // even it iterator "returns" in the same event loop + cb(null, item * 2); +} +``` + +More examples could be found in [test/test-serial-array.js](test/test-serial-array.js). + +#### Input Object + +Also it supports named jobs, listed via object. + +```javascript +var serial = require('asynckit').serial + , assert = require('assert') + ; + +var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ] + , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ] + , expectedTarget = [ 0, 1, 2, 3, 4, 5, 6, 7 ] + , target = [] + ; + +var source = { first: 1, one: 1, four: 4, sixteen: 16, sixtyFour: 64, thirtyTwo: 32, eight: 8, two: 2 } + , expectedResult = { first: 2, one: 2, four: 8, sixteen: 32, sixtyFour: 128, thirtyTwo: 64, eight: 16, two: 4 } + , expectedTarget = [ 1, 1, 4, 16, 64, 32, 8, 2 ] + , target = [] + ; + + +serial(source, asyncJob, function(err, result) +{ + assert.deepEqual(result, expectedResult); + assert.deepEqual(target, expectedTarget); +}); + +// shortcut interface (item, callback) +// works for object as well as for the arrays +function asyncJob(item, cb) +{ + target.push(item); + + // it will be automatically made async + // even it iterator "returns" in the same event loop + cb(null, item * 2); +} +``` + +More examples could be found in [test/test-serial-object.js](test/test-serial-object.js). + +_Note: Since _object_ is an _unordered_ collection of properties, +it may produce unexpected results with sequential iterations. +Whenever order of the jobs' execution is important please use `serialOrdered` method._ + +### Ordered Serial Iterations + +TBD + +For example [compare-property](compare-property) package. + +### Streaming interface + +TBD + +## Want to Know More? + +More examples can be found in [test folder](test/). + +Or open an [issue](https://github.com/alexindigo/asynckit/issues) with questions and/or suggestions. + +## License + +AsyncKit is licensed under the MIT license. diff --git a/publisher/node_modules/asynckit/bench.js b/publisher/node_modules/asynckit/bench.js new file mode 100644 index 00000000..c612f1a5 --- /dev/null +++ b/publisher/node_modules/asynckit/bench.js @@ -0,0 +1,76 @@ +/* eslint no-console: "off" */ + +var asynckit = require('./') + , async = require('async') + , assert = require('assert') + , expected = 0 + ; + +var Benchmark = require('benchmark'); +var suite = new Benchmark.Suite; + +var source = []; +for (var z = 1; z < 100; z++) +{ + source.push(z); + expected += z; +} + +suite +// add tests + +.add('async.map', function(deferred) +{ + var total = 0; + + async.map(source, + function(i, cb) + { + setImmediate(function() + { + total += i; + cb(null, total); + }); + }, + function(err, result) + { + assert.ifError(err); + assert.equal(result[result.length - 1], expected); + deferred.resolve(); + }); +}, {'defer': true}) + + +.add('asynckit.parallel', function(deferred) +{ + var total = 0; + + asynckit.parallel(source, + function(i, cb) + { + setImmediate(function() + { + total += i; + cb(null, total); + }); + }, + function(err, result) + { + assert.ifError(err); + assert.equal(result[result.length - 1], expected); + deferred.resolve(); + }); +}, {'defer': true}) + + +// add listeners +.on('cycle', function(ev) +{ + console.log(String(ev.target)); +}) +.on('complete', function() +{ + console.log('Fastest is ' + this.filter('fastest').map('name')); +}) +// run async +.run({ 'async': true }); diff --git a/publisher/node_modules/asynckit/index.js b/publisher/node_modules/asynckit/index.js new file mode 100644 index 00000000..455f9454 --- /dev/null +++ b/publisher/node_modules/asynckit/index.js @@ -0,0 +1,6 @@ +module.exports = +{ + parallel : require('./parallel.js'), + serial : require('./serial.js'), + serialOrdered : require('./serialOrdered.js') +}; diff --git a/publisher/node_modules/asynckit/lib/abort.js b/publisher/node_modules/asynckit/lib/abort.js new file mode 100644 index 00000000..114367e5 --- /dev/null +++ b/publisher/node_modules/asynckit/lib/abort.js @@ -0,0 +1,29 @@ +// API +module.exports = abort; + +/** + * Aborts leftover active jobs + * + * @param {object} state - current state object + */ +function abort(state) +{ + Object.keys(state.jobs).forEach(clean.bind(state)); + + // reset leftover jobs + state.jobs = {}; +} + +/** + * Cleans up leftover job by invoking abort function for the provided job id + * + * @this state + * @param {string|number} key - job id to abort + */ +function clean(key) +{ + if (typeof this.jobs[key] == 'function') + { + this.jobs[key](); + } +} diff --git a/publisher/node_modules/asynckit/lib/async.js b/publisher/node_modules/asynckit/lib/async.js new file mode 100644 index 00000000..7f1288a4 --- /dev/null +++ b/publisher/node_modules/asynckit/lib/async.js @@ -0,0 +1,34 @@ +var defer = require('./defer.js'); + +// API +module.exports = async; + +/** + * Runs provided callback asynchronously + * even if callback itself is not + * + * @param {function} callback - callback to invoke + * @returns {function} - augmented callback + */ +function async(callback) +{ + var isAsync = false; + + // check if async happened + defer(function() { isAsync = true; }); + + return function async_callback(err, result) + { + if (isAsync) + { + callback(err, result); + } + else + { + defer(function nextTick_callback() + { + callback(err, result); + }); + } + }; +} diff --git a/publisher/node_modules/asynckit/lib/defer.js b/publisher/node_modules/asynckit/lib/defer.js new file mode 100644 index 00000000..b67110c7 --- /dev/null +++ b/publisher/node_modules/asynckit/lib/defer.js @@ -0,0 +1,26 @@ +module.exports = defer; + +/** + * Runs provided function on next iteration of the event loop + * + * @param {function} fn - function to run + */ +function defer(fn) +{ + var nextTick = typeof setImmediate == 'function' + ? setImmediate + : ( + typeof process == 'object' && typeof process.nextTick == 'function' + ? process.nextTick + : null + ); + + if (nextTick) + { + nextTick(fn); + } + else + { + setTimeout(fn, 0); + } +} diff --git a/publisher/node_modules/asynckit/lib/iterate.js b/publisher/node_modules/asynckit/lib/iterate.js new file mode 100644 index 00000000..5d2839a5 --- /dev/null +++ b/publisher/node_modules/asynckit/lib/iterate.js @@ -0,0 +1,75 @@ +var async = require('./async.js') + , abort = require('./abort.js') + ; + +// API +module.exports = iterate; + +/** + * Iterates over each job object + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {object} state - current job status + * @param {function} callback - invoked when all elements processed + */ +function iterate(list, iterator, state, callback) +{ + // store current index + var key = state['keyedList'] ? state['keyedList'][state.index] : state.index; + + state.jobs[key] = runJob(iterator, key, list[key], function(error, output) + { + // don't repeat yourself + // skip secondary callbacks + if (!(key in state.jobs)) + { + return; + } + + // clean up jobs + delete state.jobs[key]; + + if (error) + { + // don't process rest of the results + // stop still active jobs + // and reset the list + abort(state); + } + else + { + state.results[key] = output; + } + + // return salvaged results + callback(error, state.results); + }); +} + +/** + * Runs iterator over provided job element + * + * @param {function} iterator - iterator to invoke + * @param {string|number} key - key/index of the element in the list of jobs + * @param {mixed} item - job description + * @param {function} callback - invoked after iterator is done with the job + * @returns {function|mixed} - job abort function or something else + */ +function runJob(iterator, key, item, callback) +{ + var aborter; + + // allow shortcut if iterator expects only two arguments + if (iterator.length == 2) + { + aborter = iterator(item, async(callback)); + } + // otherwise go with full three arguments + else + { + aborter = iterator(item, key, async(callback)); + } + + return aborter; +} diff --git a/publisher/node_modules/asynckit/lib/readable_asynckit.js b/publisher/node_modules/asynckit/lib/readable_asynckit.js new file mode 100644 index 00000000..78ad240f --- /dev/null +++ b/publisher/node_modules/asynckit/lib/readable_asynckit.js @@ -0,0 +1,91 @@ +var streamify = require('./streamify.js') + , defer = require('./defer.js') + ; + +// API +module.exports = ReadableAsyncKit; + +/** + * Base constructor for all streams + * used to hold properties/methods + */ +function ReadableAsyncKit() +{ + ReadableAsyncKit.super_.apply(this, arguments); + + // list of active jobs + this.jobs = {}; + + // add stream methods + this.destroy = destroy; + this._start = _start; + this._read = _read; +} + +/** + * Destroys readable stream, + * by aborting outstanding jobs + * + * @returns {void} + */ +function destroy() +{ + if (this.destroyed) + { + return; + } + + this.destroyed = true; + + if (typeof this.terminator == 'function') + { + this.terminator(); + } +} + +/** + * Starts provided jobs in async manner + * + * @private + */ +function _start() +{ + // first argument – runner function + var runner = arguments[0] + // take away first argument + , args = Array.prototype.slice.call(arguments, 1) + // second argument - input data + , input = args[0] + // last argument - result callback + , endCb = streamify.callback.call(this, args[args.length - 1]) + ; + + args[args.length - 1] = endCb; + // third argument - iterator + args[1] = streamify.iterator.call(this, args[1]); + + // allow time for proper setup + defer(function() + { + if (!this.destroyed) + { + this.terminator = runner.apply(null, args); + } + else + { + endCb(null, Array.isArray(input) ? [] : {}); + } + }.bind(this)); +} + + +/** + * Implement _read to comply with Readable streams + * Doesn't really make sense for flowing object mode + * + * @private + */ +function _read() +{ + +} diff --git a/publisher/node_modules/asynckit/lib/readable_parallel.js b/publisher/node_modules/asynckit/lib/readable_parallel.js new file mode 100644 index 00000000..5d2929f7 --- /dev/null +++ b/publisher/node_modules/asynckit/lib/readable_parallel.js @@ -0,0 +1,25 @@ +var parallel = require('../parallel.js'); + +// API +module.exports = ReadableParallel; + +/** + * Streaming wrapper to `asynckit.parallel` + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {stream.Readable#} + */ +function ReadableParallel(list, iterator, callback) +{ + if (!(this instanceof ReadableParallel)) + { + return new ReadableParallel(list, iterator, callback); + } + + // turn on object mode + ReadableParallel.super_.call(this, {objectMode: true}); + + this._start(parallel, list, iterator, callback); +} diff --git a/publisher/node_modules/asynckit/lib/readable_serial.js b/publisher/node_modules/asynckit/lib/readable_serial.js new file mode 100644 index 00000000..78226982 --- /dev/null +++ b/publisher/node_modules/asynckit/lib/readable_serial.js @@ -0,0 +1,25 @@ +var serial = require('../serial.js'); + +// API +module.exports = ReadableSerial; + +/** + * Streaming wrapper to `asynckit.serial` + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {stream.Readable#} + */ +function ReadableSerial(list, iterator, callback) +{ + if (!(this instanceof ReadableSerial)) + { + return new ReadableSerial(list, iterator, callback); + } + + // turn on object mode + ReadableSerial.super_.call(this, {objectMode: true}); + + this._start(serial, list, iterator, callback); +} diff --git a/publisher/node_modules/asynckit/lib/readable_serial_ordered.js b/publisher/node_modules/asynckit/lib/readable_serial_ordered.js new file mode 100644 index 00000000..3de89c47 --- /dev/null +++ b/publisher/node_modules/asynckit/lib/readable_serial_ordered.js @@ -0,0 +1,29 @@ +var serialOrdered = require('../serialOrdered.js'); + +// API +module.exports = ReadableSerialOrdered; +// expose sort helpers +module.exports.ascending = serialOrdered.ascending; +module.exports.descending = serialOrdered.descending; + +/** + * Streaming wrapper to `asynckit.serialOrdered` + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} sortMethod - custom sort function + * @param {function} callback - invoked when all elements processed + * @returns {stream.Readable#} + */ +function ReadableSerialOrdered(list, iterator, sortMethod, callback) +{ + if (!(this instanceof ReadableSerialOrdered)) + { + return new ReadableSerialOrdered(list, iterator, sortMethod, callback); + } + + // turn on object mode + ReadableSerialOrdered.super_.call(this, {objectMode: true}); + + this._start(serialOrdered, list, iterator, sortMethod, callback); +} diff --git a/publisher/node_modules/asynckit/lib/state.js b/publisher/node_modules/asynckit/lib/state.js new file mode 100644 index 00000000..cbea7ad8 --- /dev/null +++ b/publisher/node_modules/asynckit/lib/state.js @@ -0,0 +1,37 @@ +// API +module.exports = state; + +/** + * Creates initial state object + * for iteration over list + * + * @param {array|object} list - list to iterate over + * @param {function|null} sortMethod - function to use for keys sort, + * or `null` to keep them as is + * @returns {object} - initial state object + */ +function state(list, sortMethod) +{ + var isNamedList = !Array.isArray(list) + , initState = + { + index : 0, + keyedList: isNamedList || sortMethod ? Object.keys(list) : null, + jobs : {}, + results : isNamedList ? {} : [], + size : isNamedList ? Object.keys(list).length : list.length + } + ; + + if (sortMethod) + { + // sort array keys based on it's values + // sort object's keys just on own merit + initState.keyedList.sort(isNamedList ? sortMethod : function(a, b) + { + return sortMethod(list[a], list[b]); + }); + } + + return initState; +} diff --git a/publisher/node_modules/asynckit/lib/streamify.js b/publisher/node_modules/asynckit/lib/streamify.js new file mode 100644 index 00000000..f56a1c92 --- /dev/null +++ b/publisher/node_modules/asynckit/lib/streamify.js @@ -0,0 +1,141 @@ +var async = require('./async.js'); + +// API +module.exports = { + iterator: wrapIterator, + callback: wrapCallback +}; + +/** + * Wraps iterators with long signature + * + * @this ReadableAsyncKit# + * @param {function} iterator - function to wrap + * @returns {function} - wrapped function + */ +function wrapIterator(iterator) +{ + var stream = this; + + return function(item, key, cb) + { + var aborter + , wrappedCb = async(wrapIteratorCallback.call(stream, cb, key)) + ; + + stream.jobs[key] = wrappedCb; + + // it's either shortcut (item, cb) + if (iterator.length == 2) + { + aborter = iterator(item, wrappedCb); + } + // or long format (item, key, cb) + else + { + aborter = iterator(item, key, wrappedCb); + } + + return aborter; + }; +} + +/** + * Wraps provided callback function + * allowing to execute snitch function before + * real callback + * + * @this ReadableAsyncKit# + * @param {function} callback - function to wrap + * @returns {function} - wrapped function + */ +function wrapCallback(callback) +{ + var stream = this; + + var wrapped = function(error, result) + { + return finisher.call(stream, error, result, callback); + }; + + return wrapped; +} + +/** + * Wraps provided iterator callback function + * makes sure snitch only called once, + * but passes secondary calls to the original callback + * + * @this ReadableAsyncKit# + * @param {function} callback - callback to wrap + * @param {number|string} key - iteration key + * @returns {function} wrapped callback + */ +function wrapIteratorCallback(callback, key) +{ + var stream = this; + + return function(error, output) + { + // don't repeat yourself + if (!(key in stream.jobs)) + { + callback(error, output); + return; + } + + // clean up jobs + delete stream.jobs[key]; + + return streamer.call(stream, error, {key: key, value: output}, callback); + }; +} + +/** + * Stream wrapper for iterator callback + * + * @this ReadableAsyncKit# + * @param {mixed} error - error response + * @param {mixed} output - iterator output + * @param {function} callback - callback that expects iterator results + */ +function streamer(error, output, callback) +{ + if (error && !this.error) + { + this.error = error; + this.pause(); + this.emit('error', error); + // send back value only, as expected + callback(error, output && output.value); + return; + } + + // stream stuff + this.push(output); + + // back to original track + // send back value only, as expected + callback(error, output && output.value); +} + +/** + * Stream wrapper for finishing callback + * + * @this ReadableAsyncKit# + * @param {mixed} error - error response + * @param {mixed} output - iterator output + * @param {function} callback - callback that expects final results + */ +function finisher(error, output, callback) +{ + // signal end of the stream + // only for successfully finished streams + if (!error) + { + this.push(null); + } + + // back to original track + callback(error, output); +} diff --git a/publisher/node_modules/asynckit/lib/terminator.js b/publisher/node_modules/asynckit/lib/terminator.js new file mode 100644 index 00000000..d6eb9921 --- /dev/null +++ b/publisher/node_modules/asynckit/lib/terminator.js @@ -0,0 +1,29 @@ +var abort = require('./abort.js') + , async = require('./async.js') + ; + +// API +module.exports = terminator; + +/** + * Terminates jobs in the attached state context + * + * @this AsyncKitState# + * @param {function} callback - final callback to invoke after termination + */ +function terminator(callback) +{ + if (!Object.keys(this.jobs).length) + { + return; + } + + // fast forward iteration index + this.index = this.size; + + // abort jobs + abort(this); + + // send back results we have so far + async(callback)(null, this.results); +} diff --git a/publisher/node_modules/asynckit/package.json b/publisher/node_modules/asynckit/package.json new file mode 100644 index 00000000..51147d65 --- /dev/null +++ b/publisher/node_modules/asynckit/package.json @@ -0,0 +1,63 @@ +{ + "name": "asynckit", + "version": "0.4.0", + "description": "Minimal async jobs utility library, with streams support", + "main": "index.js", + "scripts": { + "clean": "rimraf coverage", + "lint": "eslint *.js lib/*.js test/*.js", + "test": "istanbul cover --reporter=json tape -- 'test/test-*.js' | tap-spec", + "win-test": "tape test/test-*.js", + "browser": "browserify -t browserify-istanbul test/lib/browserify_adjustment.js test/test-*.js | obake --coverage | tap-spec", + "report": "istanbul report", + "size": "browserify index.js | size-table asynckit", + "debug": "tape test/test-*.js" + }, + "pre-commit": [ + "clean", + "lint", + "test", + "browser", + "report", + "size" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/alexindigo/asynckit.git" + }, + "keywords": [ + "async", + "jobs", + "parallel", + "serial", + "iterator", + "array", + "object", + "stream", + "destroy", + "terminate", + "abort" + ], + "author": "Alex Indigo ", + "license": "MIT", + "bugs": { + "url": "https://github.com/alexindigo/asynckit/issues" + }, + "homepage": "https://github.com/alexindigo/asynckit#readme", + "devDependencies": { + "browserify": "^13.0.0", + "browserify-istanbul": "^2.0.0", + "coveralls": "^2.11.9", + "eslint": "^2.9.0", + "istanbul": "^0.4.3", + "obake": "^0.1.2", + "phantomjs-prebuilt": "^2.1.7", + "pre-commit": "^1.1.3", + "reamde": "^1.1.0", + "rimraf": "^2.5.2", + "size-table": "^0.2.0", + "tap-spec": "^4.1.1", + "tape": "^4.5.1" + }, + "dependencies": {} +} diff --git a/publisher/node_modules/asynckit/parallel.js b/publisher/node_modules/asynckit/parallel.js new file mode 100644 index 00000000..3c50344d --- /dev/null +++ b/publisher/node_modules/asynckit/parallel.js @@ -0,0 +1,43 @@ +var iterate = require('./lib/iterate.js') + , initState = require('./lib/state.js') + , terminator = require('./lib/terminator.js') + ; + +// Public API +module.exports = parallel; + +/** + * Runs iterator over provided array elements in parallel + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function parallel(list, iterator, callback) +{ + var state = initState(list); + + while (state.index < (state['keyedList'] || list).length) + { + iterate(list, iterator, state, function(error, result) + { + if (error) + { + callback(error, result); + return; + } + + // looks like it's the last one + if (Object.keys(state.jobs).length === 0) + { + callback(null, state.results); + return; + } + }); + + state.index++; + } + + return terminator.bind(state, callback); +} diff --git a/publisher/node_modules/asynckit/serial.js b/publisher/node_modules/asynckit/serial.js new file mode 100644 index 00000000..6cd949a6 --- /dev/null +++ b/publisher/node_modules/asynckit/serial.js @@ -0,0 +1,17 @@ +var serialOrdered = require('./serialOrdered.js'); + +// Public API +module.exports = serial; + +/** + * Runs iterator over provided array elements in series + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function serial(list, iterator, callback) +{ + return serialOrdered(list, iterator, null, callback); +} diff --git a/publisher/node_modules/asynckit/serialOrdered.js b/publisher/node_modules/asynckit/serialOrdered.js new file mode 100644 index 00000000..607eafea --- /dev/null +++ b/publisher/node_modules/asynckit/serialOrdered.js @@ -0,0 +1,75 @@ +var iterate = require('./lib/iterate.js') + , initState = require('./lib/state.js') + , terminator = require('./lib/terminator.js') + ; + +// Public API +module.exports = serialOrdered; +// sorting helpers +module.exports.ascending = ascending; +module.exports.descending = descending; + +/** + * Runs iterator over provided sorted array elements in series + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} sortMethod - custom sort function + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function serialOrdered(list, iterator, sortMethod, callback) +{ + var state = initState(list, sortMethod); + + iterate(list, iterator, state, function iteratorHandler(error, result) + { + if (error) + { + callback(error, result); + return; + } + + state.index++; + + // are we there yet? + if (state.index < (state['keyedList'] || list).length) + { + iterate(list, iterator, state, iteratorHandler); + return; + } + + // done here + callback(null, state.results); + }); + + return terminator.bind(state, callback); +} + +/* + * -- Sort methods + */ + +/** + * sort helper to sort array elements in ascending order + * + * @param {mixed} a - an item to compare + * @param {mixed} b - an item to compare + * @returns {number} - comparison result + */ +function ascending(a, b) +{ + return a < b ? -1 : a > b ? 1 : 0; +} + +/** + * sort helper to sort array elements in descending order + * + * @param {mixed} a - an item to compare + * @param {mixed} b - an item to compare + * @returns {number} - comparison result + */ +function descending(a, b) +{ + return -1 * ascending(a, b); +} diff --git a/publisher/node_modules/asynckit/stream.js b/publisher/node_modules/asynckit/stream.js new file mode 100644 index 00000000..d43465f9 --- /dev/null +++ b/publisher/node_modules/asynckit/stream.js @@ -0,0 +1,21 @@ +var inherits = require('util').inherits + , Readable = require('stream').Readable + , ReadableAsyncKit = require('./lib/readable_asynckit.js') + , ReadableParallel = require('./lib/readable_parallel.js') + , ReadableSerial = require('./lib/readable_serial.js') + , ReadableSerialOrdered = require('./lib/readable_serial_ordered.js') + ; + +// API +module.exports = +{ + parallel : ReadableParallel, + serial : ReadableSerial, + serialOrdered : ReadableSerialOrdered, +}; + +inherits(ReadableAsyncKit, Readable); + +inherits(ReadableParallel, ReadableAsyncKit); +inherits(ReadableSerial, ReadableAsyncKit); +inherits(ReadableSerialOrdered, ReadableAsyncKit); diff --git a/publisher/node_modules/aws-sign2/LICENSE b/publisher/node_modules/aws-sign2/LICENSE new file mode 100644 index 00000000..a4a9aee0 --- /dev/null +++ b/publisher/node_modules/aws-sign2/LICENSE @@ -0,0 +1,55 @@ +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and + +You must cause any modified files to carry prominent notices stating that You changed the files; and + +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/publisher/node_modules/aws-sign2/README.md b/publisher/node_modules/aws-sign2/README.md new file mode 100644 index 00000000..763564e0 --- /dev/null +++ b/publisher/node_modules/aws-sign2/README.md @@ -0,0 +1,4 @@ +aws-sign +======== + +AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module. diff --git a/publisher/node_modules/aws-sign2/index.js b/publisher/node_modules/aws-sign2/index.js new file mode 100644 index 00000000..fb35f6db --- /dev/null +++ b/publisher/node_modules/aws-sign2/index.js @@ -0,0 +1,212 @@ + +/*! + * Copyright 2010 LearnBoost + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Module dependencies. + */ + +var crypto = require('crypto') + , parse = require('url').parse + ; + +/** + * Valid keys. + */ + +var keys = + [ 'acl' + , 'location' + , 'logging' + , 'notification' + , 'partNumber' + , 'policy' + , 'requestPayment' + , 'torrent' + , 'uploadId' + , 'uploads' + , 'versionId' + , 'versioning' + , 'versions' + , 'website' + ] + +/** + * Return an "Authorization" header value with the given `options` + * in the form of "AWS :" + * + * @param {Object} options + * @return {String} + * @api private + */ + +function authorization (options) { + return 'AWS ' + options.key + ':' + sign(options) +} + +module.exports = authorization +module.exports.authorization = authorization + +/** + * Simple HMAC-SHA1 Wrapper + * + * @param {Object} options + * @return {String} + * @api private + */ + +function hmacSha1 (options) { + return crypto.createHmac('sha1', options.secret).update(options.message).digest('base64') +} + +module.exports.hmacSha1 = hmacSha1 + +/** + * Create a base64 sha1 HMAC for `options`. + * + * @param {Object} options + * @return {String} + * @api private + */ + +function sign (options) { + options.message = stringToSign(options) + return hmacSha1(options) +} +module.exports.sign = sign + +/** + * Create a base64 sha1 HMAC for `options`. + * + * Specifically to be used with S3 presigned URLs + * + * @param {Object} options + * @return {String} + * @api private + */ + +function signQuery (options) { + options.message = queryStringToSign(options) + return hmacSha1(options) +} +module.exports.signQuery= signQuery + +/** + * Return a string for sign() with the given `options`. + * + * Spec: + * + * \n + * \n + * \n + * \n + * [headers\n] + * + * + * @param {Object} options + * @return {String} + * @api private + */ + +function stringToSign (options) { + var headers = options.amazonHeaders || '' + if (headers) headers += '\n' + var r = + [ options.verb + , options.md5 + , options.contentType + , options.date ? options.date.toUTCString() : '' + , headers + options.resource + ] + return r.join('\n') +} +module.exports.stringToSign = stringToSign + +/** + * Return a string for sign() with the given `options`, but is meant exclusively + * for S3 presigned URLs + * + * Spec: + * + * \n + * + * + * @param {Object} options + * @return {String} + * @api private + */ + +function queryStringToSign (options){ + return 'GET\n\n\n' + options.date + '\n' + options.resource +} +module.exports.queryStringToSign = queryStringToSign + +/** + * Perform the following: + * + * - ignore non-amazon headers + * - lowercase fields + * - sort lexicographically + * - trim whitespace between ":" + * - join with newline + * + * @param {Object} headers + * @return {String} + * @api private + */ + +function canonicalizeHeaders (headers) { + var buf = [] + , fields = Object.keys(headers) + ; + for (var i = 0, len = fields.length; i < len; ++i) { + var field = fields[i] + , val = headers[field] + , field = field.toLowerCase() + ; + if (0 !== field.indexOf('x-amz')) continue + buf.push(field + ':' + val) + } + return buf.sort().join('\n') +} +module.exports.canonicalizeHeaders = canonicalizeHeaders + +/** + * Perform the following: + * + * - ignore non sub-resources + * - sort lexicographically + * + * @param {String} resource + * @return {String} + * @api private + */ + +function canonicalizeResource (resource) { + var url = parse(resource, true) + , path = url.pathname + , buf = [] + ; + + Object.keys(url.query).forEach(function(key){ + if (!~keys.indexOf(key)) return + var val = '' == url.query[key] ? '' : '=' + encodeURIComponent(url.query[key]) + buf.push(key + val) + }) + + return path + (buf.length ? '?' + buf.sort().join('&') : '') +} +module.exports.canonicalizeResource = canonicalizeResource diff --git a/publisher/node_modules/aws-sign2/package.json b/publisher/node_modules/aws-sign2/package.json new file mode 100644 index 00000000..4c3d57e5 --- /dev/null +++ b/publisher/node_modules/aws-sign2/package.json @@ -0,0 +1,17 @@ +{ + "author": "Mikeal Rogers (http://www.futurealoof.com)", + "name": "aws-sign2", + "description": "AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.", + "version": "0.7.0", + "repository": { + "url": "https://github.com/mikeal/aws-sign" + }, + "license": "Apache-2.0", + "main": "index.js", + "dependencies": {}, + "devDependencies": {}, + "optionalDependencies": {}, + "engines": { + "node": "*" + } +} diff --git a/publisher/node_modules/aws4/LICENSE b/publisher/node_modules/aws4/LICENSE new file mode 100644 index 00000000..4f321e59 --- /dev/null +++ b/publisher/node_modules/aws4/LICENSE @@ -0,0 +1,19 @@ +Copyright 2013 Michael Hart (michael.hart.au@gmail.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/publisher/node_modules/aws4/README.md b/publisher/node_modules/aws4/README.md new file mode 100644 index 00000000..fa4d5946 --- /dev/null +++ b/publisher/node_modules/aws4/README.md @@ -0,0 +1,211 @@ +aws4 +---- + +A small utility to sign [vanilla Node.js http(s)](https://nodejs.org/api/http.html) request options using Amazon's +[AWS Signature Version 4](https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html). + +If you want to sign and send AWS requests using [`fetch()`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API), then check out [aws4fetch](https://github.com/mhart/aws4fetch) – otherwise you can also bundle this library for use [in older browsers](./browser). + +The only AWS service I know of that *doesn't* support v4 is +[SimpleDB](https://docs.aws.amazon.com/AmazonSimpleDB/latest/DeveloperGuide/SDB_API.html) +(it only supports [AWS Signature Version 2](https://github.com/mhart/aws2)). + +It also provides defaults for a number of core AWS headers and +request parameters, making it very easy to query AWS services, or +build out a fully-featured AWS library. + +Example +------- + +```javascript +var https = require('https') +var aws4 = require('aws4') + +// to illustrate usage, we'll create a utility function to request and pipe to stdout +function request(opts) { https.request(opts, function(res) { res.pipe(process.stdout) }).end(opts.body || '') } + +// aws4 will sign an options object as you'd pass to http.request, with an AWS service and region +var opts = { host: 'my-bucket.s3.us-west-1.amazonaws.com', path: '/my-object', service: 's3', region: 'us-west-1' } + +// aws4.sign() will sign and modify these options, ready to pass to http.request +aws4.sign(opts, { accessKeyId: '', secretAccessKey: '' }) + +// or it can get credentials from process.env.AWS_ACCESS_KEY_ID, etc +aws4.sign(opts) + +// for most AWS services, aws4 can figure out the service and region if you pass a host +opts = { host: 'my-bucket.s3.us-west-1.amazonaws.com', path: '/my-object' } + +// usually it will add/modify request headers, but you can also sign the query: +opts = { host: 'my-bucket.s3.amazonaws.com', path: '/?X-Amz-Expires=12345', signQuery: true } + +// and for services with simple hosts, aws4 can infer the host from service and region: +opts = { service: 'sqs', region: 'us-east-1', path: '/?Action=ListQueues' } + +// and if you're using us-east-1, it's the default: +opts = { service: 'sqs', path: '/?Action=ListQueues' } + +aws4.sign(opts) +console.log(opts) +/* +{ + host: 'sqs.us-east-1.amazonaws.com', + path: '/?Action=ListQueues', + headers: { + Host: 'sqs.us-east-1.amazonaws.com', + 'X-Amz-Date': '20121226T061030Z', + Authorization: 'AWS4-HMAC-SHA256 Credential=ABCDEF/20121226/us-east-1/sqs/aws4_request, ...' + } +} +*/ + +// we can now use this to query AWS +request(opts) +/* + + +... +*/ + +// aws4 can infer the HTTP method if a body is passed in +// method will be POST and Content-Type: 'application/x-www-form-urlencoded; charset=utf-8' +request(aws4.sign({ service: 'iam', body: 'Action=ListGroups&Version=2010-05-08' })) +/* + +... +*/ + +// you can specify any custom option or header as per usual +request(aws4.sign({ + service: 'dynamodb', + region: 'ap-southeast-2', + method: 'POST', + path: '/', + headers: { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'DynamoDB_20120810.ListTables' + }, + body: '{}' +})) +/* +{"TableNames":[]} +... +*/ + +// you can also specify extra headers to ignore during signing +request(aws4.sign({ + host: '07tjusf2h91cunochc.us-east-1.aoss.amazonaws.com', + method: 'PUT', + path: '/my-index', + body: '{"mappings":{}}', + headers: { + 'Content-Type': 'application/json', + 'X-Amz-Content-Sha256': 'UNSIGNED-PAYLOAD' + }, + extraHeadersToIgnore: { + 'content-length': true + } +})) + +// and headers to include that would normally be ignored +request(aws4.sign({ + service: 'mycustomservice', + path: '/whatever', + headers: { + 'Range': 'bytes=200-1000, 2000-6576, 19000-' + }, + extraHeadersToInclude: { + 'range': true + } +})) + + +// The raw RequestSigner can be used to generate CodeCommit Git passwords +var signer = new aws4.RequestSigner({ + service: 'codecommit', + host: 'git-codecommit.us-east-1.amazonaws.com', + method: 'GIT', + path: '/v1/repos/MyAwesomeRepo', +}) +var password = signer.getDateTime() + 'Z' + signer.signature() + +// see example.js for examples with other services +``` + +API +--- + +### aws4.sign(requestOptions, [credentials]) + +Calculates and populates any necessary AWS headers and/or request +options on `requestOptions`. Returns `requestOptions` as a convenience for chaining. + +`requestOptions` is an object holding the same options that the Node.js +[http.request](https://nodejs.org/docs/latest/api/http.html#http_http_request_options_callback) +function takes. + +The following properties of `requestOptions` are used in the signing or +populated if they don't already exist: + +- `hostname` or `host` (will try to be determined from `service` and `region` if not given) +- `method` (will use `'GET'` if not given or `'POST'` if there is a `body`) +- `path` (will use `'/'` if not given) +- `body` (will use `''` if not given) +- `service` (will try to be calculated from `hostname` or `host` if not given) +- `region` (will try to be calculated from `hostname` or `host` or use `'us-east-1'` if not given) +- `signQuery` (to sign the query instead of adding an `Authorization` header, defaults to false) +- `extraHeadersToIgnore` (an object with lowercase header keys to ignore when signing, eg `{ 'content-length': true }`) +- `extraHeadersToInclude` (an object with lowercase header keys to include when signing, overriding any ignores) +- `headers['Host']` (will use `hostname` or `host` or be calculated if not given) +- `headers['Content-Type']` (will use `'application/x-www-form-urlencoded; charset=utf-8'` + if not given and there is a `body`) +- `headers['Date']` (used to calculate the signature date if given, otherwise `new Date` is used) + +Your AWS credentials (which can be found in your +[AWS console](https://portal.aws.amazon.com/gp/aws/securityCredentials)) +can be specified in one of two ways: + +- As the second argument, like this: + +```javascript +aws4.sign(requestOptions, { + secretAccessKey: "", + accessKeyId: "", + sessionToken: "" +}) +``` + +- From `process.env`, such as this: + +``` +export AWS_ACCESS_KEY_ID="" +export AWS_SECRET_ACCESS_KEY="" +export AWS_SESSION_TOKEN="" +``` + +(will also use `AWS_ACCESS_KEY` and `AWS_SECRET_KEY` if available) + +The `sessionToken` property and `AWS_SESSION_TOKEN` environment variable are optional for signing +with [IAM STS temporary credentials](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html). + +Installation +------------ + +With [npm](https://www.npmjs.com/) do: + +``` +npm install aws4 +``` + +Can also be used [in the browser](./browser). + +Thanks +------ + +Thanks to [@jed](https://github.com/jed) for his +[dynamo-client](https://github.com/jed/dynamo-client) lib where I first +committed and subsequently extracted this code. + +Also thanks to the +[official Node.js AWS SDK](https://github.com/aws/aws-sdk-js) for giving +me a start on implementing the v4 signature. diff --git a/publisher/node_modules/aws4/aws4.js b/publisher/node_modules/aws4/aws4.js new file mode 100644 index 00000000..6a96676f --- /dev/null +++ b/publisher/node_modules/aws4/aws4.js @@ -0,0 +1,383 @@ +var aws4 = exports, + url = require('url'), + querystring = require('querystring'), + crypto = require('crypto'), + lru = require('./lru'), + credentialsCache = lru(1000) + +// http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html + +function hmac(key, string, encoding) { + return crypto.createHmac('sha256', key).update(string, 'utf8').digest(encoding) +} + +function hash(string, encoding) { + return crypto.createHash('sha256').update(string, 'utf8').digest(encoding) +} + +// This function assumes the string has already been percent encoded +function encodeRfc3986(urlEncodedString) { + return urlEncodedString.replace(/[!'()*]/g, function(c) { + return '%' + c.charCodeAt(0).toString(16).toUpperCase() + }) +} + +function encodeRfc3986Full(str) { + return encodeRfc3986(encodeURIComponent(str)) +} + +// A bit of a combination of: +// https://github.com/aws/aws-sdk-java-v2/blob/dc695de6ab49ad03934e1b02e7263abbd2354be0/core/auth/src/main/java/software/amazon/awssdk/auth/signer/internal/AbstractAws4Signer.java#L59 +// https://github.com/aws/aws-sdk-js/blob/18cb7e5b463b46239f9fdd4a65e2ff8c81831e8f/lib/signers/v4.js#L191-L199 +// https://github.com/mhart/aws4fetch/blob/b3aed16b6f17384cf36ea33bcba3c1e9f3bdfefd/src/main.js#L25-L34 +var HEADERS_TO_IGNORE = { + 'authorization': true, + 'connection': true, + 'x-amzn-trace-id': true, + 'user-agent': true, + 'expect': true, + 'presigned-expires': true, + 'range': true, +} + +// request: { path | body, [host], [method], [headers], [service], [region] } +// credentials: { accessKeyId, secretAccessKey, [sessionToken] } +function RequestSigner(request, credentials) { + + if (typeof request === 'string') request = url.parse(request) + + var headers = request.headers = Object.assign({}, (request.headers || {})), + hostParts = (!this.service || !this.region) && this.matchHost(request.hostname || request.host || headers.Host || headers.host) + + this.request = request + this.credentials = credentials || this.defaultCredentials() + + this.service = request.service || hostParts[0] || '' + this.region = request.region || hostParts[1] || 'us-east-1' + + // SES uses a different domain from the service name + if (this.service === 'email') this.service = 'ses' + + if (!request.method && request.body) + request.method = 'POST' + + if (!headers.Host && !headers.host) { + headers.Host = request.hostname || request.host || this.createHost() + + // If a port is specified explicitly, use it as is + if (request.port) + headers.Host += ':' + request.port + } + if (!request.hostname && !request.host) + request.hostname = headers.Host || headers.host + + this.isCodeCommitGit = this.service === 'codecommit' && request.method === 'GIT' + + this.extraHeadersToIgnore = request.extraHeadersToIgnore || Object.create(null) + this.extraHeadersToInclude = request.extraHeadersToInclude || Object.create(null) +} + +RequestSigner.prototype.matchHost = function(host) { + var match = (host || '').match(/([^\.]{1,63})\.(?:([^\.]{0,63})\.)?amazonaws\.com(\.cn)?$/) + var hostParts = (match || []).slice(1, 3) + + // ES's hostParts are sometimes the other way round, if the value that is expected + // to be region equals ‘es’ switch them back + // e.g. search-cluster-name-aaaa00aaaa0aaa0aaaaaaa0aaa.us-east-1.es.amazonaws.com + if (hostParts[1] === 'es' || hostParts[1] === 'aoss') + hostParts = hostParts.reverse() + + if (hostParts[1] == 's3') { + hostParts[0] = 's3' + hostParts[1] = 'us-east-1' + } else { + for (var i = 0; i < 2; i++) { + if (/^s3-/.test(hostParts[i])) { + hostParts[1] = hostParts[i].slice(3) + hostParts[0] = 's3' + break + } + } + } + + return hostParts +} + +// http://docs.aws.amazon.com/general/latest/gr/rande.html +RequestSigner.prototype.isSingleRegion = function() { + // Special case for S3 and SimpleDB in us-east-1 + if (['s3', 'sdb'].indexOf(this.service) >= 0 && this.region === 'us-east-1') return true + + return ['cloudfront', 'ls', 'route53', 'iam', 'importexport', 'sts'] + .indexOf(this.service) >= 0 +} + +RequestSigner.prototype.createHost = function() { + var region = this.isSingleRegion() ? '' : '.' + this.region, + subdomain = this.service === 'ses' ? 'email' : this.service + return subdomain + region + '.amazonaws.com' +} + +RequestSigner.prototype.prepareRequest = function() { + this.parsePath() + + var request = this.request, headers = request.headers, query + + if (request.signQuery) { + + this.parsedPath.query = query = this.parsedPath.query || {} + + if (this.credentials.sessionToken) + query['X-Amz-Security-Token'] = this.credentials.sessionToken + + if (this.service === 's3' && !query['X-Amz-Expires']) + query['X-Amz-Expires'] = 86400 + + if (query['X-Amz-Date']) + this.datetime = query['X-Amz-Date'] + else + query['X-Amz-Date'] = this.getDateTime() + + query['X-Amz-Algorithm'] = 'AWS4-HMAC-SHA256' + query['X-Amz-Credential'] = this.credentials.accessKeyId + '/' + this.credentialString() + query['X-Amz-SignedHeaders'] = this.signedHeaders() + + } else { + + if (!request.doNotModifyHeaders && !this.isCodeCommitGit) { + if (request.body && !headers['Content-Type'] && !headers['content-type']) + headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=utf-8' + + if (request.body && !headers['Content-Length'] && !headers['content-length']) + headers['Content-Length'] = Buffer.byteLength(request.body) + + if (this.credentials.sessionToken && !headers['X-Amz-Security-Token'] && !headers['x-amz-security-token']) + headers['X-Amz-Security-Token'] = this.credentials.sessionToken + + if (this.service === 's3' && !headers['X-Amz-Content-Sha256'] && !headers['x-amz-content-sha256']) + headers['X-Amz-Content-Sha256'] = hash(this.request.body || '', 'hex') + + if (headers['X-Amz-Date'] || headers['x-amz-date']) + this.datetime = headers['X-Amz-Date'] || headers['x-amz-date'] + else + headers['X-Amz-Date'] = this.getDateTime() + } + + delete headers.Authorization + delete headers.authorization + } +} + +RequestSigner.prototype.sign = function() { + if (!this.parsedPath) this.prepareRequest() + + if (this.request.signQuery) { + this.parsedPath.query['X-Amz-Signature'] = this.signature() + } else { + this.request.headers.Authorization = this.authHeader() + } + + this.request.path = this.formatPath() + + return this.request +} + +RequestSigner.prototype.getDateTime = function() { + if (!this.datetime) { + var headers = this.request.headers, + date = new Date(headers.Date || headers.date || new Date) + + this.datetime = date.toISOString().replace(/[:\-]|\.\d{3}/g, '') + + // Remove the trailing 'Z' on the timestamp string for CodeCommit git access + if (this.isCodeCommitGit) this.datetime = this.datetime.slice(0, -1) + } + return this.datetime +} + +RequestSigner.prototype.getDate = function() { + return this.getDateTime().substr(0, 8) +} + +RequestSigner.prototype.authHeader = function() { + return [ + 'AWS4-HMAC-SHA256 Credential=' + this.credentials.accessKeyId + '/' + this.credentialString(), + 'SignedHeaders=' + this.signedHeaders(), + 'Signature=' + this.signature(), + ].join(', ') +} + +RequestSigner.prototype.signature = function() { + var date = this.getDate(), + cacheKey = [this.credentials.secretAccessKey, date, this.region, this.service].join(), + kDate, kRegion, kService, kCredentials = credentialsCache.get(cacheKey) + if (!kCredentials) { + kDate = hmac('AWS4' + this.credentials.secretAccessKey, date) + kRegion = hmac(kDate, this.region) + kService = hmac(kRegion, this.service) + kCredentials = hmac(kService, 'aws4_request') + credentialsCache.set(cacheKey, kCredentials) + } + return hmac(kCredentials, this.stringToSign(), 'hex') +} + +RequestSigner.prototype.stringToSign = function() { + return [ + 'AWS4-HMAC-SHA256', + this.getDateTime(), + this.credentialString(), + hash(this.canonicalString(), 'hex'), + ].join('\n') +} + +RequestSigner.prototype.canonicalString = function() { + if (!this.parsedPath) this.prepareRequest() + + var pathStr = this.parsedPath.path, + query = this.parsedPath.query, + headers = this.request.headers, + queryStr = '', + normalizePath = this.service !== 's3', + decodePath = this.service === 's3' || this.request.doNotEncodePath, + decodeSlashesInPath = this.service === 's3', + firstValOnly = this.service === 's3', + bodyHash + + if (this.service === 's3' && this.request.signQuery) { + bodyHash = 'UNSIGNED-PAYLOAD' + } else if (this.isCodeCommitGit) { + bodyHash = '' + } else { + bodyHash = headers['X-Amz-Content-Sha256'] || headers['x-amz-content-sha256'] || + hash(this.request.body || '', 'hex') + } + + if (query) { + var reducedQuery = Object.keys(query).reduce(function(obj, key) { + if (!key) return obj + obj[encodeRfc3986Full(key)] = !Array.isArray(query[key]) ? query[key] : + (firstValOnly ? query[key][0] : query[key]) + return obj + }, {}) + var encodedQueryPieces = [] + Object.keys(reducedQuery).sort().forEach(function(key) { + if (!Array.isArray(reducedQuery[key])) { + encodedQueryPieces.push(key + '=' + encodeRfc3986Full(reducedQuery[key])) + } else { + reducedQuery[key].map(encodeRfc3986Full).sort() + .forEach(function(val) { encodedQueryPieces.push(key + '=' + val) }) + } + }) + queryStr = encodedQueryPieces.join('&') + } + if (pathStr !== '/') { + if (normalizePath) pathStr = pathStr.replace(/\/{2,}/g, '/') + pathStr = pathStr.split('/').reduce(function(path, piece) { + if (normalizePath && piece === '..') { + path.pop() + } else if (!normalizePath || piece !== '.') { + if (decodePath) piece = decodeURIComponent(piece.replace(/\+/g, ' ')) + path.push(encodeRfc3986Full(piece)) + } + return path + }, []).join('/') + if (pathStr[0] !== '/') pathStr = '/' + pathStr + if (decodeSlashesInPath) pathStr = pathStr.replace(/%2F/g, '/') + } + + return [ + this.request.method || 'GET', + pathStr, + queryStr, + this.canonicalHeaders() + '\n', + this.signedHeaders(), + bodyHash, + ].join('\n') +} + +RequestSigner.prototype.filterHeaders = function() { + var headers = this.request.headers, + extraHeadersToInclude = this.extraHeadersToInclude, + extraHeadersToIgnore = this.extraHeadersToIgnore + this.filteredHeaders = Object.keys(headers) + .map(function(key) { return [key.toLowerCase(), headers[key]] }) + .filter(function(entry) { + return extraHeadersToInclude[entry[0]] || + (HEADERS_TO_IGNORE[entry[0]] == null && !extraHeadersToIgnore[entry[0]]) + }) + .sort(function(a, b) { return a[0] < b[0] ? -1 : 1 }) +} + +RequestSigner.prototype.canonicalHeaders = function() { + if (!this.filteredHeaders) this.filterHeaders() + + return this.filteredHeaders.map(function(entry) { + return entry[0] + ':' + entry[1].toString().trim().replace(/\s+/g, ' ') + }).join('\n') +} + +RequestSigner.prototype.signedHeaders = function() { + if (!this.filteredHeaders) this.filterHeaders() + + return this.filteredHeaders.map(function(entry) { return entry[0] }).join(';') +} + +RequestSigner.prototype.credentialString = function() { + return [ + this.getDate(), + this.region, + this.service, + 'aws4_request', + ].join('/') +} + +RequestSigner.prototype.defaultCredentials = function() { + var env = process.env + return { + accessKeyId: env.AWS_ACCESS_KEY_ID || env.AWS_ACCESS_KEY, + secretAccessKey: env.AWS_SECRET_ACCESS_KEY || env.AWS_SECRET_KEY, + sessionToken: env.AWS_SESSION_TOKEN, + } +} + +RequestSigner.prototype.parsePath = function() { + var path = this.request.path || '/' + + // S3 doesn't always encode characters > 127 correctly and + // all services don't encode characters > 255 correctly + // So if there are non-reserved chars (and it's not already all % encoded), just encode them all + if (/[^0-9A-Za-z;,/?:@&=+$\-_.!~*'()#%]/.test(path)) { + path = encodeURI(decodeURI(path)) + } + + var queryIx = path.indexOf('?'), + query = null + + if (queryIx >= 0) { + query = querystring.parse(path.slice(queryIx + 1)) + path = path.slice(0, queryIx) + } + + this.parsedPath = { + path: path, + query: query, + } +} + +RequestSigner.prototype.formatPath = function() { + var path = this.parsedPath.path, + query = this.parsedPath.query + + if (!query) return path + + // Services don't support empty query string keys + if (query[''] != null) delete query[''] + + return path + '?' + encodeRfc3986(querystring.stringify(query)) +} + +aws4.RequestSigner = RequestSigner + +aws4.sign = function(request, credentials) { + return new RequestSigner(request, credentials).sign() +} diff --git a/publisher/node_modules/aws4/lru.js b/publisher/node_modules/aws4/lru.js new file mode 100644 index 00000000..333f66a4 --- /dev/null +++ b/publisher/node_modules/aws4/lru.js @@ -0,0 +1,96 @@ +module.exports = function(size) { + return new LruCache(size) +} + +function LruCache(size) { + this.capacity = size | 0 + this.map = Object.create(null) + this.list = new DoublyLinkedList() +} + +LruCache.prototype.get = function(key) { + var node = this.map[key] + if (node == null) return undefined + this.used(node) + return node.val +} + +LruCache.prototype.set = function(key, val) { + var node = this.map[key] + if (node != null) { + node.val = val + } else { + if (!this.capacity) this.prune() + if (!this.capacity) return false + node = new DoublyLinkedNode(key, val) + this.map[key] = node + this.capacity-- + } + this.used(node) + return true +} + +LruCache.prototype.used = function(node) { + this.list.moveToFront(node) +} + +LruCache.prototype.prune = function() { + var node = this.list.pop() + if (node != null) { + delete this.map[node.key] + this.capacity++ + } +} + + +function DoublyLinkedList() { + this.firstNode = null + this.lastNode = null +} + +DoublyLinkedList.prototype.moveToFront = function(node) { + if (this.firstNode == node) return + + this.remove(node) + + if (this.firstNode == null) { + this.firstNode = node + this.lastNode = node + node.prev = null + node.next = null + } else { + node.prev = null + node.next = this.firstNode + node.next.prev = node + this.firstNode = node + } +} + +DoublyLinkedList.prototype.pop = function() { + var lastNode = this.lastNode + if (lastNode != null) { + this.remove(lastNode) + } + return lastNode +} + +DoublyLinkedList.prototype.remove = function(node) { + if (this.firstNode == node) { + this.firstNode = node.next + } else if (node.prev != null) { + node.prev.next = node.next + } + if (this.lastNode == node) { + this.lastNode = node.prev + } else if (node.next != null) { + node.next.prev = node.prev + } +} + + +function DoublyLinkedNode(key, val) { + this.key = key + this.val = val + this.prev = null + this.next = null +} diff --git a/publisher/node_modules/aws4/package.json b/publisher/node_modules/aws4/package.json new file mode 100644 index 00000000..fbd6195e --- /dev/null +++ b/publisher/node_modules/aws4/package.json @@ -0,0 +1,21 @@ +{ + "name": "aws4", + "version": "1.13.2", + "description": "Signs and prepares requests using AWS Signature Version 4", + "author": "Michael Hart (https://github.com/mhart)", + "license": "MIT", + "repository": "github:mhart/aws4", + "main": "aws4.js", + "files": [ + "aws4.js", + "lru.js" + ], + "scripts": { + "test": "mocha ./test/fast.js -R list", + "integration": "node ./test/slow.js" + }, + "devDependencies": { + "mocha": "^10.7.3", + "should": "^13.2.3" + } +} diff --git a/publisher/node_modules/bcrypt-pbkdf/CONTRIBUTING.md b/publisher/node_modules/bcrypt-pbkdf/CONTRIBUTING.md new file mode 100644 index 00000000..401d34ed --- /dev/null +++ b/publisher/node_modules/bcrypt-pbkdf/CONTRIBUTING.md @@ -0,0 +1,13 @@ +# Contributing + +This repository uses [cr.joyent.us](https://cr.joyent.us) (Gerrit) for new +changes. Anyone can submit changes. To get started, see the [cr.joyent.us user +guide](https://github.com/joyent/joyent-gerrit/blob/master/docs/user/README.md). +This repo does not use GitHub pull requests. + +See the [Joyent Engineering +Guidelines](https://github.com/joyent/eng/blob/master/docs/index.md) for general +best practices expected in this repository. + +If you're changing something non-trivial or user-facing, you may want to submit +an issue first. diff --git a/publisher/node_modules/bcrypt-pbkdf/LICENSE b/publisher/node_modules/bcrypt-pbkdf/LICENSE new file mode 100644 index 00000000..fc58d2ab --- /dev/null +++ b/publisher/node_modules/bcrypt-pbkdf/LICENSE @@ -0,0 +1,66 @@ +The Blowfish portions are under the following license: + +Blowfish block cipher for OpenBSD +Copyright 1997 Niels Provos +All rights reserved. + +Implementation advice by David Mazieres . + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. 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. +3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 THE AUTHOR 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. + + + +The bcrypt_pbkdf portions are under the following license: + +Copyright (c) 2013 Ted Unangst + +Permission to use, copy, modify, and 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. + + + +Performance improvements (Javascript-specific): + +Copyright 2016, Joyent Inc +Author: Alex Wilson + +Permission to use, copy, modify, and 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. diff --git a/publisher/node_modules/bcrypt-pbkdf/README.md b/publisher/node_modules/bcrypt-pbkdf/README.md new file mode 100644 index 00000000..7551f335 --- /dev/null +++ b/publisher/node_modules/bcrypt-pbkdf/README.md @@ -0,0 +1,45 @@ +Port of the OpenBSD `bcrypt_pbkdf` function to pure Javascript. `npm`-ified +version of [Devi Mandiri's port](https://github.com/devi/tmp/blob/master/js/bcrypt_pbkdf.js), +with some minor performance improvements. The code is copied verbatim (and +un-styled) from Devi's work. + +This product includes software developed by Niels Provos. + +## API + +### `bcrypt_pbkdf.pbkdf(pass, passlen, salt, saltlen, key, keylen, rounds)` + +Derive a cryptographic key of arbitrary length from a given password and salt, +using the OpenBSD `bcrypt_pbkdf` function. This is a combination of Blowfish and +SHA-512. + +See [this article](http://www.tedunangst.com/flak/post/bcrypt-pbkdf) for +further information. + +Parameters: + + * `pass`, a Uint8Array of length `passlen` + * `passlen`, an integer Number + * `salt`, a Uint8Array of length `saltlen` + * `saltlen`, an integer Number + * `key`, a Uint8Array of length `keylen`, will be filled with output + * `keylen`, an integer Number + * `rounds`, an integer Number, number of rounds of the PBKDF to run + +### `bcrypt_pbkdf.hash(sha2pass, sha2salt, out)` + +Calculate a Blowfish hash, given SHA2-512 output of a password and salt. Used as +part of the inner round function in the PBKDF. + +Parameters: + + * `sha2pass`, a Uint8Array of length 64 + * `sha2salt`, a Uint8Array of length 64 + * `out`, a Uint8Array of length 32, will be filled with output + +## License + +This source form is a 1:1 port from the OpenBSD `blowfish.c` and `bcrypt_pbkdf.c`. +As a result, it retains the original copyright and license. The two files are +under slightly different (but compatible) licenses, and are here combined in +one file. For each of the full license texts see `LICENSE`. diff --git a/publisher/node_modules/bcrypt-pbkdf/index.js b/publisher/node_modules/bcrypt-pbkdf/index.js new file mode 100644 index 00000000..b1b5ad4b --- /dev/null +++ b/publisher/node_modules/bcrypt-pbkdf/index.js @@ -0,0 +1,556 @@ +'use strict'; + +var crypto_hash_sha512 = require('tweetnacl').lowlevel.crypto_hash; + +/* + * This file is a 1:1 port from the OpenBSD blowfish.c and bcrypt_pbkdf.c. As a + * result, it retains the original copyright and license. The two files are + * under slightly different (but compatible) licenses, and are here combined in + * one file. + * + * Credit for the actual porting work goes to: + * Devi Mandiri + */ + +/* + * The Blowfish portions are under the following license: + * + * Blowfish block cipher for OpenBSD + * Copyright 1997 Niels Provos + * All rights reserved. + * + * Implementation advice by David Mazieres . + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 THE AUTHOR 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. + */ + +/* + * The bcrypt_pbkdf portions are under the following license: + * + * Copyright (c) 2013 Ted Unangst + * + * Permission to use, copy, modify, and 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. + */ + +/* + * Performance improvements (Javascript-specific): + * + * Copyright 2016, Joyent Inc + * Author: Alex Wilson + * + * Permission to use, copy, modify, and 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. + */ + +// Ported from OpenBSD bcrypt_pbkdf.c v1.9 + +var BLF_J = 0; + +var Blowfish = function() { + this.S = [ + new Uint32Array([ + 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, + 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99, + 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, + 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, + 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee, + 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013, + 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, + 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e, + 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60, + 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, + 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce, + 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a, + 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, + 0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677, + 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, + 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, + 0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88, + 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239, + 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, + 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0, + 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, + 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, + 0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88, + 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe, + 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, + 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d, + 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b, + 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, + 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba, + 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463, + 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, + 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09, + 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3, + 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, + 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279, + 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8, + 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, + 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82, + 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db, + 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, + 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0, + 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b, + 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, + 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8, + 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, + 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, + 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7, + 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c, + 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, + 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1, + 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, + 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, + 0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477, + 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf, + 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, + 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af, + 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa, + 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, + 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41, + 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, + 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, + 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915, + 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, + 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a]), + new Uint32Array([ + 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, + 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, + 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1, + 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, + 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6, + 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, + 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, + 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1, + 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737, + 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, + 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff, + 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, + 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, + 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7, + 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41, + 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, + 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf, + 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af, + 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, + 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87, + 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, + 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, + 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16, + 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd, + 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, + 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509, + 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, + 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, + 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f, + 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a, + 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, + 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960, + 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66, + 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28, + 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802, + 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84, + 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, + 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf, + 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14, + 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, + 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50, + 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, + 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, + 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281, + 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, + 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, + 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128, + 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, + 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, + 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0, + 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, + 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, + 0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3, + 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285, + 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, + 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061, + 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, + 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, + 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735, + 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, + 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, + 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340, + 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, + 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7]), + new Uint32Array([ + 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, + 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, + 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af, + 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, + 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45, + 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504, + 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, + 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb, + 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee, + 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, + 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42, + 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b, + 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, + 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb, + 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527, + 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, + 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33, + 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c, + 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, + 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc, + 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17, + 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, + 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, + 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115, + 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, + 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728, + 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, + 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, + 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, + 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d, + 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, + 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, + 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, + 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, + 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d, + 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c, + 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, + 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9, + 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a, + 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, + 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d, + 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc, + 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, + 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61, + 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2, + 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, + 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2, + 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c, + 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, + 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633, + 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10, + 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, + 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, + 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027, + 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, + 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62, + 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, + 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, + 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24, + 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc, + 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, + 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, + 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, + 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0]), + new Uint32Array([ + 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, + 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe, + 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b, + 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, + 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8, + 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6, + 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, + 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22, + 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, + 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, + 0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9, + 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59, + 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, + 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51, + 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28, + 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, + 0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b, + 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28, + 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, + 0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd, + 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a, + 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, + 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb, + 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f, + 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, + 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32, + 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680, + 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, + 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae, + 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb, + 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, + 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47, + 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370, + 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, + 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84, + 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048, + 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, + 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd, + 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9, + 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, + 0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38, + 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f, + 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, + 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525, + 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1, + 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, + 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964, + 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e, + 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, + 0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d, + 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f, + 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, + 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02, + 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc, + 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, + 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a, + 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6, + 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, + 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0, + 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060, + 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, + 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9, + 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, + 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6]) + ]; + this.P = new Uint32Array([ + 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, + 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, + 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, + 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, + 0x9216d5d9, 0x8979fb1b]); +}; + +function F(S, x8, i) { + return (((S[0][x8[i+3]] + + S[1][x8[i+2]]) ^ + S[2][x8[i+1]]) + + S[3][x8[i]]); +}; + +Blowfish.prototype.encipher = function(x, x8) { + if (x8 === undefined) { + x8 = new Uint8Array(x.buffer); + if (x.byteOffset !== 0) + x8 = x8.subarray(x.byteOffset); + } + x[0] ^= this.P[0]; + for (var i = 1; i < 16; i += 2) { + x[1] ^= F(this.S, x8, 0) ^ this.P[i]; + x[0] ^= F(this.S, x8, 4) ^ this.P[i+1]; + } + var t = x[0]; + x[0] = x[1] ^ this.P[17]; + x[1] = t; +}; + +Blowfish.prototype.decipher = function(x) { + var x8 = new Uint8Array(x.buffer); + if (x.byteOffset !== 0) + x8 = x8.subarray(x.byteOffset); + x[0] ^= this.P[17]; + for (var i = 16; i > 0; i -= 2) { + x[1] ^= F(this.S, x8, 0) ^ this.P[i]; + x[0] ^= F(this.S, x8, 4) ^ this.P[i-1]; + } + var t = x[0]; + x[0] = x[1] ^ this.P[0]; + x[1] = t; +}; + +function stream2word(data, databytes){ + var i, temp = 0; + for (i = 0; i < 4; i++, BLF_J++) { + if (BLF_J >= databytes) BLF_J = 0; + temp = (temp << 8) | data[BLF_J]; + } + return temp; +}; + +Blowfish.prototype.expand0state = function(key, keybytes) { + var d = new Uint32Array(2), i, k; + var d8 = new Uint8Array(d.buffer); + + for (i = 0, BLF_J = 0; i < 18; i++) { + this.P[i] ^= stream2word(key, keybytes); + } + BLF_J = 0; + + for (i = 0; i < 18; i += 2) { + this.encipher(d, d8); + this.P[i] = d[0]; + this.P[i+1] = d[1]; + } + + for (i = 0; i < 4; i++) { + for (k = 0; k < 256; k += 2) { + this.encipher(d, d8); + this.S[i][k] = d[0]; + this.S[i][k+1] = d[1]; + } + } +}; + +Blowfish.prototype.expandstate = function(data, databytes, key, keybytes) { + var d = new Uint32Array(2), i, k; + + for (i = 0, BLF_J = 0; i < 18; i++) { + this.P[i] ^= stream2word(key, keybytes); + } + + for (i = 0, BLF_J = 0; i < 18; i += 2) { + d[0] ^= stream2word(data, databytes); + d[1] ^= stream2word(data, databytes); + this.encipher(d); + this.P[i] = d[0]; + this.P[i+1] = d[1]; + } + + for (i = 0; i < 4; i++) { + for (k = 0; k < 256; k += 2) { + d[0] ^= stream2word(data, databytes); + d[1] ^= stream2word(data, databytes); + this.encipher(d); + this.S[i][k] = d[0]; + this.S[i][k+1] = d[1]; + } + } + BLF_J = 0; +}; + +Blowfish.prototype.enc = function(data, blocks) { + for (var i = 0; i < blocks; i++) { + this.encipher(data.subarray(i*2)); + } +}; + +Blowfish.prototype.dec = function(data, blocks) { + for (var i = 0; i < blocks; i++) { + this.decipher(data.subarray(i*2)); + } +}; + +var BCRYPT_BLOCKS = 8, + BCRYPT_HASHSIZE = 32; + +function bcrypt_hash(sha2pass, sha2salt, out) { + var state = new Blowfish(), + cdata = new Uint32Array(BCRYPT_BLOCKS), i, + ciphertext = new Uint8Array([79,120,121,99,104,114,111,109,97,116,105, + 99,66,108,111,119,102,105,115,104,83,119,97,116,68,121,110,97,109, + 105,116,101]); //"OxychromaticBlowfishSwatDynamite" + + state.expandstate(sha2salt, 64, sha2pass, 64); + for (i = 0; i < 64; i++) { + state.expand0state(sha2salt, 64); + state.expand0state(sha2pass, 64); + } + + for (i = 0; i < BCRYPT_BLOCKS; i++) + cdata[i] = stream2word(ciphertext, ciphertext.byteLength); + for (i = 0; i < 64; i++) + state.enc(cdata, cdata.byteLength / 8); + + for (i = 0; i < BCRYPT_BLOCKS; i++) { + out[4*i+3] = cdata[i] >>> 24; + out[4*i+2] = cdata[i] >>> 16; + out[4*i+1] = cdata[i] >>> 8; + out[4*i+0] = cdata[i]; + } +}; + +function bcrypt_pbkdf(pass, passlen, salt, saltlen, key, keylen, rounds) { + var sha2pass = new Uint8Array(64), + sha2salt = new Uint8Array(64), + out = new Uint8Array(BCRYPT_HASHSIZE), + tmpout = new Uint8Array(BCRYPT_HASHSIZE), + countsalt = new Uint8Array(saltlen+4), + i, j, amt, stride, dest, count, + origkeylen = keylen; + + if (rounds < 1) + return -1; + if (passlen === 0 || saltlen === 0 || keylen === 0 || + keylen > (out.byteLength * out.byteLength) || saltlen > (1<<20)) + return -1; + + stride = Math.floor((keylen + out.byteLength - 1) / out.byteLength); + amt = Math.floor((keylen + stride - 1) / stride); + + for (i = 0; i < saltlen; i++) + countsalt[i] = salt[i]; + + crypto_hash_sha512(sha2pass, pass, passlen); + + for (count = 1; keylen > 0; count++) { + countsalt[saltlen+0] = count >>> 24; + countsalt[saltlen+1] = count >>> 16; + countsalt[saltlen+2] = count >>> 8; + countsalt[saltlen+3] = count; + + crypto_hash_sha512(sha2salt, countsalt, saltlen + 4); + bcrypt_hash(sha2pass, sha2salt, tmpout); + for (i = out.byteLength; i--;) + out[i] = tmpout[i]; + + for (i = 1; i < rounds; i++) { + crypto_hash_sha512(sha2salt, tmpout, tmpout.byteLength); + bcrypt_hash(sha2pass, sha2salt, tmpout); + for (j = 0; j < out.byteLength; j++) + out[j] ^= tmpout[j]; + } + + amt = Math.min(amt, keylen); + for (i = 0; i < amt; i++) { + dest = i * stride + (count - 1); + if (dest >= origkeylen) + break; + key[dest] = out[i]; + } + keylen -= i; + } + + return 0; +}; + +module.exports = { + BLOCKS: BCRYPT_BLOCKS, + HASHSIZE: BCRYPT_HASHSIZE, + hash: bcrypt_hash, + pbkdf: bcrypt_pbkdf +}; diff --git a/publisher/node_modules/bcrypt-pbkdf/package.json b/publisher/node_modules/bcrypt-pbkdf/package.json new file mode 100644 index 00000000..e93a969b --- /dev/null +++ b/publisher/node_modules/bcrypt-pbkdf/package.json @@ -0,0 +1,15 @@ +{ + "name": "bcrypt-pbkdf", + "version": "1.0.2", + "description": "Port of the OpenBSD bcrypt_pbkdf function to pure JS", + "repository": { + "type": "git", + "url": "git://github.com/joyent/node-bcrypt-pbkdf.git" + }, + "main": "index.js", + "dependencies": { + "tweetnacl": "^0.14.3" + }, + "devDependencies": {}, + "license": "BSD-3-Clause" +} diff --git a/publisher/node_modules/bluebird/LICENSE b/publisher/node_modules/bluebird/LICENSE new file mode 100644 index 00000000..b24e6350 --- /dev/null +++ b/publisher/node_modules/bluebird/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2013-2018 Petka Antonov + +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. diff --git a/publisher/node_modules/bluebird/README.md b/publisher/node_modules/bluebird/README.md new file mode 100644 index 00000000..7c1dd661 --- /dev/null +++ b/publisher/node_modules/bluebird/README.md @@ -0,0 +1,57 @@ + + Promises/A+ logo + + + +[![Build Status](https://travis-ci.org/petkaantonov/bluebird.svg?branch=master)](https://travis-ci.org/petkaantonov/bluebird) +[![coverage-98%](https://img.shields.io/badge/coverage-98%25-brightgreen.svg?style=flat)](http://petkaantonov.github.io/bluebird/coverage/debug/index.html) + +**Got a question?** Join us on [stackoverflow](http://stackoverflow.com/questions/tagged/bluebird), the [mailing list](https://groups.google.com/forum/#!forum/bluebird-js) or chat on [IRC](https://webchat.freenode.net/?channels=#promises) + +# Introduction + +Bluebird is a fully featured promise library with focus on innovative features and performance + +See the [**bluebird website**](http://bluebirdjs.com/docs/getting-started.html) for further documentation, references and instructions. See the [**API reference**](http://bluebirdjs.com/docs/api-reference.html) here. + +For bluebird 2.x documentation and files, see the [2.x tree](https://github.com/petkaantonov/bluebird/tree/2.x). + +### Note + +Promises in Node.js 10 are significantly faster than before. Bluebird still includes a lot of features like cancellation, iteration methods and warnings that native promises don't. If you are using Bluebird for performance rather than for those - please consider giving native promises a shot and running the benchmarks yourself. + +# Questions and issues + +The [github issue tracker](https://github.com/petkaantonov/bluebird/issues) is **_only_** for bug reports and feature requests. Anything else, such as questions for help in using the library, should be posted in [StackOverflow](http://stackoverflow.com/questions/tagged/bluebird) under tags `promise` and `bluebird`. + + + +## Thanks + +Thanks to BrowserStack for providing us with a free account which lets us support old browsers like IE8. + +# License + +The MIT License (MIT) + +Copyright (c) 2013-2019 Petka Antonov + +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. + diff --git a/publisher/node_modules/bluebird/changelog.md b/publisher/node_modules/bluebird/changelog.md new file mode 100644 index 00000000..73b2eb6c --- /dev/null +++ b/publisher/node_modules/bluebird/changelog.md @@ -0,0 +1 @@ +[http://bluebirdjs.com/docs/changelog.html](http://bluebirdjs.com/docs/changelog.html) diff --git a/publisher/node_modules/bluebird/js/browser/bluebird.core.js b/publisher/node_modules/bluebird/js/browser/bluebird.core.js new file mode 100644 index 00000000..24a8bf28 --- /dev/null +++ b/publisher/node_modules/bluebird/js/browser/bluebird.core.js @@ -0,0 +1,3914 @@ +/* @preserve + * The MIT License (MIT) + * + * Copyright (c) 2013-2018 Petka Antonov + * + * 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. + * + */ +/** + * bluebird build version 3.7.2 + * Features enabled: core + * Features disabled: race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each +*/ +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.Promise=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof _dereq_=="function"&&_dereq_;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof _dereq_=="function"&&_dereq_;for(var o=0;o 0) { + _drainQueueStep(queue); + } +} + +function _drainQueueStep(queue) { + var fn = queue.shift(); + if (typeof fn !== "function") { + fn._settlePromises(); + } else { + var receiver = queue.shift(); + var arg = queue.shift(); + fn.call(receiver, arg); + } +} + +Async.prototype._drainQueues = function () { + _drainQueue(this._normalQueue); + this._reset(); + this._haveDrainedQueues = true; + _drainQueue(this._lateQueue); +}; + +Async.prototype._queueTick = function () { + if (!this._isTickUsed) { + this._isTickUsed = true; + this._schedule(this.drainQueues); + } +}; + +Async.prototype._reset = function () { + this._isTickUsed = false; +}; + +module.exports = Async; +module.exports.firstLineError = firstLineError; + +},{"./queue":17,"./schedule":18}],2:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL, tryConvertToPromise, debug) { +var calledBind = false; +var rejectThis = function(_, e) { + this._reject(e); +}; + +var targetRejected = function(e, context) { + context.promiseRejectionQueued = true; + context.bindingPromise._then(rejectThis, rejectThis, null, this, e); +}; + +var bindingResolved = function(thisArg, context) { + if (((this._bitField & 50397184) === 0)) { + this._resolveCallback(context.target); + } +}; + +var bindingRejected = function(e, context) { + if (!context.promiseRejectionQueued) this._reject(e); +}; + +Promise.prototype.bind = function (thisArg) { + if (!calledBind) { + calledBind = true; + Promise.prototype._propagateFrom = debug.propagateFromFunction(); + Promise.prototype._boundValue = debug.boundValueFunction(); + } + var maybePromise = tryConvertToPromise(thisArg); + var ret = new Promise(INTERNAL); + ret._propagateFrom(this, 1); + var target = this._target(); + ret._setBoundTo(maybePromise); + if (maybePromise instanceof Promise) { + var context = { + promiseRejectionQueued: false, + promise: ret, + target: target, + bindingPromise: maybePromise + }; + target._then(INTERNAL, targetRejected, undefined, ret, context); + maybePromise._then( + bindingResolved, bindingRejected, undefined, ret, context); + ret._setOnCancel(maybePromise); + } else { + ret._resolveCallback(target); + } + return ret; +}; + +Promise.prototype._setBoundTo = function (obj) { + if (obj !== undefined) { + this._bitField = this._bitField | 2097152; + this._boundTo = obj; + } else { + this._bitField = this._bitField & (~2097152); + } +}; + +Promise.prototype._isBound = function () { + return (this._bitField & 2097152) === 2097152; +}; + +Promise.bind = function (thisArg, value) { + return Promise.resolve(value).bind(thisArg); +}; +}; + +},{}],3:[function(_dereq_,module,exports){ +"use strict"; +var old; +if (typeof Promise !== "undefined") old = Promise; +function noConflict() { + try { if (Promise === bluebird) Promise = old; } + catch (e) {} + return bluebird; +} +var bluebird = _dereq_("./promise")(); +bluebird.noConflict = noConflict; +module.exports = bluebird; + +},{"./promise":15}],4:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, PromiseArray, apiRejection, debug) { +var util = _dereq_("./util"); +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; +var async = Promise._async; + +Promise.prototype["break"] = Promise.prototype.cancel = function() { + if (!debug.cancellation()) return this._warn("cancellation is disabled"); + + var promise = this; + var child = promise; + while (promise._isCancellable()) { + if (!promise._cancelBy(child)) { + if (child._isFollowing()) { + child._followee().cancel(); + } else { + child._cancelBranched(); + } + break; + } + + var parent = promise._cancellationParent; + if (parent == null || !parent._isCancellable()) { + if (promise._isFollowing()) { + promise._followee().cancel(); + } else { + promise._cancelBranched(); + } + break; + } else { + if (promise._isFollowing()) promise._followee().cancel(); + promise._setWillBeCancelled(); + child = promise; + promise = parent; + } + } +}; + +Promise.prototype._branchHasCancelled = function() { + this._branchesRemainingToCancel--; +}; + +Promise.prototype._enoughBranchesHaveCancelled = function() { + return this._branchesRemainingToCancel === undefined || + this._branchesRemainingToCancel <= 0; +}; + +Promise.prototype._cancelBy = function(canceller) { + if (canceller === this) { + this._branchesRemainingToCancel = 0; + this._invokeOnCancel(); + return true; + } else { + this._branchHasCancelled(); + if (this._enoughBranchesHaveCancelled()) { + this._invokeOnCancel(); + return true; + } + } + return false; +}; + +Promise.prototype._cancelBranched = function() { + if (this._enoughBranchesHaveCancelled()) { + this._cancel(); + } +}; + +Promise.prototype._cancel = function() { + if (!this._isCancellable()) return; + this._setCancelled(); + async.invoke(this._cancelPromises, this, undefined); +}; + +Promise.prototype._cancelPromises = function() { + if (this._length() > 0) this._settlePromises(); +}; + +Promise.prototype._unsetOnCancel = function() { + this._onCancelField = undefined; +}; + +Promise.prototype._isCancellable = function() { + return this.isPending() && !this._isCancelled(); +}; + +Promise.prototype.isCancellable = function() { + return this.isPending() && !this.isCancelled(); +}; + +Promise.prototype._doInvokeOnCancel = function(onCancelCallback, internalOnly) { + if (util.isArray(onCancelCallback)) { + for (var i = 0; i < onCancelCallback.length; ++i) { + this._doInvokeOnCancel(onCancelCallback[i], internalOnly); + } + } else if (onCancelCallback !== undefined) { + if (typeof onCancelCallback === "function") { + if (!internalOnly) { + var e = tryCatch(onCancelCallback).call(this._boundValue()); + if (e === errorObj) { + this._attachExtraTrace(e.e); + async.throwLater(e.e); + } + } + } else { + onCancelCallback._resultCancelled(this); + } + } +}; + +Promise.prototype._invokeOnCancel = function() { + var onCancelCallback = this._onCancel(); + this._unsetOnCancel(); + async.invoke(this._doInvokeOnCancel, this, onCancelCallback); +}; + +Promise.prototype._invokeInternalOnCancel = function() { + if (this._isCancellable()) { + this._doInvokeOnCancel(this._onCancel(), true); + this._unsetOnCancel(); + } +}; + +Promise.prototype._resultCancelled = function() { + this.cancel(); +}; + +}; + +},{"./util":21}],5:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(NEXT_FILTER) { +var util = _dereq_("./util"); +var getKeys = _dereq_("./es5").keys; +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; + +function catchFilter(instances, cb, promise) { + return function(e) { + var boundTo = promise._boundValue(); + predicateLoop: for (var i = 0; i < instances.length; ++i) { + var item = instances[i]; + + if (item === Error || + (item != null && item.prototype instanceof Error)) { + if (e instanceof item) { + return tryCatch(cb).call(boundTo, e); + } + } else if (typeof item === "function") { + var matchesPredicate = tryCatch(item).call(boundTo, e); + if (matchesPredicate === errorObj) { + return matchesPredicate; + } else if (matchesPredicate) { + return tryCatch(cb).call(boundTo, e); + } + } else if (util.isObject(e)) { + var keys = getKeys(item); + for (var j = 0; j < keys.length; ++j) { + var key = keys[j]; + if (item[key] != e[key]) { + continue predicateLoop; + } + } + return tryCatch(cb).call(boundTo, e); + } + } + return NEXT_FILTER; + }; +} + +return catchFilter; +}; + +},{"./es5":10,"./util":21}],6:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise) { +var longStackTraces = false; +var contextStack = []; + +Promise.prototype._promiseCreated = function() {}; +Promise.prototype._pushContext = function() {}; +Promise.prototype._popContext = function() {return null;}; +Promise._peekContext = Promise.prototype._peekContext = function() {}; + +function Context() { + this._trace = new Context.CapturedTrace(peekContext()); +} +Context.prototype._pushContext = function () { + if (this._trace !== undefined) { + this._trace._promiseCreated = null; + contextStack.push(this._trace); + } +}; + +Context.prototype._popContext = function () { + if (this._trace !== undefined) { + var trace = contextStack.pop(); + var ret = trace._promiseCreated; + trace._promiseCreated = null; + return ret; + } + return null; +}; + +function createContext() { + if (longStackTraces) return new Context(); +} + +function peekContext() { + var lastIndex = contextStack.length - 1; + if (lastIndex >= 0) { + return contextStack[lastIndex]; + } + return undefined; +} +Context.CapturedTrace = null; +Context.create = createContext; +Context.deactivateLongStackTraces = function() {}; +Context.activateLongStackTraces = function() { + var Promise_pushContext = Promise.prototype._pushContext; + var Promise_popContext = Promise.prototype._popContext; + var Promise_PeekContext = Promise._peekContext; + var Promise_peekContext = Promise.prototype._peekContext; + var Promise_promiseCreated = Promise.prototype._promiseCreated; + Context.deactivateLongStackTraces = function() { + Promise.prototype._pushContext = Promise_pushContext; + Promise.prototype._popContext = Promise_popContext; + Promise._peekContext = Promise_PeekContext; + Promise.prototype._peekContext = Promise_peekContext; + Promise.prototype._promiseCreated = Promise_promiseCreated; + longStackTraces = false; + }; + longStackTraces = true; + Promise.prototype._pushContext = Context.prototype._pushContext; + Promise.prototype._popContext = Context.prototype._popContext; + Promise._peekContext = Promise.prototype._peekContext = peekContext; + Promise.prototype._promiseCreated = function() { + var ctx = this._peekContext(); + if (ctx && ctx._promiseCreated == null) ctx._promiseCreated = this; + }; +}; +return Context; +}; + +},{}],7:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, Context, + enableAsyncHooks, disableAsyncHooks) { +var async = Promise._async; +var Warning = _dereq_("./errors").Warning; +var util = _dereq_("./util"); +var es5 = _dereq_("./es5"); +var canAttachTrace = util.canAttachTrace; +var unhandledRejectionHandled; +var possiblyUnhandledRejection; +var bluebirdFramePattern = + /[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/; +var nodeFramePattern = /\((?:timers\.js):\d+:\d+\)/; +var parseLinePattern = /[\/<\(](.+?):(\d+):(\d+)\)?\s*$/; +var stackFramePattern = null; +var formatStack = null; +var indentStackFrames = false; +var printWarning; +var debugging = !!(util.env("BLUEBIRD_DEBUG") != 0 && + (true || + util.env("BLUEBIRD_DEBUG") || + util.env("NODE_ENV") === "development")); + +var warnings = !!(util.env("BLUEBIRD_WARNINGS") != 0 && + (debugging || util.env("BLUEBIRD_WARNINGS"))); + +var longStackTraces = !!(util.env("BLUEBIRD_LONG_STACK_TRACES") != 0 && + (debugging || util.env("BLUEBIRD_LONG_STACK_TRACES"))); + +var wForgottenReturn = util.env("BLUEBIRD_W_FORGOTTEN_RETURN") != 0 && + (warnings || !!util.env("BLUEBIRD_W_FORGOTTEN_RETURN")); + +var deferUnhandledRejectionCheck; +(function() { + var promises = []; + + function unhandledRejectionCheck() { + for (var i = 0; i < promises.length; ++i) { + promises[i]._notifyUnhandledRejection(); + } + unhandledRejectionClear(); + } + + function unhandledRejectionClear() { + promises.length = 0; + } + + deferUnhandledRejectionCheck = function(promise) { + promises.push(promise); + setTimeout(unhandledRejectionCheck, 1); + }; + + es5.defineProperty(Promise, "_unhandledRejectionCheck", { + value: unhandledRejectionCheck + }); + es5.defineProperty(Promise, "_unhandledRejectionClear", { + value: unhandledRejectionClear + }); +})(); + +Promise.prototype.suppressUnhandledRejections = function() { + var target = this._target(); + target._bitField = ((target._bitField & (~1048576)) | + 524288); +}; + +Promise.prototype._ensurePossibleRejectionHandled = function () { + if ((this._bitField & 524288) !== 0) return; + this._setRejectionIsUnhandled(); + deferUnhandledRejectionCheck(this); +}; + +Promise.prototype._notifyUnhandledRejectionIsHandled = function () { + fireRejectionEvent("rejectionHandled", + unhandledRejectionHandled, undefined, this); +}; + +Promise.prototype._setReturnedNonUndefined = function() { + this._bitField = this._bitField | 268435456; +}; + +Promise.prototype._returnedNonUndefined = function() { + return (this._bitField & 268435456) !== 0; +}; + +Promise.prototype._notifyUnhandledRejection = function () { + if (this._isRejectionUnhandled()) { + var reason = this._settledValue(); + this._setUnhandledRejectionIsNotified(); + fireRejectionEvent("unhandledRejection", + possiblyUnhandledRejection, reason, this); + } +}; + +Promise.prototype._setUnhandledRejectionIsNotified = function () { + this._bitField = this._bitField | 262144; +}; + +Promise.prototype._unsetUnhandledRejectionIsNotified = function () { + this._bitField = this._bitField & (~262144); +}; + +Promise.prototype._isUnhandledRejectionNotified = function () { + return (this._bitField & 262144) > 0; +}; + +Promise.prototype._setRejectionIsUnhandled = function () { + this._bitField = this._bitField | 1048576; +}; + +Promise.prototype._unsetRejectionIsUnhandled = function () { + this._bitField = this._bitField & (~1048576); + if (this._isUnhandledRejectionNotified()) { + this._unsetUnhandledRejectionIsNotified(); + this._notifyUnhandledRejectionIsHandled(); + } +}; + +Promise.prototype._isRejectionUnhandled = function () { + return (this._bitField & 1048576) > 0; +}; + +Promise.prototype._warn = function(message, shouldUseOwnTrace, promise) { + return warn(message, shouldUseOwnTrace, promise || this); +}; + +Promise.onPossiblyUnhandledRejection = function (fn) { + var context = Promise._getContext(); + possiblyUnhandledRejection = util.contextBind(context, fn); +}; + +Promise.onUnhandledRejectionHandled = function (fn) { + var context = Promise._getContext(); + unhandledRejectionHandled = util.contextBind(context, fn); +}; + +var disableLongStackTraces = function() {}; +Promise.longStackTraces = function () { + if (async.haveItemsQueued() && !config.longStackTraces) { + throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + if (!config.longStackTraces && longStackTracesIsSupported()) { + var Promise_captureStackTrace = Promise.prototype._captureStackTrace; + var Promise_attachExtraTrace = Promise.prototype._attachExtraTrace; + var Promise_dereferenceTrace = Promise.prototype._dereferenceTrace; + config.longStackTraces = true; + disableLongStackTraces = function() { + if (async.haveItemsQueued() && !config.longStackTraces) { + throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + Promise.prototype._captureStackTrace = Promise_captureStackTrace; + Promise.prototype._attachExtraTrace = Promise_attachExtraTrace; + Promise.prototype._dereferenceTrace = Promise_dereferenceTrace; + Context.deactivateLongStackTraces(); + config.longStackTraces = false; + }; + Promise.prototype._captureStackTrace = longStackTracesCaptureStackTrace; + Promise.prototype._attachExtraTrace = longStackTracesAttachExtraTrace; + Promise.prototype._dereferenceTrace = longStackTracesDereferenceTrace; + Context.activateLongStackTraces(); + } +}; + +Promise.hasLongStackTraces = function () { + return config.longStackTraces && longStackTracesIsSupported(); +}; + + +var legacyHandlers = { + unhandledrejection: { + before: function() { + var ret = util.global.onunhandledrejection; + util.global.onunhandledrejection = null; + return ret; + }, + after: function(fn) { + util.global.onunhandledrejection = fn; + } + }, + rejectionhandled: { + before: function() { + var ret = util.global.onrejectionhandled; + util.global.onrejectionhandled = null; + return ret; + }, + after: function(fn) { + util.global.onrejectionhandled = fn; + } + } +}; + +var fireDomEvent = (function() { + var dispatch = function(legacy, e) { + if (legacy) { + var fn; + try { + fn = legacy.before(); + return !util.global.dispatchEvent(e); + } finally { + legacy.after(fn); + } + } else { + return !util.global.dispatchEvent(e); + } + }; + try { + if (typeof CustomEvent === "function") { + var event = new CustomEvent("CustomEvent"); + util.global.dispatchEvent(event); + return function(name, event) { + name = name.toLowerCase(); + var eventData = { + detail: event, + cancelable: true + }; + var domEvent = new CustomEvent(name, eventData); + es5.defineProperty( + domEvent, "promise", {value: event.promise}); + es5.defineProperty( + domEvent, "reason", {value: event.reason}); + + return dispatch(legacyHandlers[name], domEvent); + }; + } else if (typeof Event === "function") { + var event = new Event("CustomEvent"); + util.global.dispatchEvent(event); + return function(name, event) { + name = name.toLowerCase(); + var domEvent = new Event(name, { + cancelable: true + }); + domEvent.detail = event; + es5.defineProperty(domEvent, "promise", {value: event.promise}); + es5.defineProperty(domEvent, "reason", {value: event.reason}); + return dispatch(legacyHandlers[name], domEvent); + }; + } else { + var event = document.createEvent("CustomEvent"); + event.initCustomEvent("testingtheevent", false, true, {}); + util.global.dispatchEvent(event); + return function(name, event) { + name = name.toLowerCase(); + var domEvent = document.createEvent("CustomEvent"); + domEvent.initCustomEvent(name, false, true, + event); + return dispatch(legacyHandlers[name], domEvent); + }; + } + } catch (e) {} + return function() { + return false; + }; +})(); + +var fireGlobalEvent = (function() { + if (util.isNode) { + return function() { + return process.emit.apply(process, arguments); + }; + } else { + if (!util.global) { + return function() { + return false; + }; + } + return function(name) { + var methodName = "on" + name.toLowerCase(); + var method = util.global[methodName]; + if (!method) return false; + method.apply(util.global, [].slice.call(arguments, 1)); + return true; + }; + } +})(); + +function generatePromiseLifecycleEventObject(name, promise) { + return {promise: promise}; +} + +var eventToObjectGenerator = { + promiseCreated: generatePromiseLifecycleEventObject, + promiseFulfilled: generatePromiseLifecycleEventObject, + promiseRejected: generatePromiseLifecycleEventObject, + promiseResolved: generatePromiseLifecycleEventObject, + promiseCancelled: generatePromiseLifecycleEventObject, + promiseChained: function(name, promise, child) { + return {promise: promise, child: child}; + }, + warning: function(name, warning) { + return {warning: warning}; + }, + unhandledRejection: function (name, reason, promise) { + return {reason: reason, promise: promise}; + }, + rejectionHandled: generatePromiseLifecycleEventObject +}; + +var activeFireEvent = function (name) { + var globalEventFired = false; + try { + globalEventFired = fireGlobalEvent.apply(null, arguments); + } catch (e) { + async.throwLater(e); + globalEventFired = true; + } + + var domEventFired = false; + try { + domEventFired = fireDomEvent(name, + eventToObjectGenerator[name].apply(null, arguments)); + } catch (e) { + async.throwLater(e); + domEventFired = true; + } + + return domEventFired || globalEventFired; +}; + +Promise.config = function(opts) { + opts = Object(opts); + if ("longStackTraces" in opts) { + if (opts.longStackTraces) { + Promise.longStackTraces(); + } else if (!opts.longStackTraces && Promise.hasLongStackTraces()) { + disableLongStackTraces(); + } + } + if ("warnings" in opts) { + var warningsOption = opts.warnings; + config.warnings = !!warningsOption; + wForgottenReturn = config.warnings; + + if (util.isObject(warningsOption)) { + if ("wForgottenReturn" in warningsOption) { + wForgottenReturn = !!warningsOption.wForgottenReturn; + } + } + } + if ("cancellation" in opts && opts.cancellation && !config.cancellation) { + if (async.haveItemsQueued()) { + throw new Error( + "cannot enable cancellation after promises are in use"); + } + Promise.prototype._clearCancellationData = + cancellationClearCancellationData; + Promise.prototype._propagateFrom = cancellationPropagateFrom; + Promise.prototype._onCancel = cancellationOnCancel; + Promise.prototype._setOnCancel = cancellationSetOnCancel; + Promise.prototype._attachCancellationCallback = + cancellationAttachCancellationCallback; + Promise.prototype._execute = cancellationExecute; + propagateFromFunction = cancellationPropagateFrom; + config.cancellation = true; + } + if ("monitoring" in opts) { + if (opts.monitoring && !config.monitoring) { + config.monitoring = true; + Promise.prototype._fireEvent = activeFireEvent; + } else if (!opts.monitoring && config.monitoring) { + config.monitoring = false; + Promise.prototype._fireEvent = defaultFireEvent; + } + } + if ("asyncHooks" in opts && util.nodeSupportsAsyncResource) { + var prev = config.asyncHooks; + var cur = !!opts.asyncHooks; + if (prev !== cur) { + config.asyncHooks = cur; + if (cur) { + enableAsyncHooks(); + } else { + disableAsyncHooks(); + } + } + } + return Promise; +}; + +function defaultFireEvent() { return false; } + +Promise.prototype._fireEvent = defaultFireEvent; +Promise.prototype._execute = function(executor, resolve, reject) { + try { + executor(resolve, reject); + } catch (e) { + return e; + } +}; +Promise.prototype._onCancel = function () {}; +Promise.prototype._setOnCancel = function (handler) { ; }; +Promise.prototype._attachCancellationCallback = function(onCancel) { + ; +}; +Promise.prototype._captureStackTrace = function () {}; +Promise.prototype._attachExtraTrace = function () {}; +Promise.prototype._dereferenceTrace = function () {}; +Promise.prototype._clearCancellationData = function() {}; +Promise.prototype._propagateFrom = function (parent, flags) { + ; + ; +}; + +function cancellationExecute(executor, resolve, reject) { + var promise = this; + try { + executor(resolve, reject, function(onCancel) { + if (typeof onCancel !== "function") { + throw new TypeError("onCancel must be a function, got: " + + util.toString(onCancel)); + } + promise._attachCancellationCallback(onCancel); + }); + } catch (e) { + return e; + } +} + +function cancellationAttachCancellationCallback(onCancel) { + if (!this._isCancellable()) return this; + + var previousOnCancel = this._onCancel(); + if (previousOnCancel !== undefined) { + if (util.isArray(previousOnCancel)) { + previousOnCancel.push(onCancel); + } else { + this._setOnCancel([previousOnCancel, onCancel]); + } + } else { + this._setOnCancel(onCancel); + } +} + +function cancellationOnCancel() { + return this._onCancelField; +} + +function cancellationSetOnCancel(onCancel) { + this._onCancelField = onCancel; +} + +function cancellationClearCancellationData() { + this._cancellationParent = undefined; + this._onCancelField = undefined; +} + +function cancellationPropagateFrom(parent, flags) { + if ((flags & 1) !== 0) { + this._cancellationParent = parent; + var branchesRemainingToCancel = parent._branchesRemainingToCancel; + if (branchesRemainingToCancel === undefined) { + branchesRemainingToCancel = 0; + } + parent._branchesRemainingToCancel = branchesRemainingToCancel + 1; + } + if ((flags & 2) !== 0 && parent._isBound()) { + this._setBoundTo(parent._boundTo); + } +} + +function bindingPropagateFrom(parent, flags) { + if ((flags & 2) !== 0 && parent._isBound()) { + this._setBoundTo(parent._boundTo); + } +} +var propagateFromFunction = bindingPropagateFrom; + +function boundValueFunction() { + var ret = this._boundTo; + if (ret !== undefined) { + if (ret instanceof Promise) { + if (ret.isFulfilled()) { + return ret.value(); + } else { + return undefined; + } + } + } + return ret; +} + +function longStackTracesCaptureStackTrace() { + this._trace = new CapturedTrace(this._peekContext()); +} + +function longStackTracesAttachExtraTrace(error, ignoreSelf) { + if (canAttachTrace(error)) { + var trace = this._trace; + if (trace !== undefined) { + if (ignoreSelf) trace = trace._parent; + } + if (trace !== undefined) { + trace.attachExtraTrace(error); + } else if (!error.__stackCleaned__) { + var parsed = parseStackAndMessage(error); + util.notEnumerableProp(error, "stack", + parsed.message + "\n" + parsed.stack.join("\n")); + util.notEnumerableProp(error, "__stackCleaned__", true); + } + } +} + +function longStackTracesDereferenceTrace() { + this._trace = undefined; +} + +function checkForgottenReturns(returnValue, promiseCreated, name, promise, + parent) { + if (returnValue === undefined && promiseCreated !== null && + wForgottenReturn) { + if (parent !== undefined && parent._returnedNonUndefined()) return; + if ((promise._bitField & 65535) === 0) return; + + if (name) name = name + " "; + var handlerLine = ""; + var creatorLine = ""; + if (promiseCreated._trace) { + var traceLines = promiseCreated._trace.stack.split("\n"); + var stack = cleanStack(traceLines); + for (var i = stack.length - 1; i >= 0; --i) { + var line = stack[i]; + if (!nodeFramePattern.test(line)) { + var lineMatches = line.match(parseLinePattern); + if (lineMatches) { + handlerLine = "at " + lineMatches[1] + + ":" + lineMatches[2] + ":" + lineMatches[3] + " "; + } + break; + } + } + + if (stack.length > 0) { + var firstUserLine = stack[0]; + for (var i = 0; i < traceLines.length; ++i) { + + if (traceLines[i] === firstUserLine) { + if (i > 0) { + creatorLine = "\n" + traceLines[i - 1]; + } + break; + } + } + + } + } + var msg = "a promise was created in a " + name + + "handler " + handlerLine + "but was not returned from it, " + + "see http://goo.gl/rRqMUw" + + creatorLine; + promise._warn(msg, true, promiseCreated); + } +} + +function deprecated(name, replacement) { + var message = name + + " is deprecated and will be removed in a future version."; + if (replacement) message += " Use " + replacement + " instead."; + return warn(message); +} + +function warn(message, shouldUseOwnTrace, promise) { + if (!config.warnings) return; + var warning = new Warning(message); + var ctx; + if (shouldUseOwnTrace) { + promise._attachExtraTrace(warning); + } else if (config.longStackTraces && (ctx = Promise._peekContext())) { + ctx.attachExtraTrace(warning); + } else { + var parsed = parseStackAndMessage(warning); + warning.stack = parsed.message + "\n" + parsed.stack.join("\n"); + } + + if (!activeFireEvent("warning", warning)) { + formatAndLogError(warning, "", true); + } +} + +function reconstructStack(message, stacks) { + for (var i = 0; i < stacks.length - 1; ++i) { + stacks[i].push("From previous event:"); + stacks[i] = stacks[i].join("\n"); + } + if (i < stacks.length) { + stacks[i] = stacks[i].join("\n"); + } + return message + "\n" + stacks.join("\n"); +} + +function removeDuplicateOrEmptyJumps(stacks) { + for (var i = 0; i < stacks.length; ++i) { + if (stacks[i].length === 0 || + ((i + 1 < stacks.length) && stacks[i][0] === stacks[i+1][0])) { + stacks.splice(i, 1); + i--; + } + } +} + +function removeCommonRoots(stacks) { + var current = stacks[0]; + for (var i = 1; i < stacks.length; ++i) { + var prev = stacks[i]; + var currentLastIndex = current.length - 1; + var currentLastLine = current[currentLastIndex]; + var commonRootMeetPoint = -1; + + for (var j = prev.length - 1; j >= 0; --j) { + if (prev[j] === currentLastLine) { + commonRootMeetPoint = j; + break; + } + } + + for (var j = commonRootMeetPoint; j >= 0; --j) { + var line = prev[j]; + if (current[currentLastIndex] === line) { + current.pop(); + currentLastIndex--; + } else { + break; + } + } + current = prev; + } +} + +function cleanStack(stack) { + var ret = []; + for (var i = 0; i < stack.length; ++i) { + var line = stack[i]; + var isTraceLine = " (No stack trace)" === line || + stackFramePattern.test(line); + var isInternalFrame = isTraceLine && shouldIgnore(line); + if (isTraceLine && !isInternalFrame) { + if (indentStackFrames && line.charAt(0) !== " ") { + line = " " + line; + } + ret.push(line); + } + } + return ret; +} + +function stackFramesAsArray(error) { + var stack = error.stack.replace(/\s+$/g, "").split("\n"); + for (var i = 0; i < stack.length; ++i) { + var line = stack[i]; + if (" (No stack trace)" === line || stackFramePattern.test(line)) { + break; + } + } + if (i > 0 && error.name != "SyntaxError") { + stack = stack.slice(i); + } + return stack; +} + +function parseStackAndMessage(error) { + var stack = error.stack; + var message = error.toString(); + stack = typeof stack === "string" && stack.length > 0 + ? stackFramesAsArray(error) : [" (No stack trace)"]; + return { + message: message, + stack: error.name == "SyntaxError" ? stack : cleanStack(stack) + }; +} + +function formatAndLogError(error, title, isSoft) { + if (typeof console !== "undefined") { + var message; + if (util.isObject(error)) { + var stack = error.stack; + message = title + formatStack(stack, error); + } else { + message = title + String(error); + } + if (typeof printWarning === "function") { + printWarning(message, isSoft); + } else if (typeof console.log === "function" || + typeof console.log === "object") { + console.log(message); + } + } +} + +function fireRejectionEvent(name, localHandler, reason, promise) { + var localEventFired = false; + try { + if (typeof localHandler === "function") { + localEventFired = true; + if (name === "rejectionHandled") { + localHandler(promise); + } else { + localHandler(reason, promise); + } + } + } catch (e) { + async.throwLater(e); + } + + if (name === "unhandledRejection") { + if (!activeFireEvent(name, reason, promise) && !localEventFired) { + formatAndLogError(reason, "Unhandled rejection "); + } + } else { + activeFireEvent(name, promise); + } +} + +function formatNonError(obj) { + var str; + if (typeof obj === "function") { + str = "[function " + + (obj.name || "anonymous") + + "]"; + } else { + str = obj && typeof obj.toString === "function" + ? obj.toString() : util.toString(obj); + var ruselessToString = /\[object [a-zA-Z0-9$_]+\]/; + if (ruselessToString.test(str)) { + try { + var newStr = JSON.stringify(obj); + str = newStr; + } + catch(e) { + + } + } + if (str.length === 0) { + str = "(empty array)"; + } + } + return ("(<" + snip(str) + ">, no stack trace)"); +} + +function snip(str) { + var maxChars = 41; + if (str.length < maxChars) { + return str; + } + return str.substr(0, maxChars - 3) + "..."; +} + +function longStackTracesIsSupported() { + return typeof captureStackTrace === "function"; +} + +var shouldIgnore = function() { return false; }; +var parseLineInfoRegex = /[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/; +function parseLineInfo(line) { + var matches = line.match(parseLineInfoRegex); + if (matches) { + return { + fileName: matches[1], + line: parseInt(matches[2], 10) + }; + } +} + +function setBounds(firstLineError, lastLineError) { + if (!longStackTracesIsSupported()) return; + var firstStackLines = (firstLineError.stack || "").split("\n"); + var lastStackLines = (lastLineError.stack || "").split("\n"); + var firstIndex = -1; + var lastIndex = -1; + var firstFileName; + var lastFileName; + for (var i = 0; i < firstStackLines.length; ++i) { + var result = parseLineInfo(firstStackLines[i]); + if (result) { + firstFileName = result.fileName; + firstIndex = result.line; + break; + } + } + for (var i = 0; i < lastStackLines.length; ++i) { + var result = parseLineInfo(lastStackLines[i]); + if (result) { + lastFileName = result.fileName; + lastIndex = result.line; + break; + } + } + if (firstIndex < 0 || lastIndex < 0 || !firstFileName || !lastFileName || + firstFileName !== lastFileName || firstIndex >= lastIndex) { + return; + } + + shouldIgnore = function(line) { + if (bluebirdFramePattern.test(line)) return true; + var info = parseLineInfo(line); + if (info) { + if (info.fileName === firstFileName && + (firstIndex <= info.line && info.line <= lastIndex)) { + return true; + } + } + return false; + }; +} + +function CapturedTrace(parent) { + this._parent = parent; + this._promisesCreated = 0; + var length = this._length = 1 + (parent === undefined ? 0 : parent._length); + captureStackTrace(this, CapturedTrace); + if (length > 32) this.uncycle(); +} +util.inherits(CapturedTrace, Error); +Context.CapturedTrace = CapturedTrace; + +CapturedTrace.prototype.uncycle = function() { + var length = this._length; + if (length < 2) return; + var nodes = []; + var stackToIndex = {}; + + for (var i = 0, node = this; node !== undefined; ++i) { + nodes.push(node); + node = node._parent; + } + length = this._length = i; + for (var i = length - 1; i >= 0; --i) { + var stack = nodes[i].stack; + if (stackToIndex[stack] === undefined) { + stackToIndex[stack] = i; + } + } + for (var i = 0; i < length; ++i) { + var currentStack = nodes[i].stack; + var index = stackToIndex[currentStack]; + if (index !== undefined && index !== i) { + if (index > 0) { + nodes[index - 1]._parent = undefined; + nodes[index - 1]._length = 1; + } + nodes[i]._parent = undefined; + nodes[i]._length = 1; + var cycleEdgeNode = i > 0 ? nodes[i - 1] : this; + + if (index < length - 1) { + cycleEdgeNode._parent = nodes[index + 1]; + cycleEdgeNode._parent.uncycle(); + cycleEdgeNode._length = + cycleEdgeNode._parent._length + 1; + } else { + cycleEdgeNode._parent = undefined; + cycleEdgeNode._length = 1; + } + var currentChildLength = cycleEdgeNode._length + 1; + for (var j = i - 2; j >= 0; --j) { + nodes[j]._length = currentChildLength; + currentChildLength++; + } + return; + } + } +}; + +CapturedTrace.prototype.attachExtraTrace = function(error) { + if (error.__stackCleaned__) return; + this.uncycle(); + var parsed = parseStackAndMessage(error); + var message = parsed.message; + var stacks = [parsed.stack]; + + var trace = this; + while (trace !== undefined) { + stacks.push(cleanStack(trace.stack.split("\n"))); + trace = trace._parent; + } + removeCommonRoots(stacks); + removeDuplicateOrEmptyJumps(stacks); + util.notEnumerableProp(error, "stack", reconstructStack(message, stacks)); + util.notEnumerableProp(error, "__stackCleaned__", true); +}; + +var captureStackTrace = (function stackDetection() { + var v8stackFramePattern = /^\s*at\s*/; + var v8stackFormatter = function(stack, error) { + if (typeof stack === "string") return stack; + + if (error.name !== undefined && + error.message !== undefined) { + return error.toString(); + } + return formatNonError(error); + }; + + if (typeof Error.stackTraceLimit === "number" && + typeof Error.captureStackTrace === "function") { + Error.stackTraceLimit += 6; + stackFramePattern = v8stackFramePattern; + formatStack = v8stackFormatter; + var captureStackTrace = Error.captureStackTrace; + + shouldIgnore = function(line) { + return bluebirdFramePattern.test(line); + }; + return function(receiver, ignoreUntil) { + Error.stackTraceLimit += 6; + captureStackTrace(receiver, ignoreUntil); + Error.stackTraceLimit -= 6; + }; + } + var err = new Error(); + + if (typeof err.stack === "string" && + err.stack.split("\n")[0].indexOf("stackDetection@") >= 0) { + stackFramePattern = /@/; + formatStack = v8stackFormatter; + indentStackFrames = true; + return function captureStackTrace(o) { + o.stack = new Error().stack; + }; + } + + var hasStackAfterThrow; + try { throw new Error(); } + catch(e) { + hasStackAfterThrow = ("stack" in e); + } + if (!("stack" in err) && hasStackAfterThrow && + typeof Error.stackTraceLimit === "number") { + stackFramePattern = v8stackFramePattern; + formatStack = v8stackFormatter; + return function captureStackTrace(o) { + Error.stackTraceLimit += 6; + try { throw new Error(); } + catch(e) { o.stack = e.stack; } + Error.stackTraceLimit -= 6; + }; + } + + formatStack = function(stack, error) { + if (typeof stack === "string") return stack; + + if ((typeof error === "object" || + typeof error === "function") && + error.name !== undefined && + error.message !== undefined) { + return error.toString(); + } + return formatNonError(error); + }; + + return null; + +})([]); + +if (typeof console !== "undefined" && typeof console.warn !== "undefined") { + printWarning = function (message) { + console.warn(message); + }; + if (util.isNode && process.stderr.isTTY) { + printWarning = function(message, isSoft) { + var color = isSoft ? "\u001b[33m" : "\u001b[31m"; + console.warn(color + message + "\u001b[0m\n"); + }; + } else if (!util.isNode && typeof (new Error().stack) === "string") { + printWarning = function(message, isSoft) { + console.warn("%c" + message, + isSoft ? "color: darkorange" : "color: red"); + }; + } +} + +var config = { + warnings: warnings, + longStackTraces: false, + cancellation: false, + monitoring: false, + asyncHooks: false +}; + +if (longStackTraces) Promise.longStackTraces(); + +return { + asyncHooks: function() { + return config.asyncHooks; + }, + longStackTraces: function() { + return config.longStackTraces; + }, + warnings: function() { + return config.warnings; + }, + cancellation: function() { + return config.cancellation; + }, + monitoring: function() { + return config.monitoring; + }, + propagateFromFunction: function() { + return propagateFromFunction; + }, + boundValueFunction: function() { + return boundValueFunction; + }, + checkForgottenReturns: checkForgottenReturns, + setBounds: setBounds, + warn: warn, + deprecated: deprecated, + CapturedTrace: CapturedTrace, + fireDomEvent: fireDomEvent, + fireGlobalEvent: fireGlobalEvent +}; +}; + +},{"./errors":9,"./es5":10,"./util":21}],8:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise) { +function returner() { + return this.value; +} +function thrower() { + throw this.reason; +} + +Promise.prototype["return"] = +Promise.prototype.thenReturn = function (value) { + if (value instanceof Promise) value.suppressUnhandledRejections(); + return this._then( + returner, undefined, undefined, {value: value}, undefined); +}; + +Promise.prototype["throw"] = +Promise.prototype.thenThrow = function (reason) { + return this._then( + thrower, undefined, undefined, {reason: reason}, undefined); +}; + +Promise.prototype.catchThrow = function (reason) { + if (arguments.length <= 1) { + return this._then( + undefined, thrower, undefined, {reason: reason}, undefined); + } else { + var _reason = arguments[1]; + var handler = function() {throw _reason;}; + return this.caught(reason, handler); + } +}; + +Promise.prototype.catchReturn = function (value) { + if (arguments.length <= 1) { + if (value instanceof Promise) value.suppressUnhandledRejections(); + return this._then( + undefined, returner, undefined, {value: value}, undefined); + } else { + var _value = arguments[1]; + if (_value instanceof Promise) _value.suppressUnhandledRejections(); + var handler = function() {return _value;}; + return this.caught(value, handler); + } +}; +}; + +},{}],9:[function(_dereq_,module,exports){ +"use strict"; +var es5 = _dereq_("./es5"); +var Objectfreeze = es5.freeze; +var util = _dereq_("./util"); +var inherits = util.inherits; +var notEnumerableProp = util.notEnumerableProp; + +function subError(nameProperty, defaultMessage) { + function SubError(message) { + if (!(this instanceof SubError)) return new SubError(message); + notEnumerableProp(this, "message", + typeof message === "string" ? message : defaultMessage); + notEnumerableProp(this, "name", nameProperty); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + Error.call(this); + } + } + inherits(SubError, Error); + return SubError; +} + +var _TypeError, _RangeError; +var Warning = subError("Warning", "warning"); +var CancellationError = subError("CancellationError", "cancellation error"); +var TimeoutError = subError("TimeoutError", "timeout error"); +var AggregateError = subError("AggregateError", "aggregate error"); +try { + _TypeError = TypeError; + _RangeError = RangeError; +} catch(e) { + _TypeError = subError("TypeError", "type error"); + _RangeError = subError("RangeError", "range error"); +} + +var methods = ("join pop push shift unshift slice filter forEach some " + + "every map indexOf lastIndexOf reduce reduceRight sort reverse").split(" "); + +for (var i = 0; i < methods.length; ++i) { + if (typeof Array.prototype[methods[i]] === "function") { + AggregateError.prototype[methods[i]] = Array.prototype[methods[i]]; + } +} + +es5.defineProperty(AggregateError.prototype, "length", { + value: 0, + configurable: false, + writable: true, + enumerable: true +}); +AggregateError.prototype["isOperational"] = true; +var level = 0; +AggregateError.prototype.toString = function() { + var indent = Array(level * 4 + 1).join(" "); + var ret = "\n" + indent + "AggregateError of:" + "\n"; + level++; + indent = Array(level * 4 + 1).join(" "); + for (var i = 0; i < this.length; ++i) { + var str = this[i] === this ? "[Circular AggregateError]" : this[i] + ""; + var lines = str.split("\n"); + for (var j = 0; j < lines.length; ++j) { + lines[j] = indent + lines[j]; + } + str = lines.join("\n"); + ret += str + "\n"; + } + level--; + return ret; +}; + +function OperationalError(message) { + if (!(this instanceof OperationalError)) + return new OperationalError(message); + notEnumerableProp(this, "name", "OperationalError"); + notEnumerableProp(this, "message", message); + this.cause = message; + this["isOperational"] = true; + + if (message instanceof Error) { + notEnumerableProp(this, "message", message.message); + notEnumerableProp(this, "stack", message.stack); + } else if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + +} +inherits(OperationalError, Error); + +var errorTypes = Error["__BluebirdErrorTypes__"]; +if (!errorTypes) { + errorTypes = Objectfreeze({ + CancellationError: CancellationError, + TimeoutError: TimeoutError, + OperationalError: OperationalError, + RejectionError: OperationalError, + AggregateError: AggregateError + }); + es5.defineProperty(Error, "__BluebirdErrorTypes__", { + value: errorTypes, + writable: false, + enumerable: false, + configurable: false + }); +} + +module.exports = { + Error: Error, + TypeError: _TypeError, + RangeError: _RangeError, + CancellationError: errorTypes.CancellationError, + OperationalError: errorTypes.OperationalError, + TimeoutError: errorTypes.TimeoutError, + AggregateError: errorTypes.AggregateError, + Warning: Warning +}; + +},{"./es5":10,"./util":21}],10:[function(_dereq_,module,exports){ +var isES5 = (function(){ + "use strict"; + return this === undefined; +})(); + +if (isES5) { + module.exports = { + freeze: Object.freeze, + defineProperty: Object.defineProperty, + getDescriptor: Object.getOwnPropertyDescriptor, + keys: Object.keys, + names: Object.getOwnPropertyNames, + getPrototypeOf: Object.getPrototypeOf, + isArray: Array.isArray, + isES5: isES5, + propertyIsWritable: function(obj, prop) { + var descriptor = Object.getOwnPropertyDescriptor(obj, prop); + return !!(!descriptor || descriptor.writable || descriptor.set); + } + }; +} else { + var has = {}.hasOwnProperty; + var str = {}.toString; + var proto = {}.constructor.prototype; + + var ObjectKeys = function (o) { + var ret = []; + for (var key in o) { + if (has.call(o, key)) { + ret.push(key); + } + } + return ret; + }; + + var ObjectGetDescriptor = function(o, key) { + return {value: o[key]}; + }; + + var ObjectDefineProperty = function (o, key, desc) { + o[key] = desc.value; + return o; + }; + + var ObjectFreeze = function (obj) { + return obj; + }; + + var ObjectGetPrototypeOf = function (obj) { + try { + return Object(obj).constructor.prototype; + } + catch (e) { + return proto; + } + }; + + var ArrayIsArray = function (obj) { + try { + return str.call(obj) === "[object Array]"; + } + catch(e) { + return false; + } + }; + + module.exports = { + isArray: ArrayIsArray, + keys: ObjectKeys, + names: ObjectKeys, + defineProperty: ObjectDefineProperty, + getDescriptor: ObjectGetDescriptor, + freeze: ObjectFreeze, + getPrototypeOf: ObjectGetPrototypeOf, + isES5: isES5, + propertyIsWritable: function() { + return true; + } + }; +} + +},{}],11:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, tryConvertToPromise, NEXT_FILTER) { +var util = _dereq_("./util"); +var CancellationError = Promise.CancellationError; +var errorObj = util.errorObj; +var catchFilter = _dereq_("./catch_filter")(NEXT_FILTER); + +function PassThroughHandlerContext(promise, type, handler) { + this.promise = promise; + this.type = type; + this.handler = handler; + this.called = false; + this.cancelPromise = null; +} + +PassThroughHandlerContext.prototype.isFinallyHandler = function() { + return this.type === 0; +}; + +function FinallyHandlerCancelReaction(finallyHandler) { + this.finallyHandler = finallyHandler; +} + +FinallyHandlerCancelReaction.prototype._resultCancelled = function() { + checkCancel(this.finallyHandler); +}; + +function checkCancel(ctx, reason) { + if (ctx.cancelPromise != null) { + if (arguments.length > 1) { + ctx.cancelPromise._reject(reason); + } else { + ctx.cancelPromise._cancel(); + } + ctx.cancelPromise = null; + return true; + } + return false; +} + +function succeed() { + return finallyHandler.call(this, this.promise._target()._settledValue()); +} +function fail(reason) { + if (checkCancel(this, reason)) return; + errorObj.e = reason; + return errorObj; +} +function finallyHandler(reasonOrValue) { + var promise = this.promise; + var handler = this.handler; + + if (!this.called) { + this.called = true; + var ret = this.isFinallyHandler() + ? handler.call(promise._boundValue()) + : handler.call(promise._boundValue(), reasonOrValue); + if (ret === NEXT_FILTER) { + return ret; + } else if (ret !== undefined) { + promise._setReturnedNonUndefined(); + var maybePromise = tryConvertToPromise(ret, promise); + if (maybePromise instanceof Promise) { + if (this.cancelPromise != null) { + if (maybePromise._isCancelled()) { + var reason = + new CancellationError("late cancellation observer"); + promise._attachExtraTrace(reason); + errorObj.e = reason; + return errorObj; + } else if (maybePromise.isPending()) { + maybePromise._attachCancellationCallback( + new FinallyHandlerCancelReaction(this)); + } + } + return maybePromise._then( + succeed, fail, undefined, this, undefined); + } + } + } + + if (promise.isRejected()) { + checkCancel(this); + errorObj.e = reasonOrValue; + return errorObj; + } else { + checkCancel(this); + return reasonOrValue; + } +} + +Promise.prototype._passThrough = function(handler, type, success, fail) { + if (typeof handler !== "function") return this.then(); + return this._then(success, + fail, + undefined, + new PassThroughHandlerContext(this, type, handler), + undefined); +}; + +Promise.prototype.lastly = +Promise.prototype["finally"] = function (handler) { + return this._passThrough(handler, + 0, + finallyHandler, + finallyHandler); +}; + + +Promise.prototype.tap = function (handler) { + return this._passThrough(handler, 1, finallyHandler); +}; + +Promise.prototype.tapCatch = function (handlerOrPredicate) { + var len = arguments.length; + if(len === 1) { + return this._passThrough(handlerOrPredicate, + 1, + undefined, + finallyHandler); + } else { + var catchInstances = new Array(len - 1), + j = 0, i; + for (i = 0; i < len - 1; ++i) { + var item = arguments[i]; + if (util.isObject(item)) { + catchInstances[j++] = item; + } else { + return Promise.reject(new TypeError( + "tapCatch statement predicate: " + + "expecting an object but got " + util.classString(item) + )); + } + } + catchInstances.length = j; + var handler = arguments[i]; + return this._passThrough(catchFilter(catchInstances, handler, this), + 1, + undefined, + finallyHandler); + } + +}; + +return PassThroughHandlerContext; +}; + +},{"./catch_filter":5,"./util":21}],12:[function(_dereq_,module,exports){ +"use strict"; +module.exports = +function(Promise, PromiseArray, tryConvertToPromise, INTERNAL, async) { +var util = _dereq_("./util"); +var canEvaluate = util.canEvaluate; +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; +var reject; + +if (!true) { +if (canEvaluate) { + var thenCallback = function(i) { + return new Function("value", "holder", " \n\ + 'use strict'; \n\ + holder.pIndex = value; \n\ + holder.checkFulfillment(this); \n\ + ".replace(/Index/g, i)); + }; + + var promiseSetter = function(i) { + return new Function("promise", "holder", " \n\ + 'use strict'; \n\ + holder.pIndex = promise; \n\ + ".replace(/Index/g, i)); + }; + + var generateHolderClass = function(total) { + var props = new Array(total); + for (var i = 0; i < props.length; ++i) { + props[i] = "this.p" + (i+1); + } + var assignment = props.join(" = ") + " = null;"; + var cancellationCode= "var promise;\n" + props.map(function(prop) { + return " \n\ + promise = " + prop + "; \n\ + if (promise instanceof Promise) { \n\ + promise.cancel(); \n\ + } \n\ + "; + }).join("\n"); + var passedArguments = props.join(", "); + var name = "Holder$" + total; + + + var code = "return function(tryCatch, errorObj, Promise, async) { \n\ + 'use strict'; \n\ + function [TheName](fn) { \n\ + [TheProperties] \n\ + this.fn = fn; \n\ + this.asyncNeeded = true; \n\ + this.now = 0; \n\ + } \n\ + \n\ + [TheName].prototype._callFunction = function(promise) { \n\ + promise._pushContext(); \n\ + var ret = tryCatch(this.fn)([ThePassedArguments]); \n\ + promise._popContext(); \n\ + if (ret === errorObj) { \n\ + promise._rejectCallback(ret.e, false); \n\ + } else { \n\ + promise._resolveCallback(ret); \n\ + } \n\ + }; \n\ + \n\ + [TheName].prototype.checkFulfillment = function(promise) { \n\ + var now = ++this.now; \n\ + if (now === [TheTotal]) { \n\ + if (this.asyncNeeded) { \n\ + async.invoke(this._callFunction, this, promise); \n\ + } else { \n\ + this._callFunction(promise); \n\ + } \n\ + \n\ + } \n\ + }; \n\ + \n\ + [TheName].prototype._resultCancelled = function() { \n\ + [CancellationCode] \n\ + }; \n\ + \n\ + return [TheName]; \n\ + }(tryCatch, errorObj, Promise, async); \n\ + "; + + code = code.replace(/\[TheName\]/g, name) + .replace(/\[TheTotal\]/g, total) + .replace(/\[ThePassedArguments\]/g, passedArguments) + .replace(/\[TheProperties\]/g, assignment) + .replace(/\[CancellationCode\]/g, cancellationCode); + + return new Function("tryCatch", "errorObj", "Promise", "async", code) + (tryCatch, errorObj, Promise, async); + }; + + var holderClasses = []; + var thenCallbacks = []; + var promiseSetters = []; + + for (var i = 0; i < 8; ++i) { + holderClasses.push(generateHolderClass(i + 1)); + thenCallbacks.push(thenCallback(i + 1)); + promiseSetters.push(promiseSetter(i + 1)); + } + + reject = function (reason) { + this._reject(reason); + }; +}} + +Promise.join = function () { + var last = arguments.length - 1; + var fn; + if (last > 0 && typeof arguments[last] === "function") { + fn = arguments[last]; + if (!true) { + if (last <= 8 && canEvaluate) { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + var HolderClass = holderClasses[last - 1]; + var holder = new HolderClass(fn); + var callbacks = thenCallbacks; + + for (var i = 0; i < last; ++i) { + var maybePromise = tryConvertToPromise(arguments[i], ret); + if (maybePromise instanceof Promise) { + maybePromise = maybePromise._target(); + var bitField = maybePromise._bitField; + ; + if (((bitField & 50397184) === 0)) { + maybePromise._then(callbacks[i], reject, + undefined, ret, holder); + promiseSetters[i](maybePromise, holder); + holder.asyncNeeded = false; + } else if (((bitField & 33554432) !== 0)) { + callbacks[i].call(ret, + maybePromise._value(), holder); + } else if (((bitField & 16777216) !== 0)) { + ret._reject(maybePromise._reason()); + } else { + ret._cancel(); + } + } else { + callbacks[i].call(ret, maybePromise, holder); + } + } + + if (!ret._isFateSealed()) { + if (holder.asyncNeeded) { + var context = Promise._getContext(); + holder.fn = util.contextBind(context, holder.fn); + } + ret._setAsyncGuaranteed(); + ret._setOnCancel(holder); + } + return ret; + } + } + } + var args = [].slice.call(arguments);; + if (fn) args.pop(); + var ret = new PromiseArray(args).promise(); + return fn !== undefined ? ret.spread(fn) : ret; +}; + +}; + +},{"./util":21}],13:[function(_dereq_,module,exports){ +"use strict"; +module.exports = +function(Promise, INTERNAL, tryConvertToPromise, apiRejection, debug) { +var util = _dereq_("./util"); +var tryCatch = util.tryCatch; + +Promise.method = function (fn) { + if (typeof fn !== "function") { + throw new Promise.TypeError("expecting a function but got " + util.classString(fn)); + } + return function () { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._pushContext(); + var value = tryCatch(fn).apply(this, arguments); + var promiseCreated = ret._popContext(); + debug.checkForgottenReturns( + value, promiseCreated, "Promise.method", ret); + ret._resolveFromSyncValue(value); + return ret; + }; +}; + +Promise.attempt = Promise["try"] = function (fn) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._pushContext(); + var value; + if (arguments.length > 1) { + debug.deprecated("calling Promise.try with more than 1 argument"); + var arg = arguments[1]; + var ctx = arguments[2]; + value = util.isArray(arg) ? tryCatch(fn).apply(ctx, arg) + : tryCatch(fn).call(ctx, arg); + } else { + value = tryCatch(fn)(); + } + var promiseCreated = ret._popContext(); + debug.checkForgottenReturns( + value, promiseCreated, "Promise.try", ret); + ret._resolveFromSyncValue(value); + return ret; +}; + +Promise.prototype._resolveFromSyncValue = function (value) { + if (value === util.errorObj) { + this._rejectCallback(value.e, false); + } else { + this._resolveCallback(value, true); + } +}; +}; + +},{"./util":21}],14:[function(_dereq_,module,exports){ +"use strict"; +var util = _dereq_("./util"); +var maybeWrapAsError = util.maybeWrapAsError; +var errors = _dereq_("./errors"); +var OperationalError = errors.OperationalError; +var es5 = _dereq_("./es5"); + +function isUntypedError(obj) { + return obj instanceof Error && + es5.getPrototypeOf(obj) === Error.prototype; +} + +var rErrorKey = /^(?:name|message|stack|cause)$/; +function wrapAsOperationalError(obj) { + var ret; + if (isUntypedError(obj)) { + ret = new OperationalError(obj); + ret.name = obj.name; + ret.message = obj.message; + ret.stack = obj.stack; + var keys = es5.keys(obj); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (!rErrorKey.test(key)) { + ret[key] = obj[key]; + } + } + return ret; + } + util.markAsOriginatingFromRejection(obj); + return obj; +} + +function nodebackForPromise(promise, multiArgs) { + return function(err, value) { + if (promise === null) return; + if (err) { + var wrapped = wrapAsOperationalError(maybeWrapAsError(err)); + promise._attachExtraTrace(wrapped); + promise._reject(wrapped); + } else if (!multiArgs) { + promise._fulfill(value); + } else { + var args = [].slice.call(arguments, 1);; + promise._fulfill(args); + } + promise = null; + }; +} + +module.exports = nodebackForPromise; + +},{"./errors":9,"./es5":10,"./util":21}],15:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function() { +var makeSelfResolutionError = function () { + return new TypeError("circular promise resolution chain\u000a\u000a See http://goo.gl/MqrFmX\u000a"); +}; +var reflectHandler = function() { + return new Promise.PromiseInspection(this._target()); +}; +var apiRejection = function(msg) { + return Promise.reject(new TypeError(msg)); +}; +function Proxyable() {} +var UNDEFINED_BINDING = {}; +var util = _dereq_("./util"); +util.setReflectHandler(reflectHandler); + +var getDomain = function() { + var domain = process.domain; + if (domain === undefined) { + return null; + } + return domain; +}; +var getContextDefault = function() { + return null; +}; +var getContextDomain = function() { + return { + domain: getDomain(), + async: null + }; +}; +var AsyncResource = util.isNode && util.nodeSupportsAsyncResource ? + _dereq_("async_hooks").AsyncResource : null; +var getContextAsyncHooks = function() { + return { + domain: getDomain(), + async: new AsyncResource("Bluebird::Promise") + }; +}; +var getContext = util.isNode ? getContextDomain : getContextDefault; +util.notEnumerableProp(Promise, "_getContext", getContext); +var enableAsyncHooks = function() { + getContext = getContextAsyncHooks; + util.notEnumerableProp(Promise, "_getContext", getContextAsyncHooks); +}; +var disableAsyncHooks = function() { + getContext = getContextDomain; + util.notEnumerableProp(Promise, "_getContext", getContextDomain); +}; + +var es5 = _dereq_("./es5"); +var Async = _dereq_("./async"); +var async = new Async(); +es5.defineProperty(Promise, "_async", {value: async}); +var errors = _dereq_("./errors"); +var TypeError = Promise.TypeError = errors.TypeError; +Promise.RangeError = errors.RangeError; +var CancellationError = Promise.CancellationError = errors.CancellationError; +Promise.TimeoutError = errors.TimeoutError; +Promise.OperationalError = errors.OperationalError; +Promise.RejectionError = errors.OperationalError; +Promise.AggregateError = errors.AggregateError; +var INTERNAL = function(){}; +var APPLY = {}; +var NEXT_FILTER = {}; +var tryConvertToPromise = _dereq_("./thenables")(Promise, INTERNAL); +var PromiseArray = + _dereq_("./promise_array")(Promise, INTERNAL, + tryConvertToPromise, apiRejection, Proxyable); +var Context = _dereq_("./context")(Promise); + /*jshint unused:false*/ +var createContext = Context.create; + +var debug = _dereq_("./debuggability")(Promise, Context, + enableAsyncHooks, disableAsyncHooks); +var CapturedTrace = debug.CapturedTrace; +var PassThroughHandlerContext = + _dereq_("./finally")(Promise, tryConvertToPromise, NEXT_FILTER); +var catchFilter = _dereq_("./catch_filter")(NEXT_FILTER); +var nodebackForPromise = _dereq_("./nodeback"); +var errorObj = util.errorObj; +var tryCatch = util.tryCatch; +function check(self, executor) { + if (self == null || self.constructor !== Promise) { + throw new TypeError("the promise constructor cannot be invoked directly\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + if (typeof executor !== "function") { + throw new TypeError("expecting a function but got " + util.classString(executor)); + } + +} + +function Promise(executor) { + if (executor !== INTERNAL) { + check(this, executor); + } + this._bitField = 0; + this._fulfillmentHandler0 = undefined; + this._rejectionHandler0 = undefined; + this._promise0 = undefined; + this._receiver0 = undefined; + this._resolveFromExecutor(executor); + this._promiseCreated(); + this._fireEvent("promiseCreated", this); +} + +Promise.prototype.toString = function () { + return "[object Promise]"; +}; + +Promise.prototype.caught = Promise.prototype["catch"] = function (fn) { + var len = arguments.length; + if (len > 1) { + var catchInstances = new Array(len - 1), + j = 0, i; + for (i = 0; i < len - 1; ++i) { + var item = arguments[i]; + if (util.isObject(item)) { + catchInstances[j++] = item; + } else { + return apiRejection("Catch statement predicate: " + + "expecting an object but got " + util.classString(item)); + } + } + catchInstances.length = j; + fn = arguments[i]; + + if (typeof fn !== "function") { + throw new TypeError("The last argument to .catch() " + + "must be a function, got " + util.toString(fn)); + } + return this.then(undefined, catchFilter(catchInstances, fn, this)); + } + return this.then(undefined, fn); +}; + +Promise.prototype.reflect = function () { + return this._then(reflectHandler, + reflectHandler, undefined, this, undefined); +}; + +Promise.prototype.then = function (didFulfill, didReject) { + if (debug.warnings() && arguments.length > 0 && + typeof didFulfill !== "function" && + typeof didReject !== "function") { + var msg = ".then() only accepts functions but was passed: " + + util.classString(didFulfill); + if (arguments.length > 1) { + msg += ", " + util.classString(didReject); + } + this._warn(msg); + } + return this._then(didFulfill, didReject, undefined, undefined, undefined); +}; + +Promise.prototype.done = function (didFulfill, didReject) { + var promise = + this._then(didFulfill, didReject, undefined, undefined, undefined); + promise._setIsFinal(); +}; + +Promise.prototype.spread = function (fn) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + return this.all()._then(fn, undefined, undefined, APPLY, undefined); +}; + +Promise.prototype.toJSON = function () { + var ret = { + isFulfilled: false, + isRejected: false, + fulfillmentValue: undefined, + rejectionReason: undefined + }; + if (this.isFulfilled()) { + ret.fulfillmentValue = this.value(); + ret.isFulfilled = true; + } else if (this.isRejected()) { + ret.rejectionReason = this.reason(); + ret.isRejected = true; + } + return ret; +}; + +Promise.prototype.all = function () { + if (arguments.length > 0) { + this._warn(".all() was passed arguments but it does not take any"); + } + return new PromiseArray(this).promise(); +}; + +Promise.prototype.error = function (fn) { + return this.caught(util.originatesFromRejection, fn); +}; + +Promise.getNewLibraryCopy = module.exports; + +Promise.is = function (val) { + return val instanceof Promise; +}; + +Promise.fromNode = Promise.fromCallback = function(fn) { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + var multiArgs = arguments.length > 1 ? !!Object(arguments[1]).multiArgs + : false; + var result = tryCatch(fn)(nodebackForPromise(ret, multiArgs)); + if (result === errorObj) { + ret._rejectCallback(result.e, true); + } + if (!ret._isFateSealed()) ret._setAsyncGuaranteed(); + return ret; +}; + +Promise.all = function (promises) { + return new PromiseArray(promises).promise(); +}; + +Promise.cast = function (obj) { + var ret = tryConvertToPromise(obj); + if (!(ret instanceof Promise)) { + ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._setFulfilled(); + ret._rejectionHandler0 = obj; + } + return ret; +}; + +Promise.resolve = Promise.fulfilled = Promise.cast; + +Promise.reject = Promise.rejected = function (reason) { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._rejectCallback(reason, true); + return ret; +}; + +Promise.setScheduler = function(fn) { + if (typeof fn !== "function") { + throw new TypeError("expecting a function but got " + util.classString(fn)); + } + return async.setScheduler(fn); +}; + +Promise.prototype._then = function ( + didFulfill, + didReject, + _, receiver, + internalData +) { + var haveInternalData = internalData !== undefined; + var promise = haveInternalData ? internalData : new Promise(INTERNAL); + var target = this._target(); + var bitField = target._bitField; + + if (!haveInternalData) { + promise._propagateFrom(this, 3); + promise._captureStackTrace(); + if (receiver === undefined && + ((this._bitField & 2097152) !== 0)) { + if (!((bitField & 50397184) === 0)) { + receiver = this._boundValue(); + } else { + receiver = target === this ? undefined : this._boundTo; + } + } + this._fireEvent("promiseChained", this, promise); + } + + var context = getContext(); + if (!((bitField & 50397184) === 0)) { + var handler, value, settler = target._settlePromiseCtx; + if (((bitField & 33554432) !== 0)) { + value = target._rejectionHandler0; + handler = didFulfill; + } else if (((bitField & 16777216) !== 0)) { + value = target._fulfillmentHandler0; + handler = didReject; + target._unsetRejectionIsUnhandled(); + } else { + settler = target._settlePromiseLateCancellationObserver; + value = new CancellationError("late cancellation observer"); + target._attachExtraTrace(value); + handler = didReject; + } + + async.invoke(settler, target, { + handler: util.contextBind(context, handler), + promise: promise, + receiver: receiver, + value: value + }); + } else { + target._addCallbacks(didFulfill, didReject, promise, + receiver, context); + } + + return promise; +}; + +Promise.prototype._length = function () { + return this._bitField & 65535; +}; + +Promise.prototype._isFateSealed = function () { + return (this._bitField & 117506048) !== 0; +}; + +Promise.prototype._isFollowing = function () { + return (this._bitField & 67108864) === 67108864; +}; + +Promise.prototype._setLength = function (len) { + this._bitField = (this._bitField & -65536) | + (len & 65535); +}; + +Promise.prototype._setFulfilled = function () { + this._bitField = this._bitField | 33554432; + this._fireEvent("promiseFulfilled", this); +}; + +Promise.prototype._setRejected = function () { + this._bitField = this._bitField | 16777216; + this._fireEvent("promiseRejected", this); +}; + +Promise.prototype._setFollowing = function () { + this._bitField = this._bitField | 67108864; + this._fireEvent("promiseResolved", this); +}; + +Promise.prototype._setIsFinal = function () { + this._bitField = this._bitField | 4194304; +}; + +Promise.prototype._isFinal = function () { + return (this._bitField & 4194304) > 0; +}; + +Promise.prototype._unsetCancelled = function() { + this._bitField = this._bitField & (~65536); +}; + +Promise.prototype._setCancelled = function() { + this._bitField = this._bitField | 65536; + this._fireEvent("promiseCancelled", this); +}; + +Promise.prototype._setWillBeCancelled = function() { + this._bitField = this._bitField | 8388608; +}; + +Promise.prototype._setAsyncGuaranteed = function() { + if (async.hasCustomScheduler()) return; + var bitField = this._bitField; + this._bitField = bitField | + (((bitField & 536870912) >> 2) ^ + 134217728); +}; + +Promise.prototype._setNoAsyncGuarantee = function() { + this._bitField = (this._bitField | 536870912) & + (~134217728); +}; + +Promise.prototype._receiverAt = function (index) { + var ret = index === 0 ? this._receiver0 : this[ + index * 4 - 4 + 3]; + if (ret === UNDEFINED_BINDING) { + return undefined; + } else if (ret === undefined && this._isBound()) { + return this._boundValue(); + } + return ret; +}; + +Promise.prototype._promiseAt = function (index) { + return this[ + index * 4 - 4 + 2]; +}; + +Promise.prototype._fulfillmentHandlerAt = function (index) { + return this[ + index * 4 - 4 + 0]; +}; + +Promise.prototype._rejectionHandlerAt = function (index) { + return this[ + index * 4 - 4 + 1]; +}; + +Promise.prototype._boundValue = function() {}; + +Promise.prototype._migrateCallback0 = function (follower) { + var bitField = follower._bitField; + var fulfill = follower._fulfillmentHandler0; + var reject = follower._rejectionHandler0; + var promise = follower._promise0; + var receiver = follower._receiverAt(0); + if (receiver === undefined) receiver = UNDEFINED_BINDING; + this._addCallbacks(fulfill, reject, promise, receiver, null); +}; + +Promise.prototype._migrateCallbackAt = function (follower, index) { + var fulfill = follower._fulfillmentHandlerAt(index); + var reject = follower._rejectionHandlerAt(index); + var promise = follower._promiseAt(index); + var receiver = follower._receiverAt(index); + if (receiver === undefined) receiver = UNDEFINED_BINDING; + this._addCallbacks(fulfill, reject, promise, receiver, null); +}; + +Promise.prototype._addCallbacks = function ( + fulfill, + reject, + promise, + receiver, + context +) { + var index = this._length(); + + if (index >= 65535 - 4) { + index = 0; + this._setLength(0); + } + + if (index === 0) { + this._promise0 = promise; + this._receiver0 = receiver; + if (typeof fulfill === "function") { + this._fulfillmentHandler0 = util.contextBind(context, fulfill); + } + if (typeof reject === "function") { + this._rejectionHandler0 = util.contextBind(context, reject); + } + } else { + var base = index * 4 - 4; + this[base + 2] = promise; + this[base + 3] = receiver; + if (typeof fulfill === "function") { + this[base + 0] = + util.contextBind(context, fulfill); + } + if (typeof reject === "function") { + this[base + 1] = + util.contextBind(context, reject); + } + } + this._setLength(index + 1); + return index; +}; + +Promise.prototype._proxy = function (proxyable, arg) { + this._addCallbacks(undefined, undefined, arg, proxyable, null); +}; + +Promise.prototype._resolveCallback = function(value, shouldBind) { + if (((this._bitField & 117506048) !== 0)) return; + if (value === this) + return this._rejectCallback(makeSelfResolutionError(), false); + var maybePromise = tryConvertToPromise(value, this); + if (!(maybePromise instanceof Promise)) return this._fulfill(value); + + if (shouldBind) this._propagateFrom(maybePromise, 2); + + + var promise = maybePromise._target(); + + if (promise === this) { + this._reject(makeSelfResolutionError()); + return; + } + + var bitField = promise._bitField; + if (((bitField & 50397184) === 0)) { + var len = this._length(); + if (len > 0) promise._migrateCallback0(this); + for (var i = 1; i < len; ++i) { + promise._migrateCallbackAt(this, i); + } + this._setFollowing(); + this._setLength(0); + this._setFollowee(maybePromise); + } else if (((bitField & 33554432) !== 0)) { + this._fulfill(promise._value()); + } else if (((bitField & 16777216) !== 0)) { + this._reject(promise._reason()); + } else { + var reason = new CancellationError("late cancellation observer"); + promise._attachExtraTrace(reason); + this._reject(reason); + } +}; + +Promise.prototype._rejectCallback = +function(reason, synchronous, ignoreNonErrorWarnings) { + var trace = util.ensureErrorObject(reason); + var hasStack = trace === reason; + if (!hasStack && !ignoreNonErrorWarnings && debug.warnings()) { + var message = "a promise was rejected with a non-error: " + + util.classString(reason); + this._warn(message, true); + } + this._attachExtraTrace(trace, synchronous ? hasStack : false); + this._reject(reason); +}; + +Promise.prototype._resolveFromExecutor = function (executor) { + if (executor === INTERNAL) return; + var promise = this; + this._captureStackTrace(); + this._pushContext(); + var synchronous = true; + var r = this._execute(executor, function(value) { + promise._resolveCallback(value); + }, function (reason) { + promise._rejectCallback(reason, synchronous); + }); + synchronous = false; + this._popContext(); + + if (r !== undefined) { + promise._rejectCallback(r, true); + } +}; + +Promise.prototype._settlePromiseFromHandler = function ( + handler, receiver, value, promise +) { + var bitField = promise._bitField; + if (((bitField & 65536) !== 0)) return; + promise._pushContext(); + var x; + if (receiver === APPLY) { + if (!value || typeof value.length !== "number") { + x = errorObj; + x.e = new TypeError("cannot .spread() a non-array: " + + util.classString(value)); + } else { + x = tryCatch(handler).apply(this._boundValue(), value); + } + } else { + x = tryCatch(handler).call(receiver, value); + } + var promiseCreated = promise._popContext(); + bitField = promise._bitField; + if (((bitField & 65536) !== 0)) return; + + if (x === NEXT_FILTER) { + promise._reject(value); + } else if (x === errorObj) { + promise._rejectCallback(x.e, false); + } else { + debug.checkForgottenReturns(x, promiseCreated, "", promise, this); + promise._resolveCallback(x); + } +}; + +Promise.prototype._target = function() { + var ret = this; + while (ret._isFollowing()) ret = ret._followee(); + return ret; +}; + +Promise.prototype._followee = function() { + return this._rejectionHandler0; +}; + +Promise.prototype._setFollowee = function(promise) { + this._rejectionHandler0 = promise; +}; + +Promise.prototype._settlePromise = function(promise, handler, receiver, value) { + var isPromise = promise instanceof Promise; + var bitField = this._bitField; + var asyncGuaranteed = ((bitField & 134217728) !== 0); + if (((bitField & 65536) !== 0)) { + if (isPromise) promise._invokeInternalOnCancel(); + + if (receiver instanceof PassThroughHandlerContext && + receiver.isFinallyHandler()) { + receiver.cancelPromise = promise; + if (tryCatch(handler).call(receiver, value) === errorObj) { + promise._reject(errorObj.e); + } + } else if (handler === reflectHandler) { + promise._fulfill(reflectHandler.call(receiver)); + } else if (receiver instanceof Proxyable) { + receiver._promiseCancelled(promise); + } else if (isPromise || promise instanceof PromiseArray) { + promise._cancel(); + } else { + receiver.cancel(); + } + } else if (typeof handler === "function") { + if (!isPromise) { + handler.call(receiver, value, promise); + } else { + if (asyncGuaranteed) promise._setAsyncGuaranteed(); + this._settlePromiseFromHandler(handler, receiver, value, promise); + } + } else if (receiver instanceof Proxyable) { + if (!receiver._isResolved()) { + if (((bitField & 33554432) !== 0)) { + receiver._promiseFulfilled(value, promise); + } else { + receiver._promiseRejected(value, promise); + } + } + } else if (isPromise) { + if (asyncGuaranteed) promise._setAsyncGuaranteed(); + if (((bitField & 33554432) !== 0)) { + promise._fulfill(value); + } else { + promise._reject(value); + } + } +}; + +Promise.prototype._settlePromiseLateCancellationObserver = function(ctx) { + var handler = ctx.handler; + var promise = ctx.promise; + var receiver = ctx.receiver; + var value = ctx.value; + if (typeof handler === "function") { + if (!(promise instanceof Promise)) { + handler.call(receiver, value, promise); + } else { + this._settlePromiseFromHandler(handler, receiver, value, promise); + } + } else if (promise instanceof Promise) { + promise._reject(value); + } +}; + +Promise.prototype._settlePromiseCtx = function(ctx) { + this._settlePromise(ctx.promise, ctx.handler, ctx.receiver, ctx.value); +}; + +Promise.prototype._settlePromise0 = function(handler, value, bitField) { + var promise = this._promise0; + var receiver = this._receiverAt(0); + this._promise0 = undefined; + this._receiver0 = undefined; + this._settlePromise(promise, handler, receiver, value); +}; + +Promise.prototype._clearCallbackDataAtIndex = function(index) { + var base = index * 4 - 4; + this[base + 2] = + this[base + 3] = + this[base + 0] = + this[base + 1] = undefined; +}; + +Promise.prototype._fulfill = function (value) { + var bitField = this._bitField; + if (((bitField & 117506048) >>> 16)) return; + if (value === this) { + var err = makeSelfResolutionError(); + this._attachExtraTrace(err); + return this._reject(err); + } + this._setFulfilled(); + this._rejectionHandler0 = value; + + if ((bitField & 65535) > 0) { + if (((bitField & 134217728) !== 0)) { + this._settlePromises(); + } else { + async.settlePromises(this); + } + this._dereferenceTrace(); + } +}; + +Promise.prototype._reject = function (reason) { + var bitField = this._bitField; + if (((bitField & 117506048) >>> 16)) return; + this._setRejected(); + this._fulfillmentHandler0 = reason; + + if (this._isFinal()) { + return async.fatalError(reason, util.isNode); + } + + if ((bitField & 65535) > 0) { + async.settlePromises(this); + } else { + this._ensurePossibleRejectionHandled(); + } +}; + +Promise.prototype._fulfillPromises = function (len, value) { + for (var i = 1; i < len; i++) { + var handler = this._fulfillmentHandlerAt(i); + var promise = this._promiseAt(i); + var receiver = this._receiverAt(i); + this._clearCallbackDataAtIndex(i); + this._settlePromise(promise, handler, receiver, value); + } +}; + +Promise.prototype._rejectPromises = function (len, reason) { + for (var i = 1; i < len; i++) { + var handler = this._rejectionHandlerAt(i); + var promise = this._promiseAt(i); + var receiver = this._receiverAt(i); + this._clearCallbackDataAtIndex(i); + this._settlePromise(promise, handler, receiver, reason); + } +}; + +Promise.prototype._settlePromises = function () { + var bitField = this._bitField; + var len = (bitField & 65535); + + if (len > 0) { + if (((bitField & 16842752) !== 0)) { + var reason = this._fulfillmentHandler0; + this._settlePromise0(this._rejectionHandler0, reason, bitField); + this._rejectPromises(len, reason); + } else { + var value = this._rejectionHandler0; + this._settlePromise0(this._fulfillmentHandler0, value, bitField); + this._fulfillPromises(len, value); + } + this._setLength(0); + } + this._clearCancellationData(); +}; + +Promise.prototype._settledValue = function() { + var bitField = this._bitField; + if (((bitField & 33554432) !== 0)) { + return this._rejectionHandler0; + } else if (((bitField & 16777216) !== 0)) { + return this._fulfillmentHandler0; + } +}; + +if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + es5.defineProperty(Promise.prototype, Symbol.toStringTag, { + get: function () { + return "Object"; + } + }); +} + +function deferResolve(v) {this.promise._resolveCallback(v);} +function deferReject(v) {this.promise._rejectCallback(v, false);} + +Promise.defer = Promise.pending = function() { + debug.deprecated("Promise.defer", "new Promise"); + var promise = new Promise(INTERNAL); + return { + promise: promise, + resolve: deferResolve, + reject: deferReject + }; +}; + +util.notEnumerableProp(Promise, + "_makeSelfResolutionError", + makeSelfResolutionError); + +_dereq_("./method")(Promise, INTERNAL, tryConvertToPromise, apiRejection, + debug); +_dereq_("./bind")(Promise, INTERNAL, tryConvertToPromise, debug); +_dereq_("./cancel")(Promise, PromiseArray, apiRejection, debug); +_dereq_("./direct_resolve")(Promise); +_dereq_("./synchronous_inspection")(Promise); +_dereq_("./join")( + Promise, PromiseArray, tryConvertToPromise, INTERNAL, async); +Promise.Promise = Promise; +Promise.version = "3.7.2"; + + util.toFastProperties(Promise); + util.toFastProperties(Promise.prototype); + function fillTypes(value) { + var p = new Promise(INTERNAL); + p._fulfillmentHandler0 = value; + p._rejectionHandler0 = value; + p._promise0 = value; + p._receiver0 = value; + } + // Complete slack tracking, opt out of field-type tracking and + // stabilize map + fillTypes({a: 1}); + fillTypes({b: 2}); + fillTypes({c: 3}); + fillTypes(1); + fillTypes(function(){}); + fillTypes(undefined); + fillTypes(false); + fillTypes(new Promise(INTERNAL)); + debug.setBounds(Async.firstLineError, util.lastLineError); + return Promise; + +}; + +},{"./async":1,"./bind":2,"./cancel":4,"./catch_filter":5,"./context":6,"./debuggability":7,"./direct_resolve":8,"./errors":9,"./es5":10,"./finally":11,"./join":12,"./method":13,"./nodeback":14,"./promise_array":16,"./synchronous_inspection":19,"./thenables":20,"./util":21,"async_hooks":undefined}],16:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL, tryConvertToPromise, + apiRejection, Proxyable) { +var util = _dereq_("./util"); +var isArray = util.isArray; + +function toResolutionValue(val) { + switch(val) { + case -2: return []; + case -3: return {}; + case -6: return new Map(); + } +} + +function PromiseArray(values) { + var promise = this._promise = new Promise(INTERNAL); + if (values instanceof Promise) { + promise._propagateFrom(values, 3); + values.suppressUnhandledRejections(); + } + promise._setOnCancel(this); + this._values = values; + this._length = 0; + this._totalResolved = 0; + this._init(undefined, -2); +} +util.inherits(PromiseArray, Proxyable); + +PromiseArray.prototype.length = function () { + return this._length; +}; + +PromiseArray.prototype.promise = function () { + return this._promise; +}; + +PromiseArray.prototype._init = function init(_, resolveValueIfEmpty) { + var values = tryConvertToPromise(this._values, this._promise); + if (values instanceof Promise) { + values = values._target(); + var bitField = values._bitField; + ; + this._values = values; + + if (((bitField & 50397184) === 0)) { + this._promise._setAsyncGuaranteed(); + return values._then( + init, + this._reject, + undefined, + this, + resolveValueIfEmpty + ); + } else if (((bitField & 33554432) !== 0)) { + values = values._value(); + } else if (((bitField & 16777216) !== 0)) { + return this._reject(values._reason()); + } else { + return this._cancel(); + } + } + values = util.asArray(values); + if (values === null) { + var err = apiRejection( + "expecting an array or an iterable object but got " + util.classString(values)).reason(); + this._promise._rejectCallback(err, false); + return; + } + + if (values.length === 0) { + if (resolveValueIfEmpty === -5) { + this._resolveEmptyArray(); + } + else { + this._resolve(toResolutionValue(resolveValueIfEmpty)); + } + return; + } + this._iterate(values); +}; + +PromiseArray.prototype._iterate = function(values) { + var len = this.getActualLength(values.length); + this._length = len; + this._values = this.shouldCopyValues() ? new Array(len) : this._values; + var result = this._promise; + var isResolved = false; + var bitField = null; + for (var i = 0; i < len; ++i) { + var maybePromise = tryConvertToPromise(values[i], result); + + if (maybePromise instanceof Promise) { + maybePromise = maybePromise._target(); + bitField = maybePromise._bitField; + } else { + bitField = null; + } + + if (isResolved) { + if (bitField !== null) { + maybePromise.suppressUnhandledRejections(); + } + } else if (bitField !== null) { + if (((bitField & 50397184) === 0)) { + maybePromise._proxy(this, i); + this._values[i] = maybePromise; + } else if (((bitField & 33554432) !== 0)) { + isResolved = this._promiseFulfilled(maybePromise._value(), i); + } else if (((bitField & 16777216) !== 0)) { + isResolved = this._promiseRejected(maybePromise._reason(), i); + } else { + isResolved = this._promiseCancelled(i); + } + } else { + isResolved = this._promiseFulfilled(maybePromise, i); + } + } + if (!isResolved) result._setAsyncGuaranteed(); +}; + +PromiseArray.prototype._isResolved = function () { + return this._values === null; +}; + +PromiseArray.prototype._resolve = function (value) { + this._values = null; + this._promise._fulfill(value); +}; + +PromiseArray.prototype._cancel = function() { + if (this._isResolved() || !this._promise._isCancellable()) return; + this._values = null; + this._promise._cancel(); +}; + +PromiseArray.prototype._reject = function (reason) { + this._values = null; + this._promise._rejectCallback(reason, false); +}; + +PromiseArray.prototype._promiseFulfilled = function (value, index) { + this._values[index] = value; + var totalResolved = ++this._totalResolved; + if (totalResolved >= this._length) { + this._resolve(this._values); + return true; + } + return false; +}; + +PromiseArray.prototype._promiseCancelled = function() { + this._cancel(); + return true; +}; + +PromiseArray.prototype._promiseRejected = function (reason) { + this._totalResolved++; + this._reject(reason); + return true; +}; + +PromiseArray.prototype._resultCancelled = function() { + if (this._isResolved()) return; + var values = this._values; + this._cancel(); + if (values instanceof Promise) { + values.cancel(); + } else { + for (var i = 0; i < values.length; ++i) { + if (values[i] instanceof Promise) { + values[i].cancel(); + } + } + } +}; + +PromiseArray.prototype.shouldCopyValues = function () { + return true; +}; + +PromiseArray.prototype.getActualLength = function (len) { + return len; +}; + +return PromiseArray; +}; + +},{"./util":21}],17:[function(_dereq_,module,exports){ +"use strict"; +function arrayMove(src, srcIndex, dst, dstIndex, len) { + for (var j = 0; j < len; ++j) { + dst[j + dstIndex] = src[j + srcIndex]; + src[j + srcIndex] = void 0; + } +} + +function Queue(capacity) { + this._capacity = capacity; + this._length = 0; + this._front = 0; +} + +Queue.prototype._willBeOverCapacity = function (size) { + return this._capacity < size; +}; + +Queue.prototype._pushOne = function (arg) { + var length = this.length(); + this._checkCapacity(length + 1); + var i = (this._front + length) & (this._capacity - 1); + this[i] = arg; + this._length = length + 1; +}; + +Queue.prototype.push = function (fn, receiver, arg) { + var length = this.length() + 3; + if (this._willBeOverCapacity(length)) { + this._pushOne(fn); + this._pushOne(receiver); + this._pushOne(arg); + return; + } + var j = this._front + length - 3; + this._checkCapacity(length); + var wrapMask = this._capacity - 1; + this[(j + 0) & wrapMask] = fn; + this[(j + 1) & wrapMask] = receiver; + this[(j + 2) & wrapMask] = arg; + this._length = length; +}; + +Queue.prototype.shift = function () { + var front = this._front, + ret = this[front]; + + this[front] = undefined; + this._front = (front + 1) & (this._capacity - 1); + this._length--; + return ret; +}; + +Queue.prototype.length = function () { + return this._length; +}; + +Queue.prototype._checkCapacity = function (size) { + if (this._capacity < size) { + this._resizeTo(this._capacity << 1); + } +}; + +Queue.prototype._resizeTo = function (capacity) { + var oldCapacity = this._capacity; + this._capacity = capacity; + var front = this._front; + var length = this._length; + var moveItemsCount = (front + length) & (oldCapacity - 1); + arrayMove(this, 0, this, oldCapacity, moveItemsCount); +}; + +module.exports = Queue; + +},{}],18:[function(_dereq_,module,exports){ +"use strict"; +var util = _dereq_("./util"); +var schedule; +var noAsyncScheduler = function() { + throw new Error("No async scheduler available\u000a\u000a See http://goo.gl/MqrFmX\u000a"); +}; +var NativePromise = util.getNativePromise(); +if (util.isNode && typeof MutationObserver === "undefined") { + var GlobalSetImmediate = global.setImmediate; + var ProcessNextTick = process.nextTick; + schedule = util.isRecentNode + ? function(fn) { GlobalSetImmediate.call(global, fn); } + : function(fn) { ProcessNextTick.call(process, fn); }; +} else if (typeof NativePromise === "function" && + typeof NativePromise.resolve === "function") { + var nativePromise = NativePromise.resolve(); + schedule = function(fn) { + nativePromise.then(fn); + }; +} else if ((typeof MutationObserver !== "undefined") && + !(typeof window !== "undefined" && + window.navigator && + (window.navigator.standalone || window.cordova)) && + ("classList" in document.documentElement)) { + schedule = (function() { + var div = document.createElement("div"); + var opts = {attributes: true}; + var toggleScheduled = false; + var div2 = document.createElement("div"); + var o2 = new MutationObserver(function() { + div.classList.toggle("foo"); + toggleScheduled = false; + }); + o2.observe(div2, opts); + + var scheduleToggle = function() { + if (toggleScheduled) return; + toggleScheduled = true; + div2.classList.toggle("foo"); + }; + + return function schedule(fn) { + var o = new MutationObserver(function() { + o.disconnect(); + fn(); + }); + o.observe(div, opts); + scheduleToggle(); + }; + })(); +} else if (typeof setImmediate !== "undefined") { + schedule = function (fn) { + setImmediate(fn); + }; +} else if (typeof setTimeout !== "undefined") { + schedule = function (fn) { + setTimeout(fn, 0); + }; +} else { + schedule = noAsyncScheduler; +} +module.exports = schedule; + +},{"./util":21}],19:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise) { +function PromiseInspection(promise) { + if (promise !== undefined) { + promise = promise._target(); + this._bitField = promise._bitField; + this._settledValueField = promise._isFateSealed() + ? promise._settledValue() : undefined; + } + else { + this._bitField = 0; + this._settledValueField = undefined; + } +} + +PromiseInspection.prototype._settledValue = function() { + return this._settledValueField; +}; + +var value = PromiseInspection.prototype.value = function () { + if (!this.isFulfilled()) { + throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + return this._settledValue(); +}; + +var reason = PromiseInspection.prototype.error = +PromiseInspection.prototype.reason = function () { + if (!this.isRejected()) { + throw new TypeError("cannot get rejection reason of a non-rejected promise\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + return this._settledValue(); +}; + +var isFulfilled = PromiseInspection.prototype.isFulfilled = function() { + return (this._bitField & 33554432) !== 0; +}; + +var isRejected = PromiseInspection.prototype.isRejected = function () { + return (this._bitField & 16777216) !== 0; +}; + +var isPending = PromiseInspection.prototype.isPending = function () { + return (this._bitField & 50397184) === 0; +}; + +var isResolved = PromiseInspection.prototype.isResolved = function () { + return (this._bitField & 50331648) !== 0; +}; + +PromiseInspection.prototype.isCancelled = function() { + return (this._bitField & 8454144) !== 0; +}; + +Promise.prototype.__isCancelled = function() { + return (this._bitField & 65536) === 65536; +}; + +Promise.prototype._isCancelled = function() { + return this._target().__isCancelled(); +}; + +Promise.prototype.isCancelled = function() { + return (this._target()._bitField & 8454144) !== 0; +}; + +Promise.prototype.isPending = function() { + return isPending.call(this._target()); +}; + +Promise.prototype.isRejected = function() { + return isRejected.call(this._target()); +}; + +Promise.prototype.isFulfilled = function() { + return isFulfilled.call(this._target()); +}; + +Promise.prototype.isResolved = function() { + return isResolved.call(this._target()); +}; + +Promise.prototype.value = function() { + return value.call(this._target()); +}; + +Promise.prototype.reason = function() { + var target = this._target(); + target._unsetRejectionIsUnhandled(); + return reason.call(target); +}; + +Promise.prototype._value = function() { + return this._settledValue(); +}; + +Promise.prototype._reason = function() { + this._unsetRejectionIsUnhandled(); + return this._settledValue(); +}; + +Promise.PromiseInspection = PromiseInspection; +}; + +},{}],20:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var util = _dereq_("./util"); +var errorObj = util.errorObj; +var isObject = util.isObject; + +function tryConvertToPromise(obj, context) { + if (isObject(obj)) { + if (obj instanceof Promise) return obj; + var then = getThen(obj); + if (then === errorObj) { + if (context) context._pushContext(); + var ret = Promise.reject(then.e); + if (context) context._popContext(); + return ret; + } else if (typeof then === "function") { + if (isAnyBluebirdPromise(obj)) { + var ret = new Promise(INTERNAL); + obj._then( + ret._fulfill, + ret._reject, + undefined, + ret, + null + ); + return ret; + } + return doThenable(obj, then, context); + } + } + return obj; +} + +function doGetThen(obj) { + return obj.then; +} + +function getThen(obj) { + try { + return doGetThen(obj); + } catch (e) { + errorObj.e = e; + return errorObj; + } +} + +var hasProp = {}.hasOwnProperty; +function isAnyBluebirdPromise(obj) { + try { + return hasProp.call(obj, "_promise0"); + } catch (e) { + return false; + } +} + +function doThenable(x, then, context) { + var promise = new Promise(INTERNAL); + var ret = promise; + if (context) context._pushContext(); + promise._captureStackTrace(); + if (context) context._popContext(); + var synchronous = true; + var result = util.tryCatch(then).call(x, resolve, reject); + synchronous = false; + + if (promise && result === errorObj) { + promise._rejectCallback(result.e, true, true); + promise = null; + } + + function resolve(value) { + if (!promise) return; + promise._resolveCallback(value); + promise = null; + } + + function reject(reason) { + if (!promise) return; + promise._rejectCallback(reason, synchronous, true); + promise = null; + } + return ret; +} + +return tryConvertToPromise; +}; + +},{"./util":21}],21:[function(_dereq_,module,exports){ +"use strict"; +var es5 = _dereq_("./es5"); +var canEvaluate = typeof navigator == "undefined"; + +var errorObj = {e: {}}; +var tryCatchTarget; +var globalObject = typeof self !== "undefined" ? self : + typeof window !== "undefined" ? window : + typeof global !== "undefined" ? global : + this !== undefined ? this : null; + +function tryCatcher() { + try { + var target = tryCatchTarget; + tryCatchTarget = null; + return target.apply(this, arguments); + } catch (e) { + errorObj.e = e; + return errorObj; + } +} +function tryCatch(fn) { + tryCatchTarget = fn; + return tryCatcher; +} + +var inherits = function(Child, Parent) { + var hasProp = {}.hasOwnProperty; + + function T() { + this.constructor = Child; + this.constructor$ = Parent; + for (var propertyName in Parent.prototype) { + if (hasProp.call(Parent.prototype, propertyName) && + propertyName.charAt(propertyName.length-1) !== "$" + ) { + this[propertyName + "$"] = Parent.prototype[propertyName]; + } + } + } + T.prototype = Parent.prototype; + Child.prototype = new T(); + return Child.prototype; +}; + + +function isPrimitive(val) { + return val == null || val === true || val === false || + typeof val === "string" || typeof val === "number"; + +} + +function isObject(value) { + return typeof value === "function" || + typeof value === "object" && value !== null; +} + +function maybeWrapAsError(maybeError) { + if (!isPrimitive(maybeError)) return maybeError; + + return new Error(safeToString(maybeError)); +} + +function withAppended(target, appendee) { + var len = target.length; + var ret = new Array(len + 1); + var i; + for (i = 0; i < len; ++i) { + ret[i] = target[i]; + } + ret[i] = appendee; + return ret; +} + +function getDataPropertyOrDefault(obj, key, defaultValue) { + if (es5.isES5) { + var desc = Object.getOwnPropertyDescriptor(obj, key); + + if (desc != null) { + return desc.get == null && desc.set == null + ? desc.value + : defaultValue; + } + } else { + return {}.hasOwnProperty.call(obj, key) ? obj[key] : undefined; + } +} + +function notEnumerableProp(obj, name, value) { + if (isPrimitive(obj)) return obj; + var descriptor = { + value: value, + configurable: true, + enumerable: false, + writable: true + }; + es5.defineProperty(obj, name, descriptor); + return obj; +} + +function thrower(r) { + throw r; +} + +var inheritedDataKeys = (function() { + var excludedPrototypes = [ + Array.prototype, + Object.prototype, + Function.prototype + ]; + + var isExcludedProto = function(val) { + for (var i = 0; i < excludedPrototypes.length; ++i) { + if (excludedPrototypes[i] === val) { + return true; + } + } + return false; + }; + + if (es5.isES5) { + var getKeys = Object.getOwnPropertyNames; + return function(obj) { + var ret = []; + var visitedKeys = Object.create(null); + while (obj != null && !isExcludedProto(obj)) { + var keys; + try { + keys = getKeys(obj); + } catch (e) { + return ret; + } + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (visitedKeys[key]) continue; + visitedKeys[key] = true; + var desc = Object.getOwnPropertyDescriptor(obj, key); + if (desc != null && desc.get == null && desc.set == null) { + ret.push(key); + } + } + obj = es5.getPrototypeOf(obj); + } + return ret; + }; + } else { + var hasProp = {}.hasOwnProperty; + return function(obj) { + if (isExcludedProto(obj)) return []; + var ret = []; + + /*jshint forin:false */ + enumeration: for (var key in obj) { + if (hasProp.call(obj, key)) { + ret.push(key); + } else { + for (var i = 0; i < excludedPrototypes.length; ++i) { + if (hasProp.call(excludedPrototypes[i], key)) { + continue enumeration; + } + } + ret.push(key); + } + } + return ret; + }; + } + +})(); + +var thisAssignmentPattern = /this\s*\.\s*\S+\s*=/; +function isClass(fn) { + try { + if (typeof fn === "function") { + var keys = es5.names(fn.prototype); + + var hasMethods = es5.isES5 && keys.length > 1; + var hasMethodsOtherThanConstructor = keys.length > 0 && + !(keys.length === 1 && keys[0] === "constructor"); + var hasThisAssignmentAndStaticMethods = + thisAssignmentPattern.test(fn + "") && es5.names(fn).length > 0; + + if (hasMethods || hasMethodsOtherThanConstructor || + hasThisAssignmentAndStaticMethods) { + return true; + } + } + return false; + } catch (e) { + return false; + } +} + +function toFastProperties(obj) { + /*jshint -W027,-W055,-W031*/ + function FakeConstructor() {} + FakeConstructor.prototype = obj; + var receiver = new FakeConstructor(); + function ic() { + return typeof receiver.foo; + } + ic(); + ic(); + return obj; + eval(obj); +} + +var rident = /^[a-z$_][a-z$_0-9]*$/i; +function isIdentifier(str) { + return rident.test(str); +} + +function filledRange(count, prefix, suffix) { + var ret = new Array(count); + for(var i = 0; i < count; ++i) { + ret[i] = prefix + i + suffix; + } + return ret; +} + +function safeToString(obj) { + try { + return obj + ""; + } catch (e) { + return "[no string representation]"; + } +} + +function isError(obj) { + return obj instanceof Error || + (obj !== null && + typeof obj === "object" && + typeof obj.message === "string" && + typeof obj.name === "string"); +} + +function markAsOriginatingFromRejection(e) { + try { + notEnumerableProp(e, "isOperational", true); + } + catch(ignore) {} +} + +function originatesFromRejection(e) { + if (e == null) return false; + return ((e instanceof Error["__BluebirdErrorTypes__"].OperationalError) || + e["isOperational"] === true); +} + +function canAttachTrace(obj) { + return isError(obj) && es5.propertyIsWritable(obj, "stack"); +} + +var ensureErrorObject = (function() { + if (!("stack" in new Error())) { + return function(value) { + if (canAttachTrace(value)) return value; + try {throw new Error(safeToString(value));} + catch(err) {return err;} + }; + } else { + return function(value) { + if (canAttachTrace(value)) return value; + return new Error(safeToString(value)); + }; + } +})(); + +function classString(obj) { + return {}.toString.call(obj); +} + +function copyDescriptors(from, to, filter) { + var keys = es5.names(from); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (filter(key)) { + try { + es5.defineProperty(to, key, es5.getDescriptor(from, key)); + } catch (ignore) {} + } + } +} + +var asArray = function(v) { + if (es5.isArray(v)) { + return v; + } + return null; +}; + +if (typeof Symbol !== "undefined" && Symbol.iterator) { + var ArrayFrom = typeof Array.from === "function" ? function(v) { + return Array.from(v); + } : function(v) { + var ret = []; + var it = v[Symbol.iterator](); + var itResult; + while (!((itResult = it.next()).done)) { + ret.push(itResult.value); + } + return ret; + }; + + asArray = function(v) { + if (es5.isArray(v)) { + return v; + } else if (v != null && typeof v[Symbol.iterator] === "function") { + return ArrayFrom(v); + } + return null; + }; +} + +var isNode = typeof process !== "undefined" && + classString(process).toLowerCase() === "[object process]"; + +var hasEnvVariables = typeof process !== "undefined" && + typeof process.env !== "undefined"; + +function env(key) { + return hasEnvVariables ? process.env[key] : undefined; +} + +function getNativePromise() { + if (typeof Promise === "function") { + try { + var promise = new Promise(function(){}); + if (classString(promise) === "[object Promise]") { + return Promise; + } + } catch (e) {} + } +} + +var reflectHandler; +function contextBind(ctx, cb) { + if (ctx === null || + typeof cb !== "function" || + cb === reflectHandler) { + return cb; + } + + if (ctx.domain !== null) { + cb = ctx.domain.bind(cb); + } + + var async = ctx.async; + if (async !== null) { + var old = cb; + cb = function() { + var args = (new Array(2)).concat([].slice.call(arguments));; + args[0] = old; + args[1] = this; + return async.runInAsyncScope.apply(async, args); + }; + } + return cb; +} + +var ret = { + setReflectHandler: function(fn) { + reflectHandler = fn; + }, + isClass: isClass, + isIdentifier: isIdentifier, + inheritedDataKeys: inheritedDataKeys, + getDataPropertyOrDefault: getDataPropertyOrDefault, + thrower: thrower, + isArray: es5.isArray, + asArray: asArray, + notEnumerableProp: notEnumerableProp, + isPrimitive: isPrimitive, + isObject: isObject, + isError: isError, + canEvaluate: canEvaluate, + errorObj: errorObj, + tryCatch: tryCatch, + inherits: inherits, + withAppended: withAppended, + maybeWrapAsError: maybeWrapAsError, + toFastProperties: toFastProperties, + filledRange: filledRange, + toString: safeToString, + canAttachTrace: canAttachTrace, + ensureErrorObject: ensureErrorObject, + originatesFromRejection: originatesFromRejection, + markAsOriginatingFromRejection: markAsOriginatingFromRejection, + classString: classString, + copyDescriptors: copyDescriptors, + isNode: isNode, + hasEnvVariables: hasEnvVariables, + env: env, + global: globalObject, + getNativePromise: getNativePromise, + contextBind: contextBind +}; +ret.isRecentNode = ret.isNode && (function() { + var version; + if (process.versions && process.versions.node) { + version = process.versions.node.split(".").map(Number); + } else if (process.version) { + version = process.version.split(".").map(Number); + } + return (version[0] === 0 && version[1] > 10) || (version[0] > 0); +})(); +ret.nodeSupportsAsyncResource = ret.isNode && (function() { + var supportsAsync = false; + try { + var res = _dereq_("async_hooks").AsyncResource; + supportsAsync = typeof res.prototype.runInAsyncScope === "function"; + } catch (e) { + supportsAsync = false; + } + return supportsAsync; +})(); + +if (ret.isNode) ret.toFastProperties(process); + +try {throw new Error(); } catch (e) {ret.lastLineError = e;} +module.exports = ret; + +},{"./es5":10,"async_hooks":undefined}]},{},[3])(3) +}); ;if (typeof window !== 'undefined' && window !== null) { window.P = window.Promise; } else if (typeof self !== 'undefined' && self !== null) { self.P = self.Promise; } \ No newline at end of file diff --git a/publisher/node_modules/bluebird/js/browser/bluebird.core.min.js b/publisher/node_modules/bluebird/js/browser/bluebird.core.min.js new file mode 100644 index 00000000..836176e8 --- /dev/null +++ b/publisher/node_modules/bluebird/js/browser/bluebird.core.min.js @@ -0,0 +1,31 @@ +/* @preserve + * The MIT License (MIT) + * + * Copyright (c) 2013-2018 Petka Antonov + * + * 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. + * + */ +/** + * bluebird build version 3.7.2 + * Features enabled: core + * Features disabled: race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each +*/ +!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Promise=t()}}(function(){var t,e,n;return function r(t,e,n){function o(a,s){if(!e[a]){if(!t[a]){var c="function"==typeof _dereq_&&_dereq_;if(!s&&c)return c(a,!0);if(i)return i(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var u=e[a]={exports:{}};t[a][0].call(u.exports,function(e){var n=t[a][1][e];return o(n?n:e)},u,u.exports,r,t,e,n)}return e[a].exports}for(var i="function"==typeof _dereq_&&_dereq_,a=0;a0;)c(t)}function c(t){var e=t.shift();if("function"!=typeof e)e._settlePromises();else{var n=t.shift(),r=t.shift();e.call(n,r)}}var l;try{throw new Error}catch(u){l=u}var p=t("./schedule"),f=t("./queue");r.prototype.setScheduler=function(t){var e=this._schedule;return this._schedule=t,this._customScheduler=!0,e},r.prototype.hasCustomScheduler=function(){return this._customScheduler},r.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},r.prototype.fatalError=function(t,e){e?(process.stderr.write("Fatal "+(t instanceof Error?t.stack:t)+"\n"),process.exit(2)):this.throwLater(t)},r.prototype.throwLater=function(t,e){if(1===arguments.length&&(e=t,t=function(){throw e}),"undefined"!=typeof setTimeout)setTimeout(function(){t(e)},0);else try{this._schedule(function(){t(e)})}catch(n){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}},r.prototype.invokeLater=o,r.prototype.invoke=i,r.prototype.settlePromises=a,r.prototype._drainQueues=function(){s(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,s(this._lateQueue)},r.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},r.prototype._reset=function(){this._isTickUsed=!1},e.exports=r,e.exports.firstLineError=l},{"./queue":17,"./schedule":18}],2:[function(t,e,n){"use strict";e.exports=function(t,e,n,r){var o=!1,i=function(t,e){this._reject(e)},a=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(i,i,null,this,t)},s=function(t,e){0===(50397184&this._bitField)&&this._resolveCallback(e.target)},c=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(i){o||(o=!0,t.prototype._propagateFrom=r.propagateFromFunction(),t.prototype._boundValue=r.boundValueFunction());var l=n(i),u=new t(e);u._propagateFrom(this,1);var p=this._target();if(u._setBoundTo(l),l instanceof t){var f={promiseRejectionQueued:!1,promise:u,target:p,bindingPromise:l};p._then(e,a,void 0,u,f),l._then(s,c,void 0,u,f),u._setOnCancel(l)}else u._resolveCallback(p);return u},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=-2097153&this._bitField},t.prototype._isBound=function(){return 2097152===(2097152&this._bitField)},t.bind=function(e,n){return t.resolve(n).bind(e)}}},{}],3:[function(t,e,n){"use strict";function r(){try{Promise===i&&(Promise=o)}catch(t){}return i}var o;"undefined"!=typeof Promise&&(o=Promise);var i=t("./promise")();i.noConflict=r,e.exports=i},{"./promise":15}],4:[function(t,e,n){"use strict";e.exports=function(e,n,r,o){var i=t("./util"),a=i.tryCatch,s=i.errorObj,c=e._async;e.prototype["break"]=e.prototype.cancel=function(){if(!o.cancellation())return this._warn("cancellation is disabled");for(var t=this,e=t;t._isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}var n=t._cancellationParent;if(null==n||!n._isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}t._isFollowing()&&t._followee().cancel(),t._setWillBeCancelled(),e=t,t=n}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(t){return t===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),this._enoughBranchesHaveCancelled()?(this._invokeOnCancel(),!0):!1)},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),c.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(t,e){if(i.isArray(t))for(var n=0;n=0?i[t]:void 0}var o=!1,i=[];return t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null},t._peekContext=t.prototype._peekContext=function(){},e.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,i.push(this._trace))},e.prototype._popContext=function(){if(void 0!==this._trace){var t=i.pop(),e=t._promiseCreated;return t._promiseCreated=null,e}return null},e.CapturedTrace=null,e.create=n,e.deactivateLongStackTraces=function(){},e.activateLongStackTraces=function(){var n=t.prototype._pushContext,i=t.prototype._popContext,a=t._peekContext,s=t.prototype._peekContext,c=t.prototype._promiseCreated;e.deactivateLongStackTraces=function(){t.prototype._pushContext=n,t.prototype._popContext=i,t._peekContext=a,t.prototype._peekContext=s,t.prototype._promiseCreated=c,o=!1},o=!0,t.prototype._pushContext=e.prototype._pushContext,t.prototype._popContext=e.prototype._popContext,t._peekContext=t.prototype._peekContext=r,t.prototype._promiseCreated=function(){var t=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this)}},e}},{}],7:[function(t,e,n){"use strict";e.exports=function(e,n,r,o){function i(t,e){return{promise:e}}function a(){return!1}function s(t,e,n){var r=this;try{t(e,n,function(t){if("function"!=typeof t)throw new TypeError("onCancel must be a function, got: "+V.toString(t));r._attachCancellationCallback(t)})}catch(o){return o}}function c(t){if(!this._isCancellable())return this;var e=this._onCancel();void 0!==e?V.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}function l(){return this._onCancelField}function u(t){this._onCancelField=t}function p(){this._cancellationParent=void 0,this._onCancelField=void 0}function f(t,e){if(0!==(1&e)){this._cancellationParent=t;var n=t._branchesRemainingToCancel;void 0===n&&(n=0),t._branchesRemainingToCancel=n+1}0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function h(t,e){0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function d(){var t=this._boundTo;return void 0!==t&&t instanceof e?t.isFulfilled()?t.value():void 0:t}function _(){this._trace=new H(this._peekContext())}function v(t,e){if(q(t)){var n=this._trace;if(void 0!==n&&e&&(n=n._parent),void 0!==n)n.attachExtraTrace(t);else if(!t.__stackCleaned__){var r=F(t);V.notEnumerableProp(t,"stack",r.message+"\n"+r.stack.join("\n")),V.notEnumerableProp(t,"__stackCleaned__",!0)}}}function y(){this._trace=void 0}function g(t,e,n,r,o){if(void 0===t&&null!==e&&Z){if(void 0!==o&&o._returnedNonUndefined())return;if(0===(65535&r._bitField))return;n&&(n+=" ");var i="",a="";if(e._trace){for(var s=e._trace.stack.split("\n"),c=E(s),l=c.length-1;l>=0;--l){var u=c[l];if(!M.test(u)){var p=u.match(W);p&&(i="at "+p[1]+":"+p[2]+":"+p[3]+" ");break}}if(c.length>0)for(var f=c[0],l=0;l0&&(a="\n"+s[l-1]);break}}var h="a promise was created in a "+n+"handler "+i+"but was not returned from it, see http://goo.gl/rRqMUw"+a;r._warn(h,!0,e)}}function m(t,e){var n=t+" is deprecated and will be removed in a future version.";return e&&(n+=" Use "+e+" instead."),b(n)}function b(t,n,r){if(ut.warnings){var o,i=new D(t);if(n)r._attachExtraTrace(i);else if(ut.longStackTraces&&(o=e._peekContext()))o.attachExtraTrace(i);else{var a=F(i);i.stack=a.message+"\n"+a.stack.join("\n")}it("warning",i)||T(i,"",!0)}}function C(t,e){for(var n=0;n=0;--s)if(r[s]===i){a=s;break}for(var s=a;s>=0;--s){var c=r[s];if(e[o]!==c)break;e.pop(),o--}e=r}}function E(t){for(var e=[],n=0;n0&&"SyntaxError"!=t.name&&(e=e.slice(n)),e}function F(t){var e=t.stack,n=t.toString();return e="string"==typeof e&&e.length>0?j(t):[" (No stack trace)"],{message:n,stack:"SyntaxError"==t.name?e:E(e)}}function T(t,e,n){if("undefined"!=typeof console){var r;if(V.isObject(t)){var o=t.stack;r=e+z(o,t)}else r=e+String(t);"function"==typeof B?B(r,n):("function"==typeof console.log||"object"==typeof console.log)&&console.log(r)}}function x(t,e,n,r){var o=!1;try{"function"==typeof e&&(o=!0,"rejectionHandled"===t?e(r):e(n,r))}catch(i){I.throwLater(i)}"unhandledRejection"===t?it(t,n,r)||o||T(n,"Unhandled rejection "):it(t,r)}function R(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t&&"function"==typeof t.toString?t.toString():V.toString(t);var n=/\[object [a-zA-Z0-9$_]+\]/;if(n.test(e))try{var r=JSON.stringify(t);e=r}catch(o){}0===e.length&&(e="(empty array)")}return"(<"+S(e)+">, no stack trace)"}function S(t){var e=41;return t.lengtha||0>s||!n||!r||n!==r||a>=s||(st=function(t){if(G.test(t))return!0;var e=O(t);return e&&e.fileName===n&&a<=e.line&&e.line<=s?!0:!1})}}function H(t){this._parent=t,this._promisesCreated=0;var e=this._length=1+(void 0===t?0:t._length);lt(this,H),e>32&&this.uncycle()}var N,L,B,U,I=e._async,D=t("./errors").Warning,V=t("./util"),Q=t("./es5"),q=V.canAttachTrace,G=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,M=/\((?:timers\.js):\d+:\d+\)/,W=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,$=null,z=null,X=!1,K=!(0==V.env("BLUEBIRD_DEBUG")||!V.env("BLUEBIRD_DEBUG")&&"development"!==V.env("NODE_ENV")),J=!(0==V.env("BLUEBIRD_WARNINGS")||!K&&!V.env("BLUEBIRD_WARNINGS")),Y=!(0==V.env("BLUEBIRD_LONG_STACK_TRACES")||!K&&!V.env("BLUEBIRD_LONG_STACK_TRACES")),Z=0!=V.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(J||!!V.env("BLUEBIRD_W_FORGOTTEN_RETURN"));!function(){function t(){for(var t=0;t0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},e.prototype._warn=function(t,e,n){return b(t,e,n||this)},e.onPossiblyUnhandledRejection=function(t){var n=e._getContext();L=V.contextBind(n,t)},e.onUnhandledRejectionHandled=function(t){var n=e._getContext();N=V.contextBind(n,t)};var tt=function(){};e.longStackTraces=function(){if(I.haveItemsQueued()&&!ut.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!ut.longStackTraces&&P()){var t=e.prototype._captureStackTrace,r=e.prototype._attachExtraTrace,o=e.prototype._dereferenceTrace;ut.longStackTraces=!0,tt=function(){if(I.haveItemsQueued()&&!ut.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");e.prototype._captureStackTrace=t,e.prototype._attachExtraTrace=r,e.prototype._dereferenceTrace=o,n.deactivateLongStackTraces(),ut.longStackTraces=!1},e.prototype._captureStackTrace=_,e.prototype._attachExtraTrace=v,e.prototype._dereferenceTrace=y,n.activateLongStackTraces()}},e.hasLongStackTraces=function(){return ut.longStackTraces&&P()};var et={unhandledrejection:{before:function(){var t=V.global.onunhandledrejection;return V.global.onunhandledrejection=null,t},after:function(t){V.global.onunhandledrejection=t}},rejectionhandled:{before:function(){var t=V.global.onrejectionhandled;return V.global.onrejectionhandled=null,t},after:function(t){V.global.onrejectionhandled=t}}},nt=function(){var t=function(t,e){if(!t)return!V.global.dispatchEvent(e);var n;try{return n=t.before(),!V.global.dispatchEvent(e)}finally{t.after(n)}};try{if("function"==typeof CustomEvent){var e=new CustomEvent("CustomEvent");return V.global.dispatchEvent(e),function(e,n){e=e.toLowerCase();var r={detail:n,cancelable:!0},o=new CustomEvent(e,r);return Q.defineProperty(o,"promise",{value:n.promise}),Q.defineProperty(o,"reason",{value:n.reason}),t(et[e],o)}}if("function"==typeof Event){var e=new Event("CustomEvent");return V.global.dispatchEvent(e),function(e,n){e=e.toLowerCase();var r=new Event(e,{cancelable:!0});return r.detail=n,Q.defineProperty(r,"promise",{value:n.promise}),Q.defineProperty(r,"reason",{value:n.reason}),t(et[e],r)}}var e=document.createEvent("CustomEvent");return e.initCustomEvent("testingtheevent",!1,!0,{}),V.global.dispatchEvent(e),function(e,n){e=e.toLowerCase();var r=document.createEvent("CustomEvent");return r.initCustomEvent(e,!1,!0,n),t(et[e],r)}}catch(n){}return function(){return!1}}(),rt=function(){return V.isNode?function(){return process.emit.apply(process,arguments)}:V.global?function(t){var e="on"+t.toLowerCase(),n=V.global[e];return n?(n.apply(V.global,[].slice.call(arguments,1)),!0):!1}:function(){return!1}}(),ot={promiseCreated:i,promiseFulfilled:i,promiseRejected:i,promiseResolved:i,promiseCancelled:i,promiseChained:function(t,e,n){return{promise:e,child:n}},warning:function(t,e){return{warning:e}},unhandledRejection:function(t,e,n){return{reason:e,promise:n}},rejectionHandled:i},it=function(t){var e=!1;try{e=rt.apply(null,arguments)}catch(n){I.throwLater(n),e=!0}var r=!1;try{r=nt(t,ot[t].apply(null,arguments))}catch(n){I.throwLater(n),r=!0}return r||e};e.config=function(t){if(t=Object(t),"longStackTraces"in t&&(t.longStackTraces?e.longStackTraces():!t.longStackTraces&&e.hasLongStackTraces()&&tt()),"warnings"in t){var n=t.warnings;ut.warnings=!!n,Z=ut.warnings,V.isObject(n)&&"wForgottenReturn"in n&&(Z=!!n.wForgottenReturn)}if("cancellation"in t&&t.cancellation&&!ut.cancellation){if(I.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");e.prototype._clearCancellationData=p,e.prototype._propagateFrom=f,e.prototype._onCancel=l,e.prototype._setOnCancel=u,e.prototype._attachCancellationCallback=c,e.prototype._execute=s,at=f,ut.cancellation=!0}if("monitoring"in t&&(t.monitoring&&!ut.monitoring?(ut.monitoring=!0,e.prototype._fireEvent=it):!t.monitoring&&ut.monitoring&&(ut.monitoring=!1,e.prototype._fireEvent=a)),"asyncHooks"in t&&V.nodeSupportsAsyncResource){var i=ut.asyncHooks,h=!!t.asyncHooks;i!==h&&(ut.asyncHooks=h,h?r():o())}return e},e.prototype._fireEvent=a,e.prototype._execute=function(t,e,n){try{t(e,n)}catch(r){return r}},e.prototype._onCancel=function(){},e.prototype._setOnCancel=function(t){},e.prototype._attachCancellationCallback=function(t){},e.prototype._captureStackTrace=function(){},e.prototype._attachExtraTrace=function(){},e.prototype._dereferenceTrace=function(){},e.prototype._clearCancellationData=function(){},e.prototype._propagateFrom=function(t,e){};var at=h,st=function(){return!1},ct=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;V.inherits(H,Error),n.CapturedTrace=H,H.prototype.uncycle=function(){var t=this._length;if(!(2>t)){for(var e=[],n={},r=0,o=this;void 0!==o;++r)e.push(o),o=o._parent;t=this._length=r;for(var r=t-1;r>=0;--r){var i=e[r].stack;void 0===n[i]&&(n[i]=r)}for(var r=0;t>r;++r){var a=e[r].stack,s=n[a];if(void 0!==s&&s!==r){s>0&&(e[s-1]._parent=void 0,e[s-1]._length=1),e[r]._parent=void 0,e[r]._length=1;var c=r>0?e[r-1]:this;t-1>s?(c._parent=e[s+1],c._parent.uncycle(),c._length=c._parent._length+1):(c._parent=void 0,c._length=1);for(var l=c._length+1,u=r-2;u>=0;--u)e[u]._length=l,l++;return}}}},H.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=F(t),n=e.message,r=[e.stack],o=this;void 0!==o;)r.push(E(o.stack.split("\n"))),o=o._parent;k(r),w(r),V.notEnumerableProp(t,"stack",C(n,r)),V.notEnumerableProp(t,"__stackCleaned__",!0)}};var lt=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():R(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,$=t,z=e;var n=Error.captureStackTrace;return st=function(t){return G.test(t)},function(t,e){Error.stackTraceLimit+=6,n(t,e),Error.stackTraceLimit-=6}}var r=new Error;if("string"==typeof r.stack&&r.stack.split("\n")[0].indexOf("stackDetection@")>=0)return $=/@/,z=e,X=!0,function(t){t.stack=(new Error).stack};var o;try{throw new Error}catch(i){o="stack"in i}return"stack"in r||!o||"number"!=typeof Error.stackTraceLimit?(z=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?R(e):e.toString()},null):($=t,z=e,function(t){Error.stackTraceLimit+=6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit-=6})}([]);"undefined"!=typeof console&&"undefined"!=typeof console.warn&&(B=function(t){console.warn(t)},V.isNode&&process.stderr.isTTY?B=function(t,e){var n=e?"":"";console.warn(n+t+"\n")}:V.isNode||"string"!=typeof(new Error).stack||(B=function(t,e){console.warn("%c"+t,e?"color: darkorange":"color: red")}));var ut={warnings:J,longStackTraces:!1,cancellation:!1,monitoring:!1,asyncHooks:!1};return Y&&e.longStackTraces(),{asyncHooks:function(){return ut.asyncHooks},longStackTraces:function(){return ut.longStackTraces},warnings:function(){return ut.warnings},cancellation:function(){return ut.cancellation},monitoring:function(){return ut.monitoring},propagateFromFunction:function(){return at},boundValueFunction:function(){return d},checkForgottenReturns:g,setBounds:A,warn:b,deprecated:m,CapturedTrace:H,fireDomEvent:nt,fireGlobalEvent:rt}}},{"./errors":9,"./es5":10,"./util":21}],8:[function(t,e,n){"use strict";e.exports=function(t){function e(){return this.value}function n(){throw this.reason}t.prototype["return"]=t.prototype.thenReturn=function(n){return n instanceof t&&n.suppressUnhandledRejections(),this._then(e,void 0,void 0,{value:n},void 0)},t.prototype["throw"]=t.prototype.thenThrow=function(t){return this._then(n,void 0,void 0,{reason:t},void 0)},t.prototype.catchThrow=function(t){if(arguments.length<=1)return this._then(void 0,n,void 0,{reason:t},void 0);var e=arguments[1],r=function(){throw e};return this.caught(t,r)},t.prototype.catchReturn=function(n){if(arguments.length<=1)return n instanceof t&&n.suppressUnhandledRejections(),this._then(void 0,e,void 0,{value:n},void 0);var r=arguments[1];r instanceof t&&r.suppressUnhandledRejections();var o=function(){return r};return this.caught(n,o)}}},{}],9:[function(t,e,n){"use strict";function r(t,e){function n(r){return this instanceof n?(p(this,"message","string"==typeof r?r:e),p(this,"name",t),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):new n(r)}return u(n,Error),n}function o(t){return this instanceof o?(p(this,"name","OperationalError"),p(this,"message",t),this.cause=t,this.isOperational=!0,void(t instanceof Error?(p(this,"message",t.message),p(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new o(t)}var i,a,s=t("./es5"),c=s.freeze,l=t("./util"),u=l.inherits,p=l.notEnumerableProp,f=r("Warning","warning"),h=r("CancellationError","cancellation error"),d=r("TimeoutError","timeout error"),_=r("AggregateError","aggregate error");try{i=TypeError,a=RangeError}catch(v){i=r("TypeError","type error"),a=r("RangeError","range error")}for(var y="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),g=0;g1?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0):!1}function s(){return l.call(this,this.promise._target()._settledValue())}function c(t){return a(this,t)?void 0:(f.e=t,f)}function l(t){var o=this.promise,l=this.handler;if(!this.called){this.called=!0;var u=this.isFinallyHandler()?l.call(o._boundValue()):l.call(o._boundValue(),t);if(u===r)return u;if(void 0!==u){o._setReturnedNonUndefined();var h=n(u,o);if(h instanceof e){if(null!=this.cancelPromise){if(h._isCancelled()){var d=new p("late cancellation observer");return o._attachExtraTrace(d),f.e=d,f}h.isPending()&&h._attachCancellationCallback(new i(this))}return h._then(s,c,void 0,this,void 0)}}}return o.isRejected()?(a(this),f.e=t,f):(a(this),t)}var u=t("./util"),p=e.CancellationError,f=u.errorObj,h=t("./catch_filter")(r);return o.prototype.isFinallyHandler=function(){return 0===this.type},i.prototype._resultCancelled=function(){a(this.finallyHandler)},e.prototype._passThrough=function(t,e,n,r){return"function"!=typeof t?this.then():this._then(n,r,void 0,new o(this,e,t),void 0)},e.prototype.lastly=e.prototype["finally"]=function(t){return this._passThrough(t,0,l,l)},e.prototype.tap=function(t){return this._passThrough(t,1,l)},e.prototype.tapCatch=function(t){var n=arguments.length;if(1===n)return this._passThrough(t,1,void 0,l);var r,o=new Array(n-1),i=0;for(r=0;n-1>r;++r){var a=arguments[r];if(!u.isObject(a))return e.reject(new TypeError("tapCatch statement predicate: expecting an object but got "+u.classString(a)));o[i++]=a}o.length=i;var s=arguments[r];return this._passThrough(h(o,s,this),1,void 0,l)},o}},{"./catch_filter":5,"./util":21}],12:[function(t,e,n){"use strict";e.exports=function(e,n,r,o,i){var a=t("./util");a.canEvaluate,a.tryCatch,a.errorObj;e.join=function(){var t,e=arguments.length-1;if(e>0&&"function"==typeof arguments[e]){t=arguments[e];var r}var o=[].slice.call(arguments);t&&o.pop();var r=new n(o).promise();return void 0!==t?r.spread(t):r}}},{"./util":21}],13:[function(t,e,n){"use strict";e.exports=function(e,n,r,o,i){var a=t("./util"),s=a.tryCatch;e.method=function(t){if("function"!=typeof t)throw new e.TypeError("expecting a function but got "+a.classString(t));return function(){var r=new e(n);r._captureStackTrace(),r._pushContext();var o=s(t).apply(this,arguments),a=r._popContext();return i.checkForgottenReturns(o,a,"Promise.method",r),r._resolveFromSyncValue(o),r}},e.attempt=e["try"]=function(t){if("function"!=typeof t)return o("expecting a function but got "+a.classString(t));var r=new e(n);r._captureStackTrace(),r._pushContext();var c;if(arguments.length>1){i.deprecated("calling Promise.try with more than 1 argument");var l=arguments[1],u=arguments[2];c=a.isArray(l)?s(t).apply(u,l):s(t).call(u,l)}else c=s(t)();var p=r._popContext();return i.checkForgottenReturns(c,p,"Promise.try",r),r._resolveFromSyncValue(c),r},e.prototype._resolveFromSyncValue=function(t){t===a.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0)}}},{"./util":21}],14:[function(t,e,n){"use strict";function r(t){return t instanceof Error&&u.getPrototypeOf(t)===Error.prototype}function o(t){var e;if(r(t)){e=new l(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(var n=u.keys(t),o=0;o1){var n,r=new Array(e-1),o=0; +for(n=0;e-1>n;++n){var i=arguments[n];if(!f.isObject(i))return u("Catch statement predicate: expecting an object but got "+f.classString(i));r[o++]=i}if(r.length=o,t=arguments[n],"function"!=typeof t)throw new j("The last argument to .catch() must be a function, got "+f.toString(t));return this.then(void 0,N(r,t,this))}return this.then(void 0,t)},o.prototype.reflect=function(){return this._then(l,l,void 0,this,void 0)},o.prototype.then=function(t,e){if(A.warnings()&&arguments.length>0&&"function"!=typeof t&&"function"!=typeof e){var n=".then() only accepts functions but was passed: "+f.classString(t);arguments.length>1&&(n+=", "+f.classString(e)),this._warn(n)}return this._then(t,e,void 0,void 0,void 0)},o.prototype.done=function(t,e){var n=this._then(t,e,void 0,void 0,void 0);n._setIsFinal()},o.prototype.spread=function(t){return"function"!=typeof t?u("expecting a function but got "+f.classString(t)):this.all()._then(t,void 0,void 0,x,void 0)},o.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},o.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new P(this).promise()},o.prototype.error=function(t){return this.caught(f.originatesFromRejection,t)},o.getNewLibraryCopy=e.exports,o.is=function(t){return t instanceof o},o.fromNode=o.fromCallback=function(t){var e=new o(T);e._captureStackTrace();var n=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,r=U(t)(L(e,n));return r===B&&e._rejectCallback(r.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e},o.all=function(t){return new P(t).promise()},o.cast=function(t){var e=S(t);return e instanceof o||(e=new o(T),e._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e},o.resolve=o.fulfilled=o.cast,o.reject=o.rejected=function(t){var e=new o(T);return e._captureStackTrace(),e._rejectCallback(t,!0),e},o.setScheduler=function(t){if("function"!=typeof t)throw new j("expecting a function but got "+f.classString(t));return k.setScheduler(t)},o.prototype._then=function(t,e,n,r,i){var a=void 0!==i,s=a?i:new o(T),c=this._target(),l=c._bitField;a||(s._propagateFrom(this,3),s._captureStackTrace(),void 0===r&&0!==(2097152&this._bitField)&&(r=0!==(50397184&l)?this._boundValue():c===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,s));var u=g();if(0!==(50397184&l)){var p,h,d=c._settlePromiseCtx;0!==(33554432&l)?(h=c._rejectionHandler0,p=t):0!==(16777216&l)?(h=c._fulfillmentHandler0,p=e,c._unsetRejectionIsUnhandled()):(d=c._settlePromiseLateCancellationObserver,h=new F("late cancellation observer"),c._attachExtraTrace(h),p=e),k.invoke(d,c,{handler:f.contextBind(u,p),promise:s,receiver:r,value:h})}else c._addCallbacks(t,e,s,r,u);return s},o.prototype._length=function(){return 65535&this._bitField},o.prototype._isFateSealed=function(){return 0!==(117506048&this._bitField)},o.prototype._isFollowing=function(){return 67108864===(67108864&this._bitField)},o.prototype._setLength=function(t){this._bitField=-65536&this._bitField|65535&t},o.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},o.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},o.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},o.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},o.prototype._isFinal=function(){return(4194304&this._bitField)>0},o.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},o.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},o.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},o.prototype._setAsyncGuaranteed=function(){if(!k.hasCustomScheduler()){var t=this._bitField;this._bitField=t|(536870912&t)>>2^134217728}},o.prototype._setNoAsyncGuarantee=function(){this._bitField=-134217729&(536870912|this._bitField)},o.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[4*t-4+3];return e===p?void 0:void 0===e&&this._isBound()?this._boundValue():e},o.prototype._promiseAt=function(t){return this[4*t-4+2]},o.prototype._fulfillmentHandlerAt=function(t){return this[4*t-4+0]},o.prototype._rejectionHandlerAt=function(t){return this[4*t-4+1]},o.prototype._boundValue=function(){},o.prototype._migrateCallback0=function(t){var e=(t._bitField,t._fulfillmentHandler0),n=t._rejectionHandler0,r=t._promise0,o=t._receiverAt(0);void 0===o&&(o=p),this._addCallbacks(e,n,r,o,null)},o.prototype._migrateCallbackAt=function(t,e){var n=t._fulfillmentHandlerAt(e),r=t._rejectionHandlerAt(e),o=t._promiseAt(e),i=t._receiverAt(e);void 0===i&&(i=p),this._addCallbacks(n,r,o,i,null)},o.prototype._addCallbacks=function(t,e,n,r,o){var i=this._length();if(i>=65531&&(i=0,this._setLength(0)),0===i)this._promise0=n,this._receiver0=r,"function"==typeof t&&(this._fulfillmentHandler0=f.contextBind(o,t)),"function"==typeof e&&(this._rejectionHandler0=f.contextBind(o,e));else{var a=4*i-4;this[a+2]=n,this[a+3]=r,"function"==typeof t&&(this[a+0]=f.contextBind(o,t)),"function"==typeof e&&(this[a+1]=f.contextBind(o,e))}return this._setLength(i+1),i},o.prototype._proxy=function(t,e){this._addCallbacks(void 0,void 0,e,t,null)},o.prototype._resolveCallback=function(t,e){if(0===(117506048&this._bitField)){if(t===this)return this._rejectCallback(c(),!1);var n=S(t,this);if(!(n instanceof o))return this._fulfill(t);e&&this._propagateFrom(n,2);var r=n._target();if(r===this)return void this._reject(c());var i=r._bitField;if(0===(50397184&i)){var a=this._length();a>0&&r._migrateCallback0(this);for(var s=1;a>s;++s)r._migrateCallbackAt(this,s);this._setFollowing(),this._setLength(0),this._setFollowee(n)}else if(0!==(33554432&i))this._fulfill(r._value());else if(0!==(16777216&i))this._reject(r._reason());else{var l=new F("late cancellation observer");r._attachExtraTrace(l),this._reject(l)}}},o.prototype._rejectCallback=function(t,e,n){var r=f.ensureErrorObject(t),o=r===t;if(!o&&!n&&A.warnings()){var i="a promise was rejected with a non-error: "+f.classString(t);this._warn(i,!0)}this._attachExtraTrace(r,e?o:!1),this._reject(t)},o.prototype._resolveFromExecutor=function(t){if(t!==T){var e=this;this._captureStackTrace(),this._pushContext();var n=!0,r=this._execute(t,function(t){e._resolveCallback(t)},function(t){e._rejectCallback(t,n)});n=!1,this._popContext(),void 0!==r&&e._rejectCallback(r,!0)}},o.prototype._settlePromiseFromHandler=function(t,e,n,r){var o=r._bitField;if(0===(65536&o)){r._pushContext();var i;e===x?n&&"number"==typeof n.length?i=U(t).apply(this._boundValue(),n):(i=B,i.e=new j("cannot .spread() a non-array: "+f.classString(n))):i=U(t).call(e,n);var a=r._popContext();o=r._bitField,0===(65536&o)&&(i===R?r._reject(n):i===B?r._rejectCallback(i.e,!1):(A.checkForgottenReturns(i,a,"",r,this),r._resolveCallback(i)))}},o.prototype._target=function(){for(var t=this;t._isFollowing();)t=t._followee();return t},o.prototype._followee=function(){return this._rejectionHandler0},o.prototype._setFollowee=function(t){this._rejectionHandler0=t},o.prototype._settlePromise=function(t,e,r,i){var a=t instanceof o,s=this._bitField,c=0!==(134217728&s);0!==(65536&s)?(a&&t._invokeInternalOnCancel(),r instanceof H&&r.isFinallyHandler()?(r.cancelPromise=t,U(e).call(r,i)===B&&t._reject(B.e)):e===l?t._fulfill(l.call(r)):r instanceof n?r._promiseCancelled(t):a||t instanceof P?t._cancel():r.cancel()):"function"==typeof e?a?(c&&t._setAsyncGuaranteed(),this._settlePromiseFromHandler(e,r,i,t)):e.call(r,i,t):r instanceof n?r._isResolved()||(0!==(33554432&s)?r._promiseFulfilled(i,t):r._promiseRejected(i,t)):a&&(c&&t._setAsyncGuaranteed(),0!==(33554432&s)?t._fulfill(i):t._reject(i))},o.prototype._settlePromiseLateCancellationObserver=function(t){var e=t.handler,n=t.promise,r=t.receiver,i=t.value;"function"==typeof e?n instanceof o?this._settlePromiseFromHandler(e,r,i,n):e.call(r,i,n):n instanceof o&&n._reject(i)},o.prototype._settlePromiseCtx=function(t){this._settlePromise(t.promise,t.handler,t.receiver,t.value)},o.prototype._settlePromise0=function(t,e,n){var r=this._promise0,o=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(r,t,o,e)},o.prototype._clearCallbackDataAtIndex=function(t){var e=4*t-4;this[e+2]=this[e+3]=this[e+0]=this[e+1]=void 0},o.prototype._fulfill=function(t){var e=this._bitField;if(!((117506048&e)>>>16)){if(t===this){var n=c();return this._attachExtraTrace(n),this._reject(n)}this._setFulfilled(),this._rejectionHandler0=t,(65535&e)>0&&(0!==(134217728&e)?this._settlePromises():k.settlePromises(this),this._dereferenceTrace())}},o.prototype._reject=function(t){var e=this._bitField;if(!((117506048&e)>>>16))return this._setRejected(),this._fulfillmentHandler0=t,this._isFinal()?k.fatalError(t,f.isNode):void((65535&e)>0?k.settlePromises(this):this._ensurePossibleRejectionHandled())},o.prototype._fulfillPromises=function(t,e){for(var n=1;t>n;n++){var r=this._fulfillmentHandlerAt(n),o=this._promiseAt(n),i=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(o,r,i,e)}},o.prototype._rejectPromises=function(t,e){for(var n=1;t>n;n++){var r=this._rejectionHandlerAt(n),o=this._promiseAt(n),i=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(o,r,i,e)}},o.prototype._settlePromises=function(){var t=this._bitField,e=65535&t;if(e>0){if(0!==(16842752&t)){var n=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,n,t),this._rejectPromises(e,n)}else{var r=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,r,t),this._fulfillPromises(e,r)}this._setLength(0)}this._clearCancellationData()},o.prototype._settledValue=function(){var t=this._bitField;return 0!==(33554432&t)?this._rejectionHandler0:0!==(16777216&t)?this._fulfillmentHandler0:void 0},"undefined"!=typeof Symbol&&Symbol.toStringTag&&C.defineProperty(o.prototype,Symbol.toStringTag,{get:function(){return"Object"}}),o.defer=o.pending=function(){A.deprecated("Promise.defer","new Promise");var t=new o(T);return{promise:t,resolve:i,reject:a}},f.notEnumerableProp(o,"_makeSelfResolutionError",c),t("./method")(o,T,S,u,A),t("./bind")(o,T,S,A),t("./cancel")(o,P,u,A),t("./direct_resolve")(o),t("./synchronous_inspection")(o),t("./join")(o,P,S,T,k),o.Promise=o,o.version="3.7.2",f.toFastProperties(o),f.toFastProperties(o.prototype),s({a:1}),s({b:2}),s({c:3}),s(1),s(function(){}),s(void 0),s(!1),s(new o(T)),A.setBounds(w.firstLineError,f.lastLineError),o}},{"./async":1,"./bind":2,"./cancel":4,"./catch_filter":5,"./context":6,"./debuggability":7,"./direct_resolve":8,"./errors":9,"./es5":10,"./finally":11,"./join":12,"./method":13,"./nodeback":14,"./promise_array":16,"./synchronous_inspection":19,"./thenables":20,"./util":21,async_hooks:void 0}],16:[function(t,e,n){"use strict";e.exports=function(e,n,r,o,i){function a(t){switch(t){case-2:return[];case-3:return{};case-6:return new Map}}function s(t){var r=this._promise=new e(n);t instanceof e&&(r._propagateFrom(t,3),t.suppressUnhandledRejections()),r._setOnCancel(this),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var c=t("./util");c.isArray;return c.inherits(s,i),s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function l(t,n){var i=r(this._values,this._promise);if(i instanceof e){i=i._target();var s=i._bitField;if(this._values=i,0===(50397184&s))return this._promise._setAsyncGuaranteed(),i._then(l,this._reject,void 0,this,n);if(0===(33554432&s))return 0!==(16777216&s)?this._reject(i._reason()):this._cancel();i=i._value()}if(i=c.asArray(i),null===i){var u=o("expecting an array or an iterable object but got "+c.classString(i)).reason();return void this._promise._rejectCallback(u,!1)}return 0===i.length?void(-5===n?this._resolveEmptyArray():this._resolve(a(n))):void this._iterate(i)},s.prototype._iterate=function(t){var n=this.getActualLength(t.length);this._length=n,this._values=this.shouldCopyValues()?new Array(n):this._values;for(var o=this._promise,i=!1,a=null,s=0;n>s;++s){var c=r(t[s],o);c instanceof e?(c=c._target(),a=c._bitField):a=null,i?null!==a&&c.suppressUnhandledRejections():null!==a?0===(50397184&a)?(c._proxy(this,s),this._values[s]=c):i=0!==(33554432&a)?this._promiseFulfilled(c._value(),s):0!==(16777216&a)?this._promiseRejected(c._reason(),s):this._promiseCancelled(s):i=this._promiseFulfilled(c,s)}i||o._setAsyncGuaranteed()},s.prototype._isResolved=function(){return null===this._values},s.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},s.prototype._cancel=function(){!this._isResolved()&&this._promise._isCancellable()&&(this._values=null,this._promise._cancel())},s.prototype._reject=function(t){this._values=null,this._promise._rejectCallback(t,!1)},s.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var n=++this._totalResolved;return n>=this._length?(this._resolve(this._values),!0):!1},s.prototype._promiseCancelled=function(){return this._cancel(),!0},s.prototype._promiseRejected=function(t){return this._totalResolved++,this._reject(t),!0},s.prototype._resultCancelled=function(){if(!this._isResolved()){var t=this._values;if(this._cancel(),t instanceof e)t.cancel();else for(var n=0;ni;++i)n[i+r]=t[i+e],t[i+e]=void 0}function o(t){this._capacity=t,this._length=0,this._front=0}o.prototype._willBeOverCapacity=function(t){return this._capacityn;++n)o[n]=t[n];return o[n]=e,o}function l(t,e,n){if(!F.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var r=Object.getOwnPropertyDescriptor(t,e);return null!=r?null==r.get&&null==r.set?r.value:n:void 0}function u(t,e,n){if(i(t))return t;var r={value:n,configurable:!0,enumerable:!1,writable:!0};return F.defineProperty(t,e,r),t}function p(t){throw t}function f(t){try{if("function"==typeof t){var e=F.names(t.prototype),n=F.isES5&&e.length>1,r=e.length>0&&!(1===e.length&&"constructor"===e[0]),o=A.test(t+"")&&F.names(t).length>0;if(n||r||o)return!0}return!1}catch(i){return!1}}function h(t){function e(){}function n(){return typeof r.foo}e.prototype=t;var r=new e;return n(),n(),t}function d(t){return H.test(t)}function _(t,e,n){for(var r=new Array(t),o=0;t>o;++o)r[o]=e+o+n;return r}function v(t){try{return t+""}catch(e){return"[no string representation]"}}function y(t){return t instanceof Error||null!==t&&"object"==typeof t&&"string"==typeof t.message&&"string"==typeof t.name}function g(t){try{u(t,"isOperational",!0)}catch(e){}}function m(t){return null==t?!1:t instanceof Error.__BluebirdErrorTypes__.OperationalError||t.isOperational===!0}function b(t){return y(t)&&F.propertyIsWritable(t,"stack")}function C(t){return{}.toString.call(t)}function w(t,e,n){for(var r=F.names(t),o=0;o10||t[0]>0}(),V.nodeSupportsAsyncResource=V.isNode&&function(){var e=!1;try{var n=t("async_hooks").AsyncResource;e="function"==typeof n.prototype.runInAsyncScope}catch(r){e=!1}return e}(),V.isNode&&V.toFastProperties(process);try{throw new Error}catch(Q){V.lastLineError=Q}e.exports=V},{"./es5":10,async_hooks:void 0}]},{},[3])(3)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise); \ No newline at end of file diff --git a/publisher/node_modules/bluebird/js/browser/bluebird.js b/publisher/node_modules/bluebird/js/browser/bluebird.js new file mode 100644 index 00000000..7f0686f4 --- /dev/null +++ b/publisher/node_modules/bluebird/js/browser/bluebird.js @@ -0,0 +1,5778 @@ +/* @preserve + * The MIT License (MIT) + * + * Copyright (c) 2013-2018 Petka Antonov + * + * 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. + * + */ +/** + * bluebird build version 3.7.2 + * Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each +*/ +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.Promise=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof _dereq_=="function"&&_dereq_;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof _dereq_=="function"&&_dereq_;for(var o=0;o 0) { + _drainQueueStep(queue); + } +} + +function _drainQueueStep(queue) { + var fn = queue.shift(); + if (typeof fn !== "function") { + fn._settlePromises(); + } else { + var receiver = queue.shift(); + var arg = queue.shift(); + fn.call(receiver, arg); + } +} + +Async.prototype._drainQueues = function () { + _drainQueue(this._normalQueue); + this._reset(); + this._haveDrainedQueues = true; + _drainQueue(this._lateQueue); +}; + +Async.prototype._queueTick = function () { + if (!this._isTickUsed) { + this._isTickUsed = true; + this._schedule(this.drainQueues); + } +}; + +Async.prototype._reset = function () { + this._isTickUsed = false; +}; + +module.exports = Async; +module.exports.firstLineError = firstLineError; + +},{"./queue":26,"./schedule":29}],3:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL, tryConvertToPromise, debug) { +var calledBind = false; +var rejectThis = function(_, e) { + this._reject(e); +}; + +var targetRejected = function(e, context) { + context.promiseRejectionQueued = true; + context.bindingPromise._then(rejectThis, rejectThis, null, this, e); +}; + +var bindingResolved = function(thisArg, context) { + if (((this._bitField & 50397184) === 0)) { + this._resolveCallback(context.target); + } +}; + +var bindingRejected = function(e, context) { + if (!context.promiseRejectionQueued) this._reject(e); +}; + +Promise.prototype.bind = function (thisArg) { + if (!calledBind) { + calledBind = true; + Promise.prototype._propagateFrom = debug.propagateFromFunction(); + Promise.prototype._boundValue = debug.boundValueFunction(); + } + var maybePromise = tryConvertToPromise(thisArg); + var ret = new Promise(INTERNAL); + ret._propagateFrom(this, 1); + var target = this._target(); + ret._setBoundTo(maybePromise); + if (maybePromise instanceof Promise) { + var context = { + promiseRejectionQueued: false, + promise: ret, + target: target, + bindingPromise: maybePromise + }; + target._then(INTERNAL, targetRejected, undefined, ret, context); + maybePromise._then( + bindingResolved, bindingRejected, undefined, ret, context); + ret._setOnCancel(maybePromise); + } else { + ret._resolveCallback(target); + } + return ret; +}; + +Promise.prototype._setBoundTo = function (obj) { + if (obj !== undefined) { + this._bitField = this._bitField | 2097152; + this._boundTo = obj; + } else { + this._bitField = this._bitField & (~2097152); + } +}; + +Promise.prototype._isBound = function () { + return (this._bitField & 2097152) === 2097152; +}; + +Promise.bind = function (thisArg, value) { + return Promise.resolve(value).bind(thisArg); +}; +}; + +},{}],4:[function(_dereq_,module,exports){ +"use strict"; +var old; +if (typeof Promise !== "undefined") old = Promise; +function noConflict() { + try { if (Promise === bluebird) Promise = old; } + catch (e) {} + return bluebird; +} +var bluebird = _dereq_("./promise")(); +bluebird.noConflict = noConflict; +module.exports = bluebird; + +},{"./promise":22}],5:[function(_dereq_,module,exports){ +"use strict"; +var cr = Object.create; +if (cr) { + var callerCache = cr(null); + var getterCache = cr(null); + callerCache[" size"] = getterCache[" size"] = 0; +} + +module.exports = function(Promise) { +var util = _dereq_("./util"); +var canEvaluate = util.canEvaluate; +var isIdentifier = util.isIdentifier; + +var getMethodCaller; +var getGetter; +if (!true) { +var makeMethodCaller = function (methodName) { + return new Function("ensureMethod", " \n\ + return function(obj) { \n\ + 'use strict' \n\ + var len = this.length; \n\ + ensureMethod(obj, 'methodName'); \n\ + switch(len) { \n\ + case 1: return obj.methodName(this[0]); \n\ + case 2: return obj.methodName(this[0], this[1]); \n\ + case 3: return obj.methodName(this[0], this[1], this[2]); \n\ + case 0: return obj.methodName(); \n\ + default: \n\ + return obj.methodName.apply(obj, this); \n\ + } \n\ + }; \n\ + ".replace(/methodName/g, methodName))(ensureMethod); +}; + +var makeGetter = function (propertyName) { + return new Function("obj", " \n\ + 'use strict'; \n\ + return obj.propertyName; \n\ + ".replace("propertyName", propertyName)); +}; + +var getCompiled = function(name, compiler, cache) { + var ret = cache[name]; + if (typeof ret !== "function") { + if (!isIdentifier(name)) { + return null; + } + ret = compiler(name); + cache[name] = ret; + cache[" size"]++; + if (cache[" size"] > 512) { + var keys = Object.keys(cache); + for (var i = 0; i < 256; ++i) delete cache[keys[i]]; + cache[" size"] = keys.length - 256; + } + } + return ret; +}; + +getMethodCaller = function(name) { + return getCompiled(name, makeMethodCaller, callerCache); +}; + +getGetter = function(name) { + return getCompiled(name, makeGetter, getterCache); +}; +} + +function ensureMethod(obj, methodName) { + var fn; + if (obj != null) fn = obj[methodName]; + if (typeof fn !== "function") { + var message = "Object " + util.classString(obj) + " has no method '" + + util.toString(methodName) + "'"; + throw new Promise.TypeError(message); + } + return fn; +} + +function caller(obj) { + var methodName = this.pop(); + var fn = ensureMethod(obj, methodName); + return fn.apply(obj, this); +} +Promise.prototype.call = function (methodName) { + var args = [].slice.call(arguments, 1);; + if (!true) { + if (canEvaluate) { + var maybeCaller = getMethodCaller(methodName); + if (maybeCaller !== null) { + return this._then( + maybeCaller, undefined, undefined, args, undefined); + } + } + } + args.push(methodName); + return this._then(caller, undefined, undefined, args, undefined); +}; + +function namedGetter(obj) { + return obj[this]; +} +function indexedGetter(obj) { + var index = +this; + if (index < 0) index = Math.max(0, index + obj.length); + return obj[index]; +} +Promise.prototype.get = function (propertyName) { + var isIndex = (typeof propertyName === "number"); + var getter; + if (!isIndex) { + if (canEvaluate) { + var maybeGetter = getGetter(propertyName); + getter = maybeGetter !== null ? maybeGetter : namedGetter; + } else { + getter = namedGetter; + } + } else { + getter = indexedGetter; + } + return this._then(getter, undefined, undefined, propertyName, undefined); +}; +}; + +},{"./util":36}],6:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, PromiseArray, apiRejection, debug) { +var util = _dereq_("./util"); +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; +var async = Promise._async; + +Promise.prototype["break"] = Promise.prototype.cancel = function() { + if (!debug.cancellation()) return this._warn("cancellation is disabled"); + + var promise = this; + var child = promise; + while (promise._isCancellable()) { + if (!promise._cancelBy(child)) { + if (child._isFollowing()) { + child._followee().cancel(); + } else { + child._cancelBranched(); + } + break; + } + + var parent = promise._cancellationParent; + if (parent == null || !parent._isCancellable()) { + if (promise._isFollowing()) { + promise._followee().cancel(); + } else { + promise._cancelBranched(); + } + break; + } else { + if (promise._isFollowing()) promise._followee().cancel(); + promise._setWillBeCancelled(); + child = promise; + promise = parent; + } + } +}; + +Promise.prototype._branchHasCancelled = function() { + this._branchesRemainingToCancel--; +}; + +Promise.prototype._enoughBranchesHaveCancelled = function() { + return this._branchesRemainingToCancel === undefined || + this._branchesRemainingToCancel <= 0; +}; + +Promise.prototype._cancelBy = function(canceller) { + if (canceller === this) { + this._branchesRemainingToCancel = 0; + this._invokeOnCancel(); + return true; + } else { + this._branchHasCancelled(); + if (this._enoughBranchesHaveCancelled()) { + this._invokeOnCancel(); + return true; + } + } + return false; +}; + +Promise.prototype._cancelBranched = function() { + if (this._enoughBranchesHaveCancelled()) { + this._cancel(); + } +}; + +Promise.prototype._cancel = function() { + if (!this._isCancellable()) return; + this._setCancelled(); + async.invoke(this._cancelPromises, this, undefined); +}; + +Promise.prototype._cancelPromises = function() { + if (this._length() > 0) this._settlePromises(); +}; + +Promise.prototype._unsetOnCancel = function() { + this._onCancelField = undefined; +}; + +Promise.prototype._isCancellable = function() { + return this.isPending() && !this._isCancelled(); +}; + +Promise.prototype.isCancellable = function() { + return this.isPending() && !this.isCancelled(); +}; + +Promise.prototype._doInvokeOnCancel = function(onCancelCallback, internalOnly) { + if (util.isArray(onCancelCallback)) { + for (var i = 0; i < onCancelCallback.length; ++i) { + this._doInvokeOnCancel(onCancelCallback[i], internalOnly); + } + } else if (onCancelCallback !== undefined) { + if (typeof onCancelCallback === "function") { + if (!internalOnly) { + var e = tryCatch(onCancelCallback).call(this._boundValue()); + if (e === errorObj) { + this._attachExtraTrace(e.e); + async.throwLater(e.e); + } + } + } else { + onCancelCallback._resultCancelled(this); + } + } +}; + +Promise.prototype._invokeOnCancel = function() { + var onCancelCallback = this._onCancel(); + this._unsetOnCancel(); + async.invoke(this._doInvokeOnCancel, this, onCancelCallback); +}; + +Promise.prototype._invokeInternalOnCancel = function() { + if (this._isCancellable()) { + this._doInvokeOnCancel(this._onCancel(), true); + this._unsetOnCancel(); + } +}; + +Promise.prototype._resultCancelled = function() { + this.cancel(); +}; + +}; + +},{"./util":36}],7:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(NEXT_FILTER) { +var util = _dereq_("./util"); +var getKeys = _dereq_("./es5").keys; +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; + +function catchFilter(instances, cb, promise) { + return function(e) { + var boundTo = promise._boundValue(); + predicateLoop: for (var i = 0; i < instances.length; ++i) { + var item = instances[i]; + + if (item === Error || + (item != null && item.prototype instanceof Error)) { + if (e instanceof item) { + return tryCatch(cb).call(boundTo, e); + } + } else if (typeof item === "function") { + var matchesPredicate = tryCatch(item).call(boundTo, e); + if (matchesPredicate === errorObj) { + return matchesPredicate; + } else if (matchesPredicate) { + return tryCatch(cb).call(boundTo, e); + } + } else if (util.isObject(e)) { + var keys = getKeys(item); + for (var j = 0; j < keys.length; ++j) { + var key = keys[j]; + if (item[key] != e[key]) { + continue predicateLoop; + } + } + return tryCatch(cb).call(boundTo, e); + } + } + return NEXT_FILTER; + }; +} + +return catchFilter; +}; + +},{"./es5":13,"./util":36}],8:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise) { +var longStackTraces = false; +var contextStack = []; + +Promise.prototype._promiseCreated = function() {}; +Promise.prototype._pushContext = function() {}; +Promise.prototype._popContext = function() {return null;}; +Promise._peekContext = Promise.prototype._peekContext = function() {}; + +function Context() { + this._trace = new Context.CapturedTrace(peekContext()); +} +Context.prototype._pushContext = function () { + if (this._trace !== undefined) { + this._trace._promiseCreated = null; + contextStack.push(this._trace); + } +}; + +Context.prototype._popContext = function () { + if (this._trace !== undefined) { + var trace = contextStack.pop(); + var ret = trace._promiseCreated; + trace._promiseCreated = null; + return ret; + } + return null; +}; + +function createContext() { + if (longStackTraces) return new Context(); +} + +function peekContext() { + var lastIndex = contextStack.length - 1; + if (lastIndex >= 0) { + return contextStack[lastIndex]; + } + return undefined; +} +Context.CapturedTrace = null; +Context.create = createContext; +Context.deactivateLongStackTraces = function() {}; +Context.activateLongStackTraces = function() { + var Promise_pushContext = Promise.prototype._pushContext; + var Promise_popContext = Promise.prototype._popContext; + var Promise_PeekContext = Promise._peekContext; + var Promise_peekContext = Promise.prototype._peekContext; + var Promise_promiseCreated = Promise.prototype._promiseCreated; + Context.deactivateLongStackTraces = function() { + Promise.prototype._pushContext = Promise_pushContext; + Promise.prototype._popContext = Promise_popContext; + Promise._peekContext = Promise_PeekContext; + Promise.prototype._peekContext = Promise_peekContext; + Promise.prototype._promiseCreated = Promise_promiseCreated; + longStackTraces = false; + }; + longStackTraces = true; + Promise.prototype._pushContext = Context.prototype._pushContext; + Promise.prototype._popContext = Context.prototype._popContext; + Promise._peekContext = Promise.prototype._peekContext = peekContext; + Promise.prototype._promiseCreated = function() { + var ctx = this._peekContext(); + if (ctx && ctx._promiseCreated == null) ctx._promiseCreated = this; + }; +}; +return Context; +}; + +},{}],9:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, Context, + enableAsyncHooks, disableAsyncHooks) { +var async = Promise._async; +var Warning = _dereq_("./errors").Warning; +var util = _dereq_("./util"); +var es5 = _dereq_("./es5"); +var canAttachTrace = util.canAttachTrace; +var unhandledRejectionHandled; +var possiblyUnhandledRejection; +var bluebirdFramePattern = + /[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/; +var nodeFramePattern = /\((?:timers\.js):\d+:\d+\)/; +var parseLinePattern = /[\/<\(](.+?):(\d+):(\d+)\)?\s*$/; +var stackFramePattern = null; +var formatStack = null; +var indentStackFrames = false; +var printWarning; +var debugging = !!(util.env("BLUEBIRD_DEBUG") != 0 && + (true || + util.env("BLUEBIRD_DEBUG") || + util.env("NODE_ENV") === "development")); + +var warnings = !!(util.env("BLUEBIRD_WARNINGS") != 0 && + (debugging || util.env("BLUEBIRD_WARNINGS"))); + +var longStackTraces = !!(util.env("BLUEBIRD_LONG_STACK_TRACES") != 0 && + (debugging || util.env("BLUEBIRD_LONG_STACK_TRACES"))); + +var wForgottenReturn = util.env("BLUEBIRD_W_FORGOTTEN_RETURN") != 0 && + (warnings || !!util.env("BLUEBIRD_W_FORGOTTEN_RETURN")); + +var deferUnhandledRejectionCheck; +(function() { + var promises = []; + + function unhandledRejectionCheck() { + for (var i = 0; i < promises.length; ++i) { + promises[i]._notifyUnhandledRejection(); + } + unhandledRejectionClear(); + } + + function unhandledRejectionClear() { + promises.length = 0; + } + + deferUnhandledRejectionCheck = function(promise) { + promises.push(promise); + setTimeout(unhandledRejectionCheck, 1); + }; + + es5.defineProperty(Promise, "_unhandledRejectionCheck", { + value: unhandledRejectionCheck + }); + es5.defineProperty(Promise, "_unhandledRejectionClear", { + value: unhandledRejectionClear + }); +})(); + +Promise.prototype.suppressUnhandledRejections = function() { + var target = this._target(); + target._bitField = ((target._bitField & (~1048576)) | + 524288); +}; + +Promise.prototype._ensurePossibleRejectionHandled = function () { + if ((this._bitField & 524288) !== 0) return; + this._setRejectionIsUnhandled(); + deferUnhandledRejectionCheck(this); +}; + +Promise.prototype._notifyUnhandledRejectionIsHandled = function () { + fireRejectionEvent("rejectionHandled", + unhandledRejectionHandled, undefined, this); +}; + +Promise.prototype._setReturnedNonUndefined = function() { + this._bitField = this._bitField | 268435456; +}; + +Promise.prototype._returnedNonUndefined = function() { + return (this._bitField & 268435456) !== 0; +}; + +Promise.prototype._notifyUnhandledRejection = function () { + if (this._isRejectionUnhandled()) { + var reason = this._settledValue(); + this._setUnhandledRejectionIsNotified(); + fireRejectionEvent("unhandledRejection", + possiblyUnhandledRejection, reason, this); + } +}; + +Promise.prototype._setUnhandledRejectionIsNotified = function () { + this._bitField = this._bitField | 262144; +}; + +Promise.prototype._unsetUnhandledRejectionIsNotified = function () { + this._bitField = this._bitField & (~262144); +}; + +Promise.prototype._isUnhandledRejectionNotified = function () { + return (this._bitField & 262144) > 0; +}; + +Promise.prototype._setRejectionIsUnhandled = function () { + this._bitField = this._bitField | 1048576; +}; + +Promise.prototype._unsetRejectionIsUnhandled = function () { + this._bitField = this._bitField & (~1048576); + if (this._isUnhandledRejectionNotified()) { + this._unsetUnhandledRejectionIsNotified(); + this._notifyUnhandledRejectionIsHandled(); + } +}; + +Promise.prototype._isRejectionUnhandled = function () { + return (this._bitField & 1048576) > 0; +}; + +Promise.prototype._warn = function(message, shouldUseOwnTrace, promise) { + return warn(message, shouldUseOwnTrace, promise || this); +}; + +Promise.onPossiblyUnhandledRejection = function (fn) { + var context = Promise._getContext(); + possiblyUnhandledRejection = util.contextBind(context, fn); +}; + +Promise.onUnhandledRejectionHandled = function (fn) { + var context = Promise._getContext(); + unhandledRejectionHandled = util.contextBind(context, fn); +}; + +var disableLongStackTraces = function() {}; +Promise.longStackTraces = function () { + if (async.haveItemsQueued() && !config.longStackTraces) { + throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + if (!config.longStackTraces && longStackTracesIsSupported()) { + var Promise_captureStackTrace = Promise.prototype._captureStackTrace; + var Promise_attachExtraTrace = Promise.prototype._attachExtraTrace; + var Promise_dereferenceTrace = Promise.prototype._dereferenceTrace; + config.longStackTraces = true; + disableLongStackTraces = function() { + if (async.haveItemsQueued() && !config.longStackTraces) { + throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + Promise.prototype._captureStackTrace = Promise_captureStackTrace; + Promise.prototype._attachExtraTrace = Promise_attachExtraTrace; + Promise.prototype._dereferenceTrace = Promise_dereferenceTrace; + Context.deactivateLongStackTraces(); + config.longStackTraces = false; + }; + Promise.prototype._captureStackTrace = longStackTracesCaptureStackTrace; + Promise.prototype._attachExtraTrace = longStackTracesAttachExtraTrace; + Promise.prototype._dereferenceTrace = longStackTracesDereferenceTrace; + Context.activateLongStackTraces(); + } +}; + +Promise.hasLongStackTraces = function () { + return config.longStackTraces && longStackTracesIsSupported(); +}; + + +var legacyHandlers = { + unhandledrejection: { + before: function() { + var ret = util.global.onunhandledrejection; + util.global.onunhandledrejection = null; + return ret; + }, + after: function(fn) { + util.global.onunhandledrejection = fn; + } + }, + rejectionhandled: { + before: function() { + var ret = util.global.onrejectionhandled; + util.global.onrejectionhandled = null; + return ret; + }, + after: function(fn) { + util.global.onrejectionhandled = fn; + } + } +}; + +var fireDomEvent = (function() { + var dispatch = function(legacy, e) { + if (legacy) { + var fn; + try { + fn = legacy.before(); + return !util.global.dispatchEvent(e); + } finally { + legacy.after(fn); + } + } else { + return !util.global.dispatchEvent(e); + } + }; + try { + if (typeof CustomEvent === "function") { + var event = new CustomEvent("CustomEvent"); + util.global.dispatchEvent(event); + return function(name, event) { + name = name.toLowerCase(); + var eventData = { + detail: event, + cancelable: true + }; + var domEvent = new CustomEvent(name, eventData); + es5.defineProperty( + domEvent, "promise", {value: event.promise}); + es5.defineProperty( + domEvent, "reason", {value: event.reason}); + + return dispatch(legacyHandlers[name], domEvent); + }; + } else if (typeof Event === "function") { + var event = new Event("CustomEvent"); + util.global.dispatchEvent(event); + return function(name, event) { + name = name.toLowerCase(); + var domEvent = new Event(name, { + cancelable: true + }); + domEvent.detail = event; + es5.defineProperty(domEvent, "promise", {value: event.promise}); + es5.defineProperty(domEvent, "reason", {value: event.reason}); + return dispatch(legacyHandlers[name], domEvent); + }; + } else { + var event = document.createEvent("CustomEvent"); + event.initCustomEvent("testingtheevent", false, true, {}); + util.global.dispatchEvent(event); + return function(name, event) { + name = name.toLowerCase(); + var domEvent = document.createEvent("CustomEvent"); + domEvent.initCustomEvent(name, false, true, + event); + return dispatch(legacyHandlers[name], domEvent); + }; + } + } catch (e) {} + return function() { + return false; + }; +})(); + +var fireGlobalEvent = (function() { + if (util.isNode) { + return function() { + return process.emit.apply(process, arguments); + }; + } else { + if (!util.global) { + return function() { + return false; + }; + } + return function(name) { + var methodName = "on" + name.toLowerCase(); + var method = util.global[methodName]; + if (!method) return false; + method.apply(util.global, [].slice.call(arguments, 1)); + return true; + }; + } +})(); + +function generatePromiseLifecycleEventObject(name, promise) { + return {promise: promise}; +} + +var eventToObjectGenerator = { + promiseCreated: generatePromiseLifecycleEventObject, + promiseFulfilled: generatePromiseLifecycleEventObject, + promiseRejected: generatePromiseLifecycleEventObject, + promiseResolved: generatePromiseLifecycleEventObject, + promiseCancelled: generatePromiseLifecycleEventObject, + promiseChained: function(name, promise, child) { + return {promise: promise, child: child}; + }, + warning: function(name, warning) { + return {warning: warning}; + }, + unhandledRejection: function (name, reason, promise) { + return {reason: reason, promise: promise}; + }, + rejectionHandled: generatePromiseLifecycleEventObject +}; + +var activeFireEvent = function (name) { + var globalEventFired = false; + try { + globalEventFired = fireGlobalEvent.apply(null, arguments); + } catch (e) { + async.throwLater(e); + globalEventFired = true; + } + + var domEventFired = false; + try { + domEventFired = fireDomEvent(name, + eventToObjectGenerator[name].apply(null, arguments)); + } catch (e) { + async.throwLater(e); + domEventFired = true; + } + + return domEventFired || globalEventFired; +}; + +Promise.config = function(opts) { + opts = Object(opts); + if ("longStackTraces" in opts) { + if (opts.longStackTraces) { + Promise.longStackTraces(); + } else if (!opts.longStackTraces && Promise.hasLongStackTraces()) { + disableLongStackTraces(); + } + } + if ("warnings" in opts) { + var warningsOption = opts.warnings; + config.warnings = !!warningsOption; + wForgottenReturn = config.warnings; + + if (util.isObject(warningsOption)) { + if ("wForgottenReturn" in warningsOption) { + wForgottenReturn = !!warningsOption.wForgottenReturn; + } + } + } + if ("cancellation" in opts && opts.cancellation && !config.cancellation) { + if (async.haveItemsQueued()) { + throw new Error( + "cannot enable cancellation after promises are in use"); + } + Promise.prototype._clearCancellationData = + cancellationClearCancellationData; + Promise.prototype._propagateFrom = cancellationPropagateFrom; + Promise.prototype._onCancel = cancellationOnCancel; + Promise.prototype._setOnCancel = cancellationSetOnCancel; + Promise.prototype._attachCancellationCallback = + cancellationAttachCancellationCallback; + Promise.prototype._execute = cancellationExecute; + propagateFromFunction = cancellationPropagateFrom; + config.cancellation = true; + } + if ("monitoring" in opts) { + if (opts.monitoring && !config.monitoring) { + config.monitoring = true; + Promise.prototype._fireEvent = activeFireEvent; + } else if (!opts.monitoring && config.monitoring) { + config.monitoring = false; + Promise.prototype._fireEvent = defaultFireEvent; + } + } + if ("asyncHooks" in opts && util.nodeSupportsAsyncResource) { + var prev = config.asyncHooks; + var cur = !!opts.asyncHooks; + if (prev !== cur) { + config.asyncHooks = cur; + if (cur) { + enableAsyncHooks(); + } else { + disableAsyncHooks(); + } + } + } + return Promise; +}; + +function defaultFireEvent() { return false; } + +Promise.prototype._fireEvent = defaultFireEvent; +Promise.prototype._execute = function(executor, resolve, reject) { + try { + executor(resolve, reject); + } catch (e) { + return e; + } +}; +Promise.prototype._onCancel = function () {}; +Promise.prototype._setOnCancel = function (handler) { ; }; +Promise.prototype._attachCancellationCallback = function(onCancel) { + ; +}; +Promise.prototype._captureStackTrace = function () {}; +Promise.prototype._attachExtraTrace = function () {}; +Promise.prototype._dereferenceTrace = function () {}; +Promise.prototype._clearCancellationData = function() {}; +Promise.prototype._propagateFrom = function (parent, flags) { + ; + ; +}; + +function cancellationExecute(executor, resolve, reject) { + var promise = this; + try { + executor(resolve, reject, function(onCancel) { + if (typeof onCancel !== "function") { + throw new TypeError("onCancel must be a function, got: " + + util.toString(onCancel)); + } + promise._attachCancellationCallback(onCancel); + }); + } catch (e) { + return e; + } +} + +function cancellationAttachCancellationCallback(onCancel) { + if (!this._isCancellable()) return this; + + var previousOnCancel = this._onCancel(); + if (previousOnCancel !== undefined) { + if (util.isArray(previousOnCancel)) { + previousOnCancel.push(onCancel); + } else { + this._setOnCancel([previousOnCancel, onCancel]); + } + } else { + this._setOnCancel(onCancel); + } +} + +function cancellationOnCancel() { + return this._onCancelField; +} + +function cancellationSetOnCancel(onCancel) { + this._onCancelField = onCancel; +} + +function cancellationClearCancellationData() { + this._cancellationParent = undefined; + this._onCancelField = undefined; +} + +function cancellationPropagateFrom(parent, flags) { + if ((flags & 1) !== 0) { + this._cancellationParent = parent; + var branchesRemainingToCancel = parent._branchesRemainingToCancel; + if (branchesRemainingToCancel === undefined) { + branchesRemainingToCancel = 0; + } + parent._branchesRemainingToCancel = branchesRemainingToCancel + 1; + } + if ((flags & 2) !== 0 && parent._isBound()) { + this._setBoundTo(parent._boundTo); + } +} + +function bindingPropagateFrom(parent, flags) { + if ((flags & 2) !== 0 && parent._isBound()) { + this._setBoundTo(parent._boundTo); + } +} +var propagateFromFunction = bindingPropagateFrom; + +function boundValueFunction() { + var ret = this._boundTo; + if (ret !== undefined) { + if (ret instanceof Promise) { + if (ret.isFulfilled()) { + return ret.value(); + } else { + return undefined; + } + } + } + return ret; +} + +function longStackTracesCaptureStackTrace() { + this._trace = new CapturedTrace(this._peekContext()); +} + +function longStackTracesAttachExtraTrace(error, ignoreSelf) { + if (canAttachTrace(error)) { + var trace = this._trace; + if (trace !== undefined) { + if (ignoreSelf) trace = trace._parent; + } + if (trace !== undefined) { + trace.attachExtraTrace(error); + } else if (!error.__stackCleaned__) { + var parsed = parseStackAndMessage(error); + util.notEnumerableProp(error, "stack", + parsed.message + "\n" + parsed.stack.join("\n")); + util.notEnumerableProp(error, "__stackCleaned__", true); + } + } +} + +function longStackTracesDereferenceTrace() { + this._trace = undefined; +} + +function checkForgottenReturns(returnValue, promiseCreated, name, promise, + parent) { + if (returnValue === undefined && promiseCreated !== null && + wForgottenReturn) { + if (parent !== undefined && parent._returnedNonUndefined()) return; + if ((promise._bitField & 65535) === 0) return; + + if (name) name = name + " "; + var handlerLine = ""; + var creatorLine = ""; + if (promiseCreated._trace) { + var traceLines = promiseCreated._trace.stack.split("\n"); + var stack = cleanStack(traceLines); + for (var i = stack.length - 1; i >= 0; --i) { + var line = stack[i]; + if (!nodeFramePattern.test(line)) { + var lineMatches = line.match(parseLinePattern); + if (lineMatches) { + handlerLine = "at " + lineMatches[1] + + ":" + lineMatches[2] + ":" + lineMatches[3] + " "; + } + break; + } + } + + if (stack.length > 0) { + var firstUserLine = stack[0]; + for (var i = 0; i < traceLines.length; ++i) { + + if (traceLines[i] === firstUserLine) { + if (i > 0) { + creatorLine = "\n" + traceLines[i - 1]; + } + break; + } + } + + } + } + var msg = "a promise was created in a " + name + + "handler " + handlerLine + "but was not returned from it, " + + "see http://goo.gl/rRqMUw" + + creatorLine; + promise._warn(msg, true, promiseCreated); + } +} + +function deprecated(name, replacement) { + var message = name + + " is deprecated and will be removed in a future version."; + if (replacement) message += " Use " + replacement + " instead."; + return warn(message); +} + +function warn(message, shouldUseOwnTrace, promise) { + if (!config.warnings) return; + var warning = new Warning(message); + var ctx; + if (shouldUseOwnTrace) { + promise._attachExtraTrace(warning); + } else if (config.longStackTraces && (ctx = Promise._peekContext())) { + ctx.attachExtraTrace(warning); + } else { + var parsed = parseStackAndMessage(warning); + warning.stack = parsed.message + "\n" + parsed.stack.join("\n"); + } + + if (!activeFireEvent("warning", warning)) { + formatAndLogError(warning, "", true); + } +} + +function reconstructStack(message, stacks) { + for (var i = 0; i < stacks.length - 1; ++i) { + stacks[i].push("From previous event:"); + stacks[i] = stacks[i].join("\n"); + } + if (i < stacks.length) { + stacks[i] = stacks[i].join("\n"); + } + return message + "\n" + stacks.join("\n"); +} + +function removeDuplicateOrEmptyJumps(stacks) { + for (var i = 0; i < stacks.length; ++i) { + if (stacks[i].length === 0 || + ((i + 1 < stacks.length) && stacks[i][0] === stacks[i+1][0])) { + stacks.splice(i, 1); + i--; + } + } +} + +function removeCommonRoots(stacks) { + var current = stacks[0]; + for (var i = 1; i < stacks.length; ++i) { + var prev = stacks[i]; + var currentLastIndex = current.length - 1; + var currentLastLine = current[currentLastIndex]; + var commonRootMeetPoint = -1; + + for (var j = prev.length - 1; j >= 0; --j) { + if (prev[j] === currentLastLine) { + commonRootMeetPoint = j; + break; + } + } + + for (var j = commonRootMeetPoint; j >= 0; --j) { + var line = prev[j]; + if (current[currentLastIndex] === line) { + current.pop(); + currentLastIndex--; + } else { + break; + } + } + current = prev; + } +} + +function cleanStack(stack) { + var ret = []; + for (var i = 0; i < stack.length; ++i) { + var line = stack[i]; + var isTraceLine = " (No stack trace)" === line || + stackFramePattern.test(line); + var isInternalFrame = isTraceLine && shouldIgnore(line); + if (isTraceLine && !isInternalFrame) { + if (indentStackFrames && line.charAt(0) !== " ") { + line = " " + line; + } + ret.push(line); + } + } + return ret; +} + +function stackFramesAsArray(error) { + var stack = error.stack.replace(/\s+$/g, "").split("\n"); + for (var i = 0; i < stack.length; ++i) { + var line = stack[i]; + if (" (No stack trace)" === line || stackFramePattern.test(line)) { + break; + } + } + if (i > 0 && error.name != "SyntaxError") { + stack = stack.slice(i); + } + return stack; +} + +function parseStackAndMessage(error) { + var stack = error.stack; + var message = error.toString(); + stack = typeof stack === "string" && stack.length > 0 + ? stackFramesAsArray(error) : [" (No stack trace)"]; + return { + message: message, + stack: error.name == "SyntaxError" ? stack : cleanStack(stack) + }; +} + +function formatAndLogError(error, title, isSoft) { + if (typeof console !== "undefined") { + var message; + if (util.isObject(error)) { + var stack = error.stack; + message = title + formatStack(stack, error); + } else { + message = title + String(error); + } + if (typeof printWarning === "function") { + printWarning(message, isSoft); + } else if (typeof console.log === "function" || + typeof console.log === "object") { + console.log(message); + } + } +} + +function fireRejectionEvent(name, localHandler, reason, promise) { + var localEventFired = false; + try { + if (typeof localHandler === "function") { + localEventFired = true; + if (name === "rejectionHandled") { + localHandler(promise); + } else { + localHandler(reason, promise); + } + } + } catch (e) { + async.throwLater(e); + } + + if (name === "unhandledRejection") { + if (!activeFireEvent(name, reason, promise) && !localEventFired) { + formatAndLogError(reason, "Unhandled rejection "); + } + } else { + activeFireEvent(name, promise); + } +} + +function formatNonError(obj) { + var str; + if (typeof obj === "function") { + str = "[function " + + (obj.name || "anonymous") + + "]"; + } else { + str = obj && typeof obj.toString === "function" + ? obj.toString() : util.toString(obj); + var ruselessToString = /\[object [a-zA-Z0-9$_]+\]/; + if (ruselessToString.test(str)) { + try { + var newStr = JSON.stringify(obj); + str = newStr; + } + catch(e) { + + } + } + if (str.length === 0) { + str = "(empty array)"; + } + } + return ("(<" + snip(str) + ">, no stack trace)"); +} + +function snip(str) { + var maxChars = 41; + if (str.length < maxChars) { + return str; + } + return str.substr(0, maxChars - 3) + "..."; +} + +function longStackTracesIsSupported() { + return typeof captureStackTrace === "function"; +} + +var shouldIgnore = function() { return false; }; +var parseLineInfoRegex = /[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/; +function parseLineInfo(line) { + var matches = line.match(parseLineInfoRegex); + if (matches) { + return { + fileName: matches[1], + line: parseInt(matches[2], 10) + }; + } +} + +function setBounds(firstLineError, lastLineError) { + if (!longStackTracesIsSupported()) return; + var firstStackLines = (firstLineError.stack || "").split("\n"); + var lastStackLines = (lastLineError.stack || "").split("\n"); + var firstIndex = -1; + var lastIndex = -1; + var firstFileName; + var lastFileName; + for (var i = 0; i < firstStackLines.length; ++i) { + var result = parseLineInfo(firstStackLines[i]); + if (result) { + firstFileName = result.fileName; + firstIndex = result.line; + break; + } + } + for (var i = 0; i < lastStackLines.length; ++i) { + var result = parseLineInfo(lastStackLines[i]); + if (result) { + lastFileName = result.fileName; + lastIndex = result.line; + break; + } + } + if (firstIndex < 0 || lastIndex < 0 || !firstFileName || !lastFileName || + firstFileName !== lastFileName || firstIndex >= lastIndex) { + return; + } + + shouldIgnore = function(line) { + if (bluebirdFramePattern.test(line)) return true; + var info = parseLineInfo(line); + if (info) { + if (info.fileName === firstFileName && + (firstIndex <= info.line && info.line <= lastIndex)) { + return true; + } + } + return false; + }; +} + +function CapturedTrace(parent) { + this._parent = parent; + this._promisesCreated = 0; + var length = this._length = 1 + (parent === undefined ? 0 : parent._length); + captureStackTrace(this, CapturedTrace); + if (length > 32) this.uncycle(); +} +util.inherits(CapturedTrace, Error); +Context.CapturedTrace = CapturedTrace; + +CapturedTrace.prototype.uncycle = function() { + var length = this._length; + if (length < 2) return; + var nodes = []; + var stackToIndex = {}; + + for (var i = 0, node = this; node !== undefined; ++i) { + nodes.push(node); + node = node._parent; + } + length = this._length = i; + for (var i = length - 1; i >= 0; --i) { + var stack = nodes[i].stack; + if (stackToIndex[stack] === undefined) { + stackToIndex[stack] = i; + } + } + for (var i = 0; i < length; ++i) { + var currentStack = nodes[i].stack; + var index = stackToIndex[currentStack]; + if (index !== undefined && index !== i) { + if (index > 0) { + nodes[index - 1]._parent = undefined; + nodes[index - 1]._length = 1; + } + nodes[i]._parent = undefined; + nodes[i]._length = 1; + var cycleEdgeNode = i > 0 ? nodes[i - 1] : this; + + if (index < length - 1) { + cycleEdgeNode._parent = nodes[index + 1]; + cycleEdgeNode._parent.uncycle(); + cycleEdgeNode._length = + cycleEdgeNode._parent._length + 1; + } else { + cycleEdgeNode._parent = undefined; + cycleEdgeNode._length = 1; + } + var currentChildLength = cycleEdgeNode._length + 1; + for (var j = i - 2; j >= 0; --j) { + nodes[j]._length = currentChildLength; + currentChildLength++; + } + return; + } + } +}; + +CapturedTrace.prototype.attachExtraTrace = function(error) { + if (error.__stackCleaned__) return; + this.uncycle(); + var parsed = parseStackAndMessage(error); + var message = parsed.message; + var stacks = [parsed.stack]; + + var trace = this; + while (trace !== undefined) { + stacks.push(cleanStack(trace.stack.split("\n"))); + trace = trace._parent; + } + removeCommonRoots(stacks); + removeDuplicateOrEmptyJumps(stacks); + util.notEnumerableProp(error, "stack", reconstructStack(message, stacks)); + util.notEnumerableProp(error, "__stackCleaned__", true); +}; + +var captureStackTrace = (function stackDetection() { + var v8stackFramePattern = /^\s*at\s*/; + var v8stackFormatter = function(stack, error) { + if (typeof stack === "string") return stack; + + if (error.name !== undefined && + error.message !== undefined) { + return error.toString(); + } + return formatNonError(error); + }; + + if (typeof Error.stackTraceLimit === "number" && + typeof Error.captureStackTrace === "function") { + Error.stackTraceLimit += 6; + stackFramePattern = v8stackFramePattern; + formatStack = v8stackFormatter; + var captureStackTrace = Error.captureStackTrace; + + shouldIgnore = function(line) { + return bluebirdFramePattern.test(line); + }; + return function(receiver, ignoreUntil) { + Error.stackTraceLimit += 6; + captureStackTrace(receiver, ignoreUntil); + Error.stackTraceLimit -= 6; + }; + } + var err = new Error(); + + if (typeof err.stack === "string" && + err.stack.split("\n")[0].indexOf("stackDetection@") >= 0) { + stackFramePattern = /@/; + formatStack = v8stackFormatter; + indentStackFrames = true; + return function captureStackTrace(o) { + o.stack = new Error().stack; + }; + } + + var hasStackAfterThrow; + try { throw new Error(); } + catch(e) { + hasStackAfterThrow = ("stack" in e); + } + if (!("stack" in err) && hasStackAfterThrow && + typeof Error.stackTraceLimit === "number") { + stackFramePattern = v8stackFramePattern; + formatStack = v8stackFormatter; + return function captureStackTrace(o) { + Error.stackTraceLimit += 6; + try { throw new Error(); } + catch(e) { o.stack = e.stack; } + Error.stackTraceLimit -= 6; + }; + } + + formatStack = function(stack, error) { + if (typeof stack === "string") return stack; + + if ((typeof error === "object" || + typeof error === "function") && + error.name !== undefined && + error.message !== undefined) { + return error.toString(); + } + return formatNonError(error); + }; + + return null; + +})([]); + +if (typeof console !== "undefined" && typeof console.warn !== "undefined") { + printWarning = function (message) { + console.warn(message); + }; + if (util.isNode && process.stderr.isTTY) { + printWarning = function(message, isSoft) { + var color = isSoft ? "\u001b[33m" : "\u001b[31m"; + console.warn(color + message + "\u001b[0m\n"); + }; + } else if (!util.isNode && typeof (new Error().stack) === "string") { + printWarning = function(message, isSoft) { + console.warn("%c" + message, + isSoft ? "color: darkorange" : "color: red"); + }; + } +} + +var config = { + warnings: warnings, + longStackTraces: false, + cancellation: false, + monitoring: false, + asyncHooks: false +}; + +if (longStackTraces) Promise.longStackTraces(); + +return { + asyncHooks: function() { + return config.asyncHooks; + }, + longStackTraces: function() { + return config.longStackTraces; + }, + warnings: function() { + return config.warnings; + }, + cancellation: function() { + return config.cancellation; + }, + monitoring: function() { + return config.monitoring; + }, + propagateFromFunction: function() { + return propagateFromFunction; + }, + boundValueFunction: function() { + return boundValueFunction; + }, + checkForgottenReturns: checkForgottenReturns, + setBounds: setBounds, + warn: warn, + deprecated: deprecated, + CapturedTrace: CapturedTrace, + fireDomEvent: fireDomEvent, + fireGlobalEvent: fireGlobalEvent +}; +}; + +},{"./errors":12,"./es5":13,"./util":36}],10:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise) { +function returner() { + return this.value; +} +function thrower() { + throw this.reason; +} + +Promise.prototype["return"] = +Promise.prototype.thenReturn = function (value) { + if (value instanceof Promise) value.suppressUnhandledRejections(); + return this._then( + returner, undefined, undefined, {value: value}, undefined); +}; + +Promise.prototype["throw"] = +Promise.prototype.thenThrow = function (reason) { + return this._then( + thrower, undefined, undefined, {reason: reason}, undefined); +}; + +Promise.prototype.catchThrow = function (reason) { + if (arguments.length <= 1) { + return this._then( + undefined, thrower, undefined, {reason: reason}, undefined); + } else { + var _reason = arguments[1]; + var handler = function() {throw _reason;}; + return this.caught(reason, handler); + } +}; + +Promise.prototype.catchReturn = function (value) { + if (arguments.length <= 1) { + if (value instanceof Promise) value.suppressUnhandledRejections(); + return this._then( + undefined, returner, undefined, {value: value}, undefined); + } else { + var _value = arguments[1]; + if (_value instanceof Promise) _value.suppressUnhandledRejections(); + var handler = function() {return _value;}; + return this.caught(value, handler); + } +}; +}; + +},{}],11:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var PromiseReduce = Promise.reduce; +var PromiseAll = Promise.all; + +function promiseAllThis() { + return PromiseAll(this); +} + +function PromiseMapSeries(promises, fn) { + return PromiseReduce(promises, fn, INTERNAL, INTERNAL); +} + +Promise.prototype.each = function (fn) { + return PromiseReduce(this, fn, INTERNAL, 0) + ._then(promiseAllThis, undefined, undefined, this, undefined); +}; + +Promise.prototype.mapSeries = function (fn) { + return PromiseReduce(this, fn, INTERNAL, INTERNAL); +}; + +Promise.each = function (promises, fn) { + return PromiseReduce(promises, fn, INTERNAL, 0) + ._then(promiseAllThis, undefined, undefined, promises, undefined); +}; + +Promise.mapSeries = PromiseMapSeries; +}; + + +},{}],12:[function(_dereq_,module,exports){ +"use strict"; +var es5 = _dereq_("./es5"); +var Objectfreeze = es5.freeze; +var util = _dereq_("./util"); +var inherits = util.inherits; +var notEnumerableProp = util.notEnumerableProp; + +function subError(nameProperty, defaultMessage) { + function SubError(message) { + if (!(this instanceof SubError)) return new SubError(message); + notEnumerableProp(this, "message", + typeof message === "string" ? message : defaultMessage); + notEnumerableProp(this, "name", nameProperty); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + Error.call(this); + } + } + inherits(SubError, Error); + return SubError; +} + +var _TypeError, _RangeError; +var Warning = subError("Warning", "warning"); +var CancellationError = subError("CancellationError", "cancellation error"); +var TimeoutError = subError("TimeoutError", "timeout error"); +var AggregateError = subError("AggregateError", "aggregate error"); +try { + _TypeError = TypeError; + _RangeError = RangeError; +} catch(e) { + _TypeError = subError("TypeError", "type error"); + _RangeError = subError("RangeError", "range error"); +} + +var methods = ("join pop push shift unshift slice filter forEach some " + + "every map indexOf lastIndexOf reduce reduceRight sort reverse").split(" "); + +for (var i = 0; i < methods.length; ++i) { + if (typeof Array.prototype[methods[i]] === "function") { + AggregateError.prototype[methods[i]] = Array.prototype[methods[i]]; + } +} + +es5.defineProperty(AggregateError.prototype, "length", { + value: 0, + configurable: false, + writable: true, + enumerable: true +}); +AggregateError.prototype["isOperational"] = true; +var level = 0; +AggregateError.prototype.toString = function() { + var indent = Array(level * 4 + 1).join(" "); + var ret = "\n" + indent + "AggregateError of:" + "\n"; + level++; + indent = Array(level * 4 + 1).join(" "); + for (var i = 0; i < this.length; ++i) { + var str = this[i] === this ? "[Circular AggregateError]" : this[i] + ""; + var lines = str.split("\n"); + for (var j = 0; j < lines.length; ++j) { + lines[j] = indent + lines[j]; + } + str = lines.join("\n"); + ret += str + "\n"; + } + level--; + return ret; +}; + +function OperationalError(message) { + if (!(this instanceof OperationalError)) + return new OperationalError(message); + notEnumerableProp(this, "name", "OperationalError"); + notEnumerableProp(this, "message", message); + this.cause = message; + this["isOperational"] = true; + + if (message instanceof Error) { + notEnumerableProp(this, "message", message.message); + notEnumerableProp(this, "stack", message.stack); + } else if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + +} +inherits(OperationalError, Error); + +var errorTypes = Error["__BluebirdErrorTypes__"]; +if (!errorTypes) { + errorTypes = Objectfreeze({ + CancellationError: CancellationError, + TimeoutError: TimeoutError, + OperationalError: OperationalError, + RejectionError: OperationalError, + AggregateError: AggregateError + }); + es5.defineProperty(Error, "__BluebirdErrorTypes__", { + value: errorTypes, + writable: false, + enumerable: false, + configurable: false + }); +} + +module.exports = { + Error: Error, + TypeError: _TypeError, + RangeError: _RangeError, + CancellationError: errorTypes.CancellationError, + OperationalError: errorTypes.OperationalError, + TimeoutError: errorTypes.TimeoutError, + AggregateError: errorTypes.AggregateError, + Warning: Warning +}; + +},{"./es5":13,"./util":36}],13:[function(_dereq_,module,exports){ +var isES5 = (function(){ + "use strict"; + return this === undefined; +})(); + +if (isES5) { + module.exports = { + freeze: Object.freeze, + defineProperty: Object.defineProperty, + getDescriptor: Object.getOwnPropertyDescriptor, + keys: Object.keys, + names: Object.getOwnPropertyNames, + getPrototypeOf: Object.getPrototypeOf, + isArray: Array.isArray, + isES5: isES5, + propertyIsWritable: function(obj, prop) { + var descriptor = Object.getOwnPropertyDescriptor(obj, prop); + return !!(!descriptor || descriptor.writable || descriptor.set); + } + }; +} else { + var has = {}.hasOwnProperty; + var str = {}.toString; + var proto = {}.constructor.prototype; + + var ObjectKeys = function (o) { + var ret = []; + for (var key in o) { + if (has.call(o, key)) { + ret.push(key); + } + } + return ret; + }; + + var ObjectGetDescriptor = function(o, key) { + return {value: o[key]}; + }; + + var ObjectDefineProperty = function (o, key, desc) { + o[key] = desc.value; + return o; + }; + + var ObjectFreeze = function (obj) { + return obj; + }; + + var ObjectGetPrototypeOf = function (obj) { + try { + return Object(obj).constructor.prototype; + } + catch (e) { + return proto; + } + }; + + var ArrayIsArray = function (obj) { + try { + return str.call(obj) === "[object Array]"; + } + catch(e) { + return false; + } + }; + + module.exports = { + isArray: ArrayIsArray, + keys: ObjectKeys, + names: ObjectKeys, + defineProperty: ObjectDefineProperty, + getDescriptor: ObjectGetDescriptor, + freeze: ObjectFreeze, + getPrototypeOf: ObjectGetPrototypeOf, + isES5: isES5, + propertyIsWritable: function() { + return true; + } + }; +} + +},{}],14:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var PromiseMap = Promise.map; + +Promise.prototype.filter = function (fn, options) { + return PromiseMap(this, fn, options, INTERNAL); +}; + +Promise.filter = function (promises, fn, options) { + return PromiseMap(promises, fn, options, INTERNAL); +}; +}; + +},{}],15:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, tryConvertToPromise, NEXT_FILTER) { +var util = _dereq_("./util"); +var CancellationError = Promise.CancellationError; +var errorObj = util.errorObj; +var catchFilter = _dereq_("./catch_filter")(NEXT_FILTER); + +function PassThroughHandlerContext(promise, type, handler) { + this.promise = promise; + this.type = type; + this.handler = handler; + this.called = false; + this.cancelPromise = null; +} + +PassThroughHandlerContext.prototype.isFinallyHandler = function() { + return this.type === 0; +}; + +function FinallyHandlerCancelReaction(finallyHandler) { + this.finallyHandler = finallyHandler; +} + +FinallyHandlerCancelReaction.prototype._resultCancelled = function() { + checkCancel(this.finallyHandler); +}; + +function checkCancel(ctx, reason) { + if (ctx.cancelPromise != null) { + if (arguments.length > 1) { + ctx.cancelPromise._reject(reason); + } else { + ctx.cancelPromise._cancel(); + } + ctx.cancelPromise = null; + return true; + } + return false; +} + +function succeed() { + return finallyHandler.call(this, this.promise._target()._settledValue()); +} +function fail(reason) { + if (checkCancel(this, reason)) return; + errorObj.e = reason; + return errorObj; +} +function finallyHandler(reasonOrValue) { + var promise = this.promise; + var handler = this.handler; + + if (!this.called) { + this.called = true; + var ret = this.isFinallyHandler() + ? handler.call(promise._boundValue()) + : handler.call(promise._boundValue(), reasonOrValue); + if (ret === NEXT_FILTER) { + return ret; + } else if (ret !== undefined) { + promise._setReturnedNonUndefined(); + var maybePromise = tryConvertToPromise(ret, promise); + if (maybePromise instanceof Promise) { + if (this.cancelPromise != null) { + if (maybePromise._isCancelled()) { + var reason = + new CancellationError("late cancellation observer"); + promise._attachExtraTrace(reason); + errorObj.e = reason; + return errorObj; + } else if (maybePromise.isPending()) { + maybePromise._attachCancellationCallback( + new FinallyHandlerCancelReaction(this)); + } + } + return maybePromise._then( + succeed, fail, undefined, this, undefined); + } + } + } + + if (promise.isRejected()) { + checkCancel(this); + errorObj.e = reasonOrValue; + return errorObj; + } else { + checkCancel(this); + return reasonOrValue; + } +} + +Promise.prototype._passThrough = function(handler, type, success, fail) { + if (typeof handler !== "function") return this.then(); + return this._then(success, + fail, + undefined, + new PassThroughHandlerContext(this, type, handler), + undefined); +}; + +Promise.prototype.lastly = +Promise.prototype["finally"] = function (handler) { + return this._passThrough(handler, + 0, + finallyHandler, + finallyHandler); +}; + + +Promise.prototype.tap = function (handler) { + return this._passThrough(handler, 1, finallyHandler); +}; + +Promise.prototype.tapCatch = function (handlerOrPredicate) { + var len = arguments.length; + if(len === 1) { + return this._passThrough(handlerOrPredicate, + 1, + undefined, + finallyHandler); + } else { + var catchInstances = new Array(len - 1), + j = 0, i; + for (i = 0; i < len - 1; ++i) { + var item = arguments[i]; + if (util.isObject(item)) { + catchInstances[j++] = item; + } else { + return Promise.reject(new TypeError( + "tapCatch statement predicate: " + + "expecting an object but got " + util.classString(item) + )); + } + } + catchInstances.length = j; + var handler = arguments[i]; + return this._passThrough(catchFilter(catchInstances, handler, this), + 1, + undefined, + finallyHandler); + } + +}; + +return PassThroughHandlerContext; +}; + +},{"./catch_filter":7,"./util":36}],16:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, + apiRejection, + INTERNAL, + tryConvertToPromise, + Proxyable, + debug) { +var errors = _dereq_("./errors"); +var TypeError = errors.TypeError; +var util = _dereq_("./util"); +var errorObj = util.errorObj; +var tryCatch = util.tryCatch; +var yieldHandlers = []; + +function promiseFromYieldHandler(value, yieldHandlers, traceParent) { + for (var i = 0; i < yieldHandlers.length; ++i) { + traceParent._pushContext(); + var result = tryCatch(yieldHandlers[i])(value); + traceParent._popContext(); + if (result === errorObj) { + traceParent._pushContext(); + var ret = Promise.reject(errorObj.e); + traceParent._popContext(); + return ret; + } + var maybePromise = tryConvertToPromise(result, traceParent); + if (maybePromise instanceof Promise) return maybePromise; + } + return null; +} + +function PromiseSpawn(generatorFunction, receiver, yieldHandler, stack) { + if (debug.cancellation()) { + var internal = new Promise(INTERNAL); + var _finallyPromise = this._finallyPromise = new Promise(INTERNAL); + this._promise = internal.lastly(function() { + return _finallyPromise; + }); + internal._captureStackTrace(); + internal._setOnCancel(this); + } else { + var promise = this._promise = new Promise(INTERNAL); + promise._captureStackTrace(); + } + this._stack = stack; + this._generatorFunction = generatorFunction; + this._receiver = receiver; + this._generator = undefined; + this._yieldHandlers = typeof yieldHandler === "function" + ? [yieldHandler].concat(yieldHandlers) + : yieldHandlers; + this._yieldedPromise = null; + this._cancellationPhase = false; +} +util.inherits(PromiseSpawn, Proxyable); + +PromiseSpawn.prototype._isResolved = function() { + return this._promise === null; +}; + +PromiseSpawn.prototype._cleanup = function() { + this._promise = this._generator = null; + if (debug.cancellation() && this._finallyPromise !== null) { + this._finallyPromise._fulfill(); + this._finallyPromise = null; + } +}; + +PromiseSpawn.prototype._promiseCancelled = function() { + if (this._isResolved()) return; + var implementsReturn = typeof this._generator["return"] !== "undefined"; + + var result; + if (!implementsReturn) { + var reason = new Promise.CancellationError( + "generator .return() sentinel"); + Promise.coroutine.returnSentinel = reason; + this._promise._attachExtraTrace(reason); + this._promise._pushContext(); + result = tryCatch(this._generator["throw"]).call(this._generator, + reason); + this._promise._popContext(); + } else { + this._promise._pushContext(); + result = tryCatch(this._generator["return"]).call(this._generator, + undefined); + this._promise._popContext(); + } + this._cancellationPhase = true; + this._yieldedPromise = null; + this._continue(result); +}; + +PromiseSpawn.prototype._promiseFulfilled = function(value) { + this._yieldedPromise = null; + this._promise._pushContext(); + var result = tryCatch(this._generator.next).call(this._generator, value); + this._promise._popContext(); + this._continue(result); +}; + +PromiseSpawn.prototype._promiseRejected = function(reason) { + this._yieldedPromise = null; + this._promise._attachExtraTrace(reason); + this._promise._pushContext(); + var result = tryCatch(this._generator["throw"]) + .call(this._generator, reason); + this._promise._popContext(); + this._continue(result); +}; + +PromiseSpawn.prototype._resultCancelled = function() { + if (this._yieldedPromise instanceof Promise) { + var promise = this._yieldedPromise; + this._yieldedPromise = null; + promise.cancel(); + } +}; + +PromiseSpawn.prototype.promise = function () { + return this._promise; +}; + +PromiseSpawn.prototype._run = function () { + this._generator = this._generatorFunction.call(this._receiver); + this._receiver = + this._generatorFunction = undefined; + this._promiseFulfilled(undefined); +}; + +PromiseSpawn.prototype._continue = function (result) { + var promise = this._promise; + if (result === errorObj) { + this._cleanup(); + if (this._cancellationPhase) { + return promise.cancel(); + } else { + return promise._rejectCallback(result.e, false); + } + } + + var value = result.value; + if (result.done === true) { + this._cleanup(); + if (this._cancellationPhase) { + return promise.cancel(); + } else { + return promise._resolveCallback(value); + } + } else { + var maybePromise = tryConvertToPromise(value, this._promise); + if (!(maybePromise instanceof Promise)) { + maybePromise = + promiseFromYieldHandler(maybePromise, + this._yieldHandlers, + this._promise); + if (maybePromise === null) { + this._promiseRejected( + new TypeError( + "A value %s was yielded that could not be treated as a promise\u000a\u000a See http://goo.gl/MqrFmX\u000a\u000a".replace("%s", String(value)) + + "From coroutine:\u000a" + + this._stack.split("\n").slice(1, -7).join("\n") + ) + ); + return; + } + } + maybePromise = maybePromise._target(); + var bitField = maybePromise._bitField; + ; + if (((bitField & 50397184) === 0)) { + this._yieldedPromise = maybePromise; + maybePromise._proxy(this, null); + } else if (((bitField & 33554432) !== 0)) { + Promise._async.invoke( + this._promiseFulfilled, this, maybePromise._value() + ); + } else if (((bitField & 16777216) !== 0)) { + Promise._async.invoke( + this._promiseRejected, this, maybePromise._reason() + ); + } else { + this._promiseCancelled(); + } + } +}; + +Promise.coroutine = function (generatorFunction, options) { + if (typeof generatorFunction !== "function") { + throw new TypeError("generatorFunction must be a function\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + var yieldHandler = Object(options).yieldHandler; + var PromiseSpawn$ = PromiseSpawn; + var stack = new Error().stack; + return function () { + var generator = generatorFunction.apply(this, arguments); + var spawn = new PromiseSpawn$(undefined, undefined, yieldHandler, + stack); + var ret = spawn.promise(); + spawn._generator = generator; + spawn._promiseFulfilled(undefined); + return ret; + }; +}; + +Promise.coroutine.addYieldHandler = function(fn) { + if (typeof fn !== "function") { + throw new TypeError("expecting a function but got " + util.classString(fn)); + } + yieldHandlers.push(fn); +}; + +Promise.spawn = function (generatorFunction) { + debug.deprecated("Promise.spawn()", "Promise.coroutine()"); + if (typeof generatorFunction !== "function") { + return apiRejection("generatorFunction must be a function\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + var spawn = new PromiseSpawn(generatorFunction, this); + var ret = spawn.promise(); + spawn._run(Promise.spawn); + return ret; +}; +}; + +},{"./errors":12,"./util":36}],17:[function(_dereq_,module,exports){ +"use strict"; +module.exports = +function(Promise, PromiseArray, tryConvertToPromise, INTERNAL, async) { +var util = _dereq_("./util"); +var canEvaluate = util.canEvaluate; +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; +var reject; + +if (!true) { +if (canEvaluate) { + var thenCallback = function(i) { + return new Function("value", "holder", " \n\ + 'use strict'; \n\ + holder.pIndex = value; \n\ + holder.checkFulfillment(this); \n\ + ".replace(/Index/g, i)); + }; + + var promiseSetter = function(i) { + return new Function("promise", "holder", " \n\ + 'use strict'; \n\ + holder.pIndex = promise; \n\ + ".replace(/Index/g, i)); + }; + + var generateHolderClass = function(total) { + var props = new Array(total); + for (var i = 0; i < props.length; ++i) { + props[i] = "this.p" + (i+1); + } + var assignment = props.join(" = ") + " = null;"; + var cancellationCode= "var promise;\n" + props.map(function(prop) { + return " \n\ + promise = " + prop + "; \n\ + if (promise instanceof Promise) { \n\ + promise.cancel(); \n\ + } \n\ + "; + }).join("\n"); + var passedArguments = props.join(", "); + var name = "Holder$" + total; + + + var code = "return function(tryCatch, errorObj, Promise, async) { \n\ + 'use strict'; \n\ + function [TheName](fn) { \n\ + [TheProperties] \n\ + this.fn = fn; \n\ + this.asyncNeeded = true; \n\ + this.now = 0; \n\ + } \n\ + \n\ + [TheName].prototype._callFunction = function(promise) { \n\ + promise._pushContext(); \n\ + var ret = tryCatch(this.fn)([ThePassedArguments]); \n\ + promise._popContext(); \n\ + if (ret === errorObj) { \n\ + promise._rejectCallback(ret.e, false); \n\ + } else { \n\ + promise._resolveCallback(ret); \n\ + } \n\ + }; \n\ + \n\ + [TheName].prototype.checkFulfillment = function(promise) { \n\ + var now = ++this.now; \n\ + if (now === [TheTotal]) { \n\ + if (this.asyncNeeded) { \n\ + async.invoke(this._callFunction, this, promise); \n\ + } else { \n\ + this._callFunction(promise); \n\ + } \n\ + \n\ + } \n\ + }; \n\ + \n\ + [TheName].prototype._resultCancelled = function() { \n\ + [CancellationCode] \n\ + }; \n\ + \n\ + return [TheName]; \n\ + }(tryCatch, errorObj, Promise, async); \n\ + "; + + code = code.replace(/\[TheName\]/g, name) + .replace(/\[TheTotal\]/g, total) + .replace(/\[ThePassedArguments\]/g, passedArguments) + .replace(/\[TheProperties\]/g, assignment) + .replace(/\[CancellationCode\]/g, cancellationCode); + + return new Function("tryCatch", "errorObj", "Promise", "async", code) + (tryCatch, errorObj, Promise, async); + }; + + var holderClasses = []; + var thenCallbacks = []; + var promiseSetters = []; + + for (var i = 0; i < 8; ++i) { + holderClasses.push(generateHolderClass(i + 1)); + thenCallbacks.push(thenCallback(i + 1)); + promiseSetters.push(promiseSetter(i + 1)); + } + + reject = function (reason) { + this._reject(reason); + }; +}} + +Promise.join = function () { + var last = arguments.length - 1; + var fn; + if (last > 0 && typeof arguments[last] === "function") { + fn = arguments[last]; + if (!true) { + if (last <= 8 && canEvaluate) { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + var HolderClass = holderClasses[last - 1]; + var holder = new HolderClass(fn); + var callbacks = thenCallbacks; + + for (var i = 0; i < last; ++i) { + var maybePromise = tryConvertToPromise(arguments[i], ret); + if (maybePromise instanceof Promise) { + maybePromise = maybePromise._target(); + var bitField = maybePromise._bitField; + ; + if (((bitField & 50397184) === 0)) { + maybePromise._then(callbacks[i], reject, + undefined, ret, holder); + promiseSetters[i](maybePromise, holder); + holder.asyncNeeded = false; + } else if (((bitField & 33554432) !== 0)) { + callbacks[i].call(ret, + maybePromise._value(), holder); + } else if (((bitField & 16777216) !== 0)) { + ret._reject(maybePromise._reason()); + } else { + ret._cancel(); + } + } else { + callbacks[i].call(ret, maybePromise, holder); + } + } + + if (!ret._isFateSealed()) { + if (holder.asyncNeeded) { + var context = Promise._getContext(); + holder.fn = util.contextBind(context, holder.fn); + } + ret._setAsyncGuaranteed(); + ret._setOnCancel(holder); + } + return ret; + } + } + } + var args = [].slice.call(arguments);; + if (fn) args.pop(); + var ret = new PromiseArray(args).promise(); + return fn !== undefined ? ret.spread(fn) : ret; +}; + +}; + +},{"./util":36}],18:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, + PromiseArray, + apiRejection, + tryConvertToPromise, + INTERNAL, + debug) { +var util = _dereq_("./util"); +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; +var async = Promise._async; + +function MappingPromiseArray(promises, fn, limit, _filter) { + this.constructor$(promises); + this._promise._captureStackTrace(); + var context = Promise._getContext(); + this._callback = util.contextBind(context, fn); + this._preservedValues = _filter === INTERNAL + ? new Array(this.length()) + : null; + this._limit = limit; + this._inFlight = 0; + this._queue = []; + async.invoke(this._asyncInit, this, undefined); + if (util.isArray(promises)) { + for (var i = 0; i < promises.length; ++i) { + var maybePromise = promises[i]; + if (maybePromise instanceof Promise) { + maybePromise.suppressUnhandledRejections(); + } + } + } +} +util.inherits(MappingPromiseArray, PromiseArray); + +MappingPromiseArray.prototype._asyncInit = function() { + this._init$(undefined, -2); +}; + +MappingPromiseArray.prototype._init = function () {}; + +MappingPromiseArray.prototype._promiseFulfilled = function (value, index) { + var values = this._values; + var length = this.length(); + var preservedValues = this._preservedValues; + var limit = this._limit; + + if (index < 0) { + index = (index * -1) - 1; + values[index] = value; + if (limit >= 1) { + this._inFlight--; + this._drainQueue(); + if (this._isResolved()) return true; + } + } else { + if (limit >= 1 && this._inFlight >= limit) { + values[index] = value; + this._queue.push(index); + return false; + } + if (preservedValues !== null) preservedValues[index] = value; + + var promise = this._promise; + var callback = this._callback; + var receiver = promise._boundValue(); + promise._pushContext(); + var ret = tryCatch(callback).call(receiver, value, index, length); + var promiseCreated = promise._popContext(); + debug.checkForgottenReturns( + ret, + promiseCreated, + preservedValues !== null ? "Promise.filter" : "Promise.map", + promise + ); + if (ret === errorObj) { + this._reject(ret.e); + return true; + } + + var maybePromise = tryConvertToPromise(ret, this._promise); + if (maybePromise instanceof Promise) { + maybePromise = maybePromise._target(); + var bitField = maybePromise._bitField; + ; + if (((bitField & 50397184) === 0)) { + if (limit >= 1) this._inFlight++; + values[index] = maybePromise; + maybePromise._proxy(this, (index + 1) * -1); + return false; + } else if (((bitField & 33554432) !== 0)) { + ret = maybePromise._value(); + } else if (((bitField & 16777216) !== 0)) { + this._reject(maybePromise._reason()); + return true; + } else { + this._cancel(); + return true; + } + } + values[index] = ret; + } + var totalResolved = ++this._totalResolved; + if (totalResolved >= length) { + if (preservedValues !== null) { + this._filter(values, preservedValues); + } else { + this._resolve(values); + } + return true; + } + return false; +}; + +MappingPromiseArray.prototype._drainQueue = function () { + var queue = this._queue; + var limit = this._limit; + var values = this._values; + while (queue.length > 0 && this._inFlight < limit) { + if (this._isResolved()) return; + var index = queue.pop(); + this._promiseFulfilled(values[index], index); + } +}; + +MappingPromiseArray.prototype._filter = function (booleans, values) { + var len = values.length; + var ret = new Array(len); + var j = 0; + for (var i = 0; i < len; ++i) { + if (booleans[i]) ret[j++] = values[i]; + } + ret.length = j; + this._resolve(ret); +}; + +MappingPromiseArray.prototype.preservedValues = function () { + return this._preservedValues; +}; + +function map(promises, fn, options, _filter) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + + var limit = 0; + if (options !== undefined) { + if (typeof options === "object" && options !== null) { + if (typeof options.concurrency !== "number") { + return Promise.reject( + new TypeError("'concurrency' must be a number but it is " + + util.classString(options.concurrency))); + } + limit = options.concurrency; + } else { + return Promise.reject(new TypeError( + "options argument must be an object but it is " + + util.classString(options))); + } + } + limit = typeof limit === "number" && + isFinite(limit) && limit >= 1 ? limit : 0; + return new MappingPromiseArray(promises, fn, limit, _filter).promise(); +} + +Promise.prototype.map = function (fn, options) { + return map(this, fn, options, null); +}; + +Promise.map = function (promises, fn, options, _filter) { + return map(promises, fn, options, _filter); +}; + + +}; + +},{"./util":36}],19:[function(_dereq_,module,exports){ +"use strict"; +module.exports = +function(Promise, INTERNAL, tryConvertToPromise, apiRejection, debug) { +var util = _dereq_("./util"); +var tryCatch = util.tryCatch; + +Promise.method = function (fn) { + if (typeof fn !== "function") { + throw new Promise.TypeError("expecting a function but got " + util.classString(fn)); + } + return function () { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._pushContext(); + var value = tryCatch(fn).apply(this, arguments); + var promiseCreated = ret._popContext(); + debug.checkForgottenReturns( + value, promiseCreated, "Promise.method", ret); + ret._resolveFromSyncValue(value); + return ret; + }; +}; + +Promise.attempt = Promise["try"] = function (fn) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._pushContext(); + var value; + if (arguments.length > 1) { + debug.deprecated("calling Promise.try with more than 1 argument"); + var arg = arguments[1]; + var ctx = arguments[2]; + value = util.isArray(arg) ? tryCatch(fn).apply(ctx, arg) + : tryCatch(fn).call(ctx, arg); + } else { + value = tryCatch(fn)(); + } + var promiseCreated = ret._popContext(); + debug.checkForgottenReturns( + value, promiseCreated, "Promise.try", ret); + ret._resolveFromSyncValue(value); + return ret; +}; + +Promise.prototype._resolveFromSyncValue = function (value) { + if (value === util.errorObj) { + this._rejectCallback(value.e, false); + } else { + this._resolveCallback(value, true); + } +}; +}; + +},{"./util":36}],20:[function(_dereq_,module,exports){ +"use strict"; +var util = _dereq_("./util"); +var maybeWrapAsError = util.maybeWrapAsError; +var errors = _dereq_("./errors"); +var OperationalError = errors.OperationalError; +var es5 = _dereq_("./es5"); + +function isUntypedError(obj) { + return obj instanceof Error && + es5.getPrototypeOf(obj) === Error.prototype; +} + +var rErrorKey = /^(?:name|message|stack|cause)$/; +function wrapAsOperationalError(obj) { + var ret; + if (isUntypedError(obj)) { + ret = new OperationalError(obj); + ret.name = obj.name; + ret.message = obj.message; + ret.stack = obj.stack; + var keys = es5.keys(obj); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (!rErrorKey.test(key)) { + ret[key] = obj[key]; + } + } + return ret; + } + util.markAsOriginatingFromRejection(obj); + return obj; +} + +function nodebackForPromise(promise, multiArgs) { + return function(err, value) { + if (promise === null) return; + if (err) { + var wrapped = wrapAsOperationalError(maybeWrapAsError(err)); + promise._attachExtraTrace(wrapped); + promise._reject(wrapped); + } else if (!multiArgs) { + promise._fulfill(value); + } else { + var args = [].slice.call(arguments, 1);; + promise._fulfill(args); + } + promise = null; + }; +} + +module.exports = nodebackForPromise; + +},{"./errors":12,"./es5":13,"./util":36}],21:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise) { +var util = _dereq_("./util"); +var async = Promise._async; +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; + +function spreadAdapter(val, nodeback) { + var promise = this; + if (!util.isArray(val)) return successAdapter.call(promise, val, nodeback); + var ret = + tryCatch(nodeback).apply(promise._boundValue(), [null].concat(val)); + if (ret === errorObj) { + async.throwLater(ret.e); + } +} + +function successAdapter(val, nodeback) { + var promise = this; + var receiver = promise._boundValue(); + var ret = val === undefined + ? tryCatch(nodeback).call(receiver, null) + : tryCatch(nodeback).call(receiver, null, val); + if (ret === errorObj) { + async.throwLater(ret.e); + } +} +function errorAdapter(reason, nodeback) { + var promise = this; + if (!reason) { + var newReason = new Error(reason + ""); + newReason.cause = reason; + reason = newReason; + } + var ret = tryCatch(nodeback).call(promise._boundValue(), reason); + if (ret === errorObj) { + async.throwLater(ret.e); + } +} + +Promise.prototype.asCallback = Promise.prototype.nodeify = function (nodeback, + options) { + if (typeof nodeback == "function") { + var adapter = successAdapter; + if (options !== undefined && Object(options).spread) { + adapter = spreadAdapter; + } + this._then( + adapter, + errorAdapter, + undefined, + this, + nodeback + ); + } + return this; +}; +}; + +},{"./util":36}],22:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function() { +var makeSelfResolutionError = function () { + return new TypeError("circular promise resolution chain\u000a\u000a See http://goo.gl/MqrFmX\u000a"); +}; +var reflectHandler = function() { + return new Promise.PromiseInspection(this._target()); +}; +var apiRejection = function(msg) { + return Promise.reject(new TypeError(msg)); +}; +function Proxyable() {} +var UNDEFINED_BINDING = {}; +var util = _dereq_("./util"); +util.setReflectHandler(reflectHandler); + +var getDomain = function() { + var domain = process.domain; + if (domain === undefined) { + return null; + } + return domain; +}; +var getContextDefault = function() { + return null; +}; +var getContextDomain = function() { + return { + domain: getDomain(), + async: null + }; +}; +var AsyncResource = util.isNode && util.nodeSupportsAsyncResource ? + _dereq_("async_hooks").AsyncResource : null; +var getContextAsyncHooks = function() { + return { + domain: getDomain(), + async: new AsyncResource("Bluebird::Promise") + }; +}; +var getContext = util.isNode ? getContextDomain : getContextDefault; +util.notEnumerableProp(Promise, "_getContext", getContext); +var enableAsyncHooks = function() { + getContext = getContextAsyncHooks; + util.notEnumerableProp(Promise, "_getContext", getContextAsyncHooks); +}; +var disableAsyncHooks = function() { + getContext = getContextDomain; + util.notEnumerableProp(Promise, "_getContext", getContextDomain); +}; + +var es5 = _dereq_("./es5"); +var Async = _dereq_("./async"); +var async = new Async(); +es5.defineProperty(Promise, "_async", {value: async}); +var errors = _dereq_("./errors"); +var TypeError = Promise.TypeError = errors.TypeError; +Promise.RangeError = errors.RangeError; +var CancellationError = Promise.CancellationError = errors.CancellationError; +Promise.TimeoutError = errors.TimeoutError; +Promise.OperationalError = errors.OperationalError; +Promise.RejectionError = errors.OperationalError; +Promise.AggregateError = errors.AggregateError; +var INTERNAL = function(){}; +var APPLY = {}; +var NEXT_FILTER = {}; +var tryConvertToPromise = _dereq_("./thenables")(Promise, INTERNAL); +var PromiseArray = + _dereq_("./promise_array")(Promise, INTERNAL, + tryConvertToPromise, apiRejection, Proxyable); +var Context = _dereq_("./context")(Promise); + /*jshint unused:false*/ +var createContext = Context.create; + +var debug = _dereq_("./debuggability")(Promise, Context, + enableAsyncHooks, disableAsyncHooks); +var CapturedTrace = debug.CapturedTrace; +var PassThroughHandlerContext = + _dereq_("./finally")(Promise, tryConvertToPromise, NEXT_FILTER); +var catchFilter = _dereq_("./catch_filter")(NEXT_FILTER); +var nodebackForPromise = _dereq_("./nodeback"); +var errorObj = util.errorObj; +var tryCatch = util.tryCatch; +function check(self, executor) { + if (self == null || self.constructor !== Promise) { + throw new TypeError("the promise constructor cannot be invoked directly\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + if (typeof executor !== "function") { + throw new TypeError("expecting a function but got " + util.classString(executor)); + } + +} + +function Promise(executor) { + if (executor !== INTERNAL) { + check(this, executor); + } + this._bitField = 0; + this._fulfillmentHandler0 = undefined; + this._rejectionHandler0 = undefined; + this._promise0 = undefined; + this._receiver0 = undefined; + this._resolveFromExecutor(executor); + this._promiseCreated(); + this._fireEvent("promiseCreated", this); +} + +Promise.prototype.toString = function () { + return "[object Promise]"; +}; + +Promise.prototype.caught = Promise.prototype["catch"] = function (fn) { + var len = arguments.length; + if (len > 1) { + var catchInstances = new Array(len - 1), + j = 0, i; + for (i = 0; i < len - 1; ++i) { + var item = arguments[i]; + if (util.isObject(item)) { + catchInstances[j++] = item; + } else { + return apiRejection("Catch statement predicate: " + + "expecting an object but got " + util.classString(item)); + } + } + catchInstances.length = j; + fn = arguments[i]; + + if (typeof fn !== "function") { + throw new TypeError("The last argument to .catch() " + + "must be a function, got " + util.toString(fn)); + } + return this.then(undefined, catchFilter(catchInstances, fn, this)); + } + return this.then(undefined, fn); +}; + +Promise.prototype.reflect = function () { + return this._then(reflectHandler, + reflectHandler, undefined, this, undefined); +}; + +Promise.prototype.then = function (didFulfill, didReject) { + if (debug.warnings() && arguments.length > 0 && + typeof didFulfill !== "function" && + typeof didReject !== "function") { + var msg = ".then() only accepts functions but was passed: " + + util.classString(didFulfill); + if (arguments.length > 1) { + msg += ", " + util.classString(didReject); + } + this._warn(msg); + } + return this._then(didFulfill, didReject, undefined, undefined, undefined); +}; + +Promise.prototype.done = function (didFulfill, didReject) { + var promise = + this._then(didFulfill, didReject, undefined, undefined, undefined); + promise._setIsFinal(); +}; + +Promise.prototype.spread = function (fn) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + return this.all()._then(fn, undefined, undefined, APPLY, undefined); +}; + +Promise.prototype.toJSON = function () { + var ret = { + isFulfilled: false, + isRejected: false, + fulfillmentValue: undefined, + rejectionReason: undefined + }; + if (this.isFulfilled()) { + ret.fulfillmentValue = this.value(); + ret.isFulfilled = true; + } else if (this.isRejected()) { + ret.rejectionReason = this.reason(); + ret.isRejected = true; + } + return ret; +}; + +Promise.prototype.all = function () { + if (arguments.length > 0) { + this._warn(".all() was passed arguments but it does not take any"); + } + return new PromiseArray(this).promise(); +}; + +Promise.prototype.error = function (fn) { + return this.caught(util.originatesFromRejection, fn); +}; + +Promise.getNewLibraryCopy = module.exports; + +Promise.is = function (val) { + return val instanceof Promise; +}; + +Promise.fromNode = Promise.fromCallback = function(fn) { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + var multiArgs = arguments.length > 1 ? !!Object(arguments[1]).multiArgs + : false; + var result = tryCatch(fn)(nodebackForPromise(ret, multiArgs)); + if (result === errorObj) { + ret._rejectCallback(result.e, true); + } + if (!ret._isFateSealed()) ret._setAsyncGuaranteed(); + return ret; +}; + +Promise.all = function (promises) { + return new PromiseArray(promises).promise(); +}; + +Promise.cast = function (obj) { + var ret = tryConvertToPromise(obj); + if (!(ret instanceof Promise)) { + ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._setFulfilled(); + ret._rejectionHandler0 = obj; + } + return ret; +}; + +Promise.resolve = Promise.fulfilled = Promise.cast; + +Promise.reject = Promise.rejected = function (reason) { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._rejectCallback(reason, true); + return ret; +}; + +Promise.setScheduler = function(fn) { + if (typeof fn !== "function") { + throw new TypeError("expecting a function but got " + util.classString(fn)); + } + return async.setScheduler(fn); +}; + +Promise.prototype._then = function ( + didFulfill, + didReject, + _, receiver, + internalData +) { + var haveInternalData = internalData !== undefined; + var promise = haveInternalData ? internalData : new Promise(INTERNAL); + var target = this._target(); + var bitField = target._bitField; + + if (!haveInternalData) { + promise._propagateFrom(this, 3); + promise._captureStackTrace(); + if (receiver === undefined && + ((this._bitField & 2097152) !== 0)) { + if (!((bitField & 50397184) === 0)) { + receiver = this._boundValue(); + } else { + receiver = target === this ? undefined : this._boundTo; + } + } + this._fireEvent("promiseChained", this, promise); + } + + var context = getContext(); + if (!((bitField & 50397184) === 0)) { + var handler, value, settler = target._settlePromiseCtx; + if (((bitField & 33554432) !== 0)) { + value = target._rejectionHandler0; + handler = didFulfill; + } else if (((bitField & 16777216) !== 0)) { + value = target._fulfillmentHandler0; + handler = didReject; + target._unsetRejectionIsUnhandled(); + } else { + settler = target._settlePromiseLateCancellationObserver; + value = new CancellationError("late cancellation observer"); + target._attachExtraTrace(value); + handler = didReject; + } + + async.invoke(settler, target, { + handler: util.contextBind(context, handler), + promise: promise, + receiver: receiver, + value: value + }); + } else { + target._addCallbacks(didFulfill, didReject, promise, + receiver, context); + } + + return promise; +}; + +Promise.prototype._length = function () { + return this._bitField & 65535; +}; + +Promise.prototype._isFateSealed = function () { + return (this._bitField & 117506048) !== 0; +}; + +Promise.prototype._isFollowing = function () { + return (this._bitField & 67108864) === 67108864; +}; + +Promise.prototype._setLength = function (len) { + this._bitField = (this._bitField & -65536) | + (len & 65535); +}; + +Promise.prototype._setFulfilled = function () { + this._bitField = this._bitField | 33554432; + this._fireEvent("promiseFulfilled", this); +}; + +Promise.prototype._setRejected = function () { + this._bitField = this._bitField | 16777216; + this._fireEvent("promiseRejected", this); +}; + +Promise.prototype._setFollowing = function () { + this._bitField = this._bitField | 67108864; + this._fireEvent("promiseResolved", this); +}; + +Promise.prototype._setIsFinal = function () { + this._bitField = this._bitField | 4194304; +}; + +Promise.prototype._isFinal = function () { + return (this._bitField & 4194304) > 0; +}; + +Promise.prototype._unsetCancelled = function() { + this._bitField = this._bitField & (~65536); +}; + +Promise.prototype._setCancelled = function() { + this._bitField = this._bitField | 65536; + this._fireEvent("promiseCancelled", this); +}; + +Promise.prototype._setWillBeCancelled = function() { + this._bitField = this._bitField | 8388608; +}; + +Promise.prototype._setAsyncGuaranteed = function() { + if (async.hasCustomScheduler()) return; + var bitField = this._bitField; + this._bitField = bitField | + (((bitField & 536870912) >> 2) ^ + 134217728); +}; + +Promise.prototype._setNoAsyncGuarantee = function() { + this._bitField = (this._bitField | 536870912) & + (~134217728); +}; + +Promise.prototype._receiverAt = function (index) { + var ret = index === 0 ? this._receiver0 : this[ + index * 4 - 4 + 3]; + if (ret === UNDEFINED_BINDING) { + return undefined; + } else if (ret === undefined && this._isBound()) { + return this._boundValue(); + } + return ret; +}; + +Promise.prototype._promiseAt = function (index) { + return this[ + index * 4 - 4 + 2]; +}; + +Promise.prototype._fulfillmentHandlerAt = function (index) { + return this[ + index * 4 - 4 + 0]; +}; + +Promise.prototype._rejectionHandlerAt = function (index) { + return this[ + index * 4 - 4 + 1]; +}; + +Promise.prototype._boundValue = function() {}; + +Promise.prototype._migrateCallback0 = function (follower) { + var bitField = follower._bitField; + var fulfill = follower._fulfillmentHandler0; + var reject = follower._rejectionHandler0; + var promise = follower._promise0; + var receiver = follower._receiverAt(0); + if (receiver === undefined) receiver = UNDEFINED_BINDING; + this._addCallbacks(fulfill, reject, promise, receiver, null); +}; + +Promise.prototype._migrateCallbackAt = function (follower, index) { + var fulfill = follower._fulfillmentHandlerAt(index); + var reject = follower._rejectionHandlerAt(index); + var promise = follower._promiseAt(index); + var receiver = follower._receiverAt(index); + if (receiver === undefined) receiver = UNDEFINED_BINDING; + this._addCallbacks(fulfill, reject, promise, receiver, null); +}; + +Promise.prototype._addCallbacks = function ( + fulfill, + reject, + promise, + receiver, + context +) { + var index = this._length(); + + if (index >= 65535 - 4) { + index = 0; + this._setLength(0); + } + + if (index === 0) { + this._promise0 = promise; + this._receiver0 = receiver; + if (typeof fulfill === "function") { + this._fulfillmentHandler0 = util.contextBind(context, fulfill); + } + if (typeof reject === "function") { + this._rejectionHandler0 = util.contextBind(context, reject); + } + } else { + var base = index * 4 - 4; + this[base + 2] = promise; + this[base + 3] = receiver; + if (typeof fulfill === "function") { + this[base + 0] = + util.contextBind(context, fulfill); + } + if (typeof reject === "function") { + this[base + 1] = + util.contextBind(context, reject); + } + } + this._setLength(index + 1); + return index; +}; + +Promise.prototype._proxy = function (proxyable, arg) { + this._addCallbacks(undefined, undefined, arg, proxyable, null); +}; + +Promise.prototype._resolveCallback = function(value, shouldBind) { + if (((this._bitField & 117506048) !== 0)) return; + if (value === this) + return this._rejectCallback(makeSelfResolutionError(), false); + var maybePromise = tryConvertToPromise(value, this); + if (!(maybePromise instanceof Promise)) return this._fulfill(value); + + if (shouldBind) this._propagateFrom(maybePromise, 2); + + + var promise = maybePromise._target(); + + if (promise === this) { + this._reject(makeSelfResolutionError()); + return; + } + + var bitField = promise._bitField; + if (((bitField & 50397184) === 0)) { + var len = this._length(); + if (len > 0) promise._migrateCallback0(this); + for (var i = 1; i < len; ++i) { + promise._migrateCallbackAt(this, i); + } + this._setFollowing(); + this._setLength(0); + this._setFollowee(maybePromise); + } else if (((bitField & 33554432) !== 0)) { + this._fulfill(promise._value()); + } else if (((bitField & 16777216) !== 0)) { + this._reject(promise._reason()); + } else { + var reason = new CancellationError("late cancellation observer"); + promise._attachExtraTrace(reason); + this._reject(reason); + } +}; + +Promise.prototype._rejectCallback = +function(reason, synchronous, ignoreNonErrorWarnings) { + var trace = util.ensureErrorObject(reason); + var hasStack = trace === reason; + if (!hasStack && !ignoreNonErrorWarnings && debug.warnings()) { + var message = "a promise was rejected with a non-error: " + + util.classString(reason); + this._warn(message, true); + } + this._attachExtraTrace(trace, synchronous ? hasStack : false); + this._reject(reason); +}; + +Promise.prototype._resolveFromExecutor = function (executor) { + if (executor === INTERNAL) return; + var promise = this; + this._captureStackTrace(); + this._pushContext(); + var synchronous = true; + var r = this._execute(executor, function(value) { + promise._resolveCallback(value); + }, function (reason) { + promise._rejectCallback(reason, synchronous); + }); + synchronous = false; + this._popContext(); + + if (r !== undefined) { + promise._rejectCallback(r, true); + } +}; + +Promise.prototype._settlePromiseFromHandler = function ( + handler, receiver, value, promise +) { + var bitField = promise._bitField; + if (((bitField & 65536) !== 0)) return; + promise._pushContext(); + var x; + if (receiver === APPLY) { + if (!value || typeof value.length !== "number") { + x = errorObj; + x.e = new TypeError("cannot .spread() a non-array: " + + util.classString(value)); + } else { + x = tryCatch(handler).apply(this._boundValue(), value); + } + } else { + x = tryCatch(handler).call(receiver, value); + } + var promiseCreated = promise._popContext(); + bitField = promise._bitField; + if (((bitField & 65536) !== 0)) return; + + if (x === NEXT_FILTER) { + promise._reject(value); + } else if (x === errorObj) { + promise._rejectCallback(x.e, false); + } else { + debug.checkForgottenReturns(x, promiseCreated, "", promise, this); + promise._resolveCallback(x); + } +}; + +Promise.prototype._target = function() { + var ret = this; + while (ret._isFollowing()) ret = ret._followee(); + return ret; +}; + +Promise.prototype._followee = function() { + return this._rejectionHandler0; +}; + +Promise.prototype._setFollowee = function(promise) { + this._rejectionHandler0 = promise; +}; + +Promise.prototype._settlePromise = function(promise, handler, receiver, value) { + var isPromise = promise instanceof Promise; + var bitField = this._bitField; + var asyncGuaranteed = ((bitField & 134217728) !== 0); + if (((bitField & 65536) !== 0)) { + if (isPromise) promise._invokeInternalOnCancel(); + + if (receiver instanceof PassThroughHandlerContext && + receiver.isFinallyHandler()) { + receiver.cancelPromise = promise; + if (tryCatch(handler).call(receiver, value) === errorObj) { + promise._reject(errorObj.e); + } + } else if (handler === reflectHandler) { + promise._fulfill(reflectHandler.call(receiver)); + } else if (receiver instanceof Proxyable) { + receiver._promiseCancelled(promise); + } else if (isPromise || promise instanceof PromiseArray) { + promise._cancel(); + } else { + receiver.cancel(); + } + } else if (typeof handler === "function") { + if (!isPromise) { + handler.call(receiver, value, promise); + } else { + if (asyncGuaranteed) promise._setAsyncGuaranteed(); + this._settlePromiseFromHandler(handler, receiver, value, promise); + } + } else if (receiver instanceof Proxyable) { + if (!receiver._isResolved()) { + if (((bitField & 33554432) !== 0)) { + receiver._promiseFulfilled(value, promise); + } else { + receiver._promiseRejected(value, promise); + } + } + } else if (isPromise) { + if (asyncGuaranteed) promise._setAsyncGuaranteed(); + if (((bitField & 33554432) !== 0)) { + promise._fulfill(value); + } else { + promise._reject(value); + } + } +}; + +Promise.prototype._settlePromiseLateCancellationObserver = function(ctx) { + var handler = ctx.handler; + var promise = ctx.promise; + var receiver = ctx.receiver; + var value = ctx.value; + if (typeof handler === "function") { + if (!(promise instanceof Promise)) { + handler.call(receiver, value, promise); + } else { + this._settlePromiseFromHandler(handler, receiver, value, promise); + } + } else if (promise instanceof Promise) { + promise._reject(value); + } +}; + +Promise.prototype._settlePromiseCtx = function(ctx) { + this._settlePromise(ctx.promise, ctx.handler, ctx.receiver, ctx.value); +}; + +Promise.prototype._settlePromise0 = function(handler, value, bitField) { + var promise = this._promise0; + var receiver = this._receiverAt(0); + this._promise0 = undefined; + this._receiver0 = undefined; + this._settlePromise(promise, handler, receiver, value); +}; + +Promise.prototype._clearCallbackDataAtIndex = function(index) { + var base = index * 4 - 4; + this[base + 2] = + this[base + 3] = + this[base + 0] = + this[base + 1] = undefined; +}; + +Promise.prototype._fulfill = function (value) { + var bitField = this._bitField; + if (((bitField & 117506048) >>> 16)) return; + if (value === this) { + var err = makeSelfResolutionError(); + this._attachExtraTrace(err); + return this._reject(err); + } + this._setFulfilled(); + this._rejectionHandler0 = value; + + if ((bitField & 65535) > 0) { + if (((bitField & 134217728) !== 0)) { + this._settlePromises(); + } else { + async.settlePromises(this); + } + this._dereferenceTrace(); + } +}; + +Promise.prototype._reject = function (reason) { + var bitField = this._bitField; + if (((bitField & 117506048) >>> 16)) return; + this._setRejected(); + this._fulfillmentHandler0 = reason; + + if (this._isFinal()) { + return async.fatalError(reason, util.isNode); + } + + if ((bitField & 65535) > 0) { + async.settlePromises(this); + } else { + this._ensurePossibleRejectionHandled(); + } +}; + +Promise.prototype._fulfillPromises = function (len, value) { + for (var i = 1; i < len; i++) { + var handler = this._fulfillmentHandlerAt(i); + var promise = this._promiseAt(i); + var receiver = this._receiverAt(i); + this._clearCallbackDataAtIndex(i); + this._settlePromise(promise, handler, receiver, value); + } +}; + +Promise.prototype._rejectPromises = function (len, reason) { + for (var i = 1; i < len; i++) { + var handler = this._rejectionHandlerAt(i); + var promise = this._promiseAt(i); + var receiver = this._receiverAt(i); + this._clearCallbackDataAtIndex(i); + this._settlePromise(promise, handler, receiver, reason); + } +}; + +Promise.prototype._settlePromises = function () { + var bitField = this._bitField; + var len = (bitField & 65535); + + if (len > 0) { + if (((bitField & 16842752) !== 0)) { + var reason = this._fulfillmentHandler0; + this._settlePromise0(this._rejectionHandler0, reason, bitField); + this._rejectPromises(len, reason); + } else { + var value = this._rejectionHandler0; + this._settlePromise0(this._fulfillmentHandler0, value, bitField); + this._fulfillPromises(len, value); + } + this._setLength(0); + } + this._clearCancellationData(); +}; + +Promise.prototype._settledValue = function() { + var bitField = this._bitField; + if (((bitField & 33554432) !== 0)) { + return this._rejectionHandler0; + } else if (((bitField & 16777216) !== 0)) { + return this._fulfillmentHandler0; + } +}; + +if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + es5.defineProperty(Promise.prototype, Symbol.toStringTag, { + get: function () { + return "Object"; + } + }); +} + +function deferResolve(v) {this.promise._resolveCallback(v);} +function deferReject(v) {this.promise._rejectCallback(v, false);} + +Promise.defer = Promise.pending = function() { + debug.deprecated("Promise.defer", "new Promise"); + var promise = new Promise(INTERNAL); + return { + promise: promise, + resolve: deferResolve, + reject: deferReject + }; +}; + +util.notEnumerableProp(Promise, + "_makeSelfResolutionError", + makeSelfResolutionError); + +_dereq_("./method")(Promise, INTERNAL, tryConvertToPromise, apiRejection, + debug); +_dereq_("./bind")(Promise, INTERNAL, tryConvertToPromise, debug); +_dereq_("./cancel")(Promise, PromiseArray, apiRejection, debug); +_dereq_("./direct_resolve")(Promise); +_dereq_("./synchronous_inspection")(Promise); +_dereq_("./join")( + Promise, PromiseArray, tryConvertToPromise, INTERNAL, async); +Promise.Promise = Promise; +Promise.version = "3.7.2"; +_dereq_('./call_get.js')(Promise); +_dereq_('./generators.js')(Promise, apiRejection, INTERNAL, tryConvertToPromise, Proxyable, debug); +_dereq_('./map.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug); +_dereq_('./nodeify.js')(Promise); +_dereq_('./promisify.js')(Promise, INTERNAL); +_dereq_('./props.js')(Promise, PromiseArray, tryConvertToPromise, apiRejection); +_dereq_('./race.js')(Promise, INTERNAL, tryConvertToPromise, apiRejection); +_dereq_('./reduce.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug); +_dereq_('./settle.js')(Promise, PromiseArray, debug); +_dereq_('./some.js')(Promise, PromiseArray, apiRejection); +_dereq_('./timers.js')(Promise, INTERNAL, debug); +_dereq_('./using.js')(Promise, apiRejection, tryConvertToPromise, createContext, INTERNAL, debug); +_dereq_('./any.js')(Promise); +_dereq_('./each.js')(Promise, INTERNAL); +_dereq_('./filter.js')(Promise, INTERNAL); + + util.toFastProperties(Promise); + util.toFastProperties(Promise.prototype); + function fillTypes(value) { + var p = new Promise(INTERNAL); + p._fulfillmentHandler0 = value; + p._rejectionHandler0 = value; + p._promise0 = value; + p._receiver0 = value; + } + // Complete slack tracking, opt out of field-type tracking and + // stabilize map + fillTypes({a: 1}); + fillTypes({b: 2}); + fillTypes({c: 3}); + fillTypes(1); + fillTypes(function(){}); + fillTypes(undefined); + fillTypes(false); + fillTypes(new Promise(INTERNAL)); + debug.setBounds(Async.firstLineError, util.lastLineError); + return Promise; + +}; + +},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36,"async_hooks":undefined}],23:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL, tryConvertToPromise, + apiRejection, Proxyable) { +var util = _dereq_("./util"); +var isArray = util.isArray; + +function toResolutionValue(val) { + switch(val) { + case -2: return []; + case -3: return {}; + case -6: return new Map(); + } +} + +function PromiseArray(values) { + var promise = this._promise = new Promise(INTERNAL); + if (values instanceof Promise) { + promise._propagateFrom(values, 3); + values.suppressUnhandledRejections(); + } + promise._setOnCancel(this); + this._values = values; + this._length = 0; + this._totalResolved = 0; + this._init(undefined, -2); +} +util.inherits(PromiseArray, Proxyable); + +PromiseArray.prototype.length = function () { + return this._length; +}; + +PromiseArray.prototype.promise = function () { + return this._promise; +}; + +PromiseArray.prototype._init = function init(_, resolveValueIfEmpty) { + var values = tryConvertToPromise(this._values, this._promise); + if (values instanceof Promise) { + values = values._target(); + var bitField = values._bitField; + ; + this._values = values; + + if (((bitField & 50397184) === 0)) { + this._promise._setAsyncGuaranteed(); + return values._then( + init, + this._reject, + undefined, + this, + resolveValueIfEmpty + ); + } else if (((bitField & 33554432) !== 0)) { + values = values._value(); + } else if (((bitField & 16777216) !== 0)) { + return this._reject(values._reason()); + } else { + return this._cancel(); + } + } + values = util.asArray(values); + if (values === null) { + var err = apiRejection( + "expecting an array or an iterable object but got " + util.classString(values)).reason(); + this._promise._rejectCallback(err, false); + return; + } + + if (values.length === 0) { + if (resolveValueIfEmpty === -5) { + this._resolveEmptyArray(); + } + else { + this._resolve(toResolutionValue(resolveValueIfEmpty)); + } + return; + } + this._iterate(values); +}; + +PromiseArray.prototype._iterate = function(values) { + var len = this.getActualLength(values.length); + this._length = len; + this._values = this.shouldCopyValues() ? new Array(len) : this._values; + var result = this._promise; + var isResolved = false; + var bitField = null; + for (var i = 0; i < len; ++i) { + var maybePromise = tryConvertToPromise(values[i], result); + + if (maybePromise instanceof Promise) { + maybePromise = maybePromise._target(); + bitField = maybePromise._bitField; + } else { + bitField = null; + } + + if (isResolved) { + if (bitField !== null) { + maybePromise.suppressUnhandledRejections(); + } + } else if (bitField !== null) { + if (((bitField & 50397184) === 0)) { + maybePromise._proxy(this, i); + this._values[i] = maybePromise; + } else if (((bitField & 33554432) !== 0)) { + isResolved = this._promiseFulfilled(maybePromise._value(), i); + } else if (((bitField & 16777216) !== 0)) { + isResolved = this._promiseRejected(maybePromise._reason(), i); + } else { + isResolved = this._promiseCancelled(i); + } + } else { + isResolved = this._promiseFulfilled(maybePromise, i); + } + } + if (!isResolved) result._setAsyncGuaranteed(); +}; + +PromiseArray.prototype._isResolved = function () { + return this._values === null; +}; + +PromiseArray.prototype._resolve = function (value) { + this._values = null; + this._promise._fulfill(value); +}; + +PromiseArray.prototype._cancel = function() { + if (this._isResolved() || !this._promise._isCancellable()) return; + this._values = null; + this._promise._cancel(); +}; + +PromiseArray.prototype._reject = function (reason) { + this._values = null; + this._promise._rejectCallback(reason, false); +}; + +PromiseArray.prototype._promiseFulfilled = function (value, index) { + this._values[index] = value; + var totalResolved = ++this._totalResolved; + if (totalResolved >= this._length) { + this._resolve(this._values); + return true; + } + return false; +}; + +PromiseArray.prototype._promiseCancelled = function() { + this._cancel(); + return true; +}; + +PromiseArray.prototype._promiseRejected = function (reason) { + this._totalResolved++; + this._reject(reason); + return true; +}; + +PromiseArray.prototype._resultCancelled = function() { + if (this._isResolved()) return; + var values = this._values; + this._cancel(); + if (values instanceof Promise) { + values.cancel(); + } else { + for (var i = 0; i < values.length; ++i) { + if (values[i] instanceof Promise) { + values[i].cancel(); + } + } + } +}; + +PromiseArray.prototype.shouldCopyValues = function () { + return true; +}; + +PromiseArray.prototype.getActualLength = function (len) { + return len; +}; + +return PromiseArray; +}; + +},{"./util":36}],24:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var THIS = {}; +var util = _dereq_("./util"); +var nodebackForPromise = _dereq_("./nodeback"); +var withAppended = util.withAppended; +var maybeWrapAsError = util.maybeWrapAsError; +var canEvaluate = util.canEvaluate; +var TypeError = _dereq_("./errors").TypeError; +var defaultSuffix = "Async"; +var defaultPromisified = {__isPromisified__: true}; +var noCopyProps = [ + "arity", "length", + "name", + "arguments", + "caller", + "callee", + "prototype", + "__isPromisified__" +]; +var noCopyPropsPattern = new RegExp("^(?:" + noCopyProps.join("|") + ")$"); + +var defaultFilter = function(name) { + return util.isIdentifier(name) && + name.charAt(0) !== "_" && + name !== "constructor"; +}; + +function propsFilter(key) { + return !noCopyPropsPattern.test(key); +} + +function isPromisified(fn) { + try { + return fn.__isPromisified__ === true; + } + catch (e) { + return false; + } +} + +function hasPromisified(obj, key, suffix) { + var val = util.getDataPropertyOrDefault(obj, key + suffix, + defaultPromisified); + return val ? isPromisified(val) : false; +} +function checkValid(ret, suffix, suffixRegexp) { + for (var i = 0; i < ret.length; i += 2) { + var key = ret[i]; + if (suffixRegexp.test(key)) { + var keyWithoutAsyncSuffix = key.replace(suffixRegexp, ""); + for (var j = 0; j < ret.length; j += 2) { + if (ret[j] === keyWithoutAsyncSuffix) { + throw new TypeError("Cannot promisify an API that has normal methods with '%s'-suffix\u000a\u000a See http://goo.gl/MqrFmX\u000a" + .replace("%s", suffix)); + } + } + } + } +} + +function promisifiableMethods(obj, suffix, suffixRegexp, filter) { + var keys = util.inheritedDataKeys(obj); + var ret = []; + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + var value = obj[key]; + var passesDefaultFilter = filter === defaultFilter + ? true : defaultFilter(key, value, obj); + if (typeof value === "function" && + !isPromisified(value) && + !hasPromisified(obj, key, suffix) && + filter(key, value, obj, passesDefaultFilter)) { + ret.push(key, value); + } + } + checkValid(ret, suffix, suffixRegexp); + return ret; +} + +var escapeIdentRegex = function(str) { + return str.replace(/([$])/, "\\$"); +}; + +var makeNodePromisifiedEval; +if (!true) { +var switchCaseArgumentOrder = function(likelyArgumentCount) { + var ret = [likelyArgumentCount]; + var min = Math.max(0, likelyArgumentCount - 1 - 3); + for(var i = likelyArgumentCount - 1; i >= min; --i) { + ret.push(i); + } + for(var i = likelyArgumentCount + 1; i <= 3; ++i) { + ret.push(i); + } + return ret; +}; + +var argumentSequence = function(argumentCount) { + return util.filledRange(argumentCount, "_arg", ""); +}; + +var parameterDeclaration = function(parameterCount) { + return util.filledRange( + Math.max(parameterCount, 3), "_arg", ""); +}; + +var parameterCount = function(fn) { + if (typeof fn.length === "number") { + return Math.max(Math.min(fn.length, 1023 + 1), 0); + } + return 0; +}; + +makeNodePromisifiedEval = +function(callback, receiver, originalName, fn, _, multiArgs) { + var newParameterCount = Math.max(0, parameterCount(fn) - 1); + var argumentOrder = switchCaseArgumentOrder(newParameterCount); + var shouldProxyThis = typeof callback === "string" || receiver === THIS; + + function generateCallForArgumentCount(count) { + var args = argumentSequence(count).join(", "); + var comma = count > 0 ? ", " : ""; + var ret; + if (shouldProxyThis) { + ret = "ret = callback.call(this, {{args}}, nodeback); break;\n"; + } else { + ret = receiver === undefined + ? "ret = callback({{args}}, nodeback); break;\n" + : "ret = callback.call(receiver, {{args}}, nodeback); break;\n"; + } + return ret.replace("{{args}}", args).replace(", ", comma); + } + + function generateArgumentSwitchCase() { + var ret = ""; + for (var i = 0; i < argumentOrder.length; ++i) { + ret += "case " + argumentOrder[i] +":" + + generateCallForArgumentCount(argumentOrder[i]); + } + + ret += " \n\ + default: \n\ + var args = new Array(len + 1); \n\ + var i = 0; \n\ + for (var i = 0; i < len; ++i) { \n\ + args[i] = arguments[i]; \n\ + } \n\ + args[i] = nodeback; \n\ + [CodeForCall] \n\ + break; \n\ + ".replace("[CodeForCall]", (shouldProxyThis + ? "ret = callback.apply(this, args);\n" + : "ret = callback.apply(receiver, args);\n")); + return ret; + } + + var getFunctionCode = typeof callback === "string" + ? ("this != null ? this['"+callback+"'] : fn") + : "fn"; + var body = "'use strict'; \n\ + var ret = function (Parameters) { \n\ + 'use strict'; \n\ + var len = arguments.length; \n\ + var promise = new Promise(INTERNAL); \n\ + promise._captureStackTrace(); \n\ + var nodeback = nodebackForPromise(promise, " + multiArgs + "); \n\ + var ret; \n\ + var callback = tryCatch([GetFunctionCode]); \n\ + switch(len) { \n\ + [CodeForSwitchCase] \n\ + } \n\ + if (ret === errorObj) { \n\ + promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\n\ + } \n\ + if (!promise._isFateSealed()) promise._setAsyncGuaranteed(); \n\ + return promise; \n\ + }; \n\ + notEnumerableProp(ret, '__isPromisified__', true); \n\ + return ret; \n\ + ".replace("[CodeForSwitchCase]", generateArgumentSwitchCase()) + .replace("[GetFunctionCode]", getFunctionCode); + body = body.replace("Parameters", parameterDeclaration(newParameterCount)); + return new Function("Promise", + "fn", + "receiver", + "withAppended", + "maybeWrapAsError", + "nodebackForPromise", + "tryCatch", + "errorObj", + "notEnumerableProp", + "INTERNAL", + body)( + Promise, + fn, + receiver, + withAppended, + maybeWrapAsError, + nodebackForPromise, + util.tryCatch, + util.errorObj, + util.notEnumerableProp, + INTERNAL); +}; +} + +function makeNodePromisifiedClosure(callback, receiver, _, fn, __, multiArgs) { + var defaultThis = (function() {return this;})(); + var method = callback; + if (typeof method === "string") { + callback = fn; + } + function promisified() { + var _receiver = receiver; + if (receiver === THIS) _receiver = this; + var promise = new Promise(INTERNAL); + promise._captureStackTrace(); + var cb = typeof method === "string" && this !== defaultThis + ? this[method] : callback; + var fn = nodebackForPromise(promise, multiArgs); + try { + cb.apply(_receiver, withAppended(arguments, fn)); + } catch(e) { + promise._rejectCallback(maybeWrapAsError(e), true, true); + } + if (!promise._isFateSealed()) promise._setAsyncGuaranteed(); + return promise; + } + util.notEnumerableProp(promisified, "__isPromisified__", true); + return promisified; +} + +var makeNodePromisified = canEvaluate + ? makeNodePromisifiedEval + : makeNodePromisifiedClosure; + +function promisifyAll(obj, suffix, filter, promisifier, multiArgs) { + var suffixRegexp = new RegExp(escapeIdentRegex(suffix) + "$"); + var methods = + promisifiableMethods(obj, suffix, suffixRegexp, filter); + + for (var i = 0, len = methods.length; i < len; i+= 2) { + var key = methods[i]; + var fn = methods[i+1]; + var promisifiedKey = key + suffix; + if (promisifier === makeNodePromisified) { + obj[promisifiedKey] = + makeNodePromisified(key, THIS, key, fn, suffix, multiArgs); + } else { + var promisified = promisifier(fn, function() { + return makeNodePromisified(key, THIS, key, + fn, suffix, multiArgs); + }); + util.notEnumerableProp(promisified, "__isPromisified__", true); + obj[promisifiedKey] = promisified; + } + } + util.toFastProperties(obj); + return obj; +} + +function promisify(callback, receiver, multiArgs) { + return makeNodePromisified(callback, receiver, undefined, + callback, null, multiArgs); +} + +Promise.promisify = function (fn, options) { + if (typeof fn !== "function") { + throw new TypeError("expecting a function but got " + util.classString(fn)); + } + if (isPromisified(fn)) { + return fn; + } + options = Object(options); + var receiver = options.context === undefined ? THIS : options.context; + var multiArgs = !!options.multiArgs; + var ret = promisify(fn, receiver, multiArgs); + util.copyDescriptors(fn, ret, propsFilter); + return ret; +}; + +Promise.promisifyAll = function (target, options) { + if (typeof target !== "function" && typeof target !== "object") { + throw new TypeError("the target of promisifyAll must be an object or a function\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + options = Object(options); + var multiArgs = !!options.multiArgs; + var suffix = options.suffix; + if (typeof suffix !== "string") suffix = defaultSuffix; + var filter = options.filter; + if (typeof filter !== "function") filter = defaultFilter; + var promisifier = options.promisifier; + if (typeof promisifier !== "function") promisifier = makeNodePromisified; + + if (!util.isIdentifier(suffix)) { + throw new RangeError("suffix must be a valid identifier\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + + var keys = util.inheritedDataKeys(target); + for (var i = 0; i < keys.length; ++i) { + var value = target[keys[i]]; + if (keys[i] !== "constructor" && + util.isClass(value)) { + promisifyAll(value.prototype, suffix, filter, promisifier, + multiArgs); + promisifyAll(value, suffix, filter, promisifier, multiArgs); + } + } + + return promisifyAll(target, suffix, filter, promisifier, multiArgs); +}; +}; + + +},{"./errors":12,"./nodeback":20,"./util":36}],25:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function( + Promise, PromiseArray, tryConvertToPromise, apiRejection) { +var util = _dereq_("./util"); +var isObject = util.isObject; +var es5 = _dereq_("./es5"); +var Es6Map; +if (typeof Map === "function") Es6Map = Map; + +var mapToEntries = (function() { + var index = 0; + var size = 0; + + function extractEntry(value, key) { + this[index] = value; + this[index + size] = key; + index++; + } + + return function mapToEntries(map) { + size = map.size; + index = 0; + var ret = new Array(map.size * 2); + map.forEach(extractEntry, ret); + return ret; + }; +})(); + +var entriesToMap = function(entries) { + var ret = new Es6Map(); + var length = entries.length / 2 | 0; + for (var i = 0; i < length; ++i) { + var key = entries[length + i]; + var value = entries[i]; + ret.set(key, value); + } + return ret; +}; + +function PropertiesPromiseArray(obj) { + var isMap = false; + var entries; + if (Es6Map !== undefined && obj instanceof Es6Map) { + entries = mapToEntries(obj); + isMap = true; + } else { + var keys = es5.keys(obj); + var len = keys.length; + entries = new Array(len * 2); + for (var i = 0; i < len; ++i) { + var key = keys[i]; + entries[i] = obj[key]; + entries[i + len] = key; + } + } + this.constructor$(entries); + this._isMap = isMap; + this._init$(undefined, isMap ? -6 : -3); +} +util.inherits(PropertiesPromiseArray, PromiseArray); + +PropertiesPromiseArray.prototype._init = function () {}; + +PropertiesPromiseArray.prototype._promiseFulfilled = function (value, index) { + this._values[index] = value; + var totalResolved = ++this._totalResolved; + if (totalResolved >= this._length) { + var val; + if (this._isMap) { + val = entriesToMap(this._values); + } else { + val = {}; + var keyOffset = this.length(); + for (var i = 0, len = this.length(); i < len; ++i) { + val[this._values[i + keyOffset]] = this._values[i]; + } + } + this._resolve(val); + return true; + } + return false; +}; + +PropertiesPromiseArray.prototype.shouldCopyValues = function () { + return false; +}; + +PropertiesPromiseArray.prototype.getActualLength = function (len) { + return len >> 1; +}; + +function props(promises) { + var ret; + var castValue = tryConvertToPromise(promises); + + if (!isObject(castValue)) { + return apiRejection("cannot await properties of a non-object\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } else if (castValue instanceof Promise) { + ret = castValue._then( + Promise.props, undefined, undefined, undefined, undefined); + } else { + ret = new PropertiesPromiseArray(castValue).promise(); + } + + if (castValue instanceof Promise) { + ret._propagateFrom(castValue, 2); + } + return ret; +} + +Promise.prototype.props = function () { + return props(this); +}; + +Promise.props = function (promises) { + return props(promises); +}; +}; + +},{"./es5":13,"./util":36}],26:[function(_dereq_,module,exports){ +"use strict"; +function arrayMove(src, srcIndex, dst, dstIndex, len) { + for (var j = 0; j < len; ++j) { + dst[j + dstIndex] = src[j + srcIndex]; + src[j + srcIndex] = void 0; + } +} + +function Queue(capacity) { + this._capacity = capacity; + this._length = 0; + this._front = 0; +} + +Queue.prototype._willBeOverCapacity = function (size) { + return this._capacity < size; +}; + +Queue.prototype._pushOne = function (arg) { + var length = this.length(); + this._checkCapacity(length + 1); + var i = (this._front + length) & (this._capacity - 1); + this[i] = arg; + this._length = length + 1; +}; + +Queue.prototype.push = function (fn, receiver, arg) { + var length = this.length() + 3; + if (this._willBeOverCapacity(length)) { + this._pushOne(fn); + this._pushOne(receiver); + this._pushOne(arg); + return; + } + var j = this._front + length - 3; + this._checkCapacity(length); + var wrapMask = this._capacity - 1; + this[(j + 0) & wrapMask] = fn; + this[(j + 1) & wrapMask] = receiver; + this[(j + 2) & wrapMask] = arg; + this._length = length; +}; + +Queue.prototype.shift = function () { + var front = this._front, + ret = this[front]; + + this[front] = undefined; + this._front = (front + 1) & (this._capacity - 1); + this._length--; + return ret; +}; + +Queue.prototype.length = function () { + return this._length; +}; + +Queue.prototype._checkCapacity = function (size) { + if (this._capacity < size) { + this._resizeTo(this._capacity << 1); + } +}; + +Queue.prototype._resizeTo = function (capacity) { + var oldCapacity = this._capacity; + this._capacity = capacity; + var front = this._front; + var length = this._length; + var moveItemsCount = (front + length) & (oldCapacity - 1); + arrayMove(this, 0, this, oldCapacity, moveItemsCount); +}; + +module.exports = Queue; + +},{}],27:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function( + Promise, INTERNAL, tryConvertToPromise, apiRejection) { +var util = _dereq_("./util"); + +var raceLater = function (promise) { + return promise.then(function(array) { + return race(array, promise); + }); +}; + +function race(promises, parent) { + var maybePromise = tryConvertToPromise(promises); + + if (maybePromise instanceof Promise) { + return raceLater(maybePromise); + } else { + promises = util.asArray(promises); + if (promises === null) + return apiRejection("expecting an array or an iterable object but got " + util.classString(promises)); + } + + var ret = new Promise(INTERNAL); + if (parent !== undefined) { + ret._propagateFrom(parent, 3); + } + var fulfill = ret._fulfill; + var reject = ret._reject; + for (var i = 0, len = promises.length; i < len; ++i) { + var val = promises[i]; + + if (val === undefined && !(i in promises)) { + continue; + } + + Promise.cast(val)._then(fulfill, reject, undefined, ret, null); + } + return ret; +} + +Promise.race = function (promises) { + return race(promises, undefined); +}; + +Promise.prototype.race = function () { + return race(this, undefined); +}; + +}; + +},{"./util":36}],28:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, + PromiseArray, + apiRejection, + tryConvertToPromise, + INTERNAL, + debug) { +var util = _dereq_("./util"); +var tryCatch = util.tryCatch; + +function ReductionPromiseArray(promises, fn, initialValue, _each) { + this.constructor$(promises); + var context = Promise._getContext(); + this._fn = util.contextBind(context, fn); + if (initialValue !== undefined) { + initialValue = Promise.resolve(initialValue); + initialValue._attachCancellationCallback(this); + } + this._initialValue = initialValue; + this._currentCancellable = null; + if(_each === INTERNAL) { + this._eachValues = Array(this._length); + } else if (_each === 0) { + this._eachValues = null; + } else { + this._eachValues = undefined; + } + this._promise._captureStackTrace(); + this._init$(undefined, -5); +} +util.inherits(ReductionPromiseArray, PromiseArray); + +ReductionPromiseArray.prototype._gotAccum = function(accum) { + if (this._eachValues !== undefined && + this._eachValues !== null && + accum !== INTERNAL) { + this._eachValues.push(accum); + } +}; + +ReductionPromiseArray.prototype._eachComplete = function(value) { + if (this._eachValues !== null) { + this._eachValues.push(value); + } + return this._eachValues; +}; + +ReductionPromiseArray.prototype._init = function() {}; + +ReductionPromiseArray.prototype._resolveEmptyArray = function() { + this._resolve(this._eachValues !== undefined ? this._eachValues + : this._initialValue); +}; + +ReductionPromiseArray.prototype.shouldCopyValues = function () { + return false; +}; + +ReductionPromiseArray.prototype._resolve = function(value) { + this._promise._resolveCallback(value); + this._values = null; +}; + +ReductionPromiseArray.prototype._resultCancelled = function(sender) { + if (sender === this._initialValue) return this._cancel(); + if (this._isResolved()) return; + this._resultCancelled$(); + if (this._currentCancellable instanceof Promise) { + this._currentCancellable.cancel(); + } + if (this._initialValue instanceof Promise) { + this._initialValue.cancel(); + } +}; + +ReductionPromiseArray.prototype._iterate = function (values) { + this._values = values; + var value; + var i; + var length = values.length; + if (this._initialValue !== undefined) { + value = this._initialValue; + i = 0; + } else { + value = Promise.resolve(values[0]); + i = 1; + } + + this._currentCancellable = value; + + for (var j = i; j < length; ++j) { + var maybePromise = values[j]; + if (maybePromise instanceof Promise) { + maybePromise.suppressUnhandledRejections(); + } + } + + if (!value.isRejected()) { + for (; i < length; ++i) { + var ctx = { + accum: null, + value: values[i], + index: i, + length: length, + array: this + }; + + value = value._then(gotAccum, undefined, undefined, ctx, undefined); + + if ((i & 127) === 0) { + value._setNoAsyncGuarantee(); + } + } + } + + if (this._eachValues !== undefined) { + value = value + ._then(this._eachComplete, undefined, undefined, this, undefined); + } + value._then(completed, completed, undefined, value, this); +}; + +Promise.prototype.reduce = function (fn, initialValue) { + return reduce(this, fn, initialValue, null); +}; + +Promise.reduce = function (promises, fn, initialValue, _each) { + return reduce(promises, fn, initialValue, _each); +}; + +function completed(valueOrReason, array) { + if (this.isFulfilled()) { + array._resolve(valueOrReason); + } else { + array._reject(valueOrReason); + } +} + +function reduce(promises, fn, initialValue, _each) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + var array = new ReductionPromiseArray(promises, fn, initialValue, _each); + return array.promise(); +} + +function gotAccum(accum) { + this.accum = accum; + this.array._gotAccum(accum); + var value = tryConvertToPromise(this.value, this.array._promise); + if (value instanceof Promise) { + this.array._currentCancellable = value; + return value._then(gotValue, undefined, undefined, this, undefined); + } else { + return gotValue.call(this, value); + } +} + +function gotValue(value) { + var array = this.array; + var promise = array._promise; + var fn = tryCatch(array._fn); + promise._pushContext(); + var ret; + if (array._eachValues !== undefined) { + ret = fn.call(promise._boundValue(), value, this.index, this.length); + } else { + ret = fn.call(promise._boundValue(), + this.accum, value, this.index, this.length); + } + if (ret instanceof Promise) { + array._currentCancellable = ret; + } + var promiseCreated = promise._popContext(); + debug.checkForgottenReturns( + ret, + promiseCreated, + array._eachValues !== undefined ? "Promise.each" : "Promise.reduce", + promise + ); + return ret; +} +}; + +},{"./util":36}],29:[function(_dereq_,module,exports){ +"use strict"; +var util = _dereq_("./util"); +var schedule; +var noAsyncScheduler = function() { + throw new Error("No async scheduler available\u000a\u000a See http://goo.gl/MqrFmX\u000a"); +}; +var NativePromise = util.getNativePromise(); +if (util.isNode && typeof MutationObserver === "undefined") { + var GlobalSetImmediate = global.setImmediate; + var ProcessNextTick = process.nextTick; + schedule = util.isRecentNode + ? function(fn) { GlobalSetImmediate.call(global, fn); } + : function(fn) { ProcessNextTick.call(process, fn); }; +} else if (typeof NativePromise === "function" && + typeof NativePromise.resolve === "function") { + var nativePromise = NativePromise.resolve(); + schedule = function(fn) { + nativePromise.then(fn); + }; +} else if ((typeof MutationObserver !== "undefined") && + !(typeof window !== "undefined" && + window.navigator && + (window.navigator.standalone || window.cordova)) && + ("classList" in document.documentElement)) { + schedule = (function() { + var div = document.createElement("div"); + var opts = {attributes: true}; + var toggleScheduled = false; + var div2 = document.createElement("div"); + var o2 = new MutationObserver(function() { + div.classList.toggle("foo"); + toggleScheduled = false; + }); + o2.observe(div2, opts); + + var scheduleToggle = function() { + if (toggleScheduled) return; + toggleScheduled = true; + div2.classList.toggle("foo"); + }; + + return function schedule(fn) { + var o = new MutationObserver(function() { + o.disconnect(); + fn(); + }); + o.observe(div, opts); + scheduleToggle(); + }; + })(); +} else if (typeof setImmediate !== "undefined") { + schedule = function (fn) { + setImmediate(fn); + }; +} else if (typeof setTimeout !== "undefined") { + schedule = function (fn) { + setTimeout(fn, 0); + }; +} else { + schedule = noAsyncScheduler; +} +module.exports = schedule; + +},{"./util":36}],30:[function(_dereq_,module,exports){ +"use strict"; +module.exports = + function(Promise, PromiseArray, debug) { +var PromiseInspection = Promise.PromiseInspection; +var util = _dereq_("./util"); + +function SettledPromiseArray(values) { + this.constructor$(values); +} +util.inherits(SettledPromiseArray, PromiseArray); + +SettledPromiseArray.prototype._promiseResolved = function (index, inspection) { + this._values[index] = inspection; + var totalResolved = ++this._totalResolved; + if (totalResolved >= this._length) { + this._resolve(this._values); + return true; + } + return false; +}; + +SettledPromiseArray.prototype._promiseFulfilled = function (value, index) { + var ret = new PromiseInspection(); + ret._bitField = 33554432; + ret._settledValueField = value; + return this._promiseResolved(index, ret); +}; +SettledPromiseArray.prototype._promiseRejected = function (reason, index) { + var ret = new PromiseInspection(); + ret._bitField = 16777216; + ret._settledValueField = reason; + return this._promiseResolved(index, ret); +}; + +Promise.settle = function (promises) { + debug.deprecated(".settle()", ".reflect()"); + return new SettledPromiseArray(promises).promise(); +}; + +Promise.allSettled = function (promises) { + return new SettledPromiseArray(promises).promise(); +}; + +Promise.prototype.settle = function () { + return Promise.settle(this); +}; +}; + +},{"./util":36}],31:[function(_dereq_,module,exports){ +"use strict"; +module.exports = +function(Promise, PromiseArray, apiRejection) { +var util = _dereq_("./util"); +var RangeError = _dereq_("./errors").RangeError; +var AggregateError = _dereq_("./errors").AggregateError; +var isArray = util.isArray; +var CANCELLATION = {}; + + +function SomePromiseArray(values) { + this.constructor$(values); + this._howMany = 0; + this._unwrap = false; + this._initialized = false; +} +util.inherits(SomePromiseArray, PromiseArray); + +SomePromiseArray.prototype._init = function () { + if (!this._initialized) { + return; + } + if (this._howMany === 0) { + this._resolve([]); + return; + } + this._init$(undefined, -5); + var isArrayResolved = isArray(this._values); + if (!this._isResolved() && + isArrayResolved && + this._howMany > this._canPossiblyFulfill()) { + this._reject(this._getRangeError(this.length())); + } +}; + +SomePromiseArray.prototype.init = function () { + this._initialized = true; + this._init(); +}; + +SomePromiseArray.prototype.setUnwrap = function () { + this._unwrap = true; +}; + +SomePromiseArray.prototype.howMany = function () { + return this._howMany; +}; + +SomePromiseArray.prototype.setHowMany = function (count) { + this._howMany = count; +}; + +SomePromiseArray.prototype._promiseFulfilled = function (value) { + this._addFulfilled(value); + if (this._fulfilled() === this.howMany()) { + this._values.length = this.howMany(); + if (this.howMany() === 1 && this._unwrap) { + this._resolve(this._values[0]); + } else { + this._resolve(this._values); + } + return true; + } + return false; + +}; +SomePromiseArray.prototype._promiseRejected = function (reason) { + this._addRejected(reason); + return this._checkOutcome(); +}; + +SomePromiseArray.prototype._promiseCancelled = function () { + if (this._values instanceof Promise || this._values == null) { + return this._cancel(); + } + this._addRejected(CANCELLATION); + return this._checkOutcome(); +}; + +SomePromiseArray.prototype._checkOutcome = function() { + if (this.howMany() > this._canPossiblyFulfill()) { + var e = new AggregateError(); + for (var i = this.length(); i < this._values.length; ++i) { + if (this._values[i] !== CANCELLATION) { + e.push(this._values[i]); + } + } + if (e.length > 0) { + this._reject(e); + } else { + this._cancel(); + } + return true; + } + return false; +}; + +SomePromiseArray.prototype._fulfilled = function () { + return this._totalResolved; +}; + +SomePromiseArray.prototype._rejected = function () { + return this._values.length - this.length(); +}; + +SomePromiseArray.prototype._addRejected = function (reason) { + this._values.push(reason); +}; + +SomePromiseArray.prototype._addFulfilled = function (value) { + this._values[this._totalResolved++] = value; +}; + +SomePromiseArray.prototype._canPossiblyFulfill = function () { + return this.length() - this._rejected(); +}; + +SomePromiseArray.prototype._getRangeError = function (count) { + var message = "Input array must contain at least " + + this._howMany + " items but contains only " + count + " items"; + return new RangeError(message); +}; + +SomePromiseArray.prototype._resolveEmptyArray = function () { + this._reject(this._getRangeError(0)); +}; + +function some(promises, howMany) { + if ((howMany | 0) !== howMany || howMany < 0) { + return apiRejection("expecting a positive integer\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + var ret = new SomePromiseArray(promises); + var promise = ret.promise(); + ret.setHowMany(howMany); + ret.init(); + return promise; +} + +Promise.some = function (promises, howMany) { + return some(promises, howMany); +}; + +Promise.prototype.some = function (howMany) { + return some(this, howMany); +}; + +Promise._SomePromiseArray = SomePromiseArray; +}; + +},{"./errors":12,"./util":36}],32:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise) { +function PromiseInspection(promise) { + if (promise !== undefined) { + promise = promise._target(); + this._bitField = promise._bitField; + this._settledValueField = promise._isFateSealed() + ? promise._settledValue() : undefined; + } + else { + this._bitField = 0; + this._settledValueField = undefined; + } +} + +PromiseInspection.prototype._settledValue = function() { + return this._settledValueField; +}; + +var value = PromiseInspection.prototype.value = function () { + if (!this.isFulfilled()) { + throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + return this._settledValue(); +}; + +var reason = PromiseInspection.prototype.error = +PromiseInspection.prototype.reason = function () { + if (!this.isRejected()) { + throw new TypeError("cannot get rejection reason of a non-rejected promise\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + return this._settledValue(); +}; + +var isFulfilled = PromiseInspection.prototype.isFulfilled = function() { + return (this._bitField & 33554432) !== 0; +}; + +var isRejected = PromiseInspection.prototype.isRejected = function () { + return (this._bitField & 16777216) !== 0; +}; + +var isPending = PromiseInspection.prototype.isPending = function () { + return (this._bitField & 50397184) === 0; +}; + +var isResolved = PromiseInspection.prototype.isResolved = function () { + return (this._bitField & 50331648) !== 0; +}; + +PromiseInspection.prototype.isCancelled = function() { + return (this._bitField & 8454144) !== 0; +}; + +Promise.prototype.__isCancelled = function() { + return (this._bitField & 65536) === 65536; +}; + +Promise.prototype._isCancelled = function() { + return this._target().__isCancelled(); +}; + +Promise.prototype.isCancelled = function() { + return (this._target()._bitField & 8454144) !== 0; +}; + +Promise.prototype.isPending = function() { + return isPending.call(this._target()); +}; + +Promise.prototype.isRejected = function() { + return isRejected.call(this._target()); +}; + +Promise.prototype.isFulfilled = function() { + return isFulfilled.call(this._target()); +}; + +Promise.prototype.isResolved = function() { + return isResolved.call(this._target()); +}; + +Promise.prototype.value = function() { + return value.call(this._target()); +}; + +Promise.prototype.reason = function() { + var target = this._target(); + target._unsetRejectionIsUnhandled(); + return reason.call(target); +}; + +Promise.prototype._value = function() { + return this._settledValue(); +}; + +Promise.prototype._reason = function() { + this._unsetRejectionIsUnhandled(); + return this._settledValue(); +}; + +Promise.PromiseInspection = PromiseInspection; +}; + +},{}],33:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var util = _dereq_("./util"); +var errorObj = util.errorObj; +var isObject = util.isObject; + +function tryConvertToPromise(obj, context) { + if (isObject(obj)) { + if (obj instanceof Promise) return obj; + var then = getThen(obj); + if (then === errorObj) { + if (context) context._pushContext(); + var ret = Promise.reject(then.e); + if (context) context._popContext(); + return ret; + } else if (typeof then === "function") { + if (isAnyBluebirdPromise(obj)) { + var ret = new Promise(INTERNAL); + obj._then( + ret._fulfill, + ret._reject, + undefined, + ret, + null + ); + return ret; + } + return doThenable(obj, then, context); + } + } + return obj; +} + +function doGetThen(obj) { + return obj.then; +} + +function getThen(obj) { + try { + return doGetThen(obj); + } catch (e) { + errorObj.e = e; + return errorObj; + } +} + +var hasProp = {}.hasOwnProperty; +function isAnyBluebirdPromise(obj) { + try { + return hasProp.call(obj, "_promise0"); + } catch (e) { + return false; + } +} + +function doThenable(x, then, context) { + var promise = new Promise(INTERNAL); + var ret = promise; + if (context) context._pushContext(); + promise._captureStackTrace(); + if (context) context._popContext(); + var synchronous = true; + var result = util.tryCatch(then).call(x, resolve, reject); + synchronous = false; + + if (promise && result === errorObj) { + promise._rejectCallback(result.e, true, true); + promise = null; + } + + function resolve(value) { + if (!promise) return; + promise._resolveCallback(value); + promise = null; + } + + function reject(reason) { + if (!promise) return; + promise._rejectCallback(reason, synchronous, true); + promise = null; + } + return ret; +} + +return tryConvertToPromise; +}; + +},{"./util":36}],34:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL, debug) { +var util = _dereq_("./util"); +var TimeoutError = Promise.TimeoutError; + +function HandleWrapper(handle) { + this.handle = handle; +} + +HandleWrapper.prototype._resultCancelled = function() { + clearTimeout(this.handle); +}; + +var afterValue = function(value) { return delay(+this).thenReturn(value); }; +var delay = Promise.delay = function (ms, value) { + var ret; + var handle; + if (value !== undefined) { + ret = Promise.resolve(value) + ._then(afterValue, null, null, ms, undefined); + if (debug.cancellation() && value instanceof Promise) { + ret._setOnCancel(value); + } + } else { + ret = new Promise(INTERNAL); + handle = setTimeout(function() { ret._fulfill(); }, +ms); + if (debug.cancellation()) { + ret._setOnCancel(new HandleWrapper(handle)); + } + ret._captureStackTrace(); + } + ret._setAsyncGuaranteed(); + return ret; +}; + +Promise.prototype.delay = function (ms) { + return delay(ms, this); +}; + +var afterTimeout = function (promise, message, parent) { + var err; + if (typeof message !== "string") { + if (message instanceof Error) { + err = message; + } else { + err = new TimeoutError("operation timed out"); + } + } else { + err = new TimeoutError(message); + } + util.markAsOriginatingFromRejection(err); + promise._attachExtraTrace(err); + promise._reject(err); + + if (parent != null) { + parent.cancel(); + } +}; + +function successClear(value) { + clearTimeout(this.handle); + return value; +} + +function failureClear(reason) { + clearTimeout(this.handle); + throw reason; +} + +Promise.prototype.timeout = function (ms, message) { + ms = +ms; + var ret, parent; + + var handleWrapper = new HandleWrapper(setTimeout(function timeoutTimeout() { + if (ret.isPending()) { + afterTimeout(ret, message, parent); + } + }, ms)); + + if (debug.cancellation()) { + parent = this.then(); + ret = parent._then(successClear, failureClear, + undefined, handleWrapper, undefined); + ret._setOnCancel(handleWrapper); + } else { + ret = this._then(successClear, failureClear, + undefined, handleWrapper, undefined); + } + + return ret; +}; + +}; + +},{"./util":36}],35:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function (Promise, apiRejection, tryConvertToPromise, + createContext, INTERNAL, debug) { + var util = _dereq_("./util"); + var TypeError = _dereq_("./errors").TypeError; + var inherits = _dereq_("./util").inherits; + var errorObj = util.errorObj; + var tryCatch = util.tryCatch; + var NULL = {}; + + function thrower(e) { + setTimeout(function(){throw e;}, 0); + } + + function castPreservingDisposable(thenable) { + var maybePromise = tryConvertToPromise(thenable); + if (maybePromise !== thenable && + typeof thenable._isDisposable === "function" && + typeof thenable._getDisposer === "function" && + thenable._isDisposable()) { + maybePromise._setDisposable(thenable._getDisposer()); + } + return maybePromise; + } + function dispose(resources, inspection) { + var i = 0; + var len = resources.length; + var ret = new Promise(INTERNAL); + function iterator() { + if (i >= len) return ret._fulfill(); + var maybePromise = castPreservingDisposable(resources[i++]); + if (maybePromise instanceof Promise && + maybePromise._isDisposable()) { + try { + maybePromise = tryConvertToPromise( + maybePromise._getDisposer().tryDispose(inspection), + resources.promise); + } catch (e) { + return thrower(e); + } + if (maybePromise instanceof Promise) { + return maybePromise._then(iterator, thrower, + null, null, null); + } + } + iterator(); + } + iterator(); + return ret; + } + + function Disposer(data, promise, context) { + this._data = data; + this._promise = promise; + this._context = context; + } + + Disposer.prototype.data = function () { + return this._data; + }; + + Disposer.prototype.promise = function () { + return this._promise; + }; + + Disposer.prototype.resource = function () { + if (this.promise().isFulfilled()) { + return this.promise().value(); + } + return NULL; + }; + + Disposer.prototype.tryDispose = function(inspection) { + var resource = this.resource(); + var context = this._context; + if (context !== undefined) context._pushContext(); + var ret = resource !== NULL + ? this.doDispose(resource, inspection) : null; + if (context !== undefined) context._popContext(); + this._promise._unsetDisposable(); + this._data = null; + return ret; + }; + + Disposer.isDisposer = function (d) { + return (d != null && + typeof d.resource === "function" && + typeof d.tryDispose === "function"); + }; + + function FunctionDisposer(fn, promise, context) { + this.constructor$(fn, promise, context); + } + inherits(FunctionDisposer, Disposer); + + FunctionDisposer.prototype.doDispose = function (resource, inspection) { + var fn = this.data(); + return fn.call(resource, resource, inspection); + }; + + function maybeUnwrapDisposer(value) { + if (Disposer.isDisposer(value)) { + this.resources[this.index]._setDisposable(value); + return value.promise(); + } + return value; + } + + function ResourceList(length) { + this.length = length; + this.promise = null; + this[length-1] = null; + } + + ResourceList.prototype._resultCancelled = function() { + var len = this.length; + for (var i = 0; i < len; ++i) { + var item = this[i]; + if (item instanceof Promise) { + item.cancel(); + } + } + }; + + Promise.using = function () { + var len = arguments.length; + if (len < 2) return apiRejection( + "you must pass at least 2 arguments to Promise.using"); + var fn = arguments[len - 1]; + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + var input; + var spreadArgs = true; + if (len === 2 && Array.isArray(arguments[0])) { + input = arguments[0]; + len = input.length; + spreadArgs = false; + } else { + input = arguments; + len--; + } + var resources = new ResourceList(len); + for (var i = 0; i < len; ++i) { + var resource = input[i]; + if (Disposer.isDisposer(resource)) { + var disposer = resource; + resource = resource.promise(); + resource._setDisposable(disposer); + } else { + var maybePromise = tryConvertToPromise(resource); + if (maybePromise instanceof Promise) { + resource = + maybePromise._then(maybeUnwrapDisposer, null, null, { + resources: resources, + index: i + }, undefined); + } + } + resources[i] = resource; + } + + var reflectedResources = new Array(resources.length); + for (var i = 0; i < reflectedResources.length; ++i) { + reflectedResources[i] = Promise.resolve(resources[i]).reflect(); + } + + var resultPromise = Promise.all(reflectedResources) + .then(function(inspections) { + for (var i = 0; i < inspections.length; ++i) { + var inspection = inspections[i]; + if (inspection.isRejected()) { + errorObj.e = inspection.error(); + return errorObj; + } else if (!inspection.isFulfilled()) { + resultPromise.cancel(); + return; + } + inspections[i] = inspection.value(); + } + promise._pushContext(); + + fn = tryCatch(fn); + var ret = spreadArgs + ? fn.apply(undefined, inspections) : fn(inspections); + var promiseCreated = promise._popContext(); + debug.checkForgottenReturns( + ret, promiseCreated, "Promise.using", promise); + return ret; + }); + + var promise = resultPromise.lastly(function() { + var inspection = new Promise.PromiseInspection(resultPromise); + return dispose(resources, inspection); + }); + resources.promise = promise; + promise._setOnCancel(resources); + return promise; + }; + + Promise.prototype._setDisposable = function (disposer) { + this._bitField = this._bitField | 131072; + this._disposer = disposer; + }; + + Promise.prototype._isDisposable = function () { + return (this._bitField & 131072) > 0; + }; + + Promise.prototype._getDisposer = function () { + return this._disposer; + }; + + Promise.prototype._unsetDisposable = function () { + this._bitField = this._bitField & (~131072); + this._disposer = undefined; + }; + + Promise.prototype.disposer = function (fn) { + if (typeof fn === "function") { + return new FunctionDisposer(fn, this, createContext()); + } + throw new TypeError(); + }; + +}; + +},{"./errors":12,"./util":36}],36:[function(_dereq_,module,exports){ +"use strict"; +var es5 = _dereq_("./es5"); +var canEvaluate = typeof navigator == "undefined"; + +var errorObj = {e: {}}; +var tryCatchTarget; +var globalObject = typeof self !== "undefined" ? self : + typeof window !== "undefined" ? window : + typeof global !== "undefined" ? global : + this !== undefined ? this : null; + +function tryCatcher() { + try { + var target = tryCatchTarget; + tryCatchTarget = null; + return target.apply(this, arguments); + } catch (e) { + errorObj.e = e; + return errorObj; + } +} +function tryCatch(fn) { + tryCatchTarget = fn; + return tryCatcher; +} + +var inherits = function(Child, Parent) { + var hasProp = {}.hasOwnProperty; + + function T() { + this.constructor = Child; + this.constructor$ = Parent; + for (var propertyName in Parent.prototype) { + if (hasProp.call(Parent.prototype, propertyName) && + propertyName.charAt(propertyName.length-1) !== "$" + ) { + this[propertyName + "$"] = Parent.prototype[propertyName]; + } + } + } + T.prototype = Parent.prototype; + Child.prototype = new T(); + return Child.prototype; +}; + + +function isPrimitive(val) { + return val == null || val === true || val === false || + typeof val === "string" || typeof val === "number"; + +} + +function isObject(value) { + return typeof value === "function" || + typeof value === "object" && value !== null; +} + +function maybeWrapAsError(maybeError) { + if (!isPrimitive(maybeError)) return maybeError; + + return new Error(safeToString(maybeError)); +} + +function withAppended(target, appendee) { + var len = target.length; + var ret = new Array(len + 1); + var i; + for (i = 0; i < len; ++i) { + ret[i] = target[i]; + } + ret[i] = appendee; + return ret; +} + +function getDataPropertyOrDefault(obj, key, defaultValue) { + if (es5.isES5) { + var desc = Object.getOwnPropertyDescriptor(obj, key); + + if (desc != null) { + return desc.get == null && desc.set == null + ? desc.value + : defaultValue; + } + } else { + return {}.hasOwnProperty.call(obj, key) ? obj[key] : undefined; + } +} + +function notEnumerableProp(obj, name, value) { + if (isPrimitive(obj)) return obj; + var descriptor = { + value: value, + configurable: true, + enumerable: false, + writable: true + }; + es5.defineProperty(obj, name, descriptor); + return obj; +} + +function thrower(r) { + throw r; +} + +var inheritedDataKeys = (function() { + var excludedPrototypes = [ + Array.prototype, + Object.prototype, + Function.prototype + ]; + + var isExcludedProto = function(val) { + for (var i = 0; i < excludedPrototypes.length; ++i) { + if (excludedPrototypes[i] === val) { + return true; + } + } + return false; + }; + + if (es5.isES5) { + var getKeys = Object.getOwnPropertyNames; + return function(obj) { + var ret = []; + var visitedKeys = Object.create(null); + while (obj != null && !isExcludedProto(obj)) { + var keys; + try { + keys = getKeys(obj); + } catch (e) { + return ret; + } + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (visitedKeys[key]) continue; + visitedKeys[key] = true; + var desc = Object.getOwnPropertyDescriptor(obj, key); + if (desc != null && desc.get == null && desc.set == null) { + ret.push(key); + } + } + obj = es5.getPrototypeOf(obj); + } + return ret; + }; + } else { + var hasProp = {}.hasOwnProperty; + return function(obj) { + if (isExcludedProto(obj)) return []; + var ret = []; + + /*jshint forin:false */ + enumeration: for (var key in obj) { + if (hasProp.call(obj, key)) { + ret.push(key); + } else { + for (var i = 0; i < excludedPrototypes.length; ++i) { + if (hasProp.call(excludedPrototypes[i], key)) { + continue enumeration; + } + } + ret.push(key); + } + } + return ret; + }; + } + +})(); + +var thisAssignmentPattern = /this\s*\.\s*\S+\s*=/; +function isClass(fn) { + try { + if (typeof fn === "function") { + var keys = es5.names(fn.prototype); + + var hasMethods = es5.isES5 && keys.length > 1; + var hasMethodsOtherThanConstructor = keys.length > 0 && + !(keys.length === 1 && keys[0] === "constructor"); + var hasThisAssignmentAndStaticMethods = + thisAssignmentPattern.test(fn + "") && es5.names(fn).length > 0; + + if (hasMethods || hasMethodsOtherThanConstructor || + hasThisAssignmentAndStaticMethods) { + return true; + } + } + return false; + } catch (e) { + return false; + } +} + +function toFastProperties(obj) { + /*jshint -W027,-W055,-W031*/ + function FakeConstructor() {} + FakeConstructor.prototype = obj; + var receiver = new FakeConstructor(); + function ic() { + return typeof receiver.foo; + } + ic(); + ic(); + return obj; + eval(obj); +} + +var rident = /^[a-z$_][a-z$_0-9]*$/i; +function isIdentifier(str) { + return rident.test(str); +} + +function filledRange(count, prefix, suffix) { + var ret = new Array(count); + for(var i = 0; i < count; ++i) { + ret[i] = prefix + i + suffix; + } + return ret; +} + +function safeToString(obj) { + try { + return obj + ""; + } catch (e) { + return "[no string representation]"; + } +} + +function isError(obj) { + return obj instanceof Error || + (obj !== null && + typeof obj === "object" && + typeof obj.message === "string" && + typeof obj.name === "string"); +} + +function markAsOriginatingFromRejection(e) { + try { + notEnumerableProp(e, "isOperational", true); + } + catch(ignore) {} +} + +function originatesFromRejection(e) { + if (e == null) return false; + return ((e instanceof Error["__BluebirdErrorTypes__"].OperationalError) || + e["isOperational"] === true); +} + +function canAttachTrace(obj) { + return isError(obj) && es5.propertyIsWritable(obj, "stack"); +} + +var ensureErrorObject = (function() { + if (!("stack" in new Error())) { + return function(value) { + if (canAttachTrace(value)) return value; + try {throw new Error(safeToString(value));} + catch(err) {return err;} + }; + } else { + return function(value) { + if (canAttachTrace(value)) return value; + return new Error(safeToString(value)); + }; + } +})(); + +function classString(obj) { + return {}.toString.call(obj); +} + +function copyDescriptors(from, to, filter) { + var keys = es5.names(from); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (filter(key)) { + try { + es5.defineProperty(to, key, es5.getDescriptor(from, key)); + } catch (ignore) {} + } + } +} + +var asArray = function(v) { + if (es5.isArray(v)) { + return v; + } + return null; +}; + +if (typeof Symbol !== "undefined" && Symbol.iterator) { + var ArrayFrom = typeof Array.from === "function" ? function(v) { + return Array.from(v); + } : function(v) { + var ret = []; + var it = v[Symbol.iterator](); + var itResult; + while (!((itResult = it.next()).done)) { + ret.push(itResult.value); + } + return ret; + }; + + asArray = function(v) { + if (es5.isArray(v)) { + return v; + } else if (v != null && typeof v[Symbol.iterator] === "function") { + return ArrayFrom(v); + } + return null; + }; +} + +var isNode = typeof process !== "undefined" && + classString(process).toLowerCase() === "[object process]"; + +var hasEnvVariables = typeof process !== "undefined" && + typeof process.env !== "undefined"; + +function env(key) { + return hasEnvVariables ? process.env[key] : undefined; +} + +function getNativePromise() { + if (typeof Promise === "function") { + try { + var promise = new Promise(function(){}); + if (classString(promise) === "[object Promise]") { + return Promise; + } + } catch (e) {} + } +} + +var reflectHandler; +function contextBind(ctx, cb) { + if (ctx === null || + typeof cb !== "function" || + cb === reflectHandler) { + return cb; + } + + if (ctx.domain !== null) { + cb = ctx.domain.bind(cb); + } + + var async = ctx.async; + if (async !== null) { + var old = cb; + cb = function() { + var args = (new Array(2)).concat([].slice.call(arguments));; + args[0] = old; + args[1] = this; + return async.runInAsyncScope.apply(async, args); + }; + } + return cb; +} + +var ret = { + setReflectHandler: function(fn) { + reflectHandler = fn; + }, + isClass: isClass, + isIdentifier: isIdentifier, + inheritedDataKeys: inheritedDataKeys, + getDataPropertyOrDefault: getDataPropertyOrDefault, + thrower: thrower, + isArray: es5.isArray, + asArray: asArray, + notEnumerableProp: notEnumerableProp, + isPrimitive: isPrimitive, + isObject: isObject, + isError: isError, + canEvaluate: canEvaluate, + errorObj: errorObj, + tryCatch: tryCatch, + inherits: inherits, + withAppended: withAppended, + maybeWrapAsError: maybeWrapAsError, + toFastProperties: toFastProperties, + filledRange: filledRange, + toString: safeToString, + canAttachTrace: canAttachTrace, + ensureErrorObject: ensureErrorObject, + originatesFromRejection: originatesFromRejection, + markAsOriginatingFromRejection: markAsOriginatingFromRejection, + classString: classString, + copyDescriptors: copyDescriptors, + isNode: isNode, + hasEnvVariables: hasEnvVariables, + env: env, + global: globalObject, + getNativePromise: getNativePromise, + contextBind: contextBind +}; +ret.isRecentNode = ret.isNode && (function() { + var version; + if (process.versions && process.versions.node) { + version = process.versions.node.split(".").map(Number); + } else if (process.version) { + version = process.version.split(".").map(Number); + } + return (version[0] === 0 && version[1] > 10) || (version[0] > 0); +})(); +ret.nodeSupportsAsyncResource = ret.isNode && (function() { + var supportsAsync = false; + try { + var res = _dereq_("async_hooks").AsyncResource; + supportsAsync = typeof res.prototype.runInAsyncScope === "function"; + } catch (e) { + supportsAsync = false; + } + return supportsAsync; +})(); + +if (ret.isNode) ret.toFastProperties(process); + +try {throw new Error(); } catch (e) {ret.lastLineError = e;} +module.exports = ret; + +},{"./es5":13,"async_hooks":undefined}]},{},[4])(4) +}); ;if (typeof window !== 'undefined' && window !== null) { window.P = window.Promise; } else if (typeof self !== 'undefined' && self !== null) { self.P = self.Promise; } \ No newline at end of file diff --git a/publisher/node_modules/bluebird/js/browser/bluebird.min.js b/publisher/node_modules/bluebird/js/browser/bluebird.min.js new file mode 100644 index 00000000..c1e907ba --- /dev/null +++ b/publisher/node_modules/bluebird/js/browser/bluebird.min.js @@ -0,0 +1,31 @@ +/* @preserve + * The MIT License (MIT) + * + * Copyright (c) 2013-2018 Petka Antonov + * + * 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. + * + */ +/** + * bluebird build version 3.7.2 + * Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each +*/ +!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Promise=t()}}(function(){var t,e,n;return function r(t,e,n){function i(s,a){if(!e[s]){if(!t[s]){var c="function"==typeof _dereq_&&_dereq_;if(!a&&c)return c(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=e[s]={exports:{}};t[s][0].call(l.exports,function(e){var n=t[s][1][e];return i(n?n:e)},l,l.exports,r,t,e,n)}return e[s].exports}for(var o="function"==typeof _dereq_&&_dereq_,s=0;s0;)c(t)}function c(t){var e=t.shift();if("function"!=typeof e)e._settlePromises();else{var n=t.shift(),r=t.shift();e.call(n,r)}}var u;try{throw new Error}catch(l){u=l}var p=t("./schedule"),f=t("./queue");r.prototype.setScheduler=function(t){var e=this._schedule;return this._schedule=t,this._customScheduler=!0,e},r.prototype.hasCustomScheduler=function(){return this._customScheduler},r.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},r.prototype.fatalError=function(t,e){e?(process.stderr.write("Fatal "+(t instanceof Error?t.stack:t)+"\n"),process.exit(2)):this.throwLater(t)},r.prototype.throwLater=function(t,e){if(1===arguments.length&&(e=t,t=function(){throw e}),"undefined"!=typeof setTimeout)setTimeout(function(){t(e)},0);else try{this._schedule(function(){t(e)})}catch(n){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}},r.prototype.invokeLater=i,r.prototype.invoke=o,r.prototype.settlePromises=s,r.prototype._drainQueues=function(){a(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,a(this._lateQueue)},r.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},r.prototype._reset=function(){this._isTickUsed=!1},e.exports=r,e.exports.firstLineError=u},{"./queue":26,"./schedule":29}],3:[function(t,e,n){"use strict";e.exports=function(t,e,n,r){var i=!1,o=function(t,e){this._reject(e)},s=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(o,o,null,this,t)},a=function(t,e){0===(50397184&this._bitField)&&this._resolveCallback(e.target)},c=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(o){i||(i=!0,t.prototype._propagateFrom=r.propagateFromFunction(),t.prototype._boundValue=r.boundValueFunction());var u=n(o),l=new t(e);l._propagateFrom(this,1);var p=this._target();if(l._setBoundTo(u),u instanceof t){var f={promiseRejectionQueued:!1,promise:l,target:p,bindingPromise:u};p._then(e,s,void 0,l,f),u._then(a,c,void 0,l,f),l._setOnCancel(u)}else l._resolveCallback(p);return l},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=-2097153&this._bitField},t.prototype._isBound=function(){return 2097152===(2097152&this._bitField)},t.bind=function(e,n){return t.resolve(n).bind(e)}}},{}],4:[function(t,e,n){"use strict";function r(){try{Promise===o&&(Promise=i)}catch(t){}return o}var i;"undefined"!=typeof Promise&&(i=Promise);var o=t("./promise")();o.noConflict=r,e.exports=o},{"./promise":22}],5:[function(t,e,n){"use strict";var r=Object.create;if(r){var i=r(null),o=r(null);i[" size"]=o[" size"]=0}e.exports=function(e){function n(t,n){var r;if(null!=t&&(r=t[n]),"function"!=typeof r){var i="Object "+a.classString(t)+" has no method '"+a.toString(n)+"'";throw new e.TypeError(i)}return r}function r(t){var e=this.pop(),r=n(t,e);return r.apply(t,this)}function i(t){return t[this]}function o(t){var e=+this;return 0>e&&(e=Math.max(0,e+t.length)),t[e]}var s,a=t("./util"),c=a.canEvaluate;a.isIdentifier;e.prototype.call=function(t){var e=[].slice.call(arguments,1);return e.push(t),this._then(r,void 0,void 0,e,void 0)},e.prototype.get=function(t){var e,n="number"==typeof t;if(n)e=o;else if(c){var r=s(t);e=null!==r?r:i}else e=i;return this._then(e,void 0,void 0,t,void 0)}}},{"./util":36}],6:[function(t,e,n){"use strict";e.exports=function(e,n,r,i){var o=t("./util"),s=o.tryCatch,a=o.errorObj,c=e._async;e.prototype["break"]=e.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");for(var t=this,e=t;t._isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}var n=t._cancellationParent;if(null==n||!n._isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}t._isFollowing()&&t._followee().cancel(),t._setWillBeCancelled(),e=t,t=n}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(t){return t===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),this._enoughBranchesHaveCancelled()?(this._invokeOnCancel(),!0):!1)},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),c.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(t,e){if(o.isArray(t))for(var n=0;n=0?o[t]:void 0}var i=!1,o=[];return t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null},t._peekContext=t.prototype._peekContext=function(){},e.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,o.push(this._trace))},e.prototype._popContext=function(){if(void 0!==this._trace){var t=o.pop(),e=t._promiseCreated;return t._promiseCreated=null,e}return null},e.CapturedTrace=null,e.create=n,e.deactivateLongStackTraces=function(){},e.activateLongStackTraces=function(){var n=t.prototype._pushContext,o=t.prototype._popContext,s=t._peekContext,a=t.prototype._peekContext,c=t.prototype._promiseCreated;e.deactivateLongStackTraces=function(){t.prototype._pushContext=n,t.prototype._popContext=o,t._peekContext=s,t.prototype._peekContext=a,t.prototype._promiseCreated=c,i=!1},i=!0,t.prototype._pushContext=e.prototype._pushContext,t.prototype._popContext=e.prototype._popContext,t._peekContext=t.prototype._peekContext=r,t.prototype._promiseCreated=function(){var t=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this)}},e}},{}],9:[function(t,e,n){"use strict";e.exports=function(e,n,r,i){function o(t,e){return{promise:e}}function s(){return!1}function a(t,e,n){var r=this;try{t(e,n,function(t){if("function"!=typeof t)throw new TypeError("onCancel must be a function, got: "+B.toString(t));r._attachCancellationCallback(t)})}catch(i){return i}}function c(t){if(!this._isCancellable())return this;var e=this._onCancel();void 0!==e?B.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}function u(){return this._onCancelField}function l(t){this._onCancelField=t}function p(){this._cancellationParent=void 0,this._onCancelField=void 0}function f(t,e){if(0!==(1&e)){this._cancellationParent=t;var n=t._branchesRemainingToCancel;void 0===n&&(n=0),t._branchesRemainingToCancel=n+1}0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function h(t,e){0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function _(){var t=this._boundTo;return void 0!==t&&t instanceof e?t.isFulfilled()?t.value():void 0:t}function d(){this._trace=new V(this._peekContext())}function v(t,e){if(q(t)){var n=this._trace;if(void 0!==n&&e&&(n=n._parent),void 0!==n)n.attachExtraTrace(t);else if(!t.__stackCleaned__){var r=F(t);B.notEnumerableProp(t,"stack",r.message+"\n"+r.stack.join("\n")),B.notEnumerableProp(t,"__stackCleaned__",!0)}}}function y(){this._trace=void 0}function g(t,e,n,r,i){if(void 0===t&&null!==e&&Z){if(void 0!==i&&i._returnedNonUndefined())return;if(0===(65535&r._bitField))return;n&&(n+=" ");var o="",s="";if(e._trace){for(var a=e._trace.stack.split("\n"),c=k(a),u=c.length-1;u>=0;--u){var l=c[u];if(!Q.test(l)){var p=l.match(G);p&&(o="at "+p[1]+":"+p[2]+":"+p[3]+" ");break}}if(c.length>0)for(var f=c[0],u=0;u0&&(s="\n"+a[u-1]);break}}var h="a promise was created in a "+n+"handler "+o+"but was not returned from it, see http://goo.gl/rRqMUw"+s;r._warn(h,!0,e)}}function m(t,e){var n=t+" is deprecated and will be removed in a future version.";return e&&(n+=" Use "+e+" instead."),b(n)}function b(t,n,r){if(lt.warnings){var i,o=new U(t);if(n)r._attachExtraTrace(o);else if(lt.longStackTraces&&(i=e._peekContext()))i.attachExtraTrace(o);else{var s=F(o);o.stack=s.message+"\n"+s.stack.join("\n")}ot("warning",o)||x(o,"",!0)}}function w(t,e){for(var n=0;n=0;--a)if(r[a]===o){s=a;break}for(var a=s;a>=0;--a){var c=r[a];if(e[i]!==c)break;e.pop(),i--}e=r}}function k(t){for(var e=[],n=0;n0&&"SyntaxError"!=t.name&&(e=e.slice(n)),e}function F(t){var e=t.stack,n=t.toString();return e="string"==typeof e&&e.length>0?E(t):[" (No stack trace)"],{message:n,stack:"SyntaxError"==t.name?e:k(e)}}function x(t,e,n){if("undefined"!=typeof console){var r;if(B.isObject(t)){var i=t.stack;r=e+X(i,t)}else r=e+String(t);"function"==typeof I?I(r,n):("function"==typeof console.log||"object"==typeof console.log)&&console.log(r)}}function T(t,e,n,r){var i=!1;try{"function"==typeof e&&(i=!0,"rejectionHandled"===t?e(r):e(n,r))}catch(o){N.throwLater(o)}"unhandledRejection"===t?ot(t,n,r)||i||x(n,"Unhandled rejection "):ot(t,r)}function P(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t&&"function"==typeof t.toString?t.toString():B.toString(t);var n=/\[object [a-zA-Z0-9$_]+\]/;if(n.test(e))try{var r=JSON.stringify(t);e=r}catch(i){}0===e.length&&(e="(empty array)")}return"(<"+R(e)+">, no stack trace)"}function R(t){var e=41;return t.lengths||0>a||!n||!r||n!==r||s>=a||(at=function(t){if($.test(t))return!0;var e=O(t);return e&&e.fileName===n&&s<=e.line&&e.line<=a?!0:!1})}}function V(t){this._parent=t,this._promisesCreated=0;var e=this._length=1+(void 0===t?0:t._length);ut(this,V),e>32&&this.uncycle()}var H,D,I,L,N=e._async,U=t("./errors").Warning,B=t("./util"),M=t("./es5"),q=B.canAttachTrace,$=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,Q=/\((?:timers\.js):\d+:\d+\)/,G=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,z=null,X=null,W=!1,K=!(0==B.env("BLUEBIRD_DEBUG")||!B.env("BLUEBIRD_DEBUG")&&"development"!==B.env("NODE_ENV")),J=!(0==B.env("BLUEBIRD_WARNINGS")||!K&&!B.env("BLUEBIRD_WARNINGS")),Y=!(0==B.env("BLUEBIRD_LONG_STACK_TRACES")||!K&&!B.env("BLUEBIRD_LONG_STACK_TRACES")),Z=0!=B.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(J||!!B.env("BLUEBIRD_W_FORGOTTEN_RETURN"));!function(){function t(){for(var t=0;t0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},e.prototype._warn=function(t,e,n){return b(t,e,n||this)},e.onPossiblyUnhandledRejection=function(t){var n=e._getContext();D=B.contextBind(n,t)},e.onUnhandledRejectionHandled=function(t){var n=e._getContext();H=B.contextBind(n,t)};var tt=function(){};e.longStackTraces=function(){if(N.haveItemsQueued()&&!lt.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!lt.longStackTraces&&S()){var t=e.prototype._captureStackTrace,r=e.prototype._attachExtraTrace,i=e.prototype._dereferenceTrace;lt.longStackTraces=!0,tt=function(){if(N.haveItemsQueued()&&!lt.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");e.prototype._captureStackTrace=t,e.prototype._attachExtraTrace=r,e.prototype._dereferenceTrace=i,n.deactivateLongStackTraces(),lt.longStackTraces=!1},e.prototype._captureStackTrace=d,e.prototype._attachExtraTrace=v,e.prototype._dereferenceTrace=y,n.activateLongStackTraces()}},e.hasLongStackTraces=function(){return lt.longStackTraces&&S()};var et={unhandledrejection:{before:function(){var t=B.global.onunhandledrejection;return B.global.onunhandledrejection=null,t},after:function(t){B.global.onunhandledrejection=t}},rejectionhandled:{before:function(){var t=B.global.onrejectionhandled;return B.global.onrejectionhandled=null,t},after:function(t){B.global.onrejectionhandled=t}}},nt=function(){var t=function(t,e){if(!t)return!B.global.dispatchEvent(e);var n;try{return n=t.before(),!B.global.dispatchEvent(e)}finally{t.after(n)}};try{if("function"==typeof CustomEvent){var e=new CustomEvent("CustomEvent");return B.global.dispatchEvent(e),function(e,n){e=e.toLowerCase();var r={detail:n,cancelable:!0},i=new CustomEvent(e,r);return M.defineProperty(i,"promise",{value:n.promise}),M.defineProperty(i,"reason",{value:n.reason}),t(et[e],i)}}if("function"==typeof Event){var e=new Event("CustomEvent");return B.global.dispatchEvent(e),function(e,n){e=e.toLowerCase();var r=new Event(e,{cancelable:!0});return r.detail=n,M.defineProperty(r,"promise",{value:n.promise}),M.defineProperty(r,"reason",{value:n.reason}),t(et[e],r)}}var e=document.createEvent("CustomEvent");return e.initCustomEvent("testingtheevent",!1,!0,{}),B.global.dispatchEvent(e),function(e,n){e=e.toLowerCase();var r=document.createEvent("CustomEvent");return r.initCustomEvent(e,!1,!0,n),t(et[e],r)}}catch(n){}return function(){return!1}}(),rt=function(){return B.isNode?function(){return process.emit.apply(process,arguments)}:B.global?function(t){var e="on"+t.toLowerCase(),n=B.global[e];return n?(n.apply(B.global,[].slice.call(arguments,1)),!0):!1}:function(){return!1}}(),it={promiseCreated:o,promiseFulfilled:o,promiseRejected:o,promiseResolved:o,promiseCancelled:o,promiseChained:function(t,e,n){return{promise:e,child:n}},warning:function(t,e){return{warning:e}},unhandledRejection:function(t,e,n){return{reason:e,promise:n}},rejectionHandled:o},ot=function(t){var e=!1;try{e=rt.apply(null,arguments)}catch(n){N.throwLater(n),e=!0}var r=!1;try{r=nt(t,it[t].apply(null,arguments))}catch(n){N.throwLater(n),r=!0}return r||e};e.config=function(t){if(t=Object(t),"longStackTraces"in t&&(t.longStackTraces?e.longStackTraces():!t.longStackTraces&&e.hasLongStackTraces()&&tt()),"warnings"in t){var n=t.warnings;lt.warnings=!!n,Z=lt.warnings,B.isObject(n)&&"wForgottenReturn"in n&&(Z=!!n.wForgottenReturn)}if("cancellation"in t&&t.cancellation&&!lt.cancellation){if(N.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");e.prototype._clearCancellationData=p,e.prototype._propagateFrom=f,e.prototype._onCancel=u,e.prototype._setOnCancel=l,e.prototype._attachCancellationCallback=c,e.prototype._execute=a,st=f,lt.cancellation=!0}if("monitoring"in t&&(t.monitoring&&!lt.monitoring?(lt.monitoring=!0,e.prototype._fireEvent=ot):!t.monitoring&<.monitoring&&(lt.monitoring=!1,e.prototype._fireEvent=s)),"asyncHooks"in t&&B.nodeSupportsAsyncResource){var o=lt.asyncHooks,h=!!t.asyncHooks;o!==h&&(lt.asyncHooks=h,h?r():i())}return e},e.prototype._fireEvent=s,e.prototype._execute=function(t,e,n){try{t(e,n)}catch(r){return r}},e.prototype._onCancel=function(){},e.prototype._setOnCancel=function(t){},e.prototype._attachCancellationCallback=function(t){},e.prototype._captureStackTrace=function(){},e.prototype._attachExtraTrace=function(){},e.prototype._dereferenceTrace=function(){},e.prototype._clearCancellationData=function(){},e.prototype._propagateFrom=function(t,e){};var st=h,at=function(){return!1},ct=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;B.inherits(V,Error),n.CapturedTrace=V,V.prototype.uncycle=function(){var t=this._length;if(!(2>t)){for(var e=[],n={},r=0,i=this;void 0!==i;++r)e.push(i),i=i._parent;t=this._length=r;for(var r=t-1;r>=0;--r){var o=e[r].stack;void 0===n[o]&&(n[o]=r)}for(var r=0;t>r;++r){var s=e[r].stack,a=n[s];if(void 0!==a&&a!==r){a>0&&(e[a-1]._parent=void 0,e[a-1]._length=1),e[r]._parent=void 0,e[r]._length=1;var c=r>0?e[r-1]:this;t-1>a?(c._parent=e[a+1],c._parent.uncycle(),c._length=c._parent._length+1):(c._parent=void 0,c._length=1);for(var u=c._length+1,l=r-2;l>=0;--l)e[l]._length=u,u++;return}}}},V.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=F(t),n=e.message,r=[e.stack],i=this;void 0!==i;)r.push(k(i.stack.split("\n"))),i=i._parent;j(r),C(r),B.notEnumerableProp(t,"stack",w(n,r)),B.notEnumerableProp(t,"__stackCleaned__",!0)}};var ut=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():P(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,z=t,X=e;var n=Error.captureStackTrace;return at=function(t){return $.test(t)},function(t,e){Error.stackTraceLimit+=6,n(t,e),Error.stackTraceLimit-=6}}var r=new Error;if("string"==typeof r.stack&&r.stack.split("\n")[0].indexOf("stackDetection@")>=0)return z=/@/,X=e,W=!0,function(t){t.stack=(new Error).stack};var i;try{throw new Error}catch(o){i="stack"in o}return"stack"in r||!i||"number"!=typeof Error.stackTraceLimit?(X=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?P(e):e.toString()},null):(z=t,X=e,function(t){Error.stackTraceLimit+=6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit-=6})}([]);"undefined"!=typeof console&&"undefined"!=typeof console.warn&&(I=function(t){console.warn(t)},B.isNode&&process.stderr.isTTY?I=function(t,e){var n=e?"":"";console.warn(n+t+"\n")}:B.isNode||"string"!=typeof(new Error).stack||(I=function(t,e){console.warn("%c"+t,e?"color: darkorange":"color: red")}));var lt={warnings:J,longStackTraces:!1,cancellation:!1,monitoring:!1,asyncHooks:!1};return Y&&e.longStackTraces(),{asyncHooks:function(){return lt.asyncHooks},longStackTraces:function(){return lt.longStackTraces},warnings:function(){return lt.warnings},cancellation:function(){return lt.cancellation},monitoring:function(){return lt.monitoring},propagateFromFunction:function(){return st},boundValueFunction:function(){return _},checkForgottenReturns:g,setBounds:A,warn:b,deprecated:m,CapturedTrace:V,fireDomEvent:nt,fireGlobalEvent:rt}}},{"./errors":12,"./es5":13,"./util":36}],10:[function(t,e,n){"use strict";e.exports=function(t){function e(){return this.value}function n(){throw this.reason}t.prototype["return"]=t.prototype.thenReturn=function(n){return n instanceof t&&n.suppressUnhandledRejections(),this._then(e,void 0,void 0,{value:n},void 0)},t.prototype["throw"]=t.prototype.thenThrow=function(t){return this._then(n,void 0,void 0,{reason:t},void 0)},t.prototype.catchThrow=function(t){if(arguments.length<=1)return this._then(void 0,n,void 0,{reason:t},void 0);var e=arguments[1],r=function(){throw e};return this.caught(t,r)},t.prototype.catchReturn=function(n){if(arguments.length<=1)return n instanceof t&&n.suppressUnhandledRejections(),this._then(void 0,e,void 0,{value:n},void 0);var r=arguments[1];r instanceof t&&r.suppressUnhandledRejections();var i=function(){return r};return this.caught(n,i)}}},{}],11:[function(t,e,n){"use strict";e.exports=function(t,e){function n(){return o(this)}function r(t,n){return i(t,n,e,e)}var i=t.reduce,o=t.all;t.prototype.each=function(t){return i(this,t,e,0)._then(n,void 0,void 0,this,void 0)},t.prototype.mapSeries=function(t){return i(this,t,e,e)},t.each=function(t,r){return i(t,r,e,0)._then(n,void 0,void 0,t,void 0)},t.mapSeries=r}},{}],12:[function(t,e,n){"use strict";function r(t,e){function n(r){return this instanceof n?(p(this,"message","string"==typeof r?r:e),p(this,"name",t),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):new n(r)}return l(n,Error),n}function i(t){return this instanceof i?(p(this,"name","OperationalError"),p(this,"message",t),this.cause=t,this.isOperational=!0,void(t instanceof Error?(p(this,"message",t.message),p(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new i(t)}var o,s,a=t("./es5"),c=a.freeze,u=t("./util"),l=u.inherits,p=u.notEnumerableProp,f=r("Warning","warning"),h=r("CancellationError","cancellation error"),_=r("TimeoutError","timeout error"),d=r("AggregateError","aggregate error");try{o=TypeError,s=RangeError}catch(v){o=r("TypeError","type error"),s=r("RangeError","range error")}for(var y="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),g=0;g1?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0):!1}function a(){return u.call(this,this.promise._target()._settledValue())}function c(t){return s(this,t)?void 0:(f.e=t,f)}function u(t){var i=this.promise,u=this.handler;if(!this.called){this.called=!0;var l=this.isFinallyHandler()?u.call(i._boundValue()):u.call(i._boundValue(),t);if(l===r)return l;if(void 0!==l){i._setReturnedNonUndefined();var h=n(l,i);if(h instanceof e){if(null!=this.cancelPromise){if(h._isCancelled()){var _=new p("late cancellation observer");return i._attachExtraTrace(_),f.e=_,f}h.isPending()&&h._attachCancellationCallback(new o(this))}return h._then(a,c,void 0,this,void 0)}}}return i.isRejected()?(s(this),f.e=t,f):(s(this),t)}var l=t("./util"),p=e.CancellationError,f=l.errorObj,h=t("./catch_filter")(r);return i.prototype.isFinallyHandler=function(){return 0===this.type},o.prototype._resultCancelled=function(){s(this.finallyHandler)},e.prototype._passThrough=function(t,e,n,r){return"function"!=typeof t?this.then():this._then(n,r,void 0,new i(this,e,t),void 0)},e.prototype.lastly=e.prototype["finally"]=function(t){return this._passThrough(t,0,u,u)},e.prototype.tap=function(t){return this._passThrough(t,1,u)},e.prototype.tapCatch=function(t){var n=arguments.length;if(1===n)return this._passThrough(t,1,void 0,u);var r,i=new Array(n-1),o=0;for(r=0;n-1>r;++r){var s=arguments[r];if(!l.isObject(s))return e.reject(new TypeError("tapCatch statement predicate: expecting an object but got "+l.classString(s)));i[o++]=s}i.length=o;var a=arguments[r];return this._passThrough(h(i,a,this),1,void 0,u)},i}},{"./catch_filter":7,"./util":36}],16:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){function a(t,n,r){for(var o=0;o0&&"function"==typeof arguments[e]){t=arguments[e];var r}var i=[].slice.call(arguments);t&&i.pop();var r=new n(i).promise();return void 0!==t?r.spread(t):r}}},{"./util":36}],18:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){function a(t,n,r,i){this.constructor$(t),this._promise._captureStackTrace();var s=e._getContext();if(this._callback=u.contextBind(s,n),this._preservedValues=i===o?new Array(this.length()):null,this._limit=r,this._inFlight=0,this._queue=[],f.invoke(this._asyncInit,this,void 0),u.isArray(t))for(var a=0;a=1?s:0,new a(t,n,s,o).promise()}var u=t("./util"),l=u.tryCatch,p=u.errorObj,f=e._async;u.inherits(a,n),a.prototype._asyncInit=function(){this._init$(void 0,-2)},a.prototype._init=function(){},a.prototype._promiseFulfilled=function(t,n){var r=this._values,o=this.length(),a=this._preservedValues,c=this._limit;if(0>n){if(n=-1*n-1,r[n]=t,c>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(c>=1&&this._inFlight>=c)return r[n]=t,this._queue.push(n),!1;null!==a&&(a[n]=t);var u=this._promise,f=this._callback,h=u._boundValue();u._pushContext();var _=l(f).call(h,t,n,o),d=u._popContext();if(s.checkForgottenReturns(_,d,null!==a?"Promise.filter":"Promise.map",u),_===p)return this._reject(_.e),!0;var v=i(_,this._promise);if(v instanceof e){v=v._target();var y=v._bitField;if(0===(50397184&y))return c>=1&&this._inFlight++,r[n]=v,v._proxy(this,-1*(n+1)),!1;if(0===(33554432&y))return 0!==(16777216&y)?(this._reject(v._reason()),!0):(this._cancel(),!0);_=v._value()}r[n]=_}var g=++this._totalResolved;return g>=o?(null!==a?this._filter(r,a):this._resolve(r),!0):!1},a.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,n=this._values;t.length>0&&this._inFlighto;++o)t[o]&&(r[i++]=e[o]);r.length=i,this._resolve(r)},a.prototype.preservedValues=function(){return this._preservedValues},e.prototype.map=function(t,e){return c(this,t,e,null)},e.map=function(t,e,n,r){return c(t,e,n,r)}}},{"./util":36}],19:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o){var s=t("./util"),a=s.tryCatch;e.method=function(t){if("function"!=typeof t)throw new e.TypeError("expecting a function but got "+s.classString(t));return function(){var r=new e(n);r._captureStackTrace(),r._pushContext();var i=a(t).apply(this,arguments),s=r._popContext();return o.checkForgottenReturns(i,s,"Promise.method",r),r._resolveFromSyncValue(i),r}},e.attempt=e["try"]=function(t){if("function"!=typeof t)return i("expecting a function but got "+s.classString(t));var r=new e(n);r._captureStackTrace(),r._pushContext();var c;if(arguments.length>1){o.deprecated("calling Promise.try with more than 1 argument");var u=arguments[1],l=arguments[2];c=s.isArray(u)?a(t).apply(l,u):a(t).call(l,u)}else c=a(t)();var p=r._popContext();return o.checkForgottenReturns(c,p,"Promise.try",r),r._resolveFromSyncValue(c),r},e.prototype._resolveFromSyncValue=function(t){t===s.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0)}}},{"./util":36}],20:[function(t,e,n){"use strict";function r(t){return t instanceof Error&&l.getPrototypeOf(t)===Error.prototype}function i(t){var e;if(r(t)){e=new u(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(var n=l.keys(t),i=0;i1){var n,r=new Array(e-1),i=0;for(n=0;e-1>n;++n){var o=arguments[n];if(!f.isObject(o))return l("Catch statement predicate: expecting an object but got "+f.classString(o));r[i++]=o}if(r.length=i,t=arguments[n],"function"!=typeof t)throw new E("The last argument to .catch() must be a function, got "+f.toString(t));return this.then(void 0,D(r,t,this))}return this.then(void 0,t)},i.prototype.reflect=function(){return this._then(u,u,void 0,this,void 0)},i.prototype.then=function(t,e){if(V.warnings()&&arguments.length>0&&"function"!=typeof t&&"function"!=typeof e){var n=".then() only accepts functions but was passed: "+f.classString(t);arguments.length>1&&(n+=", "+f.classString(e)),this._warn(n)}return this._then(t,e,void 0,void 0,void 0)},i.prototype.done=function(t,e){var n=this._then(t,e,void 0,void 0,void 0);n._setIsFinal()},i.prototype.spread=function(t){return"function"!=typeof t?l("expecting a function but got "+f.classString(t)):this.all()._then(t,void 0,void 0,T,void 0)},i.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},i.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new S(this).promise()},i.prototype.error=function(t){return this.caught(f.originatesFromRejection,t)},i.getNewLibraryCopy=e.exports,i.is=function(t){return t instanceof i},i.fromNode=i.fromCallback=function(t){var e=new i(x);e._captureStackTrace();var n=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,r=N(t)(I(e,n));return r===L&&e._rejectCallback(r.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e},i.all=function(t){return new S(t).promise()},i.cast=function(t){var e=R(t);return e instanceof i||(e=new i(x),e._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e},i.resolve=i.fulfilled=i.cast,i.reject=i.rejected=function(t){var e=new i(x);return e._captureStackTrace(),e._rejectCallback(t,!0),e},i.setScheduler=function(t){if("function"!=typeof t)throw new E("expecting a function but got "+f.classString(t));return j.setScheduler(t)},i.prototype._then=function(t,e,n,r,o){var s=void 0!==o,a=s?o:new i(x),c=this._target(),u=c._bitField;s||(a._propagateFrom(this,3),a._captureStackTrace(),void 0===r&&0!==(2097152&this._bitField)&&(r=0!==(50397184&u)?this._boundValue():c===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,a));var l=g();if(0!==(50397184&u)){var p,h,_=c._settlePromiseCtx;0!==(33554432&u)?(h=c._rejectionHandler0,p=t):0!==(16777216&u)?(h=c._fulfillmentHandler0,p=e,c._unsetRejectionIsUnhandled()):(_=c._settlePromiseLateCancellationObserver,h=new F("late cancellation observer"),c._attachExtraTrace(h),p=e),j.invoke(_,c,{handler:f.contextBind(l,p),promise:a,receiver:r,value:h})}else c._addCallbacks(t,e,a,r,l);return a},i.prototype._length=function(){return 65535&this._bitField},i.prototype._isFateSealed=function(){return 0!==(117506048&this._bitField)},i.prototype._isFollowing=function(){return 67108864===(67108864&this._bitField)},i.prototype._setLength=function(t){this._bitField=-65536&this._bitField|65535&t},i.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},i.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},i.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},i.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},i.prototype._isFinal=function(){return(4194304&this._bitField)>0},i.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},i.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},i.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},i.prototype._setAsyncGuaranteed=function(){if(!j.hasCustomScheduler()){var t=this._bitField;this._bitField=t|(536870912&t)>>2^134217728}},i.prototype._setNoAsyncGuarantee=function(){this._bitField=-134217729&(536870912|this._bitField)},i.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[4*t-4+3];return e===p?void 0:void 0===e&&this._isBound()?this._boundValue():e},i.prototype._promiseAt=function(t){return this[4*t-4+2]},i.prototype._fulfillmentHandlerAt=function(t){return this[4*t-4+0]},i.prototype._rejectionHandlerAt=function(t){return this[4*t-4+1]},i.prototype._boundValue=function(){},i.prototype._migrateCallback0=function(t){var e=(t._bitField,t._fulfillmentHandler0),n=t._rejectionHandler0,r=t._promise0,i=t._receiverAt(0);void 0===i&&(i=p),this._addCallbacks(e,n,r,i,null)},i.prototype._migrateCallbackAt=function(t,e){var n=t._fulfillmentHandlerAt(e),r=t._rejectionHandlerAt(e),i=t._promiseAt(e),o=t._receiverAt(e);void 0===o&&(o=p),this._addCallbacks(n,r,i,o,null)},i.prototype._addCallbacks=function(t,e,n,r,i){var o=this._length();if(o>=65531&&(o=0,this._setLength(0)),0===o)this._promise0=n,this._receiver0=r,"function"==typeof t&&(this._fulfillmentHandler0=f.contextBind(i,t)),"function"==typeof e&&(this._rejectionHandler0=f.contextBind(i,e));else{var s=4*o-4;this[s+2]=n,this[s+3]=r,"function"==typeof t&&(this[s+0]=f.contextBind(i,t)),"function"==typeof e&&(this[s+1]=f.contextBind(i,e))}return this._setLength(o+1),o},i.prototype._proxy=function(t,e){this._addCallbacks(void 0,void 0,e,t,null)},i.prototype._resolveCallback=function(t,e){if(0===(117506048&this._bitField)){if(t===this)return this._rejectCallback(c(),!1);var n=R(t,this);if(!(n instanceof i))return this._fulfill(t);e&&this._propagateFrom(n,2);var r=n._target();if(r===this)return void this._reject(c());var o=r._bitField;if(0===(50397184&o)){var s=this._length();s>0&&r._migrateCallback0(this);for(var a=1;s>a;++a)r._migrateCallbackAt(this,a);this._setFollowing(),this._setLength(0),this._setFollowee(n)}else if(0!==(33554432&o))this._fulfill(r._value());else if(0!==(16777216&o))this._reject(r._reason());else{var u=new F("late cancellation observer");r._attachExtraTrace(u),this._reject(u)}}},i.prototype._rejectCallback=function(t,e,n){var r=f.ensureErrorObject(t),i=r===t;if(!i&&!n&&V.warnings()){var o="a promise was rejected with a non-error: "+f.classString(t);this._warn(o,!0)}this._attachExtraTrace(r,e?i:!1),this._reject(t)},i.prototype._resolveFromExecutor=function(t){if(t!==x){var e=this;this._captureStackTrace(),this._pushContext();var n=!0,r=this._execute(t,function(t){e._resolveCallback(t)},function(t){e._rejectCallback(t,n)});n=!1,this._popContext(),void 0!==r&&e._rejectCallback(r,!0)}},i.prototype._settlePromiseFromHandler=function(t,e,n,r){var i=r._bitField;if(0===(65536&i)){r._pushContext();var o;e===T?n&&"number"==typeof n.length?o=N(t).apply(this._boundValue(),n):(o=L,o.e=new E("cannot .spread() a non-array: "+f.classString(n))):o=N(t).call(e,n);var s=r._popContext();i=r._bitField,0===(65536&i)&&(o===P?r._reject(n):o===L?r._rejectCallback(o.e,!1):(V.checkForgottenReturns(o,s,"",r,this),r._resolveCallback(o)))}},i.prototype._target=function(){for(var t=this;t._isFollowing();)t=t._followee();return t},i.prototype._followee=function(){return this._rejectionHandler0},i.prototype._setFollowee=function(t){this._rejectionHandler0=t},i.prototype._settlePromise=function(t,e,r,o){var s=t instanceof i,a=this._bitField,c=0!==(134217728&a);0!==(65536&a)?(s&&t._invokeInternalOnCancel(),r instanceof H&&r.isFinallyHandler()?(r.cancelPromise=t,N(e).call(r,o)===L&&t._reject(L.e)):e===u?t._fulfill(u.call(r)):r instanceof n?r._promiseCancelled(t):s||t instanceof S?t._cancel():r.cancel()):"function"==typeof e?s?(c&&t._setAsyncGuaranteed(),this._settlePromiseFromHandler(e,r,o,t)):e.call(r,o,t):r instanceof n?r._isResolved()||(0!==(33554432&a)?r._promiseFulfilled(o,t):r._promiseRejected(o,t)):s&&(c&&t._setAsyncGuaranteed(),0!==(33554432&a)?t._fulfill(o):t._reject(o))},i.prototype._settlePromiseLateCancellationObserver=function(t){var e=t.handler,n=t.promise,r=t.receiver,o=t.value;"function"==typeof e?n instanceof i?this._settlePromiseFromHandler(e,r,o,n):e.call(r,o,n):n instanceof i&&n._reject(o)},i.prototype._settlePromiseCtx=function(t){this._settlePromise(t.promise,t.handler,t.receiver,t.value)},i.prototype._settlePromise0=function(t,e,n){var r=this._promise0,i=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(r,t,i,e)},i.prototype._clearCallbackDataAtIndex=function(t){var e=4*t-4;this[e+2]=this[e+3]=this[e+0]=this[e+1]=void 0},i.prototype._fulfill=function(t){var e=this._bitField;if(!((117506048&e)>>>16)){if(t===this){var n=c();return this._attachExtraTrace(n),this._reject(n)}this._setFulfilled(),this._rejectionHandler0=t,(65535&e)>0&&(0!==(134217728&e)?this._settlePromises():j.settlePromises(this),this._dereferenceTrace())}},i.prototype._reject=function(t){var e=this._bitField;if(!((117506048&e)>>>16))return this._setRejected(),this._fulfillmentHandler0=t,this._isFinal()?j.fatalError(t,f.isNode):void((65535&e)>0?j.settlePromises(this):this._ensurePossibleRejectionHandled())},i.prototype._fulfillPromises=function(t,e){for(var n=1;t>n;n++){var r=this._fulfillmentHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,e)}},i.prototype._rejectPromises=function(t,e){for(var n=1;t>n;n++){var r=this._rejectionHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,e)}},i.prototype._settlePromises=function(){var t=this._bitField,e=65535&t;if(e>0){if(0!==(16842752&t)){var n=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,n,t),this._rejectPromises(e,n)}else{var r=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,r,t),this._fulfillPromises(e,r)}this._setLength(0)}this._clearCancellationData()},i.prototype._settledValue=function(){var t=this._bitField;return 0!==(33554432&t)?this._rejectionHandler0:0!==(16777216&t)?this._fulfillmentHandler0:void 0},"undefined"!=typeof Symbol&&Symbol.toStringTag&&w.defineProperty(i.prototype,Symbol.toStringTag,{get:function(){return"Object"}}),i.defer=i.pending=function(){V.deprecated("Promise.defer","new Promise");var t=new i(x);return{promise:t,resolve:o,reject:s}},f.notEnumerableProp(i,"_makeSelfResolutionError",c),t("./method")(i,x,R,l,V),t("./bind")(i,x,R,V),t("./cancel")(i,S,l,V),t("./direct_resolve")(i),t("./synchronous_inspection")(i),t("./join")(i,S,R,x,j),i.Promise=i,i.version="3.7.2",t("./call_get.js")(i),t("./generators.js")(i,l,x,R,n,V),t("./map.js")(i,S,l,R,x,V),t("./nodeify.js")(i),t("./promisify.js")(i,x),t("./props.js")(i,S,R,l),t("./race.js")(i,x,R,l),t("./reduce.js")(i,S,l,R,x,V),t("./settle.js")(i,S,V),t("./some.js")(i,S,l),t("./timers.js")(i,x,V),t("./using.js")(i,l,R,A,x,V),t("./any.js")(i),t("./each.js")(i,x),t("./filter.js")(i,x),f.toFastProperties(i),f.toFastProperties(i.prototype),a({a:1}),a({b:2}),a({c:3}),a(1),a(function(){}),a(void 0),a(!1),a(new i(x)),V.setBounds(C.firstLineError,f.lastLineError),i}},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36,async_hooks:void 0}],23:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o){function s(t){switch(t){case-2:return[];case-3:return{};case-6:return new Map}}function a(t){var r=this._promise=new e(n);t instanceof e&&(r._propagateFrom(t,3),t.suppressUnhandledRejections()),r._setOnCancel(this),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var c=t("./util");c.isArray;return c.inherits(a,o),a.prototype.length=function(){return this._length},a.prototype.promise=function(){return this._promise},a.prototype._init=function u(t,n){var o=r(this._values,this._promise);if(o instanceof e){o=o._target();var a=o._bitField;if(this._values=o,0===(50397184&a))return this._promise._setAsyncGuaranteed(),o._then(u,this._reject,void 0,this,n);if(0===(33554432&a))return 0!==(16777216&a)?this._reject(o._reason()):this._cancel();o=o._value()}if(o=c.asArray(o),null===o){var l=i("expecting an array or an iterable object but got "+c.classString(o)).reason();return void this._promise._rejectCallback(l,!1)}return 0===o.length?void(-5===n?this._resolveEmptyArray():this._resolve(s(n))):void this._iterate(o)},a.prototype._iterate=function(t){var n=this.getActualLength(t.length);this._length=n,this._values=this.shouldCopyValues()?new Array(n):this._values;for(var i=this._promise,o=!1,s=null,a=0;n>a;++a){var c=r(t[a],i);c instanceof e?(c=c._target(),s=c._bitField):s=null,o?null!==s&&c.suppressUnhandledRejections():null!==s?0===(50397184&s)?(c._proxy(this,a),this._values[a]=c):o=0!==(33554432&s)?this._promiseFulfilled(c._value(),a):0!==(16777216&s)?this._promiseRejected(c._reason(),a):this._promiseCancelled(a):o=this._promiseFulfilled(c,a)}o||i._setAsyncGuaranteed()},a.prototype._isResolved=function(){return null===this._values},a.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},a.prototype._cancel=function(){!this._isResolved()&&this._promise._isCancellable()&&(this._values=null,this._promise._cancel())},a.prototype._reject=function(t){this._values=null,this._promise._rejectCallback(t,!1)},a.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var n=++this._totalResolved;return n>=this._length?(this._resolve(this._values),!0):!1},a.prototype._promiseCancelled=function(){return this._cancel(),!0},a.prototype._promiseRejected=function(t){return this._totalResolved++,this._reject(t),!0},a.prototype._resultCancelled=function(){if(!this._isResolved()){var t=this._values;if(this._cancel(),t instanceof e)t.cancel();else for(var n=0;nc;c+=2){var l=s[c],p=s[c+1],_=l+e;if(r===E)t[_]=E(l,f,l,p,e,i);else{var d=r(p,function(){return E(l,f,l,p,e,i)});h.notEnumerableProp(d,"__isPromisified__",!0),t[_]=d}}return h.toFastProperties(t),t}function l(t,e,n){return E(t,e,void 0,t,null,n)}var p,f={},h=t("./util"),_=t("./nodeback"),d=h.withAppended,v=h.maybeWrapAsError,y=h.canEvaluate,g=t("./errors").TypeError,m="Async",b={__isPromisified__:!0},w=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],C=new RegExp("^(?:"+w.join("|")+")$"),j=function(t){return h.isIdentifier(t)&&"_"!==t.charAt(0)&&"constructor"!==t},k=function(t){return t.replace(/([$])/,"\\$")},E=y?p:c;e.promisify=function(t,e){if("function"!=typeof t)throw new g("expecting a function but got "+h.classString(t));if(i(t))return t;e=Object(e);var n=void 0===e.context?f:e.context,o=!!e.multiArgs,s=l(t,n,o);return h.copyDescriptors(t,s,r),s},e.promisifyAll=function(t,e){if("function"!=typeof t&&"object"!=typeof t)throw new g("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/MqrFmX\n");e=Object(e);var n=!!e.multiArgs,r=e.suffix;"string"!=typeof r&&(r=m);var i=e.filter;"function"!=typeof i&&(i=j);var o=e.promisifier;if("function"!=typeof o&&(o=E),!h.isIdentifier(r))throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/MqrFmX\n");for(var s=h.inheritedDataKeys(t),a=0;ao;++o){var s=r[o];e[o]=t[s],e[o+i]=s}}this.constructor$(e),this._isMap=n,this._init$(void 0,n?-6:-3)}function s(t){var n,s=r(t);return u(s)?(n=s instanceof e?s._then(e.props,void 0,void 0,void 0,void 0):new o(s).promise(),s instanceof e&&n._propagateFrom(s,2),n):i("cannot await properties of a non-object\n\n See http://goo.gl/MqrFmX\n")}var a,c=t("./util"),u=c.isObject,l=t("./es5");"function"==typeof Map&&(a=Map);var p=function(){function t(t,r){this[e]=t,this[e+n]=r,e++}var e=0,n=0;return function(r){n=r.size,e=0;var i=new Array(2*r.size);return r.forEach(t,i),i}}(),f=function(t){for(var e=new a,n=t.length/2|0,r=0;n>r;++r){var i=t[n+r],o=t[r];e.set(i,o)}return e};c.inherits(o,n),o.prototype._init=function(){},o.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var n=++this._totalResolved;if(n>=this._length){var r;if(this._isMap)r=f(this._values);else{r={};for(var i=this.length(),o=0,s=this.length();s>o;++o)r[this._values[o+i]]=this._values[o]}return this._resolve(r),!0}return!1},o.prototype.shouldCopyValues=function(){return!1},o.prototype.getActualLength=function(t){return t>>1},e.prototype.props=function(){return s(this)},e.props=function(t){return s(t)}}},{"./es5":13,"./util":36}],26:[function(t,e,n){"use strict";function r(t,e,n,r,i){for(var o=0;i>o;++o)n[o+r]=t[o+e],t[o+e]=void 0}function i(t){this._capacity=t,this._length=0,this._front=0}i.prototype._willBeOverCapacity=function(t){return this._capacityf;++f){var _=t[f];(void 0!==_||f in t)&&e.cast(_)._then(l,p,void 0,u,null)}return u}var s=t("./util"),a=function(t){return t.then(function(e){return o(e,t)})};e.race=function(t){return o(t,void 0)},e.prototype.race=function(){return o(this,void 0)}}},{"./util":36}],28:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){function a(t,n,r,i){this.constructor$(t);var s=e._getContext();this._fn=f.contextBind(s,n),void 0!==r&&(r=e.resolve(r),r._attachCancellationCallback(this)),this._initialValue=r,this._currentCancellable=null,i===o?this._eachValues=Array(this._length):0===i?this._eachValues=null:this._eachValues=void 0,this._promise._captureStackTrace(),this._init$(void 0,-5)}function c(t,e){this.isFulfilled()?e._resolve(t):e._reject(t)}function u(t,e,n,i){if("function"!=typeof e)return r("expecting a function but got "+f.classString(e));var o=new a(t,e,n,i);return o.promise()}function l(t){this.accum=t,this.array._gotAccum(t);var n=i(this.value,this.array._promise);return n instanceof e?(this.array._currentCancellable=n,n._then(p,void 0,void 0,this,void 0)):p.call(this,n)}function p(t){var n=this.array,r=n._promise,i=h(n._fn);r._pushContext();var o;o=void 0!==n._eachValues?i.call(r._boundValue(),t,this.index,this.length):i.call(r._boundValue(),this.accum,t,this.index,this.length),o instanceof e&&(n._currentCancellable=o);var a=r._popContext();return s.checkForgottenReturns(o,a,void 0!==n._eachValues?"Promise.each":"Promise.reduce",r),o}var f=t("./util"),h=f.tryCatch;f.inherits(a,n),a.prototype._gotAccum=function(t){void 0!==this._eachValues&&null!==this._eachValues&&t!==o&&this._eachValues.push(t)},a.prototype._eachComplete=function(t){return null!==this._eachValues&&this._eachValues.push(t),this._eachValues},a.prototype._init=function(){},a.prototype._resolveEmptyArray=function(){this._resolve(void 0!==this._eachValues?this._eachValues:this._initialValue)},a.prototype.shouldCopyValues=function(){return!1},a.prototype._resolve=function(t){this._promise._resolveCallback(t),this._values=null},a.prototype._resultCancelled=function(t){return t===this._initialValue?this._cancel():void(this._isResolved()||(this._resultCancelled$(),this._currentCancellable instanceof e&&this._currentCancellable.cancel(),this._initialValue instanceof e&&this._initialValue.cancel()))},a.prototype._iterate=function(t){this._values=t;var n,r,i=t.length;void 0!==this._initialValue?(n=this._initialValue,r=0):(n=e.resolve(t[0]),r=1),this._currentCancellable=n;for(var o=r;i>o;++o){var s=t[o];s instanceof e&&s.suppressUnhandledRejections()}if(!n.isRejected())for(;i>r;++r){var a={accum:null,value:t[r],index:r,length:i,array:this};n=n._then(l,void 0,void 0,a,void 0),0===(127&r)&&n._setNoAsyncGuarantee()}void 0!==this._eachValues&&(n=n._then(this._eachComplete,void 0,void 0,this,void 0)),n._then(c,c,void 0,n,this)},e.prototype.reduce=function(t,e){return u(this,t,e,null)},e.reduce=function(t,e,n,r){return u(t,e,n,r)}}},{"./util":36}],29:[function(t,e,n){"use strict";var r,i=t("./util"),o=function(){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")},s=i.getNativePromise();if(i.isNode&&"undefined"==typeof MutationObserver){var a=global.setImmediate,c=process.nextTick;r=i.isRecentNode?function(t){a.call(global,t)}:function(t){c.call(process,t)}}else if("function"==typeof s&&"function"==typeof s.resolve){ +var u=s.resolve();r=function(t){u.then(t)}}else r="undefined"!=typeof MutationObserver&&("undefined"==typeof window||!window.navigator||!window.navigator.standalone&&!window.cordova)&&"classList"in document.documentElement?function(){var t=document.createElement("div"),e={attributes:!0},n=!1,r=document.createElement("div"),i=new MutationObserver(function(){t.classList.toggle("foo"),n=!1});i.observe(r,e);var o=function(){n||(n=!0,r.classList.toggle("foo"))};return function(n){var r=new MutationObserver(function(){r.disconnect(),n()});r.observe(t,e),o()}}():"undefined"!=typeof setImmediate?function(t){setImmediate(t)}:"undefined"!=typeof setTimeout?function(t){setTimeout(t,0)}:o;e.exports=r},{"./util":36}],30:[function(t,e,n){"use strict";e.exports=function(e,n,r){function i(t){this.constructor$(t)}var o=e.PromiseInspection,s=t("./util");s.inherits(i,n),i.prototype._promiseResolved=function(t,e){this._values[t]=e;var n=++this._totalResolved;return n>=this._length?(this._resolve(this._values),!0):!1},i.prototype._promiseFulfilled=function(t,e){var n=new o;return n._bitField=33554432,n._settledValueField=t,this._promiseResolved(e,n)},i.prototype._promiseRejected=function(t,e){var n=new o;return n._bitField=16777216,n._settledValueField=t,this._promiseResolved(e,n)},e.settle=function(t){return r.deprecated(".settle()",".reflect()"),new i(t).promise()},e.allSettled=function(t){return new i(t).promise()},e.prototype.settle=function(){return e.settle(this)}}},{"./util":36}],31:[function(t,e,n){"use strict";e.exports=function(e,n,r){function i(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function o(t,e){if((0|e)!==e||0>e)return r("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var n=new i(t),o=n.promise();return n.setHowMany(e),n.init(),o}var s=t("./util"),a=t("./errors").RangeError,c=t("./errors").AggregateError,u=s.isArray,l={};s.inherits(i,n),i.prototype._init=function(){if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var t=u(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},i.prototype.init=function(){this._initialized=!0,this._init()},i.prototype.setUnwrap=function(){this._unwrap=!0},i.prototype.howMany=function(){return this._howMany},i.prototype.setHowMany=function(t){this._howMany=t},i.prototype._promiseFulfilled=function(t){return this._addFulfilled(t),this._fulfilled()===this.howMany()?(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0):!1},i.prototype._promiseRejected=function(t){return this._addRejected(t),this._checkOutcome()},i.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(l),this._checkOutcome())},i.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var t=new c,e=this.length();e0?this._reject(t):this._cancel(),!0}return!1},i.prototype._fulfilled=function(){return this._totalResolved},i.prototype._rejected=function(){return this._values.length-this.length()},i.prototype._addRejected=function(t){this._values.push(t)},i.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},i.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},i.prototype._getRangeError=function(t){var e="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";return new a(e)},i.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(t,e){return o(t,e)},e.prototype.some=function(t){return o(this,t)},e._SomePromiseArray=i}},{"./errors":12,"./util":36}],32:[function(t,e,n){"use strict";e.exports=function(t){function e(t){void 0!==t?(t=t._target(),this._bitField=t._bitField,this._settledValueField=t._isFateSealed()?t._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}e.prototype._settledValue=function(){return this._settledValueField};var n=e.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},r=e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},i=e.prototype.isFulfilled=function(){return 0!==(33554432&this._bitField)},o=e.prototype.isRejected=function(){return 0!==(16777216&this._bitField)},s=e.prototype.isPending=function(){return 0===(50397184&this._bitField)},a=e.prototype.isResolved=function(){return 0!==(50331648&this._bitField)};e.prototype.isCancelled=function(){return 0!==(8454144&this._bitField)},t.prototype.__isCancelled=function(){return 65536===(65536&this._bitField)},t.prototype._isCancelled=function(){return this._target().__isCancelled()},t.prototype.isCancelled=function(){return 0!==(8454144&this._target()._bitField)},t.prototype.isPending=function(){return s.call(this._target())},t.prototype.isRejected=function(){return o.call(this._target())},t.prototype.isFulfilled=function(){return i.call(this._target())},t.prototype.isResolved=function(){return a.call(this._target())},t.prototype.value=function(){return n.call(this._target())},t.prototype.reason=function(){var t=this._target();return t._unsetRejectionIsUnhandled(),r.call(t)},t.prototype._value=function(){return this._settledValue()},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},t.PromiseInspection=e}},{}],33:[function(t,e,n){"use strict";e.exports=function(e,n){function r(t,r){if(l(t)){if(t instanceof e)return t;var i=o(t);if(i===u){r&&r._pushContext();var c=e.reject(i.e);return r&&r._popContext(),c}if("function"==typeof i){if(s(t)){var c=new e(n);return t._then(c._fulfill,c._reject,void 0,c,null),c}return a(t,i,r)}}return t}function i(t){return t.then}function o(t){try{return i(t)}catch(e){return u.e=e,u}}function s(t){try{return p.call(t,"_promise0")}catch(e){return!1}}function a(t,r,i){function o(t){a&&(a._resolveCallback(t),a=null)}function s(t){a&&(a._rejectCallback(t,p,!0),a=null)}var a=new e(n),l=a;i&&i._pushContext(),a._captureStackTrace(),i&&i._popContext();var p=!0,f=c.tryCatch(r).call(t,o,s);return p=!1,a&&f===u&&(a._rejectCallback(f.e,!0,!0),a=null),l}var c=t("./util"),u=c.errorObj,l=c.isObject,p={}.hasOwnProperty;return r}},{"./util":36}],34:[function(t,e,n){"use strict";e.exports=function(e,n,r){function i(t){this.handle=t}function o(t){return clearTimeout(this.handle),t}function s(t){throw clearTimeout(this.handle),t}var a=t("./util"),c=e.TimeoutError;i.prototype._resultCancelled=function(){clearTimeout(this.handle)};var u=function(t){return l(+this).thenReturn(t)},l=e.delay=function(t,o){var s,a;return void 0!==o?(s=e.resolve(o)._then(u,null,null,t,void 0),r.cancellation()&&o instanceof e&&s._setOnCancel(o)):(s=new e(n),a=setTimeout(function(){s._fulfill()},+t),r.cancellation()&&s._setOnCancel(new i(a)),s._captureStackTrace()),s._setAsyncGuaranteed(),s};e.prototype.delay=function(t){return l(t,this)};var p=function(t,e,n){var r;r="string"!=typeof e?e instanceof Error?e:new c("operation timed out"):new c(e),a.markAsOriginatingFromRejection(r),t._attachExtraTrace(r),t._reject(r),null!=n&&n.cancel()};e.prototype.timeout=function(t,e){t=+t;var n,a,c=new i(setTimeout(function(){n.isPending()&&p(n,e,a)},t));return r.cancellation()?(a=this.then(),n=a._then(o,s,void 0,c,void 0),n._setOnCancel(c)):n=this._then(o,s,void 0,c,void 0),n}}},{"./util":36}],35:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){function a(t){setTimeout(function(){throw t},0)}function c(t){var e=r(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}function u(t,n){function i(){if(s>=u)return l._fulfill();var o=c(t[s++]);if(o instanceof e&&o._isDisposable()){try{o=r(o._getDisposer().tryDispose(n),t.promise)}catch(p){return a(p)}if(o instanceof e)return o._then(i,a,null,null,null)}i()}var s=0,u=t.length,l=new e(o);return i(),l}function l(t,e,n){this._data=t,this._promise=e,this._context=n}function p(t,e,n){this.constructor$(t,e,n)}function f(t){return l.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}function h(t){this.length=t,this.promise=null,this[t-1]=null}var _=t("./util"),d=t("./errors").TypeError,v=t("./util").inherits,y=_.errorObj,g=_.tryCatch,m={};l.prototype.data=function(){return this._data},l.prototype.promise=function(){return this._promise},l.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():m},l.prototype.tryDispose=function(t){var e=this.resource(),n=this._context;void 0!==n&&n._pushContext();var r=e!==m?this.doDispose(e,t):null;return void 0!==n&&n._popContext(),this._promise._unsetDisposable(),this._data=null,r},l.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},v(p,l),p.prototype.doDispose=function(t,e){var n=this.data();return n.call(t,t,e)},h.prototype._resultCancelled=function(){for(var t=this.length,n=0;t>n;++n){var r=this[n];r instanceof e&&r.cancel()}},e.using=function(){var t=arguments.length;if(2>t)return n("you must pass at least 2 arguments to Promise.using");var i=arguments[t-1];if("function"!=typeof i)return n("expecting a function but got "+_.classString(i));var o,a=!0;2===t&&Array.isArray(arguments[0])?(o=arguments[0],t=o.length,a=!1):(o=arguments,t--);for(var c=new h(t),p=0;t>p;++p){var d=o[p];if(l.isDisposer(d)){var v=d;d=d.promise(),d._setDisposable(v)}else{var m=r(d);m instanceof e&&(d=m._then(f,null,null,{resources:c,index:p},void 0))}c[p]=d}for(var b=new Array(c.length),p=0;p0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},e.prototype.disposer=function(t){if("function"==typeof t)return new p(t,this,i());throw new d}}},{"./errors":12,"./util":36}],36:[function(t,e,n){"use strict";function r(){try{var t=P;return P=null,t.apply(this,arguments)}catch(e){return T.e=e,T}}function i(t){return P=t,r}function o(t){return null==t||t===!0||t===!1||"string"==typeof t||"number"==typeof t}function s(t){return"function"==typeof t||"object"==typeof t&&null!==t}function a(t){return o(t)?new Error(v(t)):t}function c(t,e){var n,r=t.length,i=new Array(r+1);for(n=0;r>n;++n)i[n]=t[n];return i[n]=e,i}function u(t,e,n){if(!F.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var r=Object.getOwnPropertyDescriptor(t,e);return null!=r?null==r.get&&null==r.set?r.value:n:void 0}function l(t,e,n){if(o(t))return t;var r={value:n,configurable:!0,enumerable:!1,writable:!0};return F.defineProperty(t,e,r),t}function p(t){throw t}function f(t){try{if("function"==typeof t){var e=F.names(t.prototype),n=F.isES5&&e.length>1,r=e.length>0&&!(1===e.length&&"constructor"===e[0]),i=A.test(t+"")&&F.names(t).length>0;if(n||r||i)return!0}return!1}catch(o){return!1}}function h(t){function e(){}function n(){return typeof r.foo}e.prototype=t;var r=new e;return n(),n(),t}function _(t){return V.test(t)}function d(t,e,n){for(var r=new Array(t),i=0;t>i;++i)r[i]=e+i+n;return r}function v(t){try{return t+""}catch(e){return"[no string representation]"}}function y(t){return t instanceof Error||null!==t&&"object"==typeof t&&"string"==typeof t.message&&"string"==typeof t.name}function g(t){try{l(t,"isOperational",!0)}catch(e){}}function m(t){return null==t?!1:t instanceof Error.__BluebirdErrorTypes__.OperationalError||t.isOperational===!0}function b(t){return y(t)&&F.propertyIsWritable(t,"stack")}function w(t){return{}.toString.call(t)}function C(t,e,n){for(var r=F.names(t),i=0;i10||t[0]>0}(),B.nodeSupportsAsyncResource=B.isNode&&function(){var e=!1;try{var n=t("async_hooks").AsyncResource;e="function"==typeof n.prototype.runInAsyncScope}catch(r){e=!1}return e}(),B.isNode&&B.toFastProperties(process);try{throw new Error}catch(M){B.lastLineError=M}e.exports=B},{"./es5":13,async_hooks:void 0}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise); \ No newline at end of file diff --git a/publisher/node_modules/bluebird/js/release/any.js b/publisher/node_modules/bluebird/js/release/any.js new file mode 100644 index 00000000..05a6228e --- /dev/null +++ b/publisher/node_modules/bluebird/js/release/any.js @@ -0,0 +1,21 @@ +"use strict"; +module.exports = function(Promise) { +var SomePromiseArray = Promise._SomePromiseArray; +function any(promises) { + var ret = new SomePromiseArray(promises); + var promise = ret.promise(); + ret.setHowMany(1); + ret.setUnwrap(); + ret.init(); + return promise; +} + +Promise.any = function (promises) { + return any(promises); +}; + +Promise.prototype.any = function () { + return any(this); +}; + +}; diff --git a/publisher/node_modules/bluebird/js/release/assert.js b/publisher/node_modules/bluebird/js/release/assert.js new file mode 100644 index 00000000..4518231a --- /dev/null +++ b/publisher/node_modules/bluebird/js/release/assert.js @@ -0,0 +1,55 @@ +"use strict"; +module.exports = (function(){ +var AssertionError = (function() { + function AssertionError(a) { + this.constructor$(a); + this.message = a; + this.name = "AssertionError"; + } + AssertionError.prototype = new Error(); + AssertionError.prototype.constructor = AssertionError; + AssertionError.prototype.constructor$ = Error; + return AssertionError; +})(); + +function getParams(args) { + var params = []; + for (var i = 0; i < args.length; ++i) params.push("arg" + i); + return params; +} + +function nativeAssert(callName, args, expect) { + try { + var params = getParams(args); + var constructorArgs = params; + constructorArgs.push("return " + + callName + "("+ params.join(",") + ");"); + var fn = Function.apply(null, constructorArgs); + return fn.apply(null, args); + } catch (e) { + if (!(e instanceof SyntaxError)) { + throw e; + } else { + return expect; + } + } +} + +return function assert(boolExpr, message) { + if (boolExpr === true) return; + + if (typeof boolExpr === "string" && + boolExpr.charAt(0) === "%") { + var nativeCallName = boolExpr; + var $_len = arguments.length;var args = new Array(Math.max($_len - 2, 0)); for(var $_i = 2; $_i < $_len; ++$_i) {args[$_i - 2] = arguments[$_i];}; + if (nativeAssert(nativeCallName, args, message) === message) return; + message = (nativeCallName + " !== " + message); + } + + var ret = new AssertionError(message); + if (Error.captureStackTrace) { + Error.captureStackTrace(ret, assert); + } + throw ret; +}; +})(); diff --git a/publisher/node_modules/bluebird/js/release/async.js b/publisher/node_modules/bluebird/js/release/async.js new file mode 100644 index 00000000..8eab6f88 --- /dev/null +++ b/publisher/node_modules/bluebird/js/release/async.js @@ -0,0 +1,120 @@ +"use strict"; +var firstLineError; +try {throw new Error(); } catch (e) {firstLineError = e;} +var schedule = require("./schedule"); +var Queue = require("./queue"); + +function Async() { + this._customScheduler = false; + this._isTickUsed = false; + this._lateQueue = new Queue(16); + this._normalQueue = new Queue(16); + this._haveDrainedQueues = false; + var self = this; + this.drainQueues = function () { + self._drainQueues(); + }; + this._schedule = schedule; +} + +Async.prototype.setScheduler = function(fn) { + var prev = this._schedule; + this._schedule = fn; + this._customScheduler = true; + return prev; +}; + +Async.prototype.hasCustomScheduler = function() { + return this._customScheduler; +}; + +Async.prototype.haveItemsQueued = function () { + return this._isTickUsed || this._haveDrainedQueues; +}; + + +Async.prototype.fatalError = function(e, isNode) { + if (isNode) { + process.stderr.write("Fatal " + (e instanceof Error ? e.stack : e) + + "\n"); + process.exit(2); + } else { + this.throwLater(e); + } +}; + +Async.prototype.throwLater = function(fn, arg) { + if (arguments.length === 1) { + arg = fn; + fn = function () { throw arg; }; + } + if (typeof setTimeout !== "undefined") { + setTimeout(function() { + fn(arg); + }, 0); + } else try { + this._schedule(function() { + fn(arg); + }); + } catch (e) { + throw new Error("No async scheduler available\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } +}; + +function AsyncInvokeLater(fn, receiver, arg) { + this._lateQueue.push(fn, receiver, arg); + this._queueTick(); +} + +function AsyncInvoke(fn, receiver, arg) { + this._normalQueue.push(fn, receiver, arg); + this._queueTick(); +} + +function AsyncSettlePromises(promise) { + this._normalQueue._pushOne(promise); + this._queueTick(); +} + +Async.prototype.invokeLater = AsyncInvokeLater; +Async.prototype.invoke = AsyncInvoke; +Async.prototype.settlePromises = AsyncSettlePromises; + + +function _drainQueue(queue) { + while (queue.length() > 0) { + _drainQueueStep(queue); + } +} + +function _drainQueueStep(queue) { + var fn = queue.shift(); + if (typeof fn !== "function") { + fn._settlePromises(); + } else { + var receiver = queue.shift(); + var arg = queue.shift(); + fn.call(receiver, arg); + } +} + +Async.prototype._drainQueues = function () { + _drainQueue(this._normalQueue); + this._reset(); + this._haveDrainedQueues = true; + _drainQueue(this._lateQueue); +}; + +Async.prototype._queueTick = function () { + if (!this._isTickUsed) { + this._isTickUsed = true; + this._schedule(this.drainQueues); + } +}; + +Async.prototype._reset = function () { + this._isTickUsed = false; +}; + +module.exports = Async; +module.exports.firstLineError = firstLineError; diff --git a/publisher/node_modules/bluebird/js/release/bind.js b/publisher/node_modules/bluebird/js/release/bind.js new file mode 100644 index 00000000..fc3379db --- /dev/null +++ b/publisher/node_modules/bluebird/js/release/bind.js @@ -0,0 +1,67 @@ +"use strict"; +module.exports = function(Promise, INTERNAL, tryConvertToPromise, debug) { +var calledBind = false; +var rejectThis = function(_, e) { + this._reject(e); +}; + +var targetRejected = function(e, context) { + context.promiseRejectionQueued = true; + context.bindingPromise._then(rejectThis, rejectThis, null, this, e); +}; + +var bindingResolved = function(thisArg, context) { + if (((this._bitField & 50397184) === 0)) { + this._resolveCallback(context.target); + } +}; + +var bindingRejected = function(e, context) { + if (!context.promiseRejectionQueued) this._reject(e); +}; + +Promise.prototype.bind = function (thisArg) { + if (!calledBind) { + calledBind = true; + Promise.prototype._propagateFrom = debug.propagateFromFunction(); + Promise.prototype._boundValue = debug.boundValueFunction(); + } + var maybePromise = tryConvertToPromise(thisArg); + var ret = new Promise(INTERNAL); + ret._propagateFrom(this, 1); + var target = this._target(); + ret._setBoundTo(maybePromise); + if (maybePromise instanceof Promise) { + var context = { + promiseRejectionQueued: false, + promise: ret, + target: target, + bindingPromise: maybePromise + }; + target._then(INTERNAL, targetRejected, undefined, ret, context); + maybePromise._then( + bindingResolved, bindingRejected, undefined, ret, context); + ret._setOnCancel(maybePromise); + } else { + ret._resolveCallback(target); + } + return ret; +}; + +Promise.prototype._setBoundTo = function (obj) { + if (obj !== undefined) { + this._bitField = this._bitField | 2097152; + this._boundTo = obj; + } else { + this._bitField = this._bitField & (~2097152); + } +}; + +Promise.prototype._isBound = function () { + return (this._bitField & 2097152) === 2097152; +}; + +Promise.bind = function (thisArg, value) { + return Promise.resolve(value).bind(thisArg); +}; +}; diff --git a/publisher/node_modules/bluebird/js/release/bluebird.js b/publisher/node_modules/bluebird/js/release/bluebird.js new file mode 100644 index 00000000..1c36cf36 --- /dev/null +++ b/publisher/node_modules/bluebird/js/release/bluebird.js @@ -0,0 +1,11 @@ +"use strict"; +var old; +if (typeof Promise !== "undefined") old = Promise; +function noConflict() { + try { if (Promise === bluebird) Promise = old; } + catch (e) {} + return bluebird; +} +var bluebird = require("./promise")(); +bluebird.noConflict = noConflict; +module.exports = bluebird; diff --git a/publisher/node_modules/bluebird/js/release/call_get.js b/publisher/node_modules/bluebird/js/release/call_get.js new file mode 100644 index 00000000..0ed7714a --- /dev/null +++ b/publisher/node_modules/bluebird/js/release/call_get.js @@ -0,0 +1,123 @@ +"use strict"; +var cr = Object.create; +if (cr) { + var callerCache = cr(null); + var getterCache = cr(null); + callerCache[" size"] = getterCache[" size"] = 0; +} + +module.exports = function(Promise) { +var util = require("./util"); +var canEvaluate = util.canEvaluate; +var isIdentifier = util.isIdentifier; + +var getMethodCaller; +var getGetter; +if (!false) { +var makeMethodCaller = function (methodName) { + return new Function("ensureMethod", " \n\ + return function(obj) { \n\ + 'use strict' \n\ + var len = this.length; \n\ + ensureMethod(obj, 'methodName'); \n\ + switch(len) { \n\ + case 1: return obj.methodName(this[0]); \n\ + case 2: return obj.methodName(this[0], this[1]); \n\ + case 3: return obj.methodName(this[0], this[1], this[2]); \n\ + case 0: return obj.methodName(); \n\ + default: \n\ + return obj.methodName.apply(obj, this); \n\ + } \n\ + }; \n\ + ".replace(/methodName/g, methodName))(ensureMethod); +}; + +var makeGetter = function (propertyName) { + return new Function("obj", " \n\ + 'use strict'; \n\ + return obj.propertyName; \n\ + ".replace("propertyName", propertyName)); +}; + +var getCompiled = function(name, compiler, cache) { + var ret = cache[name]; + if (typeof ret !== "function") { + if (!isIdentifier(name)) { + return null; + } + ret = compiler(name); + cache[name] = ret; + cache[" size"]++; + if (cache[" size"] > 512) { + var keys = Object.keys(cache); + for (var i = 0; i < 256; ++i) delete cache[keys[i]]; + cache[" size"] = keys.length - 256; + } + } + return ret; +}; + +getMethodCaller = function(name) { + return getCompiled(name, makeMethodCaller, callerCache); +}; + +getGetter = function(name) { + return getCompiled(name, makeGetter, getterCache); +}; +} + +function ensureMethod(obj, methodName) { + var fn; + if (obj != null) fn = obj[methodName]; + if (typeof fn !== "function") { + var message = "Object " + util.classString(obj) + " has no method '" + + util.toString(methodName) + "'"; + throw new Promise.TypeError(message); + } + return fn; +} + +function caller(obj) { + var methodName = this.pop(); + var fn = ensureMethod(obj, methodName); + return fn.apply(obj, this); +} +Promise.prototype.call = function (methodName) { + var $_len = arguments.length;var args = new Array(Math.max($_len - 1, 0)); for(var $_i = 1; $_i < $_len; ++$_i) {args[$_i - 1] = arguments[$_i];}; + if (!false) { + if (canEvaluate) { + var maybeCaller = getMethodCaller(methodName); + if (maybeCaller !== null) { + return this._then( + maybeCaller, undefined, undefined, args, undefined); + } + } + } + args.push(methodName); + return this._then(caller, undefined, undefined, args, undefined); +}; + +function namedGetter(obj) { + return obj[this]; +} +function indexedGetter(obj) { + var index = +this; + if (index < 0) index = Math.max(0, index + obj.length); + return obj[index]; +} +Promise.prototype.get = function (propertyName) { + var isIndex = (typeof propertyName === "number"); + var getter; + if (!isIndex) { + if (canEvaluate) { + var maybeGetter = getGetter(propertyName); + getter = maybeGetter !== null ? maybeGetter : namedGetter; + } else { + getter = namedGetter; + } + } else { + getter = indexedGetter; + } + return this._then(getter, undefined, undefined, propertyName, undefined); +}; +}; diff --git a/publisher/node_modules/bluebird/js/release/cancel.js b/publisher/node_modules/bluebird/js/release/cancel.js new file mode 100644 index 00000000..7a12415e --- /dev/null +++ b/publisher/node_modules/bluebird/js/release/cancel.js @@ -0,0 +1,129 @@ +"use strict"; +module.exports = function(Promise, PromiseArray, apiRejection, debug) { +var util = require("./util"); +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; +var async = Promise._async; + +Promise.prototype["break"] = Promise.prototype.cancel = function() { + if (!debug.cancellation()) return this._warn("cancellation is disabled"); + + var promise = this; + var child = promise; + while (promise._isCancellable()) { + if (!promise._cancelBy(child)) { + if (child._isFollowing()) { + child._followee().cancel(); + } else { + child._cancelBranched(); + } + break; + } + + var parent = promise._cancellationParent; + if (parent == null || !parent._isCancellable()) { + if (promise._isFollowing()) { + promise._followee().cancel(); + } else { + promise._cancelBranched(); + } + break; + } else { + if (promise._isFollowing()) promise._followee().cancel(); + promise._setWillBeCancelled(); + child = promise; + promise = parent; + } + } +}; + +Promise.prototype._branchHasCancelled = function() { + this._branchesRemainingToCancel--; +}; + +Promise.prototype._enoughBranchesHaveCancelled = function() { + return this._branchesRemainingToCancel === undefined || + this._branchesRemainingToCancel <= 0; +}; + +Promise.prototype._cancelBy = function(canceller) { + if (canceller === this) { + this._branchesRemainingToCancel = 0; + this._invokeOnCancel(); + return true; + } else { + this._branchHasCancelled(); + if (this._enoughBranchesHaveCancelled()) { + this._invokeOnCancel(); + return true; + } + } + return false; +}; + +Promise.prototype._cancelBranched = function() { + if (this._enoughBranchesHaveCancelled()) { + this._cancel(); + } +}; + +Promise.prototype._cancel = function() { + if (!this._isCancellable()) return; + this._setCancelled(); + async.invoke(this._cancelPromises, this, undefined); +}; + +Promise.prototype._cancelPromises = function() { + if (this._length() > 0) this._settlePromises(); +}; + +Promise.prototype._unsetOnCancel = function() { + this._onCancelField = undefined; +}; + +Promise.prototype._isCancellable = function() { + return this.isPending() && !this._isCancelled(); +}; + +Promise.prototype.isCancellable = function() { + return this.isPending() && !this.isCancelled(); +}; + +Promise.prototype._doInvokeOnCancel = function(onCancelCallback, internalOnly) { + if (util.isArray(onCancelCallback)) { + for (var i = 0; i < onCancelCallback.length; ++i) { + this._doInvokeOnCancel(onCancelCallback[i], internalOnly); + } + } else if (onCancelCallback !== undefined) { + if (typeof onCancelCallback === "function") { + if (!internalOnly) { + var e = tryCatch(onCancelCallback).call(this._boundValue()); + if (e === errorObj) { + this._attachExtraTrace(e.e); + async.throwLater(e.e); + } + } + } else { + onCancelCallback._resultCancelled(this); + } + } +}; + +Promise.prototype._invokeOnCancel = function() { + var onCancelCallback = this._onCancel(); + this._unsetOnCancel(); + async.invoke(this._doInvokeOnCancel, this, onCancelCallback); +}; + +Promise.prototype._invokeInternalOnCancel = function() { + if (this._isCancellable()) { + this._doInvokeOnCancel(this._onCancel(), true); + this._unsetOnCancel(); + } +}; + +Promise.prototype._resultCancelled = function() { + this.cancel(); +}; + +}; diff --git a/publisher/node_modules/bluebird/js/release/catch_filter.js b/publisher/node_modules/bluebird/js/release/catch_filter.js new file mode 100644 index 00000000..0f24ce23 --- /dev/null +++ b/publisher/node_modules/bluebird/js/release/catch_filter.js @@ -0,0 +1,42 @@ +"use strict"; +module.exports = function(NEXT_FILTER) { +var util = require("./util"); +var getKeys = require("./es5").keys; +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; + +function catchFilter(instances, cb, promise) { + return function(e) { + var boundTo = promise._boundValue(); + predicateLoop: for (var i = 0; i < instances.length; ++i) { + var item = instances[i]; + + if (item === Error || + (item != null && item.prototype instanceof Error)) { + if (e instanceof item) { + return tryCatch(cb).call(boundTo, e); + } + } else if (typeof item === "function") { + var matchesPredicate = tryCatch(item).call(boundTo, e); + if (matchesPredicate === errorObj) { + return matchesPredicate; + } else if (matchesPredicate) { + return tryCatch(cb).call(boundTo, e); + } + } else if (util.isObject(e)) { + var keys = getKeys(item); + for (var j = 0; j < keys.length; ++j) { + var key = keys[j]; + if (item[key] != e[key]) { + continue predicateLoop; + } + } + return tryCatch(cb).call(boundTo, e); + } + } + return NEXT_FILTER; + }; +} + +return catchFilter; +}; diff --git a/publisher/node_modules/bluebird/js/release/context.js b/publisher/node_modules/bluebird/js/release/context.js new file mode 100644 index 00000000..c307414f --- /dev/null +++ b/publisher/node_modules/bluebird/js/release/context.js @@ -0,0 +1,69 @@ +"use strict"; +module.exports = function(Promise) { +var longStackTraces = false; +var contextStack = []; + +Promise.prototype._promiseCreated = function() {}; +Promise.prototype._pushContext = function() {}; +Promise.prototype._popContext = function() {return null;}; +Promise._peekContext = Promise.prototype._peekContext = function() {}; + +function Context() { + this._trace = new Context.CapturedTrace(peekContext()); +} +Context.prototype._pushContext = function () { + if (this._trace !== undefined) { + this._trace._promiseCreated = null; + contextStack.push(this._trace); + } +}; + +Context.prototype._popContext = function () { + if (this._trace !== undefined) { + var trace = contextStack.pop(); + var ret = trace._promiseCreated; + trace._promiseCreated = null; + return ret; + } + return null; +}; + +function createContext() { + if (longStackTraces) return new Context(); +} + +function peekContext() { + var lastIndex = contextStack.length - 1; + if (lastIndex >= 0) { + return contextStack[lastIndex]; + } + return undefined; +} +Context.CapturedTrace = null; +Context.create = createContext; +Context.deactivateLongStackTraces = function() {}; +Context.activateLongStackTraces = function() { + var Promise_pushContext = Promise.prototype._pushContext; + var Promise_popContext = Promise.prototype._popContext; + var Promise_PeekContext = Promise._peekContext; + var Promise_peekContext = Promise.prototype._peekContext; + var Promise_promiseCreated = Promise.prototype._promiseCreated; + Context.deactivateLongStackTraces = function() { + Promise.prototype._pushContext = Promise_pushContext; + Promise.prototype._popContext = Promise_popContext; + Promise._peekContext = Promise_PeekContext; + Promise.prototype._peekContext = Promise_peekContext; + Promise.prototype._promiseCreated = Promise_promiseCreated; + longStackTraces = false; + }; + longStackTraces = true; + Promise.prototype._pushContext = Context.prototype._pushContext; + Promise.prototype._popContext = Context.prototype._popContext; + Promise._peekContext = Promise.prototype._peekContext = peekContext; + Promise.prototype._promiseCreated = function() { + var ctx = this._peekContext(); + if (ctx && ctx._promiseCreated == null) ctx._promiseCreated = this; + }; +}; +return Context; +}; diff --git a/publisher/node_modules/bluebird/js/release/debuggability.js b/publisher/node_modules/bluebird/js/release/debuggability.js new file mode 100644 index 00000000..ce997eeb --- /dev/null +++ b/publisher/node_modules/bluebird/js/release/debuggability.js @@ -0,0 +1,1009 @@ +"use strict"; +module.exports = function(Promise, Context, + enableAsyncHooks, disableAsyncHooks) { +var async = Promise._async; +var Warning = require("./errors").Warning; +var util = require("./util"); +var es5 = require("./es5"); +var canAttachTrace = util.canAttachTrace; +var unhandledRejectionHandled; +var possiblyUnhandledRejection; +var bluebirdFramePattern = + /[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/; +var nodeFramePattern = /\((?:timers\.js):\d+:\d+\)/; +var parseLinePattern = /[\/<\(](.+?):(\d+):(\d+)\)?\s*$/; +var stackFramePattern = null; +var formatStack = null; +var indentStackFrames = false; +var printWarning; +var debugging = !!(util.env("BLUEBIRD_DEBUG") != 0 && + (false || + util.env("BLUEBIRD_DEBUG") || + util.env("NODE_ENV") === "development")); + +var warnings = !!(util.env("BLUEBIRD_WARNINGS") != 0 && + (debugging || util.env("BLUEBIRD_WARNINGS"))); + +var longStackTraces = !!(util.env("BLUEBIRD_LONG_STACK_TRACES") != 0 && + (debugging || util.env("BLUEBIRD_LONG_STACK_TRACES"))); + +var wForgottenReturn = util.env("BLUEBIRD_W_FORGOTTEN_RETURN") != 0 && + (warnings || !!util.env("BLUEBIRD_W_FORGOTTEN_RETURN")); + +var deferUnhandledRejectionCheck; +(function() { + var promises = []; + + function unhandledRejectionCheck() { + for (var i = 0; i < promises.length; ++i) { + promises[i]._notifyUnhandledRejection(); + } + unhandledRejectionClear(); + } + + function unhandledRejectionClear() { + promises.length = 0; + } + + deferUnhandledRejectionCheck = function(promise) { + promises.push(promise); + setTimeout(unhandledRejectionCheck, 1); + }; + + es5.defineProperty(Promise, "_unhandledRejectionCheck", { + value: unhandledRejectionCheck + }); + es5.defineProperty(Promise, "_unhandledRejectionClear", { + value: unhandledRejectionClear + }); +})(); + +Promise.prototype.suppressUnhandledRejections = function() { + var target = this._target(); + target._bitField = ((target._bitField & (~1048576)) | + 524288); +}; + +Promise.prototype._ensurePossibleRejectionHandled = function () { + if ((this._bitField & 524288) !== 0) return; + this._setRejectionIsUnhandled(); + deferUnhandledRejectionCheck(this); +}; + +Promise.prototype._notifyUnhandledRejectionIsHandled = function () { + fireRejectionEvent("rejectionHandled", + unhandledRejectionHandled, undefined, this); +}; + +Promise.prototype._setReturnedNonUndefined = function() { + this._bitField = this._bitField | 268435456; +}; + +Promise.prototype._returnedNonUndefined = function() { + return (this._bitField & 268435456) !== 0; +}; + +Promise.prototype._notifyUnhandledRejection = function () { + if (this._isRejectionUnhandled()) { + var reason = this._settledValue(); + this._setUnhandledRejectionIsNotified(); + fireRejectionEvent("unhandledRejection", + possiblyUnhandledRejection, reason, this); + } +}; + +Promise.prototype._setUnhandledRejectionIsNotified = function () { + this._bitField = this._bitField | 262144; +}; + +Promise.prototype._unsetUnhandledRejectionIsNotified = function () { + this._bitField = this._bitField & (~262144); +}; + +Promise.prototype._isUnhandledRejectionNotified = function () { + return (this._bitField & 262144) > 0; +}; + +Promise.prototype._setRejectionIsUnhandled = function () { + this._bitField = this._bitField | 1048576; +}; + +Promise.prototype._unsetRejectionIsUnhandled = function () { + this._bitField = this._bitField & (~1048576); + if (this._isUnhandledRejectionNotified()) { + this._unsetUnhandledRejectionIsNotified(); + this._notifyUnhandledRejectionIsHandled(); + } +}; + +Promise.prototype._isRejectionUnhandled = function () { + return (this._bitField & 1048576) > 0; +}; + +Promise.prototype._warn = function(message, shouldUseOwnTrace, promise) { + return warn(message, shouldUseOwnTrace, promise || this); +}; + +Promise.onPossiblyUnhandledRejection = function (fn) { + var context = Promise._getContext(); + possiblyUnhandledRejection = util.contextBind(context, fn); +}; + +Promise.onUnhandledRejectionHandled = function (fn) { + var context = Promise._getContext(); + unhandledRejectionHandled = util.contextBind(context, fn); +}; + +var disableLongStackTraces = function() {}; +Promise.longStackTraces = function () { + if (async.haveItemsQueued() && !config.longStackTraces) { + throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + if (!config.longStackTraces && longStackTracesIsSupported()) { + var Promise_captureStackTrace = Promise.prototype._captureStackTrace; + var Promise_attachExtraTrace = Promise.prototype._attachExtraTrace; + var Promise_dereferenceTrace = Promise.prototype._dereferenceTrace; + config.longStackTraces = true; + disableLongStackTraces = function() { + if (async.haveItemsQueued() && !config.longStackTraces) { + throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + Promise.prototype._captureStackTrace = Promise_captureStackTrace; + Promise.prototype._attachExtraTrace = Promise_attachExtraTrace; + Promise.prototype._dereferenceTrace = Promise_dereferenceTrace; + Context.deactivateLongStackTraces(); + config.longStackTraces = false; + }; + Promise.prototype._captureStackTrace = longStackTracesCaptureStackTrace; + Promise.prototype._attachExtraTrace = longStackTracesAttachExtraTrace; + Promise.prototype._dereferenceTrace = longStackTracesDereferenceTrace; + Context.activateLongStackTraces(); + } +}; + +Promise.hasLongStackTraces = function () { + return config.longStackTraces && longStackTracesIsSupported(); +}; + + +var legacyHandlers = { + unhandledrejection: { + before: function() { + var ret = util.global.onunhandledrejection; + util.global.onunhandledrejection = null; + return ret; + }, + after: function(fn) { + util.global.onunhandledrejection = fn; + } + }, + rejectionhandled: { + before: function() { + var ret = util.global.onrejectionhandled; + util.global.onrejectionhandled = null; + return ret; + }, + after: function(fn) { + util.global.onrejectionhandled = fn; + } + } +}; + +var fireDomEvent = (function() { + var dispatch = function(legacy, e) { + if (legacy) { + var fn; + try { + fn = legacy.before(); + return !util.global.dispatchEvent(e); + } finally { + legacy.after(fn); + } + } else { + return !util.global.dispatchEvent(e); + } + }; + try { + if (typeof CustomEvent === "function") { + var event = new CustomEvent("CustomEvent"); + util.global.dispatchEvent(event); + return function(name, event) { + name = name.toLowerCase(); + var eventData = { + detail: event, + cancelable: true + }; + var domEvent = new CustomEvent(name, eventData); + es5.defineProperty( + domEvent, "promise", {value: event.promise}); + es5.defineProperty( + domEvent, "reason", {value: event.reason}); + + return dispatch(legacyHandlers[name], domEvent); + }; + } else if (typeof Event === "function") { + var event = new Event("CustomEvent"); + util.global.dispatchEvent(event); + return function(name, event) { + name = name.toLowerCase(); + var domEvent = new Event(name, { + cancelable: true + }); + domEvent.detail = event; + es5.defineProperty(domEvent, "promise", {value: event.promise}); + es5.defineProperty(domEvent, "reason", {value: event.reason}); + return dispatch(legacyHandlers[name], domEvent); + }; + } else { + var event = document.createEvent("CustomEvent"); + event.initCustomEvent("testingtheevent", false, true, {}); + util.global.dispatchEvent(event); + return function(name, event) { + name = name.toLowerCase(); + var domEvent = document.createEvent("CustomEvent"); + domEvent.initCustomEvent(name, false, true, + event); + return dispatch(legacyHandlers[name], domEvent); + }; + } + } catch (e) {} + return function() { + return false; + }; +})(); + +var fireGlobalEvent = (function() { + if (util.isNode) { + return function() { + return process.emit.apply(process, arguments); + }; + } else { + if (!util.global) { + return function() { + return false; + }; + } + return function(name) { + var methodName = "on" + name.toLowerCase(); + var method = util.global[methodName]; + if (!method) return false; + method.apply(util.global, [].slice.call(arguments, 1)); + return true; + }; + } +})(); + +function generatePromiseLifecycleEventObject(name, promise) { + return {promise: promise}; +} + +var eventToObjectGenerator = { + promiseCreated: generatePromiseLifecycleEventObject, + promiseFulfilled: generatePromiseLifecycleEventObject, + promiseRejected: generatePromiseLifecycleEventObject, + promiseResolved: generatePromiseLifecycleEventObject, + promiseCancelled: generatePromiseLifecycleEventObject, + promiseChained: function(name, promise, child) { + return {promise: promise, child: child}; + }, + warning: function(name, warning) { + return {warning: warning}; + }, + unhandledRejection: function (name, reason, promise) { + return {reason: reason, promise: promise}; + }, + rejectionHandled: generatePromiseLifecycleEventObject +}; + +var activeFireEvent = function (name) { + var globalEventFired = false; + try { + globalEventFired = fireGlobalEvent.apply(null, arguments); + } catch (e) { + async.throwLater(e); + globalEventFired = true; + } + + var domEventFired = false; + try { + domEventFired = fireDomEvent(name, + eventToObjectGenerator[name].apply(null, arguments)); + } catch (e) { + async.throwLater(e); + domEventFired = true; + } + + return domEventFired || globalEventFired; +}; + +Promise.config = function(opts) { + opts = Object(opts); + if ("longStackTraces" in opts) { + if (opts.longStackTraces) { + Promise.longStackTraces(); + } else if (!opts.longStackTraces && Promise.hasLongStackTraces()) { + disableLongStackTraces(); + } + } + if ("warnings" in opts) { + var warningsOption = opts.warnings; + config.warnings = !!warningsOption; + wForgottenReturn = config.warnings; + + if (util.isObject(warningsOption)) { + if ("wForgottenReturn" in warningsOption) { + wForgottenReturn = !!warningsOption.wForgottenReturn; + } + } + } + if ("cancellation" in opts && opts.cancellation && !config.cancellation) { + if (async.haveItemsQueued()) { + throw new Error( + "cannot enable cancellation after promises are in use"); + } + Promise.prototype._clearCancellationData = + cancellationClearCancellationData; + Promise.prototype._propagateFrom = cancellationPropagateFrom; + Promise.prototype._onCancel = cancellationOnCancel; + Promise.prototype._setOnCancel = cancellationSetOnCancel; + Promise.prototype._attachCancellationCallback = + cancellationAttachCancellationCallback; + Promise.prototype._execute = cancellationExecute; + propagateFromFunction = cancellationPropagateFrom; + config.cancellation = true; + } + if ("monitoring" in opts) { + if (opts.monitoring && !config.monitoring) { + config.monitoring = true; + Promise.prototype._fireEvent = activeFireEvent; + } else if (!opts.monitoring && config.monitoring) { + config.monitoring = false; + Promise.prototype._fireEvent = defaultFireEvent; + } + } + if ("asyncHooks" in opts && util.nodeSupportsAsyncResource) { + var prev = config.asyncHooks; + var cur = !!opts.asyncHooks; + if (prev !== cur) { + config.asyncHooks = cur; + if (cur) { + enableAsyncHooks(); + } else { + disableAsyncHooks(); + } + } + } + return Promise; +}; + +function defaultFireEvent() { return false; } + +Promise.prototype._fireEvent = defaultFireEvent; +Promise.prototype._execute = function(executor, resolve, reject) { + try { + executor(resolve, reject); + } catch (e) { + return e; + } +}; +Promise.prototype._onCancel = function () {}; +Promise.prototype._setOnCancel = function (handler) { ; }; +Promise.prototype._attachCancellationCallback = function(onCancel) { + ; +}; +Promise.prototype._captureStackTrace = function () {}; +Promise.prototype._attachExtraTrace = function () {}; +Promise.prototype._dereferenceTrace = function () {}; +Promise.prototype._clearCancellationData = function() {}; +Promise.prototype._propagateFrom = function (parent, flags) { + ; + ; +}; + +function cancellationExecute(executor, resolve, reject) { + var promise = this; + try { + executor(resolve, reject, function(onCancel) { + if (typeof onCancel !== "function") { + throw new TypeError("onCancel must be a function, got: " + + util.toString(onCancel)); + } + promise._attachCancellationCallback(onCancel); + }); + } catch (e) { + return e; + } +} + +function cancellationAttachCancellationCallback(onCancel) { + if (!this._isCancellable()) return this; + + var previousOnCancel = this._onCancel(); + if (previousOnCancel !== undefined) { + if (util.isArray(previousOnCancel)) { + previousOnCancel.push(onCancel); + } else { + this._setOnCancel([previousOnCancel, onCancel]); + } + } else { + this._setOnCancel(onCancel); + } +} + +function cancellationOnCancel() { + return this._onCancelField; +} + +function cancellationSetOnCancel(onCancel) { + this._onCancelField = onCancel; +} + +function cancellationClearCancellationData() { + this._cancellationParent = undefined; + this._onCancelField = undefined; +} + +function cancellationPropagateFrom(parent, flags) { + if ((flags & 1) !== 0) { + this._cancellationParent = parent; + var branchesRemainingToCancel = parent._branchesRemainingToCancel; + if (branchesRemainingToCancel === undefined) { + branchesRemainingToCancel = 0; + } + parent._branchesRemainingToCancel = branchesRemainingToCancel + 1; + } + if ((flags & 2) !== 0 && parent._isBound()) { + this._setBoundTo(parent._boundTo); + } +} + +function bindingPropagateFrom(parent, flags) { + if ((flags & 2) !== 0 && parent._isBound()) { + this._setBoundTo(parent._boundTo); + } +} +var propagateFromFunction = bindingPropagateFrom; + +function boundValueFunction() { + var ret = this._boundTo; + if (ret !== undefined) { + if (ret instanceof Promise) { + if (ret.isFulfilled()) { + return ret.value(); + } else { + return undefined; + } + } + } + return ret; +} + +function longStackTracesCaptureStackTrace() { + this._trace = new CapturedTrace(this._peekContext()); +} + +function longStackTracesAttachExtraTrace(error, ignoreSelf) { + if (canAttachTrace(error)) { + var trace = this._trace; + if (trace !== undefined) { + if (ignoreSelf) trace = trace._parent; + } + if (trace !== undefined) { + trace.attachExtraTrace(error); + } else if (!error.__stackCleaned__) { + var parsed = parseStackAndMessage(error); + util.notEnumerableProp(error, "stack", + parsed.message + "\n" + parsed.stack.join("\n")); + util.notEnumerableProp(error, "__stackCleaned__", true); + } + } +} + +function longStackTracesDereferenceTrace() { + this._trace = undefined; +} + +function checkForgottenReturns(returnValue, promiseCreated, name, promise, + parent) { + if (returnValue === undefined && promiseCreated !== null && + wForgottenReturn) { + if (parent !== undefined && parent._returnedNonUndefined()) return; + if ((promise._bitField & 65535) === 0) return; + + if (name) name = name + " "; + var handlerLine = ""; + var creatorLine = ""; + if (promiseCreated._trace) { + var traceLines = promiseCreated._trace.stack.split("\n"); + var stack = cleanStack(traceLines); + for (var i = stack.length - 1; i >= 0; --i) { + var line = stack[i]; + if (!nodeFramePattern.test(line)) { + var lineMatches = line.match(parseLinePattern); + if (lineMatches) { + handlerLine = "at " + lineMatches[1] + + ":" + lineMatches[2] + ":" + lineMatches[3] + " "; + } + break; + } + } + + if (stack.length > 0) { + var firstUserLine = stack[0]; + for (var i = 0; i < traceLines.length; ++i) { + + if (traceLines[i] === firstUserLine) { + if (i > 0) { + creatorLine = "\n" + traceLines[i - 1]; + } + break; + } + } + + } + } + var msg = "a promise was created in a " + name + + "handler " + handlerLine + "but was not returned from it, " + + "see http://goo.gl/rRqMUw" + + creatorLine; + promise._warn(msg, true, promiseCreated); + } +} + +function deprecated(name, replacement) { + var message = name + + " is deprecated and will be removed in a future version."; + if (replacement) message += " Use " + replacement + " instead."; + return warn(message); +} + +function warn(message, shouldUseOwnTrace, promise) { + if (!config.warnings) return; + var warning = new Warning(message); + var ctx; + if (shouldUseOwnTrace) { + promise._attachExtraTrace(warning); + } else if (config.longStackTraces && (ctx = Promise._peekContext())) { + ctx.attachExtraTrace(warning); + } else { + var parsed = parseStackAndMessage(warning); + warning.stack = parsed.message + "\n" + parsed.stack.join("\n"); + } + + if (!activeFireEvent("warning", warning)) { + formatAndLogError(warning, "", true); + } +} + +function reconstructStack(message, stacks) { + for (var i = 0; i < stacks.length - 1; ++i) { + stacks[i].push("From previous event:"); + stacks[i] = stacks[i].join("\n"); + } + if (i < stacks.length) { + stacks[i] = stacks[i].join("\n"); + } + return message + "\n" + stacks.join("\n"); +} + +function removeDuplicateOrEmptyJumps(stacks) { + for (var i = 0; i < stacks.length; ++i) { + if (stacks[i].length === 0 || + ((i + 1 < stacks.length) && stacks[i][0] === stacks[i+1][0])) { + stacks.splice(i, 1); + i--; + } + } +} + +function removeCommonRoots(stacks) { + var current = stacks[0]; + for (var i = 1; i < stacks.length; ++i) { + var prev = stacks[i]; + var currentLastIndex = current.length - 1; + var currentLastLine = current[currentLastIndex]; + var commonRootMeetPoint = -1; + + for (var j = prev.length - 1; j >= 0; --j) { + if (prev[j] === currentLastLine) { + commonRootMeetPoint = j; + break; + } + } + + for (var j = commonRootMeetPoint; j >= 0; --j) { + var line = prev[j]; + if (current[currentLastIndex] === line) { + current.pop(); + currentLastIndex--; + } else { + break; + } + } + current = prev; + } +} + +function cleanStack(stack) { + var ret = []; + for (var i = 0; i < stack.length; ++i) { + var line = stack[i]; + var isTraceLine = " (No stack trace)" === line || + stackFramePattern.test(line); + var isInternalFrame = isTraceLine && shouldIgnore(line); + if (isTraceLine && !isInternalFrame) { + if (indentStackFrames && line.charAt(0) !== " ") { + line = " " + line; + } + ret.push(line); + } + } + return ret; +} + +function stackFramesAsArray(error) { + var stack = error.stack.replace(/\s+$/g, "").split("\n"); + for (var i = 0; i < stack.length; ++i) { + var line = stack[i]; + if (" (No stack trace)" === line || stackFramePattern.test(line)) { + break; + } + } + if (i > 0 && error.name != "SyntaxError") { + stack = stack.slice(i); + } + return stack; +} + +function parseStackAndMessage(error) { + var stack = error.stack; + var message = error.toString(); + stack = typeof stack === "string" && stack.length > 0 + ? stackFramesAsArray(error) : [" (No stack trace)"]; + return { + message: message, + stack: error.name == "SyntaxError" ? stack : cleanStack(stack) + }; +} + +function formatAndLogError(error, title, isSoft) { + if (typeof console !== "undefined") { + var message; + if (util.isObject(error)) { + var stack = error.stack; + message = title + formatStack(stack, error); + } else { + message = title + String(error); + } + if (typeof printWarning === "function") { + printWarning(message, isSoft); + } else if (typeof console.log === "function" || + typeof console.log === "object") { + console.log(message); + } + } +} + +function fireRejectionEvent(name, localHandler, reason, promise) { + var localEventFired = false; + try { + if (typeof localHandler === "function") { + localEventFired = true; + if (name === "rejectionHandled") { + localHandler(promise); + } else { + localHandler(reason, promise); + } + } + } catch (e) { + async.throwLater(e); + } + + if (name === "unhandledRejection") { + if (!activeFireEvent(name, reason, promise) && !localEventFired) { + formatAndLogError(reason, "Unhandled rejection "); + } + } else { + activeFireEvent(name, promise); + } +} + +function formatNonError(obj) { + var str; + if (typeof obj === "function") { + str = "[function " + + (obj.name || "anonymous") + + "]"; + } else { + str = obj && typeof obj.toString === "function" + ? obj.toString() : util.toString(obj); + var ruselessToString = /\[object [a-zA-Z0-9$_]+\]/; + if (ruselessToString.test(str)) { + try { + var newStr = JSON.stringify(obj); + str = newStr; + } + catch(e) { + + } + } + if (str.length === 0) { + str = "(empty array)"; + } + } + return ("(<" + snip(str) + ">, no stack trace)"); +} + +function snip(str) { + var maxChars = 41; + if (str.length < maxChars) { + return str; + } + return str.substr(0, maxChars - 3) + "..."; +} + +function longStackTracesIsSupported() { + return typeof captureStackTrace === "function"; +} + +var shouldIgnore = function() { return false; }; +var parseLineInfoRegex = /[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/; +function parseLineInfo(line) { + var matches = line.match(parseLineInfoRegex); + if (matches) { + return { + fileName: matches[1], + line: parseInt(matches[2], 10) + }; + } +} + +function setBounds(firstLineError, lastLineError) { + if (!longStackTracesIsSupported()) return; + var firstStackLines = (firstLineError.stack || "").split("\n"); + var lastStackLines = (lastLineError.stack || "").split("\n"); + var firstIndex = -1; + var lastIndex = -1; + var firstFileName; + var lastFileName; + for (var i = 0; i < firstStackLines.length; ++i) { + var result = parseLineInfo(firstStackLines[i]); + if (result) { + firstFileName = result.fileName; + firstIndex = result.line; + break; + } + } + for (var i = 0; i < lastStackLines.length; ++i) { + var result = parseLineInfo(lastStackLines[i]); + if (result) { + lastFileName = result.fileName; + lastIndex = result.line; + break; + } + } + if (firstIndex < 0 || lastIndex < 0 || !firstFileName || !lastFileName || + firstFileName !== lastFileName || firstIndex >= lastIndex) { + return; + } + + shouldIgnore = function(line) { + if (bluebirdFramePattern.test(line)) return true; + var info = parseLineInfo(line); + if (info) { + if (info.fileName === firstFileName && + (firstIndex <= info.line && info.line <= lastIndex)) { + return true; + } + } + return false; + }; +} + +function CapturedTrace(parent) { + this._parent = parent; + this._promisesCreated = 0; + var length = this._length = 1 + (parent === undefined ? 0 : parent._length); + captureStackTrace(this, CapturedTrace); + if (length > 32) this.uncycle(); +} +util.inherits(CapturedTrace, Error); +Context.CapturedTrace = CapturedTrace; + +CapturedTrace.prototype.uncycle = function() { + var length = this._length; + if (length < 2) return; + var nodes = []; + var stackToIndex = {}; + + for (var i = 0, node = this; node !== undefined; ++i) { + nodes.push(node); + node = node._parent; + } + length = this._length = i; + for (var i = length - 1; i >= 0; --i) { + var stack = nodes[i].stack; + if (stackToIndex[stack] === undefined) { + stackToIndex[stack] = i; + } + } + for (var i = 0; i < length; ++i) { + var currentStack = nodes[i].stack; + var index = stackToIndex[currentStack]; + if (index !== undefined && index !== i) { + if (index > 0) { + nodes[index - 1]._parent = undefined; + nodes[index - 1]._length = 1; + } + nodes[i]._parent = undefined; + nodes[i]._length = 1; + var cycleEdgeNode = i > 0 ? nodes[i - 1] : this; + + if (index < length - 1) { + cycleEdgeNode._parent = nodes[index + 1]; + cycleEdgeNode._parent.uncycle(); + cycleEdgeNode._length = + cycleEdgeNode._parent._length + 1; + } else { + cycleEdgeNode._parent = undefined; + cycleEdgeNode._length = 1; + } + var currentChildLength = cycleEdgeNode._length + 1; + for (var j = i - 2; j >= 0; --j) { + nodes[j]._length = currentChildLength; + currentChildLength++; + } + return; + } + } +}; + +CapturedTrace.prototype.attachExtraTrace = function(error) { + if (error.__stackCleaned__) return; + this.uncycle(); + var parsed = parseStackAndMessage(error); + var message = parsed.message; + var stacks = [parsed.stack]; + + var trace = this; + while (trace !== undefined) { + stacks.push(cleanStack(trace.stack.split("\n"))); + trace = trace._parent; + } + removeCommonRoots(stacks); + removeDuplicateOrEmptyJumps(stacks); + util.notEnumerableProp(error, "stack", reconstructStack(message, stacks)); + util.notEnumerableProp(error, "__stackCleaned__", true); +}; + +var captureStackTrace = (function stackDetection() { + var v8stackFramePattern = /^\s*at\s*/; + var v8stackFormatter = function(stack, error) { + if (typeof stack === "string") return stack; + + if (error.name !== undefined && + error.message !== undefined) { + return error.toString(); + } + return formatNonError(error); + }; + + if (typeof Error.stackTraceLimit === "number" && + typeof Error.captureStackTrace === "function") { + Error.stackTraceLimit += 6; + stackFramePattern = v8stackFramePattern; + formatStack = v8stackFormatter; + var captureStackTrace = Error.captureStackTrace; + + shouldIgnore = function(line) { + return bluebirdFramePattern.test(line); + }; + return function(receiver, ignoreUntil) { + Error.stackTraceLimit += 6; + captureStackTrace(receiver, ignoreUntil); + Error.stackTraceLimit -= 6; + }; + } + var err = new Error(); + + if (typeof err.stack === "string" && + err.stack.split("\n")[0].indexOf("stackDetection@") >= 0) { + stackFramePattern = /@/; + formatStack = v8stackFormatter; + indentStackFrames = true; + return function captureStackTrace(o) { + o.stack = new Error().stack; + }; + } + + var hasStackAfterThrow; + try { throw new Error(); } + catch(e) { + hasStackAfterThrow = ("stack" in e); + } + if (!("stack" in err) && hasStackAfterThrow && + typeof Error.stackTraceLimit === "number") { + stackFramePattern = v8stackFramePattern; + formatStack = v8stackFormatter; + return function captureStackTrace(o) { + Error.stackTraceLimit += 6; + try { throw new Error(); } + catch(e) { o.stack = e.stack; } + Error.stackTraceLimit -= 6; + }; + } + + formatStack = function(stack, error) { + if (typeof stack === "string") return stack; + + if ((typeof error === "object" || + typeof error === "function") && + error.name !== undefined && + error.message !== undefined) { + return error.toString(); + } + return formatNonError(error); + }; + + return null; + +})([]); + +if (typeof console !== "undefined" && typeof console.warn !== "undefined") { + printWarning = function (message) { + console.warn(message); + }; + if (util.isNode && process.stderr.isTTY) { + printWarning = function(message, isSoft) { + var color = isSoft ? "\u001b[33m" : "\u001b[31m"; + console.warn(color + message + "\u001b[0m\n"); + }; + } else if (!util.isNode && typeof (new Error().stack) === "string") { + printWarning = function(message, isSoft) { + console.warn("%c" + message, + isSoft ? "color: darkorange" : "color: red"); + }; + } +} + +var config = { + warnings: warnings, + longStackTraces: false, + cancellation: false, + monitoring: false, + asyncHooks: false +}; + +if (longStackTraces) Promise.longStackTraces(); + +return { + asyncHooks: function() { + return config.asyncHooks; + }, + longStackTraces: function() { + return config.longStackTraces; + }, + warnings: function() { + return config.warnings; + }, + cancellation: function() { + return config.cancellation; + }, + monitoring: function() { + return config.monitoring; + }, + propagateFromFunction: function() { + return propagateFromFunction; + }, + boundValueFunction: function() { + return boundValueFunction; + }, + checkForgottenReturns: checkForgottenReturns, + setBounds: setBounds, + warn: warn, + deprecated: deprecated, + CapturedTrace: CapturedTrace, + fireDomEvent: fireDomEvent, + fireGlobalEvent: fireGlobalEvent +}; +}; diff --git a/publisher/node_modules/bluebird/js/release/direct_resolve.js b/publisher/node_modules/bluebird/js/release/direct_resolve.js new file mode 100644 index 00000000..a8902982 --- /dev/null +++ b/publisher/node_modules/bluebird/js/release/direct_resolve.js @@ -0,0 +1,46 @@ +"use strict"; +module.exports = function(Promise) { +function returner() { + return this.value; +} +function thrower() { + throw this.reason; +} + +Promise.prototype["return"] = +Promise.prototype.thenReturn = function (value) { + if (value instanceof Promise) value.suppressUnhandledRejections(); + return this._then( + returner, undefined, undefined, {value: value}, undefined); +}; + +Promise.prototype["throw"] = +Promise.prototype.thenThrow = function (reason) { + return this._then( + thrower, undefined, undefined, {reason: reason}, undefined); +}; + +Promise.prototype.catchThrow = function (reason) { + if (arguments.length <= 1) { + return this._then( + undefined, thrower, undefined, {reason: reason}, undefined); + } else { + var _reason = arguments[1]; + var handler = function() {throw _reason;}; + return this.caught(reason, handler); + } +}; + +Promise.prototype.catchReturn = function (value) { + if (arguments.length <= 1) { + if (value instanceof Promise) value.suppressUnhandledRejections(); + return this._then( + undefined, returner, undefined, {value: value}, undefined); + } else { + var _value = arguments[1]; + if (_value instanceof Promise) _value.suppressUnhandledRejections(); + var handler = function() {return _value;}; + return this.caught(value, handler); + } +}; +}; diff --git a/publisher/node_modules/bluebird/js/release/each.js b/publisher/node_modules/bluebird/js/release/each.js new file mode 100644 index 00000000..e4f3d05b --- /dev/null +++ b/publisher/node_modules/bluebird/js/release/each.js @@ -0,0 +1,30 @@ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var PromiseReduce = Promise.reduce; +var PromiseAll = Promise.all; + +function promiseAllThis() { + return PromiseAll(this); +} + +function PromiseMapSeries(promises, fn) { + return PromiseReduce(promises, fn, INTERNAL, INTERNAL); +} + +Promise.prototype.each = function (fn) { + return PromiseReduce(this, fn, INTERNAL, 0) + ._then(promiseAllThis, undefined, undefined, this, undefined); +}; + +Promise.prototype.mapSeries = function (fn) { + return PromiseReduce(this, fn, INTERNAL, INTERNAL); +}; + +Promise.each = function (promises, fn) { + return PromiseReduce(promises, fn, INTERNAL, 0) + ._then(promiseAllThis, undefined, undefined, promises, undefined); +}; + +Promise.mapSeries = PromiseMapSeries; +}; + diff --git a/publisher/node_modules/bluebird/js/release/errors.js b/publisher/node_modules/bluebird/js/release/errors.js new file mode 100644 index 00000000..f62f323e --- /dev/null +++ b/publisher/node_modules/bluebird/js/release/errors.js @@ -0,0 +1,116 @@ +"use strict"; +var es5 = require("./es5"); +var Objectfreeze = es5.freeze; +var util = require("./util"); +var inherits = util.inherits; +var notEnumerableProp = util.notEnumerableProp; + +function subError(nameProperty, defaultMessage) { + function SubError(message) { + if (!(this instanceof SubError)) return new SubError(message); + notEnumerableProp(this, "message", + typeof message === "string" ? message : defaultMessage); + notEnumerableProp(this, "name", nameProperty); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + Error.call(this); + } + } + inherits(SubError, Error); + return SubError; +} + +var _TypeError, _RangeError; +var Warning = subError("Warning", "warning"); +var CancellationError = subError("CancellationError", "cancellation error"); +var TimeoutError = subError("TimeoutError", "timeout error"); +var AggregateError = subError("AggregateError", "aggregate error"); +try { + _TypeError = TypeError; + _RangeError = RangeError; +} catch(e) { + _TypeError = subError("TypeError", "type error"); + _RangeError = subError("RangeError", "range error"); +} + +var methods = ("join pop push shift unshift slice filter forEach some " + + "every map indexOf lastIndexOf reduce reduceRight sort reverse").split(" "); + +for (var i = 0; i < methods.length; ++i) { + if (typeof Array.prototype[methods[i]] === "function") { + AggregateError.prototype[methods[i]] = Array.prototype[methods[i]]; + } +} + +es5.defineProperty(AggregateError.prototype, "length", { + value: 0, + configurable: false, + writable: true, + enumerable: true +}); +AggregateError.prototype["isOperational"] = true; +var level = 0; +AggregateError.prototype.toString = function() { + var indent = Array(level * 4 + 1).join(" "); + var ret = "\n" + indent + "AggregateError of:" + "\n"; + level++; + indent = Array(level * 4 + 1).join(" "); + for (var i = 0; i < this.length; ++i) { + var str = this[i] === this ? "[Circular AggregateError]" : this[i] + ""; + var lines = str.split("\n"); + for (var j = 0; j < lines.length; ++j) { + lines[j] = indent + lines[j]; + } + str = lines.join("\n"); + ret += str + "\n"; + } + level--; + return ret; +}; + +function OperationalError(message) { + if (!(this instanceof OperationalError)) + return new OperationalError(message); + notEnumerableProp(this, "name", "OperationalError"); + notEnumerableProp(this, "message", message); + this.cause = message; + this["isOperational"] = true; + + if (message instanceof Error) { + notEnumerableProp(this, "message", message.message); + notEnumerableProp(this, "stack", message.stack); + } else if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + +} +inherits(OperationalError, Error); + +var errorTypes = Error["__BluebirdErrorTypes__"]; +if (!errorTypes) { + errorTypes = Objectfreeze({ + CancellationError: CancellationError, + TimeoutError: TimeoutError, + OperationalError: OperationalError, + RejectionError: OperationalError, + AggregateError: AggregateError + }); + es5.defineProperty(Error, "__BluebirdErrorTypes__", { + value: errorTypes, + writable: false, + enumerable: false, + configurable: false + }); +} + +module.exports = { + Error: Error, + TypeError: _TypeError, + RangeError: _RangeError, + CancellationError: errorTypes.CancellationError, + OperationalError: errorTypes.OperationalError, + TimeoutError: errorTypes.TimeoutError, + AggregateError: errorTypes.AggregateError, + Warning: Warning +}; diff --git a/publisher/node_modules/bluebird/js/release/es5.js b/publisher/node_modules/bluebird/js/release/es5.js new file mode 100644 index 00000000..ea41d5a5 --- /dev/null +++ b/publisher/node_modules/bluebird/js/release/es5.js @@ -0,0 +1,80 @@ +var isES5 = (function(){ + "use strict"; + return this === undefined; +})(); + +if (isES5) { + module.exports = { + freeze: Object.freeze, + defineProperty: Object.defineProperty, + getDescriptor: Object.getOwnPropertyDescriptor, + keys: Object.keys, + names: Object.getOwnPropertyNames, + getPrototypeOf: Object.getPrototypeOf, + isArray: Array.isArray, + isES5: isES5, + propertyIsWritable: function(obj, prop) { + var descriptor = Object.getOwnPropertyDescriptor(obj, prop); + return !!(!descriptor || descriptor.writable || descriptor.set); + } + }; +} else { + var has = {}.hasOwnProperty; + var str = {}.toString; + var proto = {}.constructor.prototype; + + var ObjectKeys = function (o) { + var ret = []; + for (var key in o) { + if (has.call(o, key)) { + ret.push(key); + } + } + return ret; + }; + + var ObjectGetDescriptor = function(o, key) { + return {value: o[key]}; + }; + + var ObjectDefineProperty = function (o, key, desc) { + o[key] = desc.value; + return o; + }; + + var ObjectFreeze = function (obj) { + return obj; + }; + + var ObjectGetPrototypeOf = function (obj) { + try { + return Object(obj).constructor.prototype; + } + catch (e) { + return proto; + } + }; + + var ArrayIsArray = function (obj) { + try { + return str.call(obj) === "[object Array]"; + } + catch(e) { + return false; + } + }; + + module.exports = { + isArray: ArrayIsArray, + keys: ObjectKeys, + names: ObjectKeys, + defineProperty: ObjectDefineProperty, + getDescriptor: ObjectGetDescriptor, + freeze: ObjectFreeze, + getPrototypeOf: ObjectGetPrototypeOf, + isES5: isES5, + propertyIsWritable: function() { + return true; + } + }; +} diff --git a/publisher/node_modules/bluebird/js/release/filter.js b/publisher/node_modules/bluebird/js/release/filter.js new file mode 100644 index 00000000..ed57bf01 --- /dev/null +++ b/publisher/node_modules/bluebird/js/release/filter.js @@ -0,0 +1,12 @@ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var PromiseMap = Promise.map; + +Promise.prototype.filter = function (fn, options) { + return PromiseMap(this, fn, options, INTERNAL); +}; + +Promise.filter = function (promises, fn, options) { + return PromiseMap(promises, fn, options, INTERNAL); +}; +}; diff --git a/publisher/node_modules/bluebird/js/release/finally.js b/publisher/node_modules/bluebird/js/release/finally.js new file mode 100644 index 00000000..d57444be --- /dev/null +++ b/publisher/node_modules/bluebird/js/release/finally.js @@ -0,0 +1,146 @@ +"use strict"; +module.exports = function(Promise, tryConvertToPromise, NEXT_FILTER) { +var util = require("./util"); +var CancellationError = Promise.CancellationError; +var errorObj = util.errorObj; +var catchFilter = require("./catch_filter")(NEXT_FILTER); + +function PassThroughHandlerContext(promise, type, handler) { + this.promise = promise; + this.type = type; + this.handler = handler; + this.called = false; + this.cancelPromise = null; +} + +PassThroughHandlerContext.prototype.isFinallyHandler = function() { + return this.type === 0; +}; + +function FinallyHandlerCancelReaction(finallyHandler) { + this.finallyHandler = finallyHandler; +} + +FinallyHandlerCancelReaction.prototype._resultCancelled = function() { + checkCancel(this.finallyHandler); +}; + +function checkCancel(ctx, reason) { + if (ctx.cancelPromise != null) { + if (arguments.length > 1) { + ctx.cancelPromise._reject(reason); + } else { + ctx.cancelPromise._cancel(); + } + ctx.cancelPromise = null; + return true; + } + return false; +} + +function succeed() { + return finallyHandler.call(this, this.promise._target()._settledValue()); +} +function fail(reason) { + if (checkCancel(this, reason)) return; + errorObj.e = reason; + return errorObj; +} +function finallyHandler(reasonOrValue) { + var promise = this.promise; + var handler = this.handler; + + if (!this.called) { + this.called = true; + var ret = this.isFinallyHandler() + ? handler.call(promise._boundValue()) + : handler.call(promise._boundValue(), reasonOrValue); + if (ret === NEXT_FILTER) { + return ret; + } else if (ret !== undefined) { + promise._setReturnedNonUndefined(); + var maybePromise = tryConvertToPromise(ret, promise); + if (maybePromise instanceof Promise) { + if (this.cancelPromise != null) { + if (maybePromise._isCancelled()) { + var reason = + new CancellationError("late cancellation observer"); + promise._attachExtraTrace(reason); + errorObj.e = reason; + return errorObj; + } else if (maybePromise.isPending()) { + maybePromise._attachCancellationCallback( + new FinallyHandlerCancelReaction(this)); + } + } + return maybePromise._then( + succeed, fail, undefined, this, undefined); + } + } + } + + if (promise.isRejected()) { + checkCancel(this); + errorObj.e = reasonOrValue; + return errorObj; + } else { + checkCancel(this); + return reasonOrValue; + } +} + +Promise.prototype._passThrough = function(handler, type, success, fail) { + if (typeof handler !== "function") return this.then(); + return this._then(success, + fail, + undefined, + new PassThroughHandlerContext(this, type, handler), + undefined); +}; + +Promise.prototype.lastly = +Promise.prototype["finally"] = function (handler) { + return this._passThrough(handler, + 0, + finallyHandler, + finallyHandler); +}; + + +Promise.prototype.tap = function (handler) { + return this._passThrough(handler, 1, finallyHandler); +}; + +Promise.prototype.tapCatch = function (handlerOrPredicate) { + var len = arguments.length; + if(len === 1) { + return this._passThrough(handlerOrPredicate, + 1, + undefined, + finallyHandler); + } else { + var catchInstances = new Array(len - 1), + j = 0, i; + for (i = 0; i < len - 1; ++i) { + var item = arguments[i]; + if (util.isObject(item)) { + catchInstances[j++] = item; + } else { + return Promise.reject(new TypeError( + "tapCatch statement predicate: " + + "expecting an object but got " + util.classString(item) + )); + } + } + catchInstances.length = j; + var handler = arguments[i]; + return this._passThrough(catchFilter(catchInstances, handler, this), + 1, + undefined, + finallyHandler); + } + +}; + +return PassThroughHandlerContext; +}; diff --git a/publisher/node_modules/bluebird/js/release/generators.js b/publisher/node_modules/bluebird/js/release/generators.js new file mode 100644 index 00000000..500c280c --- /dev/null +++ b/publisher/node_modules/bluebird/js/release/generators.js @@ -0,0 +1,223 @@ +"use strict"; +module.exports = function(Promise, + apiRejection, + INTERNAL, + tryConvertToPromise, + Proxyable, + debug) { +var errors = require("./errors"); +var TypeError = errors.TypeError; +var util = require("./util"); +var errorObj = util.errorObj; +var tryCatch = util.tryCatch; +var yieldHandlers = []; + +function promiseFromYieldHandler(value, yieldHandlers, traceParent) { + for (var i = 0; i < yieldHandlers.length; ++i) { + traceParent._pushContext(); + var result = tryCatch(yieldHandlers[i])(value); + traceParent._popContext(); + if (result === errorObj) { + traceParent._pushContext(); + var ret = Promise.reject(errorObj.e); + traceParent._popContext(); + return ret; + } + var maybePromise = tryConvertToPromise(result, traceParent); + if (maybePromise instanceof Promise) return maybePromise; + } + return null; +} + +function PromiseSpawn(generatorFunction, receiver, yieldHandler, stack) { + if (debug.cancellation()) { + var internal = new Promise(INTERNAL); + var _finallyPromise = this._finallyPromise = new Promise(INTERNAL); + this._promise = internal.lastly(function() { + return _finallyPromise; + }); + internal._captureStackTrace(); + internal._setOnCancel(this); + } else { + var promise = this._promise = new Promise(INTERNAL); + promise._captureStackTrace(); + } + this._stack = stack; + this._generatorFunction = generatorFunction; + this._receiver = receiver; + this._generator = undefined; + this._yieldHandlers = typeof yieldHandler === "function" + ? [yieldHandler].concat(yieldHandlers) + : yieldHandlers; + this._yieldedPromise = null; + this._cancellationPhase = false; +} +util.inherits(PromiseSpawn, Proxyable); + +PromiseSpawn.prototype._isResolved = function() { + return this._promise === null; +}; + +PromiseSpawn.prototype._cleanup = function() { + this._promise = this._generator = null; + if (debug.cancellation() && this._finallyPromise !== null) { + this._finallyPromise._fulfill(); + this._finallyPromise = null; + } +}; + +PromiseSpawn.prototype._promiseCancelled = function() { + if (this._isResolved()) return; + var implementsReturn = typeof this._generator["return"] !== "undefined"; + + var result; + if (!implementsReturn) { + var reason = new Promise.CancellationError( + "generator .return() sentinel"); + Promise.coroutine.returnSentinel = reason; + this._promise._attachExtraTrace(reason); + this._promise._pushContext(); + result = tryCatch(this._generator["throw"]).call(this._generator, + reason); + this._promise._popContext(); + } else { + this._promise._pushContext(); + result = tryCatch(this._generator["return"]).call(this._generator, + undefined); + this._promise._popContext(); + } + this._cancellationPhase = true; + this._yieldedPromise = null; + this._continue(result); +}; + +PromiseSpawn.prototype._promiseFulfilled = function(value) { + this._yieldedPromise = null; + this._promise._pushContext(); + var result = tryCatch(this._generator.next).call(this._generator, value); + this._promise._popContext(); + this._continue(result); +}; + +PromiseSpawn.prototype._promiseRejected = function(reason) { + this._yieldedPromise = null; + this._promise._attachExtraTrace(reason); + this._promise._pushContext(); + var result = tryCatch(this._generator["throw"]) + .call(this._generator, reason); + this._promise._popContext(); + this._continue(result); +}; + +PromiseSpawn.prototype._resultCancelled = function() { + if (this._yieldedPromise instanceof Promise) { + var promise = this._yieldedPromise; + this._yieldedPromise = null; + promise.cancel(); + } +}; + +PromiseSpawn.prototype.promise = function () { + return this._promise; +}; + +PromiseSpawn.prototype._run = function () { + this._generator = this._generatorFunction.call(this._receiver); + this._receiver = + this._generatorFunction = undefined; + this._promiseFulfilled(undefined); +}; + +PromiseSpawn.prototype._continue = function (result) { + var promise = this._promise; + if (result === errorObj) { + this._cleanup(); + if (this._cancellationPhase) { + return promise.cancel(); + } else { + return promise._rejectCallback(result.e, false); + } + } + + var value = result.value; + if (result.done === true) { + this._cleanup(); + if (this._cancellationPhase) { + return promise.cancel(); + } else { + return promise._resolveCallback(value); + } + } else { + var maybePromise = tryConvertToPromise(value, this._promise); + if (!(maybePromise instanceof Promise)) { + maybePromise = + promiseFromYieldHandler(maybePromise, + this._yieldHandlers, + this._promise); + if (maybePromise === null) { + this._promiseRejected( + new TypeError( + "A value %s was yielded that could not be treated as a promise\u000a\u000a See http://goo.gl/MqrFmX\u000a\u000a".replace("%s", String(value)) + + "From coroutine:\u000a" + + this._stack.split("\n").slice(1, -7).join("\n") + ) + ); + return; + } + } + maybePromise = maybePromise._target(); + var bitField = maybePromise._bitField; + ; + if (((bitField & 50397184) === 0)) { + this._yieldedPromise = maybePromise; + maybePromise._proxy(this, null); + } else if (((bitField & 33554432) !== 0)) { + Promise._async.invoke( + this._promiseFulfilled, this, maybePromise._value() + ); + } else if (((bitField & 16777216) !== 0)) { + Promise._async.invoke( + this._promiseRejected, this, maybePromise._reason() + ); + } else { + this._promiseCancelled(); + } + } +}; + +Promise.coroutine = function (generatorFunction, options) { + if (typeof generatorFunction !== "function") { + throw new TypeError("generatorFunction must be a function\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + var yieldHandler = Object(options).yieldHandler; + var PromiseSpawn$ = PromiseSpawn; + var stack = new Error().stack; + return function () { + var generator = generatorFunction.apply(this, arguments); + var spawn = new PromiseSpawn$(undefined, undefined, yieldHandler, + stack); + var ret = spawn.promise(); + spawn._generator = generator; + spawn._promiseFulfilled(undefined); + return ret; + }; +}; + +Promise.coroutine.addYieldHandler = function(fn) { + if (typeof fn !== "function") { + throw new TypeError("expecting a function but got " + util.classString(fn)); + } + yieldHandlers.push(fn); +}; + +Promise.spawn = function (generatorFunction) { + debug.deprecated("Promise.spawn()", "Promise.coroutine()"); + if (typeof generatorFunction !== "function") { + return apiRejection("generatorFunction must be a function\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + var spawn = new PromiseSpawn(generatorFunction, this); + var ret = spawn.promise(); + spawn._run(Promise.spawn); + return ret; +}; +}; diff --git a/publisher/node_modules/bluebird/js/release/join.js b/publisher/node_modules/bluebird/js/release/join.js new file mode 100644 index 00000000..e7e19f06 --- /dev/null +++ b/publisher/node_modules/bluebird/js/release/join.js @@ -0,0 +1,165 @@ +"use strict"; +module.exports = +function(Promise, PromiseArray, tryConvertToPromise, INTERNAL, async) { +var util = require("./util"); +var canEvaluate = util.canEvaluate; +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; +var reject; + +if (!false) { +if (canEvaluate) { + var thenCallback = function(i) { + return new Function("value", "holder", " \n\ + 'use strict'; \n\ + holder.pIndex = value; \n\ + holder.checkFulfillment(this); \n\ + ".replace(/Index/g, i)); + }; + + var promiseSetter = function(i) { + return new Function("promise", "holder", " \n\ + 'use strict'; \n\ + holder.pIndex = promise; \n\ + ".replace(/Index/g, i)); + }; + + var generateHolderClass = function(total) { + var props = new Array(total); + for (var i = 0; i < props.length; ++i) { + props[i] = "this.p" + (i+1); + } + var assignment = props.join(" = ") + " = null;"; + var cancellationCode= "var promise;\n" + props.map(function(prop) { + return " \n\ + promise = " + prop + "; \n\ + if (promise instanceof Promise) { \n\ + promise.cancel(); \n\ + } \n\ + "; + }).join("\n"); + var passedArguments = props.join(", "); + var name = "Holder$" + total; + + + var code = "return function(tryCatch, errorObj, Promise, async) { \n\ + 'use strict'; \n\ + function [TheName](fn) { \n\ + [TheProperties] \n\ + this.fn = fn; \n\ + this.asyncNeeded = true; \n\ + this.now = 0; \n\ + } \n\ + \n\ + [TheName].prototype._callFunction = function(promise) { \n\ + promise._pushContext(); \n\ + var ret = tryCatch(this.fn)([ThePassedArguments]); \n\ + promise._popContext(); \n\ + if (ret === errorObj) { \n\ + promise._rejectCallback(ret.e, false); \n\ + } else { \n\ + promise._resolveCallback(ret); \n\ + } \n\ + }; \n\ + \n\ + [TheName].prototype.checkFulfillment = function(promise) { \n\ + var now = ++this.now; \n\ + if (now === [TheTotal]) { \n\ + if (this.asyncNeeded) { \n\ + async.invoke(this._callFunction, this, promise); \n\ + } else { \n\ + this._callFunction(promise); \n\ + } \n\ + \n\ + } \n\ + }; \n\ + \n\ + [TheName].prototype._resultCancelled = function() { \n\ + [CancellationCode] \n\ + }; \n\ + \n\ + return [TheName]; \n\ + }(tryCatch, errorObj, Promise, async); \n\ + "; + + code = code.replace(/\[TheName\]/g, name) + .replace(/\[TheTotal\]/g, total) + .replace(/\[ThePassedArguments\]/g, passedArguments) + .replace(/\[TheProperties\]/g, assignment) + .replace(/\[CancellationCode\]/g, cancellationCode); + + return new Function("tryCatch", "errorObj", "Promise", "async", code) + (tryCatch, errorObj, Promise, async); + }; + + var holderClasses = []; + var thenCallbacks = []; + var promiseSetters = []; + + for (var i = 0; i < 8; ++i) { + holderClasses.push(generateHolderClass(i + 1)); + thenCallbacks.push(thenCallback(i + 1)); + promiseSetters.push(promiseSetter(i + 1)); + } + + reject = function (reason) { + this._reject(reason); + }; +}} + +Promise.join = function () { + var last = arguments.length - 1; + var fn; + if (last > 0 && typeof arguments[last] === "function") { + fn = arguments[last]; + if (!false) { + if (last <= 8 && canEvaluate) { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + var HolderClass = holderClasses[last - 1]; + var holder = new HolderClass(fn); + var callbacks = thenCallbacks; + + for (var i = 0; i < last; ++i) { + var maybePromise = tryConvertToPromise(arguments[i], ret); + if (maybePromise instanceof Promise) { + maybePromise = maybePromise._target(); + var bitField = maybePromise._bitField; + ; + if (((bitField & 50397184) === 0)) { + maybePromise._then(callbacks[i], reject, + undefined, ret, holder); + promiseSetters[i](maybePromise, holder); + holder.asyncNeeded = false; + } else if (((bitField & 33554432) !== 0)) { + callbacks[i].call(ret, + maybePromise._value(), holder); + } else if (((bitField & 16777216) !== 0)) { + ret._reject(maybePromise._reason()); + } else { + ret._cancel(); + } + } else { + callbacks[i].call(ret, maybePromise, holder); + } + } + + if (!ret._isFateSealed()) { + if (holder.asyncNeeded) { + var context = Promise._getContext(); + holder.fn = util.contextBind(context, holder.fn); + } + ret._setAsyncGuaranteed(); + ret._setOnCancel(holder); + } + return ret; + } + } + } + var $_len = arguments.length;var args = new Array($_len); for(var $_i = 0; $_i < $_len ; ++$_i) {args[$_i] = arguments[$_i ];}; + if (fn) args.pop(); + var ret = new PromiseArray(args).promise(); + return fn !== undefined ? ret.spread(fn) : ret; +}; + +}; diff --git a/publisher/node_modules/bluebird/js/release/map.js b/publisher/node_modules/bluebird/js/release/map.js new file mode 100644 index 00000000..91d5a826 --- /dev/null +++ b/publisher/node_modules/bluebird/js/release/map.js @@ -0,0 +1,175 @@ +"use strict"; +module.exports = function(Promise, + PromiseArray, + apiRejection, + tryConvertToPromise, + INTERNAL, + debug) { +var util = require("./util"); +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; +var async = Promise._async; + +function MappingPromiseArray(promises, fn, limit, _filter) { + this.constructor$(promises); + this._promise._captureStackTrace(); + var context = Promise._getContext(); + this._callback = util.contextBind(context, fn); + this._preservedValues = _filter === INTERNAL + ? new Array(this.length()) + : null; + this._limit = limit; + this._inFlight = 0; + this._queue = []; + async.invoke(this._asyncInit, this, undefined); + if (util.isArray(promises)) { + for (var i = 0; i < promises.length; ++i) { + var maybePromise = promises[i]; + if (maybePromise instanceof Promise) { + maybePromise.suppressUnhandledRejections(); + } + } + } +} +util.inherits(MappingPromiseArray, PromiseArray); + +MappingPromiseArray.prototype._asyncInit = function() { + this._init$(undefined, -2); +}; + +MappingPromiseArray.prototype._init = function () {}; + +MappingPromiseArray.prototype._promiseFulfilled = function (value, index) { + var values = this._values; + var length = this.length(); + var preservedValues = this._preservedValues; + var limit = this._limit; + + if (index < 0) { + index = (index * -1) - 1; + values[index] = value; + if (limit >= 1) { + this._inFlight--; + this._drainQueue(); + if (this._isResolved()) return true; + } + } else { + if (limit >= 1 && this._inFlight >= limit) { + values[index] = value; + this._queue.push(index); + return false; + } + if (preservedValues !== null) preservedValues[index] = value; + + var promise = this._promise; + var callback = this._callback; + var receiver = promise._boundValue(); + promise._pushContext(); + var ret = tryCatch(callback).call(receiver, value, index, length); + var promiseCreated = promise._popContext(); + debug.checkForgottenReturns( + ret, + promiseCreated, + preservedValues !== null ? "Promise.filter" : "Promise.map", + promise + ); + if (ret === errorObj) { + this._reject(ret.e); + return true; + } + + var maybePromise = tryConvertToPromise(ret, this._promise); + if (maybePromise instanceof Promise) { + maybePromise = maybePromise._target(); + var bitField = maybePromise._bitField; + ; + if (((bitField & 50397184) === 0)) { + if (limit >= 1) this._inFlight++; + values[index] = maybePromise; + maybePromise._proxy(this, (index + 1) * -1); + return false; + } else if (((bitField & 33554432) !== 0)) { + ret = maybePromise._value(); + } else if (((bitField & 16777216) !== 0)) { + this._reject(maybePromise._reason()); + return true; + } else { + this._cancel(); + return true; + } + } + values[index] = ret; + } + var totalResolved = ++this._totalResolved; + if (totalResolved >= length) { + if (preservedValues !== null) { + this._filter(values, preservedValues); + } else { + this._resolve(values); + } + return true; + } + return false; +}; + +MappingPromiseArray.prototype._drainQueue = function () { + var queue = this._queue; + var limit = this._limit; + var values = this._values; + while (queue.length > 0 && this._inFlight < limit) { + if (this._isResolved()) return; + var index = queue.pop(); + this._promiseFulfilled(values[index], index); + } +}; + +MappingPromiseArray.prototype._filter = function (booleans, values) { + var len = values.length; + var ret = new Array(len); + var j = 0; + for (var i = 0; i < len; ++i) { + if (booleans[i]) ret[j++] = values[i]; + } + ret.length = j; + this._resolve(ret); +}; + +MappingPromiseArray.prototype.preservedValues = function () { + return this._preservedValues; +}; + +function map(promises, fn, options, _filter) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + + var limit = 0; + if (options !== undefined) { + if (typeof options === "object" && options !== null) { + if (typeof options.concurrency !== "number") { + return Promise.reject( + new TypeError("'concurrency' must be a number but it is " + + util.classString(options.concurrency))); + } + limit = options.concurrency; + } else { + return Promise.reject(new TypeError( + "options argument must be an object but it is " + + util.classString(options))); + } + } + limit = typeof limit === "number" && + isFinite(limit) && limit >= 1 ? limit : 0; + return new MappingPromiseArray(promises, fn, limit, _filter).promise(); +} + +Promise.prototype.map = function (fn, options) { + return map(this, fn, options, null); +}; + +Promise.map = function (promises, fn, options, _filter) { + return map(promises, fn, options, _filter); +}; + + +}; diff --git a/publisher/node_modules/bluebird/js/release/method.js b/publisher/node_modules/bluebird/js/release/method.js new file mode 100644 index 00000000..ce9e4db7 --- /dev/null +++ b/publisher/node_modules/bluebird/js/release/method.js @@ -0,0 +1,55 @@ +"use strict"; +module.exports = +function(Promise, INTERNAL, tryConvertToPromise, apiRejection, debug) { +var util = require("./util"); +var tryCatch = util.tryCatch; + +Promise.method = function (fn) { + if (typeof fn !== "function") { + throw new Promise.TypeError("expecting a function but got " + util.classString(fn)); + } + return function () { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._pushContext(); + var value = tryCatch(fn).apply(this, arguments); + var promiseCreated = ret._popContext(); + debug.checkForgottenReturns( + value, promiseCreated, "Promise.method", ret); + ret._resolveFromSyncValue(value); + return ret; + }; +}; + +Promise.attempt = Promise["try"] = function (fn) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._pushContext(); + var value; + if (arguments.length > 1) { + debug.deprecated("calling Promise.try with more than 1 argument"); + var arg = arguments[1]; + var ctx = arguments[2]; + value = util.isArray(arg) ? tryCatch(fn).apply(ctx, arg) + : tryCatch(fn).call(ctx, arg); + } else { + value = tryCatch(fn)(); + } + var promiseCreated = ret._popContext(); + debug.checkForgottenReturns( + value, promiseCreated, "Promise.try", ret); + ret._resolveFromSyncValue(value); + return ret; +}; + +Promise.prototype._resolveFromSyncValue = function (value) { + if (value === util.errorObj) { + this._rejectCallback(value.e, false); + } else { + this._resolveCallback(value, true); + } +}; +}; diff --git a/publisher/node_modules/bluebird/js/release/nodeback.js b/publisher/node_modules/bluebird/js/release/nodeback.js new file mode 100644 index 00000000..71e69ebd --- /dev/null +++ b/publisher/node_modules/bluebird/js/release/nodeback.js @@ -0,0 +1,51 @@ +"use strict"; +var util = require("./util"); +var maybeWrapAsError = util.maybeWrapAsError; +var errors = require("./errors"); +var OperationalError = errors.OperationalError; +var es5 = require("./es5"); + +function isUntypedError(obj) { + return obj instanceof Error && + es5.getPrototypeOf(obj) === Error.prototype; +} + +var rErrorKey = /^(?:name|message|stack|cause)$/; +function wrapAsOperationalError(obj) { + var ret; + if (isUntypedError(obj)) { + ret = new OperationalError(obj); + ret.name = obj.name; + ret.message = obj.message; + ret.stack = obj.stack; + var keys = es5.keys(obj); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (!rErrorKey.test(key)) { + ret[key] = obj[key]; + } + } + return ret; + } + util.markAsOriginatingFromRejection(obj); + return obj; +} + +function nodebackForPromise(promise, multiArgs) { + return function(err, value) { + if (promise === null) return; + if (err) { + var wrapped = wrapAsOperationalError(maybeWrapAsError(err)); + promise._attachExtraTrace(wrapped); + promise._reject(wrapped); + } else if (!multiArgs) { + promise._fulfill(value); + } else { + var $_len = arguments.length;var args = new Array(Math.max($_len - 1, 0)); for(var $_i = 1; $_i < $_len; ++$_i) {args[$_i - 1] = arguments[$_i];}; + promise._fulfill(args); + } + promise = null; + }; +} + +module.exports = nodebackForPromise; diff --git a/publisher/node_modules/bluebird/js/release/nodeify.js b/publisher/node_modules/bluebird/js/release/nodeify.js new file mode 100644 index 00000000..ce2b1900 --- /dev/null +++ b/publisher/node_modules/bluebird/js/release/nodeify.js @@ -0,0 +1,58 @@ +"use strict"; +module.exports = function(Promise) { +var util = require("./util"); +var async = Promise._async; +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; + +function spreadAdapter(val, nodeback) { + var promise = this; + if (!util.isArray(val)) return successAdapter.call(promise, val, nodeback); + var ret = + tryCatch(nodeback).apply(promise._boundValue(), [null].concat(val)); + if (ret === errorObj) { + async.throwLater(ret.e); + } +} + +function successAdapter(val, nodeback) { + var promise = this; + var receiver = promise._boundValue(); + var ret = val === undefined + ? tryCatch(nodeback).call(receiver, null) + : tryCatch(nodeback).call(receiver, null, val); + if (ret === errorObj) { + async.throwLater(ret.e); + } +} +function errorAdapter(reason, nodeback) { + var promise = this; + if (!reason) { + var newReason = new Error(reason + ""); + newReason.cause = reason; + reason = newReason; + } + var ret = tryCatch(nodeback).call(promise._boundValue(), reason); + if (ret === errorObj) { + async.throwLater(ret.e); + } +} + +Promise.prototype.asCallback = Promise.prototype.nodeify = function (nodeback, + options) { + if (typeof nodeback == "function") { + var adapter = successAdapter; + if (options !== undefined && Object(options).spread) { + adapter = spreadAdapter; + } + this._then( + adapter, + errorAdapter, + undefined, + this, + nodeback + ); + } + return this; +}; +}; diff --git a/publisher/node_modules/bluebird/js/release/promise.js b/publisher/node_modules/bluebird/js/release/promise.js new file mode 100644 index 00000000..622a86f4 --- /dev/null +++ b/publisher/node_modules/bluebird/js/release/promise.js @@ -0,0 +1,819 @@ +"use strict"; +module.exports = function() { +var makeSelfResolutionError = function () { + return new TypeError("circular promise resolution chain\u000a\u000a See http://goo.gl/MqrFmX\u000a"); +}; +var reflectHandler = function() { + return new Promise.PromiseInspection(this._target()); +}; +var apiRejection = function(msg) { + return Promise.reject(new TypeError(msg)); +}; +function Proxyable() {} +var UNDEFINED_BINDING = {}; +var util = require("./util"); +util.setReflectHandler(reflectHandler); + +var getDomain = function() { + var domain = process.domain; + if (domain === undefined) { + return null; + } + return domain; +}; +var getContextDefault = function() { + return null; +}; +var getContextDomain = function() { + return { + domain: getDomain(), + async: null + }; +}; +var AsyncResource = util.isNode && util.nodeSupportsAsyncResource ? + require("async_hooks").AsyncResource : null; +var getContextAsyncHooks = function() { + return { + domain: getDomain(), + async: new AsyncResource("Bluebird::Promise") + }; +}; +var getContext = util.isNode ? getContextDomain : getContextDefault; +util.notEnumerableProp(Promise, "_getContext", getContext); +var enableAsyncHooks = function() { + getContext = getContextAsyncHooks; + util.notEnumerableProp(Promise, "_getContext", getContextAsyncHooks); +}; +var disableAsyncHooks = function() { + getContext = getContextDomain; + util.notEnumerableProp(Promise, "_getContext", getContextDomain); +}; + +var es5 = require("./es5"); +var Async = require("./async"); +var async = new Async(); +es5.defineProperty(Promise, "_async", {value: async}); +var errors = require("./errors"); +var TypeError = Promise.TypeError = errors.TypeError; +Promise.RangeError = errors.RangeError; +var CancellationError = Promise.CancellationError = errors.CancellationError; +Promise.TimeoutError = errors.TimeoutError; +Promise.OperationalError = errors.OperationalError; +Promise.RejectionError = errors.OperationalError; +Promise.AggregateError = errors.AggregateError; +var INTERNAL = function(){}; +var APPLY = {}; +var NEXT_FILTER = {}; +var tryConvertToPromise = require("./thenables")(Promise, INTERNAL); +var PromiseArray = + require("./promise_array")(Promise, INTERNAL, + tryConvertToPromise, apiRejection, Proxyable); +var Context = require("./context")(Promise); + /*jshint unused:false*/ +var createContext = Context.create; + +var debug = require("./debuggability")(Promise, Context, + enableAsyncHooks, disableAsyncHooks); +var CapturedTrace = debug.CapturedTrace; +var PassThroughHandlerContext = + require("./finally")(Promise, tryConvertToPromise, NEXT_FILTER); +var catchFilter = require("./catch_filter")(NEXT_FILTER); +var nodebackForPromise = require("./nodeback"); +var errorObj = util.errorObj; +var tryCatch = util.tryCatch; +function check(self, executor) { + if (self == null || self.constructor !== Promise) { + throw new TypeError("the promise constructor cannot be invoked directly\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + if (typeof executor !== "function") { + throw new TypeError("expecting a function but got " + util.classString(executor)); + } + +} + +function Promise(executor) { + if (executor !== INTERNAL) { + check(this, executor); + } + this._bitField = 0; + this._fulfillmentHandler0 = undefined; + this._rejectionHandler0 = undefined; + this._promise0 = undefined; + this._receiver0 = undefined; + this._resolveFromExecutor(executor); + this._promiseCreated(); + this._fireEvent("promiseCreated", this); +} + +Promise.prototype.toString = function () { + return "[object Promise]"; +}; + +Promise.prototype.caught = Promise.prototype["catch"] = function (fn) { + var len = arguments.length; + if (len > 1) { + var catchInstances = new Array(len - 1), + j = 0, i; + for (i = 0; i < len - 1; ++i) { + var item = arguments[i]; + if (util.isObject(item)) { + catchInstances[j++] = item; + } else { + return apiRejection("Catch statement predicate: " + + "expecting an object but got " + util.classString(item)); + } + } + catchInstances.length = j; + fn = arguments[i]; + + if (typeof fn !== "function") { + throw new TypeError("The last argument to .catch() " + + "must be a function, got " + util.toString(fn)); + } + return this.then(undefined, catchFilter(catchInstances, fn, this)); + } + return this.then(undefined, fn); +}; + +Promise.prototype.reflect = function () { + return this._then(reflectHandler, + reflectHandler, undefined, this, undefined); +}; + +Promise.prototype.then = function (didFulfill, didReject) { + if (debug.warnings() && arguments.length > 0 && + typeof didFulfill !== "function" && + typeof didReject !== "function") { + var msg = ".then() only accepts functions but was passed: " + + util.classString(didFulfill); + if (arguments.length > 1) { + msg += ", " + util.classString(didReject); + } + this._warn(msg); + } + return this._then(didFulfill, didReject, undefined, undefined, undefined); +}; + +Promise.prototype.done = function (didFulfill, didReject) { + var promise = + this._then(didFulfill, didReject, undefined, undefined, undefined); + promise._setIsFinal(); +}; + +Promise.prototype.spread = function (fn) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + return this.all()._then(fn, undefined, undefined, APPLY, undefined); +}; + +Promise.prototype.toJSON = function () { + var ret = { + isFulfilled: false, + isRejected: false, + fulfillmentValue: undefined, + rejectionReason: undefined + }; + if (this.isFulfilled()) { + ret.fulfillmentValue = this.value(); + ret.isFulfilled = true; + } else if (this.isRejected()) { + ret.rejectionReason = this.reason(); + ret.isRejected = true; + } + return ret; +}; + +Promise.prototype.all = function () { + if (arguments.length > 0) { + this._warn(".all() was passed arguments but it does not take any"); + } + return new PromiseArray(this).promise(); +}; + +Promise.prototype.error = function (fn) { + return this.caught(util.originatesFromRejection, fn); +}; + +Promise.getNewLibraryCopy = module.exports; + +Promise.is = function (val) { + return val instanceof Promise; +}; + +Promise.fromNode = Promise.fromCallback = function(fn) { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + var multiArgs = arguments.length > 1 ? !!Object(arguments[1]).multiArgs + : false; + var result = tryCatch(fn)(nodebackForPromise(ret, multiArgs)); + if (result === errorObj) { + ret._rejectCallback(result.e, true); + } + if (!ret._isFateSealed()) ret._setAsyncGuaranteed(); + return ret; +}; + +Promise.all = function (promises) { + return new PromiseArray(promises).promise(); +}; + +Promise.cast = function (obj) { + var ret = tryConvertToPromise(obj); + if (!(ret instanceof Promise)) { + ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._setFulfilled(); + ret._rejectionHandler0 = obj; + } + return ret; +}; + +Promise.resolve = Promise.fulfilled = Promise.cast; + +Promise.reject = Promise.rejected = function (reason) { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._rejectCallback(reason, true); + return ret; +}; + +Promise.setScheduler = function(fn) { + if (typeof fn !== "function") { + throw new TypeError("expecting a function but got " + util.classString(fn)); + } + return async.setScheduler(fn); +}; + +Promise.prototype._then = function ( + didFulfill, + didReject, + _, receiver, + internalData +) { + var haveInternalData = internalData !== undefined; + var promise = haveInternalData ? internalData : new Promise(INTERNAL); + var target = this._target(); + var bitField = target._bitField; + + if (!haveInternalData) { + promise._propagateFrom(this, 3); + promise._captureStackTrace(); + if (receiver === undefined && + ((this._bitField & 2097152) !== 0)) { + if (!((bitField & 50397184) === 0)) { + receiver = this._boundValue(); + } else { + receiver = target === this ? undefined : this._boundTo; + } + } + this._fireEvent("promiseChained", this, promise); + } + + var context = getContext(); + if (!((bitField & 50397184) === 0)) { + var handler, value, settler = target._settlePromiseCtx; + if (((bitField & 33554432) !== 0)) { + value = target._rejectionHandler0; + handler = didFulfill; + } else if (((bitField & 16777216) !== 0)) { + value = target._fulfillmentHandler0; + handler = didReject; + target._unsetRejectionIsUnhandled(); + } else { + settler = target._settlePromiseLateCancellationObserver; + value = new CancellationError("late cancellation observer"); + target._attachExtraTrace(value); + handler = didReject; + } + + async.invoke(settler, target, { + handler: util.contextBind(context, handler), + promise: promise, + receiver: receiver, + value: value + }); + } else { + target._addCallbacks(didFulfill, didReject, promise, + receiver, context); + } + + return promise; +}; + +Promise.prototype._length = function () { + return this._bitField & 65535; +}; + +Promise.prototype._isFateSealed = function () { + return (this._bitField & 117506048) !== 0; +}; + +Promise.prototype._isFollowing = function () { + return (this._bitField & 67108864) === 67108864; +}; + +Promise.prototype._setLength = function (len) { + this._bitField = (this._bitField & -65536) | + (len & 65535); +}; + +Promise.prototype._setFulfilled = function () { + this._bitField = this._bitField | 33554432; + this._fireEvent("promiseFulfilled", this); +}; + +Promise.prototype._setRejected = function () { + this._bitField = this._bitField | 16777216; + this._fireEvent("promiseRejected", this); +}; + +Promise.prototype._setFollowing = function () { + this._bitField = this._bitField | 67108864; + this._fireEvent("promiseResolved", this); +}; + +Promise.prototype._setIsFinal = function () { + this._bitField = this._bitField | 4194304; +}; + +Promise.prototype._isFinal = function () { + return (this._bitField & 4194304) > 0; +}; + +Promise.prototype._unsetCancelled = function() { + this._bitField = this._bitField & (~65536); +}; + +Promise.prototype._setCancelled = function() { + this._bitField = this._bitField | 65536; + this._fireEvent("promiseCancelled", this); +}; + +Promise.prototype._setWillBeCancelled = function() { + this._bitField = this._bitField | 8388608; +}; + +Promise.prototype._setAsyncGuaranteed = function() { + if (async.hasCustomScheduler()) return; + var bitField = this._bitField; + this._bitField = bitField | + (((bitField & 536870912) >> 2) ^ + 134217728); +}; + +Promise.prototype._setNoAsyncGuarantee = function() { + this._bitField = (this._bitField | 536870912) & + (~134217728); +}; + +Promise.prototype._receiverAt = function (index) { + var ret = index === 0 ? this._receiver0 : this[ + index * 4 - 4 + 3]; + if (ret === UNDEFINED_BINDING) { + return undefined; + } else if (ret === undefined && this._isBound()) { + return this._boundValue(); + } + return ret; +}; + +Promise.prototype._promiseAt = function (index) { + return this[ + index * 4 - 4 + 2]; +}; + +Promise.prototype._fulfillmentHandlerAt = function (index) { + return this[ + index * 4 - 4 + 0]; +}; + +Promise.prototype._rejectionHandlerAt = function (index) { + return this[ + index * 4 - 4 + 1]; +}; + +Promise.prototype._boundValue = function() {}; + +Promise.prototype._migrateCallback0 = function (follower) { + var bitField = follower._bitField; + var fulfill = follower._fulfillmentHandler0; + var reject = follower._rejectionHandler0; + var promise = follower._promise0; + var receiver = follower._receiverAt(0); + if (receiver === undefined) receiver = UNDEFINED_BINDING; + this._addCallbacks(fulfill, reject, promise, receiver, null); +}; + +Promise.prototype._migrateCallbackAt = function (follower, index) { + var fulfill = follower._fulfillmentHandlerAt(index); + var reject = follower._rejectionHandlerAt(index); + var promise = follower._promiseAt(index); + var receiver = follower._receiverAt(index); + if (receiver === undefined) receiver = UNDEFINED_BINDING; + this._addCallbacks(fulfill, reject, promise, receiver, null); +}; + +Promise.prototype._addCallbacks = function ( + fulfill, + reject, + promise, + receiver, + context +) { + var index = this._length(); + + if (index >= 65535 - 4) { + index = 0; + this._setLength(0); + } + + if (index === 0) { + this._promise0 = promise; + this._receiver0 = receiver; + if (typeof fulfill === "function") { + this._fulfillmentHandler0 = util.contextBind(context, fulfill); + } + if (typeof reject === "function") { + this._rejectionHandler0 = util.contextBind(context, reject); + } + } else { + var base = index * 4 - 4; + this[base + 2] = promise; + this[base + 3] = receiver; + if (typeof fulfill === "function") { + this[base + 0] = + util.contextBind(context, fulfill); + } + if (typeof reject === "function") { + this[base + 1] = + util.contextBind(context, reject); + } + } + this._setLength(index + 1); + return index; +}; + +Promise.prototype._proxy = function (proxyable, arg) { + this._addCallbacks(undefined, undefined, arg, proxyable, null); +}; + +Promise.prototype._resolveCallback = function(value, shouldBind) { + if (((this._bitField & 117506048) !== 0)) return; + if (value === this) + return this._rejectCallback(makeSelfResolutionError(), false); + var maybePromise = tryConvertToPromise(value, this); + if (!(maybePromise instanceof Promise)) return this._fulfill(value); + + if (shouldBind) this._propagateFrom(maybePromise, 2); + + + var promise = maybePromise._target(); + + if (promise === this) { + this._reject(makeSelfResolutionError()); + return; + } + + var bitField = promise._bitField; + if (((bitField & 50397184) === 0)) { + var len = this._length(); + if (len > 0) promise._migrateCallback0(this); + for (var i = 1; i < len; ++i) { + promise._migrateCallbackAt(this, i); + } + this._setFollowing(); + this._setLength(0); + this._setFollowee(maybePromise); + } else if (((bitField & 33554432) !== 0)) { + this._fulfill(promise._value()); + } else if (((bitField & 16777216) !== 0)) { + this._reject(promise._reason()); + } else { + var reason = new CancellationError("late cancellation observer"); + promise._attachExtraTrace(reason); + this._reject(reason); + } +}; + +Promise.prototype._rejectCallback = +function(reason, synchronous, ignoreNonErrorWarnings) { + var trace = util.ensureErrorObject(reason); + var hasStack = trace === reason; + if (!hasStack && !ignoreNonErrorWarnings && debug.warnings()) { + var message = "a promise was rejected with a non-error: " + + util.classString(reason); + this._warn(message, true); + } + this._attachExtraTrace(trace, synchronous ? hasStack : false); + this._reject(reason); +}; + +Promise.prototype._resolveFromExecutor = function (executor) { + if (executor === INTERNAL) return; + var promise = this; + this._captureStackTrace(); + this._pushContext(); + var synchronous = true; + var r = this._execute(executor, function(value) { + promise._resolveCallback(value); + }, function (reason) { + promise._rejectCallback(reason, synchronous); + }); + synchronous = false; + this._popContext(); + + if (r !== undefined) { + promise._rejectCallback(r, true); + } +}; + +Promise.prototype._settlePromiseFromHandler = function ( + handler, receiver, value, promise +) { + var bitField = promise._bitField; + if (((bitField & 65536) !== 0)) return; + promise._pushContext(); + var x; + if (receiver === APPLY) { + if (!value || typeof value.length !== "number") { + x = errorObj; + x.e = new TypeError("cannot .spread() a non-array: " + + util.classString(value)); + } else { + x = tryCatch(handler).apply(this._boundValue(), value); + } + } else { + x = tryCatch(handler).call(receiver, value); + } + var promiseCreated = promise._popContext(); + bitField = promise._bitField; + if (((bitField & 65536) !== 0)) return; + + if (x === NEXT_FILTER) { + promise._reject(value); + } else if (x === errorObj) { + promise._rejectCallback(x.e, false); + } else { + debug.checkForgottenReturns(x, promiseCreated, "", promise, this); + promise._resolveCallback(x); + } +}; + +Promise.prototype._target = function() { + var ret = this; + while (ret._isFollowing()) ret = ret._followee(); + return ret; +}; + +Promise.prototype._followee = function() { + return this._rejectionHandler0; +}; + +Promise.prototype._setFollowee = function(promise) { + this._rejectionHandler0 = promise; +}; + +Promise.prototype._settlePromise = function(promise, handler, receiver, value) { + var isPromise = promise instanceof Promise; + var bitField = this._bitField; + var asyncGuaranteed = ((bitField & 134217728) !== 0); + if (((bitField & 65536) !== 0)) { + if (isPromise) promise._invokeInternalOnCancel(); + + if (receiver instanceof PassThroughHandlerContext && + receiver.isFinallyHandler()) { + receiver.cancelPromise = promise; + if (tryCatch(handler).call(receiver, value) === errorObj) { + promise._reject(errorObj.e); + } + } else if (handler === reflectHandler) { + promise._fulfill(reflectHandler.call(receiver)); + } else if (receiver instanceof Proxyable) { + receiver._promiseCancelled(promise); + } else if (isPromise || promise instanceof PromiseArray) { + promise._cancel(); + } else { + receiver.cancel(); + } + } else if (typeof handler === "function") { + if (!isPromise) { + handler.call(receiver, value, promise); + } else { + if (asyncGuaranteed) promise._setAsyncGuaranteed(); + this._settlePromiseFromHandler(handler, receiver, value, promise); + } + } else if (receiver instanceof Proxyable) { + if (!receiver._isResolved()) { + if (((bitField & 33554432) !== 0)) { + receiver._promiseFulfilled(value, promise); + } else { + receiver._promiseRejected(value, promise); + } + } + } else if (isPromise) { + if (asyncGuaranteed) promise._setAsyncGuaranteed(); + if (((bitField & 33554432) !== 0)) { + promise._fulfill(value); + } else { + promise._reject(value); + } + } +}; + +Promise.prototype._settlePromiseLateCancellationObserver = function(ctx) { + var handler = ctx.handler; + var promise = ctx.promise; + var receiver = ctx.receiver; + var value = ctx.value; + if (typeof handler === "function") { + if (!(promise instanceof Promise)) { + handler.call(receiver, value, promise); + } else { + this._settlePromiseFromHandler(handler, receiver, value, promise); + } + } else if (promise instanceof Promise) { + promise._reject(value); + } +}; + +Promise.prototype._settlePromiseCtx = function(ctx) { + this._settlePromise(ctx.promise, ctx.handler, ctx.receiver, ctx.value); +}; + +Promise.prototype._settlePromise0 = function(handler, value, bitField) { + var promise = this._promise0; + var receiver = this._receiverAt(0); + this._promise0 = undefined; + this._receiver0 = undefined; + this._settlePromise(promise, handler, receiver, value); +}; + +Promise.prototype._clearCallbackDataAtIndex = function(index) { + var base = index * 4 - 4; + this[base + 2] = + this[base + 3] = + this[base + 0] = + this[base + 1] = undefined; +}; + +Promise.prototype._fulfill = function (value) { + var bitField = this._bitField; + if (((bitField & 117506048) >>> 16)) return; + if (value === this) { + var err = makeSelfResolutionError(); + this._attachExtraTrace(err); + return this._reject(err); + } + this._setFulfilled(); + this._rejectionHandler0 = value; + + if ((bitField & 65535) > 0) { + if (((bitField & 134217728) !== 0)) { + this._settlePromises(); + } else { + async.settlePromises(this); + } + this._dereferenceTrace(); + } +}; + +Promise.prototype._reject = function (reason) { + var bitField = this._bitField; + if (((bitField & 117506048) >>> 16)) return; + this._setRejected(); + this._fulfillmentHandler0 = reason; + + if (this._isFinal()) { + return async.fatalError(reason, util.isNode); + } + + if ((bitField & 65535) > 0) { + async.settlePromises(this); + } else { + this._ensurePossibleRejectionHandled(); + } +}; + +Promise.prototype._fulfillPromises = function (len, value) { + for (var i = 1; i < len; i++) { + var handler = this._fulfillmentHandlerAt(i); + var promise = this._promiseAt(i); + var receiver = this._receiverAt(i); + this._clearCallbackDataAtIndex(i); + this._settlePromise(promise, handler, receiver, value); + } +}; + +Promise.prototype._rejectPromises = function (len, reason) { + for (var i = 1; i < len; i++) { + var handler = this._rejectionHandlerAt(i); + var promise = this._promiseAt(i); + var receiver = this._receiverAt(i); + this._clearCallbackDataAtIndex(i); + this._settlePromise(promise, handler, receiver, reason); + } +}; + +Promise.prototype._settlePromises = function () { + var bitField = this._bitField; + var len = (bitField & 65535); + + if (len > 0) { + if (((bitField & 16842752) !== 0)) { + var reason = this._fulfillmentHandler0; + this._settlePromise0(this._rejectionHandler0, reason, bitField); + this._rejectPromises(len, reason); + } else { + var value = this._rejectionHandler0; + this._settlePromise0(this._fulfillmentHandler0, value, bitField); + this._fulfillPromises(len, value); + } + this._setLength(0); + } + this._clearCancellationData(); +}; + +Promise.prototype._settledValue = function() { + var bitField = this._bitField; + if (((bitField & 33554432) !== 0)) { + return this._rejectionHandler0; + } else if (((bitField & 16777216) !== 0)) { + return this._fulfillmentHandler0; + } +}; + +if (typeof Symbol !== "undefined" && Symbol.toStringTag) { + es5.defineProperty(Promise.prototype, Symbol.toStringTag, { + get: function () { + return "Object"; + } + }); +} + +function deferResolve(v) {this.promise._resolveCallback(v);} +function deferReject(v) {this.promise._rejectCallback(v, false);} + +Promise.defer = Promise.pending = function() { + debug.deprecated("Promise.defer", "new Promise"); + var promise = new Promise(INTERNAL); + return { + promise: promise, + resolve: deferResolve, + reject: deferReject + }; +}; + +util.notEnumerableProp(Promise, + "_makeSelfResolutionError", + makeSelfResolutionError); + +require("./method")(Promise, INTERNAL, tryConvertToPromise, apiRejection, + debug); +require("./bind")(Promise, INTERNAL, tryConvertToPromise, debug); +require("./cancel")(Promise, PromiseArray, apiRejection, debug); +require("./direct_resolve")(Promise); +require("./synchronous_inspection")(Promise); +require("./join")( + Promise, PromiseArray, tryConvertToPromise, INTERNAL, async); +Promise.Promise = Promise; +Promise.version = "3.7.2"; +require('./call_get.js')(Promise); +require('./generators.js')(Promise, apiRejection, INTERNAL, tryConvertToPromise, Proxyable, debug); +require('./map.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug); +require('./nodeify.js')(Promise); +require('./promisify.js')(Promise, INTERNAL); +require('./props.js')(Promise, PromiseArray, tryConvertToPromise, apiRejection); +require('./race.js')(Promise, INTERNAL, tryConvertToPromise, apiRejection); +require('./reduce.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug); +require('./settle.js')(Promise, PromiseArray, debug); +require('./some.js')(Promise, PromiseArray, apiRejection); +require('./timers.js')(Promise, INTERNAL, debug); +require('./using.js')(Promise, apiRejection, tryConvertToPromise, createContext, INTERNAL, debug); +require('./any.js')(Promise); +require('./each.js')(Promise, INTERNAL); +require('./filter.js')(Promise, INTERNAL); + + util.toFastProperties(Promise); + util.toFastProperties(Promise.prototype); + function fillTypes(value) { + var p = new Promise(INTERNAL); + p._fulfillmentHandler0 = value; + p._rejectionHandler0 = value; + p._promise0 = value; + p._receiver0 = value; + } + // Complete slack tracking, opt out of field-type tracking and + // stabilize map + fillTypes({a: 1}); + fillTypes({b: 2}); + fillTypes({c: 3}); + fillTypes(1); + fillTypes(function(){}); + fillTypes(undefined); + fillTypes(false); + fillTypes(new Promise(INTERNAL)); + debug.setBounds(Async.firstLineError, util.lastLineError); + return Promise; + +}; diff --git a/publisher/node_modules/bluebird/js/release/promise_array.js b/publisher/node_modules/bluebird/js/release/promise_array.js new file mode 100644 index 00000000..8fc665a4 --- /dev/null +++ b/publisher/node_modules/bluebird/js/release/promise_array.js @@ -0,0 +1,186 @@ +"use strict"; +module.exports = function(Promise, INTERNAL, tryConvertToPromise, + apiRejection, Proxyable) { +var util = require("./util"); +var isArray = util.isArray; + +function toResolutionValue(val) { + switch(val) { + case -2: return []; + case -3: return {}; + case -6: return new Map(); + } +} + +function PromiseArray(values) { + var promise = this._promise = new Promise(INTERNAL); + if (values instanceof Promise) { + promise._propagateFrom(values, 3); + values.suppressUnhandledRejections(); + } + promise._setOnCancel(this); + this._values = values; + this._length = 0; + this._totalResolved = 0; + this._init(undefined, -2); +} +util.inherits(PromiseArray, Proxyable); + +PromiseArray.prototype.length = function () { + return this._length; +}; + +PromiseArray.prototype.promise = function () { + return this._promise; +}; + +PromiseArray.prototype._init = function init(_, resolveValueIfEmpty) { + var values = tryConvertToPromise(this._values, this._promise); + if (values instanceof Promise) { + values = values._target(); + var bitField = values._bitField; + ; + this._values = values; + + if (((bitField & 50397184) === 0)) { + this._promise._setAsyncGuaranteed(); + return values._then( + init, + this._reject, + undefined, + this, + resolveValueIfEmpty + ); + } else if (((bitField & 33554432) !== 0)) { + values = values._value(); + } else if (((bitField & 16777216) !== 0)) { + return this._reject(values._reason()); + } else { + return this._cancel(); + } + } + values = util.asArray(values); + if (values === null) { + var err = apiRejection( + "expecting an array or an iterable object but got " + util.classString(values)).reason(); + this._promise._rejectCallback(err, false); + return; + } + + if (values.length === 0) { + if (resolveValueIfEmpty === -5) { + this._resolveEmptyArray(); + } + else { + this._resolve(toResolutionValue(resolveValueIfEmpty)); + } + return; + } + this._iterate(values); +}; + +PromiseArray.prototype._iterate = function(values) { + var len = this.getActualLength(values.length); + this._length = len; + this._values = this.shouldCopyValues() ? new Array(len) : this._values; + var result = this._promise; + var isResolved = false; + var bitField = null; + for (var i = 0; i < len; ++i) { + var maybePromise = tryConvertToPromise(values[i], result); + + if (maybePromise instanceof Promise) { + maybePromise = maybePromise._target(); + bitField = maybePromise._bitField; + } else { + bitField = null; + } + + if (isResolved) { + if (bitField !== null) { + maybePromise.suppressUnhandledRejections(); + } + } else if (bitField !== null) { + if (((bitField & 50397184) === 0)) { + maybePromise._proxy(this, i); + this._values[i] = maybePromise; + } else if (((bitField & 33554432) !== 0)) { + isResolved = this._promiseFulfilled(maybePromise._value(), i); + } else if (((bitField & 16777216) !== 0)) { + isResolved = this._promiseRejected(maybePromise._reason(), i); + } else { + isResolved = this._promiseCancelled(i); + } + } else { + isResolved = this._promiseFulfilled(maybePromise, i); + } + } + if (!isResolved) result._setAsyncGuaranteed(); +}; + +PromiseArray.prototype._isResolved = function () { + return this._values === null; +}; + +PromiseArray.prototype._resolve = function (value) { + this._values = null; + this._promise._fulfill(value); +}; + +PromiseArray.prototype._cancel = function() { + if (this._isResolved() || !this._promise._isCancellable()) return; + this._values = null; + this._promise._cancel(); +}; + +PromiseArray.prototype._reject = function (reason) { + this._values = null; + this._promise._rejectCallback(reason, false); +}; + +PromiseArray.prototype._promiseFulfilled = function (value, index) { + this._values[index] = value; + var totalResolved = ++this._totalResolved; + if (totalResolved >= this._length) { + this._resolve(this._values); + return true; + } + return false; +}; + +PromiseArray.prototype._promiseCancelled = function() { + this._cancel(); + return true; +}; + +PromiseArray.prototype._promiseRejected = function (reason) { + this._totalResolved++; + this._reject(reason); + return true; +}; + +PromiseArray.prototype._resultCancelled = function() { + if (this._isResolved()) return; + var values = this._values; + this._cancel(); + if (values instanceof Promise) { + values.cancel(); + } else { + for (var i = 0; i < values.length; ++i) { + if (values[i] instanceof Promise) { + values[i].cancel(); + } + } + } +}; + +PromiseArray.prototype.shouldCopyValues = function () { + return true; +}; + +PromiseArray.prototype.getActualLength = function (len) { + return len; +}; + +return PromiseArray; +}; diff --git a/publisher/node_modules/bluebird/js/release/promisify.js b/publisher/node_modules/bluebird/js/release/promisify.js new file mode 100644 index 00000000..aa98e5bd --- /dev/null +++ b/publisher/node_modules/bluebird/js/release/promisify.js @@ -0,0 +1,314 @@ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var THIS = {}; +var util = require("./util"); +var nodebackForPromise = require("./nodeback"); +var withAppended = util.withAppended; +var maybeWrapAsError = util.maybeWrapAsError; +var canEvaluate = util.canEvaluate; +var TypeError = require("./errors").TypeError; +var defaultSuffix = "Async"; +var defaultPromisified = {__isPromisified__: true}; +var noCopyProps = [ + "arity", "length", + "name", + "arguments", + "caller", + "callee", + "prototype", + "__isPromisified__" +]; +var noCopyPropsPattern = new RegExp("^(?:" + noCopyProps.join("|") + ")$"); + +var defaultFilter = function(name) { + return util.isIdentifier(name) && + name.charAt(0) !== "_" && + name !== "constructor"; +}; + +function propsFilter(key) { + return !noCopyPropsPattern.test(key); +} + +function isPromisified(fn) { + try { + return fn.__isPromisified__ === true; + } + catch (e) { + return false; + } +} + +function hasPromisified(obj, key, suffix) { + var val = util.getDataPropertyOrDefault(obj, key + suffix, + defaultPromisified); + return val ? isPromisified(val) : false; +} +function checkValid(ret, suffix, suffixRegexp) { + for (var i = 0; i < ret.length; i += 2) { + var key = ret[i]; + if (suffixRegexp.test(key)) { + var keyWithoutAsyncSuffix = key.replace(suffixRegexp, ""); + for (var j = 0; j < ret.length; j += 2) { + if (ret[j] === keyWithoutAsyncSuffix) { + throw new TypeError("Cannot promisify an API that has normal methods with '%s'-suffix\u000a\u000a See http://goo.gl/MqrFmX\u000a" + .replace("%s", suffix)); + } + } + } + } +} + +function promisifiableMethods(obj, suffix, suffixRegexp, filter) { + var keys = util.inheritedDataKeys(obj); + var ret = []; + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + var value = obj[key]; + var passesDefaultFilter = filter === defaultFilter + ? true : defaultFilter(key, value, obj); + if (typeof value === "function" && + !isPromisified(value) && + !hasPromisified(obj, key, suffix) && + filter(key, value, obj, passesDefaultFilter)) { + ret.push(key, value); + } + } + checkValid(ret, suffix, suffixRegexp); + return ret; +} + +var escapeIdentRegex = function(str) { + return str.replace(/([$])/, "\\$"); +}; + +var makeNodePromisifiedEval; +if (!false) { +var switchCaseArgumentOrder = function(likelyArgumentCount) { + var ret = [likelyArgumentCount]; + var min = Math.max(0, likelyArgumentCount - 1 - 3); + for(var i = likelyArgumentCount - 1; i >= min; --i) { + ret.push(i); + } + for(var i = likelyArgumentCount + 1; i <= 3; ++i) { + ret.push(i); + } + return ret; +}; + +var argumentSequence = function(argumentCount) { + return util.filledRange(argumentCount, "_arg", ""); +}; + +var parameterDeclaration = function(parameterCount) { + return util.filledRange( + Math.max(parameterCount, 3), "_arg", ""); +}; + +var parameterCount = function(fn) { + if (typeof fn.length === "number") { + return Math.max(Math.min(fn.length, 1023 + 1), 0); + } + return 0; +}; + +makeNodePromisifiedEval = +function(callback, receiver, originalName, fn, _, multiArgs) { + var newParameterCount = Math.max(0, parameterCount(fn) - 1); + var argumentOrder = switchCaseArgumentOrder(newParameterCount); + var shouldProxyThis = typeof callback === "string" || receiver === THIS; + + function generateCallForArgumentCount(count) { + var args = argumentSequence(count).join(", "); + var comma = count > 0 ? ", " : ""; + var ret; + if (shouldProxyThis) { + ret = "ret = callback.call(this, {{args}}, nodeback); break;\n"; + } else { + ret = receiver === undefined + ? "ret = callback({{args}}, nodeback); break;\n" + : "ret = callback.call(receiver, {{args}}, nodeback); break;\n"; + } + return ret.replace("{{args}}", args).replace(", ", comma); + } + + function generateArgumentSwitchCase() { + var ret = ""; + for (var i = 0; i < argumentOrder.length; ++i) { + ret += "case " + argumentOrder[i] +":" + + generateCallForArgumentCount(argumentOrder[i]); + } + + ret += " \n\ + default: \n\ + var args = new Array(len + 1); \n\ + var i = 0; \n\ + for (var i = 0; i < len; ++i) { \n\ + args[i] = arguments[i]; \n\ + } \n\ + args[i] = nodeback; \n\ + [CodeForCall] \n\ + break; \n\ + ".replace("[CodeForCall]", (shouldProxyThis + ? "ret = callback.apply(this, args);\n" + : "ret = callback.apply(receiver, args);\n")); + return ret; + } + + var getFunctionCode = typeof callback === "string" + ? ("this != null ? this['"+callback+"'] : fn") + : "fn"; + var body = "'use strict'; \n\ + var ret = function (Parameters) { \n\ + 'use strict'; \n\ + var len = arguments.length; \n\ + var promise = new Promise(INTERNAL); \n\ + promise._captureStackTrace(); \n\ + var nodeback = nodebackForPromise(promise, " + multiArgs + "); \n\ + var ret; \n\ + var callback = tryCatch([GetFunctionCode]); \n\ + switch(len) { \n\ + [CodeForSwitchCase] \n\ + } \n\ + if (ret === errorObj) { \n\ + promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\n\ + } \n\ + if (!promise._isFateSealed()) promise._setAsyncGuaranteed(); \n\ + return promise; \n\ + }; \n\ + notEnumerableProp(ret, '__isPromisified__', true); \n\ + return ret; \n\ + ".replace("[CodeForSwitchCase]", generateArgumentSwitchCase()) + .replace("[GetFunctionCode]", getFunctionCode); + body = body.replace("Parameters", parameterDeclaration(newParameterCount)); + return new Function("Promise", + "fn", + "receiver", + "withAppended", + "maybeWrapAsError", + "nodebackForPromise", + "tryCatch", + "errorObj", + "notEnumerableProp", + "INTERNAL", + body)( + Promise, + fn, + receiver, + withAppended, + maybeWrapAsError, + nodebackForPromise, + util.tryCatch, + util.errorObj, + util.notEnumerableProp, + INTERNAL); +}; +} + +function makeNodePromisifiedClosure(callback, receiver, _, fn, __, multiArgs) { + var defaultThis = (function() {return this;})(); + var method = callback; + if (typeof method === "string") { + callback = fn; + } + function promisified() { + var _receiver = receiver; + if (receiver === THIS) _receiver = this; + var promise = new Promise(INTERNAL); + promise._captureStackTrace(); + var cb = typeof method === "string" && this !== defaultThis + ? this[method] : callback; + var fn = nodebackForPromise(promise, multiArgs); + try { + cb.apply(_receiver, withAppended(arguments, fn)); + } catch(e) { + promise._rejectCallback(maybeWrapAsError(e), true, true); + } + if (!promise._isFateSealed()) promise._setAsyncGuaranteed(); + return promise; + } + util.notEnumerableProp(promisified, "__isPromisified__", true); + return promisified; +} + +var makeNodePromisified = canEvaluate + ? makeNodePromisifiedEval + : makeNodePromisifiedClosure; + +function promisifyAll(obj, suffix, filter, promisifier, multiArgs) { + var suffixRegexp = new RegExp(escapeIdentRegex(suffix) + "$"); + var methods = + promisifiableMethods(obj, suffix, suffixRegexp, filter); + + for (var i = 0, len = methods.length; i < len; i+= 2) { + var key = methods[i]; + var fn = methods[i+1]; + var promisifiedKey = key + suffix; + if (promisifier === makeNodePromisified) { + obj[promisifiedKey] = + makeNodePromisified(key, THIS, key, fn, suffix, multiArgs); + } else { + var promisified = promisifier(fn, function() { + return makeNodePromisified(key, THIS, key, + fn, suffix, multiArgs); + }); + util.notEnumerableProp(promisified, "__isPromisified__", true); + obj[promisifiedKey] = promisified; + } + } + util.toFastProperties(obj); + return obj; +} + +function promisify(callback, receiver, multiArgs) { + return makeNodePromisified(callback, receiver, undefined, + callback, null, multiArgs); +} + +Promise.promisify = function (fn, options) { + if (typeof fn !== "function") { + throw new TypeError("expecting a function but got " + util.classString(fn)); + } + if (isPromisified(fn)) { + return fn; + } + options = Object(options); + var receiver = options.context === undefined ? THIS : options.context; + var multiArgs = !!options.multiArgs; + var ret = promisify(fn, receiver, multiArgs); + util.copyDescriptors(fn, ret, propsFilter); + return ret; +}; + +Promise.promisifyAll = function (target, options) { + if (typeof target !== "function" && typeof target !== "object") { + throw new TypeError("the target of promisifyAll must be an object or a function\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + options = Object(options); + var multiArgs = !!options.multiArgs; + var suffix = options.suffix; + if (typeof suffix !== "string") suffix = defaultSuffix; + var filter = options.filter; + if (typeof filter !== "function") filter = defaultFilter; + var promisifier = options.promisifier; + if (typeof promisifier !== "function") promisifier = makeNodePromisified; + + if (!util.isIdentifier(suffix)) { + throw new RangeError("suffix must be a valid identifier\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + + var keys = util.inheritedDataKeys(target); + for (var i = 0; i < keys.length; ++i) { + var value = target[keys[i]]; + if (keys[i] !== "constructor" && + util.isClass(value)) { + promisifyAll(value.prototype, suffix, filter, promisifier, + multiArgs); + promisifyAll(value, suffix, filter, promisifier, multiArgs); + } + } + + return promisifyAll(target, suffix, filter, promisifier, multiArgs); +}; +}; + diff --git a/publisher/node_modules/bluebird/js/release/props.js b/publisher/node_modules/bluebird/js/release/props.js new file mode 100644 index 00000000..6a34aaf5 --- /dev/null +++ b/publisher/node_modules/bluebird/js/release/props.js @@ -0,0 +1,118 @@ +"use strict"; +module.exports = function( + Promise, PromiseArray, tryConvertToPromise, apiRejection) { +var util = require("./util"); +var isObject = util.isObject; +var es5 = require("./es5"); +var Es6Map; +if (typeof Map === "function") Es6Map = Map; + +var mapToEntries = (function() { + var index = 0; + var size = 0; + + function extractEntry(value, key) { + this[index] = value; + this[index + size] = key; + index++; + } + + return function mapToEntries(map) { + size = map.size; + index = 0; + var ret = new Array(map.size * 2); + map.forEach(extractEntry, ret); + return ret; + }; +})(); + +var entriesToMap = function(entries) { + var ret = new Es6Map(); + var length = entries.length / 2 | 0; + for (var i = 0; i < length; ++i) { + var key = entries[length + i]; + var value = entries[i]; + ret.set(key, value); + } + return ret; +}; + +function PropertiesPromiseArray(obj) { + var isMap = false; + var entries; + if (Es6Map !== undefined && obj instanceof Es6Map) { + entries = mapToEntries(obj); + isMap = true; + } else { + var keys = es5.keys(obj); + var len = keys.length; + entries = new Array(len * 2); + for (var i = 0; i < len; ++i) { + var key = keys[i]; + entries[i] = obj[key]; + entries[i + len] = key; + } + } + this.constructor$(entries); + this._isMap = isMap; + this._init$(undefined, isMap ? -6 : -3); +} +util.inherits(PropertiesPromiseArray, PromiseArray); + +PropertiesPromiseArray.prototype._init = function () {}; + +PropertiesPromiseArray.prototype._promiseFulfilled = function (value, index) { + this._values[index] = value; + var totalResolved = ++this._totalResolved; + if (totalResolved >= this._length) { + var val; + if (this._isMap) { + val = entriesToMap(this._values); + } else { + val = {}; + var keyOffset = this.length(); + for (var i = 0, len = this.length(); i < len; ++i) { + val[this._values[i + keyOffset]] = this._values[i]; + } + } + this._resolve(val); + return true; + } + return false; +}; + +PropertiesPromiseArray.prototype.shouldCopyValues = function () { + return false; +}; + +PropertiesPromiseArray.prototype.getActualLength = function (len) { + return len >> 1; +}; + +function props(promises) { + var ret; + var castValue = tryConvertToPromise(promises); + + if (!isObject(castValue)) { + return apiRejection("cannot await properties of a non-object\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } else if (castValue instanceof Promise) { + ret = castValue._then( + Promise.props, undefined, undefined, undefined, undefined); + } else { + ret = new PropertiesPromiseArray(castValue).promise(); + } + + if (castValue instanceof Promise) { + ret._propagateFrom(castValue, 2); + } + return ret; +} + +Promise.prototype.props = function () { + return props(this); +}; + +Promise.props = function (promises) { + return props(promises); +}; +}; diff --git a/publisher/node_modules/bluebird/js/release/queue.js b/publisher/node_modules/bluebird/js/release/queue.js new file mode 100644 index 00000000..ffd36fda --- /dev/null +++ b/publisher/node_modules/bluebird/js/release/queue.js @@ -0,0 +1,73 @@ +"use strict"; +function arrayMove(src, srcIndex, dst, dstIndex, len) { + for (var j = 0; j < len; ++j) { + dst[j + dstIndex] = src[j + srcIndex]; + src[j + srcIndex] = void 0; + } +} + +function Queue(capacity) { + this._capacity = capacity; + this._length = 0; + this._front = 0; +} + +Queue.prototype._willBeOverCapacity = function (size) { + return this._capacity < size; +}; + +Queue.prototype._pushOne = function (arg) { + var length = this.length(); + this._checkCapacity(length + 1); + var i = (this._front + length) & (this._capacity - 1); + this[i] = arg; + this._length = length + 1; +}; + +Queue.prototype.push = function (fn, receiver, arg) { + var length = this.length() + 3; + if (this._willBeOverCapacity(length)) { + this._pushOne(fn); + this._pushOne(receiver); + this._pushOne(arg); + return; + } + var j = this._front + length - 3; + this._checkCapacity(length); + var wrapMask = this._capacity - 1; + this[(j + 0) & wrapMask] = fn; + this[(j + 1) & wrapMask] = receiver; + this[(j + 2) & wrapMask] = arg; + this._length = length; +}; + +Queue.prototype.shift = function () { + var front = this._front, + ret = this[front]; + + this[front] = undefined; + this._front = (front + 1) & (this._capacity - 1); + this._length--; + return ret; +}; + +Queue.prototype.length = function () { + return this._length; +}; + +Queue.prototype._checkCapacity = function (size) { + if (this._capacity < size) { + this._resizeTo(this._capacity << 1); + } +}; + +Queue.prototype._resizeTo = function (capacity) { + var oldCapacity = this._capacity; + this._capacity = capacity; + var front = this._front; + var length = this._length; + var moveItemsCount = (front + length) & (oldCapacity - 1); + arrayMove(this, 0, this, oldCapacity, moveItemsCount); +}; + +module.exports = Queue; diff --git a/publisher/node_modules/bluebird/js/release/race.js b/publisher/node_modules/bluebird/js/release/race.js new file mode 100644 index 00000000..b862f46d --- /dev/null +++ b/publisher/node_modules/bluebird/js/release/race.js @@ -0,0 +1,49 @@ +"use strict"; +module.exports = function( + Promise, INTERNAL, tryConvertToPromise, apiRejection) { +var util = require("./util"); + +var raceLater = function (promise) { + return promise.then(function(array) { + return race(array, promise); + }); +}; + +function race(promises, parent) { + var maybePromise = tryConvertToPromise(promises); + + if (maybePromise instanceof Promise) { + return raceLater(maybePromise); + } else { + promises = util.asArray(promises); + if (promises === null) + return apiRejection("expecting an array or an iterable object but got " + util.classString(promises)); + } + + var ret = new Promise(INTERNAL); + if (parent !== undefined) { + ret._propagateFrom(parent, 3); + } + var fulfill = ret._fulfill; + var reject = ret._reject; + for (var i = 0, len = promises.length; i < len; ++i) { + var val = promises[i]; + + if (val === undefined && !(i in promises)) { + continue; + } + + Promise.cast(val)._then(fulfill, reject, undefined, ret, null); + } + return ret; +} + +Promise.race = function (promises) { + return race(promises, undefined); +}; + +Promise.prototype.race = function () { + return race(this, undefined); +}; + +}; diff --git a/publisher/node_modules/bluebird/js/release/reduce.js b/publisher/node_modules/bluebird/js/release/reduce.js new file mode 100644 index 00000000..101ac226 --- /dev/null +++ b/publisher/node_modules/bluebird/js/release/reduce.js @@ -0,0 +1,183 @@ +"use strict"; +module.exports = function(Promise, + PromiseArray, + apiRejection, + tryConvertToPromise, + INTERNAL, + debug) { +var util = require("./util"); +var tryCatch = util.tryCatch; + +function ReductionPromiseArray(promises, fn, initialValue, _each) { + this.constructor$(promises); + var context = Promise._getContext(); + this._fn = util.contextBind(context, fn); + if (initialValue !== undefined) { + initialValue = Promise.resolve(initialValue); + initialValue._attachCancellationCallback(this); + } + this._initialValue = initialValue; + this._currentCancellable = null; + if(_each === INTERNAL) { + this._eachValues = Array(this._length); + } else if (_each === 0) { + this._eachValues = null; + } else { + this._eachValues = undefined; + } + this._promise._captureStackTrace(); + this._init$(undefined, -5); +} +util.inherits(ReductionPromiseArray, PromiseArray); + +ReductionPromiseArray.prototype._gotAccum = function(accum) { + if (this._eachValues !== undefined && + this._eachValues !== null && + accum !== INTERNAL) { + this._eachValues.push(accum); + } +}; + +ReductionPromiseArray.prototype._eachComplete = function(value) { + if (this._eachValues !== null) { + this._eachValues.push(value); + } + return this._eachValues; +}; + +ReductionPromiseArray.prototype._init = function() {}; + +ReductionPromiseArray.prototype._resolveEmptyArray = function() { + this._resolve(this._eachValues !== undefined ? this._eachValues + : this._initialValue); +}; + +ReductionPromiseArray.prototype.shouldCopyValues = function () { + return false; +}; + +ReductionPromiseArray.prototype._resolve = function(value) { + this._promise._resolveCallback(value); + this._values = null; +}; + +ReductionPromiseArray.prototype._resultCancelled = function(sender) { + if (sender === this._initialValue) return this._cancel(); + if (this._isResolved()) return; + this._resultCancelled$(); + if (this._currentCancellable instanceof Promise) { + this._currentCancellable.cancel(); + } + if (this._initialValue instanceof Promise) { + this._initialValue.cancel(); + } +}; + +ReductionPromiseArray.prototype._iterate = function (values) { + this._values = values; + var value; + var i; + var length = values.length; + if (this._initialValue !== undefined) { + value = this._initialValue; + i = 0; + } else { + value = Promise.resolve(values[0]); + i = 1; + } + + this._currentCancellable = value; + + for (var j = i; j < length; ++j) { + var maybePromise = values[j]; + if (maybePromise instanceof Promise) { + maybePromise.suppressUnhandledRejections(); + } + } + + if (!value.isRejected()) { + for (; i < length; ++i) { + var ctx = { + accum: null, + value: values[i], + index: i, + length: length, + array: this + }; + + value = value._then(gotAccum, undefined, undefined, ctx, undefined); + + if ((i & 127) === 0) { + value._setNoAsyncGuarantee(); + } + } + } + + if (this._eachValues !== undefined) { + value = value + ._then(this._eachComplete, undefined, undefined, this, undefined); + } + value._then(completed, completed, undefined, value, this); +}; + +Promise.prototype.reduce = function (fn, initialValue) { + return reduce(this, fn, initialValue, null); +}; + +Promise.reduce = function (promises, fn, initialValue, _each) { + return reduce(promises, fn, initialValue, _each); +}; + +function completed(valueOrReason, array) { + if (this.isFulfilled()) { + array._resolve(valueOrReason); + } else { + array._reject(valueOrReason); + } +} + +function reduce(promises, fn, initialValue, _each) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + var array = new ReductionPromiseArray(promises, fn, initialValue, _each); + return array.promise(); +} + +function gotAccum(accum) { + this.accum = accum; + this.array._gotAccum(accum); + var value = tryConvertToPromise(this.value, this.array._promise); + if (value instanceof Promise) { + this.array._currentCancellable = value; + return value._then(gotValue, undefined, undefined, this, undefined); + } else { + return gotValue.call(this, value); + } +} + +function gotValue(value) { + var array = this.array; + var promise = array._promise; + var fn = tryCatch(array._fn); + promise._pushContext(); + var ret; + if (array._eachValues !== undefined) { + ret = fn.call(promise._boundValue(), value, this.index, this.length); + } else { + ret = fn.call(promise._boundValue(), + this.accum, value, this.index, this.length); + } + if (ret instanceof Promise) { + array._currentCancellable = ret; + } + var promiseCreated = promise._popContext(); + debug.checkForgottenReturns( + ret, + promiseCreated, + array._eachValues !== undefined ? "Promise.each" : "Promise.reduce", + promise + ); + return ret; +} +}; diff --git a/publisher/node_modules/bluebird/js/release/schedule.js b/publisher/node_modules/bluebird/js/release/schedule.js new file mode 100644 index 00000000..15197d14 --- /dev/null +++ b/publisher/node_modules/bluebird/js/release/schedule.js @@ -0,0 +1,62 @@ +"use strict"; +var util = require("./util"); +var schedule; +var noAsyncScheduler = function() { + throw new Error("No async scheduler available\u000a\u000a See http://goo.gl/MqrFmX\u000a"); +}; +var NativePromise = util.getNativePromise(); +if (util.isNode && typeof MutationObserver === "undefined") { + var GlobalSetImmediate = global.setImmediate; + var ProcessNextTick = process.nextTick; + schedule = util.isRecentNode + ? function(fn) { GlobalSetImmediate.call(global, fn); } + : function(fn) { ProcessNextTick.call(process, fn); }; +} else if (typeof NativePromise === "function" && + typeof NativePromise.resolve === "function") { + var nativePromise = NativePromise.resolve(); + schedule = function(fn) { + nativePromise.then(fn); + }; +} else if ((typeof MutationObserver !== "undefined") && + !(typeof window !== "undefined" && + window.navigator && + (window.navigator.standalone || window.cordova)) && + ("classList" in document.documentElement)) { + schedule = (function() { + var div = document.createElement("div"); + var opts = {attributes: true}; + var toggleScheduled = false; + var div2 = document.createElement("div"); + var o2 = new MutationObserver(function() { + div.classList.toggle("foo"); + toggleScheduled = false; + }); + o2.observe(div2, opts); + + var scheduleToggle = function() { + if (toggleScheduled) return; + toggleScheduled = true; + div2.classList.toggle("foo"); + }; + + return function schedule(fn) { + var o = new MutationObserver(function() { + o.disconnect(); + fn(); + }); + o.observe(div, opts); + scheduleToggle(); + }; + })(); +} else if (typeof setImmediate !== "undefined") { + schedule = function (fn) { + setImmediate(fn); + }; +} else if (typeof setTimeout !== "undefined") { + schedule = function (fn) { + setTimeout(fn, 0); + }; +} else { + schedule = noAsyncScheduler; +} +module.exports = schedule; diff --git a/publisher/node_modules/bluebird/js/release/settle.js b/publisher/node_modules/bluebird/js/release/settle.js new file mode 100644 index 00000000..e24b2047 --- /dev/null +++ b/publisher/node_modules/bluebird/js/release/settle.js @@ -0,0 +1,47 @@ +"use strict"; +module.exports = + function(Promise, PromiseArray, debug) { +var PromiseInspection = Promise.PromiseInspection; +var util = require("./util"); + +function SettledPromiseArray(values) { + this.constructor$(values); +} +util.inherits(SettledPromiseArray, PromiseArray); + +SettledPromiseArray.prototype._promiseResolved = function (index, inspection) { + this._values[index] = inspection; + var totalResolved = ++this._totalResolved; + if (totalResolved >= this._length) { + this._resolve(this._values); + return true; + } + return false; +}; + +SettledPromiseArray.prototype._promiseFulfilled = function (value, index) { + var ret = new PromiseInspection(); + ret._bitField = 33554432; + ret._settledValueField = value; + return this._promiseResolved(index, ret); +}; +SettledPromiseArray.prototype._promiseRejected = function (reason, index) { + var ret = new PromiseInspection(); + ret._bitField = 16777216; + ret._settledValueField = reason; + return this._promiseResolved(index, ret); +}; + +Promise.settle = function (promises) { + debug.deprecated(".settle()", ".reflect()"); + return new SettledPromiseArray(promises).promise(); +}; + +Promise.allSettled = function (promises) { + return new SettledPromiseArray(promises).promise(); +}; + +Promise.prototype.settle = function () { + return Promise.settle(this); +}; +}; diff --git a/publisher/node_modules/bluebird/js/release/some.js b/publisher/node_modules/bluebird/js/release/some.js new file mode 100644 index 00000000..400d8520 --- /dev/null +++ b/publisher/node_modules/bluebird/js/release/some.js @@ -0,0 +1,148 @@ +"use strict"; +module.exports = +function(Promise, PromiseArray, apiRejection) { +var util = require("./util"); +var RangeError = require("./errors").RangeError; +var AggregateError = require("./errors").AggregateError; +var isArray = util.isArray; +var CANCELLATION = {}; + + +function SomePromiseArray(values) { + this.constructor$(values); + this._howMany = 0; + this._unwrap = false; + this._initialized = false; +} +util.inherits(SomePromiseArray, PromiseArray); + +SomePromiseArray.prototype._init = function () { + if (!this._initialized) { + return; + } + if (this._howMany === 0) { + this._resolve([]); + return; + } + this._init$(undefined, -5); + var isArrayResolved = isArray(this._values); + if (!this._isResolved() && + isArrayResolved && + this._howMany > this._canPossiblyFulfill()) { + this._reject(this._getRangeError(this.length())); + } +}; + +SomePromiseArray.prototype.init = function () { + this._initialized = true; + this._init(); +}; + +SomePromiseArray.prototype.setUnwrap = function () { + this._unwrap = true; +}; + +SomePromiseArray.prototype.howMany = function () { + return this._howMany; +}; + +SomePromiseArray.prototype.setHowMany = function (count) { + this._howMany = count; +}; + +SomePromiseArray.prototype._promiseFulfilled = function (value) { + this._addFulfilled(value); + if (this._fulfilled() === this.howMany()) { + this._values.length = this.howMany(); + if (this.howMany() === 1 && this._unwrap) { + this._resolve(this._values[0]); + } else { + this._resolve(this._values); + } + return true; + } + return false; + +}; +SomePromiseArray.prototype._promiseRejected = function (reason) { + this._addRejected(reason); + return this._checkOutcome(); +}; + +SomePromiseArray.prototype._promiseCancelled = function () { + if (this._values instanceof Promise || this._values == null) { + return this._cancel(); + } + this._addRejected(CANCELLATION); + return this._checkOutcome(); +}; + +SomePromiseArray.prototype._checkOutcome = function() { + if (this.howMany() > this._canPossiblyFulfill()) { + var e = new AggregateError(); + for (var i = this.length(); i < this._values.length; ++i) { + if (this._values[i] !== CANCELLATION) { + e.push(this._values[i]); + } + } + if (e.length > 0) { + this._reject(e); + } else { + this._cancel(); + } + return true; + } + return false; +}; + +SomePromiseArray.prototype._fulfilled = function () { + return this._totalResolved; +}; + +SomePromiseArray.prototype._rejected = function () { + return this._values.length - this.length(); +}; + +SomePromiseArray.prototype._addRejected = function (reason) { + this._values.push(reason); +}; + +SomePromiseArray.prototype._addFulfilled = function (value) { + this._values[this._totalResolved++] = value; +}; + +SomePromiseArray.prototype._canPossiblyFulfill = function () { + return this.length() - this._rejected(); +}; + +SomePromiseArray.prototype._getRangeError = function (count) { + var message = "Input array must contain at least " + + this._howMany + " items but contains only " + count + " items"; + return new RangeError(message); +}; + +SomePromiseArray.prototype._resolveEmptyArray = function () { + this._reject(this._getRangeError(0)); +}; + +function some(promises, howMany) { + if ((howMany | 0) !== howMany || howMany < 0) { + return apiRejection("expecting a positive integer\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + var ret = new SomePromiseArray(promises); + var promise = ret.promise(); + ret.setHowMany(howMany); + ret.init(); + return promise; +} + +Promise.some = function (promises, howMany) { + return some(promises, howMany); +}; + +Promise.prototype.some = function (howMany) { + return some(this, howMany); +}; + +Promise._SomePromiseArray = SomePromiseArray; +}; diff --git a/publisher/node_modules/bluebird/js/release/synchronous_inspection.js b/publisher/node_modules/bluebird/js/release/synchronous_inspection.js new file mode 100644 index 00000000..9c49d2e6 --- /dev/null +++ b/publisher/node_modules/bluebird/js/release/synchronous_inspection.js @@ -0,0 +1,103 @@ +"use strict"; +module.exports = function(Promise) { +function PromiseInspection(promise) { + if (promise !== undefined) { + promise = promise._target(); + this._bitField = promise._bitField; + this._settledValueField = promise._isFateSealed() + ? promise._settledValue() : undefined; + } + else { + this._bitField = 0; + this._settledValueField = undefined; + } +} + +PromiseInspection.prototype._settledValue = function() { + return this._settledValueField; +}; + +var value = PromiseInspection.prototype.value = function () { + if (!this.isFulfilled()) { + throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + return this._settledValue(); +}; + +var reason = PromiseInspection.prototype.error = +PromiseInspection.prototype.reason = function () { + if (!this.isRejected()) { + throw new TypeError("cannot get rejection reason of a non-rejected promise\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + return this._settledValue(); +}; + +var isFulfilled = PromiseInspection.prototype.isFulfilled = function() { + return (this._bitField & 33554432) !== 0; +}; + +var isRejected = PromiseInspection.prototype.isRejected = function () { + return (this._bitField & 16777216) !== 0; +}; + +var isPending = PromiseInspection.prototype.isPending = function () { + return (this._bitField & 50397184) === 0; +}; + +var isResolved = PromiseInspection.prototype.isResolved = function () { + return (this._bitField & 50331648) !== 0; +}; + +PromiseInspection.prototype.isCancelled = function() { + return (this._bitField & 8454144) !== 0; +}; + +Promise.prototype.__isCancelled = function() { + return (this._bitField & 65536) === 65536; +}; + +Promise.prototype._isCancelled = function() { + return this._target().__isCancelled(); +}; + +Promise.prototype.isCancelled = function() { + return (this._target()._bitField & 8454144) !== 0; +}; + +Promise.prototype.isPending = function() { + return isPending.call(this._target()); +}; + +Promise.prototype.isRejected = function() { + return isRejected.call(this._target()); +}; + +Promise.prototype.isFulfilled = function() { + return isFulfilled.call(this._target()); +}; + +Promise.prototype.isResolved = function() { + return isResolved.call(this._target()); +}; + +Promise.prototype.value = function() { + return value.call(this._target()); +}; + +Promise.prototype.reason = function() { + var target = this._target(); + target._unsetRejectionIsUnhandled(); + return reason.call(target); +}; + +Promise.prototype._value = function() { + return this._settledValue(); +}; + +Promise.prototype._reason = function() { + this._unsetRejectionIsUnhandled(); + return this._settledValue(); +}; + +Promise.PromiseInspection = PromiseInspection; +}; diff --git a/publisher/node_modules/bluebird/js/release/thenables.js b/publisher/node_modules/bluebird/js/release/thenables.js new file mode 100644 index 00000000..d6ab9aa2 --- /dev/null +++ b/publisher/node_modules/bluebird/js/release/thenables.js @@ -0,0 +1,86 @@ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var util = require("./util"); +var errorObj = util.errorObj; +var isObject = util.isObject; + +function tryConvertToPromise(obj, context) { + if (isObject(obj)) { + if (obj instanceof Promise) return obj; + var then = getThen(obj); + if (then === errorObj) { + if (context) context._pushContext(); + var ret = Promise.reject(then.e); + if (context) context._popContext(); + return ret; + } else if (typeof then === "function") { + if (isAnyBluebirdPromise(obj)) { + var ret = new Promise(INTERNAL); + obj._then( + ret._fulfill, + ret._reject, + undefined, + ret, + null + ); + return ret; + } + return doThenable(obj, then, context); + } + } + return obj; +} + +function doGetThen(obj) { + return obj.then; +} + +function getThen(obj) { + try { + return doGetThen(obj); + } catch (e) { + errorObj.e = e; + return errorObj; + } +} + +var hasProp = {}.hasOwnProperty; +function isAnyBluebirdPromise(obj) { + try { + return hasProp.call(obj, "_promise0"); + } catch (e) { + return false; + } +} + +function doThenable(x, then, context) { + var promise = new Promise(INTERNAL); + var ret = promise; + if (context) context._pushContext(); + promise._captureStackTrace(); + if (context) context._popContext(); + var synchronous = true; + var result = util.tryCatch(then).call(x, resolve, reject); + synchronous = false; + + if (promise && result === errorObj) { + promise._rejectCallback(result.e, true, true); + promise = null; + } + + function resolve(value) { + if (!promise) return; + promise._resolveCallback(value); + promise = null; + } + + function reject(reason) { + if (!promise) return; + promise._rejectCallback(reason, synchronous, true); + promise = null; + } + return ret; +} + +return tryConvertToPromise; +}; diff --git a/publisher/node_modules/bluebird/js/release/timers.js b/publisher/node_modules/bluebird/js/release/timers.js new file mode 100644 index 00000000..cb8f1f42 --- /dev/null +++ b/publisher/node_modules/bluebird/js/release/timers.js @@ -0,0 +1,93 @@ +"use strict"; +module.exports = function(Promise, INTERNAL, debug) { +var util = require("./util"); +var TimeoutError = Promise.TimeoutError; + +function HandleWrapper(handle) { + this.handle = handle; +} + +HandleWrapper.prototype._resultCancelled = function() { + clearTimeout(this.handle); +}; + +var afterValue = function(value) { return delay(+this).thenReturn(value); }; +var delay = Promise.delay = function (ms, value) { + var ret; + var handle; + if (value !== undefined) { + ret = Promise.resolve(value) + ._then(afterValue, null, null, ms, undefined); + if (debug.cancellation() && value instanceof Promise) { + ret._setOnCancel(value); + } + } else { + ret = new Promise(INTERNAL); + handle = setTimeout(function() { ret._fulfill(); }, +ms); + if (debug.cancellation()) { + ret._setOnCancel(new HandleWrapper(handle)); + } + ret._captureStackTrace(); + } + ret._setAsyncGuaranteed(); + return ret; +}; + +Promise.prototype.delay = function (ms) { + return delay(ms, this); +}; + +var afterTimeout = function (promise, message, parent) { + var err; + if (typeof message !== "string") { + if (message instanceof Error) { + err = message; + } else { + err = new TimeoutError("operation timed out"); + } + } else { + err = new TimeoutError(message); + } + util.markAsOriginatingFromRejection(err); + promise._attachExtraTrace(err); + promise._reject(err); + + if (parent != null) { + parent.cancel(); + } +}; + +function successClear(value) { + clearTimeout(this.handle); + return value; +} + +function failureClear(reason) { + clearTimeout(this.handle); + throw reason; +} + +Promise.prototype.timeout = function (ms, message) { + ms = +ms; + var ret, parent; + + var handleWrapper = new HandleWrapper(setTimeout(function timeoutTimeout() { + if (ret.isPending()) { + afterTimeout(ret, message, parent); + } + }, ms)); + + if (debug.cancellation()) { + parent = this.then(); + ret = parent._then(successClear, failureClear, + undefined, handleWrapper, undefined); + ret._setOnCancel(handleWrapper); + } else { + ret = this._then(successClear, failureClear, + undefined, handleWrapper, undefined); + } + + return ret; +}; + +}; diff --git a/publisher/node_modules/bluebird/js/release/using.js b/publisher/node_modules/bluebird/js/release/using.js new file mode 100644 index 00000000..65de531c --- /dev/null +++ b/publisher/node_modules/bluebird/js/release/using.js @@ -0,0 +1,226 @@ +"use strict"; +module.exports = function (Promise, apiRejection, tryConvertToPromise, + createContext, INTERNAL, debug) { + var util = require("./util"); + var TypeError = require("./errors").TypeError; + var inherits = require("./util").inherits; + var errorObj = util.errorObj; + var tryCatch = util.tryCatch; + var NULL = {}; + + function thrower(e) { + setTimeout(function(){throw e;}, 0); + } + + function castPreservingDisposable(thenable) { + var maybePromise = tryConvertToPromise(thenable); + if (maybePromise !== thenable && + typeof thenable._isDisposable === "function" && + typeof thenable._getDisposer === "function" && + thenable._isDisposable()) { + maybePromise._setDisposable(thenable._getDisposer()); + } + return maybePromise; + } + function dispose(resources, inspection) { + var i = 0; + var len = resources.length; + var ret = new Promise(INTERNAL); + function iterator() { + if (i >= len) return ret._fulfill(); + var maybePromise = castPreservingDisposable(resources[i++]); + if (maybePromise instanceof Promise && + maybePromise._isDisposable()) { + try { + maybePromise = tryConvertToPromise( + maybePromise._getDisposer().tryDispose(inspection), + resources.promise); + } catch (e) { + return thrower(e); + } + if (maybePromise instanceof Promise) { + return maybePromise._then(iterator, thrower, + null, null, null); + } + } + iterator(); + } + iterator(); + return ret; + } + + function Disposer(data, promise, context) { + this._data = data; + this._promise = promise; + this._context = context; + } + + Disposer.prototype.data = function () { + return this._data; + }; + + Disposer.prototype.promise = function () { + return this._promise; + }; + + Disposer.prototype.resource = function () { + if (this.promise().isFulfilled()) { + return this.promise().value(); + } + return NULL; + }; + + Disposer.prototype.tryDispose = function(inspection) { + var resource = this.resource(); + var context = this._context; + if (context !== undefined) context._pushContext(); + var ret = resource !== NULL + ? this.doDispose(resource, inspection) : null; + if (context !== undefined) context._popContext(); + this._promise._unsetDisposable(); + this._data = null; + return ret; + }; + + Disposer.isDisposer = function (d) { + return (d != null && + typeof d.resource === "function" && + typeof d.tryDispose === "function"); + }; + + function FunctionDisposer(fn, promise, context) { + this.constructor$(fn, promise, context); + } + inherits(FunctionDisposer, Disposer); + + FunctionDisposer.prototype.doDispose = function (resource, inspection) { + var fn = this.data(); + return fn.call(resource, resource, inspection); + }; + + function maybeUnwrapDisposer(value) { + if (Disposer.isDisposer(value)) { + this.resources[this.index]._setDisposable(value); + return value.promise(); + } + return value; + } + + function ResourceList(length) { + this.length = length; + this.promise = null; + this[length-1] = null; + } + + ResourceList.prototype._resultCancelled = function() { + var len = this.length; + for (var i = 0; i < len; ++i) { + var item = this[i]; + if (item instanceof Promise) { + item.cancel(); + } + } + }; + + Promise.using = function () { + var len = arguments.length; + if (len < 2) return apiRejection( + "you must pass at least 2 arguments to Promise.using"); + var fn = arguments[len - 1]; + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + var input; + var spreadArgs = true; + if (len === 2 && Array.isArray(arguments[0])) { + input = arguments[0]; + len = input.length; + spreadArgs = false; + } else { + input = arguments; + len--; + } + var resources = new ResourceList(len); + for (var i = 0; i < len; ++i) { + var resource = input[i]; + if (Disposer.isDisposer(resource)) { + var disposer = resource; + resource = resource.promise(); + resource._setDisposable(disposer); + } else { + var maybePromise = tryConvertToPromise(resource); + if (maybePromise instanceof Promise) { + resource = + maybePromise._then(maybeUnwrapDisposer, null, null, { + resources: resources, + index: i + }, undefined); + } + } + resources[i] = resource; + } + + var reflectedResources = new Array(resources.length); + for (var i = 0; i < reflectedResources.length; ++i) { + reflectedResources[i] = Promise.resolve(resources[i]).reflect(); + } + + var resultPromise = Promise.all(reflectedResources) + .then(function(inspections) { + for (var i = 0; i < inspections.length; ++i) { + var inspection = inspections[i]; + if (inspection.isRejected()) { + errorObj.e = inspection.error(); + return errorObj; + } else if (!inspection.isFulfilled()) { + resultPromise.cancel(); + return; + } + inspections[i] = inspection.value(); + } + promise._pushContext(); + + fn = tryCatch(fn); + var ret = spreadArgs + ? fn.apply(undefined, inspections) : fn(inspections); + var promiseCreated = promise._popContext(); + debug.checkForgottenReturns( + ret, promiseCreated, "Promise.using", promise); + return ret; + }); + + var promise = resultPromise.lastly(function() { + var inspection = new Promise.PromiseInspection(resultPromise); + return dispose(resources, inspection); + }); + resources.promise = promise; + promise._setOnCancel(resources); + return promise; + }; + + Promise.prototype._setDisposable = function (disposer) { + this._bitField = this._bitField | 131072; + this._disposer = disposer; + }; + + Promise.prototype._isDisposable = function () { + return (this._bitField & 131072) > 0; + }; + + Promise.prototype._getDisposer = function () { + return this._disposer; + }; + + Promise.prototype._unsetDisposable = function () { + this._bitField = this._bitField & (~131072); + this._disposer = undefined; + }; + + Promise.prototype.disposer = function (fn) { + if (typeof fn === "function") { + return new FunctionDisposer(fn, this, createContext()); + } + throw new TypeError(); + }; + +}; diff --git a/publisher/node_modules/bluebird/js/release/util.js b/publisher/node_modules/bluebird/js/release/util.js new file mode 100644 index 00000000..8ca4d91b --- /dev/null +++ b/publisher/node_modules/bluebird/js/release/util.js @@ -0,0 +1,421 @@ +"use strict"; +var es5 = require("./es5"); +var canEvaluate = typeof navigator == "undefined"; + +var errorObj = {e: {}}; +var tryCatchTarget; +var globalObject = typeof self !== "undefined" ? self : + typeof window !== "undefined" ? window : + typeof global !== "undefined" ? global : + this !== undefined ? this : null; + +function tryCatcher() { + try { + var target = tryCatchTarget; + tryCatchTarget = null; + return target.apply(this, arguments); + } catch (e) { + errorObj.e = e; + return errorObj; + } +} +function tryCatch(fn) { + tryCatchTarget = fn; + return tryCatcher; +} + +var inherits = function(Child, Parent) { + var hasProp = {}.hasOwnProperty; + + function T() { + this.constructor = Child; + this.constructor$ = Parent; + for (var propertyName in Parent.prototype) { + if (hasProp.call(Parent.prototype, propertyName) && + propertyName.charAt(propertyName.length-1) !== "$" + ) { + this[propertyName + "$"] = Parent.prototype[propertyName]; + } + } + } + T.prototype = Parent.prototype; + Child.prototype = new T(); + return Child.prototype; +}; + + +function isPrimitive(val) { + return val == null || val === true || val === false || + typeof val === "string" || typeof val === "number"; + +} + +function isObject(value) { + return typeof value === "function" || + typeof value === "object" && value !== null; +} + +function maybeWrapAsError(maybeError) { + if (!isPrimitive(maybeError)) return maybeError; + + return new Error(safeToString(maybeError)); +} + +function withAppended(target, appendee) { + var len = target.length; + var ret = new Array(len + 1); + var i; + for (i = 0; i < len; ++i) { + ret[i] = target[i]; + } + ret[i] = appendee; + return ret; +} + +function getDataPropertyOrDefault(obj, key, defaultValue) { + if (es5.isES5) { + var desc = Object.getOwnPropertyDescriptor(obj, key); + + if (desc != null) { + return desc.get == null && desc.set == null + ? desc.value + : defaultValue; + } + } else { + return {}.hasOwnProperty.call(obj, key) ? obj[key] : undefined; + } +} + +function notEnumerableProp(obj, name, value) { + if (isPrimitive(obj)) return obj; + var descriptor = { + value: value, + configurable: true, + enumerable: false, + writable: true + }; + es5.defineProperty(obj, name, descriptor); + return obj; +} + +function thrower(r) { + throw r; +} + +var inheritedDataKeys = (function() { + var excludedPrototypes = [ + Array.prototype, + Object.prototype, + Function.prototype + ]; + + var isExcludedProto = function(val) { + for (var i = 0; i < excludedPrototypes.length; ++i) { + if (excludedPrototypes[i] === val) { + return true; + } + } + return false; + }; + + if (es5.isES5) { + var getKeys = Object.getOwnPropertyNames; + return function(obj) { + var ret = []; + var visitedKeys = Object.create(null); + while (obj != null && !isExcludedProto(obj)) { + var keys; + try { + keys = getKeys(obj); + } catch (e) { + return ret; + } + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (visitedKeys[key]) continue; + visitedKeys[key] = true; + var desc = Object.getOwnPropertyDescriptor(obj, key); + if (desc != null && desc.get == null && desc.set == null) { + ret.push(key); + } + } + obj = es5.getPrototypeOf(obj); + } + return ret; + }; + } else { + var hasProp = {}.hasOwnProperty; + return function(obj) { + if (isExcludedProto(obj)) return []; + var ret = []; + + /*jshint forin:false */ + enumeration: for (var key in obj) { + if (hasProp.call(obj, key)) { + ret.push(key); + } else { + for (var i = 0; i < excludedPrototypes.length; ++i) { + if (hasProp.call(excludedPrototypes[i], key)) { + continue enumeration; + } + } + ret.push(key); + } + } + return ret; + }; + } + +})(); + +var thisAssignmentPattern = /this\s*\.\s*\S+\s*=/; +function isClass(fn) { + try { + if (typeof fn === "function") { + var keys = es5.names(fn.prototype); + + var hasMethods = es5.isES5 && keys.length > 1; + var hasMethodsOtherThanConstructor = keys.length > 0 && + !(keys.length === 1 && keys[0] === "constructor"); + var hasThisAssignmentAndStaticMethods = + thisAssignmentPattern.test(fn + "") && es5.names(fn).length > 0; + + if (hasMethods || hasMethodsOtherThanConstructor || + hasThisAssignmentAndStaticMethods) { + return true; + } + } + return false; + } catch (e) { + return false; + } +} + +function toFastProperties(obj) { + /*jshint -W027,-W055,-W031*/ + function FakeConstructor() {} + FakeConstructor.prototype = obj; + var receiver = new FakeConstructor(); + function ic() { + return typeof receiver.foo; + } + ic(); + ic(); + return obj; + eval(obj); +} + +var rident = /^[a-z$_][a-z$_0-9]*$/i; +function isIdentifier(str) { + return rident.test(str); +} + +function filledRange(count, prefix, suffix) { + var ret = new Array(count); + for(var i = 0; i < count; ++i) { + ret[i] = prefix + i + suffix; + } + return ret; +} + +function safeToString(obj) { + try { + return obj + ""; + } catch (e) { + return "[no string representation]"; + } +} + +function isError(obj) { + return obj instanceof Error || + (obj !== null && + typeof obj === "object" && + typeof obj.message === "string" && + typeof obj.name === "string"); +} + +function markAsOriginatingFromRejection(e) { + try { + notEnumerableProp(e, "isOperational", true); + } + catch(ignore) {} +} + +function originatesFromRejection(e) { + if (e == null) return false; + return ((e instanceof Error["__BluebirdErrorTypes__"].OperationalError) || + e["isOperational"] === true); +} + +function canAttachTrace(obj) { + return isError(obj) && es5.propertyIsWritable(obj, "stack"); +} + +var ensureErrorObject = (function() { + if (!("stack" in new Error())) { + return function(value) { + if (canAttachTrace(value)) return value; + try {throw new Error(safeToString(value));} + catch(err) {return err;} + }; + } else { + return function(value) { + if (canAttachTrace(value)) return value; + return new Error(safeToString(value)); + }; + } +})(); + +function classString(obj) { + return {}.toString.call(obj); +} + +function copyDescriptors(from, to, filter) { + var keys = es5.names(from); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (filter(key)) { + try { + es5.defineProperty(to, key, es5.getDescriptor(from, key)); + } catch (ignore) {} + } + } +} + +var asArray = function(v) { + if (es5.isArray(v)) { + return v; + } + return null; +}; + +if (typeof Symbol !== "undefined" && Symbol.iterator) { + var ArrayFrom = typeof Array.from === "function" ? function(v) { + return Array.from(v); + } : function(v) { + var ret = []; + var it = v[Symbol.iterator](); + var itResult; + while (!((itResult = it.next()).done)) { + ret.push(itResult.value); + } + return ret; + }; + + asArray = function(v) { + if (es5.isArray(v)) { + return v; + } else if (v != null && typeof v[Symbol.iterator] === "function") { + return ArrayFrom(v); + } + return null; + }; +} + +var isNode = typeof process !== "undefined" && + classString(process).toLowerCase() === "[object process]"; + +var hasEnvVariables = typeof process !== "undefined" && + typeof process.env !== "undefined"; + +function env(key) { + return hasEnvVariables ? process.env[key] : undefined; +} + +function getNativePromise() { + if (typeof Promise === "function") { + try { + var promise = new Promise(function(){}); + if (classString(promise) === "[object Promise]") { + return Promise; + } + } catch (e) {} + } +} + +var reflectHandler; +function contextBind(ctx, cb) { + if (ctx === null || + typeof cb !== "function" || + cb === reflectHandler) { + return cb; + } + + if (ctx.domain !== null) { + cb = ctx.domain.bind(cb); + } + + var async = ctx.async; + if (async !== null) { + var old = cb; + cb = function() { + var $_len = arguments.length + 2;var args = new Array($_len); for(var $_i = 2; $_i < $_len ; ++$_i) {args[$_i] = arguments[$_i - 2];}; + args[0] = old; + args[1] = this; + return async.runInAsyncScope.apply(async, args); + }; + } + return cb; +} + +var ret = { + setReflectHandler: function(fn) { + reflectHandler = fn; + }, + isClass: isClass, + isIdentifier: isIdentifier, + inheritedDataKeys: inheritedDataKeys, + getDataPropertyOrDefault: getDataPropertyOrDefault, + thrower: thrower, + isArray: es5.isArray, + asArray: asArray, + notEnumerableProp: notEnumerableProp, + isPrimitive: isPrimitive, + isObject: isObject, + isError: isError, + canEvaluate: canEvaluate, + errorObj: errorObj, + tryCatch: tryCatch, + inherits: inherits, + withAppended: withAppended, + maybeWrapAsError: maybeWrapAsError, + toFastProperties: toFastProperties, + filledRange: filledRange, + toString: safeToString, + canAttachTrace: canAttachTrace, + ensureErrorObject: ensureErrorObject, + originatesFromRejection: originatesFromRejection, + markAsOriginatingFromRejection: markAsOriginatingFromRejection, + classString: classString, + copyDescriptors: copyDescriptors, + isNode: isNode, + hasEnvVariables: hasEnvVariables, + env: env, + global: globalObject, + getNativePromise: getNativePromise, + contextBind: contextBind +}; +ret.isRecentNode = ret.isNode && (function() { + var version; + if (process.versions && process.versions.node) { + version = process.versions.node.split(".").map(Number); + } else if (process.version) { + version = process.version.split(".").map(Number); + } + return (version[0] === 0 && version[1] > 10) || (version[0] > 0); +})(); +ret.nodeSupportsAsyncResource = ret.isNode && (function() { + var supportsAsync = false; + try { + var res = require("async_hooks").AsyncResource; + supportsAsync = typeof res.prototype.runInAsyncScope === "function"; + } catch (e) { + supportsAsync = false; + } + return supportsAsync; +})(); + +if (ret.isNode) ret.toFastProperties(process); + +try {throw new Error(); } catch (e) {ret.lastLineError = e;} +module.exports = ret; diff --git a/publisher/node_modules/bluebird/package.json b/publisher/node_modules/bluebird/package.json new file mode 100644 index 00000000..33f696cb --- /dev/null +++ b/publisher/node_modules/bluebird/package.json @@ -0,0 +1,78 @@ +{ + "name": "bluebird", + "description": "Full featured Promises/A+ implementation with exceptionally good performance", + "version": "3.7.2", + "keywords": [ + "promise", + "performance", + "promises", + "promises-a", + "promises-aplus", + "async", + "await", + "deferred", + "deferreds", + "future", + "flow control", + "dsl", + "fluent interface" + ], + "scripts": { + "lint": "node scripts/jshint.js", + "test": "node --expose-gc tools/test.js", + "istanbul": "istanbul", + "prepublish": "npm run generate-browser-core && npm run generate-browser-full", + "generate-browser-full": "node tools/build.js --no-clean --no-debug --release --browser --minify", + "generate-browser-core": "node tools/build.js --features=core --no-debug --release --zalgo --browser --minify && mv js/browser/bluebird.js js/browser/bluebird.core.js && mv js/browser/bluebird.min.js js/browser/bluebird.core.min.js" + }, + "homepage": "https://github.com/petkaantonov/bluebird", + "repository": { + "type": "git", + "url": "git://github.com/petkaantonov/bluebird.git" + }, + "bugs": { + "url": "http://github.com/petkaantonov/bluebird/issues" + }, + "license": "MIT", + "author": { + "name": "Petka Antonov", + "email": "petka_antonov@hotmail.com", + "url": "http://github.com/petkaantonov/" + }, + "devDependencies": { + "acorn": "^6.0.2", + "acorn-walk": "^6.1.0", + "baconjs": "^0.7.43", + "bluebird": "^2.9.2", + "body-parser": "^1.10.2", + "browserify": "^8.1.1", + "cli-table": "~0.3.1", + "co": "^4.2.0", + "cross-spawn": "^0.2.3", + "glob": "^4.3.2", + "grunt-saucelabs": "~8.4.1", + "highland": "^2.3.0", + "istanbul": "^0.3.5", + "jshint": "^2.6.0", + "jshint-stylish": "~0.2.0", + "kefir": "^2.4.1", + "mkdirp": "~0.5.0", + "mocha": "~2.1", + "open": "~0.0.5", + "optimist": "~0.6.1", + "rimraf": "~2.2.6", + "rx": "^2.3.25", + "serve-static": "^1.7.1", + "sinon": "~1.7.3", + "uglify-js": "~2.4.16" + }, + "readmeFilename": "README.md", + "main": "./js/release/bluebird.js", + "webpack": "./js/release/bluebird.js", + "browser": "./js/browser/bluebird.js", + "files": [ + "js/browser", + "js/release", + "LICENSE" + ] +} diff --git a/publisher/node_modules/braces/LICENSE b/publisher/node_modules/braces/LICENSE new file mode 100644 index 00000000..9af4a67d --- /dev/null +++ b/publisher/node_modules/braces/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-present, Jon Schlinkert. + +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. diff --git a/publisher/node_modules/braces/README.md b/publisher/node_modules/braces/README.md new file mode 100644 index 00000000..f59dd604 --- /dev/null +++ b/publisher/node_modules/braces/README.md @@ -0,0 +1,586 @@ +# braces [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W8YFZ425KND68) [![NPM version](https://img.shields.io/npm/v/braces.svg?style=flat)](https://www.npmjs.com/package/braces) [![NPM monthly downloads](https://img.shields.io/npm/dm/braces.svg?style=flat)](https://npmjs.org/package/braces) [![NPM total downloads](https://img.shields.io/npm/dt/braces.svg?style=flat)](https://npmjs.org/package/braces) [![Linux Build Status](https://img.shields.io/travis/micromatch/braces.svg?style=flat&label=Travis)](https://travis-ci.org/micromatch/braces) + +> Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save braces +``` + +## v3.0.0 Released!! + +See the [changelog](CHANGELOG.md) for details. + +## Why use braces? + +Brace patterns make globs more powerful by adding the ability to match specific ranges and sequences of characters. + +- **Accurate** - complete support for the [Bash 4.3 Brace Expansion](www.gnu.org/software/bash/) specification (passes all of the Bash braces tests) +- **[fast and performant](#benchmarks)** - Starts fast, runs fast and [scales well](#performance) as patterns increase in complexity. +- **Organized code base** - The parser and compiler are easy to maintain and update when edge cases crop up. +- **Well-tested** - Thousands of test assertions, and passes all of the Bash, minimatch, and [brace-expansion](https://github.com/juliangruber/brace-expansion) unit tests (as of the date this was written). +- **Safer** - You shouldn't have to worry about users defining aggressive or malicious brace patterns that can break your application. Braces takes measures to prevent malicious regex that can be used for DDoS attacks (see [catastrophic backtracking](https://www.regular-expressions.info/catastrophic.html)). +- [Supports lists](#lists) - (aka "sets") `a/{b,c}/d` => `['a/b/d', 'a/c/d']` +- [Supports sequences](#sequences) - (aka "ranges") `{01..03}` => `['01', '02', '03']` +- [Supports steps](#steps) - (aka "increments") `{2..10..2}` => `['2', '4', '6', '8', '10']` +- [Supports escaping](#escaping) - To prevent evaluation of special characters. + +## Usage + +The main export is a function that takes one or more brace `patterns` and `options`. + +```js +const braces = require('braces'); +// braces(patterns[, options]); + +console.log(braces(['{01..05}', '{a..e}'])); +//=> ['(0[1-5])', '([a-e])'] + +console.log(braces(['{01..05}', '{a..e}'], { expand: true })); +//=> ['01', '02', '03', '04', '05', 'a', 'b', 'c', 'd', 'e'] +``` + +### Brace Expansion vs. Compilation + +By default, brace patterns are compiled into strings that are optimized for creating regular expressions and matching. + +**Compiled** + +```js +console.log(braces('a/{x,y,z}/b')); +//=> ['a/(x|y|z)/b'] +console.log(braces(['a/{01..20}/b', 'a/{1..5}/b'])); +//=> [ 'a/(0[1-9]|1[0-9]|20)/b', 'a/([1-5])/b' ] +``` + +**Expanded** + +Enable brace expansion by setting the `expand` option to true, or by using [braces.expand()](#expand) (returns an array similar to what you'd expect from Bash, or `echo {1..5}`, or [minimatch](https://github.com/isaacs/minimatch)): + +```js +console.log(braces('a/{x,y,z}/b', { expand: true })); +//=> ['a/x/b', 'a/y/b', 'a/z/b'] + +console.log(braces.expand('{01..10}')); +//=> ['01','02','03','04','05','06','07','08','09','10'] +``` + +### Lists + +Expand lists (like Bash "sets"): + +```js +console.log(braces('a/{foo,bar,baz}/*.js')); +//=> ['a/(foo|bar|baz)/*.js'] + +console.log(braces.expand('a/{foo,bar,baz}/*.js')); +//=> ['a/foo/*.js', 'a/bar/*.js', 'a/baz/*.js'] +``` + +### Sequences + +Expand ranges of characters (like Bash "sequences"): + +```js +console.log(braces.expand('{1..3}')); // ['1', '2', '3'] +console.log(braces.expand('a/{1..3}/b')); // ['a/1/b', 'a/2/b', 'a/3/b'] +console.log(braces('{a..c}', { expand: true })); // ['a', 'b', 'c'] +console.log(braces('foo/{a..c}', { expand: true })); // ['foo/a', 'foo/b', 'foo/c'] + +// supports zero-padded ranges +console.log(braces('a/{01..03}/b')); //=> ['a/(0[1-3])/b'] +console.log(braces('a/{001..300}/b')); //=> ['a/(0{2}[1-9]|0[1-9][0-9]|[12][0-9]{2}|300)/b'] +``` + +See [fill-range](https://github.com/jonschlinkert/fill-range) for all available range-expansion options. + +### Steppped ranges + +Steps, or increments, may be used with ranges: + +```js +console.log(braces.expand('{2..10..2}')); +//=> ['2', '4', '6', '8', '10'] + +console.log(braces('{2..10..2}')); +//=> ['(2|4|6|8|10)'] +``` + +When the [.optimize](#optimize) method is used, or [options.optimize](#optionsoptimize) is set to true, sequences are passed to [to-regex-range](https://github.com/jonschlinkert/to-regex-range) for expansion. + +### Nesting + +Brace patterns may be nested. The results of each expanded string are not sorted, and left to right order is preserved. + +**"Expanded" braces** + +```js +console.log(braces.expand('a{b,c,/{x,y}}/e')); +//=> ['ab/e', 'ac/e', 'a/x/e', 'a/y/e'] + +console.log(braces.expand('a/{x,{1..5},y}/c')); +//=> ['a/x/c', 'a/1/c', 'a/2/c', 'a/3/c', 'a/4/c', 'a/5/c', 'a/y/c'] +``` + +**"Optimized" braces** + +```js +console.log(braces('a{b,c,/{x,y}}/e')); +//=> ['a(b|c|/(x|y))/e'] + +console.log(braces('a/{x,{1..5},y}/c')); +//=> ['a/(x|([1-5])|y)/c'] +``` + +### Escaping + +**Escaping braces** + +A brace pattern will not be expanded or evaluted if _either the opening or closing brace is escaped_: + +```js +console.log(braces.expand('a\\{d,c,b}e')); +//=> ['a{d,c,b}e'] + +console.log(braces.expand('a{d,c,b\\}e')); +//=> ['a{d,c,b}e'] +``` + +**Escaping commas** + +Commas inside braces may also be escaped: + +```js +console.log(braces.expand('a{b\\,c}d')); +//=> ['a{b,c}d'] + +console.log(braces.expand('a{d\\,c,b}e')); +//=> ['ad,ce', 'abe'] +``` + +**Single items** + +Following bash conventions, a brace pattern is also not expanded when it contains a single character: + +```js +console.log(braces.expand('a{b}c')); +//=> ['a{b}c'] +``` + +## Options + +### options.maxLength + +**Type**: `Number` + +**Default**: `10,000` + +**Description**: Limit the length of the input string. Useful when the input string is generated or your application allows users to pass a string, et cetera. + +```js +console.log(braces('a/{b,c}/d', { maxLength: 3 })); //=> throws an error +``` + +### options.expand + +**Type**: `Boolean` + +**Default**: `undefined` + +**Description**: Generate an "expanded" brace pattern (alternatively you can use the `braces.expand()` method, which does the same thing). + +```js +console.log(braces('a/{b,c}/d', { expand: true })); +//=> [ 'a/b/d', 'a/c/d' ] +``` + +### options.nodupes + +**Type**: `Boolean` + +**Default**: `undefined` + +**Description**: Remove duplicates from the returned array. + +### options.rangeLimit + +**Type**: `Number` + +**Default**: `1000` + +**Description**: To prevent malicious patterns from being passed by users, an error is thrown when `braces.expand()` is used or `options.expand` is true and the generated range will exceed the `rangeLimit`. + +You can customize `options.rangeLimit` or set it to `Inifinity` to disable this altogether. + +**Examples** + +```js +// pattern exceeds the "rangeLimit", so it's optimized automatically +console.log(braces.expand('{1..1000}')); +//=> ['([1-9]|[1-9][0-9]{1,2}|1000)'] + +// pattern does not exceed "rangeLimit", so it's NOT optimized +console.log(braces.expand('{1..100}')); +//=> ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '90', '91', '92', '93', '94', '95', '96', '97', '98', '99', '100'] +``` + +### options.transform + +**Type**: `Function` + +**Default**: `undefined` + +**Description**: Customize range expansion. + +**Example: Transforming non-numeric values** + +```js +const alpha = braces.expand('x/{a..e}/y', { + transform(value, index) { + // When non-numeric values are passed, "value" is a character code. + return 'foo/' + String.fromCharCode(value) + '-' + index; + }, +}); +console.log(alpha); +//=> [ 'x/foo/a-0/y', 'x/foo/b-1/y', 'x/foo/c-2/y', 'x/foo/d-3/y', 'x/foo/e-4/y' ] +``` + +**Example: Transforming numeric values** + +```js +const numeric = braces.expand('{1..5}', { + transform(value) { + // when numeric values are passed, "value" is a number + return 'foo/' + value * 2; + }, +}); +console.log(numeric); +//=> [ 'foo/2', 'foo/4', 'foo/6', 'foo/8', 'foo/10' ] +``` + +### options.quantifiers + +**Type**: `Boolean` + +**Default**: `undefined` + +**Description**: In regular expressions, quanitifiers can be used to specify how many times a token can be repeated. For example, `a{1,3}` will match the letter `a` one to three times. + +Unfortunately, regex quantifiers happen to share the same syntax as [Bash lists](#lists) + +The `quantifiers` option tells braces to detect when [regex quantifiers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#quantifiers) are defined in the given pattern, and not to try to expand them as lists. + +**Examples** + +```js +const braces = require('braces'); +console.log(braces('a/b{1,3}/{x,y,z}')); +//=> [ 'a/b(1|3)/(x|y|z)' ] +console.log(braces('a/b{1,3}/{x,y,z}', { quantifiers: true })); +//=> [ 'a/b{1,3}/(x|y|z)' ] +console.log(braces('a/b{1,3}/{x,y,z}', { quantifiers: true, expand: true })); +//=> [ 'a/b{1,3}/x', 'a/b{1,3}/y', 'a/b{1,3}/z' ] +``` + +### options.keepEscaping + +**Type**: `Boolean` + +**Default**: `undefined` + +**Description**: Do not strip backslashes that were used for escaping from the result. + +## What is "brace expansion"? + +Brace expansion is a type of parameter expansion that was made popular by unix shells for generating lists of strings, as well as regex-like matching when used alongside wildcards (globs). + +In addition to "expansion", braces are also used for matching. In other words: + +- [brace expansion](#brace-expansion) is for generating new lists +- [brace matching](#brace-matching) is for filtering existing lists + +
+More about brace expansion (click to expand) + +There are two main types of brace expansion: + +1. **lists**: which are defined using comma-separated values inside curly braces: `{a,b,c}` +2. **sequences**: which are defined using a starting value and an ending value, separated by two dots: `a{1..3}b`. Optionally, a third argument may be passed to define a "step" or increment to use: `a{1..100..10}b`. These are also sometimes referred to as "ranges". + +Here are some example brace patterns to illustrate how they work: + +**Sets** + +``` +{a,b,c} => a b c +{a,b,c}{1,2} => a1 a2 b1 b2 c1 c2 +``` + +**Sequences** + +``` +{1..9} => 1 2 3 4 5 6 7 8 9 +{4..-4} => 4 3 2 1 0 -1 -2 -3 -4 +{1..20..3} => 1 4 7 10 13 16 19 +{a..j} => a b c d e f g h i j +{j..a} => j i h g f e d c b a +{a..z..3} => a d g j m p s v y +``` + +**Combination** + +Sets and sequences can be mixed together or used along with any other strings. + +``` +{a,b,c}{1..3} => a1 a2 a3 b1 b2 b3 c1 c2 c3 +foo/{a,b,c}/bar => foo/a/bar foo/b/bar foo/c/bar +``` + +The fact that braces can be "expanded" from relatively simple patterns makes them ideal for quickly generating test fixtures, file paths, and similar use cases. + +## Brace matching + +In addition to _expansion_, brace patterns are also useful for performing regular-expression-like matching. + +For example, the pattern `foo/{1..3}/bar` would match any of following strings: + +``` +foo/1/bar +foo/2/bar +foo/3/bar +``` + +But not: + +``` +baz/1/qux +baz/2/qux +baz/3/qux +``` + +Braces can also be combined with [glob patterns](https://github.com/jonschlinkert/micromatch) to perform more advanced wildcard matching. For example, the pattern `*/{1..3}/*` would match any of following strings: + +``` +foo/1/bar +foo/2/bar +foo/3/bar +baz/1/qux +baz/2/qux +baz/3/qux +``` + +## Brace matching pitfalls + +Although brace patterns offer a user-friendly way of matching ranges or sets of strings, there are also some major disadvantages and potential risks you should be aware of. + +### tldr + +**"brace bombs"** + +- brace expansion can eat up a huge amount of processing resources +- as brace patterns increase _linearly in size_, the system resources required to expand the pattern increase exponentially +- users can accidentally (or intentially) exhaust your system's resources resulting in the equivalent of a DoS attack (bonus: no programming knowledge is required!) + +For a more detailed explanation with examples, see the [geometric complexity](#geometric-complexity) section. + +### The solution + +Jump to the [performance section](#performance) to see how Braces solves this problem in comparison to other libraries. + +### Geometric complexity + +At minimum, brace patterns with sets limited to two elements have quadradic or `O(n^2)` complexity. But the complexity of the algorithm increases exponentially as the number of sets, _and elements per set_, increases, which is `O(n^c)`. + +For example, the following sets demonstrate quadratic (`O(n^2)`) complexity: + +``` +{1,2}{3,4} => (2X2) => 13 14 23 24 +{1,2}{3,4}{5,6} => (2X2X2) => 135 136 145 146 235 236 245 246 +``` + +But add an element to a set, and we get a n-fold Cartesian product with `O(n^c)` complexity: + +``` +{1,2,3}{4,5,6}{7,8,9} => (3X3X3) => 147 148 149 157 158 159 167 168 169 247 248 + 249 257 258 259 267 268 269 347 348 349 357 + 358 359 367 368 369 +``` + +Now, imagine how this complexity grows given that each element is a n-tuple: + +``` +{1..100}{1..100} => (100X100) => 10,000 elements (38.4 kB) +{1..100}{1..100}{1..100} => (100X100X100) => 1,000,000 elements (5.76 MB) +``` + +Although these examples are clearly contrived, they demonstrate how brace patterns can quickly grow out of control. + +**More information** + +Interested in learning more about brace expansion? + +- [linuxjournal/bash-brace-expansion](http://www.linuxjournal.com/content/bash-brace-expansion) +- [rosettacode/Brace_expansion](https://rosettacode.org/wiki/Brace_expansion) +- [cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) + +
+ +## Performance + +Braces is not only screaming fast, it's also more accurate the other brace expansion libraries. + +### Better algorithms + +Fortunately there is a solution to the ["brace bomb" problem](#brace-matching-pitfalls): _don't expand brace patterns into an array when they're used for matching_. + +Instead, convert the pattern into an optimized regular expression. This is easier said than done, and braces is the only library that does this currently. + +**The proof is in the numbers** + +Minimatch gets exponentially slower as patterns increase in complexity, braces does not. The following results were generated using `braces()` and `minimatch.braceExpand()`, respectively. + +| **Pattern** | **braces** | **[minimatch][]** | +| --------------------------- | ------------------- | ---------------------------- | +| `{1..9007199254740991}`[^1] | `298 B` (5ms 459μs) | N/A (freezes) | +| `{1..1000000000000000}` | `41 B` (1ms 15μs) | N/A (freezes) | +| `{1..100000000000000}` | `40 B` (890μs) | N/A (freezes) | +| `{1..10000000000000}` | `39 B` (2ms 49μs) | N/A (freezes) | +| `{1..1000000000000}` | `38 B` (608μs) | N/A (freezes) | +| `{1..100000000000}` | `37 B` (397μs) | N/A (freezes) | +| `{1..10000000000}` | `35 B` (983μs) | N/A (freezes) | +| `{1..1000000000}` | `34 B` (798μs) | N/A (freezes) | +| `{1..100000000}` | `33 B` (733μs) | N/A (freezes) | +| `{1..10000000}` | `32 B` (5ms 632μs) | `78.89 MB` (16s 388ms 569μs) | +| `{1..1000000}` | `31 B` (1ms 381μs) | `6.89 MB` (1s 496ms 887μs) | +| `{1..100000}` | `30 B` (950μs) | `588.89 kB` (146ms 921μs) | +| `{1..10000}` | `29 B` (1ms 114μs) | `48.89 kB` (14ms 187μs) | +| `{1..1000}` | `28 B` (760μs) | `3.89 kB` (1ms 453μs) | +| `{1..100}` | `22 B` (345μs) | `291 B` (196μs) | +| `{1..10}` | `10 B` (533μs) | `20 B` (37μs) | +| `{1..3}` | `7 B` (190μs) | `5 B` (27μs) | + +### Faster algorithms + +When you need expansion, braces is still much faster. + +_(the following results were generated using `braces.expand()` and `minimatch.braceExpand()`, respectively)_ + +| **Pattern** | **braces** | **[minimatch][]** | +| --------------- | --------------------------- | ---------------------------- | +| `{1..10000000}` | `78.89 MB` (2s 698ms 642μs) | `78.89 MB` (18s 601ms 974μs) | +| `{1..1000000}` | `6.89 MB` (458ms 576μs) | `6.89 MB` (1s 491ms 621μs) | +| `{1..100000}` | `588.89 kB` (20ms 728μs) | `588.89 kB` (156ms 919μs) | +| `{1..10000}` | `48.89 kB` (2ms 202μs) | `48.89 kB` (13ms 641μs) | +| `{1..1000}` | `3.89 kB` (1ms 796μs) | `3.89 kB` (1ms 958μs) | +| `{1..100}` | `291 B` (424μs) | `291 B` (211μs) | +| `{1..10}` | `20 B` (487μs) | `20 B` (72μs) | +| `{1..3}` | `5 B` (166μs) | `5 B` (27μs) | + +If you'd like to run these comparisons yourself, see [test/support/generate.js](test/support/generate.js). + +## Benchmarks + +### Running benchmarks + +Install dev dependencies: + +```bash +npm i -d && npm benchmark +``` + +### Latest results + +Braces is more accurate, without sacrificing performance. + +```bash +● expand - range (expanded) + braces x 53,167 ops/sec ±0.12% (102 runs sampled) + minimatch x 11,378 ops/sec ±0.10% (102 runs sampled) +● expand - range (optimized for regex) + braces x 373,442 ops/sec ±0.04% (100 runs sampled) + minimatch x 3,262 ops/sec ±0.18% (100 runs sampled) +● expand - nested ranges (expanded) + braces x 33,921 ops/sec ±0.09% (99 runs sampled) + minimatch x 10,855 ops/sec ±0.28% (100 runs sampled) +● expand - nested ranges (optimized for regex) + braces x 287,479 ops/sec ±0.52% (98 runs sampled) + minimatch x 3,219 ops/sec ±0.28% (101 runs sampled) +● expand - set (expanded) + braces x 238,243 ops/sec ±0.19% (97 runs sampled) + minimatch x 538,268 ops/sec ±0.31% (96 runs sampled) +● expand - set (optimized for regex) + braces x 321,844 ops/sec ±0.10% (97 runs sampled) + minimatch x 140,600 ops/sec ±0.15% (100 runs sampled) +● expand - nested sets (expanded) + braces x 165,371 ops/sec ±0.42% (96 runs sampled) + minimatch x 337,720 ops/sec ±0.28% (100 runs sampled) +● expand - nested sets (optimized for regex) + braces x 242,948 ops/sec ±0.12% (99 runs sampled) + minimatch x 87,403 ops/sec ±0.79% (96 runs sampled) +``` + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Contributors + +| **Commits** | **Contributor** | +| ----------- | ------------------------------------------------------------- | +| 197 | [jonschlinkert](https://github.com/jonschlinkert) | +| 4 | [doowb](https://github.com/doowb) | +| 1 | [es128](https://github.com/es128) | +| 1 | [eush77](https://github.com/eush77) | +| 1 | [hemanth](https://github.com/hemanth) | +| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | + +### Author + +**Jon Schlinkert** + +- [GitHub Profile](https://github.com/jonschlinkert) +- [Twitter Profile](https://twitter.com/jonschlinkert) +- [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) + +### License + +Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +--- + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on April 08, 2019._ diff --git a/publisher/node_modules/braces/index.js b/publisher/node_modules/braces/index.js new file mode 100644 index 00000000..d222c13b --- /dev/null +++ b/publisher/node_modules/braces/index.js @@ -0,0 +1,170 @@ +'use strict'; + +const stringify = require('./lib/stringify'); +const compile = require('./lib/compile'); +const expand = require('./lib/expand'); +const parse = require('./lib/parse'); + +/** + * Expand the given pattern or create a regex-compatible string. + * + * ```js + * const braces = require('braces'); + * console.log(braces('{a,b,c}', { compile: true })); //=> ['(a|b|c)'] + * console.log(braces('{a,b,c}')); //=> ['a', 'b', 'c'] + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {String} + * @api public + */ + +const braces = (input, options = {}) => { + let output = []; + + if (Array.isArray(input)) { + for (const pattern of input) { + const result = braces.create(pattern, options); + if (Array.isArray(result)) { + output.push(...result); + } else { + output.push(result); + } + } + } else { + output = [].concat(braces.create(input, options)); + } + + if (options && options.expand === true && options.nodupes === true) { + output = [...new Set(output)]; + } + return output; +}; + +/** + * Parse the given `str` with the given `options`. + * + * ```js + * // braces.parse(pattern, [, options]); + * const ast = braces.parse('a/{b,c}/d'); + * console.log(ast); + * ``` + * @param {String} pattern Brace pattern to parse + * @param {Object} options + * @return {Object} Returns an AST + * @api public + */ + +braces.parse = (input, options = {}) => parse(input, options); + +/** + * Creates a braces string from an AST, or an AST node. + * + * ```js + * const braces = require('braces'); + * let ast = braces.parse('foo/{a,b}/bar'); + * console.log(stringify(ast.nodes[2])); //=> '{a,b}' + * ``` + * @param {String} `input` Brace pattern or AST. + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ + +braces.stringify = (input, options = {}) => { + if (typeof input === 'string') { + return stringify(braces.parse(input, options), options); + } + return stringify(input, options); +}; + +/** + * Compiles a brace pattern into a regex-compatible, optimized string. + * This method is called by the main [braces](#braces) function by default. + * + * ```js + * const braces = require('braces'); + * console.log(braces.compile('a/{b,c}/d')); + * //=> ['a/(b|c)/d'] + * ``` + * @param {String} `input` Brace pattern or AST. + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ + +braces.compile = (input, options = {}) => { + if (typeof input === 'string') { + input = braces.parse(input, options); + } + return compile(input, options); +}; + +/** + * Expands a brace pattern into an array. This method is called by the + * main [braces](#braces) function when `options.expand` is true. Before + * using this method it's recommended that you read the [performance notes](#performance)) + * and advantages of using [.compile](#compile) instead. + * + * ```js + * const braces = require('braces'); + * console.log(braces.expand('a/{b,c}/d')); + * //=> ['a/b/d', 'a/c/d']; + * ``` + * @param {String} `pattern` Brace pattern + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ + +braces.expand = (input, options = {}) => { + if (typeof input === 'string') { + input = braces.parse(input, options); + } + + let result = expand(input, options); + + // filter out empty strings if specified + if (options.noempty === true) { + result = result.filter(Boolean); + } + + // filter out duplicates if specified + if (options.nodupes === true) { + result = [...new Set(result)]; + } + + return result; +}; + +/** + * Processes a brace pattern and returns either an expanded array + * (if `options.expand` is true), a highly optimized regex-compatible string. + * This method is called by the main [braces](#braces) function. + * + * ```js + * const braces = require('braces'); + * console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}')) + * //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)' + * ``` + * @param {String} `pattern` Brace pattern + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ + +braces.create = (input, options = {}) => { + if (input === '' || input.length < 3) { + return [input]; + } + + return options.expand !== true + ? braces.compile(input, options) + : braces.expand(input, options); +}; + +/** + * Expose "braces" + */ + +module.exports = braces; diff --git a/publisher/node_modules/braces/lib/compile.js b/publisher/node_modules/braces/lib/compile.js new file mode 100644 index 00000000..dce69beb --- /dev/null +++ b/publisher/node_modules/braces/lib/compile.js @@ -0,0 +1,60 @@ +'use strict'; + +const fill = require('fill-range'); +const utils = require('./utils'); + +const compile = (ast, options = {}) => { + const walk = (node, parent = {}) => { + const invalidBlock = utils.isInvalidBrace(parent); + const invalidNode = node.invalid === true && options.escapeInvalid === true; + const invalid = invalidBlock === true || invalidNode === true; + const prefix = options.escapeInvalid === true ? '\\' : ''; + let output = ''; + + if (node.isOpen === true) { + return prefix + node.value; + } + + if (node.isClose === true) { + console.log('node.isClose', prefix, node.value); + return prefix + node.value; + } + + if (node.type === 'open') { + return invalid ? prefix + node.value : '('; + } + + if (node.type === 'close') { + return invalid ? prefix + node.value : ')'; + } + + if (node.type === 'comma') { + return node.prev.type === 'comma' ? '' : invalid ? node.value : '|'; + } + + if (node.value) { + return node.value; + } + + if (node.nodes && node.ranges > 0) { + const args = utils.reduce(node.nodes); + const range = fill(...args, { ...options, wrap: false, toRegex: true, strictZeros: true }); + + if (range.length !== 0) { + return args.length > 1 && range.length > 1 ? `(${range})` : range; + } + } + + if (node.nodes) { + for (const child of node.nodes) { + output += walk(child, node); + } + } + + return output; + }; + + return walk(ast); +}; + +module.exports = compile; diff --git a/publisher/node_modules/braces/lib/constants.js b/publisher/node_modules/braces/lib/constants.js new file mode 100644 index 00000000..2bb3b884 --- /dev/null +++ b/publisher/node_modules/braces/lib/constants.js @@ -0,0 +1,57 @@ +'use strict'; + +module.exports = { + MAX_LENGTH: 10000, + + // Digits + CHAR_0: '0', /* 0 */ + CHAR_9: '9', /* 9 */ + + // Alphabet chars. + CHAR_UPPERCASE_A: 'A', /* A */ + CHAR_LOWERCASE_A: 'a', /* a */ + CHAR_UPPERCASE_Z: 'Z', /* Z */ + CHAR_LOWERCASE_Z: 'z', /* z */ + + CHAR_LEFT_PARENTHESES: '(', /* ( */ + CHAR_RIGHT_PARENTHESES: ')', /* ) */ + + CHAR_ASTERISK: '*', /* * */ + + // Non-alphabetic chars. + CHAR_AMPERSAND: '&', /* & */ + CHAR_AT: '@', /* @ */ + CHAR_BACKSLASH: '\\', /* \ */ + CHAR_BACKTICK: '`', /* ` */ + CHAR_CARRIAGE_RETURN: '\r', /* \r */ + CHAR_CIRCUMFLEX_ACCENT: '^', /* ^ */ + CHAR_COLON: ':', /* : */ + CHAR_COMMA: ',', /* , */ + CHAR_DOLLAR: '$', /* . */ + CHAR_DOT: '.', /* . */ + CHAR_DOUBLE_QUOTE: '"', /* " */ + CHAR_EQUAL: '=', /* = */ + CHAR_EXCLAMATION_MARK: '!', /* ! */ + CHAR_FORM_FEED: '\f', /* \f */ + CHAR_FORWARD_SLASH: '/', /* / */ + CHAR_HASH: '#', /* # */ + CHAR_HYPHEN_MINUS: '-', /* - */ + CHAR_LEFT_ANGLE_BRACKET: '<', /* < */ + CHAR_LEFT_CURLY_BRACE: '{', /* { */ + CHAR_LEFT_SQUARE_BRACKET: '[', /* [ */ + CHAR_LINE_FEED: '\n', /* \n */ + CHAR_NO_BREAK_SPACE: '\u00A0', /* \u00A0 */ + CHAR_PERCENT: '%', /* % */ + CHAR_PLUS: '+', /* + */ + CHAR_QUESTION_MARK: '?', /* ? */ + CHAR_RIGHT_ANGLE_BRACKET: '>', /* > */ + CHAR_RIGHT_CURLY_BRACE: '}', /* } */ + CHAR_RIGHT_SQUARE_BRACKET: ']', /* ] */ + CHAR_SEMICOLON: ';', /* ; */ + CHAR_SINGLE_QUOTE: '\'', /* ' */ + CHAR_SPACE: ' ', /* */ + CHAR_TAB: '\t', /* \t */ + CHAR_UNDERSCORE: '_', /* _ */ + CHAR_VERTICAL_LINE: '|', /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: '\uFEFF' /* \uFEFF */ +}; diff --git a/publisher/node_modules/braces/lib/expand.js b/publisher/node_modules/braces/lib/expand.js new file mode 100644 index 00000000..35b2c41d --- /dev/null +++ b/publisher/node_modules/braces/lib/expand.js @@ -0,0 +1,113 @@ +'use strict'; + +const fill = require('fill-range'); +const stringify = require('./stringify'); +const utils = require('./utils'); + +const append = (queue = '', stash = '', enclose = false) => { + const result = []; + + queue = [].concat(queue); + stash = [].concat(stash); + + if (!stash.length) return queue; + if (!queue.length) { + return enclose ? utils.flatten(stash).map(ele => `{${ele}}`) : stash; + } + + for (const item of queue) { + if (Array.isArray(item)) { + for (const value of item) { + result.push(append(value, stash, enclose)); + } + } else { + for (let ele of stash) { + if (enclose === true && typeof ele === 'string') ele = `{${ele}}`; + result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele); + } + } + } + return utils.flatten(result); +}; + +const expand = (ast, options = {}) => { + const rangeLimit = options.rangeLimit === undefined ? 1000 : options.rangeLimit; + + const walk = (node, parent = {}) => { + node.queue = []; + + let p = parent; + let q = parent.queue; + + while (p.type !== 'brace' && p.type !== 'root' && p.parent) { + p = p.parent; + q = p.queue; + } + + if (node.invalid || node.dollar) { + q.push(append(q.pop(), stringify(node, options))); + return; + } + + if (node.type === 'brace' && node.invalid !== true && node.nodes.length === 2) { + q.push(append(q.pop(), ['{}'])); + return; + } + + if (node.nodes && node.ranges > 0) { + const args = utils.reduce(node.nodes); + + if (utils.exceedsLimit(...args, options.step, rangeLimit)) { + throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.'); + } + + let range = fill(...args, options); + if (range.length === 0) { + range = stringify(node, options); + } + + q.push(append(q.pop(), range)); + node.nodes = []; + return; + } + + const enclose = utils.encloseBrace(node); + let queue = node.queue; + let block = node; + + while (block.type !== 'brace' && block.type !== 'root' && block.parent) { + block = block.parent; + queue = block.queue; + } + + for (let i = 0; i < node.nodes.length; i++) { + const child = node.nodes[i]; + + if (child.type === 'comma' && node.type === 'brace') { + if (i === 1) queue.push(''); + queue.push(''); + continue; + } + + if (child.type === 'close') { + q.push(append(q.pop(), queue, enclose)); + continue; + } + + if (child.value && child.type !== 'open') { + queue.push(append(queue.pop(), child.value)); + continue; + } + + if (child.nodes) { + walk(child, node); + } + } + + return queue; + }; + + return utils.flatten(walk(ast)); +}; + +module.exports = expand; diff --git a/publisher/node_modules/braces/lib/parse.js b/publisher/node_modules/braces/lib/parse.js new file mode 100644 index 00000000..3a6988e6 --- /dev/null +++ b/publisher/node_modules/braces/lib/parse.js @@ -0,0 +1,331 @@ +'use strict'; + +const stringify = require('./stringify'); + +/** + * Constants + */ + +const { + MAX_LENGTH, + CHAR_BACKSLASH, /* \ */ + CHAR_BACKTICK, /* ` */ + CHAR_COMMA, /* , */ + CHAR_DOT, /* . */ + CHAR_LEFT_PARENTHESES, /* ( */ + CHAR_RIGHT_PARENTHESES, /* ) */ + CHAR_LEFT_CURLY_BRACE, /* { */ + CHAR_RIGHT_CURLY_BRACE, /* } */ + CHAR_LEFT_SQUARE_BRACKET, /* [ */ + CHAR_RIGHT_SQUARE_BRACKET, /* ] */ + CHAR_DOUBLE_QUOTE, /* " */ + CHAR_SINGLE_QUOTE, /* ' */ + CHAR_NO_BREAK_SPACE, + CHAR_ZERO_WIDTH_NOBREAK_SPACE +} = require('./constants'); + +/** + * parse + */ + +const parse = (input, options = {}) => { + if (typeof input !== 'string') { + throw new TypeError('Expected a string'); + } + + const opts = options || {}; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + if (input.length > max) { + throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`); + } + + const ast = { type: 'root', input, nodes: [] }; + const stack = [ast]; + let block = ast; + let prev = ast; + let brackets = 0; + const length = input.length; + let index = 0; + let depth = 0; + let value; + + /** + * Helpers + */ + + const advance = () => input[index++]; + const push = node => { + if (node.type === 'text' && prev.type === 'dot') { + prev.type = 'text'; + } + + if (prev && prev.type === 'text' && node.type === 'text') { + prev.value += node.value; + return; + } + + block.nodes.push(node); + node.parent = block; + node.prev = prev; + prev = node; + return node; + }; + + push({ type: 'bos' }); + + while (index < length) { + block = stack[stack.length - 1]; + value = advance(); + + /** + * Invalid chars + */ + + if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) { + continue; + } + + /** + * Escaped chars + */ + + if (value === CHAR_BACKSLASH) { + push({ type: 'text', value: (options.keepEscaping ? value : '') + advance() }); + continue; + } + + /** + * Right square bracket (literal): ']' + */ + + if (value === CHAR_RIGHT_SQUARE_BRACKET) { + push({ type: 'text', value: '\\' + value }); + continue; + } + + /** + * Left square bracket: '[' + */ + + if (value === CHAR_LEFT_SQUARE_BRACKET) { + brackets++; + + let next; + + while (index < length && (next = advance())) { + value += next; + + if (next === CHAR_LEFT_SQUARE_BRACKET) { + brackets++; + continue; + } + + if (next === CHAR_BACKSLASH) { + value += advance(); + continue; + } + + if (next === CHAR_RIGHT_SQUARE_BRACKET) { + brackets--; + + if (brackets === 0) { + break; + } + } + } + + push({ type: 'text', value }); + continue; + } + + /** + * Parentheses + */ + + if (value === CHAR_LEFT_PARENTHESES) { + block = push({ type: 'paren', nodes: [] }); + stack.push(block); + push({ type: 'text', value }); + continue; + } + + if (value === CHAR_RIGHT_PARENTHESES) { + if (block.type !== 'paren') { + push({ type: 'text', value }); + continue; + } + block = stack.pop(); + push({ type: 'text', value }); + block = stack[stack.length - 1]; + continue; + } + + /** + * Quotes: '|"|` + */ + + if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) { + const open = value; + let next; + + if (options.keepQuotes !== true) { + value = ''; + } + + while (index < length && (next = advance())) { + if (next === CHAR_BACKSLASH) { + value += next + advance(); + continue; + } + + if (next === open) { + if (options.keepQuotes === true) value += next; + break; + } + + value += next; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Left curly brace: '{' + */ + + if (value === CHAR_LEFT_CURLY_BRACE) { + depth++; + + const dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true; + const brace = { + type: 'brace', + open: true, + close: false, + dollar, + depth, + commas: 0, + ranges: 0, + nodes: [] + }; + + block = push(brace); + stack.push(block); + push({ type: 'open', value }); + continue; + } + + /** + * Right curly brace: '}' + */ + + if (value === CHAR_RIGHT_CURLY_BRACE) { + if (block.type !== 'brace') { + push({ type: 'text', value }); + continue; + } + + const type = 'close'; + block = stack.pop(); + block.close = true; + + push({ type, value }); + depth--; + + block = stack[stack.length - 1]; + continue; + } + + /** + * Comma: ',' + */ + + if (value === CHAR_COMMA && depth > 0) { + if (block.ranges > 0) { + block.ranges = 0; + const open = block.nodes.shift(); + block.nodes = [open, { type: 'text', value: stringify(block) }]; + } + + push({ type: 'comma', value }); + block.commas++; + continue; + } + + /** + * Dot: '.' + */ + + if (value === CHAR_DOT && depth > 0 && block.commas === 0) { + const siblings = block.nodes; + + if (depth === 0 || siblings.length === 0) { + push({ type: 'text', value }); + continue; + } + + if (prev.type === 'dot') { + block.range = []; + prev.value += value; + prev.type = 'range'; + + if (block.nodes.length !== 3 && block.nodes.length !== 5) { + block.invalid = true; + block.ranges = 0; + prev.type = 'text'; + continue; + } + + block.ranges++; + block.args = []; + continue; + } + + if (prev.type === 'range') { + siblings.pop(); + + const before = siblings[siblings.length - 1]; + before.value += prev.value + value; + prev = before; + block.ranges--; + continue; + } + + push({ type: 'dot', value }); + continue; + } + + /** + * Text + */ + + push({ type: 'text', value }); + } + + // Mark imbalanced braces and brackets as invalid + do { + block = stack.pop(); + + if (block.type !== 'root') { + block.nodes.forEach(node => { + if (!node.nodes) { + if (node.type === 'open') node.isOpen = true; + if (node.type === 'close') node.isClose = true; + if (!node.nodes) node.type = 'text'; + node.invalid = true; + } + }); + + // get the location of the block on parent.nodes (block's siblings) + const parent = stack[stack.length - 1]; + const index = parent.nodes.indexOf(block); + // replace the (invalid) block with it's nodes + parent.nodes.splice(index, 1, ...block.nodes); + } + } while (stack.length > 0); + + push({ type: 'eos' }); + return ast; +}; + +module.exports = parse; diff --git a/publisher/node_modules/braces/lib/stringify.js b/publisher/node_modules/braces/lib/stringify.js new file mode 100644 index 00000000..8bcf872c --- /dev/null +++ b/publisher/node_modules/braces/lib/stringify.js @@ -0,0 +1,32 @@ +'use strict'; + +const utils = require('./utils'); + +module.exports = (ast, options = {}) => { + const stringify = (node, parent = {}) => { + const invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent); + const invalidNode = node.invalid === true && options.escapeInvalid === true; + let output = ''; + + if (node.value) { + if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) { + return '\\' + node.value; + } + return node.value; + } + + if (node.value) { + return node.value; + } + + if (node.nodes) { + for (const child of node.nodes) { + output += stringify(child); + } + } + return output; + }; + + return stringify(ast); +}; + diff --git a/publisher/node_modules/braces/lib/utils.js b/publisher/node_modules/braces/lib/utils.js new file mode 100644 index 00000000..d19311fe --- /dev/null +++ b/publisher/node_modules/braces/lib/utils.js @@ -0,0 +1,122 @@ +'use strict'; + +exports.isInteger = num => { + if (typeof num === 'number') { + return Number.isInteger(num); + } + if (typeof num === 'string' && num.trim() !== '') { + return Number.isInteger(Number(num)); + } + return false; +}; + +/** + * Find a node of the given type + */ + +exports.find = (node, type) => node.nodes.find(node => node.type === type); + +/** + * Find a node of the given type + */ + +exports.exceedsLimit = (min, max, step = 1, limit) => { + if (limit === false) return false; + if (!exports.isInteger(min) || !exports.isInteger(max)) return false; + return ((Number(max) - Number(min)) / Number(step)) >= limit; +}; + +/** + * Escape the given node with '\\' before node.value + */ + +exports.escapeNode = (block, n = 0, type) => { + const node = block.nodes[n]; + if (!node) return; + + if ((type && node.type === type) || node.type === 'open' || node.type === 'close') { + if (node.escaped !== true) { + node.value = '\\' + node.value; + node.escaped = true; + } + } +}; + +/** + * Returns true if the given brace node should be enclosed in literal braces + */ + +exports.encloseBrace = node => { + if (node.type !== 'brace') return false; + if ((node.commas >> 0 + node.ranges >> 0) === 0) { + node.invalid = true; + return true; + } + return false; +}; + +/** + * Returns true if a brace node is invalid. + */ + +exports.isInvalidBrace = block => { + if (block.type !== 'brace') return false; + if (block.invalid === true || block.dollar) return true; + if ((block.commas >> 0 + block.ranges >> 0) === 0) { + block.invalid = true; + return true; + } + if (block.open !== true || block.close !== true) { + block.invalid = true; + return true; + } + return false; +}; + +/** + * Returns true if a node is an open or close node + */ + +exports.isOpenOrClose = node => { + if (node.type === 'open' || node.type === 'close') { + return true; + } + return node.open === true || node.close === true; +}; + +/** + * Reduce an array of text nodes. + */ + +exports.reduce = nodes => nodes.reduce((acc, node) => { + if (node.type === 'text') acc.push(node.value); + if (node.type === 'range') node.type = 'text'; + return acc; +}, []); + +/** + * Flatten an array + */ + +exports.flatten = (...args) => { + const result = []; + + const flat = arr => { + for (let i = 0; i < arr.length; i++) { + const ele = arr[i]; + + if (Array.isArray(ele)) { + flat(ele); + continue; + } + + if (ele !== undefined) { + result.push(ele); + } + } + return result; + }; + + flat(args); + return result; +}; diff --git a/publisher/node_modules/braces/package.json b/publisher/node_modules/braces/package.json new file mode 100644 index 00000000..c3c056e4 --- /dev/null +++ b/publisher/node_modules/braces/package.json @@ -0,0 +1,77 @@ +{ + "name": "braces", + "description": "Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed.", + "version": "3.0.3", + "homepage": "https://github.com/micromatch/braces", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "Brian Woodward (https://twitter.com/doowb)", + "Elan Shanker (https://github.com/es128)", + "Eugene Sharygin (https://github.com/eush77)", + "hemanth.hm (http://h3manth.com)", + "Jon Schlinkert (http://twitter.com/jonschlinkert)" + ], + "repository": "micromatch/braces", + "bugs": { + "url": "https://github.com/micromatch/braces/issues" + }, + "license": "MIT", + "files": [ + "index.js", + "lib" + ], + "main": "index.js", + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "mocha", + "benchmark": "node benchmark" + }, + "dependencies": { + "fill-range": "^7.1.1" + }, + "devDependencies": { + "ansi-colors": "^3.2.4", + "bash-path": "^2.0.1", + "gulp-format-md": "^2.0.0", + "mocha": "^6.1.1" + }, + "keywords": [ + "alpha", + "alphabetical", + "bash", + "brace", + "braces", + "expand", + "expansion", + "filepath", + "fill", + "fs", + "glob", + "globbing", + "letter", + "match", + "matches", + "matching", + "number", + "numerical", + "path", + "range", + "ranges", + "sh" + ], + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "lint": { + "reflinks": true + }, + "plugins": [ + "gulp-format-md" + ] + } +} diff --git a/publisher/node_modules/call-bind/.eslintignore b/publisher/node_modules/call-bind/.eslintignore new file mode 100644 index 00000000..404abb22 --- /dev/null +++ b/publisher/node_modules/call-bind/.eslintignore @@ -0,0 +1 @@ +coverage/ diff --git a/publisher/node_modules/call-bind/.eslintrc b/publisher/node_modules/call-bind/.eslintrc new file mode 100644 index 00000000..dfa9a6cd --- /dev/null +++ b/publisher/node_modules/call-bind/.eslintrc @@ -0,0 +1,16 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "func-name-matching": 0, + "id-length": 0, + "new-cap": [2, { + "capIsNewExceptions": [ + "GetIntrinsic", + ], + }], + "no-magic-numbers": 0, + }, +} diff --git a/publisher/node_modules/call-bind/.github/FUNDING.yml b/publisher/node_modules/call-bind/.github/FUNDING.yml new file mode 100644 index 00000000..c70c2ecd --- /dev/null +++ b/publisher/node_modules/call-bind/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/call-bind +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/publisher/node_modules/call-bind/.nycrc b/publisher/node_modules/call-bind/.nycrc new file mode 100644 index 00000000..bdd626ce --- /dev/null +++ b/publisher/node_modules/call-bind/.nycrc @@ -0,0 +1,9 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "exclude": [ + "coverage", + "test" + ] +} diff --git a/publisher/node_modules/call-bind/CHANGELOG.md b/publisher/node_modules/call-bind/CHANGELOG.md new file mode 100644 index 00000000..c653f701 --- /dev/null +++ b/publisher/node_modules/call-bind/CHANGELOG.md @@ -0,0 +1,93 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.0.7](https://github.com/ljharb/call-bind/compare/v1.0.6...v1.0.7) - 2024-02-12 + +### Commits + +- [Refactor] use `es-define-property` [`09b76a0`](https://github.com/ljharb/call-bind/commit/09b76a01634440461d44a80c9924ec4b500f3b03) +- [Deps] update `get-intrinsic`, `set-function-length` [`ad5136d`](https://github.com/ljharb/call-bind/commit/ad5136ddda2a45c590959829ad3dce0c9f4e3590) + +## [v1.0.6](https://github.com/ljharb/call-bind/compare/v1.0.5...v1.0.6) - 2024-02-05 + +### Commits + +- [Dev Deps] update `aud`, `npmignore`, `tape` [`d564d5c`](https://github.com/ljharb/call-bind/commit/d564d5ce3e06a19df4d499c77f8d1a9da44e77aa) +- [Deps] update `get-intrinsic`, `set-function-length` [`cfc2bdc`](https://github.com/ljharb/call-bind/commit/cfc2bdca7b633df0e0e689e6b637f668f1c6792e) +- [Refactor] use `es-errors`, so things that only need those do not need `get-intrinsic` [`64cd289`](https://github.com/ljharb/call-bind/commit/64cd289ae5862c250a4ca80aa8d461047c166af5) +- [meta] add missing `engines.node` [`32a4038`](https://github.com/ljharb/call-bind/commit/32a4038857b62179f7f9b7b3df2c5260036be582) + +## [v1.0.5](https://github.com/ljharb/call-bind/compare/v1.0.4...v1.0.5) - 2023-10-19 + +### Commits + +- [Fix] throw an error on non-functions as early as possible [`f262408`](https://github.com/ljharb/call-bind/commit/f262408f822c840fbc268080f3ad7c429611066d) +- [Deps] update `set-function-length` [`3fff271`](https://github.com/ljharb/call-bind/commit/3fff27145a1e3a76a5b74f1d7c3c43d0fa3b9871) + +## [v1.0.4](https://github.com/ljharb/call-bind/compare/v1.0.3...v1.0.4) - 2023-10-19 + +## [v1.0.3](https://github.com/ljharb/call-bind/compare/v1.0.2...v1.0.3) - 2023-10-19 + +### Commits + +- [actions] reuse common workflows [`a994df6`](https://github.com/ljharb/call-bind/commit/a994df69f401f4bf735a4ccd77029b85d1549453) +- [meta] use `npmignore` to autogenerate an npmignore file [`eef3ef2`](https://github.com/ljharb/call-bind/commit/eef3ef21e1f002790837fedb8af2679c761fbdf5) +- [readme] flesh out content [`1845ccf`](https://github.com/ljharb/call-bind/commit/1845ccfd9976a607884cfc7157c93192cc16cf22) +- [actions] use `node/install` instead of `node/run`; use `codecov` action [`5b47d53`](https://github.com/ljharb/call-bind/commit/5b47d53d2fd74af5ea0a44f1d51e503cd42f7a90) +- [Refactor] use `set-function-length` [`a0e165c`](https://github.com/ljharb/call-bind/commit/a0e165c5dc61db781cbc919b586b1c2b8da0b150) +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`9c50103`](https://github.com/ljharb/call-bind/commit/9c50103f44137279a817317cf6cc421a658f85b4) +- [meta] simplify "exports" [`019c6d0`](https://github.com/ljharb/call-bind/commit/019c6d06b0e1246ceed8e579f57e44441cbbf6d9) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `safe-publish-latest`, `tape` [`23bd718`](https://github.com/ljharb/call-bind/commit/23bd718a288d3b03042062b4ef5153b3cea83f11) +- [actions] update codecov uploader [`62552d7`](https://github.com/ljharb/call-bind/commit/62552d79cc79e05825e99aaba134ae5b37f33da5) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`ec81665`](https://github.com/ljharb/call-bind/commit/ec81665b300f87eabff597afdc8b8092adfa7afd) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `tape` [`35d67fc`](https://github.com/ljharb/call-bind/commit/35d67fcea883e686650f736f61da5ddca2592de8) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`0266d8d`](https://github.com/ljharb/call-bind/commit/0266d8d2a45086a922db366d0c2932fa463662ff) +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`43a5b28`](https://github.com/ljharb/call-bind/commit/43a5b28a444e710e1bbf92adb8afb5cf7523a223) +- [Deps] update `define-data-property`, `function-bind`, `get-intrinsic` [`780eb36`](https://github.com/ljharb/call-bind/commit/780eb36552514f8cc99c70821ce698697c2726a5) +- [Dev Deps] update `aud`, `tape` [`90d50ad`](https://github.com/ljharb/call-bind/commit/90d50ad03b061e0268b3380b0065fcaec183dc05) +- [meta] use `prepublishOnly` script for npm 7+ [`44c5433`](https://github.com/ljharb/call-bind/commit/44c5433b7980e02b4870007046407cf6fc543329) +- [Deps] update `get-intrinsic` [`86bfbfc`](https://github.com/ljharb/call-bind/commit/86bfbfcf34afdc6eabc93ce3d408548d0e27d958) +- [Deps] update `get-intrinsic` [`5c53354`](https://github.com/ljharb/call-bind/commit/5c5335489be0294c18cd7a8bb6e08226ee019ff5) +- [actions] update checkout action [`4c393a8`](https://github.com/ljharb/call-bind/commit/4c393a8173b3c8e5b30d5b3297b3b94d48bf87f3) +- [Deps] update `get-intrinsic` [`4e70bde`](https://github.com/ljharb/call-bind/commit/4e70bdec0626acb11616d66250fc14565e716e91) +- [Deps] update `get-intrinsic` [`55ae803`](https://github.com/ljharb/call-bind/commit/55ae803a920bd93c369cd798c20de31f91e9fc60) + +## [v1.0.2](https://github.com/ljharb/call-bind/compare/v1.0.1...v1.0.2) - 2021-01-11 + +### Commits + +- [Fix] properly include the receiver in the bound length [`dbae7bc`](https://github.com/ljharb/call-bind/commit/dbae7bc676c079a0d33c0a43e9ef92cb7b01345d) + +## [v1.0.1](https://github.com/ljharb/call-bind/compare/v1.0.0...v1.0.1) - 2021-01-08 + +### Commits + +- [Tests] migrate tests to Github Actions [`b6db284`](https://github.com/ljharb/call-bind/commit/b6db284c36f8ccd195b88a6764fe84b7223a0da1) +- [meta] do not publish github action workflow files [`ec7fe46`](https://github.com/ljharb/call-bind/commit/ec7fe46e60cfa4764ee943d2755f5e5a366e578e) +- [Fix] preserve original function’s length when possible [`adbceaa`](https://github.com/ljharb/call-bind/commit/adbceaa3cac4b41ea78bb19d7ccdbaaf7e0bdadb) +- [Tests] gather coverage data on every job [`d69e23c`](https://github.com/ljharb/call-bind/commit/d69e23cc65f101ba1d4c19bb07fa8eb0ec624be8) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`2fd3586`](https://github.com/ljharb/call-bind/commit/2fd3586c5d47b335364c14293114c6b625ae1f71) +- [Deps] update `get-intrinsic` [`f23e931`](https://github.com/ljharb/call-bind/commit/f23e9318cc271c2add8bb38cfded85ee7baf8eee) +- [Deps] update `get-intrinsic` [`72d9f44`](https://github.com/ljharb/call-bind/commit/72d9f44e184465ba8dd3fb48260bbcff234985f2) +- [meta] fix FUNDING.yml [`e723573`](https://github.com/ljharb/call-bind/commit/e723573438c5a68dcec31fb5d96ea6b7e4a93be8) +- [eslint] ignore coverage output [`15e76d2`](https://github.com/ljharb/call-bind/commit/15e76d28a5f43e504696401e5b31ebb78ee1b532) +- [meta] add Automatic Rebase and Require Allow Edits workflows [`8fa4dab`](https://github.com/ljharb/call-bind/commit/8fa4dabb23ba3dd7bb92c9571c1241c08b56e4b6) + +## v1.0.0 - 2020-10-30 + +### Commits + +- Initial commit [`306cf98`](https://github.com/ljharb/call-bind/commit/306cf98c7ec9e7ef66b653ec152277ac1381eb50) +- Tests [`e10d0bb`](https://github.com/ljharb/call-bind/commit/e10d0bbdadc7a10ecedc9a1c035112d3e368b8df) +- Implementation [`43852ed`](https://github.com/ljharb/call-bind/commit/43852eda0f187327b7fad2423ca972149a52bd65) +- npm init [`408f860`](https://github.com/ljharb/call-bind/commit/408f860b773a2f610805fd3613d0d71bac1b6249) +- [meta] add Automatic Rebase and Require Allow Edits workflows [`fb349b2`](https://github.com/ljharb/call-bind/commit/fb349b2e48defbec8b5ec8a8395cc8f69f220b13) +- [meta] add `auto-changelog` [`c4001fc`](https://github.com/ljharb/call-bind/commit/c4001fc43031799ef908211c98d3b0fb2b60fde4) +- [meta] add "funding"; create `FUNDING.yml` [`d4d6d29`](https://github.com/ljharb/call-bind/commit/d4d6d2974a14bc2e98830468eda7fe6d6a776717) +- [Tests] add `npm run lint` [`dedfb98`](https://github.com/ljharb/call-bind/commit/dedfb98bd0ecefb08ddb9a94061bd10cde4332af) +- Only apps should have lockfiles [`54ac776`](https://github.com/ljharb/call-bind/commit/54ac77653db45a7361dc153d2f478e743f110650) +- [meta] add `safe-publish-latest` [`9ea8e43`](https://github.com/ljharb/call-bind/commit/9ea8e435b950ce9b705559cd651039f9bf40140f) diff --git a/publisher/node_modules/call-bind/LICENSE b/publisher/node_modules/call-bind/LICENSE new file mode 100644 index 00000000..48f05d01 --- /dev/null +++ b/publisher/node_modules/call-bind/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Jordan Harband + +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. diff --git a/publisher/node_modules/call-bind/README.md b/publisher/node_modules/call-bind/README.md new file mode 100644 index 00000000..48e9047f --- /dev/null +++ b/publisher/node_modules/call-bind/README.md @@ -0,0 +1,64 @@ +# call-bind [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Robustly `.call.bind()` a function. + +## Getting started + +```sh +npm install --save call-bind +``` + +## Usage/Examples + +```js +const assert = require('assert'); +const callBind = require('call-bind'); +const callBound = require('call-bind/callBound'); + +function f(a, b) { + assert.equal(this, 1); + assert.equal(a, 2); + assert.equal(b, 3); + assert.equal(arguments.length, 2); +} + +const fBound = callBind(f); + +const slice = callBound('Array.prototype.slice'); + +delete Function.prototype.call; +delete Function.prototype.bind; + +fBound(1, 2, 3); + +assert.deepEqual(slice([1, 2, 3, 4], 1, -1), [2, 3]); +``` + +## Tests + +Clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/call-bind +[npm-version-svg]: https://versionbadg.es/ljharb/call-bind.svg +[deps-svg]: https://david-dm.org/ljharb/call-bind.svg +[deps-url]: https://david-dm.org/ljharb/call-bind +[dev-deps-svg]: https://david-dm.org/ljharb/call-bind/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/call-bind#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/call-bind.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/call-bind.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/call-bind.svg +[downloads-url]: https://npm-stat.com/charts.html?package=call-bind +[codecov-image]: https://codecov.io/gh/ljharb/call-bind/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/call-bind/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/call-bind +[actions-url]: https://github.com/ljharb/call-bind/actions diff --git a/publisher/node_modules/call-bind/callBound.js b/publisher/node_modules/call-bind/callBound.js new file mode 100644 index 00000000..8374adfd --- /dev/null +++ b/publisher/node_modules/call-bind/callBound.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); + +var callBind = require('./'); + +var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); + +module.exports = function callBoundIntrinsic(name, allowMissing) { + var intrinsic = GetIntrinsic(name, !!allowMissing); + if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { + return callBind(intrinsic); + } + return intrinsic; +}; diff --git a/publisher/node_modules/call-bind/index.js b/publisher/node_modules/call-bind/index.js new file mode 100644 index 00000000..01c5b3d4 --- /dev/null +++ b/publisher/node_modules/call-bind/index.js @@ -0,0 +1,35 @@ +'use strict'; + +var bind = require('function-bind'); +var GetIntrinsic = require('get-intrinsic'); +var setFunctionLength = require('set-function-length'); + +var $TypeError = require('es-errors/type'); +var $apply = GetIntrinsic('%Function.prototype.apply%'); +var $call = GetIntrinsic('%Function.prototype.call%'); +var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); + +var $defineProperty = require('es-define-property'); +var $max = GetIntrinsic('%Math.max%'); + +module.exports = function callBind(originalFunction) { + if (typeof originalFunction !== 'function') { + throw new $TypeError('a function is required'); + } + var func = $reflectApply(bind, $call, arguments); + return setFunctionLength( + func, + 1 + $max(0, originalFunction.length - (arguments.length - 1)), + true + ); +}; + +var applyBind = function applyBind() { + return $reflectApply(bind, $apply, arguments); +}; + +if ($defineProperty) { + $defineProperty(module.exports, 'apply', { value: applyBind }); +} else { + module.exports.apply = applyBind; +} diff --git a/publisher/node_modules/call-bind/package.json b/publisher/node_modules/call-bind/package.json new file mode 100644 index 00000000..5ba88ff8 --- /dev/null +++ b/publisher/node_modules/call-bind/package.json @@ -0,0 +1,95 @@ +{ + "name": "call-bind", + "version": "1.0.7", + "description": "Robustly `.call.bind()` a function", + "main": "index.js", + "exports": { + ".": "./index.js", + "./callBound": "./callBound.js", + "./package.json": "./package.json" + }, + "scripts": { + "prepack": "npmignore --auto --commentLines=auto", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prepublishOnly": "safe-publish-latest", + "lint": "eslint --ext=.js,.mjs .", + "postlint": "evalmd README.md", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "aud --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/call-bind.git" + }, + "keywords": [ + "javascript", + "ecmascript", + "es", + "js", + "callbind", + "callbound", + "call", + "bind", + "bound", + "call-bind", + "call-bound", + "function", + "es-abstract" + ], + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/call-bind/issues" + }, + "homepage": "https://github.com/ljharb/call-bind#readme", + "devDependencies": { + "@ljharb/eslint-config": "^21.1.0", + "aud": "^2.0.4", + "auto-changelog": "^2.4.0", + "es-value-fixtures": "^1.4.2", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-strict-mode": "^1.0.1", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "object-inspect": "^1.13.1", + "safe-publish-latest": "^2.0.0", + "tape": "^5.7.4" + }, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "testling": { + "files": "test/index.js" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/publisher/node_modules/call-bind/test/callBound.js b/publisher/node_modules/call-bind/test/callBound.js new file mode 100644 index 00000000..c32319d7 --- /dev/null +++ b/publisher/node_modules/call-bind/test/callBound.js @@ -0,0 +1,54 @@ +'use strict'; + +var test = require('tape'); + +var callBound = require('../callBound'); + +test('callBound', function (t) { + // static primitive + t.equal(callBound('Array.length'), Array.length, 'Array.length yields itself'); + t.equal(callBound('%Array.length%'), Array.length, '%Array.length% yields itself'); + + // static non-function object + t.equal(callBound('Array.prototype'), Array.prototype, 'Array.prototype yields itself'); + t.equal(callBound('%Array.prototype%'), Array.prototype, '%Array.prototype% yields itself'); + t.equal(callBound('Array.constructor'), Array.constructor, 'Array.constructor yields itself'); + t.equal(callBound('%Array.constructor%'), Array.constructor, '%Array.constructor% yields itself'); + + // static function + t.equal(callBound('Date.parse'), Date.parse, 'Date.parse yields itself'); + t.equal(callBound('%Date.parse%'), Date.parse, '%Date.parse% yields itself'); + + // prototype primitive + t.equal(callBound('Error.prototype.message'), Error.prototype.message, 'Error.prototype.message yields itself'); + t.equal(callBound('%Error.prototype.message%'), Error.prototype.message, '%Error.prototype.message% yields itself'); + + // prototype function + t.notEqual(callBound('Object.prototype.toString'), Object.prototype.toString, 'Object.prototype.toString does not yield itself'); + t.notEqual(callBound('%Object.prototype.toString%'), Object.prototype.toString, '%Object.prototype.toString% does not yield itself'); + t.equal(callBound('Object.prototype.toString')(true), Object.prototype.toString.call(true), 'call-bound Object.prototype.toString calls into the original'); + t.equal(callBound('%Object.prototype.toString%')(true), Object.prototype.toString.call(true), 'call-bound %Object.prototype.toString% calls into the original'); + + t['throws']( + function () { callBound('does not exist'); }, + SyntaxError, + 'nonexistent intrinsic throws' + ); + t['throws']( + function () { callBound('does not exist', true); }, + SyntaxError, + 'allowMissing arg still throws for unknown intrinsic' + ); + + t.test('real but absent intrinsic', { skip: typeof WeakRef !== 'undefined' }, function (st) { + st['throws']( + function () { callBound('WeakRef'); }, + TypeError, + 'real but absent intrinsic throws' + ); + st.equal(callBound('WeakRef', true), undefined, 'allowMissing arg avoids exception'); + st.end(); + }); + + t.end(); +}); diff --git a/publisher/node_modules/call-bind/test/index.js b/publisher/node_modules/call-bind/test/index.js new file mode 100644 index 00000000..1fd46689 --- /dev/null +++ b/publisher/node_modules/call-bind/test/index.js @@ -0,0 +1,80 @@ +'use strict'; + +var callBind = require('../'); +var bind = require('function-bind'); +var gOPD = require('gopd'); +var hasStrictMode = require('has-strict-mode')(); +var forEach = require('for-each'); +var inspect = require('object-inspect'); +var v = require('es-value-fixtures'); + +var test = require('tape'); + +/* + * older engines have length nonconfigurable + * in io.js v3, it is configurable except on bound functions, hence the .bind() + */ +var functionsHaveConfigurableLengths = !!( + gOPD + && Object.getOwnPropertyDescriptor + && Object.getOwnPropertyDescriptor(bind.call(function () {}), 'length').configurable +); + +test('callBind', function (t) { + forEach(v.nonFunctions, function (nonFunction) { + t['throws']( + function () { callBind(nonFunction); }, + TypeError, + inspect(nonFunction) + ' is not a function' + ); + }); + + var sentinel = { sentinel: true }; + var func = function (a, b) { + // eslint-disable-next-line no-invalid-this + return [!hasStrictMode && this === global ? undefined : this, a, b]; + }; + t.equal(func.length, 2, 'original function length is 2'); + t.deepEqual(func(), [undefined, undefined, undefined], 'unbound func with too few args'); + t.deepEqual(func(1, 2), [undefined, 1, 2], 'unbound func with right args'); + t.deepEqual(func(1, 2, 3), [undefined, 1, 2], 'unbound func with too many args'); + + var bound = callBind(func); + t.equal(bound.length, func.length + 1, 'function length is preserved', { skip: !functionsHaveConfigurableLengths }); + t.deepEqual(bound(), [undefined, undefined, undefined], 'bound func with too few args'); + t.deepEqual(bound(1, 2), [hasStrictMode ? 1 : Object(1), 2, undefined], 'bound func with right args'); + t.deepEqual(bound(1, 2, 3), [hasStrictMode ? 1 : Object(1), 2, 3], 'bound func with too many args'); + + var boundR = callBind(func, sentinel); + t.equal(boundR.length, func.length, 'function length is preserved', { skip: !functionsHaveConfigurableLengths }); + t.deepEqual(boundR(), [sentinel, undefined, undefined], 'bound func with receiver, with too few args'); + t.deepEqual(boundR(1, 2), [sentinel, 1, 2], 'bound func with receiver, with right args'); + t.deepEqual(boundR(1, 2, 3), [sentinel, 1, 2], 'bound func with receiver, with too many args'); + + var boundArg = callBind(func, sentinel, 1); + t.equal(boundArg.length, func.length - 1, 'function length is preserved', { skip: !functionsHaveConfigurableLengths }); + t.deepEqual(boundArg(), [sentinel, 1, undefined], 'bound func with receiver and arg, with too few args'); + t.deepEqual(boundArg(2), [sentinel, 1, 2], 'bound func with receiver and arg, with right arg'); + t.deepEqual(boundArg(2, 3), [sentinel, 1, 2], 'bound func with receiver and arg, with too many args'); + + t.test('callBind.apply', function (st) { + var aBound = callBind.apply(func); + st.deepEqual(aBound(sentinel), [sentinel, undefined, undefined], 'apply-bound func with no args'); + st.deepEqual(aBound(sentinel, [1], 4), [sentinel, 1, undefined], 'apply-bound func with too few args'); + st.deepEqual(aBound(sentinel, [1, 2], 4), [sentinel, 1, 2], 'apply-bound func with right args'); + + var aBoundArg = callBind.apply(func); + st.deepEqual(aBoundArg(sentinel, [1, 2, 3], 4), [sentinel, 1, 2], 'apply-bound func with too many args'); + st.deepEqual(aBoundArg(sentinel, [1, 2], 4), [sentinel, 1, 2], 'apply-bound func with right args'); + st.deepEqual(aBoundArg(sentinel, [1], 4), [sentinel, 1, undefined], 'apply-bound func with too few args'); + + var aBoundR = callBind.apply(func, sentinel); + st.deepEqual(aBoundR([1, 2, 3], 4), [sentinel, 1, 2], 'apply-bound func with receiver and too many args'); + st.deepEqual(aBoundR([1, 2], 4), [sentinel, 1, 2], 'apply-bound func with receiver and right args'); + st.deepEqual(aBoundR([1], 4), [sentinel, 1, undefined], 'apply-bound func with receiver and too few args'); + + st.end(); + }); + + t.end(); +}); diff --git a/publisher/node_modules/caseless/LICENSE b/publisher/node_modules/caseless/LICENSE new file mode 100644 index 00000000..61789f4a --- /dev/null +++ b/publisher/node_modules/caseless/LICENSE @@ -0,0 +1,28 @@ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +1. Definitions. +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +You must give any other recipients of the Work or Derivative Works a copy of this License; and +You must cause any modified files to carry prominent notices stating that You changed the files; and +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/publisher/node_modules/caseless/README.md b/publisher/node_modules/caseless/README.md new file mode 100644 index 00000000..e5077a21 --- /dev/null +++ b/publisher/node_modules/caseless/README.md @@ -0,0 +1,45 @@ +## Caseless -- wrap an object to set and get property with caseless semantics but also preserve caseing. + +This library is incredibly useful when working with HTTP headers. It allows you to get/set/check for headers in a caseless manner while also preserving the caseing of headers the first time they are set. + +## Usage + +```javascript +var headers = {} + , c = caseless(headers) + ; +c.set('a-Header', 'asdf') +c.get('a-header') === 'asdf' +``` + +## has(key) + +Has takes a name and if it finds a matching header will return that header name with the preserved caseing it was set with. + +```javascript +c.has('a-header') === 'a-Header' +``` + +## set(key, value[, clobber=true]) + +Set is fairly straight forward except that if the header exists and clobber is disabled it will add `','+value` to the existing header. + +```javascript +c.set('a-Header', 'fdas') +c.set('a-HEADER', 'more', false) +c.get('a-header') === 'fdsa,more' +``` + +## swap(key) + +Swaps the casing of a header with the new one that is passed in. + +```javascript +var headers = {} + , c = caseless(headers) + ; +c.set('a-Header', 'fdas') +c.swap('a-HEADER') +c.has('a-header') === 'a-HEADER' +headers === {'a-HEADER': 'fdas'} +``` diff --git a/publisher/node_modules/caseless/index.js b/publisher/node_modules/caseless/index.js new file mode 100644 index 00000000..b194734e --- /dev/null +++ b/publisher/node_modules/caseless/index.js @@ -0,0 +1,67 @@ +function Caseless (dict) { + this.dict = dict || {} +} +Caseless.prototype.set = function (name, value, clobber) { + if (typeof name === 'object') { + for (var i in name) { + this.set(i, name[i], value) + } + } else { + if (typeof clobber === 'undefined') clobber = true + var has = this.has(name) + + if (!clobber && has) this.dict[has] = this.dict[has] + ',' + value + else this.dict[has || name] = value + return has + } +} +Caseless.prototype.has = function (name) { + var keys = Object.keys(this.dict) + , name = name.toLowerCase() + ; + for (var i=0;i", + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/mikeal/caseless/issues" + }, + "devDependencies": { + "tape": "^2.10.2" + } +} diff --git a/publisher/node_modules/caseless/test.js b/publisher/node_modules/caseless/test.js new file mode 100644 index 00000000..f55196cc --- /dev/null +++ b/publisher/node_modules/caseless/test.js @@ -0,0 +1,67 @@ +var tape = require('tape') + , caseless = require('./') + ; + +tape('set get has', function (t) { + var headers = {} + , c = caseless(headers) + ; + t.plan(17) + c.set('a-Header', 'asdf') + t.equal(c.get('a-header'), 'asdf') + t.equal(c.has('a-header'), 'a-Header') + t.ok(!c.has('nothing')) + // old bug where we used the wrong regex + t.ok(!c.has('a-hea')) + c.set('a-header', 'fdsa') + t.equal(c.get('a-header'), 'fdsa') + t.equal(c.get('a-Header'), 'fdsa') + c.set('a-HEADER', 'more', false) + t.equal(c.get('a-header'), 'fdsa,more') + + t.deepEqual(headers, {'a-Header': 'fdsa,more'}) + c.swap('a-HEADER') + t.deepEqual(headers, {'a-HEADER': 'fdsa,more'}) + + c.set('deleteme', 'foobar') + t.ok(c.has('deleteme')) + t.ok(c.del('deleteme')) + t.notOk(c.has('deleteme')) + t.notOk(c.has('idonotexist')) + t.ok(c.del('idonotexist')) + + c.set('tva', 'test1') + c.set('tva-header', 'test2') + t.equal(c.has('tva'), 'tva') + t.notOk(c.has('header')) + + t.equal(c.get('tva'), 'test1') + +}) + +tape('swap', function (t) { + var headers = {} + , c = caseless(headers) + ; + t.plan(4) + // No Header to Swap. + t.throws(function () { + c.swap('content-type') + }) + // Set Header. + c.set('content-type', 'application/json') + // Swap Header With Itself. + c.swap('content-type') + // Does Not Delete Itself. + t.ok(c.has('content-type')) + // Swap Header With a Different Header. + c.swap('Content-Type') + // Still Has Header. + t.ok(c.has('Content-Type')) + // Delete Header. + c.del('Content-Type') + // No Header to Swap. + t.throws(function () { + c.swap('content-type') + }) +}) diff --git a/publisher/node_modules/chownr/LICENSE b/publisher/node_modules/chownr/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/publisher/node_modules/chownr/LICENSE @@ -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. diff --git a/publisher/node_modules/chownr/README.md b/publisher/node_modules/chownr/README.md new file mode 100644 index 00000000..70e9a54a --- /dev/null +++ b/publisher/node_modules/chownr/README.md @@ -0,0 +1,3 @@ +Like `chown -R`. + +Takes the same arguments as `fs.chown()` diff --git a/publisher/node_modules/chownr/chownr.js b/publisher/node_modules/chownr/chownr.js new file mode 100644 index 00000000..0d409321 --- /dev/null +++ b/publisher/node_modules/chownr/chownr.js @@ -0,0 +1,167 @@ +'use strict' +const fs = require('fs') +const path = require('path') + +/* istanbul ignore next */ +const LCHOWN = fs.lchown ? 'lchown' : 'chown' +/* istanbul ignore next */ +const LCHOWNSYNC = fs.lchownSync ? 'lchownSync' : 'chownSync' + +/* istanbul ignore next */ +const needEISDIRHandled = fs.lchown && + !process.version.match(/v1[1-9]+\./) && + !process.version.match(/v10\.[6-9]/) + +const lchownSync = (path, uid, gid) => { + try { + return fs[LCHOWNSYNC](path, uid, gid) + } catch (er) { + if (er.code !== 'ENOENT') + throw er + } +} + +/* istanbul ignore next */ +const chownSync = (path, uid, gid) => { + try { + return fs.chownSync(path, uid, gid) + } catch (er) { + if (er.code !== 'ENOENT') + throw er + } +} + +/* istanbul ignore next */ +const handleEISDIR = + needEISDIRHandled ? (path, uid, gid, cb) => er => { + // Node prior to v10 had a very questionable implementation of + // fs.lchown, which would always try to call fs.open on a directory + // Fall back to fs.chown in those cases. + if (!er || er.code !== 'EISDIR') + cb(er) + else + fs.chown(path, uid, gid, cb) + } + : (_, __, ___, cb) => cb + +/* istanbul ignore next */ +const handleEISDirSync = + needEISDIRHandled ? (path, uid, gid) => { + try { + return lchownSync(path, uid, gid) + } catch (er) { + if (er.code !== 'EISDIR') + throw er + chownSync(path, uid, gid) + } + } + : (path, uid, gid) => lchownSync(path, uid, gid) + +// fs.readdir could only accept an options object as of node v6 +const nodeVersion = process.version +let readdir = (path, options, cb) => fs.readdir(path, options, cb) +let readdirSync = (path, options) => fs.readdirSync(path, options) +/* istanbul ignore next */ +if (/^v4\./.test(nodeVersion)) + readdir = (path, options, cb) => fs.readdir(path, cb) + +const chown = (cpath, uid, gid, cb) => { + fs[LCHOWN](cpath, uid, gid, handleEISDIR(cpath, uid, gid, er => { + // Skip ENOENT error + cb(er && er.code !== 'ENOENT' ? er : null) + })) +} + +const chownrKid = (p, child, uid, gid, cb) => { + if (typeof child === 'string') + return fs.lstat(path.resolve(p, child), (er, stats) => { + // Skip ENOENT error + if (er) + return cb(er.code !== 'ENOENT' ? er : null) + stats.name = child + chownrKid(p, stats, uid, gid, cb) + }) + + if (child.isDirectory()) { + chownr(path.resolve(p, child.name), uid, gid, er => { + if (er) + return cb(er) + const cpath = path.resolve(p, child.name) + chown(cpath, uid, gid, cb) + }) + } else { + const cpath = path.resolve(p, child.name) + chown(cpath, uid, gid, cb) + } +} + + +const chownr = (p, uid, gid, cb) => { + readdir(p, { withFileTypes: true }, (er, children) => { + // any error other than ENOTDIR or ENOTSUP means it's not readable, + // or doesn't exist. give up. + if (er) { + if (er.code === 'ENOENT') + return cb() + else if (er.code !== 'ENOTDIR' && er.code !== 'ENOTSUP') + return cb(er) + } + if (er || !children.length) + return chown(p, uid, gid, cb) + + let len = children.length + let errState = null + const then = er => { + if (errState) + return + if (er) + return cb(errState = er) + if (-- len === 0) + return chown(p, uid, gid, cb) + } + + children.forEach(child => chownrKid(p, child, uid, gid, then)) + }) +} + +const chownrKidSync = (p, child, uid, gid) => { + if (typeof child === 'string') { + try { + const stats = fs.lstatSync(path.resolve(p, child)) + stats.name = child + child = stats + } catch (er) { + if (er.code === 'ENOENT') + return + else + throw er + } + } + + if (child.isDirectory()) + chownrSync(path.resolve(p, child.name), uid, gid) + + handleEISDirSync(path.resolve(p, child.name), uid, gid) +} + +const chownrSync = (p, uid, gid) => { + let children + try { + children = readdirSync(p, { withFileTypes: true }) + } catch (er) { + if (er.code === 'ENOENT') + return + else if (er.code === 'ENOTDIR' || er.code === 'ENOTSUP') + return handleEISDirSync(p, uid, gid) + else + throw er + } + + if (children && children.length) + children.forEach(child => chownrKidSync(p, child, uid, gid)) + + return handleEISDirSync(p, uid, gid) +} + +module.exports = chownr +chownr.sync = chownrSync diff --git a/publisher/node_modules/chownr/package.json b/publisher/node_modules/chownr/package.json new file mode 100644 index 00000000..5b0214ca --- /dev/null +++ b/publisher/node_modules/chownr/package.json @@ -0,0 +1,32 @@ +{ + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "name": "chownr", + "description": "like `chown -R`", + "version": "2.0.0", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/chownr.git" + }, + "main": "chownr.js", + "files": [ + "chownr.js" + ], + "devDependencies": { + "mkdirp": "0.3", + "rimraf": "^2.7.1", + "tap": "^14.10.6" + }, + "tap": { + "check-coverage": true + }, + "scripts": { + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags" + }, + "license": "ISC", + "engines": { + "node": ">=10" + } +} diff --git a/publisher/node_modules/color-support/LICENSE b/publisher/node_modules/color-support/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/publisher/node_modules/color-support/LICENSE @@ -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. diff --git a/publisher/node_modules/color-support/README.md b/publisher/node_modules/color-support/README.md new file mode 100644 index 00000000..f89aa17d --- /dev/null +++ b/publisher/node_modules/color-support/README.md @@ -0,0 +1,129 @@ +# color-support + +A module which will endeavor to guess your terminal's level of color +support. + +[![Build Status](https://travis-ci.org/isaacs/color-support.svg?branch=master)](https://travis-ci.org/isaacs/color-support) [![Coverage Status](https://coveralls.io/repos/github/isaacs/color-support/badge.svg?branch=master)](https://coveralls.io/github/isaacs/color-support?branch=master) + +This is similar to `supports-color`, but it does not read +`process.argv`. + +1. If not in a node environment, not supported. + +2. If stdout is not a TTY, not supported, unless the `ignoreTTY` + option is set. + +3. If the `TERM` environ is `dumb`, not supported, unless the + `ignoreDumb` option is set. + +4. If on Windows, then support 16 colors. + +5. If using Tmux, then support 256 colors. + +7. Handle continuous-integration servers. If `CI` or + `TEAMCITY_VERSION` are set in the environment, and `TRAVIS` is not + set, then color is not supported, unless `ignoreCI` option is set. + +6. Guess based on the `TERM_PROGRAM` environ. These terminals support + 16m colors: + + - `iTerm.app` version 3.x supports 16m colors, below support 256 + - `MacTerm` supports 16m colors + - `Apple_Terminal` supports 256 colors + - Have more things that belong on this list? Send a PR! + +8. Make a guess based on the `TERM` environment variable. Any + `xterm-256color` will get 256 colors. Any screen, xterm, vt100, + color, ansi, cygwin, or linux `TERM` will get 16 colors. + +9. If `COLORTERM` environment variable is set, then support 16 colors. + +10. At this point, we assume that color is not supported. + +## USAGE + +```javascript +var testColorSupport = require('color-support') +var colorSupport = testColorSupport(/* options object */) + +if (!colorSupport) { + console.log('color is not supported') +} else if (colorSupport.has16m) { + console.log('\x1b[38;2;102;194;255m16m colors\x1b[0m') +} else if (colorSupport.has256) { + console.log('\x1b[38;5;119m256 colors\x1b[0m') +} else if (colorSupport.hasBasic) { + console.log('\x1b[31mbasic colors\x1b[0m') +} else { + console.log('this is impossible, but colors are not supported') +} +``` + +If you don't have any options to set, you can also just look at the +flags which will all be set on the test function itself. (Of course, +this doesn't return a falsey value when colors aren't supported, and +doesn't allow you to set options.) + +```javascript +var colorSupport = require('color-support') + +if (colorSupport.has16m) { + console.log('\x1b[38;2;102;194;255m16m colors\x1b[0m') +} else if (colorSupport.has256) { + console.log('\x1b[38;5;119m256 colors\x1b[0m') +} else if (colorSupport.hasBasic) { + console.log('\x1b[31mbasic colors\x1b[0m') +} else { + console.log('colors are not supported') +} +``` + +## Options + +You can pass in the following options. + +* ignoreTTY - default false. Ignore the `isTTY` check. +* ignoreDumb - default false. Ignore `TERM=dumb` environ check. +* ignoreCI - default false. Ignore `CI` environ check. +* env - Object for environment vars. Defaults to `process.env`. +* stream - Stream for `isTTY` check. Defaults to `process.stdout`. +* term - String for `TERM` checking. Defaults to `env.TERM`. +* alwaysReturn - default false. Return an object when colors aren't + supported (instead of returning `false`). +* level - A number from 0 to 3. This will return a result for the + specified level. This is useful if you want to be able to set the + color support level explicitly as a number in an environment + variable or config, but then use the object flags in your program. + Except for `alwaysReturn` to return an object for level 0, all other + options are ignored, since no checking is done if a level is + explicitly set. + +## Return Value + +If no color support is available, then `false` is returned by default, +unless the `alwaysReturn` flag is set to `true`. This is so that the +simple question of "can I use colors or not" can treat any truthy +return as "yes". + +Otherwise, the return object has the following fields: + +* `level` - A number from 0 to 3 + * `0` - No color support + * `1` - Basic (16) color support + * `2` - 256 color support + * `3` - 16 million (true) color support +* `hasBasic` - Boolean +* `has256` - Boolean +* `has16m` - Boolean + +## CLI + +You can run the `color-support` bin from the command line which will +just dump the values as this module calculates them in whatever env +it's run. It takes no command line arguments. + +## Credits + +This is a spiritual, if not actual, fork of +[supports-color](http://npm.im/supports-color) by the ever prolific +[Sindre Sorhus](http://npm.im/~sindresorhus). diff --git a/publisher/node_modules/color-support/bin.js b/publisher/node_modules/color-support/bin.js new file mode 100755 index 00000000..3c0a9672 --- /dev/null +++ b/publisher/node_modules/color-support/bin.js @@ -0,0 +1,3 @@ +#!/usr/bin/env node +var colorSupport = require('./')({alwaysReturn: true }) +console.log(JSON.stringify(colorSupport, null, 2)) diff --git a/publisher/node_modules/color-support/browser.js b/publisher/node_modules/color-support/browser.js new file mode 100644 index 00000000..ab5c6631 --- /dev/null +++ b/publisher/node_modules/color-support/browser.js @@ -0,0 +1,14 @@ +module.exports = colorSupport({ alwaysReturn: true }, colorSupport) + +function colorSupport(options, obj) { + obj = obj || {} + options = options || {} + obj.level = 0 + obj.hasBasic = false + obj.has256 = false + obj.has16m = false + if (!options.alwaysReturn) { + return false + } + return obj +} diff --git a/publisher/node_modules/color-support/index.js b/publisher/node_modules/color-support/index.js new file mode 100644 index 00000000..6b6f3b28 --- /dev/null +++ b/publisher/node_modules/color-support/index.js @@ -0,0 +1,134 @@ +// call it on itself so we can test the export val for basic stuff +module.exports = colorSupport({ alwaysReturn: true }, colorSupport) + +function hasNone (obj, options) { + obj.level = 0 + obj.hasBasic = false + obj.has256 = false + obj.has16m = false + if (!options.alwaysReturn) { + return false + } + return obj +} + +function hasBasic (obj) { + obj.hasBasic = true + obj.has256 = false + obj.has16m = false + obj.level = 1 + return obj +} + +function has256 (obj) { + obj.hasBasic = true + obj.has256 = true + obj.has16m = false + obj.level = 2 + return obj +} + +function has16m (obj) { + obj.hasBasic = true + obj.has256 = true + obj.has16m = true + obj.level = 3 + return obj +} + +function colorSupport (options, obj) { + options = options || {} + + obj = obj || {} + + // if just requesting a specific level, then return that. + if (typeof options.level === 'number') { + switch (options.level) { + case 0: + return hasNone(obj, options) + case 1: + return hasBasic(obj) + case 2: + return has256(obj) + case 3: + return has16m(obj) + } + } + + obj.level = 0 + obj.hasBasic = false + obj.has256 = false + obj.has16m = false + + if (typeof process === 'undefined' || + !process || + !process.stdout || + !process.env || + !process.platform) { + return hasNone(obj, options) + } + + var env = options.env || process.env + var stream = options.stream || process.stdout + var term = options.term || env.TERM || '' + var platform = options.platform || process.platform + + if (!options.ignoreTTY && !stream.isTTY) { + return hasNone(obj, options) + } + + if (!options.ignoreDumb && term === 'dumb' && !env.COLORTERM) { + return hasNone(obj, options) + } + + if (platform === 'win32') { + return hasBasic(obj) + } + + if (env.TMUX) { + return has256(obj) + } + + if (!options.ignoreCI && (env.CI || env.TEAMCITY_VERSION)) { + if (env.TRAVIS) { + return has256(obj) + } else { + return hasNone(obj, options) + } + } + + // TODO: add more term programs + switch (env.TERM_PROGRAM) { + case 'iTerm.app': + var ver = env.TERM_PROGRAM_VERSION || '0.' + if (/^[0-2]\./.test(ver)) { + return has256(obj) + } else { + return has16m(obj) + } + + case 'HyperTerm': + case 'Hyper': + return has16m(obj) + + case 'MacTerm': + return has16m(obj) + + case 'Apple_Terminal': + return has256(obj) + } + + if (/^xterm-256/.test(term)) { + return has256(obj) + } + + if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(term)) { + return hasBasic(obj) + } + + if (env.COLORTERM) { + return hasBasic(obj) + } + + return hasNone(obj, options) +} diff --git a/publisher/node_modules/color-support/package.json b/publisher/node_modules/color-support/package.json new file mode 100644 index 00000000..f3e3b771 --- /dev/null +++ b/publisher/node_modules/color-support/package.json @@ -0,0 +1,36 @@ +{ + "name": "color-support", + "version": "1.1.3", + "description": "A module which will endeavor to guess your terminal's level of color support.", + "main": "index.js", + "browser": "browser.js", + "bin": "bin.js", + "devDependencies": { + "tap": "^10.3.3" + }, + "scripts": { + "test": "tap test/*.js --100 -J", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --all; git push origin --tags" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/color-support.git" + }, + "keywords": [ + "terminal", + "color", + "support", + "xterm", + "truecolor", + "256" + ], + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "files": [ + "browser.js", + "index.js", + "bin.js" + ] +} diff --git a/publisher/node_modules/combined-stream/License b/publisher/node_modules/combined-stream/License new file mode 100644 index 00000000..4804b7ab --- /dev/null +++ b/publisher/node_modules/combined-stream/License @@ -0,0 +1,19 @@ +Copyright (c) 2011 Debuggable Limited + +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. diff --git a/publisher/node_modules/combined-stream/Readme.md b/publisher/node_modules/combined-stream/Readme.md new file mode 100644 index 00000000..9e367b5b --- /dev/null +++ b/publisher/node_modules/combined-stream/Readme.md @@ -0,0 +1,138 @@ +# combined-stream + +A stream that emits multiple other streams one after another. + +**NB** Currently `combined-stream` works with streams version 1 only. There is ongoing effort to switch this library to streams version 2. Any help is welcome. :) Meanwhile you can explore other libraries that provide streams2 support with more or less compatibility with `combined-stream`. + +- [combined-stream2](https://www.npmjs.com/package/combined-stream2): A drop-in streams2-compatible replacement for the combined-stream module. + +- [multistream](https://www.npmjs.com/package/multistream): A stream that emits multiple other streams one after another. + +## Installation + +``` bash +npm install combined-stream +``` + +## Usage + +Here is a simple example that shows how you can use combined-stream to combine +two files into one: + +``` javascript +var CombinedStream = require('combined-stream'); +var fs = require('fs'); + +var combinedStream = CombinedStream.create(); +combinedStream.append(fs.createReadStream('file1.txt')); +combinedStream.append(fs.createReadStream('file2.txt')); + +combinedStream.pipe(fs.createWriteStream('combined.txt')); +``` + +While the example above works great, it will pause all source streams until +they are needed. If you don't want that to happen, you can set `pauseStreams` +to `false`: + +``` javascript +var CombinedStream = require('combined-stream'); +var fs = require('fs'); + +var combinedStream = CombinedStream.create({pauseStreams: false}); +combinedStream.append(fs.createReadStream('file1.txt')); +combinedStream.append(fs.createReadStream('file2.txt')); + +combinedStream.pipe(fs.createWriteStream('combined.txt')); +``` + +However, what if you don't have all the source streams yet, or you don't want +to allocate the resources (file descriptors, memory, etc.) for them right away? +Well, in that case you can simply provide a callback that supplies the stream +by calling a `next()` function: + +``` javascript +var CombinedStream = require('combined-stream'); +var fs = require('fs'); + +var combinedStream = CombinedStream.create(); +combinedStream.append(function(next) { + next(fs.createReadStream('file1.txt')); +}); +combinedStream.append(function(next) { + next(fs.createReadStream('file2.txt')); +}); + +combinedStream.pipe(fs.createWriteStream('combined.txt')); +``` + +## API + +### CombinedStream.create([options]) + +Returns a new combined stream object. Available options are: + +* `maxDataSize` +* `pauseStreams` + +The effect of those options is described below. + +### combinedStream.pauseStreams = `true` + +Whether to apply back pressure to the underlaying streams. If set to `false`, +the underlaying streams will never be paused. If set to `true`, the +underlaying streams will be paused right after being appended, as well as when +`delayedStream.pipe()` wants to throttle. + +### combinedStream.maxDataSize = `2 * 1024 * 1024` + +The maximum amount of bytes (or characters) to buffer for all source streams. +If this value is exceeded, `combinedStream` emits an `'error'` event. + +### combinedStream.dataSize = `0` + +The amount of bytes (or characters) currently buffered by `combinedStream`. + +### combinedStream.append(stream) + +Appends the given `stream` to the combinedStream object. If `pauseStreams` is +set to `true, this stream will also be paused right away. + +`streams` can also be a function that takes one parameter called `next`. `next` +is a function that must be invoked in order to provide the `next` stream, see +example above. + +Regardless of how the `stream` is appended, combined-stream always attaches an +`'error'` listener to it, so you don't have to do that manually. + +Special case: `stream` can also be a String or Buffer. + +### combinedStream.write(data) + +You should not call this, `combinedStream` takes care of piping the appended +streams into itself for you. + +### combinedStream.resume() + +Causes `combinedStream` to start drain the streams it manages. The function is +idempotent, and also emits a `'resume'` event each time which usually goes to +the stream that is currently being drained. + +### combinedStream.pause(); + +If `combinedStream.pauseStreams` is set to `false`, this does nothing. +Otherwise a `'pause'` event is emitted, this goes to the stream that is +currently being drained, so you can use it to apply back pressure. + +### combinedStream.end(); + +Sets `combinedStream.writable` to false, emits an `'end'` event, and removes +all streams from the queue. + +### combinedStream.destroy(); + +Same as `combinedStream.end()`, except it emits a `'close'` event instead of +`'end'`. + +## License + +combined-stream is licensed under the MIT license. diff --git a/publisher/node_modules/combined-stream/lib/combined_stream.js b/publisher/node_modules/combined-stream/lib/combined_stream.js new file mode 100644 index 00000000..125f097f --- /dev/null +++ b/publisher/node_modules/combined-stream/lib/combined_stream.js @@ -0,0 +1,208 @@ +var util = require('util'); +var Stream = require('stream').Stream; +var DelayedStream = require('delayed-stream'); + +module.exports = CombinedStream; +function CombinedStream() { + this.writable = false; + this.readable = true; + this.dataSize = 0; + this.maxDataSize = 2 * 1024 * 1024; + this.pauseStreams = true; + + this._released = false; + this._streams = []; + this._currentStream = null; + this._insideLoop = false; + this._pendingNext = false; +} +util.inherits(CombinedStream, Stream); + +CombinedStream.create = function(options) { + var combinedStream = new this(); + + options = options || {}; + for (var option in options) { + combinedStream[option] = options[option]; + } + + return combinedStream; +}; + +CombinedStream.isStreamLike = function(stream) { + return (typeof stream !== 'function') + && (typeof stream !== 'string') + && (typeof stream !== 'boolean') + && (typeof stream !== 'number') + && (!Buffer.isBuffer(stream)); +}; + +CombinedStream.prototype.append = function(stream) { + var isStreamLike = CombinedStream.isStreamLike(stream); + + if (isStreamLike) { + if (!(stream instanceof DelayedStream)) { + var newStream = DelayedStream.create(stream, { + maxDataSize: Infinity, + pauseStream: this.pauseStreams, + }); + stream.on('data', this._checkDataSize.bind(this)); + stream = newStream; + } + + this._handleErrors(stream); + + if (this.pauseStreams) { + stream.pause(); + } + } + + this._streams.push(stream); + return this; +}; + +CombinedStream.prototype.pipe = function(dest, options) { + Stream.prototype.pipe.call(this, dest, options); + this.resume(); + return dest; +}; + +CombinedStream.prototype._getNext = function() { + this._currentStream = null; + + if (this._insideLoop) { + this._pendingNext = true; + return; // defer call + } + + this._insideLoop = true; + try { + do { + this._pendingNext = false; + this._realGetNext(); + } while (this._pendingNext); + } finally { + this._insideLoop = false; + } +}; + +CombinedStream.prototype._realGetNext = function() { + var stream = this._streams.shift(); + + + if (typeof stream == 'undefined') { + this.end(); + return; + } + + if (typeof stream !== 'function') { + this._pipeNext(stream); + return; + } + + var getStream = stream; + getStream(function(stream) { + var isStreamLike = CombinedStream.isStreamLike(stream); + if (isStreamLike) { + stream.on('data', this._checkDataSize.bind(this)); + this._handleErrors(stream); + } + + this._pipeNext(stream); + }.bind(this)); +}; + +CombinedStream.prototype._pipeNext = function(stream) { + this._currentStream = stream; + + var isStreamLike = CombinedStream.isStreamLike(stream); + if (isStreamLike) { + stream.on('end', this._getNext.bind(this)); + stream.pipe(this, {end: false}); + return; + } + + var value = stream; + this.write(value); + this._getNext(); +}; + +CombinedStream.prototype._handleErrors = function(stream) { + var self = this; + stream.on('error', function(err) { + self._emitError(err); + }); +}; + +CombinedStream.prototype.write = function(data) { + this.emit('data', data); +}; + +CombinedStream.prototype.pause = function() { + if (!this.pauseStreams) { + return; + } + + if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause(); + this.emit('pause'); +}; + +CombinedStream.prototype.resume = function() { + if (!this._released) { + this._released = true; + this.writable = true; + this._getNext(); + } + + if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume(); + this.emit('resume'); +}; + +CombinedStream.prototype.end = function() { + this._reset(); + this.emit('end'); +}; + +CombinedStream.prototype.destroy = function() { + this._reset(); + this.emit('close'); +}; + +CombinedStream.prototype._reset = function() { + this.writable = false; + this._streams = []; + this._currentStream = null; +}; + +CombinedStream.prototype._checkDataSize = function() { + this._updateDataSize(); + if (this.dataSize <= this.maxDataSize) { + return; + } + + var message = + 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'; + this._emitError(new Error(message)); +}; + +CombinedStream.prototype._updateDataSize = function() { + this.dataSize = 0; + + var self = this; + this._streams.forEach(function(stream) { + if (!stream.dataSize) { + return; + } + + self.dataSize += stream.dataSize; + }); + + if (this._currentStream && this._currentStream.dataSize) { + this.dataSize += this._currentStream.dataSize; + } +}; + +CombinedStream.prototype._emitError = function(err) { + this._reset(); + this.emit('error', err); +}; diff --git a/publisher/node_modules/combined-stream/package.json b/publisher/node_modules/combined-stream/package.json new file mode 100644 index 00000000..6982b6da --- /dev/null +++ b/publisher/node_modules/combined-stream/package.json @@ -0,0 +1,25 @@ +{ + "author": "Felix Geisendörfer (http://debuggable.com/)", + "name": "combined-stream", + "description": "A stream that emits multiple other streams one after another.", + "version": "1.0.8", + "homepage": "https://github.com/felixge/node-combined-stream", + "repository": { + "type": "git", + "url": "git://github.com/felixge/node-combined-stream.git" + }, + "main": "./lib/combined_stream", + "scripts": { + "test": "node test/run.js" + }, + "engines": { + "node": ">= 0.8" + }, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "devDependencies": { + "far": "~0.0.7" + }, + "license": "MIT" +} diff --git a/publisher/node_modules/combined-stream/yarn.lock b/publisher/node_modules/combined-stream/yarn.lock new file mode 100644 index 00000000..7edf4184 --- /dev/null +++ b/publisher/node_modules/combined-stream/yarn.lock @@ -0,0 +1,17 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + +far@~0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/far/-/far-0.0.7.tgz#01c1fd362bcd26ce9cf161af3938aa34619f79a7" + dependencies: + oop "0.0.3" + +oop@0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/oop/-/oop-0.0.3.tgz#70fa405a5650891a194fdc82ca68dad6dabf4401" diff --git a/publisher/node_modules/console-control-strings/LICENSE b/publisher/node_modules/console-control-strings/LICENSE new file mode 100644 index 00000000..e7560529 --- /dev/null +++ b/publisher/node_modules/console-control-strings/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2014, Rebecca Turner + +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. diff --git a/publisher/node_modules/console-control-strings/README.md b/publisher/node_modules/console-control-strings/README.md new file mode 100644 index 00000000..f58cc8d8 --- /dev/null +++ b/publisher/node_modules/console-control-strings/README.md @@ -0,0 +1,145 @@ +# Console Control Strings + +A library of cross-platform tested terminal/console command strings for +doing things like color and cursor positioning. This is a subset of both +ansi and vt100. All control codes included work on both Windows & Unix-like +OSes, except where noted. + +## Usage + +```js +var consoleControl = require('console-control-strings') + +console.log(consoleControl.color('blue','bgRed', 'bold') + 'hi there' + consoleControl.color('reset')) +process.stdout.write(consoleControl.goto(75, 10)) +``` + +## Why Another? + +There are tons of libraries similar to this one. I wanted one that was: + +1. Very clear about compatibility goals. +2. Could emit, for instance, a start color code without an end one. +3. Returned strings w/o writing to streams. +4. Was not weighed down with other unrelated baggage. + +## Functions + +### var code = consoleControl.up(_num = 1_) + +Returns the escape sequence to move _num_ lines up. + +### var code = consoleControl.down(_num = 1_) + +Returns the escape sequence to move _num_ lines down. + +### var code = consoleControl.forward(_num = 1_) + +Returns the escape sequence to move _num_ lines righ. + +### var code = consoleControl.back(_num = 1_) + +Returns the escape sequence to move _num_ lines left. + +### var code = consoleControl.nextLine(_num = 1_) + +Returns the escape sequence to move _num_ lines down and to the beginning of +the line. + +### var code = consoleControl.previousLine(_num = 1_) + +Returns the escape sequence to move _num_ lines up and to the beginning of +the line. + +### var code = consoleControl.eraseData() + +Returns the escape sequence to erase everything from the current cursor +position to the bottom right of the screen. This is line based, so it +erases the remainder of the current line and all following lines. + +### var code = consoleControl.eraseLine() + +Returns the escape sequence to erase to the end of the current line. + +### var code = consoleControl.goto(_x_, _y_) + +Returns the escape sequence to move the cursor to the designated position. +Note that the origin is _1, 1_ not _0, 0_. + +### var code = consoleControl.gotoSOL() + +Returns the escape sequence to move the cursor to the beginning of the +current line. (That is, it returns a carriage return, `\r`.) + +### var code = consoleControl.beep() + +Returns the escape sequence to cause the termianl to beep. (That is, it +returns unicode character `\x0007`, a Control-G.) + +### var code = consoleControl.hideCursor() + +Returns the escape sequence to hide the cursor. + +### var code = consoleControl.showCursor() + +Returns the escape sequence to show the cursor. + +### var code = consoleControl.color(_colors = []_) + +### var code = consoleControl.color(_color1_, _color2_, _…_, _colorn_) + +Returns the escape sequence to set the current terminal display attributes +(mostly colors). Arguments can either be a list of attributes or an array +of attributes. The difference between passing in an array or list of colors +and calling `.color` separately for each one, is that in the former case a +single escape sequence will be produced where as in the latter each change +will have its own distinct escape sequence. Each attribute can be one of: + +* Reset: + * **reset** – Reset all attributes to the terminal default. +* Styles: + * **bold** – Display text as bold. In some terminals this means using a + bold font, in others this means changing the color. In some it means + both. + * **italic** – Display text as italic. This is not available in most Windows terminals. + * **underline** – Underline text. This is not available in most Windows Terminals. + * **inverse** – Invert the foreground and background colors. + * **stopBold** – Do not display text as bold. + * **stopItalic** – Do not display text as italic. + * **stopUnderline** – Do not underline text. + * **stopInverse** – Do not invert foreground and background. +* Colors: + * **white** + * **black** + * **blue** + * **cyan** + * **green** + * **magenta** + * **red** + * **yellow** + * **grey** / **brightBlack** + * **brightRed** + * **brightGreen** + * **brightYellow** + * **brightBlue** + * **brightMagenta** + * **brightCyan** + * **brightWhite** +* Background Colors: + * **bgWhite** + * **bgBlack** + * **bgBlue** + * **bgCyan** + * **bgGreen** + * **bgMagenta** + * **bgRed** + * **bgYellow** + * **bgGrey** / **bgBrightBlack** + * **bgBrightRed** + * **bgBrightGreen** + * **bgBrightYellow** + * **bgBrightBlue** + * **bgBrightMagenta** + * **bgBrightCyan** + * **bgBrightWhite** + diff --git a/publisher/node_modules/console-control-strings/README.md~ b/publisher/node_modules/console-control-strings/README.md~ new file mode 100644 index 00000000..6eb34e89 --- /dev/null +++ b/publisher/node_modules/console-control-strings/README.md~ @@ -0,0 +1,140 @@ +# Console Control Strings + +A library of cross-platform tested terminal/console command strings for +doing things like color and cursor positioning. This is a subset of both +ansi and vt100. All control codes included work on both Windows & Unix-like +OSes, except where noted. + +## Usage + +```js +var consoleControl = require('console-control-strings') + +console.log(consoleControl.color('blue','bgRed', 'bold') + 'hi there' + consoleControl.color('reset')) +process.stdout.write(consoleControl.goto(75, 10)) +``` + +## Why Another? + +There are tons of libraries similar to this one. I wanted one that was: + +1. Very clear about compatibility goals. +2. Could emit, for instance, a start color code without an end one. +3. Returned strings w/o writing to streams. +4. Was not weighed down with other unrelated baggage. + +## Functions + +### var code = consoleControl.up(_num = 1_) + +Returns the escape sequence to move _num_ lines up. + +### var code = consoleControl.down(_num = 1_) + +Returns the escape sequence to move _num_ lines down. + +### var code = consoleControl.forward(_num = 1_) + +Returns the escape sequence to move _num_ lines righ. + +### var code = consoleControl.back(_num = 1_) + +Returns the escape sequence to move _num_ lines left. + +### var code = consoleControl.nextLine(_num = 1_) + +Returns the escape sequence to move _num_ lines down and to the beginning of +the line. + +### var code = consoleControl.previousLine(_num = 1_) + +Returns the escape sequence to move _num_ lines up and to the beginning of +the line. + +### var code = consoleControl.eraseData() + +Returns the escape sequence to erase everything from the current cursor +position to the bottom right of the screen. This is line based, so it +erases the remainder of the current line and all following lines. + +### var code = consoleControl.eraseLine() + +Returns the escape sequence to erase to the end of the current line. + +### var code = consoleControl.goto(_x_, _y_) + +Returns the escape sequence to move the cursor to the designated position. +Note that the origin is _1, 1_ not _0, 0_. + +### var code = consoleControl.gotoSOL() + +Returns the escape sequence to move the cursor to the beginning of the +current line. (That is, it returns a carriage return, `\r`.) + +### var code = consoleControl.hideCursor() + +Returns the escape sequence to hide the cursor. + +### var code = consoleControl.showCursor() + +Returns the escape sequence to show the cursor. + +### var code = consoleControl.color(_colors = []_) + +### var code = consoleControl.color(_color1_, _color2_, _…_, _colorn_) + +Returns the escape sequence to set the current terminal display attributes +(mostly colors). Arguments can either be a list of attributes or an array +of attributes. The difference between passing in an array or list of colors +and calling `.color` separately for each one, is that in the former case a +single escape sequence will be produced where as in the latter each change +will have its own distinct escape sequence. Each attribute can be one of: + +* Reset: + * **reset** – Reset all attributes to the terminal default. +* Styles: + * **bold** – Display text as bold. In some terminals this means using a + bold font, in others this means changing the color. In some it means + both. + * **italic** – Display text as italic. This is not available in most Windows terminals. + * **underline** – Underline text. This is not available in most Windows Terminals. + * **inverse** – Invert the foreground and background colors. + * **stopBold** – Do not display text as bold. + * **stopItalic** – Do not display text as italic. + * **stopUnderline** – Do not underline text. + * **stopInverse** – Do not invert foreground and background. +* Colors: + * **white** + * **black** + * **blue** + * **cyan** + * **green** + * **magenta** + * **red** + * **yellow** + * **grey** / **brightBlack** + * **brightRed** + * **brightGreen** + * **brightYellow** + * **brightBlue** + * **brightMagenta** + * **brightCyan** + * **brightWhite** +* Background Colors: + * **bgWhite** + * **bgBlack** + * **bgBlue** + * **bgCyan** + * **bgGreen** + * **bgMagenta** + * **bgRed** + * **bgYellow** + * **bgGrey** / **bgBrightBlack** + * **bgBrightRed** + * **bgBrightGreen** + * **bgBrightYellow** + * **bgBrightBlue** + * **bgBrightMagenta** + * **bgBrightCyan** + * **bgBrightWhite** + diff --git a/publisher/node_modules/console-control-strings/index.js b/publisher/node_modules/console-control-strings/index.js new file mode 100644 index 00000000..bf890348 --- /dev/null +++ b/publisher/node_modules/console-control-strings/index.js @@ -0,0 +1,125 @@ +'use strict' + +// These tables borrowed from `ansi` + +var prefix = '\x1b[' + +exports.up = function up (num) { + return prefix + (num || '') + 'A' +} + +exports.down = function down (num) { + return prefix + (num || '') + 'B' +} + +exports.forward = function forward (num) { + return prefix + (num || '') + 'C' +} + +exports.back = function back (num) { + return prefix + (num || '') + 'D' +} + +exports.nextLine = function nextLine (num) { + return prefix + (num || '') + 'E' +} + +exports.previousLine = function previousLine (num) { + return prefix + (num || '') + 'F' +} + +exports.horizontalAbsolute = function horizontalAbsolute (num) { + if (num == null) throw new Error('horizontalAboslute requires a column to position to') + return prefix + num + 'G' +} + +exports.eraseData = function eraseData () { + return prefix + 'J' +} + +exports.eraseLine = function eraseLine () { + return prefix + 'K' +} + +exports.goto = function (x, y) { + return prefix + y + ';' + x + 'H' +} + +exports.gotoSOL = function () { + return '\r' +} + +exports.beep = function () { + return '\x07' +} + +exports.hideCursor = function hideCursor () { + return prefix + '?25l' +} + +exports.showCursor = function showCursor () { + return prefix + '?25h' +} + +var colors = { + reset: 0, +// styles + bold: 1, + italic: 3, + underline: 4, + inverse: 7, +// resets + stopBold: 22, + stopItalic: 23, + stopUnderline: 24, + stopInverse: 27, +// colors + white: 37, + black: 30, + blue: 34, + cyan: 36, + green: 32, + magenta: 35, + red: 31, + yellow: 33, + bgWhite: 47, + bgBlack: 40, + bgBlue: 44, + bgCyan: 46, + bgGreen: 42, + bgMagenta: 45, + bgRed: 41, + bgYellow: 43, + + grey: 90, + brightBlack: 90, + brightRed: 91, + brightGreen: 92, + brightYellow: 93, + brightBlue: 94, + brightMagenta: 95, + brightCyan: 96, + brightWhite: 97, + + bgGrey: 100, + bgBrightBlack: 100, + bgBrightRed: 101, + bgBrightGreen: 102, + bgBrightYellow: 103, + bgBrightBlue: 104, + bgBrightMagenta: 105, + bgBrightCyan: 106, + bgBrightWhite: 107 +} + +exports.color = function color (colorWith) { + if (arguments.length !== 1 || !Array.isArray(colorWith)) { + colorWith = Array.prototype.slice.call(arguments) + } + return prefix + colorWith.map(colorNameToCode).join(';') + 'm' +} + +function colorNameToCode (color) { + if (colors[color] != null) return colors[color] + throw new Error('Unknown color or style name: ' + color) +} diff --git a/publisher/node_modules/console-control-strings/package.json b/publisher/node_modules/console-control-strings/package.json new file mode 100644 index 00000000..eb6c62ae --- /dev/null +++ b/publisher/node_modules/console-control-strings/package.json @@ -0,0 +1,27 @@ +{ + "name": "console-control-strings", + "version": "1.1.0", + "description": "A library of cross-platform tested terminal/console command strings for doing things like color and cursor positioning. This is a subset of both ansi and vt100. All control codes included work on both Windows & Unix-like OSes, except where noted.", + "main": "index.js", + "directories": { + "test": "test" + }, + "scripts": { + "test": "standard && tap test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/iarna/console-control-strings" + }, + "keywords": [], + "author": "Rebecca Turner (http://re-becca.org/)", + "license": "ISC", + "files": [ + "LICENSE", + "index.js" + ], + "devDependencies": { + "standard": "^7.1.2", + "tap": "^5.7.2" + } +} diff --git a/publisher/node_modules/core-util-is/LICENSE b/publisher/node_modules/core-util-is/LICENSE new file mode 100644 index 00000000..d8d7f943 --- /dev/null +++ b/publisher/node_modules/core-util-is/LICENSE @@ -0,0 +1,19 @@ +Copyright Node.js contributors. All rights reserved. + +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. diff --git a/publisher/node_modules/core-util-is/README.md b/publisher/node_modules/core-util-is/README.md new file mode 100644 index 00000000..5a76b414 --- /dev/null +++ b/publisher/node_modules/core-util-is/README.md @@ -0,0 +1,3 @@ +# core-util-is + +The `util.is*` functions introduced in Node v0.12. diff --git a/publisher/node_modules/core-util-is/float.patch b/publisher/node_modules/core-util-is/float.patch new file mode 100644 index 00000000..a06d5c05 --- /dev/null +++ b/publisher/node_modules/core-util-is/float.patch @@ -0,0 +1,604 @@ +diff --git a/lib/util.js b/lib/util.js +index a03e874..9074e8e 100644 +--- a/lib/util.js ++++ b/lib/util.js +@@ -19,430 +19,6 @@ + // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + // USE OR OTHER DEALINGS IN THE SOFTWARE. + +-var formatRegExp = /%[sdj%]/g; +-exports.format = function(f) { +- if (!isString(f)) { +- var objects = []; +- for (var i = 0; i < arguments.length; i++) { +- objects.push(inspect(arguments[i])); +- } +- return objects.join(' '); +- } +- +- var i = 1; +- var args = arguments; +- var len = args.length; +- var str = String(f).replace(formatRegExp, function(x) { +- if (x === '%%') return '%'; +- if (i >= len) return x; +- switch (x) { +- case '%s': return String(args[i++]); +- case '%d': return Number(args[i++]); +- case '%j': +- try { +- return JSON.stringify(args[i++]); +- } catch (_) { +- return '[Circular]'; +- } +- default: +- return x; +- } +- }); +- for (var x = args[i]; i < len; x = args[++i]) { +- if (isNull(x) || !isObject(x)) { +- str += ' ' + x; +- } else { +- str += ' ' + inspect(x); +- } +- } +- return str; +-}; +- +- +-// Mark that a method should not be used. +-// Returns a modified function which warns once by default. +-// If --no-deprecation is set, then it is a no-op. +-exports.deprecate = function(fn, msg) { +- // Allow for deprecating things in the process of starting up. +- if (isUndefined(global.process)) { +- return function() { +- return exports.deprecate(fn, msg).apply(this, arguments); +- }; +- } +- +- if (process.noDeprecation === true) { +- return fn; +- } +- +- var warned = false; +- function deprecated() { +- if (!warned) { +- if (process.throwDeprecation) { +- throw new Error(msg); +- } else if (process.traceDeprecation) { +- console.trace(msg); +- } else { +- console.error(msg); +- } +- warned = true; +- } +- return fn.apply(this, arguments); +- } +- +- return deprecated; +-}; +- +- +-var debugs = {}; +-var debugEnviron; +-exports.debuglog = function(set) { +- if (isUndefined(debugEnviron)) +- debugEnviron = process.env.NODE_DEBUG || ''; +- set = set.toUpperCase(); +- if (!debugs[set]) { +- if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { +- var pid = process.pid; +- debugs[set] = function() { +- var msg = exports.format.apply(exports, arguments); +- console.error('%s %d: %s', set, pid, msg); +- }; +- } else { +- debugs[set] = function() {}; +- } +- } +- return debugs[set]; +-}; +- +- +-/** +- * Echos the value of a value. Trys to print the value out +- * in the best way possible given the different types. +- * +- * @param {Object} obj The object to print out. +- * @param {Object} opts Optional options object that alters the output. +- */ +-/* legacy: obj, showHidden, depth, colors*/ +-function inspect(obj, opts) { +- // default options +- var ctx = { +- seen: [], +- stylize: stylizeNoColor +- }; +- // legacy... +- if (arguments.length >= 3) ctx.depth = arguments[2]; +- if (arguments.length >= 4) ctx.colors = arguments[3]; +- if (isBoolean(opts)) { +- // legacy... +- ctx.showHidden = opts; +- } else if (opts) { +- // got an "options" object +- exports._extend(ctx, opts); +- } +- // set default options +- if (isUndefined(ctx.showHidden)) ctx.showHidden = false; +- if (isUndefined(ctx.depth)) ctx.depth = 2; +- if (isUndefined(ctx.colors)) ctx.colors = false; +- if (isUndefined(ctx.customInspect)) ctx.customInspect = true; +- if (ctx.colors) ctx.stylize = stylizeWithColor; +- return formatValue(ctx, obj, ctx.depth); +-} +-exports.inspect = inspect; +- +- +-// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics +-inspect.colors = { +- 'bold' : [1, 22], +- 'italic' : [3, 23], +- 'underline' : [4, 24], +- 'inverse' : [7, 27], +- 'white' : [37, 39], +- 'grey' : [90, 39], +- 'black' : [30, 39], +- 'blue' : [34, 39], +- 'cyan' : [36, 39], +- 'green' : [32, 39], +- 'magenta' : [35, 39], +- 'red' : [31, 39], +- 'yellow' : [33, 39] +-}; +- +-// Don't use 'blue' not visible on cmd.exe +-inspect.styles = { +- 'special': 'cyan', +- 'number': 'yellow', +- 'boolean': 'yellow', +- 'undefined': 'grey', +- 'null': 'bold', +- 'string': 'green', +- 'date': 'magenta', +- // "name": intentionally not styling +- 'regexp': 'red' +-}; +- +- +-function stylizeWithColor(str, styleType) { +- var style = inspect.styles[styleType]; +- +- if (style) { +- return '\u001b[' + inspect.colors[style][0] + 'm' + str + +- '\u001b[' + inspect.colors[style][1] + 'm'; +- } else { +- return str; +- } +-} +- +- +-function stylizeNoColor(str, styleType) { +- return str; +-} +- +- +-function arrayToHash(array) { +- var hash = {}; +- +- array.forEach(function(val, idx) { +- hash[val] = true; +- }); +- +- return hash; +-} +- +- +-function formatValue(ctx, value, recurseTimes) { +- // Provide a hook for user-specified inspect functions. +- // Check that value is an object with an inspect function on it +- if (ctx.customInspect && +- value && +- isFunction(value.inspect) && +- // Filter out the util module, it's inspect function is special +- value.inspect !== exports.inspect && +- // Also filter out any prototype objects using the circular check. +- !(value.constructor && value.constructor.prototype === value)) { +- var ret = value.inspect(recurseTimes, ctx); +- if (!isString(ret)) { +- ret = formatValue(ctx, ret, recurseTimes); +- } +- return ret; +- } +- +- // Primitive types cannot have properties +- var primitive = formatPrimitive(ctx, value); +- if (primitive) { +- return primitive; +- } +- +- // Look up the keys of the object. +- var keys = Object.keys(value); +- var visibleKeys = arrayToHash(keys); +- +- if (ctx.showHidden) { +- keys = Object.getOwnPropertyNames(value); +- } +- +- // Some type of object without properties can be shortcutted. +- if (keys.length === 0) { +- if (isFunction(value)) { +- var name = value.name ? ': ' + value.name : ''; +- return ctx.stylize('[Function' + name + ']', 'special'); +- } +- if (isRegExp(value)) { +- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); +- } +- if (isDate(value)) { +- return ctx.stylize(Date.prototype.toString.call(value), 'date'); +- } +- if (isError(value)) { +- return formatError(value); +- } +- } +- +- var base = '', array = false, braces = ['{', '}']; +- +- // Make Array say that they are Array +- if (isArray(value)) { +- array = true; +- braces = ['[', ']']; +- } +- +- // Make functions say that they are functions +- if (isFunction(value)) { +- var n = value.name ? ': ' + value.name : ''; +- base = ' [Function' + n + ']'; +- } +- +- // Make RegExps say that they are RegExps +- if (isRegExp(value)) { +- base = ' ' + RegExp.prototype.toString.call(value); +- } +- +- // Make dates with properties first say the date +- if (isDate(value)) { +- base = ' ' + Date.prototype.toUTCString.call(value); +- } +- +- // Make error with message first say the error +- if (isError(value)) { +- base = ' ' + formatError(value); +- } +- +- if (keys.length === 0 && (!array || value.length == 0)) { +- return braces[0] + base + braces[1]; +- } +- +- if (recurseTimes < 0) { +- if (isRegExp(value)) { +- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); +- } else { +- return ctx.stylize('[Object]', 'special'); +- } +- } +- +- ctx.seen.push(value); +- +- var output; +- if (array) { +- output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); +- } else { +- output = keys.map(function(key) { +- return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); +- }); +- } +- +- ctx.seen.pop(); +- +- return reduceToSingleString(output, base, braces); +-} +- +- +-function formatPrimitive(ctx, value) { +- if (isUndefined(value)) +- return ctx.stylize('undefined', 'undefined'); +- if (isString(value)) { +- var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') +- .replace(/'/g, "\\'") +- .replace(/\\"/g, '"') + '\''; +- return ctx.stylize(simple, 'string'); +- } +- if (isNumber(value)) { +- // Format -0 as '-0'. Strict equality won't distinguish 0 from -0, +- // so instead we use the fact that 1 / -0 < 0 whereas 1 / 0 > 0 . +- if (value === 0 && 1 / value < 0) +- return ctx.stylize('-0', 'number'); +- return ctx.stylize('' + value, 'number'); +- } +- if (isBoolean(value)) +- return ctx.stylize('' + value, 'boolean'); +- // For some reason typeof null is "object", so special case here. +- if (isNull(value)) +- return ctx.stylize('null', 'null'); +-} +- +- +-function formatError(value) { +- return '[' + Error.prototype.toString.call(value) + ']'; +-} +- +- +-function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { +- var output = []; +- for (var i = 0, l = value.length; i < l; ++i) { +- if (hasOwnProperty(value, String(i))) { +- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, +- String(i), true)); +- } else { +- output.push(''); +- } +- } +- keys.forEach(function(key) { +- if (!key.match(/^\d+$/)) { +- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, +- key, true)); +- } +- }); +- return output; +-} +- +- +-function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { +- var name, str, desc; +- desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; +- if (desc.get) { +- if (desc.set) { +- str = ctx.stylize('[Getter/Setter]', 'special'); +- } else { +- str = ctx.stylize('[Getter]', 'special'); +- } +- } else { +- if (desc.set) { +- str = ctx.stylize('[Setter]', 'special'); +- } +- } +- if (!hasOwnProperty(visibleKeys, key)) { +- name = '[' + key + ']'; +- } +- if (!str) { +- if (ctx.seen.indexOf(desc.value) < 0) { +- if (isNull(recurseTimes)) { +- str = formatValue(ctx, desc.value, null); +- } else { +- str = formatValue(ctx, desc.value, recurseTimes - 1); +- } +- if (str.indexOf('\n') > -1) { +- if (array) { +- str = str.split('\n').map(function(line) { +- return ' ' + line; +- }).join('\n').substr(2); +- } else { +- str = '\n' + str.split('\n').map(function(line) { +- return ' ' + line; +- }).join('\n'); +- } +- } +- } else { +- str = ctx.stylize('[Circular]', 'special'); +- } +- } +- if (isUndefined(name)) { +- if (array && key.match(/^\d+$/)) { +- return str; +- } +- name = JSON.stringify('' + key); +- if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { +- name = name.substr(1, name.length - 2); +- name = ctx.stylize(name, 'name'); +- } else { +- name = name.replace(/'/g, "\\'") +- .replace(/\\"/g, '"') +- .replace(/(^"|"$)/g, "'"); +- name = ctx.stylize(name, 'string'); +- } +- } +- +- return name + ': ' + str; +-} +- +- +-function reduceToSingleString(output, base, braces) { +- var numLinesEst = 0; +- var length = output.reduce(function(prev, cur) { +- numLinesEst++; +- if (cur.indexOf('\n') >= 0) numLinesEst++; +- return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; +- }, 0); +- +- if (length > 60) { +- return braces[0] + +- (base === '' ? '' : base + '\n ') + +- ' ' + +- output.join(',\n ') + +- ' ' + +- braces[1]; +- } +- +- return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; +-} +- +- + // NOTE: These type checking functions intentionally don't use `instanceof` + // because it is fragile and can be easily faked with `Object.create()`. + function isArray(ar) { +@@ -522,166 +98,10 @@ function isPrimitive(arg) { + exports.isPrimitive = isPrimitive; + + function isBuffer(arg) { +- return arg instanceof Buffer; ++ return Buffer.isBuffer(arg); + } + exports.isBuffer = isBuffer; + + function objectToString(o) { + return Object.prototype.toString.call(o); +-} +- +- +-function pad(n) { +- return n < 10 ? '0' + n.toString(10) : n.toString(10); +-} +- +- +-var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', +- 'Oct', 'Nov', 'Dec']; +- +-// 26 Feb 16:19:34 +-function timestamp() { +- var d = new Date(); +- var time = [pad(d.getHours()), +- pad(d.getMinutes()), +- pad(d.getSeconds())].join(':'); +- return [d.getDate(), months[d.getMonth()], time].join(' '); +-} +- +- +-// log is just a thin wrapper to console.log that prepends a timestamp +-exports.log = function() { +- console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); +-}; +- +- +-/** +- * Inherit the prototype methods from one constructor into another. +- * +- * The Function.prototype.inherits from lang.js rewritten as a standalone +- * function (not on Function.prototype). NOTE: If this file is to be loaded +- * during bootstrapping this function needs to be rewritten using some native +- * functions as prototype setup using normal JavaScript does not work as +- * expected during bootstrapping (see mirror.js in r114903). +- * +- * @param {function} ctor Constructor function which needs to inherit the +- * prototype. +- * @param {function} superCtor Constructor function to inherit prototype from. +- */ +-exports.inherits = function(ctor, superCtor) { +- ctor.super_ = superCtor; +- ctor.prototype = Object.create(superCtor.prototype, { +- constructor: { +- value: ctor, +- enumerable: false, +- writable: true, +- configurable: true +- } +- }); +-}; +- +-exports._extend = function(origin, add) { +- // Don't do anything if add isn't an object +- if (!add || !isObject(add)) return origin; +- +- var keys = Object.keys(add); +- var i = keys.length; +- while (i--) { +- origin[keys[i]] = add[keys[i]]; +- } +- return origin; +-}; +- +-function hasOwnProperty(obj, prop) { +- return Object.prototype.hasOwnProperty.call(obj, prop); +-} +- +- +-// Deprecated old stuff. +- +-exports.p = exports.deprecate(function() { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- console.error(exports.inspect(arguments[i])); +- } +-}, 'util.p: Use console.error() instead'); +- +- +-exports.exec = exports.deprecate(function() { +- return require('child_process').exec.apply(this, arguments); +-}, 'util.exec is now called `child_process.exec`.'); +- +- +-exports.print = exports.deprecate(function() { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- process.stdout.write(String(arguments[i])); +- } +-}, 'util.print: Use console.log instead'); +- +- +-exports.puts = exports.deprecate(function() { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- process.stdout.write(arguments[i] + '\n'); +- } +-}, 'util.puts: Use console.log instead'); +- +- +-exports.debug = exports.deprecate(function(x) { +- process.stderr.write('DEBUG: ' + x + '\n'); +-}, 'util.debug: Use console.error instead'); +- +- +-exports.error = exports.deprecate(function(x) { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- process.stderr.write(arguments[i] + '\n'); +- } +-}, 'util.error: Use console.error instead'); +- +- +-exports.pump = exports.deprecate(function(readStream, writeStream, callback) { +- var callbackCalled = false; +- +- function call(a, b, c) { +- if (callback && !callbackCalled) { +- callback(a, b, c); +- callbackCalled = true; +- } +- } +- +- readStream.addListener('data', function(chunk) { +- if (writeStream.write(chunk) === false) readStream.pause(); +- }); +- +- writeStream.addListener('drain', function() { +- readStream.resume(); +- }); +- +- readStream.addListener('end', function() { +- writeStream.end(); +- }); +- +- readStream.addListener('close', function() { +- call(); +- }); +- +- readStream.addListener('error', function(err) { +- writeStream.end(); +- call(err); +- }); +- +- writeStream.addListener('error', function(err) { +- readStream.destroy(); +- call(err); +- }); +-}, 'util.pump(): Use readableStream.pipe() instead'); +- +- +-var uv; +-exports._errnoException = function(err, syscall) { +- if (isUndefined(uv)) uv = process.binding('uv'); +- var errname = uv.errname(err); +- var e = new Error(syscall + ' ' + errname); +- e.code = errname; +- e.errno = errname; +- e.syscall = syscall; +- return e; +-}; ++} \ No newline at end of file diff --git a/publisher/node_modules/core-util-is/lib/util.js b/publisher/node_modules/core-util-is/lib/util.js new file mode 100644 index 00000000..ff4c851c --- /dev/null +++ b/publisher/node_modules/core-util-is/lib/util.js @@ -0,0 +1,107 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. + +function isArray(arg) { + if (Array.isArray) { + return Array.isArray(arg); + } + return objectToString(arg) === '[object Array]'; +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +exports.isBuffer = Buffer.isBuffer; + +function objectToString(o) { + return Object.prototype.toString.call(o); +} diff --git a/publisher/node_modules/core-util-is/package.json b/publisher/node_modules/core-util-is/package.json new file mode 100644 index 00000000..3368e951 --- /dev/null +++ b/publisher/node_modules/core-util-is/package.json @@ -0,0 +1,32 @@ +{ + "name": "core-util-is", + "version": "1.0.2", + "description": "The `util.is*` functions introduced in Node v0.12.", + "main": "lib/util.js", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/core-util-is" + }, + "keywords": [ + "util", + "isBuffer", + "isArray", + "isNumber", + "isString", + "isRegExp", + "isThis", + "isThat", + "polyfill" + ], + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "MIT", + "bugs": { + "url": "https://github.com/isaacs/core-util-is/issues" + }, + "scripts": { + "test": "tap test.js" + }, + "devDependencies": { + "tap": "^2.3.0" + } +} diff --git a/publisher/node_modules/core-util-is/test.js b/publisher/node_modules/core-util-is/test.js new file mode 100644 index 00000000..1a490c65 --- /dev/null +++ b/publisher/node_modules/core-util-is/test.js @@ -0,0 +1,68 @@ +var assert = require('tap'); + +var t = require('./lib/util'); + +assert.equal(t.isArray([]), true); +assert.equal(t.isArray({}), false); + +assert.equal(t.isBoolean(null), false); +assert.equal(t.isBoolean(true), true); +assert.equal(t.isBoolean(false), true); + +assert.equal(t.isNull(null), true); +assert.equal(t.isNull(undefined), false); +assert.equal(t.isNull(false), false); +assert.equal(t.isNull(), false); + +assert.equal(t.isNullOrUndefined(null), true); +assert.equal(t.isNullOrUndefined(undefined), true); +assert.equal(t.isNullOrUndefined(false), false); +assert.equal(t.isNullOrUndefined(), true); + +assert.equal(t.isNumber(null), false); +assert.equal(t.isNumber('1'), false); +assert.equal(t.isNumber(1), true); + +assert.equal(t.isString(null), false); +assert.equal(t.isString('1'), true); +assert.equal(t.isString(1), false); + +assert.equal(t.isSymbol(null), false); +assert.equal(t.isSymbol('1'), false); +assert.equal(t.isSymbol(1), false); +assert.equal(t.isSymbol(Symbol()), true); + +assert.equal(t.isUndefined(null), false); +assert.equal(t.isUndefined(undefined), true); +assert.equal(t.isUndefined(false), false); +assert.equal(t.isUndefined(), true); + +assert.equal(t.isRegExp(null), false); +assert.equal(t.isRegExp('1'), false); +assert.equal(t.isRegExp(new RegExp()), true); + +assert.equal(t.isObject({}), true); +assert.equal(t.isObject([]), true); +assert.equal(t.isObject(new RegExp()), true); +assert.equal(t.isObject(new Date()), true); + +assert.equal(t.isDate(null), false); +assert.equal(t.isDate('1'), false); +assert.equal(t.isDate(new Date()), true); + +assert.equal(t.isError(null), false); +assert.equal(t.isError({ err: true }), false); +assert.equal(t.isError(new Error()), true); + +assert.equal(t.isFunction(null), false); +assert.equal(t.isFunction({ }), false); +assert.equal(t.isFunction(function() {}), true); + +assert.equal(t.isPrimitive(null), true); +assert.equal(t.isPrimitive(''), true); +assert.equal(t.isPrimitive(0), true); +assert.equal(t.isPrimitive(new Date()), false); + +assert.equal(t.isBuffer(null), false); +assert.equal(t.isBuffer({}), false); +assert.equal(t.isBuffer(new Buffer(0)), true); diff --git a/publisher/node_modules/dashdash/CHANGES.md b/publisher/node_modules/dashdash/CHANGES.md new file mode 100644 index 00000000..d7c8f4eb --- /dev/null +++ b/publisher/node_modules/dashdash/CHANGES.md @@ -0,0 +1,364 @@ +# node-dashdash changelog + +## not yet released + +(nothing yet) + +## 1.14.1 + +- [issue #30] Change the output used by dashdash's Bash completion support to + indicate "there are no completions for this argument" to cope with different + sorting rules on different Bash/platforms. For example: + + $ triton -v -p test2 package get # before + ##-no -tritonpackage- completions-## + + $ triton -v -p test2 package get # after + ##-no-completion- -results-## + +## 1.14.0 + +- New `synopsisFromOpt(