Unverified Commit da0a736f authored by Snorre Magnus Davøen's avatar Snorre Magnus Davøen
Browse files

Add dependencies, definition file, and converter



Adds typescript definition file generated by converter script.
Two dependencies are needed for this.
Signed-off-by: default avatarSnorre Magnus Davøen <snorre.davoen@nsd.uib.no>
parent 74711826
node_modules
\ No newline at end of file
All rights reserved © 2017 NSD - Norsk Senter for Forskningsdata
\ No newline at end of file
#!/usr/bin/env node
/**
* Use this script to generate a (broken) Typescript definition file, and fix.
* Run: ./jsonSchemaToTypeScript.js
*/
const fs = require('fs');
const jsonSchemaToTypeScript = require('json-schema-to-typescript');
jsonSchemaToTypeScript.compileFromFile('./log-schema/log-schema.json')
.then(compiled => {
fs.writeFileSync('./log-schema.d.ts', compiled);
})
.catch(console.error);
\ No newline at end of file
export interface LogSchema {
/**
* The version of the log-schema. Used to separate versions into different Elasticsearch indices.
*/
schemaVersion: "v3";
/**
* The time of the event. Format: RFC 3339. (E.g. 1985-04-12T23:20:50.52Z)
*/
"@timestamp": string;
/**
* Log-level (DEBUG|INFO|WARN|ERROR).
*/
levelName: ("DEBUG" | "INFO" | "WARN" | "ERROR");
/**
* Same as the message parameter in log libraries. Should contain a message describing log event.
*/
message: string;
/**
* The process to which the log event pertains.
*/
process?: string;
/**
* The thread to which the log event pertains.
*/
thread?: string;
/**
* The application file to which the log event pertains.
*/
file?: string;
/**
* The line number to which the log event pertains.
*/
line?: number;
/**
* Identification of user to which log event pertains. Can be used to view log events for specific users.
*/
userId?: string;
/**
* Name of logger generating the log event.
*/
loggerName?: string;
/**
* Name of the service. E.g. user-service.
*/
serviceName: string;
/**
* Version of the service. E.g. v2.0.2.
*/
serviceVersion: string;
serviceStack?: string;
/**
* The id of a client/user request. Used to track a single request across services.
*/
xRequestId?: string;
/**
* String tags to help categorize and/or filter log events
*/
tags?: string[];
/**
* The current hostname for the service instance.
*/
host?: string;
/**
* The current port number for the service instance.
*/
port?: number;
/**
* A regular string or stringified JSON object containing data about log event.
*/
data?: string;
/**
* The URL from which the log event was initiated.
*/
url?: string;
/**
* The number of milliseconds spent on request/process.
*/
responseTime?: number;
/**
* HTTP status code if applicable.
*/
statusCode?: number;
/**
* HTTP method if applicable.
*/
method?: string;
error?: {
/**
* A string representation of error type, e.g. NO_SUCH_VARIABLE_ERROR.
*/
type?: string;
/**
* Error code uniquely identifiying error. E.g. 4324.
*/
code: string;
/**
* Name of service where error originated if the error originated outside this service.
*/
serviceName?: string;
/**
* Stack trace for the error. Should be santizied of sensitive information if possible.
*/
stack?: string;
/**
* Any data that may be related to error in string format.
*/
data?: string;
/**
* Regular string or stringified json object of original error object
*/
originalErrorObject?: string;
};
request?: {
/**
* Request headers like Accept, If-Modified-Since, etc. Avoid logging sensitive headers!
*/
headers?: {
[k: string]: string;
};
/**
* Query parameters contained within URL. E.g. (?myvalue=foo)
*/
query?: {
[k: string]: string;
};
/**
* Path parameters contained whithin URL. E.g. /resource/<pathparam>
*/
path?: {
[k: string]: string;
};
/**
* The request payload/body if applicable (POST form, json payload, etc).
*/
payload?: string;
};
response?: {
/**
* Response headers like eTag, Content-Length, etc. Avoid logging sensitive headers!
*/
headers?: {
[k: string]: string;
};
/**
* A string representation of the response body. Do not log large bodies!
*/
body?: string;
};
}
{
"name": "log-schema-node",
"version": "1.0.0",
"main": "./log-schema/log-schema.json",
"types": "./log-schema.d.ts",
"repository": "git@gitlab.nsd.uib.no:nsd-commons/log-schema-node.git",
"author": "Snorre Magnus Davøen <snorre.davoen@nsd.uib.no>",
"license": "See LICENSE",
"devDependencies": {
"jayschema": "^0.3.1",
"json-schema-to-typescript": "^4.2.0"
}
}
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
ansi-regex@^2.1.1:
version "2.1.1"
resolved "https://nexus.nsd.no/repository/npm-group/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
any-promise@^1.0.0:
version "1.3.0"
resolved "https://nexus.nsd.no/repository/npm-group/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f"
argparse@^1.0.7:
version "1.0.9"
resolved "https://nexus.nsd.no/repository/npm-group/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86"
dependencies:
sprintf-js "~1.0.2"
call-me-maybe@^1.0.1:
version "1.0.1"
resolved "https://nexus.nsd.no/repository/npm-group/call-me-maybe/-/call-me-maybe-1.0.1.tgz#26d208ea89e37b5cbde60250a15f031c16a4d66b"
cli-color@^1.2.0:
version "1.2.0"
resolved "https://nexus.nsd.no/repository/npm-group/cli-color/-/cli-color-1.2.0.tgz#3a5ae74fd76b6267af666e69e2afbbd01def34d1"
dependencies:
ansi-regex "^2.1.1"
d "1"
es5-ext "^0.10.12"
es6-iterator "2"
memoizee "^0.4.3"
timers-ext "0.1"
commander@^2.7.1:
version "2.9.0"
resolved "https://nexus.nsd.no/repository/npm-group/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4"
dependencies:
graceful-readlink ">= 1.0.0"
d@1:
version "1.0.0"
resolved "https://nexus.nsd.no/repository/npm-group/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f"
dependencies:
es5-ext "^0.10.9"
debug@^2.2.0:
version "2.6.6"
resolved "https://nexus.nsd.no/repository/npm-group/debug/-/debug-2.6.6.tgz#a9fa6fbe9ca43cf1e79f73b75c0189cbb7d6db5a"
dependencies:
ms "0.7.3"
es5-ext@^0.10.12, es5-ext@^0.10.13, es5-ext@^0.10.14, es5-ext@^0.10.9, es5-ext@~0.10.14, es5-ext@~0.10.2:
version "0.10.15"
resolved "https://nexus.nsd.no/repository/npm-group/es5-ext/-/es5-ext-0.10.15.tgz#c330a5934c1ee21284a7c081a86e5fd937c91ea6"
dependencies:
es6-iterator "2"
es6-symbol "~3.1"
es6-iterator@2, es6-iterator@^2.0.1:
version "2.0.1"
resolved "https://nexus.nsd.no/repository/npm-group/es6-iterator/-/es6-iterator-2.0.1.tgz#8e319c9f0453bf575d374940a655920e59ca5512"
dependencies:
d "1"
es5-ext "^0.10.14"
es6-symbol "^3.1"
es6-promise@^3.1.2:
version "3.3.1"
resolved "https://nexus.nsd.no/repository/npm-group/es6-promise/-/es6-promise-3.3.1.tgz#a08cdde84ccdbf34d027a1451bc91d4bcd28a613"
es6-symbol@^3.1, es6-symbol@^3.1.1, es6-symbol@~3.1:
version "3.1.1"
resolved "https://nexus.nsd.no/repository/npm-group/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77"
dependencies:
d "1"
es5-ext "~0.10.14"
es6-weak-map@^2.0.1:
version "2.0.2"
resolved "https://nexus.nsd.no/repository/npm-group/es6-weak-map/-/es6-weak-map-2.0.2.tgz#5e3ab32251ffd1538a1f8e5ffa1357772f92d96f"
dependencies:
d "1"
es5-ext "^0.10.14"
es6-iterator "^2.0.1"
es6-symbol "^3.1.1"
esprima@^3.1.1:
version "3.1.3"
resolved "https://nexus.nsd.no/repository/npm-group/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633"
event-emitter@^0.3.4:
version "0.3.5"
resolved "https://nexus.nsd.no/repository/npm-group/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39"
dependencies:
d "1"
es5-ext "~0.10.14"
"graceful-readlink@>= 1.0.0":
version "1.0.1"
resolved "https://nexus.nsd.no/repository/npm-group/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725"
is-promise@^2.1:
version "2.1.0"
resolved "https://nexus.nsd.no/repository/npm-group/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa"
jayschema@^0.3.1:
version "0.3.1"
resolved "https://nexus.nsd.no/repository/npm-group/jayschema/-/jayschema-0.3.1.tgz#76f4769f9b172ef7d5dcde4875b49cb736179b58"
dependencies:
when "~3.4.6"
js-yaml@^3.6.0:
version "3.8.4"
resolved "https://nexus.nsd.no/repository/npm-group/js-yaml/-/js-yaml-3.8.4.tgz#520b4564f86573ba96662af85a8cafa7b4b5a6f6"
dependencies:
argparse "^1.0.7"
esprima "^3.1.1"
json-schema-ref-parser@^3.1.2:
version "3.1.2"
resolved "https://nexus.nsd.no/repository/npm-group/json-schema-ref-parser/-/json-schema-ref-parser-3.1.2.tgz#a38ecb7774f87f32e7eb9723d5921390e76a9a42"
dependencies:
call-me-maybe "^1.0.1"
debug "^2.2.0"
es6-promise "^3.1.2"
js-yaml "^3.6.0"
ono "^2.2.1"
z-schema "^3.17.0"
json-schema-to-typescript@^4.2.0:
version "4.2.0"
resolved "https://nexus.nsd.no/repository/npm-group/json-schema-to-typescript/-/json-schema-to-typescript-4.2.0.tgz#234af1ca3c2ebd22470ab2c4f6f6720dae21f052"
dependencies:
cli-color "^1.2.0"
json-schema-ref-parser "^3.1.2"
json-stringify-safe "^5.0.1"
lodash "^4.17.4"
minimist "^1.2.0"
mz "^2.6.0"
stdin "0.0.1"
json-stringify-safe@^5.0.1:
version "5.0.1"
resolved "https://nexus.nsd.no/repository/npm-group/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
lodash.get@^4.1.2:
version "4.4.2"
resolved "https://nexus.nsd.no/repository/npm-group/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99"
lodash.isequal@^4.4.0:
version "4.5.0"
resolved "https://nexus.nsd.no/repository/npm-group/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0"
lodash@^4.17.4:
version "4.17.4"
resolved "https://nexus.nsd.no/repository/npm-group/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
lru-queue@0.1:
version "0.1.0"
resolved "https://nexus.nsd.no/repository/npm-group/lru-queue/-/lru-queue-0.1.0.tgz#2738bd9f0d3cf4f84490c5736c48699ac632cda3"
dependencies:
es5-ext "~0.10.2"
memoizee@^0.4.3:
version "0.4.4"
resolved "https://nexus.nsd.no/repository/npm-group/memoizee/-/memoizee-0.4.4.tgz#ecf4b791a09cd11c970203f80682534730fad78f"
dependencies:
d "1"
es5-ext "^0.10.13"
es6-weak-map "^2.0.1"
event-emitter "^0.3.4"
is-promise "^2.1"
lru-queue "0.1"
next-tick "1"
timers-ext "0.1"
minimist@^1.2.0:
version "1.2.0"
resolved "https://nexus.nsd.no/repository/npm-group/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
ms@0.7.3:
version "0.7.3"
resolved "https://nexus.nsd.no/repository/npm-group/ms/-/ms-0.7.3.tgz#708155a5e44e33f5fd0fc53e81d0d40a91be1fff"
mz@^2.6.0:
version "2.6.0"
resolved "https://nexus.nsd.no/repository/npm-group/mz/-/mz-2.6.0.tgz#c8b8521d958df0a4f2768025db69c719ee4ef1ce"
dependencies:
any-promise "^1.0.0"
object-assign "^4.0.1"
thenify-all "^1.0.0"
next-tick@1:
version "1.0.0"
resolved "https://nexus.nsd.no/repository/npm-group/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c"
object-assign@^4.0.1:
version "4.1.1"
resolved "https://nexus.nsd.no/repository/npm-group/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
ono@^2.2.1:
version "2.2.4"
resolved "https://nexus.nsd.no/repository/npm-group/ono/-/ono-2.2.4.tgz#f6c1d9ea64da07a54863986535da3de67e502696"
sprintf-js@~1.0.2:
version "1.0.3"
resolved "https://nexus.nsd.no/repository/npm-group/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
stdin@0.0.1:
version "0.0.1"
resolved "https://nexus.nsd.no/repository/npm-group/stdin/-/stdin-0.0.1.tgz#d3041981aaec3dfdbc77a1b38d6372e38f5fb71e"
thenify-all@^1.0.0:
version "1.6.0"
resolved "https://nexus.nsd.no/repository/npm-group/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726"
dependencies:
thenify ">= 3.1.0 < 4"
"thenify@>= 3.1.0 < 4":
version "3.2.1"
resolved "https://nexus.nsd.no/repository/npm-group/thenify/-/thenify-3.2.1.tgz#251fd1c80aff6e5cf57cb179ab1fcb724269bd11"
dependencies:
any-promise "^1.0.0"
timers-ext@0.1:
version "0.1.2"
resolved "https://nexus.nsd.no/repository/npm-group/timers-ext/-/timers-ext-0.1.2.tgz#61cc47a76c1abd3195f14527f978d58ae94c5204"
dependencies:
es5-ext "~0.10.14"
next-tick "1"
validator@^6.0.0:
version "6.3.0"
resolved "https://nexus.nsd.no/repository/npm-group/validator/-/validator-6.3.0.tgz#47ce23ed8d4eaddfa9d4b8ef0071b6cf1078d7c8"
when@~3.4.6:
version "3.4.6"
resolved "https://nexus.nsd.no/repository/npm-group/when/-/when-3.4.6.tgz#8fbcb7cc1439d2c3a68c431f1516e6dcce9ad28c"
z-schema@^3.17.0:
version "3.18.2"
resolved "https://nexus.nsd.no/repository/npm-group/z-schema/-/z-schema-3.18.2.tgz#e422196b5efe60b46adef3c3f2aef2deaa911161"
dependencies:
lodash.get "^4.1.2"
lodash.isequal "^4.4.0"
validator "^6.0.0"
optionalDependencies:
commander "^2.7.1"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment