diff --git a/.eslintignore b/.eslintignore index bcf463b7c..f265ab6d2 100644 --- a/.eslintignore +++ b/.eslintignore @@ -5,4 +5,5 @@ cache/ src/proto/youtube.ts coverage/ node_modules/ -dist/ \ No newline at end of file +dist/ +src/proto/generated/ \ No newline at end of file diff --git a/.github/labeler_config.yml b/.github/labeler_config.yml index c98cd189a..9eb5d8b11 100644 --- a/.github/labeler_config.yml +++ b/.github/labeler_config.yml @@ -2,13 +2,7 @@ version: 1 labels: - label: "breaking-change" title: "^refactor!:.*" - - - label: "enhancement" - title: "^feat:.*" - - - label: "bug" - title: "^fix:.*" - + - label: "github" files: - ".github/.*" diff --git a/.github/release.yml b/.github/release.yml deleted file mode 100644 index 00d87a17d..000000000 --- a/.github/release.yml +++ /dev/null @@ -1,20 +0,0 @@ -changelog: - exclude: - labels: - - ignore-for-release - authors: - - octocat - categories: - - title: Breaking Changes - labels: - - Semver-Major - - breaking-change - - title: New Features - labels: - - Semver-Minor - - enhancement - - title: Bug Fixes - - bug - - title: Other Changes - labels: - - "*" \ No newline at end of file diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 12fee65d7..fa9b4df0e 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -5,9 +5,7 @@ on: jobs: build: - runs-on: ubuntu-latest - steps: - uses: srvaroa/labeler@master with: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 16365850f..5c568b447 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,17 +1,18 @@ -name: Lint +name: lint -on: [push, pull_request] +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] jobs: - eslint: - name: Lint + lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-node@v3 - - - name: npm install and lint - run: | - npm install - npm run lint \ No newline at end of file + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 16 + - run: npm ci + - run: npm run lint \ No newline at end of file diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml deleted file mode 100644 index 7040873a6..000000000 --- a/.github/workflows/node.js.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Tests - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build: - - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [ 16.x, 18.x ] - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - - steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - run: npm install - - run: npm run test \ No newline at end of file diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 000000000..536369b21 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,62 @@ +name: release-please + +on: + push: + branches: + - main + +jobs: + release-please: + permissions: + contents: write + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: google-github-actions/release-please-action@v3 + id: release + with: + release-type: node + package-name: youtubei.js + token: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: "16.x" + - name: Build for Deno + run: | + npm ci + npm run build:deno + if: ${{ steps.release.outputs.release_created }} + - name: Move Deno files + run: | + mkdir build + mv deno build/deno + cp deno.ts build/deno.ts + cp {LICENSE,README.md} build + if: ${{ steps.release.outputs.release_created }} + - name: Push to the Deno branch + uses: s0/git-publish-subdir-action@develop + env: + REPO: self + BRANCH: deno + FOLDER: ./build + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SKIP_EMPTY_COMMITS: true + MESSAGE: "chore: ${{ steps.release.outputs.tag_name }} release" + TAG: ${{ steps.release.outputs.tag_name }}-deno + if: ${{ steps.release.outputs.release_created }} + - name: Remove Deno folder + run: rm -rf build + if: ${{ steps.release.outputs.release_created }} + - uses: actions/setup-node@v3 + with: + node-version: "16.x" + registry-url: "https://registry.npmjs.org" + if: ${{ steps.release.outputs.release_created }} + - name: Publish package to npmjs + run: | + npm ci + npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + if: ${{ steps.release.outputs.release_created }} \ No newline at end of file diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 968c6d92f..7fd3b110d 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -11,9 +11,7 @@ jobs: - uses: actions/stale@v3 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: 'This issue has been automatically marked as stale because it has not had - recent activity. It will be closed if no further activity occurs. Thank you - for your contributions.' + stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.' stale-pr-message: 'This PR has been automatically marked as stale because it has not had recent activity. Remove the stale label or comment or this will be closed in 2 days' days-before-stale: 60 days-before-close: 4 \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..a15db51e8 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,18 @@ +name: test + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 16 + - run: npm ci + - run: npm run test \ No newline at end of file diff --git a/.gitignore b/.gitignore index 134e10b25..f73e78055 100644 --- a/.gitignore +++ b/.gitignore @@ -66,6 +66,9 @@ tmp/ dist/ bundle/*.js.* bundle/*.js +bundle/*.cjs +bundle/*.cjs.* +deno/ # MacOS .DS_Store diff --git a/README.md b/README.md index 6dc279644..9481bbef4 100644 --- a/README.md +++ b/README.md @@ -112,7 +112,7 @@ yarn add youtubei.js@latest npm install github:LuanRT/YouTube.js ``` -**TODO:** Deno install instructions (esm.sh possibly?) +**TODO:** Deno install instructions (deno.land) ## Usage Create an InnerTube instance: diff --git a/browser.ts b/browser.ts deleted file mode 100644 index 00fa42e35..000000000 --- a/browser.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Deno and browser runtimes - -import Innertube from './src/Innertube'; - -export * from './src/utils'; -export { YTNodes } from './src/parser/map'; -export { default as Parser } from './src/parser'; -export { default as Innertube } from './src/Innertube'; -export { default as Session } from './src/core/Session'; -export { default as Player } from './src/core/Player'; -export default Innertube; \ No newline at end of file diff --git a/bundle/browser.d.ts b/bundle/browser.d.ts index 110c7460e..92a96fb49 100644 --- a/bundle/browser.d.ts +++ b/bundle/browser.d.ts @@ -1 +1 @@ -export * from '../dist/browser'; \ No newline at end of file +export * from '../dist/src/platform/lib.js'; \ No newline at end of file diff --git a/bundle/node.d.cts b/bundle/node.d.cts new file mode 100644 index 000000000..92a96fb49 --- /dev/null +++ b/bundle/node.d.cts @@ -0,0 +1 @@ +export * from '../dist/src/platform/lib.js'; \ No newline at end of file diff --git a/deno.ts b/deno.ts new file mode 100644 index 000000000..1225fd4be --- /dev/null +++ b/deno.ts @@ -0,0 +1,3 @@ +export * from './deno/src/platform/deno.ts'; +import Innertube from './deno/src/platform/deno.ts'; +export default Innertube; \ No newline at end of file diff --git a/index.ts b/index.ts deleted file mode 100644 index ae320ea6b..000000000 --- a/index.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { getRuntime } from './src/utils/Utils'; - -// Polyfill fetch for node -if (getRuntime() === 'node') { - // eslint-disable-next-line - const undici = require('undici'); - Reflect.set(globalThis, 'fetch', undici.fetch); - Reflect.set(globalThis, 'Headers', undici.Headers); - Reflect.set(globalThis, 'Request', undici.Request); - Reflect.set(globalThis, 'Response', undici.Response); - Reflect.set(globalThis, 'FormData', undici.FormData); - Reflect.set(globalThis, 'File', undici.File); - try { - // eslint-disable-next-line - const { ReadableStream } = require('node:stream/web'); - Reflect.set(globalThis, 'ReadableStream', ReadableStream); - } catch { /* do nothing */ } -} - -import Innertube from './src/Innertube'; - -export * from './src/utils'; -export { YTNodes } from './src/parser/map'; -export { default as Parser } from './src/parser'; -export { default as Innertube } from './src/Innertube'; -export { default as Session } from './src/core/Session'; -export { default as Player } from './src/core/Player'; -export default Innertube; \ No newline at end of file diff --git a/jest.config.js b/jest.config.js index 180fd1163..d49a939a7 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,6 +1,6 @@ -module.exports = { +export default { projects: [ { displayName: 'node', diff --git a/package-lock.json b/package-lock.json index 3ef31934f..786b6e4ae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,24 +12,25 @@ ], "license": "MIT", "dependencies": { - "@protobuf-ts/runtime": "^2.7.0", "jintr": "^0.3.1", "linkedom": "^0.14.12", "undici": "^5.7.0" }, "devDependencies": { - "@protobuf-ts/plugin": "^2.7.0", "@types/jest": "^28.1.7", "@types/node": "^17.0.45", "@typescript-eslint/eslint-plugin": "^5.30.6", "@typescript-eslint/parser": "^5.30.6", + "cpy-cli": "^4.2.0", "esbuild": "^0.14.49", "eslint": "^8.19.0", "eslint-plugin-tsdoc": "^0.2.16", "glob": "^8.0.3", "jest": "^28.1.3", + "pbkit": "^0.0.59", + "replace": "^1.2.2", "ts-jest": "^28.0.8", - "typescript": "^4.7.4" + "typescript": "^4.9.5" } }, "node_modules/@ampproject/remapping": { @@ -1202,82 +1203,6 @@ "node": ">= 8" } }, - "node_modules/@protobuf-ts/plugin": { - "version": "2.8.2", - "resolved": "https://registry.npmjs.org/@protobuf-ts/plugin/-/plugin-2.8.2.tgz", - "integrity": "sha512-rTPxaeKBfUar8ubKxbVdv4XL6AcGA0OOgHNHFyrfODP7Epy80omwuvgFJex1YpeNFJxm/FZXXj5Z+nHuhYEqJg==", - "dev": true, - "dependencies": { - "@protobuf-ts/plugin-framework": "^2.8.2", - "@protobuf-ts/protoc": "^2.8.2", - "@protobuf-ts/runtime": "^2.8.2", - "@protobuf-ts/runtime-rpc": "^2.8.2", - "typescript": "^3.9" - }, - "bin": { - "protoc-gen-dump": "bin/protoc-gen-dump", - "protoc-gen-ts": "bin/protoc-gen-ts" - } - }, - "node_modules/@protobuf-ts/plugin-framework": { - "version": "2.8.2", - "resolved": "https://registry.npmjs.org/@protobuf-ts/plugin-framework/-/plugin-framework-2.8.2.tgz", - "integrity": "sha512-ivcJdNVB3Iee8044f8erZGBgmB6ZfQbbKyxRgDBXRVKYxsruLr432WcT5upw9autK9OnlSVLaebi8kDneFXd2g==", - "dev": true, - "dependencies": { - "@protobuf-ts/runtime": "^2.8.2", - "typescript": "^3.9" - } - }, - "node_modules/@protobuf-ts/plugin-framework/node_modules/typescript": { - "version": "3.9.10", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", - "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=4.2.0" - } - }, - "node_modules/@protobuf-ts/plugin/node_modules/typescript": { - "version": "3.9.10", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", - "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=4.2.0" - } - }, - "node_modules/@protobuf-ts/protoc": { - "version": "2.8.2", - "resolved": "https://registry.npmjs.org/@protobuf-ts/protoc/-/protoc-2.8.2.tgz", - "integrity": "sha512-1e+rOgp22ElyqRWunSc8bhatJcvRe90AGPceVn67IFYzybvfKl17vP1igHddeYkN0dzOucnOrwqn2v1jnDfE2w==", - "dev": true, - "bin": { - "protoc": "protoc.js" - } - }, - "node_modules/@protobuf-ts/runtime": { - "version": "2.8.2", - "resolved": "https://registry.npmjs.org/@protobuf-ts/runtime/-/runtime-2.8.2.tgz", - "integrity": "sha512-PVxsH81y9kEbHldxxG/8Y3z2mTXWQytRl8zNS0mTPUjkEC+8GUX6gj6LsA8EFp25fAs9V0ruh+aNWmPccEI9MA==" - }, - "node_modules/@protobuf-ts/runtime-rpc": { - "version": "2.8.2", - "resolved": "https://registry.npmjs.org/@protobuf-ts/runtime-rpc/-/runtime-rpc-2.8.2.tgz", - "integrity": "sha512-vum/Y7AXdUTWGFu7dke/jCSB9dV3Oo3iVPcce3j7KudpzzWarDkEGvXjKv3Y8zJPj5waToyxwBNSb7eo5Vw5WA==", - "dev": true, - "dependencies": { - "@protobuf-ts/runtime": "^2.8.2" - } - }, "node_modules/@sinclair/typebox": { "version": "0.24.51", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.24.51.tgz", @@ -1343,6 +1268,12 @@ "@babel/types": "^7.3.0" } }, + "node_modules/@types/emscripten": { + "version": "1.39.6", + "resolved": "https://registry.npmjs.org/@types/emscripten/-/emscripten-1.39.6.tgz", + "integrity": "sha512-H90aoynNhhkQP6DRweEjJp5vfUVdIj7tdPLsu7pq89vODD/lcugKfZOsfgwpvM6XUewEp2N5dCg1Uf3Qe55Dcg==", + "dev": true + }, "node_modules/@types/graceful-fs": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz", @@ -1392,12 +1323,24 @@ "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", "dev": true }, + "node_modules/@types/minimist": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", + "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==", + "dev": true + }, "node_modules/@types/node": { "version": "17.0.45", "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.45.tgz", "integrity": "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==", "dev": true }, + "node_modules/@types/normalize-package-data": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", + "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", + "dev": true + }, "node_modules/@types/prettier": { "version": "2.7.2", "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.2.tgz", @@ -1618,6 +1561,32 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@yarnpkg/fslib": { + "version": "2.10.1", + "resolved": "https://registry.npmjs.org/@yarnpkg/fslib/-/fslib-2.10.1.tgz", + "integrity": "sha512-pVMLtOYu87N5y5G2lyPNYTY2JbTco99v7nGFI34Blx01Ct9LmoKVOc91vnLOYIMMljKr1c8xs1O2UamRdMG5Pg==", + "dev": true, + "dependencies": { + "@yarnpkg/libzip": "^2.2.4", + "tslib": "^1.13.0" + }, + "engines": { + "node": ">=12 <14 || 14.2 - 14.9 || >14.10.0" + } + }, + "node_modules/@yarnpkg/libzip": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/@yarnpkg/libzip/-/libzip-2.2.4.tgz", + "integrity": "sha512-QP0vUP+w0d7Jlo7jqTnlRChSnIB/dOF7nJFLD/gsPvFIHsVWLQQuAiolOcXQUD2hezLD1mQd2qb0yOKqPYRcfQ==", + "dev": true, + "dependencies": { + "@types/emscripten": "^1.38.0", + "tslib": "^1.13.0" + }, + "engines": { + "node": ">=12 <14 || 14.2 - 14.9 || >14.10.0" + } + }, "node_modules/acorn": { "version": "8.8.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", @@ -1638,6 +1607,22 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, + "node_modules/aggregate-error": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-4.0.1.tgz", + "integrity": "sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w==", + "dev": true, + "dependencies": { + "clean-stack": "^4.0.0", + "indent-string": "^5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -1733,6 +1718,18 @@ "node": ">=8" } }, + "node_modules/arrify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-3.0.0.tgz", + "integrity": "sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/babel-jest": { "version": "28.1.3", "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-28.1.3.tgz", @@ -1941,6 +1938,48 @@ "node": ">=6" } }, + "node_modules/camelcase-keys": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-7.0.2.tgz", + "integrity": "sha512-Rjs1H+A9R+Ig+4E/9oyB66UC5Mj9Xq3N//vcLf2WzgdTi/3gUu3Z9KoqmlrEG4VuuLK8wJHofxzdQXz/knhiYg==", + "dev": true, + "dependencies": { + "camelcase": "^6.3.0", + "map-obj": "^4.1.0", + "quick-lru": "^5.1.1", + "type-fest": "^1.2.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/camelcase-keys/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/camelcase-keys/node_modules/type-fest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/caniuse-lite": { "version": "1.0.30001441", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001441.tgz", @@ -1997,6 +2036,33 @@ "integrity": "sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==", "dev": true }, + "node_modules/clean-stack": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-4.2.0.tgz", + "integrity": "sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg==", + "dev": true, + "dependencies": { + "escape-string-regexp": "5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/clean-stack/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/cliui": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", @@ -2057,6 +2123,108 @@ "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", "dev": true }, + "node_modules/core-js": { + "version": "3.18.1", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.18.1.tgz", + "integrity": "sha512-vJlUi/7YdlCZeL6fXvWNaLUPh/id12WXj3MbkMw5uOyF0PfWPBNOCNbs53YqgrvtujLNlt9JQpruyIKkUZ+PKA==", + "deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.", + "dev": true, + "hasInstallScript": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, + "node_modules/cp-file": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/cp-file/-/cp-file-9.1.0.tgz", + "integrity": "sha512-3scnzFj/94eb7y4wyXRWwvzLFaQp87yyfTnChIjlfYrVqp5lVO3E2hIJMeQIltUT0K2ZAB3An1qXcBmwGyvuwA==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "make-dir": "^3.0.0", + "nested-error-stacks": "^2.0.0", + "p-event": "^4.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cpy": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/cpy/-/cpy-9.0.1.tgz", + "integrity": "sha512-D9U0DR5FjTCN3oMTcFGktanHnAG5l020yvOCR1zKILmAyPP7I/9pl6NFgRbDcmSENtbK1sQLBz1p9HIOlroiNg==", + "dev": true, + "dependencies": { + "arrify": "^3.0.0", + "cp-file": "^9.1.0", + "globby": "^13.1.1", + "junk": "^4.0.0", + "micromatch": "^4.0.4", + "nested-error-stacks": "^2.1.0", + "p-filter": "^3.0.0", + "p-map": "^5.3.0" + }, + "engines": { + "node": "^12.20.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cpy-cli": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/cpy-cli/-/cpy-cli-4.2.0.tgz", + "integrity": "sha512-b04b+cbdr29CdpREPKw/itrfjO43Ty0Aj7wRM6M6LoE4GJxZJCk9Xp+Eu1IqztkKh3LxIBt1tDplENsa6KYprg==", + "dev": true, + "dependencies": { + "cpy": "^9.0.0", + "meow": "^10.1.2" + }, + "bin": { + "cpy": "cli.js" + }, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cpy/node_modules/globby": { + "version": "13.1.3", + "resolved": "https://registry.npmjs.org/globby/-/globby-13.1.3.tgz", + "integrity": "sha512-8krCNHXvlCgHDpegPzleMq07yMYTO2sXKASmZmquEYWEmCx6J5UTRbp5RwMJkTJGtcQ44YpiUYUiN0b9mzy8Bw==", + "dev": true, + "dependencies": { + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.11", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cpy/node_modules/slash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -2119,6 +2287,52 @@ } } }, + "node_modules/decamelize": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-5.0.1.tgz", + "integrity": "sha512-VfxadyCECXgQlkoEAjeghAr5gY3Hf+IKjKb+X8tGVDtveCjN+USwprd2q3QXBR9T1+x2DG0XZF5/w+7HAtSaXA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/decamelize-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.1.tgz", + "integrity": "sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==", + "dev": true, + "dependencies": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/decamelize-keys/node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decamelize-keys/node_modules/map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/dedent": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", @@ -3216,6 +3430,15 @@ "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", "dev": true }, + "node_modules/hard-rejection": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", + "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -3237,6 +3460,36 @@ "node": ">=8" } }, + "node_modules/hosted-git-info": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", + "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/hosted-git-info/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/hosted-git-info/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/html-escaper": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", @@ -3323,12 +3576,24 @@ "node": ">=0.8.19" } }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "node_modules/indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", "dev": true, - "dependencies": { + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "dependencies": { "once": "^1.3.0", "wrappy": "1" } @@ -3414,6 +3679,15 @@ "node": ">=8" } }, + "node_modules/is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-stream": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", @@ -4206,6 +4480,27 @@ "node": ">=6" } }, + "node_modules/junk": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/junk/-/junk-4.0.0.tgz", + "integrity": "sha512-ojtSU++zLJ3jQG9bAYjg94w+/DOJtRyD7nPaerMFrBhmdVmiV5/exYH5t4uHga4G/95nT6hr1OJoKIFbYbrW5w==", + "dev": true, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/kleur": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", @@ -4335,6 +4630,65 @@ "tmpl": "1.0.5" } }, + "node_modules/map-obj": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", + "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/meow": { + "version": "10.1.5", + "resolved": "https://registry.npmjs.org/meow/-/meow-10.1.5.tgz", + "integrity": "sha512-/d+PQ4GKmGvM9Bee/DPa8z3mXs/pkvJE2KEThngVNOqtmljC6K7NMPxtc2JeZYTmpWb9k/TmxjeL18ez3h7vCw==", + "dev": true, + "dependencies": { + "@types/minimist": "^1.2.2", + "camelcase-keys": "^7.0.0", + "decamelize": "^5.0.0", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "4.1.0", + "normalize-package-data": "^3.0.2", + "read-pkg-up": "^8.0.0", + "redent": "^4.0.0", + "trim-newlines": "^4.0.2", + "type-fest": "^1.2.2", + "yargs-parser": "^20.2.9" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/meow/node_modules/type-fest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/meow/node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -4372,6 +4726,15 @@ "node": ">=6" } }, + "node_modules/min-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -4384,6 +4747,38 @@ "node": "*" } }, + "node_modules/minimist-options": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", + "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", + "dev": true, + "dependencies": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0", + "kind-of": "^6.0.3" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/minimist-options/node_modules/arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/mri": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", + "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -4402,6 +4797,12 @@ "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", "dev": true }, + "node_modules/nested-error-stacks": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-2.1.1.tgz", + "integrity": "sha512-9iN1ka/9zmX1ZvLV9ewJYEk9h7RyRRtqdK0woXcqohu8EWIerfPUjYJPg0ULy0UqP7cslmdGc8xKDJcojlKiaw==", + "dev": true + }, "node_modules/node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -4414,6 +4815,21 @@ "integrity": "sha512-dFSmB8fFHEH/s81Xi+Y/15DQY6VHW81nXRj86EMSL3lmuTmK1e+aT4wrFCkTbm+gSwkw4KpX+rT/pMM2c1mF+A==", "dev": true }, + "node_modules/normalize-package-data": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", + "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", + "dev": true, + "dependencies": { + "hosted-git-info": "^4.0.1", + "is-core-module": "^2.5.0", + "semver": "^7.3.4", + "validate-npm-package-license": "^3.0.1" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -4487,6 +4903,45 @@ "node": ">= 0.8.0" } }, + "node_modules/p-event": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/p-event/-/p-event-4.2.0.tgz", + "integrity": "sha512-KXatOjCRXXkSePPb1Nbi0p0m+gQAwdlbhi4wQKJPI1HsMQS9g+Sqp2o+QHziPr7eYJyOZet836KoHEVM1mwOrQ==", + "dev": true, + "dependencies": { + "p-timeout": "^3.1.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-filter": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-filter/-/p-filter-3.0.0.tgz", + "integrity": "sha512-QtoWLjXAW++uTX67HZQz1dbTpqBfiidsB6VtQUC9iR85S120+s0T5sO6s+B5MLzFcZkrEd/DGMmCjR+f2Qpxwg==", + "dev": true, + "dependencies": { + "p-map": "^5.1.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -4517,6 +4972,33 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/p-map": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-5.5.0.tgz", + "integrity": "sha512-VFqfGDHlx87K66yZrNdI4YGtD70IRyd+zSvgks6mzHPRNkoKy+9EKP4SFC77/vTTQYmRmti7dvqC+m5jBrBAcg==", + "dev": true, + "dependencies": { + "aggregate-error": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-timeout": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz", + "integrity": "sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==", + "dev": true, + "dependencies": { + "p-finally": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", @@ -4598,6 +5080,22 @@ "node": ">=8" } }, + "node_modules/pbkit": { + "version": "0.0.59", + "resolved": "https://registry.npmjs.org/pbkit/-/pbkit-0.0.59.tgz", + "integrity": "sha512-bBivFTDbmQPqUukFegIK2ScTSNnvdp5p2ghsdpivL1ZUZ/mkzy3rGDT+PvX1enoJJTY2G6nV1Zp4G+SM5vjMJg==", + "dev": true, + "dependencies": { + "@yarnpkg/fslib": "^2.6.0-rc.8", + "@yarnpkg/libzip": "^2.2.2", + "core-js": "3.18.1", + "mri": "^1.2.0" + }, + "bin": { + "pb-gen-ts": "compat/node/cli/pb-gen-ts.js", + "pb-gen-ts-bundle": "compat/node/cli/pb-gen-ts-bundle.js" + } + }, "node_modules/picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", @@ -4767,88 +5265,442 @@ } ] }, + "node_modules/quick-lru": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", + "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/react-is": { "version": "18.2.0", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", "dev": true }, - "node_modules/regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "node_modules/read-pkg": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-6.0.0.tgz", + "integrity": "sha512-X1Fu3dPuk/8ZLsMhEj5f4wFAF0DWoK7qhGJvgaijocXxBmSToKfbFtqbxMO7bVjNA1dmE5huAzjXj/ey86iw9Q==", "dev": true, + "dependencies": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^3.0.2", + "parse-json": "^5.2.0", + "type-fest": "^1.0.1" + }, "engines": { - "node": ">=8" + "node": ">=12" }, "funding": { - "url": "https://github.com/sponsors/mysticatea" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "node_modules/read-pkg-up": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-8.0.0.tgz", + "integrity": "sha512-snVCqPczksT0HS2EC+SxUndvSzn6LRCwpfSvLrIfR5BKDQQZMaI6jPRC9dYvYFDRAuFEAnkwww8kBBNE/3VvzQ==", "dev": true, + "dependencies": { + "find-up": "^5.0.0", + "read-pkg": "^6.0.0", + "type-fest": "^1.0.1" + }, "engines": { - "node": ">=0.10.0" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/resolve": { - "version": "1.19.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", - "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", + "node_modules/read-pkg-up/node_modules/type-fest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", "dev": true, - "dependencies": { - "is-core-module": "^2.1.0", - "path-parse": "^1.0.6" + "engines": { + "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/resolve-cwd": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", - "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "node_modules/read-pkg/node_modules/type-fest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/redent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-4.0.0.tgz", + "integrity": "sha512-tYkDkVVtYkSVhuQ4zBgfvciymHaeuel+zFKXShfDnFP5SyVEP7qo70Rf1jTOTCx3vGNAbnEi/xFkcfQVMIBWag==", "dev": true, "dependencies": { - "resolve-from": "^5.0.0" + "indent-string": "^5.0.0", + "strip-indent": "^4.0.0" }, "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/resolve-cwd/node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "node_modules/regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", "dev": true, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" } }, - "node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "node_modules/replace": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/replace/-/replace-1.2.2.tgz", + "integrity": "sha512-C4EDifm22XZM2b2JOYe6Mhn+lBsLBAvLbK8drfUQLTfD1KYl/n3VaW/CDju0Ny4w3xTtegBpg8YNSpFJPUDSjA==", "dev": true, + "dependencies": { + "chalk": "2.4.2", + "minimatch": "3.0.5", + "yargs": "^15.3.1" + }, + "bin": { + "replace": "bin/replace.js", + "search": "bin/search.js" + }, "engines": { - "node": ">=4" + "node": ">= 6" } }, - "node_modules/resolve.exports": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-1.1.0.tgz", - "integrity": "sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ==", + "node_modules/replace/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, "engines": { - "node": ">=10" + "node": ">=4" } }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "node_modules/replace/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/replace/node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "node_modules/replace/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/replace/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/replace/node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/replace/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/replace/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/replace/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/replace/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/replace/node_modules/minimatch": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.5.tgz", + "integrity": "sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/replace/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/replace/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/replace/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/replace/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/replace/node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/replace/node_modules/wrap-ansi/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/replace/node_modules/wrap-ansi/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/replace/node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "dev": true + }, + "node_modules/replace/node_modules/yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/replace/node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "node_modules/resolve": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", + "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", + "dev": true, + "dependencies": { + "is-core-module": "^2.1.0", + "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "dependencies": { + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-cwd/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/resolve.exports": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-1.1.0.tgz", + "integrity": "sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", "dev": true, "engines": { @@ -4947,6 +5799,12 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, + "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==", + "dev": true + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -5008,6 +5866,38 @@ "source-map": "^0.6.0" } }, + "node_modules/spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "dev": true, + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.12", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.12.tgz", + "integrity": "sha512-rr+VVSXtRhO4OHbXUiAF7xW3Bo9DuuF6C5jH+q/x15j2jniycgKbxU09Hr0WqlSLUs4i4ltHGXqTe7VHclYWyA==", + "dev": true + }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -5100,6 +5990,21 @@ "node": ">=6" } }, + "node_modules/strip-indent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-4.0.0.tgz", + "integrity": "sha512-mnVSV2l+Zv6BLpSD/8V87CW/y9EmmbYzGCIavsnsI6/nwn26DwffM/yztm30Z/I2DY9wdS3vXVCMnHDgZaVNoA==", + "dev": true, + "dependencies": { + "min-indent": "^1.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -5232,6 +6137,18 @@ "node": ">=8.0" } }, + "node_modules/trim-newlines": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-4.0.2.tgz", + "integrity": "sha512-GJtWyq9InR/2HRiLZgpIKv+ufIKrVrvjQWEj7PxAXNc5dwbNJkqhAUoAGgzRmULAnoOM5EIpveYd3J2VeSAIew==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/ts-jest": { "version": "28.0.8", "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-28.0.8.tgz", @@ -5330,9 +6247,9 @@ } }, "node_modules/typescript": { - "version": "4.9.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.4.tgz", - "integrity": "sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -5407,6 +6324,16 @@ "node": ">=10.12.0" } }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, "node_modules/walker": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", @@ -5431,6 +6358,12 @@ "node": ">= 8" } }, + "node_modules/which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==", + "dev": true + }, "node_modules/word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", @@ -6431,65 +7364,6 @@ "fastq": "^1.6.0" } }, - "@protobuf-ts/plugin": { - "version": "2.8.2", - "resolved": "https://registry.npmjs.org/@protobuf-ts/plugin/-/plugin-2.8.2.tgz", - "integrity": "sha512-rTPxaeKBfUar8ubKxbVdv4XL6AcGA0OOgHNHFyrfODP7Epy80omwuvgFJex1YpeNFJxm/FZXXj5Z+nHuhYEqJg==", - "dev": true, - "requires": { - "@protobuf-ts/plugin-framework": "^2.8.2", - "@protobuf-ts/protoc": "^2.8.2", - "@protobuf-ts/runtime": "^2.8.2", - "@protobuf-ts/runtime-rpc": "^2.8.2", - "typescript": "^3.9" - }, - "dependencies": { - "typescript": { - "version": "3.9.10", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", - "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", - "dev": true - } - } - }, - "@protobuf-ts/plugin-framework": { - "version": "2.8.2", - "resolved": "https://registry.npmjs.org/@protobuf-ts/plugin-framework/-/plugin-framework-2.8.2.tgz", - "integrity": "sha512-ivcJdNVB3Iee8044f8erZGBgmB6ZfQbbKyxRgDBXRVKYxsruLr432WcT5upw9autK9OnlSVLaebi8kDneFXd2g==", - "dev": true, - "requires": { - "@protobuf-ts/runtime": "^2.8.2", - "typescript": "^3.9" - }, - "dependencies": { - "typescript": { - "version": "3.9.10", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", - "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", - "dev": true - } - } - }, - "@protobuf-ts/protoc": { - "version": "2.8.2", - "resolved": "https://registry.npmjs.org/@protobuf-ts/protoc/-/protoc-2.8.2.tgz", - "integrity": "sha512-1e+rOgp22ElyqRWunSc8bhatJcvRe90AGPceVn67IFYzybvfKl17vP1igHddeYkN0dzOucnOrwqn2v1jnDfE2w==", - "dev": true - }, - "@protobuf-ts/runtime": { - "version": "2.8.2", - "resolved": "https://registry.npmjs.org/@protobuf-ts/runtime/-/runtime-2.8.2.tgz", - "integrity": "sha512-PVxsH81y9kEbHldxxG/8Y3z2mTXWQytRl8zNS0mTPUjkEC+8GUX6gj6LsA8EFp25fAs9V0ruh+aNWmPccEI9MA==" - }, - "@protobuf-ts/runtime-rpc": { - "version": "2.8.2", - "resolved": "https://registry.npmjs.org/@protobuf-ts/runtime-rpc/-/runtime-rpc-2.8.2.tgz", - "integrity": "sha512-vum/Y7AXdUTWGFu7dke/jCSB9dV3Oo3iVPcce3j7KudpzzWarDkEGvXjKv3Y8zJPj5waToyxwBNSb7eo5Vw5WA==", - "dev": true, - "requires": { - "@protobuf-ts/runtime": "^2.8.2" - } - }, "@sinclair/typebox": { "version": "0.24.51", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.24.51.tgz", @@ -6555,6 +7429,12 @@ "@babel/types": "^7.3.0" } }, + "@types/emscripten": { + "version": "1.39.6", + "resolved": "https://registry.npmjs.org/@types/emscripten/-/emscripten-1.39.6.tgz", + "integrity": "sha512-H90aoynNhhkQP6DRweEjJp5vfUVdIj7tdPLsu7pq89vODD/lcugKfZOsfgwpvM6XUewEp2N5dCg1Uf3Qe55Dcg==", + "dev": true + }, "@types/graceful-fs": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz", @@ -6604,12 +7484,24 @@ "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", "dev": true }, + "@types/minimist": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", + "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==", + "dev": true + }, "@types/node": { "version": "17.0.45", "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.45.tgz", "integrity": "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==", "dev": true }, + "@types/normalize-package-data": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", + "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", + "dev": true + }, "@types/prettier": { "version": "2.7.2", "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.2.tgz", @@ -6741,6 +7633,26 @@ "eslint-visitor-keys": "^3.3.0" } }, + "@yarnpkg/fslib": { + "version": "2.10.1", + "resolved": "https://registry.npmjs.org/@yarnpkg/fslib/-/fslib-2.10.1.tgz", + "integrity": "sha512-pVMLtOYu87N5y5G2lyPNYTY2JbTco99v7nGFI34Blx01Ct9LmoKVOc91vnLOYIMMljKr1c8xs1O2UamRdMG5Pg==", + "dev": true, + "requires": { + "@yarnpkg/libzip": "^2.2.4", + "tslib": "^1.13.0" + } + }, + "@yarnpkg/libzip": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/@yarnpkg/libzip/-/libzip-2.2.4.tgz", + "integrity": "sha512-QP0vUP+w0d7Jlo7jqTnlRChSnIB/dOF7nJFLD/gsPvFIHsVWLQQuAiolOcXQUD2hezLD1mQd2qb0yOKqPYRcfQ==", + "dev": true, + "requires": { + "@types/emscripten": "^1.38.0", + "tslib": "^1.13.0" + } + }, "acorn": { "version": "8.8.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", @@ -6753,6 +7665,16 @@ "dev": true, "requires": {} }, + "aggregate-error": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-4.0.1.tgz", + "integrity": "sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w==", + "dev": true, + "requires": { + "clean-stack": "^4.0.0", + "indent-string": "^5.0.0" + } + }, "ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -6819,6 +7741,12 @@ "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true }, + "arrify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-3.0.0.tgz", + "integrity": "sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==", + "dev": true + }, "babel-jest": { "version": "28.1.3", "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-28.1.3.tgz", @@ -6975,6 +7903,32 @@ "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true }, + "camelcase-keys": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-7.0.2.tgz", + "integrity": "sha512-Rjs1H+A9R+Ig+4E/9oyB66UC5Mj9Xq3N//vcLf2WzgdTi/3gUu3Z9KoqmlrEG4VuuLK8wJHofxzdQXz/knhiYg==", + "dev": true, + "requires": { + "camelcase": "^6.3.0", + "map-obj": "^4.1.0", + "quick-lru": "^5.1.1", + "type-fest": "^1.2.1" + }, + "dependencies": { + "camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true + }, + "type-fest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "dev": true + } + } + }, "caniuse-lite": { "version": "1.0.30001441", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001441.tgz", @@ -7009,6 +7963,23 @@ "integrity": "sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==", "dev": true }, + "clean-stack": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-4.2.0.tgz", + "integrity": "sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg==", + "dev": true, + "requires": { + "escape-string-regexp": "5.0.0" + }, + "dependencies": { + "escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "dev": true + } + } + }, "cliui": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", @@ -7059,6 +8030,71 @@ "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", "dev": true }, + "core-js": { + "version": "3.18.1", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.18.1.tgz", + "integrity": "sha512-vJlUi/7YdlCZeL6fXvWNaLUPh/id12WXj3MbkMw5uOyF0PfWPBNOCNbs53YqgrvtujLNlt9JQpruyIKkUZ+PKA==", + "dev": true + }, + "cp-file": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/cp-file/-/cp-file-9.1.0.tgz", + "integrity": "sha512-3scnzFj/94eb7y4wyXRWwvzLFaQp87yyfTnChIjlfYrVqp5lVO3E2hIJMeQIltUT0K2ZAB3An1qXcBmwGyvuwA==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "make-dir": "^3.0.0", + "nested-error-stacks": "^2.0.0", + "p-event": "^4.1.0" + } + }, + "cpy": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/cpy/-/cpy-9.0.1.tgz", + "integrity": "sha512-D9U0DR5FjTCN3oMTcFGktanHnAG5l020yvOCR1zKILmAyPP7I/9pl6NFgRbDcmSENtbK1sQLBz1p9HIOlroiNg==", + "dev": true, + "requires": { + "arrify": "^3.0.0", + "cp-file": "^9.1.0", + "globby": "^13.1.1", + "junk": "^4.0.0", + "micromatch": "^4.0.4", + "nested-error-stacks": "^2.1.0", + "p-filter": "^3.0.0", + "p-map": "^5.3.0" + }, + "dependencies": { + "globby": { + "version": "13.1.3", + "resolved": "https://registry.npmjs.org/globby/-/globby-13.1.3.tgz", + "integrity": "sha512-8krCNHXvlCgHDpegPzleMq07yMYTO2sXKASmZmquEYWEmCx6J5UTRbp5RwMJkTJGtcQ44YpiUYUiN0b9mzy8Bw==", + "dev": true, + "requires": { + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.11", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^4.0.0" + } + }, + "slash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", + "dev": true + } + } + }, + "cpy-cli": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/cpy-cli/-/cpy-cli-4.2.0.tgz", + "integrity": "sha512-b04b+cbdr29CdpREPKw/itrfjO43Ty0Aj7wRM6M6LoE4GJxZJCk9Xp+Eu1IqztkKh3LxIBt1tDplENsa6KYprg==", + "dev": true, + "requires": { + "cpy": "^9.0.0", + "meow": "^10.1.2" + } + }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -7101,6 +8137,36 @@ "ms": "2.1.2" } }, + "decamelize": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-5.0.1.tgz", + "integrity": "sha512-VfxadyCECXgQlkoEAjeghAr5gY3Hf+IKjKb+X8tGVDtveCjN+USwprd2q3QXBR9T1+x2DG0XZF5/w+7HAtSaXA==", + "dev": true + }, + "decamelize-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.1.tgz", + "integrity": "sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==", + "dev": true, + "requires": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + }, + "dependencies": { + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "dev": true + }, + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==", + "dev": true + } + } + }, "dedent": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", @@ -7826,6 +8892,12 @@ "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", "dev": true }, + "hard-rejection": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", + "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", + "dev": true + }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -7841,6 +8913,32 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, + "hosted-git-info": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", + "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + }, + "dependencies": { + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } + }, "html-escaper": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", @@ -7896,6 +8994,12 @@ "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true }, + "indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", + "dev": true + }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -7966,6 +9070,12 @@ "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", "dev": true }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", + "dev": true + }, "is-stream": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", @@ -8573,6 +9683,18 @@ "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true }, + "junk": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/junk/-/junk-4.0.0.tgz", + "integrity": "sha512-ojtSU++zLJ3jQG9bAYjg94w+/DOJtRyD7nPaerMFrBhmdVmiV5/exYH5t4uHga4G/95nT6hr1OJoKIFbYbrW5w==", + "dev": true + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true + }, "kleur": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", @@ -8673,13 +9795,53 @@ "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", "dev": true }, - "makeerror": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", - "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", + "makeerror": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", + "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", + "dev": true, + "requires": { + "tmpl": "1.0.5" + } + }, + "map-obj": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", + "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==", + "dev": true + }, + "meow": { + "version": "10.1.5", + "resolved": "https://registry.npmjs.org/meow/-/meow-10.1.5.tgz", + "integrity": "sha512-/d+PQ4GKmGvM9Bee/DPa8z3mXs/pkvJE2KEThngVNOqtmljC6K7NMPxtc2JeZYTmpWb9k/TmxjeL18ez3h7vCw==", "dev": true, "requires": { - "tmpl": "1.0.5" + "@types/minimist": "^1.2.2", + "camelcase-keys": "^7.0.0", + "decamelize": "^5.0.0", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "4.1.0", + "normalize-package-data": "^3.0.2", + "read-pkg-up": "^8.0.0", + "redent": "^4.0.0", + "trim-newlines": "^4.0.2", + "type-fest": "^1.2.2", + "yargs-parser": "^20.2.9" + }, + "dependencies": { + "type-fest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "dev": true + }, + "yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true + } } }, "merge-stream": { @@ -8710,6 +9872,12 @@ "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true }, + "min-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "dev": true + }, "minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -8719,6 +9887,31 @@ "brace-expansion": "^1.1.7" } }, + "minimist-options": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", + "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0", + "kind-of": "^6.0.3" + }, + "dependencies": { + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", + "dev": true + } + } + }, + "mri": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", + "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", + "dev": true + }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -8737,6 +9930,12 @@ "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", "dev": true }, + "nested-error-stacks": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-2.1.1.tgz", + "integrity": "sha512-9iN1ka/9zmX1ZvLV9ewJYEk9h7RyRRtqdK0woXcqohu8EWIerfPUjYJPg0ULy0UqP7cslmdGc8xKDJcojlKiaw==", + "dev": true + }, "node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -8749,6 +9948,18 @@ "integrity": "sha512-dFSmB8fFHEH/s81Xi+Y/15DQY6VHW81nXRj86EMSL3lmuTmK1e+aT4wrFCkTbm+gSwkw4KpX+rT/pMM2c1mF+A==", "dev": true }, + "normalize-package-data": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", + "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", + "dev": true, + "requires": { + "hosted-git-info": "^4.0.1", + "is-core-module": "^2.5.0", + "semver": "^7.3.4", + "validate-npm-package-license": "^3.0.1" + } + }, "normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -8804,6 +10015,30 @@ "word-wrap": "^1.2.3" } }, + "p-event": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/p-event/-/p-event-4.2.0.tgz", + "integrity": "sha512-KXatOjCRXXkSePPb1Nbi0p0m+gQAwdlbhi4wQKJPI1HsMQS9g+Sqp2o+QHziPr7eYJyOZet836KoHEVM1mwOrQ==", + "dev": true, + "requires": { + "p-timeout": "^3.1.0" + } + }, + "p-filter": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-filter/-/p-filter-3.0.0.tgz", + "integrity": "sha512-QtoWLjXAW++uTX67HZQz1dbTpqBfiidsB6VtQUC9iR85S120+s0T5sO6s+B5MLzFcZkrEd/DGMmCjR+f2Qpxwg==", + "dev": true, + "requires": { + "p-map": "^5.1.0" + } + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==", + "dev": true + }, "p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -8822,6 +10057,24 @@ "p-limit": "^3.0.2" } }, + "p-map": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-5.5.0.tgz", + "integrity": "sha512-VFqfGDHlx87K66yZrNdI4YGtD70IRyd+zSvgks6mzHPRNkoKy+9EKP4SFC77/vTTQYmRmti7dvqC+m5jBrBAcg==", + "dev": true, + "requires": { + "aggregate-error": "^4.0.0" + } + }, + "p-timeout": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz", + "integrity": "sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==", + "dev": true, + "requires": { + "p-finally": "^1.0.0" + } + }, "p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", @@ -8879,6 +10132,18 @@ "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true }, + "pbkit": { + "version": "0.0.59", + "resolved": "https://registry.npmjs.org/pbkit/-/pbkit-0.0.59.tgz", + "integrity": "sha512-bBivFTDbmQPqUukFegIK2ScTSNnvdp5p2ghsdpivL1ZUZ/mkzy3rGDT+PvX1enoJJTY2G6nV1Zp4G+SM5vjMJg==", + "dev": true, + "requires": { + "@yarnpkg/fslib": "^2.6.0-rc.8", + "@yarnpkg/libzip": "^2.2.2", + "core-js": "3.18.1", + "mri": "^1.2.0" + } + }, "picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", @@ -8993,24 +10258,289 @@ "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "dev": true }, + "quick-lru": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", + "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", + "dev": true + }, "react-is": { "version": "18.2.0", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", "dev": true }, + "read-pkg": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-6.0.0.tgz", + "integrity": "sha512-X1Fu3dPuk/8ZLsMhEj5f4wFAF0DWoK7qhGJvgaijocXxBmSToKfbFtqbxMO7bVjNA1dmE5huAzjXj/ey86iw9Q==", + "dev": true, + "requires": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^3.0.2", + "parse-json": "^5.2.0", + "type-fest": "^1.0.1" + }, + "dependencies": { + "type-fest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "dev": true + } + } + }, + "read-pkg-up": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-8.0.0.tgz", + "integrity": "sha512-snVCqPczksT0HS2EC+SxUndvSzn6LRCwpfSvLrIfR5BKDQQZMaI6jPRC9dYvYFDRAuFEAnkwww8kBBNE/3VvzQ==", + "dev": true, + "requires": { + "find-up": "^5.0.0", + "read-pkg": "^6.0.0", + "type-fest": "^1.0.1" + }, + "dependencies": { + "type-fest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "dev": true + } + } + }, + "redent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-4.0.0.tgz", + "integrity": "sha512-tYkDkVVtYkSVhuQ4zBgfvciymHaeuel+zFKXShfDnFP5SyVEP7qo70Rf1jTOTCx3vGNAbnEi/xFkcfQVMIBWag==", + "dev": true, + "requires": { + "indent-string": "^5.0.0", + "strip-indent": "^4.0.0" + } + }, "regexpp": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", "dev": true }, + "replace": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/replace/-/replace-1.2.2.tgz", + "integrity": "sha512-C4EDifm22XZM2b2JOYe6Mhn+lBsLBAvLbK8drfUQLTfD1KYl/n3VaW/CDju0Ny4w3xTtegBpg8YNSpFJPUDSjA==", + "dev": true, + "requires": { + "chalk": "2.4.2", + "minimatch": "3.0.5", + "yargs": "^15.3.1" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "minimatch": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.5.tgz", + "integrity": "sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + } + } + }, + "y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "dev": true + }, + "yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + } + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "dev": true }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, "resolve": { "version": "1.19.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", @@ -9116,6 +10646,12 @@ } } }, + "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==", + "dev": true + }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -9165,6 +10701,38 @@ "source-map": "^0.6.0" } }, + "spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.12", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.12.tgz", + "integrity": "sha512-rr+VVSXtRhO4OHbXUiAF7xW3Bo9DuuF6C5jH+q/x15j2jniycgKbxU09Hr0WqlSLUs4i4ltHGXqTe7VHclYWyA==", + "dev": true + }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -9235,6 +10803,15 @@ "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", "dev": true }, + "strip-indent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-4.0.0.tgz", + "integrity": "sha512-mnVSV2l+Zv6BLpSD/8V87CW/y9EmmbYzGCIavsnsI6/nwn26DwffM/yztm30Z/I2DY9wdS3vXVCMnHDgZaVNoA==", + "dev": true, + "requires": { + "min-indent": "^1.0.1" + } + }, "strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -9330,6 +10907,12 @@ "is-number": "^7.0.0" } }, + "trim-newlines": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-4.0.2.tgz", + "integrity": "sha512-GJtWyq9InR/2HRiLZgpIKv+ufIKrVrvjQWEj7PxAXNc5dwbNJkqhAUoAGgzRmULAnoOM5EIpveYd3J2VeSAIew==", + "dev": true + }, "ts-jest": { "version": "28.0.8", "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-28.0.8.tgz", @@ -9383,9 +10966,9 @@ "dev": true }, "typescript": { - "version": "4.9.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.4.tgz", - "integrity": "sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true }, "uhyphen": { @@ -9431,6 +11014,16 @@ "convert-source-map": "^1.6.0" } }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, "walker": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", @@ -9449,6 +11042,12 @@ "isexe": "^2.0.0" } }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==", + "dev": true + }, "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", diff --git a/package.json b/package.json index 5831b2ece..c73a593f6 100644 --- a/package.json +++ b/package.json @@ -2,9 +2,44 @@ "name": "youtubei.js", "version": "2.9.0", "description": "Full-featured wrapper around YouTube's private API. Supports YouTube, YouTube Music and YouTube Studio (WIP).", - "main": "./dist/index.js", - "browser": "./bundle/browser.js", - "types": "./dist", + "type": "module", + "types": "./dist/src/platform/lib.d.ts", + "typesVersions": { + "*": { + "agnostic": ["./dist/src/platform/lib.d.ts"], + "web": ["./dist/src/platform/lib.d.ts"], + "web.bundle": ["./dist/src/platform/lib.d.ts"], + "web.bundle.min": ["./dist/src/platform/lib.d.ts"] + } + }, + "exports": { + ".": { + "node": { + "import": "./dist/src/platform/node.js", + "require": "./bundle/node.cjs" + }, + "deno": "./dist/src/platform/deno.js", + "types": "./dist/src/platform/lib.d.ts", + "browser": "./dist/src/platform/web.js", + "default": "./dist/src/platform/web.js" + }, + "./agnostic": { + "types": "./dist/src/platform/lib.d.ts", + "default": "./dist/src/platform/lib.js" + }, + "./web": { + "types": "./dist/src/platform/lib.d.ts", + "default": "./dist/src/platform/web.js" + }, + "./web.bundle": { + "types": "./dist/src/platform/lib.d.ts", + "default": "./bundle/browser.js" + }, + "./web.bundle.min": { + "types": "./dist/src/platform/lib.d.ts", + "default": "./bundle/browser.min.js" + } + }, "author": "LuanRT (https://github.com/LuanRT)", "funding": [ "https://github.com/sponsors/LuanRT" @@ -24,12 +59,14 @@ "test": "npx jest --verbose", "lint": "npx eslint ./src", "lint:fix": "npx eslint --fix ./src", - "build": "npm run build:parser-map && npm run build:proto && npm run bundle:browser && npm run bundle:browser:prod && npm run build:node", - "build:node": "npx tsc", - "bundle:browser": "npx tsc --module esnext && npx esbuild ./dist/browser.js --banner:js=\"/* eslint-disable */\" --bundle --target=chrome58 --keep-names --format=esm --sourcemap --define:global=globalThis --outfile=./bundle/browser.js --platform=browser", + "build": "npm run build:parser-map && npm run build:proto && npm run build:esm && npm run bundle:node && npm run bundle:browser && npm run bundle:browser:prod", + "build:parser-map": "node ./scripts/build-parser-map.cjs", + "build:proto": "npx pb-gen-ts --entry-path=\"src/proto\" --out-dir=\"src/proto/generated\" --ext-in-import=\".js\"", + "build:esm": "npx tsc", + "build:deno": "npx cpy ./src ./deno && npx cpy ./package.json ./deno && npx replace \".js';\" \".ts';\" ./deno -r && npx replace '.js\";' '.ts\";' ./deno -r && npx replace \"'linkedom';\" \"'https://esm.sh/linkedom';\" ./deno -r && npx replace \"'jintr';\" \"'https://esm.sh/jintr';\" ./deno -r && npx replace \"new Jinter.default\" \"new Jinter\" ./deno -r", + "bundle:node": "npx esbuild ./dist/src/platform/node.js --bundle --target=node10 --keep-names --format=cjs --platform=node --outfile=./bundle/node.cjs --external:jintr --external:undici --external:linkedom --sourcemap --banner:js=\"/* eslint-disable */\"", + "bundle:browser": "npx esbuild ./dist/src/platform/web.js --banner:js=\"/* eslint-disable */\" --bundle --target=chrome58 --keep-names --format=esm --sourcemap --define:global=globalThis --outfile=./bundle/browser.js --platform=browser", "bundle:browser:prod": "npm run bundle:browser -- --outfile=./bundle/browser.min.js --minify", - "build:parser-map": "node ./scripts/build-parser-map.js", - "build:proto": "npx protoc --ts_out ./src/proto --proto_path ./src/proto ./src/proto/youtube.proto", "prepare": "npm run build", "watch": "npx tsc --watch" }, @@ -39,24 +76,25 @@ }, "license": "MIT", "dependencies": { - "@protobuf-ts/runtime": "^2.7.0", "jintr": "^0.3.1", "linkedom": "^0.14.12", "undici": "^5.7.0" }, "devDependencies": { - "@protobuf-ts/plugin": "^2.7.0", "@types/jest": "^28.1.7", "@types/node": "^17.0.45", "@typescript-eslint/eslint-plugin": "^5.30.6", "@typescript-eslint/parser": "^5.30.6", + "cpy-cli": "^4.2.0", "esbuild": "^0.14.49", "eslint": "^8.19.0", "eslint-plugin-tsdoc": "^0.2.16", "glob": "^8.0.3", "jest": "^28.1.3", + "pbkit": "^0.0.59", + "replace": "^1.2.2", "ts-jest": "^28.0.8", - "typescript": "^4.7.4" + "typescript": "^4.9.5" }, "bugs": { "url": "https://github.com/LuanRT/YouTube.js/issues" diff --git a/scripts/build-parser-map.js b/scripts/build-parser-map.cjs similarity index 64% rename from scripts/build-parser-map.js rename to scripts/build-parser-map.cjs index 571ddde6e..de10d0345 100644 --- a/scripts/build-parser-map.js +++ b/scripts/build-parser-map.cjs @@ -5,22 +5,30 @@ const path = require('path'); const import_list = []; const json = []; +const misc_exports = []; glob.sync('../src/parser/classes/**/*.{js,ts}', { cwd: __dirname }) .forEach((file) => { - if (file.includes('/misc/')) return; // Trim path + const is_misc = file.includes('/misc/'); file = file.replace('../src/parser/classes/', '').replace('.js', '').replace('.ts', ''); const import_name = file.split('/').pop(); - import_list.push(`import { default as ${import_name} } from './classes/${file}';`); - json.push(import_name); + + if (is_misc) { + const class_name = file.split('/').pop().replace('.js', '').replace('.ts', ''); + import_list.push(`import { default as ${class_name} } from './classes/${file}.js';`); + misc_exports.push(class_name); + } else { + import_list.push(`import { default as ${import_name} } from './classes/${file}.js';`); + json.push(import_name); + } }); fs.writeFileSync( path.resolve(__dirname, '../src/parser/map.ts'), `// This file was auto generated, do not edit. // See ./scripts/build-parser-map.js -import { YTNodeConstructor } from './helpers'; +import { YTNodeConstructor } from './helpers.js'; ${import_list.join('\n')} @@ -28,6 +36,10 @@ export const YTNodes = { ${json.join(',\n ')} }; +export const Misc = { + ${misc_exports.join(',\n ')} +}; + const map: Record = YTNodes; /** diff --git a/scripts/get-agents.js b/scripts/get-agents.js new file mode 100644 index 000000000..358f97cba --- /dev/null +++ b/scripts/get-agents.js @@ -0,0 +1,52 @@ +import { fetch } from 'undici'; +import { gunzip } from 'zlib'; +import { dirname, resolve } from 'path'; +import { fileURLToPath } from 'url'; +import { writeFile } from 'fs/promises'; + +(async () => { + + const __dirname = dirname(fileURLToPath(import.meta.url)); + + const buf = await (await fetch('https://github.com/intoli/user-agents/blob/master/src/user-agents.json.gz?raw=true')).arrayBuffer(); + const bytes = new Uint8Array(buf); + + // Only get desktop and mobile agents + const allowed_agents = new Set([ + 'desktop', + 'mobile' + ]); + + const decompressed = await new Promise((resolve, reject) => { + gunzip(bytes, (err, result) => { + if (err) { + reject(err); + } else { + resolve(result.buffer); + } + }); + }); + + const contents = new TextDecoder().decode(decompressed); + + const agents = JSON.parse(contents); + + if (!Array.isArray(agents)) { + throw new Error('Invalid user-agents.json'); + } + + const agentsByDevice = agents.reduce((acc, agent) => { + const device = agent.deviceCategory; + if (!allowed_agents.has(device)) + return acc; + if (!acc[device]) { + acc[device] = []; + } + // We dont want to massive of a list of agents for each device + if (acc[device].length <= 25) acc[device].push(agent.userAgent); + return acc; + }, {}); + + await writeFile(resolve(__dirname, '..', 'src', 'utils', 'user-agents.ts'), `/* eslint-disable */\n/* Generated file do not edit */\nexport default ${JSON.stringify(agentsByDevice, null, 2)} as { desktop: string[], mobile: string[] };`); + +})(); diff --git a/scripts/get-agents.mjs b/scripts/get-agents.mjs deleted file mode 100644 index 50caf3675..000000000 --- a/scripts/get-agents.mjs +++ /dev/null @@ -1,52 +0,0 @@ -import { fetch } from "undici"; -import { gunzip } from "zlib"; -import { dirname, resolve } from 'path'; -import { fileURLToPath } from 'url'; -import { writeFile } from "fs/promises"; - -(async () => { - -const __dirname = dirname(fileURLToPath(import.meta.url)); - -const buf = await (await fetch('https://github.com/intoli/user-agents/blob/master/src/user-agents.json.gz?raw=true')).arrayBuffer(); -const bytes = new Uint8Array(buf); - -// Only get desktop and mobile agents -const allowed_agents = new Set([ - 'desktop', - 'mobile', -]) - -const decompressed = await new Promise((resolve, reject) => { - gunzip(bytes, (err, result) => { - if (err) { - reject(err); - } else { - resolve(result.buffer); - } - }); -}); - -const contents = new TextDecoder().decode(decompressed); - -const agents = JSON.parse(contents); - -if (!Array.isArray(agents)) { - throw new Error('Invalid user-agents.json'); -} - -const agentsByDevice = agents.reduce((acc, agent) => { - const device = agent.deviceCategory; - if (!allowed_agents.has(device)) - return acc; - if (!acc[device]) { - acc[device] = []; - } - // we dont want to massive of a list of agents for each device - if (acc[device].length <= 25) acc[device].push(agent.userAgent); - return acc; -}, {}); - -await writeFile(resolve(__dirname, '..', 'src', 'utils', 'user-agents.json'), JSON.stringify(agentsByDevice, null, 2)); - -})(); diff --git a/src/Innertube.ts b/src/Innertube.ts index 1284d58fa..661ea6bd6 100644 --- a/src/Innertube.ts +++ b/src/Innertube.ts @@ -1,35 +1,35 @@ -import Session, { SessionOptions } from './core/Session'; -import type { ParsedResponse } from './parser'; -import type { ActionsResponse } from './core/Actions'; - -import NavigationEndpoint from './parser/classes/NavigationEndpoint'; -import Channel from './parser/youtube/Channel'; -import Comments from './parser/youtube/Comments'; -import History from './parser/youtube/History'; -import Library from './parser/youtube/Library'; -import NotificationsMenu from './parser/youtube/NotificationsMenu'; -import Playlist from './parser/youtube/Playlist'; -import Search from './parser/youtube/Search'; -import VideoInfo from './parser/youtube/VideoInfo'; - -import AccountManager from './core/AccountManager'; -import Feed from './core/Feed'; -import InteractionManager from './core/InteractionManager'; -import YTMusic from './core/Music'; -import PlaylistManager from './core/PlaylistManager'; -import YTStudio from './core/Studio'; -import YTKids from './core/Kids'; -import TabbedFeed from './core/TabbedFeed'; -import HomeFeed from './parser/youtube/HomeFeed'; -import Proto from './proto/index'; -import Constants from './utils/Constants'; - -import type Actions from './core/Actions'; -import type Format from './parser/classes/misc/Format'; - -import { generateRandomString, throwIfMissing } from './utils/Utils'; -import type { FormatOptions, DownloadOptions } from './utils/FormatUtils'; +import Session, { SessionOptions } from './core/Session.js'; +import type { ParsedResponse } from './parser/index.js'; +import type { ActionsResponse } from './core/Actions.js'; + +import NavigationEndpoint from './parser/classes/NavigationEndpoint.js'; +import Channel from './parser/youtube/Channel.js'; +import Comments from './parser/youtube/Comments.js'; +import History from './parser/youtube/History.js'; +import Library from './parser/youtube/Library.js'; +import NotificationsMenu from './parser/youtube/NotificationsMenu.js'; +import Playlist from './parser/youtube/Playlist.js'; +import Search from './parser/youtube/Search.js'; +import VideoInfo from './parser/youtube/VideoInfo.js'; + +import AccountManager from './core/AccountManager.js'; +import Feed from './core/Feed.js'; +import InteractionManager from './core/InteractionManager.js'; +import YTMusic from './core/Music.js'; +import PlaylistManager from './core/PlaylistManager.js'; +import YTStudio from './core/Studio.js'; +import YTKids from './core/Kids.js'; +import TabbedFeed from './core/TabbedFeed.js'; +import HomeFeed from './parser/youtube/HomeFeed.js'; +import Proto from './proto/index.js'; +import Constants from './utils/Constants.js'; + +import type Actions from './core/Actions.js'; +import type Format from './parser/classes/misc/Format.js'; + +import { generateRandomString, throwIfMissing } from './utils/Utils.js'; +import type { FormatOptions, DownloadOptions } from './utils/FormatUtils.js'; export type InnertubeConfig = SessionOptions; diff --git a/src/core/AccountManager.ts b/src/core/AccountManager.ts index 4ded931dc..716c78726 100644 --- a/src/core/AccountManager.ts +++ b/src/core/AccountManager.ts @@ -1,13 +1,13 @@ -import Proto from '../proto/index'; -import type Actions from './Actions'; -import type { ActionsResponse } from './Actions'; +import Proto from '../proto/index.js'; +import type Actions from './Actions.js'; +import type { ActionsResponse } from './Actions.js'; -import Analytics from '../parser/youtube/Analytics'; -import TimeWatched from '../parser/youtube/TimeWatched'; -import AccountInfo from '../parser/youtube/AccountInfo'; -import Settings from '../parser/youtube/Settings'; +import Analytics from '../parser/youtube/Analytics.js'; +import TimeWatched from '../parser/youtube/TimeWatched.js'; +import AccountInfo from '../parser/youtube/AccountInfo.js'; +import Settings from '../parser/youtube/Settings.js'; -import { InnertubeError } from '../utils/Utils'; +import { InnertubeError } from '../utils/Utils.js'; class AccountManager { #actions: Actions; diff --git a/src/core/Actions.ts b/src/core/Actions.ts index 4d22ba2f0..f883a38dd 100644 --- a/src/core/Actions.ts +++ b/src/core/Actions.ts @@ -1,6 +1,6 @@ -import Parser, { ParsedResponse } from '../parser/index'; -import { InnertubeError } from '../utils/Utils'; -import type Session from './Session'; +import Parser, { ParsedResponse } from '../parser/index.js'; +import { InnertubeError } from '../utils/Utils.js'; +import type Session from './Session.js'; export interface ApiResponse { success: boolean; diff --git a/src/core/Feed.ts b/src/core/Feed.ts index 12d34757d..bb18e0175 100644 --- a/src/core/Feed.ts +++ b/src/core/Feed.ts @@ -1,34 +1,34 @@ -import type { Memo, ObservedArray, SuperParsedResult, YTNode } from '../parser/helpers'; -import Parser, { ParsedResponse, ReloadContinuationItemsCommand } from '../parser/index'; -import { concatMemos, InnertubeError } from '../utils/Utils'; -import type Actions from './Actions'; - -import BackstagePost from '../parser/classes/BackstagePost'; -import Channel from '../parser/classes/Channel'; -import CompactVideo from '../parser/classes/CompactVideo'; -import GridChannel from '../parser/classes/GridChannel'; -import GridPlaylist from '../parser/classes/GridPlaylist'; -import GridVideo from '../parser/classes/GridVideo'; -import Playlist from '../parser/classes/Playlist'; -import PlaylistPanelVideo from '../parser/classes/PlaylistPanelVideo'; -import PlaylistVideo from '../parser/classes/PlaylistVideo'; -import Post from '../parser/classes/Post'; -import ReelItem from '../parser/classes/ReelItem'; -import ReelShelf from '../parser/classes/ReelShelf'; -import RichShelf from '../parser/classes/RichShelf'; -import Shelf from '../parser/classes/Shelf'; -import Tab from '../parser/classes/Tab'; -import Video from '../parser/classes/Video'; - -import AppendContinuationItemsAction from '../parser/classes/actions/AppendContinuationItemsAction'; -import ContinuationItem from '../parser/classes/ContinuationItem'; -import TwoColumnBrowseResults from '../parser/classes/TwoColumnBrowseResults'; -import TwoColumnSearchResults from '../parser/classes/TwoColumnSearchResults'; -import WatchCardCompactVideo from '../parser/classes/WatchCardCompactVideo'; - -import type MusicQueue from '../parser/classes/MusicQueue'; -import type RichGrid from '../parser/classes/RichGrid'; -import type SectionList from '../parser/classes/SectionList'; +import type { Memo, ObservedArray, SuperParsedResult, YTNode } from '../parser/helpers.js'; +import Parser, { ParsedResponse, ReloadContinuationItemsCommand } from '../parser/index.js'; +import { concatMemos, InnertubeError } from '../utils/Utils.js'; +import type Actions from './Actions.js'; + +import BackstagePost from '../parser/classes/BackstagePost.js'; +import Channel from '../parser/classes/Channel.js'; +import CompactVideo from '../parser/classes/CompactVideo.js'; +import GridChannel from '../parser/classes/GridChannel.js'; +import GridPlaylist from '../parser/classes/GridPlaylist.js'; +import GridVideo from '../parser/classes/GridVideo.js'; +import Playlist from '../parser/classes/Playlist.js'; +import PlaylistPanelVideo from '../parser/classes/PlaylistPanelVideo.js'; +import PlaylistVideo from '../parser/classes/PlaylistVideo.js'; +import Post from '../parser/classes/Post.js'; +import ReelItem from '../parser/classes/ReelItem.js'; +import ReelShelf from '../parser/classes/ReelShelf.js'; +import RichShelf from '../parser/classes/RichShelf.js'; +import Shelf from '../parser/classes/Shelf.js'; +import Tab from '../parser/classes/Tab.js'; +import Video from '../parser/classes/Video.js'; + +import AppendContinuationItemsAction from '../parser/classes/actions/AppendContinuationItemsAction.js'; +import ContinuationItem from '../parser/classes/ContinuationItem.js'; +import TwoColumnBrowseResults from '../parser/classes/TwoColumnBrowseResults.js'; +import TwoColumnSearchResults from '../parser/classes/TwoColumnSearchResults.js'; +import WatchCardCompactVideo from '../parser/classes/WatchCardCompactVideo.js'; + +import type MusicQueue from '../parser/classes/MusicQueue.js'; +import type RichGrid from '../parser/classes/RichGrid.js'; +import type SectionList from '../parser/classes/SectionList.js'; class Feed { #page: ParsedResponse; diff --git a/src/core/FilterableFeed.ts b/src/core/FilterableFeed.ts index f9036547d..36c629465 100644 --- a/src/core/FilterableFeed.ts +++ b/src/core/FilterableFeed.ts @@ -1,10 +1,10 @@ -import ChipCloudChip from '../parser/classes/ChipCloudChip'; -import FeedFilterChipBar from '../parser/classes/FeedFilterChipBar'; -import Feed from './Feed'; +import ChipCloudChip from '../parser/classes/ChipCloudChip.js'; +import FeedFilterChipBar from '../parser/classes/FeedFilterChipBar.js'; +import Feed from './Feed.js'; -import type { ObservedArray } from '../parser/helpers'; -import { InnertubeError } from '../utils/Utils'; -import type Actions from './Actions'; +import type { ObservedArray } from '../parser/helpers.js'; +import { InnertubeError } from '../utils/Utils.js'; +import type Actions from './Actions.js'; class FilterableFeed extends Feed { #chips?: ObservedArray; diff --git a/src/core/InteractionManager.ts b/src/core/InteractionManager.ts index e90cd7bf0..1798fefa3 100644 --- a/src/core/InteractionManager.ts +++ b/src/core/InteractionManager.ts @@ -1,7 +1,7 @@ -import Proto from '../proto'; -import type Actions from './Actions'; -import type { ApiResponse } from './Actions'; -import { throwIfMissing } from '../utils/Utils'; +import Proto from '../proto/index.js'; +import type Actions from './Actions.js'; +import type { ApiResponse } from './Actions.js'; +import { throwIfMissing } from '../utils/Utils.js'; class InteractionManager { #actions: Actions; diff --git a/src/core/Kids.ts b/src/core/Kids.ts index a5a2962a3..2de148c46 100644 --- a/src/core/Kids.ts +++ b/src/core/Kids.ts @@ -1,10 +1,10 @@ -import Search from '../parser/ytkids/Search'; -import HomeFeed from '../parser/ytkids/HomeFeed'; -import VideoInfo from '../parser/ytkids/VideoInfo'; -import Channel from '../parser/ytkids/Channel'; -import type Session from './Session'; +import Search from '../parser/ytkids/Search.js'; +import HomeFeed from '../parser/ytkids/HomeFeed.js'; +import VideoInfo from '../parser/ytkids/VideoInfo.js'; +import Channel from '../parser/ytkids/Channel.js'; +import type Session from './Session.js'; -import { generateRandomString } from '../utils/Utils'; +import { generateRandomString } from '../utils/Utils.js'; class Kids { #session: Session; diff --git a/src/core/Music.ts b/src/core/Music.ts index 18421dda3..47ce6fbf6 100644 --- a/src/core/Music.ts +++ b/src/core/Music.ts @@ -1,32 +1,32 @@ -import Album from '../parser/ytmusic/Album'; -import Artist from '../parser/ytmusic/Artist'; -import Explore from '../parser/ytmusic/Explore'; -import HomeFeed from '../parser/ytmusic/HomeFeed'; -import Library from '../parser/ytmusic/Library'; -import Playlist from '../parser/ytmusic/Playlist'; -import Recap from '../parser/ytmusic/Recap'; -import Search from '../parser/ytmusic/Search'; -import TrackInfo from '../parser/ytmusic/TrackInfo'; - -import AutomixPreviewVideo from '../parser/classes/AutomixPreviewVideo'; -import Message from '../parser/classes/Message'; -import MusicCarouselShelf from '../parser/classes/MusicCarouselShelf'; -import MusicDescriptionShelf from '../parser/classes/MusicDescriptionShelf'; -import MusicQueue from '../parser/classes/MusicQueue'; -import MusicTwoRowItem from '../parser/classes/MusicTwoRowItem'; -import PlaylistPanel from '../parser/classes/PlaylistPanel'; -import SearchSuggestionsSection from '../parser/classes/SearchSuggestionsSection'; -import SectionList from '../parser/classes/SectionList'; -import Tab from '../parser/classes/Tab'; - -import { observe } from '../parser/helpers'; -import Proto from '../proto'; -import { generateRandomString, InnertubeError, throwIfMissing } from '../utils/Utils'; - -import type { ObservedArray, YTNode } from '../parser/helpers'; -import type Actions from './Actions'; -import type Session from './Session'; +import Album from '../parser/ytmusic/Album.js'; +import Artist from '../parser/ytmusic/Artist.js'; +import Explore from '../parser/ytmusic/Explore.js'; +import HomeFeed from '../parser/ytmusic/HomeFeed.js'; +import Library from '../parser/ytmusic/Library.js'; +import Playlist from '../parser/ytmusic/Playlist.js'; +import Recap from '../parser/ytmusic/Recap.js'; +import Search from '../parser/ytmusic/Search.js'; +import TrackInfo from '../parser/ytmusic/TrackInfo.js'; + +import AutomixPreviewVideo from '../parser/classes/AutomixPreviewVideo.js'; +import Message from '../parser/classes/Message.js'; +import MusicCarouselShelf from '../parser/classes/MusicCarouselShelf.js'; +import MusicDescriptionShelf from '../parser/classes/MusicDescriptionShelf.js'; +import MusicQueue from '../parser/classes/MusicQueue.js'; +import MusicTwoRowItem from '../parser/classes/MusicTwoRowItem.js'; +import PlaylistPanel from '../parser/classes/PlaylistPanel.js'; +import SearchSuggestionsSection from '../parser/classes/SearchSuggestionsSection.js'; +import SectionList from '../parser/classes/SectionList.js'; +import Tab from '../parser/classes/Tab.js'; + +import { observe } from '../parser/helpers.js'; +import Proto from '../proto/index.js'; +import { generateRandomString, InnertubeError, throwIfMissing } from '../utils/Utils.js'; + +import type { ObservedArray, YTNode } from '../parser/helpers.js'; +import type Actions from './Actions.js'; +import type Session from './Session.js'; class Music { #session: Session; diff --git a/src/core/OAuth.ts b/src/core/OAuth.ts index f0882206a..a434e8367 100644 --- a/src/core/OAuth.ts +++ b/src/core/OAuth.ts @@ -1,6 +1,6 @@ -import Constants from '../utils/Constants'; -import { OAuthError, uuidv4 } from '../utils/Utils'; -import type Session from './Session'; +import Constants from '../utils/Constants.js'; +import { OAuthError, Platform } from '../utils/Utils.js'; +import type Session from './Session.js'; export interface Credentials { /** @@ -95,7 +95,7 @@ class OAuth { const data = { client_id: this.#identity.client_id, scope: Constants.OAUTH.SCOPE, - device_id: uuidv4(), + device_id: Platform.shim.uuidv4(), model_name: Constants.OAUTH.MODEL_NAME }; diff --git a/src/core/Player.ts b/src/core/Player.ts index a1c8f48fa..6ee6ac120 100644 --- a/src/core/Player.ts +++ b/src/core/Player.ts @@ -1,12 +1,9 @@ -import { getRandomUserAgent, getStringBetweenStrings, PlayerError } from '../utils/Utils'; +import { Platform, getRandomUserAgent, getStringBetweenStrings, PlayerError } from '../utils/Utils.js'; -import Constants from '../utils/Constants'; -import UniversalCache from '../utils/Cache'; +import Constants from '../utils/Constants.js'; -// See: https://github.com/LuanRT/Jinter -import Jinter from 'jintr'; - -import type { FetchFunction } from '../utils/HTTPClient'; +import { ICache } from '../types/Cache.js'; +import { FetchFunction } from '../types/PlatformShim.js'; export default class Player { #nsig_sc; @@ -23,7 +20,7 @@ export default class Player { this.#player_id = player_id; } - static async create(cache: UniversalCache | undefined, fetch: FetchFunction = globalThis.fetch): Promise { + static async create(cache: ICache | undefined, fetch: FetchFunction = Platform.shim.fetch): Promise { const url = new URL('/iframe_api', Constants.URLS.YT_BASE); const res = await fetch(url); @@ -78,10 +75,12 @@ export default class Player { url_components.searchParams.set('alr', 'yes'); if (signature_cipher || cipher) { - const sig_decipher = new Jinter(this.#sig_sc); - sig_decipher.scope.set('sig', args.get('s')); + const signature = Platform.shim.eval(this.#sig_sc, { + sig: args.get('s') + }); - const signature = sig_decipher.interpret(); + if (typeof signature !== 'string') + throw new PlayerError('Failed to decipher signature'); const sp = args.get('sp'); @@ -93,10 +92,12 @@ export default class Player { const n = url_components.searchParams.get('n'); if (n) { - const nsig_decipher = new Jinter(this.#nsig_sc); - nsig_decipher.scope.set('nsig', n); + const nsig = Platform.shim.eval(this.#nsig_sc, { + nsig: n + }); - const nsig = nsig_decipher.interpret(); + if (typeof nsig !== 'string') + throw new PlayerError('Failed to decipher nsig'); if (nsig.startsWith('enhanced_except_')) { console.warn('Warning:\nCould not transform nsig, download may be throttled.\nChanging the InnerTube client to "ANDROID" might help!'); @@ -108,7 +109,7 @@ export default class Player { return url_components.toString(); } - static async fromCache(cache: UniversalCache, player_id: string): Promise { + static async fromCache(cache: ICache, player_id: string): Promise { const buffer = await cache.get(player_id); if (!buffer) @@ -134,13 +135,13 @@ export default class Player { return new Player(sig_timestamp, sig_sc, nsig_sc, player_id); } - static async fromSource(cache: UniversalCache | undefined, sig_timestamp: number, sig_sc: string, nsig_sc: string, player_id: string): Promise { + static async fromSource(cache: ICache | undefined, sig_timestamp: number, sig_sc: string, nsig_sc: string, player_id: string): Promise { const player = new Player(sig_timestamp, sig_sc, nsig_sc, player_id); await player.cache(cache); return player; } - async cache(cache?: UniversalCache): Promise { + async cache(cache?: ICache): Promise { if (!cache) return; const encoder = new TextEncoder(); diff --git a/src/core/PlaylistManager.ts b/src/core/PlaylistManager.ts index 51e9fd6c9..63a83f3c0 100644 --- a/src/core/PlaylistManager.ts +++ b/src/core/PlaylistManager.ts @@ -1,8 +1,8 @@ -import type Feed from './Feed'; -import type Actions from './Actions'; -import Playlist from '../parser/youtube/Playlist'; +import type Feed from './Feed.js'; +import type Actions from './Actions.js'; +import Playlist from '../parser/youtube/Playlist.js'; -import { InnertubeError, throwIfMissing } from '../utils/Utils'; +import { InnertubeError, throwIfMissing } from '../utils/Utils.js'; class PlaylistManager { #actions: Actions; diff --git a/src/core/Session.ts b/src/core/Session.ts index f698142d0..3b99426a4 100644 --- a/src/core/Session.ts +++ b/src/core/Session.ts @@ -1,13 +1,14 @@ -import UniversalCache from '../utils/Cache'; -import Constants, { CLIENTS } from '../utils/Constants'; -import EventEmitterLike from '../utils/EventEmitterLike'; -import Actions from './Actions'; -import Player from './Player'; - -import HTTPClient, { FetchFunction } from '../utils/HTTPClient'; -import { DeviceCategory, generateRandomString, getRandomUserAgent, InnertubeError, SessionError } from '../utils/Utils'; -import OAuth, { Credentials, OAuthAuthErrorEventHandler, OAuthAuthEventHandler, OAuthAuthPendingEventHandler } from './OAuth'; -import Proto from '../proto'; +import Constants, { CLIENTS } from '../utils/Constants.js'; +import EventEmitterLike from '../utils/EventEmitterLike.js'; +import Actions from './Actions.js'; +import Player from './Player.js'; + +import HTTPClient from '../utils/HTTPClient.js'; +import { Platform, DeviceCategory, generateRandomString, getRandomUserAgent, InnertubeError, SessionError } from '../utils/Utils.js'; +import OAuth, { Credentials, OAuthAuthErrorEventHandler, OAuthAuthEventHandler, OAuthAuthPendingEventHandler } from './OAuth.js'; +import Proto from '../proto/index.js'; +import { ICache } from '../types/Cache.js'; +import { FetchFunction } from '../types/PlatformShim.js'; export enum ClientType { WEB = 'WEB', @@ -112,7 +113,7 @@ export interface SessionOptions { /** * Used to cache the deciphering functions from the JS player. */ - cache?: UniversalCache; + cache?: ICache; /** * YouTube cookies. */ @@ -140,9 +141,9 @@ export default class Session extends EventEmitterLike { http: HTTPClient; logged_in: boolean; actions: Actions; - cache?: UniversalCache; + cache?: ICache; - constructor(context: Context, api_key: string, api_version: string, account_index: number, player?: Player, cookie?: string, fetch?: FetchFunction, cache?: UniversalCache) { + constructor(context: Context, api_key: string, api_version: string, account_index: number, player?: Player, cookie?: string, fetch?: FetchFunction, cache?: ICache) { super(); this.#context = context; this.#account_index = account_index; @@ -202,7 +203,7 @@ export default class Session extends EventEmitterLike { device_category: DeviceCategory = 'desktop', client_name: ClientType = ClientType.WEB, tz: string = Intl.DateTimeFormat().resolvedOptions().timeZone, - fetch: FetchFunction = globalThis.fetch + fetch: FetchFunction = Platform.shim.fetch ) { let session_data: SessionData; @@ -222,7 +223,7 @@ export default class Session extends EventEmitterLike { device_category: string; client_name: string; enable_safety_mode: boolean; - }, fetch: FetchFunction = globalThis.fetch): Promise { + }, fetch: FetchFunction = Platform.shim.fetch): Promise { const url = new URL('/sw.js_data', Constants.URLS.YT_BASE); const res = await fetch(url, { diff --git a/src/core/Studio.ts b/src/core/Studio.ts index e271bcfde..fecce9150 100644 --- a/src/core/Studio.ts +++ b/src/core/Studio.ts @@ -1,9 +1,9 @@ -import Proto from '../proto'; -import { Constants } from '../utils'; -import { InnertubeError, MissingParamError, uuidv4 } from '../utils/Utils'; +import Proto from '../proto/index.js'; +import { Constants } from '../utils/index.js'; +import { InnertubeError, MissingParamError, Platform } from '../utils/Utils.js'; -import type { ApiResponse } from './Actions'; -import type Session from './Session'; +import type { ApiResponse } from './Actions.js'; +import type Session from './Session.js'; interface UploadResult { status: string; @@ -120,12 +120,12 @@ class Studio { } async #getInitialUploadData(): Promise { - const frontend_upload_id = `innertube_android:${uuidv4()}:0:v=3,api=1,cf=3`; + const frontend_upload_id = `innertube_android:${Platform.shim.uuidv4()}:0:v=3,api=1,cf=3`; const payload = { frontendUploadId: frontend_upload_id, deviceDisplayName: 'Pixel 6 Pro', - fileId: `goog-edited-video://generated?videoFileUri=content://media/external/video/media/${uuidv4()}`, + fileId: `goog-edited-video://generated?videoFileUri=content://media/external/video/media/${Platform.shim.uuidv4()}`, mp4MoovAtomRelocationStatus: 'UNSUPPORTED', transcodeResult: 'DISABLED', connectionType: 'WIFI' diff --git a/src/core/TabbedFeed.ts b/src/core/TabbedFeed.ts index 78cf62940..1167850f7 100644 --- a/src/core/TabbedFeed.ts +++ b/src/core/TabbedFeed.ts @@ -1,9 +1,9 @@ -import Tab from '../parser/classes/Tab'; -import Feed from './Feed'; -import { InnertubeError } from '../utils/Utils'; +import Tab from '../parser/classes/Tab.js'; +import Feed from './Feed.js'; +import { InnertubeError } from '../utils/Utils.js'; -import type Actions from './Actions'; -import type { ObservedArray } from '../parser/helpers'; +import type Actions from './Actions.js'; +import type { ObservedArray } from '../parser/helpers.js'; class TabbedFeed extends Feed { #tabs: ObservedArray; diff --git a/src/core/index.ts b/src/core/index.ts new file mode 100644 index 000000000..a38ea0821 --- /dev/null +++ b/src/core/index.ts @@ -0,0 +1,38 @@ +export { default as AccountManager } from './AccountManager.js'; +export * from './AccountManager.js'; + +export { default as Actions } from './Actions.js'; +export * from './Actions.js'; + +export { default as Feed } from './Feed.js'; +export * from './Feed.js'; + +export { default as FilterableFeed } from './FilterableFeed.js'; +export * from './FilterableFeed.js'; + +export { default as InteractionManager } from './InteractionManager.js'; +export * from './InteractionManager.js'; + +export { default as Kids } from './Kids.js'; +export * from './Kids.js'; + +export { default as Music } from './Music.js'; +export * from './Music.js'; + +export { default as OAuth } from './OAuth.js'; +export * from './OAuth.js'; + +export { default as Player } from './Player.js'; +export * from './Player.js'; + +export { default as PlaylistManager } from './PlaylistManager.js'; +export * from './PlaylistManager.js'; + +export { default as Session } from './Session.js'; +export * from './Session.js'; + +export { default as Studio } from './Studio.js'; +export * from './Studio.js'; + +export { default as TabbedFeed } from './TabbedFeed.js'; +export * from './TabbedFeed.js'; diff --git a/src/parser/classes/AccountChannel.ts b/src/parser/classes/AccountChannel.ts index 2a667c678..cec2b19fa 100644 --- a/src/parser/classes/AccountChannel.ts +++ b/src/parser/classes/AccountChannel.ts @@ -1,6 +1,6 @@ -import Text from './misc/Text'; -import NavigationEndpoint from './NavigationEndpoint'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { YTNode } from '../helpers.js'; class AccountChannel extends YTNode { static type = 'AccountChannel'; diff --git a/src/parser/classes/AccountItemSection.ts b/src/parser/classes/AccountItemSection.ts index a00addf43..40daceb1b 100644 --- a/src/parser/classes/AccountItemSection.ts +++ b/src/parser/classes/AccountItemSection.ts @@ -1,11 +1,11 @@ -import Parser from '..'; +import Parser from '../index.js'; -import Text from './misc/Text'; -import Thumbnail from './misc/Thumbnail'; -import NavigationEndpoint from './NavigationEndpoint'; -import AccountItemSectionHeader from './AccountItemSectionHeader'; +import Text from './misc/Text.js'; +import Thumbnail from './misc/Thumbnail.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import AccountItemSectionHeader from './AccountItemSectionHeader.js'; -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class AccountItem { static type = 'AccountItem'; diff --git a/src/parser/classes/AccountItemSectionHeader.ts b/src/parser/classes/AccountItemSectionHeader.ts index 631378f13..91d40edb7 100644 --- a/src/parser/classes/AccountItemSectionHeader.ts +++ b/src/parser/classes/AccountItemSectionHeader.ts @@ -1,5 +1,5 @@ -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class AccountItemSectionHeader extends YTNode { static type = 'AccountItemSectionHeader'; diff --git a/src/parser/classes/AccountSectionList.ts b/src/parser/classes/AccountSectionList.ts index 8d38cd3c5..03bc27cc4 100644 --- a/src/parser/classes/AccountSectionList.ts +++ b/src/parser/classes/AccountSectionList.ts @@ -1,8 +1,8 @@ -import Parser from '..'; -import AccountChannel from './AccountChannel'; -import AccountItemSection from './AccountItemSection'; +import Parser from '../index.js'; +import AccountChannel from './AccountChannel.js'; +import AccountItemSection from './AccountItemSection.js'; -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class AccountSectionList extends YTNode { static type = 'AccountSectionList'; diff --git a/src/parser/classes/Alert.ts b/src/parser/classes/Alert.ts index ffca5aaae..d095bee2a 100644 --- a/src/parser/classes/Alert.ts +++ b/src/parser/classes/Alert.ts @@ -1,5 +1,5 @@ -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class Alert extends YTNode { static type = 'Alert'; diff --git a/src/parser/classes/AudioOnlyPlayability.ts b/src/parser/classes/AudioOnlyPlayability.ts index 2b52c1345..f1d4ed3a0 100644 --- a/src/parser/classes/AudioOnlyPlayability.ts +++ b/src/parser/classes/AudioOnlyPlayability.ts @@ -1,4 +1,4 @@ -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class AudioOnlyPlayability extends YTNode { static type = 'AudioOnlyPlayability'; diff --git a/src/parser/classes/AutomixPreviewVideo.ts b/src/parser/classes/AutomixPreviewVideo.ts index dde29a867..e697106f4 100644 --- a/src/parser/classes/AutomixPreviewVideo.ts +++ b/src/parser/classes/AutomixPreviewVideo.ts @@ -1,5 +1,5 @@ -import { YTNode } from '../helpers'; -import NavigationEndpoint from './NavigationEndpoint'; +import { YTNode } from '../helpers.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; class AutomixPreviewVideo extends YTNode { static type = 'AutomixPreviewVideo'; diff --git a/src/parser/classes/BackstageImage.ts b/src/parser/classes/BackstageImage.ts index fa03bdaa4..af11137e0 100644 --- a/src/parser/classes/BackstageImage.ts +++ b/src/parser/classes/BackstageImage.ts @@ -1,6 +1,6 @@ -import Thumbnail from './misc/Thumbnail'; -import NavigationEndpoint from './NavigationEndpoint'; -import { YTNode } from '../helpers'; +import Thumbnail from './misc/Thumbnail.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { YTNode } from '../helpers.js'; class BackstageImage extends YTNode { static type = 'BackstageImage'; diff --git a/src/parser/classes/BackstagePost.ts b/src/parser/classes/BackstagePost.ts index 8fbc50313..041fbd5e5 100644 --- a/src/parser/classes/BackstagePost.ts +++ b/src/parser/classes/BackstagePost.ts @@ -1,11 +1,11 @@ -import Parser from '../index'; -import Author from './misc/Author'; -import Text from './misc/Text'; -import NavigationEndpoint from './NavigationEndpoint'; -import type CommentActionButtons from './comments/CommentActionButtons'; -import type Menu from './menus/Menu'; - -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import Author from './misc/Author.js'; +import Text from './misc/Text.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import type CommentActionButtons from './comments/CommentActionButtons.js'; +import type Menu from './menus/Menu.js'; + +import { YTNode } from '../helpers.js'; class BackstagePost extends YTNode { static type = 'BackstagePost'; diff --git a/src/parser/classes/BackstagePostThread.ts b/src/parser/classes/BackstagePostThread.ts index 24d972530..77e17a19b 100644 --- a/src/parser/classes/BackstagePostThread.ts +++ b/src/parser/classes/BackstagePostThread.ts @@ -1,5 +1,5 @@ -import Parser from '../index'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; class BackstagePostThread extends YTNode { static type = 'BackstagePostThread'; diff --git a/src/parser/classes/BrowseFeedActions.ts b/src/parser/classes/BrowseFeedActions.ts index 9c78f5426..b9e47eb01 100644 --- a/src/parser/classes/BrowseFeedActions.ts +++ b/src/parser/classes/BrowseFeedActions.ts @@ -1,5 +1,5 @@ -import Parser from '../index'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; class BrowseFeedActions extends YTNode { static type = 'BrowseFeedActions'; diff --git a/src/parser/classes/BrowserMediaSession.ts b/src/parser/classes/BrowserMediaSession.ts index b88387a11..f62fd2ed4 100644 --- a/src/parser/classes/BrowserMediaSession.ts +++ b/src/parser/classes/BrowserMediaSession.ts @@ -1,6 +1,6 @@ -import Text from './misc/Text'; -import Thumbnail from './misc/Thumbnail'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import Thumbnail from './misc/Thumbnail.js'; +import { YTNode } from '../helpers.js'; class BrowserMediaSession extends YTNode { static type = 'BrowserMediaSession'; diff --git a/src/parser/classes/Button.ts b/src/parser/classes/Button.ts index 4e962af50..ae1486622 100644 --- a/src/parser/classes/Button.ts +++ b/src/parser/classes/Button.ts @@ -1,7 +1,7 @@ -import Text from './misc/Text'; -import NavigationEndpoint from './NavigationEndpoint'; +import Text from './misc/Text.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class Button extends YTNode { static type = 'Button'; diff --git a/src/parser/classes/C4TabbedHeader.ts b/src/parser/classes/C4TabbedHeader.ts index 899cb7dcd..b5ea265c4 100644 --- a/src/parser/classes/C4TabbedHeader.ts +++ b/src/parser/classes/C4TabbedHeader.ts @@ -1,13 +1,13 @@ -import Parser from '../index'; -import Author from './misc/Author'; -import Text from './misc/Text'; -import Thumbnail from './misc/Thumbnail'; +import Parser from '../index.js'; +import Author from './misc/Author.js'; +import Text from './misc/Text.js'; +import Thumbnail from './misc/Thumbnail.js'; -import type Button from './Button'; -import type ChannelHeaderLinks from './ChannelHeaderLinks'; -import type SubscribeButton from './SubscribeButton'; +import type Button from './Button.js'; +import type ChannelHeaderLinks from './ChannelHeaderLinks.js'; +import type SubscribeButton from './SubscribeButton.js'; -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class C4TabbedHeader extends YTNode { static type = 'C4TabbedHeader'; diff --git a/src/parser/classes/CallToActionButton.ts b/src/parser/classes/CallToActionButton.ts index 32702c1d1..a803b5ef7 100644 --- a/src/parser/classes/CallToActionButton.ts +++ b/src/parser/classes/CallToActionButton.ts @@ -1,5 +1,5 @@ -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class CallToActionButton extends YTNode { static type = 'CallToActionButton'; diff --git a/src/parser/classes/Card.ts b/src/parser/classes/Card.ts index 23fd452cf..872476d5a 100644 --- a/src/parser/classes/Card.ts +++ b/src/parser/classes/Card.ts @@ -1,5 +1,5 @@ -import Parser from '../index'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; class Card extends YTNode { static type = 'Card'; diff --git a/src/parser/classes/CardCollection.ts b/src/parser/classes/CardCollection.ts index fdbe22d46..5f60d81db 100644 --- a/src/parser/classes/CardCollection.ts +++ b/src/parser/classes/CardCollection.ts @@ -1,6 +1,6 @@ -import Parser from '../index'; -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class CardCollection extends YTNode { static type = 'CardCollection'; diff --git a/src/parser/classes/CarouselHeader.ts b/src/parser/classes/CarouselHeader.ts index 863edc0e8..fb3cde85c 100644 --- a/src/parser/classes/CarouselHeader.ts +++ b/src/parser/classes/CarouselHeader.ts @@ -1,5 +1,5 @@ -import Parser from '..'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; class CarouselHeader extends YTNode { static type = 'CarouselHeader'; diff --git a/src/parser/classes/CarouselItem.ts b/src/parser/classes/CarouselItem.ts index 7a4dbe9ec..58810e79b 100644 --- a/src/parser/classes/CarouselItem.ts +++ b/src/parser/classes/CarouselItem.ts @@ -1,7 +1,7 @@ -import Parser from '..'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; -import Thumbnail from './misc/Thumbnail'; +import Thumbnail from './misc/Thumbnail.js'; class CarouselItem extends YTNode { static type = 'CarouselItem'; diff --git a/src/parser/classes/Channel.ts b/src/parser/classes/Channel.ts index 1f33a96f3..4fb6e8aeb 100644 --- a/src/parser/classes/Channel.ts +++ b/src/parser/classes/Channel.ts @@ -1,12 +1,12 @@ -import Parser from '..'; +import Parser from '../index.js'; -import Text from './misc/Text'; -import Author from './misc/Author'; -import NavigationEndpoint from './NavigationEndpoint'; +import Text from './misc/Text.js'; +import Author from './misc/Author.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; -import type SubscribeButton from './SubscribeButton'; +import type SubscribeButton from './SubscribeButton.js'; -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class Channel extends YTNode { static type = 'Channel'; diff --git a/src/parser/classes/ChannelAboutFullMetadata.ts b/src/parser/classes/ChannelAboutFullMetadata.ts index c40bbaed5..71974437c 100644 --- a/src/parser/classes/ChannelAboutFullMetadata.ts +++ b/src/parser/classes/ChannelAboutFullMetadata.ts @@ -1,12 +1,12 @@ -import Parser from '../index'; +import Parser from '../index.js'; -import Text from './misc/Text'; -import Thumbnail from './misc/Thumbnail'; -import NavigationEndpoint from './NavigationEndpoint'; +import Text from './misc/Text.js'; +import Thumbnail from './misc/Thumbnail.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; -import type Button from './Button'; +import type Button from './Button.js'; -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class ChannelAboutFullMetadata extends YTNode { static type = 'ChannelAboutFullMetadata'; diff --git a/src/parser/classes/ChannelFeaturedContent.ts b/src/parser/classes/ChannelFeaturedContent.ts index 607cd5adb..bf3313b80 100644 --- a/src/parser/classes/ChannelFeaturedContent.ts +++ b/src/parser/classes/ChannelFeaturedContent.ts @@ -1,6 +1,6 @@ -import Parser from '../index'; -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class ChannelFeaturedContent extends YTNode { static type = 'ChannelFeaturedContent'; diff --git a/src/parser/classes/ChannelHeaderLinks.ts b/src/parser/classes/ChannelHeaderLinks.ts index 93d40a7e6..ffff1299a 100644 --- a/src/parser/classes/ChannelHeaderLinks.ts +++ b/src/parser/classes/ChannelHeaderLinks.ts @@ -1,7 +1,7 @@ -import NavigationEndpoint from './NavigationEndpoint'; -import Text from './misc/Text'; -import Thumbnail from './misc/Thumbnail'; -import { YTNode } from '../helpers'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import Text from './misc/Text.js'; +import Thumbnail from './misc/Thumbnail.js'; +import { YTNode } from '../helpers.js'; class HeaderLink { endpoint: NavigationEndpoint; diff --git a/src/parser/classes/ChannelMetadata.ts b/src/parser/classes/ChannelMetadata.ts index b44d12a81..59402324f 100644 --- a/src/parser/classes/ChannelMetadata.ts +++ b/src/parser/classes/ChannelMetadata.ts @@ -1,5 +1,5 @@ -import Thumbnail from './misc/Thumbnail'; -import { YTNode } from '../helpers'; +import Thumbnail from './misc/Thumbnail.js'; +import { YTNode } from '../helpers.js'; class ChannelMetadata extends YTNode { static type = 'ChannelMetadata'; diff --git a/src/parser/classes/ChannelMobileHeader.ts b/src/parser/classes/ChannelMobileHeader.ts index 1848dc927..36a7fa56a 100644 --- a/src/parser/classes/ChannelMobileHeader.ts +++ b/src/parser/classes/ChannelMobileHeader.ts @@ -1,5 +1,5 @@ -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class ChannelMobileHeader extends YTNode { static type = 'ChannelMobileHeader'; diff --git a/src/parser/classes/ChannelOptions.ts b/src/parser/classes/ChannelOptions.ts index d9bed584e..9f7c21f96 100644 --- a/src/parser/classes/ChannelOptions.ts +++ b/src/parser/classes/ChannelOptions.ts @@ -1,8 +1,8 @@ -import Text from './misc/Text'; -import Thumbnail from './misc/Thumbnail'; -import NavigationEndpoint from './NavigationEndpoint'; +import Text from './misc/Text.js'; +import Thumbnail from './misc/Thumbnail.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class ChannelOptions extends YTNode { static type = 'ChannelOptions'; diff --git a/src/parser/classes/ChannelSubMenu.ts b/src/parser/classes/ChannelSubMenu.ts index 195bec50a..79b904189 100644 --- a/src/parser/classes/ChannelSubMenu.ts +++ b/src/parser/classes/ChannelSubMenu.ts @@ -1,6 +1,6 @@ -import Parser from '..'; -import NavigationEndpoint from './NavigationEndpoint'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { YTNode } from '../helpers.js'; class ChannelSubMenu extends YTNode { static type = 'ChannelSubMenu'; diff --git a/src/parser/classes/ChannelThumbnailWithLink.ts b/src/parser/classes/ChannelThumbnailWithLink.ts index ba897edc3..d2ec2fd98 100644 --- a/src/parser/classes/ChannelThumbnailWithLink.ts +++ b/src/parser/classes/ChannelThumbnailWithLink.ts @@ -1,6 +1,6 @@ -import Thumbnail from './misc/Thumbnail'; -import NavigationEndpoint from './NavigationEndpoint'; -import { YTNode } from '../helpers'; +import Thumbnail from './misc/Thumbnail.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { YTNode } from '../helpers.js'; class ChannelThumbnailWithLink extends YTNode { static type = 'ChannelThumbnailWithLink'; diff --git a/src/parser/classes/ChannelVideoPlayer.ts b/src/parser/classes/ChannelVideoPlayer.ts index f98b7a97b..0c6787426 100644 --- a/src/parser/classes/ChannelVideoPlayer.ts +++ b/src/parser/classes/ChannelVideoPlayer.ts @@ -1,5 +1,5 @@ -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class ChannelVideoPlayer extends YTNode { static type = 'ChannelVideoPlayer'; diff --git a/src/parser/classes/Chapter.ts b/src/parser/classes/Chapter.ts index 463e9b188..21f64285a 100644 --- a/src/parser/classes/Chapter.ts +++ b/src/parser/classes/Chapter.ts @@ -1,7 +1,7 @@ -import Text from './misc/Text'; -import Thumbnail from './misc/Thumbnail'; +import Text from './misc/Text.js'; +import Thumbnail from './misc/Thumbnail.js'; -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class Chapter extends YTNode { static type = 'Chapter'; diff --git a/src/parser/classes/ChildVideo.ts b/src/parser/classes/ChildVideo.ts index 8d6ea4ed5..6d1e0f34d 100644 --- a/src/parser/classes/ChildVideo.ts +++ b/src/parser/classes/ChildVideo.ts @@ -1,8 +1,8 @@ -import NavigationEndpoint from './NavigationEndpoint'; -import Text from './misc/Text'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import Text from './misc/Text.js'; -import { timeToSeconds } from '../../utils/Utils'; -import { YTNode } from '../helpers'; +import { timeToSeconds } from '../../utils/Utils.js'; +import { YTNode } from '../helpers.js'; class ChildVideo extends YTNode { static type = 'ChildVideo'; diff --git a/src/parser/classes/ChipCloud.ts b/src/parser/classes/ChipCloud.ts index bb555e2aa..04eb51604 100644 --- a/src/parser/classes/ChipCloud.ts +++ b/src/parser/classes/ChipCloud.ts @@ -1,8 +1,8 @@ -import Parser from '../index'; -import Button from './Button'; -import ChipCloudChip from './ChipCloudChip'; +import Parser from '../index.js'; +import Button from './Button.js'; +import ChipCloudChip from './ChipCloudChip.js'; -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class ChipCloud extends YTNode { static type = 'ChipCloud'; diff --git a/src/parser/classes/ChipCloudChip.ts b/src/parser/classes/ChipCloudChip.ts index 00eba4d5d..9f23cc53f 100644 --- a/src/parser/classes/ChipCloudChip.ts +++ b/src/parser/classes/ChipCloudChip.ts @@ -1,6 +1,6 @@ -import Text from './misc/Text'; -import NavigationEndpoint from './NavigationEndpoint'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { YTNode } from '../helpers.js'; class ChipCloudChip extends YTNode { static type = 'ChipCloudChip'; diff --git a/src/parser/classes/CollaboratorInfoCardContent.ts b/src/parser/classes/CollaboratorInfoCardContent.ts index 04409c5c4..674d3e5dd 100644 --- a/src/parser/classes/CollaboratorInfoCardContent.ts +++ b/src/parser/classes/CollaboratorInfoCardContent.ts @@ -1,8 +1,8 @@ -import Text from './misc/Text'; -import Thumbnail from './misc/Thumbnail'; -import NavigationEndpoint from './NavigationEndpoint'; +import Text from './misc/Text.js'; +import Thumbnail from './misc/Thumbnail.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class CollaboratorInfoCardContent extends YTNode { static type = 'CollaboratorInfoCardContent'; diff --git a/src/parser/classes/CollageHeroImage.ts b/src/parser/classes/CollageHeroImage.ts index 3aab28fe2..5d2fe15f3 100644 --- a/src/parser/classes/CollageHeroImage.ts +++ b/src/parser/classes/CollageHeroImage.ts @@ -1,6 +1,6 @@ -import NavigationEndpoint from './NavigationEndpoint'; -import Thumbnail from './misc/Thumbnail'; -import { YTNode } from '../helpers'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import Thumbnail from './misc/Thumbnail.js'; +import { YTNode } from '../helpers.js'; class CollageHeroImage extends YTNode { static type = 'CollageHeroImage'; diff --git a/src/parser/classes/CompactChannel.ts b/src/parser/classes/CompactChannel.ts index d8ca2819e..43dbc17ca 100644 --- a/src/parser/classes/CompactChannel.ts +++ b/src/parser/classes/CompactChannel.ts @@ -1,9 +1,9 @@ -import Parser from '..'; -import Text from './misc/Text'; -import Thumbnail from './misc/Thumbnail'; -import NavigationEndpoint from './NavigationEndpoint'; -import type Menu from './menus/Menu'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import Text from './misc/Text.js'; +import Thumbnail from './misc/Thumbnail.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import type Menu from './menus/Menu.js'; +import { YTNode } from '../helpers.js'; class CompactChannel extends YTNode { static type = 'CompactChannel'; diff --git a/src/parser/classes/CompactLink.ts b/src/parser/classes/CompactLink.ts index 82a0b98c9..7a8c008d9 100644 --- a/src/parser/classes/CompactLink.ts +++ b/src/parser/classes/CompactLink.ts @@ -1,6 +1,6 @@ -import Text from './misc/Text'; -import NavigationEndpoint from './NavigationEndpoint'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { YTNode } from '../helpers.js'; class CompactLink extends YTNode { static type = 'CompactLink'; diff --git a/src/parser/classes/CompactMix.ts b/src/parser/classes/CompactMix.ts index f41b02201..aadc6d604 100644 --- a/src/parser/classes/CompactMix.ts +++ b/src/parser/classes/CompactMix.ts @@ -1,4 +1,4 @@ -import Playlist from './Playlist'; +import Playlist from './Playlist.js'; class CompactMix extends Playlist { static type = 'CompactMix'; diff --git a/src/parser/classes/CompactPlaylist.ts b/src/parser/classes/CompactPlaylist.ts index bd11eba08..ec61f94f3 100644 --- a/src/parser/classes/CompactPlaylist.ts +++ b/src/parser/classes/CompactPlaylist.ts @@ -1,4 +1,4 @@ -import Playlist from './Playlist'; +import Playlist from './Playlist.js'; class CompactPlaylist extends Playlist { static type = 'CompactPlaylist'; diff --git a/src/parser/classes/CompactStation.ts b/src/parser/classes/CompactStation.ts index 15f149830..1a5af25f7 100644 --- a/src/parser/classes/CompactStation.ts +++ b/src/parser/classes/CompactStation.ts @@ -1,8 +1,8 @@ -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; -import Text from './misc/Text'; -import Thumbnail from './misc/Thumbnail'; -import NavigationEndpoint from './NavigationEndpoint'; +import Text from './misc/Text.js'; +import Thumbnail from './misc/Thumbnail.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; class CompactStation extends YTNode { static type = 'CompactStation'; diff --git a/src/parser/classes/CompactVideo.ts b/src/parser/classes/CompactVideo.ts index 443dfd1c9..9186c9331 100644 --- a/src/parser/classes/CompactVideo.ts +++ b/src/parser/classes/CompactVideo.ts @@ -1,13 +1,13 @@ -import Parser from '../index'; -import Text from './misc/Text'; -import Author from './misc/Author'; -import { timeToSeconds } from '../../utils/Utils'; -import Thumbnail from './misc/Thumbnail'; -import NavigationEndpoint from './NavigationEndpoint'; -import type Menu from './menus/Menu'; -import MetadataBadge from './MetadataBadge'; +import Parser from '../index.js'; +import Text from './misc/Text.js'; +import Author from './misc/Author.js'; +import { timeToSeconds } from '../../utils/Utils.js'; +import Thumbnail from './misc/Thumbnail.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import type Menu from './menus/Menu.js'; +import MetadataBadge from './MetadataBadge.js'; -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class CompactVideo extends YTNode { static type = 'CompactVideo'; diff --git a/src/parser/classes/ConfirmDialog.ts b/src/parser/classes/ConfirmDialog.ts index 4725e2d8b..965303912 100644 --- a/src/parser/classes/ConfirmDialog.ts +++ b/src/parser/classes/ConfirmDialog.ts @@ -1,8 +1,8 @@ -import Parser from '..'; -import Text from './misc/Text'; -import Button from './Button'; +import Parser from '../index.js'; +import Text from './misc/Text.js'; +import Button from './Button.js'; -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class ConfirmDialog extends YTNode { static type = 'ConfirmDialog'; diff --git a/src/parser/classes/ContinuationItem.ts b/src/parser/classes/ContinuationItem.ts index 4062fb56a..bbe60a1c2 100644 --- a/src/parser/classes/ContinuationItem.ts +++ b/src/parser/classes/ContinuationItem.ts @@ -1,6 +1,6 @@ -import Parser from '../index'; -import NavigationEndpoint from './NavigationEndpoint'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { YTNode } from '../helpers.js'; class ContinuationItem extends YTNode { static type = 'ContinuationItem'; diff --git a/src/parser/classes/CopyLink.ts b/src/parser/classes/CopyLink.ts index 3d2581d9f..720b07cb3 100644 --- a/src/parser/classes/CopyLink.ts +++ b/src/parser/classes/CopyLink.ts @@ -1,6 +1,6 @@ -import Parser from '../index'; -import Button from './Button'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import Button from './Button.js'; +import { YTNode } from '../helpers.js'; class CopyLink extends YTNode { static type = 'CopyLink'; diff --git a/src/parser/classes/CreatePlaylistDialog.ts b/src/parser/classes/CreatePlaylistDialog.ts index 8fcff0ffe..60f829e65 100644 --- a/src/parser/classes/CreatePlaylistDialog.ts +++ b/src/parser/classes/CreatePlaylistDialog.ts @@ -1,9 +1,9 @@ -import Parser from '..'; -import { ObservedArray, YTNode } from '../helpers'; -import Button from './Button'; -import Dropdown from './Dropdown'; -import DropdownItem from './DropdownItem'; -import Text from './misc/Text'; +import Parser from '../index.js'; +import { ObservedArray, YTNode } from '../helpers.js'; +import Button from './Button.js'; +import Dropdown from './Dropdown.js'; +import DropdownItem from './DropdownItem.js'; +import Text from './misc/Text.js'; class CreatePlaylistDialog extends YTNode { static type = 'CreatePlaylistDialog'; diff --git a/src/parser/classes/DecoratedPlayerBar.ts b/src/parser/classes/DecoratedPlayerBar.ts index d972c1261..e45c03179 100644 --- a/src/parser/classes/DecoratedPlayerBar.ts +++ b/src/parser/classes/DecoratedPlayerBar.ts @@ -1,7 +1,7 @@ -import Parser from '..'; -import { YTNode } from '../helpers'; -import type Button from './Button'; -import type MultiMarkersPlayerBar from './MultiMarkersPlayerBar'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; +import type Button from './Button.js'; +import type MultiMarkersPlayerBar from './MultiMarkersPlayerBar.js'; class DecoratedPlayerBar extends YTNode { static type = 'DecoratedPlayerBar'; diff --git a/src/parser/classes/DefaultPromoPanel.ts b/src/parser/classes/DefaultPromoPanel.ts index 12ae2b85d..5973f7815 100644 --- a/src/parser/classes/DefaultPromoPanel.ts +++ b/src/parser/classes/DefaultPromoPanel.ts @@ -1,8 +1,8 @@ -import Parser from '..'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; -import Text from './misc/Text'; -import NavigationEndpoint from './NavigationEndpoint'; +import Text from './misc/Text.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; class DefaultPromoPanel extends YTNode { static type = 'DefaultPromoPanel'; diff --git a/src/parser/classes/DidYouMean.ts b/src/parser/classes/DidYouMean.ts index d1caf155b..4c02a4dd5 100644 --- a/src/parser/classes/DidYouMean.ts +++ b/src/parser/classes/DidYouMean.ts @@ -1,6 +1,6 @@ -import Text from './misc/Text'; -import NavigationEndpoint from './NavigationEndpoint'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { YTNode } from '../helpers.js'; class DidYouMean extends YTNode { static type = 'DidYouMean'; diff --git a/src/parser/classes/DownloadButton.ts b/src/parser/classes/DownloadButton.ts index 4c936f4db..3b6ab0d61 100644 --- a/src/parser/classes/DownloadButton.ts +++ b/src/parser/classes/DownloadButton.ts @@ -1,5 +1,5 @@ -import NavigationEndpoint from './NavigationEndpoint'; -import { YTNode } from '../helpers'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { YTNode } from '../helpers.js'; class DownloadButton extends YTNode { static type = 'DownloadButton'; diff --git a/src/parser/classes/Dropdown.ts b/src/parser/classes/Dropdown.ts index 278651a92..d7a22fef4 100644 --- a/src/parser/classes/Dropdown.ts +++ b/src/parser/classes/Dropdown.ts @@ -1,6 +1,6 @@ -import Parser from '..'; -import { ObservedArray, YTNode } from '../helpers'; -import DropdownItem from './DropdownItem'; +import Parser from '../index.js'; +import { ObservedArray, YTNode } from '../helpers.js'; +import DropdownItem from './DropdownItem.js'; class Dropdown extends YTNode { static type = 'Dropdown'; diff --git a/src/parser/classes/DropdownItem.ts b/src/parser/classes/DropdownItem.ts index c246573bd..4a2d03377 100644 --- a/src/parser/classes/DropdownItem.ts +++ b/src/parser/classes/DropdownItem.ts @@ -1,6 +1,6 @@ -import { YTNode } from '../helpers'; -import Text from './misc/Text'; -import NavigationEndpoint from './NavigationEndpoint'; +import { YTNode } from '../helpers.js'; +import Text from './misc/Text.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; class DropdownItem extends YTNode { static type = 'DropdownItem'; diff --git a/src/parser/classes/Element.ts b/src/parser/classes/Element.ts index 712d2cf03..1471c6ddb 100644 --- a/src/parser/classes/Element.ts +++ b/src/parser/classes/Element.ts @@ -1,7 +1,7 @@ -import Parser from '../index'; -import ChildElement from './misc/ChildElement'; +import Parser from '../index.js'; +import ChildElement from './misc/ChildElement.js'; -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class Element extends YTNode { static type = 'Element'; diff --git a/src/parser/classes/EmergencyOnebox.ts b/src/parser/classes/EmergencyOnebox.ts index c132c6e83..da2aaffbe 100644 --- a/src/parser/classes/EmergencyOnebox.ts +++ b/src/parser/classes/EmergencyOnebox.ts @@ -1,6 +1,6 @@ -import Text from './misc/Text'; -import Parser from '../index'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; class EmergencyOnebox extends YTNode { static type = 'EmergencyOnebox'; diff --git a/src/parser/classes/EmojiPickerCategory.ts b/src/parser/classes/EmojiPickerCategory.ts index 7932c24fd..78215c8e6 100644 --- a/src/parser/classes/EmojiPickerCategory.ts +++ b/src/parser/classes/EmojiPickerCategory.ts @@ -1,5 +1,5 @@ -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class EmojiPickerCategory extends YTNode { static type = 'EmojiPickerCategory'; diff --git a/src/parser/classes/EmojiPickerCategoryButton.ts b/src/parser/classes/EmojiPickerCategoryButton.ts index b082fa97e..7c417bda0 100644 --- a/src/parser/classes/EmojiPickerCategoryButton.ts +++ b/src/parser/classes/EmojiPickerCategoryButton.ts @@ -1,4 +1,4 @@ -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class EmojiPickerCategoryButton extends YTNode { static type = 'EmojiPickerCategoryButton'; diff --git a/src/parser/classes/EmojiPickerUpsellCategory.ts b/src/parser/classes/EmojiPickerUpsellCategory.ts index 32fe3c864..c14a317f0 100644 --- a/src/parser/classes/EmojiPickerUpsellCategory.ts +++ b/src/parser/classes/EmojiPickerUpsellCategory.ts @@ -1,6 +1,6 @@ -import Text from './misc/Text'; -import NavigationEndpoint from './NavigationEndpoint'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { YTNode } from '../helpers.js'; class EmojiPickerUpsellCategory extends YTNode { static type = 'EmojiPickerUpsellCategory'; diff --git a/src/parser/classes/EndScreenPlaylist.ts b/src/parser/classes/EndScreenPlaylist.ts index ae58e36c8..e0311cb52 100644 --- a/src/parser/classes/EndScreenPlaylist.ts +++ b/src/parser/classes/EndScreenPlaylist.ts @@ -1,7 +1,7 @@ -import Text from './misc/Text'; -import Thumbnail from './misc/Thumbnail'; -import NavigationEndpoint from './NavigationEndpoint'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import Thumbnail from './misc/Thumbnail.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { YTNode } from '../helpers.js'; class EndScreenPlaylist extends YTNode { static type = 'EndScreenPlaylist'; diff --git a/src/parser/classes/EndScreenVideo.ts b/src/parser/classes/EndScreenVideo.ts index 109e47776..4a5bd1ac8 100644 --- a/src/parser/classes/EndScreenVideo.ts +++ b/src/parser/classes/EndScreenVideo.ts @@ -1,9 +1,9 @@ -import Parser from '../index'; -import Text from './misc/Text'; -import Author from './misc/Author'; -import Thumbnail from './misc/Thumbnail'; -import NavigationEndpoint from './NavigationEndpoint'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import Text from './misc/Text.js'; +import Author from './misc/Author.js'; +import Thumbnail from './misc/Thumbnail.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { YTNode } from '../helpers.js'; class EndScreenVideo extends YTNode { static type = 'EndScreenVideo'; diff --git a/src/parser/classes/Endscreen.ts b/src/parser/classes/Endscreen.ts index b1b08d574..94d09e5d6 100644 --- a/src/parser/classes/Endscreen.ts +++ b/src/parser/classes/Endscreen.ts @@ -1,5 +1,5 @@ -import Parser from '../index'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; class Endscreen extends YTNode { static type = 'Endscreen'; diff --git a/src/parser/classes/EndscreenElement.ts b/src/parser/classes/EndscreenElement.ts index 32770946d..605146f4a 100644 --- a/src/parser/classes/EndscreenElement.ts +++ b/src/parser/classes/EndscreenElement.ts @@ -1,8 +1,8 @@ -import Parser from '../index'; -import Thumbnail from './misc/Thumbnail'; -import NavigationEndpoint from './NavigationEndpoint'; -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import Thumbnail from './misc/Thumbnail.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class EndscreenElement extends YTNode { static type = 'EndscreenElement'; diff --git a/src/parser/classes/ExpandableMetadata.ts b/src/parser/classes/ExpandableMetadata.ts index 7a4b859a8..05416ed04 100644 --- a/src/parser/classes/ExpandableMetadata.ts +++ b/src/parser/classes/ExpandableMetadata.ts @@ -1,12 +1,12 @@ -import Parser from '..'; +import Parser from '../index.js'; -import Text from './misc/Text'; -import Thumbnail from './misc/Thumbnail'; +import Text from './misc/Text.js'; +import Thumbnail from './misc/Thumbnail.js'; -import Button from './Button'; -import HorizontalCardList from './HorizontalCardList'; +import Button from './Button.js'; +import HorizontalCardList from './HorizontalCardList.js'; -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class ExpandableMetadata extends YTNode { static type = 'ExpandableMetadata'; diff --git a/src/parser/classes/ExpandableTab.ts b/src/parser/classes/ExpandableTab.ts index 12dc17836..7890e586d 100644 --- a/src/parser/classes/ExpandableTab.ts +++ b/src/parser/classes/ExpandableTab.ts @@ -1,6 +1,6 @@ -import Parser from '../index'; -import NavigationEndpoint from './NavigationEndpoint'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { YTNode } from '../helpers.js'; class ExpandableTab extends YTNode { static type = 'ExpandableTab'; diff --git a/src/parser/classes/ExpandedShelfContents.ts b/src/parser/classes/ExpandedShelfContents.ts index 3f0c24243..9ebe22a99 100644 --- a/src/parser/classes/ExpandedShelfContents.ts +++ b/src/parser/classes/ExpandedShelfContents.ts @@ -1,5 +1,5 @@ -import Parser from '../index'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; class ExpandedShelfContents extends YTNode { static type = 'ExpandedShelfContents'; diff --git a/src/parser/classes/FeedFilterChipBar.ts b/src/parser/classes/FeedFilterChipBar.ts index cd3240877..dca16bd30 100644 --- a/src/parser/classes/FeedFilterChipBar.ts +++ b/src/parser/classes/FeedFilterChipBar.ts @@ -1,6 +1,6 @@ -import Parser from '../index'; -import { YTNode } from '../helpers'; -import ChipCloudChip from './ChipCloudChip'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; +import ChipCloudChip from './ChipCloudChip.js'; class FeedFilterChipBar extends YTNode { static type = 'FeedFilterChipBar'; diff --git a/src/parser/classes/FeedTabbedHeader.ts b/src/parser/classes/FeedTabbedHeader.ts index abf7ddfcf..c07473a50 100644 --- a/src/parser/classes/FeedTabbedHeader.ts +++ b/src/parser/classes/FeedTabbedHeader.ts @@ -1,5 +1,5 @@ -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class FeedTabbedHeader extends YTNode { static type = 'FeedTabbedHeader'; diff --git a/src/parser/classes/GameCard.ts b/src/parser/classes/GameCard.ts index dd7c6dc9d..6abf53c5e 100644 --- a/src/parser/classes/GameCard.ts +++ b/src/parser/classes/GameCard.ts @@ -1,5 +1,5 @@ -import Parser from '..'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; class GameCard extends YTNode { static type = 'GameCard'; diff --git a/src/parser/classes/GameDetails.ts b/src/parser/classes/GameDetails.ts index 2345a6b82..b3bb80adf 100644 --- a/src/parser/classes/GameDetails.ts +++ b/src/parser/classes/GameDetails.ts @@ -1,8 +1,8 @@ -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; -import Text from './misc/Text'; -import Thumbnail from './misc/Thumbnail'; -import NavigationEndpoint from './NavigationEndpoint'; +import Text from './misc/Text.js'; +import Thumbnail from './misc/Thumbnail.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; class GameDetails extends YTNode { static type = 'GameDetails'; diff --git a/src/parser/classes/Grid.ts b/src/parser/classes/Grid.ts index c95830166..74a9a9449 100644 --- a/src/parser/classes/Grid.ts +++ b/src/parser/classes/Grid.ts @@ -1,5 +1,5 @@ -import Parser from '../index'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; class Grid extends YTNode { static type = 'Grid'; diff --git a/src/parser/classes/GridChannel.ts b/src/parser/classes/GridChannel.ts index 2df289832..817d52f0f 100644 --- a/src/parser/classes/GridChannel.ts +++ b/src/parser/classes/GridChannel.ts @@ -1,8 +1,8 @@ -import Author from './misc/Author'; -import Parser from '../index'; -import NavigationEndpoint from './NavigationEndpoint'; -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Author from './misc/Author.js'; +import Parser from '../index.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class GridChannel extends YTNode { static type = 'GridChannel'; diff --git a/src/parser/classes/GridHeader.ts b/src/parser/classes/GridHeader.ts index b16769f86..7a128bfc7 100644 --- a/src/parser/classes/GridHeader.ts +++ b/src/parser/classes/GridHeader.ts @@ -1,5 +1,5 @@ -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class GridHeader extends YTNode { static type = 'GridHeader'; diff --git a/src/parser/classes/GridPlaylist.ts b/src/parser/classes/GridPlaylist.ts index ffccc00dc..4996e32c4 100644 --- a/src/parser/classes/GridPlaylist.ts +++ b/src/parser/classes/GridPlaylist.ts @@ -1,10 +1,10 @@ -import Text from './misc/Text'; -import Parser from '../index'; -import Thumbnail from './misc/Thumbnail'; -import PlaylistAuthor from './misc/PlaylistAuthor'; -import NavigationEndpoint from './NavigationEndpoint'; -import NavigatableText from './misc/NavigatableText'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import Parser from '../index.js'; +import Thumbnail from './misc/Thumbnail.js'; +import PlaylistAuthor from './misc/PlaylistAuthor.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import NavigatableText from './misc/NavigatableText.js'; +import { YTNode } from '../helpers.js'; class GridPlaylist extends YTNode { static type = 'GridPlaylist'; diff --git a/src/parser/classes/GridVideo.ts b/src/parser/classes/GridVideo.ts index 660e1ce41..9a653d588 100644 --- a/src/parser/classes/GridVideo.ts +++ b/src/parser/classes/GridVideo.ts @@ -1,12 +1,12 @@ -import Parser from '../index'; -import Text from './misc/Text'; -import Thumbnail from './misc/Thumbnail'; -import NavigationEndpoint from './NavigationEndpoint'; -import Author from './misc/Author'; +import Parser from '../index.js'; +import Text from './misc/Text.js'; +import Thumbnail from './misc/Thumbnail.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import Author from './misc/Author.js'; -import type Menu from './menus/Menu'; +import type Menu from './menus/Menu.js'; -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class GridVideo extends YTNode { static type = 'GridVideo'; diff --git a/src/parser/classes/HeatMarker.ts b/src/parser/classes/HeatMarker.ts index 7194d32ce..62808b540 100644 --- a/src/parser/classes/HeatMarker.ts +++ b/src/parser/classes/HeatMarker.ts @@ -1,4 +1,4 @@ -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class HeatMarker extends YTNode { static type = 'HeatMarker'; diff --git a/src/parser/classes/Heatmap.ts b/src/parser/classes/Heatmap.ts index 35989a829..735df77a5 100644 --- a/src/parser/classes/Heatmap.ts +++ b/src/parser/classes/Heatmap.ts @@ -1,7 +1,7 @@ -import Parser from '..'; -import type HeatMarker from './HeatMarker'; +import Parser from '../index.js'; +import type HeatMarker from './HeatMarker.js'; -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class Heatmap extends YTNode { static type = 'Heatmap'; diff --git a/src/parser/classes/HighlightsCarousel.ts b/src/parser/classes/HighlightsCarousel.ts index 1b8162240..434fc336a 100644 --- a/src/parser/classes/HighlightsCarousel.ts +++ b/src/parser/classes/HighlightsCarousel.ts @@ -1,5 +1,5 @@ -import NavigationEndpoint from './NavigationEndpoint'; -import { YTNode } from '../helpers'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { YTNode } from '../helpers.js'; class Panel { static type = 'Panel'; diff --git a/src/parser/classes/HistorySuggestion.ts b/src/parser/classes/HistorySuggestion.ts index 4cb46d492..7ca2f2a01 100644 --- a/src/parser/classes/HistorySuggestion.ts +++ b/src/parser/classes/HistorySuggestion.ts @@ -1,4 +1,4 @@ -import SearchSuggestion from './SearchSuggestion'; +import SearchSuggestion from './SearchSuggestion.js'; class HistorySuggestion extends SearchSuggestion { static type = 'HistorySuggestion'; diff --git a/src/parser/classes/HorizontalCardList.ts b/src/parser/classes/HorizontalCardList.ts index e7d2529b6..54e9697c6 100644 --- a/src/parser/classes/HorizontalCardList.ts +++ b/src/parser/classes/HorizontalCardList.ts @@ -1,8 +1,8 @@ -import Parser from '../index'; -import { YTNode } from '../helpers'; -import SearchRefinementCard from './SearchRefinementCard'; -import Button from './Button'; -import MacroMarkersListItem from './MacroMarkersListItem'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; +import SearchRefinementCard from './SearchRefinementCard.js'; +import Button from './Button.js'; +import MacroMarkersListItem from './MacroMarkersListItem.js'; class HorizontalCardList extends YTNode { static type = 'HorizontalCardList'; diff --git a/src/parser/classes/HorizontalList.ts b/src/parser/classes/HorizontalList.ts index 0c358f2c8..5497bdad3 100644 --- a/src/parser/classes/HorizontalList.ts +++ b/src/parser/classes/HorizontalList.ts @@ -1,5 +1,5 @@ -import Parser from '../index'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; class HorizontalList extends YTNode { static type = 'HorizontalList'; diff --git a/src/parser/classes/IconLink.ts b/src/parser/classes/IconLink.ts index 5deae9ac8..c680eb2cd 100644 --- a/src/parser/classes/IconLink.ts +++ b/src/parser/classes/IconLink.ts @@ -1,6 +1,6 @@ -import Text from './misc/Text'; -import { YTNode } from '../helpers'; -import NavigationEndpoint from './NavigationEndpoint'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; class IconLink extends YTNode { static type = 'IconLink'; diff --git a/src/parser/classes/InteractiveTabbedHeader.ts b/src/parser/classes/InteractiveTabbedHeader.ts index c7a6fe909..1cca92a37 100644 --- a/src/parser/classes/InteractiveTabbedHeader.ts +++ b/src/parser/classes/InteractiveTabbedHeader.ts @@ -1,11 +1,11 @@ -import Parser from '..'; -import { ObservedArray, YTNode } from '../helpers'; +import Parser from '../index.js'; +import { ObservedArray, YTNode } from '../helpers.js'; -import Text from './misc/Text'; -import Thumbnail from './misc/Thumbnail'; -import SubscribeButton from './SubscribeButton'; -import MetadataBadge from './MetadataBadge'; -import Button from './Button'; +import Text from './misc/Text.js'; +import Thumbnail from './misc/Thumbnail.js'; +import SubscribeButton from './SubscribeButton.js'; +import MetadataBadge from './MetadataBadge.js'; +import Button from './Button.js'; class InteractiveTabbedHeader extends YTNode { static type = 'InteractiveTabbedHeader'; diff --git a/src/parser/classes/ItemSection.ts b/src/parser/classes/ItemSection.ts index 1e5f3fde1..1daf1c253 100644 --- a/src/parser/classes/ItemSection.ts +++ b/src/parser/classes/ItemSection.ts @@ -1,9 +1,9 @@ -import Parser from '../index'; -import ItemSectionHeader from './ItemSectionHeader'; +import Parser from '../index.js'; +import ItemSectionHeader from './ItemSectionHeader.js'; -import { YTNode } from '../helpers'; -import ItemSectionTabbedHeader from './ItemSectionTabbedHeader'; -import CommentsHeader from './comments/CommentsHeader'; +import { YTNode } from '../helpers.js'; +import ItemSectionTabbedHeader from './ItemSectionTabbedHeader.js'; +import CommentsHeader from './comments/CommentsHeader.js'; class ItemSection extends YTNode { static type = 'ItemSection'; diff --git a/src/parser/classes/ItemSectionHeader.ts b/src/parser/classes/ItemSectionHeader.ts index caea87fd3..d4b87f959 100644 --- a/src/parser/classes/ItemSectionHeader.ts +++ b/src/parser/classes/ItemSectionHeader.ts @@ -1,5 +1,5 @@ -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class ItemSectionHeader extends YTNode { static type = 'ItemSectionHeader'; diff --git a/src/parser/classes/ItemSectionTab.ts b/src/parser/classes/ItemSectionTab.ts index 1c6109135..01d4d80f8 100644 --- a/src/parser/classes/ItemSectionTab.ts +++ b/src/parser/classes/ItemSectionTab.ts @@ -1,7 +1,7 @@ -import NavigationEndpoint from './NavigationEndpoint'; +import NavigationEndpoint from './NavigationEndpoint.js'; -import { YTNode } from '../helpers'; -import Text from './misc/Text'; +import { YTNode } from '../helpers.js'; +import Text from './misc/Text.js'; class ItemSectionTab extends YTNode { static type = 'Tab'; diff --git a/src/parser/classes/ItemSectionTabbedHeader.ts b/src/parser/classes/ItemSectionTabbedHeader.ts index 139b6b4fb..22578d0b3 100644 --- a/src/parser/classes/ItemSectionTabbedHeader.ts +++ b/src/parser/classes/ItemSectionTabbedHeader.ts @@ -1,7 +1,7 @@ -import Text from './misc/Text'; -import { ObservedArray, YTNode } from '../helpers'; -import ItemSectionTab from './ItemSectionTab'; -import Parser from '..'; +import Text from './misc/Text.js'; +import { ObservedArray, YTNode } from '../helpers.js'; +import ItemSectionTab from './ItemSectionTab.js'; +import Parser from '../index.js'; class ItemSectionTabbedHeader extends YTNode { static type = 'ItemSectionTabbedHeader'; diff --git a/src/parser/classes/LikeButton.ts b/src/parser/classes/LikeButton.ts index 8135f4438..5d157bdb8 100644 --- a/src/parser/classes/LikeButton.ts +++ b/src/parser/classes/LikeButton.ts @@ -1,5 +1,5 @@ -import NavigationEndpoint from './NavigationEndpoint'; -import { YTNode } from '../helpers'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { YTNode } from '../helpers.js'; class LikeButton extends YTNode { static type = 'LikeButton'; diff --git a/src/parser/classes/LiveChat.ts b/src/parser/classes/LiveChat.ts index 6aacc05cc..9ee9210e7 100644 --- a/src/parser/classes/LiveChat.ts +++ b/src/parser/classes/LiveChat.ts @@ -1,6 +1,6 @@ -import Parser from '../index'; -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class LiveChat extends YTNode { static type = 'LiveChat'; diff --git a/src/parser/classes/LiveChatAuthorBadge.ts b/src/parser/classes/LiveChatAuthorBadge.ts index 7c8fb203f..bf6b92882 100644 --- a/src/parser/classes/LiveChatAuthorBadge.ts +++ b/src/parser/classes/LiveChatAuthorBadge.ts @@ -1,5 +1,5 @@ -import MetadataBadge from './MetadataBadge'; -import Thumbnail from './misc/Thumbnail'; +import MetadataBadge from './MetadataBadge.js'; +import Thumbnail from './misc/Thumbnail.js'; class LiveChatAuthorBadge extends MetadataBadge { static type = 'LiveChatAuthorBadge'; diff --git a/src/parser/classes/LiveChatDialog.ts b/src/parser/classes/LiveChatDialog.ts index ca63f8873..2c12343e8 100644 --- a/src/parser/classes/LiveChatDialog.ts +++ b/src/parser/classes/LiveChatDialog.ts @@ -1,7 +1,7 @@ -import Parser from '..'; -import Text from './misc/Text'; -import Button from './Button'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import Text from './misc/Text.js'; +import Button from './Button.js'; +import { YTNode } from '../helpers.js'; class LiveChatDialog extends YTNode { static type = 'LiveChatDialog'; diff --git a/src/parser/classes/LiveChatHeader.ts b/src/parser/classes/LiveChatHeader.ts index 06547ef98..efc3f106d 100644 --- a/src/parser/classes/LiveChatHeader.ts +++ b/src/parser/classes/LiveChatHeader.ts @@ -1,8 +1,8 @@ -import Parser from '../index'; -import type Menu from './menus/Menu'; -import type Button from './Button'; -import type SortFilterSubMenu from './SortFilterSubMenu'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import type Menu from './menus/Menu.js'; +import type Button from './Button.js'; +import type SortFilterSubMenu from './SortFilterSubMenu.js'; +import { YTNode } from '../helpers.js'; class LiveChatHeader extends YTNode { static type = 'LiveChatHeader'; diff --git a/src/parser/classes/LiveChatItemList.ts b/src/parser/classes/LiveChatItemList.ts index af69a83f3..a561c8c6a 100644 --- a/src/parser/classes/LiveChatItemList.ts +++ b/src/parser/classes/LiveChatItemList.ts @@ -1,6 +1,6 @@ -import Parser from '../index'; -import { YTNode } from '../helpers'; -import type Button from './Button'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; +import type Button from './Button.js'; class LiveChatItemList extends YTNode { static type = 'LiveChatItemList'; diff --git a/src/parser/classes/LiveChatMessageInput.ts b/src/parser/classes/LiveChatMessageInput.ts index cc055ecda..ce24cd925 100644 --- a/src/parser/classes/LiveChatMessageInput.ts +++ b/src/parser/classes/LiveChatMessageInput.ts @@ -1,8 +1,8 @@ -import Text from './misc/Text'; -import Parser from '../index'; -import Thumbnail from './misc/Thumbnail'; -import type Button from './Button'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import Parser from '../index.js'; +import Thumbnail from './misc/Thumbnail.js'; +import type Button from './Button.js'; +import { YTNode } from '../helpers.js'; class LiveChatMessageInput extends YTNode { static type = 'LiveChatMessageInput'; diff --git a/src/parser/classes/LiveChatParticipant.ts b/src/parser/classes/LiveChatParticipant.ts index 79a12fb5f..264e801dc 100644 --- a/src/parser/classes/LiveChatParticipant.ts +++ b/src/parser/classes/LiveChatParticipant.ts @@ -1,7 +1,7 @@ -import Parser from '../index'; -import Text from './misc/Text'; -import Thumbnail from './misc/Thumbnail'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import Text from './misc/Text.js'; +import Thumbnail from './misc/Thumbnail.js'; +import { YTNode } from '../helpers.js'; class LiveChatParticipant extends YTNode { static type = 'LiveChatParticipant'; diff --git a/src/parser/classes/LiveChatParticipantsList.ts b/src/parser/classes/LiveChatParticipantsList.ts index 965746c5d..44f856a3c 100644 --- a/src/parser/classes/LiveChatParticipantsList.ts +++ b/src/parser/classes/LiveChatParticipantsList.ts @@ -1,7 +1,7 @@ -import Parser from '../index'; -import Text from './misc/Text'; -import { ObservedArray, YTNode } from '../helpers'; -import type LiveChatParticipant from './LiveChatParticipant'; +import Parser from '../index.js'; +import Text from './misc/Text.js'; +import { ObservedArray, YTNode } from '../helpers.js'; +import type LiveChatParticipant from './LiveChatParticipant.js'; class LiveChatParticipantsList extends YTNode { static type = 'LiveChatParticipantsList'; diff --git a/src/parser/classes/MacroMarkersListItem.ts b/src/parser/classes/MacroMarkersListItem.ts index c8590b190..d3518a63a 100644 --- a/src/parser/classes/MacroMarkersListItem.ts +++ b/src/parser/classes/MacroMarkersListItem.ts @@ -1,8 +1,8 @@ -import Text from './misc/Text'; -import Thumbnail from './misc/Thumbnail'; -import NavigationEndpoint from './NavigationEndpoint'; +import Text from './misc/Text.js'; +import Thumbnail from './misc/Thumbnail.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class MacroMarkersListItem extends YTNode { static type = 'MacroMarkersListItem'; diff --git a/src/parser/classes/MerchandiseItem.ts b/src/parser/classes/MerchandiseItem.ts index f08c0bd92..f351a5e7f 100644 --- a/src/parser/classes/MerchandiseItem.ts +++ b/src/parser/classes/MerchandiseItem.ts @@ -1,6 +1,6 @@ -import Thumbnail from './misc/Thumbnail'; -import NavigationEndpoint from './NavigationEndpoint'; -import { YTNode } from '../helpers'; +import Thumbnail from './misc/Thumbnail.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { YTNode } from '../helpers.js'; class MerchandiseItem extends YTNode { static type = 'MerchandiseItem'; diff --git a/src/parser/classes/MerchandiseShelf.ts b/src/parser/classes/MerchandiseShelf.ts index 326a9ea3b..95a962277 100644 --- a/src/parser/classes/MerchandiseShelf.ts +++ b/src/parser/classes/MerchandiseShelf.ts @@ -1,5 +1,5 @@ -import Parser from '../index'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; class MerchandiseShelf extends YTNode { static type = 'MerchandiseShelf'; diff --git a/src/parser/classes/Message.ts b/src/parser/classes/Message.ts index bfc419829..49927a1d5 100644 --- a/src/parser/classes/Message.ts +++ b/src/parser/classes/Message.ts @@ -1,5 +1,5 @@ -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class Message extends YTNode { static type = 'Message'; diff --git a/src/parser/classes/MetadataBadge.ts b/src/parser/classes/MetadataBadge.ts index 83600bedb..f5e67cee5 100644 --- a/src/parser/classes/MetadataBadge.ts +++ b/src/parser/classes/MetadataBadge.ts @@ -1,4 +1,4 @@ -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class MetadataBadge extends YTNode { static type = 'MetadataBadge'; diff --git a/src/parser/classes/MetadataRow.ts b/src/parser/classes/MetadataRow.ts index 8a74f6005..18c8ed860 100644 --- a/src/parser/classes/MetadataRow.ts +++ b/src/parser/classes/MetadataRow.ts @@ -1,5 +1,5 @@ -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class MetadataRow extends YTNode { static type = 'MetadataRow'; diff --git a/src/parser/classes/MetadataRowContainer.ts b/src/parser/classes/MetadataRowContainer.ts index 62a61b076..d8845a859 100644 --- a/src/parser/classes/MetadataRowContainer.ts +++ b/src/parser/classes/MetadataRowContainer.ts @@ -1,5 +1,5 @@ -import Parser from '../index'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; class MetadataRowContainer extends YTNode { static type = 'MetadataRowContainer'; diff --git a/src/parser/classes/MetadataRowHeader.ts b/src/parser/classes/MetadataRowHeader.ts index 886bda63e..5e86c8324 100644 --- a/src/parser/classes/MetadataRowHeader.ts +++ b/src/parser/classes/MetadataRowHeader.ts @@ -1,5 +1,5 @@ -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class MetadataRowHeader extends YTNode { static type = 'MetadataRowHeader'; diff --git a/src/parser/classes/MetadataScreen.ts b/src/parser/classes/MetadataScreen.ts index fe03bbf76..89fb61cd8 100644 --- a/src/parser/classes/MetadataScreen.ts +++ b/src/parser/classes/MetadataScreen.ts @@ -1,5 +1,5 @@ -import Parser from '..'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; class MetadataScreen extends YTNode { static type = 'MetadataScreen'; diff --git a/src/parser/classes/MicroformatData.ts b/src/parser/classes/MicroformatData.ts index 9b2c29ad4..f486d77fe 100644 --- a/src/parser/classes/MicroformatData.ts +++ b/src/parser/classes/MicroformatData.ts @@ -1,5 +1,5 @@ -import Thumbnail from './misc/Thumbnail'; -import { YTNode } from '../helpers'; +import Thumbnail from './misc/Thumbnail.js'; +import { YTNode } from '../helpers.js'; class MicroformatData extends YTNode { static type = 'MicroformatData'; diff --git a/src/parser/classes/Mix.ts b/src/parser/classes/Mix.ts index 9886591ec..25e28c2a4 100644 --- a/src/parser/classes/Mix.ts +++ b/src/parser/classes/Mix.ts @@ -1,4 +1,4 @@ -import Playlist from './Playlist'; +import Playlist from './Playlist.js'; class Mix extends Playlist { static type = 'Mix'; diff --git a/src/parser/classes/Movie.ts b/src/parser/classes/Movie.ts index 311dabe34..927547519 100644 --- a/src/parser/classes/Movie.ts +++ b/src/parser/classes/Movie.ts @@ -1,10 +1,10 @@ -import Parser from '../index'; -import Author from './misc/Author'; -import Thumbnail from './misc/Thumbnail'; -import NavigationEndpoint from './NavigationEndpoint'; -import { timeToSeconds } from '../../utils/Utils'; -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import Author from './misc/Author.js'; +import Thumbnail from './misc/Thumbnail.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { timeToSeconds } from '../../utils/Utils.js'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class Movie extends YTNode { static type = 'Movie'; diff --git a/src/parser/classes/MovingThumbnail.ts b/src/parser/classes/MovingThumbnail.ts index 3bc986edb..a56798643 100644 --- a/src/parser/classes/MovingThumbnail.ts +++ b/src/parser/classes/MovingThumbnail.ts @@ -1,5 +1,5 @@ -import Thumbnail from './misc/Thumbnail'; -import { YTNode } from '../helpers'; +import Thumbnail from './misc/Thumbnail.js'; +import { YTNode } from '../helpers.js'; class MovingThumbnail extends YTNode { static type = 'MovingThumbnail'; diff --git a/src/parser/classes/MultiMarkersPlayerBar.ts b/src/parser/classes/MultiMarkersPlayerBar.ts index 7ecd74cac..9b9da014a 100644 --- a/src/parser/classes/MultiMarkersPlayerBar.ts +++ b/src/parser/classes/MultiMarkersPlayerBar.ts @@ -1,8 +1,8 @@ -import Parser from '..'; -import type Chapter from './Chapter'; -import type Heatmap from './Heatmap'; +import Parser from '../index.js'; +import type Chapter from './Chapter.js'; +import type Heatmap from './Heatmap.js'; -import { observe, ObservedArray, YTNode } from '../helpers'; +import { observe, ObservedArray, YTNode } from '../helpers.js'; class Marker extends YTNode { static type = 'Marker'; diff --git a/src/parser/classes/MusicCarouselShelf.ts b/src/parser/classes/MusicCarouselShelf.ts index 18aba8360..1f3f59327 100644 --- a/src/parser/classes/MusicCarouselShelf.ts +++ b/src/parser/classes/MusicCarouselShelf.ts @@ -1,11 +1,11 @@ -import Parser from '../index'; +import Parser from '../index.js'; -import MusicTwoRowItem from './MusicTwoRowItem'; -import MusicResponsiveListItem from './MusicResponsiveListItem'; -import MusicCarouselShelfBasicHeader from './MusicCarouselShelfBasicHeader'; -import MusicNavigationButton from './MusicNavigationButton'; +import MusicTwoRowItem from './MusicTwoRowItem.js'; +import MusicResponsiveListItem from './MusicResponsiveListItem.js'; +import MusicCarouselShelfBasicHeader from './MusicCarouselShelfBasicHeader.js'; +import MusicNavigationButton from './MusicNavigationButton.js'; -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class MusicCarouselShelf extends YTNode { static type = 'MusicCarouselShelf'; diff --git a/src/parser/classes/MusicCarouselShelfBasicHeader.ts b/src/parser/classes/MusicCarouselShelfBasicHeader.ts index 0d222c583..94f26a48f 100644 --- a/src/parser/classes/MusicCarouselShelfBasicHeader.ts +++ b/src/parser/classes/MusicCarouselShelfBasicHeader.ts @@ -1,9 +1,9 @@ -import Text from './misc/Text'; -import { YTNode } from '../helpers'; -import MusicThumbnail from './MusicThumbnail'; -import Parser from '..'; -import Button from './Button'; -import IconLink from './IconLink'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; +import MusicThumbnail from './MusicThumbnail.js'; +import Parser from '../index.js'; +import Button from './Button.js'; +import IconLink from './IconLink.js'; class MusicCarouselShelfBasicHeader extends YTNode { static type = 'MusicCarouselShelfBasicHeader'; diff --git a/src/parser/classes/MusicDescriptionShelf.ts b/src/parser/classes/MusicDescriptionShelf.ts index 075bb90e5..eb4663da2 100644 --- a/src/parser/classes/MusicDescriptionShelf.ts +++ b/src/parser/classes/MusicDescriptionShelf.ts @@ -1,5 +1,5 @@ -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class MusicDescriptionShelf extends YTNode { static type = 'MusicDescriptionShelf'; diff --git a/src/parser/classes/MusicDetailHeader.ts b/src/parser/classes/MusicDetailHeader.ts index 3168a254f..b40b009fa 100644 --- a/src/parser/classes/MusicDetailHeader.ts +++ b/src/parser/classes/MusicDetailHeader.ts @@ -1,9 +1,9 @@ -import Text from './misc/Text'; -import TextRun from './misc/TextRun'; -import Thumbnail from './misc/Thumbnail'; -import NavigationEndpoint from './NavigationEndpoint'; -import Parser from '../index'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import TextRun from './misc/TextRun.js'; +import Thumbnail from './misc/Thumbnail.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; class MusicDetailHeader extends YTNode { static type = 'MusicDetailHeader'; diff --git a/src/parser/classes/MusicDownloadStateBadge.ts b/src/parser/classes/MusicDownloadStateBadge.ts index b568ebcd2..dcd02caa4 100644 --- a/src/parser/classes/MusicDownloadStateBadge.ts +++ b/src/parser/classes/MusicDownloadStateBadge.ts @@ -1,4 +1,4 @@ -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class MusicDownloadStateBadge extends YTNode { static type = 'MusicDownloadStateBadge'; diff --git a/src/parser/classes/MusicEditablePlaylistDetailHeader.ts b/src/parser/classes/MusicEditablePlaylistDetailHeader.ts index ffdc155fa..bf411878a 100644 --- a/src/parser/classes/MusicEditablePlaylistDetailHeader.ts +++ b/src/parser/classes/MusicEditablePlaylistDetailHeader.ts @@ -1,5 +1,5 @@ -import Parser from '../index'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; class MusicEditablePlaylistDetailHeader extends YTNode { static type = 'MusicEditablePlaylistDetailHeader'; diff --git a/src/parser/classes/MusicElementHeader.ts b/src/parser/classes/MusicElementHeader.ts index c852a639f..5b6495edc 100644 --- a/src/parser/classes/MusicElementHeader.ts +++ b/src/parser/classes/MusicElementHeader.ts @@ -1,7 +1,7 @@ -import Parser from '../index'; -import Element from './Element'; +import Parser from '../index.js'; +import Element from './Element.js'; -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class MusicElementHeader extends YTNode { static type = 'MusicElementHeader'; diff --git a/src/parser/classes/MusicHeader.ts b/src/parser/classes/MusicHeader.ts index 63ce0ad4f..bfbaf7bbf 100644 --- a/src/parser/classes/MusicHeader.ts +++ b/src/parser/classes/MusicHeader.ts @@ -1,6 +1,6 @@ -import Parser from '../index'; -import { YTNode } from '../helpers'; -import Text from './misc/Text'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; +import Text from './misc/Text.js'; class MusicHeader extends YTNode { static type = 'MusicHeader'; diff --git a/src/parser/classes/MusicImmersiveHeader.ts b/src/parser/classes/MusicImmersiveHeader.ts index bb5aac034..8c2001cb1 100644 --- a/src/parser/classes/MusicImmersiveHeader.ts +++ b/src/parser/classes/MusicImmersiveHeader.ts @@ -1,8 +1,8 @@ -import Text from './misc/Text'; -import Parser from '../index'; -import MusicThumbnail from './MusicThumbnail'; +import Text from './misc/Text.js'; +import Parser from '../index.js'; +import MusicThumbnail from './MusicThumbnail.js'; -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class MusicImmersiveHeader extends YTNode { static type = 'MusicImmersiveHeader'; diff --git a/src/parser/classes/MusicInlineBadge.ts b/src/parser/classes/MusicInlineBadge.ts index b18fd2e8d..b3aec0eb7 100644 --- a/src/parser/classes/MusicInlineBadge.ts +++ b/src/parser/classes/MusicInlineBadge.ts @@ -1,4 +1,4 @@ -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class MusicInlineBadge extends YTNode { static type = 'MusicInlineBadge'; diff --git a/src/parser/classes/MusicItemThumbnailOverlay.ts b/src/parser/classes/MusicItemThumbnailOverlay.ts index 1d87e374b..ba8dfd597 100644 --- a/src/parser/classes/MusicItemThumbnailOverlay.ts +++ b/src/parser/classes/MusicItemThumbnailOverlay.ts @@ -1,6 +1,6 @@ -import Parser from '../index'; -import MusicPlayButton from './MusicPlayButton'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import MusicPlayButton from './MusicPlayButton.js'; +import { YTNode } from '../helpers.js'; class MusicItemThumbnailOverlay extends YTNode { static type = 'MusicItemThumbnailOverlay'; diff --git a/src/parser/classes/MusicLargeCardItemCarousel.ts b/src/parser/classes/MusicLargeCardItemCarousel.ts index f5c6aa18e..023c40900 100644 --- a/src/parser/classes/MusicLargeCardItemCarousel.ts +++ b/src/parser/classes/MusicLargeCardItemCarousel.ts @@ -1,5 +1,5 @@ -import NavigationEndpoint from './NavigationEndpoint'; -import { YTNode } from '../helpers'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { YTNode } from '../helpers.js'; class ActionButton { static type = 'ActionButton'; diff --git a/src/parser/classes/MusicNavigationButton.ts b/src/parser/classes/MusicNavigationButton.ts index b7a6c0fc5..2f7cf8821 100644 --- a/src/parser/classes/MusicNavigationButton.ts +++ b/src/parser/classes/MusicNavigationButton.ts @@ -1,6 +1,6 @@ -import Text from './misc/Text'; -import NavigationEndpoint from './NavigationEndpoint'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { YTNode } from '../helpers.js'; class MusicNavigationButton extends YTNode { static type = 'MusicNavigationButton'; diff --git a/src/parser/classes/MusicPlayButton.ts b/src/parser/classes/MusicPlayButton.ts index 5e689b997..726d84b1e 100644 --- a/src/parser/classes/MusicPlayButton.ts +++ b/src/parser/classes/MusicPlayButton.ts @@ -1,5 +1,5 @@ -import NavigationEndpoint from './NavigationEndpoint'; -import { YTNode } from '../helpers'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { YTNode } from '../helpers.js'; class MusicPlayButton extends YTNode { static type = 'MusicPlayButton'; diff --git a/src/parser/classes/MusicPlaylistShelf.ts b/src/parser/classes/MusicPlaylistShelf.ts index 0b084003b..a4da4ea1f 100644 --- a/src/parser/classes/MusicPlaylistShelf.ts +++ b/src/parser/classes/MusicPlaylistShelf.ts @@ -1,7 +1,7 @@ -import Parser from '../index'; -import MusicResponsiveListItem from './MusicResponsiveListItem'; +import Parser from '../index.js'; +import MusicResponsiveListItem from './MusicResponsiveListItem.js'; -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class MusicPlaylistShelf extends YTNode { static type = 'MusicPlaylistShelf'; diff --git a/src/parser/classes/MusicQueue.ts b/src/parser/classes/MusicQueue.ts index cd48395b7..c0c40f1df 100644 --- a/src/parser/classes/MusicQueue.ts +++ b/src/parser/classes/MusicQueue.ts @@ -1,6 +1,6 @@ -import Parser from '../index'; -import PlaylistPanel from './PlaylistPanel'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import PlaylistPanel from './PlaylistPanel.js'; +import { YTNode } from '../helpers.js'; class MusicQueue extends YTNode { static type = 'MusicQueue'; diff --git a/src/parser/classes/MusicResponsiveListItem.ts b/src/parser/classes/MusicResponsiveListItem.ts index b4a095a46..39c186d2d 100644 --- a/src/parser/classes/MusicResponsiveListItem.ts +++ b/src/parser/classes/MusicResponsiveListItem.ts @@ -1,18 +1,18 @@ // TODO: this needs a refactor // Seems like a mess to use -import Parser from '../index'; -import Text from './misc/Text'; -import TextRun from './misc/TextRun'; -import Thumbnail from './misc/Thumbnail'; -import NavigationEndpoint from './NavigationEndpoint'; -import MusicItemThumbnailOverlay from './MusicItemThumbnailOverlay'; -import MusicResponsiveListItemFlexColumn from './MusicResponsiveListItemFlexColumn'; -import MusicResponsiveListItemFixedColumn from './MusicResponsiveListItemFixedColumn'; -import Menu from './menus/Menu'; - -import { timeToSeconds } from '../../utils/Utils'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import Text from './misc/Text.js'; +import TextRun from './misc/TextRun.js'; +import Thumbnail from './misc/Thumbnail.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import MusicItemThumbnailOverlay from './MusicItemThumbnailOverlay.js'; +import MusicResponsiveListItemFlexColumn from './MusicResponsiveListItemFlexColumn.js'; +import MusicResponsiveListItemFixedColumn from './MusicResponsiveListItemFixedColumn.js'; +import Menu from './menus/Menu.js'; + +import { timeToSeconds } from '../../utils/Utils.js'; +import { YTNode } from '../helpers.js'; class MusicResponsiveListItem extends YTNode { static type = 'MusicResponsiveListItem'; diff --git a/src/parser/classes/MusicResponsiveListItemFixedColumn.ts b/src/parser/classes/MusicResponsiveListItemFixedColumn.ts index ff75c87d9..69d3a5638 100644 --- a/src/parser/classes/MusicResponsiveListItemFixedColumn.ts +++ b/src/parser/classes/MusicResponsiveListItemFixedColumn.ts @@ -1,5 +1,5 @@ -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class MusicResponsiveListItemFixedColumn extends YTNode { static type = 'musicResponsiveListItemFlexColumnRenderer'; diff --git a/src/parser/classes/MusicResponsiveListItemFlexColumn.ts b/src/parser/classes/MusicResponsiveListItemFlexColumn.ts index c0950690a..6375d92b5 100644 --- a/src/parser/classes/MusicResponsiveListItemFlexColumn.ts +++ b/src/parser/classes/MusicResponsiveListItemFlexColumn.ts @@ -1,5 +1,5 @@ -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class MusicResponsiveListItemFlexColumn extends YTNode { static type = 'musicResponsiveListItemFlexColumnRenderer'; diff --git a/src/parser/classes/MusicShelf.ts b/src/parser/classes/MusicShelf.ts index 9a423d9b6..9d2fa0e6e 100644 --- a/src/parser/classes/MusicShelf.ts +++ b/src/parser/classes/MusicShelf.ts @@ -1,10 +1,10 @@ -import Parser from '../index'; -import Text from './misc/Text'; -import NavigationEndpoint from './NavigationEndpoint'; -import MusicResponsiveListItem from './MusicResponsiveListItem'; +import Parser from '../index.js'; +import Text from './misc/Text.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import MusicResponsiveListItem from './MusicResponsiveListItem.js'; -import { YTNode } from '../helpers'; -import Button from './Button'; +import { YTNode } from '../helpers.js'; +import Button from './Button.js'; class MusicShelf extends YTNode { static type = 'MusicShelf'; diff --git a/src/parser/classes/MusicSideAlignedItem.ts b/src/parser/classes/MusicSideAlignedItem.ts index a60b19c8e..e5cddae46 100644 --- a/src/parser/classes/MusicSideAlignedItem.ts +++ b/src/parser/classes/MusicSideAlignedItem.ts @@ -1,6 +1,6 @@ -import Parser from '../index'; +import Parser from '../index.js'; -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class MusicSideAlignedItem extends YTNode { static type = 'MusicSideAlignedItem'; diff --git a/src/parser/classes/MusicSortFilterButton.ts b/src/parser/classes/MusicSortFilterButton.ts index 98879fafe..0ff6b0134 100644 --- a/src/parser/classes/MusicSortFilterButton.ts +++ b/src/parser/classes/MusicSortFilterButton.ts @@ -1,8 +1,8 @@ -import Parser from '../index'; +import Parser from '../index.js'; -import { YTNode } from '../helpers'; -import MusicMultiSelectMenu from './menus/MusicMultiSelectMenu'; -import Text from './misc/Text'; +import { YTNode } from '../helpers.js'; +import MusicMultiSelectMenu from './menus/MusicMultiSelectMenu.js'; +import Text from './misc/Text.js'; class MusicSortFilterButton extends YTNode { static type = 'MusicSortFilterButton'; diff --git a/src/parser/classes/MusicThumbnail.ts b/src/parser/classes/MusicThumbnail.ts index 6f643ab23..588305a08 100644 --- a/src/parser/classes/MusicThumbnail.ts +++ b/src/parser/classes/MusicThumbnail.ts @@ -1,5 +1,5 @@ -import Thumbnail from './misc/Thumbnail'; -import { YTNode } from '../helpers'; +import Thumbnail from './misc/Thumbnail.js'; +import { YTNode } from '../helpers.js'; class MusicThumbnail extends YTNode { static type = 'MusicThumbnail'; diff --git a/src/parser/classes/MusicTwoRowItem.ts b/src/parser/classes/MusicTwoRowItem.ts index 755c0ac8f..fff93691e 100644 --- a/src/parser/classes/MusicTwoRowItem.ts +++ b/src/parser/classes/MusicTwoRowItem.ts @@ -1,14 +1,14 @@ // TODO: refactor this -import Parser from '../index'; -import Text from './misc/Text'; -import TextRun from './misc/TextRun'; -import Thumbnail from './misc/Thumbnail'; -import NavigationEndpoint from './NavigationEndpoint'; -import MusicItemThumbnailOverlay from './MusicItemThumbnailOverlay'; -import Menu from './menus/Menu'; - -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import Text from './misc/Text.js'; +import TextRun from './misc/TextRun.js'; +import Thumbnail from './misc/Thumbnail.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import MusicItemThumbnailOverlay from './MusicItemThumbnailOverlay.js'; +import Menu from './menus/Menu.js'; + +import { YTNode } from '../helpers.js'; class MusicTwoRowItem extends YTNode { static type = 'MusicTwoRowItem'; diff --git a/src/parser/classes/MusicVisualHeader.ts b/src/parser/classes/MusicVisualHeader.ts index 1deedb44a..bdb7a4b02 100644 --- a/src/parser/classes/MusicVisualHeader.ts +++ b/src/parser/classes/MusicVisualHeader.ts @@ -1,8 +1,8 @@ -import Parser from '../index'; -import { YTNode } from '../helpers'; -import Text from './misc/Text'; -import Thumbnail from './misc/Thumbnail'; -import Menu from './menus/Menu'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; +import Text from './misc/Text.js'; +import Thumbnail from './misc/Thumbnail.js'; +import Menu from './menus/Menu.js'; class MusicVisualHeader extends YTNode { static type = 'MusicVisualHeader'; diff --git a/src/parser/classes/NavigationEndpoint.ts b/src/parser/classes/NavigationEndpoint.ts index 79755edc4..23830a68b 100644 --- a/src/parser/classes/NavigationEndpoint.ts +++ b/src/parser/classes/NavigationEndpoint.ts @@ -1,8 +1,8 @@ -import Parser, { ParsedResponse } from '../index'; -import Actions, { ActionsResponse } from '../../core/Actions'; -import { YTNode } from '../helpers'; +import Parser, { ParsedResponse } from '../index.js'; +import Actions, { ActionsResponse } from '../../core/Actions.js'; +import { YTNode } from '../helpers.js'; -import CreatePlaylistDialog from './CreatePlaylistDialog'; +import CreatePlaylistDialog from './CreatePlaylistDialog.js'; class NavigationEndpoint extends YTNode { static type = 'NavigationEndpoint'; diff --git a/src/parser/classes/Notification.ts b/src/parser/classes/Notification.ts index 8ab229394..965a548ba 100644 --- a/src/parser/classes/Notification.ts +++ b/src/parser/classes/Notification.ts @@ -1,8 +1,8 @@ -import Parser from '../index'; -import Text from './misc/Text'; -import Thumbnail from './misc/Thumbnail'; -import NavigationEndpoint from './NavigationEndpoint'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import Text from './misc/Text.js'; +import Thumbnail from './misc/Thumbnail.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { YTNode } from '../helpers.js'; class Notification extends YTNode { static type = 'Notification'; diff --git a/src/parser/classes/PageIntroduction.ts b/src/parser/classes/PageIntroduction.ts index fc43a02a5..f5ff02bf9 100644 --- a/src/parser/classes/PageIntroduction.ts +++ b/src/parser/classes/PageIntroduction.ts @@ -1,5 +1,5 @@ -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class PageIntroduction extends YTNode { static type = 'PageIntroduction'; diff --git a/src/parser/classes/PlayerAnnotationsExpanded.ts b/src/parser/classes/PlayerAnnotationsExpanded.ts index a7c0cf9a4..8b8130c73 100644 --- a/src/parser/classes/PlayerAnnotationsExpanded.ts +++ b/src/parser/classes/PlayerAnnotationsExpanded.ts @@ -1,7 +1,7 @@ -import Parser from '../index'; -import Thumbnail from './misc/Thumbnail'; -import NavigationEndpoint from './NavigationEndpoint'; -import { YTNode, SuperParsedResult } from '../helpers'; +import Parser from '../index.js'; +import Thumbnail from './misc/Thumbnail.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { YTNode, SuperParsedResult } from '../helpers.js'; class PlayerAnnotationsExpanded extends YTNode { static type = 'PlayerAnnotationsExpanded'; diff --git a/src/parser/classes/PlayerCaptionsTracklist.ts b/src/parser/classes/PlayerCaptionsTracklist.ts index 0efea8c89..4c9a194ac 100644 --- a/src/parser/classes/PlayerCaptionsTracklist.ts +++ b/src/parser/classes/PlayerCaptionsTracklist.ts @@ -1,5 +1,5 @@ -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class PlayerCaptionsTracklist extends YTNode { static type = 'PlayerCaptionsTracklist'; diff --git a/src/parser/classes/PlayerErrorMessage.ts b/src/parser/classes/PlayerErrorMessage.ts index 9ed68a875..f21d636b5 100644 --- a/src/parser/classes/PlayerErrorMessage.ts +++ b/src/parser/classes/PlayerErrorMessage.ts @@ -1,9 +1,9 @@ -import Parser from '../index'; -import Text from './misc/Text'; -import Thumbnail from './misc/Thumbnail'; -import Button from './Button'; +import Parser from '../index.js'; +import Text from './misc/Text.js'; +import Thumbnail from './misc/Thumbnail.js'; +import Button from './Button.js'; -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class PlayerErrorMessage extends YTNode { static type = 'PlayerErrorMessage'; diff --git a/src/parser/classes/PlayerLiveStoryboardSpec.ts b/src/parser/classes/PlayerLiveStoryboardSpec.ts index 69b57154b..78ed155fa 100644 --- a/src/parser/classes/PlayerLiveStoryboardSpec.ts +++ b/src/parser/classes/PlayerLiveStoryboardSpec.ts @@ -1,4 +1,4 @@ -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class PlayerLiveStoryboardSpec extends YTNode { static type = 'PlayerLiveStoryboardSpec'; diff --git a/src/parser/classes/PlayerMicroformat.ts b/src/parser/classes/PlayerMicroformat.ts index ff3e147ed..2ea56a995 100644 --- a/src/parser/classes/PlayerMicroformat.ts +++ b/src/parser/classes/PlayerMicroformat.ts @@ -1,6 +1,6 @@ -import Text from './misc/Text'; -import Thumbnail from './misc/Thumbnail'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import Thumbnail from './misc/Thumbnail.js'; +import { YTNode } from '../helpers.js'; class PlayerMicroformat extends YTNode { static type = 'PlayerMicroformat'; diff --git a/src/parser/classes/PlayerOverlay.ts b/src/parser/classes/PlayerOverlay.ts index 185acbb7a..91e2c658f 100644 --- a/src/parser/classes/PlayerOverlay.ts +++ b/src/parser/classes/PlayerOverlay.ts @@ -1,11 +1,11 @@ -import Parser from '../index'; -import Menu from './menus/Menu'; -import Button from './Button'; -import WatchNextEndScreen from './WatchNextEndScreen'; -import PlayerOverlayAutoplay from './PlayerOverlayAutoplay'; -import type DecoratedPlayerBar from './DecoratedPlayerBar'; +import Parser from '../index.js'; +import Menu from './menus/Menu.js'; +import Button from './Button.js'; +import WatchNextEndScreen from './WatchNextEndScreen.js'; +import PlayerOverlayAutoplay from './PlayerOverlayAutoplay.js'; +import type DecoratedPlayerBar from './DecoratedPlayerBar.js'; -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class PlayerOverlay extends YTNode { static type = 'PlayerOverlay'; diff --git a/src/parser/classes/PlayerOverlayAutoplay.ts b/src/parser/classes/PlayerOverlayAutoplay.ts index fec5d068c..25b07466d 100644 --- a/src/parser/classes/PlayerOverlayAutoplay.ts +++ b/src/parser/classes/PlayerOverlayAutoplay.ts @@ -1,9 +1,9 @@ -import Parser from '../index'; -import Text from './misc/Text'; -import Author from './misc/Author'; -import Thumbnail from './misc/Thumbnail'; -import Button from './Button'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import Text from './misc/Text.js'; +import Author from './misc/Author.js'; +import Thumbnail from './misc/Thumbnail.js'; +import Button from './Button.js'; +import { YTNode } from '../helpers.js'; class PlayerOverlayAutoplay extends YTNode { static type = 'PlayerOverlayAutoplay'; diff --git a/src/parser/classes/PlayerStoryboardSpec.ts b/src/parser/classes/PlayerStoryboardSpec.ts index 05c2eba5e..1f6d655c0 100644 --- a/src/parser/classes/PlayerStoryboardSpec.ts +++ b/src/parser/classes/PlayerStoryboardSpec.ts @@ -1,4 +1,4 @@ -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class PlayerStoryboardSpec extends YTNode { static type = 'PlayerStoryboardSpec'; diff --git a/src/parser/classes/Playlist.ts b/src/parser/classes/Playlist.ts index d9b18efc0..94ea49318 100644 --- a/src/parser/classes/Playlist.ts +++ b/src/parser/classes/Playlist.ts @@ -1,9 +1,9 @@ -import Text from './misc/Text'; -import Parser from '../index'; -import Thumbnail from './misc/Thumbnail'; -import NavigationEndpoint from './NavigationEndpoint'; -import PlaylistAuthor from './misc/PlaylistAuthor'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import Parser from '../index.js'; +import Thumbnail from './misc/Thumbnail.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import PlaylistAuthor from './misc/PlaylistAuthor.js'; +import { YTNode } from '../helpers.js'; class Playlist extends YTNode { static type = 'Playlist'; diff --git a/src/parser/classes/PlaylistCustomThumbnail.ts b/src/parser/classes/PlaylistCustomThumbnail.ts index f22270d08..d385f78e3 100644 --- a/src/parser/classes/PlaylistCustomThumbnail.ts +++ b/src/parser/classes/PlaylistCustomThumbnail.ts @@ -1,5 +1,5 @@ -import { YTNode } from '../helpers'; -import Thumbnail from './misc/Thumbnail'; +import { YTNode } from '../helpers.js'; +import Thumbnail from './misc/Thumbnail.js'; class PlaylistCustomThumbnail extends YTNode { static type = 'PlaylistCustomThumbnail'; diff --git a/src/parser/classes/PlaylistHeader.ts b/src/parser/classes/PlaylistHeader.ts index 1677e54d4..a670538d4 100644 --- a/src/parser/classes/PlaylistHeader.ts +++ b/src/parser/classes/PlaylistHeader.ts @@ -1,7 +1,7 @@ -import Text from './misc/Text'; -import PlaylistAuthor from './misc/PlaylistAuthor'; -import Parser from '../index'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import PlaylistAuthor from './misc/PlaylistAuthor.js'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; class PlaylistHeader extends YTNode { static type = 'PlaylistHeader'; diff --git a/src/parser/classes/PlaylistInfoCardContent.ts b/src/parser/classes/PlaylistInfoCardContent.ts index 6a683a010..688d2054d 100644 --- a/src/parser/classes/PlaylistInfoCardContent.ts +++ b/src/parser/classes/PlaylistInfoCardContent.ts @@ -1,7 +1,7 @@ -import Text from './misc/Text'; -import Thumbnail from './misc/Thumbnail'; -import NavigationEndpoint from './NavigationEndpoint'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import Thumbnail from './misc/Thumbnail.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { YTNode } from '../helpers.js'; class PlaylistInfoCardContent extends YTNode { static type = 'PlaylistInfoCardContent'; diff --git a/src/parser/classes/PlaylistMetadata.ts b/src/parser/classes/PlaylistMetadata.ts index b27826afb..2252e1f73 100644 --- a/src/parser/classes/PlaylistMetadata.ts +++ b/src/parser/classes/PlaylistMetadata.ts @@ -1,4 +1,4 @@ -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class PlaylistMetadata extends YTNode { static type = 'PlaylistMetadata'; diff --git a/src/parser/classes/PlaylistPanel.ts b/src/parser/classes/PlaylistPanel.ts index 4c0c8c560..fede4e43a 100644 --- a/src/parser/classes/PlaylistPanel.ts +++ b/src/parser/classes/PlaylistPanel.ts @@ -1,10 +1,10 @@ -import Parser from '../index'; -import Text from './misc/Text'; -import PlaylistPanelVideo from './PlaylistPanelVideo'; +import Parser from '../index.js'; +import Text from './misc/Text.js'; +import PlaylistPanelVideo from './PlaylistPanelVideo.js'; -import { YTNode } from '../helpers'; -import AutomixPreviewVideo from './AutomixPreviewVideo'; -import PlaylistPanelVideoWrapper from './PlaylistPanelVideoWrapper'; +import { YTNode } from '../helpers.js'; +import AutomixPreviewVideo from './AutomixPreviewVideo.js'; +import PlaylistPanelVideoWrapper from './PlaylistPanelVideoWrapper.js'; class PlaylistPanel extends YTNode { static type = 'PlaylistPanel'; diff --git a/src/parser/classes/PlaylistPanelVideo.ts b/src/parser/classes/PlaylistPanelVideo.ts index 08039519d..ab0999cca 100644 --- a/src/parser/classes/PlaylistPanelVideo.ts +++ b/src/parser/classes/PlaylistPanelVideo.ts @@ -1,11 +1,11 @@ -import Parser from '../index'; -import Text from './misc/Text'; -import TextRun from './misc/TextRun'; -import Thumbnail from './misc/Thumbnail'; -import NavigationEndpoint from './NavigationEndpoint'; -import { timeToSeconds } from '../../utils/Utils'; - -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import Text from './misc/Text.js'; +import TextRun from './misc/TextRun.js'; +import Thumbnail from './misc/Thumbnail.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { timeToSeconds } from '../../utils/Utils.js'; + +import { YTNode } from '../helpers.js'; class PlaylistPanelVideo extends YTNode { static type = 'PlaylistPanelVideo'; diff --git a/src/parser/classes/PlaylistPanelVideoWrapper.ts b/src/parser/classes/PlaylistPanelVideoWrapper.ts index 47166e8c3..872ea50a3 100644 --- a/src/parser/classes/PlaylistPanelVideoWrapper.ts +++ b/src/parser/classes/PlaylistPanelVideoWrapper.ts @@ -1,6 +1,6 @@ -import Parser from '..'; -import { YTNode } from '../helpers'; -import PlaylistPanelVideo from './PlaylistPanelVideo'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; +import PlaylistPanelVideo from './PlaylistPanelVideo.js'; class PlaylistPanelVideoWrapper extends YTNode { static type = 'PlaylistPanelVideoWrapper'; diff --git a/src/parser/classes/PlaylistSidebar.ts b/src/parser/classes/PlaylistSidebar.ts index 10a58fa1d..570a15bd6 100644 --- a/src/parser/classes/PlaylistSidebar.ts +++ b/src/parser/classes/PlaylistSidebar.ts @@ -1,5 +1,5 @@ -import Parser from '../index'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; class PlaylistSidebar extends YTNode { static type = 'PlaylistSidebar'; diff --git a/src/parser/classes/PlaylistSidebarPrimaryInfo.ts b/src/parser/classes/PlaylistSidebarPrimaryInfo.ts index 56f0eec16..141cf8287 100644 --- a/src/parser/classes/PlaylistSidebarPrimaryInfo.ts +++ b/src/parser/classes/PlaylistSidebarPrimaryInfo.ts @@ -1,8 +1,8 @@ -import Parser from '../index'; -import Text from './misc/Text'; -import NavigationEndpoint from './NavigationEndpoint'; +import Parser from '../index.js'; +import Text from './misc/Text.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class PlaylistSidebarPrimaryInfo extends YTNode { static type = 'PlaylistSidebarPrimaryInfo'; diff --git a/src/parser/classes/PlaylistSidebarSecondaryInfo.ts b/src/parser/classes/PlaylistSidebarSecondaryInfo.ts index dd3f892b2..86f54af2d 100644 --- a/src/parser/classes/PlaylistSidebarSecondaryInfo.ts +++ b/src/parser/classes/PlaylistSidebarSecondaryInfo.ts @@ -1,5 +1,5 @@ -import Parser from '../index'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; class PlaylistSidebarSecondaryInfo extends YTNode { static type = 'PlaylistSidebarSecondaryInfo'; diff --git a/src/parser/classes/PlaylistVideo.ts b/src/parser/classes/PlaylistVideo.ts index 7cbc4f34b..ab67fee60 100644 --- a/src/parser/classes/PlaylistVideo.ts +++ b/src/parser/classes/PlaylistVideo.ts @@ -1,11 +1,11 @@ -import Text from './misc/Text'; -import Parser from '../index'; -import Thumbnail from './misc/Thumbnail'; -import PlaylistAuthor from './misc/PlaylistAuthor'; -import NavigationEndpoint from './NavigationEndpoint'; -import type Menu from './menus/Menu'; +import Text from './misc/Text.js'; +import Parser from '../index.js'; +import Thumbnail from './misc/Thumbnail.js'; +import PlaylistAuthor from './misc/PlaylistAuthor.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import type Menu from './menus/Menu.js'; -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class PlaylistVideo extends YTNode { static type = 'PlaylistVideo'; diff --git a/src/parser/classes/PlaylistVideoList.ts b/src/parser/classes/PlaylistVideoList.ts index 3bf31242a..cf6c739fc 100644 --- a/src/parser/classes/PlaylistVideoList.ts +++ b/src/parser/classes/PlaylistVideoList.ts @@ -1,5 +1,5 @@ -import Parser from '../index'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; class PlaylistVideoList extends YTNode { static type = 'PlaylistVideoList'; diff --git a/src/parser/classes/PlaylistVideoThumbnail.ts b/src/parser/classes/PlaylistVideoThumbnail.ts index 42f082635..fca8b3891 100644 --- a/src/parser/classes/PlaylistVideoThumbnail.ts +++ b/src/parser/classes/PlaylistVideoThumbnail.ts @@ -1,5 +1,5 @@ -import Thumbnail from './misc/Thumbnail'; -import { YTNode } from '../helpers'; +import Thumbnail from './misc/Thumbnail.js'; +import { YTNode } from '../helpers.js'; class PlaylistVideoThumbnail extends YTNode { static type = 'PlaylistVideoThumbnail'; diff --git a/src/parser/classes/Poll.ts b/src/parser/classes/Poll.ts index 8de91522b..f84173406 100644 --- a/src/parser/classes/Poll.ts +++ b/src/parser/classes/Poll.ts @@ -1,7 +1,7 @@ -import Text from './misc/Text'; -import Thumbnail from './misc/Thumbnail'; -import NavigationEndpoint from './NavigationEndpoint'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import Thumbnail from './misc/Thumbnail.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { YTNode } from '../helpers.js'; class Poll extends YTNode { static type = 'Poll'; diff --git a/src/parser/classes/Post.ts b/src/parser/classes/Post.ts index d0f6db2b3..acf9dc19b 100644 --- a/src/parser/classes/Post.ts +++ b/src/parser/classes/Post.ts @@ -1,4 +1,4 @@ -import BackstagePost from './BackstagePost'; +import BackstagePost from './BackstagePost.js'; class Post extends BackstagePost { static type = 'Post'; diff --git a/src/parser/classes/PostMultiImage.ts b/src/parser/classes/PostMultiImage.ts index 9a95f01a8..12605bb7b 100644 --- a/src/parser/classes/PostMultiImage.ts +++ b/src/parser/classes/PostMultiImage.ts @@ -1,7 +1,7 @@ -import Parser from '../index'; -import BackstageImage from './BackstageImage'; +import Parser from '../index.js'; +import BackstageImage from './BackstageImage.js'; -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class PostMultiImage extends YTNode { static type = 'PostMultiImage'; diff --git a/src/parser/classes/ProfileColumn.ts b/src/parser/classes/ProfileColumn.ts index 3f073714d..a3e5d3e22 100644 --- a/src/parser/classes/ProfileColumn.ts +++ b/src/parser/classes/ProfileColumn.ts @@ -1,5 +1,5 @@ -import Parser from '../index'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; class ProfileColumn extends YTNode { static type = 'ProfileColumn'; diff --git a/src/parser/classes/ProfileColumnStats.ts b/src/parser/classes/ProfileColumnStats.ts index ab27337f0..79a2cb8b9 100644 --- a/src/parser/classes/ProfileColumnStats.ts +++ b/src/parser/classes/ProfileColumnStats.ts @@ -1,5 +1,5 @@ -import Parser from '../index'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; class ProfileColumnStats extends YTNode { static type = 'ProfileColumnStats'; diff --git a/src/parser/classes/ProfileColumnStatsEntry.ts b/src/parser/classes/ProfileColumnStatsEntry.ts index edcb20d55..2827bdab5 100644 --- a/src/parser/classes/ProfileColumnStatsEntry.ts +++ b/src/parser/classes/ProfileColumnStatsEntry.ts @@ -1,5 +1,5 @@ -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class ProfileColumnStatsEntry extends YTNode { static type = 'ProfileColumnStatsEntry'; diff --git a/src/parser/classes/ProfileColumnUserInfo.ts b/src/parser/classes/ProfileColumnUserInfo.ts index f9e44db25..ec118064b 100644 --- a/src/parser/classes/ProfileColumnUserInfo.ts +++ b/src/parser/classes/ProfileColumnUserInfo.ts @@ -1,6 +1,6 @@ -import Text from './misc/Text'; -import Thumbnail from './misc/Thumbnail'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import Thumbnail from './misc/Thumbnail.js'; +import { YTNode } from '../helpers.js'; class ProfileColumnUserInfo extends YTNode { static type = 'ProfileColumnUserInfo'; diff --git a/src/parser/classes/RecognitionShelf.ts b/src/parser/classes/RecognitionShelf.ts index 473a30fe5..5c27938dc 100644 --- a/src/parser/classes/RecognitionShelf.ts +++ b/src/parser/classes/RecognitionShelf.ts @@ -1,9 +1,9 @@ -import Parser from '..'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; -import Button from './Button'; -import Text from './misc/Text'; -import Thumbnail from './misc/Thumbnail'; +import Button from './Button.js'; +import Text from './misc/Text.js'; +import Thumbnail from './misc/Thumbnail.js'; class RecognitionShelf extends YTNode { static type = 'RecognitionShelf'; diff --git a/src/parser/classes/ReelItem.ts b/src/parser/classes/ReelItem.ts index 15579eadb..cf1c39b10 100644 --- a/src/parser/classes/ReelItem.ts +++ b/src/parser/classes/ReelItem.ts @@ -1,7 +1,7 @@ -import NavigationEndpoint from './NavigationEndpoint'; -import Text from './misc/Text'; -import Thumbnail from './misc/Thumbnail'; -import { YTNode } from '../helpers'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import Text from './misc/Text.js'; +import Thumbnail from './misc/Thumbnail.js'; +import { YTNode } from '../helpers.js'; class ReelItem extends YTNode { static type = 'ReelItem'; diff --git a/src/parser/classes/ReelShelf.ts b/src/parser/classes/ReelShelf.ts index 5003b52a8..a578bddc0 100644 --- a/src/parser/classes/ReelShelf.ts +++ b/src/parser/classes/ReelShelf.ts @@ -1,7 +1,7 @@ -import Parser from '../index'; -import NavigationEndpoint from './NavigationEndpoint'; -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class ReelShelf extends YTNode { static type = 'ReelShelf'; diff --git a/src/parser/classes/RelatedChipCloud.ts b/src/parser/classes/RelatedChipCloud.ts index 0e75c040a..bc987b273 100644 --- a/src/parser/classes/RelatedChipCloud.ts +++ b/src/parser/classes/RelatedChipCloud.ts @@ -1,5 +1,5 @@ -import Parser from '../index'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; class RelatedChipCloud extends YTNode { static type = 'RelatedChipCloud'; diff --git a/src/parser/classes/RichGrid.ts b/src/parser/classes/RichGrid.ts index db12b0676..a7c3bdc58 100644 --- a/src/parser/classes/RichGrid.ts +++ b/src/parser/classes/RichGrid.ts @@ -1,6 +1,6 @@ -import Parser from '../index'; +import Parser from '../index.js'; -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class RichGrid extends YTNode { static type = 'RichGrid'; diff --git a/src/parser/classes/RichItem.ts b/src/parser/classes/RichItem.ts index df4c3f823..c7b3d98a9 100644 --- a/src/parser/classes/RichItem.ts +++ b/src/parser/classes/RichItem.ts @@ -1,5 +1,5 @@ -import Parser from '../index'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; class RichItem extends YTNode { static type = 'RichItem'; diff --git a/src/parser/classes/RichListHeader.ts b/src/parser/classes/RichListHeader.ts index 7f1e1d664..dba218bec 100644 --- a/src/parser/classes/RichListHeader.ts +++ b/src/parser/classes/RichListHeader.ts @@ -1,5 +1,5 @@ -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class RichListHeader extends YTNode { static type = 'RichListHeader'; diff --git a/src/parser/classes/RichSection.ts b/src/parser/classes/RichSection.ts index 5ff292bae..ad69a4796 100644 --- a/src/parser/classes/RichSection.ts +++ b/src/parser/classes/RichSection.ts @@ -1,5 +1,5 @@ -import Parser from '../index'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; class RichSection extends YTNode { static type = 'RichSection'; diff --git a/src/parser/classes/RichShelf.ts b/src/parser/classes/RichShelf.ts index cf1ab91ef..d060a52f9 100644 --- a/src/parser/classes/RichShelf.ts +++ b/src/parser/classes/RichShelf.ts @@ -1,7 +1,7 @@ -import Parser from '../index'; -import NavigationEndpoint from './NavigationEndpoint'; -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class RichShelf extends YTNode { static type = 'RichShelf'; diff --git a/src/parser/classes/SearchBox.ts b/src/parser/classes/SearchBox.ts index d13553718..56fd58568 100644 --- a/src/parser/classes/SearchBox.ts +++ b/src/parser/classes/SearchBox.ts @@ -1,7 +1,7 @@ -import Parser from '../index'; -import Text from './misc/Text'; -import NavigationEndpoint from './NavigationEndpoint'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import Text from './misc/Text.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { YTNode } from '../helpers.js'; class SearchBox extends YTNode { static type = 'SearchBox'; diff --git a/src/parser/classes/SearchRefinementCard.ts b/src/parser/classes/SearchRefinementCard.ts index 63ce0c64d..3a749bc87 100644 --- a/src/parser/classes/SearchRefinementCard.ts +++ b/src/parser/classes/SearchRefinementCard.ts @@ -1,7 +1,7 @@ -import NavigationEndpoint from './NavigationEndpoint'; -import Thumbnail from './misc/Thumbnail'; -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import Thumbnail from './misc/Thumbnail.js'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class SearchRefinementCard extends YTNode { static type = 'SearchRefinementCard'; diff --git a/src/parser/classes/SearchSuggestion.ts b/src/parser/classes/SearchSuggestion.ts index 575bb2c34..dde78b753 100644 --- a/src/parser/classes/SearchSuggestion.ts +++ b/src/parser/classes/SearchSuggestion.ts @@ -1,6 +1,6 @@ -import Text from './misc/Text'; -import NavigationEndpoint from './NavigationEndpoint'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { YTNode } from '../helpers.js'; class SearchSuggestion extends YTNode { static type = 'SearchSuggestion'; diff --git a/src/parser/classes/SearchSuggestionsSection.ts b/src/parser/classes/SearchSuggestionsSection.ts index 83fa0cd9d..7969771fa 100644 --- a/src/parser/classes/SearchSuggestionsSection.ts +++ b/src/parser/classes/SearchSuggestionsSection.ts @@ -1,5 +1,5 @@ -import Parser from '../index'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; class SearchSuggestionsSection extends YTNode { static type = 'SearchSuggestionsSection'; diff --git a/src/parser/classes/SecondarySearchContainer.ts b/src/parser/classes/SecondarySearchContainer.ts index 29e5ae331..aa0af9915 100644 --- a/src/parser/classes/SecondarySearchContainer.ts +++ b/src/parser/classes/SecondarySearchContainer.ts @@ -1,5 +1,5 @@ -import Parser from '../index'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; class SecondarySearchContainer extends YTNode { static type = 'SecondarySearchContainer'; diff --git a/src/parser/classes/SectionList.ts b/src/parser/classes/SectionList.ts index faa5872c4..ec21674ad 100644 --- a/src/parser/classes/SectionList.ts +++ b/src/parser/classes/SectionList.ts @@ -1,5 +1,5 @@ -import Parser from '../index'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; class SectionList extends YTNode { static type = 'SectionList'; diff --git a/src/parser/classes/SegmentedLikeDislikeButton.ts b/src/parser/classes/SegmentedLikeDislikeButton.ts index 6f2ea8ee0..1dd446146 100644 --- a/src/parser/classes/SegmentedLikeDislikeButton.ts +++ b/src/parser/classes/SegmentedLikeDislikeButton.ts @@ -1,6 +1,6 @@ -import Parser from '..'; -import ToggleButton from './ToggleButton'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import ToggleButton from './ToggleButton.js'; +import { YTNode } from '../helpers.js'; class SegmentedLikeDislikeButton extends YTNode { static type = 'SegmentedLikeDislikeButton'; diff --git a/src/parser/classes/SettingBoolean.ts b/src/parser/classes/SettingBoolean.ts index c9bc6bba6..193d8893c 100644 --- a/src/parser/classes/SettingBoolean.ts +++ b/src/parser/classes/SettingBoolean.ts @@ -1,7 +1,7 @@ -import Text from './misc/Text'; -import NavigationEndpoint from './NavigationEndpoint'; +import Text from './misc/Text.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class SettingBoolean extends YTNode { static type = 'SettingBoolean'; diff --git a/src/parser/classes/SettingsCheckbox.ts b/src/parser/classes/SettingsCheckbox.ts index 78f062caf..1d59e3182 100644 --- a/src/parser/classes/SettingsCheckbox.ts +++ b/src/parser/classes/SettingsCheckbox.ts @@ -1,5 +1,5 @@ -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class SettingsCheckbox extends YTNode { static type = 'SettingsCheckbox'; diff --git a/src/parser/classes/SettingsOptions.ts b/src/parser/classes/SettingsOptions.ts index 862b7a75b..3ac5c5175 100644 --- a/src/parser/classes/SettingsOptions.ts +++ b/src/parser/classes/SettingsOptions.ts @@ -1,13 +1,13 @@ -import Parser from '..'; +import Parser from '../index.js'; -import Text from './misc/Text'; -import Dropdown from './Dropdown'; -import SettingsSwitch from './SettingsSwitch'; -import SettingsCheckbox from './SettingsCheckbox'; -import ChannelOptions from './ChannelOptions'; -import CopyLink from './CopyLink'; +import Text from './misc/Text.js'; +import Dropdown from './Dropdown.js'; +import SettingsSwitch from './SettingsSwitch.js'; +import SettingsCheckbox from './SettingsCheckbox.js'; +import ChannelOptions from './ChannelOptions.js'; +import CopyLink from './CopyLink.js'; -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class SettingsOptions extends YTNode { static type = 'SettingsOptions'; diff --git a/src/parser/classes/SettingsSidebar.ts b/src/parser/classes/SettingsSidebar.ts index edb60857a..8289d0038 100644 --- a/src/parser/classes/SettingsSidebar.ts +++ b/src/parser/classes/SettingsSidebar.ts @@ -1,7 +1,7 @@ -import Parser from '../index'; -import Text from './misc/Text'; -import CompactLink from './CompactLink'; -import { ObservedArray, YTNode } from '../helpers'; +import Parser from '../index.js'; +import Text from './misc/Text.js'; +import CompactLink from './CompactLink.js'; +import { ObservedArray, YTNode } from '../helpers.js'; class SettingsSidebar extends YTNode { static type = 'SettingsSidebar'; diff --git a/src/parser/classes/SettingsSwitch.ts b/src/parser/classes/SettingsSwitch.ts index a3e7b5575..1c398bc49 100644 --- a/src/parser/classes/SettingsSwitch.ts +++ b/src/parser/classes/SettingsSwitch.ts @@ -1,6 +1,6 @@ -import Text from './misc/Text'; -import NavigationEndpoint from './NavigationEndpoint'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { YTNode } from '../helpers.js'; class SettingsSwitch extends YTNode { static type = 'SettingsSwitch'; diff --git a/src/parser/classes/Shelf.ts b/src/parser/classes/Shelf.ts index f20f8e0d8..b4cfc4c6a 100644 --- a/src/parser/classes/Shelf.ts +++ b/src/parser/classes/Shelf.ts @@ -1,7 +1,7 @@ -import Text from './misc/Text'; -import Parser from '../index'; -import NavigationEndpoint from './NavigationEndpoint'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import Parser from '../index.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { YTNode } from '../helpers.js'; class Shelf extends YTNode { static type = 'Shelf'; diff --git a/src/parser/classes/ShowingResultsFor.ts b/src/parser/classes/ShowingResultsFor.ts index 7be99d777..b03935523 100644 --- a/src/parser/classes/ShowingResultsFor.ts +++ b/src/parser/classes/ShowingResultsFor.ts @@ -1,6 +1,6 @@ -import Text from './misc/Text'; -import NavigationEndpoint from './NavigationEndpoint'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { YTNode } from '../helpers.js'; class ShowingResultsFor extends YTNode { static type = 'ShowingResultsFor'; diff --git a/src/parser/classes/SimpleCardContent.ts b/src/parser/classes/SimpleCardContent.ts index f2c7c80da..02624cc0d 100644 --- a/src/parser/classes/SimpleCardContent.ts +++ b/src/parser/classes/SimpleCardContent.ts @@ -1,8 +1,8 @@ -import Text from './misc/Text'; -import Thumbnail from './misc/Thumbnail'; -import NavigationEndpoint from './NavigationEndpoint'; +import Text from './misc/Text.js'; +import Thumbnail from './misc/Thumbnail.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class SimpleCardContent extends YTNode { static type = 'SimpleCardContent'; diff --git a/src/parser/classes/SimpleCardTeaser.ts b/src/parser/classes/SimpleCardTeaser.ts index 05ea5f268..3362770f5 100644 --- a/src/parser/classes/SimpleCardTeaser.ts +++ b/src/parser/classes/SimpleCardTeaser.ts @@ -1,5 +1,5 @@ -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class SimpleCardTeaser extends YTNode { static type = 'SimpleCardTeaser'; diff --git a/src/parser/classes/SimpleTextSection.ts b/src/parser/classes/SimpleTextSection.ts index b4c5bd5d5..a5fa0e43c 100644 --- a/src/parser/classes/SimpleTextSection.ts +++ b/src/parser/classes/SimpleTextSection.ts @@ -1,6 +1,6 @@ -import Text from './misc/Text'; +import Text from './misc/Text.js'; -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class SimpleTextSection extends YTNode { static type = 'SimpleTextSection'; diff --git a/src/parser/classes/SingleActionEmergencySupport.ts b/src/parser/classes/SingleActionEmergencySupport.ts index 43dfd318f..ff6e2eb29 100644 --- a/src/parser/classes/SingleActionEmergencySupport.ts +++ b/src/parser/classes/SingleActionEmergencySupport.ts @@ -1,6 +1,6 @@ -import Text from './misc/Text'; -import NavigationEndpoint from './NavigationEndpoint'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { YTNode } from '../helpers.js'; class SingleActionEmergencySupport extends YTNode { static type = 'SingleActionEmergencySupport'; diff --git a/src/parser/classes/SingleColumnBrowseResults.ts b/src/parser/classes/SingleColumnBrowseResults.ts index 4edfad345..bbbb7434b 100644 --- a/src/parser/classes/SingleColumnBrowseResults.ts +++ b/src/parser/classes/SingleColumnBrowseResults.ts @@ -1,7 +1,7 @@ -import Parser from '../index'; -import Tab from './Tab'; +import Parser from '../index.js'; +import Tab from './Tab.js'; -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class SingleColumnBrowseResults extends YTNode { static type = 'SingleColumnBrowseResults'; diff --git a/src/parser/classes/SingleColumnMusicWatchNextResults.ts b/src/parser/classes/SingleColumnMusicWatchNextResults.ts index e680e484f..351c7b08a 100644 --- a/src/parser/classes/SingleColumnMusicWatchNextResults.ts +++ b/src/parser/classes/SingleColumnMusicWatchNextResults.ts @@ -1,5 +1,5 @@ -import Parser from '../index'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; class SingleColumnMusicWatchNextResults extends YTNode { static type = 'SingleColumnMusicWatchNextResults'; diff --git a/src/parser/classes/SingleHeroImage.ts b/src/parser/classes/SingleHeroImage.ts index f17d74b39..89105606e 100644 --- a/src/parser/classes/SingleHeroImage.ts +++ b/src/parser/classes/SingleHeroImage.ts @@ -1,5 +1,5 @@ -import Thumbnail from './misc/Thumbnail'; -import { YTNode } from '../helpers'; +import Thumbnail from './misc/Thumbnail.js'; +import { YTNode } from '../helpers.js'; class SingleHeroImage extends YTNode { static type = 'SingleHeroImage'; diff --git a/src/parser/classes/SlimOwner.ts b/src/parser/classes/SlimOwner.ts index ae7d2ed78..4db9be372 100644 --- a/src/parser/classes/SlimOwner.ts +++ b/src/parser/classes/SlimOwner.ts @@ -1,9 +1,9 @@ -import Parser from '..'; -import Text from './misc/Text'; -import Thumbnail from './misc/Thumbnail'; -import NavigationEndpoint from './NavigationEndpoint'; -import SubscribeButton from './SubscribeButton'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import Text from './misc/Text.js'; +import Thumbnail from './misc/Thumbnail.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import SubscribeButton from './SubscribeButton.js'; +import { YTNode } from '../helpers.js'; class SlimOwner extends YTNode { static type = 'SlimOwner'; diff --git a/src/parser/classes/SlimVideoMetadata.ts b/src/parser/classes/SlimVideoMetadata.ts index e256ae7b2..24df37767 100644 --- a/src/parser/classes/SlimVideoMetadata.ts +++ b/src/parser/classes/SlimVideoMetadata.ts @@ -1,6 +1,6 @@ -import Parser from '..'; -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class SlimVideoMetadata extends YTNode { static type = 'SlimVideoMetadata'; diff --git a/src/parser/classes/SortFilterSubMenu.ts b/src/parser/classes/SortFilterSubMenu.ts index ca9147fbe..b78c8c5a3 100644 --- a/src/parser/classes/SortFilterSubMenu.ts +++ b/src/parser/classes/SortFilterSubMenu.ts @@ -1,5 +1,5 @@ -import { YTNode } from '../helpers'; -import NavigationEndpoint from './NavigationEndpoint'; +import { YTNode } from '../helpers.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; class SortFilterSubMenu extends YTNode { static type = 'SortFilterSubMenu'; diff --git a/src/parser/classes/SubFeedOption.ts b/src/parser/classes/SubFeedOption.ts index 32746fcf3..0ae391643 100644 --- a/src/parser/classes/SubFeedOption.ts +++ b/src/parser/classes/SubFeedOption.ts @@ -1,6 +1,6 @@ -import Text from './misc/Text'; -import NavigationEndpoint from './NavigationEndpoint'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { YTNode } from '../helpers.js'; class SubFeedOption extends YTNode { static type = 'SubFeedOption'; diff --git a/src/parser/classes/SubFeedSelector.ts b/src/parser/classes/SubFeedSelector.ts index 6c3942751..89e99d42e 100644 --- a/src/parser/classes/SubFeedSelector.ts +++ b/src/parser/classes/SubFeedSelector.ts @@ -1,6 +1,6 @@ -import Parser from '../index'; -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class SubFeedSelector extends YTNode { static type = 'SubFeedSelector'; diff --git a/src/parser/classes/SubscribeButton.ts b/src/parser/classes/SubscribeButton.ts index a3f1cfc35..957cf8ff8 100644 --- a/src/parser/classes/SubscribeButton.ts +++ b/src/parser/classes/SubscribeButton.ts @@ -1,8 +1,8 @@ -import Parser from '../index'; -import Text from './misc/Text'; -import NavigationEndpoint from './NavigationEndpoint'; -import SubscriptionNotificationToggleButton from './SubscriptionNotificationToggleButton'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import Text from './misc/Text.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import SubscriptionNotificationToggleButton from './SubscriptionNotificationToggleButton.js'; +import { YTNode } from '../helpers.js'; class SubscribeButton extends YTNode { static type = 'SubscribeButton'; diff --git a/src/parser/classes/SubscriptionNotificationToggleButton.ts b/src/parser/classes/SubscriptionNotificationToggleButton.ts index 39e3c482b..b185a98cc 100644 --- a/src/parser/classes/SubscriptionNotificationToggleButton.ts +++ b/src/parser/classes/SubscriptionNotificationToggleButton.ts @@ -1,5 +1,5 @@ -import Parser from '../index'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; class SubscriptionNotificationToggleButton extends YTNode { static type = 'SubscriptionNotificationToggleButton'; diff --git a/src/parser/classes/Tab.ts b/src/parser/classes/Tab.ts index 08f638221..11f77b893 100644 --- a/src/parser/classes/Tab.ts +++ b/src/parser/classes/Tab.ts @@ -1,10 +1,10 @@ -import Parser from '../index'; -import NavigationEndpoint from './NavigationEndpoint'; -import SectionList from './SectionList'; -import MusicQueue from './MusicQueue'; -import RichGrid from './RichGrid'; +import Parser from '../index.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import SectionList from './SectionList.js'; +import MusicQueue from './MusicQueue.js'; +import RichGrid from './RichGrid.js'; -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class Tab extends YTNode { static type = 'Tab'; diff --git a/src/parser/classes/Tabbed.ts b/src/parser/classes/Tabbed.ts index d5281db8a..1e6bb9e37 100644 --- a/src/parser/classes/Tabbed.ts +++ b/src/parser/classes/Tabbed.ts @@ -1,5 +1,5 @@ -import Parser from '../index'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; class Tabbed extends YTNode { static type = 'Tabbed'; diff --git a/src/parser/classes/TabbedSearchResults.ts b/src/parser/classes/TabbedSearchResults.ts index 893882c79..4111179e1 100644 --- a/src/parser/classes/TabbedSearchResults.ts +++ b/src/parser/classes/TabbedSearchResults.ts @@ -1,6 +1,6 @@ -import Parser from '../index'; -import { YTNode } from '../helpers'; -import Tab from './Tab'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; +import Tab from './Tab.js'; class TabbedSearchResults extends YTNode { static type = 'TabbedSearchResults'; diff --git a/src/parser/classes/TextHeader.ts b/src/parser/classes/TextHeader.ts index cbe3da417..fbdef83a2 100644 --- a/src/parser/classes/TextHeader.ts +++ b/src/parser/classes/TextHeader.ts @@ -1,5 +1,5 @@ -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class TextHeader extends YTNode { static type = 'TextHeader'; diff --git a/src/parser/classes/ThumbnailLandscapePortrait.ts b/src/parser/classes/ThumbnailLandscapePortrait.ts index 513476281..a70f8e332 100644 --- a/src/parser/classes/ThumbnailLandscapePortrait.ts +++ b/src/parser/classes/ThumbnailLandscapePortrait.ts @@ -1,5 +1,5 @@ -import { YTNode } from '../helpers'; -import Thumbnail from './misc/Thumbnail'; +import { YTNode } from '../helpers.js'; +import Thumbnail from './misc/Thumbnail.js'; class ThumbnailLandscapePortrait extends YTNode { static type = 'ThumbnailLandscapePortrait'; diff --git a/src/parser/classes/ThumbnailOverlayBottomPanel.ts b/src/parser/classes/ThumbnailOverlayBottomPanel.ts index 649ae6ca2..6c0cd1155 100644 --- a/src/parser/classes/ThumbnailOverlayBottomPanel.ts +++ b/src/parser/classes/ThumbnailOverlayBottomPanel.ts @@ -1,4 +1,4 @@ -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class ThumbnailOverlayBottomPanel extends YTNode { static type = 'ThumbnailOverlayBottomPanel'; diff --git a/src/parser/classes/ThumbnailOverlayEndorsement.ts b/src/parser/classes/ThumbnailOverlayEndorsement.ts index fb3a39adc..e88025b7c 100644 --- a/src/parser/classes/ThumbnailOverlayEndorsement.ts +++ b/src/parser/classes/ThumbnailOverlayEndorsement.ts @@ -1,5 +1,5 @@ -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class ThumbnailOverlayEndorsement extends YTNode { static type = 'ThumbnailOverlayEndorsement'; diff --git a/src/parser/classes/ThumbnailOverlayHoverText.ts b/src/parser/classes/ThumbnailOverlayHoverText.ts index 0e2746d89..112b79e95 100644 --- a/src/parser/classes/ThumbnailOverlayHoverText.ts +++ b/src/parser/classes/ThumbnailOverlayHoverText.ts @@ -1,5 +1,5 @@ -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class ThumbnailOverlayHoverText extends YTNode { static type = 'ThumbnailOverlayHoverText'; diff --git a/src/parser/classes/ThumbnailOverlayInlineUnplayable.ts b/src/parser/classes/ThumbnailOverlayInlineUnplayable.ts index 389b50f58..d7133f48d 100644 --- a/src/parser/classes/ThumbnailOverlayInlineUnplayable.ts +++ b/src/parser/classes/ThumbnailOverlayInlineUnplayable.ts @@ -1,5 +1,5 @@ -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class ThumbnailOverlayInlineUnplayable extends YTNode { static type = 'ThumbnailOverlayInlineUnplayable'; diff --git a/src/parser/classes/ThumbnailOverlayLoadingPreview.ts b/src/parser/classes/ThumbnailOverlayLoadingPreview.ts index 49c1806c1..09f5519be 100644 --- a/src/parser/classes/ThumbnailOverlayLoadingPreview.ts +++ b/src/parser/classes/ThumbnailOverlayLoadingPreview.ts @@ -1,5 +1,5 @@ -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class ThumbnailOverlayLoadingPreview extends YTNode { static type = 'ThumbnailOverlayLoadingPreview'; diff --git a/src/parser/classes/ThumbnailOverlayNowPlaying.ts b/src/parser/classes/ThumbnailOverlayNowPlaying.ts index 434ae7b9d..ec6382d1c 100644 --- a/src/parser/classes/ThumbnailOverlayNowPlaying.ts +++ b/src/parser/classes/ThumbnailOverlayNowPlaying.ts @@ -1,5 +1,5 @@ -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class ThumbnailOverlayNowPlaying extends YTNode { static type = 'ThumbnailOverlayNowPlaying'; diff --git a/src/parser/classes/ThumbnailOverlayPinking.ts b/src/parser/classes/ThumbnailOverlayPinking.ts index d0675f979..345f21472 100644 --- a/src/parser/classes/ThumbnailOverlayPinking.ts +++ b/src/parser/classes/ThumbnailOverlayPinking.ts @@ -1,4 +1,4 @@ -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class ThumbnailOverlayPinking extends YTNode { static type = 'ThumbnailOverlayPinking'; diff --git a/src/parser/classes/ThumbnailOverlayPlaybackStatus.ts b/src/parser/classes/ThumbnailOverlayPlaybackStatus.ts index b80255bb3..3db53792a 100644 --- a/src/parser/classes/ThumbnailOverlayPlaybackStatus.ts +++ b/src/parser/classes/ThumbnailOverlayPlaybackStatus.ts @@ -1,5 +1,5 @@ -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class ThumbnailOverlayPlaybackStatus extends YTNode { static type = 'ThumbnailOverlayPlaybackStatus'; diff --git a/src/parser/classes/ThumbnailOverlayResumePlayback.ts b/src/parser/classes/ThumbnailOverlayResumePlayback.ts index ad0c98fcd..cc628d46e 100644 --- a/src/parser/classes/ThumbnailOverlayResumePlayback.ts +++ b/src/parser/classes/ThumbnailOverlayResumePlayback.ts @@ -1,4 +1,4 @@ -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; class ThumbnailOverlayResumePlayback extends YTNode { static type = 'ThumbnailOverlayResumePlayback'; diff --git a/src/parser/classes/ThumbnailOverlaySidePanel.ts b/src/parser/classes/ThumbnailOverlaySidePanel.ts index 9338aecfc..9bc8c48ee 100644 --- a/src/parser/classes/ThumbnailOverlaySidePanel.ts +++ b/src/parser/classes/ThumbnailOverlaySidePanel.ts @@ -1,5 +1,5 @@ -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class ThumbnailOverlaySidePanel extends YTNode { static type = 'ThumbnailOverlaySidePanel'; diff --git a/src/parser/classes/ThumbnailOverlayTimeStatus.ts b/src/parser/classes/ThumbnailOverlayTimeStatus.ts index 887e076f7..e3835f1f1 100644 --- a/src/parser/classes/ThumbnailOverlayTimeStatus.ts +++ b/src/parser/classes/ThumbnailOverlayTimeStatus.ts @@ -1,5 +1,5 @@ -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class ThumbnailOverlayTimeStatus extends YTNode { static type = 'ThumbnailOverlayTimeStatus'; diff --git a/src/parser/classes/ThumbnailOverlayToggleButton.ts b/src/parser/classes/ThumbnailOverlayToggleButton.ts index 80a59aba2..e1057c45d 100644 --- a/src/parser/classes/ThumbnailOverlayToggleButton.ts +++ b/src/parser/classes/ThumbnailOverlayToggleButton.ts @@ -1,5 +1,5 @@ -import NavigationEndpoint from './NavigationEndpoint'; -import { YTNode } from '../helpers'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { YTNode } from '../helpers.js'; class ThumbnailOverlayToggleButton extends YTNode { static type = 'ThumbnailOverlayToggleButton'; diff --git a/src/parser/classes/TimedMarkerDecoration.ts b/src/parser/classes/TimedMarkerDecoration.ts index c688e5a6c..a1b121e55 100644 --- a/src/parser/classes/TimedMarkerDecoration.ts +++ b/src/parser/classes/TimedMarkerDecoration.ts @@ -1,5 +1,5 @@ -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class TimedMarkerDecoration extends YTNode { static type = 'TimedMarkerDecoration'; diff --git a/src/parser/classes/TitleAndButtonListHeader.ts b/src/parser/classes/TitleAndButtonListHeader.ts index b4a17d07c..66221bd92 100644 --- a/src/parser/classes/TitleAndButtonListHeader.ts +++ b/src/parser/classes/TitleAndButtonListHeader.ts @@ -1,5 +1,5 @@ -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class TitleAndButtonListHeader extends YTNode { static type = 'TitleAndButtonListHeader'; diff --git a/src/parser/classes/ToggleButton.ts b/src/parser/classes/ToggleButton.ts index 51c21a60c..5b6acfa66 100644 --- a/src/parser/classes/ToggleButton.ts +++ b/src/parser/classes/ToggleButton.ts @@ -1,6 +1,6 @@ -import Text from './misc/Text'; -import NavigationEndpoint from './NavigationEndpoint'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { YTNode } from '../helpers.js'; class ToggleButton extends YTNode { static type = 'ToggleButton'; diff --git a/src/parser/classes/ToggleMenuServiceItem.ts b/src/parser/classes/ToggleMenuServiceItem.ts index 53a8994a5..be64c3ae6 100644 --- a/src/parser/classes/ToggleMenuServiceItem.ts +++ b/src/parser/classes/ToggleMenuServiceItem.ts @@ -1,6 +1,6 @@ -import Text from './misc/Text'; -import NavigationEndpoint from './NavigationEndpoint'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { YTNode } from '../helpers.js'; class ToggleMenuServiceItem extends YTNode { static type = 'ToggleMenuServiceItem'; diff --git a/src/parser/classes/Tooltip.ts b/src/parser/classes/Tooltip.ts index 9c9ebca11..6646e09a8 100644 --- a/src/parser/classes/Tooltip.ts +++ b/src/parser/classes/Tooltip.ts @@ -1,6 +1,6 @@ -import Text from './misc/Text'; -import NavigationEndpoint from './NavigationEndpoint'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { YTNode } from '../helpers.js'; class Tooltip extends YTNode { static type = 'Tooltip'; diff --git a/src/parser/classes/TopicChannelDetails.ts b/src/parser/classes/TopicChannelDetails.ts index 07a78b077..dfb786d10 100644 --- a/src/parser/classes/TopicChannelDetails.ts +++ b/src/parser/classes/TopicChannelDetails.ts @@ -1,10 +1,10 @@ -import Parser from '..'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; -import Text from './misc/Text'; -import Thumbnail from './misc/Thumbnail'; -import NavigationEndpoint from './NavigationEndpoint'; -import SubscribeButton from './SubscribeButton'; +import Text from './misc/Text.js'; +import Thumbnail from './misc/Thumbnail.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import SubscribeButton from './SubscribeButton.js'; class TopicChannelDetails extends YTNode { static type = 'TopicChannelDetails'; diff --git a/src/parser/classes/TwoColumnBrowseResults.ts b/src/parser/classes/TwoColumnBrowseResults.ts index 88ca90847..9621d1ded 100644 --- a/src/parser/classes/TwoColumnBrowseResults.ts +++ b/src/parser/classes/TwoColumnBrowseResults.ts @@ -1,5 +1,5 @@ -import Parser from '../index'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; class TwoColumnBrowseResults extends YTNode { static type = 'TwoColumnBrowseResults'; diff --git a/src/parser/classes/TwoColumnSearchResults.ts b/src/parser/classes/TwoColumnSearchResults.ts index 6d0ab4b53..1d89d025f 100644 --- a/src/parser/classes/TwoColumnSearchResults.ts +++ b/src/parser/classes/TwoColumnSearchResults.ts @@ -1,5 +1,5 @@ -import Parser from '../index'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; class TwoColumnSearchResults extends YTNode { static type = 'TwoColumnSearchResults'; diff --git a/src/parser/classes/TwoColumnWatchNextResults.ts b/src/parser/classes/TwoColumnWatchNextResults.ts index cab2450c4..875d83e05 100644 --- a/src/parser/classes/TwoColumnWatchNextResults.ts +++ b/src/parser/classes/TwoColumnWatchNextResults.ts @@ -1,5 +1,5 @@ -import Parser from '../index'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; class TwoColumnWatchNextResults extends YTNode { static type = 'TwoColumnWatchNextResults'; diff --git a/src/parser/classes/UniversalWatchCard.ts b/src/parser/classes/UniversalWatchCard.ts index fb136c612..ef0f430b4 100644 --- a/src/parser/classes/UniversalWatchCard.ts +++ b/src/parser/classes/UniversalWatchCard.ts @@ -1,6 +1,6 @@ -import Parser from '../index'; -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class UniversalWatchCard extends YTNode { static type = 'UniversalWatchCard'; diff --git a/src/parser/classes/UpsellDialog.ts b/src/parser/classes/UpsellDialog.ts index 77c3c58c3..8c0273554 100644 --- a/src/parser/classes/UpsellDialog.ts +++ b/src/parser/classes/UpsellDialog.ts @@ -1,7 +1,7 @@ -import Parser from '..'; -import { YTNode } from '../helpers'; -import type Button from './Button'; -import Text from './misc/Text'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; +import type Button from './Button.js'; +import Text from './misc/Text.js'; class UpsellDialog extends YTNode { static type = 'UpsellDialog'; diff --git a/src/parser/classes/VerticalList.ts b/src/parser/classes/VerticalList.ts index ed87c26d4..cdf2c4dc2 100644 --- a/src/parser/classes/VerticalList.ts +++ b/src/parser/classes/VerticalList.ts @@ -1,6 +1,6 @@ -import Parser from '../index'; -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class VerticalList extends YTNode { static type = 'VerticalList'; diff --git a/src/parser/classes/VerticalWatchCardList.ts b/src/parser/classes/VerticalWatchCardList.ts index 5b53cad81..cd0908a07 100644 --- a/src/parser/classes/VerticalWatchCardList.ts +++ b/src/parser/classes/VerticalWatchCardList.ts @@ -1,7 +1,7 @@ -import Parser from '../index'; -import Text from './misc/Text'; -import NavigationEndpoint from './NavigationEndpoint'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import Text from './misc/Text.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { YTNode } from '../helpers.js'; class VerticalWatchCardList extends YTNode { static type = 'VerticalWatchCardList'; diff --git a/src/parser/classes/Video.ts b/src/parser/classes/Video.ts index abaa2aed6..3714b9f2d 100644 --- a/src/parser/classes/Video.ts +++ b/src/parser/classes/Video.ts @@ -1,14 +1,14 @@ -import Parser from '..'; -import Text from './misc/Text'; -import Author from './misc/Author'; -import Menu from './menus/Menu'; -import Thumbnail from './misc/Thumbnail'; -import NavigationEndpoint from './NavigationEndpoint'; -import MetadataBadge from './MetadataBadge'; -import ExpandableMetadata from './ExpandableMetadata'; - -import { timeToSeconds } from '../../utils/Utils'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import Text from './misc/Text.js'; +import Author from './misc/Author.js'; +import Menu from './menus/Menu.js'; +import Thumbnail from './misc/Thumbnail.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import MetadataBadge from './MetadataBadge.js'; +import ExpandableMetadata from './ExpandableMetadata.js'; + +import { timeToSeconds } from '../../utils/Utils.js'; +import { YTNode } from '../helpers.js'; class Video extends YTNode { static type = 'Video'; diff --git a/src/parser/classes/VideoCard.ts b/src/parser/classes/VideoCard.ts index 8e7bda485..bff7047fd 100644 --- a/src/parser/classes/VideoCard.ts +++ b/src/parser/classes/VideoCard.ts @@ -1,4 +1,4 @@ -import Video from './Video'; +import Video from './Video.js'; class VideoCard extends Video { static type = 'VideoCard'; diff --git a/src/parser/classes/VideoInfoCardContent.ts b/src/parser/classes/VideoInfoCardContent.ts index e0b442281..54b617610 100644 --- a/src/parser/classes/VideoInfoCardContent.ts +++ b/src/parser/classes/VideoInfoCardContent.ts @@ -1,7 +1,7 @@ -import Text from './misc/Text'; -import Thumbnail from './misc/Thumbnail'; -import NavigationEndpoint from './NavigationEndpoint'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import Thumbnail from './misc/Thumbnail.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { YTNode } from '../helpers.js'; class VideoInfoCardContent extends YTNode { static type = 'VideoInfoCardContent'; diff --git a/src/parser/classes/VideoOwner.ts b/src/parser/classes/VideoOwner.ts index 509dc6f41..00242ba4e 100644 --- a/src/parser/classes/VideoOwner.ts +++ b/src/parser/classes/VideoOwner.ts @@ -1,6 +1,6 @@ -import Text from './misc/Text'; -import Author from './misc/Author'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import Author from './misc/Author.js'; +import { YTNode } from '../helpers.js'; class VideoOwner extends YTNode { static type = 'VideoOwner'; diff --git a/src/parser/classes/VideoPrimaryInfo.ts b/src/parser/classes/VideoPrimaryInfo.ts index 9498f1322..d3d0557e3 100644 --- a/src/parser/classes/VideoPrimaryInfo.ts +++ b/src/parser/classes/VideoPrimaryInfo.ts @@ -1,7 +1,7 @@ -import Parser from '../index'; -import Text from './misc/Text'; -import { YTNode } from '../helpers'; -import Menu from './menus/Menu'; +import Parser from '../index.js'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; +import Menu from './menus/Menu.js'; class VideoPrimaryInfo extends YTNode { static type = 'VideoPrimaryInfo'; diff --git a/src/parser/classes/VideoSecondaryInfo.ts b/src/parser/classes/VideoSecondaryInfo.ts index e2889718f..77e5fb271 100644 --- a/src/parser/classes/VideoSecondaryInfo.ts +++ b/src/parser/classes/VideoSecondaryInfo.ts @@ -1,10 +1,10 @@ -import Parser from '../index'; -import Text from './misc/Text'; -import Button from './Button'; -import VideoOwner from './VideoOwner'; -import SubscribeButton from './SubscribeButton'; -import MetadataRowContainer from './MetadataRowContainer'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import Text from './misc/Text.js'; +import Button from './Button.js'; +import VideoOwner from './VideoOwner.js'; +import SubscribeButton from './SubscribeButton.js'; +import MetadataRowContainer from './MetadataRowContainer.js'; +import { YTNode } from '../helpers.js'; class VideoSecondaryInfo extends YTNode { static type = 'VideoSecondaryInfo'; diff --git a/src/parser/classes/WatchCardCompactVideo.ts b/src/parser/classes/WatchCardCompactVideo.ts index 275c1bab8..54539f195 100644 --- a/src/parser/classes/WatchCardCompactVideo.ts +++ b/src/parser/classes/WatchCardCompactVideo.ts @@ -1,6 +1,6 @@ -import Text from './misc/Text'; -import { timeToSeconds } from '../../utils/Utils'; -import { YTNode } from '../helpers'; +import Text from './misc/Text.js'; +import { timeToSeconds } from '../../utils/Utils.js'; +import { YTNode } from '../helpers.js'; class WatchCardCompactVideo extends YTNode { static type = 'WatchCardCompactVideo'; diff --git a/src/parser/classes/WatchCardHeroVideo.ts b/src/parser/classes/WatchCardHeroVideo.ts index 22c49e057..2b235e0e8 100644 --- a/src/parser/classes/WatchCardHeroVideo.ts +++ b/src/parser/classes/WatchCardHeroVideo.ts @@ -1,6 +1,6 @@ -import Parser from '../index'; -import NavigationEndpoint from './NavigationEndpoint'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import { YTNode } from '../helpers.js'; class WatchCardHeroVideo extends YTNode { static type = 'WatchCardHeroVideo'; diff --git a/src/parser/classes/WatchCardRichHeader.ts b/src/parser/classes/WatchCardRichHeader.ts index 5c5b54556..35626e3a4 100644 --- a/src/parser/classes/WatchCardRichHeader.ts +++ b/src/parser/classes/WatchCardRichHeader.ts @@ -1,7 +1,7 @@ -import Author from './misc/Author'; -import NavigationEndpoint from './NavigationEndpoint'; -import Text from './misc/Text'; -import { YTNode } from '../helpers'; +import Author from './misc/Author.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import Text from './misc/Text.js'; +import { YTNode } from '../helpers.js'; class WatchCardRichHeader extends YTNode { static type = 'WatchCardRichHeader'; diff --git a/src/parser/classes/WatchCardSectionSequence.ts b/src/parser/classes/WatchCardSectionSequence.ts index 06c4c7a48..f19e89a31 100644 --- a/src/parser/classes/WatchCardSectionSequence.ts +++ b/src/parser/classes/WatchCardSectionSequence.ts @@ -1,5 +1,5 @@ -import Parser from '../index'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import { YTNode } from '../helpers.js'; class WatchCardSectionSequence extends YTNode { static type = 'WatchCardSectionSequence'; diff --git a/src/parser/classes/WatchNextEndScreen.ts b/src/parser/classes/WatchNextEndScreen.ts index aae961367..ff72e276a 100644 --- a/src/parser/classes/WatchNextEndScreen.ts +++ b/src/parser/classes/WatchNextEndScreen.ts @@ -1,8 +1,8 @@ -import Parser from '../index'; -import Text from './misc/Text'; -import EndScreenVideo from './EndScreenVideo'; -import EndScreenPlaylist from './EndScreenPlaylist'; -import { YTNode } from '../helpers'; +import Parser from '../index.js'; +import Text from './misc/Text.js'; +import EndScreenVideo from './EndScreenVideo.js'; +import EndScreenPlaylist from './EndScreenPlaylist.js'; +import { YTNode } from '../helpers.js'; class WatchNextEndScreen extends YTNode { static type = 'WatchNextEndScreen'; diff --git a/src/parser/classes/WatchNextTabbedResults.ts b/src/parser/classes/WatchNextTabbedResults.ts index 21c74a02a..683960a77 100644 --- a/src/parser/classes/WatchNextTabbedResults.ts +++ b/src/parser/classes/WatchNextTabbedResults.ts @@ -1,4 +1,4 @@ -import TwoColumnBrowseResults from './TwoColumnBrowseResults'; +import TwoColumnBrowseResults from './TwoColumnBrowseResults.js'; class WatchNextTabbedResults extends TwoColumnBrowseResults { static type = 'WatchNextTabbedResults'; diff --git a/src/parser/classes/actions/AppendContinuationItemsAction.ts b/src/parser/classes/actions/AppendContinuationItemsAction.ts index 360ffe41f..a9fa65411 100644 --- a/src/parser/classes/actions/AppendContinuationItemsAction.ts +++ b/src/parser/classes/actions/AppendContinuationItemsAction.ts @@ -1,5 +1,5 @@ -import Parser from '../../index'; -import { YTNode } from '../../helpers'; +import Parser from '../../index.js'; +import { YTNode } from '../../helpers.js'; class AppendContinuationItemsAction extends YTNode { static type = 'AppendContinuationItemsAction'; diff --git a/src/parser/classes/actions/OpenPopupAction.ts b/src/parser/classes/actions/OpenPopupAction.ts index e4a07077e..9286139e7 100644 --- a/src/parser/classes/actions/OpenPopupAction.ts +++ b/src/parser/classes/actions/OpenPopupAction.ts @@ -1,5 +1,5 @@ -import Parser from '../../index'; -import { YTNode } from '../../helpers'; +import Parser from '../../index.js'; +import { YTNode } from '../../helpers.js'; class OpenPopupAction extends YTNode { static type = 'OpenPopupAction'; diff --git a/src/parser/classes/analytics/AnalyticsMainAppKeyMetrics.ts b/src/parser/classes/analytics/AnalyticsMainAppKeyMetrics.ts index 230a20b26..31715ed51 100644 --- a/src/parser/classes/analytics/AnalyticsMainAppKeyMetrics.ts +++ b/src/parser/classes/analytics/AnalyticsMainAppKeyMetrics.ts @@ -1,5 +1,5 @@ -import DataModelSection from './DataModelSection'; -import { YTNode } from '../../helpers'; +import DataModelSection from './DataModelSection.js'; +import { YTNode } from '../../helpers.js'; class AnalyticsMainAppKeyMetrics extends YTNode { static type = 'AnalyticsMainAppKeyMetrics'; diff --git a/src/parser/classes/analytics/AnalyticsRoot.ts b/src/parser/classes/analytics/AnalyticsRoot.ts index 3a16d568e..a4bb3c9f3 100644 --- a/src/parser/classes/analytics/AnalyticsRoot.ts +++ b/src/parser/classes/analytics/AnalyticsRoot.ts @@ -1,4 +1,4 @@ -import { YTNode } from '../../helpers'; +import { YTNode } from '../../helpers.js'; class AnalyticsRoot extends YTNode { static type = 'AnalyticsRoot'; diff --git a/src/parser/classes/analytics/AnalyticsShortsCarouselCard.ts b/src/parser/classes/analytics/AnalyticsShortsCarouselCard.ts index 99002a2f5..8ea3048dc 100644 --- a/src/parser/classes/analytics/AnalyticsShortsCarouselCard.ts +++ b/src/parser/classes/analytics/AnalyticsShortsCarouselCard.ts @@ -1,5 +1,5 @@ -import { YTNode } from '../../helpers'; -import NavigationEndpoint from '../NavigationEndpoint'; +import { YTNode } from '../../helpers.js'; +import NavigationEndpoint from '../NavigationEndpoint.js'; class AnalyticsShortsCarouselCard extends YTNode { static type = 'AnalyticsShortsCarouselCard'; diff --git a/src/parser/classes/analytics/AnalyticsVideo.ts b/src/parser/classes/analytics/AnalyticsVideo.ts index 71c492a55..b17da865f 100644 --- a/src/parser/classes/analytics/AnalyticsVideo.ts +++ b/src/parser/classes/analytics/AnalyticsVideo.ts @@ -1,5 +1,5 @@ -import Thumbnail from '../misc/Thumbnail'; -import { YTNode } from '../../helpers'; +import Thumbnail from '../misc/Thumbnail.js'; +import { YTNode } from '../../helpers.js'; class AnalyticsVideo extends YTNode { static type = 'AnalyticsVideo'; diff --git a/src/parser/classes/analytics/AnalyticsVodCarouselCard.ts b/src/parser/classes/analytics/AnalyticsVodCarouselCard.ts index 05192c2d5..27a98a199 100644 --- a/src/parser/classes/analytics/AnalyticsVodCarouselCard.ts +++ b/src/parser/classes/analytics/AnalyticsVodCarouselCard.ts @@ -1,5 +1,5 @@ -import Video from './AnalyticsVideo'; -import { YTNode } from '../../helpers'; +import Video from './AnalyticsVideo.js'; +import { YTNode } from '../../helpers.js'; class AnalyticsVodCarouselCard extends YTNode { static type = 'AnalyticsVodCarouselCard'; diff --git a/src/parser/classes/analytics/CtaGoToCreatorStudio.ts b/src/parser/classes/analytics/CtaGoToCreatorStudio.ts index c43177cf4..3d2595572 100644 --- a/src/parser/classes/analytics/CtaGoToCreatorStudio.ts +++ b/src/parser/classes/analytics/CtaGoToCreatorStudio.ts @@ -1,4 +1,4 @@ -import { YTNode } from '../../helpers'; +import { YTNode } from '../../helpers.js'; class CtaGoToCreatorStudio extends YTNode { static type = 'CtaGoToCreatorStudio'; diff --git a/src/parser/classes/analytics/DataModelSection.ts b/src/parser/classes/analytics/DataModelSection.ts index 13ee55dba..d0967343f 100644 --- a/src/parser/classes/analytics/DataModelSection.ts +++ b/src/parser/classes/analytics/DataModelSection.ts @@ -1,4 +1,4 @@ -import { YTNode } from '../../helpers'; +import { YTNode } from '../../helpers.js'; class DataModelSection extends YTNode { static type = 'DataModelSection'; diff --git a/src/parser/classes/analytics/StatRow.ts b/src/parser/classes/analytics/StatRow.ts index b60c48c01..d0bf0f224 100644 --- a/src/parser/classes/analytics/StatRow.ts +++ b/src/parser/classes/analytics/StatRow.ts @@ -1,6 +1,6 @@ -import Text from '../misc/Text'; +import Text from '../misc/Text.js'; -import { YTNode } from '../../helpers'; +import { YTNode } from '../../helpers.js'; class StatRow extends YTNode { static type = 'StatRow'; diff --git a/src/parser/classes/comments/AuthorCommentBadge.ts b/src/parser/classes/comments/AuthorCommentBadge.ts index 770f136ba..f15098b41 100644 --- a/src/parser/classes/comments/AuthorCommentBadge.ts +++ b/src/parser/classes/comments/AuthorCommentBadge.ts @@ -1,4 +1,4 @@ -import { YTNode } from '../../helpers'; +import { YTNode } from '../../helpers.js'; class AuthorCommentBadge extends YTNode { static type = 'AuthorCommentBadge'; diff --git a/src/parser/classes/comments/Comment.ts b/src/parser/classes/comments/Comment.ts index f1859019d..3a787593a 100644 --- a/src/parser/classes/comments/Comment.ts +++ b/src/parser/classes/comments/Comment.ts @@ -1,21 +1,21 @@ -import Parser from '../../index'; - -import Text from '../misc/Text'; -import Thumbnail from '../misc/Thumbnail'; -import CommentReplyDialog from './CommentReplyDialog'; -import AuthorCommentBadge from './AuthorCommentBadge'; -import Author from '../misc/Author'; - -import type Menu from '../menus/Menu'; -import type CommentActionButtons from './CommentActionButtons'; -import type SponsorCommentBadge from './SponsorCommentBadge'; -import type PdgCommentChip from './PdgCommentChip'; -import type { ApiResponse } from '../../../core/Actions'; -import type Actions from '../../../core/Actions'; - -import Proto from '../../../proto/index'; -import { InnertubeError } from '../../../utils/Utils'; -import { YTNode, SuperParsedResult } from '../../helpers'; +import Parser from '../../index.js'; + +import Text from '../misc/Text.js'; +import Thumbnail from '../misc/Thumbnail.js'; +import CommentReplyDialog from './CommentReplyDialog.js'; +import AuthorCommentBadge from './AuthorCommentBadge.js'; +import Author from '../misc/Author.js'; + +import type Menu from '../menus/Menu.js'; +import type CommentActionButtons from './CommentActionButtons.js'; +import type SponsorCommentBadge from './SponsorCommentBadge.js'; +import type PdgCommentChip from './PdgCommentChip.js'; +import type { ApiResponse } from '../../../core/Actions.js'; +import type Actions from '../../../core/Actions.js'; + +import Proto from '../../../proto/index.js'; +import { InnertubeError } from '../../../utils/Utils.js'; +import { YTNode, SuperParsedResult } from '../../helpers.js'; class Comment extends YTNode { static type = 'Comment'; diff --git a/src/parser/classes/comments/CommentActionButtons.ts b/src/parser/classes/comments/CommentActionButtons.ts index f5d4a0b25..94732f86d 100644 --- a/src/parser/classes/comments/CommentActionButtons.ts +++ b/src/parser/classes/comments/CommentActionButtons.ts @@ -1,8 +1,8 @@ -import Parser from '../../index'; -import type Button from '../Button'; -import type ToggleButton from '../ToggleButton'; -import type CreatorHeart from './CreatorHeart'; -import { YTNode } from '../../helpers'; +import Parser from '../../index.js'; +import type Button from '../Button.js'; +import type ToggleButton from '../ToggleButton.js'; +import type CreatorHeart from './CreatorHeart.js'; +import { YTNode } from '../../helpers.js'; class CommentActionButtons extends YTNode { static type = 'CommentActionButtons'; diff --git a/src/parser/classes/comments/CommentDialog.ts b/src/parser/classes/comments/CommentDialog.ts index 646be0594..6144c6b26 100644 --- a/src/parser/classes/comments/CommentDialog.ts +++ b/src/parser/classes/comments/CommentDialog.ts @@ -1,9 +1,9 @@ -import Parser from '../..'; -import Text from '../misc/Text'; -import Thumbnail from '../misc/Thumbnail'; -import type Button from '../Button'; -import type EmojiPicker from './EmojiPicker'; -import { YTNode } from '../../helpers'; +import Parser from '../../index.js'; +import Text from '../misc/Text.js'; +import Thumbnail from '../misc/Thumbnail.js'; +import type Button from '../Button.js'; +import type EmojiPicker from './EmojiPicker.js'; +import { YTNode } from '../../helpers.js'; class CommentDialog extends YTNode { static type = 'CommentDialog'; diff --git a/src/parser/classes/comments/CommentReplies.ts b/src/parser/classes/comments/CommentReplies.ts index 1432aa321..24bccd40b 100644 --- a/src/parser/classes/comments/CommentReplies.ts +++ b/src/parser/classes/comments/CommentReplies.ts @@ -1,7 +1,7 @@ -import Parser from '../../index'; -import Thumbnail from '../misc/Thumbnail'; -import type Button from '../Button'; -import { YTNode } from '../../helpers'; +import Parser from '../../index.js'; +import Thumbnail from '../misc/Thumbnail.js'; +import type Button from '../Button.js'; +import { YTNode } from '../../helpers.js'; class CommentReplies extends YTNode { static type = 'CommentReplies'; diff --git a/src/parser/classes/comments/CommentReplyDialog.ts b/src/parser/classes/comments/CommentReplyDialog.ts index 611d5b4dc..4b6db6320 100644 --- a/src/parser/classes/comments/CommentReplyDialog.ts +++ b/src/parser/classes/comments/CommentReplyDialog.ts @@ -1,8 +1,8 @@ -import Parser from '../../index'; -import Thumbnail from '../misc/Thumbnail'; -import Text from '../misc/Text'; -import type Button from '../Button'; -import { YTNode } from '../../helpers'; +import Parser from '../../index.js'; +import Thumbnail from '../misc/Thumbnail.js'; +import Text from '../misc/Text.js'; +import type Button from '../Button.js'; +import { YTNode } from '../../helpers.js'; class CommentReplyDialog extends YTNode { static type = 'CommentReplyDialog'; diff --git a/src/parser/classes/comments/CommentSimplebox.ts b/src/parser/classes/comments/CommentSimplebox.ts index 667938c6a..af6aacd75 100644 --- a/src/parser/classes/comments/CommentSimplebox.ts +++ b/src/parser/classes/comments/CommentSimplebox.ts @@ -1,8 +1,8 @@ -import Parser from '../../index'; -import Thumbnail from '../misc/Thumbnail'; -import Text from '../misc/Text'; -import type Button from '../Button'; -import { YTNode } from '../../helpers'; +import Parser from '../../index.js'; +import Thumbnail from '../misc/Thumbnail.js'; +import Text from '../misc/Text.js'; +import type Button from '../Button.js'; +import { YTNode } from '../../helpers.js'; class CommentSimplebox extends YTNode { static type = 'CommentSimplebox'; diff --git a/src/parser/classes/comments/CommentThread.ts b/src/parser/classes/comments/CommentThread.ts index 5cf2febdb..2acfd551a 100644 --- a/src/parser/classes/comments/CommentThread.ts +++ b/src/parser/classes/comments/CommentThread.ts @@ -1,12 +1,12 @@ -import Parser from '../../index'; -import Comment from './Comment'; -import ContinuationItem from '../ContinuationItem'; -import CommentReplies from './CommentReplies'; -import Button from '../Button'; -import type Actions from '../../../core/Actions'; -import type { ObservedArray } from '../../helpers'; -import { InnertubeError } from '../../../utils/Utils'; -import { observe, YTNode } from '../../helpers'; +import Parser from '../../index.js'; +import Comment from './Comment.js'; +import ContinuationItem from '../ContinuationItem.js'; +import CommentReplies from './CommentReplies.js'; +import Button from '../Button.js'; +import type Actions from '../../../core/Actions.js'; +import type { ObservedArray } from '../../helpers.js'; +import { InnertubeError } from '../../../utils/Utils.js'; +import { observe, YTNode } from '../../helpers.js'; class CommentThread extends YTNode { static type = 'CommentThread'; diff --git a/src/parser/classes/comments/CommentsEntryPointHeader.ts b/src/parser/classes/comments/CommentsEntryPointHeader.ts index ee34f1ca4..2b58586a4 100644 --- a/src/parser/classes/comments/CommentsEntryPointHeader.ts +++ b/src/parser/classes/comments/CommentsEntryPointHeader.ts @@ -1,6 +1,6 @@ -import Text from '../misc/Text'; -import Thumbnail from '../misc/Thumbnail'; -import { YTNode } from '../../helpers'; +import Text from '../misc/Text.js'; +import Thumbnail from '../misc/Thumbnail.js'; +import { YTNode } from '../../helpers.js'; class CommentsEntryPointHeader extends YTNode { static type = 'CommentsEntryPointHeader'; diff --git a/src/parser/classes/comments/CommentsHeader.ts b/src/parser/classes/comments/CommentsHeader.ts index faee459d6..19173c01a 100644 --- a/src/parser/classes/comments/CommentsHeader.ts +++ b/src/parser/classes/comments/CommentsHeader.ts @@ -1,8 +1,8 @@ -import Parser from '../../index'; -import Text from '../misc/Text'; -import Thumbnail from '../misc/Thumbnail'; -import type SortFilterSubMenu from '../SortFilterSubMenu'; -import { YTNode } from '../../helpers'; +import Parser from '../../index.js'; +import Text from '../misc/Text.js'; +import Thumbnail from '../misc/Thumbnail.js'; +import type SortFilterSubMenu from '../SortFilterSubMenu.js'; +import { YTNode } from '../../helpers.js'; class CommentsHeader extends YTNode { static type = 'CommentsHeader'; diff --git a/src/parser/classes/comments/CreatorHeart.ts b/src/parser/classes/comments/CreatorHeart.ts index 4c63f96e6..5987b06a4 100644 --- a/src/parser/classes/comments/CreatorHeart.ts +++ b/src/parser/classes/comments/CreatorHeart.ts @@ -1,5 +1,5 @@ -import { YTNode } from '../../helpers'; -import Thumbnail from '../misc/Thumbnail'; +import { YTNode } from '../../helpers.js'; +import Thumbnail from '../misc/Thumbnail.js'; class CreatorHeart extends YTNode { static type = 'CreatorHeart'; diff --git a/src/parser/classes/comments/EmojiPicker.ts b/src/parser/classes/comments/EmojiPicker.ts index 3ab9e270f..e94b655a0 100644 --- a/src/parser/classes/comments/EmojiPicker.ts +++ b/src/parser/classes/comments/EmojiPicker.ts @@ -1,6 +1,6 @@ -import Text from '../misc/Text'; -import { YTNode } from '../../helpers'; -import Parser from '../..'; +import Text from '../misc/Text.js'; +import { YTNode } from '../../helpers.js'; +import Parser from '../../index.js'; class EmojiPicker extends YTNode { static type = 'EmojiPicker'; diff --git a/src/parser/classes/comments/PdgCommentChip.ts b/src/parser/classes/comments/PdgCommentChip.ts index ec4c8a388..5ad8955f2 100644 --- a/src/parser/classes/comments/PdgCommentChip.ts +++ b/src/parser/classes/comments/PdgCommentChip.ts @@ -1,5 +1,5 @@ -import Text from '../misc/Text'; -import { YTNode } from '../../helpers'; +import Text from '../misc/Text.js'; +import { YTNode } from '../../helpers.js'; class PdgCommentChip extends YTNode { static type = 'PdgCommentChip'; diff --git a/src/parser/classes/comments/SponsorCommentBadge.ts b/src/parser/classes/comments/SponsorCommentBadge.ts index b3defd8ea..fd5c2436b 100644 --- a/src/parser/classes/comments/SponsorCommentBadge.ts +++ b/src/parser/classes/comments/SponsorCommentBadge.ts @@ -1,5 +1,5 @@ -import Thumbnail from '../misc/Thumbnail'; -import { YTNode } from '../../helpers'; +import Thumbnail from '../misc/Thumbnail.js'; +import { YTNode } from '../../helpers.js'; class SponsorCommentBadge extends YTNode { static type = 'SponsorCommentBadge'; diff --git a/src/parser/classes/livechat/AddBannerToLiveChatCommand.ts b/src/parser/classes/livechat/AddBannerToLiveChatCommand.ts index 02e1a392a..86cc0ea76 100644 --- a/src/parser/classes/livechat/AddBannerToLiveChatCommand.ts +++ b/src/parser/classes/livechat/AddBannerToLiveChatCommand.ts @@ -1,6 +1,6 @@ -import Parser from '../../index'; -import { YTNode } from '../../helpers'; -import type LiveChatBanner from './items/LiveChatBanner'; +import Parser from '../../index.js'; +import { YTNode } from '../../helpers.js'; +import type LiveChatBanner from './items/LiveChatBanner.js'; class AddBannerToLiveChatCommand extends YTNode { static type = 'AddBannerToLiveChatCommand'; diff --git a/src/parser/classes/livechat/AddChatItemAction.ts b/src/parser/classes/livechat/AddChatItemAction.ts index 957d8d3f7..3ee244bae 100644 --- a/src/parser/classes/livechat/AddChatItemAction.ts +++ b/src/parser/classes/livechat/AddChatItemAction.ts @@ -1,5 +1,5 @@ -import Parser from '../../index'; -import { YTNode } from '../../helpers'; +import Parser from '../../index.js'; +import { YTNode } from '../../helpers.js'; class AddChatItemAction extends YTNode { static type = 'AddChatItemAction'; diff --git a/src/parser/classes/livechat/AddLiveChatTickerItemAction.ts b/src/parser/classes/livechat/AddLiveChatTickerItemAction.ts index e5ee74ea8..2104dedc6 100644 --- a/src/parser/classes/livechat/AddLiveChatTickerItemAction.ts +++ b/src/parser/classes/livechat/AddLiveChatTickerItemAction.ts @@ -1,5 +1,5 @@ -import Parser from '../../index'; -import { YTNode } from '../../helpers'; +import Parser from '../../index.js'; +import { YTNode } from '../../helpers.js'; class AddLiveChatTickerItemAction extends YTNode { static type = 'AddLiveChatTickerItemAction'; diff --git a/src/parser/classes/livechat/DimChatItemAction.ts b/src/parser/classes/livechat/DimChatItemAction.ts index ab77e9e3d..c97afdfae 100644 --- a/src/parser/classes/livechat/DimChatItemAction.ts +++ b/src/parser/classes/livechat/DimChatItemAction.ts @@ -1,4 +1,4 @@ -import { YTNode } from '../../helpers'; +import { YTNode } from '../../helpers.js'; class DimChatItemAction extends YTNode { static type = 'DimChatItemAction'; diff --git a/src/parser/classes/livechat/LiveChatActionPanel.ts b/src/parser/classes/livechat/LiveChatActionPanel.ts index 3cd280824..6ae2a0adc 100644 --- a/src/parser/classes/livechat/LiveChatActionPanel.ts +++ b/src/parser/classes/livechat/LiveChatActionPanel.ts @@ -1,5 +1,5 @@ -import Parser from '../../index'; -import { YTNode } from '../../helpers'; +import Parser from '../../index.js'; +import { YTNode } from '../../helpers.js'; class LiveChatActionPanel extends YTNode { static type = 'LiveChatActionPanel'; diff --git a/src/parser/classes/livechat/MarkChatItemAsDeletedAction.ts b/src/parser/classes/livechat/MarkChatItemAsDeletedAction.ts index 3548d15bd..9e69e33d1 100644 --- a/src/parser/classes/livechat/MarkChatItemAsDeletedAction.ts +++ b/src/parser/classes/livechat/MarkChatItemAsDeletedAction.ts @@ -1,5 +1,5 @@ -import Text from '../misc/Text'; -import { YTNode } from '../../helpers'; +import Text from '../misc/Text.js'; +import { YTNode } from '../../helpers.js'; class MarkChatItemAsDeletedAction extends YTNode { static type = 'MarkChatItemAsDeletedAction'; diff --git a/src/parser/classes/livechat/MarkChatItemsByAuthorAsDeletedAction.ts b/src/parser/classes/livechat/MarkChatItemsByAuthorAsDeletedAction.ts index d2021e3ea..19140dff4 100644 --- a/src/parser/classes/livechat/MarkChatItemsByAuthorAsDeletedAction.ts +++ b/src/parser/classes/livechat/MarkChatItemsByAuthorAsDeletedAction.ts @@ -1,5 +1,5 @@ -import Text from '../misc/Text'; -import { YTNode } from '../../helpers'; +import Text from '../misc/Text.js'; +import { YTNode } from '../../helpers.js'; class MarkChatItemsByAuthorAsDeletedAction extends YTNode { static type = 'MarkChatItemsByAuthorAsDeletedAction'; diff --git a/src/parser/classes/livechat/RemoveBannerForLiveChatCommand.ts b/src/parser/classes/livechat/RemoveBannerForLiveChatCommand.ts index e2c00205b..362177327 100644 --- a/src/parser/classes/livechat/RemoveBannerForLiveChatCommand.ts +++ b/src/parser/classes/livechat/RemoveBannerForLiveChatCommand.ts @@ -1,4 +1,4 @@ -import { YTNode } from '../../helpers'; +import { YTNode } from '../../helpers.js'; class RemoveBannerForLiveChatCommand extends YTNode { static type = 'RemoveBannerForLiveChatCommand'; diff --git a/src/parser/classes/livechat/RemoveChatItemAction.ts b/src/parser/classes/livechat/RemoveChatItemAction.ts index 325677b6a..1e9e30493 100644 --- a/src/parser/classes/livechat/RemoveChatItemAction.ts +++ b/src/parser/classes/livechat/RemoveChatItemAction.ts @@ -1,4 +1,4 @@ -import { YTNode } from '../../helpers'; +import { YTNode } from '../../helpers.js'; class RemoveChatItemAction extends YTNode { static type = 'RemoveChatItemAction'; diff --git a/src/parser/classes/livechat/RemoveChatItemByAuthorAction.ts b/src/parser/classes/livechat/RemoveChatItemByAuthorAction.ts index 41d68b24e..c3c22662e 100644 --- a/src/parser/classes/livechat/RemoveChatItemByAuthorAction.ts +++ b/src/parser/classes/livechat/RemoveChatItemByAuthorAction.ts @@ -1,4 +1,4 @@ -import { YTNode } from '../../helpers'; +import { YTNode } from '../../helpers.js'; class RemoveChatItemByAuthorAction extends YTNode { static type = 'RemoveChatItemByAuthorAction'; diff --git a/src/parser/classes/livechat/ReplaceChatItemAction.ts b/src/parser/classes/livechat/ReplaceChatItemAction.ts index 9a3547815..ae0f64930 100644 --- a/src/parser/classes/livechat/ReplaceChatItemAction.ts +++ b/src/parser/classes/livechat/ReplaceChatItemAction.ts @@ -1,5 +1,5 @@ -import Parser from '../../index'; -import { YTNode } from '../../helpers'; +import Parser from '../../index.js'; +import { YTNode } from '../../helpers.js'; class ReplaceChatItemAction extends YTNode { static type = 'ReplaceChatItemAction'; diff --git a/src/parser/classes/livechat/ReplayChatItemAction.ts b/src/parser/classes/livechat/ReplayChatItemAction.ts index 3fac98980..28a9035bf 100644 --- a/src/parser/classes/livechat/ReplayChatItemAction.ts +++ b/src/parser/classes/livechat/ReplayChatItemAction.ts @@ -1,5 +1,5 @@ -import Parser from '../../index'; -import { YTNode } from '../../helpers'; +import Parser from '../../index.js'; +import { YTNode } from '../../helpers.js'; class ReplayChatItemAction extends YTNode { static type = 'ReplayChatItemAction'; diff --git a/src/parser/classes/livechat/ShowLiveChatActionPanelAction.ts b/src/parser/classes/livechat/ShowLiveChatActionPanelAction.ts index c4fd781d8..479237620 100644 --- a/src/parser/classes/livechat/ShowLiveChatActionPanelAction.ts +++ b/src/parser/classes/livechat/ShowLiveChatActionPanelAction.ts @@ -1,6 +1,6 @@ -import Parser from '../../index'; -import { YTNode } from '../../helpers'; -import LiveChatActionPanel from './LiveChatActionPanel'; +import Parser from '../../index.js'; +import { YTNode } from '../../helpers.js'; +import LiveChatActionPanel from './LiveChatActionPanel.js'; class ShowLiveChatActionPanelAction extends YTNode { static type = 'ShowLiveChatActionPanelAction'; diff --git a/src/parser/classes/livechat/ShowLiveChatDialogAction.ts b/src/parser/classes/livechat/ShowLiveChatDialogAction.ts index f6f03f6a2..c7a5bd559 100644 --- a/src/parser/classes/livechat/ShowLiveChatDialogAction.ts +++ b/src/parser/classes/livechat/ShowLiveChatDialogAction.ts @@ -1,5 +1,5 @@ -import Parser from '../..'; -import { YTNode } from '../../helpers'; +import Parser from '../../index.js'; +import { YTNode } from '../../helpers.js'; class ShowLiveChatDialogAction extends YTNode { static type = 'ShowLiveChatDialogAction'; diff --git a/src/parser/classes/livechat/ShowLiveChatTooltipCommand.ts b/src/parser/classes/livechat/ShowLiveChatTooltipCommand.ts index 09414e771..14f36908a 100644 --- a/src/parser/classes/livechat/ShowLiveChatTooltipCommand.ts +++ b/src/parser/classes/livechat/ShowLiveChatTooltipCommand.ts @@ -1,5 +1,5 @@ -import Parser from '../../index'; -import { YTNode } from '../../helpers'; +import Parser from '../../index.js'; +import { YTNode } from '../../helpers.js'; class ShowLiveChatTooltipCommand extends YTNode { static type = 'ShowLiveChatTooltipCommand'; diff --git a/src/parser/classes/livechat/UpdateDateTextAction.ts b/src/parser/classes/livechat/UpdateDateTextAction.ts index 5230a95cb..e4bbddfbd 100644 --- a/src/parser/classes/livechat/UpdateDateTextAction.ts +++ b/src/parser/classes/livechat/UpdateDateTextAction.ts @@ -1,5 +1,5 @@ -import Text from '../misc/Text'; -import { YTNode } from '../../helpers'; +import Text from '../misc/Text.js'; +import { YTNode } from '../../helpers.js'; class UpdateDateTextAction extends YTNode { static type = 'UpdateDateTextAction'; diff --git a/src/parser/classes/livechat/UpdateDescriptionAction.ts b/src/parser/classes/livechat/UpdateDescriptionAction.ts index a686fdb99..c0dafeec5 100644 --- a/src/parser/classes/livechat/UpdateDescriptionAction.ts +++ b/src/parser/classes/livechat/UpdateDescriptionAction.ts @@ -1,5 +1,5 @@ -import Text from '../misc/Text'; -import { YTNode } from '../../helpers'; +import Text from '../misc/Text.js'; +import { YTNode } from '../../helpers.js'; class UpdateDescriptionAction extends YTNode { static type = 'UpdateDescriptionAction'; diff --git a/src/parser/classes/livechat/UpdateLiveChatPollAction.ts b/src/parser/classes/livechat/UpdateLiveChatPollAction.ts index 8c69d10f9..419dcbc2e 100644 --- a/src/parser/classes/livechat/UpdateLiveChatPollAction.ts +++ b/src/parser/classes/livechat/UpdateLiveChatPollAction.ts @@ -1,5 +1,5 @@ -import Parser from '../../index'; -import { YTNode } from '../../helpers'; +import Parser from '../../index.js'; +import { YTNode } from '../../helpers.js'; class UpdateLiveChatPollAction extends YTNode { static type = 'UpdateLiveChatPollAction'; diff --git a/src/parser/classes/livechat/UpdateTitleAction.ts b/src/parser/classes/livechat/UpdateTitleAction.ts index 8242a3af6..d7edc0cd5 100644 --- a/src/parser/classes/livechat/UpdateTitleAction.ts +++ b/src/parser/classes/livechat/UpdateTitleAction.ts @@ -1,5 +1,5 @@ -import Text from '../misc/Text'; -import { YTNode } from '../../helpers'; +import Text from '../misc/Text.js'; +import { YTNode } from '../../helpers.js'; class UpdateTitleAction extends YTNode { static type = 'UpdateTitleAction'; diff --git a/src/parser/classes/livechat/UpdateToggleButtonTextAction.ts b/src/parser/classes/livechat/UpdateToggleButtonTextAction.ts index 4ba0f8548..8189b8aa0 100644 --- a/src/parser/classes/livechat/UpdateToggleButtonTextAction.ts +++ b/src/parser/classes/livechat/UpdateToggleButtonTextAction.ts @@ -1,5 +1,5 @@ -import Text from '../misc/Text'; -import { YTNode } from '../../helpers'; +import Text from '../misc/Text.js'; +import { YTNode } from '../../helpers.js'; class UpdateToggleButtonTextAction extends YTNode { static type = 'UpdateToggleButtonTextAction'; diff --git a/src/parser/classes/livechat/UpdateViewershipAction.ts b/src/parser/classes/livechat/UpdateViewershipAction.ts index d0e9311dc..20c21850e 100644 --- a/src/parser/classes/livechat/UpdateViewershipAction.ts +++ b/src/parser/classes/livechat/UpdateViewershipAction.ts @@ -1,5 +1,5 @@ -import Text from '../misc/Text'; -import { YTNode } from '../../helpers'; +import Text from '../misc/Text.js'; +import { YTNode } from '../../helpers.js'; class UpdateViewershipAction extends YTNode { static type = 'UpdateViewershipAction'; diff --git a/src/parser/classes/livechat/items/LiveChatAutoModMessage.ts b/src/parser/classes/livechat/items/LiveChatAutoModMessage.ts index 58f34a7b4..6676b28d8 100644 --- a/src/parser/classes/livechat/items/LiveChatAutoModMessage.ts +++ b/src/parser/classes/livechat/items/LiveChatAutoModMessage.ts @@ -1,8 +1,8 @@ -import { ObservedArray, YTNode } from '../../../helpers'; -import Parser from '../../../index'; -import Button from '../../Button'; -import Text from '../../misc/Text'; -import NavigationEndpoint from '../../NavigationEndpoint'; +import { ObservedArray, YTNode } from '../../../helpers.js'; +import Parser from '../../../index.js'; +import Button from '../../Button.js'; +import Text from '../../misc/Text.js'; +import NavigationEndpoint from '../../NavigationEndpoint.js'; class LiveChatAutoModMessage extends YTNode { static type = 'LiveChatAutoModMessage'; diff --git a/src/parser/classes/livechat/items/LiveChatBanner.ts b/src/parser/classes/livechat/items/LiveChatBanner.ts index 4c952ed0a..53dcfd2d9 100644 --- a/src/parser/classes/livechat/items/LiveChatBanner.ts +++ b/src/parser/classes/livechat/items/LiveChatBanner.ts @@ -1,6 +1,6 @@ -import { YTNode } from '../../../helpers'; -import Parser from '../../../index'; -import type LiveChatBannerHeader from './LiveChatBannerHeader'; +import { YTNode } from '../../../helpers.js'; +import Parser from '../../../index.js'; +import type LiveChatBannerHeader from './LiveChatBannerHeader.js'; class LiveChatBanner extends YTNode { static type = 'LiveChatBanner'; diff --git a/src/parser/classes/livechat/items/LiveChatBannerHeader.ts b/src/parser/classes/livechat/items/LiveChatBannerHeader.ts index 5fcbcbe97..513a356ad 100644 --- a/src/parser/classes/livechat/items/LiveChatBannerHeader.ts +++ b/src/parser/classes/livechat/items/LiveChatBannerHeader.ts @@ -1,7 +1,7 @@ -import { YTNode } from '../../../helpers'; -import Parser from '../../../index'; -import type Button from '../../Button'; -import Text from '../../misc/Text'; +import { YTNode } from '../../../helpers.js'; +import Parser from '../../../index.js'; +import type Button from '../../Button.js'; +import Text from '../../misc/Text.js'; class LiveChatBannerHeader extends YTNode { static type = 'LiveChatBannerHeader'; diff --git a/src/parser/classes/livechat/items/LiveChatBannerPoll.ts b/src/parser/classes/livechat/items/LiveChatBannerPoll.ts index 8163d4e67..c3276a639 100644 --- a/src/parser/classes/livechat/items/LiveChatBannerPoll.ts +++ b/src/parser/classes/livechat/items/LiveChatBannerPoll.ts @@ -1,7 +1,7 @@ -import { YTNode } from '../../../helpers'; -import Parser from '../../../index'; -import Text from '../../misc/Text'; -import Thumbnail from '../../misc/Thumbnail'; +import { YTNode } from '../../../helpers.js'; +import Parser from '../../../index.js'; +import Text from '../../misc/Text.js'; +import Thumbnail from '../../misc/Thumbnail.js'; class LiveChatBannerPoll extends YTNode { static type = 'LiveChatBannerPoll'; diff --git a/src/parser/classes/livechat/items/LiveChatMembershipItem.ts b/src/parser/classes/livechat/items/LiveChatMembershipItem.ts index 7add4df3a..96301ad56 100644 --- a/src/parser/classes/livechat/items/LiveChatMembershipItem.ts +++ b/src/parser/classes/livechat/items/LiveChatMembershipItem.ts @@ -1,10 +1,10 @@ -import { observe, ObservedArray, YTNode } from '../../../helpers'; -import Parser from '../../../index'; -import LiveChatAuthorBadge from '../../LiveChatAuthorBadge'; -import MetadataBadge from '../../MetadataBadge'; -import Text from '../../misc/Text'; -import Thumbnail from '../../misc/Thumbnail'; -import NavigationEndpoint from '../../NavigationEndpoint'; +import { observe, ObservedArray, YTNode } from '../../../helpers.js'; +import Parser from '../../../index.js'; +import LiveChatAuthorBadge from '../../LiveChatAuthorBadge.js'; +import MetadataBadge from '../../MetadataBadge.js'; +import Text from '../../misc/Text.js'; +import Thumbnail from '../../misc/Thumbnail.js'; +import NavigationEndpoint from '../../NavigationEndpoint.js'; class LiveChatMembershipItem extends YTNode { static type = 'LiveChatMembershipItem'; diff --git a/src/parser/classes/livechat/items/LiveChatPaidMessage.ts b/src/parser/classes/livechat/items/LiveChatPaidMessage.ts index bbb4b52ba..ef7780f11 100644 --- a/src/parser/classes/livechat/items/LiveChatPaidMessage.ts +++ b/src/parser/classes/livechat/items/LiveChatPaidMessage.ts @@ -1,10 +1,10 @@ -import { observe, ObservedArray, YTNode } from '../../../helpers'; -import Parser from '../../../index'; -import LiveChatAuthorBadge from '../../LiveChatAuthorBadge'; -import MetadataBadge from '../../MetadataBadge'; -import Text from '../../misc/Text'; -import Thumbnail from '../../misc/Thumbnail'; -import NavigationEndpoint from '../../NavigationEndpoint'; +import { observe, ObservedArray, YTNode } from '../../../helpers.js'; +import Parser from '../../../index.js'; +import LiveChatAuthorBadge from '../../LiveChatAuthorBadge.js'; +import MetadataBadge from '../../MetadataBadge.js'; +import Text from '../../misc/Text.js'; +import Thumbnail from '../../misc/Thumbnail.js'; +import NavigationEndpoint from '../../NavigationEndpoint.js'; class LiveChatPaidMessage extends YTNode { static type = 'LiveChatPaidMessage'; diff --git a/src/parser/classes/livechat/items/LiveChatPaidSticker.ts b/src/parser/classes/livechat/items/LiveChatPaidSticker.ts index 032a0ccd7..0bc2131fa 100644 --- a/src/parser/classes/livechat/items/LiveChatPaidSticker.ts +++ b/src/parser/classes/livechat/items/LiveChatPaidSticker.ts @@ -1,10 +1,10 @@ -import { observe, ObservedArray, YTNode } from '../../../helpers'; -import Parser from '../../../index'; -import LiveChatAuthorBadge from '../../LiveChatAuthorBadge'; -import MetadataBadge from '../../MetadataBadge'; -import Text from '../../misc/Text'; -import Thumbnail from '../../misc/Thumbnail'; -import NavigationEndpoint from '../../NavigationEndpoint'; +import { observe, ObservedArray, YTNode } from '../../../helpers.js'; +import Parser from '../../../index.js'; +import LiveChatAuthorBadge from '../../LiveChatAuthorBadge.js'; +import MetadataBadge from '../../MetadataBadge.js'; +import Text from '../../misc/Text.js'; +import Thumbnail from '../../misc/Thumbnail.js'; +import NavigationEndpoint from '../../NavigationEndpoint.js'; class LiveChatPaidSticker extends YTNode { static type = 'LiveChatPaidSticker'; diff --git a/src/parser/classes/livechat/items/LiveChatPlaceholderItem.ts b/src/parser/classes/livechat/items/LiveChatPlaceholderItem.ts index 9257a54bc..4f8afa9d2 100644 --- a/src/parser/classes/livechat/items/LiveChatPlaceholderItem.ts +++ b/src/parser/classes/livechat/items/LiveChatPlaceholderItem.ts @@ -1,4 +1,4 @@ -import { YTNode } from '../../../helpers'; +import { YTNode } from '../../../helpers.js'; class LiveChatPlaceholderItem extends YTNode { static type = 'LiveChatPlaceholderItem'; diff --git a/src/parser/classes/livechat/items/LiveChatProductItem.ts b/src/parser/classes/livechat/items/LiveChatProductItem.ts index c271e9e58..33d6fa608 100644 --- a/src/parser/classes/livechat/items/LiveChatProductItem.ts +++ b/src/parser/classes/livechat/items/LiveChatProductItem.ts @@ -1,9 +1,9 @@ -import Parser from '../../../index'; -import { YTNode } from '../../../helpers'; +import Parser from '../../../index.js'; +import { YTNode } from '../../../helpers.js'; -import Text from '../../misc/Text'; -import Thumbnail from '../../misc/Thumbnail'; -import NavigationEndpoint from '../../NavigationEndpoint'; +import Text from '../../misc/Text.js'; +import Thumbnail from '../../misc/Thumbnail.js'; +import NavigationEndpoint from '../../NavigationEndpoint.js'; class LiveChatProductItem extends YTNode { static type = 'LiveChatProductItem'; diff --git a/src/parser/classes/livechat/items/LiveChatRestrictedParticipation.ts b/src/parser/classes/livechat/items/LiveChatRestrictedParticipation.ts index 9d4a97310..e99c29d1c 100644 --- a/src/parser/classes/livechat/items/LiveChatRestrictedParticipation.ts +++ b/src/parser/classes/livechat/items/LiveChatRestrictedParticipation.ts @@ -1,5 +1,5 @@ -import { YTNode } from '../../../helpers'; -import Text from '../../misc/Text'; +import { YTNode } from '../../../helpers.js'; +import Text from '../../misc/Text.js'; class LiveChatRestrictedParticipation extends YTNode { message: Text; diff --git a/src/parser/classes/livechat/items/LiveChatTextMessage.ts b/src/parser/classes/livechat/items/LiveChatTextMessage.ts index a5deb742c..15613bc14 100644 --- a/src/parser/classes/livechat/items/LiveChatTextMessage.ts +++ b/src/parser/classes/livechat/items/LiveChatTextMessage.ts @@ -1,11 +1,11 @@ -import { observe, ObservedArray, YTNode } from '../../../helpers'; -import Parser from '../../../index'; -import Button from '../../Button'; -import LiveChatAuthorBadge from '../../LiveChatAuthorBadge'; -import MetadataBadge from '../../MetadataBadge'; -import Text from '../../misc/Text'; -import Thumbnail from '../../misc/Thumbnail'; -import NavigationEndpoint from '../../NavigationEndpoint'; +import { observe, ObservedArray, YTNode } from '../../../helpers.js'; +import Parser from '../../../index.js'; +import Button from '../../Button.js'; +import LiveChatAuthorBadge from '../../LiveChatAuthorBadge.js'; +import MetadataBadge from '../../MetadataBadge.js'; +import Text from '../../misc/Text.js'; +import Thumbnail from '../../misc/Thumbnail.js'; +import NavigationEndpoint from '../../NavigationEndpoint.js'; class LiveChatTextMessage extends YTNode { static type = 'LiveChatTextMessage'; diff --git a/src/parser/classes/livechat/items/LiveChatTickerPaidMessageItem.ts b/src/parser/classes/livechat/items/LiveChatTickerPaidMessageItem.ts index 9e2d42696..72633ab93 100644 --- a/src/parser/classes/livechat/items/LiveChatTickerPaidMessageItem.ts +++ b/src/parser/classes/livechat/items/LiveChatTickerPaidMessageItem.ts @@ -1,11 +1,11 @@ -import Parser from '../../../index'; -import LiveChatAuthorBadge from '../../LiveChatAuthorBadge'; -import MetadataBadge from '../../MetadataBadge'; -import Text from '../../misc/Text'; -import Thumbnail from '../../misc/Thumbnail'; -import NavigationEndpoint from '../../NavigationEndpoint'; - -import { observe, ObservedArray, YTNode } from '../../../helpers'; +import Parser from '../../../index.js'; +import LiveChatAuthorBadge from '../../LiveChatAuthorBadge.js'; +import MetadataBadge from '../../MetadataBadge.js'; +import Text from '../../misc/Text.js'; +import Thumbnail from '../../misc/Thumbnail.js'; +import NavigationEndpoint from '../../NavigationEndpoint.js'; + +import { observe, ObservedArray, YTNode } from '../../../helpers.js'; class LiveChatTickerPaidMessageItem extends YTNode { static type = 'LiveChatTickerPaidMessageItem'; diff --git a/src/parser/classes/livechat/items/LiveChatTickerPaidStickerItem.ts b/src/parser/classes/livechat/items/LiveChatTickerPaidStickerItem.ts index 255d498cb..076818b08 100644 --- a/src/parser/classes/livechat/items/LiveChatTickerPaidStickerItem.ts +++ b/src/parser/classes/livechat/items/LiveChatTickerPaidStickerItem.ts @@ -1,11 +1,11 @@ -import Parser from '../../../index'; -import LiveChatAuthorBadge from '../../LiveChatAuthorBadge'; -import MetadataBadge from '../../MetadataBadge'; -import Text from '../../misc/Text'; -import Thumbnail from '../../misc/Thumbnail'; -import NavigationEndpoint from '../../NavigationEndpoint'; - -import { observe, ObservedArray, YTNode } from '../../../helpers'; +import Parser from '../../../index.js'; +import LiveChatAuthorBadge from '../../LiveChatAuthorBadge.js'; +import MetadataBadge from '../../MetadataBadge.js'; +import Text from '../../misc/Text.js'; +import Thumbnail from '../../misc/Thumbnail.js'; +import NavigationEndpoint from '../../NavigationEndpoint.js'; + +import { observe, ObservedArray, YTNode } from '../../../helpers.js'; class LiveChatTickerPaidStickerItem extends YTNode { static type = 'LiveChatTickerPaidStickerItem'; diff --git a/src/parser/classes/livechat/items/LiveChatTickerSponsorItem.ts b/src/parser/classes/livechat/items/LiveChatTickerSponsorItem.ts index e5dab63bf..d6f35a13b 100644 --- a/src/parser/classes/livechat/items/LiveChatTickerSponsorItem.ts +++ b/src/parser/classes/livechat/items/LiveChatTickerSponsorItem.ts @@ -1,9 +1,9 @@ -import Parser from '../../..'; -import { observe, ObservedArray, YTNode } from '../../../helpers'; -import LiveChatAuthorBadge from '../../LiveChatAuthorBadge'; -import MetadataBadge from '../../MetadataBadge'; -import Text from '../../misc/Text'; -import Thumbnail from '../../misc/Thumbnail'; +import Parser from '../../../index.js'; +import { observe, ObservedArray, YTNode } from '../../../helpers.js'; +import LiveChatAuthorBadge from '../../LiveChatAuthorBadge.js'; +import MetadataBadge from '../../MetadataBadge.js'; +import Text from '../../misc/Text.js'; +import Thumbnail from '../../misc/Thumbnail.js'; class LiveChatTickerSponsorItem extends YTNode { static type = 'LiveChatTickerSponsorItem'; diff --git a/src/parser/classes/livechat/items/LiveChatViewerEngagementMessage.ts b/src/parser/classes/livechat/items/LiveChatViewerEngagementMessage.ts index 7947820fe..e58e7453c 100644 --- a/src/parser/classes/livechat/items/LiveChatViewerEngagementMessage.ts +++ b/src/parser/classes/livechat/items/LiveChatViewerEngagementMessage.ts @@ -1,5 +1,5 @@ -import Parser from '../../../index'; -import LiveChatTextMessage from './LiveChatTextMessage'; +import Parser from '../../../index.js'; +import LiveChatTextMessage from './LiveChatTextMessage.js'; class LiveChatViewerEngagementMessage extends LiveChatTextMessage { static type = 'LiveChatViewerEngagementMessage'; diff --git a/src/parser/classes/livechat/items/PollHeader.ts b/src/parser/classes/livechat/items/PollHeader.ts index ce65c2cfc..ad415cc8d 100644 --- a/src/parser/classes/livechat/items/PollHeader.ts +++ b/src/parser/classes/livechat/items/PollHeader.ts @@ -1,7 +1,7 @@ -import Text from '../../misc/Text'; -import Thumbnail from '../../misc/Thumbnail'; -import Parser from '../../../index'; -import { YTNode } from '../../../helpers'; +import Text from '../../misc/Text.js'; +import Thumbnail from '../../misc/Thumbnail.js'; +import Parser from '../../../index.js'; +import { YTNode } from '../../../helpers.js'; class PollHeader extends YTNode { static type = 'PollHeader'; diff --git a/src/parser/classes/menus/Menu.ts b/src/parser/classes/menus/Menu.ts index 389598d1b..4aff5e0a0 100644 --- a/src/parser/classes/menus/Menu.ts +++ b/src/parser/classes/menus/Menu.ts @@ -1,5 +1,5 @@ -import Parser from '../../index'; -import { YTNode } from '../../helpers'; +import Parser from '../../index.js'; +import { YTNode } from '../../helpers.js'; class Menu extends YTNode { static type = 'Menu'; diff --git a/src/parser/classes/menus/MenuNavigationItem.ts b/src/parser/classes/menus/MenuNavigationItem.ts index 31fc8de48..08b8f49b7 100644 --- a/src/parser/classes/menus/MenuNavigationItem.ts +++ b/src/parser/classes/menus/MenuNavigationItem.ts @@ -1,4 +1,4 @@ -import Button from '../Button'; +import Button from '../Button.js'; class MenuNavigationItem extends Button { static type = 'MenuNavigationItem'; diff --git a/src/parser/classes/menus/MenuServiceItem.ts b/src/parser/classes/menus/MenuServiceItem.ts index deb58ceb9..5fd6fd00a 100644 --- a/src/parser/classes/menus/MenuServiceItem.ts +++ b/src/parser/classes/menus/MenuServiceItem.ts @@ -1,4 +1,4 @@ -import Button from '../Button'; +import Button from '../Button.js'; class MenuServiceItem extends Button { static type = 'MenuServiceItem'; diff --git a/src/parser/classes/menus/MenuServiceItemDownload.ts b/src/parser/classes/menus/MenuServiceItemDownload.ts index 9767640f8..05ede5ba5 100644 --- a/src/parser/classes/menus/MenuServiceItemDownload.ts +++ b/src/parser/classes/menus/MenuServiceItemDownload.ts @@ -1,5 +1,5 @@ -import NavigationEndpoint from '../NavigationEndpoint'; -import { YTNode } from '../../helpers'; +import NavigationEndpoint from '../NavigationEndpoint.js'; +import { YTNode } from '../../helpers.js'; class MenuServiceItemDownload extends YTNode { static type = 'MenuServiceItemDownload'; diff --git a/src/parser/classes/menus/MultiPageMenu.ts b/src/parser/classes/menus/MultiPageMenu.ts index aedaa8c7a..ee8f0555d 100644 --- a/src/parser/classes/menus/MultiPageMenu.ts +++ b/src/parser/classes/menus/MultiPageMenu.ts @@ -1,5 +1,5 @@ -import Parser from '../../index'; -import { YTNode } from '../../helpers'; +import Parser from '../../index.js'; +import { YTNode } from '../../helpers.js'; class MultiPageMenu extends YTNode { static type = 'MultiPageMenu'; diff --git a/src/parser/classes/menus/MultiPageMenuNotificationSection.ts b/src/parser/classes/menus/MultiPageMenuNotificationSection.ts index 695f2118a..3b717f239 100644 --- a/src/parser/classes/menus/MultiPageMenuNotificationSection.ts +++ b/src/parser/classes/menus/MultiPageMenuNotificationSection.ts @@ -1,5 +1,5 @@ -import Parser from '../../index'; -import { YTNode } from '../../helpers'; +import Parser from '../../index.js'; +import { YTNode } from '../../helpers.js'; class MultiPageMenuNotificationSection extends YTNode { static type = 'MultiPageMenuNotificationSection'; diff --git a/src/parser/classes/menus/MusicMenuItemDivider.ts b/src/parser/classes/menus/MusicMenuItemDivider.ts index 218f0578c..81cb3295b 100644 --- a/src/parser/classes/menus/MusicMenuItemDivider.ts +++ b/src/parser/classes/menus/MusicMenuItemDivider.ts @@ -1,4 +1,4 @@ -import { YTNode } from '../../helpers'; +import { YTNode } from '../../helpers.js'; class MusicMenuItemDivider extends YTNode { static type = 'MusicMenuItemDivider'; diff --git a/src/parser/classes/menus/MusicMultiSelectMenu.ts b/src/parser/classes/menus/MusicMultiSelectMenu.ts index 71eafd925..aa8045d17 100644 --- a/src/parser/classes/menus/MusicMultiSelectMenu.ts +++ b/src/parser/classes/menus/MusicMultiSelectMenu.ts @@ -1,8 +1,8 @@ -import MusicMultiSelectMenuItem from './MusicMultiSelectMenuItem'; -import MusicMenuItemDivider from './MusicMenuItemDivider'; -import { YTNode } from '../../helpers'; -import Text from '../misc/Text'; -import Parser from '../..'; +import MusicMultiSelectMenuItem from './MusicMultiSelectMenuItem.js'; +import MusicMenuItemDivider from './MusicMenuItemDivider.js'; +import { YTNode } from '../../helpers.js'; +import Text from '../misc/Text.js'; +import Parser from '../../index.js'; class MusicMultiSelectMenu extends YTNode { static type = 'MusicMultiSelectMenu'; diff --git a/src/parser/classes/menus/MusicMultiSelectMenuItem.ts b/src/parser/classes/menus/MusicMultiSelectMenuItem.ts index a705ad505..09f2153e8 100644 --- a/src/parser/classes/menus/MusicMultiSelectMenuItem.ts +++ b/src/parser/classes/menus/MusicMultiSelectMenuItem.ts @@ -1,6 +1,6 @@ -import { YTNode } from '../../helpers'; -import Text from '../misc/Text'; -import NavigationEndpoint from '../NavigationEndpoint'; +import { YTNode } from '../../helpers.js'; +import Text from '../misc/Text.js'; +import NavigationEndpoint from '../NavigationEndpoint.js'; class MusicMultiSelectMenuItem extends YTNode { static type = 'MusicMultiSelectMenuItem'; diff --git a/src/parser/classes/menus/SimpleMenuHeader.ts b/src/parser/classes/menus/SimpleMenuHeader.ts index 3f9f5dcf5..b39799aa4 100644 --- a/src/parser/classes/menus/SimpleMenuHeader.ts +++ b/src/parser/classes/menus/SimpleMenuHeader.ts @@ -1,6 +1,6 @@ -import Parser from '../../index'; -import Text from '../misc/Text'; -import { YTNode } from '../../helpers'; +import Parser from '../../index.js'; +import Text from '../misc/Text.js'; +import { YTNode } from '../../helpers.js'; class SimpleMenuHeader extends YTNode { static type = 'SimpleMenuHeader'; diff --git a/src/parser/classes/misc/Author.ts b/src/parser/classes/misc/Author.ts index 271090926..37ca931ef 100644 --- a/src/parser/classes/misc/Author.ts +++ b/src/parser/classes/misc/Author.ts @@ -1,9 +1,9 @@ -import Parser from '../../index'; -import NavigatableText from './NavigatableText'; -import NavigationEndpoint from '../NavigationEndpoint'; -import TextRun from './TextRun'; -import Thumbnail from './Thumbnail'; -import Constants from '../../../utils/Constants'; +import Parser from '../../index.js'; +import NavigatableText from './NavigatableText.js'; +import NavigationEndpoint from '../NavigationEndpoint.js'; +import TextRun from './TextRun.js'; +import Thumbnail from './Thumbnail.js'; +import Constants from '../../../utils/Constants.js'; class Author { #nav_text; diff --git a/src/parser/classes/misc/EmojiRun.ts b/src/parser/classes/misc/EmojiRun.ts index 47093ebb3..98cdc1ddb 100644 --- a/src/parser/classes/misc/EmojiRun.ts +++ b/src/parser/classes/misc/EmojiRun.ts @@ -1,5 +1,5 @@ -import { escape, Run } from './Text'; -import Thumbnail from './Thumbnail'; +import { escape, Run } from './Text.js'; +import Thumbnail from './Thumbnail.js'; class EmojiRun implements Run { text: string; diff --git a/src/parser/classes/misc/Format.ts b/src/parser/classes/misc/Format.ts index 4e2154502..17501cff1 100644 --- a/src/parser/classes/misc/Format.ts +++ b/src/parser/classes/misc/Format.ts @@ -1,5 +1,5 @@ -import Player from '../../../core/Player'; -import { InnertubeError } from '../../../utils/Utils'; +import Player from '../../../core/Player.js'; +import { InnertubeError } from '../../../utils/Utils.js'; class Format { itag: number; diff --git a/src/parser/classes/misc/NavigatableText.ts b/src/parser/classes/misc/NavigatableText.ts index a66aaa026..961ef6d65 100644 --- a/src/parser/classes/misc/NavigatableText.ts +++ b/src/parser/classes/misc/NavigatableText.ts @@ -1,5 +1,5 @@ -import Text from './Text'; -import NavigationEndpoint from '../NavigationEndpoint'; +import Text from './Text.js'; +import NavigationEndpoint from '../NavigationEndpoint.js'; class NavigatableText extends Text { static type = 'NavigatableText'; diff --git a/src/parser/classes/misc/PlaylistAuthor.ts b/src/parser/classes/misc/PlaylistAuthor.ts index 789ed7f4c..e092d112b 100644 --- a/src/parser/classes/misc/PlaylistAuthor.ts +++ b/src/parser/classes/misc/PlaylistAuthor.ts @@ -1,4 +1,4 @@ -import Author from './Author'; +import Author from './Author.js'; class PlaylistAuthor extends Author { constructor(item: any, badges?: any, thumbs?: any) { diff --git a/src/parser/classes/misc/Text.ts b/src/parser/classes/misc/Text.ts index fc08f8385..d13ff191a 100644 --- a/src/parser/classes/misc/Text.ts +++ b/src/parser/classes/misc/Text.ts @@ -1,5 +1,5 @@ -import TextRun from './TextRun'; -import EmojiRun from './EmojiRun'; +import TextRun from './TextRun.js'; +import EmojiRun from './EmojiRun.js'; export interface Run { text: string; diff --git a/src/parser/classes/misc/TextRun.ts b/src/parser/classes/misc/TextRun.ts index 3e35929df..8bec9b929 100644 --- a/src/parser/classes/misc/TextRun.ts +++ b/src/parser/classes/misc/TextRun.ts @@ -1,5 +1,5 @@ -import NavigationEndpoint from '../NavigationEndpoint'; -import { escape, Run } from './Text'; +import NavigationEndpoint from '../NavigationEndpoint.js'; +import { escape, Run } from './Text.js'; class TextRun implements Run { text: string; diff --git a/src/parser/classes/misc/VideoDetails.ts b/src/parser/classes/misc/VideoDetails.ts index f3cde3e66..e69d47d4b 100644 --- a/src/parser/classes/misc/VideoDetails.ts +++ b/src/parser/classes/misc/VideoDetails.ts @@ -1,4 +1,4 @@ -import Thumbnail from './Thumbnail'; +import Thumbnail from './Thumbnail.js'; class VideoDetails { id: string; diff --git a/src/parser/classes/ytkids/AnchoredSection.ts b/src/parser/classes/ytkids/AnchoredSection.ts index 8b038b862..96dc9a78b 100644 --- a/src/parser/classes/ytkids/AnchoredSection.ts +++ b/src/parser/classes/ytkids/AnchoredSection.ts @@ -1,7 +1,7 @@ -import Parser from '../..'; -import NavigationEndpoint from '../NavigationEndpoint'; -import type SectionList from '../SectionList'; -import { YTNode } from '../../helpers'; +import Parser from '../../index.js'; +import NavigationEndpoint from '../NavigationEndpoint.js'; +import type SectionList from '../SectionList.js'; +import { YTNode } from '../../helpers.js'; class AnchoredSection extends YTNode { static type = 'AnchoredSection'; diff --git a/src/parser/classes/ytkids/KidsCategoriesHeader.ts b/src/parser/classes/ytkids/KidsCategoriesHeader.ts index 6806db8d6..c43180784 100644 --- a/src/parser/classes/ytkids/KidsCategoriesHeader.ts +++ b/src/parser/classes/ytkids/KidsCategoriesHeader.ts @@ -1,7 +1,7 @@ -import Parser from '../..'; -import type Button from '../Button'; -import type KidsCategoryTab from './KidsCategoryTab'; -import { YTNode } from '../../helpers'; +import Parser from '../../index.js'; +import type Button from '../Button.js'; +import type KidsCategoryTab from './KidsCategoryTab.js'; +import { YTNode } from '../../helpers.js'; class KidsCategoriesHeader extends YTNode { static type = 'kidsCategoriesHeader'; diff --git a/src/parser/classes/ytkids/KidsCategoryTab.ts b/src/parser/classes/ytkids/KidsCategoryTab.ts index 19d2d5bf3..489d5ada3 100644 --- a/src/parser/classes/ytkids/KidsCategoryTab.ts +++ b/src/parser/classes/ytkids/KidsCategoryTab.ts @@ -1,6 +1,6 @@ -import Text from '../misc/Text'; -import NavigationEndpoint from '../NavigationEndpoint'; -import { YTNode } from '../../helpers'; +import Text from '../misc/Text.js'; +import NavigationEndpoint from '../NavigationEndpoint.js'; +import { YTNode } from '../../helpers.js'; class KidsCategoryTab extends YTNode { static type = 'KidsCategoryTab'; diff --git a/src/parser/classes/ytkids/KidsHomeScreen.ts b/src/parser/classes/ytkids/KidsHomeScreen.ts index 8c5b6f74d..4d68e184a 100644 --- a/src/parser/classes/ytkids/KidsHomeScreen.ts +++ b/src/parser/classes/ytkids/KidsHomeScreen.ts @@ -1,6 +1,6 @@ -import Parser from '../..'; -import type AnchoredSection from './AnchoredSection'; -import { YTNode } from '../../helpers'; +import Parser from '../../index.js'; +import type AnchoredSection from './AnchoredSection.js'; +import { YTNode } from '../../helpers.js'; class KidsHomeScreen extends YTNode { static type = 'kidsHomeScreen'; diff --git a/src/parser/helpers.ts b/src/parser/helpers.ts index 564920d17..42d36af3e 100644 --- a/src/parser/helpers.ts +++ b/src/parser/helpers.ts @@ -1,4 +1,4 @@ -import { deepCompare, ParsingError } from '../utils/Utils'; +import { deepCompare, ParsingError } from '../utils/Utils.js'; const isObserved = Symbol('ObservedArray.isObserved'); diff --git a/src/parser/index.ts b/src/parser/index.ts index cf941545b..790655171 100644 --- a/src/parser/index.ts +++ b/src/parser/index.ts @@ -1,584 +1,9 @@ -import type AudioOnlyPlayability from './classes/AudioOnlyPlayability'; -import type CardCollection from './classes/CardCollection'; -import type Endscreen from './classes/Endscreen'; -import type PlayerAnnotationsExpanded from './classes/PlayerAnnotationsExpanded'; -import type PlayerCaptionsTracklist from './classes/PlayerCaptionsTracklist'; -import type PlayerLiveStoryboardSpec from './classes/PlayerLiveStoryboardSpec'; -import type PlayerStoryboardSpec from './classes/PlayerStoryboardSpec'; -import type Message from './classes/Message'; -import type LiveChatParticipantsList from './classes/LiveChatParticipantsList'; -import type LiveChatHeader from './classes/LiveChatHeader'; -import type LiveChatItemList from './classes/LiveChatItemList'; -import type Alert from './classes/Alert'; - -import MusicMultiSelectMenuItem from './classes/menus/MusicMultiSelectMenuItem'; -import Format from './classes/misc/Format'; -import VideoDetails from './classes/misc/VideoDetails'; -import NavigationEndpoint from './classes/NavigationEndpoint'; -import Thumbnail from './classes/misc/Thumbnail'; - -import { InnertubeError, ParsingError } from '../utils/Utils'; -import { Memo, observe, ObservedArray, SuperParsedResult, YTNode, YTNodeConstructor } from './helpers'; -import GetParserByName from './map'; - -import package_json from '../../package.json'; - -export type ParserError = { classname: string, classdata: any, err: any }; -export type ParserErrorHandler = (error: ParserError) => void; - -export default class Parser { - static #errorHandler: ParserErrorHandler = Parser.#printError; - static #memo: Memo | null = null; - - static setParserErrorHandler(handler: ParserErrorHandler) { - this.#errorHandler = handler; - } - - static #clearMemo() { - Parser.#memo = null; - } - - static #createMemo() { - Parser.#memo = new Memo(); - } - - static #addToMemo(classname: string, result: YTNode) { - if (!Parser.#memo) - return; - - const list = Parser.#memo.get(classname); - if (!list) - return Parser.#memo.set(classname, [ result ]); - - list.push(result); - } - - static #getMemo() { - if (!Parser.#memo) - throw new Error('Parser#getMemo() called before Parser#createMemo()'); - return Parser.#memo; - } - - /** - * Parses InnerTube response. - * @param data - The response data. - */ - static parseResponse(data: any) { - // Memoize the response objects by classname - this.#createMemo(); - // TODO: should this parseItem? - const contents = Parser.parse(data.contents); - const contents_memo = this.#getMemo(); - this.#clearMemo(); - - this.#createMemo(); - const on_response_received_actions = data.onResponseReceivedActions ? Parser.parseRR(data.onResponseReceivedActions) : null; - const on_response_received_actions_memo = this.#getMemo(); - this.#clearMemo(); - - this.#createMemo(); - const on_response_received_endpoints = data.onResponseReceivedEndpoints ? Parser.parseRR(data.onResponseReceivedEndpoints) : null; - const on_response_received_endpoints_memo = this.#getMemo(); - this.#clearMemo(); - - this.#createMemo(); - const on_response_received_commands = data.onResponseReceivedCommands ? Parser.parseRR(data.onResponseReceivedCommands) : null; - const on_response_received_commands_memo = this.#getMemo(); - this.#clearMemo(); - - this.#createMemo(); - const continuation_contents = data.continuationContents ? Parser.parseLC(data.continuationContents) : null; - const continuation_contents_memo = this.#getMemo(); - this.#clearMemo(); - - this.#createMemo(); - const actions = data.actions ? Parser.parseActions(data.actions) : null; - const actions_memo = this.#getMemo(); - this.#clearMemo(); - - this.#createMemo(); - const live_chat_item_context_menu_supported_renderers = data.liveChatItemContextMenuSupportedRenderers - ? Parser.parseItem(data.liveChatItemContextMenuSupportedRenderers) - : null; - const live_chat_item_context_menu_supported_renderers_memo = this.#getMemo(); - this.#clearMemo(); - - this.#createMemo(); - const header = data.header ? Parser.parse(data.header) : null; - const header_memo = this.#getMemo(); - this.#clearMemo(); - - this.#createMemo(); - const sidebar = data.sidebar ? Parser.parseItem(data.sidebar) : null; - const sidebar_memo = this.#getMemo(); - this.#clearMemo(); - - this.applyMutations(contents_memo, data.frameworkUpdates?.entityBatchUpdate?.mutations); - - return { - actions, - actions_memo, - contents, - contents_memo, - header, - header_memo, - sidebar, - sidebar_memo, - live_chat_item_context_menu_supported_renderers, - live_chat_item_context_menu_supported_renderers_memo, - on_response_received_actions, - on_response_received_actions_memo, - on_response_received_endpoints, - on_response_received_endpoints_memo, - on_response_received_commands, - on_response_received_commands_memo, - continuation: data.continuation ? Parser.parseC(data.continuation) : null, - continuation_contents, - continuation_contents_memo, - metadata: Parser.parse(data.metadata), - microformat: data.microformat ? Parser.parseItem(data.microformat) : null, - overlay: Parser.parseItem(data.overlay), - alerts: Parser.parseArray(data.alerts), - refinements: data.refinements || null, - estimated_results: data.estimatedResults ? parseInt(data.estimatedResults) : null, - player_overlays: Parser.parse(data.playerOverlays), - playback_tracking: data.playbackTracking ? { - videostats_watchtime_url: data.playbackTracking.videostatsWatchtimeUrl.baseUrl as string, - videostats_playback_url: data.playbackTracking.videostatsPlaybackUrl.baseUrl as string - } : null, - playability_status: data.playabilityStatus ? { - status: data.playabilityStatus.status as string, - error_screen: Parser.parseItem(data.playabilityStatus.errorScreen), - audio_only_playablility: Parser.parseItem(data.playabilityStatus.audioOnlyPlayability), - embeddable: !!data.playabilityStatus.playableInEmbed || false, - reason: data.playabilityStatus?.reason || '' - } : undefined, - streaming_data: data.streamingData ? { - expires: new Date(Date.now() + parseInt(data.streamingData.expiresInSeconds) * 1000), - formats: Parser.parseFormats(data.streamingData.formats), - adaptive_formats: Parser.parseFormats(data.streamingData.adaptiveFormats), - dash_manifest_url: data.streamingData?.dashManifestUrl as string || null, - hls_manifest_url: data.streamingData?.hlsManifestUrl as string || null - } : undefined, - current_video_endpoint: data.currentVideoEndpoint ? new NavigationEndpoint(data.currentVideoEndpoint) : null, - endpoint: data.endpoint ? new NavigationEndpoint(data.endpoint) : null, - captions: Parser.parseItem(data.captions), - video_details: data.videoDetails ? new VideoDetails(data.videoDetails) : undefined, - annotations: Parser.parseArray(data.annotations), - storyboards: Parser.parseItem(data.storyboards), - endscreen: Parser.parseItem(data.endscreen), - cards: Parser.parseItem(data.cards) - }; - } - - /** - * Parses a single item. - * @param data - The data to parse. - * @param validTypes - YTNode types that are allowed to be parsed. - */ - static parseItem(data: any, validTypes?: YTNodeConstructor | YTNodeConstructor[]) { - if (!data) return null; - - const keys = Object.keys(data); - - if (!keys.length) - return null; - - const classname = this.sanitizeClassName(keys[0]); - - if (!this.shouldIgnore(classname)) { - try { - const TargetClass = GetParserByName(classname); - - if (validTypes) { - if (Array.isArray(validTypes)) { - if (!validTypes.some((type) => type.type === TargetClass.type)) - throw new ParsingError(`Type mismatch, got ${classname} but expected one of ${validTypes.map((type) => type.type).join(', ')}`); - } else if (TargetClass.type !== validTypes.type) - throw new ParsingError(`Type mismatch, got ${classname} but expected ${validTypes.type}`); - } - - const result = new TargetClass(data[keys[0]]); - this.#addToMemo(classname, result); - - return result as T; - } catch (err) { - this.#errorHandler({ classname, classdata: data[keys[0]], err }); - return null; - } - } - - return null; - } - - /** - * Parses an array of items. - * @param data - The data to parse. - * @param validTypes - YTNode types that are allowed to be parsed. - */ - static parseArray(data: any[], validTypes?: YTNodeConstructor | YTNodeConstructor[]) { - if (Array.isArray(data)) { - const results: T[] = []; - - for (const item of data) { - const result = this.parseItem(item, validTypes); - if (result) { - results.push(result); - } - } - - return observe(results); - } else if (!data) { - return observe([] as T[]); - } - throw new ParsingError('Expected array but got a single item'); - } - - /** - * Parses an item or an array of items. - * @param data - The data to parse. - * @param requireArray - Whether the data should be parsed as an array. - * @param validTypes - YTNode types that are allowed to be parsed. - */ - static parse(data: any, requireArray: true, validTypes?: YTNodeConstructor | YTNodeConstructor[]): ObservedArray | null; - static parse(data: any, requireArray?: false | undefined, validTypes?: YTNodeConstructor | YTNodeConstructor[]): SuperParsedResult; - static parse(data: any, requireArray?: boolean, validTypes?: YTNodeConstructor | YTNodeConstructor[]) { - if (!data) return null; - - if (Array.isArray(data)) { - const results: T[] = []; - - for (const item of data) { - const result = this.parseItem(item, validTypes); - if (result) { - results.push(result); - } - } - - const res = observe(results); - - return requireArray ? res : new SuperParsedResult(observe(results)); - } else if (requireArray) { - throw new ParsingError('Expected array but got a single item'); - } - - return new SuperParsedResult(this.parseItem(data, validTypes)); - } - - static parseC(data: any) { - if (data.timedContinuationData) - return new Continuation({ continuation: data.timedContinuationData, type: 'timed' }); - } - - static parseLC(data: any) { - if (data.itemSectionContinuation) - return new ItemSectionContinuation(data.itemSectionContinuation); - if (data.sectionListContinuation) - return new SectionListContinuation(data.sectionListContinuation); - if (data.liveChatContinuation) - return new LiveChatContinuation(data.liveChatContinuation); - if (data.musicPlaylistShelfContinuation) - return new MusicPlaylistShelfContinuation(data.musicPlaylistShelfContinuation); - if (data.musicShelfContinuation) - return new MusicShelfContinuation(data.musicShelfContinuation); - if (data.gridContinuation) - return new GridContinuation(data.gridContinuation); - if (data.playlistPanelContinuation) - return new PlaylistPanelContinuation(data.playlistPanelContinuation); - } - - static parseRR(actions: any[]) { - return observe(actions.map((action: any) => { - if (action.reloadContinuationItemsCommand) - return new ReloadContinuationItemsCommand(action.reloadContinuationItemsCommand); - if (action.appendContinuationItemsAction) - return new AppendContinuationItemsAction(action.appendContinuationItemsAction); - }).filter((item) => item) as (ReloadContinuationItemsCommand | AppendContinuationItemsAction)[]); - } - - static parseActions(data: any) { - if (Array.isArray(data)) { - return Parser.parse(data.map((action) => { - delete action.clickTrackingParams; - return action; - })); - } - return new SuperParsedResult(Parser.parseItem(data)); - } - - static parseFormats(formats: any[]) { - return formats?.map((format) => new Format(format)) || []; - } - - static applyMutations(memo: Memo, mutations: Array) { - // Apply mutations to MusicMultiSelectMenuItems - const music_multi_select_menu_items = memo.getType(MusicMultiSelectMenuItem); - - if (music_multi_select_menu_items.length > 0 && !mutations) { - console.warn( - new InnertubeError( - 'Mutation data required for processing MusicMultiSelectMenuItems, but none found.\n' + - `This is a bug, please report it at ${package_json.bugs.url}` - ) - ); - } else { - const missing_or_invalid_mutations = []; - - for (const menu_item of music_multi_select_menu_items) { - const mutation = mutations - .find((mutation) => mutation.payload?.musicFormBooleanChoice?.id === menu_item.form_item_entity_key); - - const choice = mutation?.payload.musicFormBooleanChoice; - - if (choice?.selected !== undefined && choice?.opaqueToken) { - menu_item.selected = choice.selected; - } else { - missing_or_invalid_mutations.push(`'${menu_item.title}'`); - } - } - if (missing_or_invalid_mutations.length > 0) { - console.warn( - new InnertubeError( - `Mutation data missing or invalid for ${missing_or_invalid_mutations.length} out of ${music_multi_select_menu_items.length} MusicMultiSelectMenuItems. ` + - `The titles of the failed items are: ${missing_or_invalid_mutations.join(', ')}.\n` + - `This is a bug, please report it at ${package_json.bugs.url}` - ) - ); - } - } - } - - static #printError({ classname, classdata, err }: ParserError) { - if (err.code == 'MODULE_NOT_FOUND') { - return console.warn( - new InnertubeError( - `${classname} not found!\n` + - `This is a bug, want to help us fix it? Follow the instructions at ${package_json.homepage.split('#')[0]}/blob/main/docs/updating-the-parser.md or report it at ${package_json.bugs.url}!`, classdata - ) - ); - } - - console.warn( - new InnertubeError( - `Something went wrong at ${classname}!\n` + - `This is a bug, please report it at ${package_json.bugs.url}`, { stack: err.stack } - ) - ); - } - - static sanitizeClassName(input: string) { - return (input.charAt(0).toUpperCase() + input.slice(1)) - .replace(/Renderer|Model/g, '') - .replace(/Radio/g, 'Mix').trim(); - } - - static ignore_list = new Set([ - 'AdSlot', - 'DisplayAd', - 'SearchPyv', - 'MealbarPromo', - 'BackgroundPromo', - 'PromotedSparklesWeb', - 'RunAttestationCommand', - 'CompactPromotedVideo', - 'StatementBanner' - ]); - - static shouldIgnore(classname: string) { - return this.ignore_list.has(classname); - } -} - -export type ParsedResponse = ReturnType; - -// Continuation - -export class ItemSectionContinuation extends YTNode { - static readonly type = 'itemSectionContinuation'; - - contents: ObservedArray | null; - continuation?: string; - - constructor(data: any) { - super(); - this.contents = Parser.parseArray(data.contents); - if (data.continuations) { - this.continuation = data.continuations?.at(0)?.nextContinuationData?.continuation; - } - } -} - -export class AppendContinuationItemsAction extends YTNode { - static readonly type = 'appendContinuationItemsAction'; - - contents: ObservedArray | null; - - constructor(data: any) { - super(); - this.contents = Parser.parse(data.continuationItems, true); - } -} - -export class ReloadContinuationItemsCommand extends YTNode { - static readonly type = 'reloadContinuationItemsCommand'; - - target_id: string; - contents: ObservedArray | null; - slot?: string; - - constructor(data: any) { - super(); - this.target_id = data.targetId; - this.contents = Parser.parse(data.continuationItems, true); - this.slot = data?.slot; - } -} - -export class SectionListContinuation extends YTNode { - static readonly type = 'sectionListContinuation'; - - continuation: string; - contents: ObservedArray | null; - - constructor(data: any) { - super(); - this.contents = Parser.parse(data.contents, true); - this.continuation = - data.continuations?.[0]?.nextContinuationData?.continuation || - data.continuations?.[0]?.reloadContinuationData?.continuation || null; - } -} - -export class MusicPlaylistShelfContinuation extends YTNode { - static readonly type = 'musicPlaylistShelfContinuation'; - - continuation: string; - contents: ObservedArray | null; - - constructor(data: any) { - super(); - this.contents = Parser.parse(data.contents, true); - this.continuation = data.continuations?.[0].nextContinuationData.continuation || null; - } -} - -export class MusicShelfContinuation extends YTNode { - static readonly type = 'musicShelfContinuation'; - - continuation: string; - contents: ObservedArray | null; - - constructor(data: any) { - super(); - this.contents = Parser.parse(data.contents, true); - this.continuation = - data.continuations?.[0].nextContinuationData?.continuation || - data.continuations?.[0].reloadContinuationData?.continuation || null; - } -} - -export class GridContinuation extends YTNode { - static readonly type = 'gridContinuation'; - - continuation: string; - items: ObservedArray | null; - - constructor(data: any) { - super(); - this.items = Parser.parse(data.items, true); - this.continuation = data.continuations?.[0].nextContinuationData.continuation || null; - } - - get contents() { - return this.items; - } -} - -export class PlaylistPanelContinuation extends YTNode { - static readonly type = 'playlistPanelContinuation'; - - continuation: string; - contents: ObservedArray | null; - - constructor(data: any) { - super(); - this.contents = Parser.parse(data.contents, true); - this.continuation = data.continuations?.[0]?.nextContinuationData?.continuation || - data.continuations?.[0]?.nextRadioContinuationData?.continuation || null; - } -} - -export class Continuation extends YTNode { - static readonly type = 'continuation'; - - continuation_type: string; - timeout_ms?: number; - time_until_last_message_ms?: number; - token: string; - - constructor(data: any) { - super(); - this.continuation_type = data.type; - this.timeout_ms = data.continuation?.timeoutMs; - this.time_until_last_message_ms = data.continuation?.timeUntilLastMessageMsec; - this.token = data.continuation?.continuation; - } -} - -export class LiveChatContinuation extends YTNode { - static readonly type = 'liveChatContinuation'; - - actions: ObservedArray; - action_panel: YTNode | null; - item_list: LiveChatItemList | null; - header: LiveChatHeader | null; - participants_list: LiveChatParticipantsList | null; - popout_message: Message | null; - emojis: { - emoji_id: string; - shortcuts: string[]; - search_terms: string[]; - image: Thumbnail[]; - }[]; - continuation: Continuation; - viewer_name: string; - - constructor(data: any) { - super(); - this.actions = Parser.parse(data.actions?.map((action: any) => { - delete action.clickTrackingParams; - return action; - }), true) || observe([]); - - this.action_panel = Parser.parseItem(data.actionPanel); - this.item_list = Parser.parseItem(data.itemList); - this.header = Parser.parseItem(data.header); - this.participants_list = Parser.parseItem(data.participantsList); - this.popout_message = Parser.parseItem(data.popoutMessage); - - this.emojis = data.emojis?.map((emoji: any) => ({ - emoji_id: emoji.emojiId, - shortcuts: emoji.shortcuts, - search_terms: emoji.searchTerms, - image: Thumbnail.fromResponse(emoji.image), - is_custom_emoji: emoji.isCustomEmoji - })) || []; - - let continuation, type; - - if (data.continuations?.[0].timedContinuationData) { - type = 'timed'; - continuation = data.continuations?.[0].timedContinuationData; - } else if (data.continuations?.[0].invalidationContinuationData) { - type = 'invalidation'; - continuation = data.continuations?.[0].invalidationContinuationData; - } else if (data.continuations?.[0].liveChatReplayContinuationData) { - type = 'replay'; - continuation = data.continuations?.[0].liveChatReplayContinuationData; - } - - this.continuation = new Continuation({ continuation, type }); - - this.viewer_name = data.viewerName; - } -} \ No newline at end of file +export { default as Parser } from './parser.js'; +export * from './parser.js'; +export { YTNodes, Misc } from '../parser/map.js'; +export * as YT from './youtube/index.js'; +export * as YTMusic from './ytmusic/index.js'; +export * as YTKids from './ytkids/index.js'; + +import Parser from './parser.js'; +export default Parser; diff --git a/src/parser/map.ts b/src/parser/map.ts index 6b8747ebf..26242c502 100644 --- a/src/parser/map.ts +++ b/src/parser/map.ts @@ -1,325 +1,335 @@ // This file was auto generated, do not edit. // See ./scripts/build-parser-map.js -import { YTNodeConstructor } from './helpers'; +import { YTNodeConstructor } from './helpers.js'; -import { default as AccountChannel } from './classes/AccountChannel'; -import { default as AccountItemSection } from './classes/AccountItemSection'; -import { default as AccountItemSectionHeader } from './classes/AccountItemSectionHeader'; -import { default as AccountSectionList } from './classes/AccountSectionList'; -import { default as AppendContinuationItemsAction } from './classes/actions/AppendContinuationItemsAction'; -import { default as OpenPopupAction } from './classes/actions/OpenPopupAction'; -import { default as Alert } from './classes/Alert'; -import { default as AnalyticsMainAppKeyMetrics } from './classes/analytics/AnalyticsMainAppKeyMetrics'; -import { default as AnalyticsRoot } from './classes/analytics/AnalyticsRoot'; -import { default as AnalyticsShortsCarouselCard } from './classes/analytics/AnalyticsShortsCarouselCard'; -import { default as AnalyticsVideo } from './classes/analytics/AnalyticsVideo'; -import { default as AnalyticsVodCarouselCard } from './classes/analytics/AnalyticsVodCarouselCard'; -import { default as CtaGoToCreatorStudio } from './classes/analytics/CtaGoToCreatorStudio'; -import { default as DataModelSection } from './classes/analytics/DataModelSection'; -import { default as StatRow } from './classes/analytics/StatRow'; -import { default as AudioOnlyPlayability } from './classes/AudioOnlyPlayability'; -import { default as AutomixPreviewVideo } from './classes/AutomixPreviewVideo'; -import { default as BackstageImage } from './classes/BackstageImage'; -import { default as BackstagePost } from './classes/BackstagePost'; -import { default as BackstagePostThread } from './classes/BackstagePostThread'; -import { default as BrowseFeedActions } from './classes/BrowseFeedActions'; -import { default as BrowserMediaSession } from './classes/BrowserMediaSession'; -import { default as Button } from './classes/Button'; -import { default as C4TabbedHeader } from './classes/C4TabbedHeader'; -import { default as CallToActionButton } from './classes/CallToActionButton'; -import { default as Card } from './classes/Card'; -import { default as CardCollection } from './classes/CardCollection'; -import { default as CarouselHeader } from './classes/CarouselHeader'; -import { default as CarouselItem } from './classes/CarouselItem'; -import { default as Channel } from './classes/Channel'; -import { default as ChannelAboutFullMetadata } from './classes/ChannelAboutFullMetadata'; -import { default as ChannelFeaturedContent } from './classes/ChannelFeaturedContent'; -import { default as ChannelHeaderLinks } from './classes/ChannelHeaderLinks'; -import { default as ChannelMetadata } from './classes/ChannelMetadata'; -import { default as ChannelMobileHeader } from './classes/ChannelMobileHeader'; -import { default as ChannelOptions } from './classes/ChannelOptions'; -import { default as ChannelSubMenu } from './classes/ChannelSubMenu'; -import { default as ChannelThumbnailWithLink } from './classes/ChannelThumbnailWithLink'; -import { default as ChannelVideoPlayer } from './classes/ChannelVideoPlayer'; -import { default as Chapter } from './classes/Chapter'; -import { default as ChildVideo } from './classes/ChildVideo'; -import { default as ChipCloud } from './classes/ChipCloud'; -import { default as ChipCloudChip } from './classes/ChipCloudChip'; -import { default as CollaboratorInfoCardContent } from './classes/CollaboratorInfoCardContent'; -import { default as CollageHeroImage } from './classes/CollageHeroImage'; -import { default as AuthorCommentBadge } from './classes/comments/AuthorCommentBadge'; -import { default as Comment } from './classes/comments/Comment'; -import { default as CommentActionButtons } from './classes/comments/CommentActionButtons'; -import { default as CommentDialog } from './classes/comments/CommentDialog'; -import { default as CommentReplies } from './classes/comments/CommentReplies'; -import { default as CommentReplyDialog } from './classes/comments/CommentReplyDialog'; -import { default as CommentsEntryPointHeader } from './classes/comments/CommentsEntryPointHeader'; -import { default as CommentsHeader } from './classes/comments/CommentsHeader'; -import { default as CommentSimplebox } from './classes/comments/CommentSimplebox'; -import { default as CommentThread } from './classes/comments/CommentThread'; -import { default as CreatorHeart } from './classes/comments/CreatorHeart'; -import { default as EmojiPicker } from './classes/comments/EmojiPicker'; -import { default as PdgCommentChip } from './classes/comments/PdgCommentChip'; -import { default as SponsorCommentBadge } from './classes/comments/SponsorCommentBadge'; -import { default as CompactChannel } from './classes/CompactChannel'; -import { default as CompactLink } from './classes/CompactLink'; -import { default as CompactMix } from './classes/CompactMix'; -import { default as CompactPlaylist } from './classes/CompactPlaylist'; -import { default as CompactStation } from './classes/CompactStation'; -import { default as CompactVideo } from './classes/CompactVideo'; -import { default as ConfirmDialog } from './classes/ConfirmDialog'; -import { default as ContinuationItem } from './classes/ContinuationItem'; -import { default as CopyLink } from './classes/CopyLink'; -import { default as CreatePlaylistDialog } from './classes/CreatePlaylistDialog'; -import { default as DecoratedPlayerBar } from './classes/DecoratedPlayerBar'; -import { default as DefaultPromoPanel } from './classes/DefaultPromoPanel'; -import { default as DidYouMean } from './classes/DidYouMean'; -import { default as DownloadButton } from './classes/DownloadButton'; -import { default as Dropdown } from './classes/Dropdown'; -import { default as DropdownItem } from './classes/DropdownItem'; -import { default as Element } from './classes/Element'; -import { default as EmergencyOnebox } from './classes/EmergencyOnebox'; -import { default as EmojiPickerCategory } from './classes/EmojiPickerCategory'; -import { default as EmojiPickerCategoryButton } from './classes/EmojiPickerCategoryButton'; -import { default as EmojiPickerUpsellCategory } from './classes/EmojiPickerUpsellCategory'; -import { default as Endscreen } from './classes/Endscreen'; -import { default as EndscreenElement } from './classes/EndscreenElement'; -import { default as EndScreenPlaylist } from './classes/EndScreenPlaylist'; -import { default as EndScreenVideo } from './classes/EndScreenVideo'; -import { default as ExpandableMetadata } from './classes/ExpandableMetadata'; -import { default as ExpandableTab } from './classes/ExpandableTab'; -import { default as ExpandedShelfContents } from './classes/ExpandedShelfContents'; -import { default as FeedFilterChipBar } from './classes/FeedFilterChipBar'; -import { default as FeedTabbedHeader } from './classes/FeedTabbedHeader'; -import { default as GameCard } from './classes/GameCard'; -import { default as GameDetails } from './classes/GameDetails'; -import { default as Grid } from './classes/Grid'; -import { default as GridChannel } from './classes/GridChannel'; -import { default as GridHeader } from './classes/GridHeader'; -import { default as GridPlaylist } from './classes/GridPlaylist'; -import { default as GridVideo } from './classes/GridVideo'; -import { default as Heatmap } from './classes/Heatmap'; -import { default as HeatMarker } from './classes/HeatMarker'; -import { default as HighlightsCarousel } from './classes/HighlightsCarousel'; -import { default as HistorySuggestion } from './classes/HistorySuggestion'; -import { default as HorizontalCardList } from './classes/HorizontalCardList'; -import { default as HorizontalList } from './classes/HorizontalList'; -import { default as IconLink } from './classes/IconLink'; -import { default as InteractiveTabbedHeader } from './classes/InteractiveTabbedHeader'; -import { default as ItemSection } from './classes/ItemSection'; -import { default as ItemSectionHeader } from './classes/ItemSectionHeader'; -import { default as ItemSectionTab } from './classes/ItemSectionTab'; -import { default as ItemSectionTabbedHeader } from './classes/ItemSectionTabbedHeader'; -import { default as LikeButton } from './classes/LikeButton'; -import { default as LiveChat } from './classes/LiveChat'; -import { default as AddBannerToLiveChatCommand } from './classes/livechat/AddBannerToLiveChatCommand'; -import { default as AddChatItemAction } from './classes/livechat/AddChatItemAction'; -import { default as AddLiveChatTickerItemAction } from './classes/livechat/AddLiveChatTickerItemAction'; -import { default as DimChatItemAction } from './classes/livechat/DimChatItemAction'; -import { default as LiveChatAutoModMessage } from './classes/livechat/items/LiveChatAutoModMessage'; -import { default as LiveChatBanner } from './classes/livechat/items/LiveChatBanner'; -import { default as LiveChatBannerHeader } from './classes/livechat/items/LiveChatBannerHeader'; -import { default as LiveChatBannerPoll } from './classes/livechat/items/LiveChatBannerPoll'; -import { default as LiveChatMembershipItem } from './classes/livechat/items/LiveChatMembershipItem'; -import { default as LiveChatPaidMessage } from './classes/livechat/items/LiveChatPaidMessage'; -import { default as LiveChatPaidSticker } from './classes/livechat/items/LiveChatPaidSticker'; -import { default as LiveChatPlaceholderItem } from './classes/livechat/items/LiveChatPlaceholderItem'; -import { default as LiveChatProductItem } from './classes/livechat/items/LiveChatProductItem'; -import { default as LiveChatRestrictedParticipation } from './classes/livechat/items/LiveChatRestrictedParticipation'; -import { default as LiveChatTextMessage } from './classes/livechat/items/LiveChatTextMessage'; -import { default as LiveChatTickerPaidMessageItem } from './classes/livechat/items/LiveChatTickerPaidMessageItem'; -import { default as LiveChatTickerPaidStickerItem } from './classes/livechat/items/LiveChatTickerPaidStickerItem'; -import { default as LiveChatTickerSponsorItem } from './classes/livechat/items/LiveChatTickerSponsorItem'; -import { default as LiveChatViewerEngagementMessage } from './classes/livechat/items/LiveChatViewerEngagementMessage'; -import { default as PollHeader } from './classes/livechat/items/PollHeader'; -import { default as LiveChatActionPanel } from './classes/livechat/LiveChatActionPanel'; -import { default as MarkChatItemAsDeletedAction } from './classes/livechat/MarkChatItemAsDeletedAction'; -import { default as MarkChatItemsByAuthorAsDeletedAction } from './classes/livechat/MarkChatItemsByAuthorAsDeletedAction'; -import { default as RemoveBannerForLiveChatCommand } from './classes/livechat/RemoveBannerForLiveChatCommand'; -import { default as RemoveChatItemAction } from './classes/livechat/RemoveChatItemAction'; -import { default as RemoveChatItemByAuthorAction } from './classes/livechat/RemoveChatItemByAuthorAction'; -import { default as ReplaceChatItemAction } from './classes/livechat/ReplaceChatItemAction'; -import { default as ReplayChatItemAction } from './classes/livechat/ReplayChatItemAction'; -import { default as ShowLiveChatActionPanelAction } from './classes/livechat/ShowLiveChatActionPanelAction'; -import { default as ShowLiveChatDialogAction } from './classes/livechat/ShowLiveChatDialogAction'; -import { default as ShowLiveChatTooltipCommand } from './classes/livechat/ShowLiveChatTooltipCommand'; -import { default as UpdateDateTextAction } from './classes/livechat/UpdateDateTextAction'; -import { default as UpdateDescriptionAction } from './classes/livechat/UpdateDescriptionAction'; -import { default as UpdateLiveChatPollAction } from './classes/livechat/UpdateLiveChatPollAction'; -import { default as UpdateTitleAction } from './classes/livechat/UpdateTitleAction'; -import { default as UpdateToggleButtonTextAction } from './classes/livechat/UpdateToggleButtonTextAction'; -import { default as UpdateViewershipAction } from './classes/livechat/UpdateViewershipAction'; -import { default as LiveChatAuthorBadge } from './classes/LiveChatAuthorBadge'; -import { default as LiveChatDialog } from './classes/LiveChatDialog'; -import { default as LiveChatHeader } from './classes/LiveChatHeader'; -import { default as LiveChatItemList } from './classes/LiveChatItemList'; -import { default as LiveChatMessageInput } from './classes/LiveChatMessageInput'; -import { default as LiveChatParticipant } from './classes/LiveChatParticipant'; -import { default as LiveChatParticipantsList } from './classes/LiveChatParticipantsList'; -import { default as MacroMarkersListItem } from './classes/MacroMarkersListItem'; -import { default as Menu } from './classes/menus/Menu'; -import { default as MenuNavigationItem } from './classes/menus/MenuNavigationItem'; -import { default as MenuServiceItem } from './classes/menus/MenuServiceItem'; -import { default as MenuServiceItemDownload } from './classes/menus/MenuServiceItemDownload'; -import { default as MultiPageMenu } from './classes/menus/MultiPageMenu'; -import { default as MultiPageMenuNotificationSection } from './classes/menus/MultiPageMenuNotificationSection'; -import { default as MusicMenuItemDivider } from './classes/menus/MusicMenuItemDivider'; -import { default as MusicMultiSelectMenu } from './classes/menus/MusicMultiSelectMenu'; -import { default as MusicMultiSelectMenuItem } from './classes/menus/MusicMultiSelectMenuItem'; -import { default as SimpleMenuHeader } from './classes/menus/SimpleMenuHeader'; -import { default as MerchandiseItem } from './classes/MerchandiseItem'; -import { default as MerchandiseShelf } from './classes/MerchandiseShelf'; -import { default as Message } from './classes/Message'; -import { default as MetadataBadge } from './classes/MetadataBadge'; -import { default as MetadataRow } from './classes/MetadataRow'; -import { default as MetadataRowContainer } from './classes/MetadataRowContainer'; -import { default as MetadataRowHeader } from './classes/MetadataRowHeader'; -import { default as MetadataScreen } from './classes/MetadataScreen'; -import { default as MicroformatData } from './classes/MicroformatData'; -import { default as Mix } from './classes/Mix'; -import { default as Movie } from './classes/Movie'; -import { default as MovingThumbnail } from './classes/MovingThumbnail'; -import { default as MultiMarkersPlayerBar } from './classes/MultiMarkersPlayerBar'; -import { default as MusicCarouselShelf } from './classes/MusicCarouselShelf'; -import { default as MusicCarouselShelfBasicHeader } from './classes/MusicCarouselShelfBasicHeader'; -import { default as MusicDescriptionShelf } from './classes/MusicDescriptionShelf'; -import { default as MusicDetailHeader } from './classes/MusicDetailHeader'; -import { default as MusicDownloadStateBadge } from './classes/MusicDownloadStateBadge'; -import { default as MusicEditablePlaylistDetailHeader } from './classes/MusicEditablePlaylistDetailHeader'; -import { default as MusicElementHeader } from './classes/MusicElementHeader'; -import { default as MusicHeader } from './classes/MusicHeader'; -import { default as MusicImmersiveHeader } from './classes/MusicImmersiveHeader'; -import { default as MusicInlineBadge } from './classes/MusicInlineBadge'; -import { default as MusicItemThumbnailOverlay } from './classes/MusicItemThumbnailOverlay'; -import { default as MusicLargeCardItemCarousel } from './classes/MusicLargeCardItemCarousel'; -import { default as MusicNavigationButton } from './classes/MusicNavigationButton'; -import { default as MusicPlayButton } from './classes/MusicPlayButton'; -import { default as MusicPlaylistShelf } from './classes/MusicPlaylistShelf'; -import { default as MusicQueue } from './classes/MusicQueue'; -import { default as MusicResponsiveListItem } from './classes/MusicResponsiveListItem'; -import { default as MusicResponsiveListItemFixedColumn } from './classes/MusicResponsiveListItemFixedColumn'; -import { default as MusicResponsiveListItemFlexColumn } from './classes/MusicResponsiveListItemFlexColumn'; -import { default as MusicShelf } from './classes/MusicShelf'; -import { default as MusicSideAlignedItem } from './classes/MusicSideAlignedItem'; -import { default as MusicSortFilterButton } from './classes/MusicSortFilterButton'; -import { default as MusicThumbnail } from './classes/MusicThumbnail'; -import { default as MusicTwoRowItem } from './classes/MusicTwoRowItem'; -import { default as MusicVisualHeader } from './classes/MusicVisualHeader'; -import { default as NavigationEndpoint } from './classes/NavigationEndpoint'; -import { default as Notification } from './classes/Notification'; -import { default as PageIntroduction } from './classes/PageIntroduction'; -import { default as PlayerAnnotationsExpanded } from './classes/PlayerAnnotationsExpanded'; -import { default as PlayerCaptionsTracklist } from './classes/PlayerCaptionsTracklist'; -import { default as PlayerErrorMessage } from './classes/PlayerErrorMessage'; -import { default as PlayerLiveStoryboardSpec } from './classes/PlayerLiveStoryboardSpec'; -import { default as PlayerMicroformat } from './classes/PlayerMicroformat'; -import { default as PlayerOverlay } from './classes/PlayerOverlay'; -import { default as PlayerOverlayAutoplay } from './classes/PlayerOverlayAutoplay'; -import { default as PlayerStoryboardSpec } from './classes/PlayerStoryboardSpec'; -import { default as Playlist } from './classes/Playlist'; -import { default as PlaylistCustomThumbnail } from './classes/PlaylistCustomThumbnail'; -import { default as PlaylistHeader } from './classes/PlaylistHeader'; -import { default as PlaylistInfoCardContent } from './classes/PlaylistInfoCardContent'; -import { default as PlaylistMetadata } from './classes/PlaylistMetadata'; -import { default as PlaylistPanel } from './classes/PlaylistPanel'; -import { default as PlaylistPanelVideo } from './classes/PlaylistPanelVideo'; -import { default as PlaylistPanelVideoWrapper } from './classes/PlaylistPanelVideoWrapper'; -import { default as PlaylistSidebar } from './classes/PlaylistSidebar'; -import { default as PlaylistSidebarPrimaryInfo } from './classes/PlaylistSidebarPrimaryInfo'; -import { default as PlaylistSidebarSecondaryInfo } from './classes/PlaylistSidebarSecondaryInfo'; -import { default as PlaylistVideo } from './classes/PlaylistVideo'; -import { default as PlaylistVideoList } from './classes/PlaylistVideoList'; -import { default as PlaylistVideoThumbnail } from './classes/PlaylistVideoThumbnail'; -import { default as Poll } from './classes/Poll'; -import { default as Post } from './classes/Post'; -import { default as PostMultiImage } from './classes/PostMultiImage'; -import { default as ProfileColumn } from './classes/ProfileColumn'; -import { default as ProfileColumnStats } from './classes/ProfileColumnStats'; -import { default as ProfileColumnStatsEntry } from './classes/ProfileColumnStatsEntry'; -import { default as ProfileColumnUserInfo } from './classes/ProfileColumnUserInfo'; -import { default as RecognitionShelf } from './classes/RecognitionShelf'; -import { default as ReelItem } from './classes/ReelItem'; -import { default as ReelShelf } from './classes/ReelShelf'; -import { default as RelatedChipCloud } from './classes/RelatedChipCloud'; -import { default as RichGrid } from './classes/RichGrid'; -import { default as RichItem } from './classes/RichItem'; -import { default as RichListHeader } from './classes/RichListHeader'; -import { default as RichSection } from './classes/RichSection'; -import { default as RichShelf } from './classes/RichShelf'; -import { default as SearchBox } from './classes/SearchBox'; -import { default as SearchRefinementCard } from './classes/SearchRefinementCard'; -import { default as SearchSuggestion } from './classes/SearchSuggestion'; -import { default as SearchSuggestionsSection } from './classes/SearchSuggestionsSection'; -import { default as SecondarySearchContainer } from './classes/SecondarySearchContainer'; -import { default as SectionList } from './classes/SectionList'; -import { default as SegmentedLikeDislikeButton } from './classes/SegmentedLikeDislikeButton'; -import { default as SettingBoolean } from './classes/SettingBoolean'; -import { default as SettingsCheckbox } from './classes/SettingsCheckbox'; -import { default as SettingsOptions } from './classes/SettingsOptions'; -import { default as SettingsSidebar } from './classes/SettingsSidebar'; -import { default as SettingsSwitch } from './classes/SettingsSwitch'; -import { default as Shelf } from './classes/Shelf'; -import { default as ShowingResultsFor } from './classes/ShowingResultsFor'; -import { default as SimpleCardContent } from './classes/SimpleCardContent'; -import { default as SimpleCardTeaser } from './classes/SimpleCardTeaser'; -import { default as SimpleTextSection } from './classes/SimpleTextSection'; -import { default as SingleActionEmergencySupport } from './classes/SingleActionEmergencySupport'; -import { default as SingleColumnBrowseResults } from './classes/SingleColumnBrowseResults'; -import { default as SingleColumnMusicWatchNextResults } from './classes/SingleColumnMusicWatchNextResults'; -import { default as SingleHeroImage } from './classes/SingleHeroImage'; -import { default as SlimOwner } from './classes/SlimOwner'; -import { default as SlimVideoMetadata } from './classes/SlimVideoMetadata'; -import { default as SortFilterSubMenu } from './classes/SortFilterSubMenu'; -import { default as SubFeedOption } from './classes/SubFeedOption'; -import { default as SubFeedSelector } from './classes/SubFeedSelector'; -import { default as SubscribeButton } from './classes/SubscribeButton'; -import { default as SubscriptionNotificationToggleButton } from './classes/SubscriptionNotificationToggleButton'; -import { default as Tab } from './classes/Tab'; -import { default as Tabbed } from './classes/Tabbed'; -import { default as TabbedSearchResults } from './classes/TabbedSearchResults'; -import { default as TextHeader } from './classes/TextHeader'; -import { default as ThumbnailLandscapePortrait } from './classes/ThumbnailLandscapePortrait'; -import { default as ThumbnailOverlayBottomPanel } from './classes/ThumbnailOverlayBottomPanel'; -import { default as ThumbnailOverlayEndorsement } from './classes/ThumbnailOverlayEndorsement'; -import { default as ThumbnailOverlayHoverText } from './classes/ThumbnailOverlayHoverText'; -import { default as ThumbnailOverlayInlineUnplayable } from './classes/ThumbnailOverlayInlineUnplayable'; -import { default as ThumbnailOverlayLoadingPreview } from './classes/ThumbnailOverlayLoadingPreview'; -import { default as ThumbnailOverlayNowPlaying } from './classes/ThumbnailOverlayNowPlaying'; -import { default as ThumbnailOverlayPinking } from './classes/ThumbnailOverlayPinking'; -import { default as ThumbnailOverlayPlaybackStatus } from './classes/ThumbnailOverlayPlaybackStatus'; -import { default as ThumbnailOverlayResumePlayback } from './classes/ThumbnailOverlayResumePlayback'; -import { default as ThumbnailOverlaySidePanel } from './classes/ThumbnailOverlaySidePanel'; -import { default as ThumbnailOverlayTimeStatus } from './classes/ThumbnailOverlayTimeStatus'; -import { default as ThumbnailOverlayToggleButton } from './classes/ThumbnailOverlayToggleButton'; -import { default as TimedMarkerDecoration } from './classes/TimedMarkerDecoration'; -import { default as TitleAndButtonListHeader } from './classes/TitleAndButtonListHeader'; -import { default as ToggleButton } from './classes/ToggleButton'; -import { default as ToggleMenuServiceItem } from './classes/ToggleMenuServiceItem'; -import { default as Tooltip } from './classes/Tooltip'; -import { default as TopicChannelDetails } from './classes/TopicChannelDetails'; -import { default as TwoColumnBrowseResults } from './classes/TwoColumnBrowseResults'; -import { default as TwoColumnSearchResults } from './classes/TwoColumnSearchResults'; -import { default as TwoColumnWatchNextResults } from './classes/TwoColumnWatchNextResults'; -import { default as UniversalWatchCard } from './classes/UniversalWatchCard'; -import { default as UpsellDialog } from './classes/UpsellDialog'; -import { default as VerticalList } from './classes/VerticalList'; -import { default as VerticalWatchCardList } from './classes/VerticalWatchCardList'; -import { default as Video } from './classes/Video'; -import { default as VideoCard } from './classes/VideoCard'; -import { default as VideoInfoCardContent } from './classes/VideoInfoCardContent'; -import { default as VideoOwner } from './classes/VideoOwner'; -import { default as VideoPrimaryInfo } from './classes/VideoPrimaryInfo'; -import { default as VideoSecondaryInfo } from './classes/VideoSecondaryInfo'; -import { default as WatchCardCompactVideo } from './classes/WatchCardCompactVideo'; -import { default as WatchCardHeroVideo } from './classes/WatchCardHeroVideo'; -import { default as WatchCardRichHeader } from './classes/WatchCardRichHeader'; -import { default as WatchCardSectionSequence } from './classes/WatchCardSectionSequence'; -import { default as WatchNextEndScreen } from './classes/WatchNextEndScreen'; -import { default as WatchNextTabbedResults } from './classes/WatchNextTabbedResults'; -import { default as AnchoredSection } from './classes/ytkids/AnchoredSection'; -import { default as KidsCategoriesHeader } from './classes/ytkids/KidsCategoriesHeader'; -import { default as KidsCategoryTab } from './classes/ytkids/KidsCategoryTab'; -import { default as KidsHomeScreen } from './classes/ytkids/KidsHomeScreen'; +import { default as AccountChannel } from './classes/AccountChannel.js'; +import { default as AccountItemSection } from './classes/AccountItemSection.js'; +import { default as AccountItemSectionHeader } from './classes/AccountItemSectionHeader.js'; +import { default as AccountSectionList } from './classes/AccountSectionList.js'; +import { default as AppendContinuationItemsAction } from './classes/actions/AppendContinuationItemsAction.js'; +import { default as OpenPopupAction } from './classes/actions/OpenPopupAction.js'; +import { default as Alert } from './classes/Alert.js'; +import { default as AnalyticsMainAppKeyMetrics } from './classes/analytics/AnalyticsMainAppKeyMetrics.js'; +import { default as AnalyticsRoot } from './classes/analytics/AnalyticsRoot.js'; +import { default as AnalyticsShortsCarouselCard } from './classes/analytics/AnalyticsShortsCarouselCard.js'; +import { default as AnalyticsVideo } from './classes/analytics/AnalyticsVideo.js'; +import { default as AnalyticsVodCarouselCard } from './classes/analytics/AnalyticsVodCarouselCard.js'; +import { default as CtaGoToCreatorStudio } from './classes/analytics/CtaGoToCreatorStudio.js'; +import { default as DataModelSection } from './classes/analytics/DataModelSection.js'; +import { default as StatRow } from './classes/analytics/StatRow.js'; +import { default as AudioOnlyPlayability } from './classes/AudioOnlyPlayability.js'; +import { default as AutomixPreviewVideo } from './classes/AutomixPreviewVideo.js'; +import { default as BackstageImage } from './classes/BackstageImage.js'; +import { default as BackstagePost } from './classes/BackstagePost.js'; +import { default as BackstagePostThread } from './classes/BackstagePostThread.js'; +import { default as BrowseFeedActions } from './classes/BrowseFeedActions.js'; +import { default as BrowserMediaSession } from './classes/BrowserMediaSession.js'; +import { default as Button } from './classes/Button.js'; +import { default as C4TabbedHeader } from './classes/C4TabbedHeader.js'; +import { default as CallToActionButton } from './classes/CallToActionButton.js'; +import { default as Card } from './classes/Card.js'; +import { default as CardCollection } from './classes/CardCollection.js'; +import { default as CarouselHeader } from './classes/CarouselHeader.js'; +import { default as CarouselItem } from './classes/CarouselItem.js'; +import { default as Channel } from './classes/Channel.js'; +import { default as ChannelAboutFullMetadata } from './classes/ChannelAboutFullMetadata.js'; +import { default as ChannelFeaturedContent } from './classes/ChannelFeaturedContent.js'; +import { default as ChannelHeaderLinks } from './classes/ChannelHeaderLinks.js'; +import { default as ChannelMetadata } from './classes/ChannelMetadata.js'; +import { default as ChannelMobileHeader } from './classes/ChannelMobileHeader.js'; +import { default as ChannelOptions } from './classes/ChannelOptions.js'; +import { default as ChannelSubMenu } from './classes/ChannelSubMenu.js'; +import { default as ChannelThumbnailWithLink } from './classes/ChannelThumbnailWithLink.js'; +import { default as ChannelVideoPlayer } from './classes/ChannelVideoPlayer.js'; +import { default as Chapter } from './classes/Chapter.js'; +import { default as ChildVideo } from './classes/ChildVideo.js'; +import { default as ChipCloud } from './classes/ChipCloud.js'; +import { default as ChipCloudChip } from './classes/ChipCloudChip.js'; +import { default as CollaboratorInfoCardContent } from './classes/CollaboratorInfoCardContent.js'; +import { default as CollageHeroImage } from './classes/CollageHeroImage.js'; +import { default as AuthorCommentBadge } from './classes/comments/AuthorCommentBadge.js'; +import { default as Comment } from './classes/comments/Comment.js'; +import { default as CommentActionButtons } from './classes/comments/CommentActionButtons.js'; +import { default as CommentDialog } from './classes/comments/CommentDialog.js'; +import { default as CommentReplies } from './classes/comments/CommentReplies.js'; +import { default as CommentReplyDialog } from './classes/comments/CommentReplyDialog.js'; +import { default as CommentsEntryPointHeader } from './classes/comments/CommentsEntryPointHeader.js'; +import { default as CommentsHeader } from './classes/comments/CommentsHeader.js'; +import { default as CommentSimplebox } from './classes/comments/CommentSimplebox.js'; +import { default as CommentThread } from './classes/comments/CommentThread.js'; +import { default as CreatorHeart } from './classes/comments/CreatorHeart.js'; +import { default as EmojiPicker } from './classes/comments/EmojiPicker.js'; +import { default as PdgCommentChip } from './classes/comments/PdgCommentChip.js'; +import { default as SponsorCommentBadge } from './classes/comments/SponsorCommentBadge.js'; +import { default as CompactChannel } from './classes/CompactChannel.js'; +import { default as CompactLink } from './classes/CompactLink.js'; +import { default as CompactMix } from './classes/CompactMix.js'; +import { default as CompactPlaylist } from './classes/CompactPlaylist.js'; +import { default as CompactStation } from './classes/CompactStation.js'; +import { default as CompactVideo } from './classes/CompactVideo.js'; +import { default as ConfirmDialog } from './classes/ConfirmDialog.js'; +import { default as ContinuationItem } from './classes/ContinuationItem.js'; +import { default as CopyLink } from './classes/CopyLink.js'; +import { default as CreatePlaylistDialog } from './classes/CreatePlaylistDialog.js'; +import { default as DecoratedPlayerBar } from './classes/DecoratedPlayerBar.js'; +import { default as DefaultPromoPanel } from './classes/DefaultPromoPanel.js'; +import { default as DidYouMean } from './classes/DidYouMean.js'; +import { default as DownloadButton } from './classes/DownloadButton.js'; +import { default as Dropdown } from './classes/Dropdown.js'; +import { default as DropdownItem } from './classes/DropdownItem.js'; +import { default as Element } from './classes/Element.js'; +import { default as EmergencyOnebox } from './classes/EmergencyOnebox.js'; +import { default as EmojiPickerCategory } from './classes/EmojiPickerCategory.js'; +import { default as EmojiPickerCategoryButton } from './classes/EmojiPickerCategoryButton.js'; +import { default as EmojiPickerUpsellCategory } from './classes/EmojiPickerUpsellCategory.js'; +import { default as Endscreen } from './classes/Endscreen.js'; +import { default as EndscreenElement } from './classes/EndscreenElement.js'; +import { default as EndScreenPlaylist } from './classes/EndScreenPlaylist.js'; +import { default as EndScreenVideo } from './classes/EndScreenVideo.js'; +import { default as ExpandableMetadata } from './classes/ExpandableMetadata.js'; +import { default as ExpandableTab } from './classes/ExpandableTab.js'; +import { default as ExpandedShelfContents } from './classes/ExpandedShelfContents.js'; +import { default as FeedFilterChipBar } from './classes/FeedFilterChipBar.js'; +import { default as FeedTabbedHeader } from './classes/FeedTabbedHeader.js'; +import { default as GameCard } from './classes/GameCard.js'; +import { default as GameDetails } from './classes/GameDetails.js'; +import { default as Grid } from './classes/Grid.js'; +import { default as GridChannel } from './classes/GridChannel.js'; +import { default as GridHeader } from './classes/GridHeader.js'; +import { default as GridPlaylist } from './classes/GridPlaylist.js'; +import { default as GridVideo } from './classes/GridVideo.js'; +import { default as Heatmap } from './classes/Heatmap.js'; +import { default as HeatMarker } from './classes/HeatMarker.js'; +import { default as HighlightsCarousel } from './classes/HighlightsCarousel.js'; +import { default as HistorySuggestion } from './classes/HistorySuggestion.js'; +import { default as HorizontalCardList } from './classes/HorizontalCardList.js'; +import { default as HorizontalList } from './classes/HorizontalList.js'; +import { default as IconLink } from './classes/IconLink.js'; +import { default as InteractiveTabbedHeader } from './classes/InteractiveTabbedHeader.js'; +import { default as ItemSection } from './classes/ItemSection.js'; +import { default as ItemSectionHeader } from './classes/ItemSectionHeader.js'; +import { default as ItemSectionTab } from './classes/ItemSectionTab.js'; +import { default as ItemSectionTabbedHeader } from './classes/ItemSectionTabbedHeader.js'; +import { default as LikeButton } from './classes/LikeButton.js'; +import { default as LiveChat } from './classes/LiveChat.js'; +import { default as AddBannerToLiveChatCommand } from './classes/livechat/AddBannerToLiveChatCommand.js'; +import { default as AddChatItemAction } from './classes/livechat/AddChatItemAction.js'; +import { default as AddLiveChatTickerItemAction } from './classes/livechat/AddLiveChatTickerItemAction.js'; +import { default as DimChatItemAction } from './classes/livechat/DimChatItemAction.js'; +import { default as LiveChatAutoModMessage } from './classes/livechat/items/LiveChatAutoModMessage.js'; +import { default as LiveChatBanner } from './classes/livechat/items/LiveChatBanner.js'; +import { default as LiveChatBannerHeader } from './classes/livechat/items/LiveChatBannerHeader.js'; +import { default as LiveChatBannerPoll } from './classes/livechat/items/LiveChatBannerPoll.js'; +import { default as LiveChatMembershipItem } from './classes/livechat/items/LiveChatMembershipItem.js'; +import { default as LiveChatPaidMessage } from './classes/livechat/items/LiveChatPaidMessage.js'; +import { default as LiveChatPaidSticker } from './classes/livechat/items/LiveChatPaidSticker.js'; +import { default as LiveChatPlaceholderItem } from './classes/livechat/items/LiveChatPlaceholderItem.js'; +import { default as LiveChatProductItem } from './classes/livechat/items/LiveChatProductItem.js'; +import { default as LiveChatRestrictedParticipation } from './classes/livechat/items/LiveChatRestrictedParticipation.js'; +import { default as LiveChatTextMessage } from './classes/livechat/items/LiveChatTextMessage.js'; +import { default as LiveChatTickerPaidMessageItem } from './classes/livechat/items/LiveChatTickerPaidMessageItem.js'; +import { default as LiveChatTickerPaidStickerItem } from './classes/livechat/items/LiveChatTickerPaidStickerItem.js'; +import { default as LiveChatTickerSponsorItem } from './classes/livechat/items/LiveChatTickerSponsorItem.js'; +import { default as LiveChatViewerEngagementMessage } from './classes/livechat/items/LiveChatViewerEngagementMessage.js'; +import { default as PollHeader } from './classes/livechat/items/PollHeader.js'; +import { default as LiveChatActionPanel } from './classes/livechat/LiveChatActionPanel.js'; +import { default as MarkChatItemAsDeletedAction } from './classes/livechat/MarkChatItemAsDeletedAction.js'; +import { default as MarkChatItemsByAuthorAsDeletedAction } from './classes/livechat/MarkChatItemsByAuthorAsDeletedAction.js'; +import { default as RemoveBannerForLiveChatCommand } from './classes/livechat/RemoveBannerForLiveChatCommand.js'; +import { default as RemoveChatItemAction } from './classes/livechat/RemoveChatItemAction.js'; +import { default as RemoveChatItemByAuthorAction } from './classes/livechat/RemoveChatItemByAuthorAction.js'; +import { default as ReplaceChatItemAction } from './classes/livechat/ReplaceChatItemAction.js'; +import { default as ReplayChatItemAction } from './classes/livechat/ReplayChatItemAction.js'; +import { default as ShowLiveChatActionPanelAction } from './classes/livechat/ShowLiveChatActionPanelAction.js'; +import { default as ShowLiveChatDialogAction } from './classes/livechat/ShowLiveChatDialogAction.js'; +import { default as ShowLiveChatTooltipCommand } from './classes/livechat/ShowLiveChatTooltipCommand.js'; +import { default as UpdateDateTextAction } from './classes/livechat/UpdateDateTextAction.js'; +import { default as UpdateDescriptionAction } from './classes/livechat/UpdateDescriptionAction.js'; +import { default as UpdateLiveChatPollAction } from './classes/livechat/UpdateLiveChatPollAction.js'; +import { default as UpdateTitleAction } from './classes/livechat/UpdateTitleAction.js'; +import { default as UpdateToggleButtonTextAction } from './classes/livechat/UpdateToggleButtonTextAction.js'; +import { default as UpdateViewershipAction } from './classes/livechat/UpdateViewershipAction.js'; +import { default as LiveChatAuthorBadge } from './classes/LiveChatAuthorBadge.js'; +import { default as LiveChatDialog } from './classes/LiveChatDialog.js'; +import { default as LiveChatHeader } from './classes/LiveChatHeader.js'; +import { default as LiveChatItemList } from './classes/LiveChatItemList.js'; +import { default as LiveChatMessageInput } from './classes/LiveChatMessageInput.js'; +import { default as LiveChatParticipant } from './classes/LiveChatParticipant.js'; +import { default as LiveChatParticipantsList } from './classes/LiveChatParticipantsList.js'; +import { default as MacroMarkersListItem } from './classes/MacroMarkersListItem.js'; +import { default as Menu } from './classes/menus/Menu.js'; +import { default as MenuNavigationItem } from './classes/menus/MenuNavigationItem.js'; +import { default as MenuServiceItem } from './classes/menus/MenuServiceItem.js'; +import { default as MenuServiceItemDownload } from './classes/menus/MenuServiceItemDownload.js'; +import { default as MultiPageMenu } from './classes/menus/MultiPageMenu.js'; +import { default as MultiPageMenuNotificationSection } from './classes/menus/MultiPageMenuNotificationSection.js'; +import { default as MusicMenuItemDivider } from './classes/menus/MusicMenuItemDivider.js'; +import { default as MusicMultiSelectMenu } from './classes/menus/MusicMultiSelectMenu.js'; +import { default as MusicMultiSelectMenuItem } from './classes/menus/MusicMultiSelectMenuItem.js'; +import { default as SimpleMenuHeader } from './classes/menus/SimpleMenuHeader.js'; +import { default as MerchandiseItem } from './classes/MerchandiseItem.js'; +import { default as MerchandiseShelf } from './classes/MerchandiseShelf.js'; +import { default as Message } from './classes/Message.js'; +import { default as MetadataBadge } from './classes/MetadataBadge.js'; +import { default as MetadataRow } from './classes/MetadataRow.js'; +import { default as MetadataRowContainer } from './classes/MetadataRowContainer.js'; +import { default as MetadataRowHeader } from './classes/MetadataRowHeader.js'; +import { default as MetadataScreen } from './classes/MetadataScreen.js'; +import { default as MicroformatData } from './classes/MicroformatData.js'; +import { default as Author } from './classes/misc/Author.js'; +import { default as ChildElement } from './classes/misc/ChildElement.js'; +import { default as EmojiRun } from './classes/misc/EmojiRun.js'; +import { default as Format } from './classes/misc/Format.js'; +import { default as NavigatableText } from './classes/misc/NavigatableText.js'; +import { default as PlaylistAuthor } from './classes/misc/PlaylistAuthor.js'; +import { default as Text } from './classes/misc/Text.js'; +import { default as TextRun } from './classes/misc/TextRun.js'; +import { default as Thumbnail } from './classes/misc/Thumbnail.js'; +import { default as VideoDetails } from './classes/misc/VideoDetails.js'; +import { default as Mix } from './classes/Mix.js'; +import { default as Movie } from './classes/Movie.js'; +import { default as MovingThumbnail } from './classes/MovingThumbnail.js'; +import { default as MultiMarkersPlayerBar } from './classes/MultiMarkersPlayerBar.js'; +import { default as MusicCarouselShelf } from './classes/MusicCarouselShelf.js'; +import { default as MusicCarouselShelfBasicHeader } from './classes/MusicCarouselShelfBasicHeader.js'; +import { default as MusicDescriptionShelf } from './classes/MusicDescriptionShelf.js'; +import { default as MusicDetailHeader } from './classes/MusicDetailHeader.js'; +import { default as MusicDownloadStateBadge } from './classes/MusicDownloadStateBadge.js'; +import { default as MusicEditablePlaylistDetailHeader } from './classes/MusicEditablePlaylistDetailHeader.js'; +import { default as MusicElementHeader } from './classes/MusicElementHeader.js'; +import { default as MusicHeader } from './classes/MusicHeader.js'; +import { default as MusicImmersiveHeader } from './classes/MusicImmersiveHeader.js'; +import { default as MusicInlineBadge } from './classes/MusicInlineBadge.js'; +import { default as MusicItemThumbnailOverlay } from './classes/MusicItemThumbnailOverlay.js'; +import { default as MusicLargeCardItemCarousel } from './classes/MusicLargeCardItemCarousel.js'; +import { default as MusicNavigationButton } from './classes/MusicNavigationButton.js'; +import { default as MusicPlayButton } from './classes/MusicPlayButton.js'; +import { default as MusicPlaylistShelf } from './classes/MusicPlaylistShelf.js'; +import { default as MusicQueue } from './classes/MusicQueue.js'; +import { default as MusicResponsiveListItem } from './classes/MusicResponsiveListItem.js'; +import { default as MusicResponsiveListItemFixedColumn } from './classes/MusicResponsiveListItemFixedColumn.js'; +import { default as MusicResponsiveListItemFlexColumn } from './classes/MusicResponsiveListItemFlexColumn.js'; +import { default as MusicShelf } from './classes/MusicShelf.js'; +import { default as MusicSideAlignedItem } from './classes/MusicSideAlignedItem.js'; +import { default as MusicSortFilterButton } from './classes/MusicSortFilterButton.js'; +import { default as MusicThumbnail } from './classes/MusicThumbnail.js'; +import { default as MusicTwoRowItem } from './classes/MusicTwoRowItem.js'; +import { default as MusicVisualHeader } from './classes/MusicVisualHeader.js'; +import { default as NavigationEndpoint } from './classes/NavigationEndpoint.js'; +import { default as Notification } from './classes/Notification.js'; +import { default as PageIntroduction } from './classes/PageIntroduction.js'; +import { default as PlayerAnnotationsExpanded } from './classes/PlayerAnnotationsExpanded.js'; +import { default as PlayerCaptionsTracklist } from './classes/PlayerCaptionsTracklist.js'; +import { default as PlayerErrorMessage } from './classes/PlayerErrorMessage.js'; +import { default as PlayerLiveStoryboardSpec } from './classes/PlayerLiveStoryboardSpec.js'; +import { default as PlayerMicroformat } from './classes/PlayerMicroformat.js'; +import { default as PlayerOverlay } from './classes/PlayerOverlay.js'; +import { default as PlayerOverlayAutoplay } from './classes/PlayerOverlayAutoplay.js'; +import { default as PlayerStoryboardSpec } from './classes/PlayerStoryboardSpec.js'; +import { default as Playlist } from './classes/Playlist.js'; +import { default as PlaylistCustomThumbnail } from './classes/PlaylistCustomThumbnail.js'; +import { default as PlaylistHeader } from './classes/PlaylistHeader.js'; +import { default as PlaylistInfoCardContent } from './classes/PlaylistInfoCardContent.js'; +import { default as PlaylistMetadata } from './classes/PlaylistMetadata.js'; +import { default as PlaylistPanel } from './classes/PlaylistPanel.js'; +import { default as PlaylistPanelVideo } from './classes/PlaylistPanelVideo.js'; +import { default as PlaylistPanelVideoWrapper } from './classes/PlaylistPanelVideoWrapper.js'; +import { default as PlaylistSidebar } from './classes/PlaylistSidebar.js'; +import { default as PlaylistSidebarPrimaryInfo } from './classes/PlaylistSidebarPrimaryInfo.js'; +import { default as PlaylistSidebarSecondaryInfo } from './classes/PlaylistSidebarSecondaryInfo.js'; +import { default as PlaylistVideo } from './classes/PlaylistVideo.js'; +import { default as PlaylistVideoList } from './classes/PlaylistVideoList.js'; +import { default as PlaylistVideoThumbnail } from './classes/PlaylistVideoThumbnail.js'; +import { default as Poll } from './classes/Poll.js'; +import { default as Post } from './classes/Post.js'; +import { default as PostMultiImage } from './classes/PostMultiImage.js'; +import { default as ProfileColumn } from './classes/ProfileColumn.js'; +import { default as ProfileColumnStats } from './classes/ProfileColumnStats.js'; +import { default as ProfileColumnStatsEntry } from './classes/ProfileColumnStatsEntry.js'; +import { default as ProfileColumnUserInfo } from './classes/ProfileColumnUserInfo.js'; +import { default as RecognitionShelf } from './classes/RecognitionShelf.js'; +import { default as ReelItem } from './classes/ReelItem.js'; +import { default as ReelShelf } from './classes/ReelShelf.js'; +import { default as RelatedChipCloud } from './classes/RelatedChipCloud.js'; +import { default as RichGrid } from './classes/RichGrid.js'; +import { default as RichItem } from './classes/RichItem.js'; +import { default as RichListHeader } from './classes/RichListHeader.js'; +import { default as RichSection } from './classes/RichSection.js'; +import { default as RichShelf } from './classes/RichShelf.js'; +import { default as SearchBox } from './classes/SearchBox.js'; +import { default as SearchRefinementCard } from './classes/SearchRefinementCard.js'; +import { default as SearchSuggestion } from './classes/SearchSuggestion.js'; +import { default as SearchSuggestionsSection } from './classes/SearchSuggestionsSection.js'; +import { default as SecondarySearchContainer } from './classes/SecondarySearchContainer.js'; +import { default as SectionList } from './classes/SectionList.js'; +import { default as SegmentedLikeDislikeButton } from './classes/SegmentedLikeDislikeButton.js'; +import { default as SettingBoolean } from './classes/SettingBoolean.js'; +import { default as SettingsCheckbox } from './classes/SettingsCheckbox.js'; +import { default as SettingsOptions } from './classes/SettingsOptions.js'; +import { default as SettingsSidebar } from './classes/SettingsSidebar.js'; +import { default as SettingsSwitch } from './classes/SettingsSwitch.js'; +import { default as Shelf } from './classes/Shelf.js'; +import { default as ShowingResultsFor } from './classes/ShowingResultsFor.js'; +import { default as SimpleCardContent } from './classes/SimpleCardContent.js'; +import { default as SimpleCardTeaser } from './classes/SimpleCardTeaser.js'; +import { default as SimpleTextSection } from './classes/SimpleTextSection.js'; +import { default as SingleActionEmergencySupport } from './classes/SingleActionEmergencySupport.js'; +import { default as SingleColumnBrowseResults } from './classes/SingleColumnBrowseResults.js'; +import { default as SingleColumnMusicWatchNextResults } from './classes/SingleColumnMusicWatchNextResults.js'; +import { default as SingleHeroImage } from './classes/SingleHeroImage.js'; +import { default as SlimOwner } from './classes/SlimOwner.js'; +import { default as SlimVideoMetadata } from './classes/SlimVideoMetadata.js'; +import { default as SortFilterSubMenu } from './classes/SortFilterSubMenu.js'; +import { default as SubFeedOption } from './classes/SubFeedOption.js'; +import { default as SubFeedSelector } from './classes/SubFeedSelector.js'; +import { default as SubscribeButton } from './classes/SubscribeButton.js'; +import { default as SubscriptionNotificationToggleButton } from './classes/SubscriptionNotificationToggleButton.js'; +import { default as Tab } from './classes/Tab.js'; +import { default as Tabbed } from './classes/Tabbed.js'; +import { default as TabbedSearchResults } from './classes/TabbedSearchResults.js'; +import { default as TextHeader } from './classes/TextHeader.js'; +import { default as ThumbnailLandscapePortrait } from './classes/ThumbnailLandscapePortrait.js'; +import { default as ThumbnailOverlayBottomPanel } from './classes/ThumbnailOverlayBottomPanel.js'; +import { default as ThumbnailOverlayEndorsement } from './classes/ThumbnailOverlayEndorsement.js'; +import { default as ThumbnailOverlayHoverText } from './classes/ThumbnailOverlayHoverText.js'; +import { default as ThumbnailOverlayInlineUnplayable } from './classes/ThumbnailOverlayInlineUnplayable.js'; +import { default as ThumbnailOverlayLoadingPreview } from './classes/ThumbnailOverlayLoadingPreview.js'; +import { default as ThumbnailOverlayNowPlaying } from './classes/ThumbnailOverlayNowPlaying.js'; +import { default as ThumbnailOverlayPinking } from './classes/ThumbnailOverlayPinking.js'; +import { default as ThumbnailOverlayPlaybackStatus } from './classes/ThumbnailOverlayPlaybackStatus.js'; +import { default as ThumbnailOverlayResumePlayback } from './classes/ThumbnailOverlayResumePlayback.js'; +import { default as ThumbnailOverlaySidePanel } from './classes/ThumbnailOverlaySidePanel.js'; +import { default as ThumbnailOverlayTimeStatus } from './classes/ThumbnailOverlayTimeStatus.js'; +import { default as ThumbnailOverlayToggleButton } from './classes/ThumbnailOverlayToggleButton.js'; +import { default as TimedMarkerDecoration } from './classes/TimedMarkerDecoration.js'; +import { default as TitleAndButtonListHeader } from './classes/TitleAndButtonListHeader.js'; +import { default as ToggleButton } from './classes/ToggleButton.js'; +import { default as ToggleMenuServiceItem } from './classes/ToggleMenuServiceItem.js'; +import { default as Tooltip } from './classes/Tooltip.js'; +import { default as TopicChannelDetails } from './classes/TopicChannelDetails.js'; +import { default as TwoColumnBrowseResults } from './classes/TwoColumnBrowseResults.js'; +import { default as TwoColumnSearchResults } from './classes/TwoColumnSearchResults.js'; +import { default as TwoColumnWatchNextResults } from './classes/TwoColumnWatchNextResults.js'; +import { default as UniversalWatchCard } from './classes/UniversalWatchCard.js'; +import { default as UpsellDialog } from './classes/UpsellDialog.js'; +import { default as VerticalList } from './classes/VerticalList.js'; +import { default as VerticalWatchCardList } from './classes/VerticalWatchCardList.js'; +import { default as Video } from './classes/Video.js'; +import { default as VideoCard } from './classes/VideoCard.js'; +import { default as VideoInfoCardContent } from './classes/VideoInfoCardContent.js'; +import { default as VideoOwner } from './classes/VideoOwner.js'; +import { default as VideoPrimaryInfo } from './classes/VideoPrimaryInfo.js'; +import { default as VideoSecondaryInfo } from './classes/VideoSecondaryInfo.js'; +import { default as WatchCardCompactVideo } from './classes/WatchCardCompactVideo.js'; +import { default as WatchCardHeroVideo } from './classes/WatchCardHeroVideo.js'; +import { default as WatchCardRichHeader } from './classes/WatchCardRichHeader.js'; +import { default as WatchCardSectionSequence } from './classes/WatchCardSectionSequence.js'; +import { default as WatchNextEndScreen } from './classes/WatchNextEndScreen.js'; +import { default as WatchNextTabbedResults } from './classes/WatchNextTabbedResults.js'; +import { default as AnchoredSection } from './classes/ytkids/AnchoredSection.js'; +import { default as KidsCategoriesHeader } from './classes/ytkids/KidsCategoriesHeader.js'; +import { default as KidsCategoryTab } from './classes/ytkids/KidsCategoryTab.js'; +import { default as KidsHomeScreen } from './classes/ytkids/KidsHomeScreen.js'; export const YTNodes = { AccountChannel, @@ -642,6 +652,19 @@ export const YTNodes = { KidsHomeScreen }; +export const Misc = { + Author, + ChildElement, + EmojiRun, + Format, + NavigatableText, + PlaylistAuthor, + Text, + TextRun, + Thumbnail, + VideoDetails +}; + const map: Record = YTNodes; /** diff --git a/src/parser/parser.ts b/src/parser/parser.ts new file mode 100644 index 000000000..8feba016f --- /dev/null +++ b/src/parser/parser.ts @@ -0,0 +1,582 @@ +import type AudioOnlyPlayability from './classes/AudioOnlyPlayability.js'; +import type CardCollection from './classes/CardCollection.js'; +import type Endscreen from './classes/Endscreen.js'; +import type PlayerAnnotationsExpanded from './classes/PlayerAnnotationsExpanded.js'; +import type PlayerCaptionsTracklist from './classes/PlayerCaptionsTracklist.js'; +import type PlayerLiveStoryboardSpec from './classes/PlayerLiveStoryboardSpec.js'; +import type PlayerStoryboardSpec from './classes/PlayerStoryboardSpec.js'; +import type Message from './classes/Message.js'; +import type LiveChatParticipantsList from './classes/LiveChatParticipantsList.js'; +import type LiveChatHeader from './classes/LiveChatHeader.js'; +import type LiveChatItemList from './classes/LiveChatItemList.js'; +import type Alert from './classes/Alert.js'; + +import MusicMultiSelectMenuItem from './classes/menus/MusicMultiSelectMenuItem.js'; +import Format from './classes/misc/Format.js'; +import VideoDetails from './classes/misc/VideoDetails.js'; +import NavigationEndpoint from './classes/NavigationEndpoint.js'; +import Thumbnail from './classes/misc/Thumbnail.js'; + +import { InnertubeError, ParsingError, Platform } from '../utils/Utils.js'; +import { Memo, observe, ObservedArray, SuperParsedResult, YTNode, YTNodeConstructor } from './helpers.js'; +import GetParserByName from './map.js'; + +export type ParserError = { classname: string, classdata: any, err: any }; +export type ParserErrorHandler = (error: ParserError) => void; + +export default class Parser { + static #errorHandler: ParserErrorHandler = Parser.#printError; + static #memo: Memo | null = null; + + static setParserErrorHandler(handler: ParserErrorHandler) { + this.#errorHandler = handler; + } + + static #clearMemo() { + Parser.#memo = null; + } + + static #createMemo() { + Parser.#memo = new Memo(); + } + + static #addToMemo(classname: string, result: YTNode) { + if (!Parser.#memo) + return; + + const list = Parser.#memo.get(classname); + if (!list) + return Parser.#memo.set(classname, [ result ]); + + list.push(result); + } + + static #getMemo() { + if (!Parser.#memo) + throw new Error('Parser#getMemo() called before Parser#createMemo()'); + return Parser.#memo; + } + + /** + * Parses InnerTube response. + * @param data - The response data. + */ + static parseResponse(data: any) { + // Memoize the response objects by classname + this.#createMemo(); + // TODO: should this parseItem? + const contents = Parser.parse(data.contents); + const contents_memo = this.#getMemo(); + this.#clearMemo(); + + this.#createMemo(); + const on_response_received_actions = data.onResponseReceivedActions ? Parser.parseRR(data.onResponseReceivedActions) : null; + const on_response_received_actions_memo = this.#getMemo(); + this.#clearMemo(); + + this.#createMemo(); + const on_response_received_endpoints = data.onResponseReceivedEndpoints ? Parser.parseRR(data.onResponseReceivedEndpoints) : null; + const on_response_received_endpoints_memo = this.#getMemo(); + this.#clearMemo(); + + this.#createMemo(); + const on_response_received_commands = data.onResponseReceivedCommands ? Parser.parseRR(data.onResponseReceivedCommands) : null; + const on_response_received_commands_memo = this.#getMemo(); + this.#clearMemo(); + + this.#createMemo(); + const continuation_contents = data.continuationContents ? Parser.parseLC(data.continuationContents) : null; + const continuation_contents_memo = this.#getMemo(); + this.#clearMemo(); + + this.#createMemo(); + const actions = data.actions ? Parser.parseActions(data.actions) : null; + const actions_memo = this.#getMemo(); + this.#clearMemo(); + + this.#createMemo(); + const live_chat_item_context_menu_supported_renderers = data.liveChatItemContextMenuSupportedRenderers + ? Parser.parseItem(data.liveChatItemContextMenuSupportedRenderers) + : null; + const live_chat_item_context_menu_supported_renderers_memo = this.#getMemo(); + this.#clearMemo(); + + this.#createMemo(); + const header = data.header ? Parser.parse(data.header) : null; + const header_memo = this.#getMemo(); + this.#clearMemo(); + + this.#createMemo(); + const sidebar = data.sidebar ? Parser.parseItem(data.sidebar) : null; + const sidebar_memo = this.#getMemo(); + this.#clearMemo(); + + this.applyMutations(contents_memo, data.frameworkUpdates?.entityBatchUpdate?.mutations); + + return { + actions, + actions_memo, + contents, + contents_memo, + header, + header_memo, + sidebar, + sidebar_memo, + live_chat_item_context_menu_supported_renderers, + live_chat_item_context_menu_supported_renderers_memo, + on_response_received_actions, + on_response_received_actions_memo, + on_response_received_endpoints, + on_response_received_endpoints_memo, + on_response_received_commands, + on_response_received_commands_memo, + continuation: data.continuation ? Parser.parseC(data.continuation) : null, + continuation_contents, + continuation_contents_memo, + metadata: Parser.parse(data.metadata), + microformat: data.microformat ? Parser.parseItem(data.microformat) : null, + overlay: Parser.parseItem(data.overlay), + alerts: Parser.parseArray(data.alerts), + refinements: data.refinements || null, + estimated_results: data.estimatedResults ? parseInt(data.estimatedResults) : null, + player_overlays: Parser.parse(data.playerOverlays), + playback_tracking: data.playbackTracking ? { + videostats_watchtime_url: data.playbackTracking.videostatsWatchtimeUrl.baseUrl as string, + videostats_playback_url: data.playbackTracking.videostatsPlaybackUrl.baseUrl as string + } : null, + playability_status: data.playabilityStatus ? { + status: data.playabilityStatus.status as string, + error_screen: Parser.parseItem(data.playabilityStatus.errorScreen), + audio_only_playablility: Parser.parseItem(data.playabilityStatus.audioOnlyPlayability), + embeddable: !!data.playabilityStatus.playableInEmbed || false, + reason: data.playabilityStatus?.reason || '' + } : undefined, + streaming_data: data.streamingData ? { + expires: new Date(Date.now() + parseInt(data.streamingData.expiresInSeconds) * 1000), + formats: Parser.parseFormats(data.streamingData.formats), + adaptive_formats: Parser.parseFormats(data.streamingData.adaptiveFormats), + dash_manifest_url: data.streamingData?.dashManifestUrl as string || null, + hls_manifest_url: data.streamingData?.hlsManifestUrl as string || null + } : undefined, + current_video_endpoint: data.currentVideoEndpoint ? new NavigationEndpoint(data.currentVideoEndpoint) : null, + endpoint: data.endpoint ? new NavigationEndpoint(data.endpoint) : null, + captions: Parser.parseItem(data.captions), + video_details: data.videoDetails ? new VideoDetails(data.videoDetails) : undefined, + annotations: Parser.parseArray(data.annotations), + storyboards: Parser.parseItem(data.storyboards), + endscreen: Parser.parseItem(data.endscreen), + cards: Parser.parseItem(data.cards) + }; + } + + /** + * Parses a single item. + * @param data - The data to parse. + * @param validTypes - YTNode types that are allowed to be parsed. + */ + static parseItem(data: any, validTypes?: YTNodeConstructor | YTNodeConstructor[]) { + if (!data) return null; + + const keys = Object.keys(data); + + if (!keys.length) + return null; + + const classname = this.sanitizeClassName(keys[0]); + + if (!this.shouldIgnore(classname)) { + try { + const TargetClass = GetParserByName(classname); + + if (validTypes) { + if (Array.isArray(validTypes)) { + if (!validTypes.some((type) => type.type === TargetClass.type)) + throw new ParsingError(`Type mismatch, got ${classname} but expected one of ${validTypes.map((type) => type.type).join(', ')}`); + } else if (TargetClass.type !== validTypes.type) + throw new ParsingError(`Type mismatch, got ${classname} but expected ${validTypes.type}`); + } + + const result = new TargetClass(data[keys[0]]); + this.#addToMemo(classname, result); + + return result as T; + } catch (err) { + this.#errorHandler({ classname, classdata: data[keys[0]], err }); + return null; + } + } + + return null; + } + + /** + * Parses an array of items. + * @param data - The data to parse. + * @param validTypes - YTNode types that are allowed to be parsed. + */ + static parseArray(data: any[], validTypes?: YTNodeConstructor | YTNodeConstructor[]) { + if (Array.isArray(data)) { + const results: T[] = []; + + for (const item of data) { + const result = this.parseItem(item, validTypes); + if (result) { + results.push(result); + } + } + + return observe(results); + } else if (!data) { + return observe([] as T[]); + } + throw new ParsingError('Expected array but got a single item'); + } + + /** + * Parses an item or an array of items. + * @param data - The data to parse. + * @param requireArray - Whether the data should be parsed as an array. + * @param validTypes - YTNode types that are allowed to be parsed. + */ + static parse(data: any, requireArray: true, validTypes?: YTNodeConstructor | YTNodeConstructor[]): ObservedArray | null; + static parse(data: any, requireArray?: false | undefined, validTypes?: YTNodeConstructor | YTNodeConstructor[]): SuperParsedResult; + static parse(data: any, requireArray?: boolean, validTypes?: YTNodeConstructor | YTNodeConstructor[]) { + if (!data) return null; + + if (Array.isArray(data)) { + const results: T[] = []; + + for (const item of data) { + const result = this.parseItem(item, validTypes); + if (result) { + results.push(result); + } + } + + const res = observe(results); + + return requireArray ? res : new SuperParsedResult(observe(results)); + } else if (requireArray) { + throw new ParsingError('Expected array but got a single item'); + } + + return new SuperParsedResult(this.parseItem(data, validTypes)); + } + + static parseC(data: any) { + if (data.timedContinuationData) + return new Continuation({ continuation: data.timedContinuationData, type: 'timed' }); + } + + static parseLC(data: any) { + if (data.itemSectionContinuation) + return new ItemSectionContinuation(data.itemSectionContinuation); + if (data.sectionListContinuation) + return new SectionListContinuation(data.sectionListContinuation); + if (data.liveChatContinuation) + return new LiveChatContinuation(data.liveChatContinuation); + if (data.musicPlaylistShelfContinuation) + return new MusicPlaylistShelfContinuation(data.musicPlaylistShelfContinuation); + if (data.musicShelfContinuation) + return new MusicShelfContinuation(data.musicShelfContinuation); + if (data.gridContinuation) + return new GridContinuation(data.gridContinuation); + if (data.playlistPanelContinuation) + return new PlaylistPanelContinuation(data.playlistPanelContinuation); + } + + static parseRR(actions: any[]) { + return observe(actions.map((action: any) => { + if (action.reloadContinuationItemsCommand) + return new ReloadContinuationItemsCommand(action.reloadContinuationItemsCommand); + if (action.appendContinuationItemsAction) + return new AppendContinuationItemsAction(action.appendContinuationItemsAction); + }).filter((item) => item) as (ReloadContinuationItemsCommand | AppendContinuationItemsAction)[]); + } + + static parseActions(data: any) { + if (Array.isArray(data)) { + return Parser.parse(data.map((action) => { + delete action.clickTrackingParams; + return action; + })); + } + return new SuperParsedResult(Parser.parseItem(data)); + } + + static parseFormats(formats: any[]) { + return formats?.map((format) => new Format(format)) || []; + } + + static applyMutations(memo: Memo, mutations: Array) { + // Apply mutations to MusicMultiSelectMenuItems + const music_multi_select_menu_items = memo.getType(MusicMultiSelectMenuItem); + + if (music_multi_select_menu_items.length > 0 && !mutations) { + console.warn( + new InnertubeError( + 'Mutation data required for processing MusicMultiSelectMenuItems, but none found.\n' + + `This is a bug, please report it at ${Platform.shim.info.bugs_url}` + ) + ); + } else { + const missing_or_invalid_mutations = []; + + for (const menu_item of music_multi_select_menu_items) { + const mutation = mutations + .find((mutation) => mutation.payload?.musicFormBooleanChoice?.id === menu_item.form_item_entity_key); + + const choice = mutation?.payload.musicFormBooleanChoice; + + if (choice?.selected !== undefined && choice?.opaqueToken) { + menu_item.selected = choice.selected; + } else { + missing_or_invalid_mutations.push(`'${menu_item.title}'`); + } + } + if (missing_or_invalid_mutations.length > 0) { + console.warn( + new InnertubeError( + `Mutation data missing or invalid for ${missing_or_invalid_mutations.length} out of ${music_multi_select_menu_items.length} MusicMultiSelectMenuItems. ` + + `The titles of the failed items are: ${missing_or_invalid_mutations.join(', ')}.\n` + + `This is a bug, please report it at ${Platform.shim.info.bugs_url}` + ) + ); + } + } + } + + static #printError({ classname, classdata, err }: ParserError) { + if (err.code == 'MODULE_NOT_FOUND') { + return console.warn( + new InnertubeError( + `${classname} not found!\n` + + `This is a bug, want to help us fix it? Follow the instructions at ${Platform.shim.info.repo_url}/blob/main/docs/updating-the-parser.md or report it at ${Platform.shim.info.bugs_url}!`, classdata + ) + ); + } + + console.warn( + new InnertubeError( + `Something went wrong at ${classname}!\n` + + `This is a bug, please report it at ${Platform.shim.info.bugs_url}`, { stack: err.stack } + ) + ); + } + + static sanitizeClassName(input: string) { + return (input.charAt(0).toUpperCase() + input.slice(1)) + .replace(/Renderer|Model/g, '') + .replace(/Radio/g, 'Mix').trim(); + } + + static ignore_list = new Set([ + 'AdSlot', + 'DisplayAd', + 'SearchPyv', + 'MealbarPromo', + 'BackgroundPromo', + 'PromotedSparklesWeb', + 'RunAttestationCommand', + 'CompactPromotedVideo', + 'StatementBanner' + ]); + + static shouldIgnore(classname: string) { + return this.ignore_list.has(classname); + } +} + +export type ParsedResponse = ReturnType; + +// Continuation + +export class ItemSectionContinuation extends YTNode { + static readonly type = 'itemSectionContinuation'; + + contents: ObservedArray | null; + continuation?: string; + + constructor(data: any) { + super(); + this.contents = Parser.parseArray(data.contents); + if (data.continuations) { + this.continuation = data.continuations?.at(0)?.nextContinuationData?.continuation; + } + } +} + +export class AppendContinuationItemsAction extends YTNode { + static readonly type = 'appendContinuationItemsAction'; + + contents: ObservedArray | null; + + constructor(data: any) { + super(); + this.contents = Parser.parse(data.continuationItems, true); + } +} + +export class ReloadContinuationItemsCommand extends YTNode { + static readonly type = 'reloadContinuationItemsCommand'; + + target_id: string; + contents: ObservedArray | null; + slot?: string; + + constructor(data: any) { + super(); + this.target_id = data.targetId; + this.contents = Parser.parse(data.continuationItems, true); + this.slot = data?.slot; + } +} + +export class SectionListContinuation extends YTNode { + static readonly type = 'sectionListContinuation'; + + continuation: string; + contents: ObservedArray | null; + + constructor(data: any) { + super(); + this.contents = Parser.parse(data.contents, true); + this.continuation = + data.continuations?.[0]?.nextContinuationData?.continuation || + data.continuations?.[0]?.reloadContinuationData?.continuation || null; + } +} + +export class MusicPlaylistShelfContinuation extends YTNode { + static readonly type = 'musicPlaylistShelfContinuation'; + + continuation: string; + contents: ObservedArray | null; + + constructor(data: any) { + super(); + this.contents = Parser.parse(data.contents, true); + this.continuation = data.continuations?.[0].nextContinuationData.continuation || null; + } +} + +export class MusicShelfContinuation extends YTNode { + static readonly type = 'musicShelfContinuation'; + + continuation: string; + contents: ObservedArray | null; + + constructor(data: any) { + super(); + this.contents = Parser.parse(data.contents, true); + this.continuation = + data.continuations?.[0].nextContinuationData?.continuation || + data.continuations?.[0].reloadContinuationData?.continuation || null; + } +} + +export class GridContinuation extends YTNode { + static readonly type = 'gridContinuation'; + + continuation: string; + items: ObservedArray | null; + + constructor(data: any) { + super(); + this.items = Parser.parse(data.items, true); + this.continuation = data.continuations?.[0].nextContinuationData.continuation || null; + } + + get contents() { + return this.items; + } +} + +export class PlaylistPanelContinuation extends YTNode { + static readonly type = 'playlistPanelContinuation'; + + continuation: string; + contents: ObservedArray | null; + + constructor(data: any) { + super(); + this.contents = Parser.parse(data.contents, true); + this.continuation = data.continuations?.[0]?.nextContinuationData?.continuation || + data.continuations?.[0]?.nextRadioContinuationData?.continuation || null; + } +} + +export class Continuation extends YTNode { + static readonly type = 'continuation'; + + continuation_type: string; + timeout_ms?: number; + time_until_last_message_ms?: number; + token: string; + + constructor(data: any) { + super(); + this.continuation_type = data.type; + this.timeout_ms = data.continuation?.timeoutMs; + this.time_until_last_message_ms = data.continuation?.timeUntilLastMessageMsec; + this.token = data.continuation?.continuation; + } +} + +export class LiveChatContinuation extends YTNode { + static readonly type = 'liveChatContinuation'; + + actions: ObservedArray; + action_panel: YTNode | null; + item_list: LiveChatItemList | null; + header: LiveChatHeader | null; + participants_list: LiveChatParticipantsList | null; + popout_message: Message | null; + emojis: { + emoji_id: string; + shortcuts: string[]; + search_terms: string[]; + image: Thumbnail[]; + }[]; + continuation: Continuation; + viewer_name: string; + + constructor(data: any) { + super(); + this.actions = Parser.parse(data.actions?.map((action: any) => { + delete action.clickTrackingParams; + return action; + }), true) || observe([]); + + this.action_panel = Parser.parseItem(data.actionPanel); + this.item_list = Parser.parseItem(data.itemList); + this.header = Parser.parseItem(data.header); + this.participants_list = Parser.parseItem(data.participantsList); + this.popout_message = Parser.parseItem(data.popoutMessage); + + this.emojis = data.emojis?.map((emoji: any) => ({ + emoji_id: emoji.emojiId, + shortcuts: emoji.shortcuts, + search_terms: emoji.searchTerms, + image: Thumbnail.fromResponse(emoji.image), + is_custom_emoji: emoji.isCustomEmoji + })) || []; + + let continuation, type; + + if (data.continuations?.[0].timedContinuationData) { + type = 'timed'; + continuation = data.continuations?.[0].timedContinuationData; + } else if (data.continuations?.[0].invalidationContinuationData) { + type = 'invalidation'; + continuation = data.continuations?.[0].invalidationContinuationData; + } else if (data.continuations?.[0].liveChatReplayContinuationData) { + type = 'replay'; + continuation = data.continuations?.[0].liveChatReplayContinuationData; + } + + this.continuation = new Continuation({ continuation, type }); + + this.viewer_name = data.viewerName; + } +} \ No newline at end of file diff --git a/src/parser/youtube/AccountInfo.ts b/src/parser/youtube/AccountInfo.ts index eb72c7097..d9f67c5b5 100644 --- a/src/parser/youtube/AccountInfo.ts +++ b/src/parser/youtube/AccountInfo.ts @@ -1,11 +1,11 @@ -import Parser, { ParsedResponse } from '..'; -import type { ApiResponse } from '../../core/Actions'; +import Parser, { ParsedResponse } from '../index.js'; +import type { ApiResponse } from '../../core/Actions.js'; -import AccountSectionList from '../classes/AccountSectionList'; -import AccountItemSection from '../classes/AccountItemSection'; -import AccountChannel from '../classes/AccountChannel'; +import AccountSectionList from '../classes/AccountSectionList.js'; +import AccountItemSection from '../classes/AccountItemSection.js'; +import AccountChannel from '../classes/AccountChannel.js'; -import { InnertubeError } from '../../utils/Utils'; +import { InnertubeError } from '../../utils/Utils.js'; class AccountInfo { #page: ParsedResponse; diff --git a/src/parser/youtube/Analytics.ts b/src/parser/youtube/Analytics.ts index 093132c6c..4b181c5ba 100644 --- a/src/parser/youtube/Analytics.ts +++ b/src/parser/youtube/Analytics.ts @@ -1,6 +1,6 @@ -import Parser, { ParsedResponse } from '..'; -import type { ApiResponse } from '../../core/Actions'; -import Element from '../classes/Element'; +import Parser, { ParsedResponse } from '../index.js'; +import type { ApiResponse } from '../../core/Actions.js'; +import Element from '../classes/Element.js'; class Analytics { #page: ParsedResponse; diff --git a/src/parser/youtube/Channel.ts b/src/parser/youtube/Channel.ts index 2a0ad0026..792f843b0 100644 --- a/src/parser/youtube/Channel.ts +++ b/src/parser/youtube/Channel.ts @@ -1,26 +1,26 @@ -import type Actions from '../../core/Actions'; -import TabbedFeed from '../../core/TabbedFeed'; -import C4TabbedHeader from '../classes/C4TabbedHeader'; -import CarouselHeader from '../classes/CarouselHeader'; -import ChannelAboutFullMetadata from '../classes/ChannelAboutFullMetadata'; -import ChannelMetadata from '../classes/ChannelMetadata'; -import InteractiveTabbedHeader from '../classes/InteractiveTabbedHeader'; -import MicroformatData from '../classes/MicroformatData'; -import SubscribeButton from '../classes/SubscribeButton'; -import ExpandableTab from '../classes/ExpandableTab'; -import SectionList from '../classes/SectionList'; -import Tab from '../classes/Tab'; - -import Feed from '../../core/Feed'; -import FilterableFeed from '../../core/FilterableFeed'; -import ChipCloudChip from '../classes/ChipCloudChip'; -import FeedFilterChipBar from '../classes/FeedFilterChipBar'; -import ChannelSubMenu from '../classes/ChannelSubMenu'; -import SortFilterSubMenu from '../classes/SortFilterSubMenu'; - -import { ChannelError, InnertubeError } from '../../utils/Utils'; - -import type { AppendContinuationItemsAction, ReloadContinuationItemsCommand } from '..'; +import type Actions from '../../core/Actions.js'; +import TabbedFeed from '../../core/TabbedFeed.js'; +import C4TabbedHeader from '../classes/C4TabbedHeader.js'; +import CarouselHeader from '../classes/CarouselHeader.js'; +import ChannelAboutFullMetadata from '../classes/ChannelAboutFullMetadata.js'; +import ChannelMetadata from '../classes/ChannelMetadata.js'; +import InteractiveTabbedHeader from '../classes/InteractiveTabbedHeader.js'; +import MicroformatData from '../classes/MicroformatData.js'; +import SubscribeButton from '../classes/SubscribeButton.js'; +import ExpandableTab from '../classes/ExpandableTab.js'; +import SectionList from '../classes/SectionList.js'; +import Tab from '../classes/Tab.js'; + +import Feed from '../../core/Feed.js'; +import FilterableFeed from '../../core/FilterableFeed.js'; +import ChipCloudChip from '../classes/ChipCloudChip.js'; +import FeedFilterChipBar from '../classes/FeedFilterChipBar.js'; +import ChannelSubMenu from '../classes/ChannelSubMenu.js'; +import SortFilterSubMenu from '../classes/SortFilterSubMenu.js'; + +import { ChannelError, InnertubeError } from '../../utils/Utils.js'; + +import type { AppendContinuationItemsAction, ReloadContinuationItemsCommand } from '../index.js'; export default class Channel extends TabbedFeed { header?: C4TabbedHeader | CarouselHeader | InteractiveTabbedHeader; diff --git a/src/parser/youtube/Comments.ts b/src/parser/youtube/Comments.ts index b3575ecf0..576d7f320 100644 --- a/src/parser/youtube/Comments.ts +++ b/src/parser/youtube/Comments.ts @@ -1,13 +1,13 @@ -import Parser, { ParsedResponse } from '..'; -import type Actions from '../../core/Actions'; -import type { ApiResponse } from '../../core/Actions'; -import { InnertubeError } from '../../utils/Utils'; -import { observe, ObservedArray } from '../helpers'; - -import CommentsHeader from '../classes/comments/CommentsHeader'; -import CommentSimplebox from '../classes/comments/CommentSimplebox'; -import CommentThread from '../classes/comments/CommentThread'; -import ContinuationItem from '../classes/ContinuationItem'; +import Parser, { ParsedResponse } from '../index.js'; +import type Actions from '../../core/Actions.js'; +import type { ApiResponse } from '../../core/Actions.js'; +import { InnertubeError } from '../../utils/Utils.js'; +import { observe, ObservedArray } from '../helpers.js'; + +import CommentsHeader from '../classes/comments/CommentsHeader.js'; +import CommentSimplebox from '../classes/comments/CommentSimplebox.js'; +import CommentThread from '../classes/comments/CommentThread.js'; +import ContinuationItem from '../classes/ContinuationItem.js'; class Comments { #page: ParsedResponse; diff --git a/src/parser/youtube/History.ts b/src/parser/youtube/History.ts index 99acb7d69..bf1c1c284 100644 --- a/src/parser/youtube/History.ts +++ b/src/parser/youtube/History.ts @@ -1,7 +1,7 @@ -import type Actions from '../../core/Actions'; -import Feed from '../../core/Feed'; -import ItemSection from '../classes/ItemSection'; -import BrowseFeedActions from '../classes/BrowseFeedActions'; +import type Actions from '../../core/Actions.js'; +import Feed from '../../core/Feed.js'; +import ItemSection from '../classes/ItemSection.js'; +import BrowseFeedActions from '../classes/BrowseFeedActions.js'; // TODO: make feed actions usable class History extends Feed { diff --git a/src/parser/youtube/HomeFeed.ts b/src/parser/youtube/HomeFeed.ts index 82a8b1acf..35357eb75 100644 --- a/src/parser/youtube/HomeFeed.ts +++ b/src/parser/youtube/HomeFeed.ts @@ -1,10 +1,10 @@ -import type Actions from '../../core/Actions'; -import FilterableFeed from '../../core/FilterableFeed'; -import ChipCloudChip from '../classes/ChipCloudChip'; -import FeedTabbedHeader from '../classes/FeedTabbedHeader'; -import RichGrid from '../classes/RichGrid'; +import type Actions from '../../core/Actions.js'; +import FilterableFeed from '../../core/FilterableFeed.js'; +import ChipCloudChip from '../classes/ChipCloudChip.js'; +import FeedTabbedHeader from '../classes/FeedTabbedHeader.js'; +import RichGrid from '../classes/RichGrid.js'; -import type { AppendContinuationItemsAction, ReloadContinuationItemsCommand } from '..'; +import type { AppendContinuationItemsAction, ReloadContinuationItemsCommand } from '../index.js'; export default class HomeFeed extends FilterableFeed { contents: RichGrid | AppendContinuationItemsAction | ReloadContinuationItemsCommand; diff --git a/src/parser/youtube/ItemMenu.ts b/src/parser/youtube/ItemMenu.ts index a4dd592db..06343d398 100644 --- a/src/parser/youtube/ItemMenu.ts +++ b/src/parser/youtube/ItemMenu.ts @@ -1,12 +1,12 @@ -import Button from '../classes/Button'; -import Menu from '../classes/menus/Menu'; -import MenuServiceItem from '../classes/menus/MenuServiceItem'; -import NavigationEndpoint from '../classes/NavigationEndpoint'; - -import type Actions from '../../core/Actions'; -import type { ParsedResponse } from '..'; -import { InnertubeError } from '../../utils/Utils'; -import type { ObservedArray, YTNode } from '../helpers'; +import Button from '../classes/Button.js'; +import Menu from '../classes/menus/Menu.js'; +import MenuServiceItem from '../classes/menus/MenuServiceItem.js'; +import NavigationEndpoint from '../classes/NavigationEndpoint.js'; + +import type Actions from '../../core/Actions.js'; +import type { ParsedResponse } from '../index.js'; +import { InnertubeError } from '../../utils/Utils.js'; +import type { ObservedArray, YTNode } from '../helpers.js'; class ItemMenu { #page: ParsedResponse; diff --git a/src/parser/youtube/Library.ts b/src/parser/youtube/Library.ts index b1dc4b9e1..88aaf5c1b 100644 --- a/src/parser/youtube/Library.ts +++ b/src/parser/youtube/Library.ts @@ -1,17 +1,17 @@ -import Parser, { ParsedResponse } from '..'; -import type Actions from '../../core/Actions'; -import type { ApiResponse } from '../../core/Actions'; -import { InnertubeError } from '../../utils/Utils'; - -import Feed from '../../core/Feed'; -import History from './History'; -import Playlist from './Playlist'; -import Menu from '../classes/menus/Menu'; -import Shelf from '../classes/Shelf'; -import Button from '../classes/Button'; - -import ProfileColumnStats from '../classes/ProfileColumnStats'; -import ProfileColumnUserInfo from '../classes/ProfileColumnUserInfo'; +import Parser, { ParsedResponse } from '../index.js'; +import type Actions from '../../core/Actions.js'; +import type { ApiResponse } from '../../core/Actions.js'; +import { InnertubeError } from '../../utils/Utils.js'; + +import Feed from '../../core/Feed.js'; +import History from './History.js'; +import Playlist from './Playlist.js'; +import Menu from '../classes/menus/Menu.js'; +import Shelf from '../classes/Shelf.js'; +import Button from '../classes/Button.js'; + +import ProfileColumnStats from '../classes/ProfileColumnStats.js'; +import ProfileColumnUserInfo from '../classes/ProfileColumnUserInfo.js'; class Library { #actions: Actions; diff --git a/src/parser/youtube/LiveChat.ts b/src/parser/youtube/LiveChat.ts index e795af3ee..82390a9b1 100644 --- a/src/parser/youtube/LiveChat.ts +++ b/src/parser/youtube/LiveChat.ts @@ -1,40 +1,40 @@ -import EventEmitter from '../../utils/EventEmitterLike'; -import Parser, { LiveChatContinuation, ParsedResponse } from '../index'; -import VideoInfo from './VideoInfo'; -import SmoothedQueue from './SmoothedQueue'; - -import AddChatItemAction from '../classes/livechat/AddChatItemAction'; -import AddLiveChatTickerItemAction from '../classes/livechat/AddLiveChatTickerItemAction'; -import MarkChatItemAsDeletedAction from '../classes/livechat/MarkChatItemAsDeletedAction'; -import MarkChatItemsByAuthorAsDeletedAction from '../classes/livechat/MarkChatItemsByAuthorAsDeletedAction'; -import ReplaceChatItemAction from '../classes/livechat/ReplaceChatItemAction'; -import ReplayChatItemAction from '../classes/livechat/ReplayChatItemAction'; -import ShowLiveChatActionPanelAction from '../classes/livechat/ShowLiveChatActionPanelAction'; - -import UpdateDateTextAction from '../classes/livechat/UpdateDateTextAction'; -import UpdateDescriptionAction from '../classes/livechat/UpdateDescriptionAction'; -import UpdateTitleAction from '../classes/livechat/UpdateTitleAction'; -import UpdateToggleButtonTextAction from '../classes/livechat/UpdateToggleButtonTextAction'; -import UpdateViewershipAction from '../classes/livechat/UpdateViewershipAction'; - -import AddBannerToLiveChatCommand from '../classes/livechat/AddBannerToLiveChatCommand'; -import RemoveBannerForLiveChatCommand from '../classes/livechat/RemoveBannerForLiveChatCommand'; -import ShowLiveChatTooltipCommand from '../classes/livechat/ShowLiveChatTooltipCommand'; - -import Proto from '../../proto/index'; -import { InnertubeError, uuidv4 } from '../../utils/Utils'; -import type { ObservedArray, YTNode } from '../helpers'; - -import Button from '../classes/Button'; -import LiveChatAutoModMessage from '../classes/livechat/items/LiveChatAutoModMessage'; -import LiveChatMembershipItem from '../classes/livechat/items/LiveChatMembershipItem'; -import LiveChatPaidMessage from '../classes/livechat/items/LiveChatPaidMessage'; -import LiveChatPaidSticker from '../classes/livechat/items/LiveChatPaidSticker'; -import LiveChatTextMessage from '../classes/livechat/items/LiveChatTextMessage'; -import LiveChatViewerEngagementMessage from '../classes/livechat/items/LiveChatViewerEngagementMessage'; -import ItemMenu from './ItemMenu'; - -import type Actions from '../../core/Actions'; +import EventEmitter from '../../utils/EventEmitterLike.js'; +import Parser, { LiveChatContinuation, ParsedResponse } from '../index.js'; +import VideoInfo from './VideoInfo.js'; +import SmoothedQueue from './SmoothedQueue.js'; + +import AddChatItemAction from '../classes/livechat/AddChatItemAction.js'; +import AddLiveChatTickerItemAction from '../classes/livechat/AddLiveChatTickerItemAction.js'; +import MarkChatItemAsDeletedAction from '../classes/livechat/MarkChatItemAsDeletedAction.js'; +import MarkChatItemsByAuthorAsDeletedAction from '../classes/livechat/MarkChatItemsByAuthorAsDeletedAction.js'; +import ReplaceChatItemAction from '../classes/livechat/ReplaceChatItemAction.js'; +import ReplayChatItemAction from '../classes/livechat/ReplayChatItemAction.js'; +import ShowLiveChatActionPanelAction from '../classes/livechat/ShowLiveChatActionPanelAction.js'; + +import UpdateDateTextAction from '../classes/livechat/UpdateDateTextAction.js'; +import UpdateDescriptionAction from '../classes/livechat/UpdateDescriptionAction.js'; +import UpdateTitleAction from '../classes/livechat/UpdateTitleAction.js'; +import UpdateToggleButtonTextAction from '../classes/livechat/UpdateToggleButtonTextAction.js'; +import UpdateViewershipAction from '../classes/livechat/UpdateViewershipAction.js'; + +import AddBannerToLiveChatCommand from '../classes/livechat/AddBannerToLiveChatCommand.js'; +import RemoveBannerForLiveChatCommand from '../classes/livechat/RemoveBannerForLiveChatCommand.js'; +import ShowLiveChatTooltipCommand from '../classes/livechat/ShowLiveChatTooltipCommand.js'; + +import Proto from '../../proto/index.js'; +import { InnertubeError, Platform } from '../../utils/Utils.js'; +import type { ObservedArray, YTNode } from '../helpers.js'; + +import Button from '../classes/Button.js'; +import LiveChatAutoModMessage from '../classes/livechat/items/LiveChatAutoModMessage.js'; +import LiveChatMembershipItem from '../classes/livechat/items/LiveChatMembershipItem.js'; +import LiveChatPaidMessage from '../classes/livechat/items/LiveChatPaidMessage.js'; +import LiveChatPaidSticker from '../classes/livechat/items/LiveChatPaidSticker.js'; +import LiveChatTextMessage from '../classes/livechat/items/LiveChatTextMessage.js'; +import LiveChatViewerEngagementMessage from '../classes/livechat/items/LiveChatViewerEngagementMessage.js'; +import ItemMenu from './ItemMenu.js'; + +import type Actions from '../../core/Actions.js'; export type ChatAction = AddChatItemAction | AddBannerToLiveChatCommand | AddLiveChatTickerItemAction | @@ -253,7 +253,7 @@ class LiveChat extends EventEmitter { const response = await this.#actions.execute('/live_chat/send_message', { params: Proto.encodeMessageParams(this.#channel_id, this.#video_id), richMessage: { textSegments: [ { text } ] }, - clientMessageId: uuidv4(), + clientMessageId: Platform.shim.uuidv4(), client: 'ANDROID', parse: true }); diff --git a/src/parser/youtube/NotificationsMenu.ts b/src/parser/youtube/NotificationsMenu.ts index 98cbdee51..e7f98057c 100644 --- a/src/parser/youtube/NotificationsMenu.ts +++ b/src/parser/youtube/NotificationsMenu.ts @@ -1,12 +1,12 @@ -import Parser, { ParsedResponse } from '..'; -import { InnertubeError } from '../../utils/Utils'; +import Parser, { ParsedResponse } from '../index.js'; +import { InnertubeError } from '../../utils/Utils.js'; -import ContinuationItem from '../classes/ContinuationItem'; -import SimpleMenuHeader from '../classes/menus/SimpleMenuHeader'; -import Notification from '../classes/Notification'; +import ContinuationItem from '../classes/ContinuationItem.js'; +import SimpleMenuHeader from '../classes/menus/SimpleMenuHeader.js'; +import Notification from '../classes/Notification.js'; -import type Actions from '../../core/Actions'; -import type { ApiResponse } from '../../core/Actions'; +import type Actions from '../../core/Actions.js'; +import type { ApiResponse } from '../../core/Actions.js'; class NotificationsMenu { #page: ParsedResponse; diff --git a/src/parser/youtube/Playlist.ts b/src/parser/youtube/Playlist.ts index 443600a5c..ab54a6dcf 100644 --- a/src/parser/youtube/Playlist.ts +++ b/src/parser/youtube/Playlist.ts @@ -1,21 +1,21 @@ -import Feed from '../../core/Feed'; +import Feed from '../../core/Feed.js'; -import Thumbnail from '../classes/misc/Thumbnail'; -import VideoOwner from '../classes/VideoOwner'; +import Thumbnail from '../classes/misc/Thumbnail.js'; +import VideoOwner from '../classes/VideoOwner.js'; -import PlaylistMetadata from '../classes/PlaylistMetadata'; -import PlaylistSidebarPrimaryInfo from '../classes/PlaylistSidebarPrimaryInfo'; -import PlaylistSidebarSecondaryInfo from '../classes/PlaylistSidebarSecondaryInfo'; -import PlaylistCustomThumbnail from '../classes/PlaylistCustomThumbnail'; -import PlaylistVideoThumbnail from '../classes/PlaylistVideoThumbnail'; -import PlaylistHeader from '../classes/PlaylistHeader'; -import Message from '../classes/Message'; +import PlaylistMetadata from '../classes/PlaylistMetadata.js'; +import PlaylistSidebarPrimaryInfo from '../classes/PlaylistSidebarPrimaryInfo.js'; +import PlaylistSidebarSecondaryInfo from '../classes/PlaylistSidebarSecondaryInfo.js'; +import PlaylistCustomThumbnail from '../classes/PlaylistCustomThumbnail.js'; +import PlaylistVideoThumbnail from '../classes/PlaylistVideoThumbnail.js'; +import PlaylistHeader from '../classes/PlaylistHeader.js'; +import Message from '../classes/Message.js'; -import { InnertubeError } from '../../utils/Utils'; +import { InnertubeError } from '../../utils/Utils.js'; -import type Actions from '../../core/Actions'; -import { ObservedArray } from '../helpers'; -import NavigationEndpoint from '../classes/NavigationEndpoint'; +import type Actions from '../../core/Actions.js'; +import { ObservedArray } from '../helpers.js'; +import NavigationEndpoint from '../classes/NavigationEndpoint.js'; class Playlist extends Feed { info; diff --git a/src/parser/youtube/Search.ts b/src/parser/youtube/Search.ts index 130981cbd..648ea4277 100644 --- a/src/parser/youtube/Search.ts +++ b/src/parser/youtube/Search.ts @@ -1,13 +1,13 @@ -import Feed from '../../core/Feed'; -import HorizontalCardList from '../classes/HorizontalCardList'; -import ItemSection from '../classes/ItemSection'; -import SearchRefinementCard from '../classes/SearchRefinementCard'; -import SectionList from '../classes/SectionList'; -import UniversalWatchCard from '../classes/UniversalWatchCard'; +import Feed from '../../core/Feed.js'; +import HorizontalCardList from '../classes/HorizontalCardList.js'; +import ItemSection from '../classes/ItemSection.js'; +import SearchRefinementCard from '../classes/SearchRefinementCard.js'; +import SectionList from '../classes/SectionList.js'; +import UniversalWatchCard from '../classes/UniversalWatchCard.js'; -import type Actions from '../../core/Actions'; -import { InnertubeError } from '../../utils/Utils'; -import type { ObservedArray, YTNode } from '../helpers'; +import type Actions from '../../core/Actions.js'; +import { InnertubeError } from '../../utils/Utils.js'; +import type { ObservedArray, YTNode } from '../helpers.js'; export default class Search extends Feed { results?: ObservedArray | null; diff --git a/src/parser/youtube/Settings.ts b/src/parser/youtube/Settings.ts index 508dc48bf..48f01edeb 100644 --- a/src/parser/youtube/Settings.ts +++ b/src/parser/youtube/Settings.ts @@ -1,19 +1,19 @@ -import Parser, { ParsedResponse } from '..'; -import { InnertubeError } from '../../utils/Utils'; - -import ItemSection from '../classes/ItemSection'; -import SectionList from '../classes/SectionList'; -import Tab from '../classes/Tab'; -import TwoColumnBrowseResults from '../classes/TwoColumnBrowseResults'; - -import CompactLink from '../classes/CompactLink'; -import PageIntroduction from '../classes/PageIntroduction'; -import SettingsOptions from '../classes/SettingsOptions'; -import SettingsSidebar from '../classes/SettingsSidebar'; -import SettingsSwitch from '../classes/SettingsSwitch'; - -import type Actions from '../../core/Actions'; -import type { ApiResponse } from '../../core/Actions'; +import Parser, { ParsedResponse } from '../index.js'; +import { InnertubeError } from '../../utils/Utils.js'; + +import ItemSection from '../classes/ItemSection.js'; +import SectionList from '../classes/SectionList.js'; +import Tab from '../classes/Tab.js'; +import TwoColumnBrowseResults from '../classes/TwoColumnBrowseResults.js'; + +import CompactLink from '../classes/CompactLink.js'; +import PageIntroduction from '../classes/PageIntroduction.js'; +import SettingsOptions from '../classes/SettingsOptions.js'; +import SettingsSidebar from '../classes/SettingsSidebar.js'; +import SettingsSwitch from '../classes/SettingsSwitch.js'; + +import type Actions from '../../core/Actions.js'; +import type { ApiResponse } from '../../core/Actions.js'; class Settings { #page: ParsedResponse; diff --git a/src/parser/youtube/SmoothedQueue.ts b/src/parser/youtube/SmoothedQueue.ts index c0ed483df..61b4ac330 100644 --- a/src/parser/youtube/SmoothedQueue.ts +++ b/src/parser/youtube/SmoothedQueue.ts @@ -1,4 +1,4 @@ -import { YTNode } from '../helpers'; +import { YTNode } from '../helpers.js'; /** * Flattens the given queue. diff --git a/src/parser/youtube/TimeWatched.ts b/src/parser/youtube/TimeWatched.ts index a3ffa43e8..2e320de32 100644 --- a/src/parser/youtube/TimeWatched.ts +++ b/src/parser/youtube/TimeWatched.ts @@ -1,11 +1,11 @@ -import Parser, { ParsedResponse } from '..'; -import ItemSection from '../classes/ItemSection'; -import SectionList from '../classes/SectionList'; -import SingleColumnBrowseResults from '../classes/SingleColumnBrowseResults'; - -import { InnertubeError } from '../../utils/Utils'; -import type { ApiResponse } from '../../core/Actions'; -import type { ObservedArray } from '../helpers'; +import Parser, { ParsedResponse } from '../index.js'; +import ItemSection from '../classes/ItemSection.js'; +import SectionList from '../classes/SectionList.js'; +import SingleColumnBrowseResults from '../classes/SingleColumnBrowseResults.js'; + +import { InnertubeError } from '../../utils/Utils.js'; +import type { ApiResponse } from '../../core/Actions.js'; +import type { ObservedArray } from '../helpers.js'; class TimeWatched { #page: ParsedResponse; diff --git a/src/parser/youtube/VideoInfo.ts b/src/parser/youtube/VideoInfo.ts index 3509b3d89..f7e6dbcf0 100644 --- a/src/parser/youtube/VideoInfo.ts +++ b/src/parser/youtube/VideoInfo.ts @@ -1,42 +1,42 @@ -import Constants from '../../utils/Constants'; -import Parser, { ParsedResponse } from '../index'; - -import TwoColumnWatchNextResults from '../classes/TwoColumnWatchNextResults'; -import VideoPrimaryInfo from '../classes/VideoPrimaryInfo'; -import VideoSecondaryInfo from '../classes/VideoSecondaryInfo'; - -import MerchandiseShelf from '../classes/MerchandiseShelf'; -import RelatedChipCloud from '../classes/RelatedChipCloud'; - -import ChipCloud from '../classes/ChipCloud'; -import ChipCloudChip from '../classes/ChipCloudChip'; -import CommentsEntryPointHeader from '../classes/comments/CommentsEntryPointHeader'; -import ContinuationItem from '../classes/ContinuationItem'; -import ItemSection from '../classes/ItemSection'; -import LiveChat from '../classes/LiveChat'; -import MicroformatData from '../classes/MicroformatData'; -import PlayerMicroformat from '../classes/PlayerMicroformat'; -import PlayerOverlay from '../classes/PlayerOverlay'; -import SegmentedLikeDislikeButton from '../classes/SegmentedLikeDislikeButton'; -import ToggleButton from '../classes/ToggleButton'; -import LiveChatWrap from './LiveChat'; - -import type CardCollection from '../classes/CardCollection'; -import type Endscreen from '../classes/Endscreen'; -import type Format from '../classes/misc/Format'; -import type PlayerAnnotationsExpanded from '../classes/PlayerAnnotationsExpanded'; -import type PlayerCaptionsTracklist from '../classes/PlayerCaptionsTracklist'; -import type PlayerLiveStoryboardSpec from '../classes/PlayerLiveStoryboardSpec'; -import type PlayerStoryboardSpec from '../classes/PlayerStoryboardSpec'; - -import type Player from '../../core/Player'; -import type Actions from '../../core/Actions'; -import type { ApiResponse } from '../../core/Actions'; -import type { ObservedArray, YTNode } from '../helpers'; - -import FormatUtils, { FormatOptions, DownloadOptions, URLTransformer, FormatFilter } from '../../utils/FormatUtils'; - -import { InnertubeError } from '../../utils/Utils'; +import Constants from '../../utils/Constants.js'; +import Parser, { ParsedResponse } from '../index.js'; + +import TwoColumnWatchNextResults from '../classes/TwoColumnWatchNextResults.js'; +import VideoPrimaryInfo from '../classes/VideoPrimaryInfo.js'; +import VideoSecondaryInfo from '../classes/VideoSecondaryInfo.js'; + +import MerchandiseShelf from '../classes/MerchandiseShelf.js'; +import RelatedChipCloud from '../classes/RelatedChipCloud.js'; + +import ChipCloud from '../classes/ChipCloud.js'; +import ChipCloudChip from '../classes/ChipCloudChip.js'; +import CommentsEntryPointHeader from '../classes/comments/CommentsEntryPointHeader.js'; +import ContinuationItem from '../classes/ContinuationItem.js'; +import ItemSection from '../classes/ItemSection.js'; +import LiveChat from '../classes/LiveChat.js'; +import MicroformatData from '../classes/MicroformatData.js'; +import PlayerMicroformat from '../classes/PlayerMicroformat.js'; +import PlayerOverlay from '../classes/PlayerOverlay.js'; +import SegmentedLikeDislikeButton from '../classes/SegmentedLikeDislikeButton.js'; +import ToggleButton from '../classes/ToggleButton.js'; +import LiveChatWrap from './LiveChat.js'; + +import type CardCollection from '../classes/CardCollection.js'; +import type Endscreen from '../classes/Endscreen.js'; +import type Format from '../classes/misc/Format.js'; +import type PlayerAnnotationsExpanded from '../classes/PlayerAnnotationsExpanded.js'; +import type PlayerCaptionsTracklist from '../classes/PlayerCaptionsTracklist.js'; +import type PlayerLiveStoryboardSpec from '../classes/PlayerLiveStoryboardSpec.js'; +import type PlayerStoryboardSpec from '../classes/PlayerStoryboardSpec.js'; + +import type Player from '../../core/Player.js'; +import type Actions from '../../core/Actions.js'; +import type { ApiResponse } from '../../core/Actions.js'; +import type { ObservedArray, YTNode } from '../helpers.js'; + +import FormatUtils, { FormatOptions, DownloadOptions, URLTransformer, FormatFilter } from '../../utils/FormatUtils.js'; + +import { InnertubeError } from '../../utils/Utils.js'; class VideoInfo { #page: [ParsedResponse, ParsedResponse?]; diff --git a/src/parser/youtube/index.ts b/src/parser/youtube/index.ts new file mode 100644 index 000000000..4d7149260 --- /dev/null +++ b/src/parser/youtube/index.ts @@ -0,0 +1,17 @@ +export { default as AccountInfo } from './AccountInfo.js'; +export { default as Analytics } from './Analytics.js'; +export { default as Channel } from './Channel.js'; +export * from './Channel.js'; +export { default as Comments } from './Comments.js'; +export { default as History } from './History.js'; +export { default as HomeFeed } from './HomeFeed.js'; +export { default as ItemMenu } from './ItemMenu.js'; +export { default as Library } from './Library.js'; +export { default as LiveChat } from './LiveChat.js'; +export { default as NotificationsMenu } from './NotificationsMenu.js'; +export { default as Playlist } from './Playlist.js'; +export { default as Search } from './Search.js'; +export { default as Settings } from './Settings.js'; +export { default as SmoothedQueue } from './SmoothedQueue.js'; +export { default as TimeWatched } from './TimeWatched.js'; +export { default as VideoInfo } from './VideoInfo.js'; diff --git a/src/parser/ytkids/Channel.ts b/src/parser/ytkids/Channel.ts index 4ece04685..2f82071d5 100644 --- a/src/parser/ytkids/Channel.ts +++ b/src/parser/ytkids/Channel.ts @@ -1,8 +1,8 @@ -import Feed from '../../core/Feed'; -import Actions from '../../core/Actions'; -import C4TabbedHeader from '../classes/C4TabbedHeader'; -import ItemSection from '../classes/ItemSection'; -import { ItemSectionContinuation } from '..'; +import Feed from '../../core/Feed.js'; +import Actions from '../../core/Actions.js'; +import C4TabbedHeader from '../classes/C4TabbedHeader.js'; +import ItemSection from '../classes/ItemSection.js'; +import { ItemSectionContinuation } from '../index.js'; class Channel extends Feed { header?: C4TabbedHeader; diff --git a/src/parser/ytkids/HomeFeed.ts b/src/parser/ytkids/HomeFeed.ts index 05d890f7b..d9359edbf 100644 --- a/src/parser/ytkids/HomeFeed.ts +++ b/src/parser/ytkids/HomeFeed.ts @@ -1,9 +1,9 @@ -import Feed from '../../core/Feed'; -import Actions from '../../core/Actions'; -import KidsCategoriesHeader from '../classes/ytkids/KidsCategoriesHeader'; -import KidsCategoryTab from '../classes/ytkids/KidsCategoryTab'; -import KidsHomeScreen from '../classes/ytkids/KidsHomeScreen'; -import { InnertubeError } from '../../utils/Utils'; +import Feed from '../../core/Feed.js'; +import Actions from '../../core/Actions.js'; +import KidsCategoriesHeader from '../classes/ytkids/KidsCategoriesHeader.js'; +import KidsCategoryTab from '../classes/ytkids/KidsCategoryTab.js'; +import KidsHomeScreen from '../classes/ytkids/KidsHomeScreen.js'; +import { InnertubeError } from '../../utils/Utils.js'; class HomeFeed extends Feed { header?: KidsCategoriesHeader; diff --git a/src/parser/ytkids/Search.ts b/src/parser/ytkids/Search.ts index fce2e4ae4..0c109fef2 100644 --- a/src/parser/ytkids/Search.ts +++ b/src/parser/ytkids/Search.ts @@ -1,8 +1,8 @@ -import Feed from '../../core/Feed'; -import ItemSection from '../classes/ItemSection'; -import { InnertubeError } from '../../utils/Utils'; -import type Actions from '../../core/Actions'; -import type { ObservedArray, YTNode } from '../helpers'; +import Feed from '../../core/Feed.js'; +import ItemSection from '../classes/ItemSection.js'; +import { InnertubeError } from '../../utils/Utils.js'; +import type Actions from '../../core/Actions.js'; +import type { ObservedArray, YTNode } from '../helpers.js'; class Search extends Feed { estimated_results: number | null; diff --git a/src/parser/ytkids/VideoInfo.ts b/src/parser/ytkids/VideoInfo.ts index fe8804996..7ee819fe3 100644 --- a/src/parser/ytkids/VideoInfo.ts +++ b/src/parser/ytkids/VideoInfo.ts @@ -1,20 +1,20 @@ -import Parser, { ParsedResponse } from '..'; +import Parser, { ParsedResponse } from '../index.js'; -import ItemSection from '../classes/ItemSection'; -import NavigationEndpoint from '../classes/NavigationEndpoint'; -import PlayerOverlay from '../classes/PlayerOverlay'; -import SlimVideoMetadata from '../classes/SlimVideoMetadata'; -import TwoColumnWatchNextResults from '../classes/TwoColumnWatchNextResults'; +import ItemSection from '../classes/ItemSection.js'; +import NavigationEndpoint from '../classes/NavigationEndpoint.js'; +import PlayerOverlay from '../classes/PlayerOverlay.js'; +import SlimVideoMetadata from '../classes/SlimVideoMetadata.js'; +import TwoColumnWatchNextResults from '../classes/TwoColumnWatchNextResults.js'; -import type Format from '../classes/misc/Format'; -import type Actions from '../../core/Actions'; -import type { ApiResponse } from '../../core/Actions'; -import type { ObservedArray, YTNode } from '../helpers'; +import type Format from '../classes/misc/Format.js'; +import type Actions from '../../core/Actions.js'; +import type { ApiResponse } from '../../core/Actions.js'; +import type { ObservedArray, YTNode } from '../helpers.js'; -import { Constants } from '../../utils'; -import { InnertubeError } from '../../utils/Utils'; +import { Constants } from '../../utils/index.js'; +import { InnertubeError } from '../../utils/Utils.js'; -import FormatUtils, { DownloadOptions, FormatFilter, FormatOptions, URLTransformer } from '../../utils/FormatUtils'; +import FormatUtils, { DownloadOptions, FormatFilter, FormatOptions, URLTransformer } from '../../utils/FormatUtils.js'; class VideoInfo { #page: [ParsedResponse, ParsedResponse?]; diff --git a/src/parser/ytkids/index.ts b/src/parser/ytkids/index.ts new file mode 100644 index 000000000..fe6ffc802 --- /dev/null +++ b/src/parser/ytkids/index.ts @@ -0,0 +1,4 @@ +export { default as Channel } from './Channel.js'; +export { default as HomeFeed } from './HomeFeed.js'; +export { default as Search } from './Search.js'; +export { default as VideoInfo } from './VideoInfo.js'; diff --git a/src/parser/ytmusic/Album.ts b/src/parser/ytmusic/Album.ts index a9c307d65..bf7f18611 100644 --- a/src/parser/ytmusic/Album.ts +++ b/src/parser/ytmusic/Album.ts @@ -1,14 +1,14 @@ -import type Actions from '../../core/Actions'; -import type { ApiResponse } from '../../core/Actions'; -import type { ObservedArray } from '../helpers'; -import Parser, { ParsedResponse } from '../index'; +import type Actions from '../../core/Actions.js'; +import type { ApiResponse } from '../../core/Actions.js'; +import type { ObservedArray } from '../helpers.js'; +import Parser, { ParsedResponse } from '../index.js'; -import MicroformatData from '../classes/MicroformatData'; -import MusicCarouselShelf from '../classes/MusicCarouselShelf'; -import MusicDetailHeader from '../classes/MusicDetailHeader'; -import MusicShelf from '../classes/MusicShelf'; +import MicroformatData from '../classes/MicroformatData.js'; +import MusicCarouselShelf from '../classes/MusicCarouselShelf.js'; +import MusicDetailHeader from '../classes/MusicDetailHeader.js'; +import MusicShelf from '../classes/MusicShelf.js'; -import type MusicResponsiveListItem from '../classes/MusicResponsiveListItem'; +import type MusicResponsiveListItem from '../classes/MusicResponsiveListItem.js'; class Album { #page: ParsedResponse; diff --git a/src/parser/ytmusic/Artist.ts b/src/parser/ytmusic/Artist.ts index e013df125..479eb771d 100644 --- a/src/parser/ytmusic/Artist.ts +++ b/src/parser/ytmusic/Artist.ts @@ -1,14 +1,14 @@ -import Parser, { ParsedResponse } from '../index'; -import type Actions from '../../core/Actions'; -import type { ApiResponse } from '../../core/Actions'; -import { InnertubeError } from '../../utils/Utils'; - -import MusicShelf from '../classes/MusicShelf'; -import MusicCarouselShelf from '../classes/MusicCarouselShelf'; -import MusicPlaylistShelf from '../classes/MusicPlaylistShelf'; -import MusicImmersiveHeader from '../classes/MusicImmersiveHeader'; -import MusicVisualHeader from '../classes/MusicVisualHeader'; -import MusicHeader from '../classes/MusicHeader'; +import Parser, { ParsedResponse } from '../index.js'; +import type Actions from '../../core/Actions.js'; +import type { ApiResponse } from '../../core/Actions.js'; +import { InnertubeError } from '../../utils/Utils.js'; + +import MusicShelf from '../classes/MusicShelf.js'; +import MusicCarouselShelf from '../classes/MusicCarouselShelf.js'; +import MusicPlaylistShelf from '../classes/MusicPlaylistShelf.js'; +import MusicImmersiveHeader from '../classes/MusicImmersiveHeader.js'; +import MusicVisualHeader from '../classes/MusicVisualHeader.js'; +import MusicHeader from '../classes/MusicHeader.js'; class Artist { #page: ParsedResponse; diff --git a/src/parser/ytmusic/Explore.ts b/src/parser/ytmusic/Explore.ts index a6e672789..4d1c222d0 100644 --- a/src/parser/ytmusic/Explore.ts +++ b/src/parser/ytmusic/Explore.ts @@ -1,14 +1,14 @@ -import Parser, { ParsedResponse } from '..'; +import Parser, { ParsedResponse } from '../index.js'; -import Grid from '../classes/Grid'; -import MusicCarouselShelf from '../classes/MusicCarouselShelf'; -import MusicNavigationButton from '../classes/MusicNavigationButton'; -import SectionList from '../classes/SectionList'; -import SingleColumnBrowseResults from '../classes/SingleColumnBrowseResults'; +import Grid from '../classes/Grid.js'; +import MusicCarouselShelf from '../classes/MusicCarouselShelf.js'; +import MusicNavigationButton from '../classes/MusicNavigationButton.js'; +import SectionList from '../classes/SectionList.js'; +import SingleColumnBrowseResults from '../classes/SingleColumnBrowseResults.js'; -import type { ApiResponse } from '../../core/Actions'; -import type { ObservedArray } from '../helpers'; -import { InnertubeError } from '../../utils/Utils'; +import type { ApiResponse } from '../../core/Actions.js'; +import type { ObservedArray } from '../helpers.js'; +import { InnertubeError } from '../../utils/Utils.js'; class Explore { #page: ParsedResponse; diff --git a/src/parser/ytmusic/HomeFeed.ts b/src/parser/ytmusic/HomeFeed.ts index 660f18fc5..f4c35ba9e 100644 --- a/src/parser/ytmusic/HomeFeed.ts +++ b/src/parser/ytmusic/HomeFeed.ts @@ -1,13 +1,13 @@ -import type Actions from '../../core/Actions'; -import type { ApiResponse } from '../../core/Actions'; -import type { ObservedArray } from '../helpers'; -import { InnertubeError } from '../../utils/Utils'; +import type Actions from '../../core/Actions.js'; +import type { ApiResponse } from '../../core/Actions.js'; +import type { ObservedArray } from '../helpers.js'; +import { InnertubeError } from '../../utils/Utils.js'; -import Parser, { ParsedResponse, SectionListContinuation } from '../index'; +import Parser, { ParsedResponse, SectionListContinuation } from '../index.js'; -import MusicCarouselShelf from '../classes/MusicCarouselShelf'; -import SectionList from '../classes/SectionList'; -import SingleColumnBrowseResults from '../classes/SingleColumnBrowseResults'; +import MusicCarouselShelf from '../classes/MusicCarouselShelf.js'; +import SectionList from '../classes/SectionList.js'; +import SingleColumnBrowseResults from '../classes/SingleColumnBrowseResults.js'; class HomeFeed { #page: ParsedResponse; diff --git a/src/parser/ytmusic/Library.ts b/src/parser/ytmusic/Library.ts index ff5c354db..f94e80713 100644 --- a/src/parser/ytmusic/Library.ts +++ b/src/parser/ytmusic/Library.ts @@ -1,21 +1,21 @@ -import Parser, { ParsedResponse, SectionListContinuation } from '..'; -import type Actions from '../../core/Actions'; -import type { ApiResponse } from '../../core/Actions'; - -import Grid from '../classes/Grid'; -import MusicShelf from '../classes/MusicShelf'; -import MusicSideAlignedItem from '../classes/MusicSideAlignedItem'; -import NavigationEndpoint from '../classes/NavigationEndpoint'; -import SectionList from '../classes/SectionList'; - -import ChipCloud from '../classes/ChipCloud'; -import ChipCloudChip from '../classes/ChipCloudChip'; -import MusicMultiSelectMenuItem from '../classes/menus/MusicMultiSelectMenuItem'; -import MusicSortFilterButton from '../classes/MusicSortFilterButton'; -import MusicMenuItemDivider from '../classes/menus/MusicMenuItemDivider'; - -import { InnertubeError } from '../../utils/Utils'; -import type { ObservedArray } from '../helpers'; +import Parser, { ParsedResponse, SectionListContinuation } from '../index.js'; +import type Actions from '../../core/Actions.js'; +import type { ApiResponse } from '../../core/Actions.js'; + +import Grid from '../classes/Grid.js'; +import MusicShelf from '../classes/MusicShelf.js'; +import MusicSideAlignedItem from '../classes/MusicSideAlignedItem.js'; +import NavigationEndpoint from '../classes/NavigationEndpoint.js'; +import SectionList from '../classes/SectionList.js'; + +import ChipCloud from '../classes/ChipCloud.js'; +import ChipCloudChip from '../classes/ChipCloudChip.js'; +import MusicMultiSelectMenuItem from '../classes/menus/MusicMultiSelectMenuItem.js'; +import MusicSortFilterButton from '../classes/MusicSortFilterButton.js'; +import MusicMenuItemDivider from '../classes/menus/MusicMenuItemDivider.js'; + +import { InnertubeError } from '../../utils/Utils.js'; +import type { ObservedArray } from '../helpers.js'; class Library { #page: ParsedResponse; diff --git a/src/parser/ytmusic/Playlist.ts b/src/parser/ytmusic/Playlist.ts index 5192ac059..9d125969a 100644 --- a/src/parser/ytmusic/Playlist.ts +++ b/src/parser/ytmusic/Playlist.ts @@ -1,17 +1,17 @@ -import Parser, { MusicPlaylistShelfContinuation, ParsedResponse, SectionListContinuation } from '../index'; - -import MusicCarouselShelf from '../classes/MusicCarouselShelf'; -import MusicDetailHeader from '../classes/MusicDetailHeader'; -import MusicEditablePlaylistDetailHeader from '../classes/MusicEditablePlaylistDetailHeader'; -import MusicPlaylistShelf from '../classes/MusicPlaylistShelf'; -import MusicResponsiveListItem from '../classes/MusicResponsiveListItem'; -import MusicShelf from '../classes/MusicShelf'; -import SectionList from '../classes/SectionList'; - -import { InnertubeError } from '../../utils/Utils'; -import type { ObservedArray, YTNode } from '../helpers'; -import type Actions from '../../core/Actions'; -import type { ApiResponse } from '../../core/Actions'; +import Parser, { MusicPlaylistShelfContinuation, ParsedResponse, SectionListContinuation } from '../index.js'; + +import MusicCarouselShelf from '../classes/MusicCarouselShelf.js'; +import MusicDetailHeader from '../classes/MusicDetailHeader.js'; +import MusicEditablePlaylistDetailHeader from '../classes/MusicEditablePlaylistDetailHeader.js'; +import MusicPlaylistShelf from '../classes/MusicPlaylistShelf.js'; +import MusicResponsiveListItem from '../classes/MusicResponsiveListItem.js'; +import MusicShelf from '../classes/MusicShelf.js'; +import SectionList from '../classes/SectionList.js'; + +import { InnertubeError } from '../../utils/Utils.js'; +import type { ObservedArray, YTNode } from '../helpers.js'; +import type Actions from '../../core/Actions.js'; +import type { ApiResponse } from '../../core/Actions.js'; class Playlist { #page: ParsedResponse; diff --git a/src/parser/ytmusic/Recap.ts b/src/parser/ytmusic/Recap.ts index 55305a592..8bb8001b2 100644 --- a/src/parser/ytmusic/Recap.ts +++ b/src/parser/ytmusic/Recap.ts @@ -1,22 +1,22 @@ -import Parser, { ParsedResponse } from '../index'; +import Parser, { ParsedResponse } from '../index.js'; -import type Actions from '../../core/Actions'; -import type { ApiResponse } from '../../core/Actions'; +import type Actions from '../../core/Actions.js'; +import type { ApiResponse } from '../../core/Actions.js'; -import HighlightsCarousel from '../classes/HighlightsCarousel'; -import MusicCarouselShelf from '../classes/MusicCarouselShelf'; -import MusicElementHeader from '../classes/MusicElementHeader'; -import MusicHeader from '../classes/MusicHeader'; -import SingleColumnBrowseResults from '../classes/SingleColumnBrowseResults'; -import Playlist from './Playlist'; +import HighlightsCarousel from '../classes/HighlightsCarousel.js'; +import MusicCarouselShelf from '../classes/MusicCarouselShelf.js'; +import MusicElementHeader from '../classes/MusicElementHeader.js'; +import MusicHeader from '../classes/MusicHeader.js'; +import SingleColumnBrowseResults from '../classes/SingleColumnBrowseResults.js'; +import Playlist from './Playlist.js'; -import ItemSection from '../classes/ItemSection'; -import Message from '../classes/Message'; -import SectionList from '../classes/SectionList'; -import Tab from '../classes/Tab'; +import ItemSection from '../classes/ItemSection.js'; +import Message from '../classes/Message.js'; +import SectionList from '../classes/SectionList.js'; +import Tab from '../classes/Tab.js'; -import { InnertubeError } from '../../utils/Utils'; -import type { ObservedArray } from '../helpers'; +import { InnertubeError } from '../../utils/Utils.js'; +import type { ObservedArray } from '../helpers.js'; class Recap { #page: ParsedResponse; diff --git a/src/parser/ytmusic/Search.ts b/src/parser/ytmusic/Search.ts index e845fb0e8..26ecfcd7a 100644 --- a/src/parser/ytmusic/Search.ts +++ b/src/parser/ytmusic/Search.ts @@ -1,23 +1,23 @@ -import type Actions from '../../core/Actions'; -import type { ApiResponse } from '../../core/Actions'; +import type Actions from '../../core/Actions.js'; +import type { ApiResponse } from '../../core/Actions.js'; -import Parser, { ParsedResponse } from '../index'; -import { InnertubeError } from '../../utils/Utils'; +import Parser, { ParsedResponse } from '../index.js'; +import { InnertubeError } from '../../utils/Utils.js'; -import SectionList from '../classes/SectionList'; -import TabbedSearchResults from '../classes/TabbedSearchResults'; +import SectionList from '../classes/SectionList.js'; +import TabbedSearchResults from '../classes/TabbedSearchResults.js'; -import DidYouMean from '../classes/DidYouMean'; -import MusicResponsiveListItem from '../classes/MusicResponsiveListItem'; -import MusicShelf from '../classes/MusicShelf'; -import ShowingResultsFor from '../classes/ShowingResultsFor'; +import DidYouMean from '../classes/DidYouMean.js'; +import MusicResponsiveListItem from '../classes/MusicResponsiveListItem.js'; +import MusicShelf from '../classes/MusicShelf.js'; +import ShowingResultsFor from '../classes/ShowingResultsFor.js'; -import ChipCloud from '../classes/ChipCloud'; -import ChipCloudChip from '../classes/ChipCloudChip'; -import ItemSection from '../classes/ItemSection'; -import Message from '../classes/Message'; +import ChipCloud from '../classes/ChipCloud.js'; +import ChipCloudChip from '../classes/ChipCloudChip.js'; +import ItemSection from '../classes/ItemSection.js'; +import Message from '../classes/Message.js'; -import type { ObservedArray } from '../helpers'; +import type { ObservedArray } from '../helpers.js'; class Search { #page: ParsedResponse; diff --git a/src/parser/ytmusic/TrackInfo.ts b/src/parser/ytmusic/TrackInfo.ts index 27e43eeb4..e4cce7bd9 100644 --- a/src/parser/ytmusic/TrackInfo.ts +++ b/src/parser/ytmusic/TrackInfo.ts @@ -1,31 +1,31 @@ -import Parser, { ParsedResponse } from '..'; -import type Actions from '../../core/Actions'; -import type { ApiResponse } from '../../core/Actions'; - -import Constants from '../../utils/Constants'; -import { InnertubeError } from '../../utils/Utils'; - -import AutomixPreviewVideo from '../classes/AutomixPreviewVideo'; -import Endscreen from '../classes/Endscreen'; -import Message from '../classes/Message'; -import MicroformatData from '../classes/MicroformatData'; -import MusicCarouselShelf from '../classes/MusicCarouselShelf'; -import MusicDescriptionShelf from '../classes/MusicDescriptionShelf'; -import MusicQueue from '../classes/MusicQueue'; -import PlayerOverlay from '../classes/PlayerOverlay'; -import PlaylistPanel from '../classes/PlaylistPanel'; -import RichGrid from '../classes/RichGrid'; -import SectionList from '../classes/SectionList'; -import Tab from '../classes/Tab'; -import WatchNextTabbedResults from '../classes/WatchNextTabbedResults'; - -import type NavigationEndpoint from '../classes/NavigationEndpoint'; -import type PlayerLiveStoryboardSpec from '../classes/PlayerLiveStoryboardSpec'; -import type PlayerStoryboardSpec from '../classes/PlayerStoryboardSpec'; -import type Format from '../classes/misc/Format'; - -import type { ObservedArray, YTNode } from '../helpers'; -import FormatUtils, { URLTransformer, FormatOptions, DownloadOptions, FormatFilter } from '../../utils/FormatUtils'; +import Parser, { ParsedResponse } from '../index.js'; +import type Actions from '../../core/Actions.js'; +import type { ApiResponse } from '../../core/Actions.js'; + +import Constants from '../../utils/Constants.js'; +import { InnertubeError } from '../../utils/Utils.js'; + +import AutomixPreviewVideo from '../classes/AutomixPreviewVideo.js'; +import Endscreen from '../classes/Endscreen.js'; +import Message from '../classes/Message.js'; +import MicroformatData from '../classes/MicroformatData.js'; +import MusicCarouselShelf from '../classes/MusicCarouselShelf.js'; +import MusicDescriptionShelf from '../classes/MusicDescriptionShelf.js'; +import MusicQueue from '../classes/MusicQueue.js'; +import PlayerOverlay from '../classes/PlayerOverlay.js'; +import PlaylistPanel from '../classes/PlaylistPanel.js'; +import RichGrid from '../classes/RichGrid.js'; +import SectionList from '../classes/SectionList.js'; +import Tab from '../classes/Tab.js'; +import WatchNextTabbedResults from '../classes/WatchNextTabbedResults.js'; + +import type NavigationEndpoint from '../classes/NavigationEndpoint.js'; +import type PlayerLiveStoryboardSpec from '../classes/PlayerLiveStoryboardSpec.js'; +import type PlayerStoryboardSpec from '../classes/PlayerStoryboardSpec.js'; +import type Format from '../classes/misc/Format.js'; + +import type { ObservedArray, YTNode } from '../helpers.js'; +import FormatUtils, { URLTransformer, FormatOptions, DownloadOptions, FormatFilter } from '../../utils/FormatUtils.js'; class TrackInfo { #page: [ ParsedResponse, ParsedResponse? ]; diff --git a/src/parser/ytmusic/index.ts b/src/parser/ytmusic/index.ts new file mode 100644 index 000000000..e4bd9a267 --- /dev/null +++ b/src/parser/ytmusic/index.ts @@ -0,0 +1,10 @@ +export { default as Album } from './Album.js'; +export { default as Artist } from './Artist.js'; +export { default as Explore } from './Explore.js'; +export { default as HomeFeed } from './HomeFeed.js'; +export { default as Library } from './Library.js'; +export * from './Library.js'; +export { default as Playlist } from './Playlist.js'; +export { default as Recap } from './Recap.js'; +export { default as Search } from './Search.js'; +export { default as TrackInfo } from './TrackInfo.js'; diff --git a/src/platform/README.md b/src/platform/README.md new file mode 100644 index 000000000..abaf085a0 --- /dev/null +++ b/src/platform/README.md @@ -0,0 +1,54 @@ +# Platform Support + +YouTube.js is designed to be as platform agnostic as possible. To achieve this, we require all platforms wishing to use YouTube.js to provide a few shims around the platform's native APIs. + +## Supported Platforms + +We provide shims for the following platforms: + +- Modern Browsers +- Node.js +- Deno + +## Contributing Support for a New Platform + +If you wish to bring YouTube.js to another platform, you will need to provide the following shims as specified by the `PlatformShim` type: + +- `runtime`: String name of the platform. +- `info`: Object containing the package information read from `package.json`. + - `version`: The version of the package. + - `bugs_url`: The URL to the package's bug tracker. + - `repository_url`: The URL to the package's repository. +- `server`: Boolean indicating whether the platform is a server or not. Used for setting some additional headers not possible on a web browser. +- `Cache`: Class that implements the `ICache` interface using the platform's native APIs. +- `sha1hash(data: string)`: Function that takes a string and returns a SHA-1 hash of it. +- `uuidv4()`: Function that returns a UUIDv4 string. +- `eval(code: string, env: Record)`: Function to evaluate untrusted javascript script and return the result. +- `DOMParser`: DOMParser implementation. Used for generating DASH manifests. +- `fetch`: WHATWG Fetch API implementation. +- `Headers`: Headers implementation. +- `Request`: Request implementation. +- `Response`: Response implementation. +- `FormData`: FormData implementation. +- `File`: File implementation. +- `ReadableStream`: ReadableStream implementation. + +An entry point for the platform should be added in the `src/platform` directory and should be formatted as follows: + +```ts +import { Platform } from '../utils/Utils.js'; +import { PlatformShim } from "../types"; +import { ICache } from '../types/Cache.js'; + +class Cache implements ICache { + // ... +} + +Platform.load({ + // ... shims +}); + +export * from './lib.js'; +import Innertube from './lib.js'; +export default Innertube; +``` diff --git a/src/platform/deno.ts b/src/platform/deno.ts new file mode 100644 index 000000000..bec09d0ac --- /dev/null +++ b/src/platform/deno.ts @@ -0,0 +1,113 @@ +// Deno Platform Support +import type { ICache } from '../types/Cache.js'; +import { Platform } from '../utils/Utils.js'; +import DOMParser from './polyfills/server-dom.js'; +import evaluate from './jsruntime/jinter.js'; +import sha1Hash from './polyfills/web-crypto.js'; +import package_json from '../../package.json' assert { type: 'json' }; + +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore +const Deno = globalThis.Deno as any; + +class Cache implements ICache { + #persistent_directory: string; + #persistent: boolean; + + constructor(persistent = false, persistent_directory?: string) { + this.#persistent_directory = persistent_directory || Cache.default_persistent_directory; + this.#persistent = persistent; + } + + static get temp_directory() { + return `${Deno.env.get('TMPDIR') || Deno.env.get('TMP') || Deno.env.get('TEMP') || '/tmp'}/youtubei.js`; + } + + static get default_persistent_directory() { + return `${Deno.cwd()}/.cache/youtubei.js`; + } + + get cache_dir() { + return this.#persistent ? this.#persistent_directory : Cache.temp_directory; + } + + async #createCache() { + const dir = this.cache_dir; + try { + const cwd = await Deno.stat(dir); + if (!cwd.isDirectory) + throw new Error('An unexpected file was found in place of the cache directory'); + } catch (e) { + if (e instanceof Deno.errors.NotFound) + await Deno.mkdir(dir, { recursive: true }); + else + throw e; + } + } + + async get(key: string) { + await this.#createCache(); + const file = `${this.cache_dir}/${key}`; + try { + const stat = await Deno.stat(file); + if (stat.isFile) { + const data: Uint8Array = await Deno.readFile(file); + return data.buffer; + } + throw new Error('An unexpected file was found in place of the cache key'); + + } catch (e) { + if (e instanceof Deno.errors.NotFound) + return undefined; + throw e; + } + } + + async set(key: string, value: ArrayBuffer) { + await this.#createCache(); + const file = `${this.cache_dir}/${key}`; + await Deno.writeFile(file, new Uint8Array(value)); + } + + async remove(key: string) { + await this.#createCache(); + const file = `${this.cache_dir}/${key}`; + try { + await Deno.remove(file); + } catch (e) { + if (e instanceof Deno.errors.NotFound) return undefined; + throw e; + } + } +} + +Platform.load({ + runtime: 'deno', + info: { + version: package_json.version, + bugs_url: package_json.bugs.url, + repo_url: package_json.homepage.split('#')[0] + }, + server: true, + Cache: Cache, + sha1Hash, + uuidv4() { + return crypto.randomUUID(); + }, + eval: evaluate, + DOMParser, + serializeDOM(document) { + return document.toString(); + }, + fetch: globalThis.fetch, + Request: globalThis.Request, + Response: globalThis.Response, + Headers: globalThis.Headers, + FormData: globalThis.FormData, + File: globalThis.File, + ReadableStream: globalThis.ReadableStream +}); + +export * from './lib.js'; +import Innertube from './lib.js'; +export default Innertube; diff --git a/src/platform/jsruntime/jinter.ts b/src/platform/jsruntime/jinter.ts new file mode 100644 index 000000000..cae18475a --- /dev/null +++ b/src/platform/jsruntime/jinter.ts @@ -0,0 +1,10 @@ +import Jinter from 'jintr'; +import { VMPrimative } from '../../types/PlatformShim.js'; + +export default function evaluate(code: string, env: Record) { + const runtime = new Jinter.default(code); + for (const [ key, value ] of Object.entries(env)) { + runtime.scope.set(key, value); + } + return runtime.interpret(); +} \ No newline at end of file diff --git a/src/platform/lib.ts b/src/platform/lib.ts new file mode 100644 index 000000000..2d7b27afb --- /dev/null +++ b/src/platform/lib.ts @@ -0,0 +1,12 @@ +import Innertube from '../Innertube.js'; + +export * from '../core/index.js'; +export * from '../parser/index.js'; +export { default as Parser } from '../parser/index.js'; +export { default as Proto } from '../proto/index.js'; +export * as Types from '../types/index.js'; +export * from '../utils/index.js'; + +export { default as Innertube } from '../Innertube.js'; + +export default Innertube; \ No newline at end of file diff --git a/src/platform/node.ts b/src/platform/node.ts new file mode 100644 index 000000000..4ba8414ca --- /dev/null +++ b/src/platform/node.ts @@ -0,0 +1,131 @@ +// Node.js Platform Support +import { ReadableStream } from 'stream/web'; +import { + fetch as defaultFetch, + Request, + Response, + Headers, + FormData, + File +} from 'undici'; +import { ICache } from '../types/Cache.js'; +import { Platform } from '../utils/Utils.js'; +import crypto from 'crypto'; +import { FetchFunction } from '../types/PlatformShim.js'; +import path from 'path'; +import os from 'os'; +import fs from 'fs/promises'; +import { readFileSync } from 'fs'; +import DOMParser from './polyfills/server-dom.js'; +import { fileURLToPath } from 'url'; +import evaluate from './jsruntime/jinter.js'; + +const meta_url = import.meta.url; +const is_cjs = !meta_url; +const __dirname__ = is_cjs ? __dirname : path.dirname(fileURLToPath(meta_url)); + +const package_json = JSON.parse(readFileSync(path.resolve(__dirname__, is_cjs ? '../package.json' : '../../package.json'), 'utf-8')); + +class Cache implements ICache { + #persistent_directory: string; + #persistent: boolean; + + constructor(persistent = false, persistent_directory?: string) { + this.#persistent_directory = persistent_directory || Cache.default_persistent_directory; + this.#persistent = persistent; + } + + static get temp_directory() { + return `${os.tmpdir()}/youtubei.js`; + } + + static get default_persistent_directory() { + return path.resolve(__dirname__, '..', '..', '.cache', 'youtubei.js'); + } + + get cache_dir() { + return this.#persistent ? this.#persistent_directory : Cache.temp_directory; + } + + async #createCache() { + const dir = this.cache_dir; + try { + const cwd = await fs.stat(dir); + if (!cwd.isDirectory()) + throw new Error('An unexpected file was found in place of the cache directory'); + } catch (e: any) { + if (e?.code === 'ENOENT') + await fs.mkdir(dir, { recursive: true }); + else + throw e; + } + } + + async get(key: string) { + await this.#createCache(); + const file = path.resolve(this.cache_dir, key); + try { + const stat = await fs.stat(file); + if (stat.isFile()) { + const data: Buffer = await fs.readFile(file); + return data.buffer; + } + throw new Error('An unexpected file was found in place of the cache key'); + + } catch (e: any) { + if (e?.code === 'ENOENT') + return undefined; + throw e; + } + } + + async set(key: string, value: ArrayBuffer) { + await this.#createCache(); + const file = path.resolve(this.cache_dir, key); + await fs.writeFile(file, new Uint8Array(value)); + } + + async remove(key: string) { + await this.#createCache(); + const file = path.resolve(this.cache_dir, key); + try { + await fs.unlink(file); + } catch (e: any) { + if (e?.code === 'ENOENT') return; + throw e; + } + } +} + +Platform.load({ + runtime: 'node', + info: { + version: package_json.version, + bugs_url: package_json.bugs.url, + repo_url: package_json.homepage.split('#')[0] + }, + server: true, + Cache: Cache, + sha1Hash: async (data: string) => { + return crypto.createHash('sha1').update(data).digest('hex'); + }, + uuidv4() { + return crypto.randomUUID(); + }, + serializeDOM(document) { + return document.toString(); + }, + eval: evaluate, + DOMParser, + fetch: defaultFetch as unknown as FetchFunction, + Request: Request as unknown as typeof globalThis.Request, + Response: Response as unknown as typeof globalThis.Response, + Headers: Headers as unknown as typeof globalThis.Headers, + FormData: FormData as unknown as typeof globalThis.FormData, + File: File as unknown as typeof globalThis.File, + ReadableStream: ReadableStream as unknown as typeof globalThis.ReadableStream +}); + +export * from './lib.js'; +import Innertube from './lib.js'; +export default Innertube; \ No newline at end of file diff --git a/src/platform/polyfills/server-dom.ts b/src/platform/polyfills/server-dom.ts new file mode 100644 index 000000000..9d7fbfc4e --- /dev/null +++ b/src/platform/polyfills/server-dom.ts @@ -0,0 +1,3 @@ +import { DOMParser as DOMParserImpl } from 'linkedom'; + +export default DOMParserImpl as typeof globalThis.DOMParser; \ No newline at end of file diff --git a/src/platform/polyfills/web-crypto.ts b/src/platform/polyfills/web-crypto.ts new file mode 100644 index 000000000..7d94987cc --- /dev/null +++ b/src/platform/polyfills/web-crypto.ts @@ -0,0 +1,30 @@ +export default async function sha1Hash(str: string) { + const byteToHex = [ + '00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '0a', '0b', '0c', '0d', '0e', '0f', + '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '1a', '1b', '1c', '1d', '1e', '1f', + '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '2a', '2b', '2c', '2d', '2e', '2f', + '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '3a', '3b', '3c', '3d', '3e', '3f', + '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '4a', '4b', '4c', '4d', '4e', '4f', + '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '5a', '5b', '5c', '5d', '5e', '5f', + '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '6a', '6b', '6c', '6d', '6e', '6f', + '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '7a', '7b', '7c', '7d', '7e', '7f', + '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '8a', '8b', '8c', '8d', '8e', '8f', + '90', '91', '92', '93', '94', '95', '96', '97', '98', '99', '9a', '9b', '9c', '9d', '9e', '9f', + 'a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'a9', 'aa', 'ab', 'ac', 'ad', 'ae', 'af', + 'b0', 'b1', 'b2', 'b3', 'b4', 'b5', 'b6', 'b7', 'b8', 'b9', 'ba', 'bb', 'bc', 'bd', 'be', 'bf', + 'c0', 'c1', 'c2', 'c3', 'c4', 'c5', 'c6', 'c7', 'c8', 'c9', 'ca', 'cb', 'cc', 'cd', 'ce', 'cf', + 'd0', 'd1', 'd2', 'd3', 'd4', 'd5', 'd6', 'd7', 'd8', 'd9', 'da', 'db', 'dc', 'dd', 'de', 'df', + 'e0', 'e1', 'e2', 'e3', 'e4', 'e5', 'e6', 'e7', 'e8', 'e9', 'ea', 'eb', 'ec', 'ed', 'ee', 'ef', + 'f0', 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'fa', 'fb', 'fc', 'fd', 'fe', 'ff' + ]; + + function hex(arrayBuffer: ArrayBuffer): string { + const buff = new Uint8Array(arrayBuffer); + const hexOctets = []; + for (let i = 0; i < buff.length; ++i) + hexOctets.push(byteToHex[buff[i]]); + return hexOctets.join(''); + } + + return hex(await crypto.subtle.digest('SHA-1', new TextEncoder().encode(str))); +} \ No newline at end of file diff --git a/src/platform/web.ts b/src/platform/web.ts new file mode 100644 index 000000000..f1727d669 --- /dev/null +++ b/src/platform/web.ts @@ -0,0 +1,123 @@ +// Deno Platform Support +import { ICache } from '../types/Cache.js'; +import { Platform } from '../utils/Utils.js'; +import sha1Hash from './polyfills/web-crypto.js'; +import package_json from '../../package.json' assert { type: 'json' }; +import evaluate from './jsruntime/jinter.js'; + +class Cache implements ICache { + #persistent_directory: string; + #persistent: boolean; + + constructor(persistent = false, persistent_directory?: string) { + this.#persistent_directory = persistent_directory || ''; + this.#persistent = persistent; + } + + get cache_dir() { + return this.#persistent ? this.#persistent_directory : ''; + } + + #getBrowserDB() { + const indexedDB: IDBFactory = Reflect.get(globalThis, 'indexedDB') || Reflect.get(globalThis, 'webkitIndexedDB') || Reflect.get(globalThis, 'mozIndexedDB') || Reflect.get(globalThis, 'msIndexedDB'); + + if (!indexedDB) return console.log('IndexedDB is not supported. No cache will be used.'); + + return new Promise((resolve, reject) => { + const request = indexedDB.open('youtubei.js', 1); + request.onsuccess = function () { + resolve(this.result); + }; + + request.onerror = function (event) { + reject('indexedDB request error'); + console.error(event); + }; + + request.onupgradeneeded = function () { + const store = this.result.createObjectStore('kv-store', { + keyPath: 'k' + }); + + store.transaction.oncomplete = function () { + resolve(this.db); + }; + }; + }); + } + + async get(key: string) { + const db = await this.#getBrowserDB(); + if (!db) return; + + return new Promise((resolve, reject) => { + const request = db.transaction('kv-store', 'readonly').objectStore('kv-store').get(key); + request.onerror = reject; + request.onsuccess = function () { + const result: Uint8Array | undefined = this.result?.v; + resolve(result ? result.buffer : undefined); + }; + }); + } + + async set(key: string, value: ArrayBuffer) { + const db = await this.#getBrowserDB(); + if (!db) return; + + return new Promise((resolve, reject) => { + const request = db.transaction('kv-store', 'readwrite').objectStore('kv-store').put({ k: key, v: value }); + request.onerror = reject; + request.onsuccess = () => resolve(); + }); + } + + async remove(key: string) { + const db = await this.#getBrowserDB(); + if (!db) return; + + return new Promise((resolve, reject) => { + const request = db.transaction('kv-store', 'readwrite').objectStore('kv-store').delete(key); + request.onerror = reject; + request.onsuccess = () => resolve(); + }); + } +} + +Platform.load({ + runtime: 'browser', + server: false, + info: { + version: package_json.version, + bugs_url: package_json.bugs.url, + repo_url: package_json.homepage.split('#')[0] + }, + Cache: Cache, + sha1Hash, + uuidv4() { + if (globalThis.crypto?.randomUUID()) { + return globalThis.crypto.randomUUID(); + } + + // See https://stackoverflow.com/a/2117523 + return '10000000-1000-4000-8000-100000000000'.replace(/[018]/g, (cc) => { + const c = parseInt(cc); + return (c ^ window.crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16); + }); + }, + eval: evaluate, + DOMParser: globalThis.DOMParser, + serializeDOM(document) { + return new XMLSerializer().serializeToString(document); + }, + fetch: globalThis.fetch, + Request: globalThis.Request, + Response: globalThis.Response, + Headers: globalThis.Headers, + FormData: globalThis.FormData, + File: globalThis.File, + ReadableStream: globalThis.ReadableStream +}); + +export * from './lib.js'; +import Innertube from './lib.js'; +export default Innertube; \ No newline at end of file diff --git a/src/proto/generated/index.ts b/src/proto/generated/index.ts new file mode 100644 index 000000000..90b95984d --- /dev/null +++ b/src/proto/generated/index.ts @@ -0,0 +1,5 @@ +import * as messages from "./messages/index.js"; + +export type { + messages, +}; diff --git a/src/proto/generated/messages/index.ts b/src/proto/generated/messages/index.ts new file mode 100644 index 000000000..f19e8589e --- /dev/null +++ b/src/proto/generated/messages/index.ts @@ -0,0 +1,5 @@ +import * as youtube from "./youtube/index.js"; + +export type { + youtube, +}; diff --git a/src/proto/generated/messages/youtube/(ChannelAnalytics)/Params.ts b/src/proto/generated/messages/youtube/(ChannelAnalytics)/Params.ts new file mode 100644 index 000000000..30f6d0c67 --- /dev/null +++ b/src/proto/generated/messages/youtube/(ChannelAnalytics)/Params.ts @@ -0,0 +1,75 @@ +import { + tsValueToJsonValueFns, + jsonValueToTsValueFns, +} from "../../../runtime/json/scalar.js"; +import { + WireMessage, +} from "../../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../../runtime/wire/serialize.js"; +import { + tsValueToWireValueFns, + wireValueToTsValueFns, +} from "../../../runtime/wire/scalar.js"; +import { + default as deserialize, +} from "../../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube.ChannelAnalytics { + export type Params = { + channelId: string; + } +} + +export type Type = $.youtube.ChannelAnalytics.Params; + +export function getDefaultValue(): $.youtube.ChannelAnalytics.Params { + return { + channelId: "", + }; +} + +export function createValue(partialValue: Partial<$.youtube.ChannelAnalytics.Params>): $.youtube.ChannelAnalytics.Params { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.ChannelAnalytics.Params): unknown { + const result: any = {}; + if (value.channelId !== undefined) result.channelId = tsValueToJsonValueFns.string(value.channelId); + return result; +} + +export function decodeJson(value: any): $.youtube.ChannelAnalytics.Params { + const result = getDefaultValue(); + if (value.channelId !== undefined) result.channelId = jsonValueToTsValueFns.string(value.channelId); + return result; +} + +export function encodeBinary(value: $.youtube.ChannelAnalytics.Params): Uint8Array { + const result: WireMessage = []; + if (value.channelId !== undefined) { + const tsValue = value.channelId; + result.push( + [1001, tsValueToWireValueFns.string(tsValue)], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.ChannelAnalytics.Params { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(1001); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.string(wireValue); + if (value === undefined) break field; + result.channelId = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/(ChannelAnalytics)/index.ts b/src/proto/generated/messages/youtube/(ChannelAnalytics)/index.ts new file mode 100644 index 000000000..fdd997fd6 --- /dev/null +++ b/src/proto/generated/messages/youtube/(ChannelAnalytics)/index.ts @@ -0,0 +1 @@ +export type { Type as Params } from "./Params.js"; diff --git a/src/proto/generated/messages/youtube/(CreateCommentParams)/Params.ts b/src/proto/generated/messages/youtube/(CreateCommentParams)/Params.ts new file mode 100644 index 000000000..d3cf3005a --- /dev/null +++ b/src/proto/generated/messages/youtube/(CreateCommentParams)/Params.ts @@ -0,0 +1,75 @@ +import { + tsValueToJsonValueFns, + jsonValueToTsValueFns, +} from "../../../runtime/json/scalar.js"; +import { + WireMessage, +} from "../../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../../runtime/wire/serialize.js"; +import { + tsValueToWireValueFns, + wireValueToTsValueFns, +} from "../../../runtime/wire/scalar.js"; +import { + default as deserialize, +} from "../../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube.CreateCommentParams { + export type Params = { + index: number; + } +} + +export type Type = $.youtube.CreateCommentParams.Params; + +export function getDefaultValue(): $.youtube.CreateCommentParams.Params { + return { + index: 0, + }; +} + +export function createValue(partialValue: Partial<$.youtube.CreateCommentParams.Params>): $.youtube.CreateCommentParams.Params { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.CreateCommentParams.Params): unknown { + const result: any = {}; + if (value.index !== undefined) result.index = tsValueToJsonValueFns.int32(value.index); + return result; +} + +export function decodeJson(value: any): $.youtube.CreateCommentParams.Params { + const result = getDefaultValue(); + if (value.index !== undefined) result.index = jsonValueToTsValueFns.int32(value.index); + return result; +} + +export function encodeBinary(value: $.youtube.CreateCommentParams.Params): Uint8Array { + const result: WireMessage = []; + if (value.index !== undefined) { + const tsValue = value.index; + result.push( + [1, tsValueToWireValueFns.int32(tsValue)], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.CreateCommentParams.Params { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(1); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.index = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/(CreateCommentParams)/index.ts b/src/proto/generated/messages/youtube/(CreateCommentParams)/index.ts new file mode 100644 index 000000000..fdd997fd6 --- /dev/null +++ b/src/proto/generated/messages/youtube/(CreateCommentParams)/index.ts @@ -0,0 +1 @@ +export type { Type as Params } from "./Params.js"; diff --git a/src/proto/generated/messages/youtube/(GetCommentsSectionParams)/(Params)/(RepliesOptions)/UnkOpts.ts b/src/proto/generated/messages/youtube/(GetCommentsSectionParams)/(Params)/(RepliesOptions)/UnkOpts.ts new file mode 100644 index 000000000..3799cd741 --- /dev/null +++ b/src/proto/generated/messages/youtube/(GetCommentsSectionParams)/(Params)/(RepliesOptions)/UnkOpts.ts @@ -0,0 +1,75 @@ +import { + tsValueToJsonValueFns, + jsonValueToTsValueFns, +} from "../../../../../runtime/json/scalar.js"; +import { + WireMessage, +} from "../../../../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../../../../runtime/wire/serialize.js"; +import { + tsValueToWireValueFns, + wireValueToTsValueFns, +} from "../../../../../runtime/wire/scalar.js"; +import { + default as deserialize, +} from "../../../../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube.GetCommentsSectionParams.Params.RepliesOptions { + export type UnkOpts = { + unkParam: number; + } +} + +export type Type = $.youtube.GetCommentsSectionParams.Params.RepliesOptions.UnkOpts; + +export function getDefaultValue(): $.youtube.GetCommentsSectionParams.Params.RepliesOptions.UnkOpts { + return { + unkParam: 0, + }; +} + +export function createValue(partialValue: Partial<$.youtube.GetCommentsSectionParams.Params.RepliesOptions.UnkOpts>): $.youtube.GetCommentsSectionParams.Params.RepliesOptions.UnkOpts { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.GetCommentsSectionParams.Params.RepliesOptions.UnkOpts): unknown { + const result: any = {}; + if (value.unkParam !== undefined) result.unkParam = tsValueToJsonValueFns.int32(value.unkParam); + return result; +} + +export function decodeJson(value: any): $.youtube.GetCommentsSectionParams.Params.RepliesOptions.UnkOpts { + const result = getDefaultValue(); + if (value.unkParam !== undefined) result.unkParam = jsonValueToTsValueFns.int32(value.unkParam); + return result; +} + +export function encodeBinary(value: $.youtube.GetCommentsSectionParams.Params.RepliesOptions.UnkOpts): Uint8Array { + const result: WireMessage = []; + if (value.unkParam !== undefined) { + const tsValue = value.unkParam; + result.push( + [1, tsValueToWireValueFns.int32(tsValue)], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.GetCommentsSectionParams.Params.RepliesOptions.UnkOpts { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(1); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.unkParam = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/(GetCommentsSectionParams)/(Params)/(RepliesOptions)/index.ts b/src/proto/generated/messages/youtube/(GetCommentsSectionParams)/(Params)/(RepliesOptions)/index.ts new file mode 100644 index 000000000..edebe8b75 --- /dev/null +++ b/src/proto/generated/messages/youtube/(GetCommentsSectionParams)/(Params)/(RepliesOptions)/index.ts @@ -0,0 +1 @@ +export type { Type as UnkOpts } from "./UnkOpts.js"; diff --git a/src/proto/generated/messages/youtube/(GetCommentsSectionParams)/(Params)/Options.ts b/src/proto/generated/messages/youtube/(GetCommentsSectionParams)/(Params)/Options.ts new file mode 100644 index 000000000..582cd07eb --- /dev/null +++ b/src/proto/generated/messages/youtube/(GetCommentsSectionParams)/(Params)/Options.ts @@ -0,0 +1,109 @@ +import { + tsValueToJsonValueFns, + jsonValueToTsValueFns, +} from "../../../../runtime/json/scalar.js"; +import { + WireMessage, +} from "../../../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../../../runtime/wire/serialize.js"; +import { + tsValueToWireValueFns, + wireValueToTsValueFns, +} from "../../../../runtime/wire/scalar.js"; +import { + default as deserialize, +} from "../../../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube.GetCommentsSectionParams.Params { + export type Options = { + videoId: string; + sortBy: number; + type: number; + } +} + +export type Type = $.youtube.GetCommentsSectionParams.Params.Options; + +export function getDefaultValue(): $.youtube.GetCommentsSectionParams.Params.Options { + return { + videoId: "", + sortBy: 0, + type: 0, + }; +} + +export function createValue(partialValue: Partial<$.youtube.GetCommentsSectionParams.Params.Options>): $.youtube.GetCommentsSectionParams.Params.Options { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.GetCommentsSectionParams.Params.Options): unknown { + const result: any = {}; + if (value.videoId !== undefined) result.videoId = tsValueToJsonValueFns.string(value.videoId); + if (value.sortBy !== undefined) result.sortBy = tsValueToJsonValueFns.int32(value.sortBy); + if (value.type !== undefined) result.type = tsValueToJsonValueFns.int32(value.type); + return result; +} + +export function decodeJson(value: any): $.youtube.GetCommentsSectionParams.Params.Options { + const result = getDefaultValue(); + if (value.videoId !== undefined) result.videoId = jsonValueToTsValueFns.string(value.videoId); + if (value.sortBy !== undefined) result.sortBy = jsonValueToTsValueFns.int32(value.sortBy); + if (value.type !== undefined) result.type = jsonValueToTsValueFns.int32(value.type); + return result; +} + +export function encodeBinary(value: $.youtube.GetCommentsSectionParams.Params.Options): Uint8Array { + const result: WireMessage = []; + if (value.videoId !== undefined) { + const tsValue = value.videoId; + result.push( + [4, tsValueToWireValueFns.string(tsValue)], + ); + } + if (value.sortBy !== undefined) { + const tsValue = value.sortBy; + result.push( + [6, tsValueToWireValueFns.int32(tsValue)], + ); + } + if (value.type !== undefined) { + const tsValue = value.type; + result.push( + [15, tsValueToWireValueFns.int32(tsValue)], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.GetCommentsSectionParams.Params.Options { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(4); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.string(wireValue); + if (value === undefined) break field; + result.videoId = value; + } + field: { + const wireValue = wireFields.get(6); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.sortBy = value; + } + field: { + const wireValue = wireFields.get(15); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.type = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/(GetCommentsSectionParams)/(Params)/RepliesOptions.ts b/src/proto/generated/messages/youtube/(GetCommentsSectionParams)/(Params)/RepliesOptions.ts new file mode 100644 index 000000000..3b3fd0022 --- /dev/null +++ b/src/proto/generated/messages/youtube/(GetCommentsSectionParams)/(Params)/RepliesOptions.ts @@ -0,0 +1,168 @@ +import { + Type as UnkOpts, + encodeJson as encodeJson_1, + decodeJson as decodeJson_1, + encodeBinary as encodeBinary_1, + decodeBinary as decodeBinary_1, +} from "./(RepliesOptions)/UnkOpts.js"; +import { + tsValueToJsonValueFns, + jsonValueToTsValueFns, +} from "../../../../runtime/json/scalar.js"; +import { + WireMessage, + WireType, +} from "../../../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../../../runtime/wire/serialize.js"; +import { + tsValueToWireValueFns, + wireValueToTsValueFns, +} from "../../../../runtime/wire/scalar.js"; +import { + default as deserialize, +} from "../../../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube.GetCommentsSectionParams.Params { + export type RepliesOptions = { + commentId: string; + unkopts?: UnkOpts; + channelId?: string; + videoId: string; + unkParam1: number; + unkParam2: number; + } +} + +export type Type = $.youtube.GetCommentsSectionParams.Params.RepliesOptions; + +export function getDefaultValue(): $.youtube.GetCommentsSectionParams.Params.RepliesOptions { + return { + commentId: "", + unkopts: undefined, + channelId: undefined, + videoId: "", + unkParam1: 0, + unkParam2: 0, + }; +} + +export function createValue(partialValue: Partial<$.youtube.GetCommentsSectionParams.Params.RepliesOptions>): $.youtube.GetCommentsSectionParams.Params.RepliesOptions { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.GetCommentsSectionParams.Params.RepliesOptions): unknown { + const result: any = {}; + if (value.commentId !== undefined) result.commentId = tsValueToJsonValueFns.string(value.commentId); + if (value.unkopts !== undefined) result.unkopts = encodeJson_1(value.unkopts); + if (value.channelId !== undefined) result.channelId = tsValueToJsonValueFns.string(value.channelId); + if (value.videoId !== undefined) result.videoId = tsValueToJsonValueFns.string(value.videoId); + if (value.unkParam1 !== undefined) result.unkParam1 = tsValueToJsonValueFns.int32(value.unkParam1); + if (value.unkParam2 !== undefined) result.unkParam2 = tsValueToJsonValueFns.int32(value.unkParam2); + return result; +} + +export function decodeJson(value: any): $.youtube.GetCommentsSectionParams.Params.RepliesOptions { + const result = getDefaultValue(); + if (value.commentId !== undefined) result.commentId = jsonValueToTsValueFns.string(value.commentId); + if (value.unkopts !== undefined) result.unkopts = decodeJson_1(value.unkopts); + if (value.channelId !== undefined) result.channelId = jsonValueToTsValueFns.string(value.channelId); + if (value.videoId !== undefined) result.videoId = jsonValueToTsValueFns.string(value.videoId); + if (value.unkParam1 !== undefined) result.unkParam1 = jsonValueToTsValueFns.int32(value.unkParam1); + if (value.unkParam2 !== undefined) result.unkParam2 = jsonValueToTsValueFns.int32(value.unkParam2); + return result; +} + +export function encodeBinary(value: $.youtube.GetCommentsSectionParams.Params.RepliesOptions): Uint8Array { + const result: WireMessage = []; + if (value.commentId !== undefined) { + const tsValue = value.commentId; + result.push( + [2, tsValueToWireValueFns.string(tsValue)], + ); + } + if (value.unkopts !== undefined) { + const tsValue = value.unkopts; + result.push( + [4, { type: WireType.LengthDelimited as const, value: encodeBinary_1(tsValue) }], + ); + } + if (value.channelId !== undefined) { + const tsValue = value.channelId; + result.push( + [5, tsValueToWireValueFns.string(tsValue)], + ); + } + if (value.videoId !== undefined) { + const tsValue = value.videoId; + result.push( + [6, tsValueToWireValueFns.string(tsValue)], + ); + } + if (value.unkParam1 !== undefined) { + const tsValue = value.unkParam1; + result.push( + [8, tsValueToWireValueFns.int32(tsValue)], + ); + } + if (value.unkParam2 !== undefined) { + const tsValue = value.unkParam2; + result.push( + [9, tsValueToWireValueFns.int32(tsValue)], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.GetCommentsSectionParams.Params.RepliesOptions { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(2); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.string(wireValue); + if (value === undefined) break field; + result.commentId = value; + } + field: { + const wireValue = wireFields.get(4); + if (wireValue === undefined) break field; + const value = wireValue.type === WireType.LengthDelimited ? decodeBinary_1(wireValue.value) : undefined; + if (value === undefined) break field; + result.unkopts = value; + } + field: { + const wireValue = wireFields.get(5); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.string(wireValue); + if (value === undefined) break field; + result.channelId = value; + } + field: { + const wireValue = wireFields.get(6); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.string(wireValue); + if (value === undefined) break field; + result.videoId = value; + } + field: { + const wireValue = wireFields.get(8); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.unkParam1 = value; + } + field: { + const wireValue = wireFields.get(9); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.unkParam2 = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/(GetCommentsSectionParams)/(Params)/index.ts b/src/proto/generated/messages/youtube/(GetCommentsSectionParams)/(Params)/index.ts new file mode 100644 index 000000000..fd5fac0c6 --- /dev/null +++ b/src/proto/generated/messages/youtube/(GetCommentsSectionParams)/(Params)/index.ts @@ -0,0 +1,2 @@ +export type { Type as Options } from "./Options.js"; +export type { Type as RepliesOptions } from "./RepliesOptions.js"; diff --git a/src/proto/generated/messages/youtube/(GetCommentsSectionParams)/Context.ts b/src/proto/generated/messages/youtube/(GetCommentsSectionParams)/Context.ts new file mode 100644 index 000000000..c37868491 --- /dev/null +++ b/src/proto/generated/messages/youtube/(GetCommentsSectionParams)/Context.ts @@ -0,0 +1,75 @@ +import { + tsValueToJsonValueFns, + jsonValueToTsValueFns, +} from "../../../runtime/json/scalar.js"; +import { + WireMessage, +} from "../../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../../runtime/wire/serialize.js"; +import { + tsValueToWireValueFns, + wireValueToTsValueFns, +} from "../../../runtime/wire/scalar.js"; +import { + default as deserialize, +} from "../../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube.GetCommentsSectionParams { + export type Context = { + videoId: string; + } +} + +export type Type = $.youtube.GetCommentsSectionParams.Context; + +export function getDefaultValue(): $.youtube.GetCommentsSectionParams.Context { + return { + videoId: "", + }; +} + +export function createValue(partialValue: Partial<$.youtube.GetCommentsSectionParams.Context>): $.youtube.GetCommentsSectionParams.Context { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.GetCommentsSectionParams.Context): unknown { + const result: any = {}; + if (value.videoId !== undefined) result.videoId = tsValueToJsonValueFns.string(value.videoId); + return result; +} + +export function decodeJson(value: any): $.youtube.GetCommentsSectionParams.Context { + const result = getDefaultValue(); + if (value.videoId !== undefined) result.videoId = jsonValueToTsValueFns.string(value.videoId); + return result; +} + +export function encodeBinary(value: $.youtube.GetCommentsSectionParams.Context): Uint8Array { + const result: WireMessage = []; + if (value.videoId !== undefined) { + const tsValue = value.videoId; + result.push( + [2, tsValueToWireValueFns.string(tsValue)], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.GetCommentsSectionParams.Context { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(2); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.string(wireValue); + if (value === undefined) break field; + result.videoId = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/(GetCommentsSectionParams)/Params.ts b/src/proto/generated/messages/youtube/(GetCommentsSectionParams)/Params.ts new file mode 100644 index 000000000..1fb2f3031 --- /dev/null +++ b/src/proto/generated/messages/youtube/(GetCommentsSectionParams)/Params.ts @@ -0,0 +1,158 @@ +import { + Type as RepliesOptions, + encodeJson as encodeJson_1, + decodeJson as decodeJson_1, + encodeBinary as encodeBinary_1, + decodeBinary as decodeBinary_1, +} from "./(Params)/RepliesOptions.js"; +import { + Type as Options, + encodeJson as encodeJson_2, + decodeJson as decodeJson_2, + encodeBinary as encodeBinary_2, + decodeBinary as decodeBinary_2, +} from "./(Params)/Options.js"; +import { + tsValueToJsonValueFns, + jsonValueToTsValueFns, +} from "../../../runtime/json/scalar.js"; +import { + WireMessage, + WireType, +} from "../../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../../runtime/wire/serialize.js"; +import { + tsValueToWireValueFns, + wireValueToTsValueFns, +} from "../../../runtime/wire/scalar.js"; +import { + default as deserialize, +} from "../../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube.GetCommentsSectionParams { + export type Params = { + unkToken?: string; + repliesOpts?: RepliesOptions; + opts?: Options; + page?: number; + target: string; + } +} + +export type Type = $.youtube.GetCommentsSectionParams.Params; + +export function getDefaultValue(): $.youtube.GetCommentsSectionParams.Params { + return { + unkToken: undefined, + repliesOpts: undefined, + opts: undefined, + page: undefined, + target: "", + }; +} + +export function createValue(partialValue: Partial<$.youtube.GetCommentsSectionParams.Params>): $.youtube.GetCommentsSectionParams.Params { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.GetCommentsSectionParams.Params): unknown { + const result: any = {}; + if (value.unkToken !== undefined) result.unkToken = tsValueToJsonValueFns.string(value.unkToken); + if (value.repliesOpts !== undefined) result.repliesOpts = encodeJson_1(value.repliesOpts); + if (value.opts !== undefined) result.opts = encodeJson_2(value.opts); + if (value.page !== undefined) result.page = tsValueToJsonValueFns.int32(value.page); + if (value.target !== undefined) result.target = tsValueToJsonValueFns.string(value.target); + return result; +} + +export function decodeJson(value: any): $.youtube.GetCommentsSectionParams.Params { + const result = getDefaultValue(); + if (value.unkToken !== undefined) result.unkToken = jsonValueToTsValueFns.string(value.unkToken); + if (value.repliesOpts !== undefined) result.repliesOpts = decodeJson_1(value.repliesOpts); + if (value.opts !== undefined) result.opts = decodeJson_2(value.opts); + if (value.page !== undefined) result.page = jsonValueToTsValueFns.int32(value.page); + if (value.target !== undefined) result.target = jsonValueToTsValueFns.string(value.target); + return result; +} + +export function encodeBinary(value: $.youtube.GetCommentsSectionParams.Params): Uint8Array { + const result: WireMessage = []; + if (value.unkToken !== undefined) { + const tsValue = value.unkToken; + result.push( + [1, tsValueToWireValueFns.string(tsValue)], + ); + } + if (value.repliesOpts !== undefined) { + const tsValue = value.repliesOpts; + result.push( + [3, { type: WireType.LengthDelimited as const, value: encodeBinary_1(tsValue) }], + ); + } + if (value.opts !== undefined) { + const tsValue = value.opts; + result.push( + [4, { type: WireType.LengthDelimited as const, value: encodeBinary_2(tsValue) }], + ); + } + if (value.page !== undefined) { + const tsValue = value.page; + result.push( + [5, tsValueToWireValueFns.int32(tsValue)], + ); + } + if (value.target !== undefined) { + const tsValue = value.target; + result.push( + [8, tsValueToWireValueFns.string(tsValue)], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.GetCommentsSectionParams.Params { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(1); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.string(wireValue); + if (value === undefined) break field; + result.unkToken = value; + } + field: { + const wireValue = wireFields.get(3); + if (wireValue === undefined) break field; + const value = wireValue.type === WireType.LengthDelimited ? decodeBinary_1(wireValue.value) : undefined; + if (value === undefined) break field; + result.repliesOpts = value; + } + field: { + const wireValue = wireFields.get(4); + if (wireValue === undefined) break field; + const value = wireValue.type === WireType.LengthDelimited ? decodeBinary_2(wireValue.value) : undefined; + if (value === undefined) break field; + result.opts = value; + } + field: { + const wireValue = wireFields.get(5); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.page = value; + } + field: { + const wireValue = wireFields.get(8); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.string(wireValue); + if (value === undefined) break field; + result.target = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/(GetCommentsSectionParams)/index.ts b/src/proto/generated/messages/youtube/(GetCommentsSectionParams)/index.ts new file mode 100644 index 000000000..fef3279f4 --- /dev/null +++ b/src/proto/generated/messages/youtube/(GetCommentsSectionParams)/index.ts @@ -0,0 +1,2 @@ +export type { Type as Context } from "./Context.js"; +export type { Type as Params } from "./Params.js"; diff --git a/src/proto/generated/messages/youtube/(InnertubePayload)/(Context)/Client.ts b/src/proto/generated/messages/youtube/(InnertubePayload)/(Context)/Client.ts new file mode 100644 index 000000000..2d5e81ae9 --- /dev/null +++ b/src/proto/generated/messages/youtube/(InnertubePayload)/(Context)/Client.ts @@ -0,0 +1,109 @@ +import { + tsValueToJsonValueFns, + jsonValueToTsValueFns, +} from "../../../../runtime/json/scalar.js"; +import { + WireMessage, +} from "../../../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../../../runtime/wire/serialize.js"; +import { + tsValueToWireValueFns, + wireValueToTsValueFns, +} from "../../../../runtime/wire/scalar.js"; +import { + default as deserialize, +} from "../../../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube.InnertubePayload.Context { + export type Client = { + unkparam: number; + clientVersion: string; + clientName: string; + } +} + +export type Type = $.youtube.InnertubePayload.Context.Client; + +export function getDefaultValue(): $.youtube.InnertubePayload.Context.Client { + return { + unkparam: 0, + clientVersion: "", + clientName: "", + }; +} + +export function createValue(partialValue: Partial<$.youtube.InnertubePayload.Context.Client>): $.youtube.InnertubePayload.Context.Client { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.InnertubePayload.Context.Client): unknown { + const result: any = {}; + if (value.unkparam !== undefined) result.unkparam = tsValueToJsonValueFns.int32(value.unkparam); + if (value.clientVersion !== undefined) result.clientVersion = tsValueToJsonValueFns.string(value.clientVersion); + if (value.clientName !== undefined) result.clientName = tsValueToJsonValueFns.string(value.clientName); + return result; +} + +export function decodeJson(value: any): $.youtube.InnertubePayload.Context.Client { + const result = getDefaultValue(); + if (value.unkparam !== undefined) result.unkparam = jsonValueToTsValueFns.int32(value.unkparam); + if (value.clientVersion !== undefined) result.clientVersion = jsonValueToTsValueFns.string(value.clientVersion); + if (value.clientName !== undefined) result.clientName = jsonValueToTsValueFns.string(value.clientName); + return result; +} + +export function encodeBinary(value: $.youtube.InnertubePayload.Context.Client): Uint8Array { + const result: WireMessage = []; + if (value.unkparam !== undefined) { + const tsValue = value.unkparam; + result.push( + [16, tsValueToWireValueFns.int32(tsValue)], + ); + } + if (value.clientVersion !== undefined) { + const tsValue = value.clientVersion; + result.push( + [17, tsValueToWireValueFns.string(tsValue)], + ); + } + if (value.clientName !== undefined) { + const tsValue = value.clientName; + result.push( + [18, tsValueToWireValueFns.string(tsValue)], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.InnertubePayload.Context.Client { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(16); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.unkparam = value; + } + field: { + const wireValue = wireFields.get(17); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.string(wireValue); + if (value === undefined) break field; + result.clientVersion = value; + } + field: { + const wireValue = wireFields.get(18); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.string(wireValue); + if (value === undefined) break field; + result.clientName = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/(InnertubePayload)/(Context)/index.ts b/src/proto/generated/messages/youtube/(InnertubePayload)/(Context)/index.ts new file mode 100644 index 000000000..f0c8b3d36 --- /dev/null +++ b/src/proto/generated/messages/youtube/(InnertubePayload)/(Context)/index.ts @@ -0,0 +1 @@ +export type { Type as Client } from "./Client.js"; diff --git a/src/proto/generated/messages/youtube/(InnertubePayload)/(VideoThumbnail)/Thumbnail.ts b/src/proto/generated/messages/youtube/(InnertubePayload)/(VideoThumbnail)/Thumbnail.ts new file mode 100644 index 000000000..e7130a98c --- /dev/null +++ b/src/proto/generated/messages/youtube/(InnertubePayload)/(VideoThumbnail)/Thumbnail.ts @@ -0,0 +1,75 @@ +import { + tsValueToJsonValueFns, + jsonValueToTsValueFns, +} from "../../../../runtime/json/scalar.js"; +import { + WireMessage, +} from "../../../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../../../runtime/wire/serialize.js"; +import { + tsValueToWireValueFns, + wireValueToTsValueFns, +} from "../../../../runtime/wire/scalar.js"; +import { + default as deserialize, +} from "../../../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube.InnertubePayload.VideoThumbnail { + export type Thumbnail = { + imageData: Uint8Array; + } +} + +export type Type = $.youtube.InnertubePayload.VideoThumbnail.Thumbnail; + +export function getDefaultValue(): $.youtube.InnertubePayload.VideoThumbnail.Thumbnail { + return { + imageData: new Uint8Array(), + }; +} + +export function createValue(partialValue: Partial<$.youtube.InnertubePayload.VideoThumbnail.Thumbnail>): $.youtube.InnertubePayload.VideoThumbnail.Thumbnail { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.InnertubePayload.VideoThumbnail.Thumbnail): unknown { + const result: any = {}; + if (value.imageData !== undefined) result.imageData = tsValueToJsonValueFns.bytes(value.imageData); + return result; +} + +export function decodeJson(value: any): $.youtube.InnertubePayload.VideoThumbnail.Thumbnail { + const result = getDefaultValue(); + if (value.imageData !== undefined) result.imageData = jsonValueToTsValueFns.bytes(value.imageData); + return result; +} + +export function encodeBinary(value: $.youtube.InnertubePayload.VideoThumbnail.Thumbnail): Uint8Array { + const result: WireMessage = []; + if (value.imageData !== undefined) { + const tsValue = value.imageData; + result.push( + [1, tsValueToWireValueFns.bytes(tsValue)], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.InnertubePayload.VideoThumbnail.Thumbnail { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(1); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.bytes(wireValue); + if (value === undefined) break field; + result.imageData = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/(InnertubePayload)/(VideoThumbnail)/index.ts b/src/proto/generated/messages/youtube/(InnertubePayload)/(VideoThumbnail)/index.ts new file mode 100644 index 000000000..cbd7bf390 --- /dev/null +++ b/src/proto/generated/messages/youtube/(InnertubePayload)/(VideoThumbnail)/index.ts @@ -0,0 +1 @@ +export type { Type as Thumbnail } from "./Thumbnail.js"; diff --git a/src/proto/generated/messages/youtube/(InnertubePayload)/AgeRestricted.ts b/src/proto/generated/messages/youtube/(InnertubePayload)/AgeRestricted.ts new file mode 100644 index 000000000..5dbc44255 --- /dev/null +++ b/src/proto/generated/messages/youtube/(InnertubePayload)/AgeRestricted.ts @@ -0,0 +1,92 @@ +import { + tsValueToJsonValueFns, + jsonValueToTsValueFns, +} from "../../../runtime/json/scalar.js"; +import { + WireMessage, +} from "../../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../../runtime/wire/serialize.js"; +import { + tsValueToWireValueFns, + wireValueToTsValueFns, +} from "../../../runtime/wire/scalar.js"; +import { + default as deserialize, +} from "../../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube.InnertubePayload { + export type AgeRestricted = { + unkparam: number; + choice: number; + } +} + +export type Type = $.youtube.InnertubePayload.AgeRestricted; + +export function getDefaultValue(): $.youtube.InnertubePayload.AgeRestricted { + return { + unkparam: 0, + choice: 0, + }; +} + +export function createValue(partialValue: Partial<$.youtube.InnertubePayload.AgeRestricted>): $.youtube.InnertubePayload.AgeRestricted { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.InnertubePayload.AgeRestricted): unknown { + const result: any = {}; + if (value.unkparam !== undefined) result.unkparam = tsValueToJsonValueFns.int32(value.unkparam); + if (value.choice !== undefined) result.choice = tsValueToJsonValueFns.int32(value.choice); + return result; +} + +export function decodeJson(value: any): $.youtube.InnertubePayload.AgeRestricted { + const result = getDefaultValue(); + if (value.unkparam !== undefined) result.unkparam = jsonValueToTsValueFns.int32(value.unkparam); + if (value.choice !== undefined) result.choice = jsonValueToTsValueFns.int32(value.choice); + return result; +} + +export function encodeBinary(value: $.youtube.InnertubePayload.AgeRestricted): Uint8Array { + const result: WireMessage = []; + if (value.unkparam !== undefined) { + const tsValue = value.unkparam; + result.push( + [1, tsValueToWireValueFns.int32(tsValue)], + ); + } + if (value.choice !== undefined) { + const tsValue = value.choice; + result.push( + [2, tsValueToWireValueFns.int32(tsValue)], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.InnertubePayload.AgeRestricted { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(1); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.unkparam = value; + } + field: { + const wireValue = wireFields.get(2); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.choice = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/(InnertubePayload)/Category.ts b/src/proto/generated/messages/youtube/(InnertubePayload)/Category.ts new file mode 100644 index 000000000..aaa0db950 --- /dev/null +++ b/src/proto/generated/messages/youtube/(InnertubePayload)/Category.ts @@ -0,0 +1,75 @@ +import { + tsValueToJsonValueFns, + jsonValueToTsValueFns, +} from "../../../runtime/json/scalar.js"; +import { + WireMessage, +} from "../../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../../runtime/wire/serialize.js"; +import { + tsValueToWireValueFns, + wireValueToTsValueFns, +} from "../../../runtime/wire/scalar.js"; +import { + default as deserialize, +} from "../../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube.InnertubePayload { + export type Category = { + id: number; + } +} + +export type Type = $.youtube.InnertubePayload.Category; + +export function getDefaultValue(): $.youtube.InnertubePayload.Category { + return { + id: 0, + }; +} + +export function createValue(partialValue: Partial<$.youtube.InnertubePayload.Category>): $.youtube.InnertubePayload.Category { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.InnertubePayload.Category): unknown { + const result: any = {}; + if (value.id !== undefined) result.id = tsValueToJsonValueFns.int32(value.id); + return result; +} + +export function decodeJson(value: any): $.youtube.InnertubePayload.Category { + const result = getDefaultValue(); + if (value.id !== undefined) result.id = jsonValueToTsValueFns.int32(value.id); + return result; +} + +export function encodeBinary(value: $.youtube.InnertubePayload.Category): Uint8Array { + const result: WireMessage = []; + if (value.id !== undefined) { + const tsValue = value.id; + result.push( + [1, tsValueToWireValueFns.int32(tsValue)], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.InnertubePayload.Category { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(1); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.id = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/(InnertubePayload)/Context.ts b/src/proto/generated/messages/youtube/(InnertubePayload)/Context.ts new file mode 100644 index 000000000..9c914efec --- /dev/null +++ b/src/proto/generated/messages/youtube/(InnertubePayload)/Context.ts @@ -0,0 +1,78 @@ +import { + Type as Client, + encodeJson as encodeJson_1, + decodeJson as decodeJson_1, + encodeBinary as encodeBinary_1, + decodeBinary as decodeBinary_1, +} from "./(Context)/Client.js"; +import { + jsonValueToTsValueFns, +} from "../../../runtime/json/scalar.js"; +import { + WireMessage, + WireType, +} from "../../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../../runtime/wire/serialize.js"; +import { + default as deserialize, +} from "../../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube.InnertubePayload { + export type Context = { + client?: Client; + } +} + +export type Type = $.youtube.InnertubePayload.Context; + +export function getDefaultValue(): $.youtube.InnertubePayload.Context { + return { + client: undefined, + }; +} + +export function createValue(partialValue: Partial<$.youtube.InnertubePayload.Context>): $.youtube.InnertubePayload.Context { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.InnertubePayload.Context): unknown { + const result: any = {}; + if (value.client !== undefined) result.client = encodeJson_1(value.client); + return result; +} + +export function decodeJson(value: any): $.youtube.InnertubePayload.Context { + const result = getDefaultValue(); + if (value.client !== undefined) result.client = decodeJson_1(value.client); + return result; +} + +export function encodeBinary(value: $.youtube.InnertubePayload.Context): Uint8Array { + const result: WireMessage = []; + if (value.client !== undefined) { + const tsValue = value.client; + result.push( + [1, { type: WireType.LengthDelimited as const, value: encodeBinary_1(tsValue) }], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.InnertubePayload.Context { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(1); + if (wireValue === undefined) break field; + const value = wireValue.type === WireType.LengthDelimited ? decodeBinary_1(wireValue.value) : undefined; + if (value === undefined) break field; + result.client = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/(InnertubePayload)/Description.ts b/src/proto/generated/messages/youtube/(InnertubePayload)/Description.ts new file mode 100644 index 000000000..feaddb071 --- /dev/null +++ b/src/proto/generated/messages/youtube/(InnertubePayload)/Description.ts @@ -0,0 +1,75 @@ +import { + tsValueToJsonValueFns, + jsonValueToTsValueFns, +} from "../../../runtime/json/scalar.js"; +import { + WireMessage, +} from "../../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../../runtime/wire/serialize.js"; +import { + tsValueToWireValueFns, + wireValueToTsValueFns, +} from "../../../runtime/wire/scalar.js"; +import { + default as deserialize, +} from "../../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube.InnertubePayload { + export type Description = { + text: string; + } +} + +export type Type = $.youtube.InnertubePayload.Description; + +export function getDefaultValue(): $.youtube.InnertubePayload.Description { + return { + text: "", + }; +} + +export function createValue(partialValue: Partial<$.youtube.InnertubePayload.Description>): $.youtube.InnertubePayload.Description { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.InnertubePayload.Description): unknown { + const result: any = {}; + if (value.text !== undefined) result.text = tsValueToJsonValueFns.string(value.text); + return result; +} + +export function decodeJson(value: any): $.youtube.InnertubePayload.Description { + const result = getDefaultValue(); + if (value.text !== undefined) result.text = jsonValueToTsValueFns.string(value.text); + return result; +} + +export function encodeBinary(value: $.youtube.InnertubePayload.Description): Uint8Array { + const result: WireMessage = []; + if (value.text !== undefined) { + const tsValue = value.text; + result.push( + [1, tsValueToWireValueFns.string(tsValue)], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.InnertubePayload.Description { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(1); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.string(wireValue); + if (value === undefined) break field; + result.text = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/(InnertubePayload)/License.ts b/src/proto/generated/messages/youtube/(InnertubePayload)/License.ts new file mode 100644 index 000000000..c56b956cc --- /dev/null +++ b/src/proto/generated/messages/youtube/(InnertubePayload)/License.ts @@ -0,0 +1,75 @@ +import { + tsValueToJsonValueFns, + jsonValueToTsValueFns, +} from "../../../runtime/json/scalar.js"; +import { + WireMessage, +} from "../../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../../runtime/wire/serialize.js"; +import { + tsValueToWireValueFns, + wireValueToTsValueFns, +} from "../../../runtime/wire/scalar.js"; +import { + default as deserialize, +} from "../../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube.InnertubePayload { + export type License = { + type: string; + } +} + +export type Type = $.youtube.InnertubePayload.License; + +export function getDefaultValue(): $.youtube.InnertubePayload.License { + return { + type: "", + }; +} + +export function createValue(partialValue: Partial<$.youtube.InnertubePayload.License>): $.youtube.InnertubePayload.License { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.InnertubePayload.License): unknown { + const result: any = {}; + if (value.type !== undefined) result.type = tsValueToJsonValueFns.string(value.type); + return result; +} + +export function decodeJson(value: any): $.youtube.InnertubePayload.License { + const result = getDefaultValue(); + if (value.type !== undefined) result.type = jsonValueToTsValueFns.string(value.type); + return result; +} + +export function encodeBinary(value: $.youtube.InnertubePayload.License): Uint8Array { + const result: WireMessage = []; + if (value.type !== undefined) { + const tsValue = value.type; + result.push( + [1, tsValueToWireValueFns.string(tsValue)], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.InnertubePayload.License { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(1); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.string(wireValue); + if (value === undefined) break field; + result.type = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/(InnertubePayload)/MadeForKids.ts b/src/proto/generated/messages/youtube/(InnertubePayload)/MadeForKids.ts new file mode 100644 index 000000000..b40ca45b1 --- /dev/null +++ b/src/proto/generated/messages/youtube/(InnertubePayload)/MadeForKids.ts @@ -0,0 +1,92 @@ +import { + tsValueToJsonValueFns, + jsonValueToTsValueFns, +} from "../../../runtime/json/scalar.js"; +import { + WireMessage, +} from "../../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../../runtime/wire/serialize.js"; +import { + tsValueToWireValueFns, + wireValueToTsValueFns, +} from "../../../runtime/wire/scalar.js"; +import { + default as deserialize, +} from "../../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube.InnertubePayload { + export type MadeForKids = { + unkparam: number; + choice: number; + } +} + +export type Type = $.youtube.InnertubePayload.MadeForKids; + +export function getDefaultValue(): $.youtube.InnertubePayload.MadeForKids { + return { + unkparam: 0, + choice: 0, + }; +} + +export function createValue(partialValue: Partial<$.youtube.InnertubePayload.MadeForKids>): $.youtube.InnertubePayload.MadeForKids { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.InnertubePayload.MadeForKids): unknown { + const result: any = {}; + if (value.unkparam !== undefined) result.unkparam = tsValueToJsonValueFns.int32(value.unkparam); + if (value.choice !== undefined) result.choice = tsValueToJsonValueFns.int32(value.choice); + return result; +} + +export function decodeJson(value: any): $.youtube.InnertubePayload.MadeForKids { + const result = getDefaultValue(); + if (value.unkparam !== undefined) result.unkparam = jsonValueToTsValueFns.int32(value.unkparam); + if (value.choice !== undefined) result.choice = jsonValueToTsValueFns.int32(value.choice); + return result; +} + +export function encodeBinary(value: $.youtube.InnertubePayload.MadeForKids): Uint8Array { + const result: WireMessage = []; + if (value.unkparam !== undefined) { + const tsValue = value.unkparam; + result.push( + [1, tsValueToWireValueFns.int32(tsValue)], + ); + } + if (value.choice !== undefined) { + const tsValue = value.choice; + result.push( + [2, tsValueToWireValueFns.int32(tsValue)], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.InnertubePayload.MadeForKids { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(1); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.unkparam = value; + } + field: { + const wireValue = wireFields.get(2); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.choice = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/(InnertubePayload)/Privacy.ts b/src/proto/generated/messages/youtube/(InnertubePayload)/Privacy.ts new file mode 100644 index 000000000..cf1079412 --- /dev/null +++ b/src/proto/generated/messages/youtube/(InnertubePayload)/Privacy.ts @@ -0,0 +1,75 @@ +import { + tsValueToJsonValueFns, + jsonValueToTsValueFns, +} from "../../../runtime/json/scalar.js"; +import { + WireMessage, +} from "../../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../../runtime/wire/serialize.js"; +import { + tsValueToWireValueFns, + wireValueToTsValueFns, +} from "../../../runtime/wire/scalar.js"; +import { + default as deserialize, +} from "../../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube.InnertubePayload { + export type Privacy = { + type: number; + } +} + +export type Type = $.youtube.InnertubePayload.Privacy; + +export function getDefaultValue(): $.youtube.InnertubePayload.Privacy { + return { + type: 0, + }; +} + +export function createValue(partialValue: Partial<$.youtube.InnertubePayload.Privacy>): $.youtube.InnertubePayload.Privacy { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.InnertubePayload.Privacy): unknown { + const result: any = {}; + if (value.type !== undefined) result.type = tsValueToJsonValueFns.int32(value.type); + return result; +} + +export function decodeJson(value: any): $.youtube.InnertubePayload.Privacy { + const result = getDefaultValue(); + if (value.type !== undefined) result.type = jsonValueToTsValueFns.int32(value.type); + return result; +} + +export function encodeBinary(value: $.youtube.InnertubePayload.Privacy): Uint8Array { + const result: WireMessage = []; + if (value.type !== undefined) { + const tsValue = value.type; + result.push( + [1, tsValueToWireValueFns.int32(tsValue)], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.InnertubePayload.Privacy { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(1); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.type = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/(InnertubePayload)/Tags.ts b/src/proto/generated/messages/youtube/(InnertubePayload)/Tags.ts new file mode 100644 index 000000000..67a8c4a44 --- /dev/null +++ b/src/proto/generated/messages/youtube/(InnertubePayload)/Tags.ts @@ -0,0 +1,73 @@ +import { + tsValueToJsonValueFns, + jsonValueToTsValueFns, +} from "../../../runtime/json/scalar.js"; +import { + WireMessage, +} from "../../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../../runtime/wire/serialize.js"; +import { + tsValueToWireValueFns, + wireValueToTsValueFns, +} from "../../../runtime/wire/scalar.js"; +import { + default as deserialize, +} from "../../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube.InnertubePayload { + export type Tags = { + list: string[]; + } +} + +export type Type = $.youtube.InnertubePayload.Tags; + +export function getDefaultValue(): $.youtube.InnertubePayload.Tags { + return { + list: [], + }; +} + +export function createValue(partialValue: Partial<$.youtube.InnertubePayload.Tags>): $.youtube.InnertubePayload.Tags { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.InnertubePayload.Tags): unknown { + const result: any = {}; + result.list = value.list.map(value => tsValueToJsonValueFns.string(value)); + return result; +} + +export function decodeJson(value: any): $.youtube.InnertubePayload.Tags { + const result = getDefaultValue(); + result.list = value.list?.map((value: any) => jsonValueToTsValueFns.string(value)) ?? []; + return result; +} + +export function encodeBinary(value: $.youtube.InnertubePayload.Tags): Uint8Array { + const result: WireMessage = []; + for (const tsValue of value.list) { + result.push( + [1, tsValueToWireValueFns.string(tsValue)], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.InnertubePayload.Tags { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + collection: { + const wireValues = wireMessage.filter(([fieldNumber]) => fieldNumber === 1).map(([, wireValue]) => wireValue); + const value = wireValues.map((wireValue) => wireValueToTsValueFns.string(wireValue)).filter(x => x !== undefined); + if (!value.length) break collection; + result.list = value as any; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/(InnertubePayload)/Title.ts b/src/proto/generated/messages/youtube/(InnertubePayload)/Title.ts new file mode 100644 index 000000000..9b97c8d4f --- /dev/null +++ b/src/proto/generated/messages/youtube/(InnertubePayload)/Title.ts @@ -0,0 +1,75 @@ +import { + tsValueToJsonValueFns, + jsonValueToTsValueFns, +} from "../../../runtime/json/scalar.js"; +import { + WireMessage, +} from "../../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../../runtime/wire/serialize.js"; +import { + tsValueToWireValueFns, + wireValueToTsValueFns, +} from "../../../runtime/wire/scalar.js"; +import { + default as deserialize, +} from "../../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube.InnertubePayload { + export type Title = { + text: string; + } +} + +export type Type = $.youtube.InnertubePayload.Title; + +export function getDefaultValue(): $.youtube.InnertubePayload.Title { + return { + text: "", + }; +} + +export function createValue(partialValue: Partial<$.youtube.InnertubePayload.Title>): $.youtube.InnertubePayload.Title { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.InnertubePayload.Title): unknown { + const result: any = {}; + if (value.text !== undefined) result.text = tsValueToJsonValueFns.string(value.text); + return result; +} + +export function decodeJson(value: any): $.youtube.InnertubePayload.Title { + const result = getDefaultValue(); + if (value.text !== undefined) result.text = jsonValueToTsValueFns.string(value.text); + return result; +} + +export function encodeBinary(value: $.youtube.InnertubePayload.Title): Uint8Array { + const result: WireMessage = []; + if (value.text !== undefined) { + const tsValue = value.text; + result.push( + [1, tsValueToWireValueFns.string(tsValue)], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.InnertubePayload.Title { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(1); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.string(wireValue); + if (value === undefined) break field; + result.text = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/(InnertubePayload)/VideoThumbnail.ts b/src/proto/generated/messages/youtube/(InnertubePayload)/VideoThumbnail.ts new file mode 100644 index 000000000..a12c43c7a --- /dev/null +++ b/src/proto/generated/messages/youtube/(InnertubePayload)/VideoThumbnail.ts @@ -0,0 +1,100 @@ +import { + Type as Thumbnail, + encodeJson as encodeJson_1, + decodeJson as decodeJson_1, + encodeBinary as encodeBinary_1, + decodeBinary as decodeBinary_1, +} from "./(VideoThumbnail)/Thumbnail.js"; +import { + tsValueToJsonValueFns, + jsonValueToTsValueFns, +} from "../../../runtime/json/scalar.js"; +import { + WireMessage, + WireType, +} from "../../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../../runtime/wire/serialize.js"; +import { + tsValueToWireValueFns, + wireValueToTsValueFns, +} from "../../../runtime/wire/scalar.js"; +import { + default as deserialize, +} from "../../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube.InnertubePayload { + export type VideoThumbnail = { + type: number; + thumbnail?: Thumbnail; + } +} + +export type Type = $.youtube.InnertubePayload.VideoThumbnail; + +export function getDefaultValue(): $.youtube.InnertubePayload.VideoThumbnail { + return { + type: 0, + thumbnail: undefined, + }; +} + +export function createValue(partialValue: Partial<$.youtube.InnertubePayload.VideoThumbnail>): $.youtube.InnertubePayload.VideoThumbnail { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.InnertubePayload.VideoThumbnail): unknown { + const result: any = {}; + if (value.type !== undefined) result.type = tsValueToJsonValueFns.int32(value.type); + if (value.thumbnail !== undefined) result.thumbnail = encodeJson_1(value.thumbnail); + return result; +} + +export function decodeJson(value: any): $.youtube.InnertubePayload.VideoThumbnail { + const result = getDefaultValue(); + if (value.type !== undefined) result.type = jsonValueToTsValueFns.int32(value.type); + if (value.thumbnail !== undefined) result.thumbnail = decodeJson_1(value.thumbnail); + return result; +} + +export function encodeBinary(value: $.youtube.InnertubePayload.VideoThumbnail): Uint8Array { + const result: WireMessage = []; + if (value.type !== undefined) { + const tsValue = value.type; + result.push( + [1, tsValueToWireValueFns.int32(tsValue)], + ); + } + if (value.thumbnail !== undefined) { + const tsValue = value.thumbnail; + result.push( + [3, { type: WireType.LengthDelimited as const, value: encodeBinary_1(tsValue) }], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.InnertubePayload.VideoThumbnail { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(1); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.type = value; + } + field: { + const wireValue = wireFields.get(3); + if (wireValue === undefined) break field; + const value = wireValue.type === WireType.LengthDelimited ? decodeBinary_1(wireValue.value) : undefined; + if (value === undefined) break field; + result.thumbnail = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/(InnertubePayload)/index.ts b/src/proto/generated/messages/youtube/(InnertubePayload)/index.ts new file mode 100644 index 000000000..04cc23ca3 --- /dev/null +++ b/src/proto/generated/messages/youtube/(InnertubePayload)/index.ts @@ -0,0 +1,10 @@ +export type { Type as Context } from "./Context.js"; +export type { Type as Title } from "./Title.js"; +export type { Type as Description } from "./Description.js"; +export type { Type as Tags } from "./Tags.js"; +export type { Type as Privacy } from "./Privacy.js"; +export type { Type as Category } from "./Category.js"; +export type { Type as MadeForKids } from "./MadeForKids.js"; +export type { Type as AgeRestricted } from "./AgeRestricted.js"; +export type { Type as License } from "./License.js"; +export type { Type as VideoThumbnail } from "./VideoThumbnail.js"; diff --git a/src/proto/generated/messages/youtube/(LiveMessageParams)/(Params)/Ids.ts b/src/proto/generated/messages/youtube/(LiveMessageParams)/(Params)/Ids.ts new file mode 100644 index 000000000..5b83935d4 --- /dev/null +++ b/src/proto/generated/messages/youtube/(LiveMessageParams)/(Params)/Ids.ts @@ -0,0 +1,92 @@ +import { + tsValueToJsonValueFns, + jsonValueToTsValueFns, +} from "../../../../runtime/json/scalar.js"; +import { + WireMessage, +} from "../../../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../../../runtime/wire/serialize.js"; +import { + tsValueToWireValueFns, + wireValueToTsValueFns, +} from "../../../../runtime/wire/scalar.js"; +import { + default as deserialize, +} from "../../../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube.LiveMessageParams.Params { + export type Ids = { + channelId: string; + videoId: string; + } +} + +export type Type = $.youtube.LiveMessageParams.Params.Ids; + +export function getDefaultValue(): $.youtube.LiveMessageParams.Params.Ids { + return { + channelId: "", + videoId: "", + }; +} + +export function createValue(partialValue: Partial<$.youtube.LiveMessageParams.Params.Ids>): $.youtube.LiveMessageParams.Params.Ids { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.LiveMessageParams.Params.Ids): unknown { + const result: any = {}; + if (value.channelId !== undefined) result.channelId = tsValueToJsonValueFns.string(value.channelId); + if (value.videoId !== undefined) result.videoId = tsValueToJsonValueFns.string(value.videoId); + return result; +} + +export function decodeJson(value: any): $.youtube.LiveMessageParams.Params.Ids { + const result = getDefaultValue(); + if (value.channelId !== undefined) result.channelId = jsonValueToTsValueFns.string(value.channelId); + if (value.videoId !== undefined) result.videoId = jsonValueToTsValueFns.string(value.videoId); + return result; +} + +export function encodeBinary(value: $.youtube.LiveMessageParams.Params.Ids): Uint8Array { + const result: WireMessage = []; + if (value.channelId !== undefined) { + const tsValue = value.channelId; + result.push( + [1, tsValueToWireValueFns.string(tsValue)], + ); + } + if (value.videoId !== undefined) { + const tsValue = value.videoId; + result.push( + [2, tsValueToWireValueFns.string(tsValue)], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.LiveMessageParams.Params.Ids { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(1); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.string(wireValue); + if (value === undefined) break field; + result.channelId = value; + } + field: { + const wireValue = wireFields.get(2); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.string(wireValue); + if (value === undefined) break field; + result.videoId = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/(LiveMessageParams)/(Params)/index.ts b/src/proto/generated/messages/youtube/(LiveMessageParams)/(Params)/index.ts new file mode 100644 index 000000000..1f60fdfa3 --- /dev/null +++ b/src/proto/generated/messages/youtube/(LiveMessageParams)/(Params)/index.ts @@ -0,0 +1 @@ +export type { Type as Ids } from "./Ids.js"; diff --git a/src/proto/generated/messages/youtube/(LiveMessageParams)/Params.ts b/src/proto/generated/messages/youtube/(LiveMessageParams)/Params.ts new file mode 100644 index 000000000..68f69504e --- /dev/null +++ b/src/proto/generated/messages/youtube/(LiveMessageParams)/Params.ts @@ -0,0 +1,78 @@ +import { + Type as Ids, + encodeJson as encodeJson_1, + decodeJson as decodeJson_1, + encodeBinary as encodeBinary_1, + decodeBinary as decodeBinary_1, +} from "./(Params)/Ids.js"; +import { + jsonValueToTsValueFns, +} from "../../../runtime/json/scalar.js"; +import { + WireMessage, + WireType, +} from "../../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../../runtime/wire/serialize.js"; +import { + default as deserialize, +} from "../../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube.LiveMessageParams { + export type Params = { + ids?: Ids; + } +} + +export type Type = $.youtube.LiveMessageParams.Params; + +export function getDefaultValue(): $.youtube.LiveMessageParams.Params { + return { + ids: undefined, + }; +} + +export function createValue(partialValue: Partial<$.youtube.LiveMessageParams.Params>): $.youtube.LiveMessageParams.Params { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.LiveMessageParams.Params): unknown { + const result: any = {}; + if (value.ids !== undefined) result.ids = encodeJson_1(value.ids); + return result; +} + +export function decodeJson(value: any): $.youtube.LiveMessageParams.Params { + const result = getDefaultValue(); + if (value.ids !== undefined) result.ids = decodeJson_1(value.ids); + return result; +} + +export function encodeBinary(value: $.youtube.LiveMessageParams.Params): Uint8Array { + const result: WireMessage = []; + if (value.ids !== undefined) { + const tsValue = value.ids; + result.push( + [5, { type: WireType.LengthDelimited as const, value: encodeBinary_1(tsValue) }], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.LiveMessageParams.Params { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(5); + if (wireValue === undefined) break field; + const value = wireValue.type === WireType.LengthDelimited ? decodeBinary_1(wireValue.value) : undefined; + if (value === undefined) break field; + result.ids = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/(LiveMessageParams)/index.ts b/src/proto/generated/messages/youtube/(LiveMessageParams)/index.ts new file mode 100644 index 000000000..fdd997fd6 --- /dev/null +++ b/src/proto/generated/messages/youtube/(LiveMessageParams)/index.ts @@ -0,0 +1 @@ +export type { Type as Params } from "./Params.js"; diff --git a/src/proto/generated/messages/youtube/(MusicSearchFilter)/(Filters)/Type.ts b/src/proto/generated/messages/youtube/(MusicSearchFilter)/(Filters)/Type.ts new file mode 100644 index 000000000..90c6c51bf --- /dev/null +++ b/src/proto/generated/messages/youtube/(MusicSearchFilter)/(Filters)/Type.ts @@ -0,0 +1,143 @@ +import { + tsValueToJsonValueFns, + jsonValueToTsValueFns, +} from "../../../../runtime/json/scalar.js"; +import { + WireMessage, +} from "../../../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../../../runtime/wire/serialize.js"; +import { + tsValueToWireValueFns, + wireValueToTsValueFns, +} from "../../../../runtime/wire/scalar.js"; +import { + default as deserialize, +} from "../../../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube.MusicSearchFilter.Filters { + export type Type = { + song?: number; + video?: number; + album?: number; + artist?: number; + playlist?: number; + } +} + +export type Type = $.youtube.MusicSearchFilter.Filters.Type; + +export function getDefaultValue(): $.youtube.MusicSearchFilter.Filters.Type { + return { + song: undefined, + video: undefined, + album: undefined, + artist: undefined, + playlist: undefined, + }; +} + +export function createValue(partialValue: Partial<$.youtube.MusicSearchFilter.Filters.Type>): $.youtube.MusicSearchFilter.Filters.Type { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.MusicSearchFilter.Filters.Type): unknown { + const result: any = {}; + if (value.song !== undefined) result.song = tsValueToJsonValueFns.int32(value.song); + if (value.video !== undefined) result.video = tsValueToJsonValueFns.int32(value.video); + if (value.album !== undefined) result.album = tsValueToJsonValueFns.int32(value.album); + if (value.artist !== undefined) result.artist = tsValueToJsonValueFns.int32(value.artist); + if (value.playlist !== undefined) result.playlist = tsValueToJsonValueFns.int32(value.playlist); + return result; +} + +export function decodeJson(value: any): $.youtube.MusicSearchFilter.Filters.Type { + const result = getDefaultValue(); + if (value.song !== undefined) result.song = jsonValueToTsValueFns.int32(value.song); + if (value.video !== undefined) result.video = jsonValueToTsValueFns.int32(value.video); + if (value.album !== undefined) result.album = jsonValueToTsValueFns.int32(value.album); + if (value.artist !== undefined) result.artist = jsonValueToTsValueFns.int32(value.artist); + if (value.playlist !== undefined) result.playlist = jsonValueToTsValueFns.int32(value.playlist); + return result; +} + +export function encodeBinary(value: $.youtube.MusicSearchFilter.Filters.Type): Uint8Array { + const result: WireMessage = []; + if (value.song !== undefined) { + const tsValue = value.song; + result.push( + [1, tsValueToWireValueFns.int32(tsValue)], + ); + } + if (value.video !== undefined) { + const tsValue = value.video; + result.push( + [2, tsValueToWireValueFns.int32(tsValue)], + ); + } + if (value.album !== undefined) { + const tsValue = value.album; + result.push( + [3, tsValueToWireValueFns.int32(tsValue)], + ); + } + if (value.artist !== undefined) { + const tsValue = value.artist; + result.push( + [4, tsValueToWireValueFns.int32(tsValue)], + ); + } + if (value.playlist !== undefined) { + const tsValue = value.playlist; + result.push( + [5, tsValueToWireValueFns.int32(tsValue)], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.MusicSearchFilter.Filters.Type { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(1); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.song = value; + } + field: { + const wireValue = wireFields.get(2); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.video = value; + } + field: { + const wireValue = wireFields.get(3); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.album = value; + } + field: { + const wireValue = wireFields.get(4); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.artist = value; + } + field: { + const wireValue = wireFields.get(5); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.playlist = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/(MusicSearchFilter)/(Filters)/index.ts b/src/proto/generated/messages/youtube/(MusicSearchFilter)/(Filters)/index.ts new file mode 100644 index 000000000..a77f865ab --- /dev/null +++ b/src/proto/generated/messages/youtube/(MusicSearchFilter)/(Filters)/index.ts @@ -0,0 +1 @@ +export type { Type as Type } from "./Type.js"; diff --git a/src/proto/generated/messages/youtube/(MusicSearchFilter)/Filters.ts b/src/proto/generated/messages/youtube/(MusicSearchFilter)/Filters.ts new file mode 100644 index 000000000..5b0d030a2 --- /dev/null +++ b/src/proto/generated/messages/youtube/(MusicSearchFilter)/Filters.ts @@ -0,0 +1,78 @@ +import { + Type as Type_1, + encodeJson as encodeJson_1, + decodeJson as decodeJson_1, + encodeBinary as encodeBinary_1, + decodeBinary as decodeBinary_1, +} from "./(Filters)/Type.js"; +import { + jsonValueToTsValueFns, +} from "../../../runtime/json/scalar.js"; +import { + WireMessage, + WireType, +} from "../../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../../runtime/wire/serialize.js"; +import { + default as deserialize, +} from "../../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube.MusicSearchFilter { + export type Filters = { + type?: Type_1; + } +} + +export type Type = $.youtube.MusicSearchFilter.Filters; + +export function getDefaultValue(): $.youtube.MusicSearchFilter.Filters { + return { + type: undefined, + }; +} + +export function createValue(partialValue: Partial<$.youtube.MusicSearchFilter.Filters>): $.youtube.MusicSearchFilter.Filters { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.MusicSearchFilter.Filters): unknown { + const result: any = {}; + if (value.type !== undefined) result.type = encodeJson_1(value.type); + return result; +} + +export function decodeJson(value: any): $.youtube.MusicSearchFilter.Filters { + const result = getDefaultValue(); + if (value.type !== undefined) result.type = decodeJson_1(value.type); + return result; +} + +export function encodeBinary(value: $.youtube.MusicSearchFilter.Filters): Uint8Array { + const result: WireMessage = []; + if (value.type !== undefined) { + const tsValue = value.type; + result.push( + [17, { type: WireType.LengthDelimited as const, value: encodeBinary_1(tsValue) }], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.MusicSearchFilter.Filters { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(17); + if (wireValue === undefined) break field; + const value = wireValue.type === WireType.LengthDelimited ? decodeBinary_1(wireValue.value) : undefined; + if (value === undefined) break field; + result.type = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/(MusicSearchFilter)/index.ts b/src/proto/generated/messages/youtube/(MusicSearchFilter)/index.ts new file mode 100644 index 000000000..a4dbe22a4 --- /dev/null +++ b/src/proto/generated/messages/youtube/(MusicSearchFilter)/index.ts @@ -0,0 +1 @@ +export type { Type as Filters } from "./Filters.js"; diff --git a/src/proto/generated/messages/youtube/(NotificationPreferences)/Preference.ts b/src/proto/generated/messages/youtube/(NotificationPreferences)/Preference.ts new file mode 100644 index 000000000..f91b0db0a --- /dev/null +++ b/src/proto/generated/messages/youtube/(NotificationPreferences)/Preference.ts @@ -0,0 +1,75 @@ +import { + tsValueToJsonValueFns, + jsonValueToTsValueFns, +} from "../../../runtime/json/scalar.js"; +import { + WireMessage, +} from "../../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../../runtime/wire/serialize.js"; +import { + tsValueToWireValueFns, + wireValueToTsValueFns, +} from "../../../runtime/wire/scalar.js"; +import { + default as deserialize, +} from "../../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube.NotificationPreferences { + export type Preference = { + index: number; + } +} + +export type Type = $.youtube.NotificationPreferences.Preference; + +export function getDefaultValue(): $.youtube.NotificationPreferences.Preference { + return { + index: 0, + }; +} + +export function createValue(partialValue: Partial<$.youtube.NotificationPreferences.Preference>): $.youtube.NotificationPreferences.Preference { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.NotificationPreferences.Preference): unknown { + const result: any = {}; + if (value.index !== undefined) result.index = tsValueToJsonValueFns.int32(value.index); + return result; +} + +export function decodeJson(value: any): $.youtube.NotificationPreferences.Preference { + const result = getDefaultValue(); + if (value.index !== undefined) result.index = jsonValueToTsValueFns.int32(value.index); + return result; +} + +export function encodeBinary(value: $.youtube.NotificationPreferences.Preference): Uint8Array { + const result: WireMessage = []; + if (value.index !== undefined) { + const tsValue = value.index; + result.push( + [1, tsValueToWireValueFns.int32(tsValue)], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.NotificationPreferences.Preference { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(1); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.index = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/(NotificationPreferences)/index.ts b/src/proto/generated/messages/youtube/(NotificationPreferences)/index.ts new file mode 100644 index 000000000..1d8729083 --- /dev/null +++ b/src/proto/generated/messages/youtube/(NotificationPreferences)/index.ts @@ -0,0 +1 @@ +export type { Type as Preference } from "./Preference.js"; diff --git a/src/proto/generated/messages/youtube/(PeformCommentActionParams)/(TranslateCommentParams)/(Params)/Comment.ts b/src/proto/generated/messages/youtube/(PeformCommentActionParams)/(TranslateCommentParams)/(Params)/Comment.ts new file mode 100644 index 000000000..21b0d22f9 --- /dev/null +++ b/src/proto/generated/messages/youtube/(PeformCommentActionParams)/(TranslateCommentParams)/(Params)/Comment.ts @@ -0,0 +1,75 @@ +import { + tsValueToJsonValueFns, + jsonValueToTsValueFns, +} from "../../../../../runtime/json/scalar.js"; +import { + WireMessage, +} from "../../../../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../../../../runtime/wire/serialize.js"; +import { + tsValueToWireValueFns, + wireValueToTsValueFns, +} from "../../../../../runtime/wire/scalar.js"; +import { + default as deserialize, +} from "../../../../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube.PeformCommentActionParams.TranslateCommentParams.Params { + export type Comment = { + text: string; + } +} + +export type Type = $.youtube.PeformCommentActionParams.TranslateCommentParams.Params.Comment; + +export function getDefaultValue(): $.youtube.PeformCommentActionParams.TranslateCommentParams.Params.Comment { + return { + text: "", + }; +} + +export function createValue(partialValue: Partial<$.youtube.PeformCommentActionParams.TranslateCommentParams.Params.Comment>): $.youtube.PeformCommentActionParams.TranslateCommentParams.Params.Comment { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.PeformCommentActionParams.TranslateCommentParams.Params.Comment): unknown { + const result: any = {}; + if (value.text !== undefined) result.text = tsValueToJsonValueFns.string(value.text); + return result; +} + +export function decodeJson(value: any): $.youtube.PeformCommentActionParams.TranslateCommentParams.Params.Comment { + const result = getDefaultValue(); + if (value.text !== undefined) result.text = jsonValueToTsValueFns.string(value.text); + return result; +} + +export function encodeBinary(value: $.youtube.PeformCommentActionParams.TranslateCommentParams.Params.Comment): Uint8Array { + const result: WireMessage = []; + if (value.text !== undefined) { + const tsValue = value.text; + result.push( + [1, tsValueToWireValueFns.string(tsValue)], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.PeformCommentActionParams.TranslateCommentParams.Params.Comment { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(1); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.string(wireValue); + if (value === undefined) break field; + result.text = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/(PeformCommentActionParams)/(TranslateCommentParams)/(Params)/index.ts b/src/proto/generated/messages/youtube/(PeformCommentActionParams)/(TranslateCommentParams)/(Params)/index.ts new file mode 100644 index 000000000..ebfd0194b --- /dev/null +++ b/src/proto/generated/messages/youtube/(PeformCommentActionParams)/(TranslateCommentParams)/(Params)/index.ts @@ -0,0 +1 @@ +export type { Type as Comment } from "./Comment.js"; diff --git a/src/proto/generated/messages/youtube/(PeformCommentActionParams)/(TranslateCommentParams)/Params.ts b/src/proto/generated/messages/youtube/(PeformCommentActionParams)/(TranslateCommentParams)/Params.ts new file mode 100644 index 000000000..87c62bdf1 --- /dev/null +++ b/src/proto/generated/messages/youtube/(PeformCommentActionParams)/(TranslateCommentParams)/Params.ts @@ -0,0 +1,78 @@ +import { + Type as Comment, + encodeJson as encodeJson_1, + decodeJson as decodeJson_1, + encodeBinary as encodeBinary_1, + decodeBinary as decodeBinary_1, +} from "./(Params)/Comment.js"; +import { + jsonValueToTsValueFns, +} from "../../../../runtime/json/scalar.js"; +import { + WireMessage, + WireType, +} from "../../../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../../../runtime/wire/serialize.js"; +import { + default as deserialize, +} from "../../../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube.PeformCommentActionParams.TranslateCommentParams { + export type Params = { + comment?: Comment; + } +} + +export type Type = $.youtube.PeformCommentActionParams.TranslateCommentParams.Params; + +export function getDefaultValue(): $.youtube.PeformCommentActionParams.TranslateCommentParams.Params { + return { + comment: undefined, + }; +} + +export function createValue(partialValue: Partial<$.youtube.PeformCommentActionParams.TranslateCommentParams.Params>): $.youtube.PeformCommentActionParams.TranslateCommentParams.Params { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.PeformCommentActionParams.TranslateCommentParams.Params): unknown { + const result: any = {}; + if (value.comment !== undefined) result.comment = encodeJson_1(value.comment); + return result; +} + +export function decodeJson(value: any): $.youtube.PeformCommentActionParams.TranslateCommentParams.Params { + const result = getDefaultValue(); + if (value.comment !== undefined) result.comment = decodeJson_1(value.comment); + return result; +} + +export function encodeBinary(value: $.youtube.PeformCommentActionParams.TranslateCommentParams.Params): Uint8Array { + const result: WireMessage = []; + if (value.comment !== undefined) { + const tsValue = value.comment; + result.push( + [1, { type: WireType.LengthDelimited as const, value: encodeBinary_1(tsValue) }], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.PeformCommentActionParams.TranslateCommentParams.Params { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(1); + if (wireValue === undefined) break field; + const value = wireValue.type === WireType.LengthDelimited ? decodeBinary_1(wireValue.value) : undefined; + if (value === undefined) break field; + result.comment = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/(PeformCommentActionParams)/(TranslateCommentParams)/index.ts b/src/proto/generated/messages/youtube/(PeformCommentActionParams)/(TranslateCommentParams)/index.ts new file mode 100644 index 000000000..fdd997fd6 --- /dev/null +++ b/src/proto/generated/messages/youtube/(PeformCommentActionParams)/(TranslateCommentParams)/index.ts @@ -0,0 +1 @@ +export type { Type as Params } from "./Params.js"; diff --git a/src/proto/generated/messages/youtube/(PeformCommentActionParams)/TranslateCommentParams.ts b/src/proto/generated/messages/youtube/(PeformCommentActionParams)/TranslateCommentParams.ts new file mode 100644 index 000000000..f06054eb8 --- /dev/null +++ b/src/proto/generated/messages/youtube/(PeformCommentActionParams)/TranslateCommentParams.ts @@ -0,0 +1,117 @@ +import { + Type as Params, + encodeJson as encodeJson_1, + decodeJson as decodeJson_1, + encodeBinary as encodeBinary_1, + decodeBinary as decodeBinary_1, +} from "./(TranslateCommentParams)/Params.js"; +import { + tsValueToJsonValueFns, + jsonValueToTsValueFns, +} from "../../../runtime/json/scalar.js"; +import { + WireMessage, + WireType, +} from "../../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../../runtime/wire/serialize.js"; +import { + tsValueToWireValueFns, + wireValueToTsValueFns, +} from "../../../runtime/wire/scalar.js"; +import { + default as deserialize, +} from "../../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube.PeformCommentActionParams { + export type TranslateCommentParams = { + commentId: string; + params?: Params; + targetLanguage: string; + } +} + +export type Type = $.youtube.PeformCommentActionParams.TranslateCommentParams; + +export function getDefaultValue(): $.youtube.PeformCommentActionParams.TranslateCommentParams { + return { + commentId: "", + params: undefined, + targetLanguage: "", + }; +} + +export function createValue(partialValue: Partial<$.youtube.PeformCommentActionParams.TranslateCommentParams>): $.youtube.PeformCommentActionParams.TranslateCommentParams { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.PeformCommentActionParams.TranslateCommentParams): unknown { + const result: any = {}; + if (value.commentId !== undefined) result.commentId = tsValueToJsonValueFns.string(value.commentId); + if (value.params !== undefined) result.params = encodeJson_1(value.params); + if (value.targetLanguage !== undefined) result.targetLanguage = tsValueToJsonValueFns.string(value.targetLanguage); + return result; +} + +export function decodeJson(value: any): $.youtube.PeformCommentActionParams.TranslateCommentParams { + const result = getDefaultValue(); + if (value.commentId !== undefined) result.commentId = jsonValueToTsValueFns.string(value.commentId); + if (value.params !== undefined) result.params = decodeJson_1(value.params); + if (value.targetLanguage !== undefined) result.targetLanguage = jsonValueToTsValueFns.string(value.targetLanguage); + return result; +} + +export function encodeBinary(value: $.youtube.PeformCommentActionParams.TranslateCommentParams): Uint8Array { + const result: WireMessage = []; + if (value.commentId !== undefined) { + const tsValue = value.commentId; + result.push( + [2, tsValueToWireValueFns.string(tsValue)], + ); + } + if (value.params !== undefined) { + const tsValue = value.params; + result.push( + [3, { type: WireType.LengthDelimited as const, value: encodeBinary_1(tsValue) }], + ); + } + if (value.targetLanguage !== undefined) { + const tsValue = value.targetLanguage; + result.push( + [4, tsValueToWireValueFns.string(tsValue)], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.PeformCommentActionParams.TranslateCommentParams { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(2); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.string(wireValue); + if (value === undefined) break field; + result.commentId = value; + } + field: { + const wireValue = wireFields.get(3); + if (wireValue === undefined) break field; + const value = wireValue.type === WireType.LengthDelimited ? decodeBinary_1(wireValue.value) : undefined; + if (value === undefined) break field; + result.params = value; + } + field: { + const wireValue = wireFields.get(4); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.string(wireValue); + if (value === undefined) break field; + result.targetLanguage = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/(PeformCommentActionParams)/index.ts b/src/proto/generated/messages/youtube/(PeformCommentActionParams)/index.ts new file mode 100644 index 000000000..14f838f07 --- /dev/null +++ b/src/proto/generated/messages/youtube/(PeformCommentActionParams)/index.ts @@ -0,0 +1 @@ +export type { Type as TranslateCommentParams } from "./TranslateCommentParams.js"; diff --git a/src/proto/generated/messages/youtube/(SearchFilter)/Filters.ts b/src/proto/generated/messages/youtube/(SearchFilter)/Filters.ts new file mode 100644 index 000000000..a537ebc44 --- /dev/null +++ b/src/proto/generated/messages/youtube/(SearchFilter)/Filters.ts @@ -0,0 +1,296 @@ +import { + tsValueToJsonValueFns, + jsonValueToTsValueFns, +} from "../../../runtime/json/scalar.js"; +import { + WireMessage, +} from "../../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../../runtime/wire/serialize.js"; +import { + tsValueToWireValueFns, + wireValueToTsValueFns, +} from "../../../runtime/wire/scalar.js"; +import { + default as deserialize, +} from "../../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube.SearchFilter { + export type Filters = { + uploadDate?: number; + type?: number; + duration?: number; + featuresHd?: number; + featuresSubtitles?: number; + featuresCreativeCommons?: number; + features3d?: number; + featuresLive?: number; + featuresPurchased?: number; + features4k?: number; + features360?: number; + featuresLocation?: number; + featuresHdr?: number; + featuresVr180?: number; + } +} + +export type Type = $.youtube.SearchFilter.Filters; + +export function getDefaultValue(): $.youtube.SearchFilter.Filters { + return { + uploadDate: undefined, + type: undefined, + duration: undefined, + featuresHd: undefined, + featuresSubtitles: undefined, + featuresCreativeCommons: undefined, + features3d: undefined, + featuresLive: undefined, + featuresPurchased: undefined, + features4k: undefined, + features360: undefined, + featuresLocation: undefined, + featuresHdr: undefined, + featuresVr180: undefined, + }; +} + +export function createValue(partialValue: Partial<$.youtube.SearchFilter.Filters>): $.youtube.SearchFilter.Filters { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.SearchFilter.Filters): unknown { + const result: any = {}; + if (value.uploadDate !== undefined) result.uploadDate = tsValueToJsonValueFns.int32(value.uploadDate); + if (value.type !== undefined) result.type = tsValueToJsonValueFns.int32(value.type); + if (value.duration !== undefined) result.duration = tsValueToJsonValueFns.int32(value.duration); + if (value.featuresHd !== undefined) result.featuresHd = tsValueToJsonValueFns.int32(value.featuresHd); + if (value.featuresSubtitles !== undefined) result.featuresSubtitles = tsValueToJsonValueFns.int32(value.featuresSubtitles); + if (value.featuresCreativeCommons !== undefined) result.featuresCreativeCommons = tsValueToJsonValueFns.int32(value.featuresCreativeCommons); + if (value.features3d !== undefined) result.features3d = tsValueToJsonValueFns.int32(value.features3d); + if (value.featuresLive !== undefined) result.featuresLive = tsValueToJsonValueFns.int32(value.featuresLive); + if (value.featuresPurchased !== undefined) result.featuresPurchased = tsValueToJsonValueFns.int32(value.featuresPurchased); + if (value.features4k !== undefined) result.features4k = tsValueToJsonValueFns.int32(value.features4k); + if (value.features360 !== undefined) result.features360 = tsValueToJsonValueFns.int32(value.features360); + if (value.featuresLocation !== undefined) result.featuresLocation = tsValueToJsonValueFns.int32(value.featuresLocation); + if (value.featuresHdr !== undefined) result.featuresHdr = tsValueToJsonValueFns.int32(value.featuresHdr); + if (value.featuresVr180 !== undefined) result.featuresVr180 = tsValueToJsonValueFns.int32(value.featuresVr180); + return result; +} + +export function decodeJson(value: any): $.youtube.SearchFilter.Filters { + const result = getDefaultValue(); + if (value.uploadDate !== undefined) result.uploadDate = jsonValueToTsValueFns.int32(value.uploadDate); + if (value.type !== undefined) result.type = jsonValueToTsValueFns.int32(value.type); + if (value.duration !== undefined) result.duration = jsonValueToTsValueFns.int32(value.duration); + if (value.featuresHd !== undefined) result.featuresHd = jsonValueToTsValueFns.int32(value.featuresHd); + if (value.featuresSubtitles !== undefined) result.featuresSubtitles = jsonValueToTsValueFns.int32(value.featuresSubtitles); + if (value.featuresCreativeCommons !== undefined) result.featuresCreativeCommons = jsonValueToTsValueFns.int32(value.featuresCreativeCommons); + if (value.features3d !== undefined) result.features3d = jsonValueToTsValueFns.int32(value.features3d); + if (value.featuresLive !== undefined) result.featuresLive = jsonValueToTsValueFns.int32(value.featuresLive); + if (value.featuresPurchased !== undefined) result.featuresPurchased = jsonValueToTsValueFns.int32(value.featuresPurchased); + if (value.features4k !== undefined) result.features4k = jsonValueToTsValueFns.int32(value.features4k); + if (value.features360 !== undefined) result.features360 = jsonValueToTsValueFns.int32(value.features360); + if (value.featuresLocation !== undefined) result.featuresLocation = jsonValueToTsValueFns.int32(value.featuresLocation); + if (value.featuresHdr !== undefined) result.featuresHdr = jsonValueToTsValueFns.int32(value.featuresHdr); + if (value.featuresVr180 !== undefined) result.featuresVr180 = jsonValueToTsValueFns.int32(value.featuresVr180); + return result; +} + +export function encodeBinary(value: $.youtube.SearchFilter.Filters): Uint8Array { + const result: WireMessage = []; + if (value.uploadDate !== undefined) { + const tsValue = value.uploadDate; + result.push( + [1, tsValueToWireValueFns.int32(tsValue)], + ); + } + if (value.type !== undefined) { + const tsValue = value.type; + result.push( + [2, tsValueToWireValueFns.int32(tsValue)], + ); + } + if (value.duration !== undefined) { + const tsValue = value.duration; + result.push( + [3, tsValueToWireValueFns.int32(tsValue)], + ); + } + if (value.featuresHd !== undefined) { + const tsValue = value.featuresHd; + result.push( + [4, tsValueToWireValueFns.int32(tsValue)], + ); + } + if (value.featuresSubtitles !== undefined) { + const tsValue = value.featuresSubtitles; + result.push( + [5, tsValueToWireValueFns.int32(tsValue)], + ); + } + if (value.featuresCreativeCommons !== undefined) { + const tsValue = value.featuresCreativeCommons; + result.push( + [6, tsValueToWireValueFns.int32(tsValue)], + ); + } + if (value.features3d !== undefined) { + const tsValue = value.features3d; + result.push( + [7, tsValueToWireValueFns.int32(tsValue)], + ); + } + if (value.featuresLive !== undefined) { + const tsValue = value.featuresLive; + result.push( + [8, tsValueToWireValueFns.int32(tsValue)], + ); + } + if (value.featuresPurchased !== undefined) { + const tsValue = value.featuresPurchased; + result.push( + [9, tsValueToWireValueFns.int32(tsValue)], + ); + } + if (value.features4k !== undefined) { + const tsValue = value.features4k; + result.push( + [14, tsValueToWireValueFns.int32(tsValue)], + ); + } + if (value.features360 !== undefined) { + const tsValue = value.features360; + result.push( + [15, tsValueToWireValueFns.int32(tsValue)], + ); + } + if (value.featuresLocation !== undefined) { + const tsValue = value.featuresLocation; + result.push( + [23, tsValueToWireValueFns.int32(tsValue)], + ); + } + if (value.featuresHdr !== undefined) { + const tsValue = value.featuresHdr; + result.push( + [25, tsValueToWireValueFns.int32(tsValue)], + ); + } + if (value.featuresVr180 !== undefined) { + const tsValue = value.featuresVr180; + result.push( + [26, tsValueToWireValueFns.int32(tsValue)], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.SearchFilter.Filters { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(1); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.uploadDate = value; + } + field: { + const wireValue = wireFields.get(2); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.type = value; + } + field: { + const wireValue = wireFields.get(3); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.duration = value; + } + field: { + const wireValue = wireFields.get(4); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.featuresHd = value; + } + field: { + const wireValue = wireFields.get(5); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.featuresSubtitles = value; + } + field: { + const wireValue = wireFields.get(6); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.featuresCreativeCommons = value; + } + field: { + const wireValue = wireFields.get(7); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.features3d = value; + } + field: { + const wireValue = wireFields.get(8); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.featuresLive = value; + } + field: { + const wireValue = wireFields.get(9); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.featuresPurchased = value; + } + field: { + const wireValue = wireFields.get(14); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.features4k = value; + } + field: { + const wireValue = wireFields.get(15); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.features360 = value; + } + field: { + const wireValue = wireFields.get(23); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.featuresLocation = value; + } + field: { + const wireValue = wireFields.get(25); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.featuresHdr = value; + } + field: { + const wireValue = wireFields.get(26); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.featuresVr180 = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/(SearchFilter)/index.ts b/src/proto/generated/messages/youtube/(SearchFilter)/index.ts new file mode 100644 index 000000000..a4dbe22a4 --- /dev/null +++ b/src/proto/generated/messages/youtube/(SearchFilter)/index.ts @@ -0,0 +1 @@ +export type { Type as Filters } from "./Filters.js"; diff --git a/src/proto/generated/messages/youtube/(SoundInfoParams)/(Sound)/(Params)/Ids.ts b/src/proto/generated/messages/youtube/(SoundInfoParams)/(Sound)/(Params)/Ids.ts new file mode 100644 index 000000000..01dfd573e --- /dev/null +++ b/src/proto/generated/messages/youtube/(SoundInfoParams)/(Sound)/(Params)/Ids.ts @@ -0,0 +1,109 @@ +import { + tsValueToJsonValueFns, + jsonValueToTsValueFns, +} from "../../../../../runtime/json/scalar.js"; +import { + WireMessage, +} from "../../../../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../../../../runtime/wire/serialize.js"; +import { + tsValueToWireValueFns, + wireValueToTsValueFns, +} from "../../../../../runtime/wire/scalar.js"; +import { + default as deserialize, +} from "../../../../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube.SoundInfoParams.Sound.Params { + export type Ids = { + id1: string; + id2: string; + id3: string; + } +} + +export type Type = $.youtube.SoundInfoParams.Sound.Params.Ids; + +export function getDefaultValue(): $.youtube.SoundInfoParams.Sound.Params.Ids { + return { + id1: "", + id2: "", + id3: "", + }; +} + +export function createValue(partialValue: Partial<$.youtube.SoundInfoParams.Sound.Params.Ids>): $.youtube.SoundInfoParams.Sound.Params.Ids { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.SoundInfoParams.Sound.Params.Ids): unknown { + const result: any = {}; + if (value.id1 !== undefined) result.id1 = tsValueToJsonValueFns.string(value.id1); + if (value.id2 !== undefined) result.id2 = tsValueToJsonValueFns.string(value.id2); + if (value.id3 !== undefined) result.id3 = tsValueToJsonValueFns.string(value.id3); + return result; +} + +export function decodeJson(value: any): $.youtube.SoundInfoParams.Sound.Params.Ids { + const result = getDefaultValue(); + if (value.id1 !== undefined) result.id1 = jsonValueToTsValueFns.string(value.id1); + if (value.id2 !== undefined) result.id2 = jsonValueToTsValueFns.string(value.id2); + if (value.id3 !== undefined) result.id3 = jsonValueToTsValueFns.string(value.id3); + return result; +} + +export function encodeBinary(value: $.youtube.SoundInfoParams.Sound.Params.Ids): Uint8Array { + const result: WireMessage = []; + if (value.id1 !== undefined) { + const tsValue = value.id1; + result.push( + [1, tsValueToWireValueFns.string(tsValue)], + ); + } + if (value.id2 !== undefined) { + const tsValue = value.id2; + result.push( + [2, tsValueToWireValueFns.string(tsValue)], + ); + } + if (value.id3 !== undefined) { + const tsValue = value.id3; + result.push( + [3, tsValueToWireValueFns.string(tsValue)], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.SoundInfoParams.Sound.Params.Ids { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(1); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.string(wireValue); + if (value === undefined) break field; + result.id1 = value; + } + field: { + const wireValue = wireFields.get(2); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.string(wireValue); + if (value === undefined) break field; + result.id2 = value; + } + field: { + const wireValue = wireFields.get(3); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.string(wireValue); + if (value === undefined) break field; + result.id3 = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/(SoundInfoParams)/(Sound)/(Params)/index.ts b/src/proto/generated/messages/youtube/(SoundInfoParams)/(Sound)/(Params)/index.ts new file mode 100644 index 000000000..1f60fdfa3 --- /dev/null +++ b/src/proto/generated/messages/youtube/(SoundInfoParams)/(Sound)/(Params)/index.ts @@ -0,0 +1 @@ +export type { Type as Ids } from "./Ids.js"; diff --git a/src/proto/generated/messages/youtube/(SoundInfoParams)/(Sound)/Params.ts b/src/proto/generated/messages/youtube/(SoundInfoParams)/(Sound)/Params.ts new file mode 100644 index 000000000..c69425cf3 --- /dev/null +++ b/src/proto/generated/messages/youtube/(SoundInfoParams)/(Sound)/Params.ts @@ -0,0 +1,78 @@ +import { + Type as Ids, + encodeJson as encodeJson_1, + decodeJson as decodeJson_1, + encodeBinary as encodeBinary_1, + decodeBinary as decodeBinary_1, +} from "./(Params)/Ids.js"; +import { + jsonValueToTsValueFns, +} from "../../../../runtime/json/scalar.js"; +import { + WireMessage, + WireType, +} from "../../../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../../../runtime/wire/serialize.js"; +import { + default as deserialize, +} from "../../../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube.SoundInfoParams.Sound { + export type Params = { + ids?: Ids; + } +} + +export type Type = $.youtube.SoundInfoParams.Sound.Params; + +export function getDefaultValue(): $.youtube.SoundInfoParams.Sound.Params { + return { + ids: undefined, + }; +} + +export function createValue(partialValue: Partial<$.youtube.SoundInfoParams.Sound.Params>): $.youtube.SoundInfoParams.Sound.Params { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.SoundInfoParams.Sound.Params): unknown { + const result: any = {}; + if (value.ids !== undefined) result.ids = encodeJson_1(value.ids); + return result; +} + +export function decodeJson(value: any): $.youtube.SoundInfoParams.Sound.Params { + const result = getDefaultValue(); + if (value.ids !== undefined) result.ids = decodeJson_1(value.ids); + return result; +} + +export function encodeBinary(value: $.youtube.SoundInfoParams.Sound.Params): Uint8Array { + const result: WireMessage = []; + if (value.ids !== undefined) { + const tsValue = value.ids; + result.push( + [2, { type: WireType.LengthDelimited as const, value: encodeBinary_1(tsValue) }], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.SoundInfoParams.Sound.Params { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(2); + if (wireValue === undefined) break field; + const value = wireValue.type === WireType.LengthDelimited ? decodeBinary_1(wireValue.value) : undefined; + if (value === undefined) break field; + result.ids = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/(SoundInfoParams)/(Sound)/index.ts b/src/proto/generated/messages/youtube/(SoundInfoParams)/(Sound)/index.ts new file mode 100644 index 000000000..fdd997fd6 --- /dev/null +++ b/src/proto/generated/messages/youtube/(SoundInfoParams)/(Sound)/index.ts @@ -0,0 +1 @@ +export type { Type as Params } from "./Params.js"; diff --git a/src/proto/generated/messages/youtube/(SoundInfoParams)/Sound.ts b/src/proto/generated/messages/youtube/(SoundInfoParams)/Sound.ts new file mode 100644 index 000000000..62bc9467a --- /dev/null +++ b/src/proto/generated/messages/youtube/(SoundInfoParams)/Sound.ts @@ -0,0 +1,78 @@ +import { + Type as Params, + encodeJson as encodeJson_1, + decodeJson as decodeJson_1, + encodeBinary as encodeBinary_1, + decodeBinary as decodeBinary_1, +} from "./(Sound)/Params.js"; +import { + jsonValueToTsValueFns, +} from "../../../runtime/json/scalar.js"; +import { + WireMessage, + WireType, +} from "../../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../../runtime/wire/serialize.js"; +import { + default as deserialize, +} from "../../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube.SoundInfoParams { + export type Sound = { + params?: Params; + } +} + +export type Type = $.youtube.SoundInfoParams.Sound; + +export function getDefaultValue(): $.youtube.SoundInfoParams.Sound { + return { + params: undefined, + }; +} + +export function createValue(partialValue: Partial<$.youtube.SoundInfoParams.Sound>): $.youtube.SoundInfoParams.Sound { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.SoundInfoParams.Sound): unknown { + const result: any = {}; + if (value.params !== undefined) result.params = encodeJson_1(value.params); + return result; +} + +export function decodeJson(value: any): $.youtube.SoundInfoParams.Sound { + const result = getDefaultValue(); + if (value.params !== undefined) result.params = decodeJson_1(value.params); + return result; +} + +export function encodeBinary(value: $.youtube.SoundInfoParams.Sound): Uint8Array { + const result: WireMessage = []; + if (value.params !== undefined) { + const tsValue = value.params; + result.push( + [1, { type: WireType.LengthDelimited as const, value: encodeBinary_1(tsValue) }], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.SoundInfoParams.Sound { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(1); + if (wireValue === undefined) break field; + const value = wireValue.type === WireType.LengthDelimited ? decodeBinary_1(wireValue.value) : undefined; + if (value === undefined) break field; + result.params = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/(SoundInfoParams)/index.ts b/src/proto/generated/messages/youtube/(SoundInfoParams)/index.ts new file mode 100644 index 000000000..54bd84a13 --- /dev/null +++ b/src/proto/generated/messages/youtube/(SoundInfoParams)/index.ts @@ -0,0 +1 @@ +export type { Type as Sound } from "./Sound.js"; diff --git a/src/proto/generated/messages/youtube/ChannelAnalytics.ts b/src/proto/generated/messages/youtube/ChannelAnalytics.ts new file mode 100644 index 000000000..882458031 --- /dev/null +++ b/src/proto/generated/messages/youtube/ChannelAnalytics.ts @@ -0,0 +1,78 @@ +import { + Type as Params, + encodeJson as encodeJson_1, + decodeJson as decodeJson_1, + encodeBinary as encodeBinary_1, + decodeBinary as decodeBinary_1, +} from "./(ChannelAnalytics)/Params.js"; +import { + jsonValueToTsValueFns, +} from "../../runtime/json/scalar.js"; +import { + WireMessage, + WireType, +} from "../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../runtime/wire/serialize.js"; +import { + default as deserialize, +} from "../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube { + export type ChannelAnalytics = { + params?: Params; + } +} + +export type Type = $.youtube.ChannelAnalytics; + +export function getDefaultValue(): $.youtube.ChannelAnalytics { + return { + params: undefined, + }; +} + +export function createValue(partialValue: Partial<$.youtube.ChannelAnalytics>): $.youtube.ChannelAnalytics { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.ChannelAnalytics): unknown { + const result: any = {}; + if (value.params !== undefined) result.params = encodeJson_1(value.params); + return result; +} + +export function decodeJson(value: any): $.youtube.ChannelAnalytics { + const result = getDefaultValue(); + if (value.params !== undefined) result.params = decodeJson_1(value.params); + return result; +} + +export function encodeBinary(value: $.youtube.ChannelAnalytics): Uint8Array { + const result: WireMessage = []; + if (value.params !== undefined) { + const tsValue = value.params; + result.push( + [32, { type: WireType.LengthDelimited as const, value: encodeBinary_1(tsValue) }], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.ChannelAnalytics { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(32); + if (wireValue === undefined) break field; + const value = wireValue.type === WireType.LengthDelimited ? decodeBinary_1(wireValue.value) : undefined; + if (value === undefined) break field; + result.params = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/CreateCommentParams.ts b/src/proto/generated/messages/youtube/CreateCommentParams.ts new file mode 100644 index 000000000..7678940cf --- /dev/null +++ b/src/proto/generated/messages/youtube/CreateCommentParams.ts @@ -0,0 +1,117 @@ +import { + Type as Params, + encodeJson as encodeJson_1, + decodeJson as decodeJson_1, + encodeBinary as encodeBinary_1, + decodeBinary as decodeBinary_1, +} from "./(CreateCommentParams)/Params.js"; +import { + tsValueToJsonValueFns, + jsonValueToTsValueFns, +} from "../../runtime/json/scalar.js"; +import { + WireMessage, + WireType, +} from "../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../runtime/wire/serialize.js"; +import { + tsValueToWireValueFns, + wireValueToTsValueFns, +} from "../../runtime/wire/scalar.js"; +import { + default as deserialize, +} from "../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube { + export type CreateCommentParams = { + videoId: string; + params?: Params; + number: number; + } +} + +export type Type = $.youtube.CreateCommentParams; + +export function getDefaultValue(): $.youtube.CreateCommentParams { + return { + videoId: "", + params: undefined, + number: 0, + }; +} + +export function createValue(partialValue: Partial<$.youtube.CreateCommentParams>): $.youtube.CreateCommentParams { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.CreateCommentParams): unknown { + const result: any = {}; + if (value.videoId !== undefined) result.videoId = tsValueToJsonValueFns.string(value.videoId); + if (value.params !== undefined) result.params = encodeJson_1(value.params); + if (value.number !== undefined) result.number = tsValueToJsonValueFns.int32(value.number); + return result; +} + +export function decodeJson(value: any): $.youtube.CreateCommentParams { + const result = getDefaultValue(); + if (value.videoId !== undefined) result.videoId = jsonValueToTsValueFns.string(value.videoId); + if (value.params !== undefined) result.params = decodeJson_1(value.params); + if (value.number !== undefined) result.number = jsonValueToTsValueFns.int32(value.number); + return result; +} + +export function encodeBinary(value: $.youtube.CreateCommentParams): Uint8Array { + const result: WireMessage = []; + if (value.videoId !== undefined) { + const tsValue = value.videoId; + result.push( + [2, tsValueToWireValueFns.string(tsValue)], + ); + } + if (value.params !== undefined) { + const tsValue = value.params; + result.push( + [5, { type: WireType.LengthDelimited as const, value: encodeBinary_1(tsValue) }], + ); + } + if (value.number !== undefined) { + const tsValue = value.number; + result.push( + [10, tsValueToWireValueFns.int32(tsValue)], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.CreateCommentParams { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(2); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.string(wireValue); + if (value === undefined) break field; + result.videoId = value; + } + field: { + const wireValue = wireFields.get(5); + if (wireValue === undefined) break field; + const value = wireValue.type === WireType.LengthDelimited ? decodeBinary_1(wireValue.value) : undefined; + if (value === undefined) break field; + result.params = value; + } + field: { + const wireValue = wireFields.get(10); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.number = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/GetCommentsSectionParams.ts b/src/proto/generated/messages/youtube/GetCommentsSectionParams.ts new file mode 100644 index 000000000..b4f8c4319 --- /dev/null +++ b/src/proto/generated/messages/youtube/GetCommentsSectionParams.ts @@ -0,0 +1,124 @@ +import { + Type as Context, + encodeJson as encodeJson_1, + decodeJson as decodeJson_1, + encodeBinary as encodeBinary_1, + decodeBinary as decodeBinary_1, +} from "./(GetCommentsSectionParams)/Context.js"; +import { + Type as Params, + encodeJson as encodeJson_2, + decodeJson as decodeJson_2, + encodeBinary as encodeBinary_2, + decodeBinary as decodeBinary_2, +} from "./(GetCommentsSectionParams)/Params.js"; +import { + tsValueToJsonValueFns, + jsonValueToTsValueFns, +} from "../../runtime/json/scalar.js"; +import { + WireMessage, + WireType, +} from "../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../runtime/wire/serialize.js"; +import { + tsValueToWireValueFns, + wireValueToTsValueFns, +} from "../../runtime/wire/scalar.js"; +import { + default as deserialize, +} from "../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube { + export type GetCommentsSectionParams = { + ctx?: Context; + unkParam: number; + params?: Params; + } +} + +export type Type = $.youtube.GetCommentsSectionParams; + +export function getDefaultValue(): $.youtube.GetCommentsSectionParams { + return { + ctx: undefined, + unkParam: 0, + params: undefined, + }; +} + +export function createValue(partialValue: Partial<$.youtube.GetCommentsSectionParams>): $.youtube.GetCommentsSectionParams { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.GetCommentsSectionParams): unknown { + const result: any = {}; + if (value.ctx !== undefined) result.ctx = encodeJson_1(value.ctx); + if (value.unkParam !== undefined) result.unkParam = tsValueToJsonValueFns.int32(value.unkParam); + if (value.params !== undefined) result.params = encodeJson_2(value.params); + return result; +} + +export function decodeJson(value: any): $.youtube.GetCommentsSectionParams { + const result = getDefaultValue(); + if (value.ctx !== undefined) result.ctx = decodeJson_1(value.ctx); + if (value.unkParam !== undefined) result.unkParam = jsonValueToTsValueFns.int32(value.unkParam); + if (value.params !== undefined) result.params = decodeJson_2(value.params); + return result; +} + +export function encodeBinary(value: $.youtube.GetCommentsSectionParams): Uint8Array { + const result: WireMessage = []; + if (value.ctx !== undefined) { + const tsValue = value.ctx; + result.push( + [2, { type: WireType.LengthDelimited as const, value: encodeBinary_1(tsValue) }], + ); + } + if (value.unkParam !== undefined) { + const tsValue = value.unkParam; + result.push( + [3, tsValueToWireValueFns.int32(tsValue)], + ); + } + if (value.params !== undefined) { + const tsValue = value.params; + result.push( + [6, { type: WireType.LengthDelimited as const, value: encodeBinary_2(tsValue) }], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.GetCommentsSectionParams { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(2); + if (wireValue === undefined) break field; + const value = wireValue.type === WireType.LengthDelimited ? decodeBinary_1(wireValue.value) : undefined; + if (value === undefined) break field; + result.ctx = value; + } + field: { + const wireValue = wireFields.get(3); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.unkParam = value; + } + field: { + const wireValue = wireFields.get(6); + if (wireValue === undefined) break field; + const value = wireValue.type === WireType.LengthDelimited ? decodeBinary_2(wireValue.value) : undefined; + if (value === undefined) break field; + result.params = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/InnertubePayload.ts b/src/proto/generated/messages/youtube/InnertubePayload.ts new file mode 100644 index 000000000..1388e7e4a --- /dev/null +++ b/src/proto/generated/messages/youtube/InnertubePayload.ts @@ -0,0 +1,316 @@ +import { + Type as Context, + encodeJson as encodeJson_1, + decodeJson as decodeJson_1, + encodeBinary as encodeBinary_1, + decodeBinary as decodeBinary_1, +} from "./(InnertubePayload)/Context.js"; +import { + Type as Title, + encodeJson as encodeJson_2, + decodeJson as decodeJson_2, + encodeBinary as encodeBinary_2, + decodeBinary as decodeBinary_2, +} from "./(InnertubePayload)/Title.js"; +import { + Type as Description, + encodeJson as encodeJson_3, + decodeJson as decodeJson_3, + encodeBinary as encodeBinary_3, + decodeBinary as decodeBinary_3, +} from "./(InnertubePayload)/Description.js"; +import { + Type as Tags, + encodeJson as encodeJson_4, + decodeJson as decodeJson_4, + encodeBinary as encodeBinary_4, + decodeBinary as decodeBinary_4, +} from "./(InnertubePayload)/Tags.js"; +import { + Type as Category, + encodeJson as encodeJson_5, + decodeJson as decodeJson_5, + encodeBinary as encodeBinary_5, + decodeBinary as decodeBinary_5, +} from "./(InnertubePayload)/Category.js"; +import { + Type as License, + encodeJson as encodeJson_6, + decodeJson as decodeJson_6, + encodeBinary as encodeBinary_6, + decodeBinary as decodeBinary_6, +} from "./(InnertubePayload)/License.js"; +import { + Type as VideoThumbnail, + encodeJson as encodeJson_7, + decodeJson as decodeJson_7, + encodeBinary as encodeBinary_7, + decodeBinary as decodeBinary_7, +} from "./(InnertubePayload)/VideoThumbnail.js"; +import { + Type as Privacy, + encodeJson as encodeJson_8, + decodeJson as decodeJson_8, + encodeBinary as encodeBinary_8, + decodeBinary as decodeBinary_8, +} from "./(InnertubePayload)/Privacy.js"; +import { + Type as MadeForKids, + encodeJson as encodeJson_9, + decodeJson as decodeJson_9, + encodeBinary as encodeBinary_9, + decodeBinary as decodeBinary_9, +} from "./(InnertubePayload)/MadeForKids.js"; +import { + Type as AgeRestricted, + encodeJson as encodeJson_10, + decodeJson as decodeJson_10, + encodeBinary as encodeBinary_10, + decodeBinary as decodeBinary_10, +} from "./(InnertubePayload)/AgeRestricted.js"; +import { + tsValueToJsonValueFns, + jsonValueToTsValueFns, +} from "../../runtime/json/scalar.js"; +import { + WireMessage, + WireType, +} from "../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../runtime/wire/serialize.js"; +import { + tsValueToWireValueFns, + wireValueToTsValueFns, +} from "../../runtime/wire/scalar.js"; +import { + default as deserialize, +} from "../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube { + export type InnertubePayload = { + context?: Context; + target?: string; + title?: Title; + description?: Description; + tags?: Tags; + category?: Category; + license?: License; + videoThumbnail?: VideoThumbnail; + privacy?: Privacy; + madeForKids?: MadeForKids; + ageRestricted?: AgeRestricted; + } +} + +export type Type = $.youtube.InnertubePayload; + +export function getDefaultValue(): $.youtube.InnertubePayload { + return { + context: undefined, + target: undefined, + title: undefined, + description: undefined, + tags: undefined, + category: undefined, + license: undefined, + videoThumbnail: undefined, + privacy: undefined, + madeForKids: undefined, + ageRestricted: undefined, + }; +} + +export function createValue(partialValue: Partial<$.youtube.InnertubePayload>): $.youtube.InnertubePayload { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.InnertubePayload): unknown { + const result: any = {}; + if (value.context !== undefined) result.context = encodeJson_1(value.context); + if (value.target !== undefined) result.target = tsValueToJsonValueFns.string(value.target); + if (value.title !== undefined) result.title = encodeJson_2(value.title); + if (value.description !== undefined) result.description = encodeJson_3(value.description); + if (value.tags !== undefined) result.tags = encodeJson_4(value.tags); + if (value.category !== undefined) result.category = encodeJson_5(value.category); + if (value.license !== undefined) result.license = encodeJson_6(value.license); + if (value.videoThumbnail !== undefined) result.videoThumbnail = encodeJson_7(value.videoThumbnail); + if (value.privacy !== undefined) result.privacy = encodeJson_8(value.privacy); + if (value.madeForKids !== undefined) result.madeForKids = encodeJson_9(value.madeForKids); + if (value.ageRestricted !== undefined) result.ageRestricted = encodeJson_10(value.ageRestricted); + return result; +} + +export function decodeJson(value: any): $.youtube.InnertubePayload { + const result = getDefaultValue(); + if (value.context !== undefined) result.context = decodeJson_1(value.context); + if (value.target !== undefined) result.target = jsonValueToTsValueFns.string(value.target); + if (value.title !== undefined) result.title = decodeJson_2(value.title); + if (value.description !== undefined) result.description = decodeJson_3(value.description); + if (value.tags !== undefined) result.tags = decodeJson_4(value.tags); + if (value.category !== undefined) result.category = decodeJson_5(value.category); + if (value.license !== undefined) result.license = decodeJson_6(value.license); + if (value.videoThumbnail !== undefined) result.videoThumbnail = decodeJson_7(value.videoThumbnail); + if (value.privacy !== undefined) result.privacy = decodeJson_8(value.privacy); + if (value.madeForKids !== undefined) result.madeForKids = decodeJson_9(value.madeForKids); + if (value.ageRestricted !== undefined) result.ageRestricted = decodeJson_10(value.ageRestricted); + return result; +} + +export function encodeBinary(value: $.youtube.InnertubePayload): Uint8Array { + const result: WireMessage = []; + if (value.context !== undefined) { + const tsValue = value.context; + result.push( + [1, { type: WireType.LengthDelimited as const, value: encodeBinary_1(tsValue) }], + ); + } + if (value.target !== undefined) { + const tsValue = value.target; + result.push( + [2, tsValueToWireValueFns.string(tsValue)], + ); + } + if (value.title !== undefined) { + const tsValue = value.title; + result.push( + [3, { type: WireType.LengthDelimited as const, value: encodeBinary_2(tsValue) }], + ); + } + if (value.description !== undefined) { + const tsValue = value.description; + result.push( + [4, { type: WireType.LengthDelimited as const, value: encodeBinary_3(tsValue) }], + ); + } + if (value.tags !== undefined) { + const tsValue = value.tags; + result.push( + [6, { type: WireType.LengthDelimited as const, value: encodeBinary_4(tsValue) }], + ); + } + if (value.category !== undefined) { + const tsValue = value.category; + result.push( + [7, { type: WireType.LengthDelimited as const, value: encodeBinary_5(tsValue) }], + ); + } + if (value.license !== undefined) { + const tsValue = value.license; + result.push( + [8, { type: WireType.LengthDelimited as const, value: encodeBinary_6(tsValue) }], + ); + } + if (value.videoThumbnail !== undefined) { + const tsValue = value.videoThumbnail; + result.push( + [20, { type: WireType.LengthDelimited as const, value: encodeBinary_7(tsValue) }], + ); + } + if (value.privacy !== undefined) { + const tsValue = value.privacy; + result.push( + [38, { type: WireType.LengthDelimited as const, value: encodeBinary_8(tsValue) }], + ); + } + if (value.madeForKids !== undefined) { + const tsValue = value.madeForKids; + result.push( + [68, { type: WireType.LengthDelimited as const, value: encodeBinary_9(tsValue) }], + ); + } + if (value.ageRestricted !== undefined) { + const tsValue = value.ageRestricted; + result.push( + [69, { type: WireType.LengthDelimited as const, value: encodeBinary_10(tsValue) }], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.InnertubePayload { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(1); + if (wireValue === undefined) break field; + const value = wireValue.type === WireType.LengthDelimited ? decodeBinary_1(wireValue.value) : undefined; + if (value === undefined) break field; + result.context = value; + } + field: { + const wireValue = wireFields.get(2); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.string(wireValue); + if (value === undefined) break field; + result.target = value; + } + field: { + const wireValue = wireFields.get(3); + if (wireValue === undefined) break field; + const value = wireValue.type === WireType.LengthDelimited ? decodeBinary_2(wireValue.value) : undefined; + if (value === undefined) break field; + result.title = value; + } + field: { + const wireValue = wireFields.get(4); + if (wireValue === undefined) break field; + const value = wireValue.type === WireType.LengthDelimited ? decodeBinary_3(wireValue.value) : undefined; + if (value === undefined) break field; + result.description = value; + } + field: { + const wireValue = wireFields.get(6); + if (wireValue === undefined) break field; + const value = wireValue.type === WireType.LengthDelimited ? decodeBinary_4(wireValue.value) : undefined; + if (value === undefined) break field; + result.tags = value; + } + field: { + const wireValue = wireFields.get(7); + if (wireValue === undefined) break field; + const value = wireValue.type === WireType.LengthDelimited ? decodeBinary_5(wireValue.value) : undefined; + if (value === undefined) break field; + result.category = value; + } + field: { + const wireValue = wireFields.get(8); + if (wireValue === undefined) break field; + const value = wireValue.type === WireType.LengthDelimited ? decodeBinary_6(wireValue.value) : undefined; + if (value === undefined) break field; + result.license = value; + } + field: { + const wireValue = wireFields.get(20); + if (wireValue === undefined) break field; + const value = wireValue.type === WireType.LengthDelimited ? decodeBinary_7(wireValue.value) : undefined; + if (value === undefined) break field; + result.videoThumbnail = value; + } + field: { + const wireValue = wireFields.get(38); + if (wireValue === undefined) break field; + const value = wireValue.type === WireType.LengthDelimited ? decodeBinary_8(wireValue.value) : undefined; + if (value === undefined) break field; + result.privacy = value; + } + field: { + const wireValue = wireFields.get(68); + if (wireValue === undefined) break field; + const value = wireValue.type === WireType.LengthDelimited ? decodeBinary_9(wireValue.value) : undefined; + if (value === undefined) break field; + result.madeForKids = value; + } + field: { + const wireValue = wireFields.get(69); + if (wireValue === undefined) break field; + const value = wireValue.type === WireType.LengthDelimited ? decodeBinary_10(wireValue.value) : undefined; + if (value === undefined) break field; + result.ageRestricted = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/LiveMessageParams.ts b/src/proto/generated/messages/youtube/LiveMessageParams.ts new file mode 100644 index 000000000..9789fc088 --- /dev/null +++ b/src/proto/generated/messages/youtube/LiveMessageParams.ts @@ -0,0 +1,117 @@ +import { + Type as Params, + encodeJson as encodeJson_1, + decodeJson as decodeJson_1, + encodeBinary as encodeBinary_1, + decodeBinary as decodeBinary_1, +} from "./(LiveMessageParams)/Params.js"; +import { + tsValueToJsonValueFns, + jsonValueToTsValueFns, +} from "../../runtime/json/scalar.js"; +import { + WireMessage, + WireType, +} from "../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../runtime/wire/serialize.js"; +import { + tsValueToWireValueFns, + wireValueToTsValueFns, +} from "../../runtime/wire/scalar.js"; +import { + default as deserialize, +} from "../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube { + export type LiveMessageParams = { + params?: Params; + number0?: number; + number1?: number; + } +} + +export type Type = $.youtube.LiveMessageParams; + +export function getDefaultValue(): $.youtube.LiveMessageParams { + return { + params: undefined, + number0: undefined, + number1: undefined, + }; +} + +export function createValue(partialValue: Partial<$.youtube.LiveMessageParams>): $.youtube.LiveMessageParams { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.LiveMessageParams): unknown { + const result: any = {}; + if (value.params !== undefined) result.params = encodeJson_1(value.params); + if (value.number0 !== undefined) result.number0 = tsValueToJsonValueFns.int32(value.number0); + if (value.number1 !== undefined) result.number1 = tsValueToJsonValueFns.int32(value.number1); + return result; +} + +export function decodeJson(value: any): $.youtube.LiveMessageParams { + const result = getDefaultValue(); + if (value.params !== undefined) result.params = decodeJson_1(value.params); + if (value.number0 !== undefined) result.number0 = jsonValueToTsValueFns.int32(value.number0); + if (value.number1 !== undefined) result.number1 = jsonValueToTsValueFns.int32(value.number1); + return result; +} + +export function encodeBinary(value: $.youtube.LiveMessageParams): Uint8Array { + const result: WireMessage = []; + if (value.params !== undefined) { + const tsValue = value.params; + result.push( + [1, { type: WireType.LengthDelimited as const, value: encodeBinary_1(tsValue) }], + ); + } + if (value.number0 !== undefined) { + const tsValue = value.number0; + result.push( + [2, tsValueToWireValueFns.int32(tsValue)], + ); + } + if (value.number1 !== undefined) { + const tsValue = value.number1; + result.push( + [3, tsValueToWireValueFns.int32(tsValue)], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.LiveMessageParams { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(1); + if (wireValue === undefined) break field; + const value = wireValue.type === WireType.LengthDelimited ? decodeBinary_1(wireValue.value) : undefined; + if (value === undefined) break field; + result.params = value; + } + field: { + const wireValue = wireFields.get(2); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.number0 = value; + } + field: { + const wireValue = wireFields.get(3); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.number1 = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/MusicSearchFilter.ts b/src/proto/generated/messages/youtube/MusicSearchFilter.ts new file mode 100644 index 000000000..710835f1d --- /dev/null +++ b/src/proto/generated/messages/youtube/MusicSearchFilter.ts @@ -0,0 +1,78 @@ +import { + Type as Filters, + encodeJson as encodeJson_1, + decodeJson as decodeJson_1, + encodeBinary as encodeBinary_1, + decodeBinary as decodeBinary_1, +} from "./(MusicSearchFilter)/Filters.js"; +import { + jsonValueToTsValueFns, +} from "../../runtime/json/scalar.js"; +import { + WireMessage, + WireType, +} from "../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../runtime/wire/serialize.js"; +import { + default as deserialize, +} from "../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube { + export type MusicSearchFilter = { + filters?: Filters; + } +} + +export type Type = $.youtube.MusicSearchFilter; + +export function getDefaultValue(): $.youtube.MusicSearchFilter { + return { + filters: undefined, + }; +} + +export function createValue(partialValue: Partial<$.youtube.MusicSearchFilter>): $.youtube.MusicSearchFilter { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.MusicSearchFilter): unknown { + const result: any = {}; + if (value.filters !== undefined) result.filters = encodeJson_1(value.filters); + return result; +} + +export function decodeJson(value: any): $.youtube.MusicSearchFilter { + const result = getDefaultValue(); + if (value.filters !== undefined) result.filters = decodeJson_1(value.filters); + return result; +} + +export function encodeBinary(value: $.youtube.MusicSearchFilter): Uint8Array { + const result: WireMessage = []; + if (value.filters !== undefined) { + const tsValue = value.filters; + result.push( + [2, { type: WireType.LengthDelimited as const, value: encodeBinary_1(tsValue) }], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.MusicSearchFilter { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(2); + if (wireValue === undefined) break field; + const value = wireValue.type === WireType.LengthDelimited ? decodeBinary_1(wireValue.value) : undefined; + if (value === undefined) break field; + result.filters = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/NotificationPreferences.ts b/src/proto/generated/messages/youtube/NotificationPreferences.ts new file mode 100644 index 000000000..2d25fc6d9 --- /dev/null +++ b/src/proto/generated/messages/youtube/NotificationPreferences.ts @@ -0,0 +1,134 @@ +import { + Type as Preference, + encodeJson as encodeJson_1, + decodeJson as decodeJson_1, + encodeBinary as encodeBinary_1, + decodeBinary as decodeBinary_1, +} from "./(NotificationPreferences)/Preference.js"; +import { + tsValueToJsonValueFns, + jsonValueToTsValueFns, +} from "../../runtime/json/scalar.js"; +import { + WireMessage, + WireType, +} from "../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../runtime/wire/serialize.js"; +import { + tsValueToWireValueFns, + wireValueToTsValueFns, +} from "../../runtime/wire/scalar.js"; +import { + default as deserialize, +} from "../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube { + export type NotificationPreferences = { + channelId: string; + prefId?: Preference; + number0?: number; + number1?: number; + } +} + +export type Type = $.youtube.NotificationPreferences; + +export function getDefaultValue(): $.youtube.NotificationPreferences { + return { + channelId: "", + prefId: undefined, + number0: undefined, + number1: undefined, + }; +} + +export function createValue(partialValue: Partial<$.youtube.NotificationPreferences>): $.youtube.NotificationPreferences { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.NotificationPreferences): unknown { + const result: any = {}; + if (value.channelId !== undefined) result.channelId = tsValueToJsonValueFns.string(value.channelId); + if (value.prefId !== undefined) result.prefId = encodeJson_1(value.prefId); + if (value.number0 !== undefined) result.number0 = tsValueToJsonValueFns.int32(value.number0); + if (value.number1 !== undefined) result.number1 = tsValueToJsonValueFns.int32(value.number1); + return result; +} + +export function decodeJson(value: any): $.youtube.NotificationPreferences { + const result = getDefaultValue(); + if (value.channelId !== undefined) result.channelId = jsonValueToTsValueFns.string(value.channelId); + if (value.prefId !== undefined) result.prefId = decodeJson_1(value.prefId); + if (value.number0 !== undefined) result.number0 = jsonValueToTsValueFns.int32(value.number0); + if (value.number1 !== undefined) result.number1 = jsonValueToTsValueFns.int32(value.number1); + return result; +} + +export function encodeBinary(value: $.youtube.NotificationPreferences): Uint8Array { + const result: WireMessage = []; + if (value.channelId !== undefined) { + const tsValue = value.channelId; + result.push( + [1, tsValueToWireValueFns.string(tsValue)], + ); + } + if (value.prefId !== undefined) { + const tsValue = value.prefId; + result.push( + [2, { type: WireType.LengthDelimited as const, value: encodeBinary_1(tsValue) }], + ); + } + if (value.number0 !== undefined) { + const tsValue = value.number0; + result.push( + [3, tsValueToWireValueFns.int32(tsValue)], + ); + } + if (value.number1 !== undefined) { + const tsValue = value.number1; + result.push( + [4, tsValueToWireValueFns.int32(tsValue)], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.NotificationPreferences { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(1); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.string(wireValue); + if (value === undefined) break field; + result.channelId = value; + } + field: { + const wireValue = wireFields.get(2); + if (wireValue === undefined) break field; + const value = wireValue.type === WireType.LengthDelimited ? decodeBinary_1(wireValue.value) : undefined; + if (value === undefined) break field; + result.prefId = value; + } + field: { + const wireValue = wireFields.get(3); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.number0 = value; + } + field: { + const wireValue = wireFields.get(4); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.number1 = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/PeformCommentActionParams.ts b/src/proto/generated/messages/youtube/PeformCommentActionParams.ts new file mode 100644 index 000000000..0cfc29239 --- /dev/null +++ b/src/proto/generated/messages/youtube/PeformCommentActionParams.ts @@ -0,0 +1,168 @@ +import { + Type as TranslateCommentParams, + encodeJson as encodeJson_1, + decodeJson as decodeJson_1, + encodeBinary as encodeBinary_1, + decodeBinary as decodeBinary_1, +} from "./(PeformCommentActionParams)/TranslateCommentParams.js"; +import { + tsValueToJsonValueFns, + jsonValueToTsValueFns, +} from "../../runtime/json/scalar.js"; +import { + WireMessage, + WireType, +} from "../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../runtime/wire/serialize.js"; +import { + tsValueToWireValueFns, + wireValueToTsValueFns, +} from "../../runtime/wire/scalar.js"; +import { + default as deserialize, +} from "../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube { + export type PeformCommentActionParams = { + type: number; + unkNum?: number; + commentId: string; + videoId: string; + channelId?: string; + translateCommentParams?: TranslateCommentParams; + } +} + +export type Type = $.youtube.PeformCommentActionParams; + +export function getDefaultValue(): $.youtube.PeformCommentActionParams { + return { + type: 0, + unkNum: undefined, + commentId: "", + videoId: "", + channelId: undefined, + translateCommentParams: undefined, + }; +} + +export function createValue(partialValue: Partial<$.youtube.PeformCommentActionParams>): $.youtube.PeformCommentActionParams { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.PeformCommentActionParams): unknown { + const result: any = {}; + if (value.type !== undefined) result.type = tsValueToJsonValueFns.int32(value.type); + if (value.unkNum !== undefined) result.unkNum = tsValueToJsonValueFns.int32(value.unkNum); + if (value.commentId !== undefined) result.commentId = tsValueToJsonValueFns.string(value.commentId); + if (value.videoId !== undefined) result.videoId = tsValueToJsonValueFns.string(value.videoId); + if (value.channelId !== undefined) result.channelId = tsValueToJsonValueFns.string(value.channelId); + if (value.translateCommentParams !== undefined) result.translateCommentParams = encodeJson_1(value.translateCommentParams); + return result; +} + +export function decodeJson(value: any): $.youtube.PeformCommentActionParams { + const result = getDefaultValue(); + if (value.type !== undefined) result.type = jsonValueToTsValueFns.int32(value.type); + if (value.unkNum !== undefined) result.unkNum = jsonValueToTsValueFns.int32(value.unkNum); + if (value.commentId !== undefined) result.commentId = jsonValueToTsValueFns.string(value.commentId); + if (value.videoId !== undefined) result.videoId = jsonValueToTsValueFns.string(value.videoId); + if (value.channelId !== undefined) result.channelId = jsonValueToTsValueFns.string(value.channelId); + if (value.translateCommentParams !== undefined) result.translateCommentParams = decodeJson_1(value.translateCommentParams); + return result; +} + +export function encodeBinary(value: $.youtube.PeformCommentActionParams): Uint8Array { + const result: WireMessage = []; + if (value.type !== undefined) { + const tsValue = value.type; + result.push( + [1, tsValueToWireValueFns.int32(tsValue)], + ); + } + if (value.unkNum !== undefined) { + const tsValue = value.unkNum; + result.push( + [2, tsValueToWireValueFns.int32(tsValue)], + ); + } + if (value.commentId !== undefined) { + const tsValue = value.commentId; + result.push( + [3, tsValueToWireValueFns.string(tsValue)], + ); + } + if (value.videoId !== undefined) { + const tsValue = value.videoId; + result.push( + [5, tsValueToWireValueFns.string(tsValue)], + ); + } + if (value.channelId !== undefined) { + const tsValue = value.channelId; + result.push( + [23, tsValueToWireValueFns.string(tsValue)], + ); + } + if (value.translateCommentParams !== undefined) { + const tsValue = value.translateCommentParams; + result.push( + [31, { type: WireType.LengthDelimited as const, value: encodeBinary_1(tsValue) }], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.PeformCommentActionParams { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(1); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.type = value; + } + field: { + const wireValue = wireFields.get(2); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.unkNum = value; + } + field: { + const wireValue = wireFields.get(3); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.string(wireValue); + if (value === undefined) break field; + result.commentId = value; + } + field: { + const wireValue = wireFields.get(5); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.string(wireValue); + if (value === undefined) break field; + result.videoId = value; + } + field: { + const wireValue = wireFields.get(23); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.string(wireValue); + if (value === undefined) break field; + result.channelId = value; + } + field: { + const wireValue = wireFields.get(31); + if (wireValue === undefined) break field; + const value = wireValue.type === WireType.LengthDelimited ? decodeBinary_1(wireValue.value) : undefined; + if (value === undefined) break field; + result.translateCommentParams = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/SearchFilter.ts b/src/proto/generated/messages/youtube/SearchFilter.ts new file mode 100644 index 000000000..b0d48f076 --- /dev/null +++ b/src/proto/generated/messages/youtube/SearchFilter.ts @@ -0,0 +1,117 @@ +import { + Type as Filters, + encodeJson as encodeJson_1, + decodeJson as decodeJson_1, + encodeBinary as encodeBinary_1, + decodeBinary as decodeBinary_1, +} from "./(SearchFilter)/Filters.js"; +import { + tsValueToJsonValueFns, + jsonValueToTsValueFns, +} from "../../runtime/json/scalar.js"; +import { + WireMessage, + WireType, +} from "../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../runtime/wire/serialize.js"; +import { + tsValueToWireValueFns, + wireValueToTsValueFns, +} from "../../runtime/wire/scalar.js"; +import { + default as deserialize, +} from "../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube { + export type SearchFilter = { + sortBy?: number; + filters?: Filters; + noFilter?: number; + } +} + +export type Type = $.youtube.SearchFilter; + +export function getDefaultValue(): $.youtube.SearchFilter { + return { + sortBy: undefined, + filters: undefined, + noFilter: undefined, + }; +} + +export function createValue(partialValue: Partial<$.youtube.SearchFilter>): $.youtube.SearchFilter { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.SearchFilter): unknown { + const result: any = {}; + if (value.sortBy !== undefined) result.sortBy = tsValueToJsonValueFns.int32(value.sortBy); + if (value.filters !== undefined) result.filters = encodeJson_1(value.filters); + if (value.noFilter !== undefined) result.noFilter = tsValueToJsonValueFns.int32(value.noFilter); + return result; +} + +export function decodeJson(value: any): $.youtube.SearchFilter { + const result = getDefaultValue(); + if (value.sortBy !== undefined) result.sortBy = jsonValueToTsValueFns.int32(value.sortBy); + if (value.filters !== undefined) result.filters = decodeJson_1(value.filters); + if (value.noFilter !== undefined) result.noFilter = jsonValueToTsValueFns.int32(value.noFilter); + return result; +} + +export function encodeBinary(value: $.youtube.SearchFilter): Uint8Array { + const result: WireMessage = []; + if (value.sortBy !== undefined) { + const tsValue = value.sortBy; + result.push( + [1, tsValueToWireValueFns.int32(tsValue)], + ); + } + if (value.filters !== undefined) { + const tsValue = value.filters; + result.push( + [2, { type: WireType.LengthDelimited as const, value: encodeBinary_1(tsValue) }], + ); + } + if (value.noFilter !== undefined) { + const tsValue = value.noFilter; + result.push( + [19, tsValueToWireValueFns.int32(tsValue)], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.SearchFilter { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(1); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.sortBy = value; + } + field: { + const wireValue = wireFields.get(2); + if (wireValue === undefined) break field; + const value = wireValue.type === WireType.LengthDelimited ? decodeBinary_1(wireValue.value) : undefined; + if (value === undefined) break field; + result.filters = value; + } + field: { + const wireValue = wireFields.get(19); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.noFilter = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/SoundInfoParams.ts b/src/proto/generated/messages/youtube/SoundInfoParams.ts new file mode 100644 index 000000000..464d5c1b8 --- /dev/null +++ b/src/proto/generated/messages/youtube/SoundInfoParams.ts @@ -0,0 +1,78 @@ +import { + Type as Sound, + encodeJson as encodeJson_1, + decodeJson as decodeJson_1, + encodeBinary as encodeBinary_1, + decodeBinary as decodeBinary_1, +} from "./(SoundInfoParams)/Sound.js"; +import { + jsonValueToTsValueFns, +} from "../../runtime/json/scalar.js"; +import { + WireMessage, + WireType, +} from "../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../runtime/wire/serialize.js"; +import { + default as deserialize, +} from "../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube { + export type SoundInfoParams = { + sound?: Sound; + } +} + +export type Type = $.youtube.SoundInfoParams; + +export function getDefaultValue(): $.youtube.SoundInfoParams { + return { + sound: undefined, + }; +} + +export function createValue(partialValue: Partial<$.youtube.SoundInfoParams>): $.youtube.SoundInfoParams { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.SoundInfoParams): unknown { + const result: any = {}; + if (value.sound !== undefined) result.sound = encodeJson_1(value.sound); + return result; +} + +export function decodeJson(value: any): $.youtube.SoundInfoParams { + const result = getDefaultValue(); + if (value.sound !== undefined) result.sound = decodeJson_1(value.sound); + return result; +} + +export function encodeBinary(value: $.youtube.SoundInfoParams): Uint8Array { + const result: WireMessage = []; + if (value.sound !== undefined) { + const tsValue = value.sound; + result.push( + [94, { type: WireType.LengthDelimited as const, value: encodeBinary_1(tsValue) }], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.SoundInfoParams { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(94); + if (wireValue === undefined) break field; + const value = wireValue.type === WireType.LengthDelimited ? decodeBinary_1(wireValue.value) : undefined; + if (value === undefined) break field; + result.sound = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/VisitorData.ts b/src/proto/generated/messages/youtube/VisitorData.ts new file mode 100644 index 000000000..03a831f3c --- /dev/null +++ b/src/proto/generated/messages/youtube/VisitorData.ts @@ -0,0 +1,92 @@ +import { + tsValueToJsonValueFns, + jsonValueToTsValueFns, +} from "../../runtime/json/scalar.js"; +import { + WireMessage, +} from "../../runtime/wire/index.js"; +import { + default as serialize, +} from "../../runtime/wire/serialize.js"; +import { + tsValueToWireValueFns, + wireValueToTsValueFns, +} from "../../runtime/wire/scalar.js"; +import { + default as deserialize, +} from "../../runtime/wire/deserialize.js"; + +export declare namespace $.youtube { + export type VisitorData = { + id: string; + timestamp: number; + } +} + +export type Type = $.youtube.VisitorData; + +export function getDefaultValue(): $.youtube.VisitorData { + return { + id: "", + timestamp: 0, + }; +} + +export function createValue(partialValue: Partial<$.youtube.VisitorData>): $.youtube.VisitorData { + return { + ...getDefaultValue(), + ...partialValue, + }; +} + +export function encodeJson(value: $.youtube.VisitorData): unknown { + const result: any = {}; + if (value.id !== undefined) result.id = tsValueToJsonValueFns.string(value.id); + if (value.timestamp !== undefined) result.timestamp = tsValueToJsonValueFns.int32(value.timestamp); + return result; +} + +export function decodeJson(value: any): $.youtube.VisitorData { + const result = getDefaultValue(); + if (value.id !== undefined) result.id = jsonValueToTsValueFns.string(value.id); + if (value.timestamp !== undefined) result.timestamp = jsonValueToTsValueFns.int32(value.timestamp); + return result; +} + +export function encodeBinary(value: $.youtube.VisitorData): Uint8Array { + const result: WireMessage = []; + if (value.id !== undefined) { + const tsValue = value.id; + result.push( + [1, tsValueToWireValueFns.string(tsValue)], + ); + } + if (value.timestamp !== undefined) { + const tsValue = value.timestamp; + result.push( + [5, tsValueToWireValueFns.int32(tsValue)], + ); + } + return serialize(result); +} + +export function decodeBinary(binary: Uint8Array): $.youtube.VisitorData { + const result = getDefaultValue(); + const wireMessage = deserialize(binary); + const wireFields = new Map(wireMessage); + field: { + const wireValue = wireFields.get(1); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.string(wireValue); + if (value === undefined) break field; + result.id = value; + } + field: { + const wireValue = wireFields.get(5); + if (wireValue === undefined) break field; + const value = wireValueToTsValueFns.int32(wireValue); + if (value === undefined) break field; + result.timestamp = value; + } + return result; +} diff --git a/src/proto/generated/messages/youtube/index.ts b/src/proto/generated/messages/youtube/index.ts new file mode 100644 index 000000000..ea4ec6161 --- /dev/null +++ b/src/proto/generated/messages/youtube/index.ts @@ -0,0 +1,11 @@ +export type { Type as VisitorData } from "./VisitorData.js"; +export type { Type as InnertubePayload } from "./InnertubePayload.js"; +export type { Type as ChannelAnalytics } from "./ChannelAnalytics.js"; +export type { Type as SoundInfoParams } from "./SoundInfoParams.js"; +export type { Type as NotificationPreferences } from "./NotificationPreferences.js"; +export type { Type as LiveMessageParams } from "./LiveMessageParams.js"; +export type { Type as GetCommentsSectionParams } from "./GetCommentsSectionParams.js"; +export type { Type as CreateCommentParams } from "./CreateCommentParams.js"; +export type { Type as PeformCommentActionParams } from "./PeformCommentActionParams.js"; +export type { Type as MusicSearchFilter } from "./MusicSearchFilter.js"; +export type { Type as SearchFilter } from "./SearchFilter.js"; diff --git a/src/proto/generated/runtime/Long.ts b/src/proto/generated/runtime/Long.ts new file mode 100644 index 000000000..f6cd3f547 --- /dev/null +++ b/src/proto/generated/runtime/Long.ts @@ -0,0 +1,113 @@ +export const UINT16_MAX = 0xFFFF; +export const UINT32_MAX = 0xFFFFFFFF; + +export default class Long extends Uint32Array { + constructor(lo: number = 0, hi: number = 0) { + super([lo, hi]); + } + toString(signed = true): string { + const [lo, hi] = this; + if (lo === 0 && hi === 0) return "0"; + if (signed && (hi > 0x7FFFFFFF)) { + return "-" + add(negate(this), one).toString(false); + } + const result = []; + let tmp = new Long(lo, hi); + while (compare(tmp, zero)) { + const [next, remainder] = divByTen(tmp); + result.push(remainder); + tmp = next; + } + return result.reverse().join(""); + } + static parse(text: string): Long { + const parsedValue = parseInt(text, 10); + const sign = parsedValue < 0; + if (Number.isNaN(parsedValue)) return new Long(0); + if (text.length < 10) { + if (parsedValue < 0) return add(negate(new Long(-parsedValue)), one); + return new Long(parsedValue); + } + let result = new Long(); + let powerTen = one; + for (const digit of text.split("").reverse()) { + if (parseInt(digit)) { + result = add(result, mul(new Long(parseInt(digit)), powerTen)); + } + powerTen = mul(powerTen, new Long(10)); + } + if (!sign) return result; + return add(negate(result), one); + } +} + +const zero = new Long(0); +const one = new Long(1); + +function makeChunk(value: Long): [number, number, number, number] { + const [lo, hi] = value; + return [lo & UINT16_MAX, lo >>> 16, hi & UINT16_MAX, hi >>> 16]; +} + +export function add(a: Long, b: Long): Long { + const [a00, a16, a32, a48] = makeChunk(a); + const [b00, b16, b32, b48] = makeChunk(b); + let c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 + b00; + c16 += c00 >>> 16; + c00 &= UINT16_MAX; + c16 += a16 + b16; + c32 += c16 >>> 16; + c16 &= UINT16_MAX; + c32 += a32 + b32; + c48 += c32 >>> 16; + c32 &= UINT16_MAX; + c48 += a48 + b48; + c48 &= UINT16_MAX; + return new Long(c16 << 16 | c00, c48 << 16 | c32); +} + +export function sub(a: Long, b: Long): Long { + return add(a, add(negate(b), one)); +} + +export function mul(a: Long, b: Long): Long { + const [a00, a16, a32, a48] = makeChunk(a); + const [b00, b16, b32, b48] = makeChunk(b); + let c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 * b00; + c16 += c00 >>> 16; + c00 &= UINT16_MAX; + c16 += a00 * b16 + a16 * b00; + c32 += c16 >>> 16; + c16 &= UINT16_MAX; + c32 += a00 * b32 + a32 * b00 + a16 * b16; + c48 += c32 >>> 16; + c32 &= UINT16_MAX; + c48 += a00 * b48 + a16 * b32 + a32 * b16 + a48 * b00; + c48 &= UINT16_MAX; + return new Long(c16 << 16 | c00, c48 << 16 | c32); +} + +export function divByTen(value: Long): [Long, number] { + const [lo, hi] = value; + return [ + new Long( + (((hi % 10) * (UINT32_MAX + 1) + lo) / 10) | 0, + (hi / 10) | 0, + ), + ((hi % 10) * (UINT32_MAX + 1) + lo) % 10, + ]; +} + +export function compare(a: Long, b: Long): number { + const [l1, h1] = a; + const [l2, h2] = b; + if (h1 !== h2) return h1 - h2; + return l1 - l2; +} + +function negate(value: Long): Long { + const [lo, hi] = value; + return new Long(~lo, ~hi); +} diff --git a/src/proto/generated/runtime/array.ts b/src/proto/generated/runtime/array.ts new file mode 100644 index 000000000..fabdc657c --- /dev/null +++ b/src/proto/generated/runtime/array.ts @@ -0,0 +1,25 @@ +// @ts-ignore +export type PojoSet = { [key in T]: T }; +export function toPojoSet( + arr: readonly T[], +): PojoSet { + const result: any = {}; + for (const item of arr) result[item] = item; + return result; +} + +export function removeItem(arr: T[], item: T): T[] { + const index = arr.indexOf(item); + arr.splice(index, 1); + return arr; +} + +export function groupBy(arr: T[], by: U): Map { + const result = new Map(); + for (const item of arr) { + const key = item[by]; + if (result.has(key)) result.get(key)!.push(item); + else result.set(key, [item]); + } + return result; +} diff --git a/src/proto/generated/runtime/async/async-generator.ts b/src/proto/generated/runtime/async/async-generator.ts new file mode 100644 index 000000000..e2b40d17d --- /dev/null +++ b/src/proto/generated/runtime/async/async-generator.ts @@ -0,0 +1,11 @@ +export async function* fromSingle(value: T): AsyncGenerator { + yield value; +} + +export async function first( + generator: AsyncGenerator, +): Promise { + const { done, value } = await generator.next(); + if (done) throw Error("The generator should yield at least one value."); + return value; +} diff --git a/src/proto/generated/runtime/async/event-buffer.ts b/src/proto/generated/runtime/async/event-buffer.ts new file mode 100644 index 000000000..a7c0f6c8f --- /dev/null +++ b/src/proto/generated/runtime/async/event-buffer.ts @@ -0,0 +1,70 @@ +import { defer, Deferred } from "./observer.js"; + +export interface EventBuffer { + push(value: T): void; + error(error: Error): void; + finish(): void; + drain(): AsyncGenerator; +} +export interface CreateEventBufferConfig { + onDrainStart?: () => void; + onDrainEnd?: () => void; +} +export function createEventBuffer( + config?: CreateEventBufferConfig, +): EventBuffer { + const queue: T[] = []; + let _error: Error | undefined; + let deferred: Deferred> | undefined; + let finished = false; + return { + push(value) { + if (finished) throw new Error("can't push after finish"); + if (deferred) { + deferred.resolve({ value, done: false }); + deferred = undefined; + } else { + queue.push(value); + } + }, + error(error) { + if (deferred) deferred.reject(error); + else _error = error; + finished = true; + }, + finish() { + deferred?.resolve({ value: undefined, done: true }); + finished = true; + }, + drain() { + config?.onDrainStart?.(); + const result: AsyncGenerator = { + [Symbol.asyncIterator]: () => result, + next() { + if (queue.length > 0) { + return Promise.resolve({ + value: queue.shift()!, + done: false, + }); + } else { + if (_error) return Promise.reject(_error); + if (finished) { + return Promise.resolve({ value: undefined, done: true }); + } else { + return deferred = defer(); + } + } + }, + return(value) { + config?.onDrainEnd?.(); + return Promise.resolve({ value, done: true }); + }, + throw(error) { + config?.onDrainEnd?.(); + return Promise.reject(error); + }, + }; + return result; + }, + }; +} diff --git a/src/proto/generated/runtime/async/event-emitter.ts b/src/proto/generated/runtime/async/event-emitter.ts new file mode 100644 index 000000000..7dd63c168 --- /dev/null +++ b/src/proto/generated/runtime/async/event-emitter.ts @@ -0,0 +1,34 @@ +export interface EventEmitter> { + emit(type: Type, event: Events[Type]): void; + on( + type: Type | "*", + listener: Listener, + ): Off; + off(type: keyof Events): void; +} +export type Listener = (event: Event, type: string) => void; +export type Off = () => void; + +export function createEventEmitter< + Events extends Record, +>(): EventEmitter { + const listeners = {} as Record>>; + const eventEmitter: EventEmitter = { + emit(type, event) { + listeners[type]?.forEach( + (listener) => listener(event, type as string), + ); + (type !== "*") && listeners["*"]?.forEach( + (listener) => listener(event, type as string), + ); + }, + on(type, listener) { + (listeners[type] ||= new Set()).add(listener); + return () => listeners[type]?.delete(listener); + }, + off(type) { + delete listeners[type]; + }, + }; + return eventEmitter; +} diff --git a/src/proto/generated/runtime/async/observer.ts b/src/proto/generated/runtime/async/observer.ts new file mode 100644 index 000000000..24402d383 --- /dev/null +++ b/src/proto/generated/runtime/async/observer.ts @@ -0,0 +1,84 @@ +import { removeItem } from "../array.js"; + +export interface Observer { + next(value: T): void; + error(exception?: any): void; + complete(): void; +} +export type SubscribeFn = (observer: Observer) => UnsubscribeFn; +export type UnsubscribeFn = () => void; + +export interface Deferred extends Promise { + resolve(value: T): void; + reject(reason?: any): void; +} +export function defer(): Deferred { + const transit: any = {}; + const result = new Promise( + (resolve, reject) => Object.assign(transit, { resolve, reject }), + ); + return Object.assign(result, transit); +} + +export interface Next { + (): Promise<[T, boolean]>; +} +export function createSubscribeFn( + next: Next, + wait = Promise.resolve(), +): SubscribeFn { + const observers: Observer[] = []; + (async () => { + try { + await wait; + while (observers.length) { + const [value, done] = await next(); + for (const observer of observers) observer.next(value); + if (done) break; + } + } catch (err) { + for (const observer of observers) observer.error(err); + } finally { + for (const observer of observers) observer.complete(); + } + })(); + return (observer) => { + observers.push(observer); + return () => { + observer.complete(); + removeItem(observers, observer); + }; + }; +} +export async function* subscribeFnToAsyncGenerator( + subscribe: SubscribeFn, +): AsyncGenerator { + let finished = false; + let deferred = defer(); + const observer: Observer = { + next(value) { + const result = deferred; + deferred = defer(); + result.resolve(value); + }, + error(exception) { + const result = deferred; + deferred = defer(); + result.reject(exception); + }, + complete() { + finished = true; + deferred.resolve(null as any); + }, + }; + const unsubscribe = subscribe(observer); + try { + while (true) { + const value = await deferred; + if (finished) break; + yield value; + } + } finally { + unsubscribe(); + } +} diff --git a/src/proto/generated/runtime/async/wait.ts b/src/proto/generated/runtime/async/wait.ts new file mode 100644 index 000000000..9f7cb8652 --- /dev/null +++ b/src/proto/generated/runtime/async/wait.ts @@ -0,0 +1,3 @@ +export default function wait(ms: number): Promise { + return new Promise((resolve) => setTimeout(resolve, ms)); +} diff --git a/src/proto/generated/runtime/base64.ts b/src/proto/generated/runtime/base64.ts new file mode 100644 index 000000000..d0060bc75 --- /dev/null +++ b/src/proto/generated/runtime/base64.ts @@ -0,0 +1,118 @@ +// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. + +const base64abc = [ + "A", + "B", + "C", + "D", + "E", + "F", + "G", + "H", + "I", + "J", + "K", + "L", + "M", + "N", + "O", + "P", + "Q", + "R", + "S", + "T", + "U", + "V", + "W", + "X", + "Y", + "Z", + "a", + "b", + "c", + "d", + "e", + "f", + "g", + "h", + "i", + "j", + "k", + "l", + "m", + "n", + "o", + "p", + "q", + "r", + "s", + "t", + "u", + "v", + "w", + "x", + "y", + "z", + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "+", + "/", +]; + +/** + * CREDIT: https://gist.github.com/enepomnyaschih/72c423f727d395eeaa09697058238727 + * Encodes a given Uint8Array, ArrayBuffer or string into RFC4648 base64 representation + * @param data + */ +export function encode(data: ArrayBuffer | string): string { + const uint8 = typeof data === "string" + ? new TextEncoder().encode(data) + : data instanceof Uint8Array + ? data + : new Uint8Array(data); + let result = "", + i; + const l = uint8.length; + for (i = 2; i < l; i += 3) { + result += base64abc[uint8[i - 2] >> 2]; + result += base64abc[((uint8[i - 2] & 0x03) << 4) | (uint8[i - 1] >> 4)]; + result += base64abc[((uint8[i - 1] & 0x0f) << 2) | (uint8[i] >> 6)]; + result += base64abc[uint8[i] & 0x3f]; + } + if (i === l + 1) { + // 1 octet yet to write + result += base64abc[uint8[i - 2] >> 2]; + result += base64abc[(uint8[i - 2] & 0x03) << 4]; + result += "=="; + } + if (i === l) { + // 2 octets yet to write + result += base64abc[uint8[i - 2] >> 2]; + result += base64abc[((uint8[i - 2] & 0x03) << 4) | (uint8[i - 1] >> 4)]; + result += base64abc[(uint8[i - 1] & 0x0f) << 2]; + result += "="; + } + return result; +} + +/** + * Decodes a given RFC4648 base64 encoded string + * @param b64 + */ +export function decode(b64: string): Uint8Array { + const binString = atob(b64); + const size = binString.length; + const bytes = new Uint8Array(size); + for (let i = 0; i < size; i++) { + bytes[i] = binString.charCodeAt(i); + } + return bytes; +} diff --git a/src/proto/generated/runtime/client-devtools.ts b/src/proto/generated/runtime/client-devtools.ts new file mode 100644 index 000000000..58d636901 --- /dev/null +++ b/src/proto/generated/runtime/client-devtools.ts @@ -0,0 +1,198 @@ +import type { RpcClientImpl } from "./rpc.js"; +import { + createEventEmitter, + EventEmitter, + Off, +} from "./async/event-emitter.js"; + +export const devtoolsKey = "@pbkit/devtools"; + +export function registerRemoteDevtools(host: string): Off { + return getDevtoolsConfig().on("*", (event, type) => { + fetch(`${host}/send`, { + method: "POST", + mode: "no-cors", + body: JSON.stringify({ event, type }), + }); + }); +} + +export function getDevtoolsConfig(): DevtoolsConfig { + const global = globalThis as any; + if (!global[devtoolsKey]) { + const devtoolsConfig = createDevtoolsConfig(); + return global[devtoolsKey] = devtoolsConfig; + } else if (Array.isArray(global[devtoolsKey])) { + const devtoolsConfig = createDevtoolsConfig(); + for (const fn of global[devtoolsKey]) { + if (typeof fn !== "function") continue; + fn(devtoolsConfig); + } + return global[devtoolsKey] = devtoolsConfig; + } else { + return global[devtoolsKey]; + } +} + +export interface DevtoolsConfig extends EventEmitter { + configId: string; + requestIdCounter: number; +} +function createDevtoolsConfig(): DevtoolsConfig { + const devtoolsConfig: DevtoolsConfig = { + configId: String(Date.now()), + requestIdCounter: 0, + ...createEventEmitter(), + }; + return devtoolsConfig; +} + +export interface WrapRpcClientImplConfig { + rpcClientImpl: RpcClientImpl; + devtoolsConfig: DevtoolsConfig; + tags: string[]; +} +export function wrapRpcClientImpl( + config: WrapRpcClientImplConfig, +): RpcClientImpl { + return function devtoolsRpcClientImpl(methodDescriptor) { + const { rpcClientImpl, devtoolsConfig, tags } = config; + const rpcMethodImpl = rpcClientImpl(methodDescriptor); + return function devtoolsRpcMethodImpl(req, metadata) { + const configId = devtoolsConfig.configId; + const requestId = devtoolsConfig.requestIdCounter++; + devtoolsConfig.emit("request", { + configId, + requestId, + servicePath: methodDescriptor.service.serviceName, + rpcName: methodDescriptor.methodName, + metadataJson: toJson(metadata), + tags, + }); + const rpcMethodResult = rpcMethodImpl( + mapAsyncGenerator(req, (payload) => { + devtoolsConfig.emit("request-payload", { + configId, + requestId, + payloadJson: methodDescriptor.requestType.serializeJson(payload), + payloadProto: methodDescriptor.requestType.serializeBinary(payload), + }); + return payload; + }, (error) => { + devtoolsConfig.emit("request-error", { + configId, + requestId, + errorMessage: getErrorMessage(error), + }); + }), + metadata, + ); + const resAsyncGenerator = mapAsyncGenerator( + rpcMethodResult[0], + (payload) => { + devtoolsConfig.emit("response-payload", { + configId, + requestId, + payloadJson: methodDescriptor.responseType.serializeJson(payload), + payloadProto: methodDescriptor.responseType.serializeBinary( + payload, + ), + }); + return payload; + }, + (error) => { + devtoolsConfig.emit("response-error", { + configId, + requestId, + errorMessage: getErrorMessage(error), + }); + }, + ); + const headerPromise = rpcMethodResult[1].then((header) => { + devtoolsConfig.emit("response", { + configId, + requestId, + headerJson: toJson(header), + }); + return header; + }); + const trailerPromise = rpcMethodResult[2].then((trailer) => { + devtoolsConfig.emit("response-trailer", { + configId, + requestId, + trailerJson: toJson(trailer), + }); + return trailer; + }); + return [resAsyncGenerator, headerPromise, trailerPromise]; + }; + }; +} + +function toJson(value: any): string { + if ((!value) || (typeof value !== "object")) return "{}"; + return JSON.stringify(value); +} + +async function* mapAsyncGenerator( + asyncGenerator: AsyncGenerator, + fn: (value: T) => T | Promise, + catchFn: (error: any) => void, +): AsyncGenerator { + try { + for await (const value of asyncGenerator) { + yield await fn(value); + } + } catch (error) { + catchFn(error); + throw error; + } +} + +function getErrorMessage(error: any): string { + if (error instanceof Error) return error.stack || error.message; + return String(error); +} + +export interface Events { + "request": { + configId: string; + requestId: number; + servicePath: string; + rpcName: string; + metadataJson: string; + tags: string[]; + }; + "request-payload": { + configId: string; + requestId: number; + payloadJson: string; + payloadProto: Uint8Array; + }; + "request-error": { + configId: string; + requestId: number; + errorMessage: string; + }; + "response": { + configId: string; + requestId: number; + headerJson: string; + }; + "response-payload": { + configId: string; + requestId: number; + payloadJson: string; + payloadProto: Uint8Array; + }; + "response-error": { + configId: string; + requestId: number; + errorMessage: string; + }; + "response-trailer": { + configId: string; + requestId: number; + trailerJson: string; + }; +} diff --git a/src/proto/generated/runtime/json/scalar.ts b/src/proto/generated/runtime/json/scalar.ts new file mode 100644 index 000000000..a8c9ad897 --- /dev/null +++ b/src/proto/generated/runtime/json/scalar.ts @@ -0,0 +1,82 @@ +import { encode as base64Encode, decode as base64Decode } from "../base64.js"; + +type TsValueToJsonValue = (tsValue: T) => unknown; +type JsonValueToTsValue = (jsonValue: any) => T; + +interface TsValueToJsonValueFns { + int32: TsValueToJsonValue; + int64: TsValueToJsonValue; + uint32: TsValueToJsonValue; + uint64: TsValueToJsonValue; + sint32: TsValueToJsonValue; + sint64: TsValueToJsonValue; + bool: TsValueToJsonValue; + double: TsValueToJsonValue; + float: TsValueToJsonValue; + fixed32: TsValueToJsonValue; + fixed64: TsValueToJsonValue; + sfixed32: TsValueToJsonValue; + sfixed64: TsValueToJsonValue; + string: TsValueToJsonValue; + bytes: TsValueToJsonValue; + enum: TsValueToJsonValue; +} + +interface JsonValueToTsValueFns { + int32: JsonValueToTsValue; + int64: JsonValueToTsValue; + uint32: JsonValueToTsValue; + uint64: JsonValueToTsValue; + sint32: JsonValueToTsValue; + sint64: JsonValueToTsValue; + bool: JsonValueToTsValue; + double: JsonValueToTsValue; + float: JsonValueToTsValue; + fixed32: JsonValueToTsValue; + fixed64: JsonValueToTsValue; + sfixed32: JsonValueToTsValue; + sfixed64: JsonValueToTsValue; + string: JsonValueToTsValue; + bytes: JsonValueToTsValue; + enum: JsonValueToTsValue; +} + + +export const tsValueToJsonValueFns: TsValueToJsonValueFns = { + int32: (tsValue) => tsValue, + int64: (tsValue) => tsValue, + uint32: (tsValue) => tsValue, + uint64: (tsValue) => tsValue, + sint32: (tsValue) => tsValue, + sint64: (tsValue) => tsValue, + bool: (tsValue) => tsValue, + double: (tsValue) => tsValue, + float: (tsValue) => tsValue, + fixed32: (tsValue) => tsValue, + fixed64: (tsValue) => tsValue, + sfixed32: (tsValue) => tsValue, + sfixed64: (tsValue) => tsValue, + string: (tsValue) => tsValue, + bytes: (tsValue) => base64Encode(tsValue), + enum: (tsValue) => tsValue, +}; + + +export const jsonValueToTsValueFns: JsonValueToTsValueFns = { + int32: (tsValue) => tsValue, + int64: (tsValue) => tsValue, + uint32: (tsValue) => tsValue, + uint64: (tsValue) => tsValue, + sint32: (tsValue) => tsValue, + sint64: (tsValue) => tsValue, + bool: (tsValue) => tsValue, + double: (tsValue) => tsValue, + float: (tsValue) => tsValue, + fixed32: (tsValue) => tsValue, + fixed64: (tsValue) => tsValue, + sfixed32: (tsValue) => tsValue, + sfixed64: (tsValue) => tsValue, + string: (tsValue) => tsValue, + bytes: (tsValue) => base64Decode(tsValue), + enum: (tsValue) => tsValue, +}; diff --git a/src/proto/generated/runtime/rpc.ts b/src/proto/generated/runtime/rpc.ts new file mode 100644 index 000000000..6f966794a --- /dev/null +++ b/src/proto/generated/runtime/rpc.ts @@ -0,0 +1,130 @@ +import { createEventBuffer } from "./async/event-buffer.js"; +import { defer } from "./async/observer.js"; + +export type Method< + TMetadata = any, + THeader = any, + TTrailer = any, + TServiceName extends string = string, + TMethodName extends string = string, + TRequestStream extends boolean = boolean, + TResponseStream extends boolean = boolean, + TReq = any, + TRes = any, +> = [ + MethodDescriptor< + TReq, + TRes, + TMethodName, + TServiceName, + TRequestStream, + TResponseStream + >, + MethodImpl, +]; + +export type RpcClientImpl = < + TReq, + TRes, +>( + methodDescriptor: MethodDescriptor, +) => MethodImpl; + +export interface MethodDescriptor< + TReq, + TRes, + TMethodName extends string = string, + TServiceName extends string = string, + TRequestStream extends boolean = boolean, + TResponseStream extends boolean = boolean, +> { + methodName: TMethodName; + service: { serviceName: TServiceName }; + requestStream: TRequestStream; + responseStream: TResponseStream; + requestType: { + serializeBinary: (value: TReq) => Uint8Array; + deserializeBinary: (value: Uint8Array) => TReq; + serializeJson: (value: TReq) => string; + }; + responseType: { + serializeBinary: (value: TRes) => Uint8Array; + deserializeBinary: (value: Uint8Array) => TRes; + serializeJson: (value: TRes) => string; + }; +} + +type ThenArg = T extends Promise ? U : T; +export type RpcReturnType = ( + Promise : [ThenArg, ...TResArgs]> +); + +export interface MethodImpl< + TReq, + TRes, + TMetadata = any, + THeader = any, + TTrailer = any, +> { + ( + req: AsyncGenerator, + metadata?: TMetadata, + ): [AsyncGenerator, Promise, Promise]; +} + +export interface MethodImplHandlerReq { + metadata?: TMetadata; + messages: AsyncGenerator; + drainEnd: Promise; +} +export interface MethodImplHandlerRes { + header(value: THeader): void; + send(value: TRes): void; + end(value: TTrailer): void; +} +export interface MethodImplHandler { + ( + req: MethodImplHandlerReq, + res: MethodImplHandlerRes, + ): void; +} +export function getMethodImpl< + TReq, + TRes, + TMetadata, + THeader, + TTrailer, +>( + handler: MethodImplHandler, +): MethodImpl { + return (messages: AsyncGenerator, metadata?: TMetadata) => { + const headerPromise = defer(); + const trailerPromise = defer(); + const drainEnd = defer(); + const eventBuffer = createEventBuffer({ + onDrainEnd: drainEnd.resolve, + }); + const header = headerPromise.resolve; + const send = eventBuffer.push; + const end = (value: TTrailer) => { + eventBuffer.finish(); + trailerPromise.resolve(value); + }; + handler({ metadata, messages, drainEnd }, { header, send, end }); + return [eventBuffer.drain(), headerPromise, trailerPromise]; + }; +} + +export function createServerImplBuilder() { + const buffer = createEventBuffer>(); + return { + register( + methodDescriptor: MethodDescriptor, + handler: MethodImplHandler, + ) { + buffer.push([methodDescriptor, getMethodImpl(handler)]); + }, + finish: buffer.finish, + drain: buffer.drain, + }; +} diff --git a/src/proto/generated/runtime/scalar.ts b/src/proto/generated/runtime/scalar.ts new file mode 100644 index 000000000..570fbd384 --- /dev/null +++ b/src/proto/generated/runtime/scalar.ts @@ -0,0 +1,26 @@ +export type ScalarValueTypePath = `.${ScalarValueType}`; +export type ScalarValueTypes = Writable; +export type ScalarValueType = ScalarValueTypes[number]; +export const _scalarValueTypes = [ + "double", + "float", + "int32", + "int64", + "uint32", + "uint64", + "sint32", + "sint64", + "fixed32", + "fixed64", + "sfixed32", + "sfixed64", + "bool", + "string", + "bytes", +] as const; +export const scalarValueTypes: ScalarValueTypes = + _scalarValueTypes as ScalarValueTypes; + +type Writable = { + -readonly [K in keyof T]: T[K]; +}; diff --git a/src/proto/generated/runtime/wire/deserialize.ts b/src/proto/generated/runtime/wire/deserialize.ts new file mode 100644 index 000000000..361dcdbdb --- /dev/null +++ b/src/proto/generated/runtime/wire/deserialize.ts @@ -0,0 +1,60 @@ +import Long from "../Long.js"; +import { WireMessage, WireType } from "./index.js"; +import { decode } from "./varint.js"; + +export default function deserialize(uint8array: Uint8Array): WireMessage { + let idx = 0; + const offset = uint8array.byteOffset; + const result: WireMessage = []; + const dataview = new DataView(uint8array.buffer, offset); + while (idx < uint8array.length) { + const decodeResult = decode(new DataView(uint8array.buffer, offset + idx)); + const key = decodeResult[1][0]; + idx += decodeResult[0]; + const type = (key & 0b111) as WireType; + const fieldNumber = key >>> 3; + switch (type) { + default: + throw new Error(`Unknown wire type ${type}`); + case WireType.Varint: { + const [len, value] = decode( + new DataView(uint8array.buffer, offset + idx), + ); + result.push([fieldNumber, { type, value }]); + idx += len; + break; + } + case WireType.Fixed64: + const lo = dataview.getUint32(idx, true); + const hi = dataview.getUint32(idx += 4, true); + idx += 4; + result.push([fieldNumber, { + type, + value: new Long(lo, hi), + }]); + break; + case WireType.LengthDelimited: { + const [len, value] = decode( + new DataView(uint8array.buffer, offset + idx), + ); + result.push([fieldNumber, { + type, + value: uint8array.subarray(idx += len, idx += value[0]), + }]); + break; + } + case WireType.StartGroup: + case WireType.EndGroup: + result.push([fieldNumber, { type }]); + break; + case WireType.Fixed32: + result.push([fieldNumber, { + type, + value: dataview.getUint32(idx, true), + }]); + idx += 4; + break; + } + } + return result; +} diff --git a/src/proto/generated/runtime/wire/index.ts b/src/proto/generated/runtime/wire/index.ts new file mode 100644 index 000000000..6b9ed2e8a --- /dev/null +++ b/src/proto/generated/runtime/wire/index.ts @@ -0,0 +1,38 @@ +import Long from "../Long.js"; + +export type WireMessage = [FieldNumber, Field][]; +export type FieldNumber = number; +export type Field = + | Varint + | Fixed64 + | LengthDelimited + | StartGroup + | EndGroup + | Fixed32; + +export enum WireType { + Varint = 0, + Fixed64 = 1, + LengthDelimited = 2, + StartGroup = 3, + EndGroup = 4, + Fixed32 = 5, +} + +interface FieldBase { + type: T; +} +export interface Varint extends FieldBase { + value: Long; +} +export interface Fixed64 extends FieldBase { + value: Long; +} +export interface LengthDelimited extends FieldBase { + value: Uint8Array; +} +export interface StartGroup extends FieldBase {} +export interface EndGroup extends FieldBase {} +export interface Fixed32 extends FieldBase { + value: number; +} diff --git a/src/proto/generated/runtime/wire/scalar.ts b/src/proto/generated/runtime/wire/scalar.ts new file mode 100644 index 000000000..90e5eef3f --- /dev/null +++ b/src/proto/generated/runtime/wire/scalar.ts @@ -0,0 +1,372 @@ +import Long from "../Long.js"; +import { decode as decodeVarint, encode as encodeVarint } from "./varint.js"; +import { decode as decodeZigzag, encode as encodeZigzag } from "./zigzag.js"; +import { concat } from "./serialize.js"; +import { Field, LengthDelimited, WireType } from "./index.js"; + +type WireValueToTsValue = (wireValue: Field) => T | undefined; +type TsValueToWireValue = (tsValue: T) => Field; +type Unpack = (wireValues: Iterable) => Generator; +type Pack = (values: T[]) => LengthDelimited; + +interface WireValueToTsValueFns extends NumericWireValueToTsValueFns { + string: WireValueToTsValue; + bytes: WireValueToTsValue; +} + +interface TsValueToWireValueFns extends TsValueToNumericWireValueFns { + string: TsValueToWireValue; + bytes: TsValueToWireValue; +} + +interface NumericWireValueToTsValueFns extends VarintFieldToTsValueFns { + double: WireValueToTsValue; + float: WireValueToTsValue; + fixed32: WireValueToTsValue; + fixed64: WireValueToTsValue; + sfixed32: WireValueToTsValue; + sfixed64: WireValueToTsValue; +} + +interface TsValueToNumericWireValueFns extends TsValueToVarintFieldFns { + double: TsValueToWireValue; + float: TsValueToWireValue; + fixed32: TsValueToWireValue; + fixed64: TsValueToWireValue; + sfixed32: TsValueToWireValue; + sfixed64: TsValueToWireValue; +} + +type DecodeVarintFns = typeof decodeVarintFns; +const decodeVarintFns = { + int32: (long: Long) => long[0] | 0, + int64: (long: Long) => long.toString(true), + uint32: (long: Long) => long[0] >>> 0, + uint64: (long: Long) => long.toString(false), + sint32: (long: Long) => decodeZigzag(long[0]), + sint64: (long: Long) => decodeZigzag(long).toString(true), + bool: (long: Long) => long[0] !== 0, +}; + +type EncodeVarintFns = { + [key in keyof DecodeVarintFns]: ( + tsValue: ReturnType, + ) => Long; +}; +const encodeVarintFns: EncodeVarintFns = { + int32: (tsValue) => new Long(tsValue), + int64: (tsValue) => Long.parse(tsValue), + uint32: (tsValue) => new Long(tsValue), + uint64: (tsValue) => Long.parse(tsValue), + sint32: (tsValue) => encodeZigzag(new Long(tsValue)), + sint64: (tsValue) => encodeZigzag(Long.parse(tsValue)), + bool: (tsValue) => new Long(+tsValue), +}; + +type VarintFieldToTsValueFns = typeof varintFieldToTsValueFns; +const varintFieldToTsValueFns = Object.fromEntries( + Object.entries(decodeVarintFns).map(([type, fn]) => [ + type, + (wireValue: Field) => { + if (wireValue.type !== WireType.Varint) return; + return fn(wireValue.value); + }, + ]), +) as { + [type in keyof DecodeVarintFns]: WireValueToTsValue< + ReturnType + >; +}; + +type TsValueToVarintFieldFns = typeof tsValueToVarintFieldFns; +const tsValueToVarintFieldFns = Object.fromEntries( + Object.entries(encodeVarintFns).map(([type, fn]) => ([ + type, + (tsValue: T) => ({ + type: WireType.Varint, + value: fn(tsValue), + }), + ])), +) as { + [type in keyof DecodeVarintFns]: TsValueToWireValue< + ReturnType + >; +}; + +export const wireValueToTsValueFns: WireValueToTsValueFns = { + ...varintFieldToTsValueFns, + double: (wireValue) => { + if (wireValue.type !== WireType.Fixed64) return; + const dataview = new DataView(wireValue.value.buffer); + return dataview.getFloat64(0, true); + }, + float: (wireValue) => { + if (wireValue.type !== WireType.Fixed32) return; + const dataview = new DataView(new Uint32Array([wireValue.value]).buffer); + return dataview.getFloat32(0, true); + }, + fixed32: (wireValue) => { + if (wireValue.type !== WireType.Fixed32) return; + return wireValue.value >>> 0; + }, + fixed64: (wireValue) => { + if (wireValue.type !== WireType.Fixed64) return; + return wireValue.value.toString(false); + }, + sfixed32: (wireValue) => { + if (wireValue.type !== WireType.Fixed32) return; + return wireValue.value | 0; + }, + sfixed64: (wireValue) => { + if (wireValue.type !== WireType.Fixed64) return; + return wireValue.value.toString(true); + }, + string: (wireValue) => { + if (wireValue.type !== WireType.LengthDelimited) return; + const textDecoder = new TextDecoder(); + return textDecoder.decode(wireValue.value); + }, + bytes: (wireValue) => { + if (wireValue.type !== WireType.LengthDelimited) return; + return wireValue.value; + }, +}; + +export const tsValueToWireValueFns: TsValueToWireValueFns = { + ...tsValueToVarintFieldFns, + double: (tsValue) => { + const long = new Long(); + const dataview = new DataView(long.buffer); + dataview.setFloat64(0, tsValue, true); + return { type: WireType.Fixed64, value: long }; + }, + float: (tsValue) => { + const u32 = new Uint32Array(1); + const dataview = new DataView(u32.buffer); + dataview.setFloat32(0, tsValue, true); + return { type: WireType.Fixed32, value: dataview.getUint32(0, true) }; + }, + fixed32: (tsValue) => ({ type: WireType.Fixed32, value: tsValue >>> 0 }), + fixed64: (tsValue) => ({ + type: WireType.Fixed64, + value: Long.parse(tsValue), + }), + sfixed32: (tsValue) => ({ type: WireType.Fixed32, value: tsValue | 0 }), + sfixed64: (tsValue) => ({ + type: WireType.Fixed64, + value: Long.parse(tsValue), + }), + string: (tsValue) => { + const textEncoder = new TextEncoder(); + return { + type: WireType.LengthDelimited, + value: textEncoder.encode(tsValue), + }; + }, + bytes: (tsValue) => ({ type: WireType.LengthDelimited, value: tsValue }), +}; + +type UnpackFns = { + [type in keyof NumericWireValueToTsValueFns]: Unpack< + NonNullable> + >; +}; +const unpackVarintFns = Object.fromEntries( + Object.keys(decodeVarintFns).map((type) => [ + type, + function* (wireValues: Iterable) { + type Key = keyof typeof decodeVarintFns; + for (const wireValue of wireValues) { + const value = wireValueToTsValueFns[type as Key](wireValue); + if (value != null) yield value; + else { + for (const long of unpackVarint(wireValue)) { + yield decodeVarintFns[type as Key](long); + } + } + } + }, + ]), +) as { + [type in keyof DecodeVarintFns]: Unpack< + ReturnType + >; +}; +export const unpackFns: UnpackFns = { + ...unpackVarintFns, + *double(wireValues) { + for (const wireValue of wireValues) { + const value = wireValueToTsValueFns.double(wireValue); + if (value != null) yield value; + else yield* unpackDouble(wireValue); + } + }, + *float(wireValues) { + for (const wireValue of wireValues) { + const value = wireValueToTsValueFns.float(wireValue); + if (value != null) yield value; + else yield* unpackFloat(wireValue); + } + }, + *fixed32(wireValues) { + for (const wireValue of wireValues) { + const value = wireValueToTsValueFns.fixed32(wireValue); + if (value != null) yield value; + else for (const value of unpackFixed32(wireValue)) yield value >>> 0; + } + }, + *fixed64(wireValues) { + for (const wireValue of wireValues) { + const value = wireValueToTsValueFns.fixed64(wireValue); + if (value != null) yield value; + else { + for (const value of unpackFixed64(wireValue)) { + yield value.toString(false); + } + } + } + }, + *sfixed32(wireValues) { + for (const wireValue of wireValues) { + const value = wireValueToTsValueFns.sfixed32(wireValue); + if (value != null) yield value; + else for (const value of unpackFixed32(wireValue)) yield value | 0; + } + }, + *sfixed64(wireValues) { + for (const wireValue of wireValues) { + const value = wireValueToTsValueFns.sfixed64(wireValue); + if (value != null) yield value; + else { + for (const value of unpackFixed64(wireValue)) { + yield value.toString(true); + } + } + } + }, +}; + +type PackFns = { + [type in keyof NumericWireValueToTsValueFns]: Pack< + NonNullable> + >; +}; +const packVarintFns = Object.fromEntries( + Object.keys(encodeVarintFns).map((type) => [ + type, + function (tsValues: T[]) { + type Key = keyof typeof encodeVarintFns; + return { + type: WireType.LengthDelimited, + value: concat(tsValues.map((tsValue) => { + const value = encodeVarintFns[type as Key](tsValue); + return encodeVarint(value); + })), + }; + }, + ]), +) as { + [type in keyof EncodeVarintFns]: Pack< + ReturnType + >; +}; +function getFixedPackFn( + size: number, + setFn: (dataview: DataView, byteOffset: number, value: T) => void, +): Pack { + return function pack(values) { + const value = new Uint8Array(values.length * size); + const dataview = new DataView(value.buffer); + for (let i = 0; i < values.length; ++i) { + setFn(dataview, i * size, values[i]); + } + return { type: WireType.LengthDelimited, value }; + }; +} +export const packFns: PackFns = { + ...packVarintFns, + double: getFixedPackFn(8, (dataView, byteOffset, value) => { + dataView.setFloat64(byteOffset, value, true); + }), + float: getFixedPackFn(4, (dataView, byteOffset, value) => { + dataView.setFloat32(byteOffset, value, true); + }), + fixed32: getFixedPackFn(4, (dataView, byteOffset, value) => { + dataView.setUint32(byteOffset, value, true); + }), + fixed64: getFixedPackFn(8, (dataView, byteOffset, value) => { + const long = Long.parse(value); + dataView.setUint32(byteOffset, long[0], true); + dataView.setUint32(byteOffset + 4, long[1], true); + }), + sfixed32: getFixedPackFn(4, (dataView, byteOffset, value) => { + dataView.setInt32(byteOffset, value, true); + }), + sfixed64: getFixedPackFn(8, (dataView, byteOffset, value) => { + const long = Long.parse(value); + dataView.setUint32(byteOffset, long[0], true); + dataView.setUint32(byteOffset + 4, long[1], true); + }), +}; + +function* unpackDouble(wireValue: Field): Generator { + if (wireValue.type !== WireType.LengthDelimited) return; + const { value } = wireValue; + let idx = 0; + const dataview = new DataView(value.buffer, value.byteOffset); + while (idx < value.length) { + const double = dataview.getFloat64(idx, true); + idx += 4; + yield double; + } +} + +function* unpackFloat(wireValue: Field): Generator { + if (wireValue.type !== WireType.LengthDelimited) return; + const { value } = wireValue; + let idx = 0; + const dataview = new DataView(value.buffer, value.byteOffset); + while (idx < value.length) { + const float = dataview.getFloat32(idx, true); + idx += 4; + yield float; + } +} + +function* unpackVarint(wireValue: Field): Generator { + if (wireValue.type !== WireType.LengthDelimited) return; + const { value } = wireValue; + let idx = 0; + const offset = value.byteOffset; + while (idx < value.length) { + const decodeResult = decodeVarint(new DataView(value.buffer, offset + idx)); + idx += decodeResult[0]; + yield decodeResult[1]; + } +} + +function* unpackFixed32(wireValue: Field): Generator { + if (wireValue.type !== WireType.LengthDelimited) return; + const { value } = wireValue; + let idx = 0; + const dataview = new DataView(value.buffer, value.byteOffset); + while (idx < value.length) { + const fixed32 = dataview.getUint32(idx, true); + idx += 4; + yield fixed32; + } +} + +function* unpackFixed64(wireValue: Field): Generator { + if (wireValue.type !== WireType.LengthDelimited) return; + const { value } = wireValue; + let idx = 0; + const dataview = new DataView(value.buffer, value.byteOffset); + while (idx < value.length) { + const lo = dataview.getUint32(idx, true); + idx += 4; + const hi = dataview.getUint32(idx, true); + idx += 4; + yield new Long(lo, hi); + } +} diff --git a/src/proto/generated/runtime/wire/serialize.ts b/src/proto/generated/runtime/wire/serialize.ts new file mode 100644 index 000000000..0dc624091 --- /dev/null +++ b/src/proto/generated/runtime/wire/serialize.ts @@ -0,0 +1,46 @@ +import { WireMessage, WireType } from "./index.js"; +import { encode } from "./varint.js"; + +export default function serialize(wireMessage: WireMessage): Uint8Array { + const result: Uint8Array[] = []; + wireMessage.forEach(([fieldNumber, field]) => { + result.push(encode((fieldNumber << 3) | field.type)); + switch (field.type) { + case WireType.Varint: + result.push(encode(field.value)); + break; + case WireType.Fixed64: { + const arr = new Uint8Array(8); + const dataview = new DataView(arr.buffer); + dataview.setUint32(0, field.value[0], true); + dataview.setUint32(4, field.value[1], true); + result.push(arr); + break; + } + case WireType.LengthDelimited: + result.push(encode(field.value.byteLength)); + result.push(field.value); + break; + case WireType.Fixed32: { + const arr = new Uint8Array(4); + const dataview = new DataView(arr.buffer); + dataview.setUint32(0, field.value, true); + result.push(arr); + break; + } + } + }); + return concat(result); +} + +export function concat(arrays: Uint8Array[]): Uint8Array { + const totalLength = arrays.reduce((acc, value) => { + return acc + value.byteLength; + }, 0); + const result = new Uint8Array(totalLength); + arrays.reduce((acc, array) => { + result.set(array, acc); + return acc + array.byteLength; + }, 0); + return result; +} diff --git a/src/proto/generated/runtime/wire/varint.ts b/src/proto/generated/runtime/wire/varint.ts new file mode 100644 index 000000000..6864e4b57 --- /dev/null +++ b/src/proto/generated/runtime/wire/varint.ts @@ -0,0 +1,51 @@ +import Long from "../Long.js"; + +export function encode(value: number | Long): Uint8Array { + const result: number[] = []; + const mask = 0b1111111; + const head = 1 << 7; + let long = typeof value === "number" ? new Long(value) : value; + while (long[0] || long[1]) { + const [lo, hi] = long; + const chunk = lo & mask; + const nextHi = hi >>> 7; + const nextLo = (lo >>> 7) | ((hi & mask) << (32 - 7)); + long = new Long(nextLo, nextHi); + const resultChunk = !(long[0] || long[1]) ? chunk : chunk | head; + result.push(resultChunk); + } + if (result.length < 1) return new Uint8Array(1); + return Uint8Array.from(result); +} + +export type DecodeResult = [ + number, // byte count + Long, // value +]; +export function decode(dataview: DataView): DecodeResult { + let result = new Long(0); + let i = 0; + while (true) { + const curr = dataview.getUint8(i); + result = or( + result, + leftshift(new Long(curr & 0b1111111), i * 7), + ); + ++i; + if (curr >>> 7) continue; + return [i, result]; + } +} + +function or(a: Long, b: Long): Long { + return new Long(a[0] | b[0], a[1] | b[1]); +} + +function leftshift(a: Long, count: number): Long { + if (count === 0) return a; + if (count >= 32) return new Long(0, a[0] << (count - 32)); + return new Long( + a[0] << count, + (a[1] << count) | (a[0] >>> (32 - count)), + ); +} diff --git a/src/proto/generated/runtime/wire/zigzag.ts b/src/proto/generated/runtime/wire/zigzag.ts new file mode 100644 index 000000000..83bd54328 --- /dev/null +++ b/src/proto/generated/runtime/wire/zigzag.ts @@ -0,0 +1,22 @@ +import Long from "../Long.js"; + +export function encode(value: T): T { + if (value instanceof Long) { + const l = new Long( + value[0] << 1, + (value[1] << 1) | (value[0] >>> 31), + ); + const r = value[1] >>> 31 ? new Long(0xFFFFFFFF, 0xFFFFFFFF) : new Long(); + return new Long(l[0] ^ r[0], l[1] ^ r[1]) as T; + } + return (((value as number) * 2) ^ ((value as number) >> 31)) >>> 0 as T; +} + +export function decode(value: T): T { + if (value instanceof Long) { + const l = new Long((value[0] >>> 1) | (value[1] << 31), (value[1]) >>> 1); + const r = value[0] & 1 ? new Long(0xFFFFFFFF, 0xFFFFFFFF) : new Long(); + return new Long(l[0] ^ r[0], l[1] ^ r[1]) as T; + } + return (((value as number) >>> 1) ^ -((value as number) & 1)) as T; +} diff --git a/src/proto/index.ts b/src/proto/index.ts index fb120c5d1..95013fd5f 100644 --- a/src/proto/index.ts +++ b/src/proto/index.ts @@ -1,17 +1,27 @@ -import { CLIENTS } from '../utils/Constants'; -import { u8ToBase64 } from '../utils/Utils'; -import { VideoMetadata } from '../core/Studio'; - -import { ChannelAnalytics, CreateCommentParams, GetCommentsSectionParams, InnertubePayload, LiveMessageParams, MusicSearchFilter, NotificationPreferences, PeformCommentActionParams, SearchFilter, SearchFilter_Filters, VisitorData } from './youtube'; +import { CLIENTS } from '../utils/Constants.js'; +import { u8ToBase64 } from '../utils/Utils.js'; +import { VideoMetadata } from '../core/Studio.js'; + +import * as VisitorData from './generated/messages/youtube/VisitorData.js'; +import * as ChannelAnalytics from './generated/messages/youtube/ChannelAnalytics.js'; +import * as SearchFilter from './generated/messages/youtube/SearchFilter.js'; +import * as SearchFilter_Filters from './generated/messages/youtube/(SearchFilter)/Filters.js'; +import * as MusicSearchFilter from './generated/messages/youtube/MusicSearchFilter.js'; +import * as LiveMessageParams from './generated/messages/youtube/LiveMessageParams.js'; +import * as GetCommentsSectionParams from './generated/messages/youtube/GetCommentsSectionParams.js'; +import * as CreateCommentParams from './generated/messages/youtube/CreateCommentParams.js'; +import * as PeformCommentActionParams from './generated/messages/youtube/PeformCommentActionParams.js'; +import * as NotificationPreferences from './generated/messages/youtube/NotificationPreferences.js'; +import * as InnertubePayload from './generated/messages/youtube/InnertubePayload.js'; class Proto { static encodeVisitorData(id: string, timestamp: number): string { - const buf = VisitorData.toBinary({ id, timestamp }); + const buf = VisitorData.encodeBinary({ id, timestamp }); return encodeURIComponent(u8ToBase64(buf).replace(/\+/g, '-').replace(/\//g, '_')); } static encodeChannelAnalyticsParams(channel_id: string): string { - const buf = ChannelAnalytics.toBinary({ + const buf = ChannelAnalytics.encodeBinary({ params: { channelId: channel_id } @@ -71,7 +81,7 @@ class Proto { vr180: 'featuresVr180' }; - const data: SearchFilter = {}; + const data: SearchFilter.Type = {}; if (filters) data.filters = {}; @@ -97,19 +107,19 @@ class Proto { if (filters.features) { for (const feature of filters.features) { - data.filters[features[feature] as keyof SearchFilter_Filters] = 1; + data.filters[features[feature] as keyof SearchFilter_Filters.Type] = 1; } } } - const buf = SearchFilter.toBinary(data); + const buf = SearchFilter.encodeBinary(data); return encodeURIComponent(u8ToBase64(buf)); } static encodeMusicSearchFilters(filters: { type?: 'all' | 'song' | 'video' | 'album' | 'playlist' | 'artist' }): string { - const data: MusicSearchFilter = { + const data: MusicSearchFilter.Type = { filters: { type: {} } @@ -119,12 +129,12 @@ class Proto { if (filters.type && filters.type !== 'all' && data.filters?.type) data.filters.type[filters.type] = 1; - const buf = MusicSearchFilter.toBinary(data); + const buf = MusicSearchFilter.encodeBinary(data); return encodeURIComponent(u8ToBase64(buf)); } static encodeMessageParams(channel_id: string, video_id: string): string { - const buf = LiveMessageParams.toBinary({ + const buf = LiveMessageParams.encodeBinary({ params: { ids: { channelId: channel_id, videoId: video_id @@ -145,7 +155,7 @@ class Proto { NEWEST_FIRST: 1 }; - const buf = GetCommentsSectionParams.toBinary({ + const buf = GetCommentsSectionParams.encodeBinary({ ctx: { videoId: video_id }, @@ -164,7 +174,7 @@ class Proto { } static encodeCommentParams(video_id: string): string { - const buf = CreateCommentParams.toBinary({ + const buf = CreateCommentParams.encodeBinary({ videoId: video_id, params: { index: 0 @@ -180,7 +190,7 @@ class Proto { text?: string, target_language?: string } = {}): string { - const data: PeformCommentActionParams = { + const data: PeformCommentActionParams.Type = { type, commentId: args.comment_id || ' ', videoId: args.video_id || ' ', @@ -203,12 +213,12 @@ class Proto { }; } - const buf = PeformCommentActionParams.toBinary(data); + const buf = PeformCommentActionParams.encodeBinary(data); return encodeURIComponent(u8ToBase64(buf)); } static encodeNotificationPref(channel_id: string, index: number): string { - const buf = NotificationPreferences.toBinary({ + const buf = NotificationPreferences.encodeBinary({ channelId: channel_id, prefId: { index @@ -220,7 +230,7 @@ class Proto { } static encodeVideoMetadataPayload(video_id: string, metadata: VideoMetadata): Uint8Array { - const data: InnertubePayload = { + const data: InnertubePayload.Type = { context: { client: { unkparam: 14, @@ -276,13 +286,13 @@ class Proto { }; } - const buf = InnertubePayload.toBinary(data); + const buf = InnertubePayload.encodeBinary(data); return buf; } static encodeCustomThumbnailPayload(video_id: string, bytes: Uint8Array): Uint8Array { - const data: InnertubePayload = { + const data: InnertubePayload.Type = { context: { client: { unkparam: 14, @@ -299,7 +309,7 @@ class Proto { } }; - const buf = InnertubePayload.toBinary(data); + const buf = InnertubePayload.encodeBinary(data); return buf; } diff --git a/src/proto/youtube.ts b/src/proto/youtube.ts deleted file mode 100644 index 86a5e84fb..000000000 --- a/src/proto/youtube.ts +++ /dev/null @@ -1,3089 +0,0 @@ -// @generated by protobuf-ts 2.8.2 -// @generated from protobuf file "youtube.proto" (package "youtube", syntax proto2) -// tslint:disable -// -// TODO: clean this up -// -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import { WireType } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import { UnknownFieldHandler } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { reflectionMergePartial } from "@protobuf-ts/runtime"; -import { MESSAGE_TYPE } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message youtube.VisitorData - */ -export interface VisitorData { - /** - * @generated from protobuf field: string id = 1; - */ - id: string; - /** - * @generated from protobuf field: int32 timestamp = 5; - */ - timestamp: number; -} -/** - * @generated from protobuf message youtube.InnertubePayload - */ -export interface InnertubePayload { - /** - * @generated from protobuf field: youtube.InnertubePayload.Context context = 1; - */ - context?: InnertubePayload_Context; - /** - * This can be either a target id or a video id. - * - * @generated from protobuf field: optional string target = 2; - */ - target?: string; - /** - * @generated from protobuf field: optional youtube.InnertubePayload.Title title = 3; - */ - title?: InnertubePayload_Title; - /** - * @generated from protobuf field: optional youtube.InnertubePayload.Description description = 4; - */ - description?: InnertubePayload_Description; - /** - * @generated from protobuf field: optional youtube.InnertubePayload.Tags tags = 6; - */ - tags?: InnertubePayload_Tags; - /** - * @generated from protobuf field: optional youtube.InnertubePayload.Privacy privacy = 38; - */ - privacy?: InnertubePayload_Privacy; - /** - * @generated from protobuf field: optional youtube.InnertubePayload.Category category = 7; - */ - category?: InnertubePayload_Category; - /** - * @generated from protobuf field: optional youtube.InnertubePayload.MadeForKids made_for_kids = 68; - */ - madeForKids?: InnertubePayload_MadeForKids; - /** - * @generated from protobuf field: optional youtube.InnertubePayload.AgeRestricted age_restricted = 69; - */ - ageRestricted?: InnertubePayload_AgeRestricted; - /** - * @generated from protobuf field: optional youtube.InnertubePayload.License license = 8; - */ - license?: InnertubePayload_License; - /** - * @generated from protobuf field: optional youtube.InnertubePayload.VideoThumbnail video_thumbnail = 20; - */ - videoThumbnail?: InnertubePayload_VideoThumbnail; -} -/** - * @generated from protobuf message youtube.InnertubePayload.Context - */ -export interface InnertubePayload_Context { - /** - * @generated from protobuf field: youtube.InnertubePayload.Context.Client client = 1; - */ - client?: InnertubePayload_Context_Client; -} -/** - * @generated from protobuf message youtube.InnertubePayload.Context.Client - */ -export interface InnertubePayload_Context_Client { - /** - * @generated from protobuf field: int32 unkparam = 16; - */ - unkparam: number; - /** - * @generated from protobuf field: string client_version = 17; - */ - clientVersion: string; - /** - * @generated from protobuf field: string client_name = 18; - */ - clientName: string; -} -// *** YT Sudio stuff *** - -/** - * @generated from protobuf message youtube.InnertubePayload.Title - */ -export interface InnertubePayload_Title { - /** - * @generated from protobuf field: string text = 1; - */ - text: string; -} -/** - * @generated from protobuf message youtube.InnertubePayload.Description - */ -export interface InnertubePayload_Description { - /** - * @generated from protobuf field: string text = 1; - */ - text: string; -} -/** - * @generated from protobuf message youtube.InnertubePayload.Tags - */ -export interface InnertubePayload_Tags { - /** - * @generated from protobuf field: repeated string list = 1; - */ - list: string[]; -} -/** - * @generated from protobuf message youtube.InnertubePayload.Privacy - */ -export interface InnertubePayload_Privacy { - /** - * @generated from protobuf field: int32 type = 1; - */ - type: number; -} -/** - * @generated from protobuf message youtube.InnertubePayload.Category - */ -export interface InnertubePayload_Category { - /** - * @generated from protobuf field: int32 id = 1; - */ - id: number; -} -/** - * @generated from protobuf message youtube.InnertubePayload.MadeForKids - */ -export interface InnertubePayload_MadeForKids { - /** - * @generated from protobuf field: int32 unkparam = 1; - */ - unkparam: number; - /** - * @generated from protobuf field: int32 choice = 2; - */ - choice: number; -} -/** - * @generated from protobuf message youtube.InnertubePayload.AgeRestricted - */ -export interface InnertubePayload_AgeRestricted { - /** - * @generated from protobuf field: int32 unkparam = 1; - */ - unkparam: number; - /** - * @generated from protobuf field: int32 choice = 2; - */ - choice: number; -} -/** - * @generated from protobuf message youtube.InnertubePayload.License - */ -export interface InnertubePayload_License { - /** - * @generated from protobuf field: string type = 1; - */ - type: string; -} -/** - * @generated from protobuf message youtube.InnertubePayload.VideoThumbnail - */ -export interface InnertubePayload_VideoThumbnail { - /** - * @generated from protobuf field: int32 type = 1; - */ - type: number; // is this something else? - /** - * @generated from protobuf field: youtube.InnertubePayload.VideoThumbnail.Thumbnail thumbnail = 3; - */ - thumbnail?: InnertubePayload_VideoThumbnail_Thumbnail; -} -/** - * @generated from protobuf message youtube.InnertubePayload.VideoThumbnail.Thumbnail - */ -export interface InnertubePayload_VideoThumbnail_Thumbnail { - /** - * @generated from protobuf field: bytes image_data = 1; - */ - imageData: Uint8Array; -} -/** - * @generated from protobuf message youtube.ChannelAnalytics - */ -export interface ChannelAnalytics { - /** - * @generated from protobuf field: youtube.ChannelAnalytics.Params params = 32; - */ - params?: ChannelAnalytics_Params; -} -/** - * @generated from protobuf message youtube.ChannelAnalytics.Params - */ -export interface ChannelAnalytics_Params { - /** - * @generated from protobuf field: string channel_id = 1001; - */ - channelId: string; -} -/** - * @generated from protobuf message youtube.SoundInfoParams - */ -export interface SoundInfoParams { - /** - * @generated from protobuf field: youtube.SoundInfoParams.Sound sound = 94; - */ - sound?: SoundInfoParams_Sound; -} -/** - * @generated from protobuf message youtube.SoundInfoParams.Sound - */ -export interface SoundInfoParams_Sound { - /** - * @generated from protobuf field: youtube.SoundInfoParams.Sound.Params params = 1; - */ - params?: SoundInfoParams_Sound_Params; -} -/** - * @generated from protobuf message youtube.SoundInfoParams.Sound.Params - */ -export interface SoundInfoParams_Sound_Params { - /** - * @generated from protobuf field: youtube.SoundInfoParams.Sound.Params.Ids ids = 2; - */ - ids?: SoundInfoParams_Sound_Params_Ids; -} -/** - * @generated from protobuf message youtube.SoundInfoParams.Sound.Params.Ids - */ -export interface SoundInfoParams_Sound_Params_Ids { - /** - * @generated from protobuf field: string id_1 = 1; - */ - id1: string; - /** - * @generated from protobuf field: string id_2 = 2; - */ - id2: string; - /** - * @generated from protobuf field: string id_3 = 3; - */ - id3: string; -} -/** - * @generated from protobuf message youtube.NotificationPreferences - */ -export interface NotificationPreferences { - /** - * @generated from protobuf field: string channel_id = 1; - */ - channelId: string; - /** - * @generated from protobuf field: youtube.NotificationPreferences.Preference pref_id = 2; - */ - prefId?: NotificationPreferences_Preference; - /** - * @generated from protobuf field: optional int32 number_0 = 3; - */ - number0?: number; - /** - * @generated from protobuf field: optional int32 number_1 = 4; - */ - number1?: number; -} -/** - * @generated from protobuf message youtube.NotificationPreferences.Preference - */ -export interface NotificationPreferences_Preference { - /** - * @generated from protobuf field: int32 index = 1; - */ - index: number; -} -/** - * @generated from protobuf message youtube.LiveMessageParams - */ -export interface LiveMessageParams { - /** - * @generated from protobuf field: youtube.LiveMessageParams.Params params = 1; - */ - params?: LiveMessageParams_Params; - /** - * @generated from protobuf field: optional int32 number_0 = 2; - */ - number0?: number; - /** - * @generated from protobuf field: optional int32 number_1 = 3; - */ - number1?: number; -} -/** - * @generated from protobuf message youtube.LiveMessageParams.Params - */ -export interface LiveMessageParams_Params { - /** - * @generated from protobuf field: youtube.LiveMessageParams.Params.Ids ids = 5; - */ - ids?: LiveMessageParams_Params_Ids; -} -/** - * @generated from protobuf message youtube.LiveMessageParams.Params.Ids - */ -export interface LiveMessageParams_Params_Ids { - /** - * @generated from protobuf field: string channel_id = 1; - */ - channelId: string; - /** - * @generated from protobuf field: string video_id = 2; - */ - videoId: string; -} -/** - * @generated from protobuf message youtube.GetCommentsSectionParams - */ -export interface GetCommentsSectionParams { - /** - * @generated from protobuf field: youtube.GetCommentsSectionParams.Context ctx = 2; - */ - ctx?: GetCommentsSectionParams_Context; - /** - * @generated from protobuf field: int32 unk_param = 3; - */ - unkParam: number; - /** - * @generated from protobuf field: youtube.GetCommentsSectionParams.Params params = 6; - */ - params?: GetCommentsSectionParams_Params; -} -/** - * @generated from protobuf message youtube.GetCommentsSectionParams.Context - */ -export interface GetCommentsSectionParams_Context { - /** - * @generated from protobuf field: string video_id = 2; - */ - videoId: string; -} -/** - * @generated from protobuf message youtube.GetCommentsSectionParams.Params - */ -export interface GetCommentsSectionParams_Params { - /** - * @generated from protobuf field: optional string unk_token = 1; - */ - unkToken?: string; - /** - * @generated from protobuf field: optional youtube.GetCommentsSectionParams.Params.Options opts = 4; - */ - opts?: GetCommentsSectionParams_Params_Options; - /** - * @generated from protobuf field: optional youtube.GetCommentsSectionParams.Params.RepliesOptions replies_opts = 3; - */ - repliesOpts?: GetCommentsSectionParams_Params_RepliesOptions; - /** - * @generated from protobuf field: optional int32 page = 5; - */ - page?: number; - /** - * @generated from protobuf field: string target = 8; - */ - target: string; -} -/** - * @generated from protobuf message youtube.GetCommentsSectionParams.Params.Options - */ -export interface GetCommentsSectionParams_Params_Options { - /** - * @generated from protobuf field: string video_id = 4; - */ - videoId: string; - /** - * @generated from protobuf field: int32 sort_by = 6; - */ - sortBy: number; - /** - * @generated from protobuf field: int32 type = 15; - */ - type: number; -} -/** - * @generated from protobuf message youtube.GetCommentsSectionParams.Params.RepliesOptions - */ -export interface GetCommentsSectionParams_Params_RepliesOptions { - /** - * @generated from protobuf field: string comment_id = 2; - */ - commentId: string; - /** - * @generated from protobuf field: youtube.GetCommentsSectionParams.Params.RepliesOptions.UnkOpts unkopts = 4; - */ - unkopts?: GetCommentsSectionParams_Params_RepliesOptions_UnkOpts; - /** - * @generated from protobuf field: optional string channel_id = 5; - */ - channelId?: string; - /** - * @generated from protobuf field: string video_id = 6; - */ - videoId: string; - /** - * @generated from protobuf field: int32 unk_param_1 = 8; - */ - unkParam1: number; - /** - * @generated from protobuf field: int32 unk_param_2 = 9; - */ - unkParam2: number; -} -/** - * @generated from protobuf message youtube.GetCommentsSectionParams.Params.RepliesOptions.UnkOpts - */ -export interface GetCommentsSectionParams_Params_RepliesOptions_UnkOpts { - /** - * @generated from protobuf field: int32 unk_param = 1; - */ - unkParam: number; -} -/** - * @generated from protobuf message youtube.CreateCommentParams - */ -export interface CreateCommentParams { - /** - * @generated from protobuf field: string video_id = 2; - */ - videoId: string; - /** - * @generated from protobuf field: youtube.CreateCommentParams.Params params = 5; - */ - params?: CreateCommentParams_Params; - /** - * @generated from protobuf field: int32 number = 10; - */ - number: number; -} -/** - * @generated from protobuf message youtube.CreateCommentParams.Params - */ -export interface CreateCommentParams_Params { - /** - * @generated from protobuf field: int32 index = 1; - */ - index: number; -} -/** - * @generated from protobuf message youtube.PeformCommentActionParams - */ -export interface PeformCommentActionParams { - /** - * @generated from protobuf field: int32 type = 1; - */ - type: number; - /** - * @generated from protobuf field: string comment_id = 3; - */ - commentId: string; - /** - * @generated from protobuf field: string video_id = 5; - */ - videoId: string; - /** - * @generated from protobuf field: optional int32 unk_num = 2; - */ - unkNum?: number; - /** - * @generated from protobuf field: optional string channel_id = 23; - */ - channelId?: string; - /** - * @generated from protobuf field: optional youtube.PeformCommentActionParams.TranslateCommentParams translate_comment_params = 31; - */ - translateCommentParams?: PeformCommentActionParams_TranslateCommentParams; -} -/** - * @generated from protobuf message youtube.PeformCommentActionParams.TranslateCommentParams - */ -export interface PeformCommentActionParams_TranslateCommentParams { - /** - * @generated from protobuf field: youtube.PeformCommentActionParams.TranslateCommentParams.Params params = 3; - */ - params?: PeformCommentActionParams_TranslateCommentParams_Params; - /** - * @generated from protobuf field: string comment_id = 2; - */ - commentId: string; - /** - * @generated from protobuf field: string target_language = 4; - */ - targetLanguage: string; -} -/** - * @generated from protobuf message youtube.PeformCommentActionParams.TranslateCommentParams.Params - */ -export interface PeformCommentActionParams_TranslateCommentParams_Params { - /** - * @generated from protobuf field: youtube.PeformCommentActionParams.TranslateCommentParams.Params.Comment comment = 1; - */ - comment?: PeformCommentActionParams_TranslateCommentParams_Params_Comment; -} -/** - * @generated from protobuf message youtube.PeformCommentActionParams.TranslateCommentParams.Params.Comment - */ -export interface PeformCommentActionParams_TranslateCommentParams_Params_Comment { - /** - * @generated from protobuf field: string text = 1; - */ - text: string; -} -/** - * @generated from protobuf message youtube.MusicSearchFilter - */ -export interface MusicSearchFilter { - /** - * @generated from protobuf field: optional youtube.MusicSearchFilter.Filters filters = 2; - */ - filters?: MusicSearchFilter_Filters; -} -/** - * @generated from protobuf message youtube.MusicSearchFilter.Filters - */ -export interface MusicSearchFilter_Filters { - /** - * @generated from protobuf field: optional youtube.MusicSearchFilter.Filters.Type type = 17; - */ - type?: MusicSearchFilter_Filters_Type; -} -/** - * @generated from protobuf message youtube.MusicSearchFilter.Filters.Type - */ -export interface MusicSearchFilter_Filters_Type { - /** - * TODO: protoc doesn't allow zero index: optional int32 all = 0; - * - * @generated from protobuf field: optional int32 song = 1; - */ - song?: number; - /** - * @generated from protobuf field: optional int32 video = 2; - */ - video?: number; - /** - * @generated from protobuf field: optional int32 album = 3; - */ - album?: number; - /** - * @generated from protobuf field: optional int32 artist = 4; - */ - artist?: number; - /** - * @generated from protobuf field: optional int32 playlist = 5; - */ - playlist?: number; -} -/** - * @generated from protobuf message youtube.SearchFilter - */ -export interface SearchFilter { - /** - * @generated from protobuf field: optional int32 sort_by = 1; - */ - sortBy?: number; - /** - * @generated from protobuf field: optional int32 no_filter = 19; - */ - noFilter?: number; - /** - * @generated from protobuf field: optional youtube.SearchFilter.Filters filters = 2; - */ - filters?: SearchFilter_Filters; -} -/** - * @generated from protobuf message youtube.SearchFilter.Filters - */ -export interface SearchFilter_Filters { - /** - * @generated from protobuf field: optional int32 upload_date = 1; - */ - uploadDate?: number; - /** - * @generated from protobuf field: optional int32 type = 2; - */ - type?: number; - /** - * @generated from protobuf field: optional int32 duration = 3; - */ - duration?: number; - /** - * @generated from protobuf field: optional int32 features_hd = 4; - */ - featuresHd?: number; - /** - * @generated from protobuf field: optional int32 features_subtitles = 5; - */ - featuresSubtitles?: number; - /** - * @generated from protobuf field: optional int32 features_creative_commons = 6; - */ - featuresCreativeCommons?: number; - /** - * @generated from protobuf field: optional int32 features_3d = 7 [json_name = "features3d"]; - */ - features3D?: number; - /** - * @generated from protobuf field: optional int32 features_live = 8; - */ - featuresLive?: number; - /** - * @generated from protobuf field: optional int32 features_purchased = 9; - */ - featuresPurchased?: number; - /** - * @generated from protobuf field: optional int32 features_4k = 14 [json_name = "features4k"]; - */ - features4K?: number; - /** - * @generated from protobuf field: optional int32 features_360 = 15; - */ - features360?: number; - /** - * @generated from protobuf field: optional int32 features_location = 23; - */ - featuresLocation?: number; - /** - * @generated from protobuf field: optional int32 features_hdr = 25; - */ - featuresHdr?: number; - /** - * @generated from protobuf field: optional int32 features_vr180 = 26; - */ - featuresVr180?: number; -} -// @generated message type with reflection information, may provide speed optimized methods -class VisitorData$Type extends MessageType { - constructor() { - super("youtube.VisitorData", [ - { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 5, name: "timestamp", kind: "scalar", T: 5 /*ScalarType.INT32*/ } - ]); - } - create(value?: PartialMessage): VisitorData { - const message = { id: "", timestamp: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: VisitorData): VisitorData { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string id */ 1: - message.id = reader.string(); - break; - case /* int32 timestamp */ 5: - message.timestamp = reader.int32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: VisitorData, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string id = 1; */ - if (message.id !== "") - writer.tag(1, WireType.LengthDelimited).string(message.id); - /* int32 timestamp = 5; */ - if (message.timestamp !== 0) - writer.tag(5, WireType.Varint).int32(message.timestamp); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.VisitorData - */ -export const VisitorData = new VisitorData$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class InnertubePayload$Type extends MessageType { - constructor() { - super("youtube.InnertubePayload", [ - { no: 1, name: "context", kind: "message", T: () => InnertubePayload_Context }, - { no: 2, name: "target", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "title", kind: "message", T: () => InnertubePayload_Title }, - { no: 4, name: "description", kind: "message", T: () => InnertubePayload_Description }, - { no: 6, name: "tags", kind: "message", T: () => InnertubePayload_Tags }, - { no: 38, name: "privacy", kind: "message", T: () => InnertubePayload_Privacy }, - { no: 7, name: "category", kind: "message", T: () => InnertubePayload_Category }, - { no: 68, name: "made_for_kids", kind: "message", T: () => InnertubePayload_MadeForKids }, - { no: 69, name: "age_restricted", kind: "message", T: () => InnertubePayload_AgeRestricted }, - { no: 8, name: "license", kind: "message", T: () => InnertubePayload_License }, - { no: 20, name: "video_thumbnail", kind: "message", T: () => InnertubePayload_VideoThumbnail } - ]); - } - create(value?: PartialMessage): InnertubePayload { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: InnertubePayload): InnertubePayload { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* youtube.InnertubePayload.Context context */ 1: - message.context = InnertubePayload_Context.internalBinaryRead(reader, reader.uint32(), options, message.context); - break; - case /* optional string target */ 2: - message.target = reader.string(); - break; - case /* optional youtube.InnertubePayload.Title title */ 3: - message.title = InnertubePayload_Title.internalBinaryRead(reader, reader.uint32(), options, message.title); - break; - case /* optional youtube.InnertubePayload.Description description */ 4: - message.description = InnertubePayload_Description.internalBinaryRead(reader, reader.uint32(), options, message.description); - break; - case /* optional youtube.InnertubePayload.Tags tags */ 6: - message.tags = InnertubePayload_Tags.internalBinaryRead(reader, reader.uint32(), options, message.tags); - break; - case /* optional youtube.InnertubePayload.Privacy privacy */ 38: - message.privacy = InnertubePayload_Privacy.internalBinaryRead(reader, reader.uint32(), options, message.privacy); - break; - case /* optional youtube.InnertubePayload.Category category */ 7: - message.category = InnertubePayload_Category.internalBinaryRead(reader, reader.uint32(), options, message.category); - break; - case /* optional youtube.InnertubePayload.MadeForKids made_for_kids */ 68: - message.madeForKids = InnertubePayload_MadeForKids.internalBinaryRead(reader, reader.uint32(), options, message.madeForKids); - break; - case /* optional youtube.InnertubePayload.AgeRestricted age_restricted */ 69: - message.ageRestricted = InnertubePayload_AgeRestricted.internalBinaryRead(reader, reader.uint32(), options, message.ageRestricted); - break; - case /* optional youtube.InnertubePayload.License license */ 8: - message.license = InnertubePayload_License.internalBinaryRead(reader, reader.uint32(), options, message.license); - break; - case /* optional youtube.InnertubePayload.VideoThumbnail video_thumbnail */ 20: - message.videoThumbnail = InnertubePayload_VideoThumbnail.internalBinaryRead(reader, reader.uint32(), options, message.videoThumbnail); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: InnertubePayload, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* youtube.InnertubePayload.Context context = 1; */ - if (message.context) - InnertubePayload_Context.internalBinaryWrite(message.context, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* optional string target = 2; */ - if (message.target !== undefined) - writer.tag(2, WireType.LengthDelimited).string(message.target); - /* optional youtube.InnertubePayload.Title title = 3; */ - if (message.title) - InnertubePayload_Title.internalBinaryWrite(message.title, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); - /* optional youtube.InnertubePayload.Description description = 4; */ - if (message.description) - InnertubePayload_Description.internalBinaryWrite(message.description, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); - /* optional youtube.InnertubePayload.Tags tags = 6; */ - if (message.tags) - InnertubePayload_Tags.internalBinaryWrite(message.tags, writer.tag(6, WireType.LengthDelimited).fork(), options).join(); - /* optional youtube.InnertubePayload.Privacy privacy = 38; */ - if (message.privacy) - InnertubePayload_Privacy.internalBinaryWrite(message.privacy, writer.tag(38, WireType.LengthDelimited).fork(), options).join(); - /* optional youtube.InnertubePayload.Category category = 7; */ - if (message.category) - InnertubePayload_Category.internalBinaryWrite(message.category, writer.tag(7, WireType.LengthDelimited).fork(), options).join(); - /* optional youtube.InnertubePayload.MadeForKids made_for_kids = 68; */ - if (message.madeForKids) - InnertubePayload_MadeForKids.internalBinaryWrite(message.madeForKids, writer.tag(68, WireType.LengthDelimited).fork(), options).join(); - /* optional youtube.InnertubePayload.AgeRestricted age_restricted = 69; */ - if (message.ageRestricted) - InnertubePayload_AgeRestricted.internalBinaryWrite(message.ageRestricted, writer.tag(69, WireType.LengthDelimited).fork(), options).join(); - /* optional youtube.InnertubePayload.License license = 8; */ - if (message.license) - InnertubePayload_License.internalBinaryWrite(message.license, writer.tag(8, WireType.LengthDelimited).fork(), options).join(); - /* optional youtube.InnertubePayload.VideoThumbnail video_thumbnail = 20; */ - if (message.videoThumbnail) - InnertubePayload_VideoThumbnail.internalBinaryWrite(message.videoThumbnail, writer.tag(20, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.InnertubePayload - */ -export const InnertubePayload = new InnertubePayload$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class InnertubePayload_Context$Type extends MessageType { - constructor() { - super("youtube.InnertubePayload.Context", [ - { no: 1, name: "client", kind: "message", T: () => InnertubePayload_Context_Client } - ]); - } - create(value?: PartialMessage): InnertubePayload_Context { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: InnertubePayload_Context): InnertubePayload_Context { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* youtube.InnertubePayload.Context.Client client */ 1: - message.client = InnertubePayload_Context_Client.internalBinaryRead(reader, reader.uint32(), options, message.client); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: InnertubePayload_Context, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* youtube.InnertubePayload.Context.Client client = 1; */ - if (message.client) - InnertubePayload_Context_Client.internalBinaryWrite(message.client, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.InnertubePayload.Context - */ -export const InnertubePayload_Context = new InnertubePayload_Context$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class InnertubePayload_Context_Client$Type extends MessageType { - constructor() { - super("youtube.InnertubePayload.Context.Client", [ - { no: 16, name: "unkparam", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 17, name: "client_version", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 18, name: "client_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): InnertubePayload_Context_Client { - const message = { unkparam: 0, clientVersion: "", clientName: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: InnertubePayload_Context_Client): InnertubePayload_Context_Client { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int32 unkparam */ 16: - message.unkparam = reader.int32(); - break; - case /* string client_version */ 17: - message.clientVersion = reader.string(); - break; - case /* string client_name */ 18: - message.clientName = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: InnertubePayload_Context_Client, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* int32 unkparam = 16; */ - if (message.unkparam !== 0) - writer.tag(16, WireType.Varint).int32(message.unkparam); - /* string client_version = 17; */ - if (message.clientVersion !== "") - writer.tag(17, WireType.LengthDelimited).string(message.clientVersion); - /* string client_name = 18; */ - if (message.clientName !== "") - writer.tag(18, WireType.LengthDelimited).string(message.clientName); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.InnertubePayload.Context.Client - */ -export const InnertubePayload_Context_Client = new InnertubePayload_Context_Client$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class InnertubePayload_Title$Type extends MessageType { - constructor() { - super("youtube.InnertubePayload.Title", [ - { no: 1, name: "text", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): InnertubePayload_Title { - const message = { text: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: InnertubePayload_Title): InnertubePayload_Title { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string text */ 1: - message.text = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: InnertubePayload_Title, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string text = 1; */ - if (message.text !== "") - writer.tag(1, WireType.LengthDelimited).string(message.text); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.InnertubePayload.Title - */ -export const InnertubePayload_Title = new InnertubePayload_Title$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class InnertubePayload_Description$Type extends MessageType { - constructor() { - super("youtube.InnertubePayload.Description", [ - { no: 1, name: "text", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): InnertubePayload_Description { - const message = { text: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: InnertubePayload_Description): InnertubePayload_Description { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string text */ 1: - message.text = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: InnertubePayload_Description, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string text = 1; */ - if (message.text !== "") - writer.tag(1, WireType.LengthDelimited).string(message.text); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.InnertubePayload.Description - */ -export const InnertubePayload_Description = new InnertubePayload_Description$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class InnertubePayload_Tags$Type extends MessageType { - constructor() { - super("youtube.InnertubePayload.Tags", [ - { no: 1, name: "list", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): InnertubePayload_Tags { - const message = { list: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: InnertubePayload_Tags): InnertubePayload_Tags { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated string list */ 1: - message.list.push(reader.string()); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: InnertubePayload_Tags, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* repeated string list = 1; */ - for (let i = 0; i < message.list.length; i++) - writer.tag(1, WireType.LengthDelimited).string(message.list[i]); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.InnertubePayload.Tags - */ -export const InnertubePayload_Tags = new InnertubePayload_Tags$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class InnertubePayload_Privacy$Type extends MessageType { - constructor() { - super("youtube.InnertubePayload.Privacy", [ - { no: 1, name: "type", kind: "scalar", T: 5 /*ScalarType.INT32*/ } - ]); - } - create(value?: PartialMessage): InnertubePayload_Privacy { - const message = { type: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: InnertubePayload_Privacy): InnertubePayload_Privacy { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int32 type */ 1: - message.type = reader.int32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: InnertubePayload_Privacy, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* int32 type = 1; */ - if (message.type !== 0) - writer.tag(1, WireType.Varint).int32(message.type); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.InnertubePayload.Privacy - */ -export const InnertubePayload_Privacy = new InnertubePayload_Privacy$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class InnertubePayload_Category$Type extends MessageType { - constructor() { - super("youtube.InnertubePayload.Category", [ - { no: 1, name: "id", kind: "scalar", T: 5 /*ScalarType.INT32*/ } - ]); - } - create(value?: PartialMessage): InnertubePayload_Category { - const message = { id: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: InnertubePayload_Category): InnertubePayload_Category { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int32 id */ 1: - message.id = reader.int32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: InnertubePayload_Category, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* int32 id = 1; */ - if (message.id !== 0) - writer.tag(1, WireType.Varint).int32(message.id); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.InnertubePayload.Category - */ -export const InnertubePayload_Category = new InnertubePayload_Category$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class InnertubePayload_MadeForKids$Type extends MessageType { - constructor() { - super("youtube.InnertubePayload.MadeForKids", [ - { no: 1, name: "unkparam", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 2, name: "choice", kind: "scalar", T: 5 /*ScalarType.INT32*/ } - ]); - } - create(value?: PartialMessage): InnertubePayload_MadeForKids { - const message = { unkparam: 0, choice: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: InnertubePayload_MadeForKids): InnertubePayload_MadeForKids { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int32 unkparam */ 1: - message.unkparam = reader.int32(); - break; - case /* int32 choice */ 2: - message.choice = reader.int32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: InnertubePayload_MadeForKids, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* int32 unkparam = 1; */ - if (message.unkparam !== 0) - writer.tag(1, WireType.Varint).int32(message.unkparam); - /* int32 choice = 2; */ - if (message.choice !== 0) - writer.tag(2, WireType.Varint).int32(message.choice); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.InnertubePayload.MadeForKids - */ -export const InnertubePayload_MadeForKids = new InnertubePayload_MadeForKids$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class InnertubePayload_AgeRestricted$Type extends MessageType { - constructor() { - super("youtube.InnertubePayload.AgeRestricted", [ - { no: 1, name: "unkparam", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 2, name: "choice", kind: "scalar", T: 5 /*ScalarType.INT32*/ } - ]); - } - create(value?: PartialMessage): InnertubePayload_AgeRestricted { - const message = { unkparam: 0, choice: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: InnertubePayload_AgeRestricted): InnertubePayload_AgeRestricted { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int32 unkparam */ 1: - message.unkparam = reader.int32(); - break; - case /* int32 choice */ 2: - message.choice = reader.int32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: InnertubePayload_AgeRestricted, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* int32 unkparam = 1; */ - if (message.unkparam !== 0) - writer.tag(1, WireType.Varint).int32(message.unkparam); - /* int32 choice = 2; */ - if (message.choice !== 0) - writer.tag(2, WireType.Varint).int32(message.choice); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.InnertubePayload.AgeRestricted - */ -export const InnertubePayload_AgeRestricted = new InnertubePayload_AgeRestricted$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class InnertubePayload_License$Type extends MessageType { - constructor() { - super("youtube.InnertubePayload.License", [ - { no: 1, name: "type", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): InnertubePayload_License { - const message = { type: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: InnertubePayload_License): InnertubePayload_License { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string type */ 1: - message.type = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: InnertubePayload_License, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string type = 1; */ - if (message.type !== "") - writer.tag(1, WireType.LengthDelimited).string(message.type); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.InnertubePayload.License - */ -export const InnertubePayload_License = new InnertubePayload_License$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class InnertubePayload_VideoThumbnail$Type extends MessageType { - constructor() { - super("youtube.InnertubePayload.VideoThumbnail", [ - { no: 1, name: "type", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 3, name: "thumbnail", kind: "message", T: () => InnertubePayload_VideoThumbnail_Thumbnail } - ]); - } - create(value?: PartialMessage): InnertubePayload_VideoThumbnail { - const message = { type: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: InnertubePayload_VideoThumbnail): InnertubePayload_VideoThumbnail { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int32 type */ 1: - message.type = reader.int32(); - break; - case /* youtube.InnertubePayload.VideoThumbnail.Thumbnail thumbnail */ 3: - message.thumbnail = InnertubePayload_VideoThumbnail_Thumbnail.internalBinaryRead(reader, reader.uint32(), options, message.thumbnail); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: InnertubePayload_VideoThumbnail, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* int32 type = 1; */ - if (message.type !== 0) - writer.tag(1, WireType.Varint).int32(message.type); - /* youtube.InnertubePayload.VideoThumbnail.Thumbnail thumbnail = 3; */ - if (message.thumbnail) - InnertubePayload_VideoThumbnail_Thumbnail.internalBinaryWrite(message.thumbnail, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.InnertubePayload.VideoThumbnail - */ -export const InnertubePayload_VideoThumbnail = new InnertubePayload_VideoThumbnail$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class InnertubePayload_VideoThumbnail_Thumbnail$Type extends MessageType { - constructor() { - super("youtube.InnertubePayload.VideoThumbnail.Thumbnail", [ - { no: 1, name: "image_data", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value?: PartialMessage): InnertubePayload_VideoThumbnail_Thumbnail { - const message = { imageData: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: InnertubePayload_VideoThumbnail_Thumbnail): InnertubePayload_VideoThumbnail_Thumbnail { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes image_data */ 1: - message.imageData = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: InnertubePayload_VideoThumbnail_Thumbnail, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes image_data = 1; */ - if (message.imageData.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.imageData); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.InnertubePayload.VideoThumbnail.Thumbnail - */ -export const InnertubePayload_VideoThumbnail_Thumbnail = new InnertubePayload_VideoThumbnail_Thumbnail$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelAnalytics$Type extends MessageType { - constructor() { - super("youtube.ChannelAnalytics", [ - { no: 32, name: "params", kind: "message", T: () => ChannelAnalytics_Params } - ]); - } - create(value?: PartialMessage): ChannelAnalytics { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelAnalytics): ChannelAnalytics { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* youtube.ChannelAnalytics.Params params */ 32: - message.params = ChannelAnalytics_Params.internalBinaryRead(reader, reader.uint32(), options, message.params); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ChannelAnalytics, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* youtube.ChannelAnalytics.Params params = 32; */ - if (message.params) - ChannelAnalytics_Params.internalBinaryWrite(message.params, writer.tag(32, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.ChannelAnalytics - */ -export const ChannelAnalytics = new ChannelAnalytics$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelAnalytics_Params$Type extends MessageType { - constructor() { - super("youtube.ChannelAnalytics.Params", [ - { no: 1001, name: "channel_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): ChannelAnalytics_Params { - const message = { channelId: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelAnalytics_Params): ChannelAnalytics_Params { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string channel_id */ 1001: - message.channelId = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ChannelAnalytics_Params, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string channel_id = 1001; */ - if (message.channelId !== "") - writer.tag(1001, WireType.LengthDelimited).string(message.channelId); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.ChannelAnalytics.Params - */ -export const ChannelAnalytics_Params = new ChannelAnalytics_Params$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SoundInfoParams$Type extends MessageType { - constructor() { - super("youtube.SoundInfoParams", [ - { no: 94, name: "sound", kind: "message", T: () => SoundInfoParams_Sound } - ]); - } - create(value?: PartialMessage): SoundInfoParams { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SoundInfoParams): SoundInfoParams { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* youtube.SoundInfoParams.Sound sound */ 94: - message.sound = SoundInfoParams_Sound.internalBinaryRead(reader, reader.uint32(), options, message.sound); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: SoundInfoParams, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* youtube.SoundInfoParams.Sound sound = 94; */ - if (message.sound) - SoundInfoParams_Sound.internalBinaryWrite(message.sound, writer.tag(94, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.SoundInfoParams - */ -export const SoundInfoParams = new SoundInfoParams$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SoundInfoParams_Sound$Type extends MessageType { - constructor() { - super("youtube.SoundInfoParams.Sound", [ - { no: 1, name: "params", kind: "message", T: () => SoundInfoParams_Sound_Params } - ]); - } - create(value?: PartialMessage): SoundInfoParams_Sound { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SoundInfoParams_Sound): SoundInfoParams_Sound { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* youtube.SoundInfoParams.Sound.Params params */ 1: - message.params = SoundInfoParams_Sound_Params.internalBinaryRead(reader, reader.uint32(), options, message.params); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: SoundInfoParams_Sound, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* youtube.SoundInfoParams.Sound.Params params = 1; */ - if (message.params) - SoundInfoParams_Sound_Params.internalBinaryWrite(message.params, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.SoundInfoParams.Sound - */ -export const SoundInfoParams_Sound = new SoundInfoParams_Sound$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SoundInfoParams_Sound_Params$Type extends MessageType { - constructor() { - super("youtube.SoundInfoParams.Sound.Params", [ - { no: 2, name: "ids", kind: "message", T: () => SoundInfoParams_Sound_Params_Ids } - ]); - } - create(value?: PartialMessage): SoundInfoParams_Sound_Params { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SoundInfoParams_Sound_Params): SoundInfoParams_Sound_Params { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* youtube.SoundInfoParams.Sound.Params.Ids ids */ 2: - message.ids = SoundInfoParams_Sound_Params_Ids.internalBinaryRead(reader, reader.uint32(), options, message.ids); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: SoundInfoParams_Sound_Params, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* youtube.SoundInfoParams.Sound.Params.Ids ids = 2; */ - if (message.ids) - SoundInfoParams_Sound_Params_Ids.internalBinaryWrite(message.ids, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.SoundInfoParams.Sound.Params - */ -export const SoundInfoParams_Sound_Params = new SoundInfoParams_Sound_Params$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SoundInfoParams_Sound_Params_Ids$Type extends MessageType { - constructor() { - super("youtube.SoundInfoParams.Sound.Params.Ids", [ - { no: 1, name: "id_1", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "id_2", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "id_3", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): SoundInfoParams_Sound_Params_Ids { - const message = { id1: "", id2: "", id3: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SoundInfoParams_Sound_Params_Ids): SoundInfoParams_Sound_Params_Ids { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string id_1 */ 1: - message.id1 = reader.string(); - break; - case /* string id_2 */ 2: - message.id2 = reader.string(); - break; - case /* string id_3 */ 3: - message.id3 = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: SoundInfoParams_Sound_Params_Ids, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string id_1 = 1; */ - if (message.id1 !== "") - writer.tag(1, WireType.LengthDelimited).string(message.id1); - /* string id_2 = 2; */ - if (message.id2 !== "") - writer.tag(2, WireType.LengthDelimited).string(message.id2); - /* string id_3 = 3; */ - if (message.id3 !== "") - writer.tag(3, WireType.LengthDelimited).string(message.id3); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.SoundInfoParams.Sound.Params.Ids - */ -export const SoundInfoParams_Sound_Params_Ids = new SoundInfoParams_Sound_Params_Ids$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class NotificationPreferences$Type extends MessageType { - constructor() { - super("youtube.NotificationPreferences", [ - { no: 1, name: "channel_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "pref_id", kind: "message", T: () => NotificationPreferences_Preference }, - { no: 3, name: "number_0", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, - { no: 4, name: "number_1", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ } - ]); - } - create(value?: PartialMessage): NotificationPreferences { - const message = { channelId: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NotificationPreferences): NotificationPreferences { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string channel_id */ 1: - message.channelId = reader.string(); - break; - case /* youtube.NotificationPreferences.Preference pref_id */ 2: - message.prefId = NotificationPreferences_Preference.internalBinaryRead(reader, reader.uint32(), options, message.prefId); - break; - case /* optional int32 number_0 */ 3: - message.number0 = reader.int32(); - break; - case /* optional int32 number_1 */ 4: - message.number1 = reader.int32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: NotificationPreferences, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string channel_id = 1; */ - if (message.channelId !== "") - writer.tag(1, WireType.LengthDelimited).string(message.channelId); - /* youtube.NotificationPreferences.Preference pref_id = 2; */ - if (message.prefId) - NotificationPreferences_Preference.internalBinaryWrite(message.prefId, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); - /* optional int32 number_0 = 3; */ - if (message.number0 !== undefined) - writer.tag(3, WireType.Varint).int32(message.number0); - /* optional int32 number_1 = 4; */ - if (message.number1 !== undefined) - writer.tag(4, WireType.Varint).int32(message.number1); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.NotificationPreferences - */ -export const NotificationPreferences = new NotificationPreferences$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class NotificationPreferences_Preference$Type extends MessageType { - constructor() { - super("youtube.NotificationPreferences.Preference", [ - { no: 1, name: "index", kind: "scalar", T: 5 /*ScalarType.INT32*/ } - ]); - } - create(value?: PartialMessage): NotificationPreferences_Preference { - const message = { index: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NotificationPreferences_Preference): NotificationPreferences_Preference { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int32 index */ 1: - message.index = reader.int32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: NotificationPreferences_Preference, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* int32 index = 1; */ - if (message.index !== 0) - writer.tag(1, WireType.Varint).int32(message.index); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.NotificationPreferences.Preference - */ -export const NotificationPreferences_Preference = new NotificationPreferences_Preference$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class LiveMessageParams$Type extends MessageType { - constructor() { - super("youtube.LiveMessageParams", [ - { no: 1, name: "params", kind: "message", T: () => LiveMessageParams_Params }, - { no: 2, name: "number_0", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, - { no: 3, name: "number_1", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ } - ]); - } - create(value?: PartialMessage): LiveMessageParams { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: LiveMessageParams): LiveMessageParams { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* youtube.LiveMessageParams.Params params */ 1: - message.params = LiveMessageParams_Params.internalBinaryRead(reader, reader.uint32(), options, message.params); - break; - case /* optional int32 number_0 */ 2: - message.number0 = reader.int32(); - break; - case /* optional int32 number_1 */ 3: - message.number1 = reader.int32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: LiveMessageParams, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* youtube.LiveMessageParams.Params params = 1; */ - if (message.params) - LiveMessageParams_Params.internalBinaryWrite(message.params, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* optional int32 number_0 = 2; */ - if (message.number0 !== undefined) - writer.tag(2, WireType.Varint).int32(message.number0); - /* optional int32 number_1 = 3; */ - if (message.number1 !== undefined) - writer.tag(3, WireType.Varint).int32(message.number1); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.LiveMessageParams - */ -export const LiveMessageParams = new LiveMessageParams$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class LiveMessageParams_Params$Type extends MessageType { - constructor() { - super("youtube.LiveMessageParams.Params", [ - { no: 5, name: "ids", kind: "message", T: () => LiveMessageParams_Params_Ids } - ]); - } - create(value?: PartialMessage): LiveMessageParams_Params { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: LiveMessageParams_Params): LiveMessageParams_Params { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* youtube.LiveMessageParams.Params.Ids ids */ 5: - message.ids = LiveMessageParams_Params_Ids.internalBinaryRead(reader, reader.uint32(), options, message.ids); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: LiveMessageParams_Params, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* youtube.LiveMessageParams.Params.Ids ids = 5; */ - if (message.ids) - LiveMessageParams_Params_Ids.internalBinaryWrite(message.ids, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.LiveMessageParams.Params - */ -export const LiveMessageParams_Params = new LiveMessageParams_Params$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class LiveMessageParams_Params_Ids$Type extends MessageType { - constructor() { - super("youtube.LiveMessageParams.Params.Ids", [ - { no: 1, name: "channel_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "video_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): LiveMessageParams_Params_Ids { - const message = { channelId: "", videoId: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: LiveMessageParams_Params_Ids): LiveMessageParams_Params_Ids { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string channel_id */ 1: - message.channelId = reader.string(); - break; - case /* string video_id */ 2: - message.videoId = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: LiveMessageParams_Params_Ids, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string channel_id = 1; */ - if (message.channelId !== "") - writer.tag(1, WireType.LengthDelimited).string(message.channelId); - /* string video_id = 2; */ - if (message.videoId !== "") - writer.tag(2, WireType.LengthDelimited).string(message.videoId); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.LiveMessageParams.Params.Ids - */ -export const LiveMessageParams_Params_Ids = new LiveMessageParams_Params_Ids$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class GetCommentsSectionParams$Type extends MessageType { - constructor() { - super("youtube.GetCommentsSectionParams", [ - { no: 2, name: "ctx", kind: "message", T: () => GetCommentsSectionParams_Context }, - { no: 3, name: "unk_param", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 6, name: "params", kind: "message", T: () => GetCommentsSectionParams_Params } - ]); - } - create(value?: PartialMessage): GetCommentsSectionParams { - const message = { unkParam: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetCommentsSectionParams): GetCommentsSectionParams { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* youtube.GetCommentsSectionParams.Context ctx */ 2: - message.ctx = GetCommentsSectionParams_Context.internalBinaryRead(reader, reader.uint32(), options, message.ctx); - break; - case /* int32 unk_param */ 3: - message.unkParam = reader.int32(); - break; - case /* youtube.GetCommentsSectionParams.Params params */ 6: - message.params = GetCommentsSectionParams_Params.internalBinaryRead(reader, reader.uint32(), options, message.params); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: GetCommentsSectionParams, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* youtube.GetCommentsSectionParams.Context ctx = 2; */ - if (message.ctx) - GetCommentsSectionParams_Context.internalBinaryWrite(message.ctx, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); - /* int32 unk_param = 3; */ - if (message.unkParam !== 0) - writer.tag(3, WireType.Varint).int32(message.unkParam); - /* youtube.GetCommentsSectionParams.Params params = 6; */ - if (message.params) - GetCommentsSectionParams_Params.internalBinaryWrite(message.params, writer.tag(6, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.GetCommentsSectionParams - */ -export const GetCommentsSectionParams = new GetCommentsSectionParams$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class GetCommentsSectionParams_Context$Type extends MessageType { - constructor() { - super("youtube.GetCommentsSectionParams.Context", [ - { no: 2, name: "video_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): GetCommentsSectionParams_Context { - const message = { videoId: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetCommentsSectionParams_Context): GetCommentsSectionParams_Context { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string video_id */ 2: - message.videoId = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: GetCommentsSectionParams_Context, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string video_id = 2; */ - if (message.videoId !== "") - writer.tag(2, WireType.LengthDelimited).string(message.videoId); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.GetCommentsSectionParams.Context - */ -export const GetCommentsSectionParams_Context = new GetCommentsSectionParams_Context$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class GetCommentsSectionParams_Params$Type extends MessageType { - constructor() { - super("youtube.GetCommentsSectionParams.Params", [ - { no: 1, name: "unk_token", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "opts", kind: "message", T: () => GetCommentsSectionParams_Params_Options }, - { no: 3, name: "replies_opts", kind: "message", T: () => GetCommentsSectionParams_Params_RepliesOptions }, - { no: 5, name: "page", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, - { no: 8, name: "target", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): GetCommentsSectionParams_Params { - const message = { target: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetCommentsSectionParams_Params): GetCommentsSectionParams_Params { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string unk_token */ 1: - message.unkToken = reader.string(); - break; - case /* optional youtube.GetCommentsSectionParams.Params.Options opts */ 4: - message.opts = GetCommentsSectionParams_Params_Options.internalBinaryRead(reader, reader.uint32(), options, message.opts); - break; - case /* optional youtube.GetCommentsSectionParams.Params.RepliesOptions replies_opts */ 3: - message.repliesOpts = GetCommentsSectionParams_Params_RepliesOptions.internalBinaryRead(reader, reader.uint32(), options, message.repliesOpts); - break; - case /* optional int32 page */ 5: - message.page = reader.int32(); - break; - case /* string target */ 8: - message.target = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: GetCommentsSectionParams_Params, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* optional string unk_token = 1; */ - if (message.unkToken !== undefined) - writer.tag(1, WireType.LengthDelimited).string(message.unkToken); - /* optional youtube.GetCommentsSectionParams.Params.Options opts = 4; */ - if (message.opts) - GetCommentsSectionParams_Params_Options.internalBinaryWrite(message.opts, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); - /* optional youtube.GetCommentsSectionParams.Params.RepliesOptions replies_opts = 3; */ - if (message.repliesOpts) - GetCommentsSectionParams_Params_RepliesOptions.internalBinaryWrite(message.repliesOpts, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); - /* optional int32 page = 5; */ - if (message.page !== undefined) - writer.tag(5, WireType.Varint).int32(message.page); - /* string target = 8; */ - if (message.target !== "") - writer.tag(8, WireType.LengthDelimited).string(message.target); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.GetCommentsSectionParams.Params - */ -export const GetCommentsSectionParams_Params = new GetCommentsSectionParams_Params$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class GetCommentsSectionParams_Params_Options$Type extends MessageType { - constructor() { - super("youtube.GetCommentsSectionParams.Params.Options", [ - { no: 4, name: "video_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 6, name: "sort_by", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 15, name: "type", kind: "scalar", T: 5 /*ScalarType.INT32*/ } - ]); - } - create(value?: PartialMessage): GetCommentsSectionParams_Params_Options { - const message = { videoId: "", sortBy: 0, type: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetCommentsSectionParams_Params_Options): GetCommentsSectionParams_Params_Options { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string video_id */ 4: - message.videoId = reader.string(); - break; - case /* int32 sort_by */ 6: - message.sortBy = reader.int32(); - break; - case /* int32 type */ 15: - message.type = reader.int32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: GetCommentsSectionParams_Params_Options, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string video_id = 4; */ - if (message.videoId !== "") - writer.tag(4, WireType.LengthDelimited).string(message.videoId); - /* int32 sort_by = 6; */ - if (message.sortBy !== 0) - writer.tag(6, WireType.Varint).int32(message.sortBy); - /* int32 type = 15; */ - if (message.type !== 0) - writer.tag(15, WireType.Varint).int32(message.type); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.GetCommentsSectionParams.Params.Options - */ -export const GetCommentsSectionParams_Params_Options = new GetCommentsSectionParams_Params_Options$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class GetCommentsSectionParams_Params_RepliesOptions$Type extends MessageType { - constructor() { - super("youtube.GetCommentsSectionParams.Params.RepliesOptions", [ - { no: 2, name: "comment_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "unkopts", kind: "message", T: () => GetCommentsSectionParams_Params_RepliesOptions_UnkOpts }, - { no: 5, name: "channel_id", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, - { no: 6, name: "video_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 8, name: "unk_param_1", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 9, name: "unk_param_2", kind: "scalar", T: 5 /*ScalarType.INT32*/ } - ]); - } - create(value?: PartialMessage): GetCommentsSectionParams_Params_RepliesOptions { - const message = { commentId: "", videoId: "", unkParam1: 0, unkParam2: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetCommentsSectionParams_Params_RepliesOptions): GetCommentsSectionParams_Params_RepliesOptions { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string comment_id */ 2: - message.commentId = reader.string(); - break; - case /* youtube.GetCommentsSectionParams.Params.RepliesOptions.UnkOpts unkopts */ 4: - message.unkopts = GetCommentsSectionParams_Params_RepliesOptions_UnkOpts.internalBinaryRead(reader, reader.uint32(), options, message.unkopts); - break; - case /* optional string channel_id */ 5: - message.channelId = reader.string(); - break; - case /* string video_id */ 6: - message.videoId = reader.string(); - break; - case /* int32 unk_param_1 */ 8: - message.unkParam1 = reader.int32(); - break; - case /* int32 unk_param_2 */ 9: - message.unkParam2 = reader.int32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: GetCommentsSectionParams_Params_RepliesOptions, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string comment_id = 2; */ - if (message.commentId !== "") - writer.tag(2, WireType.LengthDelimited).string(message.commentId); - /* youtube.GetCommentsSectionParams.Params.RepliesOptions.UnkOpts unkopts = 4; */ - if (message.unkopts) - GetCommentsSectionParams_Params_RepliesOptions_UnkOpts.internalBinaryWrite(message.unkopts, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); - /* optional string channel_id = 5; */ - if (message.channelId !== undefined) - writer.tag(5, WireType.LengthDelimited).string(message.channelId); - /* string video_id = 6; */ - if (message.videoId !== "") - writer.tag(6, WireType.LengthDelimited).string(message.videoId); - /* int32 unk_param_1 = 8; */ - if (message.unkParam1 !== 0) - writer.tag(8, WireType.Varint).int32(message.unkParam1); - /* int32 unk_param_2 = 9; */ - if (message.unkParam2 !== 0) - writer.tag(9, WireType.Varint).int32(message.unkParam2); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.GetCommentsSectionParams.Params.RepliesOptions - */ -export const GetCommentsSectionParams_Params_RepliesOptions = new GetCommentsSectionParams_Params_RepliesOptions$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class GetCommentsSectionParams_Params_RepliesOptions_UnkOpts$Type extends MessageType { - constructor() { - super("youtube.GetCommentsSectionParams.Params.RepliesOptions.UnkOpts", [ - { no: 1, name: "unk_param", kind: "scalar", T: 5 /*ScalarType.INT32*/ } - ]); - } - create(value?: PartialMessage): GetCommentsSectionParams_Params_RepliesOptions_UnkOpts { - const message = { unkParam: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetCommentsSectionParams_Params_RepliesOptions_UnkOpts): GetCommentsSectionParams_Params_RepliesOptions_UnkOpts { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int32 unk_param */ 1: - message.unkParam = reader.int32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: GetCommentsSectionParams_Params_RepliesOptions_UnkOpts, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* int32 unk_param = 1; */ - if (message.unkParam !== 0) - writer.tag(1, WireType.Varint).int32(message.unkParam); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.GetCommentsSectionParams.Params.RepliesOptions.UnkOpts - */ -export const GetCommentsSectionParams_Params_RepliesOptions_UnkOpts = new GetCommentsSectionParams_Params_RepliesOptions_UnkOpts$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class CreateCommentParams$Type extends MessageType { - constructor() { - super("youtube.CreateCommentParams", [ - { no: 2, name: "video_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 5, name: "params", kind: "message", T: () => CreateCommentParams_Params }, - { no: 10, name: "number", kind: "scalar", T: 5 /*ScalarType.INT32*/ } - ]); - } - create(value?: PartialMessage): CreateCommentParams { - const message = { videoId: "", number: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CreateCommentParams): CreateCommentParams { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string video_id */ 2: - message.videoId = reader.string(); - break; - case /* youtube.CreateCommentParams.Params params */ 5: - message.params = CreateCommentParams_Params.internalBinaryRead(reader, reader.uint32(), options, message.params); - break; - case /* int32 number */ 10: - message.number = reader.int32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: CreateCommentParams, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string video_id = 2; */ - if (message.videoId !== "") - writer.tag(2, WireType.LengthDelimited).string(message.videoId); - /* youtube.CreateCommentParams.Params params = 5; */ - if (message.params) - CreateCommentParams_Params.internalBinaryWrite(message.params, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); - /* int32 number = 10; */ - if (message.number !== 0) - writer.tag(10, WireType.Varint).int32(message.number); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.CreateCommentParams - */ -export const CreateCommentParams = new CreateCommentParams$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class CreateCommentParams_Params$Type extends MessageType { - constructor() { - super("youtube.CreateCommentParams.Params", [ - { no: 1, name: "index", kind: "scalar", T: 5 /*ScalarType.INT32*/ } - ]); - } - create(value?: PartialMessage): CreateCommentParams_Params { - const message = { index: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CreateCommentParams_Params): CreateCommentParams_Params { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int32 index */ 1: - message.index = reader.int32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: CreateCommentParams_Params, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* int32 index = 1; */ - if (message.index !== 0) - writer.tag(1, WireType.Varint).int32(message.index); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.CreateCommentParams.Params - */ -export const CreateCommentParams_Params = new CreateCommentParams_Params$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PeformCommentActionParams$Type extends MessageType { - constructor() { - super("youtube.PeformCommentActionParams", [ - { no: 1, name: "type", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 3, name: "comment_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 5, name: "video_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "unk_num", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, - { no: 23, name: "channel_id", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, - { no: 31, name: "translate_comment_params", kind: "message", T: () => PeformCommentActionParams_TranslateCommentParams } - ]); - } - create(value?: PartialMessage): PeformCommentActionParams { - const message = { type: 0, commentId: "", videoId: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PeformCommentActionParams): PeformCommentActionParams { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int32 type */ 1: - message.type = reader.int32(); - break; - case /* string comment_id */ 3: - message.commentId = reader.string(); - break; - case /* string video_id */ 5: - message.videoId = reader.string(); - break; - case /* optional int32 unk_num */ 2: - message.unkNum = reader.int32(); - break; - case /* optional string channel_id */ 23: - message.channelId = reader.string(); - break; - case /* optional youtube.PeformCommentActionParams.TranslateCommentParams translate_comment_params */ 31: - message.translateCommentParams = PeformCommentActionParams_TranslateCommentParams.internalBinaryRead(reader, reader.uint32(), options, message.translateCommentParams); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: PeformCommentActionParams, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* int32 type = 1; */ - if (message.type !== 0) - writer.tag(1, WireType.Varint).int32(message.type); - /* string comment_id = 3; */ - if (message.commentId !== "") - writer.tag(3, WireType.LengthDelimited).string(message.commentId); - /* string video_id = 5; */ - if (message.videoId !== "") - writer.tag(5, WireType.LengthDelimited).string(message.videoId); - /* optional int32 unk_num = 2; */ - if (message.unkNum !== undefined) - writer.tag(2, WireType.Varint).int32(message.unkNum); - /* optional string channel_id = 23; */ - if (message.channelId !== undefined) - writer.tag(23, WireType.LengthDelimited).string(message.channelId); - /* optional youtube.PeformCommentActionParams.TranslateCommentParams translate_comment_params = 31; */ - if (message.translateCommentParams) - PeformCommentActionParams_TranslateCommentParams.internalBinaryWrite(message.translateCommentParams, writer.tag(31, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.PeformCommentActionParams - */ -export const PeformCommentActionParams = new PeformCommentActionParams$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PeformCommentActionParams_TranslateCommentParams$Type extends MessageType { - constructor() { - super("youtube.PeformCommentActionParams.TranslateCommentParams", [ - { no: 3, name: "params", kind: "message", T: () => PeformCommentActionParams_TranslateCommentParams_Params }, - { no: 2, name: "comment_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "target_language", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): PeformCommentActionParams_TranslateCommentParams { - const message = { commentId: "", targetLanguage: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PeformCommentActionParams_TranslateCommentParams): PeformCommentActionParams_TranslateCommentParams { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* youtube.PeformCommentActionParams.TranslateCommentParams.Params params */ 3: - message.params = PeformCommentActionParams_TranslateCommentParams_Params.internalBinaryRead(reader, reader.uint32(), options, message.params); - break; - case /* string comment_id */ 2: - message.commentId = reader.string(); - break; - case /* string target_language */ 4: - message.targetLanguage = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: PeformCommentActionParams_TranslateCommentParams, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* youtube.PeformCommentActionParams.TranslateCommentParams.Params params = 3; */ - if (message.params) - PeformCommentActionParams_TranslateCommentParams_Params.internalBinaryWrite(message.params, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); - /* string comment_id = 2; */ - if (message.commentId !== "") - writer.tag(2, WireType.LengthDelimited).string(message.commentId); - /* string target_language = 4; */ - if (message.targetLanguage !== "") - writer.tag(4, WireType.LengthDelimited).string(message.targetLanguage); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.PeformCommentActionParams.TranslateCommentParams - */ -export const PeformCommentActionParams_TranslateCommentParams = new PeformCommentActionParams_TranslateCommentParams$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PeformCommentActionParams_TranslateCommentParams_Params$Type extends MessageType { - constructor() { - super("youtube.PeformCommentActionParams.TranslateCommentParams.Params", [ - { no: 1, name: "comment", kind: "message", T: () => PeformCommentActionParams_TranslateCommentParams_Params_Comment } - ]); - } - create(value?: PartialMessage): PeformCommentActionParams_TranslateCommentParams_Params { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PeformCommentActionParams_TranslateCommentParams_Params): PeformCommentActionParams_TranslateCommentParams_Params { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* youtube.PeformCommentActionParams.TranslateCommentParams.Params.Comment comment */ 1: - message.comment = PeformCommentActionParams_TranslateCommentParams_Params_Comment.internalBinaryRead(reader, reader.uint32(), options, message.comment); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: PeformCommentActionParams_TranslateCommentParams_Params, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* youtube.PeformCommentActionParams.TranslateCommentParams.Params.Comment comment = 1; */ - if (message.comment) - PeformCommentActionParams_TranslateCommentParams_Params_Comment.internalBinaryWrite(message.comment, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.PeformCommentActionParams.TranslateCommentParams.Params - */ -export const PeformCommentActionParams_TranslateCommentParams_Params = new PeformCommentActionParams_TranslateCommentParams_Params$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PeformCommentActionParams_TranslateCommentParams_Params_Comment$Type extends MessageType { - constructor() { - super("youtube.PeformCommentActionParams.TranslateCommentParams.Params.Comment", [ - { no: 1, name: "text", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): PeformCommentActionParams_TranslateCommentParams_Params_Comment { - const message = { text: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PeformCommentActionParams_TranslateCommentParams_Params_Comment): PeformCommentActionParams_TranslateCommentParams_Params_Comment { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string text */ 1: - message.text = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: PeformCommentActionParams_TranslateCommentParams_Params_Comment, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string text = 1; */ - if (message.text !== "") - writer.tag(1, WireType.LengthDelimited).string(message.text); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.PeformCommentActionParams.TranslateCommentParams.Params.Comment - */ -export const PeformCommentActionParams_TranslateCommentParams_Params_Comment = new PeformCommentActionParams_TranslateCommentParams_Params_Comment$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class MusicSearchFilter$Type extends MessageType { - constructor() { - super("youtube.MusicSearchFilter", [ - { no: 2, name: "filters", kind: "message", T: () => MusicSearchFilter_Filters } - ]); - } - create(value?: PartialMessage): MusicSearchFilter { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MusicSearchFilter): MusicSearchFilter { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional youtube.MusicSearchFilter.Filters filters */ 2: - message.filters = MusicSearchFilter_Filters.internalBinaryRead(reader, reader.uint32(), options, message.filters); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: MusicSearchFilter, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* optional youtube.MusicSearchFilter.Filters filters = 2; */ - if (message.filters) - MusicSearchFilter_Filters.internalBinaryWrite(message.filters, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.MusicSearchFilter - */ -export const MusicSearchFilter = new MusicSearchFilter$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class MusicSearchFilter_Filters$Type extends MessageType { - constructor() { - super("youtube.MusicSearchFilter.Filters", [ - { no: 17, name: "type", kind: "message", T: () => MusicSearchFilter_Filters_Type } - ]); - } - create(value?: PartialMessage): MusicSearchFilter_Filters { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MusicSearchFilter_Filters): MusicSearchFilter_Filters { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional youtube.MusicSearchFilter.Filters.Type type */ 17: - message.type = MusicSearchFilter_Filters_Type.internalBinaryRead(reader, reader.uint32(), options, message.type); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: MusicSearchFilter_Filters, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* optional youtube.MusicSearchFilter.Filters.Type type = 17; */ - if (message.type) - MusicSearchFilter_Filters_Type.internalBinaryWrite(message.type, writer.tag(17, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.MusicSearchFilter.Filters - */ -export const MusicSearchFilter_Filters = new MusicSearchFilter_Filters$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class MusicSearchFilter_Filters_Type$Type extends MessageType { - constructor() { - super("youtube.MusicSearchFilter.Filters.Type", [ - { no: 1, name: "song", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, - { no: 2, name: "video", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, - { no: 3, name: "album", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, - { no: 4, name: "artist", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, - { no: 5, name: "playlist", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ } - ]); - } - create(value?: PartialMessage): MusicSearchFilter_Filters_Type { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MusicSearchFilter_Filters_Type): MusicSearchFilter_Filters_Type { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional int32 song */ 1: - message.song = reader.int32(); - break; - case /* optional int32 video */ 2: - message.video = reader.int32(); - break; - case /* optional int32 album */ 3: - message.album = reader.int32(); - break; - case /* optional int32 artist */ 4: - message.artist = reader.int32(); - break; - case /* optional int32 playlist */ 5: - message.playlist = reader.int32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: MusicSearchFilter_Filters_Type, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* optional int32 song = 1; */ - if (message.song !== undefined) - writer.tag(1, WireType.Varint).int32(message.song); - /* optional int32 video = 2; */ - if (message.video !== undefined) - writer.tag(2, WireType.Varint).int32(message.video); - /* optional int32 album = 3; */ - if (message.album !== undefined) - writer.tag(3, WireType.Varint).int32(message.album); - /* optional int32 artist = 4; */ - if (message.artist !== undefined) - writer.tag(4, WireType.Varint).int32(message.artist); - /* optional int32 playlist = 5; */ - if (message.playlist !== undefined) - writer.tag(5, WireType.Varint).int32(message.playlist); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.MusicSearchFilter.Filters.Type - */ -export const MusicSearchFilter_Filters_Type = new MusicSearchFilter_Filters_Type$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SearchFilter$Type extends MessageType { - constructor() { - super("youtube.SearchFilter", [ - { no: 1, name: "sort_by", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, - { no: 19, name: "no_filter", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, - { no: 2, name: "filters", kind: "message", T: () => SearchFilter_Filters } - ]); - } - create(value?: PartialMessage): SearchFilter { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SearchFilter): SearchFilter { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional int32 sort_by */ 1: - message.sortBy = reader.int32(); - break; - case /* optional int32 no_filter */ 19: - message.noFilter = reader.int32(); - break; - case /* optional youtube.SearchFilter.Filters filters */ 2: - message.filters = SearchFilter_Filters.internalBinaryRead(reader, reader.uint32(), options, message.filters); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: SearchFilter, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* optional int32 sort_by = 1; */ - if (message.sortBy !== undefined) - writer.tag(1, WireType.Varint).int32(message.sortBy); - /* optional int32 no_filter = 19; */ - if (message.noFilter !== undefined) - writer.tag(19, WireType.Varint).int32(message.noFilter); - /* optional youtube.SearchFilter.Filters filters = 2; */ - if (message.filters) - SearchFilter_Filters.internalBinaryWrite(message.filters, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.SearchFilter - */ -export const SearchFilter = new SearchFilter$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SearchFilter_Filters$Type extends MessageType { - constructor() { - super("youtube.SearchFilter.Filters", [ - { no: 1, name: "upload_date", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, - { no: 2, name: "type", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, - { no: 3, name: "duration", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, - { no: 4, name: "features_hd", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, - { no: 5, name: "features_subtitles", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, - { no: 6, name: "features_creative_commons", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, - { no: 7, name: "features_3d", kind: "scalar", jsonName: "features3d", opt: true, T: 5 /*ScalarType.INT32*/ }, - { no: 8, name: "features_live", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, - { no: 9, name: "features_purchased", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, - { no: 14, name: "features_4k", kind: "scalar", jsonName: "features4k", opt: true, T: 5 /*ScalarType.INT32*/ }, - { no: 15, name: "features_360", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, - { no: 23, name: "features_location", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, - { no: 25, name: "features_hdr", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, - { no: 26, name: "features_vr180", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ } - ]); - } - create(value?: PartialMessage): SearchFilter_Filters { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SearchFilter_Filters): SearchFilter_Filters { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional int32 upload_date */ 1: - message.uploadDate = reader.int32(); - break; - case /* optional int32 type */ 2: - message.type = reader.int32(); - break; - case /* optional int32 duration */ 3: - message.duration = reader.int32(); - break; - case /* optional int32 features_hd */ 4: - message.featuresHd = reader.int32(); - break; - case /* optional int32 features_subtitles */ 5: - message.featuresSubtitles = reader.int32(); - break; - case /* optional int32 features_creative_commons */ 6: - message.featuresCreativeCommons = reader.int32(); - break; - case /* optional int32 features_3d = 7 [json_name = "features3d"];*/ 7: - message.features3D = reader.int32(); - break; - case /* optional int32 features_live */ 8: - message.featuresLive = reader.int32(); - break; - case /* optional int32 features_purchased */ 9: - message.featuresPurchased = reader.int32(); - break; - case /* optional int32 features_4k = 14 [json_name = "features4k"];*/ 14: - message.features4K = reader.int32(); - break; - case /* optional int32 features_360 */ 15: - message.features360 = reader.int32(); - break; - case /* optional int32 features_location */ 23: - message.featuresLocation = reader.int32(); - break; - case /* optional int32 features_hdr */ 25: - message.featuresHdr = reader.int32(); - break; - case /* optional int32 features_vr180 */ 26: - message.featuresVr180 = reader.int32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: SearchFilter_Filters, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* optional int32 upload_date = 1; */ - if (message.uploadDate !== undefined) - writer.tag(1, WireType.Varint).int32(message.uploadDate); - /* optional int32 type = 2; */ - if (message.type !== undefined) - writer.tag(2, WireType.Varint).int32(message.type); - /* optional int32 duration = 3; */ - if (message.duration !== undefined) - writer.tag(3, WireType.Varint).int32(message.duration); - /* optional int32 features_hd = 4; */ - if (message.featuresHd !== undefined) - writer.tag(4, WireType.Varint).int32(message.featuresHd); - /* optional int32 features_subtitles = 5; */ - if (message.featuresSubtitles !== undefined) - writer.tag(5, WireType.Varint).int32(message.featuresSubtitles); - /* optional int32 features_creative_commons = 6; */ - if (message.featuresCreativeCommons !== undefined) - writer.tag(6, WireType.Varint).int32(message.featuresCreativeCommons); - /* optional int32 features_3d = 7 [json_name = "features3d"]; */ - if (message.features3D !== undefined) - writer.tag(7, WireType.Varint).int32(message.features3D); - /* optional int32 features_live = 8; */ - if (message.featuresLive !== undefined) - writer.tag(8, WireType.Varint).int32(message.featuresLive); - /* optional int32 features_purchased = 9; */ - if (message.featuresPurchased !== undefined) - writer.tag(9, WireType.Varint).int32(message.featuresPurchased); - /* optional int32 features_4k = 14 [json_name = "features4k"]; */ - if (message.features4K !== undefined) - writer.tag(14, WireType.Varint).int32(message.features4K); - /* optional int32 features_360 = 15; */ - if (message.features360 !== undefined) - writer.tag(15, WireType.Varint).int32(message.features360); - /* optional int32 features_location = 23; */ - if (message.featuresLocation !== undefined) - writer.tag(23, WireType.Varint).int32(message.featuresLocation); - /* optional int32 features_hdr = 25; */ - if (message.featuresHdr !== undefined) - writer.tag(25, WireType.Varint).int32(message.featuresHdr); - /* optional int32 features_vr180 = 26; */ - if (message.featuresVr180 !== undefined) - writer.tag(26, WireType.Varint).int32(message.featuresVr180); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message youtube.SearchFilter.Filters - */ -export const SearchFilter_Filters = new SearchFilter_Filters$Type(); diff --git a/src/types/Cache.ts b/src/types/Cache.ts new file mode 100644 index 000000000..c3beb1e1e --- /dev/null +++ b/src/types/Cache.ts @@ -0,0 +1,10 @@ +export interface ICache { + cache_dir: string; + get(key: string): Promise; + set(key: string, value: ArrayBuffer): Promise; + remove(key: string): Promise; +} + +export interface ICacheConstructor { + new (persistent: boolean, persistent_directory?: string): ICache; +} \ No newline at end of file diff --git a/src/types/PlatformShim.ts b/src/types/PlatformShim.ts new file mode 100644 index 000000000..22b14e412 --- /dev/null +++ b/src/types/PlatformShim.ts @@ -0,0 +1,32 @@ +import { ICacheConstructor } from './Cache.js'; + +export type Runtime = 'deno' | 'node' | 'browser' | 'unknown'; + +export type FetchFunction = typeof fetch; + +export type VMPrimative = string | number | boolean | null | undefined; + +interface PlatformShim { + runtime: Runtime; + info: { + version: string, + bugs_url: string, + repo_url: string + }, + server: boolean; + Cache: ICacheConstructor; + sha1Hash(data: string): Promise; + uuidv4(): string; + eval(code: string, env: Record): unknown; + DOMParser: typeof globalThis.DOMParser; + serializeDOM: (document: Document) => string; + fetch: FetchFunction; + Request: typeof Request; + Response: typeof Response; + Headers: typeof Headers; + FormData: typeof FormData; + File: typeof File; + ReadableStream: typeof ReadableStream; +} + +export default PlatformShim; \ No newline at end of file diff --git a/src/types/index.ts b/src/types/index.ts new file mode 100644 index 000000000..b7e2ed884 --- /dev/null +++ b/src/types/index.ts @@ -0,0 +1,4 @@ +export * from './Cache.js'; + +export type { default as PlatformShim } from './PlatformShim.js'; +export * from './PlatformShim.js'; diff --git a/src/utils/Cache.ts b/src/utils/Cache.ts index cbc810336..0c48bc6a6 100644 --- a/src/utils/Cache.ts +++ b/src/utils/Cache.ts @@ -1,238 +1,21 @@ -import { getRuntime } from './Utils'; +import { ICache } from '../types/Cache.js'; +import { Platform } from './Utils.js'; -// Browser Cache is based off: -// https://github.com/elias551/simple-kvs/blob/master/src/index.ts - -export default class UniversalCache { - #persistent_directory: string; - #persistent: boolean; - - constructor(persistent = false, persistent_directory?: string) { - this.#persistent_directory = persistent_directory || UniversalCache.default_persistent_directory; - this.#persistent = persistent; - } - - static get temp_directory() { - switch (getRuntime()) { - case 'deno': - const Deno: any = Reflect.get(globalThis, 'Deno'); - return `${Deno.env.get('TMPDIR') || Deno.env.get('TMP') || Deno.env.get('TEMP') || '/tmp'}/youtubei.js`; - case 'node': - return `${Reflect.get(module, 'require')('os').tmpdir()}/youtubei.js`; - default: - return ''; - } +export default class UniversalCache implements ICache { + #cache: ICache; + constructor(persistent: boolean, persistent_directory?: string) { + this.#cache = new Platform.shim.Cache(persistent, persistent_directory); } - - static get default_persistent_directory() { - switch (getRuntime()) { - case 'deno': - const Deno: any = Reflect.get(globalThis, 'Deno'); - return `${Deno.cwd()}/.cache/youtubei.js`; - case 'node': - return Reflect.get(module, 'require')('path').resolve(__dirname, '..', '..', '.cache', 'youtubei.js'); - default: - return ''; - } - } - get cache_dir() { - return this.#persistent ? this.#persistent_directory : UniversalCache.temp_directory; + return this.#cache.cache_dir; } - - async #createCache() { - const dir = this.cache_dir; - switch (getRuntime()) { - case 'deno': - const Deno: any = Reflect.get(globalThis, 'Deno'); - try { - const cwd = await Deno.stat(dir); - if (!cwd.isDirectory) - throw new Error('An unexpected file was found in place of the cache directory'); - } catch (e) { - if (e instanceof Deno.errors.NotFound) - await Deno.mkdir(dir, { recursive: true }); - else - throw e; - } - break; - - case 'node': - const fs = Reflect.get(module, 'require')('fs/promises'); - try { - const cwd = await fs.stat(dir); - if (!cwd.isDirectory()) - throw new Error('An unexpected file was found in place of the cache directory'); - } catch (e: any) { - if (e?.code === 'ENOENT') - await fs.mkdir(dir, { recursive: true }); - else - throw e; - } - break; - } + get(key: string) { + return this.#cache.get(key); } - - #getBrowserDB() { - const indexedDB: IDBFactory = Reflect.get(globalThis, 'indexedDB') || Reflect.get(globalThis, 'webkitIndexedDB') || Reflect.get(globalThis, 'mozIndexedDB') || Reflect.get(globalThis, 'msIndexedDB'); - - if (!indexedDB) return console.log('IndexedDB is not supported. No cache will be used.'); - - return new Promise((resolve, reject) => { - const request = indexedDB.open('youtubei.js', 1); - request.onsuccess = function () { - resolve(this.result); - }; - - request.onerror = function (event) { - reject('indexedDB request error'); - console.error(event); - }; - - request.onupgradeneeded = function () { - const store = this.result.createObjectStore('kv-store', { - keyPath: 'k' - }); - - store.transaction.oncomplete = function () { - resolve(this.db); - }; - }; - }); + set(key: string, value: ArrayBuffer) { + return this.#cache.set(key, value); } - - async get(key: string) { - await this.#createCache(); - switch (getRuntime()) { - case 'deno': - { - const file = `${this.cache_dir}/${key}`; - const Deno: any = Reflect.get(globalThis, 'Deno'); - try { - const stat = await Deno.stat(file); - if (stat.isFile) { - const data: Uint8Array = await Deno.readFile(file); - return data.buffer; - } - throw new Error('An unexpected file was found in place of the cache key'); - - } catch (e) { - if (e instanceof Deno.errors.NotFound) - return undefined; - throw e; - } - } - - case 'node': - { - const fs = Reflect.get(module, 'require')('fs/promises'); - const file = Reflect.get(module, 'require')('path').resolve(this.cache_dir, key); - try { - const stat = await fs.stat(file); - if (stat.isFile()) { - const data: Buffer = await fs.readFile(file); - return data.buffer; - } - throw new Error('An unexpected file was found in place of the cache key'); - - } catch (e: any) { - if (e?.code === 'ENOENT') - return undefined; - throw e; - } - } - - case 'browser': - { - const db = await this.#getBrowserDB(); - if (!db) return; - - return new Promise((resolve, reject) => { - const request = db.transaction('kv-store', 'readonly').objectStore('kv-store').get(key); - request.onerror = reject; - request.onsuccess = function () { - const result: Uint8Array | undefined = this.result?.v; - resolve(result ? result.buffer : undefined); - }; - }); - } - } - } - - async set(key: string, value: ArrayBuffer) { - await this.#createCache(); - switch (getRuntime()) { - case 'deno': - { - const Deno: any = Reflect.get(globalThis, 'Deno'); - const file = `${this.cache_dir}/${key}`; - await Deno.writeFile(file, new Uint8Array(value)); - } - break; - - case 'node': - { - const fs = Reflect.get(module, 'require')('fs/promises'); - const file = Reflect.get(module, 'require')('path').resolve(this.cache_dir, key); - await fs.writeFile(file, new Uint8Array(value)); - } - break; - - case 'browser': - { - const db = await this.#getBrowserDB(); - if (!db) return; - - return new Promise((resolve, reject) => { - const request = db.transaction('kv-store', 'readwrite').objectStore('kv-store').put({ k: key, v: value }); - request.onerror = reject; - request.onsuccess = () => resolve(); - }); - } - break; - } - } - - async remove(key: string) { - await this.#createCache(); - switch (getRuntime()) { - case 'deno': - { - const file = `${this.cache_dir}/${key}`; - const Deno: any = Reflect.get(globalThis, 'Deno'); - try { - await Deno.remove(file); - } catch (e) { - if (e instanceof Deno.errors.NotFound) return undefined; - throw e; - } - } - break; - - case 'node': - { - const fs = Reflect.get(module, 'require')('fs/promises'); - const file = Reflect.get(module, 'require')('path').resolve(this.cache_dir, key); - try { - await fs.unlink(file); - } catch (e: any) { - if (e?.code === 'ENOENT') return; - throw e; - } - } - break; - - case 'browser': - { - const db = await this.#getBrowserDB(); - if (!db) return; - - return new Promise((resolve, reject) => { - const request = db.transaction('kv-store', 'readwrite').objectStore('kv-store').delete(key); - request.onerror = reject; - request.onsuccess = () => resolve(); - }); - } - } + remove(key: string) { + return this.#cache.remove(key); } } \ No newline at end of file diff --git a/src/utils/FormatUtils.ts b/src/utils/FormatUtils.ts index 9e12e6cd2..123c8d963 100644 --- a/src/utils/FormatUtils.ts +++ b/src/utils/FormatUtils.ts @@ -1,17 +1,12 @@ -import Player from '../core/Player'; -import Actions from '../core/Actions'; +import Player from '../core/Player.js'; +import Actions from '../core/Actions.js'; -import type Format from '../parser/classes/misc/Format'; -import type AudioOnlyPlayability from '../parser/classes/AudioOnlyPlayability'; -import type { YTNode } from '../parser/helpers'; +import type Format from '../parser/classes/misc/Format.js'; +import type AudioOnlyPlayability from '../parser/classes/AudioOnlyPlayability.js'; +import type { YTNode } from '../parser/helpers.js'; -import { DOMParser } from 'linkedom'; -import type { Element } from 'linkedom/types/interface/element'; -import type { Node } from 'linkedom/types/interface/node'; -import type { XMLDocument } from 'linkedom/types/xml/document'; - -import { Constants } from '.'; -import { getStringBetweenStrings, InnertubeError, streamToIterable } from './Utils'; +import { Constants } from './index.js'; +import { getStringBetweenStrings, InnertubeError, Platform, streamToIterable } from './Utils.js'; export type URLTransformer = (url: URL) => URL; export type FormatFilter = (format: Format) => boolean; @@ -111,7 +106,7 @@ class FormatUtils { let cancel: AbortController; - const readable_stream = new ReadableStream({ + const readable_stream = new Platform.shim.ReadableStream({ // eslint-disable-next-line @typescript-eslint/no-empty-function start() { }, pull: async (controller) => { @@ -275,10 +270,11 @@ class FormatUtils { const length = adaptive_formats[0].approx_duration_ms / 1000; - const document = new DOMParser().parseFromString('', 'text/xml'); + const document = new Platform.shim.DOMParser().parseFromString('', 'application/xml'); + const mpd = document.querySelector('MPD') as HTMLElement; const period = document.createElement('Period'); - document.appendChild(this.#el(document, 'MPD', { + mpd.replaceWith(this.#el(document, 'MPD', { xmlns: 'urn:mpeg:dash:schema:mpd:2011', minBufferTime: 'PT1.500S', profiles: 'urn:mpeg:dash:profile:isoff-main:2011', @@ -292,13 +288,13 @@ class FormatUtils { this.#generateAdaptationSet(document, period, adaptive_formats, url_transformer, cpn, player); - return `${document}`; + return Platform.shim.serializeDOM(document); } static #el(document: XMLDocument, tag: string, attrs: Record, children: Node[] = []) { const el = document.createElement(tag); for (const [ key, value ] of Object.entries(attrs)) { - el.setAttribute(key, value); + value && el.setAttribute(key, value); } for (const child of children) { if (typeof child === 'undefined') continue; @@ -435,7 +431,7 @@ class FormatUtils { ])); } - static #generateRepresentationAudio(document: XMLDocument, set: Element, format: Format, url_transformer: URLTransformer, cpn?: string, player?: Player) { + static async #generateRepresentationAudio(document: XMLDocument, set: Element, format: Format, url_transformer: URLTransformer, cpn?: string, player?: Player) { const codecs = getStringBetweenStrings(format.mime_type, 'codecs="', '"'); if (!format.index_range || !format.init_range) throw new InnertubeError('Index and init ranges not available', { format }); diff --git a/src/utils/HTTPClient.ts b/src/utils/HTTPClient.ts index b68bf7c8f..d1b40f5ae 100644 --- a/src/utils/HTTPClient.ts +++ b/src/utils/HTTPClient.ts @@ -1,8 +1,13 @@ -import Session, { Context } from '../core/Session'; -import Constants from './Constants'; -import { generateSidAuth, getRandomUserAgent, getStringBetweenStrings, InnertubeError, isServer } from './Utils'; - -export type FetchFunction = typeof fetch; +import Session, { Context } from '../core/Session.js'; +import { FetchFunction } from '../types/PlatformShim.js'; +import Constants from './Constants.js'; +import { + Platform, + generateSidAuth, + getRandomUserAgent, + getStringBetweenStrings, + InnertubeError +} from './Utils.js'; export interface HTTPClientInit { baseURL?: string; @@ -16,7 +21,7 @@ export default class HTTPClient { constructor(session: Session, cookie?: string, fetch?: FetchFunction) { this.#session = session; this.#cookie = cookie; - this.#fetch = fetch || globalThis.fetch; + this.#fetch = fetch || Platform.shim.fetch; } get fetch_function(): FetchFunction { @@ -40,12 +45,12 @@ export default class HTTPClient { const headers = init?.headers || - (input instanceof Request ? input.headers : new Headers()) || - new Headers(); + (input instanceof Platform.shim.Request ? input.headers : new Platform.shim.Headers()) || + new Platform.shim.Headers(); - const body = init?.body || (input instanceof Request ? input.body : undefined); + const body = init?.body || (input instanceof Platform.shim.Request ? input.body : undefined); - const request_headers = new Headers(headers); + const request_headers = new Platform.shim.Headers(headers); request_headers.set('Accept', '*/*'); request_headers.set('Accept-Language', '*'); @@ -53,7 +58,7 @@ export default class HTTPClient { request_headers.set('x-origin', request_url.origin); request_headers.set('x-youtube-client-version', this.#session.context.client.clientVersion || ''); - if (isServer()) { + if (Platform.shim.server) { request_headers.set('User-Agent', getRandomUserAgent('desktop')); request_headers.set('origin', request_url.origin); } @@ -115,13 +120,13 @@ export default class HTTPClient { } } - const request = new Request(request_url, input instanceof Request ? input : init); + const request = new Platform.shim.Request(request_url, input instanceof Platform.shim.Request ? input : init); const response = await this.#fetch(request, { body: request_body, headers: request_headers, credentials: 'include', - redirect: input instanceof Request ? input.redirect : init?.redirect || 'follow' + redirect: input instanceof Platform.shim.Request ? input.redirect : init?.redirect || 'follow' }); // Check if 2xx diff --git a/src/utils/Utils.ts b/src/utils/Utils.ts index 1e0c9e31c..b64808589 100644 --- a/src/utils/Utils.ts +++ b/src/utils/Utils.ts @@ -1,8 +1,19 @@ -import package_json from '../../package.json'; -import { Memo } from '../parser/helpers'; -import { FetchFunction } from './HTTPClient'; -import userAgents from './user-agents.json'; - +import { Memo } from '../parser/helpers.js'; +import PlatformShim, { FetchFunction } from '../types/PlatformShim.js'; +import userAgents from './user-agents.js'; + +export class Platform { + static #shim: PlatformShim | undefined; + static load(platform: PlatformShim): void { + Platform.#shim = platform; + } + static get shim(): PlatformShim { + if (!Platform.#shim) { + throw new Error('Platform is not loaded'); + } + return Platform.#shim; + } +} export class InnertubeError extends Error { date: Date; version: string; @@ -16,7 +27,7 @@ export class InnertubeError extends Error { } this.date = new Date(); - this.version = package_json.version; + this.version = Platform.shim.info.version; } } @@ -70,40 +81,8 @@ export function getRandomUserAgent(type: DeviceCategory): string { return available_agents[random_index]; } -export async function sha1Hash(str: string): Promise { - const SubtleCrypto = getRuntime() === 'node' ? (Reflect.get(module, 'require')('crypto').webcrypto as unknown as Crypto).subtle : window.crypto.subtle; - const byteToHex = [ - '00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '0a', '0b', '0c', '0d', '0e', '0f', - '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '1a', '1b', '1c', '1d', '1e', '1f', - '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '2a', '2b', '2c', '2d', '2e', '2f', - '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '3a', '3b', '3c', '3d', '3e', '3f', - '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '4a', '4b', '4c', '4d', '4e', '4f', - '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '5a', '5b', '5c', '5d', '5e', '5f', - '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '6a', '6b', '6c', '6d', '6e', '6f', - '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '7a', '7b', '7c', '7d', '7e', '7f', - '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '8a', '8b', '8c', '8d', '8e', '8f', - '90', '91', '92', '93', '94', '95', '96', '97', '98', '99', '9a', '9b', '9c', '9d', '9e', '9f', - 'a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'a9', 'aa', 'ab', 'ac', 'ad', 'ae', 'af', - 'b0', 'b1', 'b2', 'b3', 'b4', 'b5', 'b6', 'b7', 'b8', 'b9', 'ba', 'bb', 'bc', 'bd', 'be', 'bf', - 'c0', 'c1', 'c2', 'c3', 'c4', 'c5', 'c6', 'c7', 'c8', 'c9', 'ca', 'cb', 'cc', 'cd', 'ce', 'cf', - 'd0', 'd1', 'd2', 'd3', 'd4', 'd5', 'd6', 'd7', 'd8', 'd9', 'da', 'db', 'dc', 'dd', 'de', 'df', - 'e0', 'e1', 'e2', 'e3', 'e4', 'e5', 'e6', 'e7', 'e8', 'e9', 'ea', 'eb', 'ec', 'ed', 'ee', 'ef', - 'f0', 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'fa', 'fb', 'fc', 'fd', 'fe', 'ff' - ]; - - function hex(arrayBuffer: ArrayBuffer): string { - const buff = new Uint8Array(arrayBuffer); - const hexOctets = []; - for (let i = 0; i < buff.length; ++i) - hexOctets.push(byteToHex[buff[i]]); - return hexOctets.join(''); - } - - return hex(await SubtleCrypto.digest('SHA-1', new TextEncoder().encode(str))); -} - /** - * Generates an authentication token from a cookies' sid. + * Generates an authentication token from a cookies' sid..js * @param sid - Sid extracted from cookies */ export async function generateSidAuth(sid: string): Promise { @@ -111,7 +90,7 @@ export async function generateSidAuth(sid: string): Promise { const timestamp = Math.floor(new Date().getTime() / 1000); const input = [ timestamp, sid, youtube ].join(' '); - const gen_hash = await sha1Hash(input); + const gen_hash = await Platform.shim.sha1Hash(input); return [ 'SAPISIDHASH', [ timestamp, gen_hash ].join('_') ].join(' '); } @@ -177,36 +156,6 @@ export function hasKeys(params: T, ...k return true; } -export function uuidv4(): string { - if (getRuntime() === 'node') { - return Reflect.get(module, 'require')('crypto').webcrypto.randomUUID(); - } - - if (globalThis.crypto?.randomUUID()) { - return globalThis.crypto.randomUUID(); - } - - // See https://stackoverflow.com/a/2117523 - return '10000000-1000-4000-8000-100000000000'.replace(/[018]/g, (cc) => { - const c = parseInt(cc); - return (c ^ window.crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16); - }); -} - -export type Runtime = 'node' | 'deno' | 'browser'; - -export function getRuntime(): Runtime { - if ((typeof process !== 'undefined') && (process?.versions?.node)) - return 'node'; - if (Reflect.has(globalThis, 'Deno')) - return 'deno'; - return 'browser'; -} - -export function isServer(): boolean { - return [ 'node', 'deno' ].includes(getRuntime()); -} - export async function* streamToIterable(stream: ReadableStream) { const reader = stream.getReader(); @@ -262,7 +211,7 @@ export const debugFetch: FetchFunction = (input, init) => { ' body:\n${body_contents}` ); - return globalThis.fetch(input, init); + return Platform.shim.fetch(input, init); }; export function u8ToBase64(u8: Uint8Array): string { diff --git a/src/utils/index.ts b/src/utils/index.ts index 2c98d0496..f6f306595 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -1,6 +1,11 @@ -export * as Utils from './Utils'; -export * as Constants from './Constants'; -export { default as UniversalCache } from './Cache'; -export { default as EventEmitter } from './EventEmitterLike'; -export { default as HTTPClient } from './HTTPClient'; -export * from './HTTPClient'; \ No newline at end of file +export { default as UniversalCache } from './Cache.js'; + +export * as Constants from './Constants.js'; + +export { default as EventEmitter } from './EventEmitterLike.js'; + +export { default as HTTPClient } from './HTTPClient.js'; +export * from './HTTPClient.js'; + +export { Platform } from './Utils.js'; +export * as Utils from './Utils.js'; diff --git a/src/utils/user-agents.json b/src/utils/user-agents.json deleted file mode 100644 index 3b287d9d5..000000000 --- a/src/utils/user-agents.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "desktop": [ - "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36", - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.114 Safari/537.36", - "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36", - "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.114 Safari/537.36 Edg/103.0.1264.62", - "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.53 Safari/537.36", - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36", - "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36", - "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36", - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36", - "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36", - "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36", - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36", - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Safari/605.1.15", - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.114 Safari/537.36", - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36", - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36", - "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36", - "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36", - "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36", - "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36", - "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36", - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36", - "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.114 Safari/537.36 Edg/103.0.1264.49", - "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36", - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36", - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36" - ], - "mobile": [ - "Mozilla/5.0 (Linux; Android 12; SAMSUNG SM-S908B) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/17.0 Chrome/96.0.4664.104 Mobile Safari/537.36", - "Mozilla/5.0 (Linux; Android 11; SM-G781B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Mobile Safari/537.36", - "Mozilla/5.0 (Linux; arm_64; Android 12; RMX3081) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.148 YaBrowser/22.7.3.82.00 SA/3 Mobile Safari/537.36", - "Mozilla/5.0 (Linux; Android 12; SM-G973F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Mobile Safari/537.36", - "Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1", - "Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1", - "Mozilla/5.0 (Linux; Android 11; GM1900) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.0675.117 Mobile Safari/537.36", - "Mozilla/5.0 (Linux; Android 11; 21061119BI) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Mobile Safari/537.36", - "Mozilla/5.0 (Linux; Android 10; HarmonyOS; TEL-AN10; HMSCore 6.6.0.312) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.105 HuaweiBrowser/12.1.1.321 Mobile Safari/537.36", - "Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1", - "Mozilla/5.0 (Linux; U; Android 8.0.0; zh-cn; Mi Note 2 Build/OPR1.170623.032) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/61.0.3163.128 Mobile Safari/537.36 XiaoMi/MiuiBrowser/10.1.1", - "Mozilla/5.0 (Linux; Android 12; IN2013) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Mobile Safari/537.36", - "Mozilla/5.0 (Linux; Android 11; Redmi Note 8 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.0.0 Mobile Safari/537.36", - "Mozilla/5.0 (Linux; Android 12; Pixel 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Mobile Safari/537.36", - "Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/103.0.5060.63 Mobile/15E148 Safari/604.1", - "Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1", - "Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/103.0.5060.63 Mobile/15E148 Safari/604.1", - "Mozilla/5.0 (Linux; Android 9; moto e6s) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Mobile Safari/537.36", - "Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1", - "Mozilla/5.0 (Linux; Android 11; ONEPLUS A6013) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Mobile Safari/537.36", - "Mozilla/5.0 (Linux; Android 12; SM-G986B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Mobile Safari/537.36", - "Mozilla/5.0 (iPhone; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.25 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1", - "Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1", - "Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1", - "Mozilla/5.0 (Linux; Android 7.1.2; Redmi Note 5A Prime) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Mobile Safari/537.36", - "Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1" - ] -} \ No newline at end of file diff --git a/src/utils/user-agents.ts b/src/utils/user-agents.ts new file mode 100644 index 000000000..dca55cbbc --- /dev/null +++ b/src/utils/user-agents.ts @@ -0,0 +1,60 @@ +/* eslint-disable */ +/* Generated file do not edit */ +export default { + "desktop": [ + "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36", + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36", + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36", + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36", + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36", + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36", + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36", + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36", + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Safari/605.1.15", + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36", + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36", + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36", + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36", + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36", + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36 Edg/109.0.1518.61", + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36", + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36", + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.2 Safari/605.1.15", + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36", + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36", + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36", + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36", + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36", + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36", + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36", + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36" + ], + "mobile": [ + "Mozilla/5.0 (iPhone; CPU iPhone OS 16_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Mobile/15E148 Safari/604.1", + "Mozilla/5.0 (iPhone; CPU iPhone OS 16_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/109.0.5414.83 Mobile/15E148 Safari/604.1", + "Mozilla/5.0 (iPhone; CPU iPhone OS 16_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/109.0.5414.83 Mobile/15E148 Safari/604.1", + "Mozilla/5.0 (iPhone; CPU iPhone OS 16_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/109.0.5414.83 Mobile/15E148 Safari/604.1", + "Mozilla/5.0 (Linux; Android 12; SM-G990U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Mobile Safari/537.36", + "Mozilla/5.0 (Linux; Android 13; SM-G998B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Mobile Safari/537.36", + "Mozilla/5.0 (iPhone; CPU iPhone OS 16_1_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/108.1 Mobile/15E148 Safari/605.1.15", + "Mozilla/5.0 (iPhone; CPU iPhone OS 16_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/109.0.5414.83 Mobile/15E148 Safari/604.1", + "Mozilla/5.0 (iPhone; CPU iPhone OS 11_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15G77 ChannelId(73) NebulaSDK/1.8.100112 Nebula PSDType(1) AlipayDefined(nt:4G,ws:320|504|2.0) AliApp(AP/10.1.30.300) AlipayClient/10.1.30.300 Alipay Language/zh-Hans", + "Mozilla/5.0 (iPhone; CPU iPhone OS 16_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.2 Mobile/15E148 Safari/604.1", + "Mozilla/5.0 (iPhone; CPU iPhone OS 16_1_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Mobile/15E148 Safari/604.1", + "Mozilla/5.0 (Linux; Android 13; SM-N981U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Mobile Safari/537.36", + "Mozilla/5.0 (Linux; Android 13; SM-A515F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Mobile Safari/537.36", + "Mozilla/5.0 (iPhone; CPU iPhone OS 16_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.2 Mobile/15E148 Safari/604.1", + "Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Mobile/15E148 Safari/604.1", + "Mozilla/5.0 (iPhone; CPU iPhone OS 16_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/109.0.5414.83 Mobile/15E148 Safari/604.1", + "Mozilla/5.0 (iPhone; CPU iPhone OS 16_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/109.0.5414.83 Mobile/15E148 Safari/604.1", + "Mozilla/5.0 (Linux; Android 12; M2010J19SG) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Mobile Safari/537.36", + "Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1", + "Mozilla/5.0 (iPhone; CPU iPhone OS 16_1_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Mobile/15E148 Safari/604.1", + "Mozilla/5.0 (iPhone; CPU iPhone OS 16_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/109.0.5414.83 Mobile/15E148 Safari/604.1", + "Mozilla/5.0 (iPhone; CPU iPhone OS 15_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Mobile/15E148 Safari/604.1", + "Mozilla/5.0 (iPhone; CPU iPhone OS 16_1_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Mobile/15E148 Safari/604.1", + "Mozilla/5.0 (iPhone; CPU iPhone OS 16_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/109.0.5414.83 Mobile/15E148 Safari/604.1", + "Mozilla/5.0 (Linux; Android 11; M2102J20SG) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Mobile Safari/537.36", + "Mozilla/5.0 (iPhone; CPU iPhone OS 16_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.2 Mobile/15E148 Safari/604.1" + ] +} as { desktop: string[], mobile: string[] }; \ No newline at end of file diff --git a/test/main.test.ts b/test/main.test.ts index cef22e1e5..1d07a9700 100644 --- a/test/main.test.ts +++ b/test/main.test.ts @@ -1,9 +1,7 @@ import fs from 'fs'; -import Innertube from '..'; +import { Innertube, Utils } from '../bundle/node.cjs'; import { CHANNELS, VIDEOS } from './constants'; -import { streamToIterable } from '../src/utils/Utils'; -import TextRun from '../src/parser/classes/misc/TextRun'; -import Comments from '../dist/src/parser/youtube/Comments'; +import type TextRun from '../src/parser/classes/misc/TextRun'; describe('YouTube.js Tests', () => { let yt: Innertube; @@ -93,7 +91,7 @@ describe('YouTube.js Tests', () => { }); describe('Comments', () => { - let comment_section: Comments; + let comment_section: Awaited>; it('should retrieve comments', async () => { comment_section = await yt.getComments(VIDEOS[1].ID); @@ -279,7 +277,7 @@ async function download(id: string, yt: Innertube): Promise { const stream = await yt.download(id, { type: 'video+audio' }); const file = fs.createWriteStream(`./${id}.mp4`); - for await (const chunk of streamToIterable(stream)) { + for await (const chunk of Utils.streamToIterable(stream)) { file.write(chunk); } diff --git a/tsconfig.json b/tsconfig.json index 8d9cd6cb3..e60d25e0c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -25,9 +25,9 @@ // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ /* Modules */ - "module": "commonjs", /* Specify what module code is generated. */ + "module": "NodeNext", /* Specify what module code is generated. */ // "rootDir": "./", /* Specify the root folder within your source files. */ - "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ + "moduleResolution": "nodenext", /* Specify how TypeScript looks up a file from a given module specifier. */ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */