Upgrade to latest peechy

This commit is contained in:
Jarred Sumner
2021-10-24 16:48:47 -07:00
parent c93655c717
commit 2dcb465d50
7 changed files with 4943 additions and 4942 deletions

View File

@@ -354,7 +354,10 @@ bin-dir:
@echo $(BIN_DIR)
api:
npm install; ./node_modules/.bin/peechy --schema src/api/schema.peechy --esm src/api/schema.js --ts src/api/schema.d.ts --zig src/api/schema.zig
pnpm install; ./node_modules/.bin/peechy --schema src/api/schema.peechy --esm src/api/schema.js --ts src/api/schema.d.ts --zig src/api/schema.zig
zig fmt src/api/schema.zig
prettier --write src/api/schema.js
prettier --write src/api/schema.d.ts
node-fallbacks:
@cd src/node-fallbacks; npm install; npm run --silent build
@@ -601,7 +604,8 @@ picohttp:
$(CC) -march=native -O3 -g -fPIE -c src/deps/picohttpparser/picohttpparser.c -Isrc/deps -o src/deps/picohttpparser.o; cd ../../
analytics:
./node_modules/.bin/peechy --schema src/analytics/schema.peechy --zig src/analytics/analytics_schema.zig
./node_modules/.bin/peechy --schema src/analytics/schema.peechy --zig src/analytics/analytics_schema.zig
zig fmt src/analytics/analytics_schema.zig
analytics-features:
@cd misctools; zig run --main-pkg-path ../ ./features.zig

View File

@@ -1,7 +1,7 @@
{
"dependencies": {
"moment": "^2.29.1",
"peechy": "^0.4.19",
"peechy": "0.4.20",
"puppeteer": "^10.2.0",
"react": "^17.0.2",
"react-dom": "^17.0.2"

709
pnpm-lock.yaml generated
View File

@@ -1,238 +1,69 @@
lockfileVersion: 5.3
specifiers:
'@babel/preset-react': ^7.13.13
'@swc/cli': ^0.1.39
'@swc/core': ^1.2.55
'@swc/wasm': ^1.2.54
esbuild-wasm: ^0.11.19
'@types/node': ^16.9.2
'@types/puppeteer': ^5.4.4
moment: ^2.29.1
peechy: 0.4.20
puppeteer: ^10.2.0
react: ^17.0.2
react-dom: ^17.0.2
dependencies:
'@babel/preset-react': 7.13.13
'@swc/cli': 0.1.39_@swc+core@1.2.55
'@swc/core': 1.2.55
'@swc/wasm': 1.2.55
esbuild-wasm: 0.11.19
moment: 2.29.1
peechy: 0.4.20
puppeteer: 10.4.0
react: 17.0.2
react-dom: 17.0.2_react@17.0.2
devDependencies:
'@types/node': 16.11.4
'@types/puppeteer': 5.4.4
packages:
/@babel/helper-annotate-as-pure/7.12.13:
resolution: {integrity: sha512-7YXfX5wQ5aYM/BOlbSccHDbuXXFPxeoUmfWtz8le2yTkTZc+BxsiEnENFoi2SlmA8ewDkG2LgIMIVzzn2h8kfw==}
/@types/node/16.11.4:
resolution: {integrity: sha512-TMgXmy0v2xWyuCSCJM6NCna2snndD8yvQF67J29ipdzMcsPa9u+o0tjF5+EQNdhcuZplYuouYqpc4zcd5I6amQ==}
/@types/puppeteer/5.4.4:
resolution: {integrity: sha512-3Nau+qi69CN55VwZb0ATtdUAlYlqOOQ3OfQfq0Hqgc4JMFXiQT/XInlwQ9g6LbicDslE6loIFsXFklGh5XmI6Q==}
dependencies:
'@babel/types': 7.14.1
dev: false
'@types/node': 16.11.4
dev: true
/@babel/helper-module-imports/7.13.12:
resolution: {integrity: sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA==}
/@types/yauzl/2.9.2:
resolution: {integrity: sha512-8uALY5LTvSuHgloDVUvWP3pIauILm+8/0pDMokuDYIoNsOkSwd5AiHBTSEJjKTDcZr5z8UpgOWZkxBF4iJftoA==}
requiresBuild: true
dependencies:
'@babel/types': 7.14.1
dev: false
/@babel/helper-plugin-utils/7.13.0:
resolution: {integrity: sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==}
dev: false
/@babel/helper-validator-identifier/7.14.0:
resolution: {integrity: sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==}
dev: false
/@babel/helper-validator-option/7.12.17:
resolution: {integrity: sha512-TopkMDmLzq8ngChwRlyjR6raKD6gMSae4JdYDB8bByKreQgG0RBTuKe9LRxW3wFtUnjxOPRKBDwEH6Mg5KeDfw==}
dev: false
/@babel/plugin-syntax-jsx/7.12.13:
resolution: {integrity: sha512-d4HM23Q1K7oq/SLNmG6mRt85l2csmQ0cHRaxRXjKW0YFdEXqlZ5kzFQKH5Uc3rDJECgu+yCRgPkG04Mm98R/1g==}
peerDependencies:
'@babel/core': ^7.0.0-0
dependencies:
'@babel/helper-plugin-utils': 7.13.0
dev: false
/@babel/plugin-transform-react-display-name/7.12.13:
resolution: {integrity: sha512-MprESJzI9O5VnJZrL7gg1MpdqmiFcUv41Jc7SahxYsNP2kDkFqClxxTZq+1Qv4AFCamm+GXMRDQINNn+qrxmiA==}
peerDependencies:
'@babel/core': ^7.0.0-0
dependencies:
'@babel/helper-plugin-utils': 7.13.0
dev: false
/@babel/plugin-transform-react-jsx-development/7.12.17:
resolution: {integrity: sha512-BPjYV86SVuOaudFhsJR1zjgxxOhJDt6JHNoD48DxWEIxUCAMjV1ys6DYw4SDYZh0b1QsS2vfIA9t/ZsQGsDOUQ==}
peerDependencies:
'@babel/core': ^7.0.0-0
dependencies:
'@babel/plugin-transform-react-jsx': 7.13.12
dev: false
/@babel/plugin-transform-react-jsx/7.13.12:
resolution: {integrity: sha512-jcEI2UqIcpCqB5U5DRxIl0tQEProI2gcu+g8VTIqxLO5Iidojb4d77q+fwGseCvd8af/lJ9masp4QWzBXFE2xA==}
peerDependencies:
'@babel/core': ^7.0.0-0
dependencies:
'@babel/helper-annotate-as-pure': 7.12.13
'@babel/helper-module-imports': 7.13.12
'@babel/helper-plugin-utils': 7.13.0
'@babel/plugin-syntax-jsx': 7.12.13
'@babel/types': 7.14.1
dev: false
/@babel/plugin-transform-react-pure-annotations/7.12.1:
resolution: {integrity: sha512-RqeaHiwZtphSIUZ5I85PEH19LOSzxfuEazoY7/pWASCAIBuATQzpSVD+eT6MebeeZT2F4eSL0u4vw6n4Nm0Mjg==}
peerDependencies:
'@babel/core': ^7.0.0-0
dependencies:
'@babel/helper-annotate-as-pure': 7.12.13
'@babel/helper-plugin-utils': 7.13.0
dev: false
/@babel/preset-react/7.13.13:
resolution: {integrity: sha512-gx+tDLIE06sRjKJkVtpZ/t3mzCDOnPG+ggHZG9lffUbX8+wC739x20YQc9V35Do6ZAxaUc/HhVHIiOzz5MvDmA==}
peerDependencies:
'@babel/core': ^7.0.0-0
dependencies:
'@babel/helper-plugin-utils': 7.13.0
'@babel/helper-validator-option': 7.12.17
'@babel/plugin-transform-react-display-name': 7.12.13
'@babel/plugin-transform-react-jsx': 7.13.12
'@babel/plugin-transform-react-jsx-development': 7.12.17
'@babel/plugin-transform-react-pure-annotations': 7.12.1
dev: false
/@babel/types/7.14.1:
resolution: {integrity: sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==}
dependencies:
'@babel/helper-validator-identifier': 7.14.0
to-fast-properties: 2.0.0
dev: false
/@napi-rs/triples/1.0.2:
resolution: {integrity: sha512-EL3SiX43m9poFSnhDx4d4fn9SSaqyO2rHsCNhETi9bWPmjXK3uPJ0QpPFtx39FEdHcz1vJmsiW41kqc0AgvtzQ==}
dev: false
/@node-rs/helper/1.1.0:
resolution: {integrity: sha512-r43YnnrY5JNzDuXJdW3sBJrKzvejvFmFWbiItUEoBJsaPzOIWFMhXB7i5j4c9EMXcFfxveF4l7hT+rLmwtjrVQ==}
dependencies:
'@napi-rs/triples': 1.0.2
tslib: 2.2.0
dev: false
/@swc/cli/0.1.39_@swc+core@1.2.55:
resolution: {integrity: sha512-qTI+HIjSgKUJUKZ3xGA6zAEkHryirmKrzj4zWrCg4FQnAEFGPOIx58/qRs3aURSOS3BnbVE33sqAxEN+v8qZpw==}
engines: {node: '>= 12.13'}
hasBin: true
peerDependencies:
'@swc/core': ^1.2.4
chokidar: ^3.0.0
peerDependenciesMeta:
chokidar:
optional: true
dependencies:
'@swc/core': 1.2.55
commander: 7.2.0
convert-source-map: 1.7.0
glob: 7.1.7
lodash: 4.17.21
slash: 3.0.0
source-map: 0.7.3
dev: false
/@swc/core-android-arm64/1.2.56:
resolution: {integrity: sha512-yXiqbuEnpotpYdGL8rFvRQzkK7JQ1rhZAdGTcCvwUF7L8Ujm1NxJlrNaiMiK7uKvCYOynwe32Ddykaew8ggEFQ==}
engines: {node: '>=10'}
cpu: [arm64]
os: [android]
'@types/node': 16.11.4
dev: false
optional: true
/@swc/core-darwin-arm64/1.2.56:
resolution: {integrity: sha512-Ub74q6rKxJy909mXoBJQ7dF5dUJnqrq3XpGHWexv3WUr7C/sTbcwZDwgFMqgDHOf0TSPTge+qwPNOIxcSYv/Kg==}
engines: {node: '>=10'}
cpu: [arm64]
os: [darwin]
dev: false
optional: true
/@swc/core-darwin-x64/1.2.56:
resolution: {integrity: sha512-vxHo9eAyEVykTXM9tJGOYdlsxWq43po5mDeB1dEEjdwefpRCeV+xv3xL6GfVxoVn26w+LZgT4R+BpP0Hx7kATQ==}
engines: {node: '>=10'}
cpu: [x64]
os: [darwin]
dev: false
optional: true
/@swc/core-linux-arm-gnueabihf/1.2.56:
resolution: {integrity: sha512-Chmj/OQB1ie/UY5Cdt9e8VkUTE5lDAPGg4eN2O71j0UlZux3TwR+L/tiGuS9S87lqF9qtZAmZ+WTldeiVFdVqQ==}
engines: {node: '>=10'}
cpu: [arm]
os: [linux]
dev: false
optional: true
/@swc/core-linux-arm64-gnu/1.2.56:
resolution: {integrity: sha512-WCze10brrFmWrJUKmmZVQPfgVnfkvfXbKbs24cgjFSzsV2iBZ4/NVqe+5covYTOkaFvnrqERHqq+ntm1wjDT1A==}
engines: {node: '>=10'}
cpu: [arm64]
os: [linux]
dev: false
optional: true
/@swc/core-linux-x64-gnu/1.2.56:
resolution: {integrity: sha512-B+Rr6NXUNe8RmgBNEh3ATZt77muFssaXbzIYTn+Yovw/s+xh27TFHaoZkfKJFNY/uWxL3S22ZVAxv5ugwS4++g==}
engines: {node: '>=10'}
cpu: [x64]
os: [linux]
dev: false
optional: true
/@swc/core-linux-x64-musl/1.2.56:
resolution: {integrity: sha512-W1BA8Zjz4pkFmAg3PqKsdTyySkJcUiPWi18Ok0qBx2xemgkEKpERpwI51NwWm3YQUSJKTH2MFiwfDLtCE+Ieng==}
engines: {node: '>=10'}
cpu: [x64]
os: [linux]
dev: false
optional: true
/@swc/core-win32-ia32-msvc/1.2.56:
resolution: {integrity: sha512-sSpruAaA3y0CXO1yMPfDxo4p9wtrS7cVOM7P9IryKIUGZBtoM3U0W2NAUE3h5GNrx7xv2GBxqtzfoYW6I8T9bw==}
engines: {node: '>=10'}
cpu: [ia32]
os: [win32]
dev: false
optional: true
/@swc/core-win32-x64-msvc/1.2.56:
resolution: {integrity: sha512-eSqajMZ6fAfHAy1h9Bh8oN90faCy3zsj3VcgjhEbJQnjUIN32eOLlWb70pAb58ckP+c2pBejaRuRElVjaViVjw==}
engines: {node: '>=10'}
cpu: [x64]
os: [win32]
dev: false
optional: true
/@swc/core/1.2.55:
resolution: {integrity: sha512-ZtyxJ0IT0dv4jq0oPrlQytRN9HoSocT5Xig6y/Yx28uFRGJOlqaP1NrkNyZhB65c29gwXoedxN54uVqmXe+aFQ==}
engines: {node: '>=10'}
/agent-base/6.0.2:
resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==}
engines: {node: '>= 6.0.0'}
dependencies:
'@node-rs/helper': 1.1.0
optionalDependencies:
'@swc/core-android-arm64': 1.2.56
'@swc/core-darwin-arm64': 1.2.56
'@swc/core-darwin-x64': 1.2.56
'@swc/core-linux-arm-gnueabihf': 1.2.56
'@swc/core-linux-arm64-gnu': 1.2.56
'@swc/core-linux-x64-gnu': 1.2.56
'@swc/core-linux-x64-musl': 1.2.56
'@swc/core-win32-ia32-msvc': 1.2.56
'@swc/core-win32-x64-msvc': 1.2.56
dev: false
/@swc/wasm/1.2.55:
resolution: {integrity: sha512-otrxYNDmKSKVK8QVsGynACyvSL8XOYYXsh7cyaXPSKGnTTPjeWhYvI1d5uFnZyASfFXUpk1eFEE6AMJWIwKJhA==}
debug: 4.3.1
transitivePeerDependencies:
- supports-color
dev: false
/balanced-match/1.0.2:
resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
dev: false
/base64-js/1.5.1:
resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==}
dev: false
/bl/4.1.0:
resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==}
dependencies:
buffer: 5.7.1
inherits: 2.0.4
readable-stream: 3.6.0
dev: false
/brace-expansion/1.1.11:
resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==}
dependencies:
@@ -240,33 +71,139 @@ packages:
concat-map: 0.0.1
dev: false
/commander/7.2.0:
resolution: {integrity: sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==}
engines: {node: '>= 10'}
/buffer-crc32/0.2.13:
resolution: {integrity: sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=}
dev: false
/buffer/5.7.1:
resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==}
dependencies:
base64-js: 1.5.1
ieee754: 1.2.1
dev: false
/camel-case/4.1.2:
resolution: {integrity: sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==}
dependencies:
pascal-case: 3.1.2
tslib: 2.3.1
dev: false
/capital-case/1.0.4:
resolution: {integrity: sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==}
dependencies:
no-case: 3.0.4
tslib: 2.3.1
upper-case-first: 2.0.2
dev: false
/change-case/4.1.2:
resolution: {integrity: sha512-bSxY2ws9OtviILG1EiY5K7NNxkqg/JnRnFxLtKQ96JaviiIxi7djMrSd0ECT9AC+lttClmYwKw53BWpOMblo7A==}
dependencies:
camel-case: 4.1.2
capital-case: 1.0.4
constant-case: 3.0.4
dot-case: 3.0.4
header-case: 2.0.4
no-case: 3.0.4
param-case: 3.0.4
pascal-case: 3.1.2
path-case: 3.0.4
sentence-case: 3.0.4
snake-case: 3.0.4
tslib: 2.3.1
dev: false
/chownr/1.1.4:
resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==}
dev: false
/concat-map/0.0.1:
resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=}
dev: false
/convert-source-map/1.7.0:
resolution: {integrity: sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==}
/constant-case/3.0.4:
resolution: {integrity: sha512-I2hSBi7Vvs7BEuJDr5dDHfzb/Ruj3FyvFyh7KLilAjNQw3Be+xgqUBA2W6scVEcL0hL1dwPRtIqEPVUCKkSsyQ==}
dependencies:
safe-buffer: 5.1.2
no-case: 3.0.4
tslib: 2.3.1
upper-case: 2.0.2
dev: false
/esbuild-wasm/0.11.19:
resolution: {integrity: sha512-d4s3fcIBG9CL/h5kKfXHpkztyMhs71anqdszND1Zfr4na1bhMGAb+VyEMBbt2/0ft5HtcsOYBqXsjNPNWTC29w==}
engines: {node: '>=8'}
/debug/4.3.1:
resolution: {integrity: sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==}
engines: {node: '>=6.0'}
peerDependencies:
supports-color: '*'
peerDependenciesMeta:
supports-color:
optional: true
dependencies:
ms: 2.1.2
dev: false
/devtools-protocol/0.0.901419:
resolution: {integrity: sha512-4INMPwNm9XRpBukhNbF7OB6fNTTCaI8pzy/fXg0xQzAy5h3zL1P8xT3QazgKqBrb/hAYwIBizqDBZ7GtJE74QQ==}
dev: false
/dot-case/3.0.4:
resolution: {integrity: sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==}
dependencies:
no-case: 3.0.4
tslib: 2.3.1
dev: false
/end-of-stream/1.4.4:
resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==}
dependencies:
once: 1.4.0
dev: false
/extract-zip/2.0.1:
resolution: {integrity: sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==}
engines: {node: '>= 10.17.0'}
hasBin: true
dependencies:
debug: 4.3.1
get-stream: 5.2.0
yauzl: 2.10.0
optionalDependencies:
'@types/yauzl': 2.9.2
transitivePeerDependencies:
- supports-color
dev: false
/fd-slicer/1.1.0:
resolution: {integrity: sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=}
dependencies:
pend: 1.2.0
dev: false
/find-up/4.1.0:
resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==}
engines: {node: '>=8'}
dependencies:
locate-path: 5.0.0
path-exists: 4.0.0
dev: false
/fs-constants/1.0.0:
resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==}
dev: false
/fs.realpath/1.0.0:
resolution: {integrity: sha1-FQStJSMVjKpA20onh8sBQRmU6k8=}
dev: false
/glob/7.1.7:
resolution: {integrity: sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==}
/get-stream/5.2.0:
resolution: {integrity: sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==}
engines: {node: '>=8'}
dependencies:
pump: 3.0.0
dev: false
/glob/7.2.0:
resolution: {integrity: sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==}
dependencies:
fs.realpath: 1.0.0
inflight: 1.0.6
@@ -276,6 +213,27 @@ packages:
path-is-absolute: 1.0.1
dev: false
/header-case/2.0.4:
resolution: {integrity: sha512-H/vuk5TEEVZwrR0lp2zed9OCo1uAILMlx0JEMgC26rzyJJ3N1v6XkwHHXJQdR2doSjcGPM6OKPYoJgf0plJ11Q==}
dependencies:
capital-case: 1.0.4
tslib: 2.3.1
dev: false
/https-proxy-agent/5.0.0:
resolution: {integrity: sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==}
engines: {node: '>= 6'}
dependencies:
agent-base: 6.0.2
debug: 4.3.1
transitivePeerDependencies:
- supports-color
dev: false
/ieee754/1.2.1:
resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==}
dev: false
/inflight/1.0.6:
resolution: {integrity: sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=}
dependencies:
@@ -287,8 +245,28 @@ packages:
resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==}
dev: false
/lodash/4.17.21:
resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==}
/js-tokens/4.0.0:
resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}
dev: false
/locate-path/5.0.0:
resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==}
engines: {node: '>=8'}
dependencies:
p-locate: 4.1.0
dev: false
/loose-envify/1.4.0:
resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==}
hasBin: true
dependencies:
js-tokens: 4.0.0
dev: false
/lower-case/2.0.2:
resolution: {integrity: sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==}
dependencies:
tslib: 2.3.1
dev: false
/minimatch/3.0.4:
@@ -297,40 +275,293 @@ packages:
brace-expansion: 1.1.11
dev: false
/minimist/1.2.5:
resolution: {integrity: sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==}
dev: false
/mkdirp/0.5.5:
resolution: {integrity: sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==}
hasBin: true
dependencies:
minimist: 1.2.5
dev: false
/moment/2.29.1:
resolution: {integrity: sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==}
dev: false
/ms/2.1.2:
resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==}
dev: false
/no-case/3.0.4:
resolution: {integrity: sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==}
dependencies:
lower-case: 2.0.2
tslib: 2.3.1
dev: false
/node-fetch/2.6.1:
resolution: {integrity: sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==}
engines: {node: 4.x || >=6.0.0}
dev: false
/object-assign/4.1.1:
resolution: {integrity: sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=}
engines: {node: '>=0.10.0'}
dev: false
/once/1.4.0:
resolution: {integrity: sha1-WDsap3WWHUsROsF9nFC6753Xa9E=}
dependencies:
wrappy: 1.0.2
dev: false
/p-limit/2.3.0:
resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==}
engines: {node: '>=6'}
dependencies:
p-try: 2.2.0
dev: false
/p-locate/4.1.0:
resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==}
engines: {node: '>=8'}
dependencies:
p-limit: 2.3.0
dev: false
/p-try/2.2.0:
resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==}
engines: {node: '>=6'}
dev: false
/param-case/3.0.4:
resolution: {integrity: sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==}
dependencies:
dot-case: 3.0.4
tslib: 2.3.1
dev: false
/pascal-case/3.1.2:
resolution: {integrity: sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==}
dependencies:
no-case: 3.0.4
tslib: 2.3.1
dev: false
/path-case/3.0.4:
resolution: {integrity: sha512-qO4qCFjXqVTrcbPt/hQfhTQ+VhFsqNKOPtytgNKkKxSoEp3XPUQ8ObFuePylOIok5gjn69ry8XiULxCwot3Wfg==}
dependencies:
dot-case: 3.0.4
tslib: 2.3.1
dev: false
/path-exists/4.0.0:
resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==}
engines: {node: '>=8'}
dev: false
/path-is-absolute/1.0.1:
resolution: {integrity: sha1-F0uSaHNVNP+8es5r9TpanhtcX18=}
engines: {node: '>=0.10.0'}
dev: false
/safe-buffer/5.1.2:
resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==}
/peechy/0.4.20:
resolution: {integrity: sha512-/BXMgfEiU3gB2acIiUrUx8DCQfVdEZbgVMj1SC8TXgyWhNRFCEQWaaLw8BDsnzemlGlM1OVMnTlO0E42P1RC5g==}
hasBin: true
dependencies:
change-case: 4.1.2
dev: false
/slash/3.0.0:
resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==}
/pend/1.2.0:
resolution: {integrity: sha1-elfrVQpng/kRUzH89GY9XI4AelA=}
dev: false
/pkg-dir/4.2.0:
resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==}
engines: {node: '>=8'}
dependencies:
find-up: 4.1.0
dev: false
/source-map/0.7.3:
resolution: {integrity: sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==}
engines: {node: '>= 8'}
/progress/2.0.1:
resolution: {integrity: sha512-OE+a6vzqazc+K6LxJrX5UPyKFvGnL5CYmq2jFGNIBWHpc4QyE49/YOumcrpQFJpfejmvRtbJzgO1zPmMCqlbBg==}
engines: {node: '>=0.4.0'}
dev: false
/to-fast-properties/2.0.0:
resolution: {integrity: sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=}
engines: {node: '>=4'}
/proxy-from-env/1.1.0:
resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==}
dev: false
/tslib/2.2.0:
resolution: {integrity: sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==}
/pump/3.0.0:
resolution: {integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==}
dependencies:
end-of-stream: 1.4.4
once: 1.4.0
dev: false
/puppeteer/10.4.0:
resolution: {integrity: sha512-2cP8mBoqnu5gzAVpbZ0fRaobBWZM8GEUF4I1F6WbgHrKV/rz7SX8PG2wMymZgD0wo0UBlg2FBPNxlF/xlqW6+w==}
engines: {node: '>=10.18.1'}
requiresBuild: true
dependencies:
debug: 4.3.1
devtools-protocol: 0.0.901419
extract-zip: 2.0.1
https-proxy-agent: 5.0.0
node-fetch: 2.6.1
pkg-dir: 4.2.0
progress: 2.0.1
proxy-from-env: 1.1.0
rimraf: 3.0.2
tar-fs: 2.0.0
unbzip2-stream: 1.3.3
ws: 7.4.6
transitivePeerDependencies:
- bufferutil
- supports-color
- utf-8-validate
dev: false
/react-dom/17.0.2_react@17.0.2:
resolution: {integrity: sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==}
peerDependencies:
react: 17.0.2
dependencies:
loose-envify: 1.4.0
object-assign: 4.1.1
react: 17.0.2
scheduler: 0.20.2
dev: false
/react/17.0.2:
resolution: {integrity: sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==}
engines: {node: '>=0.10.0'}
dependencies:
loose-envify: 1.4.0
object-assign: 4.1.1
dev: false
/readable-stream/3.6.0:
resolution: {integrity: sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==}
engines: {node: '>= 6'}
dependencies:
inherits: 2.0.4
string_decoder: 1.3.0
util-deprecate: 1.0.2
dev: false
/rimraf/3.0.2:
resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==}
hasBin: true
dependencies:
glob: 7.2.0
dev: false
/safe-buffer/5.2.1:
resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==}
dev: false
/scheduler/0.20.2:
resolution: {integrity: sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==}
dependencies:
loose-envify: 1.4.0
object-assign: 4.1.1
dev: false
/sentence-case/3.0.4:
resolution: {integrity: sha512-8LS0JInaQMCRoQ7YUytAo/xUu5W2XnQxV2HI/6uM6U7CITS1RqPElr30V6uIqyMKM9lJGRVFy5/4CuzcixNYSg==}
dependencies:
no-case: 3.0.4
tslib: 2.3.1
upper-case-first: 2.0.2
dev: false
/snake-case/3.0.4:
resolution: {integrity: sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==}
dependencies:
dot-case: 3.0.4
tslib: 2.3.1
dev: false
/string_decoder/1.3.0:
resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==}
dependencies:
safe-buffer: 5.2.1
dev: false
/tar-fs/2.0.0:
resolution: {integrity: sha512-vaY0obB6Om/fso8a8vakQBzwholQ7v5+uy+tF3Ozvxv1KNezmVQAiWtcNmMHFSFPqL3dJA8ha6gdtFbfX9mcxA==}
dependencies:
chownr: 1.1.4
mkdirp: 0.5.5
pump: 3.0.0
tar-stream: 2.2.0
dev: false
/tar-stream/2.2.0:
resolution: {integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==}
engines: {node: '>=6'}
dependencies:
bl: 4.1.0
end-of-stream: 1.4.4
fs-constants: 1.0.0
inherits: 2.0.4
readable-stream: 3.6.0
dev: false
/through/2.3.8:
resolution: {integrity: sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=}
dev: false
/tslib/2.3.1:
resolution: {integrity: sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==}
dev: false
/unbzip2-stream/1.3.3:
resolution: {integrity: sha512-fUlAF7U9Ah1Q6EieQ4x4zLNejrRvDWUYmxXUpN3uziFYCHapjWFaCAnreY9bGgxzaMCFAPPpYNng57CypwJVhg==}
dependencies:
buffer: 5.7.1
through: 2.3.8
dev: false
/upper-case-first/2.0.2:
resolution: {integrity: sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==}
dependencies:
tslib: 2.3.1
dev: false
/upper-case/2.0.2:
resolution: {integrity: sha512-KgdgDGJt2TpuwBUIjgG6lzw2GWFRCW9Qkfkiv0DxqHHLYJHmtmdUIKcZd8rHgFSjopVTlw6ggzCm1b8MFQwikg==}
dependencies:
tslib: 2.3.1
dev: false
/util-deprecate/1.0.2:
resolution: {integrity: sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=}
dev: false
/wrappy/1.0.2:
resolution: {integrity: sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=}
dev: false
/ws/7.4.6:
resolution: {integrity: sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==}
engines: {node: '>=8.3.0'}
peerDependencies:
bufferutil: ^4.0.1
utf-8-validate: ^5.0.2
peerDependenciesMeta:
bufferutil:
optional: true
utf-8-validate:
optional: true
dev: false
/yauzl/2.10.0:
resolution: {integrity: sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=}
dependencies:
buffer-crc32: 0.2.13
fd-slicer: 1.1.0
dev: false

View File

@@ -1,4 +1,3 @@
const std = @import("std");
pub const Reader = struct {
@@ -18,7 +17,7 @@ pub const Reader = struct {
}
pub fn read(this: *Self, count: usize) ![]u8 {
const read_count = std.math.min(count, this.remain.len);
const read_count = @minimum(count, this.remain.len);
if (read_count < count) {
return error.EOF;
}
@@ -30,7 +29,7 @@ pub const Reader = struct {
return slice;
}
pub fn readAs(this: *Self, comptime T: type) !T {
pub inline fn readAs(this: *Self, comptime T: type) !T {
if (!std.meta.trait.hasUniqueRepresentation(T)) {
@compileError(@typeName(T) ++ " must have unique representation.");
}
@@ -38,7 +37,7 @@ pub const Reader = struct {
return std.mem.bytesAsValue(T, try this.read(@sizeOf(T)));
}
pub fn readByte(this: *Self) !u8 {
pub inline fn readByte(this: *Self) !u8 {
return (try this.read(1))[0];
}
@@ -59,29 +58,29 @@ pub const Reader = struct {
return E.InvalidValue;
}
pub fn readArray(this: *Self, comptime T: type) ![]const T {
pub inline fn readArray(this: *Self, comptime T: type) ![]const T {
const length = try this.readInt(u32);
if (length == 0) {
return &([_]T{});
}
switch (T) {
switch (comptime T) {
u8 => {
return try this.read(length);
},
u16, u32, i8, i16, i32 => {
return std.mem.readIntSliceNative(T, this.read(length * @sizeOf(T)));
},
[]const u8 => {
[:0]const u8, []const u8 => {
var i: u32 = 0;
var array = try this.allocator.alloc([]const u8, length);
var array = try this.allocator.alloc(T, length);
while (i < length) : (i += 1) {
array[i] = try this.readArray(u8);
}
return array;
},
else => {
switch (@typeInfo(T)) {
switch (comptime @typeInfo(T)) {
.Struct => |Struct| {
switch (Struct.layout) {
.Packed => {
@@ -110,48 +109,48 @@ pub const Reader = struct {
}
}
pub fn readByteArray(this: *Self) ![]u8 {
pub inline fn readByteArray(this: *Self) ![]u8 {
const length = try this.readInt(u32);
if (length == 0) {
return &([_]u8{});
}
return try this.read(@intCast(usize, length));
return try this.read(@as(usize, length));
}
pub fn readInt(this: *Self, comptime T: type) !T {
pub inline fn readInt(this: *Self, comptime T: type) !T {
var slice = try this.read(@sizeOf(T));
return std.mem.readIntSliceNative(T, slice);
}
pub fn readBool(this: *Self) !bool {
pub inline fn readBool(this: *Self) !bool {
return (try this.readByte()) > 0;
}
pub fn readValue(this: *Self, comptime T: type) !T {
switch (T) {
pub inline fn readValue(this: *Self, comptime T: type) !T {
switch (comptime T) {
bool => {
return try this.readBool();
},
u8 => {
return try this.readByte();
},
[]const u8 => {
[*:0]const u8, [:0]const u8, []const u8 => {
return try this.readArray(u8);
},
[]const []const u8 => {
[]const [:0]const u8, []const [*:0]const u8, []const []const u8 => {
return try this.readArray([]const u8);
},
[]u8 => {
[]u8, [:0]u8, [*:0]u8 => {
return try this.readArray([]u8);
},
u16, u32, i8, i16, i32 => {
return std.mem.readIntSliceNative(T, try this.read(@sizeOf(T)));
},
else => {
switch (@typeInfo(T)) {
switch (comptime @typeInfo(T)) {
.Struct => |Struct| {
switch (Struct.layout) {
.Packed => {
@@ -185,28 +184,28 @@ pub fn Writer(comptime WritableStream: type) type {
return Self{ .writable = writable };
}
pub fn write(this: *Self, bytes: anytype) !void {
pub inline fn write(this: *Self, bytes: anytype) !void {
_ = try this.writable.write(bytes);
}
pub fn writeByte(this: *Self, byte: u8) !void {
pub inline fn writeByte(this: *Self, byte: u8) !void {
_ = try this.writable.write(&[1]u8{byte});
}
pub fn writeInt(this: *Self, int: anytype) !void {
pub inline fn writeInt(this: *Self, int: anytype) !void {
try this.write(std.mem.asBytes(&int));
}
pub fn writeFieldID(this: *Self, comptime id: comptime_int) !void {
pub inline fn writeFieldID(this: *Self, comptime id: comptime_int) !void {
try this.writeByte(id);
}
pub fn writeEnum(this: *Self, val: anytype) !void {
pub inline fn writeEnum(this: *Self, val: anytype) !void {
try this.writeInt(@enumToInt(val));
}
pub fn writeValue(this: *Self, slice: anytype) !void {
switch (@TypeOf(slice)) {
pub fn writeValue(this: *Self, comptime SliceType: type, slice: SliceType) !void {
switch (SliceType) {
[]u16,
[]u32,
[]i16,
@@ -217,11 +216,37 @@ pub fn Writer(comptime WritableStream: type) type {
[]const i16,
[]const i32,
[]const i8,
[:0]u16,
[:0]u32,
[:0]i16,
[:0]i32,
[:0]i8,
[:0]const u16,
[:0]const u32,
[:0]const i16,
[:0]const i32,
[:0]const i8,
[*:0]u16,
[*:0]u32,
[*:0]i16,
[*:0]i32,
[*:0]i8,
[*:0]const u16,
[*:0]const u32,
[*:0]const i16,
[*:0]const i32,
[*:0]const i8,
=> {
try this.writeArray(@TypeOf(slice), slice);
try this.writeArray(SliceType, slice);
},
[]u8, []const u8 => {
[]u8,
[]const u8,
[:0]u8,
[:0]const u8,
[*:0]u8,
[*:0]const u8,
=> {
try this.writeArray(u8, slice);
},
@@ -238,7 +263,7 @@ pub fn Writer(comptime WritableStream: type) type {
}
}
pub fn writeArray(this: *Self, comptime T: type, slice: anytype) !void {
pub inline fn writeArray(this: *Self, comptime T: type, slice: anytype) !void {
try this.writeInt(@truncate(u32, slice.len));
switch (T) {
@@ -248,6 +273,7 @@ pub fn Writer(comptime WritableStream: type) type {
u16, u32, i16, i32, i8 => {
try this.write(std.mem.asBytes(slice));
},
[:0]u8,
[]u8,
[]u16,
[]u32,
@@ -255,11 +281,32 @@ pub fn Writer(comptime WritableStream: type) type {
[]i32,
[]i8,
[]const u8,
[:0]const u8,
[]const u16,
[]const u32,
[]const i16,
[]const i32,
[]const i8,
[:0]u16,
[:0]u32,
[:0]i16,
[:0]i32,
[:0]i8,
[:0]const u16,
[:0]const u32,
[:0]const i16,
[:0]const i32,
[:0]const i8,
[*:0]u16,
[*:0]u32,
[*:0]i16,
[*:0]i32,
[*:0]i8,
[*:0]const u16,
[*:0]const u32,
[*:0]const i16,
[*:0]const i32,
[*:0]const i8,
=> {
for (slice) |num_slice| {
try this.writeArray(std.meta.Child(@TypeOf(num_slice)), num_slice);
@@ -273,7 +320,7 @@ pub fn Writer(comptime WritableStream: type) type {
}
}
pub fn endMessage(this: *Self) !void {
pub inline fn endMessage(this: *Self) !void {
try this.writeByte(0);
}
};
@@ -282,404 +329,199 @@ pub fn Writer(comptime WritableStream: type) type {
pub const ByteWriter = Writer(*std.io.FixedBufferStream([]u8));
pub const FileWriter = Writer(std.fs.File);
pub const analytics = struct {
pub const OperatingSystem = enum(u8) {
_none,
/// linux
linux,
/// macos
macos,
/// windows
windows,
pub const analytics = struct {
/// wsl
wsl,
pub const OperatingSystem = enum(u8) {
_,
_none,
/// linux
linux,
/// macos
macos,
/// windows
windows,
/// wsl
wsl,
_,
pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void {
return try std.json.stringify(@tagName(self), opts, o);
}
};
pub const Architecture = enum(u8) {
_none,
/// x64
x64,
/// arm
arm,
_,
pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void {
return try std.json.stringify(@tagName(self), opts, o);
}
};
pub const Platform = struct {
/// os
os: OperatingSystem,
/// arch
arch: Architecture,
/// version
version: []const u8,
pub fn decode(reader: anytype) anyerror!Platform {
var this = std.mem.zeroes(Platform);
this.os = try reader.readValue(OperatingSystem);
this.arch = try reader.readValue(Architecture);
this.version = try reader.readArray(u8);
return this;
}
pub fn encode(this: *const @This(), writer: anytype) anyerror!void {
try writer.writeEnum(this.os);
try writer.writeEnum(this.arch);
try writer.writeArray(u8, this.version);
}
};
pub const EventKind = enum(u32) {
_none,
/// bundle_success
bundle_success,
/// bundle_fail
bundle_fail,
/// http_start
http_start,
/// http_build
http_build,
/// bundle_start
bundle_start,
_,
pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void {
return try std.json.stringify(@tagName(self), opts, o);
}
};
pub const Uint64 = packed struct {
/// first
first: u32 = 0,
/// second
second: u32 = 0,
pub fn decode(reader: anytype) anyerror!Uint64 {
var this = std.mem.zeroes(Uint64);
this.first = try reader.readValue(u32);
this.second = try reader.readValue(u32);
return this;
}
pub fn encode(this: *const @This(), writer: anytype) anyerror!void {
try writer.writeInt(this.first);
try writer.writeInt(this.second);
}
};
pub const EventListHeader = struct {
/// machine_id
machine_id: Uint64,
/// session_id
session_id: u32 = 0,
/// platform
platform: Platform,
/// build_id
build_id: u32 = 0,
/// project_id
project_id: Uint64,
/// session_length
session_length: u32 = 0,
/// feature_usage
feature_usage: u32 = 0,
pub fn decode(reader: anytype) anyerror!EventListHeader {
var this = std.mem.zeroes(EventListHeader);
this.machine_id = try reader.readValue(Uint64);
this.session_id = try reader.readValue(u32);
this.platform = try reader.readValue(Platform);
this.build_id = try reader.readValue(u32);
this.project_id = try reader.readValue(Uint64);
this.session_length = try reader.readValue(u32);
this.feature_usage = try reader.readValue(u32);
return this;
}
pub fn encode(this: *const @This(), writer: anytype) anyerror!void {
try writer.writeValue(this.machine_id);
try writer.writeInt(this.session_id);
try writer.writeValue(this.platform);
try writer.writeInt(this.build_id);
try writer.writeValue(this.project_id);
try writer.writeInt(this.session_length);
try writer.writeInt(this.feature_usage);
}
};
pub const EventHeader = struct {
/// timestamp
timestamp: Uint64,
/// kind
kind: EventKind,
pub fn decode(reader: anytype) anyerror!EventHeader {
var this = std.mem.zeroes(EventHeader);
this.timestamp = try reader.readValue(Uint64);
this.kind = try reader.readValue(EventKind);
return this;
}
pub fn encode(this: *const @This(), writer: anytype) anyerror!void {
try writer.writeValue(this.timestamp);
try writer.writeEnum(this.kind);
}
};
pub const EventList = struct {
/// header
header: EventListHeader,
/// event_count
event_count: u32 = 0,
pub fn decode(reader: anytype) anyerror!EventList {
var this = std.mem.zeroes(EventList);
this.header = try reader.readValue(EventListHeader);
this.event_count = try reader.readValue(u32);
return this;
}
pub fn encode(this: *const @This(), writer: anytype) anyerror!void {
try writer.writeValue(this.header);
try writer.writeInt(this.event_count);
}
};
};
const ExamplePackedStruct = packed struct {
len: u32 = 0,
offset: u32 = 0,
pub fn encode(this: *const ExamplePackedStruct, writer: anytype) !void {
try writer.write(std.mem.asBytes(this));
}
pub fn decode(reader: anytype) !ExamplePackedStruct {
return try reader.readAs(ExamplePackedStruct);
}
};
const ExampleStruct = struct {
name: []const u8 = "",
age: u32 = 0,
pub fn encode(this: *const ExampleStruct, writer: anytype) !void {
try writer.writeArray(u8, this.name);
try writer.writeInt(this.age);
}
pub fn decode(reader: anytype) !ExampleStruct {
var this = std.mem.zeroes(ExampleStruct);
this.name = try reader.readArray(u8);
this.age = try reader.readInt(u32);
return this;
}
};
const EnumValue = enum(u8) { hey, hi, heyopoo };
const ExampleMessage = struct {
examples: ?[]ExampleStruct = &([_]ExampleStruct{}),
pack: ?[]ExamplePackedStruct = &([_]ExamplePackedStruct{}),
hey: ?u8 = 0,
hey16: ?u16 = 0,
hey32: ?u16 = 0,
heyi32: ?i32 = 0,
heyi16: ?i16 = 0,
heyi8: ?i8 = 0,
boolean: ?bool = null,
heyooo: ?EnumValue = null,
pub fn encode(this: *const ExampleMessage, writer: anytype) !void {
if (this.examples) |examples| {
try writer.writeFieldID(1);
try writer.writeArray(ExampleStruct, examples);
pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void {
return try std.json.stringify(@tagName(self), opts, o);
}
if (this.pack) |pack| {
try writer.writeFieldID(2);
try writer.writeArray(ExamplePackedStruct, pack);
}
if (this.hey) |hey| {
try writer.writeFieldID(3);
try writer.writeInt(hey);
}
if (this.hey16) |hey16| {
try writer.writeFieldID(4);
try writer.writeInt(hey16);
}
if (this.hey32) |hey32| {
try writer.writeFieldID(5);
try writer.writeInt(hey32);
}
if (this.heyi32) |heyi32| {
try writer.writeFieldID(6);
try writer.writeInt(heyi32);
}
if (this.heyi16) |heyi16| {
try writer.writeFieldID(7);
try writer.writeInt(heyi16);
}
if (this.heyi8) |heyi8| {
try writer.writeFieldID(8);
try writer.writeInt(heyi8);
}
if (this.boolean) |boolean| {
try writer.writeFieldID(9);
try writer.writeInt(boolean);
}
if (this.heyooo) |heyoo| {
try writer.writeFieldID(10);
try writer.writeEnum(heyoo);
}
try writer.endMessage();
}
pub fn decode(reader: anytype) !ExampleMessage {
var this = std.mem.zeroes(ExampleMessage);
while (true) {
switch (try reader.readByte()) {
0 => {
return this;
},
1 => {
this.examples = try reader.readArray(std.meta.Child(@TypeOf(this.examples.?)));
},
2 => {
this.pack = try reader.readArray(std.meta.Child(@TypeOf(this.pack.?)));
},
3 => {
this.hey = try reader.readValue(@TypeOf(this.hey.?));
},
4 => {
this.hey16 = try reader.readValue(@TypeOf(this.hey16.?));
},
5 => {
this.hey32 = try reader.readValue(@TypeOf(this.hey32.?));
},
6 => {
this.heyi32 = try reader.readValue(@TypeOf(this.heyi32.?));
},
7 => {
this.heyi16 = try reader.readValue(@TypeOf(this.heyi16.?));
},
8 => {
this.heyi8 = try reader.readValue(@TypeOf(this.heyi8.?));
},
9 => {
this.boolean = try reader.readValue(@TypeOf(this.boolean.?));
},
10 => {
this.heyooo = try reader.readValue(@TypeOf(this.heyooo.?));
},
else => {
return error.InvalidValue;
},
}
}
return this;
}
};
test "ExampleMessage" {
var base = std.mem.zeroes(ExampleMessage);
base.hey = 1;
var buf: [4096]u8 = undefined;
var writable = std.io.fixedBufferStream(&buf);
var writer = ByteWriter.init(writable);
var examples = [_]ExamplePackedStruct{
.{ .len = 2, .offset = 5 },
.{ .len = 0, .offset = 10 },
};
var more_examples = [_]ExampleStruct{
.{ .name = "bacon", .age = 10 },
.{ .name = "slime", .age = 300 },
pub const Architecture = enum(u8) {
_none,
/// x64
x64,
/// arm
arm,
_,
pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void {
return try std.json.stringify(@tagName(self), opts, o);
}
};
base.examples = &more_examples;
base.pack = &examples;
base.heyooo = EnumValue.hey;
try base.encode(&writer);
var reader = Reader.init(&buf, std.heap.c_allocator);
var compare = try ExampleMessage.decode(&reader);
try std.testing.expectEqual(base.hey orelse 255, 1);
const cmp_pack = compare.pack.?;
for (cmp_pack) |item, id| {
try std.testing.expectEqual(item, examples[id]);
}
pub const Platform = struct {
/// os
os: OperatingSystem,
const cmp_ex = compare.examples.?;
for (cmp_ex) |item, id| {
try std.testing.expectEqualStrings(item.name, more_examples[id].name);
try std.testing.expectEqual(item.age, more_examples[id].age);
}
/// arch
arch: Architecture,
try std.testing.expectEqual(cmp_pack[0].len, examples[0].len);
try std.testing.expectEqual(base.heyooo, compare.heyooo);
}
/// version
version: []const u8,
pub fn decode(reader: anytype) anyerror!Platform {
var this = std.mem.zeroes(Platform);
this.os = try reader.readValue(OperatingSystem);
this.arch = try reader.readValue(Architecture);
this.version = try reader.readArray(u8);
return this;
}
pub fn encode(this: *const @This(), writer: anytype) anyerror!void {
try writer.writeEnum(this.os);
try writer.writeEnum(this.arch);
try writer.writeArray(u8, this.version);
}
};
pub const EventKind = enum(u32) {
_none,
/// bundle_success
bundle_success,
/// bundle_fail
bundle_fail,
/// http_start
http_start,
/// http_build
http_build,
/// bundle_start
bundle_start,
_,
pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void {
return try std.json.stringify(@tagName(self), opts, o);
}
};
pub const Uint64 = packed struct {
/// first
first: u32 = 0,
/// second
second: u32 = 0,
pub fn decode(reader: anytype) anyerror!Uint64 {
var this = std.mem.zeroes(Uint64);
this.first = try reader.readValue(u32);
this.second = try reader.readValue(u32);
return this;
}
pub fn encode(this: *const @This(), writer: anytype) anyerror!void {
try writer.writeInt(this.first);
try writer.writeInt(this.second);
}
};
pub const EventListHeader = struct {
/// machine_id
machine_id: Uint64,
/// session_id
session_id: u32 = 0,
/// platform
platform: Platform,
/// build_id
build_id: u32 = 0,
/// project_id
project_id: Uint64,
/// session_length
session_length: u32 = 0,
/// feature_usage
feature_usage: u32 = 0,
pub fn decode(reader: anytype) anyerror!EventListHeader {
var this = std.mem.zeroes(EventListHeader);
this.machine_id = try reader.readValue(Uint64);
this.session_id = try reader.readValue(u32);
this.platform = try reader.readValue(Platform);
this.build_id = try reader.readValue(u32);
this.project_id = try reader.readValue(Uint64);
this.session_length = try reader.readValue(u32);
this.feature_usage = try reader.readValue(u32);
return this;
}
pub fn encode(this: *const @This(), writer: anytype) anyerror!void {
try writer.writeValue(@TypeOf(this.machine_id), this.machine_id);
try writer.writeInt(this.session_id);
try writer.writeValue(@TypeOf(this.platform), this.platform);
try writer.writeInt(this.build_id);
try writer.writeValue(@TypeOf(this.project_id), this.project_id);
try writer.writeInt(this.session_length);
try writer.writeInt(this.feature_usage);
}
};
pub const EventHeader = struct {
/// timestamp
timestamp: Uint64,
/// kind
kind: EventKind,
pub fn decode(reader: anytype) anyerror!EventHeader {
var this = std.mem.zeroes(EventHeader);
this.timestamp = try reader.readValue(Uint64);
this.kind = try reader.readValue(EventKind);
return this;
}
pub fn encode(this: *const @This(), writer: anytype) anyerror!void {
try writer.writeValue(@TypeOf(this.timestamp), this.timestamp);
try writer.writeEnum(this.kind);
}
};
pub const EventList = struct {
/// header
header: EventListHeader,
/// event_count
event_count: u32 = 0,
pub fn decode(reader: anytype) anyerror!EventList {
var this = std.mem.zeroes(EventList);
this.header = try reader.readValue(EventListHeader);
this.event_count = try reader.readValue(u32);
return this;
}
pub fn encode(this: *const @This(), writer: anytype) anyerror!void {
try writer.writeValue(@TypeOf(this.header), this.header);
try writer.writeInt(this.event_count);
}
};
};

1483
src/api/schema.d.ts vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff