starting source code generation

pull/5/head
Mingwei Samuel 2019-10-19 02:25:09 -07:00
parent 907b19594b
commit de2c27be4c
14 changed files with 861 additions and 21 deletions

View File

@ -14,11 +14,16 @@ exclude = [
[dependencies] [dependencies]
async-std = "0.99" async-std = "0.99"
log = "0.4" log = "0.4"
num-traits = "0.2"
num-derive = "0.3"
parking_lot = { version = "0.9", features = [ "nightly" ] } parking_lot = { version = "0.9", features = [ "nightly" ] }
reqwest = { version = "0.10.0-alpha.1", features = [ "gzip", "json" ] } reqwest = { version = "0.10.0-alpha.1", features = [ "gzip", "json" ] }
scan_fmt = "0.2" scan_fmt = "0.2"
serde = "^1.0" serde = "^1.0"
tokio = "0.2.0-alpha.6"
[dev-dependencies] [dev-dependencies]
env_logger = "0.7" env_logger = "0.7"
tokio = "0.2.0-alpha.6"
[build-dependencies]
os_pipe = "0.9"

View File

@ -1,3 +1,4 @@
mod region; mod region;
pub use region::*; pub use region::*;
pub use crate::champion::*;

View File

@ -1,3 +1,5 @@
include!("../srcgen/mod.rs");
pub mod consts; pub mod consts;
mod riot_api_config; mod riot_api_config;
@ -18,10 +20,12 @@ mod tests {
fn it_works() { fn it_works() {
env_logger::init(); env_logger::init();
let champ = crate::consts::Champion::Riven;
println!("{}", champ);
let api_key_raw = std::fs::read_to_string("apikey.txt").unwrap(); // TODO don't use unwrap. let api_key_raw = std::fs::read_to_string("apikey.txt").unwrap(); // TODO don't use unwrap.
let api_key = api_key_raw.trim(); let api_key = api_key_raw.trim();
let rt = Runtime::new().unwrap(); let rt = Runtime::new().unwrap();
let riot_api = RiotApi::with_key(api_key); let riot_api = RiotApi::with_key(api_key);

View File

@ -1,7 +1,7 @@
use std::cmp; use std::cmp;
use std::time::{ Duration, Instant }; use std::time::{ Duration, Instant };
use log::debug; use log::*;
use parking_lot::{ RwLock, RwLockUpgradableReadGuard }; use parking_lot::{ RwLock, RwLockUpgradableReadGuard };
use reqwest::{ StatusCode, Response }; use reqwest::{ StatusCode, Response };
use scan_fmt::scan_fmt; use scan_fmt::scan_fmt;
@ -81,7 +81,8 @@ impl RateLimit {
{ {
// Only care if the header that indicates the relevant RateLimit is present. // Only care if the header that indicates the relevant RateLimit is present.
let type_name_header = response.headers() let type_name_header = response.headers()
.get(RateLimit::HEADER_XRATELIMITTYPE)?.to_str().unwrap(); .get(RateLimit::HEADER_XRATELIMITTYPE)?.to_str()
.expect("Failed to read x-rate-limit-type header as string.");
// Only care if that header's value matches us. // Only care if that header's value matches us.
if self.rate_limit_type.type_name() != type_name_header.to_lowercase() { if self.rate_limit_type.type_name() != type_name_header.to_lowercase() {
return None; return None;
@ -90,9 +91,14 @@ impl RateLimit {
// Get retry after header. Only care if it exists. // Get retry after header. Only care if it exists.
let retry_after_header = response.headers() let retry_after_header = response.headers()
.get(RateLimit::HEADER_RETRYAFTER)?.to_str().ok()?; .get(RateLimit::HEADER_RETRYAFTER)?.to_str()
let retry_after_secs: u64 = retry_after_header.parse().ok()?; .expect("Failed to read retry-after header as string.");
return Some(Instant::now() + Duration::from_secs(retry_after_secs)); // Header currently only returns ints, but float is more general. Can be zero.
let retry_after_secs: f32 = retry_after_header.parse()
.expect("Failed to parse retry-after header as f32.");
// Add 0.5 seconds to account for rounding, cases when response is zero.
let delay = Duration::from_secs_f32(0.5 + retry_after_secs);
return Some(Instant::now() + delay);
}() { }() {
*self.retry_after.write() = Some(retry_after); *self.retry_after.write() = Some(retry_after);
} }
@ -102,11 +108,15 @@ impl RateLimit {
fn on_response_rate_limits(&self, response: &Response) { fn on_response_rate_limits(&self, response: &Response) {
// Check if rate limits changed. // Check if rate limits changed.
let headers = response.headers(); let headers = response.headers();
let limit_header_opt = headers.get(self.rate_limit_type.limit_header()).map(|h| h.to_str().unwrap()); let limit_header_opt = headers.get(self.rate_limit_type.limit_header())
let count_header_opt = headers.get(self.rate_limit_type.count_header()).map(|h| h.to_str().unwrap()); .map(|h| h.to_str().expect("Failed to read limit header as string."));
let count_header_opt = headers.get(self.rate_limit_type.count_header())
.map(|h| h.to_str().expect("Failed to read count header as string."));
// https://github.com/rust-lang/rust/issues/53667
if let Some(limit_header) = limit_header_opt { if let Some(limit_header) = limit_header_opt {
if let Some(count_header) = count_header_opt { if let Some(count_header) = count_header_opt {
let buckets = self.buckets.upgradable_read(); let buckets = self.buckets.upgradable_read();
if !buckets_require_updating(limit_header, &*buckets) { if !buckets_require_updating(limit_header, &*buckets) {
return; return;
@ -141,8 +151,10 @@ fn buckets_from_header(limit_header: &str, count_header: &str) -> Vec<VectorToke
let mut out = Vec::with_capacity(size); let mut out = Vec::with_capacity(size);
for (limit_entry, count_entry) in limit_header.split(",").zip(count_header.split(",")) { for (limit_entry, count_entry) in limit_header.split(",").zip(count_header.split(",")) {
let (limit, limit_secs) = scan_fmt!(limit_entry, "{d}:{d}", usize, u64).unwrap(); let (limit, limit_secs) = scan_fmt!(limit_entry, "{d}:{d}", usize, u64)
let (count, count_secs) = scan_fmt!(count_entry, "{d}:{d}", usize, u64).unwrap(); .unwrap_or_else(|_| panic!("Failed to parse limit entry \"{}\".", limit_entry));
let (count, count_secs) = scan_fmt!(count_entry, "{d}:{d}", usize, u64)
.unwrap_or_else(|_| panic!("Failed to parse count entry \"{}\".", count_entry));
debug_assert!(limit_secs == count_secs); debug_assert!(limit_secs == count_secs);
let bucket = VectorTokenBucket::new(Duration::from_secs(limit_secs), limit); let bucket = VectorTokenBucket::new(Duration::from_secs(limit_secs), limit);

View File

@ -1,3 +1,4 @@
use log::*;
use reqwest::Client; use reqwest::Client;
use crate::riot_api_config::RiotApiConfig; use crate::riot_api_config::RiotApiConfig;
@ -20,6 +21,8 @@ impl<'a> RequesterManager<'a> {
pub fn new(riot_api_config: RiotApiConfig<'a>) -> Self { pub fn new(riot_api_config: RiotApiConfig<'a>) -> Self {
// TODO configure client. // TODO configure client.
let client = Client::new(); let client = Client::new();
trace!("Creating client (TODO: configuration).");
Self { Self {
riot_api_config: riot_api_config, riot_api_config: riot_api_config,
client: client, client: client,

View File

@ -61,17 +61,14 @@ impl TokenBucket for VectorTokenBucket {
fn get_delay(&self) -> Option<Duration> { fn get_delay(&self) -> Option<Duration> {
let timestamps = self.update_get_timestamps(); let timestamps = self.update_get_timestamps();
if timestamps.len() < self.total_limit { // The "?" means:
None // `if timestamps.len() < self.total_limit { return None }`
}
else {
// Timestamp that needs to be popped before // Timestamp that needs to be popped before
// we can enter another timestamp. // we can enter another timestamp.
let ts = *timestamps.get(self.total_limit - 1).unwrap(); let ts = *timestamps.get(self.total_limit - 1)?;
Instant::now().checked_duration_since(ts) Instant::now().checked_duration_since(ts)
.and_then(|passed_dur| self.duration.checked_sub(passed_dur)) .and_then(|passed_dur| self.duration.checked_sub(passed_dur))
} }
}
fn get_tokens(&self, n: usize) -> bool { fn get_tokens(&self, n: usize) -> bool {
let mut timestamps = self.update_get_timestamps(); let mut timestamps = self.update_get_timestamps();

4
srcgen/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
node_modules/
*.rs
!mod.rs
.*.json

94
srcgen/champion.rs.dt Normal file
View File

@ -0,0 +1,94 @@
{{
const champions = require('./.champion.json')
.filter(({ id }) => id > 0)
.sort(({ name: a }, { name: b }) => a > b ? 1 : -1);
const hashFactor = 256;
const enumName = name => name.replace(/[^a-z]+/i, '');
const strHash = function(str) {
let h = 0;
for (let c of str)
h = hashFactor * h + c.charCodeAt(0);
return h;
};
const padId = function(id) { return ('' + id).padEnd(3); };
}}
// This file is automatically generated.
// Do not directly edit.
// Generated on {{= (new Date).toISOString() }}
use std::fmt;
use num_derive;
#[derive(fmt::Debug, Copy, Clone)]
#[derive(num_derive::FromPrimitive, num_derive::ToPrimitive)]
pub enum Champion {
{{
for (let { id, name } of champions) {
}}
{{= enumName(name).padEnd(12) }} = {{= id }},
{{
}
}}
}
impl Champion {
pub fn name(self) -> &'static str {
match self {
{{
for (let { id, name } of champions) {
}}
Self::{{= enumName(name).padEnd(12) }} => "{{= name }}",
{{
}
}}
}
}
pub fn identifier(self) -> &'static str {
match self {
{{
for (let { name, alias } of champions) {
}}
Self::{{= enumName(name).padEnd(12) }} => "{{= alias }}",
{{
}
}}
}
}
}
impl std::str::FromStr for Champion {
type Err = ();
fn from_str(val: &str) -> Result<Self, Self::Err> {
// 4 characters encoded as an int.
match val.chars()
.filter(|c| c.is_ascii_alphabetic())
.take(4)
.map(|c| c.to_ascii_uppercase() as u32)
.fold(0u32, |hash, next| hash * {{= hashFactor }} + next)
{
{{
let keyStrings = (name, alias) => new Set([].concat(...[ name, alias ].map(s => s.toUpperCase())
.map(s => [
s.replace(/[^A-Z]+/, '').substring(0, 4),
s.split(/[^A-Z]/, 1)[0].substring(0, 4)
])));
for (let { id, alias, name } of champions) {
for (let prefix of keyStrings(name, alias)) {
}}
{{= ('' + strHash(prefix)).padEnd(10) }} /* {{= prefix.padEnd(4) }} */ => Ok(Self::{{= enumName(name) }}),
{{
}
}
}}
_ => Err(()),
}
}
}
impl fmt::Display for Champion {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{:?}", self)
}
}

105
srcgen/dotUtils.js Normal file
View File

@ -0,0 +1,105 @@
// flatMap: https://gist.github.com/samgiles/762ee337dff48623e729
// [B](f: (A) ⇒ [B]): [B] ; Although the types in the arrays aren't strict (:
Array.prototype.flatMap = function(lambda) {
return Array.prototype.concat.apply([], this.map(lambda));
};
Array.prototype.groupBy = function(lambda) {
return Object.entries(this.reduce((agg, x) => {
const k = lambda(x);
(agg[k] = agg[k] || []).push(x);
return agg;
}, {}));
}
function capitalize(input) {
return input[0].toUpperCase() + input.slice(1);
}
function decapitalize(input) {
return input[0].toLowerCase() + input.slice(1);
}
function normalizeEndpointName(name) {
return name.split('-')
.join('_');
}
function normalizeSchemaName(name) {
return name.replace(/DTO/ig, '');
}
function normalizeArgName(name) {
var tokens = name.split('_');
var argName = decapitalize(tokens.map(capitalize).join(''));
return 'base' === argName ? 'Base' : argName;
}
function normalizePropName(propName, schemaName, value) {
var tokens = propName.split('_');
var name = tokens.map(capitalize).join('');
if (name === schemaName)
name += stringifyType(value);
return name;
}
function stringifyType(prop, endpoint = null, nullable = false) {
if (prop.anyOf) {
prop = prop.anyOf[0];
}
let refType = prop['$ref'];
if (refType) {
return (!endpoint ? '' : endpoint + '.') +
normalizeSchemaName(refType.slice(refType.indexOf('.') + 1));
}
var qm = nullable ? '?' : '';
switch (prop.type) {
case 'boolean': return 'bool' + qm;
case 'integer': return ('int32' === prop.format ? 'int' : 'long') + qm;
case 'number': return prop.format + qm;
case 'array': return stringifyType(prop.items, endpoint) + '[]' + qm;
case 'object':
return 'IDictionary<' + stringifyType(prop['x-key'], endpoint) + ', ' +
stringifyType(prop.additionalProperties, endpoint) + '>' + qm;
default: return prop.type + qm;
}
}
function formatJsonProperty(name) {
return `[JsonProperty(\"${name}\")]`;
}
function formatQueryParamStringify(prop) {
switch (prop.type) {
case 'boolean': return '.ToString().ToLowerInvariant()';
case 'string': return '';
default: return '.ToString()';
}
}
function formatAddQueryParam(param) {
let k = `nameof(${param.name})`;
let nc = param.required ? '' : `if (null != ${param.name}) `;
let prop = param.schema;
switch (prop.type) {
case 'array': return `${nc}queryParams.AddRange(${param.name}.Select(`
+ `w => new KeyValuePair<string, string>(${k}, w${formatQueryParamStringify(prop.items)})))`;
case 'object': throw 'unsupported';
default:
let vnc = param.required ? '' : '.Value';
return `${nc}queryParams.Add(new KeyValuePair<string, string>(${k}, `
+ `${param.name}${vnc}${formatQueryParamStringify(prop.type)}))`;
}
}
module.exports = {
capitalize,
decapitalize,
normalizeEndpointName,
normalizeSchemaName,
normalizeArgName,
normalizePropName,
stringifyType,
formatJsonProperty,
formatAddQueryParam
};

45
srcgen/dto.rs.dt Normal file
View File

@ -0,0 +1,45 @@
{{
const spec = require('./.spec.json');
const dotUtils = require('./dotUtils.js');
}}
// This file is automatically generated.
// Do not directly edit.
// Generated on {{= (new Date).toISOString() }}
// http://www.mingweisamuel.com/riotapi-schema/tool/
// Version {{= spec.info.version }}
{{
let schemas = spec.components.schemas;
let schemaKeyByEndpoint = Object.keys(schemas)
.filter(schemaKey => 'Error' != schemaKey)
.groupBy(schemaKey => schemaKey.split('.')[0]);
for (let [endpoint, schemaKeyGroup] of schemaKeyByEndpoint) {
}}
// {{= endpoint }}
#[allow(dead_code)]
pub mod {{= dotUtils.normalizeEndpointName(endpoint) }} {
{{
for (let schemaKey of schemaKeyGroup) {
let [endpoint, rawSchemaName] = schemaKey.split('.');
let schemaName = dotUtils.normalizeSchemaName(rawSchemaName);
let schema = schemas[schemaKey];
let props = schema.properties;
}}
/// {{= schemaName }} data object. This class is automatically generated.
{{? schema.description }}
/// # Description
/// {{= schema.description }}
{{?}}
pub struct {{= schemaName }} {
// TODO.
}
{{
}
}}
}
{{
}
}}

60
srcgen/index.js Normal file
View File

@ -0,0 +1,60 @@
const util = require('util');
const fs = require('fs');
fs.readFileAsync = util.promisify(fs.readFile);
fs.writeFileAsync = util.promisify(fs.writeFile);
const req = require("request-promise-native");
process.chdir(__dirname);
const files = [
[
'http://raw.communitydragon.org/pbe/plugins/rcp-be-lol-game-data/global/default/v1/champion-summary.json',
'.champion.json'
],
[
'http://www.mingweisamuel.com/riotapi-schema/openapi-3.0.0.json',
'.spec.json'
]
]
const downloadFilesPromise = Promise.all(files.map(([url, file]) => req(url)
.then(body => fs.writeFileAsync(file, body, "utf8"))));
const doT = require('dot');
const glob = require('glob-promise');
const log = a => { console.log(a); return a; };
const suffix = '.dt';
doT.templateSettings = {
evaluate: /\r?\n?\{\{([\s\S]+?)\}\}/g,
interpolate: /\r?\n?\{\{=([\s\S]+?)\}\}/g,
encode: /\r?\n?\{\{!([\s\S]+?)\}\}/g,
use: /\r?\n?\{\{#([\s\S]+?)\}\}/g,
define: /\r?\n?\{\{##\s*([\w\.$]+)\s*(\:|=)([\s\S]+?)#\}\}/g,
conditional: /\r?\n?\{\{\?(\?)?\s*([\s\S]*?)\s*\}\}/g,
iterate: /\r?\n?\{\{~\s*(?:\}\}|([\s\S]+?)\s*\:\s*([\w$]+)\s*(?:\:\s*([\w$]+))?\s*\}\})/g,
varname: 'it',
strip: false,
append: false,
selfcontained: false
};
global.require = require;
downloadFilesPromise.then(() => glob.promise("**/*" + suffix, { ignore: ["**/node_modules/**"] }))
.then(files => Promise.all(files
.map(log)
.map(file => fs.readFileAsync(file, "utf8")
.then(input => {
try {
return doT.template(input)({});
}
catch (e) {
console.error(`Error thrown while running "${file}":`, e);
}
})
.then(output => fs.writeFileAsync(file.slice(0, -suffix.length), output, "utf8"))
)
))
.catch(console.error);

2
srcgen/mod.rs Normal file
View File

@ -0,0 +1,2 @@
mod champion;
mod dto;

489
srcgen/package-lock.json generated Normal file
View File

@ -0,0 +1,489 @@
{
"name": "dot-gen",
"version": "0.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@types/events": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz",
"integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g=="
},
"@types/glob": {
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz",
"integrity": "sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==",
"requires": {
"@types/events": "*",
"@types/minimatch": "*",
"@types/node": "*"
}
},
"@types/minimatch": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz",
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA=="
},
"@types/node": {
"version": "12.11.1",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.11.1.tgz",
"integrity": "sha512-TJtwsqZ39pqcljJpajeoofYRfeZ7/I/OMUQ5pR4q5wOKf2ocrUvBAZUMhWsOvKx3dVc/aaV5GluBivt0sWqA5A=="
},
"ajv": {
"version": "6.10.2",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz",
"integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==",
"requires": {
"fast-deep-equal": "^2.0.1",
"fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "^0.4.1",
"uri-js": "^4.2.2"
}
},
"asn1": {
"version": "0.2.4",
"resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz",
"integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==",
"requires": {
"safer-buffer": "~2.1.0"
}
},
"assert-plus": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
"integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU="
},
"asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
},
"aws-sign2": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz",
"integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg="
},
"aws4": {
"version": "1.8.0",
"resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz",
"integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ=="
},
"balanced-match": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
},
"bcrypt-pbkdf": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz",
"integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=",
"requires": {
"tweetnacl": "^0.14.3"
}
},
"brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
}
},
"caseless": {
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz",
"integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw="
},
"combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
"requires": {
"delayed-stream": "~1.0.0"
}
},
"concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
},
"core-util-is": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
},
"dashdash": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz",
"integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=",
"requires": {
"assert-plus": "^1.0.0"
}
},
"delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
},
"dot": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/dot/-/dot-1.1.2.tgz",
"integrity": "sha1-xzdwGfxOVQeYkosrmv62ar+h8vk="
},
"ecc-jsbn": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz",
"integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=",
"requires": {
"jsbn": "~0.1.0",
"safer-buffer": "^2.1.0"
}
},
"extend": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
"integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="
},
"extsprintf": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz",
"integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU="
},
"fast-deep-equal": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz",
"integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk="
},
"fast-json-stable-stringify": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz",
"integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I="
},
"forever-agent": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
"integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE="
},
"form-data": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz",
"integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==",
"requires": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.6",
"mime-types": "^2.1.12"
}
},
"fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
},
"getpass": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz",
"integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=",
"requires": {
"assert-plus": "^1.0.0"
}
},
"glob": {
"version": "7.1.4",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz",
"integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==",
"requires": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.0.4",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
}
},
"glob-promise": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/glob-promise/-/glob-promise-3.4.0.tgz",
"integrity": "sha512-q08RJ6O+eJn+dVanerAndJwIcumgbDdYiUT7zFQl3Wm1xD6fBKtah7H8ZJChj4wP+8C+QfeVy8xautR7rdmKEw==",
"requires": {
"@types/glob": "*"
}
},
"har-schema": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz",
"integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI="
},
"har-validator": {
"version": "5.1.3",
"resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz",
"integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==",
"requires": {
"ajv": "^6.5.5",
"har-schema": "^2.0.0"
}
},
"http-signature": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz",
"integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=",
"requires": {
"assert-plus": "^1.0.0",
"jsprim": "^1.2.2",
"sshpk": "^1.7.0"
}
},
"inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"requires": {
"once": "^1.3.0",
"wrappy": "1"
}
},
"inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
},
"is-typedarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
"integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo="
},
"isstream": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
"integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo="
},
"jsbn": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
"integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM="
},
"json-schema": {
"version": "0.2.3",
"resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz",
"integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM="
},
"json-schema-traverse": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="
},
"json-stringify-safe": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
"integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus="
},
"jsprim": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz",
"integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=",
"requires": {
"assert-plus": "1.0.0",
"extsprintf": "1.3.0",
"json-schema": "0.2.3",
"verror": "1.10.0"
}
},
"lodash": {
"version": "4.17.15",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A=="
},
"mime-db": {
"version": "1.40.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz",
"integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA=="
},
"mime-types": {
"version": "2.1.24",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz",
"integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==",
"requires": {
"mime-db": "1.40.0"
}
},
"minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"requires": {
"brace-expansion": "^1.1.7"
}
},
"oauth-sign": {
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
"integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ=="
},
"once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"requires": {
"wrappy": "1"
}
},
"path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
},
"performance-now": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
"integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
},
"psl": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/psl/-/psl-1.4.0.tgz",
"integrity": "sha512-HZzqCGPecFLyoRj5HLfuDSKYTJkAfB5thKBIkRHtGjWwY7p1dAyveIbXIq4tO0KYfDF2tHqPUgY9SDnGm00uFw=="
},
"punycode": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
"integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A=="
},
"qs": {
"version": "6.5.2",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
"integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA=="
},
"request": {
"version": "2.88.0",
"resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz",
"integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==",
"requires": {
"aws-sign2": "~0.7.0",
"aws4": "^1.8.0",
"caseless": "~0.12.0",
"combined-stream": "~1.0.6",
"extend": "~3.0.2",
"forever-agent": "~0.6.1",
"form-data": "~2.3.2",
"har-validator": "~5.1.0",
"http-signature": "~1.2.0",
"is-typedarray": "~1.0.0",
"isstream": "~0.1.2",
"json-stringify-safe": "~5.0.1",
"mime-types": "~2.1.19",
"oauth-sign": "~0.9.0",
"performance-now": "^2.1.0",
"qs": "~6.5.2",
"safe-buffer": "^5.1.2",
"tough-cookie": "~2.4.3",
"tunnel-agent": "^0.6.0",
"uuid": "^3.3.2"
}
},
"request-promise-core": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.2.tgz",
"integrity": "sha512-UHYyq1MO8GsefGEt7EprS8UrXsm1TxEvFUX1IMTuSLU2Rh7fTIdFtl8xD7JiEYiWU2dl+NYAjCTksTehQUxPag==",
"requires": {
"lodash": "^4.17.11"
}
},
"request-promise-native": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.7.tgz",
"integrity": "sha512-rIMnbBdgNViL37nZ1b3L/VfPOpSi0TqVDQPAvO6U14lMzOLrt5nilxCQqtDKhZeDiW0/hkCXGoQjhgJd/tCh6w==",
"requires": {
"request-promise-core": "1.1.2",
"stealthy-require": "^1.1.1",
"tough-cookie": "^2.3.3"
}
},
"safe-buffer": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz",
"integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg=="
},
"safer-buffer": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
},
"sshpk": {
"version": "1.16.1",
"resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz",
"integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==",
"requires": {
"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"
}
},
"stealthy-require": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz",
"integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks="
},
"tough-cookie": {
"version": "2.4.3",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",
"integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==",
"requires": {
"psl": "^1.1.24",
"punycode": "^1.4.1"
},
"dependencies": {
"punycode": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz",
"integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4="
}
}
},
"tunnel-agent": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
"integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=",
"requires": {
"safe-buffer": "^5.0.1"
}
},
"tweetnacl": {
"version": "0.14.5",
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",
"integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q="
},
"uri-js": {
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz",
"integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==",
"requires": {
"punycode": "^2.1.0"
}
},
"uuid": {
"version": "3.3.3",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz",
"integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ=="
},
"verror": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz",
"integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=",
"requires": {
"assert-plus": "^1.0.0",
"core-util-is": "1.0.2",
"extsprintf": "^1.2.0"
}
},
"wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
}
}
}

19
srcgen/package.json Normal file
View File

@ -0,0 +1,19 @@
{
"name": "dot-gen",
"version": "0.0.0",
"description": "",
"main": "index.js",
"dependencies": {
"request": "^2.88.0",
"request-promise-native": "^1.0.7",
"dot": "^1.1.2",
"glob": "^7.1.2",
"glob-promise": "^3.3.0"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "GPL-2.0"
}