diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index a263724..0000000 --- a/.editorconfig +++ /dev/null @@ -1,15 +0,0 @@ -root = true - -[*] -indent_style = space -indent_size = 4 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -[*.md] -trim_trailing_whitespace = false - -[*.{json,yml}] -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 969ec12..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1,460 +0,0 @@ -module.exports = { - "env": { - "node": true - }, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, - "ignorePatterns": [ - "generated/**/*.d.ts" ,// Adjust the pattern as needed - "lib/*.d.ts", - ], - "plugins": [ - "eslint-plugin-import", - "eslint-plugin-security", - "eslint-plugin-react", - "eslint-plugin-jest", - "eslint-plugin-unicorn", - "eslint-plugin-jsdoc", - "eslint-plugin-no-null", - "eslint-plugin-prefer-arrow", - "eslint-plugin-lodash", - "jsx-a11y", - "@typescript-eslint", - "@typescript-eslint/tslint" - ], - "root": true, - "rules": { - "@typescript-eslint/adjacent-overload-signatures": "error", - "@typescript-eslint/array-type": [ - "off", - { - "default": "array" - } - ], - "@typescript-eslint/await-thenable": "error", - "@typescript-eslint/ban-types": "off", - "@typescript-eslint/consistent-type-assertions": "off", - "@typescript-eslint/consistent-type-definitions": "off", - "@typescript-eslint/dot-notation": "off", - "@typescript-eslint/explicit-function-return-type": "off", - "@typescript-eslint/explicit-member-accessibility": [ - "off", - { - "accessibility": "explicit" - } - ], - "@typescript-eslint/explicit-module-boundary-types": "off", - "@typescript-eslint/indent": [ - "off", - 4, - { - "CallExpression": { - "arguments": "first" - }, - "FunctionDeclaration": { - "parameters": "first" - }, - "FunctionExpression": { - "parameters": "first" - } - } - ], - "@typescript-eslint/member-delimiter-style": [ - "off", - { - "multiline": { - "delimiter": "semi", - "requireLast": true - }, - "singleline": { - "delimiter": "semi", - "requireLast": false - } - } - ], - "@typescript-eslint/member-ordering": "off", - "@typescript-eslint/naming-convention": [ - "off", - { - "selector": "variable", - "format": [ - "camelCase", - "UPPER_CASE" - ], - "leadingUnderscore": "forbid", - "trailingUnderscore": "forbid" - } - ], - "@typescript-eslint/no-array-constructor": "error", - "@typescript-eslint/no-dynamic-delete": "error", - "@typescript-eslint/no-empty-function": "error", - "@typescript-eslint/no-empty-interface": "error", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-extraneous-class": "error", - "@typescript-eslint/no-floating-promises": "error", - "@typescript-eslint/no-for-in-array": "error", - "@typescript-eslint/no-inferrable-types": "off", - "@typescript-eslint/no-misused-new": "error", - "@typescript-eslint/no-namespace": "off", - "@typescript-eslint/no-non-null-assertion": "error", - "@typescript-eslint/no-parameter-properties": "off", - "@typescript-eslint/no-require-imports": "error", - "@typescript-eslint/no-shadow": [ - "off", - { - "hoist": "all" - } - ], - "@typescript-eslint/no-this-alias": "error", - "@typescript-eslint/no-unnecessary-qualifier": "off", - "@typescript-eslint/no-unnecessary-type-arguments": "error", - "@typescript-eslint/no-unnecessary-type-assertion": "error", - "@typescript-eslint/no-unused-expressions": "error", - "@typescript-eslint/no-use-before-define": "off", - "@typescript-eslint/no-var-requires": "error", - "@typescript-eslint/prefer-for-of": "error", - "@typescript-eslint/prefer-function-type": "error", - "@typescript-eslint/prefer-namespace-keyword": "off", - "@typescript-eslint/prefer-readonly": "error", - "@typescript-eslint/promise-function-async": "off", - "@typescript-eslint/quotes": [ - "off", - "double", - { - "avoidEscape": true - } - ], - "@typescript-eslint/restrict-plus-operands": "error", - "@typescript-eslint/semi": [ - "off", - "always" - ], - "@typescript-eslint/strict-boolean-expressions": "off", - "@typescript-eslint/triple-slash-reference": [ - "error", - { - "path": "always", - "types": "prefer-import", - "lib": "always" - } - ], - "@typescript-eslint/type-annotation-spacing": "off", - "@typescript-eslint/typedef": [ - "error", - { - "parameter": true, - "arrowParameter": true, - "propertyDeclaration": true, - "memberVariableDeclaration": true - } - ], - "@typescript-eslint/unified-signatures": "error", - "arrow-parens": [ - "off", - "always" - ], - "brace-style": [ - "off", - "1tbs" - ], - "comma-dangle": [ - "off", - "always-multiline" - ], - "complexity": "error", - "constructor-super": "error", - "curly": "error", - "default-case": "error", - "dot-notation": "off", - "eol-last": "error", - "eqeqeq": [ - "error", - "smart" - ], - "guard-for-in": "error", - "id-denylist": "error", - "id-match": "error", - "import/no-default-export": "off", - "import/no-deprecated": "off", - "import/no-extraneous-dependencies": "error", - "import/no-internal-modules": "off", - "import/no-unassigned-import": "error", - "import/order": [ - "error", - { - "alphabetize": { - "caseInsensitive": true, - "order": "asc" - }, - "newlines-between": "ignore", - "groups": [ - [ - "builtin", - "external", - "internal", - "unknown", - "object", - "type" - ], - "parent", - [ - "sibling", - "index" - ] - ], - "distinctGroup": false, - "pathGroupsExcludedImportTypes": [], - "pathGroups": [ - { - "pattern": "./", - "patternOptions": { - "nocomment": true, - "dot": true - }, - "group": "sibling", - "position": "before" - }, - { - "pattern": ".", - "patternOptions": { - "nocomment": true, - "dot": true - }, - "group": "sibling", - "position": "before" - }, - { - "pattern": "..", - "patternOptions": { - "nocomment": true, - "dot": true - }, - "group": "parent", - "position": "before" - }, - { - "pattern": "../", - "patternOptions": { - "nocomment": true, - "dot": true - }, - "group": "parent", - "position": "before" - } - ] - } - ], - "indent": "off", - "jest/no-focused-tests": "error", - "jsdoc/check-alignment": "error", - "jsdoc/check-indentation": "off", - "jsdoc/newline-after-description": "off", - "jsdoc/no-types": "error", - "jsx-a11y/alt-text": "error", - "jsx-a11y/anchor-is-valid": "error", - "jsx-a11y/aria-props": "error", - "jsx-a11y/aria-proptypes": "error", - "jsx-a11y/aria-role": "error", - "jsx-a11y/lang": "error", - "jsx-a11y/no-static-element-interactions": "error", - "jsx-a11y/role-has-required-aria-props": "error", - "jsx-a11y/role-supports-aria-props": "error", - "jsx-a11y/tabindex-no-positive": "error", - "linebreak-style": "error", - "lodash/chaining": [ - "error", - "never" - ], - "max-classes-per-file": [ - "off", - 3 - ], - "max-len": [ - "error", - { - "code": 160 - } - ], - "max-lines": "off", - "max-statements": [ - "error", - 100 - ], - "new-parens": "error", - "newline-per-chained-call": "off", - "no-array-constructor": "off", - "no-bitwise": "error", - "no-caller": "error", - "no-cond-assign": "error", - "no-console": [ - "error", - { - "allow": [ - "warn", - "dir", - "timeLog", - "assert", - "clear", - "count", - "countReset", - "group", - "groupEnd", - "table", - "dirxml", - "groupCollapsed", - "Console", - "profile", - "profileEnd", - "timeStamp", - "context" - ] - } - ], - "no-constant-condition": "error", - "no-control-regex": "error", - "no-debugger": "error", - "no-duplicate-case": "error", - "no-duplicate-imports": "error", - "no-empty": "error", - "no-empty-function": "off", - "no-eval": "error", - "no-extra-semi": "error", - "no-fallthrough": "error", - "no-invalid-regexp": "error", - "no-invalid-this": "error", - "no-irregular-whitespace": "error", - "no-magic-numbers": "off", - "no-multi-str": "off", - "no-multiple-empty-lines": "error", - "no-new-wrappers": "off", - "no-null/no-null": "off", - "no-octal": "error", - "no-octal-escape": "error", - "no-param-reassign": "error", - "no-redeclare": "off", - "no-regex-spaces": "error", - "no-restricted-imports": "off", - "no-restricted-syntax": [ - "error", - { - "message": "Forbidden call to document.cookie", - "selector": "MemberExpression[object.name=\"document\"][property.name=\"cookie\"]" - } - ], - "no-return-await": "error", - "no-sequences": "error", - "no-shadow": "off", - "no-sparse-arrays": "error", - "no-template-curly-in-string": "error", - "no-throw-literal": "error", - "no-trailing-spaces": "error", - "no-undef-init": "error", - "no-underscore-dangle": "error", - "no-unsafe-finally": "error", - "no-unused-expressions": "error", - "no-unused-labels": "error", - "no-use-before-define": "off", - "no-var": "error", - "no-void": "off", - "no-warning-comments": [ - "error", - { - "location": "anywhere", - "terms": [ - "BUG", - "HACK", - "FIXME", - "LATER", - "LATER2", - "TODO" - ] - } - ], - "no-with": "error", - "object-shorthand": "off", - "one-var": [ - "error", - "never" - ], - "padded-blocks": [ - "off", - { - "blocks": "never" - }, - { - "allowSingleLineBlocks": true - } - ], - "padding-line-between-statements": [ - "off", - { - "blankLine": "always", - "prev": "*", - "next": "return" - } - ], - "prefer-arrow/prefer-arrow-functions": [ - "off", - {} - ], - "prefer-const": "error", - "prefer-object-spread": "error", - "prefer-template": "error", - "quote-props": [ - "error", - "as-needed" - ], - "quotes": "off", - "radix": "error", - "react/jsx-curly-spacing": [ - "off", - {} - ], - "react/no-danger": "error", - "security/detect-non-literal-fs-filename": "error", - "security/detect-non-literal-require": "error", - "security/detect-possible-timing-attacks": "error", - "semi": "off", - "space-before-function-paren": "off", - "space-in-parens": [ - "error", - "never" - ], - "unicorn/filename-case": "off", - "unicorn/prefer-switch": "off", - "unicorn/prefer-ternary": "off", - "use-isnan": "error", - "valid-typeof": "off", - "yoda": "error", - "@typescript-eslint/tslint/config": [ - "error", - { - "rules": { - "completed-docs": [ - false, - "classes" - ], - "encoding": true, - "import-spacing": true, - "no-unnecessary-callback-wrapper": true, - "no-unsafe-any": false, - "number-literal-format": true, - "prefer-method-signature": true, - "prefer-while": true, - "switch-final-break": true, - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - "check-separator", - "check-type" - ] - } - } - ] - } -}; diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 7a6ad93..908cced 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,4 +1,4 @@ # CODEOWNERS info: https://help.github.com/en/articles/about-code-owners # Owners are automatically requested for review for PRs that changes code # that they own. -* @dgraph-io/committers +* @hypermodeinc/database \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..5f95c28 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve +title: "" +labels: bug +assignees: "" +--- + +## Describe the bug + +A clear and concise description of what the bug is. + +## To Reproduce + +Steps to reproduce the behavior: + +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +## Expected behavior + +A clear and concise description of what you expected to happen. + +## Screenshots + +If applicable, add screenshots to help explain your problem. + +## Environment + +- OS: [e.g. macOS, Windows, Ubuntu] +- Language [e.g. AssemblyScript, Go] +- Version [e.g. v0.xx] + +## Additional context + +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..29ea9f2 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: Dgraph Community Support + url: https://discord.hypermode.com + about: Please ask and answer questions here diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..9a4aae5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,23 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: "" +labels: "" +assignees: "" +--- + +## Is your feature request related to a problem? Please describe + +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +## Describe the solution you'd like + +A clear and concise description of what you want to happen. + +## Describe alternatives you've considered + +A clear and concise description of any alternative solutions or features you've considered. + +## Additional context + +Add any other context or screenshots about the feature request here. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..e8c683f --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,26 @@ +**Description** + +Please explain the changes you made here. + +**Checklist** + +- [ ] Code compiles correctly and linting passes locally +- [ ] For all _code_ changes, an entry added to the `CHANGELOG.md` file describing and linking to + this PR +- [ ] Tests added for new functionality, or regression tests for bug fixes added as applicable +- [ ] For public APIs, new features, etc., PR on + [docs repo](https://github.com/dgraph-io/dgraph-docs) staged and linked here + +**Instructions** + +- The PR title should follow the [Conventional Commits](https://www.conventionalcommits.org/) + syntax, leading with `fix:`, `feat:`, `chore:`, `ci:`, etc. +- The description should briefly explain what the PR is about. In the case of a bugfix, describe or + link to the bug. +- In the checklist section, check the boxes in that are applicable, using `[x]` syntax. + - If not applicable, remove the entire line. Only leave the box unchecked if you intend to come + back and check the box later. +- Delete the `Instructions` line and everything below it, to indicate you have read and are + following these instructions. 🙂 + +Thank you for your contribution to Dgraph! diff --git a/.github/actionlint.yml b/.github/actionlint.yml new file mode 100644 index 0000000..386539f --- /dev/null +++ b/.github/actionlint.yml @@ -0,0 +1,5 @@ +self-hosted-runner: + # Labels of self-hosted runner in array of string + labels: + - warp-ubuntu-latest-x64-2x + - warp-ubuntu-latest-x64-16x diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 41e7188..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,35 +0,0 @@ -# To get started with Dependabot version updates, you'll need to specify which -# package ecosystems to update and where the package manifests are located. -# Please see the documentation for all configuration options: -# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file - -version: 2 -updates: - - package-ecosystem: "npm" - directory: "/" # Location of package manifests - schedule: - interval: "weekly" - day: wednesday - time: "16:00" - versioning-strategy: increase - rebase-strategy: "disabled" - groups: - minor-and-patch: - applies-to: version-updates - update-types: - - "minor" - - "patch" - - - package-ecosystem: "github-actions" - # Workflow files stored in the default location of `.github/workflows`. (You don't need to specify `/.github/workflows` for `directory`. You can use `directory: "/"`.) - directory: "/" - schedule: - interval: "weekly" - day: wednesday - time: "16:00" - groups: - actions: - update-types: - - "patch" - - "minor" - - "major" diff --git a/renovate.json b/.github/renovate.json similarity index 53% rename from renovate.json rename to .github/renovate.json index fa2889a..88015f6 100644 --- a/renovate.json +++ b/.github/renovate.json @@ -1,6 +1,4 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": [ - "local>hypermodeinc/renovate-config" - ] + "extends": ["local>hypermodeinc/renovate-config"] } diff --git a/.github/workflows/cd-dgraph-js.yml b/.github/workflows/cd-dgraph-js.yml index a10f564..b0760d3 100644 --- a/.github/workflows/cd-dgraph-js.yml +++ b/.github/workflows/cd-dgraph-js.yml @@ -1,74 +1,78 @@ name: cd-dgraph-js + on: workflow_dispatch: inputs: releasetag: - description: "git tag to checkout and version to publish to npm" + description: git tag to checkout and version to publish to npm required: true type: string releasetype: - description: "specify how to tag release on npm" + description: specify how to tag release on npm required: true type: choice options: - latest - rc - beta + +permissions: + contents: read + jobs: dgraph-js-tests: runs-on: warp-ubuntu-latest-x64-16x strategy: fail-fast: true matrix: - node-version: [18.x, 19.x, 20.x, 21.x, 22.x] + node-version: [18.x, 20.x, 22.x, 23.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: - - name: Checkout dgraph-js repo - uses: actions/checkout@v4 - with: - path: dgraph-js - repository: dgraph-io/dgraph-js - ref: ${{ github.event.inputs.releasetag }} - - name: Checkout dgraph repo - uses: actions/checkout@v4 - with: - path: dgraph - repository: dgraph-io/dgraph - ref: main - - name: Set up Go + - name: Checkout dgraph-js repo + uses: actions/checkout@v4 + with: + path: dgraph-js + repository: hypermodeinc/dgraph-js + ref: ${{ github.event.inputs.releasetag }} + - name: Checkout dgraph repo + uses: actions/checkout@v4 + with: + path: dgraph + repository: hypermodeinc/dgraph + ref: main + - name: Set up Go uses: actions/setup-go@v5 with: go-version-file: go.mod - - name: Build dgraph binary - run: cd dgraph && make docker-image # also builds dgraph binary - - name: Move dgraph binary to gopath - run: cd dgraph && mv dgraph/dgraph ~/go/bin/dgraph - - name: Setup node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - cache-dependency-path: dgraph-js/package-lock.json - - name: Run dgraph-js tests - working-directory: dgraph-js - run: | - npm ci --legacy-peer-deps - bash scripts/run-tests.sh + - name: Build dgraph binary + run: cd dgraph && make docker-image # also builds dgraph binary + - name: Move dgraph binary to gopath + run: cd dgraph && mv dgraph/dgraph ~/go/bin/dgraph + - name: Setup node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: npm + cache-dependency-path: dgraph-js/package-lock.json + - name: Run dgraph-js tests + working-directory: dgraph-js + run: | + npm ci --legacy-peer-deps + bash scripts/run-tests.sh dgraph-js-publish-npm: needs: [dgraph-js-tests] - runs-on: warp-ubuntu-latest-x64-2x + runs-on: ubuntu-latest steps: - name: Checkout dgraph-js repo uses: actions/checkout@v4 - name: Setup node.js uses: actions/setup-node@v4 with: - node-version: '20.x' - registry-url: 'https://registry.npmjs.org' + node-version: 20.x + registry-url: https://registry.npmjs.org - name: Build dgraph-js package - run: npm ci --legacy-peer-deps + run: npm ci - run: npm publish --tag '${{ github.event.inputs.releasetype }}' env: NODE_AUTH_TOKEN: ${{ secrets.NPM_DGRAPH_JS_TOKEN }} - diff --git a/.github/workflows/ci-aqua-security-trivy-tests.yml b/.github/workflows/ci-aqua-security-trivy-tests.yml deleted file mode 100644 index 4768b02..0000000 --- a/.github/workflows/ci-aqua-security-trivy-tests.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: ci-aqua-security-trivy-tests -on: - push: - branches: - - main - pull_request: - types: - - opened - - reopened - - synchronize - - ready_for_review - branches: - - main - schedule: - - cron: "0 2 * * *" - -permissions: - security-events: write - -jobs: - build: - name: trivy-tests - runs-on: warp-ubuntu-latest-x64-2x - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Run Trivy vulnerability scanner - uses: aquasecurity/trivy-action@master - with: - scan-type: 'fs' - scan-ref: '.' - format: 'sarif' - output: 'trivy-results.sarif' - - name: Upload Trivy scan results to GitHub Security tab - uses: github/codeql-action/upload-sarif@v3 - with: - sarif_file: 'trivy-results.sarif' diff --git a/.github/workflows/ci-dgraph-js.yml b/.github/workflows/ci-dgraph-js.yml index afda900..06f772b 100644 --- a/.github/workflows/ci-dgraph-js.yml +++ b/.github/workflows/ci-dgraph-js.yml @@ -1,50 +1,55 @@ -name: ci-dgraph-js-tests -on: - pull_request: - types: - - opened - - reopened - - synchronize - - ready_for_review - branches: - - main -jobs: - dgraph-js-tests: - runs-on: warp-ubuntu-latest-x64-16x - strategy: - fail-fast: false - matrix: - node-version: [18.x, 19.x, 20.x, 21.x, 22.x] - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - steps: - - name: Checkout dgraph-js repo - uses: actions/checkout@v4 - with: - path: dgraph-js - repository: dgraph-io/dgraph-js - ref: ${{ github.ref }} - - name: Checkout dgraph repo - uses: actions/checkout@v4 - with: - path: dgraph - repository: dgraph-io/dgraph - ref: main - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version-file: go.mod - - name: Build dgraph binary - run: cd dgraph && make docker-image # also builds dgraph binary - - name: Move dgraph binary to gopath - run: cd dgraph && mv dgraph/dgraph ~/go/bin/dgraph - - name: Setup node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - cache-dependency-path: dgraph-js/package-lock.json - - name: Run dgraph-js tests - working-directory: dgraph-js - run: | - npm ci --legacy-peer-deps - bash scripts/run-tests.sh +name: ci-dgraph-js-tests + +on: + pull_request: + types: + - opened + - reopened + - synchronize + - ready_for_review + branches: + - main + +permissions: + contents: read + +jobs: + dgraph-js-tests: + runs-on: warp-ubuntu-latest-x64-16x + strategy: + fail-fast: false + matrix: + node-version: [18.x, 20.x, 22.x, 23.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + steps: + - name: Checkout dgraph-js repo + uses: actions/checkout@v4 + with: + path: dgraph-js + repository: hypermodeinc/dgraph-js + ref: ${{ github.ref }} + - name: Checkout dgraph repo + uses: actions/checkout@v4 + with: + path: dgraph + repository: hypermodeinc/dgraph + ref: main + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: dgraph/go.mod + - name: Build dgraph binary + run: cd dgraph && make docker-image # also builds dgraph binary + - name: Move dgraph binary to gopath + run: cd dgraph && mv dgraph/dgraph ~/go/bin/dgraph + - name: Setup node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: npm + cache-dependency-path: dgraph-js/package-lock.json + - name: Run dgraph-js tests + working-directory: dgraph-js + run: | + npm ci + bash scripts/run-tests.sh diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml deleted file mode 100644 index 7757f77..0000000 --- a/.github/workflows/stale.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: 'Close stale issues and PRs' -on: - schedule: - - cron: '30 1 * * *' - -permissions: - issues: write - pull-requests: write - actions: write - -jobs: - stale: - runs-on: ubuntu-latest - steps: - - uses: actions/stale@v9 - with: - stale-issue-message: 'This issue has been stale for 60 days and will be closed automatically in 7 days. Comment to keep it open.' - stale-pr-message: 'This PR has been stale for 60 days and will be closed automatically in 7 days. Comment to keep it open.' diff --git a/.trunk/.gitignore b/.trunk/.gitignore new file mode 100644 index 0000000..15966d0 --- /dev/null +++ b/.trunk/.gitignore @@ -0,0 +1,9 @@ +*out +*logs +*actions +*notifications +*tools +plugins +user_trunk.yaml +user.yaml +tmp diff --git a/.trunk/configs/.checkov.yaml b/.trunk/configs/.checkov.yaml new file mode 100644 index 0000000..521b240 --- /dev/null +++ b/.trunk/configs/.checkov.yaml @@ -0,0 +1,2 @@ +skip-check: + - CKV_GHA_7 diff --git a/.trunk/configs/.markdownlint.json b/.trunk/configs/.markdownlint.json new file mode 100644 index 0000000..449148d --- /dev/null +++ b/.trunk/configs/.markdownlint.json @@ -0,0 +1,8 @@ +{ + "line-length": { "line_length": 150, "tables": false }, + "no-inline-html": false, + "no-bare-urls": false, + "no-space-in-emphasis": false, + "no-emphasis-as-heading": false, + "first-line-heading": false +} diff --git a/.trunk/configs/.prettierrc b/.trunk/configs/.prettierrc new file mode 100644 index 0000000..577642c --- /dev/null +++ b/.trunk/configs/.prettierrc @@ -0,0 +1,5 @@ +{ + "semi": false, + "proseWrap": "always", + "printWidth": 100 +} diff --git a/.trunk/configs/.shellcheckrc b/.trunk/configs/.shellcheckrc new file mode 100644 index 0000000..8c7b1ad --- /dev/null +++ b/.trunk/configs/.shellcheckrc @@ -0,0 +1,7 @@ +enable=all +source-path=SCRIPTDIR +disable=SC2154 + +# If you're having issues with shellcheck following source, disable the errors via: +# disable=SC1090 +# disable=SC1091 diff --git a/.trunk/configs/.yamllint.yaml b/.trunk/configs/.yamllint.yaml new file mode 100644 index 0000000..184e251 --- /dev/null +++ b/.trunk/configs/.yamllint.yaml @@ -0,0 +1,7 @@ +rules: + quoted-strings: + required: only-when-needed + extra-allowed: ["{|}"] + key-duplicates: {} + octal-values: + forbid-implicit-octal: true diff --git a/.trunk/configs/eslint.config.js b/.trunk/configs/eslint.config.js new file mode 100644 index 0000000..fd4e36e --- /dev/null +++ b/.trunk/configs/eslint.config.js @@ -0,0 +1,10 @@ +import eslint from "@eslint/js" +import tseslint from "typescript-eslint" + +export default tseslint.config({ + files: ["**/*.ts"], + extends: [eslint.configs.recommended, ...tseslint.configs.strict], + rules: { + "@typescript-eslint/no-explicit-any": "off", + }, +}) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml new file mode 100644 index 0000000..832966d --- /dev/null +++ b/.trunk/trunk.yaml @@ -0,0 +1,39 @@ +# This file controls the behavior of Trunk: https://docs.trunk.io/cli +# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml +version: 0.1 +cli: + version: 1.22.9 +# Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins) +plugins: + sources: + - id: trunk + ref: v1.6.6 + uri: https://github.com/trunk-io/plugins +# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes) +runtimes: + enabled: + - go@1.21.0 + - node@18.20.5 + - python@3.10.8 +# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration) +lint: + disabled: + enabled: + - eslint@9.18.0 + - actionlint@1.7.6 + - checkov@3.2.353 + - git-diff-check + - markdownlint@0.43.0 + - osv-scanner@1.9.2 + - prettier@3.4.2 + - renovate@39.109.0 + - shellcheck@0.10.0 + - shfmt@3.6.0 + - trufflehog@3.88.2 + - yamllint@1.35.1 +actions: + enabled: + - trunk-announce + - trunk-check-pre-push + - trunk-fmt-pre-commit + - trunk-upgrade-available diff --git a/CHANGELOG.md b/CHANGELOG.md index 043e392..995f1d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,43 +2,44 @@ All notable changes to this project will be documented in this file. -The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.1.0/), -and this project adheres to [Calendar Versioning](https://calver.org/) starting v20.03.0. - +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.1.0/), and this project +adheres to [Calendar Versioning](https://calver.org/) starting v20.03.0. ## [24.1.0] - 2024-11-13 -### Changed - -* Bump the minor-and-patch group with 4 updates (#234 #232 #230 #229 #227 #228 #234 #226 #223 #225 #222 #221 #220 #218 #217) -* Remove `grpc` dependency (#233) -* fix euclidean spelling (#224) -* update examples (#219) +**Changed** +- Bump the minor-and-patch group with 4 updates (#234 #232 #230 #229 #227 #228 #234 #226 #223 #225 + #222 #221 #220 #218 #217) +- Remove `grpc` dependency (#233) +- fix euclidean spelling (#224) +- update examples (#219) ## [24.0.0] - 2024-08-22 -### Added +**Added** -* feat: Add Vector Support. ([#214]) +- feat: Add Vector Support. ([#214]) -### Security +**Security** Version bump. ## [21.03.1] - 2021-05-19 -### Added -* fix(deprecation): add clientStubFromCloudEndpoint method ([#138]) -[#138]: https://github.com/dgraph-io/dgraph-js/pull/138 +**Added** + +- fix(deprecation): add clientStubFromCloudEndpoint method ([#138]) + +[#138]: https://github.com/hypermodeinc/dgraph-js/pull/138 ## [v21.03.0] - 2021-04-08 -### Added +**Added** - LoginIntoNamespace API -### Removed +**Removed** - Nquad does not have `label` @@ -46,177 +47,191 @@ The `clientStubFromSlashGraphQLEndpoint` API is deprecated and will be removed i ## [v20.11] - 2021-03-16 -### Added +**Added** - Add support for RDF response ([#129]) -### Changed +**Changed** - Bumped gRPC libs ## [v20.03.1] - 2020-10-04 -### Added +**Added** - Extend support to connect to dgraph client via Slash endpoints and apiKey ([#125]) -### Changed +**Changed** - Migrate from `grpc` npm module to `grpc-js` in lieu of the deprecation of the former. ## [v20.03.0] - 2020-04-01 -### Changed +**Changed** - Synced proto files to latest version to support background indexing ([#110][]) -[#110]: https://github.com/dgraph-io/dgraph-js/issues/110 +[#110]: https://github.com/hypermodeinc/dgraph-js/issues/110 ## [v2.1.0] - 2020-01-30 -### Fixed +**Fixed** - Resolved JSON parse issue of Payload response. Fixes [#43][] ([#94][]) - Updating ACL tests to sync up changes with Dgraph v1.2 ([#103][]) -### Added +**Added** - Adding tests for upsert with graphql variables ([#101][]) -### Changed +**Changed** - Synced proto files to the latest version ([#99][]) -[#43]: https://github.com/dgraph-io/dgraph-js/issues/43 -[#94]: https://github.com/dgraph-io/dgraph-js/issues/94 -[#103]: https://github.com/dgraph-io/dgraph-js/issues/103 -[#101]: https://github.com/dgraph-io/dgraph-js/issues/101 -[#99]: https://github.com/dgraph-io/dgraph-js/issues/99 +[#43]: https://github.com/hypermodeinc/dgraph-js/issues/43 +[#94]: https://github.com/hypermodeinc/dgraph-js/issues/94 +[#103]: https://github.com/hypermodeinc/dgraph-js/issues/103 +[#101]: https://github.com/hypermodeinc/dgraph-js/issues/101 +[#99]: https://github.com/hypermodeinc/dgraph-js/issues/99 ## [v2.0.2] - 2019-10-01 -### Changed +**Changed** + - Upgrade google-protobuf dependency version to 3.8.0+ ([#80][]) -### Fixed -- Added logic to catch exceptions when `dgraphClient` fails to be created - due to invalid gRPC address ([#71][]) +**Fixed** + +- Added logic to catch exceptions when `dgraphClient` fails to be created due to invalid gRPC + address ([#71][]) -[#80]: https://github.com/dgraph-io/dgraph-js/issues/80 -[#71]: https://github.com/dgraph-io/dgraph-js/issues/71 +[#80]: https://github.com/hypermodeinc/dgraph-js/issues/80 +[#71]: https://github.com/hypermodeinc/dgraph-js/issues/71 ## [v2.0.1] - 2019-09-10 -### Fixed +**Fixed** + - Added function to refresh JWT token if expired ([#56][]) -[#56]: https://github.com/dgraph-io/dgraph-js/issues/56 +[#56]: https://github.com/hypermodeinc/dgraph-js/issues/56 ## [v2.0.0] - 2019-09-06 -### Added +**Added** + - `doRequest` function for performing upsert, or just a query or a mutation - Support for ACL features in Dgraph v1.1 - login & jwt refresh - `upsert` and `lang` fields to proto message type SchemaNode - Option for server-side sequencing -### Changed +**Changed** + - Return type of `Txn#mutate` function from `messages.Assigned` to `messages.Response` - Updated protobufs to the latest version - Upgraded all typescript dev libraries to the latest version -### Removed +**Removed** + - Support for null values where appropriate (because of typescript warning) ## [v1.2.1] - 2018-03-16 -### Fixed +**Fixed** + - Pass `metadata` and `options` arguments to `Txn#discard` in `Txn#mutate` ## [v1.2.0] - 2018-03-12 -### Added -- **[BREAKING]** Optional `metadata` parameter of type `grpc.Metadata` to the - `DgraphClientStub` methods. `options` parameter moved to the third position - to conform to the `grpc` package API. +**Added** - Methods affected - `DgraphClient#alter`, `Txn#query`, `Txn#queryWithVars`, - `Txn#mutate`, `Txn#commit` and `Txn#discard`. +- **[BREAKING]** Optional `metadata` parameter of type `grpc.Metadata` to the `DgraphClientStub` + methods. `options` parameter moved to the third position to conform to the `grpc` package API. - To upgrade to this version, if using any of these methods with the `options` - parameter, simply add a `null` argument before the `options` argument. For - example, `client.alter(options)` becomes `client.alter(null, options)` + Methods affected - `DgraphClient#alter`, `Txn#query`, `Txn#queryWithVars`, `Txn#mutate`, + `Txn#commit` and `Txn#discard`. + + To upgrade to this version, if using any of these methods with the `options` parameter, simply add + a `null` argument before the `options` argument. For example, `client.alter(options)` becomes + `client.alter(null, options)` ## [v1.1.2] - 2018-03-07 -### Added +**Added** + - Full compatibility with Dgraph v1.0.4 - `latency` field to proto message type `Assigned` ## [v1.1.1] - 2018-02-13 -### Added +**Added** + - Compatibility with grpc v1.9 -### Fixed -- Function `u8ToStr` which was leading to json parse errors - ([#17][]) +**Fixed** -[#17]: https://github.com/dgraph-io/dgraph-js/issues/17 +- Function `u8ToStr` which was leading to json parse errors ([#17][]) + +[#17]: https://github.com/hypermodeinc/dgraph-js/issues/17 ## [v1.1.0] - 2018-02-06 -### Added +**Added** + - Full compatibility with Dgraph v1.0.2 -### Removed +**Removed** + - `startTs` field from proto message type `Operation` ## [v1.0.4] - 2018-02-02 -### Added +**Added** + - Optional `options` parameter of type `object` to the `DgraphClientStub` constructor -- Optional `options` parameter of type `grpc.CallOptions` to the `DgraphClientStub` - methods +- Optional `options` parameter of type `grpc.CallOptions` to the `DgraphClientStub` methods - Export `Txn` class ## [v1.0.3] - 2018-01-26 -### Changed +**Changed** + - `grpc` is now a peer dependency ## [v1.0.2] - 2018-01-24 -### Added +**Added** + - Method `DgraphClientStub#close` to close the grpc client associated with `DgraphClientStub` -- Method `DgraphClientStub#grpcClient` to return the grpc client associated with - `DgraphClientStub` +- Method `DgraphClientStub#grpcClient` to return the grpc client associated with `DgraphClientStub` - Method `DgraphClientStub#waitForReady` to provide a promisified version of `grpc.Client#waitForReady` ## [v1.0.1] - 2018-01-20 -### Added +**Added** + - Wrapper classes for certain proto classes to simplify the api and avoid repetitive serialization/deserialization code ## [v1.0.0] - 2017-12-20 -### Added +**Added** + - Full compatibility with Dgraph v1.0.0 -[v20.03.0]: https://github.com/dgraph-io/dgraph-js/compare/v2.1.0...v20.03.0 -[v2.1.0]: https://github.com/dgraph-io/dgraph-js/compare/v2.0.2...v2.1.0 -[v2.0.2]: https://github.com/dgraph-io/dgraph-js/compare/v2.0.1...v2.0.2 -[v2.0.1]: https://github.com/dgraph-io/dgraph-js/compare/v2.0.0...v2.0.1 -[v2.0.0]: https://github.com/dgraph-io/dgraph-js/compare/v1.2.1...v2.0.0 -[v1.2.1]: https://github.com/dgraph-io/dgraph-js/compare/v1.2.0...v1.2.1 -[v1.2.0]: https://github.com/dgraph-io/dgraph-js/compare/v1.1.2...v1.2.0 -[v1.1.2]: https://github.com/dgraph-io/dgraph-js/compare/v1.1.1...v1.1.2 -[v1.1.1]: https://github.com/dgraph-io/dgraph-js/compare/v1.1.0...v1.1.1 -[v1.1.0]: https://github.com/dgraph-io/dgraph-js/compare/v1.0.4...v1.1.0 -[v1.0.4]: https://github.com/dgraph-io/dgraph-js/compare/v1.0.3...v1.0.4 -[v1.0.3]: https://github.com/dgraph-io/dgraph-js/compare/v1.0.2...v1.0.3 -[v1.0.2]: https://github.com/dgraph-io/dgraph-js/compare/v1.0.1...v1.0.2 -[v1.0.1]: https://github.com/dgraph-io/dgraph-js/compare/v1.0.0...v1.0.1 -[v1.0.0]: https://github.com/dgraph-io/dgraph-js/tree/v1.0.0 +[v20.03.0]: https://github.com/hypermodeinc/dgraph-js/compare/v2.1.0...v20.03.0 +[v2.1.0]: https://github.com/hypermodeinc/dgraph-js/compare/v2.0.2...v2.1.0 +[v2.0.2]: https://github.com/hypermodeinc/dgraph-js/compare/v2.0.1...v2.0.2 +[v2.0.1]: https://github.com/hypermodeinc/dgraph-js/compare/v2.0.0...v2.0.1 +[v2.0.0]: https://github.com/hypermodeinc/dgraph-js/compare/v1.2.1...v2.0.0 +[v1.2.1]: https://github.com/hypermodeinc/dgraph-js/compare/v1.2.0...v1.2.1 +[v1.2.0]: https://github.com/hypermodeinc/dgraph-js/compare/v1.1.2...v1.2.0 +[v1.1.2]: https://github.com/hypermodeinc/dgraph-js/compare/v1.1.1...v1.1.2 +[v1.1.1]: https://github.com/hypermodeinc/dgraph-js/compare/v1.1.0...v1.1.1 +[v1.1.0]: https://github.com/hypermodeinc/dgraph-js/compare/v1.0.4...v1.1.0 +[v1.0.4]: https://github.com/hypermodeinc/dgraph-js/compare/v1.0.3...v1.0.4 +[v1.0.3]: https://github.com/hypermodeinc/dgraph-js/compare/v1.0.2...v1.0.3 +[v1.0.2]: https://github.com/hypermodeinc/dgraph-js/compare/v1.0.1...v1.0.2 +[v1.0.1]: https://github.com/hypermodeinc/dgraph-js/compare/v1.0.0...v1.0.1 +[v1.0.0]: https://github.com/hypermodeinc/dgraph-js/tree/v1.0.0 diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..614af54 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,113 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our community a +harassment-free experience for everyone, regardless of age, body size, visible or invisible +disability, ethnicity, sex characteristics, gender identity and expression, level of experience, +education, socio-economic status, nationality, personal appearance, race, religion, or sexual +identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and +healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our community include: + +- Demonstrating empathy and kindness toward other people +- Being respectful of differing opinions, viewpoints, and experiences +- Giving and gracefully accepting constructive feedback +- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the + experience +- Focusing on what is best not just for us as individuals, but for the overall community + +Examples of unacceptable behavior include: + +- The use of sexualized language or imagery, and sexual attention or advances of any kind +- Trolling, insulting or derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or email address, without their + explicit permission +- Other conduct which could reasonably be considered inappropriate in a professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior +and will take appropriate and fair corrective action in response to any behavior that they deem +inappropriate, threatening, offensive, or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject comments, commits, +code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and +will communicate reasons for moderation decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when an individual is +officially representing the community in public spaces. Examples of representing our community +include using an official e-mail address, posting via an official social media account, or acting as +an appointed representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community +leaders responsible for enforcement at hello@hypermode.com. All complaints will be reviewed and +investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the reporter of any +incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining the consequences for +any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or +unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing clarity around the +nature of the violation and an explanation of why the behavior was inappropriate. A public apology +may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of actions. + +**Consequence**: A warning with consequences for continued behavior. No interaction with the people +involved, including unsolicited interaction with those enforcing the Code of Conduct, for a +specified period of time. This includes avoiding interactions in community spaces as well as +external channels like social media. Violating these terms may lead to a temporary or permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including sustained inappropriate +behavior. + +**Consequence**: A temporary ban from any sort of interaction or public communication with the +community for a specified period of time. No public or private interaction with the people involved, +including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this +period. Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community standards, including +sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement +of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at +https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. + +Community Impact Guidelines were inspired by +[Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see the FAQ at +https://www.contributor-covenant.org/faq. Translations are available at +https://www.contributor-covenant.org/translations. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..31bc239 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,253 @@ +# Contributing to Dgraph + +- [Getting Started](#getting-started) +- [Setting Up the Development Environment](#setting-up-the-development-environment) + - [Prerequisites](#prerequisites) + - [Setup Dgraph from source repo](#setup-dgraph-from-source-repo) + - [Setup Badger from source repo](#setup-badger-from-source-repo) + - [Protocol buffers](#protocol-buffers) + - [Build Dgraph](#build-dgraph) + - [Build Docker Image](#build-docker-image) + - [Testing](#testing) +- [Contributing](#contributing) + - [Guidelines](#guidelines) + - [Code style](#code-style) + - [License Header](#license-header) + - [Signed Commits](#signed-commits) + +## Getting Started + +- Read the [Getting Started Guide](https://dgraph.io/docs/get-started/) +- [Take the Dgraph tour](https://dgraph.io/tour/) + +## Setting Up the Development Environment + +### Prerequisites + +- Install [Git](https://git-scm.com/) (may be already installed on your system, or available through + your OS package manager) +- Install [Make](https://www.gnu.org/software/make/) (may be already installed on your system, or + available through your OS package manager) +- Install [Docker](https://docs.docker.com/install/) and + [Docker Compose](https://docs.docker.com/compose/install/). +- [Install Go 1.13 or above](https://golang.org/doc/install). + +### Setup Dgraph from source repo + +It's best to put the Dgraph repo somewhere in `$GOPATH`. + +```bash +mkdir -p "$(go env GOPATH)/src/github.com/hypermodeinc" +cd "$(go env GOPATH)/src/github.com/hypermodeinc" +git clone https://github.com/hypermodeinc/dgraph.git +cd ./dgraph +make install +``` + +This will put the source code in a Git repo under `$GOPATH/src/github.com/hypermodeinc/dgraph` and +compile the binaries to `$GOPATH/bin`. + +### Setup Badger from source repo + +Dgraph source repo vendors its own version of Badger. If you are just working on Dgraph, you do not +necessarily need to check out Badger from its own repo. However, if you want to contribute to Badger +as well, you will need to check it out from its own repo. + +```bash +go get -t -v github.com/dgraph-io/badger +``` + +This will put the source code in a Git repo under `$GOPATH/src/github.com/dgraph-io/badger`. + +### Protocol buffers + +We use [protocol buffers](https://developers.google.com/protocol-buffers/) to serialize data between +our server and the Go client and also for inter-worker communication. If you make any changes to the +`.proto` files, you would have to recompile them. + +Install the `protoc` compiler which is required for compiling proto files used for gRPC +communication. Get `protoc` version 3.0.0 or above from +[GitHub releases page](https://github.com/google/protobuf/releases/latest) (look for the binary +releases at the bottom, or compile from sources +[following the instructions](https://github.com/google/protobuf/tree/main/src)). + +We use [gogo protobuf](https://github.com/gogo/protobuf) in Dgraph. To get the protocol buffer +compiler plugin from gogo run + +```bash +go get -u github.com/gogo/protobuf/protoc-gen-gofast +``` + +To compile the proto file using the `protoc` plugin and the gogo compiler plugin run the command +`make regenerate` from within the directory containing the `.proto` files. + +```bash +cd protos +make regenerate +``` + +This should generate the required `.pb.go` file. + +### Build Dgraph + +You can build Dgraph using `make dgraph` or `make install` which add the version information to the +binary. + +- `make dgraph`: Creates a `dgraph` binary at `./dgraph/dgraph` +- `make install`: Creates a `dgraph` binary at `$GOPATH/bin/dgraph`. You can add `$GOPATH/bin` to + your `$PATH`. + +```text +$ make install +$ dgraph version +[Decoder]: Using assembly version of decoder + +Dgraph version : v1.1.1 +Dgraph SHA-256 : 97326c9328aff93851290b12d846da81a7da5b843e97d7c63f5d79091b9063c1 +Commit SHA-1 : 8994a57 +Commit timestamp : 2019-12-16 18:24:50 -0800 +Branch : HEAD +Go version : go1.13.5 + +For Dgraph official documentation, visit https://dgraph.io/docs/. +For discussions about Dgraph , visit https://discuss.dgraph.io. + +Licensed variously under the Apache Public License 2.0 and Dgraph Community License. +Copyright 2015-2025 Hypermode Inc. +``` + +### Build Docker Image + +```sh +make image +``` + +To build a test Docker image from source, use `make image`. This builds a Dgraph binary using +`make dgraph` and creates a Docker image named `dgraph/dgraph` tagged as the current branch name. +The image only contains the `dgraph` binary. + +Example: + +```bash +$ git rev-parse --abbrev-ref HEAD # current branch +main +$ make image +Successfully built c74d564d911f +Successfully tagged dgraph/dgraph:main +$ $ docker run --rm -it dgraph/dgraph:main dgraph version +[Decoder]: Using assembly version of decoder + +Dgraph version : v1.1.1-1-g5fa139a0e +Dgraph SHA-256 : 31f8c9324eb90a6f4659066937fcebc67bbca251c20b9da0461c2fd148187689 +Commit SHA-1 : 5fa139a0e +Commit timestamp : 2019-12-16 20:52:06 -0800 +Branch : main +Go version : go1.13.5 + +For Dgraph official documentation, visit https://dgraph.io/docs/. +For discussions about Dgraph , visit https://discuss.dgraph.io. + +Licensed variously under the Apache Public License 2.0 and Dgraph Community License. +Copyright 2015-2025 Hypermode Inc. +``` + +### Testing + +#### Dgraph + +1. Change directory to t directory. +2. If all packages need to be tested, run make test If only a specific package needs to be tested, + run make test args="--pkg=desired_package_name" + + example 1: make test args="--pkg=tok" example 2: make test args="--pkg=tlstest/acl" + + The first example will run all the tests in the 'tok' directory (if there are any) The second one + will run all the test in the acl subfolder of the tlstest directory. Note: running make test + args="--pkg=tlstest" will return an error saying no packages found because all the tests in the + tlstest package are in subdirectories of the package. So the subdirectories must be specified as + shown in example 2. + +Tests should be written in Go and use the Dgraph cluster set up in `dgraph/docker-compose.yml` +whenever possible. If the functionality being tested requires a different cluster setup (e.g. +different commandline options), the `*_test.go` files should be put in a separate directory that +also contains a `docker-compose.yml` to set up the cluster as needed. + +**IMPORTANT:** All containers should be labeled with `cluster: test` so they may be correctly +restarted and cleaned up by the test script. + +#### Badger + +Run `go test` in the root folder. + +```bash +$ go test ./... +ok github.com/dgraph-io/badger 24.853s +ok github.com/dgraph-io/badger/skl 0.027s +ok github.com/dgraph-io/badger/table 0.478s +ok github.com/dgraph-io/badger/y 0.004s +``` + +## Contributing + +### Guidelines + +Over years of writing big scalable systems, we are convinced that striving for simplicity wherever +possible is the only way to build robust systems. This simplicity could be in design, could be in +coding, or could be achieved by rewriting an entire module, that you may have painstakingly finished +yesterday. + +- **Pull requests are welcome**, as long as you're willing to put in the effort to meet the + guidelines. After you fork dgraph, create your pull request against our `main` branch +- Aim for clear, well written, maintainable code +- Simple and minimal approach to features, like Go +- New features must include passing unit tests, and integration tests when appropriate +- Refactoring existing code now for better performance, better readability or better testability + wins over adding a new feature +- Don't add a function to a module that you don't use right now, or doesn't clearly enable a planned + functionality +- Don't ship a half done feature, which would require significant alterations to work fully +- Avoid [Technical debt](https://en.wikipedia.org/wiki/Technical_debt) like cancer +- Leave the code cleaner than when you began + +### Code style + +- We're following [Go Code Review](https://github.com/golang/go/wiki/CodeReviewComments) +- Use `go fmt` to format your code before committing +- If you see _any code_ which clearly violates the style guide, please fix it and send a pull + request. No need to ask for permission +- Avoid unnecessary vertical spaces. Use your judgment or follow the code review comments +- Wrap your code and comments to 120 characters, unless doing so makes the code less legible + +### License Header + +Every new source file must begin with a license header. + +Most of Dgraph, Badger, and the Dgraph clients (dgo, dgraph-js, pydgraph and dgraph4j) are licensed +under the Apache 2.0 license: + +```sh +/* + * Copyright 2016-2025 Hypermode Inc. and Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +``` + +### Signed Commits + +Signed commits help in verifying the authenticity of the contributor. We use signed commits in +Dgraph, and we prefer it, though it's not compulsory to have signed commits. This is a recommended +step for people who intend to contribute to Dgraph on a regular basis. + +Follow instructions to generate and setup GPG keys for signing code commits on this +[Github Help page](https://help.github.com/articles/signing-commits-with-gpg/). diff --git a/README.md b/README.md index 1433c22..de623fb 100644 --- a/README.md +++ b/README.md @@ -1,48 +1,16 @@ -# dgraph-js [![npm version](https://img.shields.io/npm/v/dgraph-js.svg?style=flat)](https://www.npmjs.com/package/dgraph-js) [![Coverage Status](https://img.shields.io/coveralls/github/dgraph-io/dgraph-js/master.svg?style=flat)](https://coveralls.io/github/dgraph-io/dgraph-js?branch=master) +# dgraph-js [![npm version](https://img.shields.io/npm/v/dgraph-js.svg?style=flat)](https://www.npmjs.com/package/dgraph-js) [![Coverage Status](https://img.shields.io/coveralls/github/hypermodeinc/dgraph-js/master.svg?style=flat)](https://coveralls.io/github/hypermodeinc/dgraph-js?branch=master) -Official Dgraph client implementation for JavaScript (Node.js v6 and above), -using [gRPC]. +Official Dgraph client implementation for JavaScript (Node.js v6 and above), using [gRPC]. **Looking for browser support? Check out [dgraph-js-http].** [grpc]: https://grpc.io/ -[dgraph-js-http]: https://github.com/dgraph-io/dgraph-js-http - -This client follows the [Dgraph Go client][goclient] closely. - -[goclient]: https://github.com/dgraph-io/dgo - -Before using this client, we highly recommend that you go through [dgraph.io/docs], -and understand how to run and work with Dgraph. - -[docs.dgraph.io]:https://dgraph.io/docs - - -## Table of contents - -- [dgraph-js ](#dgraph-js--) - - [Table of contents](#table-of-contents) - - [Install](#install) - - [Supported Versions](#supported-versions) - - [Quickstart](#quickstart) - - [Using a Client](#using-a-client) - - [Creating a Client](#creating-a-client) - - [Multi-tenancy](#multi-tenancy) - - [Creating a Client for Dgraph Cloud Endpoint](#creating-a-client-for-dgraph-cloud-endpoint) - - [Altering the Database](#altering-the-database) - - [Creating a Transaction](#creating-a-transaction) - - [Running a Mutation](#running-a-mutation) - - [Running a Query](#running-a-query) - - [Running an Upsert: Query + Mutation](#running-an-upsert-query--mutation) - - [Running a Conditional Upsert](#running-a-conditional-upsert) - - [Committing a Transaction](#committing-a-transaction) - - [Cleanup Resources](#cleanup-resources) - - [Debug mode](#debug-mode) - - [Setting Metadata Headers](#setting-metadata-headers) - - [Examples](#examples) - - [Development](#development) - - [Building the source](#building-the-source) - - [Running tests](#running-tests) +[dgraph-js-http]: https://github.com/hypermodeinc/dgraph-js-http + +This client follows the [Dgraph Go client](https://github.com/dgraph-io/dgo) closely. + +Before using this client, we highly recommend that you go through +[dgraph.io/docs](https://dgraph.io/docs), and understand how to run and work with Dgraph. ## Install @@ -64,78 +32,81 @@ yarn add dgraph-js @grpc/grpc-js ## Supported Versions -Depending on the version of Dgraph that you are connecting to, you will have to -use a different version of this client. +Depending on the version of Dgraph that you are connecting to, you will have to use a different +version of this client. | Dgraph version | dgraph-js version | -|:--------------:|:-----------------:| -| 20.03.0 | *20.03.0* | -| 21.03.0 | *21.03.0* | -| >=21.03.0 | >=*21.03.0* | -| >=24.X.X | >=*24.X.X* | - +| :------------: | :---------------: | +| 20.03.0 | _20.03.0_ | +| 21.03.0 | _21.03.0_ | +| >=21.03.0 | >=_21.03.0_ | +| >=24.X.X | >=_24.X.X_ | ## Quickstart -Build and run the [simple][] project in the `examples` folder, which -contains an end-to-end example of using the Dgraph JavaScript client. Follow the -instructions in the README of that project. +Build and run the [simple][] project in the `examples` folder, which contains an end-to-end example +of using the Dgraph JavaScript client. Follow the instructions in the README of that project. ## Using a Client ### Creating a Client -A `DgraphClient` object can be initialised by passing it a list of -`DgraphClientStub` clients as variadic arguments. Connecting to multiple Dgraph -servers in the same cluster allows for better distribution of workload. +A `DgraphClient` object can be initialised by passing it a list of `DgraphClientStub` clients as +variadic arguments. Connecting to multiple Dgraph servers in the same cluster allows for better +distribution of workload. The following code snippet shows just one connection. ```js -const dgraph = require("dgraph-js"); -const grpc = require("@grpc/grpc-js"); +const dgraph = require("dgraph-js") +const grpc = require("@grpc/grpc-js") const clientStub = new dgraph.DgraphClientStub( // addr: optional, default: "localhost:9080" "localhost:9080", // credentials: optional, default: grpc.credentials.createInsecure() grpc.credentials.createInsecure(), -); -const dgraphClient = new dgraph.DgraphClient(clientStub); +) +const dgraphClient = new dgraph.DgraphClient(clientStub) ``` To facilitate debugging, [debug mode](#debug-mode) can be enabled for a client. ### Multi-tenancy -In [multi-tenancy](https://dgraph.io/docs/enterprise-features/multitenancy) environments, `dgraph-js` provides a new method `loginIntoNamespace()`, -which will allow the users to login to a specific namespace. +In [multi-tenancy](https://dgraph.io/docs/enterprise-features/multitenancy) environments, +`dgraph-js` provides a new method `loginIntoNamespace()`, which will allow the users to login to a +specific namespace. In order to create a JavaScript client, and make the client login into namespace `123`: ```js -const dgraphClientStub = new dgraph.DgraphClientStub("localhost:9080"); -await dgraphClientStub.loginIntoNamespace("groot", "password", 123); // where 123 is the namespaceId +const dgraphClientStub = new dgraph.DgraphClientStub("localhost:9080") +await dgraphClientStub.loginIntoNamespace("groot", "password", 123) // where 123 is the namespaceId ``` -In the example above, the client logs into namespace `123` using username `groot` and password `password`. -Once logged in, the client can perform all the operations allowed to the `groot` user of namespace `123`. +In the example above, the client logs into namespace `123` using username `groot` and password +`password`. Once logged in, the client can perform all the operations allowed to the `groot` user of +namespace `123`. ### Creating a Client for Dgraph Cloud Endpoint -If you want to connect to Dgraph running on your [Dgraph Cloud](https://cloud.dgraph.io) instance, then all you need is the URL of your Dgraph Cloud endpoint and the API key. You can get a client using them as follows: +If you want to connect to Dgraph running on your [Dgraph Cloud](https://cloud.dgraph.io) instance, +then all you need is the URL of your Dgraph Cloud endpoint and the API key. You can get a client +using them as follows: ```js -const dgraph = require("dgraph-js"); +const dgraph = require("dgraph-js") const clientStub = dgraph.clientStubFromCloudEndpoint( "https://frozen-mango.eu-central-1.aws.cloud.dgraph.io/graphql", - "" -); -const dgraphClient = new dgraph.DgraphClient(clientStub); + "", +) +const dgraphClient = new dgraph.DgraphClient(clientStub) ``` -**Note:** the `clientStubFromSlashGraphQLEndpoint` method is deprecated and will be removed in the next release. Instead use `clientStubFromCloudEndpoint` method. +**Note:** the `clientStubFromSlashGraphQLEndpoint` method is deprecated and will be removed in the +next release. Instead use `clientStubFromCloudEndpoint` method. ### Altering the Database @@ -143,138 +114,132 @@ To set the schema, create an `Operation` object, set the schema and pass it to `DgraphClient#alter(Operation)` method. ```js -const schema = "name: string @index(exact) ."; -const op = new dgraph.Operation(); -op.setSchema(schema); -await dgraphClient.alter(op); +const schema = "name: string @index(exact) ." +const op = new dgraph.Operation() +op.setSchema(schema) +await dgraphClient.alter(op) ``` -Starting Dgraph version 20.03.0, indexes can be computed in the background. -You can set `setRunInBackground` field of the `Operation` object to `true` -before passing it to the `DgraphClient#alter(Operation)` method. You can find more details +Starting Dgraph version 20.03.0, indexes can be computed in the background. You can set +`setRunInBackground` field of the `Operation` object to `true` before passing it to the +`DgraphClient#alter(Operation)` method. You can find more details [here](https://docs.dgraph.io/master/query-language/#indexes-in-background). ```js -const schema = "name: string @index(exact) ."; -const op = new dgraph.Operation(); -op.setSchema(schema); -op.setRunInBackground(true); -await dgraphClient.alter(op); +const schema = "name: string @index(exact) ." +const op = new dgraph.Operation() +op.setSchema(schema) +op.setRunInBackground(true) +await dgraphClient.alter(op) ``` -> NOTE: Many of the examples here use the `await` keyword which requires -> `async/await` support which is available on Node.js >= v7.6.0. For prior versions, -> the expressions following `await` can be used just like normal `Promise`: +> NOTE: Many of the examples here use the `await` keyword which requires `async/await` support which +> is available on Node.js >= v7.6.0. For prior versions, the expressions following `await` can be +> used just like normal `Promise`: > > ```js > dgraphClient.alter(op) > .then(function(result) { ... }, function(err) { ... }) > ``` -`Operation` contains other fields as well, including drop predicate and drop all. -Drop all is useful if you wish to discard all the data, and start from a clean -slate, without bringing the instance down. +`Operation` contains other fields as well, including drop predicate and drop all. Drop all is useful +if you wish to discard all the data, and start from a clean slate, without bringing the instance +down. ```js // Drop all data including schema from the Dgraph instance. This is useful // for small examples such as this, since it puts Dgraph into a clean // state. -const op = new dgraph.Operation(); -op.setDropAll(true); -await dgraphClient.alter(op); +const op = new dgraph.Operation() +op.setDropAll(true) +await dgraphClient.alter(op) ``` ### Creating a Transaction -To create a transaction, call `DgraphClient#newTxn()` method, which returns a -new `Txn` object. This operation incurs no network overhead. +To create a transaction, call `DgraphClient#newTxn()` method, which returns a new `Txn` object. This +operation incurs no network overhead. -It is good practise to call `Txn#discard()` in a `finally` block after running -the transaction. Calling `Txn#discard()` after `Txn#commit()` is a no-op -and you can call `Txn#discard()` multiple times with no additional side-effects. +It is good practise to call `Txn#discard()` in a `finally` block after running the transaction. +Calling `Txn#discard()` after `Txn#commit()` is a no-op and you can call `Txn#discard()` multiple +times with no additional side-effects. ```js -const txn = dgraphClient.newTxn(); +const txn = dgraphClient.newTxn() try { // Do something here // ... } finally { - await txn.discard(); + await txn.discard() // ... } ``` To create a read-only transaction, set `readOnly` boolean to `true` while calling -`DgraphClient#newTxn()` method. Read-only transactions cannot contain mutations and -trying to call `Txn#mutate()` or `Txn#commit()` will result in an error. Calling -`Txn.Discard()` will be a no-op. +`DgraphClient#newTxn()` method. Read-only transactions cannot contain mutations and trying to call +`Txn#mutate()` or `Txn#commit()` will result in an error. Calling `Txn.Discard()` will be a no-op. -You can optionally set the `bestEffort` boolean to `true`. This may yield improved -latencies in read-bound workloads where linearizable reads are not strictly needed. +You can optionally set the `bestEffort` boolean to `true`. This may yield improved latencies in +read-bound workloads where linearizable reads are not strictly needed. ```js const txn = dgraphClient.newTxn({ readOnly: true, - bestEffort: false -}); + bestEffort: false, +}) // ... -const res = await txn.queryWithVars(query, vars); +const res = await txn.queryWithVars(query, vars) ``` ### Running a Mutation -`Txn#mutate(Mutation)` runs a mutation. It takes in a `Mutation` object, which -provides two main ways to set data: JSON and RDF N-Quad. You can choose whichever -way is convenient. +`Txn#mutate(Mutation)` runs a mutation. It takes in a `Mutation` object, which provides two main +ways to set data: JSON and RDF N-Quad. You can choose whichever way is convenient. We define a person object to represent a person and use it in a `Mutation` object. ```js // Create data. const p = { - name: "Alice", -}; + name: "Alice", +} // Run mutation. -const mu = new dgraph.Mutation(); -mu.setSetJson(p); -await txn.mutate(mu); +const mu = new dgraph.Mutation() +mu.setSetJson(p) +await txn.mutate(mu) ``` -For a more complete example with multiple fields and relationships, look at the -[simple] project in the `examples` folder. +For a more complete example with multiple fields and relationships, look at the [simple] project in +the `examples` folder. -Sometimes, you only want to commit a mutation, without querying anything further. -In such cases, you can use `Mutation#setCommitNow(true)` to indicate that the -mutation must be immediately committed. +Sometimes, you only want to commit a mutation, without querying anything further. In such cases, you +can use `Mutation#setCommitNow(true)` to indicate that the mutation must be immediately committed. -`Mutation#setIgnoreIndexConflict(true)` can be applied on a `Mutation` object to -not run conflict detection over the index, which would decrease the number of -transaction conflicts and aborts. However, this would come at the cost of potentially -inconsistent upsert operations. +`Mutation#setIgnoreIndexConflict(true)` can be applied on a `Mutation` object to not run conflict +detection over the index, which would decrease the number of transaction conflicts and aborts. +However, this would come at the cost of potentially inconsistent upsert operations. Mutation can be run using `txn.doRequest` as well. ```js -const mu = new dgraph.Mutation(); -mu.setSetJson(p); +const mu = new dgraph.Mutation() +mu.setSetJson(p) -const req = new dgraph.Request(); -req.setCommitNow(true); -req.setMutationsList([mu]); +const req = new dgraph.Request() +req.setCommitNow(true) +req.setMutationsList([mu]) -await txn.doRequest(req); +await txn.doRequest(req) ``` ### Running a Query -You can run a query by calling `Txn#query(string)`. You will need to pass in a -GraphQL+- query string. If you want to pass an additional map of any variables that -you might want to set in the query, call `Txn#queryWithVars(string, object)` with -the variables object as the second argument. +You can run a query by calling `Txn#query(string)`. You will need to pass in a GraphQL+- query +string. If you want to pass an additional map of any variables that you might want to set in the +query, call `Txn#queryWithVars(string, object)` with the variables object as the second argument. -The response would contain the method `Response#getJSON()`, which returns the response -JSON. +The response would contain the method `Response#getJSON()`, which returns the response JSON. Let’s run the following query with a variable $a: @@ -287,8 +252,7 @@ query all($a: string) { } ``` -Run the query, deserialize the result from Uint8Array (or base64) encoded JSON and -print it out: +Run the query, deserialize the result from Uint8Array (or base64) encoded JSON and print it out: ```js // Run query. @@ -297,14 +261,14 @@ const query = `query all($a: string) { { name } -}`; -const vars = { $a: "Alice" }; -const res = await dgraphClient.newTxn().queryWithVars(query, vars); -const ppl = res.getJson(); +}` +const vars = { $a: "Alice" } +const res = await dgraphClient.newTxn().queryWithVars(query, vars) +const ppl = res.getJson() // Print results. -console.log(`Number of people named "Alice": ${ppl.all.length}`); -ppl.all.forEach((person) => console.log(person.name)); +console.log(`Number of people named "Alice": ${ppl.all.length}`) +ppl.all.forEach((person) => console.log(person.name)) ``` This should print: @@ -315,14 +279,15 @@ Alice ``` You can also use `txn.doRequest` function to run the query. + ```js -const req = new dgraph.Request(); -const vars = req.getVarsMap(); -vars.set("$a", "Alice"); -req.setQuery(query); +const req = new dgraph.Request() +const vars = req.getVarsMap() +vars.set("$a", "Alice") +req.setQuery(query) -const res = await txn.doRequest(req); -console.log(JSON.stringify(res.getJson())); +const res = await txn.doRequest(req) +console.log(JSON.stringify(res.getJson())) ``` ### Running an Upsert: Query + Mutation @@ -331,7 +296,8 @@ The `txn.doRequest` function allows you to run upserts consisting of one query a Query variables could be defined and can then be used in the mutation. You can also use the `txn.doRequest` function to perform just a query or a mutation. -To know more about upsert, we highly recommend going through the docs at https://docs.dgraph.io/mutations/#upsert-block. +To know more about upsert, we highly recommend going through the docs at +https://docs.dgraph.io/mutations/#upsert-block. ```js const query = ` @@ -339,23 +305,24 @@ const query = ` user as var(func: eq(email, "wrong_email@dgraph.io")) }` -const mu = new dgraph.Mutation(); -mu.setSetNquads(`uid(user) "correct_email@dgraph.io" .`); +const mu = new dgraph.Mutation() +mu.setSetNquads(`uid(user) "correct_email@dgraph.io" .`) -const req = new dgraph.Request(); -req.setQuery(query); -req.setMutationsList([mu]); -req.setCommitNow(true); +const req = new dgraph.Request() +req.setQuery(query) +req.setMutationsList([mu]) +req.setCommitNow(true) // Upsert: If wrong_email found, update the existing data // or else perform a new mutation. -await dgraphClient.newTxn().doRequest(req); +await dgraphClient.newTxn().doRequest(req) ``` ### Running a Conditional Upsert -The upsert block allows specifying a conditional mutation block using an `@if` directive. The mutation is executed -only when the specified condition is true. If the condition is false, the mutation is silently ignored. +The upsert block allows specifying a conditional mutation block using an `@if` directive. The +mutation is executed only when the specified condition is true. If the condition is false, the +mutation is silently ignored. See more about Conditional Upsert [Here](https://docs.dgraph.io/mutations/#conditional-upsert). @@ -365,79 +332,77 @@ const query = ` user as var(func: eq(email, "wrong_email@dgraph.io")) }` -const mu = new dgraph.Mutation(); -mu.setSetNquads(`uid(user) "correct_email@dgraph.io" .`); -mu.setCond(`@if(eq(len(user), 1))`); +const mu = new dgraph.Mutation() +mu.setSetNquads(`uid(user) "correct_email@dgraph.io" .`) +mu.setCond(`@if(eq(len(user), 1))`) -const req = new dgraph.Request(); -req.setQuery(query); -req.addMutations(mu); -req.setCommitNow(true); +const req = new dgraph.Request() +req.setQuery(query) +req.addMutations(mu) +req.setCommitNow(true) -await dgraphClient.newTxn().doRequest(req); +await dgraphClient.newTxn().doRequest(req) ``` ### Committing a Transaction -A transaction can be committed using the `Txn#commit()` method. If your transaction -consisted solely of calls to `Txn#query` or `Txn#queryWithVars`, and no calls to -`Txn#mutate`, then calling `Txn#commit()` is not necessary. +A transaction can be committed using the `Txn#commit()` method. If your transaction consisted solely +of calls to `Txn#query` or `Txn#queryWithVars`, and no calls to `Txn#mutate`, then calling +`Txn#commit()` is not necessary. -An error will be returned if other transactions running concurrently modify the same -data that was modified in this transaction. It is up to the user to retry -transactions when they fail. +An error will be returned if other transactions running concurrently modify the same data that was +modified in this transaction. It is up to the user to retry transactions when they fail. ```js -const txn = dgraphClient.newTxn(); +const txn = dgraphClient.newTxn() try { // ... // Perform any number of queries and mutations // ... // and finally... - await txn.commit(); + await txn.commit() } catch (e) { if (e === dgraph.ERR_ABORTED) { // Retry or handle exception. } else { - throw e; + throw e } } finally { // Clean up. Calling this after txn.commit() is a no-op // and hence safe. - await txn.discard(); + await txn.discard() } ``` ### Cleanup Resources -To cleanup resources, you have to call `DgraphClientStub#close()` individually for -all the instances of `DgraphClientStub`. +To cleanup resources, you have to call `DgraphClientStub#close()` individually for all the instances +of `DgraphClientStub`. ```js -const SERVER_ADDR = "localhost:9080"; -const SERVER_CREDENTIALS = grpc.credentials.createInsecure(); +const SERVER_ADDR = "localhost:9080" +const SERVER_CREDENTIALS = grpc.credentials.createInsecure() // Create instances of DgraphClientStub. -const stub1 = new dgraph.DgraphClientStub(SERVER_ADDR, SERVER_CREDENTIALS); -const stub2 = new dgraph.DgraphClientStub(SERVER_ADDR, SERVER_CREDENTIALS); +const stub1 = new dgraph.DgraphClientStub(SERVER_ADDR, SERVER_CREDENTIALS) +const stub2 = new dgraph.DgraphClientStub(SERVER_ADDR, SERVER_CREDENTIALS) // Create an instance of DgraphClient. -const dgraphClient = new dgraph.DgraphClient(stub1, stub2); +const dgraphClient = new dgraph.DgraphClient(stub1, stub2) // ... // Use dgraphClient // ... // Cleanup resources by closing all client stubs. -stub1.close(); -stub2.close(); +stub1.close() +stub2.close() ``` ### Debug mode -Debug mode can be used to print helpful debug messages while performing alters, -queries and mutations. It can be set using the`DgraphClient#setDebugMode(boolean?)` -method. +Debug mode can be used to print helpful debug messages while performing alters, queries and +mutations. It can be set using the`DgraphClient#setDebugMode(boolean?)` method. ```js // Create a client. @@ -453,16 +418,17 @@ dgraphClient.setDebugMode(false); ### Setting Metadata Headers -Metadata headers such as authentication tokens can be set through the context of gRPC methods. Below is an example of how to set a header named "auth-token". +Metadata headers such as authentication tokens can be set through the context of gRPC methods. Below +is an example of how to set a header named "auth-token". ```js // The following piece of code shows how one can set metadata with // auth-token, to allow Alter operation, if the server requires it. -var meta = new grpc.Metadata(); -meta.add('auth-token', 'mySuperSecret'); +var meta = new grpc.Metadata() +meta.add("auth-token", "mySuperSecret") -await dgraphClient.alter(op, meta); +await dgraphClient.alter(op, meta) ``` ## Examples @@ -481,10 +447,9 @@ await dgraphClient.alter(op, meta); npm run build ``` -If you have made changes to the `proto/api.proto` file, you need need to -regenerate the source files generated by Protocol Buffer tools. To do that, -install the [Protocol Buffer Compiler][protoc] and then run the following -command: +If you have made changes to the `proto/api.proto` file, you need need to regenerate the source files +generated by Protocol Buffer tools. To do that, install the [Protocol Buffer Compiler][protoc] and +then run the following command: [protoc]: https://github.com/google/protobuf#readme diff --git a/examples/simple/README.md b/examples/simple/README.md index c19c489..7e9dde8 100644 --- a/examples/simple/README.md +++ b/examples/simple/README.md @@ -1,9 +1,8 @@ # Simple example project -Simple project demonstrating the use of [dgraph-js][], the official JavaScript client -for Dgraph. +Simple project demonstrating the use of [dgraph-js][], the official JavaScript client for Dgraph. -[dgraph-js]:https://github.com/dgraph-io/dgraph-js +[dgraph-js]: https://github.com/hypermodeinc/dgraph-js ## Running @@ -11,10 +10,10 @@ for Dgraph. You will need to install [Dgraph v21.3.2 or above][releases] and run it. -[releases]: https://github.com/dgraph-io/dgraph/releases +[releases]: https://github.com/hypermodeinc/dgraph/releases -You can run the commands below to start a clean Dgraph server every time, for -testing and exploration. +You can run the commands below to start a clean Dgraph server every time, for testing and +exploration. First, create two separate directories for `dgraph zero` and `dgraph alpha`. @@ -36,8 +35,7 @@ cd local-dgraph-data/data rm -r p w; dgraph alpha --zero localhost:5080 ``` -For more configuration options, and other details, refer to -[docs.dgraph.io](https://docs.dgraph.io) +For more configuration options, and other details, refer to [docs.dgraph.io](https://docs.dgraph.io) ## Install dependencies diff --git a/examples/simple/index.js b/examples/simple/index.js index ca48f33..ba135f3 100644 --- a/examples/simple/index.js +++ b/examples/simple/index.js @@ -1,110 +1,104 @@ -const dgraph = require("dgraph-js"); +const dgraph = require("dgraph-js") // Create a client stub. function newClientStub() { - return new dgraph.DgraphClientStub("localhost:9080"); + return new dgraph.DgraphClientStub("localhost:9080") } // Create a client. function newClient(clientStub) { - return new dgraph.DgraphClient(clientStub); + return new dgraph.DgraphClient(clientStub) } // Drop All - discard all data, schema and start from a clean slate. async function dropAll(dgraphClient) { - const op = new dgraph.Operation(); - op.setDropAll(true); - await dgraphClient.alter(op); + const op = new dgraph.Operation() + op.setDropAll(true) + await dgraphClient.alter(op) } // Drop All Data, but keep the schema. async function dropData(dgraphClient) { - const op = new dgraph.Operation(); - op.setDropOp(dgraph.Operation.DropOp.DATA); - await dgraphClient.alter(op); + const op = new dgraph.Operation() + op.setDropOp(dgraph.Operation.DropOp.DATA) + await dgraphClient.alter(op) } // Set schema. async function setSchema(dgraphClient) { - const schema = ` + const schema = ` name: string @index(exact) . age: int . married: bool . loc: geo . dob: datetime . friend: [uid] @reverse . - `; - const op = new dgraph.Operation(); - op.setSchema(schema); - await dgraphClient.alter(op); + ` + const op = new dgraph.Operation() + op.setSchema(schema) + await dgraphClient.alter(op) } // Create data using JSON. async function createData(dgraphClient) { - // Create a new transaction. - const txn = dgraphClient.newTxn(); - try { - // Create data. - const p = { - uid: "_:alice", - name: "Alice", - age: 26, - married: true, - loc: { - type: "Point", - coordinates: [1.1, 2], - }, - dob: new Date(1980, 1, 1, 23, 0, 0, 0), - friend: [ - { - name: "Bob", - age: 24, - }, - { - name: "Charlie", - age: 29, - }, - ], - school: [ - { - name: "Crown Public School", - }, - ], - }; + // Create a new transaction. + const txn = dgraphClient.newTxn() + try { + // Create data. + const p = { + uid: "_:alice", + name: "Alice", + age: 26, + married: true, + loc: { + type: "Point", + coordinates: [1.1, 2], + }, + dob: new Date(1980, 1, 1, 23, 0, 0, 0), + friend: [ + { + name: "Bob", + age: 24, + }, + { + name: "Charlie", + age: 29, + }, + ], + school: [ + { + name: "Crown Public School", + }, + ], + } - // Run mutation. - const mu = new dgraph.Mutation(); - mu.setSetJson(p); - const response = await txn.mutate(mu); + // Run mutation. + const mu = new dgraph.Mutation() + mu.setSetJson(p) + const response = await txn.mutate(mu) - // Commit transaction. - await txn.commit(); + // Commit transaction. + await txn.commit() - // Get uid of the outermost object (person named "Alice"). - // Response#getUidsMap() returns a map from blank node names to uids. - // For a json mutation, blank node label is used for the name of the created nodes. - console.log( - `Created person named "Alice" with uid = ${response - .getUidsMap() - .get("alice")}\n`, - ); + // Get uid of the outermost object (person named "Alice"). + // Response#getUidsMap() returns a map from blank node names to uids. + // For a json mutation, blank node label is used for the name of the created nodes. + console.log(`Created person named "Alice" with uid = ${response.getUidsMap().get("alice")}\n`) - console.log("All created nodes (map from blank node names to uids):"); - response - .getUidsMap() - .forEach((uid, key) => console.log(`${key} => ${uid}`)); - console.log(); - } finally { - // Clean up. Calling this after txn.commit() is a no-op - // and hence safe. - await txn.discard(); - } + console.log("All created nodes (map from blank node names to uids):") + response.getUidsMap().forEach((uid, key) => console.log(`${key} => ${uid}`)) + console.log() + } finally { + // Clean up. Calling this after txn.commit() is a no-op + // and hence safe. + await txn.discard() + } } // Query for data. async function queryData(dgraphClient) { - // Run query. - const query = `query all($a: string) { + // Run query. + const query = `query all($a: string) { all(func: eq(name, $a)) { uid name @@ -120,38 +114,36 @@ async function queryData(dgraphClient) { name } } - }`; - const vars = { $a: "Alice" }; - const res = await dgraphClient - .newTxn({ readOnly: true }) - .queryWithVars(query, vars); - const ppl = res.getJson(); + }` + const vars = { $a: "Alice" } + const res = await dgraphClient.newTxn({ readOnly: true }).queryWithVars(query, vars) + const ppl = res.getJson() - // Print results. - console.log(`Number of people named "Alice": ${ppl.all.length}`); - ppl.all.forEach((person) => console.log(person)); + // Print results. + console.log(`Number of people named "Alice": ${ppl.all.length}`) + ppl.all.forEach((person) => console.log(person)) } async function main() { - const dgraphClientStub = newClientStub(); - const dgraphClient = newClient(dgraphClientStub); - await dropAll(dgraphClient); - await setSchema(dgraphClient); - await createData(dgraphClient); - await queryData(dgraphClient); - await dropData(dgraphClient); - await queryData(dgraphClient); - await createData(dgraphClient); - await queryData(dgraphClient); + const dgraphClientStub = newClientStub() + const dgraphClient = newClient(dgraphClientStub) + await dropAll(dgraphClient) + await setSchema(dgraphClient) + await createData(dgraphClient) + await queryData(dgraphClient) + await dropData(dgraphClient) + await queryData(dgraphClient) + await createData(dgraphClient) + await queryData(dgraphClient) - // Close the client stub. - dgraphClientStub.close(); + // Close the client stub. + dgraphClientStub.close() } main() - .then(() => { - console.log("\nDONE!"); - }) - .catch((e) => { - console.log("ERROR: ", e); - }); + .then(() => { + console.log("\nDONE!") + }) + .catch((e) => { + console.log("ERROR: ", e) + }) diff --git a/generate_proto.sh b/generate_proto.sh index 5ea0d6a..a8a1c43 100755 --- a/generate_proto.sh +++ b/generate_proto.sh @@ -1,13 +1,13 @@ #!/bin/bash protoc \ - --plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts \ - --js_out=import_style=commonjs,binary:./generated/ \ - --ts_out=service=true:./generated/ \ - --proto_path=./protos/ api.proto + --plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts \ + --js_out=import_style=commonjs,binary:./generated/ \ + --ts_out=service=true:./generated/ \ + --proto_path=./protos/ api.proto yarn grpc_tools_node_protoc \ - --plugin=protoc-gen-grpc=./node_modules/.bin/grpc_tools_node_protoc_plugin \ - --plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts \ - --grpc_out=grpc_js:./generated/ \ - --proto_path=./protos/ api.proto + --plugin=protoc-gen-grpc=./node_modules/.bin/grpc_tools_node_protoc_plugin \ + --plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts \ + --grpc_out=grpc_js:./generated/ \ + --proto_path=./protos/ api.proto diff --git a/generated/api_grpc_pb.d.ts b/generated/api_grpc_pb.d.ts index 00ef5af..af99888 100644 --- a/generated/api_grpc_pb.d.ts +++ b/generated/api_grpc_pb.d.ts @@ -1,49 +1,49 @@ // package: api // file: api.proto -import * as grpc from "@grpc/grpc-js"; -import * as api_pb from "./api_pb"; +import * as grpc from "@grpc/grpc-js" +import * as api_pb from "./api_pb" export class DgraphClient extends grpc.Client { - public login( - request: api_pb.LoginRequest, - metadata: grpc.Metadata | null, - options: grpc.CallOptions | null, - callback: (err?: Error | null, res?: api_pb.Response) => void - ): void; + public login( + request: api_pb.LoginRequest, + metadata: grpc.Metadata | null, + options: grpc.CallOptions | null, + callback: (err?: Error | null, res?: api_pb.Response) => void, + ): void - public alter( - operation: api_pb.Operation, - metadata: grpc.Metadata | null, - options: grpc.CallOptions | null, - callback: (err?: Error | null, res?: api_pb.Payload) => void - ): void; + public alter( + operation: api_pb.Operation, + metadata: grpc.Metadata | null, + options: grpc.CallOptions | null, + callback: (err?: Error | null, res?: api_pb.Payload) => void, + ): void - public query( - request: api_pb.Request, - metadata: grpc.Metadata | null, - options: grpc.CallOptions | null, - callback: (err?: Error | null, res?: api_pb.Response) => void - ): void; + public query( + request: api_pb.Request, + metadata: grpc.Metadata | null, + options: grpc.CallOptions | null, + callback: (err?: Error | null, res?: api_pb.Response) => void, + ): void - public mutate( - request: api_pb.Mutation, - metadata: grpc.Metadata | null, - options: grpc.CallOptions | null, - callback: (err?: Error | null, res?: api_pb.Response) => void - ): void; + public mutate( + request: api_pb.Mutation, + metadata: grpc.Metadata | null, + options: grpc.CallOptions | null, + callback: (err?: Error | null, res?: api_pb.Response) => void, + ): void - public commitOrAbort( - request: api_pb.TxnContext, - metadata: grpc.Metadata | null, - options: grpc.CallOptions | null, - callback: (err?: Error | null, res?: api_pb.TxnContext) => void - ): void; + public commitOrAbort( + request: api_pb.TxnContext, + metadata: grpc.Metadata | null, + options: grpc.CallOptions | null, + callback: (err?: Error | null, res?: api_pb.TxnContext) => void, + ): void - public checkVersion( - request: api_pb.Check, - metadata: grpc.Metadata | null, - options: grpc.CallOptions | null, - callback: (err?: Error | null, res?: api_pb.Version) => void - ): void; + public checkVersion( + request: api_pb.Check, + metadata: grpc.Metadata | null, + options: grpc.CallOptions | null, + callback: (err?: Error | null, res?: api_pb.Version) => void, + ): void } diff --git a/generated/api_grpc_pb.js b/generated/api_grpc_pb.js index c488cf0..d264fe8 100644 --- a/generated/api_grpc_pb.js +++ b/generated/api_grpc_pb.js @@ -21,103 +21,102 @@ // SongServerRequest. Use snake_case (underscore_separated_names) for field names – for // example, song_name. // -'use strict'; -var grpc = require('@grpc/grpc-js'); -var api_pb = require('./api_pb.js'); +"use strict" +var grpc = require("@grpc/grpc-js") +var api_pb = require("./api_pb.js") function serialize_api_Check(arg) { if (!(arg instanceof api_pb.Check)) { - throw new Error('Expected argument of type api.Check'); + throw new Error("Expected argument of type api.Check") } - return Buffer.from(arg.serializeBinary()); + return Buffer.from(arg.serializeBinary()) } function deserialize_api_Check(buffer_arg) { - return api_pb.Check.deserializeBinary(new Uint8Array(buffer_arg)); + return api_pb.Check.deserializeBinary(new Uint8Array(buffer_arg)) } function serialize_api_LoginRequest(arg) { if (!(arg instanceof api_pb.LoginRequest)) { - throw new Error('Expected argument of type api.LoginRequest'); + throw new Error("Expected argument of type api.LoginRequest") } - return Buffer.from(arg.serializeBinary()); + return Buffer.from(arg.serializeBinary()) } function deserialize_api_LoginRequest(buffer_arg) { - return api_pb.LoginRequest.deserializeBinary(new Uint8Array(buffer_arg)); + return api_pb.LoginRequest.deserializeBinary(new Uint8Array(buffer_arg)) } function serialize_api_Operation(arg) { if (!(arg instanceof api_pb.Operation)) { - throw new Error('Expected argument of type api.Operation'); + throw new Error("Expected argument of type api.Operation") } - return Buffer.from(arg.serializeBinary()); + return Buffer.from(arg.serializeBinary()) } function deserialize_api_Operation(buffer_arg) { - return api_pb.Operation.deserializeBinary(new Uint8Array(buffer_arg)); + return api_pb.Operation.deserializeBinary(new Uint8Array(buffer_arg)) } function serialize_api_Payload(arg) { if (!(arg instanceof api_pb.Payload)) { - throw new Error('Expected argument of type api.Payload'); + throw new Error("Expected argument of type api.Payload") } - return Buffer.from(arg.serializeBinary()); + return Buffer.from(arg.serializeBinary()) } function deserialize_api_Payload(buffer_arg) { - return api_pb.Payload.deserializeBinary(new Uint8Array(buffer_arg)); + return api_pb.Payload.deserializeBinary(new Uint8Array(buffer_arg)) } function serialize_api_Request(arg) { if (!(arg instanceof api_pb.Request)) { - throw new Error('Expected argument of type api.Request'); + throw new Error("Expected argument of type api.Request") } - return Buffer.from(arg.serializeBinary()); + return Buffer.from(arg.serializeBinary()) } function deserialize_api_Request(buffer_arg) { - return api_pb.Request.deserializeBinary(new Uint8Array(buffer_arg)); + return api_pb.Request.deserializeBinary(new Uint8Array(buffer_arg)) } function serialize_api_Response(arg) { if (!(arg instanceof api_pb.Response)) { - throw new Error('Expected argument of type api.Response'); + throw new Error("Expected argument of type api.Response") } - return Buffer.from(arg.serializeBinary()); + return Buffer.from(arg.serializeBinary()) } function deserialize_api_Response(buffer_arg) { - return api_pb.Response.deserializeBinary(new Uint8Array(buffer_arg)); + return api_pb.Response.deserializeBinary(new Uint8Array(buffer_arg)) } function serialize_api_TxnContext(arg) { if (!(arg instanceof api_pb.TxnContext)) { - throw new Error('Expected argument of type api.TxnContext'); + throw new Error("Expected argument of type api.TxnContext") } - return Buffer.from(arg.serializeBinary()); + return Buffer.from(arg.serializeBinary()) } function deserialize_api_TxnContext(buffer_arg) { - return api_pb.TxnContext.deserializeBinary(new Uint8Array(buffer_arg)); + return api_pb.TxnContext.deserializeBinary(new Uint8Array(buffer_arg)) } function serialize_api_Version(arg) { if (!(arg instanceof api_pb.Version)) { - throw new Error('Expected argument of type api.Version'); + throw new Error("Expected argument of type api.Version") } - return Buffer.from(arg.serializeBinary()); + return Buffer.from(arg.serializeBinary()) } function deserialize_api_Version(buffer_arg) { - return api_pb.Version.deserializeBinary(new Uint8Array(buffer_arg)); + return api_pb.Version.deserializeBinary(new Uint8Array(buffer_arg)) } - // Graph response. -var DgraphService = exports.DgraphService = { +var DgraphService = (exports.DgraphService = { login: { - path: '/api.Dgraph/Login', + path: "/api.Dgraph/Login", requestStream: false, responseStream: false, requestType: api_pb.LoginRequest, @@ -128,7 +127,7 @@ var DgraphService = exports.DgraphService = { responseDeserialize: deserialize_api_Response, }, query: { - path: '/api.Dgraph/Query', + path: "/api.Dgraph/Query", requestStream: false, responseStream: false, requestType: api_pb.Request, @@ -139,7 +138,7 @@ var DgraphService = exports.DgraphService = { responseDeserialize: deserialize_api_Response, }, alter: { - path: '/api.Dgraph/Alter', + path: "/api.Dgraph/Alter", requestStream: false, responseStream: false, requestType: api_pb.Operation, @@ -150,7 +149,7 @@ var DgraphService = exports.DgraphService = { responseDeserialize: deserialize_api_Payload, }, commitOrAbort: { - path: '/api.Dgraph/CommitOrAbort', + path: "/api.Dgraph/CommitOrAbort", requestStream: false, responseStream: false, requestType: api_pb.TxnContext, @@ -161,7 +160,7 @@ var DgraphService = exports.DgraphService = { responseDeserialize: deserialize_api_TxnContext, }, checkVersion: { - path: '/api.Dgraph/CheckVersion', + path: "/api.Dgraph/CheckVersion", requestStream: false, responseStream: false, requestType: api_pb.Check, @@ -171,6 +170,6 @@ var DgraphService = exports.DgraphService = { responseSerialize: serialize_api_Version, responseDeserialize: deserialize_api_Version, }, -}; +}) -exports.DgraphClient = grpc.makeGenericClientConstructor(DgraphService); +exports.DgraphClient = grpc.makeGenericClientConstructor(DgraphService) diff --git a/generated/api_pb.d.ts b/generated/api_pb.d.ts index ca90758..e4327a0 100644 --- a/generated/api_pb.d.ts +++ b/generated/api_pb.d.ts @@ -1,575 +1,602 @@ // package: api // file: api.proto -import * as jspb from "google-protobuf"; +import * as jspb from "google-protobuf" export class Request extends jspb.Message { - getStartTs(): number; - setStartTs(value: number): void; + getStartTs(): number + setStartTs(value: number): void - getQuery(): string; - setQuery(value: string): void; + getQuery(): string + setQuery(value: string): void - getVarsMap(): jspb.Map; - clearVarsMap(): void; - getReadOnly(): boolean; - setReadOnly(value: boolean): void; + getVarsMap(): jspb.Map + clearVarsMap(): void + getReadOnly(): boolean + setReadOnly(value: boolean): void - getBestEffort(): boolean; - setBestEffort(value: boolean): void; + getBestEffort(): boolean + setBestEffort(value: boolean): void - clearMutationsList(): void; - getMutationsList(): Array; - setMutationsList(value: Array): void; - addMutations(value?: Mutation, index?: number): Mutation; + clearMutationsList(): void + getMutationsList(): Array + setMutationsList(value: Array): void + addMutations(value?: Mutation, index?: number): Mutation - getCommitNow(): boolean; - setCommitNow(value: boolean): void; + getCommitNow(): boolean + setCommitNow(value: boolean): void - getRespFormat(): Request.RespFormatMap[keyof Request.RespFormatMap]; - setRespFormat(value: Request.RespFormatMap[keyof Request.RespFormatMap]): void; + getRespFormat(): Request.RespFormatMap[keyof Request.RespFormatMap] + setRespFormat(value: Request.RespFormatMap[keyof Request.RespFormatMap]): void - getHash(): string; - setHash(value: string): void; + getHash(): string + setHash(value: string): void - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Request.AsObject; - static toObject(includeInstance: boolean, msg: Request): Request.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Request, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Request; - static deserializeBinaryFromReader(message: Request, reader: jspb.BinaryReader): Request; + serializeBinary(): Uint8Array + toObject(includeInstance?: boolean): Request.AsObject + static toObject(includeInstance: boolean, msg: Request): Request.AsObject + static extensions: { [key: number]: jspb.ExtensionFieldInfo } + static extensionsBinary: { + [key: number]: jspb.ExtensionFieldBinaryInfo + } + static serializeBinaryToWriter(message: Request, writer: jspb.BinaryWriter): void + static deserializeBinary(bytes: Uint8Array): Request + static deserializeBinaryFromReader(message: Request, reader: jspb.BinaryReader): Request } export namespace Request { export type AsObject = { - startTs: number, - query: string, - varsMap: Array<[string, string]>, - readOnly: boolean, - bestEffort: boolean, - mutationsList: Array, - commitNow: boolean, - respFormat: Request.RespFormatMap[keyof Request.RespFormatMap], - hash: string, + startTs: number + query: string + varsMap: Array<[string, string]> + readOnly: boolean + bestEffort: boolean + mutationsList: Array + commitNow: boolean + respFormat: Request.RespFormatMap[keyof Request.RespFormatMap] + hash: string } export interface RespFormatMap { - JSON: 0; - RDF: 1; + JSON: 0 + RDF: 1 } - export const RespFormat: RespFormatMap; + export const RespFormat: RespFormatMap } export class Uids extends jspb.Message { - clearUidsList(): void; - getUidsList(): Array; - setUidsList(value: Array): void; - addUids(value: string, index?: number): string; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Uids.AsObject; - static toObject(includeInstance: boolean, msg: Uids): Uids.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Uids, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Uids; - static deserializeBinaryFromReader(message: Uids, reader: jspb.BinaryReader): Uids; + clearUidsList(): void + getUidsList(): Array + setUidsList(value: Array): void + addUids(value: string, index?: number): string + + serializeBinary(): Uint8Array + toObject(includeInstance?: boolean): Uids.AsObject + static toObject(includeInstance: boolean, msg: Uids): Uids.AsObject + static extensions: { [key: number]: jspb.ExtensionFieldInfo } + static extensionsBinary: { + [key: number]: jspb.ExtensionFieldBinaryInfo + } + static serializeBinaryToWriter(message: Uids, writer: jspb.BinaryWriter): void + static deserializeBinary(bytes: Uint8Array): Uids + static deserializeBinaryFromReader(message: Uids, reader: jspb.BinaryReader): Uids } export namespace Uids { export type AsObject = { - uidsList: Array, + uidsList: Array } } export class ListOfString extends jspb.Message { - clearValueList(): void; - getValueList(): Array; - setValueList(value: Array): void; - addValue(value: string, index?: number): string; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): ListOfString.AsObject; - static toObject(includeInstance: boolean, msg: ListOfString): ListOfString.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: ListOfString, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): ListOfString; - static deserializeBinaryFromReader(message: ListOfString, reader: jspb.BinaryReader): ListOfString; + clearValueList(): void + getValueList(): Array + setValueList(value: Array): void + addValue(value: string, index?: number): string + + serializeBinary(): Uint8Array + toObject(includeInstance?: boolean): ListOfString.AsObject + static toObject(includeInstance: boolean, msg: ListOfString): ListOfString.AsObject + static extensions: { [key: number]: jspb.ExtensionFieldInfo } + static extensionsBinary: { + [key: number]: jspb.ExtensionFieldBinaryInfo + } + static serializeBinaryToWriter(message: ListOfString, writer: jspb.BinaryWriter): void + static deserializeBinary(bytes: Uint8Array): ListOfString + static deserializeBinaryFromReader(message: ListOfString, reader: jspb.BinaryReader): ListOfString } export namespace ListOfString { export type AsObject = { - valueList: Array, + valueList: Array } } export class Response extends jspb.Message { - getJson(): Uint8Array | string; - getJson_asU8(): Uint8Array; - getJson_asB64(): string; - setJson(value: Uint8Array | string): void; - - hasTxn(): boolean; - clearTxn(): void; - getTxn(): TxnContext | undefined; - setTxn(value?: TxnContext): void; - - hasLatency(): boolean; - clearLatency(): void; - getLatency(): Latency | undefined; - setLatency(value?: Latency): void; - - hasMetrics(): boolean; - clearMetrics(): void; - getMetrics(): Metrics | undefined; - setMetrics(value?: Metrics): void; - - getUidsMap(): jspb.Map; - clearUidsMap(): void; - getRdf(): Uint8Array | string; - getRdf_asU8(): Uint8Array; - getRdf_asB64(): string; - setRdf(value: Uint8Array | string): void; - - getHdrsMap(): jspb.Map; - clearHdrsMap(): void; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Response.AsObject; - static toObject(includeInstance: boolean, msg: Response): Response.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Response, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Response; - static deserializeBinaryFromReader(message: Response, reader: jspb.BinaryReader): Response; + getJson(): Uint8Array | string + getJson_asU8(): Uint8Array + getJson_asB64(): string + setJson(value: Uint8Array | string): void + + hasTxn(): boolean + clearTxn(): void + getTxn(): TxnContext | undefined + setTxn(value?: TxnContext): void + + hasLatency(): boolean + clearLatency(): void + getLatency(): Latency | undefined + setLatency(value?: Latency): void + + hasMetrics(): boolean + clearMetrics(): void + getMetrics(): Metrics | undefined + setMetrics(value?: Metrics): void + + getUidsMap(): jspb.Map + clearUidsMap(): void + getRdf(): Uint8Array | string + getRdf_asU8(): Uint8Array + getRdf_asB64(): string + setRdf(value: Uint8Array | string): void + + getHdrsMap(): jspb.Map + clearHdrsMap(): void + serializeBinary(): Uint8Array + toObject(includeInstance?: boolean): Response.AsObject + static toObject(includeInstance: boolean, msg: Response): Response.AsObject + static extensions: { [key: number]: jspb.ExtensionFieldInfo } + static extensionsBinary: { + [key: number]: jspb.ExtensionFieldBinaryInfo + } + static serializeBinaryToWriter(message: Response, writer: jspb.BinaryWriter): void + static deserializeBinary(bytes: Uint8Array): Response + static deserializeBinaryFromReader(message: Response, reader: jspb.BinaryReader): Response } export namespace Response { export type AsObject = { - json: Uint8Array | string, - txn?: TxnContext.AsObject, - latency?: Latency.AsObject, - metrics?: Metrics.AsObject, - uidsMap: Array<[string, string]>, - rdf: Uint8Array | string, - hdrsMap: Array<[string, ListOfString.AsObject]>, + json: Uint8Array | string + txn?: TxnContext.AsObject + latency?: Latency.AsObject + metrics?: Metrics.AsObject + uidsMap: Array<[string, string]> + rdf: Uint8Array | string + hdrsMap: Array<[string, ListOfString.AsObject]> } } export class Mutation extends jspb.Message { - getSetJson(): Uint8Array | string; - getSetJson_asU8(): Uint8Array; - getSetJson_asB64(): string; - setSetJson(value: Uint8Array | string): void; - - getDeleteJson(): Uint8Array | string; - getDeleteJson_asU8(): Uint8Array; - getDeleteJson_asB64(): string; - setDeleteJson(value: Uint8Array | string): void; - - getSetNquads(): Uint8Array | string; - getSetNquads_asU8(): Uint8Array; - getSetNquads_asB64(): string; - setSetNquads(value: Uint8Array | string): void; - - getDelNquads(): Uint8Array | string; - getDelNquads_asU8(): Uint8Array; - getDelNquads_asB64(): string; - setDelNquads(value: Uint8Array | string): void; - - clearSetList(): void; - getSetList(): Array; - setSetList(value: Array): void; - addSet(value?: NQuad, index?: number): NQuad; - - clearDelList(): void; - getDelList(): Array; - setDelList(value: Array): void; - addDel(value?: NQuad, index?: number): NQuad; - - getCond(): string; - setCond(value: string): void; - - getCommitNow(): boolean; - setCommitNow(value: boolean): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Mutation.AsObject; - static toObject(includeInstance: boolean, msg: Mutation): Mutation.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Mutation, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Mutation; - static deserializeBinaryFromReader(message: Mutation, reader: jspb.BinaryReader): Mutation; + getSetJson(): Uint8Array | string + getSetJson_asU8(): Uint8Array + getSetJson_asB64(): string + setSetJson(value: Uint8Array | string): void + + getDeleteJson(): Uint8Array | string + getDeleteJson_asU8(): Uint8Array + getDeleteJson_asB64(): string + setDeleteJson(value: Uint8Array | string): void + + getSetNquads(): Uint8Array | string + getSetNquads_asU8(): Uint8Array + getSetNquads_asB64(): string + setSetNquads(value: Uint8Array | string): void + + getDelNquads(): Uint8Array | string + getDelNquads_asU8(): Uint8Array + getDelNquads_asB64(): string + setDelNquads(value: Uint8Array | string): void + + clearSetList(): void + getSetList(): Array + setSetList(value: Array): void + addSet(value?: NQuad, index?: number): NQuad + + clearDelList(): void + getDelList(): Array + setDelList(value: Array): void + addDel(value?: NQuad, index?: number): NQuad + + getCond(): string + setCond(value: string): void + + getCommitNow(): boolean + setCommitNow(value: boolean): void + + serializeBinary(): Uint8Array + toObject(includeInstance?: boolean): Mutation.AsObject + static toObject(includeInstance: boolean, msg: Mutation): Mutation.AsObject + static extensions: { [key: number]: jspb.ExtensionFieldInfo } + static extensionsBinary: { + [key: number]: jspb.ExtensionFieldBinaryInfo + } + static serializeBinaryToWriter(message: Mutation, writer: jspb.BinaryWriter): void + static deserializeBinary(bytes: Uint8Array): Mutation + static deserializeBinaryFromReader(message: Mutation, reader: jspb.BinaryReader): Mutation } export namespace Mutation { export type AsObject = { - setJson: Uint8Array | string, - deleteJson: Uint8Array | string, - setNquads: Uint8Array | string, - delNquads: Uint8Array | string, - setList: Array, - delList: Array, - cond: string, - commitNow: boolean, + setJson: Uint8Array | string + deleteJson: Uint8Array | string + setNquads: Uint8Array | string + delNquads: Uint8Array | string + setList: Array + delList: Array + cond: string + commitNow: boolean } } export class Operation extends jspb.Message { - getSchema(): string; - setSchema(value: string): void; + getSchema(): string + setSchema(value: string): void - getDropAttr(): string; - setDropAttr(value: string): void; + getDropAttr(): string + setDropAttr(value: string): void - getDropAll(): boolean; - setDropAll(value: boolean): void; + getDropAll(): boolean + setDropAll(value: boolean): void - getDropOp(): Operation.DropOpMap[keyof Operation.DropOpMap]; - setDropOp(value: Operation.DropOpMap[keyof Operation.DropOpMap]): void; + getDropOp(): Operation.DropOpMap[keyof Operation.DropOpMap] + setDropOp(value: Operation.DropOpMap[keyof Operation.DropOpMap]): void - getDropValue(): string; - setDropValue(value: string): void; + getDropValue(): string + setDropValue(value: string): void - getRunInBackground(): boolean; - setRunInBackground(value: boolean): void; + getRunInBackground(): boolean + setRunInBackground(value: boolean): void - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Operation.AsObject; - static toObject(includeInstance: boolean, msg: Operation): Operation.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Operation, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Operation; - static deserializeBinaryFromReader(message: Operation, reader: jspb.BinaryReader): Operation; + serializeBinary(): Uint8Array + toObject(includeInstance?: boolean): Operation.AsObject + static toObject(includeInstance: boolean, msg: Operation): Operation.AsObject + static extensions: { [key: number]: jspb.ExtensionFieldInfo } + static extensionsBinary: { + [key: number]: jspb.ExtensionFieldBinaryInfo + } + static serializeBinaryToWriter(message: Operation, writer: jspb.BinaryWriter): void + static deserializeBinary(bytes: Uint8Array): Operation + static deserializeBinaryFromReader(message: Operation, reader: jspb.BinaryReader): Operation } export namespace Operation { export type AsObject = { - schema: string, - dropAttr: string, - dropAll: boolean, - dropOp: Operation.DropOpMap[keyof Operation.DropOpMap], - dropValue: string, - runInBackground: boolean, + schema: string + dropAttr: string + dropAll: boolean + dropOp: Operation.DropOpMap[keyof Operation.DropOpMap] + dropValue: string + runInBackground: boolean } export interface DropOpMap { - NONE: 0; - ALL: 1; - DATA: 2; - ATTR: 3; - TYPE: 4; + NONE: 0 + ALL: 1 + DATA: 2 + ATTR: 3 + TYPE: 4 } - export const DropOp: DropOpMap; + export const DropOp: DropOpMap } export class Payload extends jspb.Message { - getData(): Uint8Array | string; - getData_asU8(): Uint8Array; - getData_asB64(): string; - setData(value: Uint8Array | string): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Payload.AsObject; - static toObject(includeInstance: boolean, msg: Payload): Payload.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Payload, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Payload; - static deserializeBinaryFromReader(message: Payload, reader: jspb.BinaryReader): Payload; + getData(): Uint8Array | string + getData_asU8(): Uint8Array + getData_asB64(): string + setData(value: Uint8Array | string): void + + serializeBinary(): Uint8Array + toObject(includeInstance?: boolean): Payload.AsObject + static toObject(includeInstance: boolean, msg: Payload): Payload.AsObject + static extensions: { [key: number]: jspb.ExtensionFieldInfo } + static extensionsBinary: { + [key: number]: jspb.ExtensionFieldBinaryInfo + } + static serializeBinaryToWriter(message: Payload, writer: jspb.BinaryWriter): void + static deserializeBinary(bytes: Uint8Array): Payload + static deserializeBinaryFromReader(message: Payload, reader: jspb.BinaryReader): Payload } export namespace Payload { export type AsObject = { - data: Uint8Array | string, + data: Uint8Array | string } } export class TxnContext extends jspb.Message { - getStartTs(): number; - setStartTs(value: number): void; - - getCommitTs(): number; - setCommitTs(value: number): void; - - getAborted(): boolean; - setAborted(value: boolean): void; - - clearKeysList(): void; - getKeysList(): Array; - setKeysList(value: Array): void; - addKeys(value: string, index?: number): string; - - clearPredsList(): void; - getPredsList(): Array; - setPredsList(value: Array): void; - addPreds(value: string, index?: number): string; - - getHash(): string; - setHash(value: string): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): TxnContext.AsObject; - static toObject(includeInstance: boolean, msg: TxnContext): TxnContext.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: TxnContext, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): TxnContext; - static deserializeBinaryFromReader(message: TxnContext, reader: jspb.BinaryReader): TxnContext; + getStartTs(): number + setStartTs(value: number): void + + getCommitTs(): number + setCommitTs(value: number): void + + getAborted(): boolean + setAborted(value: boolean): void + + clearKeysList(): void + getKeysList(): Array + setKeysList(value: Array): void + addKeys(value: string, index?: number): string + + clearPredsList(): void + getPredsList(): Array + setPredsList(value: Array): void + addPreds(value: string, index?: number): string + + getHash(): string + setHash(value: string): void + + serializeBinary(): Uint8Array + toObject(includeInstance?: boolean): TxnContext.AsObject + static toObject(includeInstance: boolean, msg: TxnContext): TxnContext.AsObject + static extensions: { [key: number]: jspb.ExtensionFieldInfo } + static extensionsBinary: { + [key: number]: jspb.ExtensionFieldBinaryInfo + } + static serializeBinaryToWriter(message: TxnContext, writer: jspb.BinaryWriter): void + static deserializeBinary(bytes: Uint8Array): TxnContext + static deserializeBinaryFromReader(message: TxnContext, reader: jspb.BinaryReader): TxnContext } export namespace TxnContext { export type AsObject = { - startTs: number, - commitTs: number, - aborted: boolean, - keysList: Array, - predsList: Array, - hash: string, + startTs: number + commitTs: number + aborted: boolean + keysList: Array + predsList: Array + hash: string } } export class Check extends jspb.Message { - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Check.AsObject; - static toObject(includeInstance: boolean, msg: Check): Check.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Check, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Check; - static deserializeBinaryFromReader(message: Check, reader: jspb.BinaryReader): Check; + serializeBinary(): Uint8Array + toObject(includeInstance?: boolean): Check.AsObject + static toObject(includeInstance: boolean, msg: Check): Check.AsObject + static extensions: { [key: number]: jspb.ExtensionFieldInfo } + static extensionsBinary: { + [key: number]: jspb.ExtensionFieldBinaryInfo + } + static serializeBinaryToWriter(message: Check, writer: jspb.BinaryWriter): void + static deserializeBinary(bytes: Uint8Array): Check + static deserializeBinaryFromReader(message: Check, reader: jspb.BinaryReader): Check } export namespace Check { - export type AsObject = { - } + export type AsObject = object } export class Version extends jspb.Message { - getTag(): string; - setTag(value: string): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Version.AsObject; - static toObject(includeInstance: boolean, msg: Version): Version.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Version, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Version; - static deserializeBinaryFromReader(message: Version, reader: jspb.BinaryReader): Version; + getTag(): string + setTag(value: string): void + + serializeBinary(): Uint8Array + toObject(includeInstance?: boolean): Version.AsObject + static toObject(includeInstance: boolean, msg: Version): Version.AsObject + static extensions: { [key: number]: jspb.ExtensionFieldInfo } + static extensionsBinary: { + [key: number]: jspb.ExtensionFieldBinaryInfo + } + static serializeBinaryToWriter(message: Version, writer: jspb.BinaryWriter): void + static deserializeBinary(bytes: Uint8Array): Version + static deserializeBinaryFromReader(message: Version, reader: jspb.BinaryReader): Version } export namespace Version { export type AsObject = { - tag: string, + tag: string } } export class Latency extends jspb.Message { - getParsingNs(): number; - setParsingNs(value: number): void; + getParsingNs(): number + setParsingNs(value: number): void - getProcessingNs(): number; - setProcessingNs(value: number): void; + getProcessingNs(): number + setProcessingNs(value: number): void - getEncodingNs(): number; - setEncodingNs(value: number): void; + getEncodingNs(): number + setEncodingNs(value: number): void - getAssignTimestampNs(): number; - setAssignTimestampNs(value: number): void; + getAssignTimestampNs(): number + setAssignTimestampNs(value: number): void - getTotalNs(): number; - setTotalNs(value: number): void; + getTotalNs(): number + setTotalNs(value: number): void - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Latency.AsObject; - static toObject(includeInstance: boolean, msg: Latency): Latency.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Latency, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Latency; - static deserializeBinaryFromReader(message: Latency, reader: jspb.BinaryReader): Latency; + serializeBinary(): Uint8Array + toObject(includeInstance?: boolean): Latency.AsObject + static toObject(includeInstance: boolean, msg: Latency): Latency.AsObject + static extensions: { [key: number]: jspb.ExtensionFieldInfo } + static extensionsBinary: { + [key: number]: jspb.ExtensionFieldBinaryInfo + } + static serializeBinaryToWriter(message: Latency, writer: jspb.BinaryWriter): void + static deserializeBinary(bytes: Uint8Array): Latency + static deserializeBinaryFromReader(message: Latency, reader: jspb.BinaryReader): Latency } export namespace Latency { export type AsObject = { - parsingNs: number, - processingNs: number, - encodingNs: number, - assignTimestampNs: number, - totalNs: number, + parsingNs: number + processingNs: number + encodingNs: number + assignTimestampNs: number + totalNs: number } } export class Metrics extends jspb.Message { - getNumUidsMap(): jspb.Map; - clearNumUidsMap(): void; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Metrics.AsObject; - static toObject(includeInstance: boolean, msg: Metrics): Metrics.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Metrics, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Metrics; - static deserializeBinaryFromReader(message: Metrics, reader: jspb.BinaryReader): Metrics; + getNumUidsMap(): jspb.Map + clearNumUidsMap(): void + serializeBinary(): Uint8Array + toObject(includeInstance?: boolean): Metrics.AsObject + static toObject(includeInstance: boolean, msg: Metrics): Metrics.AsObject + static extensions: { [key: number]: jspb.ExtensionFieldInfo } + static extensionsBinary: { + [key: number]: jspb.ExtensionFieldBinaryInfo + } + static serializeBinaryToWriter(message: Metrics, writer: jspb.BinaryWriter): void + static deserializeBinary(bytes: Uint8Array): Metrics + static deserializeBinaryFromReader(message: Metrics, reader: jspb.BinaryReader): Metrics } export namespace Metrics { export type AsObject = { - numUidsMap: Array<[string, number]>, + numUidsMap: Array<[string, number]> } } export class NQuad extends jspb.Message { - getSubject(): string; - setSubject(value: string): void; + getSubject(): string + setSubject(value: string): void - getPredicate(): string; - setPredicate(value: string): void; + getPredicate(): string + setPredicate(value: string): void - getObjectId(): string; - setObjectId(value: string): void; + getObjectId(): string + setObjectId(value: string): void - hasObjectValue(): boolean; - clearObjectValue(): void; - getObjectValue(): Value | undefined; - setObjectValue(value?: Value): void; + hasObjectValue(): boolean + clearObjectValue(): void + getObjectValue(): Value | undefined + setObjectValue(value?: Value): void - getLang(): string; - setLang(value: string): void; + getLang(): string + setLang(value: string): void - clearFacetsList(): void; - getFacetsList(): Array; - setFacetsList(value: Array): void; - addFacets(value?: Facet, index?: number): Facet; + clearFacetsList(): void + getFacetsList(): Array + setFacetsList(value: Array): void + addFacets(value?: Facet, index?: number): Facet - getNamespace(): number; - setNamespace(value: number): void; + getNamespace(): number + setNamespace(value: number): void - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): NQuad.AsObject; - static toObject(includeInstance: boolean, msg: NQuad): NQuad.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: NQuad, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): NQuad; - static deserializeBinaryFromReader(message: NQuad, reader: jspb.BinaryReader): NQuad; + serializeBinary(): Uint8Array + toObject(includeInstance?: boolean): NQuad.AsObject + static toObject(includeInstance: boolean, msg: NQuad): NQuad.AsObject + static extensions: { [key: number]: jspb.ExtensionFieldInfo } + static extensionsBinary: { + [key: number]: jspb.ExtensionFieldBinaryInfo + } + static serializeBinaryToWriter(message: NQuad, writer: jspb.BinaryWriter): void + static deserializeBinary(bytes: Uint8Array): NQuad + static deserializeBinaryFromReader(message: NQuad, reader: jspb.BinaryReader): NQuad } export namespace NQuad { export type AsObject = { - subject: string, - predicate: string, - objectId: string, - objectValue?: Value.AsObject, - lang: string, - facetsList: Array, - namespace: number, + subject: string + predicate: string + objectId: string + objectValue?: Value.AsObject + lang: string + facetsList: Array + namespace: number } } export class Value extends jspb.Message { - hasDefaultVal(): boolean; - clearDefaultVal(): void; - getDefaultVal(): string; - setDefaultVal(value: string): void; - - hasBytesVal(): boolean; - clearBytesVal(): void; - getBytesVal(): Uint8Array | string; - getBytesVal_asU8(): Uint8Array; - getBytesVal_asB64(): string; - setBytesVal(value: Uint8Array | string): void; - - hasIntVal(): boolean; - clearIntVal(): void; - getIntVal(): number; - setIntVal(value: number): void; - - hasBoolVal(): boolean; - clearBoolVal(): void; - getBoolVal(): boolean; - setBoolVal(value: boolean): void; - - hasStrVal(): boolean; - clearStrVal(): void; - getStrVal(): string; - setStrVal(value: string): void; - - hasDoubleVal(): boolean; - clearDoubleVal(): void; - getDoubleVal(): number; - setDoubleVal(value: number): void; - - hasGeoVal(): boolean; - clearGeoVal(): void; - getGeoVal(): Uint8Array | string; - getGeoVal_asU8(): Uint8Array; - getGeoVal_asB64(): string; - setGeoVal(value: Uint8Array | string): void; - - hasDateVal(): boolean; - clearDateVal(): void; - getDateVal(): Uint8Array | string; - getDateVal_asU8(): Uint8Array; - getDateVal_asB64(): string; - setDateVal(value: Uint8Array | string): void; - - hasDatetimeVal(): boolean; - clearDatetimeVal(): void; - getDatetimeVal(): Uint8Array | string; - getDatetimeVal_asU8(): Uint8Array; - getDatetimeVal_asB64(): string; - setDatetimeVal(value: Uint8Array | string): void; - - hasPasswordVal(): boolean; - clearPasswordVal(): void; - getPasswordVal(): string; - setPasswordVal(value: string): void; - - hasUidVal(): boolean; - clearUidVal(): void; - getUidVal(): number; - setUidVal(value: number): void; - - hasVfloat32Val(): boolean; - clearVfloat32Val(): void; - getVfloat32Val(): Uint8Array | string; - getVfloat32Val_asU8(): Uint8Array; - getVfloat32Val_asB64(): string; - setVfloat32Val(value: Uint8Array | string): void; - - getValCase(): Value.ValCase; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Value.AsObject; - static toObject(includeInstance: boolean, msg: Value): Value.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Value, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Value; - static deserializeBinaryFromReader(message: Value, reader: jspb.BinaryReader): Value; + hasDefaultVal(): boolean + clearDefaultVal(): void + getDefaultVal(): string + setDefaultVal(value: string): void + + hasBytesVal(): boolean + clearBytesVal(): void + getBytesVal(): Uint8Array | string + getBytesVal_asU8(): Uint8Array + getBytesVal_asB64(): string + setBytesVal(value: Uint8Array | string): void + + hasIntVal(): boolean + clearIntVal(): void + getIntVal(): number + setIntVal(value: number): void + + hasBoolVal(): boolean + clearBoolVal(): void + getBoolVal(): boolean + setBoolVal(value: boolean): void + + hasStrVal(): boolean + clearStrVal(): void + getStrVal(): string + setStrVal(value: string): void + + hasDoubleVal(): boolean + clearDoubleVal(): void + getDoubleVal(): number + setDoubleVal(value: number): void + + hasGeoVal(): boolean + clearGeoVal(): void + getGeoVal(): Uint8Array | string + getGeoVal_asU8(): Uint8Array + getGeoVal_asB64(): string + setGeoVal(value: Uint8Array | string): void + + hasDateVal(): boolean + clearDateVal(): void + getDateVal(): Uint8Array | string + getDateVal_asU8(): Uint8Array + getDateVal_asB64(): string + setDateVal(value: Uint8Array | string): void + + hasDatetimeVal(): boolean + clearDatetimeVal(): void + getDatetimeVal(): Uint8Array | string + getDatetimeVal_asU8(): Uint8Array + getDatetimeVal_asB64(): string + setDatetimeVal(value: Uint8Array | string): void + + hasPasswordVal(): boolean + clearPasswordVal(): void + getPasswordVal(): string + setPasswordVal(value: string): void + + hasUidVal(): boolean + clearUidVal(): void + getUidVal(): number + setUidVal(value: number): void + + hasVfloat32Val(): boolean + clearVfloat32Val(): void + getVfloat32Val(): Uint8Array | string + getVfloat32Val_asU8(): Uint8Array + getVfloat32Val_asB64(): string + setVfloat32Val(value: Uint8Array | string): void + + getValCase(): Value.ValCase + serializeBinary(): Uint8Array + toObject(includeInstance?: boolean): Value.AsObject + static toObject(includeInstance: boolean, msg: Value): Value.AsObject + static extensions: { [key: number]: jspb.ExtensionFieldInfo } + static extensionsBinary: { + [key: number]: jspb.ExtensionFieldBinaryInfo + } + static serializeBinaryToWriter(message: Value, writer: jspb.BinaryWriter): void + static deserializeBinary(bytes: Uint8Array): Value + static deserializeBinaryFromReader(message: Value, reader: jspb.BinaryReader): Value } export namespace Value { export type AsObject = { - defaultVal: string, - bytesVal: Uint8Array | string, - intVal: number, - boolVal: boolean, - strVal: string, - doubleVal: number, - geoVal: Uint8Array | string, - dateVal: Uint8Array | string, - datetimeVal: Uint8Array | string, - passwordVal: string, - uidVal: number, - vfloat32Val: Uint8Array | string, + defaultVal: string + bytesVal: Uint8Array | string + intVal: number + boolVal: boolean + strVal: string + doubleVal: number + geoVal: Uint8Array | string + dateVal: Uint8Array | string + datetimeVal: Uint8Array | string + passwordVal: string + uidVal: number + vfloat32Val: Uint8Array | string } export enum ValCase { @@ -590,108 +617,113 @@ export namespace Value { } export class Facet extends jspb.Message { - getKey(): string; - setKey(value: string): void; - - getValue(): Uint8Array | string; - getValue_asU8(): Uint8Array; - getValue_asB64(): string; - setValue(value: Uint8Array | string): void; - - getValType(): Facet.ValTypeMap[keyof Facet.ValTypeMap]; - setValType(value: Facet.ValTypeMap[keyof Facet.ValTypeMap]): void; - - clearTokensList(): void; - getTokensList(): Array; - setTokensList(value: Array): void; - addTokens(value: string, index?: number): string; - - getAlias(): string; - setAlias(value: string): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Facet.AsObject; - static toObject(includeInstance: boolean, msg: Facet): Facet.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Facet, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Facet; - static deserializeBinaryFromReader(message: Facet, reader: jspb.BinaryReader): Facet; + getKey(): string + setKey(value: string): void + + getValue(): Uint8Array | string + getValue_asU8(): Uint8Array + getValue_asB64(): string + setValue(value: Uint8Array | string): void + + getValType(): Facet.ValTypeMap[keyof Facet.ValTypeMap] + setValType(value: Facet.ValTypeMap[keyof Facet.ValTypeMap]): void + + clearTokensList(): void + getTokensList(): Array + setTokensList(value: Array): void + addTokens(value: string, index?: number): string + + getAlias(): string + setAlias(value: string): void + + serializeBinary(): Uint8Array + toObject(includeInstance?: boolean): Facet.AsObject + static toObject(includeInstance: boolean, msg: Facet): Facet.AsObject + static extensions: { [key: number]: jspb.ExtensionFieldInfo } + static extensionsBinary: { + [key: number]: jspb.ExtensionFieldBinaryInfo + } + static serializeBinaryToWriter(message: Facet, writer: jspb.BinaryWriter): void + static deserializeBinary(bytes: Uint8Array): Facet + static deserializeBinaryFromReader(message: Facet, reader: jspb.BinaryReader): Facet } export namespace Facet { export type AsObject = { - key: string, - value: Uint8Array | string, - valType: Facet.ValTypeMap[keyof Facet.ValTypeMap], - tokensList: Array, - alias: string, + key: string + value: Uint8Array | string + valType: Facet.ValTypeMap[keyof Facet.ValTypeMap] + tokensList: Array + alias: string } export interface ValTypeMap { - STRING: 0; - INT: 1; - FLOAT: 2; - BOOL: 3; - DATETIME: 4; + STRING: 0 + INT: 1 + FLOAT: 2 + BOOL: 3 + DATETIME: 4 } - export const ValType: ValTypeMap; + export const ValType: ValTypeMap } export class LoginRequest extends jspb.Message { - getUserid(): string; - setUserid(value: string): void; + getUserid(): string + setUserid(value: string): void - getPassword(): string; - setPassword(value: string): void; + getPassword(): string + setPassword(value: string): void - getRefreshToken(): string; - setRefreshToken(value: string): void; + getRefreshToken(): string + setRefreshToken(value: string): void - getNamespace(): number; - setNamespace(value: number): void; + getNamespace(): number + setNamespace(value: number): void - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): LoginRequest.AsObject; - static toObject(includeInstance: boolean, msg: LoginRequest): LoginRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: LoginRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): LoginRequest; - static deserializeBinaryFromReader(message: LoginRequest, reader: jspb.BinaryReader): LoginRequest; + serializeBinary(): Uint8Array + toObject(includeInstance?: boolean): LoginRequest.AsObject + static toObject(includeInstance: boolean, msg: LoginRequest): LoginRequest.AsObject + static extensions: { [key: number]: jspb.ExtensionFieldInfo } + static extensionsBinary: { + [key: number]: jspb.ExtensionFieldBinaryInfo + } + static serializeBinaryToWriter(message: LoginRequest, writer: jspb.BinaryWriter): void + static deserializeBinary(bytes: Uint8Array): LoginRequest + static deserializeBinaryFromReader(message: LoginRequest, reader: jspb.BinaryReader): LoginRequest } export namespace LoginRequest { export type AsObject = { - userid: string, - password: string, - refreshToken: string, - namespace: number, + userid: string + password: string + refreshToken: string + namespace: number } } export class Jwt extends jspb.Message { - getAccessJwt(): string; - setAccessJwt(value: string): void; - - getRefreshJwt(): string; - setRefreshJwt(value: string): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Jwt.AsObject; - static toObject(includeInstance: boolean, msg: Jwt): Jwt.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Jwt, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Jwt; - static deserializeBinaryFromReader(message: Jwt, reader: jspb.BinaryReader): Jwt; + getAccessJwt(): string + setAccessJwt(value: string): void + + getRefreshJwt(): string + setRefreshJwt(value: string): void + + serializeBinary(): Uint8Array + toObject(includeInstance?: boolean): Jwt.AsObject + static toObject(includeInstance: boolean, msg: Jwt): Jwt.AsObject + static extensions: { [key: number]: jspb.ExtensionFieldInfo } + static extensionsBinary: { + [key: number]: jspb.ExtensionFieldBinaryInfo + } + static serializeBinaryToWriter(message: Jwt, writer: jspb.BinaryWriter): void + static deserializeBinary(bytes: Uint8Array): Jwt + static deserializeBinaryFromReader(message: Jwt, reader: jspb.BinaryReader): Jwt } export namespace Jwt { export type AsObject = { - accessJwt: string, - refreshJwt: string, + accessJwt: string + refreshJwt: string } } - diff --git a/generated/api_pb.js b/generated/api_pb.js index 1e6fe60..c029cf7 100644 --- a/generated/api_pb.js +++ b/generated/api_pb.js @@ -8,31 +8,31 @@ */ // GENERATED CODE -- DO NOT EDIT! -var jspb = require('google-protobuf'); -var goog = jspb; -var global = Function('return this')(); - -goog.exportSymbol('proto.api.Check', null, global); -goog.exportSymbol('proto.api.Facet', null, global); -goog.exportSymbol('proto.api.Facet.ValType', null, global); -goog.exportSymbol('proto.api.Jwt', null, global); -goog.exportSymbol('proto.api.Latency', null, global); -goog.exportSymbol('proto.api.ListOfString', null, global); -goog.exportSymbol('proto.api.LoginRequest', null, global); -goog.exportSymbol('proto.api.Metrics', null, global); -goog.exportSymbol('proto.api.Mutation', null, global); -goog.exportSymbol('proto.api.NQuad', null, global); -goog.exportSymbol('proto.api.Operation', null, global); -goog.exportSymbol('proto.api.Operation.DropOp', null, global); -goog.exportSymbol('proto.api.Payload', null, global); -goog.exportSymbol('proto.api.Request', null, global); -goog.exportSymbol('proto.api.Request.RespFormat', null, global); -goog.exportSymbol('proto.api.Response', null, global); -goog.exportSymbol('proto.api.TxnContext', null, global); -goog.exportSymbol('proto.api.Uids', null, global); -goog.exportSymbol('proto.api.Value', null, global); -goog.exportSymbol('proto.api.Value.ValCase', null, global); -goog.exportSymbol('proto.api.Version', null, global); +var jspb = require("google-protobuf") +var goog = jspb +var global = Function("return this")() + +goog.exportSymbol("proto.api.Check", null, global) +goog.exportSymbol("proto.api.Facet", null, global) +goog.exportSymbol("proto.api.Facet.ValType", null, global) +goog.exportSymbol("proto.api.Jwt", null, global) +goog.exportSymbol("proto.api.Latency", null, global) +goog.exportSymbol("proto.api.ListOfString", null, global) +goog.exportSymbol("proto.api.LoginRequest", null, global) +goog.exportSymbol("proto.api.Metrics", null, global) +goog.exportSymbol("proto.api.Mutation", null, global) +goog.exportSymbol("proto.api.NQuad", null, global) +goog.exportSymbol("proto.api.Operation", null, global) +goog.exportSymbol("proto.api.Operation.DropOp", null, global) +goog.exportSymbol("proto.api.Payload", null, global) +goog.exportSymbol("proto.api.Request", null, global) +goog.exportSymbol("proto.api.Request.RespFormat", null, global) +goog.exportSymbol("proto.api.Response", null, global) +goog.exportSymbol("proto.api.TxnContext", null, global) +goog.exportSymbol("proto.api.Uids", null, global) +goog.exportSymbol("proto.api.Value", null, global) +goog.exportSymbol("proto.api.Value.ValCase", null, global) +goog.exportSymbol("proto.api.Version", null, global) /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -43,16 +43,16 @@ goog.exportSymbol('proto.api.Version', null, global); * @extends {jspb.Message} * @constructor */ -proto.api.Request = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.api.Request.repeatedFields_, null); -}; -goog.inherits(proto.api.Request, jspb.Message); +proto.api.Request = function (opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.api.Request.repeatedFields_, null) +} +goog.inherits(proto.api.Request, jspb.Message) if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.api.Request.displayName = 'proto.api.Request'; + proto.api.Request.displayName = "proto.api.Request" } /** * Generated by JsPbCodeGenerator. @@ -64,16 +64,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.api.Uids = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.api.Uids.repeatedFields_, null); -}; -goog.inherits(proto.api.Uids, jspb.Message); +proto.api.Uids = function (opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.api.Uids.repeatedFields_, null) +} +goog.inherits(proto.api.Uids, jspb.Message) if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.api.Uids.displayName = 'proto.api.Uids'; + proto.api.Uids.displayName = "proto.api.Uids" } /** * Generated by JsPbCodeGenerator. @@ -85,16 +85,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.api.ListOfString = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.api.ListOfString.repeatedFields_, null); -}; -goog.inherits(proto.api.ListOfString, jspb.Message); +proto.api.ListOfString = function (opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.api.ListOfString.repeatedFields_, null) +} +goog.inherits(proto.api.ListOfString, jspb.Message) if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.api.ListOfString.displayName = 'proto.api.ListOfString'; + proto.api.ListOfString.displayName = "proto.api.ListOfString" } /** * Generated by JsPbCodeGenerator. @@ -106,16 +106,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.api.Response = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.api.Response, jspb.Message); +proto.api.Response = function (opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null) +} +goog.inherits(proto.api.Response, jspb.Message) if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.api.Response.displayName = 'proto.api.Response'; + proto.api.Response.displayName = "proto.api.Response" } /** * Generated by JsPbCodeGenerator. @@ -127,16 +127,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.api.Mutation = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.api.Mutation.repeatedFields_, null); -}; -goog.inherits(proto.api.Mutation, jspb.Message); +proto.api.Mutation = function (opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.api.Mutation.repeatedFields_, null) +} +goog.inherits(proto.api.Mutation, jspb.Message) if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.api.Mutation.displayName = 'proto.api.Mutation'; + proto.api.Mutation.displayName = "proto.api.Mutation" } /** * Generated by JsPbCodeGenerator. @@ -148,16 +148,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.api.Operation = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.api.Operation, jspb.Message); +proto.api.Operation = function (opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null) +} +goog.inherits(proto.api.Operation, jspb.Message) if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.api.Operation.displayName = 'proto.api.Operation'; + proto.api.Operation.displayName = "proto.api.Operation" } /** * Generated by JsPbCodeGenerator. @@ -169,16 +169,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.api.Payload = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.api.Payload, jspb.Message); +proto.api.Payload = function (opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null) +} +goog.inherits(proto.api.Payload, jspb.Message) if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.api.Payload.displayName = 'proto.api.Payload'; + proto.api.Payload.displayName = "proto.api.Payload" } /** * Generated by JsPbCodeGenerator. @@ -190,16 +190,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.api.TxnContext = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.api.TxnContext.repeatedFields_, null); -}; -goog.inherits(proto.api.TxnContext, jspb.Message); +proto.api.TxnContext = function (opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.api.TxnContext.repeatedFields_, null) +} +goog.inherits(proto.api.TxnContext, jspb.Message) if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.api.TxnContext.displayName = 'proto.api.TxnContext'; + proto.api.TxnContext.displayName = "proto.api.TxnContext" } /** * Generated by JsPbCodeGenerator. @@ -211,16 +211,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.api.Check = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.api.Check, jspb.Message); +proto.api.Check = function (opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null) +} +goog.inherits(proto.api.Check, jspb.Message) if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.api.Check.displayName = 'proto.api.Check'; + proto.api.Check.displayName = "proto.api.Check" } /** * Generated by JsPbCodeGenerator. @@ -232,16 +232,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.api.Version = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.api.Version, jspb.Message); +proto.api.Version = function (opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null) +} +goog.inherits(proto.api.Version, jspb.Message) if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.api.Version.displayName = 'proto.api.Version'; + proto.api.Version.displayName = "proto.api.Version" } /** * Generated by JsPbCodeGenerator. @@ -253,16 +253,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.api.Latency = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.api.Latency, jspb.Message); +proto.api.Latency = function (opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null) +} +goog.inherits(proto.api.Latency, jspb.Message) if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.api.Latency.displayName = 'proto.api.Latency'; + proto.api.Latency.displayName = "proto.api.Latency" } /** * Generated by JsPbCodeGenerator. @@ -274,16 +274,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.api.Metrics = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.api.Metrics, jspb.Message); +proto.api.Metrics = function (opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null) +} +goog.inherits(proto.api.Metrics, jspb.Message) if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.api.Metrics.displayName = 'proto.api.Metrics'; + proto.api.Metrics.displayName = "proto.api.Metrics" } /** * Generated by JsPbCodeGenerator. @@ -295,16 +295,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.api.NQuad = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.api.NQuad.repeatedFields_, null); -}; -goog.inherits(proto.api.NQuad, jspb.Message); +proto.api.NQuad = function (opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.api.NQuad.repeatedFields_, null) +} +goog.inherits(proto.api.NQuad, jspb.Message) if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.api.NQuad.displayName = 'proto.api.NQuad'; + proto.api.NQuad.displayName = "proto.api.NQuad" } /** * Generated by JsPbCodeGenerator. @@ -316,16 +316,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.api.Value = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.api.Value.oneofGroups_); -}; -goog.inherits(proto.api.Value, jspb.Message); +proto.api.Value = function (opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.api.Value.oneofGroups_) +} +goog.inherits(proto.api.Value, jspb.Message) if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.api.Value.displayName = 'proto.api.Value'; + proto.api.Value.displayName = "proto.api.Value" } /** * Generated by JsPbCodeGenerator. @@ -337,16 +337,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.api.Facet = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.api.Facet.repeatedFields_, null); -}; -goog.inherits(proto.api.Facet, jspb.Message); +proto.api.Facet = function (opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.api.Facet.repeatedFields_, null) +} +goog.inherits(proto.api.Facet, jspb.Message) if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.api.Facet.displayName = 'proto.api.Facet'; + proto.api.Facet.displayName = "proto.api.Facet" } /** * Generated by JsPbCodeGenerator. @@ -358,16 +358,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.api.LoginRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.api.LoginRequest, jspb.Message); +proto.api.LoginRequest = function (opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null) +} +goog.inherits(proto.api.LoginRequest, jspb.Message) if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.api.LoginRequest.displayName = 'proto.api.LoginRequest'; + proto.api.LoginRequest.displayName = "proto.api.LoginRequest" } /** * Generated by JsPbCodeGenerator. @@ -379,16 +379,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.api.Jwt = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.api.Jwt, jspb.Message); +proto.api.Jwt = function (opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null) +} +goog.inherits(proto.api.Jwt, jspb.Message) if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.api.Jwt.displayName = 'proto.api.Jwt'; + proto.api.Jwt.displayName = "proto.api.Jwt" } /** @@ -396,70 +396,69 @@ if (goog.DEBUG && !COMPILED) { * @private {!Array} * @const */ -proto.api.Request.repeatedFields_ = [12]; - - +proto.api.Request.repeatedFields_ = [12] if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.api.Request.prototype.toObject = function(opt_includeInstance) { - return proto.api.Request.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.api.Request} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.api.Request.toObject = function(includeInstance, msg) { - var f, obj = { - startTs: jspb.Message.getFieldWithDefault(msg, 1, 0), - query: jspb.Message.getFieldWithDefault(msg, 4, ""), - varsMap: (f = msg.getVarsMap()) ? f.toObject(includeInstance, undefined) : [], - readOnly: jspb.Message.getBooleanFieldWithDefault(msg, 6, false), - bestEffort: jspb.Message.getBooleanFieldWithDefault(msg, 7, false), - mutationsList: jspb.Message.toObjectList(msg.getMutationsList(), - proto.api.Mutation.toObject, includeInstance), - commitNow: jspb.Message.getBooleanFieldWithDefault(msg, 13, false), - respFormat: jspb.Message.getFieldWithDefault(msg, 14, 0), - hash: jspb.Message.getFieldWithDefault(msg, 15, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; + /** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ + proto.api.Request.prototype.toObject = function (opt_includeInstance) { + return proto.api.Request.toObject(opt_includeInstance, this) } - return obj; -}; -} + /** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.Request} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ + proto.api.Request.toObject = function (includeInstance, msg) { + var f, + obj = { + startTs: jspb.Message.getFieldWithDefault(msg, 1, 0), + query: jspb.Message.getFieldWithDefault(msg, 4, ""), + varsMap: (f = msg.getVarsMap()) ? f.toObject(includeInstance, undefined) : [], + readOnly: jspb.Message.getBooleanFieldWithDefault(msg, 6, false), + bestEffort: jspb.Message.getBooleanFieldWithDefault(msg, 7, false), + mutationsList: jspb.Message.toObjectList( + msg.getMutationsList(), + proto.api.Mutation.toObject, + includeInstance, + ), + commitNow: jspb.Message.getBooleanFieldWithDefault(msg, 13, false), + respFormat: jspb.Message.getFieldWithDefault(msg, 14, 0), + hash: jspb.Message.getFieldWithDefault(msg, 15, ""), + } + + if (includeInstance) { + obj.$jspbMessageInstance = msg + } + return obj + } +} /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.api.Request} */ -proto.api.Request.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.Request; - return proto.api.Request.deserializeBinaryFromReader(msg, reader); -}; - +proto.api.Request.deserializeBinary = function (bytes) { + var reader = new jspb.BinaryReader(bytes) + var msg = new proto.api.Request() + return proto.api.Request.deserializeBinaryFromReader(msg, reader) +} /** * Deserializes binary data (in protobuf wire format) from the @@ -468,71 +467,77 @@ proto.api.Request.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.api.Request} */ -proto.api.Request.deserializeBinaryFromReader = function(msg, reader) { +proto.api.Request.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { - break; + break } - var field = reader.getFieldNumber(); + var field = reader.getFieldNumber() switch (field) { - case 1: - var value = /** @type {number} */ (reader.readUint64()); - msg.setStartTs(value); - break; - case 4: - var value = /** @type {string} */ (reader.readString()); - msg.setQuery(value); - break; - case 5: - var value = msg.getVarsMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); - }); - break; - case 6: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setReadOnly(value); - break; - case 7: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setBestEffort(value); - break; - case 12: - var value = new proto.api.Mutation; - reader.readMessage(value,proto.api.Mutation.deserializeBinaryFromReader); - msg.addMutations(value); - break; - case 13: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setCommitNow(value); - break; - case 14: - var value = /** @type {!proto.api.Request.RespFormat} */ (reader.readEnum()); - msg.setRespFormat(value); - break; - case 15: - var value = /** @type {string} */ (reader.readString()); - msg.setHash(value); - break; - default: - reader.skipField(); - break; + case 1: + var value = /** @type {number} */ (reader.readUint64()) + msg.setStartTs(value) + break + case 4: + var value = /** @type {string} */ (reader.readString()) + msg.setQuery(value) + break + case 5: + var value = msg.getVarsMap() + reader.readMessage(value, function (message, reader) { + jspb.Map.deserializeBinary( + message, + reader, + jspb.BinaryReader.prototype.readString, + jspb.BinaryReader.prototype.readString, + null, + "", + "", + ) + }) + break + case 6: + var value = /** @type {boolean} */ (reader.readBool()) + msg.setReadOnly(value) + break + case 7: + var value = /** @type {boolean} */ (reader.readBool()) + msg.setBestEffort(value) + break + case 12: + var value = new proto.api.Mutation() + reader.readMessage(value, proto.api.Mutation.deserializeBinaryFromReader) + msg.addMutations(value) + break + case 13: + var value = /** @type {boolean} */ (reader.readBool()) + msg.setCommitNow(value) + break + case 14: + var value = /** @type {!proto.api.Request.RespFormat} */ (reader.readEnum()) + msg.setRespFormat(value) + break + case 15: + var value = /** @type {string} */ (reader.readString()) + msg.setHash(value) + break + default: + reader.skipField() + break } } - return msg; -}; - + return msg +} /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.Request.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.api.Request.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - +proto.api.Request.prototype.serializeBinary = function () { + var writer = new jspb.BinaryWriter() + proto.api.Request.serializeBinaryToWriter(this, writer) + return writer.getResultBuffer() +} /** * Serializes the given message to binary data (in protobuf wire @@ -541,115 +546,90 @@ proto.api.Request.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.Request.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getStartTs(); +proto.api.Request.serializeBinaryToWriter = function (message, writer) { + var f = undefined + f = message.getStartTs() if (f !== 0) { - writer.writeUint64( - 1, - f - ); + writer.writeUint64(1, f) } - f = message.getQuery(); + f = message.getQuery() if (f.length > 0) { - writer.writeString( - 4, - f - ); + writer.writeString(4, f) } - f = message.getVarsMap(true); + f = message.getVarsMap(true) if (f && f.getLength() > 0) { - f.serializeBinary(5, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + f.serializeBinary( + 5, + writer, + jspb.BinaryWriter.prototype.writeString, + jspb.BinaryWriter.prototype.writeString, + ) } - f = message.getReadOnly(); + f = message.getReadOnly() if (f) { - writer.writeBool( - 6, - f - ); + writer.writeBool(6, f) } - f = message.getBestEffort(); + f = message.getBestEffort() if (f) { - writer.writeBool( - 7, - f - ); + writer.writeBool(7, f) } - f = message.getMutationsList(); + f = message.getMutationsList() if (f.length > 0) { - writer.writeRepeatedMessage( - 12, - f, - proto.api.Mutation.serializeBinaryToWriter - ); + writer.writeRepeatedMessage(12, f, proto.api.Mutation.serializeBinaryToWriter) } - f = message.getCommitNow(); + f = message.getCommitNow() if (f) { - writer.writeBool( - 13, - f - ); + writer.writeBool(13, f) } - f = message.getRespFormat(); + f = message.getRespFormat() if (f !== 0.0) { - writer.writeEnum( - 14, - f - ); + writer.writeEnum(14, f) } - f = message.getHash(); + f = message.getHash() if (f.length > 0) { - writer.writeString( - 15, - f - ); + writer.writeString(15, f) } -}; - +} /** * @enum {number} */ proto.api.Request.RespFormat = { JSON: 0, - RDF: 1 -}; + RDF: 1, +} /** * optional uint64 start_ts = 1; * @return {number} */ -proto.api.Request.prototype.getStartTs = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - +proto.api.Request.prototype.getStartTs = function () { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)) +} /** * @param {number} value * @return {!proto.api.Request} returns this */ -proto.api.Request.prototype.setStartTs = function(value) { - return jspb.Message.setProto3IntField(this, 1, value); -}; - +proto.api.Request.prototype.setStartTs = function (value) { + return jspb.Message.setProto3IntField(this, 1, value) +} /** * optional string query = 4; * @return {string} */ -proto.api.Request.prototype.getQuery = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); -}; - +proto.api.Request.prototype.getQuery = function () { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")) +} /** * @param {string} value * @return {!proto.api.Request} returns this */ -proto.api.Request.prototype.setQuery = function(value) { - return jspb.Message.setProto3StringField(this, 4, value); -}; - +proto.api.Request.prototype.setQuery = function (value) { + return jspb.Message.setProto3StringField(this, 4, value) +} /** * map vars = 5; @@ -657,211 +637,194 @@ proto.api.Request.prototype.setQuery = function(value) { * empty, instead returning `undefined` * @return {!jspb.Map} */ -proto.api.Request.prototype.getVarsMap = function(opt_noLazyCreate) { +proto.api.Request.prototype.getVarsMap = function (opt_noLazyCreate) { return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 5, opt_noLazyCreate, - null)); -}; - + jspb.Message.getMapField(this, 5, opt_noLazyCreate, null) + ) +} /** * Clears values from the map. The map will be non-null. * @return {!proto.api.Request} returns this */ -proto.api.Request.prototype.clearVarsMap = function() { - this.getVarsMap().clear(); - return this;}; - +proto.api.Request.prototype.clearVarsMap = function () { + this.getVarsMap().clear() + return this +} /** * optional bool read_only = 6; * @return {boolean} */ -proto.api.Request.prototype.getReadOnly = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 6, false)); -}; - +proto.api.Request.prototype.getReadOnly = function () { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 6, false)) +} /** * @param {boolean} value * @return {!proto.api.Request} returns this */ -proto.api.Request.prototype.setReadOnly = function(value) { - return jspb.Message.setProto3BooleanField(this, 6, value); -}; - +proto.api.Request.prototype.setReadOnly = function (value) { + return jspb.Message.setProto3BooleanField(this, 6, value) +} /** * optional bool best_effort = 7; * @return {boolean} */ -proto.api.Request.prototype.getBestEffort = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 7, false)); -}; - +proto.api.Request.prototype.getBestEffort = function () { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 7, false)) +} /** * @param {boolean} value * @return {!proto.api.Request} returns this */ -proto.api.Request.prototype.setBestEffort = function(value) { - return jspb.Message.setProto3BooleanField(this, 7, value); -}; - +proto.api.Request.prototype.setBestEffort = function (value) { + return jspb.Message.setProto3BooleanField(this, 7, value) +} /** * repeated Mutation mutations = 12; * @return {!Array} */ -proto.api.Request.prototype.getMutationsList = function() { +proto.api.Request.prototype.getMutationsList = function () { return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.api.Mutation, 12)); -}; - + jspb.Message.getRepeatedWrapperField(this, proto.api.Mutation, 12) + ) +} /** * @param {!Array} value * @return {!proto.api.Request} returns this -*/ -proto.api.Request.prototype.setMutationsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 12, value); -}; - + */ +proto.api.Request.prototype.setMutationsList = function (value) { + return jspb.Message.setRepeatedWrapperField(this, 12, value) +} /** * @param {!proto.api.Mutation=} opt_value * @param {number=} opt_index * @return {!proto.api.Mutation} */ -proto.api.Request.prototype.addMutations = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 12, opt_value, proto.api.Mutation, opt_index); -}; - +proto.api.Request.prototype.addMutations = function (opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 12, opt_value, proto.api.Mutation, opt_index) +} /** * Clears the list making it empty but non-null. * @return {!proto.api.Request} returns this */ -proto.api.Request.prototype.clearMutationsList = function() { - return this.setMutationsList([]); -}; - +proto.api.Request.prototype.clearMutationsList = function () { + return this.setMutationsList([]) +} /** * optional bool commit_now = 13; * @return {boolean} */ -proto.api.Request.prototype.getCommitNow = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 13, false)); -}; - +proto.api.Request.prototype.getCommitNow = function () { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 13, false)) +} /** * @param {boolean} value * @return {!proto.api.Request} returns this */ -proto.api.Request.prototype.setCommitNow = function(value) { - return jspb.Message.setProto3BooleanField(this, 13, value); -}; - +proto.api.Request.prototype.setCommitNow = function (value) { + return jspb.Message.setProto3BooleanField(this, 13, value) +} /** * optional RespFormat resp_format = 14; * @return {!proto.api.Request.RespFormat} */ -proto.api.Request.prototype.getRespFormat = function() { - return /** @type {!proto.api.Request.RespFormat} */ (jspb.Message.getFieldWithDefault(this, 14, 0)); -}; - +proto.api.Request.prototype.getRespFormat = function () { + return /** @type {!proto.api.Request.RespFormat} */ ( + jspb.Message.getFieldWithDefault(this, 14, 0) + ) +} /** * @param {!proto.api.Request.RespFormat} value * @return {!proto.api.Request} returns this */ -proto.api.Request.prototype.setRespFormat = function(value) { - return jspb.Message.setProto3EnumField(this, 14, value); -}; - +proto.api.Request.prototype.setRespFormat = function (value) { + return jspb.Message.setProto3EnumField(this, 14, value) +} /** * optional string hash = 15; * @return {string} */ -proto.api.Request.prototype.getHash = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 15, "")); -}; - +proto.api.Request.prototype.getHash = function () { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 15, "")) +} /** * @param {string} value * @return {!proto.api.Request} returns this */ -proto.api.Request.prototype.setHash = function(value) { - return jspb.Message.setProto3StringField(this, 15, value); -}; - - +proto.api.Request.prototype.setHash = function (value) { + return jspb.Message.setProto3StringField(this, 15, value) +} /** * List of repeated fields within this message type. * @private {!Array} * @const */ -proto.api.Uids.repeatedFields_ = [1]; - - +proto.api.Uids.repeatedFields_ = [1] if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.api.Uids.prototype.toObject = function(opt_includeInstance) { - return proto.api.Uids.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.api.Uids} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.api.Uids.toObject = function(includeInstance, msg) { - var f, obj = { - uidsList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f - }; + /** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ + proto.api.Uids.prototype.toObject = function (opt_includeInstance) { + return proto.api.Uids.toObject(opt_includeInstance, this) + } - if (includeInstance) { - obj.$jspbMessageInstance = msg; + /** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.Uids} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ + proto.api.Uids.toObject = function (includeInstance, msg) { + var f, + obj = { + uidsList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f, + } + + if (includeInstance) { + obj.$jspbMessageInstance = msg + } + return obj } - return obj; -}; } - /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.api.Uids} */ -proto.api.Uids.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.Uids; - return proto.api.Uids.deserializeBinaryFromReader(msg, reader); -}; - +proto.api.Uids.deserializeBinary = function (bytes) { + var reader = new jspb.BinaryReader(bytes) + var msg = new proto.api.Uids() + return proto.api.Uids.deserializeBinaryFromReader(msg, reader) +} /** * Deserializes binary data (in protobuf wire format) from the @@ -870,36 +833,34 @@ proto.api.Uids.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.api.Uids} */ -proto.api.Uids.deserializeBinaryFromReader = function(msg, reader) { +proto.api.Uids.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { - break; + break } - var field = reader.getFieldNumber(); + var field = reader.getFieldNumber() switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.addUids(value); - break; - default: - reader.skipField(); - break; + case 1: + var value = /** @type {string} */ (reader.readString()) + msg.addUids(value) + break + default: + reader.skipField() + break } } - return msg; -}; - + return msg +} /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.Uids.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.api.Uids.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - +proto.api.Uids.prototype.serializeBinary = function () { + var writer = new jspb.BinaryWriter() + proto.api.Uids.serializeBinaryToWriter(this, writer) + return writer.getResultBuffer() +} /** * Serializes the given message to binary data (in protobuf wire @@ -908,116 +869,103 @@ proto.api.Uids.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.Uids.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getUidsList(); +proto.api.Uids.serializeBinaryToWriter = function (message, writer) { + var f = undefined + f = message.getUidsList() if (f.length > 0) { - writer.writeRepeatedString( - 1, - f - ); + writer.writeRepeatedString(1, f) } -}; - +} /** * repeated string uids = 1; * @return {!Array} */ -proto.api.Uids.prototype.getUidsList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); -}; - +proto.api.Uids.prototype.getUidsList = function () { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)) +} /** * @param {!Array} value * @return {!proto.api.Uids} returns this */ -proto.api.Uids.prototype.setUidsList = function(value) { - return jspb.Message.setField(this, 1, value || []); -}; - +proto.api.Uids.prototype.setUidsList = function (value) { + return jspb.Message.setField(this, 1, value || []) +} /** * @param {string} value * @param {number=} opt_index * @return {!proto.api.Uids} returns this */ -proto.api.Uids.prototype.addUids = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 1, value, opt_index); -}; - +proto.api.Uids.prototype.addUids = function (value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index) +} /** * Clears the list making it empty but non-null. * @return {!proto.api.Uids} returns this */ -proto.api.Uids.prototype.clearUidsList = function() { - return this.setUidsList([]); -}; - - +proto.api.Uids.prototype.clearUidsList = function () { + return this.setUidsList([]) +} /** * List of repeated fields within this message type. * @private {!Array} * @const */ -proto.api.ListOfString.repeatedFields_ = [1]; - - +proto.api.ListOfString.repeatedFields_ = [1] if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.api.ListOfString.prototype.toObject = function(opt_includeInstance) { - return proto.api.ListOfString.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.api.ListOfString} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.api.ListOfString.toObject = function(includeInstance, msg) { - var f, obj = { - valueList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f - }; + /** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ + proto.api.ListOfString.prototype.toObject = function (opt_includeInstance) { + return proto.api.ListOfString.toObject(opt_includeInstance, this) + } - if (includeInstance) { - obj.$jspbMessageInstance = msg; + /** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.ListOfString} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ + proto.api.ListOfString.toObject = function (includeInstance, msg) { + var f, + obj = { + valueList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f, + } + + if (includeInstance) { + obj.$jspbMessageInstance = msg + } + return obj } - return obj; -}; } - /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.api.ListOfString} */ -proto.api.ListOfString.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.ListOfString; - return proto.api.ListOfString.deserializeBinaryFromReader(msg, reader); -}; - +proto.api.ListOfString.deserializeBinary = function (bytes) { + var reader = new jspb.BinaryReader(bytes) + var msg = new proto.api.ListOfString() + return proto.api.ListOfString.deserializeBinaryFromReader(msg, reader) +} /** * Deserializes binary data (in protobuf wire format) from the @@ -1026,36 +974,34 @@ proto.api.ListOfString.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.api.ListOfString} */ -proto.api.ListOfString.deserializeBinaryFromReader = function(msg, reader) { +proto.api.ListOfString.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { - break; + break } - var field = reader.getFieldNumber(); + var field = reader.getFieldNumber() switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.addValue(value); - break; - default: - reader.skipField(); - break; + case 1: + var value = /** @type {string} */ (reader.readString()) + msg.addValue(value) + break + default: + reader.skipField() + break } } - return msg; -}; - + return msg +} /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.ListOfString.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.api.ListOfString.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - +proto.api.ListOfString.prototype.serializeBinary = function () { + var writer = new jspb.BinaryWriter() + proto.api.ListOfString.serializeBinaryToWriter(this, writer) + return writer.getResultBuffer() +} /** * Serializes the given message to binary data (in protobuf wire @@ -1064,115 +1010,104 @@ proto.api.ListOfString.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.ListOfString.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getValueList(); +proto.api.ListOfString.serializeBinaryToWriter = function (message, writer) { + var f = undefined + f = message.getValueList() if (f.length > 0) { - writer.writeRepeatedString( - 1, - f - ); + writer.writeRepeatedString(1, f) } -}; - +} /** * repeated string value = 1; * @return {!Array} */ -proto.api.ListOfString.prototype.getValueList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); -}; - +proto.api.ListOfString.prototype.getValueList = function () { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)) +} /** * @param {!Array} value * @return {!proto.api.ListOfString} returns this */ -proto.api.ListOfString.prototype.setValueList = function(value) { - return jspb.Message.setField(this, 1, value || []); -}; - +proto.api.ListOfString.prototype.setValueList = function (value) { + return jspb.Message.setField(this, 1, value || []) +} /** * @param {string} value * @param {number=} opt_index * @return {!proto.api.ListOfString} returns this */ -proto.api.ListOfString.prototype.addValue = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 1, value, opt_index); -}; - +proto.api.ListOfString.prototype.addValue = function (value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index) +} /** * Clears the list making it empty but non-null. * @return {!proto.api.ListOfString} returns this */ -proto.api.ListOfString.prototype.clearValueList = function() { - return this.setValueList([]); -}; - - - - +proto.api.ListOfString.prototype.clearValueList = function () { + return this.setValueList([]) +} if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.api.Response.prototype.toObject = function(opt_includeInstance) { - return proto.api.Response.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.api.Response} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.api.Response.toObject = function(includeInstance, msg) { - var f, obj = { - json: msg.getJson_asB64(), - txn: (f = msg.getTxn()) && proto.api.TxnContext.toObject(includeInstance, f), - latency: (f = msg.getLatency()) && proto.api.Latency.toObject(includeInstance, f), - metrics: (f = msg.getMetrics()) && proto.api.Metrics.toObject(includeInstance, f), - uidsMap: (f = msg.getUidsMap()) ? f.toObject(includeInstance, undefined) : [], - rdf: msg.getRdf_asB64(), - hdrsMap: (f = msg.getHdrsMap()) ? f.toObject(includeInstance, proto.api.ListOfString.toObject) : [] - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; + /** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ + proto.api.Response.prototype.toObject = function (opt_includeInstance) { + return proto.api.Response.toObject(opt_includeInstance, this) } - return obj; -}; -} + /** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.Response} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ + proto.api.Response.toObject = function (includeInstance, msg) { + var f, + obj = { + json: msg.getJson_asB64(), + txn: (f = msg.getTxn()) && proto.api.TxnContext.toObject(includeInstance, f), + latency: (f = msg.getLatency()) && proto.api.Latency.toObject(includeInstance, f), + metrics: (f = msg.getMetrics()) && proto.api.Metrics.toObject(includeInstance, f), + uidsMap: (f = msg.getUidsMap()) ? f.toObject(includeInstance, undefined) : [], + rdf: msg.getRdf_asB64(), + hdrsMap: (f = msg.getHdrsMap()) + ? f.toObject(includeInstance, proto.api.ListOfString.toObject) + : [], + } + + if (includeInstance) { + obj.$jspbMessageInstance = msg + } + return obj + } +} /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.api.Response} */ -proto.api.Response.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.Response; - return proto.api.Response.deserializeBinaryFromReader(msg, reader); -}; - +proto.api.Response.deserializeBinary = function (bytes) { + var reader = new jspb.BinaryReader(bytes) + var msg = new proto.api.Response() + return proto.api.Response.deserializeBinaryFromReader(msg, reader) +} /** * Deserializes binary data (in protobuf wire format) from the @@ -1181,67 +1116,81 @@ proto.api.Response.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.api.Response} */ -proto.api.Response.deserializeBinaryFromReader = function(msg, reader) { +proto.api.Response.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { - break; + break } - var field = reader.getFieldNumber(); + var field = reader.getFieldNumber() switch (field) { - case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setJson(value); - break; - case 2: - var value = new proto.api.TxnContext; - reader.readMessage(value,proto.api.TxnContext.deserializeBinaryFromReader); - msg.setTxn(value); - break; - case 3: - var value = new proto.api.Latency; - reader.readMessage(value,proto.api.Latency.deserializeBinaryFromReader); - msg.setLatency(value); - break; - case 4: - var value = new proto.api.Metrics; - reader.readMessage(value,proto.api.Metrics.deserializeBinaryFromReader); - msg.setMetrics(value); - break; - case 12: - var value = msg.getUidsMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); - }); - break; - case 13: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setRdf(value); - break; - case 14: - var value = msg.getHdrsMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.api.ListOfString.deserializeBinaryFromReader, "", new proto.api.ListOfString()); - }); - break; - default: - reader.skipField(); - break; + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()) + msg.setJson(value) + break + case 2: + var value = new proto.api.TxnContext() + reader.readMessage(value, proto.api.TxnContext.deserializeBinaryFromReader) + msg.setTxn(value) + break + case 3: + var value = new proto.api.Latency() + reader.readMessage(value, proto.api.Latency.deserializeBinaryFromReader) + msg.setLatency(value) + break + case 4: + var value = new proto.api.Metrics() + reader.readMessage(value, proto.api.Metrics.deserializeBinaryFromReader) + msg.setMetrics(value) + break + case 12: + var value = msg.getUidsMap() + reader.readMessage(value, function (message, reader) { + jspb.Map.deserializeBinary( + message, + reader, + jspb.BinaryReader.prototype.readString, + jspb.BinaryReader.prototype.readString, + null, + "", + "", + ) + }) + break + case 13: + var value = /** @type {!Uint8Array} */ (reader.readBytes()) + msg.setRdf(value) + break + case 14: + var value = msg.getHdrsMap() + reader.readMessage(value, function (message, reader) { + jspb.Map.deserializeBinary( + message, + reader, + jspb.BinaryReader.prototype.readString, + jspb.BinaryReader.prototype.readMessage, + proto.api.ListOfString.deserializeBinaryFromReader, + "", + new proto.api.ListOfString(), + ) + }) + break + default: + reader.skipField() + break } } - return msg; -}; - + return msg +} /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.Response.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.api.Response.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - +proto.api.Response.prototype.serializeBinary = function () { + var writer = new jspb.BinaryWriter() + proto.api.Response.serializeBinaryToWriter(this, writer) + return writer.getResultBuffer() +} /** * Serializes the given message to binary data (in protobuf wire @@ -1250,76 +1199,65 @@ proto.api.Response.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.Response.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getJson_asU8(); +proto.api.Response.serializeBinaryToWriter = function (message, writer) { + var f = undefined + f = message.getJson_asU8() if (f.length > 0) { - writer.writeBytes( - 1, - f - ); + writer.writeBytes(1, f) } - f = message.getTxn(); + f = message.getTxn() if (f != null) { - writer.writeMessage( - 2, - f, - proto.api.TxnContext.serializeBinaryToWriter - ); + writer.writeMessage(2, f, proto.api.TxnContext.serializeBinaryToWriter) } - f = message.getLatency(); + f = message.getLatency() if (f != null) { - writer.writeMessage( - 3, - f, - proto.api.Latency.serializeBinaryToWriter - ); + writer.writeMessage(3, f, proto.api.Latency.serializeBinaryToWriter) } - f = message.getMetrics(); + f = message.getMetrics() if (f != null) { - writer.writeMessage( - 4, - f, - proto.api.Metrics.serializeBinaryToWriter - ); + writer.writeMessage(4, f, proto.api.Metrics.serializeBinaryToWriter) } - f = message.getUidsMap(true); + f = message.getUidsMap(true) if (f && f.getLength() > 0) { - f.serializeBinary(12, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + f.serializeBinary( + 12, + writer, + jspb.BinaryWriter.prototype.writeString, + jspb.BinaryWriter.prototype.writeString, + ) } - f = message.getRdf_asU8(); + f = message.getRdf_asU8() if (f.length > 0) { - writer.writeBytes( - 13, - f - ); + writer.writeBytes(13, f) } - f = message.getHdrsMap(true); + f = message.getHdrsMap(true) if (f && f.getLength() > 0) { - f.serializeBinary(14, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.api.ListOfString.serializeBinaryToWriter); + f.serializeBinary( + 14, + writer, + jspb.BinaryWriter.prototype.writeString, + jspb.BinaryWriter.prototype.writeMessage, + proto.api.ListOfString.serializeBinaryToWriter, + ) } -}; - +} /** * optional bytes json = 1; * @return {!(string|Uint8Array)} */ -proto.api.Response.prototype.getJson = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - +proto.api.Response.prototype.getJson = function () { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")) +} /** * optional bytes json = 1; * This is a type-conversion wrapper around `getJson()` * @return {string} */ -proto.api.Response.prototype.getJson_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getJson())); -}; - +proto.api.Response.prototype.getJson_asB64 = function () { + return /** @type {string} */ (jspb.Message.bytesAsB64(this.getJson())) +} /** * optional bytes json = 1; @@ -1328,131 +1266,115 @@ proto.api.Response.prototype.getJson_asB64 = function() { * This is a type-conversion wrapper around `getJson()` * @return {!Uint8Array} */ -proto.api.Response.prototype.getJson_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getJson())); -}; - +proto.api.Response.prototype.getJson_asU8 = function () { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(this.getJson())) +} /** * @param {!(string|Uint8Array)} value * @return {!proto.api.Response} returns this */ -proto.api.Response.prototype.setJson = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); -}; - +proto.api.Response.prototype.setJson = function (value) { + return jspb.Message.setProto3BytesField(this, 1, value) +} /** * optional TxnContext txn = 2; * @return {?proto.api.TxnContext} */ -proto.api.Response.prototype.getTxn = function() { +proto.api.Response.prototype.getTxn = function () { return /** @type{?proto.api.TxnContext} */ ( - jspb.Message.getWrapperField(this, proto.api.TxnContext, 2)); -}; - + jspb.Message.getWrapperField(this, proto.api.TxnContext, 2) + ) +} /** * @param {?proto.api.TxnContext|undefined} value * @return {!proto.api.Response} returns this -*/ -proto.api.Response.prototype.setTxn = function(value) { - return jspb.Message.setWrapperField(this, 2, value); -}; - + */ +proto.api.Response.prototype.setTxn = function (value) { + return jspb.Message.setWrapperField(this, 2, value) +} /** * Clears the message field making it undefined. * @return {!proto.api.Response} returns this */ -proto.api.Response.prototype.clearTxn = function() { - return this.setTxn(undefined); -}; - +proto.api.Response.prototype.clearTxn = function () { + return this.setTxn(undefined) +} /** * Returns whether this field is set. * @return {boolean} */ -proto.api.Response.prototype.hasTxn = function() { - return jspb.Message.getField(this, 2) != null; -}; - +proto.api.Response.prototype.hasTxn = function () { + return jspb.Message.getField(this, 2) != null +} /** * optional Latency latency = 3; * @return {?proto.api.Latency} */ -proto.api.Response.prototype.getLatency = function() { - return /** @type{?proto.api.Latency} */ ( - jspb.Message.getWrapperField(this, proto.api.Latency, 3)); -}; - +proto.api.Response.prototype.getLatency = function () { + return /** @type{?proto.api.Latency} */ (jspb.Message.getWrapperField(this, proto.api.Latency, 3)) +} /** * @param {?proto.api.Latency|undefined} value * @return {!proto.api.Response} returns this -*/ -proto.api.Response.prototype.setLatency = function(value) { - return jspb.Message.setWrapperField(this, 3, value); -}; - + */ +proto.api.Response.prototype.setLatency = function (value) { + return jspb.Message.setWrapperField(this, 3, value) +} /** * Clears the message field making it undefined. * @return {!proto.api.Response} returns this */ -proto.api.Response.prototype.clearLatency = function() { - return this.setLatency(undefined); -}; - +proto.api.Response.prototype.clearLatency = function () { + return this.setLatency(undefined) +} /** * Returns whether this field is set. * @return {boolean} */ -proto.api.Response.prototype.hasLatency = function() { - return jspb.Message.getField(this, 3) != null; -}; - +proto.api.Response.prototype.hasLatency = function () { + return jspb.Message.getField(this, 3) != null +} /** * optional Metrics metrics = 4; * @return {?proto.api.Metrics} */ -proto.api.Response.prototype.getMetrics = function() { - return /** @type{?proto.api.Metrics} */ ( - jspb.Message.getWrapperField(this, proto.api.Metrics, 4)); -}; - +proto.api.Response.prototype.getMetrics = function () { + return /** @type{?proto.api.Metrics} */ (jspb.Message.getWrapperField(this, proto.api.Metrics, 4)) +} /** * @param {?proto.api.Metrics|undefined} value * @return {!proto.api.Response} returns this -*/ -proto.api.Response.prototype.setMetrics = function(value) { - return jspb.Message.setWrapperField(this, 4, value); -}; - + */ +proto.api.Response.prototype.setMetrics = function (value) { + return jspb.Message.setWrapperField(this, 4, value) +} /** * Clears the message field making it undefined. * @return {!proto.api.Response} returns this */ -proto.api.Response.prototype.clearMetrics = function() { - return this.setMetrics(undefined); -}; - +proto.api.Response.prototype.clearMetrics = function () { + return this.setMetrics(undefined) +} /** * Returns whether this field is set. * @return {boolean} */ -proto.api.Response.prototype.hasMetrics = function() { - return jspb.Message.getField(this, 4) != null; -}; - +proto.api.Response.prototype.hasMetrics = function () { + return jspb.Message.getField(this, 4) != null +} /** * map uids = 12; @@ -1460,41 +1382,37 @@ proto.api.Response.prototype.hasMetrics = function() { * empty, instead returning `undefined` * @return {!jspb.Map} */ -proto.api.Response.prototype.getUidsMap = function(opt_noLazyCreate) { +proto.api.Response.prototype.getUidsMap = function (opt_noLazyCreate) { return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 12, opt_noLazyCreate, - null)); -}; - + jspb.Message.getMapField(this, 12, opt_noLazyCreate, null) + ) +} /** * Clears values from the map. The map will be non-null. * @return {!proto.api.Response} returns this */ -proto.api.Response.prototype.clearUidsMap = function() { - this.getUidsMap().clear(); - return this;}; - +proto.api.Response.prototype.clearUidsMap = function () { + this.getUidsMap().clear() + return this +} /** * optional bytes rdf = 13; * @return {!(string|Uint8Array)} */ -proto.api.Response.prototype.getRdf = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 13, "")); -}; - +proto.api.Response.prototype.getRdf = function () { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 13, "")) +} /** * optional bytes rdf = 13; * This is a type-conversion wrapper around `getRdf()` * @return {string} */ -proto.api.Response.prototype.getRdf_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getRdf())); -}; - +proto.api.Response.prototype.getRdf_asB64 = function () { + return /** @type {string} */ (jspb.Message.bytesAsB64(this.getRdf())) +} /** * optional bytes rdf = 13; @@ -1503,20 +1421,17 @@ proto.api.Response.prototype.getRdf_asB64 = function() { * This is a type-conversion wrapper around `getRdf()` * @return {!Uint8Array} */ -proto.api.Response.prototype.getRdf_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getRdf())); -}; - +proto.api.Response.prototype.getRdf_asU8 = function () { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(this.getRdf())) +} /** * @param {!(string|Uint8Array)} value * @return {!proto.api.Response} returns this */ -proto.api.Response.prototype.setRdf = function(value) { - return jspb.Message.setProto3BytesField(this, 13, value); -}; - +proto.api.Response.prototype.setRdf = function (value) { + return jspb.Message.setProto3BytesField(this, 13, value) +} /** * map hdrs = 14; @@ -1524,92 +1439,92 @@ proto.api.Response.prototype.setRdf = function(value) { * empty, instead returning `undefined` * @return {!jspb.Map} */ -proto.api.Response.prototype.getHdrsMap = function(opt_noLazyCreate) { +proto.api.Response.prototype.getHdrsMap = function (opt_noLazyCreate) { return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 14, opt_noLazyCreate, - proto.api.ListOfString)); -}; - + jspb.Message.getMapField(this, 14, opt_noLazyCreate, proto.api.ListOfString) + ) +} /** * Clears values from the map. The map will be non-null. * @return {!proto.api.Response} returns this */ -proto.api.Response.prototype.clearHdrsMap = function() { - this.getHdrsMap().clear(); - return this;}; - - +proto.api.Response.prototype.clearHdrsMap = function () { + this.getHdrsMap().clear() + return this +} /** * List of repeated fields within this message type. * @private {!Array} * @const */ -proto.api.Mutation.repeatedFields_ = [5,6]; - - +proto.api.Mutation.repeatedFields_ = [5, 6] if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.api.Mutation.prototype.toObject = function(opt_includeInstance) { - return proto.api.Mutation.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.api.Mutation} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.api.Mutation.toObject = function(includeInstance, msg) { - var f, obj = { - setJson: msg.getSetJson_asB64(), - deleteJson: msg.getDeleteJson_asB64(), - setNquads: msg.getSetNquads_asB64(), - delNquads: msg.getDelNquads_asB64(), - setList: jspb.Message.toObjectList(msg.getSetList(), - proto.api.NQuad.toObject, includeInstance), - delList: jspb.Message.toObjectList(msg.getDelList(), - proto.api.NQuad.toObject, includeInstance), - cond: jspb.Message.getFieldWithDefault(msg, 9, ""), - commitNow: jspb.Message.getBooleanFieldWithDefault(msg, 14, false) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; + /** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ + proto.api.Mutation.prototype.toObject = function (opt_includeInstance) { + return proto.api.Mutation.toObject(opt_includeInstance, this) } - return obj; -}; -} + /** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.Mutation} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ + proto.api.Mutation.toObject = function (includeInstance, msg) { + var f, + obj = { + setJson: msg.getSetJson_asB64(), + deleteJson: msg.getDeleteJson_asB64(), + setNquads: msg.getSetNquads_asB64(), + delNquads: msg.getDelNquads_asB64(), + setList: jspb.Message.toObjectList( + msg.getSetList(), + proto.api.NQuad.toObject, + includeInstance, + ), + delList: jspb.Message.toObjectList( + msg.getDelList(), + proto.api.NQuad.toObject, + includeInstance, + ), + cond: jspb.Message.getFieldWithDefault(msg, 9, ""), + commitNow: jspb.Message.getBooleanFieldWithDefault(msg, 14, false), + } + + if (includeInstance) { + obj.$jspbMessageInstance = msg + } + return obj + } +} /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.api.Mutation} */ -proto.api.Mutation.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.Mutation; - return proto.api.Mutation.deserializeBinaryFromReader(msg, reader); -}; - +proto.api.Mutation.deserializeBinary = function (bytes) { + var reader = new jspb.BinaryReader(bytes) + var msg = new proto.api.Mutation() + return proto.api.Mutation.deserializeBinaryFromReader(msg, reader) +} /** * Deserializes binary data (in protobuf wire format) from the @@ -1618,66 +1533,64 @@ proto.api.Mutation.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.api.Mutation} */ -proto.api.Mutation.deserializeBinaryFromReader = function(msg, reader) { +proto.api.Mutation.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { - break; + break } - var field = reader.getFieldNumber(); + var field = reader.getFieldNumber() switch (field) { - case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setSetJson(value); - break; - case 2: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setDeleteJson(value); - break; - case 3: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setSetNquads(value); - break; - case 4: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setDelNquads(value); - break; - case 5: - var value = new proto.api.NQuad; - reader.readMessage(value,proto.api.NQuad.deserializeBinaryFromReader); - msg.addSet(value); - break; - case 6: - var value = new proto.api.NQuad; - reader.readMessage(value,proto.api.NQuad.deserializeBinaryFromReader); - msg.addDel(value); - break; - case 9: - var value = /** @type {string} */ (reader.readString()); - msg.setCond(value); - break; - case 14: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setCommitNow(value); - break; - default: - reader.skipField(); - break; + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()) + msg.setSetJson(value) + break + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()) + msg.setDeleteJson(value) + break + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()) + msg.setSetNquads(value) + break + case 4: + var value = /** @type {!Uint8Array} */ (reader.readBytes()) + msg.setDelNquads(value) + break + case 5: + var value = new proto.api.NQuad() + reader.readMessage(value, proto.api.NQuad.deserializeBinaryFromReader) + msg.addSet(value) + break + case 6: + var value = new proto.api.NQuad() + reader.readMessage(value, proto.api.NQuad.deserializeBinaryFromReader) + msg.addDel(value) + break + case 9: + var value = /** @type {string} */ (reader.readString()) + msg.setCond(value) + break + case 14: + var value = /** @type {boolean} */ (reader.readBool()) + msg.setCommitNow(value) + break + default: + reader.skipField() + break } } - return msg; -}; - + return msg +} /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.Mutation.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.api.Mutation.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - +proto.api.Mutation.prototype.serializeBinary = function () { + var writer = new jspb.BinaryWriter() + proto.api.Mutation.serializeBinaryToWriter(this, writer) + return writer.getResultBuffer() +} /** * Serializes the given message to binary data (in protobuf wire @@ -1686,88 +1599,58 @@ proto.api.Mutation.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.Mutation.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getSetJson_asU8(); +proto.api.Mutation.serializeBinaryToWriter = function (message, writer) { + var f = undefined + f = message.getSetJson_asU8() if (f.length > 0) { - writer.writeBytes( - 1, - f - ); + writer.writeBytes(1, f) } - f = message.getDeleteJson_asU8(); + f = message.getDeleteJson_asU8() if (f.length > 0) { - writer.writeBytes( - 2, - f - ); + writer.writeBytes(2, f) } - f = message.getSetNquads_asU8(); + f = message.getSetNquads_asU8() if (f.length > 0) { - writer.writeBytes( - 3, - f - ); + writer.writeBytes(3, f) } - f = message.getDelNquads_asU8(); + f = message.getDelNquads_asU8() if (f.length > 0) { - writer.writeBytes( - 4, - f - ); + writer.writeBytes(4, f) } - f = message.getSetList(); + f = message.getSetList() if (f.length > 0) { - writer.writeRepeatedMessage( - 5, - f, - proto.api.NQuad.serializeBinaryToWriter - ); + writer.writeRepeatedMessage(5, f, proto.api.NQuad.serializeBinaryToWriter) } - f = message.getDelList(); + f = message.getDelList() if (f.length > 0) { - writer.writeRepeatedMessage( - 6, - f, - proto.api.NQuad.serializeBinaryToWriter - ); + writer.writeRepeatedMessage(6, f, proto.api.NQuad.serializeBinaryToWriter) } - f = message.getCond(); + f = message.getCond() if (f.length > 0) { - writer.writeString( - 9, - f - ); + writer.writeString(9, f) } - f = message.getCommitNow(); + f = message.getCommitNow() if (f) { - writer.writeBool( - 14, - f - ); + writer.writeBool(14, f) } -}; - +} /** * optional bytes set_json = 1; * @return {!(string|Uint8Array)} */ -proto.api.Mutation.prototype.getSetJson = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - +proto.api.Mutation.prototype.getSetJson = function () { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")) +} /** * optional bytes set_json = 1; * This is a type-conversion wrapper around `getSetJson()` * @return {string} */ -proto.api.Mutation.prototype.getSetJson_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getSetJson())); -}; - +proto.api.Mutation.prototype.getSetJson_asB64 = function () { + return /** @type {string} */ (jspb.Message.bytesAsB64(this.getSetJson())) +} /** * optional bytes set_json = 1; @@ -1776,40 +1659,34 @@ proto.api.Mutation.prototype.getSetJson_asB64 = function() { * This is a type-conversion wrapper around `getSetJson()` * @return {!Uint8Array} */ -proto.api.Mutation.prototype.getSetJson_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getSetJson())); -}; - +proto.api.Mutation.prototype.getSetJson_asU8 = function () { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(this.getSetJson())) +} /** * @param {!(string|Uint8Array)} value * @return {!proto.api.Mutation} returns this */ -proto.api.Mutation.prototype.setSetJson = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); -}; - +proto.api.Mutation.prototype.setSetJson = function (value) { + return jspb.Message.setProto3BytesField(this, 1, value) +} /** * optional bytes delete_json = 2; * @return {!(string|Uint8Array)} */ -proto.api.Mutation.prototype.getDeleteJson = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - +proto.api.Mutation.prototype.getDeleteJson = function () { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")) +} /** * optional bytes delete_json = 2; * This is a type-conversion wrapper around `getDeleteJson()` * @return {string} */ -proto.api.Mutation.prototype.getDeleteJson_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getDeleteJson())); -}; - +proto.api.Mutation.prototype.getDeleteJson_asB64 = function () { + return /** @type {string} */ (jspb.Message.bytesAsB64(this.getDeleteJson())) +} /** * optional bytes delete_json = 2; @@ -1818,40 +1695,34 @@ proto.api.Mutation.prototype.getDeleteJson_asB64 = function() { * This is a type-conversion wrapper around `getDeleteJson()` * @return {!Uint8Array} */ -proto.api.Mutation.prototype.getDeleteJson_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getDeleteJson())); -}; - +proto.api.Mutation.prototype.getDeleteJson_asU8 = function () { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(this.getDeleteJson())) +} /** * @param {!(string|Uint8Array)} value * @return {!proto.api.Mutation} returns this */ -proto.api.Mutation.prototype.setDeleteJson = function(value) { - return jspb.Message.setProto3BytesField(this, 2, value); -}; - +proto.api.Mutation.prototype.setDeleteJson = function (value) { + return jspb.Message.setProto3BytesField(this, 2, value) +} /** * optional bytes set_nquads = 3; * @return {!(string|Uint8Array)} */ -proto.api.Mutation.prototype.getSetNquads = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - +proto.api.Mutation.prototype.getSetNquads = function () { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")) +} /** * optional bytes set_nquads = 3; * This is a type-conversion wrapper around `getSetNquads()` * @return {string} */ -proto.api.Mutation.prototype.getSetNquads_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getSetNquads())); -}; - +proto.api.Mutation.prototype.getSetNquads_asB64 = function () { + return /** @type {string} */ (jspb.Message.bytesAsB64(this.getSetNquads())) +} /** * optional bytes set_nquads = 3; @@ -1860,40 +1731,34 @@ proto.api.Mutation.prototype.getSetNquads_asB64 = function() { * This is a type-conversion wrapper around `getSetNquads()` * @return {!Uint8Array} */ -proto.api.Mutation.prototype.getSetNquads_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getSetNquads())); -}; - +proto.api.Mutation.prototype.getSetNquads_asU8 = function () { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(this.getSetNquads())) +} /** * @param {!(string|Uint8Array)} value * @return {!proto.api.Mutation} returns this */ -proto.api.Mutation.prototype.setSetNquads = function(value) { - return jspb.Message.setProto3BytesField(this, 3, value); -}; - +proto.api.Mutation.prototype.setSetNquads = function (value) { + return jspb.Message.setProto3BytesField(this, 3, value) +} /** * optional bytes del_nquads = 4; * @return {!(string|Uint8Array)} */ -proto.api.Mutation.prototype.getDelNquads = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, "")); -}; - +proto.api.Mutation.prototype.getDelNquads = function () { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, "")) +} /** * optional bytes del_nquads = 4; * This is a type-conversion wrapper around `getDelNquads()` * @return {string} */ -proto.api.Mutation.prototype.getDelNquads_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getDelNquads())); -}; - +proto.api.Mutation.prototype.getDelNquads_asB64 = function () { + return /** @type {string} */ (jspb.Message.bytesAsB64(this.getDelNquads())) +} /** * optional bytes del_nquads = 4; @@ -1902,192 +1767,174 @@ proto.api.Mutation.prototype.getDelNquads_asB64 = function() { * This is a type-conversion wrapper around `getDelNquads()` * @return {!Uint8Array} */ -proto.api.Mutation.prototype.getDelNquads_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getDelNquads())); -}; - +proto.api.Mutation.prototype.getDelNquads_asU8 = function () { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(this.getDelNquads())) +} /** * @param {!(string|Uint8Array)} value * @return {!proto.api.Mutation} returns this */ -proto.api.Mutation.prototype.setDelNquads = function(value) { - return jspb.Message.setProto3BytesField(this, 4, value); -}; - +proto.api.Mutation.prototype.setDelNquads = function (value) { + return jspb.Message.setProto3BytesField(this, 4, value) +} /** * repeated NQuad set = 5; * @return {!Array} */ -proto.api.Mutation.prototype.getSetList = function() { +proto.api.Mutation.prototype.getSetList = function () { return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.api.NQuad, 5)); -}; - + jspb.Message.getRepeatedWrapperField(this, proto.api.NQuad, 5) + ) +} /** * @param {!Array} value * @return {!proto.api.Mutation} returns this -*/ -proto.api.Mutation.prototype.setSetList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 5, value); -}; - + */ +proto.api.Mutation.prototype.setSetList = function (value) { + return jspb.Message.setRepeatedWrapperField(this, 5, value) +} /** * @param {!proto.api.NQuad=} opt_value * @param {number=} opt_index * @return {!proto.api.NQuad} */ -proto.api.Mutation.prototype.addSet = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, proto.api.NQuad, opt_index); -}; - +proto.api.Mutation.prototype.addSet = function (opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, proto.api.NQuad, opt_index) +} /** * Clears the list making it empty but non-null. * @return {!proto.api.Mutation} returns this */ -proto.api.Mutation.prototype.clearSetList = function() { - return this.setSetList([]); -}; - +proto.api.Mutation.prototype.clearSetList = function () { + return this.setSetList([]) +} /** * repeated NQuad del = 6; * @return {!Array} */ -proto.api.Mutation.prototype.getDelList = function() { +proto.api.Mutation.prototype.getDelList = function () { return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.api.NQuad, 6)); -}; - + jspb.Message.getRepeatedWrapperField(this, proto.api.NQuad, 6) + ) +} /** * @param {!Array} value * @return {!proto.api.Mutation} returns this -*/ -proto.api.Mutation.prototype.setDelList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 6, value); -}; - + */ +proto.api.Mutation.prototype.setDelList = function (value) { + return jspb.Message.setRepeatedWrapperField(this, 6, value) +} /** * @param {!proto.api.NQuad=} opt_value * @param {number=} opt_index * @return {!proto.api.NQuad} */ -proto.api.Mutation.prototype.addDel = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 6, opt_value, proto.api.NQuad, opt_index); -}; - +proto.api.Mutation.prototype.addDel = function (opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 6, opt_value, proto.api.NQuad, opt_index) +} /** * Clears the list making it empty but non-null. * @return {!proto.api.Mutation} returns this */ -proto.api.Mutation.prototype.clearDelList = function() { - return this.setDelList([]); -}; - +proto.api.Mutation.prototype.clearDelList = function () { + return this.setDelList([]) +} /** * optional string cond = 9; * @return {string} */ -proto.api.Mutation.prototype.getCond = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 9, "")); -}; - +proto.api.Mutation.prototype.getCond = function () { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 9, "")) +} /** * @param {string} value * @return {!proto.api.Mutation} returns this */ -proto.api.Mutation.prototype.setCond = function(value) { - return jspb.Message.setProto3StringField(this, 9, value); -}; - +proto.api.Mutation.prototype.setCond = function (value) { + return jspb.Message.setProto3StringField(this, 9, value) +} /** * optional bool commit_now = 14; * @return {boolean} */ -proto.api.Mutation.prototype.getCommitNow = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 14, false)); -}; - +proto.api.Mutation.prototype.getCommitNow = function () { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 14, false)) +} /** * @param {boolean} value * @return {!proto.api.Mutation} returns this */ -proto.api.Mutation.prototype.setCommitNow = function(value) { - return jspb.Message.setProto3BooleanField(this, 14, value); -}; - - - - +proto.api.Mutation.prototype.setCommitNow = function (value) { + return jspb.Message.setProto3BooleanField(this, 14, value) +} if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.api.Operation.prototype.toObject = function(opt_includeInstance) { - return proto.api.Operation.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.api.Operation} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.api.Operation.toObject = function(includeInstance, msg) { - var f, obj = { - schema: jspb.Message.getFieldWithDefault(msg, 1, ""), - dropAttr: jspb.Message.getFieldWithDefault(msg, 2, ""), - dropAll: jspb.Message.getBooleanFieldWithDefault(msg, 3, false), - dropOp: jspb.Message.getFieldWithDefault(msg, 4, 0), - dropValue: jspb.Message.getFieldWithDefault(msg, 5, ""), - runInBackground: jspb.Message.getBooleanFieldWithDefault(msg, 6, false) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; + /** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ + proto.api.Operation.prototype.toObject = function (opt_includeInstance) { + return proto.api.Operation.toObject(opt_includeInstance, this) } - return obj; -}; -} + /** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.Operation} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ + proto.api.Operation.toObject = function (includeInstance, msg) { + var f, + obj = { + schema: jspb.Message.getFieldWithDefault(msg, 1, ""), + dropAttr: jspb.Message.getFieldWithDefault(msg, 2, ""), + dropAll: jspb.Message.getBooleanFieldWithDefault(msg, 3, false), + dropOp: jspb.Message.getFieldWithDefault(msg, 4, 0), + dropValue: jspb.Message.getFieldWithDefault(msg, 5, ""), + runInBackground: jspb.Message.getBooleanFieldWithDefault(msg, 6, false), + } + + if (includeInstance) { + obj.$jspbMessageInstance = msg + } + return obj + } +} /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.api.Operation} */ -proto.api.Operation.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.Operation; - return proto.api.Operation.deserializeBinaryFromReader(msg, reader); -}; - +proto.api.Operation.deserializeBinary = function (bytes) { + var reader = new jspb.BinaryReader(bytes) + var msg = new proto.api.Operation() + return proto.api.Operation.deserializeBinaryFromReader(msg, reader) +} /** * Deserializes binary data (in protobuf wire format) from the @@ -2096,56 +1943,54 @@ proto.api.Operation.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.api.Operation} */ -proto.api.Operation.deserializeBinaryFromReader = function(msg, reader) { +proto.api.Operation.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { - break; + break } - var field = reader.getFieldNumber(); + var field = reader.getFieldNumber() switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setSchema(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setDropAttr(value); - break; - case 3: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setDropAll(value); - break; - case 4: - var value = /** @type {!proto.api.Operation.DropOp} */ (reader.readEnum()); - msg.setDropOp(value); - break; - case 5: - var value = /** @type {string} */ (reader.readString()); - msg.setDropValue(value); - break; - case 6: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setRunInBackground(value); - break; - default: - reader.skipField(); - break; + case 1: + var value = /** @type {string} */ (reader.readString()) + msg.setSchema(value) + break + case 2: + var value = /** @type {string} */ (reader.readString()) + msg.setDropAttr(value) + break + case 3: + var value = /** @type {boolean} */ (reader.readBool()) + msg.setDropAll(value) + break + case 4: + var value = /** @type {!proto.api.Operation.DropOp} */ (reader.readEnum()) + msg.setDropOp(value) + break + case 5: + var value = /** @type {string} */ (reader.readString()) + msg.setDropValue(value) + break + case 6: + var value = /** @type {boolean} */ (reader.readBool()) + msg.setRunInBackground(value) + break + default: + reader.skipField() + break } } - return msg; -}; - + return msg +} /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.Operation.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.api.Operation.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - +proto.api.Operation.prototype.serializeBinary = function () { + var writer = new jspb.BinaryWriter() + proto.api.Operation.serializeBinaryToWriter(this, writer) + return writer.getResultBuffer() +} /** * Serializes the given message to binary data (in protobuf wire @@ -2154,52 +1999,33 @@ proto.api.Operation.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.Operation.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getSchema(); +proto.api.Operation.serializeBinaryToWriter = function (message, writer) { + var f = undefined + f = message.getSchema() if (f.length > 0) { - writer.writeString( - 1, - f - ); + writer.writeString(1, f) } - f = message.getDropAttr(); + f = message.getDropAttr() if (f.length > 0) { - writer.writeString( - 2, - f - ); + writer.writeString(2, f) } - f = message.getDropAll(); + f = message.getDropAll() if (f) { - writer.writeBool( - 3, - f - ); + writer.writeBool(3, f) } - f = message.getDropOp(); + f = message.getDropOp() if (f !== 0.0) { - writer.writeEnum( - 4, - f - ); + writer.writeEnum(4, f) } - f = message.getDropValue(); + f = message.getDropValue() if (f.length > 0) { - writer.writeString( - 5, - f - ); + writer.writeString(5, f) } - f = message.getRunInBackground(); + f = message.getRunInBackground() if (f) { - writer.writeBool( - 6, - f - ); + writer.writeBool(6, f) } -}; - +} /** * @enum {number} @@ -2209,171 +2035,154 @@ proto.api.Operation.DropOp = { ALL: 1, DATA: 2, ATTR: 3, - TYPE: 4 -}; + TYPE: 4, +} /** * optional string schema = 1; * @return {string} */ -proto.api.Operation.prototype.getSchema = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - +proto.api.Operation.prototype.getSchema = function () { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")) +} /** * @param {string} value * @return {!proto.api.Operation} returns this */ -proto.api.Operation.prototype.setSchema = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - +proto.api.Operation.prototype.setSchema = function (value) { + return jspb.Message.setProto3StringField(this, 1, value) +} /** * optional string drop_attr = 2; * @return {string} */ -proto.api.Operation.prototype.getDropAttr = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - +proto.api.Operation.prototype.getDropAttr = function () { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")) +} /** * @param {string} value * @return {!proto.api.Operation} returns this */ -proto.api.Operation.prototype.setDropAttr = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - +proto.api.Operation.prototype.setDropAttr = function (value) { + return jspb.Message.setProto3StringField(this, 2, value) +} /** * optional bool drop_all = 3; * @return {boolean} */ -proto.api.Operation.prototype.getDropAll = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); -}; - +proto.api.Operation.prototype.getDropAll = function () { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)) +} /** * @param {boolean} value * @return {!proto.api.Operation} returns this */ -proto.api.Operation.prototype.setDropAll = function(value) { - return jspb.Message.setProto3BooleanField(this, 3, value); -}; - +proto.api.Operation.prototype.setDropAll = function (value) { + return jspb.Message.setProto3BooleanField(this, 3, value) +} /** * optional DropOp drop_op = 4; * @return {!proto.api.Operation.DropOp} */ -proto.api.Operation.prototype.getDropOp = function() { - return /** @type {!proto.api.Operation.DropOp} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); -}; - +proto.api.Operation.prototype.getDropOp = function () { + return /** @type {!proto.api.Operation.DropOp} */ (jspb.Message.getFieldWithDefault(this, 4, 0)) +} /** * @param {!proto.api.Operation.DropOp} value * @return {!proto.api.Operation} returns this */ -proto.api.Operation.prototype.setDropOp = function(value) { - return jspb.Message.setProto3EnumField(this, 4, value); -}; - +proto.api.Operation.prototype.setDropOp = function (value) { + return jspb.Message.setProto3EnumField(this, 4, value) +} /** * optional string drop_value = 5; * @return {string} */ -proto.api.Operation.prototype.getDropValue = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); -}; - +proto.api.Operation.prototype.getDropValue = function () { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")) +} /** * @param {string} value * @return {!proto.api.Operation} returns this */ -proto.api.Operation.prototype.setDropValue = function(value) { - return jspb.Message.setProto3StringField(this, 5, value); -}; - +proto.api.Operation.prototype.setDropValue = function (value) { + return jspb.Message.setProto3StringField(this, 5, value) +} /** * optional bool run_in_background = 6; * @return {boolean} */ -proto.api.Operation.prototype.getRunInBackground = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 6, false)); -}; - +proto.api.Operation.prototype.getRunInBackground = function () { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 6, false)) +} /** * @param {boolean} value * @return {!proto.api.Operation} returns this */ -proto.api.Operation.prototype.setRunInBackground = function(value) { - return jspb.Message.setProto3BooleanField(this, 6, value); -}; - - - - +proto.api.Operation.prototype.setRunInBackground = function (value) { + return jspb.Message.setProto3BooleanField(this, 6, value) +} if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.api.Payload.prototype.toObject = function(opt_includeInstance) { - return proto.api.Payload.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.api.Payload} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.api.Payload.toObject = function(includeInstance, msg) { - var f, obj = { - data: msg.getData_asB64() - }; + /** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ + proto.api.Payload.prototype.toObject = function (opt_includeInstance) { + return proto.api.Payload.toObject(opt_includeInstance, this) + } - if (includeInstance) { - obj.$jspbMessageInstance = msg; + /** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.Payload} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ + proto.api.Payload.toObject = function (includeInstance, msg) { + var f, + obj = { + data: msg.getData_asB64(), + } + + if (includeInstance) { + obj.$jspbMessageInstance = msg + } + return obj } - return obj; -}; } - /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.api.Payload} */ -proto.api.Payload.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.Payload; - return proto.api.Payload.deserializeBinaryFromReader(msg, reader); -}; - +proto.api.Payload.deserializeBinary = function (bytes) { + var reader = new jspb.BinaryReader(bytes) + var msg = new proto.api.Payload() + return proto.api.Payload.deserializeBinaryFromReader(msg, reader) +} /** * Deserializes binary data (in protobuf wire format) from the @@ -2382,36 +2191,34 @@ proto.api.Payload.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.api.Payload} */ -proto.api.Payload.deserializeBinaryFromReader = function(msg, reader) { +proto.api.Payload.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { - break; + break } - var field = reader.getFieldNumber(); + var field = reader.getFieldNumber() switch (field) { - case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setData(value); - break; - default: - reader.skipField(); - break; + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()) + msg.setData(value) + break + default: + reader.skipField() + break } } - return msg; -}; - + return msg +} /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.Payload.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.api.Payload.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - +proto.api.Payload.prototype.serializeBinary = function () { + var writer = new jspb.BinaryWriter() + proto.api.Payload.serializeBinaryToWriter(this, writer) + return writer.getResultBuffer() +} /** * Serializes the given message to binary data (in protobuf wire @@ -2420,37 +2227,30 @@ proto.api.Payload.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.Payload.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getData_asU8(); +proto.api.Payload.serializeBinaryToWriter = function (message, writer) { + var f = undefined + f = message.getData_asU8() if (f.length > 0) { - writer.writeBytes( - 1, - f - ); + writer.writeBytes(1, f) } -}; - +} /** * optional bytes Data = 1; * @return {!(string|Uint8Array)} */ -proto.api.Payload.prototype.getData = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - +proto.api.Payload.prototype.getData = function () { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")) +} /** * optional bytes Data = 1; * This is a type-conversion wrapper around `getData()` * @return {string} */ -proto.api.Payload.prototype.getData_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getData())); -}; - +proto.api.Payload.prototype.getData_asB64 = function () { + return /** @type {string} */ (jspb.Message.bytesAsB64(this.getData())) +} /** * optional bytes Data = 1; @@ -2459,87 +2259,79 @@ proto.api.Payload.prototype.getData_asB64 = function() { * This is a type-conversion wrapper around `getData()` * @return {!Uint8Array} */ -proto.api.Payload.prototype.getData_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getData())); -}; - +proto.api.Payload.prototype.getData_asU8 = function () { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(this.getData())) +} /** * @param {!(string|Uint8Array)} value * @return {!proto.api.Payload} returns this */ -proto.api.Payload.prototype.setData = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); -}; - - +proto.api.Payload.prototype.setData = function (value) { + return jspb.Message.setProto3BytesField(this, 1, value) +} /** * List of repeated fields within this message type. * @private {!Array} * @const */ -proto.api.TxnContext.repeatedFields_ = [4,5]; - - +proto.api.TxnContext.repeatedFields_ = [4, 5] if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.api.TxnContext.prototype.toObject = function(opt_includeInstance) { - return proto.api.TxnContext.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.api.TxnContext} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.api.TxnContext.toObject = function(includeInstance, msg) { - var f, obj = { - startTs: jspb.Message.getFieldWithDefault(msg, 1, 0), - commitTs: jspb.Message.getFieldWithDefault(msg, 2, 0), - aborted: jspb.Message.getBooleanFieldWithDefault(msg, 3, false), - keysList: (f = jspb.Message.getRepeatedField(msg, 4)) == null ? undefined : f, - predsList: (f = jspb.Message.getRepeatedField(msg, 5)) == null ? undefined : f, - hash: jspb.Message.getFieldWithDefault(msg, 6, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; + /** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ + proto.api.TxnContext.prototype.toObject = function (opt_includeInstance) { + return proto.api.TxnContext.toObject(opt_includeInstance, this) } - return obj; -}; -} + /** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.TxnContext} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ + proto.api.TxnContext.toObject = function (includeInstance, msg) { + var f, + obj = { + startTs: jspb.Message.getFieldWithDefault(msg, 1, 0), + commitTs: jspb.Message.getFieldWithDefault(msg, 2, 0), + aborted: jspb.Message.getBooleanFieldWithDefault(msg, 3, false), + keysList: (f = jspb.Message.getRepeatedField(msg, 4)) == null ? undefined : f, + predsList: (f = jspb.Message.getRepeatedField(msg, 5)) == null ? undefined : f, + hash: jspb.Message.getFieldWithDefault(msg, 6, ""), + } + + if (includeInstance) { + obj.$jspbMessageInstance = msg + } + return obj + } +} /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.api.TxnContext} */ -proto.api.TxnContext.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.TxnContext; - return proto.api.TxnContext.deserializeBinaryFromReader(msg, reader); -}; - +proto.api.TxnContext.deserializeBinary = function (bytes) { + var reader = new jspb.BinaryReader(bytes) + var msg = new proto.api.TxnContext() + return proto.api.TxnContext.deserializeBinaryFromReader(msg, reader) +} /** * Deserializes binary data (in protobuf wire format) from the @@ -2548,56 +2340,54 @@ proto.api.TxnContext.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.api.TxnContext} */ -proto.api.TxnContext.deserializeBinaryFromReader = function(msg, reader) { +proto.api.TxnContext.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { - break; + break } - var field = reader.getFieldNumber(); + var field = reader.getFieldNumber() switch (field) { - case 1: - var value = /** @type {number} */ (reader.readUint64()); - msg.setStartTs(value); - break; - case 2: - var value = /** @type {number} */ (reader.readUint64()); - msg.setCommitTs(value); - break; - case 3: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setAborted(value); - break; - case 4: - var value = /** @type {string} */ (reader.readString()); - msg.addKeys(value); - break; - case 5: - var value = /** @type {string} */ (reader.readString()); - msg.addPreds(value); - break; - case 6: - var value = /** @type {string} */ (reader.readString()); - msg.setHash(value); - break; - default: - reader.skipField(); - break; + case 1: + var value = /** @type {number} */ (reader.readUint64()) + msg.setStartTs(value) + break + case 2: + var value = /** @type {number} */ (reader.readUint64()) + msg.setCommitTs(value) + break + case 3: + var value = /** @type {boolean} */ (reader.readBool()) + msg.setAborted(value) + break + case 4: + var value = /** @type {string} */ (reader.readString()) + msg.addKeys(value) + break + case 5: + var value = /** @type {string} */ (reader.readString()) + msg.addPreds(value) + break + case 6: + var value = /** @type {string} */ (reader.readString()) + msg.setHash(value) + break + default: + reader.skipField() + break } } - return msg; -}; - + return msg +} /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.TxnContext.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.api.TxnContext.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - +proto.api.TxnContext.prototype.serializeBinary = function () { + var writer = new jspb.BinaryWriter() + proto.api.TxnContext.serializeBinaryToWriter(this, writer) + return writer.getResultBuffer() +} /** * Serializes the given message to binary data (in protobuf wire @@ -2606,253 +2396,211 @@ proto.api.TxnContext.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.TxnContext.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getStartTs(); +proto.api.TxnContext.serializeBinaryToWriter = function (message, writer) { + var f = undefined + f = message.getStartTs() if (f !== 0) { - writer.writeUint64( - 1, - f - ); + writer.writeUint64(1, f) } - f = message.getCommitTs(); + f = message.getCommitTs() if (f !== 0) { - writer.writeUint64( - 2, - f - ); + writer.writeUint64(2, f) } - f = message.getAborted(); + f = message.getAborted() if (f) { - writer.writeBool( - 3, - f - ); + writer.writeBool(3, f) } - f = message.getKeysList(); + f = message.getKeysList() if (f.length > 0) { - writer.writeRepeatedString( - 4, - f - ); + writer.writeRepeatedString(4, f) } - f = message.getPredsList(); + f = message.getPredsList() if (f.length > 0) { - writer.writeRepeatedString( - 5, - f - ); + writer.writeRepeatedString(5, f) } - f = message.getHash(); + f = message.getHash() if (f.length > 0) { - writer.writeString( - 6, - f - ); + writer.writeString(6, f) } -}; - +} /** * optional uint64 start_ts = 1; * @return {number} */ -proto.api.TxnContext.prototype.getStartTs = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - +proto.api.TxnContext.prototype.getStartTs = function () { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)) +} /** * @param {number} value * @return {!proto.api.TxnContext} returns this */ -proto.api.TxnContext.prototype.setStartTs = function(value) { - return jspb.Message.setProto3IntField(this, 1, value); -}; - +proto.api.TxnContext.prototype.setStartTs = function (value) { + return jspb.Message.setProto3IntField(this, 1, value) +} /** * optional uint64 commit_ts = 2; * @return {number} */ -proto.api.TxnContext.prototype.getCommitTs = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - +proto.api.TxnContext.prototype.getCommitTs = function () { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)) +} /** * @param {number} value * @return {!proto.api.TxnContext} returns this */ -proto.api.TxnContext.prototype.setCommitTs = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); -}; - +proto.api.TxnContext.prototype.setCommitTs = function (value) { + return jspb.Message.setProto3IntField(this, 2, value) +} /** * optional bool aborted = 3; * @return {boolean} */ -proto.api.TxnContext.prototype.getAborted = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); -}; - +proto.api.TxnContext.prototype.getAborted = function () { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)) +} /** * @param {boolean} value * @return {!proto.api.TxnContext} returns this */ -proto.api.TxnContext.prototype.setAborted = function(value) { - return jspb.Message.setProto3BooleanField(this, 3, value); -}; - +proto.api.TxnContext.prototype.setAborted = function (value) { + return jspb.Message.setProto3BooleanField(this, 3, value) +} /** * repeated string keys = 4; * @return {!Array} */ -proto.api.TxnContext.prototype.getKeysList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 4)); -}; - +proto.api.TxnContext.prototype.getKeysList = function () { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 4)) +} /** * @param {!Array} value * @return {!proto.api.TxnContext} returns this */ -proto.api.TxnContext.prototype.setKeysList = function(value) { - return jspb.Message.setField(this, 4, value || []); -}; - +proto.api.TxnContext.prototype.setKeysList = function (value) { + return jspb.Message.setField(this, 4, value || []) +} /** * @param {string} value * @param {number=} opt_index * @return {!proto.api.TxnContext} returns this */ -proto.api.TxnContext.prototype.addKeys = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 4, value, opt_index); -}; - +proto.api.TxnContext.prototype.addKeys = function (value, opt_index) { + return jspb.Message.addToRepeatedField(this, 4, value, opt_index) +} /** * Clears the list making it empty but non-null. * @return {!proto.api.TxnContext} returns this */ -proto.api.TxnContext.prototype.clearKeysList = function() { - return this.setKeysList([]); -}; - +proto.api.TxnContext.prototype.clearKeysList = function () { + return this.setKeysList([]) +} /** * repeated string preds = 5; * @return {!Array} */ -proto.api.TxnContext.prototype.getPredsList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 5)); -}; - +proto.api.TxnContext.prototype.getPredsList = function () { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 5)) +} /** * @param {!Array} value * @return {!proto.api.TxnContext} returns this */ -proto.api.TxnContext.prototype.setPredsList = function(value) { - return jspb.Message.setField(this, 5, value || []); -}; - +proto.api.TxnContext.prototype.setPredsList = function (value) { + return jspb.Message.setField(this, 5, value || []) +} /** * @param {string} value * @param {number=} opt_index * @return {!proto.api.TxnContext} returns this */ -proto.api.TxnContext.prototype.addPreds = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 5, value, opt_index); -}; - +proto.api.TxnContext.prototype.addPreds = function (value, opt_index) { + return jspb.Message.addToRepeatedField(this, 5, value, opt_index) +} /** * Clears the list making it empty but non-null. * @return {!proto.api.TxnContext} returns this */ -proto.api.TxnContext.prototype.clearPredsList = function() { - return this.setPredsList([]); -}; - +proto.api.TxnContext.prototype.clearPredsList = function () { + return this.setPredsList([]) +} /** * optional string hash = 6; * @return {string} */ -proto.api.TxnContext.prototype.getHash = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); -}; - +proto.api.TxnContext.prototype.getHash = function () { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")) +} /** * @param {string} value * @return {!proto.api.TxnContext} returns this */ -proto.api.TxnContext.prototype.setHash = function(value) { - return jspb.Message.setProto3StringField(this, 6, value); -}; - - - - +proto.api.TxnContext.prototype.setHash = function (value) { + return jspb.Message.setProto3StringField(this, 6, value) +} if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.api.Check.prototype.toObject = function(opt_includeInstance) { - return proto.api.Check.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.api.Check} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.api.Check.toObject = function(includeInstance, msg) { - var f, obj = { + /** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ + proto.api.Check.prototype.toObject = function (opt_includeInstance) { + return proto.api.Check.toObject(opt_includeInstance, this) + } - }; + /** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.Check} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ + proto.api.Check.toObject = function (includeInstance, msg) { + var f, + obj = {} - if (includeInstance) { - obj.$jspbMessageInstance = msg; + if (includeInstance) { + obj.$jspbMessageInstance = msg + } + return obj } - return obj; -}; } - /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.api.Check} */ -proto.api.Check.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.Check; - return proto.api.Check.deserializeBinaryFromReader(msg, reader); -}; - +proto.api.Check.deserializeBinary = function (bytes) { + var reader = new jspb.BinaryReader(bytes) + var msg = new proto.api.Check() + return proto.api.Check.deserializeBinaryFromReader(msg, reader) +} /** * Deserializes binary data (in protobuf wire format) from the @@ -2861,32 +2609,30 @@ proto.api.Check.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.api.Check} */ -proto.api.Check.deserializeBinaryFromReader = function(msg, reader) { +proto.api.Check.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { - break; + break } - var field = reader.getFieldNumber(); + var field = reader.getFieldNumber() switch (field) { - default: - reader.skipField(); - break; + default: + reader.skipField() + break } } - return msg; -}; - + return msg +} /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.Check.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.api.Check.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - +proto.api.Check.prototype.serializeBinary = function () { + var writer = new jspb.BinaryWriter() + proto.api.Check.serializeBinaryToWriter(this, writer) + return writer.getResultBuffer() +} /** * Serializes the given message to binary data (in protobuf wire @@ -2895,65 +2641,59 @@ proto.api.Check.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.Check.serializeBinaryToWriter = function(message, writer) { - var f = undefined; -}; - - - - +proto.api.Check.serializeBinaryToWriter = function (message, writer) { + var f = undefined +} if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.api.Version.prototype.toObject = function(opt_includeInstance) { - return proto.api.Version.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.api.Version} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.api.Version.toObject = function(includeInstance, msg) { - var f, obj = { - tag: jspb.Message.getFieldWithDefault(msg, 1, "") - }; + /** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ + proto.api.Version.prototype.toObject = function (opt_includeInstance) { + return proto.api.Version.toObject(opt_includeInstance, this) + } - if (includeInstance) { - obj.$jspbMessageInstance = msg; + /** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.Version} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ + proto.api.Version.toObject = function (includeInstance, msg) { + var f, + obj = { + tag: jspb.Message.getFieldWithDefault(msg, 1, ""), + } + + if (includeInstance) { + obj.$jspbMessageInstance = msg + } + return obj } - return obj; -}; } - /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.api.Version} */ -proto.api.Version.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.Version; - return proto.api.Version.deserializeBinaryFromReader(msg, reader); -}; - +proto.api.Version.deserializeBinary = function (bytes) { + var reader = new jspb.BinaryReader(bytes) + var msg = new proto.api.Version() + return proto.api.Version.deserializeBinaryFromReader(msg, reader) +} /** * Deserializes binary data (in protobuf wire format) from the @@ -2962,36 +2702,34 @@ proto.api.Version.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.api.Version} */ -proto.api.Version.deserializeBinaryFromReader = function(msg, reader) { +proto.api.Version.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { - break; + break } - var field = reader.getFieldNumber(); + var field = reader.getFieldNumber() switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setTag(value); - break; - default: - reader.skipField(); - break; + case 1: + var value = /** @type {string} */ (reader.readString()) + msg.setTag(value) + break + default: + reader.skipField() + break } } - return msg; -}; - + return msg +} /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.Version.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.api.Version.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - +proto.api.Version.prototype.serializeBinary = function () { + var writer = new jspb.BinaryWriter() + proto.api.Version.serializeBinaryToWriter(this, writer) + return writer.getResultBuffer() +} /** * Serializes the given message to binary data (in protobuf wire @@ -3000,94 +2738,83 @@ proto.api.Version.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.Version.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getTag(); +proto.api.Version.serializeBinaryToWriter = function (message, writer) { + var f = undefined + f = message.getTag() if (f.length > 0) { - writer.writeString( - 1, - f - ); + writer.writeString(1, f) } -}; - +} /** * optional string tag = 1; * @return {string} */ -proto.api.Version.prototype.getTag = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - +proto.api.Version.prototype.getTag = function () { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")) +} /** * @param {string} value * @return {!proto.api.Version} returns this */ -proto.api.Version.prototype.setTag = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - - - +proto.api.Version.prototype.setTag = function (value) { + return jspb.Message.setProto3StringField(this, 1, value) +} if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.api.Latency.prototype.toObject = function(opt_includeInstance) { - return proto.api.Latency.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.api.Latency} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.api.Latency.toObject = function(includeInstance, msg) { - var f, obj = { - parsingNs: jspb.Message.getFieldWithDefault(msg, 1, 0), - processingNs: jspb.Message.getFieldWithDefault(msg, 2, 0), - encodingNs: jspb.Message.getFieldWithDefault(msg, 3, 0), - assignTimestampNs: jspb.Message.getFieldWithDefault(msg, 4, 0), - totalNs: jspb.Message.getFieldWithDefault(msg, 5, 0) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; + /** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ + proto.api.Latency.prototype.toObject = function (opt_includeInstance) { + return proto.api.Latency.toObject(opt_includeInstance, this) } - return obj; -}; -} + /** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.Latency} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ + proto.api.Latency.toObject = function (includeInstance, msg) { + var f, + obj = { + parsingNs: jspb.Message.getFieldWithDefault(msg, 1, 0), + processingNs: jspb.Message.getFieldWithDefault(msg, 2, 0), + encodingNs: jspb.Message.getFieldWithDefault(msg, 3, 0), + assignTimestampNs: jspb.Message.getFieldWithDefault(msg, 4, 0), + totalNs: jspb.Message.getFieldWithDefault(msg, 5, 0), + } + + if (includeInstance) { + obj.$jspbMessageInstance = msg + } + return obj + } +} /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.api.Latency} */ -proto.api.Latency.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.Latency; - return proto.api.Latency.deserializeBinaryFromReader(msg, reader); -}; - +proto.api.Latency.deserializeBinary = function (bytes) { + var reader = new jspb.BinaryReader(bytes) + var msg = new proto.api.Latency() + return proto.api.Latency.deserializeBinaryFromReader(msg, reader) +} /** * Deserializes binary data (in protobuf wire format) from the @@ -3096,52 +2823,50 @@ proto.api.Latency.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.api.Latency} */ -proto.api.Latency.deserializeBinaryFromReader = function(msg, reader) { +proto.api.Latency.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { - break; + break } - var field = reader.getFieldNumber(); + var field = reader.getFieldNumber() switch (field) { - case 1: - var value = /** @type {number} */ (reader.readUint64()); - msg.setParsingNs(value); - break; - case 2: - var value = /** @type {number} */ (reader.readUint64()); - msg.setProcessingNs(value); - break; - case 3: - var value = /** @type {number} */ (reader.readUint64()); - msg.setEncodingNs(value); - break; - case 4: - var value = /** @type {number} */ (reader.readUint64()); - msg.setAssignTimestampNs(value); - break; - case 5: - var value = /** @type {number} */ (reader.readUint64()); - msg.setTotalNs(value); - break; - default: - reader.skipField(); - break; + case 1: + var value = /** @type {number} */ (reader.readUint64()) + msg.setParsingNs(value) + break + case 2: + var value = /** @type {number} */ (reader.readUint64()) + msg.setProcessingNs(value) + break + case 3: + var value = /** @type {number} */ (reader.readUint64()) + msg.setEncodingNs(value) + break + case 4: + var value = /** @type {number} */ (reader.readUint64()) + msg.setAssignTimestampNs(value) + break + case 5: + var value = /** @type {number} */ (reader.readUint64()) + msg.setTotalNs(value) + break + default: + reader.skipField() + break } } - return msg; -}; - + return msg +} /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.Latency.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.api.Latency.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - +proto.api.Latency.prototype.serializeBinary = function () { + var writer = new jspb.BinaryWriter() + proto.api.Latency.serializeBinaryToWriter(this, writer) + return writer.getResultBuffer() +} /** * Serializes the given message to binary data (in protobuf wire @@ -3150,190 +2875,159 @@ proto.api.Latency.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.Latency.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getParsingNs(); +proto.api.Latency.serializeBinaryToWriter = function (message, writer) { + var f = undefined + f = message.getParsingNs() if (f !== 0) { - writer.writeUint64( - 1, - f - ); + writer.writeUint64(1, f) } - f = message.getProcessingNs(); + f = message.getProcessingNs() if (f !== 0) { - writer.writeUint64( - 2, - f - ); + writer.writeUint64(2, f) } - f = message.getEncodingNs(); + f = message.getEncodingNs() if (f !== 0) { - writer.writeUint64( - 3, - f - ); + writer.writeUint64(3, f) } - f = message.getAssignTimestampNs(); + f = message.getAssignTimestampNs() if (f !== 0) { - writer.writeUint64( - 4, - f - ); + writer.writeUint64(4, f) } - f = message.getTotalNs(); + f = message.getTotalNs() if (f !== 0) { - writer.writeUint64( - 5, - f - ); + writer.writeUint64(5, f) } -}; - +} /** * optional uint64 parsing_ns = 1; * @return {number} */ -proto.api.Latency.prototype.getParsingNs = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - +proto.api.Latency.prototype.getParsingNs = function () { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)) +} /** * @param {number} value * @return {!proto.api.Latency} returns this */ -proto.api.Latency.prototype.setParsingNs = function(value) { - return jspb.Message.setProto3IntField(this, 1, value); -}; - +proto.api.Latency.prototype.setParsingNs = function (value) { + return jspb.Message.setProto3IntField(this, 1, value) +} /** * optional uint64 processing_ns = 2; * @return {number} */ -proto.api.Latency.prototype.getProcessingNs = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - +proto.api.Latency.prototype.getProcessingNs = function () { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)) +} /** * @param {number} value * @return {!proto.api.Latency} returns this */ -proto.api.Latency.prototype.setProcessingNs = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); -}; - +proto.api.Latency.prototype.setProcessingNs = function (value) { + return jspb.Message.setProto3IntField(this, 2, value) +} /** * optional uint64 encoding_ns = 3; * @return {number} */ -proto.api.Latency.prototype.getEncodingNs = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); -}; - +proto.api.Latency.prototype.getEncodingNs = function () { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)) +} /** * @param {number} value * @return {!proto.api.Latency} returns this */ -proto.api.Latency.prototype.setEncodingNs = function(value) { - return jspb.Message.setProto3IntField(this, 3, value); -}; - +proto.api.Latency.prototype.setEncodingNs = function (value) { + return jspb.Message.setProto3IntField(this, 3, value) +} /** * optional uint64 assign_timestamp_ns = 4; * @return {number} */ -proto.api.Latency.prototype.getAssignTimestampNs = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); -}; - +proto.api.Latency.prototype.getAssignTimestampNs = function () { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)) +} /** * @param {number} value * @return {!proto.api.Latency} returns this */ -proto.api.Latency.prototype.setAssignTimestampNs = function(value) { - return jspb.Message.setProto3IntField(this, 4, value); -}; - +proto.api.Latency.prototype.setAssignTimestampNs = function (value) { + return jspb.Message.setProto3IntField(this, 4, value) +} /** * optional uint64 total_ns = 5; * @return {number} */ -proto.api.Latency.prototype.getTotalNs = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); -}; - +proto.api.Latency.prototype.getTotalNs = function () { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)) +} /** * @param {number} value * @return {!proto.api.Latency} returns this */ -proto.api.Latency.prototype.setTotalNs = function(value) { - return jspb.Message.setProto3IntField(this, 5, value); -}; - - - - +proto.api.Latency.prototype.setTotalNs = function (value) { + return jspb.Message.setProto3IntField(this, 5, value) +} if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.api.Metrics.prototype.toObject = function(opt_includeInstance) { - return proto.api.Metrics.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.api.Metrics} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.api.Metrics.toObject = function(includeInstance, msg) { - var f, obj = { - numUidsMap: (f = msg.getNumUidsMap()) ? f.toObject(includeInstance, undefined) : [] - }; + /** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ + proto.api.Metrics.prototype.toObject = function (opt_includeInstance) { + return proto.api.Metrics.toObject(opt_includeInstance, this) + } - if (includeInstance) { - obj.$jspbMessageInstance = msg; + /** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.Metrics} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ + proto.api.Metrics.toObject = function (includeInstance, msg) { + var f, + obj = { + numUidsMap: (f = msg.getNumUidsMap()) ? f.toObject(includeInstance, undefined) : [], + } + + if (includeInstance) { + obj.$jspbMessageInstance = msg + } + return obj } - return obj; -}; } - /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.api.Metrics} */ -proto.api.Metrics.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.Metrics; - return proto.api.Metrics.deserializeBinaryFromReader(msg, reader); -}; - +proto.api.Metrics.deserializeBinary = function (bytes) { + var reader = new jspb.BinaryReader(bytes) + var msg = new proto.api.Metrics() + return proto.api.Metrics.deserializeBinaryFromReader(msg, reader) +} /** * Deserializes binary data (in protobuf wire format) from the @@ -3342,38 +3036,44 @@ proto.api.Metrics.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.api.Metrics} */ -proto.api.Metrics.deserializeBinaryFromReader = function(msg, reader) { +proto.api.Metrics.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { - break; + break } - var field = reader.getFieldNumber(); + var field = reader.getFieldNumber() switch (field) { - case 1: - var value = msg.getNumUidsMap(); - reader.readMessage(value, function(message, reader) { - jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readUint64, null, "", 0); - }); - break; - default: - reader.skipField(); - break; + case 1: + var value = msg.getNumUidsMap() + reader.readMessage(value, function (message, reader) { + jspb.Map.deserializeBinary( + message, + reader, + jspb.BinaryReader.prototype.readString, + jspb.BinaryReader.prototype.readUint64, + null, + "", + 0, + ) + }) + break + default: + reader.skipField() + break } } - return msg; -}; - + return msg +} /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.Metrics.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.api.Metrics.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - +proto.api.Metrics.prototype.serializeBinary = function () { + var writer = new jspb.BinaryWriter() + proto.api.Metrics.serializeBinaryToWriter(this, writer) + return writer.getResultBuffer() +} /** * Serializes the given message to binary data (in protobuf wire @@ -3382,14 +3082,18 @@ proto.api.Metrics.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.Metrics.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getNumUidsMap(true); +proto.api.Metrics.serializeBinaryToWriter = function (message, writer) { + var f = undefined + f = message.getNumUidsMap(true) if (f && f.getLength() > 0) { - f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeUint64); + f.serializeBinary( + 1, + writer, + jspb.BinaryWriter.prototype.writeString, + jspb.BinaryWriter.prototype.writeUint64, + ) } -}; - +} /** * map num_uids = 1; @@ -3397,90 +3101,87 @@ proto.api.Metrics.serializeBinaryToWriter = function(message, writer) { * empty, instead returning `undefined` * @return {!jspb.Map} */ -proto.api.Metrics.prototype.getNumUidsMap = function(opt_noLazyCreate) { +proto.api.Metrics.prototype.getNumUidsMap = function (opt_noLazyCreate) { return /** @type {!jspb.Map} */ ( - jspb.Message.getMapField(this, 1, opt_noLazyCreate, - null)); -}; - + jspb.Message.getMapField(this, 1, opt_noLazyCreate, null) + ) +} /** * Clears values from the map. The map will be non-null. * @return {!proto.api.Metrics} returns this */ -proto.api.Metrics.prototype.clearNumUidsMap = function() { - this.getNumUidsMap().clear(); - return this;}; - - +proto.api.Metrics.prototype.clearNumUidsMap = function () { + this.getNumUidsMap().clear() + return this +} /** * List of repeated fields within this message type. * @private {!Array} * @const */ -proto.api.NQuad.repeatedFields_ = [7]; - - +proto.api.NQuad.repeatedFields_ = [7] if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.api.NQuad.prototype.toObject = function(opt_includeInstance) { - return proto.api.NQuad.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.api.NQuad} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.api.NQuad.toObject = function(includeInstance, msg) { - var f, obj = { - subject: jspb.Message.getFieldWithDefault(msg, 1, ""), - predicate: jspb.Message.getFieldWithDefault(msg, 2, ""), - objectId: jspb.Message.getFieldWithDefault(msg, 3, ""), - objectValue: (f = msg.getObjectValue()) && proto.api.Value.toObject(includeInstance, f), - lang: jspb.Message.getFieldWithDefault(msg, 6, ""), - facetsList: jspb.Message.toObjectList(msg.getFacetsList(), - proto.api.Facet.toObject, includeInstance), - namespace: jspb.Message.getFieldWithDefault(msg, 8, 0) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; + /** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ + proto.api.NQuad.prototype.toObject = function (opt_includeInstance) { + return proto.api.NQuad.toObject(opt_includeInstance, this) } - return obj; -}; -} + /** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.NQuad} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ + proto.api.NQuad.toObject = function (includeInstance, msg) { + var f, + obj = { + subject: jspb.Message.getFieldWithDefault(msg, 1, ""), + predicate: jspb.Message.getFieldWithDefault(msg, 2, ""), + objectId: jspb.Message.getFieldWithDefault(msg, 3, ""), + objectValue: (f = msg.getObjectValue()) && proto.api.Value.toObject(includeInstance, f), + lang: jspb.Message.getFieldWithDefault(msg, 6, ""), + facetsList: jspb.Message.toObjectList( + msg.getFacetsList(), + proto.api.Facet.toObject, + includeInstance, + ), + namespace: jspb.Message.getFieldWithDefault(msg, 8, 0), + } + + if (includeInstance) { + obj.$jspbMessageInstance = msg + } + return obj + } +} /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.api.NQuad} */ -proto.api.NQuad.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.NQuad; - return proto.api.NQuad.deserializeBinaryFromReader(msg, reader); -}; - +proto.api.NQuad.deserializeBinary = function (bytes) { + var reader = new jspb.BinaryReader(bytes) + var msg = new proto.api.NQuad() + return proto.api.NQuad.deserializeBinaryFromReader(msg, reader) +} /** * Deserializes binary data (in protobuf wire format) from the @@ -3489,62 +3190,60 @@ proto.api.NQuad.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.api.NQuad} */ -proto.api.NQuad.deserializeBinaryFromReader = function(msg, reader) { +proto.api.NQuad.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { - break; + break } - var field = reader.getFieldNumber(); + var field = reader.getFieldNumber() switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setSubject(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setPredicate(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setObjectId(value); - break; - case 4: - var value = new proto.api.Value; - reader.readMessage(value,proto.api.Value.deserializeBinaryFromReader); - msg.setObjectValue(value); - break; - case 6: - var value = /** @type {string} */ (reader.readString()); - msg.setLang(value); - break; - case 7: - var value = new proto.api.Facet; - reader.readMessage(value,proto.api.Facet.deserializeBinaryFromReader); - msg.addFacets(value); - break; - case 8: - var value = /** @type {number} */ (reader.readUint64()); - msg.setNamespace(value); - break; - default: - reader.skipField(); - break; + case 1: + var value = /** @type {string} */ (reader.readString()) + msg.setSubject(value) + break + case 2: + var value = /** @type {string} */ (reader.readString()) + msg.setPredicate(value) + break + case 3: + var value = /** @type {string} */ (reader.readString()) + msg.setObjectId(value) + break + case 4: + var value = new proto.api.Value() + reader.readMessage(value, proto.api.Value.deserializeBinaryFromReader) + msg.setObjectValue(value) + break + case 6: + var value = /** @type {string} */ (reader.readString()) + msg.setLang(value) + break + case 7: + var value = new proto.api.Facet() + reader.readMessage(value, proto.api.Facet.deserializeBinaryFromReader) + msg.addFacets(value) + break + case 8: + var value = /** @type {number} */ (reader.readUint64()) + msg.setNamespace(value) + break + default: + reader.skipField() + break } } - return msg; -}; - + return msg +} /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.NQuad.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.api.NQuad.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - +proto.api.NQuad.prototype.serializeBinary = function () { + var writer = new jspb.BinaryWriter() + proto.api.NQuad.serializeBinaryToWriter(this, writer) + return writer.getResultBuffer() +} /** * Serializes the given message to binary data (in protobuf wire @@ -3553,227 +3252,184 @@ proto.api.NQuad.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.NQuad.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getSubject(); +proto.api.NQuad.serializeBinaryToWriter = function (message, writer) { + var f = undefined + f = message.getSubject() if (f.length > 0) { - writer.writeString( - 1, - f - ); + writer.writeString(1, f) } - f = message.getPredicate(); + f = message.getPredicate() if (f.length > 0) { - writer.writeString( - 2, - f - ); + writer.writeString(2, f) } - f = message.getObjectId(); + f = message.getObjectId() if (f.length > 0) { - writer.writeString( - 3, - f - ); + writer.writeString(3, f) } - f = message.getObjectValue(); + f = message.getObjectValue() if (f != null) { - writer.writeMessage( - 4, - f, - proto.api.Value.serializeBinaryToWriter - ); + writer.writeMessage(4, f, proto.api.Value.serializeBinaryToWriter) } - f = message.getLang(); + f = message.getLang() if (f.length > 0) { - writer.writeString( - 6, - f - ); + writer.writeString(6, f) } - f = message.getFacetsList(); + f = message.getFacetsList() if (f.length > 0) { - writer.writeRepeatedMessage( - 7, - f, - proto.api.Facet.serializeBinaryToWriter - ); + writer.writeRepeatedMessage(7, f, proto.api.Facet.serializeBinaryToWriter) } - f = message.getNamespace(); + f = message.getNamespace() if (f !== 0) { - writer.writeUint64( - 8, - f - ); + writer.writeUint64(8, f) } -}; - +} /** * optional string subject = 1; * @return {string} */ -proto.api.NQuad.prototype.getSubject = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - +proto.api.NQuad.prototype.getSubject = function () { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")) +} /** * @param {string} value * @return {!proto.api.NQuad} returns this */ -proto.api.NQuad.prototype.setSubject = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - +proto.api.NQuad.prototype.setSubject = function (value) { + return jspb.Message.setProto3StringField(this, 1, value) +} /** * optional string predicate = 2; * @return {string} */ -proto.api.NQuad.prototype.getPredicate = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - +proto.api.NQuad.prototype.getPredicate = function () { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")) +} /** * @param {string} value * @return {!proto.api.NQuad} returns this */ -proto.api.NQuad.prototype.setPredicate = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - +proto.api.NQuad.prototype.setPredicate = function (value) { + return jspb.Message.setProto3StringField(this, 2, value) +} /** * optional string object_id = 3; * @return {string} */ -proto.api.NQuad.prototype.getObjectId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - +proto.api.NQuad.prototype.getObjectId = function () { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")) +} /** * @param {string} value * @return {!proto.api.NQuad} returns this */ -proto.api.NQuad.prototype.setObjectId = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - +proto.api.NQuad.prototype.setObjectId = function (value) { + return jspb.Message.setProto3StringField(this, 3, value) +} /** * optional Value object_value = 4; * @return {?proto.api.Value} */ -proto.api.NQuad.prototype.getObjectValue = function() { - return /** @type{?proto.api.Value} */ ( - jspb.Message.getWrapperField(this, proto.api.Value, 4)); -}; - +proto.api.NQuad.prototype.getObjectValue = function () { + return /** @type{?proto.api.Value} */ (jspb.Message.getWrapperField(this, proto.api.Value, 4)) +} /** * @param {?proto.api.Value|undefined} value * @return {!proto.api.NQuad} returns this -*/ -proto.api.NQuad.prototype.setObjectValue = function(value) { - return jspb.Message.setWrapperField(this, 4, value); -}; - + */ +proto.api.NQuad.prototype.setObjectValue = function (value) { + return jspb.Message.setWrapperField(this, 4, value) +} /** * Clears the message field making it undefined. * @return {!proto.api.NQuad} returns this */ -proto.api.NQuad.prototype.clearObjectValue = function() { - return this.setObjectValue(undefined); -}; - +proto.api.NQuad.prototype.clearObjectValue = function () { + return this.setObjectValue(undefined) +} /** * Returns whether this field is set. * @return {boolean} */ -proto.api.NQuad.prototype.hasObjectValue = function() { - return jspb.Message.getField(this, 4) != null; -}; - +proto.api.NQuad.prototype.hasObjectValue = function () { + return jspb.Message.getField(this, 4) != null +} /** * optional string lang = 6; * @return {string} */ -proto.api.NQuad.prototype.getLang = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); -}; - +proto.api.NQuad.prototype.getLang = function () { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")) +} /** * @param {string} value * @return {!proto.api.NQuad} returns this */ -proto.api.NQuad.prototype.setLang = function(value) { - return jspb.Message.setProto3StringField(this, 6, value); -}; - +proto.api.NQuad.prototype.setLang = function (value) { + return jspb.Message.setProto3StringField(this, 6, value) +} /** * repeated Facet facets = 7; * @return {!Array} */ -proto.api.NQuad.prototype.getFacetsList = function() { +proto.api.NQuad.prototype.getFacetsList = function () { return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.api.Facet, 7)); -}; - + jspb.Message.getRepeatedWrapperField(this, proto.api.Facet, 7) + ) +} /** * @param {!Array} value * @return {!proto.api.NQuad} returns this -*/ -proto.api.NQuad.prototype.setFacetsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 7, value); -}; - + */ +proto.api.NQuad.prototype.setFacetsList = function (value) { + return jspb.Message.setRepeatedWrapperField(this, 7, value) +} /** * @param {!proto.api.Facet=} opt_value * @param {number=} opt_index * @return {!proto.api.Facet} */ -proto.api.NQuad.prototype.addFacets = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 7, opt_value, proto.api.Facet, opt_index); -}; - +proto.api.NQuad.prototype.addFacets = function (opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 7, opt_value, proto.api.Facet, opt_index) +} /** * Clears the list making it empty but non-null. * @return {!proto.api.NQuad} returns this */ -proto.api.NQuad.prototype.clearFacetsList = function() { - return this.setFacetsList([]); -}; - +proto.api.NQuad.prototype.clearFacetsList = function () { + return this.setFacetsList([]) +} /** * optional uint64 namespace = 8; * @return {number} */ -proto.api.NQuad.prototype.getNamespace = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 8, 0)); -}; - +proto.api.NQuad.prototype.getNamespace = function () { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 8, 0)) +} /** * @param {number} value * @return {!proto.api.NQuad} returns this */ -proto.api.NQuad.prototype.setNamespace = function(value) { - return jspb.Message.setProto3IntField(this, 8, value); -}; - - +proto.api.NQuad.prototype.setNamespace = function (value) { + return jspb.Message.setProto3IntField(this, 8, value) +} /** * Oneof group definitions for this message. Each group defines the field @@ -3783,7 +3439,7 @@ proto.api.NQuad.prototype.setNamespace = function(value) { * @private {!Array>} * @const */ -proto.api.Value.oneofGroups_ = [[1,2,3,4,5,6,7,8,9,10,11,13]]; +proto.api.Value.oneofGroups_ = [[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13]] /** * @enum {number} @@ -3801,80 +3457,78 @@ proto.api.Value.ValCase = { DATETIME_VAL: 9, PASSWORD_VAL: 10, UID_VAL: 11, - VFLOAT32_VAL: 13 -}; + VFLOAT32_VAL: 13, +} /** * @return {proto.api.Value.ValCase} */ -proto.api.Value.prototype.getValCase = function() { - return /** @type {proto.api.Value.ValCase} */(jspb.Message.computeOneofCase(this, proto.api.Value.oneofGroups_[0])); -}; - +proto.api.Value.prototype.getValCase = function () { + return /** @type {proto.api.Value.ValCase} */ ( + jspb.Message.computeOneofCase(this, proto.api.Value.oneofGroups_[0]) + ) +} +if (jspb.Message.GENERATE_TO_OBJECT) { + /** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ + proto.api.Value.prototype.toObject = function (opt_includeInstance) { + return proto.api.Value.toObject(opt_includeInstance, this) + } -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.api.Value.prototype.toObject = function(opt_includeInstance) { - return proto.api.Value.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.api.Value} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.api.Value.toObject = function(includeInstance, msg) { - var f, obj = { - defaultVal: jspb.Message.getFieldWithDefault(msg, 1, ""), - bytesVal: msg.getBytesVal_asB64(), - intVal: jspb.Message.getFieldWithDefault(msg, 3, 0), - boolVal: jspb.Message.getBooleanFieldWithDefault(msg, 4, false), - strVal: jspb.Message.getFieldWithDefault(msg, 5, ""), - doubleVal: jspb.Message.getFloatingPointFieldWithDefault(msg, 6, 0.0), - geoVal: msg.getGeoVal_asB64(), - dateVal: msg.getDateVal_asB64(), - datetimeVal: msg.getDatetimeVal_asB64(), - passwordVal: jspb.Message.getFieldWithDefault(msg, 10, ""), - uidVal: jspb.Message.getFieldWithDefault(msg, 11, 0), - vfloat32Val: msg.getVfloat32Val_asB64() - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; + /** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.Value} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ + proto.api.Value.toObject = function (includeInstance, msg) { + var f, + obj = { + defaultVal: jspb.Message.getFieldWithDefault(msg, 1, ""), + bytesVal: msg.getBytesVal_asB64(), + intVal: jspb.Message.getFieldWithDefault(msg, 3, 0), + boolVal: jspb.Message.getBooleanFieldWithDefault(msg, 4, false), + strVal: jspb.Message.getFieldWithDefault(msg, 5, ""), + doubleVal: jspb.Message.getFloatingPointFieldWithDefault(msg, 6, 0.0), + geoVal: msg.getGeoVal_asB64(), + dateVal: msg.getDateVal_asB64(), + datetimeVal: msg.getDatetimeVal_asB64(), + passwordVal: jspb.Message.getFieldWithDefault(msg, 10, ""), + uidVal: jspb.Message.getFieldWithDefault(msg, 11, 0), + vfloat32Val: msg.getVfloat32Val_asB64(), + } + + if (includeInstance) { + obj.$jspbMessageInstance = msg + } + return obj } - return obj; -}; } - /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.api.Value} */ -proto.api.Value.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.Value; - return proto.api.Value.deserializeBinaryFromReader(msg, reader); -}; - +proto.api.Value.deserializeBinary = function (bytes) { + var reader = new jspb.BinaryReader(bytes) + var msg = new proto.api.Value() + return proto.api.Value.deserializeBinaryFromReader(msg, reader) +} /** * Deserializes binary data (in protobuf wire format) from the @@ -3883,80 +3537,78 @@ proto.api.Value.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.api.Value} */ -proto.api.Value.deserializeBinaryFromReader = function(msg, reader) { +proto.api.Value.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { - break; + break } - var field = reader.getFieldNumber(); + var field = reader.getFieldNumber() switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setDefaultVal(value); - break; - case 2: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setBytesVal(value); - break; - case 3: - var value = /** @type {number} */ (reader.readInt64()); - msg.setIntVal(value); - break; - case 4: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setBoolVal(value); - break; - case 5: - var value = /** @type {string} */ (reader.readString()); - msg.setStrVal(value); - break; - case 6: - var value = /** @type {number} */ (reader.readDouble()); - msg.setDoubleVal(value); - break; - case 7: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setGeoVal(value); - break; - case 8: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setDateVal(value); - break; - case 9: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setDatetimeVal(value); - break; - case 10: - var value = /** @type {string} */ (reader.readString()); - msg.setPasswordVal(value); - break; - case 11: - var value = /** @type {number} */ (reader.readUint64()); - msg.setUidVal(value); - break; - case 13: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setVfloat32Val(value); - break; - default: - reader.skipField(); - break; + case 1: + var value = /** @type {string} */ (reader.readString()) + msg.setDefaultVal(value) + break + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()) + msg.setBytesVal(value) + break + case 3: + var value = /** @type {number} */ (reader.readInt64()) + msg.setIntVal(value) + break + case 4: + var value = /** @type {boolean} */ (reader.readBool()) + msg.setBoolVal(value) + break + case 5: + var value = /** @type {string} */ (reader.readString()) + msg.setStrVal(value) + break + case 6: + var value = /** @type {number} */ (reader.readDouble()) + msg.setDoubleVal(value) + break + case 7: + var value = /** @type {!Uint8Array} */ (reader.readBytes()) + msg.setGeoVal(value) + break + case 8: + var value = /** @type {!Uint8Array} */ (reader.readBytes()) + msg.setDateVal(value) + break + case 9: + var value = /** @type {!Uint8Array} */ (reader.readBytes()) + msg.setDatetimeVal(value) + break + case 10: + var value = /** @type {string} */ (reader.readString()) + msg.setPasswordVal(value) + break + case 11: + var value = /** @type {number} */ (reader.readUint64()) + msg.setUidVal(value) + break + case 13: + var value = /** @type {!Uint8Array} */ (reader.readBytes()) + msg.setVfloat32Val(value) + break + default: + reader.skipField() + break } } - return msg; -}; - + return msg +} /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.Value.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.api.Value.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - +proto.api.Value.prototype.serializeBinary = function () { + var writer = new jspb.BinaryWriter() + proto.api.Value.serializeBinaryToWriter(this, writer) + return writer.getResultBuffer() +} /** * Serializes the given message to binary data (in protobuf wire @@ -3965,150 +3617,106 @@ proto.api.Value.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.Value.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = /** @type {string} */ (jspb.Message.getField(message, 1)); +proto.api.Value.serializeBinaryToWriter = function (message, writer) { + var f = undefined + f = /** @type {string} */ (jspb.Message.getField(message, 1)) if (f != null) { - writer.writeString( - 1, - f - ); + writer.writeString(1, f) } - f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 2)); + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 2)) if (f != null) { - writer.writeBytes( - 2, - f - ); + writer.writeBytes(2, f) } - f = /** @type {number} */ (jspb.Message.getField(message, 3)); + f = /** @type {number} */ (jspb.Message.getField(message, 3)) if (f != null) { - writer.writeInt64( - 3, - f - ); + writer.writeInt64(3, f) } - f = /** @type {boolean} */ (jspb.Message.getField(message, 4)); + f = /** @type {boolean} */ (jspb.Message.getField(message, 4)) if (f != null) { - writer.writeBool( - 4, - f - ); + writer.writeBool(4, f) } - f = /** @type {string} */ (jspb.Message.getField(message, 5)); + f = /** @type {string} */ (jspb.Message.getField(message, 5)) if (f != null) { - writer.writeString( - 5, - f - ); + writer.writeString(5, f) } - f = /** @type {number} */ (jspb.Message.getField(message, 6)); + f = /** @type {number} */ (jspb.Message.getField(message, 6)) if (f != null) { - writer.writeDouble( - 6, - f - ); + writer.writeDouble(6, f) } - f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 7)); + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 7)) if (f != null) { - writer.writeBytes( - 7, - f - ); + writer.writeBytes(7, f) } - f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 8)); + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 8)) if (f != null) { - writer.writeBytes( - 8, - f - ); + writer.writeBytes(8, f) } - f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 9)); + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 9)) if (f != null) { - writer.writeBytes( - 9, - f - ); + writer.writeBytes(9, f) } - f = /** @type {string} */ (jspb.Message.getField(message, 10)); + f = /** @type {string} */ (jspb.Message.getField(message, 10)) if (f != null) { - writer.writeString( - 10, - f - ); + writer.writeString(10, f) } - f = /** @type {number} */ (jspb.Message.getField(message, 11)); + f = /** @type {number} */ (jspb.Message.getField(message, 11)) if (f != null) { - writer.writeUint64( - 11, - f - ); + writer.writeUint64(11, f) } - f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 13)); + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 13)) if (f != null) { - writer.writeBytes( - 13, - f - ); + writer.writeBytes(13, f) } -}; - +} /** * optional string default_val = 1; * @return {string} */ -proto.api.Value.prototype.getDefaultVal = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - +proto.api.Value.prototype.getDefaultVal = function () { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")) +} /** * @param {string} value * @return {!proto.api.Value} returns this */ -proto.api.Value.prototype.setDefaultVal = function(value) { - return jspb.Message.setOneofField(this, 1, proto.api.Value.oneofGroups_[0], value); -}; - +proto.api.Value.prototype.setDefaultVal = function (value) { + return jspb.Message.setOneofField(this, 1, proto.api.Value.oneofGroups_[0], value) +} /** * Clears the field making it undefined. * @return {!proto.api.Value} returns this */ -proto.api.Value.prototype.clearDefaultVal = function() { - return jspb.Message.setOneofField(this, 1, proto.api.Value.oneofGroups_[0], undefined); -}; - +proto.api.Value.prototype.clearDefaultVal = function () { + return jspb.Message.setOneofField(this, 1, proto.api.Value.oneofGroups_[0], undefined) +} /** * Returns whether this field is set. * @return {boolean} */ -proto.api.Value.prototype.hasDefaultVal = function() { - return jspb.Message.getField(this, 1) != null; -}; - +proto.api.Value.prototype.hasDefaultVal = function () { + return jspb.Message.getField(this, 1) != null +} /** * optional bytes bytes_val = 2; * @return {!(string|Uint8Array)} */ -proto.api.Value.prototype.getBytesVal = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - +proto.api.Value.prototype.getBytesVal = function () { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")) +} /** * optional bytes bytes_val = 2; * This is a type-conversion wrapper around `getBytesVal()` * @return {string} */ -proto.api.Value.prototype.getBytesVal_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getBytesVal())); -}; - +proto.api.Value.prototype.getBytesVal_asB64 = function () { + return /** @type {string} */ (jspb.Message.bytesAsB64(this.getBytesVal())) +} /** * optional bytes bytes_val = 2; @@ -4117,202 +3725,178 @@ proto.api.Value.prototype.getBytesVal_asB64 = function() { * This is a type-conversion wrapper around `getBytesVal()` * @return {!Uint8Array} */ -proto.api.Value.prototype.getBytesVal_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getBytesVal())); -}; - +proto.api.Value.prototype.getBytesVal_asU8 = function () { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(this.getBytesVal())) +} /** * @param {!(string|Uint8Array)} value * @return {!proto.api.Value} returns this */ -proto.api.Value.prototype.setBytesVal = function(value) { - return jspb.Message.setOneofField(this, 2, proto.api.Value.oneofGroups_[0], value); -}; - +proto.api.Value.prototype.setBytesVal = function (value) { + return jspb.Message.setOneofField(this, 2, proto.api.Value.oneofGroups_[0], value) +} /** * Clears the field making it undefined. * @return {!proto.api.Value} returns this */ -proto.api.Value.prototype.clearBytesVal = function() { - return jspb.Message.setOneofField(this, 2, proto.api.Value.oneofGroups_[0], undefined); -}; - +proto.api.Value.prototype.clearBytesVal = function () { + return jspb.Message.setOneofField(this, 2, proto.api.Value.oneofGroups_[0], undefined) +} /** * Returns whether this field is set. * @return {boolean} */ -proto.api.Value.prototype.hasBytesVal = function() { - return jspb.Message.getField(this, 2) != null; -}; - +proto.api.Value.prototype.hasBytesVal = function () { + return jspb.Message.getField(this, 2) != null +} /** * optional int64 int_val = 3; * @return {number} */ -proto.api.Value.prototype.getIntVal = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); -}; - +proto.api.Value.prototype.getIntVal = function () { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)) +} /** * @param {number} value * @return {!proto.api.Value} returns this */ -proto.api.Value.prototype.setIntVal = function(value) { - return jspb.Message.setOneofField(this, 3, proto.api.Value.oneofGroups_[0], value); -}; - +proto.api.Value.prototype.setIntVal = function (value) { + return jspb.Message.setOneofField(this, 3, proto.api.Value.oneofGroups_[0], value) +} /** * Clears the field making it undefined. * @return {!proto.api.Value} returns this */ -proto.api.Value.prototype.clearIntVal = function() { - return jspb.Message.setOneofField(this, 3, proto.api.Value.oneofGroups_[0], undefined); -}; - +proto.api.Value.prototype.clearIntVal = function () { + return jspb.Message.setOneofField(this, 3, proto.api.Value.oneofGroups_[0], undefined) +} /** * Returns whether this field is set. * @return {boolean} */ -proto.api.Value.prototype.hasIntVal = function() { - return jspb.Message.getField(this, 3) != null; -}; - +proto.api.Value.prototype.hasIntVal = function () { + return jspb.Message.getField(this, 3) != null +} /** * optional bool bool_val = 4; * @return {boolean} */ -proto.api.Value.prototype.getBoolVal = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false)); -}; - +proto.api.Value.prototype.getBoolVal = function () { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false)) +} /** * @param {boolean} value * @return {!proto.api.Value} returns this */ -proto.api.Value.prototype.setBoolVal = function(value) { - return jspb.Message.setOneofField(this, 4, proto.api.Value.oneofGroups_[0], value); -}; - +proto.api.Value.prototype.setBoolVal = function (value) { + return jspb.Message.setOneofField(this, 4, proto.api.Value.oneofGroups_[0], value) +} /** * Clears the field making it undefined. * @return {!proto.api.Value} returns this */ -proto.api.Value.prototype.clearBoolVal = function() { - return jspb.Message.setOneofField(this, 4, proto.api.Value.oneofGroups_[0], undefined); -}; - +proto.api.Value.prototype.clearBoolVal = function () { + return jspb.Message.setOneofField(this, 4, proto.api.Value.oneofGroups_[0], undefined) +} /** * Returns whether this field is set. * @return {boolean} */ -proto.api.Value.prototype.hasBoolVal = function() { - return jspb.Message.getField(this, 4) != null; -}; - +proto.api.Value.prototype.hasBoolVal = function () { + return jspb.Message.getField(this, 4) != null +} /** * optional string str_val = 5; * @return {string} */ -proto.api.Value.prototype.getStrVal = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); -}; - +proto.api.Value.prototype.getStrVal = function () { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")) +} /** * @param {string} value * @return {!proto.api.Value} returns this */ -proto.api.Value.prototype.setStrVal = function(value) { - return jspb.Message.setOneofField(this, 5, proto.api.Value.oneofGroups_[0], value); -}; - +proto.api.Value.prototype.setStrVal = function (value) { + return jspb.Message.setOneofField(this, 5, proto.api.Value.oneofGroups_[0], value) +} /** * Clears the field making it undefined. * @return {!proto.api.Value} returns this */ -proto.api.Value.prototype.clearStrVal = function() { - return jspb.Message.setOneofField(this, 5, proto.api.Value.oneofGroups_[0], undefined); -}; - +proto.api.Value.prototype.clearStrVal = function () { + return jspb.Message.setOneofField(this, 5, proto.api.Value.oneofGroups_[0], undefined) +} /** * Returns whether this field is set. * @return {boolean} */ -proto.api.Value.prototype.hasStrVal = function() { - return jspb.Message.getField(this, 5) != null; -}; - +proto.api.Value.prototype.hasStrVal = function () { + return jspb.Message.getField(this, 5) != null +} /** * optional double double_val = 6; * @return {number} */ -proto.api.Value.prototype.getDoubleVal = function() { - return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 6, 0.0)); -}; - +proto.api.Value.prototype.getDoubleVal = function () { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 6, 0.0)) +} /** * @param {number} value * @return {!proto.api.Value} returns this */ -proto.api.Value.prototype.setDoubleVal = function(value) { - return jspb.Message.setOneofField(this, 6, proto.api.Value.oneofGroups_[0], value); -}; - +proto.api.Value.prototype.setDoubleVal = function (value) { + return jspb.Message.setOneofField(this, 6, proto.api.Value.oneofGroups_[0], value) +} /** * Clears the field making it undefined. * @return {!proto.api.Value} returns this */ -proto.api.Value.prototype.clearDoubleVal = function() { - return jspb.Message.setOneofField(this, 6, proto.api.Value.oneofGroups_[0], undefined); -}; - +proto.api.Value.prototype.clearDoubleVal = function () { + return jspb.Message.setOneofField(this, 6, proto.api.Value.oneofGroups_[0], undefined) +} /** * Returns whether this field is set. * @return {boolean} */ -proto.api.Value.prototype.hasDoubleVal = function() { - return jspb.Message.getField(this, 6) != null; -}; - +proto.api.Value.prototype.hasDoubleVal = function () { + return jspb.Message.getField(this, 6) != null +} /** * optional bytes geo_val = 7; * @return {!(string|Uint8Array)} */ -proto.api.Value.prototype.getGeoVal = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 7, "")); -}; - +proto.api.Value.prototype.getGeoVal = function () { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 7, "")) +} /** * optional bytes geo_val = 7; * This is a type-conversion wrapper around `getGeoVal()` * @return {string} */ -proto.api.Value.prototype.getGeoVal_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getGeoVal())); -}; - +proto.api.Value.prototype.getGeoVal_asB64 = function () { + return /** @type {string} */ (jspb.Message.bytesAsB64(this.getGeoVal())) +} /** * optional bytes geo_val = 7; @@ -4321,58 +3905,50 @@ proto.api.Value.prototype.getGeoVal_asB64 = function() { * This is a type-conversion wrapper around `getGeoVal()` * @return {!Uint8Array} */ -proto.api.Value.prototype.getGeoVal_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getGeoVal())); -}; - +proto.api.Value.prototype.getGeoVal_asU8 = function () { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(this.getGeoVal())) +} /** * @param {!(string|Uint8Array)} value * @return {!proto.api.Value} returns this */ -proto.api.Value.prototype.setGeoVal = function(value) { - return jspb.Message.setOneofField(this, 7, proto.api.Value.oneofGroups_[0], value); -}; - +proto.api.Value.prototype.setGeoVal = function (value) { + return jspb.Message.setOneofField(this, 7, proto.api.Value.oneofGroups_[0], value) +} /** * Clears the field making it undefined. * @return {!proto.api.Value} returns this */ -proto.api.Value.prototype.clearGeoVal = function() { - return jspb.Message.setOneofField(this, 7, proto.api.Value.oneofGroups_[0], undefined); -}; - +proto.api.Value.prototype.clearGeoVal = function () { + return jspb.Message.setOneofField(this, 7, proto.api.Value.oneofGroups_[0], undefined) +} /** * Returns whether this field is set. * @return {boolean} */ -proto.api.Value.prototype.hasGeoVal = function() { - return jspb.Message.getField(this, 7) != null; -}; - +proto.api.Value.prototype.hasGeoVal = function () { + return jspb.Message.getField(this, 7) != null +} /** * optional bytes date_val = 8; * @return {!(string|Uint8Array)} */ -proto.api.Value.prototype.getDateVal = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 8, "")); -}; - +proto.api.Value.prototype.getDateVal = function () { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 8, "")) +} /** * optional bytes date_val = 8; * This is a type-conversion wrapper around `getDateVal()` * @return {string} */ -proto.api.Value.prototype.getDateVal_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getDateVal())); -}; - +proto.api.Value.prototype.getDateVal_asB64 = function () { + return /** @type {string} */ (jspb.Message.bytesAsB64(this.getDateVal())) +} /** * optional bytes date_val = 8; @@ -4381,58 +3957,50 @@ proto.api.Value.prototype.getDateVal_asB64 = function() { * This is a type-conversion wrapper around `getDateVal()` * @return {!Uint8Array} */ -proto.api.Value.prototype.getDateVal_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getDateVal())); -}; - +proto.api.Value.prototype.getDateVal_asU8 = function () { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(this.getDateVal())) +} /** * @param {!(string|Uint8Array)} value * @return {!proto.api.Value} returns this */ -proto.api.Value.prototype.setDateVal = function(value) { - return jspb.Message.setOneofField(this, 8, proto.api.Value.oneofGroups_[0], value); -}; - +proto.api.Value.prototype.setDateVal = function (value) { + return jspb.Message.setOneofField(this, 8, proto.api.Value.oneofGroups_[0], value) +} /** * Clears the field making it undefined. * @return {!proto.api.Value} returns this */ -proto.api.Value.prototype.clearDateVal = function() { - return jspb.Message.setOneofField(this, 8, proto.api.Value.oneofGroups_[0], undefined); -}; - +proto.api.Value.prototype.clearDateVal = function () { + return jspb.Message.setOneofField(this, 8, proto.api.Value.oneofGroups_[0], undefined) +} /** * Returns whether this field is set. * @return {boolean} */ -proto.api.Value.prototype.hasDateVal = function() { - return jspb.Message.getField(this, 8) != null; -}; - +proto.api.Value.prototype.hasDateVal = function () { + return jspb.Message.getField(this, 8) != null +} /** * optional bytes datetime_val = 9; * @return {!(string|Uint8Array)} */ -proto.api.Value.prototype.getDatetimeVal = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 9, "")); -}; - +proto.api.Value.prototype.getDatetimeVal = function () { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 9, "")) +} /** * optional bytes datetime_val = 9; * This is a type-conversion wrapper around `getDatetimeVal()` * @return {string} */ -proto.api.Value.prototype.getDatetimeVal_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getDatetimeVal())); -}; - +proto.api.Value.prototype.getDatetimeVal_asB64 = function () { + return /** @type {string} */ (jspb.Message.bytesAsB64(this.getDatetimeVal())) +} /** * optional bytes datetime_val = 9; @@ -4441,130 +4009,114 @@ proto.api.Value.prototype.getDatetimeVal_asB64 = function() { * This is a type-conversion wrapper around `getDatetimeVal()` * @return {!Uint8Array} */ -proto.api.Value.prototype.getDatetimeVal_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getDatetimeVal())); -}; - +proto.api.Value.prototype.getDatetimeVal_asU8 = function () { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(this.getDatetimeVal())) +} /** * @param {!(string|Uint8Array)} value * @return {!proto.api.Value} returns this */ -proto.api.Value.prototype.setDatetimeVal = function(value) { - return jspb.Message.setOneofField(this, 9, proto.api.Value.oneofGroups_[0], value); -}; - +proto.api.Value.prototype.setDatetimeVal = function (value) { + return jspb.Message.setOneofField(this, 9, proto.api.Value.oneofGroups_[0], value) +} /** * Clears the field making it undefined. * @return {!proto.api.Value} returns this */ -proto.api.Value.prototype.clearDatetimeVal = function() { - return jspb.Message.setOneofField(this, 9, proto.api.Value.oneofGroups_[0], undefined); -}; - +proto.api.Value.prototype.clearDatetimeVal = function () { + return jspb.Message.setOneofField(this, 9, proto.api.Value.oneofGroups_[0], undefined) +} /** * Returns whether this field is set. * @return {boolean} */ -proto.api.Value.prototype.hasDatetimeVal = function() { - return jspb.Message.getField(this, 9) != null; -}; - +proto.api.Value.prototype.hasDatetimeVal = function () { + return jspb.Message.getField(this, 9) != null +} /** * optional string password_val = 10; * @return {string} */ -proto.api.Value.prototype.getPasswordVal = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 10, "")); -}; - +proto.api.Value.prototype.getPasswordVal = function () { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 10, "")) +} /** * @param {string} value * @return {!proto.api.Value} returns this */ -proto.api.Value.prototype.setPasswordVal = function(value) { - return jspb.Message.setOneofField(this, 10, proto.api.Value.oneofGroups_[0], value); -}; - +proto.api.Value.prototype.setPasswordVal = function (value) { + return jspb.Message.setOneofField(this, 10, proto.api.Value.oneofGroups_[0], value) +} /** * Clears the field making it undefined. * @return {!proto.api.Value} returns this */ -proto.api.Value.prototype.clearPasswordVal = function() { - return jspb.Message.setOneofField(this, 10, proto.api.Value.oneofGroups_[0], undefined); -}; - +proto.api.Value.prototype.clearPasswordVal = function () { + return jspb.Message.setOneofField(this, 10, proto.api.Value.oneofGroups_[0], undefined) +} /** * Returns whether this field is set. * @return {boolean} */ -proto.api.Value.prototype.hasPasswordVal = function() { - return jspb.Message.getField(this, 10) != null; -}; - +proto.api.Value.prototype.hasPasswordVal = function () { + return jspb.Message.getField(this, 10) != null +} /** * optional uint64 uid_val = 11; * @return {number} */ -proto.api.Value.prototype.getUidVal = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 11, 0)); -}; - +proto.api.Value.prototype.getUidVal = function () { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 11, 0)) +} /** * @param {number} value * @return {!proto.api.Value} returns this */ -proto.api.Value.prototype.setUidVal = function(value) { - return jspb.Message.setOneofField(this, 11, proto.api.Value.oneofGroups_[0], value); -}; - +proto.api.Value.prototype.setUidVal = function (value) { + return jspb.Message.setOneofField(this, 11, proto.api.Value.oneofGroups_[0], value) +} /** * Clears the field making it undefined. * @return {!proto.api.Value} returns this */ -proto.api.Value.prototype.clearUidVal = function() { - return jspb.Message.setOneofField(this, 11, proto.api.Value.oneofGroups_[0], undefined); -}; - +proto.api.Value.prototype.clearUidVal = function () { + return jspb.Message.setOneofField(this, 11, proto.api.Value.oneofGroups_[0], undefined) +} /** * Returns whether this field is set. * @return {boolean} */ -proto.api.Value.prototype.hasUidVal = function() { - return jspb.Message.getField(this, 11) != null; -}; - +proto.api.Value.prototype.hasUidVal = function () { + return jspb.Message.getField(this, 11) != null +} /** * optional bytes vfloat32_val = 13; * @return {!(string|Uint8Array)} */ -proto.api.Value.prototype.getVfloat32Val = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 13, "")); -}; - +proto.api.Value.prototype.getVfloat32Val = function () { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 13, "")) +} /** * optional bytes vfloat32_val = 13; * This is a type-conversion wrapper around `getVfloat32Val()` * @return {string} */ -proto.api.Value.prototype.getVfloat32Val_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getVfloat32Val())); -}; - +proto.api.Value.prototype.getVfloat32Val_asB64 = function () { + return /** @type {string} */ (jspb.Message.bytesAsB64(this.getVfloat32Val())) +} /** * optional bytes vfloat32_val = 13; @@ -4573,104 +4125,94 @@ proto.api.Value.prototype.getVfloat32Val_asB64 = function() { * This is a type-conversion wrapper around `getVfloat32Val()` * @return {!Uint8Array} */ -proto.api.Value.prototype.getVfloat32Val_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getVfloat32Val())); -}; - +proto.api.Value.prototype.getVfloat32Val_asU8 = function () { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(this.getVfloat32Val())) +} /** * @param {!(string|Uint8Array)} value * @return {!proto.api.Value} returns this */ -proto.api.Value.prototype.setVfloat32Val = function(value) { - return jspb.Message.setOneofField(this, 13, proto.api.Value.oneofGroups_[0], value); -}; - +proto.api.Value.prototype.setVfloat32Val = function (value) { + return jspb.Message.setOneofField(this, 13, proto.api.Value.oneofGroups_[0], value) +} /** * Clears the field making it undefined. * @return {!proto.api.Value} returns this */ -proto.api.Value.prototype.clearVfloat32Val = function() { - return jspb.Message.setOneofField(this, 13, proto.api.Value.oneofGroups_[0], undefined); -}; - +proto.api.Value.prototype.clearVfloat32Val = function () { + return jspb.Message.setOneofField(this, 13, proto.api.Value.oneofGroups_[0], undefined) +} /** * Returns whether this field is set. * @return {boolean} */ -proto.api.Value.prototype.hasVfloat32Val = function() { - return jspb.Message.getField(this, 13) != null; -}; - - +proto.api.Value.prototype.hasVfloat32Val = function () { + return jspb.Message.getField(this, 13) != null +} /** * List of repeated fields within this message type. * @private {!Array} * @const */ -proto.api.Facet.repeatedFields_ = [4]; - - +proto.api.Facet.repeatedFields_ = [4] if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.api.Facet.prototype.toObject = function(opt_includeInstance) { - return proto.api.Facet.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.api.Facet} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.api.Facet.toObject = function(includeInstance, msg) { - var f, obj = { - key: jspb.Message.getFieldWithDefault(msg, 1, ""), - value: msg.getValue_asB64(), - valType: jspb.Message.getFieldWithDefault(msg, 3, 0), - tokensList: (f = jspb.Message.getRepeatedField(msg, 4)) == null ? undefined : f, - alias: jspb.Message.getFieldWithDefault(msg, 5, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; + /** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ + proto.api.Facet.prototype.toObject = function (opt_includeInstance) { + return proto.api.Facet.toObject(opt_includeInstance, this) } - return obj; -}; -} + /** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.Facet} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ + proto.api.Facet.toObject = function (includeInstance, msg) { + var f, + obj = { + key: jspb.Message.getFieldWithDefault(msg, 1, ""), + value: msg.getValue_asB64(), + valType: jspb.Message.getFieldWithDefault(msg, 3, 0), + tokensList: (f = jspb.Message.getRepeatedField(msg, 4)) == null ? undefined : f, + alias: jspb.Message.getFieldWithDefault(msg, 5, ""), + } + + if (includeInstance) { + obj.$jspbMessageInstance = msg + } + return obj + } +} /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.api.Facet} */ -proto.api.Facet.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.Facet; - return proto.api.Facet.deserializeBinaryFromReader(msg, reader); -}; - +proto.api.Facet.deserializeBinary = function (bytes) { + var reader = new jspb.BinaryReader(bytes) + var msg = new proto.api.Facet() + return proto.api.Facet.deserializeBinaryFromReader(msg, reader) +} /** * Deserializes binary data (in protobuf wire format) from the @@ -4679,52 +4221,50 @@ proto.api.Facet.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.api.Facet} */ -proto.api.Facet.deserializeBinaryFromReader = function(msg, reader) { +proto.api.Facet.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { - break; + break } - var field = reader.getFieldNumber(); + var field = reader.getFieldNumber() switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setKey(value); - break; - case 2: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setValue(value); - break; - case 3: - var value = /** @type {!proto.api.Facet.ValType} */ (reader.readEnum()); - msg.setValType(value); - break; - case 4: - var value = /** @type {string} */ (reader.readString()); - msg.addTokens(value); - break; - case 5: - var value = /** @type {string} */ (reader.readString()); - msg.setAlias(value); - break; - default: - reader.skipField(); - break; + case 1: + var value = /** @type {string} */ (reader.readString()) + msg.setKey(value) + break + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()) + msg.setValue(value) + break + case 3: + var value = /** @type {!proto.api.Facet.ValType} */ (reader.readEnum()) + msg.setValType(value) + break + case 4: + var value = /** @type {string} */ (reader.readString()) + msg.addTokens(value) + break + case 5: + var value = /** @type {string} */ (reader.readString()) + msg.setAlias(value) + break + default: + reader.skipField() + break } } - return msg; -}; - + return msg +} /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.Facet.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.api.Facet.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - +proto.api.Facet.prototype.serializeBinary = function () { + var writer = new jspb.BinaryWriter() + proto.api.Facet.serializeBinaryToWriter(this, writer) + return writer.getResultBuffer() +} /** * Serializes the given message to binary data (in protobuf wire @@ -4733,45 +4273,29 @@ proto.api.Facet.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.Facet.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getKey(); +proto.api.Facet.serializeBinaryToWriter = function (message, writer) { + var f = undefined + f = message.getKey() if (f.length > 0) { - writer.writeString( - 1, - f - ); + writer.writeString(1, f) } - f = message.getValue_asU8(); + f = message.getValue_asU8() if (f.length > 0) { - writer.writeBytes( - 2, - f - ); + writer.writeBytes(2, f) } - f = message.getValType(); + f = message.getValType() if (f !== 0.0) { - writer.writeEnum( - 3, - f - ); + writer.writeEnum(3, f) } - f = message.getTokensList(); + f = message.getTokensList() if (f.length > 0) { - writer.writeRepeatedString( - 4, - f - ); + writer.writeRepeatedString(4, f) } - f = message.getAlias(); + f = message.getAlias() if (f.length > 0) { - writer.writeString( - 5, - f - ); + writer.writeString(5, f) } -}; - +} /** * @enum {number} @@ -4781,46 +4305,41 @@ proto.api.Facet.ValType = { INT: 1, FLOAT: 2, BOOL: 3, - DATETIME: 4 -}; + DATETIME: 4, +} /** * optional string key = 1; * @return {string} */ -proto.api.Facet.prototype.getKey = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - +proto.api.Facet.prototype.getKey = function () { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")) +} /** * @param {string} value * @return {!proto.api.Facet} returns this */ -proto.api.Facet.prototype.setKey = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - +proto.api.Facet.prototype.setKey = function (value) { + return jspb.Message.setProto3StringField(this, 1, value) +} /** * optional bytes value = 2; * @return {!(string|Uint8Array)} */ -proto.api.Facet.prototype.getValue = function() { - return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - +proto.api.Facet.prototype.getValue = function () { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")) +} /** * optional bytes value = 2; * This is a type-conversion wrapper around `getValue()` * @return {string} */ -proto.api.Facet.prototype.getValue_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getValue())); -}; - +proto.api.Facet.prototype.getValue_asB64 = function () { + return /** @type {string} */ (jspb.Message.bytesAsB64(this.getValue())) +} /** * optional bytes value = 2; @@ -4829,151 +4348,135 @@ proto.api.Facet.prototype.getValue_asB64 = function() { * This is a type-conversion wrapper around `getValue()` * @return {!Uint8Array} */ -proto.api.Facet.prototype.getValue_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getValue())); -}; - +proto.api.Facet.prototype.getValue_asU8 = function () { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(this.getValue())) +} /** * @param {!(string|Uint8Array)} value * @return {!proto.api.Facet} returns this */ -proto.api.Facet.prototype.setValue = function(value) { - return jspb.Message.setProto3BytesField(this, 2, value); -}; - +proto.api.Facet.prototype.setValue = function (value) { + return jspb.Message.setProto3BytesField(this, 2, value) +} /** * optional ValType val_type = 3; * @return {!proto.api.Facet.ValType} */ -proto.api.Facet.prototype.getValType = function() { - return /** @type {!proto.api.Facet.ValType} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); -}; - +proto.api.Facet.prototype.getValType = function () { + return /** @type {!proto.api.Facet.ValType} */ (jspb.Message.getFieldWithDefault(this, 3, 0)) +} /** * @param {!proto.api.Facet.ValType} value * @return {!proto.api.Facet} returns this */ -proto.api.Facet.prototype.setValType = function(value) { - return jspb.Message.setProto3EnumField(this, 3, value); -}; - +proto.api.Facet.prototype.setValType = function (value) { + return jspb.Message.setProto3EnumField(this, 3, value) +} /** * repeated string tokens = 4; * @return {!Array} */ -proto.api.Facet.prototype.getTokensList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 4)); -}; - +proto.api.Facet.prototype.getTokensList = function () { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 4)) +} /** * @param {!Array} value * @return {!proto.api.Facet} returns this */ -proto.api.Facet.prototype.setTokensList = function(value) { - return jspb.Message.setField(this, 4, value || []); -}; - +proto.api.Facet.prototype.setTokensList = function (value) { + return jspb.Message.setField(this, 4, value || []) +} /** * @param {string} value * @param {number=} opt_index * @return {!proto.api.Facet} returns this */ -proto.api.Facet.prototype.addTokens = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 4, value, opt_index); -}; - +proto.api.Facet.prototype.addTokens = function (value, opt_index) { + return jspb.Message.addToRepeatedField(this, 4, value, opt_index) +} /** * Clears the list making it empty but non-null. * @return {!proto.api.Facet} returns this */ -proto.api.Facet.prototype.clearTokensList = function() { - return this.setTokensList([]); -}; - +proto.api.Facet.prototype.clearTokensList = function () { + return this.setTokensList([]) +} /** * optional string alias = 5; * @return {string} */ -proto.api.Facet.prototype.getAlias = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); -}; - +proto.api.Facet.prototype.getAlias = function () { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")) +} /** * @param {string} value * @return {!proto.api.Facet} returns this */ -proto.api.Facet.prototype.setAlias = function(value) { - return jspb.Message.setProto3StringField(this, 5, value); -}; - - - - +proto.api.Facet.prototype.setAlias = function (value) { + return jspb.Message.setProto3StringField(this, 5, value) +} if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.api.LoginRequest.prototype.toObject = function(opt_includeInstance) { - return proto.api.LoginRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.api.LoginRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.api.LoginRequest.toObject = function(includeInstance, msg) { - var f, obj = { - userid: jspb.Message.getFieldWithDefault(msg, 1, ""), - password: jspb.Message.getFieldWithDefault(msg, 2, ""), - refreshToken: jspb.Message.getFieldWithDefault(msg, 3, ""), - namespace: jspb.Message.getFieldWithDefault(msg, 4, 0) - }; + /** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ + proto.api.LoginRequest.prototype.toObject = function (opt_includeInstance) { + return proto.api.LoginRequest.toObject(opt_includeInstance, this) + } - if (includeInstance) { - obj.$jspbMessageInstance = msg; + /** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.LoginRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ + proto.api.LoginRequest.toObject = function (includeInstance, msg) { + var f, + obj = { + userid: jspb.Message.getFieldWithDefault(msg, 1, ""), + password: jspb.Message.getFieldWithDefault(msg, 2, ""), + refreshToken: jspb.Message.getFieldWithDefault(msg, 3, ""), + namespace: jspb.Message.getFieldWithDefault(msg, 4, 0), + } + + if (includeInstance) { + obj.$jspbMessageInstance = msg + } + return obj } - return obj; -}; } - /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.api.LoginRequest} */ -proto.api.LoginRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.LoginRequest; - return proto.api.LoginRequest.deserializeBinaryFromReader(msg, reader); -}; - +proto.api.LoginRequest.deserializeBinary = function (bytes) { + var reader = new jspb.BinaryReader(bytes) + var msg = new proto.api.LoginRequest() + return proto.api.LoginRequest.deserializeBinaryFromReader(msg, reader) +} /** * Deserializes binary data (in protobuf wire format) from the @@ -4982,48 +4485,46 @@ proto.api.LoginRequest.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.api.LoginRequest} */ -proto.api.LoginRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.api.LoginRequest.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { - break; + break } - var field = reader.getFieldNumber(); + var field = reader.getFieldNumber() switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setUserid(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setPassword(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setRefreshToken(value); - break; - case 4: - var value = /** @type {number} */ (reader.readUint64()); - msg.setNamespace(value); - break; - default: - reader.skipField(); - break; + case 1: + var value = /** @type {string} */ (reader.readString()) + msg.setUserid(value) + break + case 2: + var value = /** @type {string} */ (reader.readString()) + msg.setPassword(value) + break + case 3: + var value = /** @type {string} */ (reader.readString()) + msg.setRefreshToken(value) + break + case 4: + var value = /** @type {number} */ (reader.readUint64()) + msg.setNamespace(value) + break + default: + reader.skipField() + break } } - return msg; -}; - + return msg +} /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.LoginRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.api.LoginRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - +proto.api.LoginRequest.prototype.serializeBinary = function () { + var writer = new jspb.BinaryWriter() + proto.api.LoginRequest.serializeBinaryToWriter(this, writer) + return writer.getResultBuffer() +} /** * Serializes the given message to binary data (in protobuf wire @@ -5032,166 +4533,140 @@ proto.api.LoginRequest.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.LoginRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getUserid(); +proto.api.LoginRequest.serializeBinaryToWriter = function (message, writer) { + var f = undefined + f = message.getUserid() if (f.length > 0) { - writer.writeString( - 1, - f - ); + writer.writeString(1, f) } - f = message.getPassword(); + f = message.getPassword() if (f.length > 0) { - writer.writeString( - 2, - f - ); + writer.writeString(2, f) } - f = message.getRefreshToken(); + f = message.getRefreshToken() if (f.length > 0) { - writer.writeString( - 3, - f - ); + writer.writeString(3, f) } - f = message.getNamespace(); + f = message.getNamespace() if (f !== 0) { - writer.writeUint64( - 4, - f - ); + writer.writeUint64(4, f) } -}; - +} /** * optional string userid = 1; * @return {string} */ -proto.api.LoginRequest.prototype.getUserid = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - +proto.api.LoginRequest.prototype.getUserid = function () { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")) +} /** * @param {string} value * @return {!proto.api.LoginRequest} returns this */ -proto.api.LoginRequest.prototype.setUserid = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - +proto.api.LoginRequest.prototype.setUserid = function (value) { + return jspb.Message.setProto3StringField(this, 1, value) +} /** * optional string password = 2; * @return {string} */ -proto.api.LoginRequest.prototype.getPassword = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - +proto.api.LoginRequest.prototype.getPassword = function () { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")) +} /** * @param {string} value * @return {!proto.api.LoginRequest} returns this */ -proto.api.LoginRequest.prototype.setPassword = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - +proto.api.LoginRequest.prototype.setPassword = function (value) { + return jspb.Message.setProto3StringField(this, 2, value) +} /** * optional string refresh_token = 3; * @return {string} */ -proto.api.LoginRequest.prototype.getRefreshToken = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - +proto.api.LoginRequest.prototype.getRefreshToken = function () { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")) +} /** * @param {string} value * @return {!proto.api.LoginRequest} returns this */ -proto.api.LoginRequest.prototype.setRefreshToken = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - +proto.api.LoginRequest.prototype.setRefreshToken = function (value) { + return jspb.Message.setProto3StringField(this, 3, value) +} /** * optional uint64 namespace = 4; * @return {number} */ -proto.api.LoginRequest.prototype.getNamespace = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); -}; - +proto.api.LoginRequest.prototype.getNamespace = function () { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)) +} /** * @param {number} value * @return {!proto.api.LoginRequest} returns this */ -proto.api.LoginRequest.prototype.setNamespace = function(value) { - return jspb.Message.setProto3IntField(this, 4, value); -}; - - - - +proto.api.LoginRequest.prototype.setNamespace = function (value) { + return jspb.Message.setProto3IntField(this, 4, value) +} if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.api.Jwt.prototype.toObject = function(opt_includeInstance) { - return proto.api.Jwt.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.api.Jwt} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.api.Jwt.toObject = function(includeInstance, msg) { - var f, obj = { - accessJwt: jspb.Message.getFieldWithDefault(msg, 1, ""), - refreshJwt: jspb.Message.getFieldWithDefault(msg, 2, "") - }; + /** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ + proto.api.Jwt.prototype.toObject = function (opt_includeInstance) { + return proto.api.Jwt.toObject(opt_includeInstance, this) + } - if (includeInstance) { - obj.$jspbMessageInstance = msg; + /** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.api.Jwt} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ + proto.api.Jwt.toObject = function (includeInstance, msg) { + var f, + obj = { + accessJwt: jspb.Message.getFieldWithDefault(msg, 1, ""), + refreshJwt: jspb.Message.getFieldWithDefault(msg, 2, ""), + } + + if (includeInstance) { + obj.$jspbMessageInstance = msg + } + return obj } - return obj; -}; } - /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.api.Jwt} */ -proto.api.Jwt.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.api.Jwt; - return proto.api.Jwt.deserializeBinaryFromReader(msg, reader); -}; - +proto.api.Jwt.deserializeBinary = function (bytes) { + var reader = new jspb.BinaryReader(bytes) + var msg = new proto.api.Jwt() + return proto.api.Jwt.deserializeBinaryFromReader(msg, reader) +} /** * Deserializes binary data (in protobuf wire format) from the @@ -5200,40 +4675,38 @@ proto.api.Jwt.deserializeBinary = function(bytes) { * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.api.Jwt} */ -proto.api.Jwt.deserializeBinaryFromReader = function(msg, reader) { +proto.api.Jwt.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { - break; + break } - var field = reader.getFieldNumber(); + var field = reader.getFieldNumber() switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setAccessJwt(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setRefreshJwt(value); - break; - default: - reader.skipField(); - break; + case 1: + var value = /** @type {string} */ (reader.readString()) + msg.setAccessJwt(value) + break + case 2: + var value = /** @type {string} */ (reader.readString()) + msg.setRefreshJwt(value) + break + default: + reader.skipField() + break } } - return msg; -}; - + return msg +} /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.api.Jwt.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.api.Jwt.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - +proto.api.Jwt.prototype.serializeBinary = function () { + var writer = new jspb.BinaryWriter() + proto.api.Jwt.serializeBinaryToWriter(this, writer) + return writer.getResultBuffer() +} /** * Serializes the given message to binary data (in protobuf wire @@ -5242,59 +4715,48 @@ proto.api.Jwt.prototype.serializeBinary = function() { * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.api.Jwt.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getAccessJwt(); +proto.api.Jwt.serializeBinaryToWriter = function (message, writer) { + var f = undefined + f = message.getAccessJwt() if (f.length > 0) { - writer.writeString( - 1, - f - ); + writer.writeString(1, f) } - f = message.getRefreshJwt(); + f = message.getRefreshJwt() if (f.length > 0) { - writer.writeString( - 2, - f - ); + writer.writeString(2, f) } -}; - +} /** * optional string access_jwt = 1; * @return {string} */ -proto.api.Jwt.prototype.getAccessJwt = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - +proto.api.Jwt.prototype.getAccessJwt = function () { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")) +} /** * @param {string} value * @return {!proto.api.Jwt} returns this */ -proto.api.Jwt.prototype.setAccessJwt = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - +proto.api.Jwt.prototype.setAccessJwt = function (value) { + return jspb.Message.setProto3StringField(this, 1, value) +} /** * optional string refresh_jwt = 2; * @return {string} */ -proto.api.Jwt.prototype.getRefreshJwt = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - +proto.api.Jwt.prototype.getRefreshJwt = function () { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")) +} /** * @param {string} value * @return {!proto.api.Jwt} returns this */ -proto.api.Jwt.prototype.setRefreshJwt = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - +proto.api.Jwt.prototype.setRefreshJwt = function (value) { + return jspb.Message.setProto3StringField(this, 2, value) +} -goog.object.extend(exports, proto.api); +goog.object.extend(exports, proto.api) diff --git a/generated/api_pb_service.d.ts b/generated/api_pb_service.d.ts index 397dd65..308bc72 100644 --- a/generated/api_pb_service.d.ts +++ b/generated/api_pb_service.d.ts @@ -1,139 +1,142 @@ // package: api // file: api.proto -import * as api_pb from "./api_pb"; -import {grpc} from "@improbable-eng/grpc-web"; +import * as api_pb from "./api_pb" +import { grpc } from "@improbable-eng/grpc-web" type DgraphLogin = { - readonly methodName: string; - readonly service: typeof Dgraph; - readonly requestStream: false; - readonly responseStream: false; - readonly requestType: typeof api_pb.LoginRequest; - readonly responseType: typeof api_pb.Response; -}; + readonly methodName: string + readonly service: typeof Dgraph + readonly requestStream: false + readonly responseStream: false + readonly requestType: typeof api_pb.LoginRequest + readonly responseType: typeof api_pb.Response +} type DgraphQuery = { - readonly methodName: string; - readonly service: typeof Dgraph; - readonly requestStream: false; - readonly responseStream: false; - readonly requestType: typeof api_pb.Request; - readonly responseType: typeof api_pb.Response; -}; + readonly methodName: string + readonly service: typeof Dgraph + readonly requestStream: false + readonly responseStream: false + readonly requestType: typeof api_pb.Request + readonly responseType: typeof api_pb.Response +} type DgraphAlter = { - readonly methodName: string; - readonly service: typeof Dgraph; - readonly requestStream: false; - readonly responseStream: false; - readonly requestType: typeof api_pb.Operation; - readonly responseType: typeof api_pb.Payload; -}; + readonly methodName: string + readonly service: typeof Dgraph + readonly requestStream: false + readonly responseStream: false + readonly requestType: typeof api_pb.Operation + readonly responseType: typeof api_pb.Payload +} type DgraphCommitOrAbort = { - readonly methodName: string; - readonly service: typeof Dgraph; - readonly requestStream: false; - readonly responseStream: false; - readonly requestType: typeof api_pb.TxnContext; - readonly responseType: typeof api_pb.TxnContext; -}; + readonly methodName: string + readonly service: typeof Dgraph + readonly requestStream: false + readonly responseStream: false + readonly requestType: typeof api_pb.TxnContext + readonly responseType: typeof api_pb.TxnContext +} type DgraphCheckVersion = { - readonly methodName: string; - readonly service: typeof Dgraph; - readonly requestStream: false; - readonly responseStream: false; - readonly requestType: typeof api_pb.Check; - readonly responseType: typeof api_pb.Version; -}; + readonly methodName: string + readonly service: typeof Dgraph + readonly requestStream: false + readonly responseStream: false + readonly requestType: typeof api_pb.Check + readonly responseType: typeof api_pb.Version +} -export class Dgraph { - static readonly serviceName: string; - static readonly Login: DgraphLogin; - static readonly Query: DgraphQuery; - static readonly Alter: DgraphAlter; - static readonly CommitOrAbort: DgraphCommitOrAbort; - static readonly CheckVersion: DgraphCheckVersion; +export namespace Dgraph { + export const serviceName: string + export const Login: DgraphLogin + export const Query: DgraphQuery + export const Alter: DgraphAlter + export const CommitOrAbort: DgraphCommitOrAbort + export const CheckVersion: DgraphCheckVersion } -export type ServiceError = { message: string, code: number; metadata: grpc.Metadata } -export type Status = { details: string, code: number; metadata: grpc.Metadata } +export type ServiceError = { + message: string + code: number + metadata: grpc.Metadata +} +export type Status = { details: string; code: number; metadata: grpc.Metadata } interface UnaryResponse { - cancel(): void; + cancel(): void } interface ResponseStream { - cancel(): void; - on(type: 'data', handler: (message: T) => void): ResponseStream; - on(type: 'end', handler: (status?: Status) => void): ResponseStream; - on(type: 'status', handler: (status: Status) => void): ResponseStream; + cancel(): void + on(type: "data", handler: (message: T) => void): ResponseStream + on(type: "end", handler: (status?: Status) => void): ResponseStream + on(type: "status", handler: (status: Status) => void): ResponseStream } interface RequestStream { - write(message: T): RequestStream; - end(): void; - cancel(): void; - on(type: 'end', handler: (status?: Status) => void): RequestStream; - on(type: 'status', handler: (status: Status) => void): RequestStream; + write(message: T): RequestStream + end(): void + cancel(): void + on(type: "end", handler: (status?: Status) => void): RequestStream + on(type: "status", handler: (status: Status) => void): RequestStream } interface BidirectionalStream { - write(message: ReqT): BidirectionalStream; - end(): void; - cancel(): void; - on(type: 'data', handler: (message: ResT) => void): BidirectionalStream; - on(type: 'end', handler: (status?: Status) => void): BidirectionalStream; - on(type: 'status', handler: (status: Status) => void): BidirectionalStream; + write(message: ReqT): BidirectionalStream + end(): void + cancel(): void + on(type: "data", handler: (message: ResT) => void): BidirectionalStream + on(type: "end", handler: (status?: Status) => void): BidirectionalStream + on(type: "status", handler: (status: Status) => void): BidirectionalStream } export class DgraphClient { - readonly serviceHost: string; + readonly serviceHost: string - constructor(serviceHost: string, options?: grpc.RpcOptions); + constructor(serviceHost: string, options?: grpc.RpcOptions) login( requestMessage: api_pb.LoginRequest, metadata: grpc.Metadata, - callback: (error: ServiceError|null, responseMessage: api_pb.Response|null) => void - ): UnaryResponse; + callback: (error: ServiceError | null, responseMessage: api_pb.Response | null) => void, + ): UnaryResponse login( requestMessage: api_pb.LoginRequest, - callback: (error: ServiceError|null, responseMessage: api_pb.Response|null) => void - ): UnaryResponse; + callback: (error: ServiceError | null, responseMessage: api_pb.Response | null) => void, + ): UnaryResponse query( requestMessage: api_pb.Request, metadata: grpc.Metadata, - callback: (error: ServiceError|null, responseMessage: api_pb.Response|null) => void - ): UnaryResponse; + callback: (error: ServiceError | null, responseMessage: api_pb.Response | null) => void, + ): UnaryResponse query( requestMessage: api_pb.Request, - callback: (error: ServiceError|null, responseMessage: api_pb.Response|null) => void - ): UnaryResponse; + callback: (error: ServiceError | null, responseMessage: api_pb.Response | null) => void, + ): UnaryResponse alter( requestMessage: api_pb.Operation, metadata: grpc.Metadata, - callback: (error: ServiceError|null, responseMessage: api_pb.Payload|null) => void - ): UnaryResponse; + callback: (error: ServiceError | null, responseMessage: api_pb.Payload | null) => void, + ): UnaryResponse alter( requestMessage: api_pb.Operation, - callback: (error: ServiceError|null, responseMessage: api_pb.Payload|null) => void - ): UnaryResponse; + callback: (error: ServiceError | null, responseMessage: api_pb.Payload | null) => void, + ): UnaryResponse commitOrAbort( requestMessage: api_pb.TxnContext, metadata: grpc.Metadata, - callback: (error: ServiceError|null, responseMessage: api_pb.TxnContext|null) => void - ): UnaryResponse; + callback: (error: ServiceError | null, responseMessage: api_pb.TxnContext | null) => void, + ): UnaryResponse commitOrAbort( requestMessage: api_pb.TxnContext, - callback: (error: ServiceError|null, responseMessage: api_pb.TxnContext|null) => void - ): UnaryResponse; + callback: (error: ServiceError | null, responseMessage: api_pb.TxnContext | null) => void, + ): UnaryResponse checkVersion( requestMessage: api_pb.Check, metadata: grpc.Metadata, - callback: (error: ServiceError|null, responseMessage: api_pb.Version|null) => void - ): UnaryResponse; + callback: (error: ServiceError | null, responseMessage: api_pb.Version | null) => void, + ): UnaryResponse checkVersion( requestMessage: api_pb.Check, - callback: (error: ServiceError|null, responseMessage: api_pb.Version|null) => void - ): UnaryResponse; + callback: (error: ServiceError | null, responseMessage: api_pb.Version | null) => void, + ): UnaryResponse } - diff --git a/generated/api_pb_service.js b/generated/api_pb_service.js index 4654def..792d840 100644 --- a/generated/api_pb_service.js +++ b/generated/api_pb_service.js @@ -1,14 +1,14 @@ // package: api // file: api.proto -var api_pb = require("./api_pb"); -var grpc = require("@improbable-eng/grpc-web").grpc; +var api_pb = require("./api_pb") +var grpc = require("@improbable-eng/grpc-web").grpc var Dgraph = (function () { function Dgraph() {} - Dgraph.serviceName = "api.Dgraph"; - return Dgraph; -}()); + Dgraph.serviceName = "api.Dgraph" + return Dgraph +})() Dgraph.Login = { methodName: "Login", @@ -16,8 +16,8 @@ Dgraph.Login = { requestStream: false, responseStream: false, requestType: api_pb.LoginRequest, - responseType: api_pb.Response -}; + responseType: api_pb.Response, +} Dgraph.Query = { methodName: "Query", @@ -25,8 +25,8 @@ Dgraph.Query = { requestStream: false, responseStream: false, requestType: api_pb.Request, - responseType: api_pb.Response -}; + responseType: api_pb.Response, +} Dgraph.Alter = { methodName: "Alter", @@ -34,8 +34,8 @@ Dgraph.Alter = { requestStream: false, responseStream: false, requestType: api_pb.Operation, - responseType: api_pb.Payload -}; + responseType: api_pb.Payload, +} Dgraph.CommitOrAbort = { methodName: "CommitOrAbort", @@ -43,8 +43,8 @@ Dgraph.CommitOrAbort = { requestStream: false, responseStream: false, requestType: api_pb.TxnContext, - responseType: api_pb.TxnContext -}; + responseType: api_pb.TxnContext, +} Dgraph.CheckVersion = { methodName: "CheckVersion", @@ -52,19 +52,19 @@ Dgraph.CheckVersion = { requestStream: false, responseStream: false, requestType: api_pb.Check, - responseType: api_pb.Version -}; + responseType: api_pb.Version, +} -exports.Dgraph = Dgraph; +exports.Dgraph = Dgraph function DgraphClient(serviceHost, options) { - this.serviceHost = serviceHost; - this.options = options || {}; + this.serviceHost = serviceHost + this.options = options || {} } DgraphClient.prototype.login = function login(requestMessage, metadata, callback) { if (arguments.length === 2) { - callback = arguments[1]; + callback = arguments[1] } var client = grpc.unary(Dgraph.Login, { request: requestMessage, @@ -75,27 +75,27 @@ DgraphClient.prototype.login = function login(requestMessage, metadata, callback onEnd: function (response) { if (callback) { if (response.status !== grpc.Code.OK) { - var err = new Error(response.statusMessage); - err.code = response.status; - err.metadata = response.trailers; - callback(err, null); + var err = new Error(response.statusMessage) + err.code = response.status + err.metadata = response.trailers + callback(err, null) } else { - callback(null, response.message); + callback(null, response.message) } } - } - }); + }, + }) return { cancel: function () { - callback = null; - client.close(); - } - }; -}; + callback = null + client.close() + }, + } +} DgraphClient.prototype.query = function query(requestMessage, metadata, callback) { if (arguments.length === 2) { - callback = arguments[1]; + callback = arguments[1] } var client = grpc.unary(Dgraph.Query, { request: requestMessage, @@ -106,27 +106,27 @@ DgraphClient.prototype.query = function query(requestMessage, metadata, callback onEnd: function (response) { if (callback) { if (response.status !== grpc.Code.OK) { - var err = new Error(response.statusMessage); - err.code = response.status; - err.metadata = response.trailers; - callback(err, null); + var err = new Error(response.statusMessage) + err.code = response.status + err.metadata = response.trailers + callback(err, null) } else { - callback(null, response.message); + callback(null, response.message) } } - } - }); + }, + }) return { cancel: function () { - callback = null; - client.close(); - } - }; -}; + callback = null + client.close() + }, + } +} DgraphClient.prototype.alter = function alter(requestMessage, metadata, callback) { if (arguments.length === 2) { - callback = arguments[1]; + callback = arguments[1] } var client = grpc.unary(Dgraph.Alter, { request: requestMessage, @@ -137,27 +137,27 @@ DgraphClient.prototype.alter = function alter(requestMessage, metadata, callback onEnd: function (response) { if (callback) { if (response.status !== grpc.Code.OK) { - var err = new Error(response.statusMessage); - err.code = response.status; - err.metadata = response.trailers; - callback(err, null); + var err = new Error(response.statusMessage) + err.code = response.status + err.metadata = response.trailers + callback(err, null) } else { - callback(null, response.message); + callback(null, response.message) } } - } - }); + }, + }) return { cancel: function () { - callback = null; - client.close(); - } - }; -}; + callback = null + client.close() + }, + } +} DgraphClient.prototype.commitOrAbort = function commitOrAbort(requestMessage, metadata, callback) { if (arguments.length === 2) { - callback = arguments[1]; + callback = arguments[1] } var client = grpc.unary(Dgraph.CommitOrAbort, { request: requestMessage, @@ -168,27 +168,27 @@ DgraphClient.prototype.commitOrAbort = function commitOrAbort(requestMessage, me onEnd: function (response) { if (callback) { if (response.status !== grpc.Code.OK) { - var err = new Error(response.statusMessage); - err.code = response.status; - err.metadata = response.trailers; - callback(err, null); + var err = new Error(response.statusMessage) + err.code = response.status + err.metadata = response.trailers + callback(err, null) } else { - callback(null, response.message); + callback(null, response.message) } } - } - }); + }, + }) return { cancel: function () { - callback = null; - client.close(); - } - }; -}; + callback = null + client.close() + }, + } +} DgraphClient.prototype.checkVersion = function checkVersion(requestMessage, metadata, callback) { if (arguments.length === 2) { - callback = arguments[1]; + callback = arguments[1] } var client = grpc.unary(Dgraph.CheckVersion, { request: requestMessage, @@ -199,23 +199,22 @@ DgraphClient.prototype.checkVersion = function checkVersion(requestMessage, meta onEnd: function (response) { if (callback) { if (response.status !== grpc.Code.OK) { - var err = new Error(response.statusMessage); - err.code = response.status; - err.metadata = response.trailers; - callback(err, null); + var err = new Error(response.statusMessage) + err.code = response.status + err.metadata = response.trailers + callback(err, null) } else { - callback(null, response.message); + callback(null, response.message) } } - } - }); + }, + }) return { cancel: function () { - callback = null; - client.close(); - } - }; -}; - -exports.DgraphClient = DgraphClient; + callback = null + client.close() + }, + } +} +exports.DgraphClient = DgraphClient diff --git a/jest.config.js b/jest.config.js deleted file mode 100644 index 70db699..0000000 --- a/jest.config.js +++ /dev/null @@ -1,21 +0,0 @@ -module.exports = { - testEnvironment: "node", - testResultsProcessor: "jest-teamcity", - transform: { - ".(ts|tsx)": "ts-jest" - }, - moduleFileExtensions: [ - "ts", - "tsx", - "js", - "jsx", - ], - testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.(ts|js)x?$", - coverageDirectory: "coverage", - collectCoverageFrom: [ - "src/**/*.{ts,tsx,js,jsx}", - "!src/index.{ts,tsx,js,jsx}", - "!src/generated/**/*.{ts,tsx,js,jsx}", - "!src/**/*.d.ts", - ], -}; diff --git a/jest.config.ts b/jest.config.ts new file mode 100644 index 0000000..2b56501 --- /dev/null +++ b/jest.config.ts @@ -0,0 +1,15 @@ +module.exports = { + testEnvironment: "node", + transform: { + ".(ts|tsx)": "ts-jest", + }, + moduleFileExtensions: ["ts", "tsx", "js", "jsx"], + testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.(ts|js)x?$", + coverageDirectory: "coverage", + collectCoverageFrom: [ + "src/**/*.{ts,tsx,js,jsx}", + "!src/index.{ts,tsx,js,jsx}", + "!src/generated/**/*.{ts,tsx,js,jsx}", + "!src/**/*.d.ts", + ], +} diff --git a/lib/client.d.ts b/lib/client.d.ts index 4baf1a4..b35b994 100644 --- a/lib/client.d.ts +++ b/lib/client.d.ts @@ -1,17 +1,21 @@ -import * as grpc from "@grpc/grpc-js"; -import * as messages from "../generated/api_pb"; -import { DgraphClientStub } from "./clientStub"; -import { Txn, TxnOptions } from "./txn"; -import * as types from "./types"; +import * as grpc from "@grpc/grpc-js" +import * as messages from "../generated/api_pb" +import { DgraphClientStub } from "./clientStub" +import { Txn, TxnOptions } from "./txn" +import * as types from "./types" export declare class DgraphClient { - private readonly clients; - private debugMode; - constructor(...clients: DgraphClientStub[]); - alter(op: messages.Operation, metadata?: grpc.Metadata | null, options?: grpc.CallOptions | null): Promise; - newTxn(txnOpts?: TxnOptions): Txn; - setDebugMode(mode?: boolean): void; - debug(msg: string): void; - anyClient(): DgraphClientStub; + private readonly clients + private debugMode + constructor(...clients: DgraphClientStub[]) + alter( + op: messages.Operation, + metadata?: grpc.Metadata | null, + options?: grpc.CallOptions | null, + ): Promise + newTxn(txnOpts?: TxnOptions): Txn + setDebugMode(mode?: boolean): void + debug(msg: string): void + anyClient(): DgraphClientStub } -export declare function isJwtExpired(err: any): Boolean; -export declare function deleteEdges(mu: types.Mutation, uid: string, ...predicates: string[]): void; +export declare function isJwtExpired(err: any): boolean +export declare function deleteEdges(mu: types.Mutation, uid: string, ...predicates: string[]): void diff --git a/lib/client.js b/lib/client.js index f4c85d2..28e314d 100644 --- a/lib/client.js +++ b/lib/client.js @@ -1,137 +1,242 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } +"use strict" +var __awaiter = + (this && this.__awaiter) || + function (thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P + ? value + : new P(function (resolve) { + resolve(value) + }) + } return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } + function fulfilled(value) { + try { + step(generator.next(value)) + } catch (e) { + reject(e) + } + } + function rejected(value) { + try { + step(generator["throw"](value)) + } catch (e) { + reject(e) + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected) + } + step((generator = generator.apply(thisArg, _arguments || [])).next()) + }) + } +var __generator = + (this && this.__generator) || + function (thisArg, body) { + var _ = { + label: 0, + sent: function () { + if (t[0] & 1) throw t[1] + return t[1] + }, + trys: [], + ops: [], + }, + f, + y, + t, + g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype) + return ( + (g.next = verb(0)), + (g["throw"] = verb(1)), + (g["return"] = verb(2)), + typeof Symbol === "function" && + (g[Symbol.iterator] = function () { + return this + }), + g + ) + function verb(n) { + return function (v) { + return step([n, v]) + } + } function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + if (f) throw new TypeError("Generator is already executing.") + while ((g && ((g = 0), op[0] && (_ = 0)), _)) + try { + if ( + ((f = 1), + y && + (t = + op[0] & 2 + ? y["return"] + : op[0] + ? y["throw"] || ((t = y["return"]) && t.call(y), 0) + : y.next) && + !(t = t.call(y, op[1])).done) + ) + return t + if (((y = 0), t)) op = [op[0] & 2, t.value] + switch (op[0]) { + case 0: + case 1: + t = op + break + case 4: + _.label++ + return { value: op[1], done: false } + case 5: + _.label++ + y = op[1] + op = [0] + continue + case 7: + op = _.ops.pop() + _.trys.pop() + continue + default: + if ( + !((t = _.trys), (t = t.length > 0 && t[t.length - 1])) && + (op[0] === 6 || op[0] === 2) + ) { + _ = 0 + continue + } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { + _.label = op[1] + break + } + if (op[0] === 6 && _.label < t[1]) { + _.label = t[1] + t = op + break + } + if (t && _.label < t[2]) { + _.label = t[2] + _.ops.push(op) + break + } + if (t[2]) _.ops.pop() + _.trys.pop() + continue + } + op = body.call(thisArg, _) + } catch (e) { + op = [6, e] + y = 0 + } finally { + f = t = 0 + } + if (op[0] & 5) throw op[1] + return { value: op[0] ? op[1] : void 0, done: true } } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.DgraphClient = void 0; -exports.isJwtExpired = isJwtExpired; -exports.deleteEdges = deleteEdges; -var messages = require("../generated/api_pb"); -var errors_1 = require("./errors"); -var txn_1 = require("./txn"); -var types = require("./types"); -var util_1 = require("./util"); + } +Object.defineProperty(exports, "__esModule", { value: true }) +exports.DgraphClient = void 0 +exports.isJwtExpired = isJwtExpired +exports.deleteEdges = deleteEdges +var messages = require("../generated/api_pb") +var errors_1 = require("./errors") +var txn_1 = require("./txn") +var types = require("./types") +var util_1 = require("./util") var DgraphClient = (function () { - function DgraphClient() { - var clients = []; - for (var _i = 0; _i < arguments.length; _i++) { - clients[_i] = arguments[_i]; - } - this.debugMode = false; - if (clients.length === 0) { - throw errors_1.ERR_NO_CLIENTS; - } - this.clients = clients; + function DgraphClient() { + var clients = [] + for (var _i = 0; _i < arguments.length; _i++) { + clients[_i] = arguments[_i] } - DgraphClient.prototype.alter = function (op, metadata, options) { - return __awaiter(this, void 0, void 0, function () { - var c, payload, operation, e_1, pl; - var _this = this; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - this.debug("Alter request:\n".concat((0, util_1.stringifyMessage)(op))); - c = this.anyClient(); - operation = function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - return [2, c.alter(op, metadata, options)]; - }); }); }; - _a.label = 1; - case 1: - _a.trys.push([1, 3, , 8]); - return [4, operation()]; - case 2: - payload = _a.sent(); - return [3, 8]; - case 3: - e_1 = _a.sent(); - if (!(isJwtExpired(e_1) === true)) return [3, 6]; - return [4, c.retryLogin(metadata, options)]; - case 4: - _a.sent(); - return [4, operation()]; - case 5: - payload = _a.sent(); - return [3, 7]; - case 6: throw e_1; - case 7: return [3, 8]; - case 8: - pl = types.createPayload(payload); - this.debug("Alter response:\n".concat((0, util_1.stringifyMessage)(pl))); - return [2, pl]; - } - }); - }); - }; - DgraphClient.prototype.newTxn = function (txnOpts) { - return new txn_1.Txn(this, txnOpts); - }; - DgraphClient.prototype.setDebugMode = function (mode) { - if (mode === void 0) { mode = true; } - this.debugMode = mode; - }; - DgraphClient.prototype.debug = function (msg) { - if (this.debugMode) { - console.log(msg); + this.debugMode = false + if (clients.length === 0) { + throw errors_1.ERR_NO_CLIENTS + } + this.clients = clients + } + DgraphClient.prototype.alter = function (op, metadata, options) { + return __awaiter(this, void 0, void 0, function () { + var c, payload, operation, e_1, pl + var _this = this + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + this.debug("Alter request:\n".concat((0, util_1.stringifyMessage)(op))) + c = this.anyClient() + operation = function () { + return __awaiter(_this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2, c.alter(op, metadata, options)] + }) + }) + } + _a.label = 1 + case 1: + _a.trys.push([1, 3, , 8]) + return [4, operation()] + case 2: + payload = _a.sent() + return [3, 8] + case 3: + e_1 = _a.sent() + if (!(isJwtExpired(e_1) === true)) return [3, 6] + return [4, c.retryLogin(metadata, options)] + case 4: + _a.sent() + return [4, operation()] + case 5: + payload = _a.sent() + return [3, 7] + case 6: + throw e_1 + case 7: + return [3, 8] + case 8: + pl = types.createPayload(payload) + this.debug("Alter response:\n".concat((0, util_1.stringifyMessage)(pl))) + return [2, pl] } - }; - DgraphClient.prototype.anyClient = function () { - return this.clients[Math.floor(Math.random() * this.clients.length)]; - }; - return DgraphClient; -}()); -exports.DgraphClient = DgraphClient; -function isJwtExpired(err) { - if (!err) { - return false; + }) + }) + } + DgraphClient.prototype.newTxn = function (txnOpts) { + return new txn_1.Txn(this, txnOpts) + } + DgraphClient.prototype.setDebugMode = function (mode) { + if (mode === void 0) { + mode = true + } + this.debugMode = mode + } + DgraphClient.prototype.debug = function (msg) { + if (this.debugMode) { + console.log(msg) } - return (0, util_1.isUnauthenticatedError)(err); + } + DgraphClient.prototype.anyClient = function () { + return this.clients[Math.floor(Math.random() * this.clients.length)] + } + return DgraphClient +})() +exports.DgraphClient = DgraphClient +function isJwtExpired(err) { + if (!err) { + return false + } + return (0, util_1.isUnauthenticatedError)(err) } function deleteEdges(mu, uid) { - var predicates = []; - for (var _i = 2; _i < arguments.length; _i++) { - predicates[_i - 2] = arguments[_i]; - } - for (var _a = 0, predicates_1 = predicates; _a < predicates_1.length; _a++) { - var predicate = predicates_1[_a]; - var nquad = new messages.NQuad(); - nquad.setSubject(uid); - nquad.setPredicate(predicate); - var ov = new messages.Value(); - ov.setDefaultVal("_STAR_ALL"); - nquad.setObjectValue(ov); - mu.addDel(nquad); - } + var predicates = [] + for (var _i = 2; _i < arguments.length; _i++) { + predicates[_i - 2] = arguments[_i] + } + for (var _a = 0, predicates_1 = predicates; _a < predicates_1.length; _a++) { + var predicate = predicates_1[_a] + var nquad = new messages.NQuad() + nquad.setSubject(uid) + nquad.setPredicate(predicate) + var ov = new messages.Value() + ov.setDefaultVal("_STAR_ALL") + nquad.setObjectValue(ov) + mu.addDel(nquad) + } } diff --git a/lib/clientStub.d.ts b/lib/clientStub.d.ts index 6373355..e1beb03 100644 --- a/lib/clientStub.d.ts +++ b/lib/clientStub.d.ts @@ -1,21 +1,54 @@ -import * as grpc from "@grpc/grpc-js"; -import * as messages from "../generated/api_pb"; +import * as grpc from "@grpc/grpc-js" +import * as messages from "../generated/api_pb" export declare class DgraphClientStub { - private readonly stub; - private accessJwt; - private refreshJwt; - private readonly promisified; - constructor(addr?: string, credentials?: grpc.ChannelCredentials, options?: object); - login(userid?: string, password?: string, refreshJwt?: string, metadata?: grpc.Metadata, options?: grpc.CallOptions): Promise; - loginIntoNamespace(userid?: string, password?: string, namespace?: number, refreshJwt?: string, metadata?: grpc.Metadata, options?: grpc.CallOptions): Promise; - alter(op: messages.Operation, metadata?: grpc.Metadata, options?: grpc.CallOptions): Promise; - retryLogin(metadata?: grpc.Metadata, options?: grpc.CallOptions): Promise; - query(req: messages.Request, metadata?: grpc.Metadata, options?: grpc.CallOptions): Promise; - mutate(mu: messages.Mutation, metadata?: grpc.Metadata, options?: grpc.CallOptions): Promise; - commitOrAbort(ctx: messages.TxnContext, metadata?: grpc.Metadata, options?: grpc.CallOptions): Promise; - checkVersion(check: messages.Check, metadata?: grpc.Metadata, options?: grpc.CallOptions): Promise; - waitForReady(deadline: grpc.Deadline): Promise; - close(): void; - grpcClient(): grpc.Client; - private ensureMetadata; + private readonly stub + private accessJwt + private refreshJwt + private readonly promisified + constructor(addr?: string, credentials?: grpc.ChannelCredentials, options?: object) + login( + userid?: string, + password?: string, + refreshJwt?: string, + metadata?: grpc.Metadata, + options?: grpc.CallOptions, + ): Promise + loginIntoNamespace( + userid?: string, + password?: string, + namespace?: number, + refreshJwt?: string, + metadata?: grpc.Metadata, + options?: grpc.CallOptions, + ): Promise + alter( + op: messages.Operation, + metadata?: grpc.Metadata, + options?: grpc.CallOptions, + ): Promise + retryLogin(metadata?: grpc.Metadata, options?: grpc.CallOptions): Promise + query( + req: messages.Request, + metadata?: grpc.Metadata, + options?: grpc.CallOptions, + ): Promise + mutate( + mu: messages.Mutation, + metadata?: grpc.Metadata, + options?: grpc.CallOptions, + ): Promise + commitOrAbort( + ctx: messages.TxnContext, + metadata?: grpc.Metadata, + options?: grpc.CallOptions, + ): Promise + checkVersion( + check: messages.Check, + metadata?: grpc.Metadata, + options?: grpc.CallOptions, + ): Promise + waitForReady(deadline: grpc.Deadline): Promise + close(): void + grpcClient(): grpc.Client + private ensureMetadata } diff --git a/lib/clientStub.js b/lib/clientStub.js index 2e65f0b..d9ac5ea 100644 --- a/lib/clientStub.js +++ b/lib/clientStub.js @@ -1,165 +1,289 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } +"use strict" +var __awaiter = + (this && this.__awaiter) || + function (thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P + ? value + : new P(function (resolve) { + resolve(value) + }) + } return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } + function fulfilled(value) { + try { + step(generator.next(value)) + } catch (e) { + reject(e) + } + } + function rejected(value) { + try { + step(generator["throw"](value)) + } catch (e) { + reject(e) + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected) + } + step((generator = generator.apply(thisArg, _arguments || [])).next()) + }) + } +var __generator = + (this && this.__generator) || + function (thisArg, body) { + var _ = { + label: 0, + sent: function () { + if (t[0] & 1) throw t[1] + return t[1] + }, + trys: [], + ops: [], + }, + f, + y, + t, + g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype) + return ( + (g.next = verb(0)), + (g["throw"] = verb(1)), + (g["return"] = verb(2)), + typeof Symbol === "function" && + (g[Symbol.iterator] = function () { + return this + }), + g + ) + function verb(n) { + return function (v) { + return step([n, v]) + } + } function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + if (f) throw new TypeError("Generator is already executing.") + while ((g && ((g = 0), op[0] && (_ = 0)), _)) + try { + if ( + ((f = 1), + y && + (t = + op[0] & 2 + ? y["return"] + : op[0] + ? y["throw"] || ((t = y["return"]) && t.call(y), 0) + : y.next) && + !(t = t.call(y, op[1])).done) + ) + return t + if (((y = 0), t)) op = [op[0] & 2, t.value] + switch (op[0]) { + case 0: + case 1: + t = op + break + case 4: + _.label++ + return { value: op[1], done: false } + case 5: + _.label++ + y = op[1] + op = [0] + continue + case 7: + op = _.ops.pop() + _.trys.pop() + continue + default: + if ( + !((t = _.trys), (t = t.length > 0 && t[t.length - 1])) && + (op[0] === 6 || op[0] === 2) + ) { + _ = 0 + continue + } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { + _.label = op[1] + break + } + if (op[0] === 6 && _.label < t[1]) { + _.label = t[1] + t = op + break + } + if (t && _.label < t[2]) { + _.label = t[2] + _.ops.push(op) + break + } + if (t[2]) _.ops.pop() + _.trys.pop() + continue + } + op = body.call(thisArg, _) + } catch (e) { + op = [6, e] + y = 0 + } finally { + f = t = 0 + } + if (op[0] & 5) throw op[1] + return { value: op[0] ? op[1] : void 0, done: true } } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.DgraphClientStub = void 0; -var grpc = require("@grpc/grpc-js"); -var services = require("../generated/api_grpc_pb"); -var messages = require("../generated/api_pb"); -var errors_1 = require("./errors"); -var util_1 = require("./util"); + } +Object.defineProperty(exports, "__esModule", { value: true }) +exports.DgraphClientStub = void 0 +var grpc = require("@grpc/grpc-js") +var services = require("../generated/api_grpc_pb") +var messages = require("../generated/api_pb") +var errors_1 = require("./errors") +var util_1 = require("./util") var DgraphClientStub = (function () { - function DgraphClientStub(addr, credentials, options) { - this.accessJwt = ""; - this.refreshJwt = ""; - if (addr === undefined) { - addr = "localhost:9080"; + function DgraphClientStub(addr, credentials, options) { + this.accessJwt = "" + this.refreshJwt = "" + if (addr === undefined) { + addr = "localhost:9080" + } + if (credentials === undefined) { + credentials = grpc.credentials.createInsecure() + } + this.stub = new services.DgraphClient(addr, credentials, options) + this.promisified = { + login: (0, util_1.promisify3)(this.stub.login, this.stub), + alter: (0, util_1.promisify3)(this.stub.alter, this.stub), + query: (0, util_1.promisify3)(this.stub.query, this.stub), + mutate: (0, util_1.promisify3)(this.stub.mutate, this.stub), + commitOrAbort: (0, util_1.promisify3)(this.stub.commitOrAbort, this.stub), + checkVersion: (0, util_1.promisify3)(this.stub.checkVersion, this.stub), + waitForReady: (0, util_1.promisify1)(this.stub.waitForReady, this.stub), + } + } + DgraphClientStub.prototype.login = function (userid, password, refreshJwt, metadata, options) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2, this.loginIntoNamespace(userid, password, 0, refreshJwt, metadata, options)] + }) + }) + } + DgraphClientStub.prototype.loginIntoNamespace = function ( + userid, + password, + namespace, + refreshJwt, + metadata, + options, + ) { + return __awaiter(this, void 0, void 0, function () { + var req, resp, jwtResponse + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + req = new messages.LoginRequest() + if (userid !== undefined) { + req.setUserid(userid) + req.setPassword(password) + req.setNamespace(namespace) + } else if (refreshJwt !== undefined) { + req.setRefreshToken(refreshJwt) + } else { + req.setRefreshToken(this.refreshJwt) + } + return [ + 4, + this.promisified.login( + req, + this.ensureMetadata(metadata), + ensureCallOptions(options), + ), + ] + case 1: + resp = _a.sent() + jwtResponse = messages.Jwt.deserializeBinary(resp.getJson_asU8()) + this.accessJwt = jwtResponse.getAccessJwt() + this.refreshJwt = jwtResponse.getRefreshJwt() + return [2, jwtResponse] } - if (credentials === undefined) { - credentials = grpc.credentials.createInsecure(); + }) + }) + } + DgraphClientStub.prototype.alter = function (op, metadata, options) { + return this.promisified.alter(op, this.ensureMetadata(metadata), ensureCallOptions(options)) + } + DgraphClientStub.prototype.retryLogin = function (metadata, options) { + return __awaiter(this, void 0, void 0, function () { + var req, resp, jwtResponse + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (this.refreshJwt.length === 0) { + throw errors_1.ERR_REFRESH_JWT_EMPTY + } + req = new messages.LoginRequest() + req.setRefreshToken(this.refreshJwt) + return [ + 4, + this.promisified.login( + req, + this.ensureMetadata(metadata), + ensureCallOptions(options), + ), + ] + case 1: + resp = _a.sent() + jwtResponse = messages.Jwt.deserializeBinary(resp.getJson_asU8()) + this.accessJwt = jwtResponse.getAccessJwt() + this.refreshJwt = jwtResponse.getRefreshJwt() + return [2, jwtResponse] } - this.stub = new services.DgraphClient(addr, credentials, options); - this.promisified = { - login: (0, util_1.promisify3)(this.stub.login, this.stub), - alter: (0, util_1.promisify3)(this.stub.alter, this.stub), - query: (0, util_1.promisify3)(this.stub.query, this.stub), - mutate: (0, util_1.promisify3)(this.stub.mutate, this.stub), - commitOrAbort: (0, util_1.promisify3)(this.stub.commitOrAbort, this.stub), - checkVersion: (0, util_1.promisify3)(this.stub.checkVersion, this.stub), - waitForReady: (0, util_1.promisify1)(this.stub.waitForReady, this.stub), - }; + }) + }) + } + DgraphClientStub.prototype.query = function (req, metadata, options) { + return this.promisified.query(req, this.ensureMetadata(metadata), ensureCallOptions(options)) + } + DgraphClientStub.prototype.mutate = function (mu, metadata, options) { + return this.promisified.mutate(mu, this.ensureMetadata(metadata), ensureCallOptions(options)) + } + DgraphClientStub.prototype.commitOrAbort = function (ctx, metadata, options) { + return this.promisified.commitOrAbort( + ctx, + this.ensureMetadata(metadata), + ensureCallOptions(options), + ) + } + DgraphClientStub.prototype.checkVersion = function (check, metadata, options) { + return this.promisified.checkVersion( + check, + this.ensureMetadata(metadata), + ensureCallOptions(options), + ) + } + DgraphClientStub.prototype.waitForReady = function (deadline) { + return this.promisified.waitForReady(deadline) + } + DgraphClientStub.prototype.close = function () { + return this.stub.close() + } + DgraphClientStub.prototype.grpcClient = function () { + return this.stub + } + DgraphClientStub.prototype.ensureMetadata = function (metadata) { + var newMeta = metadata === undefined ? new grpc.Metadata() : metadata + if (this.accessJwt !== "") { + newMeta.set("accessJwt", this.accessJwt) } - DgraphClientStub.prototype.login = function (userid, password, refreshJwt, metadata, options) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2, this.loginIntoNamespace(userid, password, 0, refreshJwt, metadata, options)]; - }); - }); - }; - DgraphClientStub.prototype.loginIntoNamespace = function (userid, password, namespace, refreshJwt, metadata, options) { - return __awaiter(this, void 0, void 0, function () { - var req, resp, jwtResponse; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - req = new messages.LoginRequest(); - if (userid !== undefined) { - req.setUserid(userid); - req.setPassword(password); - req.setNamespace(namespace); - } - else if (refreshJwt !== undefined) { - req.setRefreshToken(refreshJwt); - } - else { - req.setRefreshToken(this.refreshJwt); - } - return [4, this.promisified.login(req, this.ensureMetadata(metadata), ensureCallOptions(options))]; - case 1: - resp = _a.sent(); - jwtResponse = messages.Jwt.deserializeBinary(resp.getJson_asU8()); - this.accessJwt = jwtResponse.getAccessJwt(); - this.refreshJwt = jwtResponse.getRefreshJwt(); - return [2, jwtResponse]; - } - }); - }); - }; - DgraphClientStub.prototype.alter = function (op, metadata, options) { - return this.promisified.alter(op, this.ensureMetadata(metadata), ensureCallOptions(options)); - }; - DgraphClientStub.prototype.retryLogin = function (metadata, options) { - return __awaiter(this, void 0, void 0, function () { - var req, resp, jwtResponse; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (this.refreshJwt.length === 0) { - throw errors_1.ERR_REFRESH_JWT_EMPTY; - } - req = new messages.LoginRequest(); - req.setRefreshToken(this.refreshJwt); - return [4, this.promisified.login(req, this.ensureMetadata(metadata), ensureCallOptions(options))]; - case 1: - resp = _a.sent(); - jwtResponse = messages.Jwt.deserializeBinary(resp.getJson_asU8()); - this.accessJwt = jwtResponse.getAccessJwt(); - this.refreshJwt = jwtResponse.getRefreshJwt(); - return [2, jwtResponse]; - } - }); - }); - }; - DgraphClientStub.prototype.query = function (req, metadata, options) { - return this.promisified.query(req, this.ensureMetadata(metadata), ensureCallOptions(options)); - }; - DgraphClientStub.prototype.mutate = function (mu, metadata, options) { - return this.promisified.mutate(mu, this.ensureMetadata(metadata), ensureCallOptions(options)); - }; - DgraphClientStub.prototype.commitOrAbort = function (ctx, metadata, options) { - return this.promisified.commitOrAbort(ctx, this.ensureMetadata(metadata), ensureCallOptions(options)); - }; - DgraphClientStub.prototype.checkVersion = function (check, metadata, options) { - return this.promisified.checkVersion(check, this.ensureMetadata(metadata), ensureCallOptions(options)); - }; - DgraphClientStub.prototype.waitForReady = function (deadline) { - return this.promisified.waitForReady(deadline); - }; - DgraphClientStub.prototype.close = function () { - return this.stub.close(); - }; - DgraphClientStub.prototype.grpcClient = function () { - return this.stub; - }; - DgraphClientStub.prototype.ensureMetadata = function (metadata) { - var newMeta = metadata === undefined ? new grpc.Metadata() : metadata; - if (this.accessJwt !== "") { - newMeta.set("accessJwt", this.accessJwt); - } - return newMeta; - }; - return DgraphClientStub; -}()); -exports.DgraphClientStub = DgraphClientStub; + return newMeta + } + return DgraphClientStub +})() +exports.DgraphClientStub = DgraphClientStub function ensureCallOptions(options) { - return options === undefined - ? { - propagate_flags: grpc.propagate.DEFAULTS, - credentials: undefined, - } - : options; + return options === undefined + ? { + propagate_flags: grpc.propagate.DEFAULTS, + credentials: undefined, + } + : options } diff --git a/lib/clientStubFromSlash.d.ts b/lib/clientStubFromSlash.d.ts index 8a7001d..5080c80 100644 --- a/lib/clientStubFromSlash.d.ts +++ b/lib/clientStubFromSlash.d.ts @@ -1,3 +1,9 @@ -import { DgraphClientStub } from "./clientStub"; -export declare function clientStubFromSlashGraphQLEndpoint(graphqlEndpoint: string, apiKey: string): DgraphClientStub; -export declare function clientStubFromCloudEndpoint(graphqlEndpoint: string, apiKey: string): DgraphClientStub; +import { DgraphClientStub } from "./clientStub" +export declare function clientStubFromSlashGraphQLEndpoint( + graphqlEndpoint: string, + apiKey: string, +): DgraphClientStub +export declare function clientStubFromCloudEndpoint( + graphqlEndpoint: string, + apiKey: string, +): DgraphClientStub diff --git a/lib/clientStubFromSlash.js b/lib/clientStubFromSlash.js index 0ebcd6f..f396b8b 100644 --- a/lib/clientStubFromSlash.js +++ b/lib/clientStubFromSlash.js @@ -1,25 +1,28 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.clientStubFromSlashGraphQLEndpoint = clientStubFromSlashGraphQLEndpoint; -exports.clientStubFromCloudEndpoint = clientStubFromCloudEndpoint; -var grpc = require("@grpc/grpc-js"); -var Url = require("url-parse"); -var clientStub_1 = require("./clientStub"); -var PORT = "443"; +"use strict" +Object.defineProperty(exports, "__esModule", { value: true }) +exports.clientStubFromSlashGraphQLEndpoint = clientStubFromSlashGraphQLEndpoint +exports.clientStubFromCloudEndpoint = clientStubFromCloudEndpoint +var grpc = require("@grpc/grpc-js") +var Url = require("url-parse") +var clientStub_1 = require("./clientStub") +var PORT = "443" function clientStubFromSlashGraphQLEndpoint(graphqlEndpoint, apiKey) { - return clientStubFromCloudEndpoint(graphqlEndpoint, apiKey); + return clientStubFromCloudEndpoint(graphqlEndpoint, apiKey) } function clientStubFromCloudEndpoint(graphqlEndpoint, apiKey) { - var url = new Url(graphqlEndpoint); - var urlParts = url.host.split("."); - var firstHalf = urlParts[0]; - var secondHalf = "".concat(urlParts.splice(1).join("."), ":").concat(PORT); - var backenedURL = "".concat(firstHalf, ".grpc.").concat(secondHalf); - var metaCreds = grpc.credentials.createFromMetadataGenerator(function (_, callback) { - var metadata = new grpc.Metadata(); - metadata.add("authorization", apiKey); - callback(undefined, metadata); - }); - var credentials = grpc.credentials.combineChannelCredentials(grpc.credentials.createSsl(), metaCreds); - return new clientStub_1.DgraphClientStub(backenedURL, credentials); + var url = new Url(graphqlEndpoint) + var urlParts = url.host.split(".") + var firstHalf = urlParts[0] + var secondHalf = "".concat(urlParts.splice(1).join("."), ":").concat(PORT) + var backenedURL = "".concat(firstHalf, ".grpc.").concat(secondHalf) + var metaCreds = grpc.credentials.createFromMetadataGenerator(function (_, callback) { + var metadata = new grpc.Metadata() + metadata.add("authorization", apiKey) + callback(undefined, metadata) + }) + var credentials = grpc.credentials.combineChannelCredentials( + grpc.credentials.createSsl(), + metaCreds, + ) + return new clientStub_1.DgraphClientStub(backenedURL, credentials) } diff --git a/lib/dgraph.d.ts b/lib/dgraph.d.ts index 183ffd6..4a5f468 100644 --- a/lib/dgraph.d.ts +++ b/lib/dgraph.d.ts @@ -1,8 +1,18 @@ -export * from "./types"; -export { Operation, Request, TxnContext, Check, Version, NQuad, Value, Facet, Latency, } from "../generated/api_pb"; -export * from "./clientStub"; -export * from "./client"; -export * from "./clientStubFromSlash"; -export * from "./txn"; -export * from "./errors"; -export * as grpc from "@grpc/grpc-js"; +export * from "./types" +export { + Operation, + Request, + TxnContext, + Check, + Version, + NQuad, + Value, + Facet, + Latency, +} from "../generated/api_pb" +export * from "./clientStub" +export * from "./client" +export * from "./clientStubFromSlash" +export * from "./txn" +export * from "./errors" +export * as grpc from "@grpc/grpc-js" diff --git a/lib/dgraph.js b/lib/dgraph.js index e5ebfb8..91e6d42 100644 --- a/lib/dgraph.js +++ b/lib/dgraph.js @@ -1,34 +1,102 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.grpc = exports.Latency = exports.Facet = exports.Value = exports.NQuad = exports.Version = exports.Check = exports.TxnContext = exports.Request = exports.Operation = void 0; -__exportStar(require("./types"), exports); -var api_pb_1 = require("../generated/api_pb"); -Object.defineProperty(exports, "Operation", { enumerable: true, get: function () { return api_pb_1.Operation; } }); -Object.defineProperty(exports, "Request", { enumerable: true, get: function () { return api_pb_1.Request; } }); -Object.defineProperty(exports, "TxnContext", { enumerable: true, get: function () { return api_pb_1.TxnContext; } }); -Object.defineProperty(exports, "Check", { enumerable: true, get: function () { return api_pb_1.Check; } }); -Object.defineProperty(exports, "Version", { enumerable: true, get: function () { return api_pb_1.Version; } }); -Object.defineProperty(exports, "NQuad", { enumerable: true, get: function () { return api_pb_1.NQuad; } }); -Object.defineProperty(exports, "Value", { enumerable: true, get: function () { return api_pb_1.Value; } }); -Object.defineProperty(exports, "Facet", { enumerable: true, get: function () { return api_pb_1.Facet; } }); -Object.defineProperty(exports, "Latency", { enumerable: true, get: function () { return api_pb_1.Latency; } }); -__exportStar(require("./clientStub"), exports); -__exportStar(require("./client"), exports); -__exportStar(require("./clientStubFromSlash"), exports); -__exportStar(require("./txn"), exports); -__exportStar(require("./errors"), exports); -exports.grpc = require("@grpc/grpc-js"); +"use strict" +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k + var desc = Object.getOwnPropertyDescriptor(m, k) + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { + enumerable: true, + get: function () { + return m[k] + }, + } + } + Object.defineProperty(o, k2, desc) + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k + o[k2] = m[k] + }) +var __exportStar = + (this && this.__exportStar) || + function (m, exports) { + for (var p in m) + if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) + __createBinding(exports, m, p) + } +Object.defineProperty(exports, "__esModule", { value: true }) +exports.grpc = + exports.Latency = + exports.Facet = + exports.Value = + exports.NQuad = + exports.Version = + exports.Check = + exports.TxnContext = + exports.Request = + exports.Operation = + void 0 +__exportStar(require("./types"), exports) +var api_pb_1 = require("../generated/api_pb") +Object.defineProperty(exports, "Operation", { + enumerable: true, + get: function () { + return api_pb_1.Operation + }, +}) +Object.defineProperty(exports, "Request", { + enumerable: true, + get: function () { + return api_pb_1.Request + }, +}) +Object.defineProperty(exports, "TxnContext", { + enumerable: true, + get: function () { + return api_pb_1.TxnContext + }, +}) +Object.defineProperty(exports, "Check", { + enumerable: true, + get: function () { + return api_pb_1.Check + }, +}) +Object.defineProperty(exports, "Version", { + enumerable: true, + get: function () { + return api_pb_1.Version + }, +}) +Object.defineProperty(exports, "NQuad", { + enumerable: true, + get: function () { + return api_pb_1.NQuad + }, +}) +Object.defineProperty(exports, "Value", { + enumerable: true, + get: function () { + return api_pb_1.Value + }, +}) +Object.defineProperty(exports, "Facet", { + enumerable: true, + get: function () { + return api_pb_1.Facet + }, +}) +Object.defineProperty(exports, "Latency", { + enumerable: true, + get: function () { + return api_pb_1.Latency + }, +}) +__exportStar(require("./clientStub"), exports) +__exportStar(require("./client"), exports) +__exportStar(require("./clientStubFromSlash"), exports) +__exportStar(require("./txn"), exports) +__exportStar(require("./errors"), exports) +exports.grpc = require("@grpc/grpc-js") diff --git a/lib/errors.d.ts b/lib/errors.d.ts index dcf1510..f4396f5 100644 --- a/lib/errors.d.ts +++ b/lib/errors.d.ts @@ -1,6 +1,6 @@ -export declare const ERR_NO_CLIENTS: Error; -export declare const ERR_FINISHED: Error; -export declare const ERR_ABORTED: Error; -export declare const ERR_BEST_EFFORT_REQUIRED_READ_ONLY: Error; -export declare const ERR_READ_ONLY: Error; -export declare const ERR_REFRESH_JWT_EMPTY: Error; +export declare const ERR_NO_CLIENTS: Error +export declare const ERR_FINISHED: Error +export declare const ERR_ABORTED: Error +export declare const ERR_BEST_EFFORT_REQUIRED_READ_ONLY: Error +export declare const ERR_READ_ONLY: Error +export declare const ERR_REFRESH_JWT_EMPTY: Error diff --git a/lib/errors.js b/lib/errors.js index b95f1c3..9c0935c 100644 --- a/lib/errors.js +++ b/lib/errors.js @@ -1,9 +1,17 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ERR_REFRESH_JWT_EMPTY = exports.ERR_READ_ONLY = exports.ERR_BEST_EFFORT_REQUIRED_READ_ONLY = exports.ERR_ABORTED = exports.ERR_FINISHED = exports.ERR_NO_CLIENTS = void 0; -exports.ERR_NO_CLIENTS = new Error("No clients provided in DgraphClient constructor"); -exports.ERR_FINISHED = new Error("Transaction has already been committed or discarded"); -exports.ERR_ABORTED = new Error("Transaction has been aborted. Please retry"); -exports.ERR_BEST_EFFORT_REQUIRED_READ_ONLY = new Error("Best effort only works for read-only queries"); -exports.ERR_READ_ONLY = new Error("Readonly transaction cannot run mutations or be committed"); -exports.ERR_REFRESH_JWT_EMPTY = new Error("refresh jwt should not be empty"); +"use strict" +Object.defineProperty(exports, "__esModule", { value: true }) +exports.ERR_REFRESH_JWT_EMPTY = + exports.ERR_READ_ONLY = + exports.ERR_BEST_EFFORT_REQUIRED_READ_ONLY = + exports.ERR_ABORTED = + exports.ERR_FINISHED = + exports.ERR_NO_CLIENTS = + void 0 +exports.ERR_NO_CLIENTS = new Error("No clients provided in DgraphClient constructor") +exports.ERR_FINISHED = new Error("Transaction has already been committed or discarded") +exports.ERR_ABORTED = new Error("Transaction has been aborted. Please retry") +exports.ERR_BEST_EFFORT_REQUIRED_READ_ONLY = new Error( + "Best effort only works for read-only queries", +) +exports.ERR_READ_ONLY = new Error("Readonly transaction cannot run mutations or be committed") +exports.ERR_REFRESH_JWT_EMPTY = new Error("refresh jwt should not be empty") diff --git a/lib/index.d.ts b/lib/index.d.ts index b9abf88..abcc0ff 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -1,3 +1,3 @@ -import * as dgraph from "./dgraph"; -export * from "./dgraph"; -export default dgraph; +import * as dgraph from "./dgraph" +export * from "./dgraph" +export default dgraph diff --git a/lib/index.js b/lib/index.js index aa8b575..525bd5e 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,19 +1,32 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var dgraph = require("./dgraph"); -__exportStar(require("./dgraph"), exports); -exports.default = dgraph; +"use strict" +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k + var desc = Object.getOwnPropertyDescriptor(m, k) + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { + enumerable: true, + get: function () { + return m[k] + }, + } + } + Object.defineProperty(o, k2, desc) + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k + o[k2] = m[k] + }) +var __exportStar = + (this && this.__exportStar) || + function (m, exports) { + for (var p in m) + if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) + __createBinding(exports, m, p) + } +Object.defineProperty(exports, "__esModule", { value: true }) +var dgraph = require("./dgraph") +__exportStar(require("./dgraph"), exports) +exports.default = dgraph diff --git a/lib/txn.d.ts b/lib/txn.d.ts index 73649db..ac45969 100644 --- a/lib/txn.d.ts +++ b/lib/txn.d.ts @@ -1,30 +1,48 @@ -import * as grpc from "@grpc/grpc-js"; -import * as messages from "../generated/api_pb"; -import { DgraphClient } from "./client"; -import * as types from "./types"; +import * as grpc from "@grpc/grpc-js" +import * as messages from "../generated/api_pb" +import { DgraphClient } from "./client" +import * as types from "./types" export type TxnOptions = { - readOnly?: boolean; - bestEffort?: boolean; -}; + readOnly?: boolean + bestEffort?: boolean +} export declare class Txn { - private readonly dc; - private readonly ctx; - private finished; - private mutated; - private readonly useReadOnly; - private readonly useBestEffort; - constructor(dc: DgraphClient, txnOpts?: TxnOptions); - query(q: string, metadata?: grpc.Metadata, options?: grpc.CallOptions): Promise; - queryWithVars(q: string, vars?: { - [k: string]: any; - }, metadata?: grpc.Metadata, options?: grpc.CallOptions): Promise; - queryRDF(q: string, metadata?: grpc.Metadata, options?: grpc.CallOptions): Promise; - queryRDFWithVars(q: string, vars?: { - [k: string]: any; - }, metadata?: grpc.Metadata, options?: grpc.CallOptions): Promise; - mutate(mu: types.Mutation, metadata?: grpc.Metadata, options?: grpc.CallOptions): Promise; - doRequest(req: messages.Request, metadata?: grpc.Metadata, options?: grpc.CallOptions): Promise; - commit(metadata?: grpc.Metadata, options?: grpc.CallOptions): Promise; - discard(metadata?: grpc.Metadata, options?: grpc.CallOptions): Promise; - private mergeContext; + private readonly dc + private readonly ctx + private finished + private mutated + private readonly useReadOnly + private readonly useBestEffort + constructor(dc: DgraphClient, txnOpts?: TxnOptions) + query(q: string, metadata?: grpc.Metadata, options?: grpc.CallOptions): Promise + queryWithVars( + q: string, + vars?: { + [k: string]: any + }, + metadata?: grpc.Metadata, + options?: grpc.CallOptions, + ): Promise + queryRDF(q: string, metadata?: grpc.Metadata, options?: grpc.CallOptions): Promise + queryRDFWithVars( + q: string, + vars?: { + [k: string]: any + }, + metadata?: grpc.Metadata, + options?: grpc.CallOptions, + ): Promise + mutate( + mu: types.Mutation, + metadata?: grpc.Metadata, + options?: grpc.CallOptions, + ): Promise + doRequest( + req: messages.Request, + metadata?: grpc.Metadata, + options?: grpc.CallOptions, + ): Promise + commit(metadata?: grpc.Metadata, options?: grpc.CallOptions): Promise + discard(metadata?: grpc.Metadata, options?: grpc.CallOptions): Promise + private mergeContext } diff --git a/lib/txn.js b/lib/txn.js index 5e7067a..a2f72e8 100644 --- a/lib/txn.js +++ b/lib/txn.js @@ -1,314 +1,453 @@ -"use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { +"use strict" +var __assign = + (this && this.__assign) || + function () { + __assign = + Object.assign || + function (t) { for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; + s = arguments[i] + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p] } - return t; - }; - return __assign.apply(this, arguments); -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return t + } + return __assign.apply(this, arguments) + } +var __awaiter = + (this && this.__awaiter) || + function (thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P + ? value + : new P(function (resolve) { + resolve(value) + }) + } return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } + function fulfilled(value) { + try { + step(generator.next(value)) + } catch (e) { + reject(e) + } + } + function rejected(value) { + try { + step(generator["throw"](value)) + } catch (e) { + reject(e) + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected) + } + step((generator = generator.apply(thisArg, _arguments || [])).next()) + }) + } +var __generator = + (this && this.__generator) || + function (thisArg, body) { + var _ = { + label: 0, + sent: function () { + if (t[0] & 1) throw t[1] + return t[1] + }, + trys: [], + ops: [], + }, + f, + y, + t, + g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype) + return ( + (g.next = verb(0)), + (g["throw"] = verb(1)), + (g["return"] = verb(2)), + typeof Symbol === "function" && + (g[Symbol.iterator] = function () { + return this + }), + g + ) + function verb(n) { + return function (v) { + return step([n, v]) + } + } function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + if (f) throw new TypeError("Generator is already executing.") + while ((g && ((g = 0), op[0] && (_ = 0)), _)) + try { + if ( + ((f = 1), + y && + (t = + op[0] & 2 + ? y["return"] + : op[0] + ? y["throw"] || ((t = y["return"]) && t.call(y), 0) + : y.next) && + !(t = t.call(y, op[1])).done) + ) + return t + if (((y = 0), t)) op = [op[0] & 2, t.value] + switch (op[0]) { + case 0: + case 1: + t = op + break + case 4: + _.label++ + return { value: op[1], done: false } + case 5: + _.label++ + y = op[1] + op = [0] + continue + case 7: + op = _.ops.pop() + _.trys.pop() + continue + default: + if ( + !((t = _.trys), (t = t.length > 0 && t[t.length - 1])) && + (op[0] === 6 || op[0] === 2) + ) { + _ = 0 + continue + } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { + _.label = op[1] + break + } + if (op[0] === 6 && _.label < t[1]) { + _.label = t[1] + t = op + break + } + if (t && _.label < t[2]) { + _.label = t[2] + _.ops.push(op) + break + } + if (t[2]) _.ops.pop() + _.trys.pop() + continue + } + op = body.call(thisArg, _) + } catch (e) { + op = [6, e] + y = 0 + } finally { + f = t = 0 + } + if (op[0] & 5) throw op[1] + return { value: op[0] ? op[1] : void 0, done: true } } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Txn = void 0; -var messages = require("../generated/api_pb"); -var client_1 = require("./client"); -var errors_1 = require("./errors"); -var types = require("./types"); -var util_1 = require("./util"); + } +Object.defineProperty(exports, "__esModule", { value: true }) +exports.Txn = void 0 +var messages = require("../generated/api_pb") +var client_1 = require("./client") +var errors_1 = require("./errors") +var types = require("./types") +var util_1 = require("./util") var Txn = (function () { - function Txn(dc, txnOpts) { - this.finished = false; - this.mutated = false; - this.useReadOnly = false; - this.useBestEffort = false; - this.dc = dc; - this.ctx = new messages.TxnContext(); - var defaultedTxnOpts = __assign({ readOnly: false, bestEffort: false }, txnOpts); - this.useReadOnly = defaultedTxnOpts.readOnly; - this.useBestEffort = defaultedTxnOpts.bestEffort; - if (this.useBestEffort && !this.useReadOnly) { - this.dc.debug("Client attempted to query using best-effort without setting the transaction to read-only"); - throw errors_1.ERR_BEST_EFFORT_REQUIRED_READ_ONLY; - } + function Txn(dc, txnOpts) { + this.finished = false + this.mutated = false + this.useReadOnly = false + this.useBestEffort = false + this.dc = dc + this.ctx = new messages.TxnContext() + var defaultedTxnOpts = __assign({ readOnly: false, bestEffort: false }, txnOpts) + this.useReadOnly = defaultedTxnOpts.readOnly + this.useBestEffort = defaultedTxnOpts.bestEffort + if (this.useBestEffort && !this.useReadOnly) { + this.dc.debug( + "Client attempted to query using best-effort without setting the transaction to read-only", + ) + throw errors_1.ERR_BEST_EFFORT_REQUIRED_READ_ONLY } - Txn.prototype.query = function (q, metadata, options) { - return this.queryWithVars(q, undefined, metadata, options); - }; - Txn.prototype.queryWithVars = function (q, vars, metadata, options) { - return __awaiter(this, void 0, void 0, function () { - var req, varsMap_1; - return __generator(this, function (_a) { - if (this.finished) { - this.dc.debug("Query request (ERR_FINISHED):\nquery = ".concat(q, "\nvars = ").concat(vars)); - throw errors_1.ERR_FINISHED; - } - req = new messages.Request(); - req.setQuery(q); - req.setStartTs(this.ctx.getStartTs()); - req.setReadOnly(this.useReadOnly); - req.setBestEffort(this.useBestEffort); - if (vars !== undefined) { - varsMap_1 = req.getVarsMap(); - Object.keys(vars).forEach(function (key) { - var value = vars[key]; - if (typeof value === "string" || value instanceof String) { - varsMap_1.set(key, value.toString()); - } - }); - } - return [2, this.doRequest(req, metadata, options)]; - }); - }); - }; - Txn.prototype.queryRDF = function (q, metadata, options) { - return this.queryRDFWithVars(q, undefined, metadata, options); - }; - Txn.prototype.queryRDFWithVars = function (q, vars, metadata, options) { - return __awaiter(this, void 0, void 0, function () { - var req, varsMap_2; - return __generator(this, function (_a) { - if (this.finished) { - this.dc.debug("Query request (ERR_FINISHED):\nquery = ".concat(q, "\nvars = ").concat(vars)); - throw errors_1.ERR_FINISHED; - } - req = new messages.Request(); - req.setQuery(q); - req.setStartTs(this.ctx.getStartTs()); - req.setReadOnly(this.useReadOnly); - req.setBestEffort(this.useBestEffort); - req.setRespFormat(messages.Request.RespFormat.RDF); - if (vars !== undefined) { - varsMap_2 = req.getVarsMap(); - Object.keys(vars).forEach(function (key) { - var value = vars[key]; - if (typeof value === "string" || value instanceof String) { - varsMap_2.set(key, value.toString()); - } - }); - } - return [2, this.doRequest(req, metadata, options)]; - }); - }); - }; - Txn.prototype.mutate = function (mu, metadata, options) { - return __awaiter(this, void 0, void 0, function () { - var req; - return __generator(this, function (_a) { - req = new messages.Request(); - req.setStartTs(this.ctx.getStartTs()); - req.setMutationsList([mu]); - req.setCommitNow(mu.getCommitNow()); - return [2, this.doRequest(req, metadata, options)]; - }); - }); - }; - Txn.prototype.doRequest = function (req, metadata, options) { - return __awaiter(this, void 0, void 0, function () { - var mutationList, resp, c, operation, _a, _b, e_1, _c, _d, e_2; - var _this = this; - return __generator(this, function (_e) { - switch (_e.label) { - case 0: - mutationList = req.getMutationsList(); - if (this.finished) { - this.dc.debug("Do request (ERR_FINISHED):\nquery = ".concat(req.getQuery(), "\nvars = ").concat(req.getVarsMap())); - this.dc.debug("Do request (ERR_FINISHED):\nmutation = ".concat((0, util_1.stringifyMessage)(mutationList[0]))); - throw errors_1.ERR_FINISHED; - } - if (mutationList.length > 0) { - if (this.useReadOnly) { - this.dc.debug("Do request (ERR_READ_ONLY):\nmutation = ".concat((0, util_1.stringifyMessage)(mutationList[0]))); - throw errors_1.ERR_READ_ONLY; - } - this.mutated = true; - } - req.setStartTs(this.ctx.getStartTs()); - req.setHash(this.ctx.getHash()); - this.dc.debug("Do request:\n".concat((0, util_1.stringifyMessage)(req))); - c = this.dc.anyClient(); - operation = function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - return [2, c.query(req, metadata, options)]; - }); }); }; - _e.label = 1; - case 1: - _e.trys.push([1, 3, , 11]); - _b = (_a = types).createResponse; - return [4, operation()]; - case 2: - resp = _b.apply(_a, [_e.sent()]); - return [3, 11]; - case 3: - e_1 = _e.sent(); - if (!((0, client_1.isJwtExpired)(e_1) === true)) return [3, 6]; - return [4, c.retryLogin(metadata, options)]; - case 4: - _e.sent(); - _d = (_c = types).createResponse; - return [4, operation()]; - case 5: - resp = _d.apply(_c, [_e.sent()]); - return [3, 10]; - case 6: - _e.trys.push([6, 8, , 9]); - return [4, this.discard(metadata, options)]; - case 7: - _e.sent(); - return [3, 9]; - case 8: - e_2 = _e.sent(); - return [3, 9]; - case 9: throw (0, util_1.isAbortedError)(e_1) || (0, util_1.isConflictError)(e_1) ? errors_1.ERR_ABORTED : e_1; - case 10: return [3, 11]; - case 11: - if (req.getCommitNow()) { - this.finished = true; - } - this.mergeContext(resp.getTxn()); - this.dc.debug("Do request:\nresponse = ".concat((0, util_1.stringifyMessage)(resp))); - return [2, resp]; - } - }); - }); - }; - Txn.prototype.commit = function (metadata, options) { - return __awaiter(this, void 0, void 0, function () { - var c, operation, e_3; - var _this = this; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (this.finished) { - throw errors_1.ERR_FINISHED; - } - this.finished = true; - if (!this.mutated) { - return [2]; - } - c = this.dc.anyClient(); - operation = function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - return [2, c.commitOrAbort(this.ctx, metadata, options)]; - }); }); }; - _a.label = 1; - case 1: - _a.trys.push([1, 3, , 8]); - return [4, operation()]; - case 2: - _a.sent(); - return [3, 8]; - case 3: - e_3 = _a.sent(); - if (!((0, client_1.isJwtExpired)(e_3) === true)) return [3, 6]; - return [4, c.retryLogin(metadata, options)]; - case 4: - _a.sent(); - return [4, operation()]; - case 5: - _a.sent(); - return [3, 7]; - case 6: throw (0, util_1.isAbortedError)(e_3) ? errors_1.ERR_ABORTED : e_3; - case 7: return [3, 8]; - case 8: return [2]; - } - }); - }); - }; - Txn.prototype.discard = function (metadata, options) { - return __awaiter(this, void 0, void 0, function () { - var c, operation, e_4; - var _this = this; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (this.finished) { - return [2]; - } - this.finished = true; - if (!this.mutated) { - return [2]; - } - this.ctx.setAborted(true); - c = this.dc.anyClient(); - operation = function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - return [2, c.commitOrAbort(this.ctx, metadata, options)]; - }); }); }; - _a.label = 1; - case 1: - _a.trys.push([1, 3, , 8]); - return [4, operation()]; - case 2: - _a.sent(); - return [3, 8]; - case 3: - e_4 = _a.sent(); - if (!((0, client_1.isJwtExpired)(e_4) === true)) return [3, 6]; - return [4, c.retryLogin(metadata, options)]; - case 4: - _a.sent(); - return [4, operation()]; - case 5: - _a.sent(); - return [3, 7]; - case 6: throw (0, util_1.isAbortedError)(e_4) ? errors_1.ERR_ABORTED : e_4; - case 7: return [3, 8]; - case 8: return [2]; - } - }); - }); - }; - Txn.prototype.mergeContext = function (src) { - if (src === undefined) { - return; + } + Txn.prototype.query = function (q, metadata, options) { + return this.queryWithVars(q, undefined, metadata, options) + } + Txn.prototype.queryWithVars = function (q, vars, metadata, options) { + return __awaiter(this, void 0, void 0, function () { + var req, varsMap_1 + return __generator(this, function (_a) { + if (this.finished) { + this.dc.debug( + "Query request (ERR_FINISHED):\nquery = ".concat(q, "\nvars = ").concat(vars), + ) + throw errors_1.ERR_FINISHED } - this.ctx.setHash(src.getHash()); - if (this.ctx.getStartTs() === 0) { - this.ctx.setStartTs(src.getStartTs()); + req = new messages.Request() + req.setQuery(q) + req.setStartTs(this.ctx.getStartTs()) + req.setReadOnly(this.useReadOnly) + req.setBestEffort(this.useBestEffort) + if (vars !== undefined) { + varsMap_1 = req.getVarsMap() + Object.keys(vars).forEach(function (key) { + var value = vars[key] + if (typeof value === "string" || value instanceof String) { + varsMap_1.set(key, value.toString()) + } + }) } - else if (this.ctx.getStartTs() !== src.getStartTs()) { - throw new Error("StartTs mismatch"); + return [2, this.doRequest(req, metadata, options)] + }) + }) + } + Txn.prototype.queryRDF = function (q, metadata, options) { + return this.queryRDFWithVars(q, undefined, metadata, options) + } + Txn.prototype.queryRDFWithVars = function (q, vars, metadata, options) { + return __awaiter(this, void 0, void 0, function () { + var req, varsMap_2 + return __generator(this, function (_a) { + if (this.finished) { + this.dc.debug( + "Query request (ERR_FINISHED):\nquery = ".concat(q, "\nvars = ").concat(vars), + ) + throw errors_1.ERR_FINISHED } - for (var _i = 0, _a = src.getKeysList(); _i < _a.length; _i++) { - var key = _a[_i]; - this.ctx.addKeys(key); + req = new messages.Request() + req.setQuery(q) + req.setStartTs(this.ctx.getStartTs()) + req.setReadOnly(this.useReadOnly) + req.setBestEffort(this.useBestEffort) + req.setRespFormat(messages.Request.RespFormat.RDF) + if (vars !== undefined) { + varsMap_2 = req.getVarsMap() + Object.keys(vars).forEach(function (key) { + var value = vars[key] + if (typeof value === "string" || value instanceof String) { + varsMap_2.set(key, value.toString()) + } + }) } - }; - return Txn; -}()); -exports.Txn = Txn; + return [2, this.doRequest(req, metadata, options)] + }) + }) + } + Txn.prototype.mutate = function (mu, metadata, options) { + return __awaiter(this, void 0, void 0, function () { + var req + return __generator(this, function (_a) { + req = new messages.Request() + req.setStartTs(this.ctx.getStartTs()) + req.setMutationsList([mu]) + req.setCommitNow(mu.getCommitNow()) + return [2, this.doRequest(req, metadata, options)] + }) + }) + } + Txn.prototype.doRequest = function (req, metadata, options) { + return __awaiter(this, void 0, void 0, function () { + var mutationList, resp, c, operation, _a, _b, e_1, _c, _d, _e + var _this = this + return __generator(this, function (_f) { + switch (_f.label) { + case 0: + mutationList = req.getMutationsList() + if (this.finished) { + this.dc.debug( + "Do request (ERR_FINISHED):\nquery = " + .concat(req.getQuery(), "\nvars = ") + .concat(req.getVarsMap()), + ) + this.dc.debug( + "Do request (ERR_FINISHED):\nmutation = ".concat( + (0, util_1.stringifyMessage)(mutationList[0]), + ), + ) + throw errors_1.ERR_FINISHED + } + if (mutationList.length > 0) { + if (this.useReadOnly) { + this.dc.debug( + "Do request (ERR_READ_ONLY):\nmutation = ".concat( + (0, util_1.stringifyMessage)(mutationList[0]), + ), + ) + throw errors_1.ERR_READ_ONLY + } + this.mutated = true + } + req.setStartTs(this.ctx.getStartTs()) + req.setHash(this.ctx.getHash()) + this.dc.debug("Do request:\n".concat((0, util_1.stringifyMessage)(req))) + c = this.dc.anyClient() + operation = function () { + return __awaiter(_this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2, c.query(req, metadata, options)] + }) + }) + } + _f.label = 1 + case 1: + _f.trys.push([1, 3, , 11]) + _b = (_a = types).createResponse + return [4, operation()] + case 2: + resp = _b.apply(_a, [_f.sent()]) + return [3, 11] + case 3: + e_1 = _f.sent() + if (!((0, client_1.isJwtExpired)(e_1) === true)) return [3, 6] + return [4, c.retryLogin(metadata, options)] + case 4: + _f.sent() + _d = (_c = types).createResponse + return [4, operation()] + case 5: + resp = _d.apply(_c, [_f.sent()]) + return [3, 10] + case 6: + _f.trys.push([6, 8, , 9]) + return [4, this.discard(metadata, options)] + case 7: + _f.sent() + return [3, 9] + case 8: + _e = _f.sent() + return [3, 9] + case 9: + throw (0, util_1.isAbortedError)(e_1) || (0, util_1.isConflictError)(e_1) + ? errors_1.ERR_ABORTED + : e_1 + case 10: + return [3, 11] + case 11: + if (req.getCommitNow()) { + this.finished = true + } + this.mergeContext(resp.getTxn()) + this.dc.debug("Do request:\nresponse = ".concat((0, util_1.stringifyMessage)(resp))) + return [2, resp] + } + }) + }) + } + Txn.prototype.commit = function (metadata, options) { + return __awaiter(this, void 0, void 0, function () { + var c, operation, e_2 + var _this = this + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (this.finished) { + throw errors_1.ERR_FINISHED + } + this.finished = true + if (!this.mutated) { + return [2] + } + c = this.dc.anyClient() + operation = function () { + return __awaiter(_this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2, c.commitOrAbort(this.ctx, metadata, options)] + }) + }) + } + _a.label = 1 + case 1: + _a.trys.push([1, 3, , 8]) + return [4, operation()] + case 2: + _a.sent() + return [3, 8] + case 3: + e_2 = _a.sent() + if (!((0, client_1.isJwtExpired)(e_2) === true)) return [3, 6] + return [4, c.retryLogin(metadata, options)] + case 4: + _a.sent() + return [4, operation()] + case 5: + _a.sent() + return [3, 7] + case 6: + throw (0, util_1.isAbortedError)(e_2) ? errors_1.ERR_ABORTED : e_2 + case 7: + return [3, 8] + case 8: + return [2] + } + }) + }) + } + Txn.prototype.discard = function (metadata, options) { + return __awaiter(this, void 0, void 0, function () { + var c, operation, e_3 + var _this = this + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (this.finished) { + return [2] + } + this.finished = true + if (!this.mutated) { + return [2] + } + this.ctx.setAborted(true) + c = this.dc.anyClient() + operation = function () { + return __awaiter(_this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2, c.commitOrAbort(this.ctx, metadata, options)] + }) + }) + } + _a.label = 1 + case 1: + _a.trys.push([1, 3, , 8]) + return [4, operation()] + case 2: + _a.sent() + return [3, 8] + case 3: + e_3 = _a.sent() + if (!((0, client_1.isJwtExpired)(e_3) === true)) return [3, 6] + return [4, c.retryLogin(metadata, options)] + case 4: + _a.sent() + return [4, operation()] + case 5: + _a.sent() + return [3, 7] + case 6: + throw (0, util_1.isAbortedError)(e_3) ? errors_1.ERR_ABORTED : e_3 + case 7: + return [3, 8] + case 8: + return [2] + } + }) + }) + } + Txn.prototype.mergeContext = function (src) { + if (src === undefined) { + return + } + this.ctx.setHash(src.getHash()) + if (this.ctx.getStartTs() === 0) { + this.ctx.setStartTs(src.getStartTs()) + } else if (this.ctx.getStartTs() !== src.getStartTs()) { + throw new Error("StartTs mismatch") + } + for (var _i = 0, _a = src.getKeysList(); _i < _a.length; _i++) { + var key = _a[_i] + this.ctx.addKeys(key) + } + } + return Txn +})() +exports.Txn = Txn diff --git a/lib/types.d.ts b/lib/types.d.ts index b1804bb..2c29294 100644 --- a/lib/types.d.ts +++ b/lib/types.d.ts @@ -1,33 +1,33 @@ -import * as messages from "../generated/api_pb"; +import * as messages from "../generated/api_pb" export declare class Payload extends messages.Payload { - getData(): any; - getData_asB64(): string; - getData_asU8(): Uint8Array; - setData(value: any): void; + getData(): string | Uint8Array + getData_asB64(): string + getData_asU8(): Uint8Array + setData(value: any): void } -export declare function createPayload(oldPayload: messages.Payload): Payload; +export declare function createPayload(oldPayload: messages.Payload): Payload export declare class Response extends messages.Response { - getJson(): any; - getJson_asB64(): string; - getJson_asU8(): Uint8Array; - setJson(value: any): void; + getJson(): string | Uint8Array + getJson_asB64(): string + getJson_asU8(): Uint8Array + setJson(value: any): void } -export declare function createResponse(oldResponse: messages.Response): Response; +export declare function createResponse(oldResponse: messages.Response): Response export declare class Mutation extends messages.Mutation { - getSetJson(): any; - getSetJson_asB64(): string; - getSetJson_asU8(): Uint8Array; - setSetJson(value: any): void; - getDeleteJson(): any; - getDeleteJson_asB64(): string; - getDeleteJson_asU8(): Uint8Array; - setDeleteJson(value: any): void; - getSetNquads(): Uint8Array | string; - getSetNquads_asB64(): string; - getSetNquads_asU8(): Uint8Array; - setSetNquads(value: Uint8Array | string): void; - getDelNquads(): Uint8Array | string; - getDelNquads_asB64(): string; - getDelNquads_asU8(): Uint8Array; - setDelNquads(value: Uint8Array | string): void; + getSetJson(): string | Uint8Array + getSetJson_asB64(): string + getSetJson_asU8(): Uint8Array + setSetJson(value: any): void + getDeleteJson(): string | Uint8Array + getDeleteJson_asB64(): string + getDeleteJson_asU8(): Uint8Array + setDeleteJson(value: any): void + getSetNquads(): Uint8Array | string + getSetNquads_asB64(): string + getSetNquads_asU8(): Uint8Array + setSetNquads(value: Uint8Array | string): void + getDelNquads(): Uint8Array | string + getDelNquads_asB64(): string + getDelNquads_asU8(): Uint8Array + setDelNquads(value: Uint8Array | string): void } diff --git a/lib/types.js b/lib/types.js index 1a531f0..5de7500 100644 --- a/lib/types.js +++ b/lib/types.js @@ -1,265 +1,277 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { +"use strict" +var __extends = + (this && this.__extends) || + (function () { var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; + extendStatics = + Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && + function (d, b) { + d.__proto__ = b + }) || + function (d, b) { + for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p] + } + return extendStatics(d, b) + } return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Mutation = exports.Response = exports.Payload = void 0; -exports.createPayload = createPayload; -exports.createResponse = createResponse; -var jspb = require("google-protobuf"); -var messages = require("../generated/api_pb"); -var util_1 = require("./util"); + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null") + extendStatics(d, b) + function __() { + this.constructor = d + } + d.prototype = b === null ? Object.create(b) : ((__.prototype = b.prototype), new __()) + } + })() +Object.defineProperty(exports, "__esModule", { value: true }) +exports.Mutation = exports.Response = exports.Payload = void 0 +exports.createPayload = createPayload +exports.createResponse = createResponse +var jspb = require("google-protobuf") +var messages = require("../generated/api_pb") +var util_1 = require("./util") var Payload = (function (_super) { - __extends(Payload, _super); - function Payload() { - return _super !== null && _super.apply(this, arguments) || this; - } - Payload.prototype.getData = function () { - var jsonStr; - var value = _super.prototype.getData.call(this); - if (value instanceof Uint8Array) { - jsonStr = (0, util_1.u8ToStr)(value); - } - else { - jsonStr = (0, util_1.b64ToStr)(value); - } - return (0, util_1.strToJson)(jsonStr); - }; - Payload.prototype.getData_asB64 = function () { - var value = _super.prototype.getData.call(this); - if (value instanceof Uint8Array) { - return jspb.Message.bytesAsB64(value); - } - return value; - }; - Payload.prototype.getData_asU8 = function () { - var value = _super.prototype.getData.call(this); - if (typeof value === "string" || value instanceof String) { - return jspb.Message.bytesAsU8(value.toString()); - } - return value; - }; - Payload.prototype.setData = function (value) { - if (value instanceof Uint8Array) { - _super.prototype.setData.call(this, value); - return; - } - if (typeof value === "string" || value instanceof String) { - _super.prototype.setData.call(this, value.toString()); - return; - } - var jsonStr = JSON.stringify(value); - _super.prototype.setData.call(this, (0, util_1.strToU8)(jsonStr)); - }; - return Payload; -}(messages.Payload)); -exports.Payload = Payload; + __extends(Payload, _super) + function Payload() { + return (_super !== null && _super.apply(this, arguments)) || this + } + Payload.prototype.getData = function () { + var jsonStr + var value = _super.prototype.getData.call(this) + if (value instanceof Uint8Array) { + jsonStr = (0, util_1.u8ToStr)(value) + } else { + jsonStr = (0, util_1.b64ToStr)(value) + } + return (0, util_1.strToJson)(jsonStr) + } + Payload.prototype.getData_asB64 = function () { + var value = _super.prototype.getData.call(this) + if (value instanceof Uint8Array) { + return jspb.Message.bytesAsB64(value) + } + return value + } + Payload.prototype.getData_asU8 = function () { + var value = _super.prototype.getData.call(this) + if (typeof value === "string" || value instanceof String) { + return jspb.Message.bytesAsU8(value.toString()) + } + return value + } + Payload.prototype.setData = function (value) { + if (value instanceof Uint8Array) { + _super.prototype.setData.call(this, value) + return + } + if (typeof value === "string" || value instanceof String) { + _super.prototype.setData.call(this, value.toString()) + return + } + var jsonStr = JSON.stringify(value) + _super.prototype.setData.call(this, (0, util_1.strToU8)(jsonStr)) + } + return Payload +})(messages.Payload) +exports.Payload = Payload function createPayload(oldPayload) { - return messages.Payload.deserializeBinaryFromReader(new Payload(), new jspb.BinaryReader(oldPayload.serializeBinary())); + return messages.Payload.deserializeBinaryFromReader( + new Payload(), + new jspb.BinaryReader(oldPayload.serializeBinary()), + ) } var Response = (function (_super) { - __extends(Response, _super); - function Response() { - return _super !== null && _super.apply(this, arguments) || this; - } - Response.prototype.getJson = function () { - var jsonStr; - var value = _super.prototype.getJson.call(this); - if (value instanceof Uint8Array) { - jsonStr = (0, util_1.u8ToStr)(value); - } - else { - jsonStr = (0, util_1.b64ToStr)(value); - } - return (0, util_1.strToJson)(jsonStr); - }; - Response.prototype.getJson_asB64 = function () { - var value = _super.prototype.getJson.call(this); - if (value instanceof Uint8Array) { - return jspb.Message.bytesAsB64(value); - } - return value; - }; - Response.prototype.getJson_asU8 = function () { - var value = _super.prototype.getJson.call(this); - if (typeof value === "string" || value instanceof String) { - return jspb.Message.bytesAsU8(value.toString()); - } - return value; - }; - Response.prototype.setJson = function (value) { - if (value instanceof Uint8Array) { - _super.prototype.setJson.call(this, value); - return; - } - if (typeof value === "string" || value instanceof String) { - _super.prototype.setJson.call(this, value.toString()); - return; - } - var jsonStr = JSON.stringify(value); - _super.prototype.setJson.call(this, (0, util_1.strToU8)(jsonStr)); - }; - return Response; -}(messages.Response)); -exports.Response = Response; + __extends(Response, _super) + function Response() { + return (_super !== null && _super.apply(this, arguments)) || this + } + Response.prototype.getJson = function () { + var jsonStr + var value = _super.prototype.getJson.call(this) + if (value instanceof Uint8Array) { + jsonStr = (0, util_1.u8ToStr)(value) + } else { + jsonStr = (0, util_1.b64ToStr)(value) + } + return (0, util_1.strToJson)(jsonStr) + } + Response.prototype.getJson_asB64 = function () { + var value = _super.prototype.getJson.call(this) + if (value instanceof Uint8Array) { + return jspb.Message.bytesAsB64(value) + } + return value + } + Response.prototype.getJson_asU8 = function () { + var value = _super.prototype.getJson.call(this) + if (typeof value === "string" || value instanceof String) { + return jspb.Message.bytesAsU8(value.toString()) + } + return value + } + Response.prototype.setJson = function (value) { + if (value instanceof Uint8Array) { + _super.prototype.setJson.call(this, value) + return + } + if (typeof value === "string" || value instanceof String) { + _super.prototype.setJson.call(this, value.toString()) + return + } + var jsonStr = JSON.stringify(value) + _super.prototype.setJson.call(this, (0, util_1.strToU8)(jsonStr)) + } + return Response +})(messages.Response) +exports.Response = Response function createResponse(oldResponse) { - return messages.Response.deserializeBinaryFromReader(new Response(), new jspb.BinaryReader(oldResponse.serializeBinary())); + return messages.Response.deserializeBinaryFromReader( + new Response(), + new jspb.BinaryReader(oldResponse.serializeBinary()), + ) } var Mutation = (function (_super) { - __extends(Mutation, _super); - function Mutation() { - return _super !== null && _super.apply(this, arguments) || this; - } - Mutation.prototype.getSetJson = function () { - var jsonStr; - var value = _super.prototype.getSetJson.call(this); - if (value instanceof Uint8Array) { - jsonStr = (0, util_1.u8ToStr)(value); - } - else { - jsonStr = (0, util_1.b64ToStr)(value); - } - return (0, util_1.strToJson)(jsonStr); - }; - Mutation.prototype.getSetJson_asB64 = function () { - var value = _super.prototype.getSetJson.call(this); - if (value instanceof Uint8Array) { - return jspb.Message.bytesAsB64(value); - } - return value; - }; - Mutation.prototype.getSetJson_asU8 = function () { - var value = _super.prototype.getSetJson.call(this); - if (typeof value === "string" || value instanceof String) { - return jspb.Message.bytesAsU8(value.toString()); - } - return value; - }; - Mutation.prototype.setSetJson = function (value) { - if (value instanceof Uint8Array) { - _super.prototype.setSetJson.call(this, value); - return; - } - if (typeof value === "string" || value instanceof String) { - _super.prototype.setSetJson.call(this, value.toString()); - return; - } - var jsonStr = JSON.stringify(value); - _super.prototype.setSetJson.call(this, (0, util_1.strToU8)(jsonStr)); - }; - Mutation.prototype.getDeleteJson = function () { - var jsonStr; - var value = _super.prototype.getDeleteJson.call(this); - if (value instanceof Uint8Array) { - jsonStr = (0, util_1.u8ToStr)(value); - } - else { - jsonStr = (0, util_1.b64ToStr)(value); - } - return (0, util_1.strToJson)(jsonStr); - }; - Mutation.prototype.getDeleteJson_asB64 = function () { - var value = _super.prototype.getDeleteJson.call(this); - if (value instanceof Uint8Array) { - return jspb.Message.bytesAsB64(value); - } - return value; - }; - Mutation.prototype.getDeleteJson_asU8 = function () { - var value = _super.prototype.getDeleteJson.call(this); - if (typeof value === "string" || value instanceof String) { - return jspb.Message.bytesAsU8(value.toString()); - } - return value; - }; - Mutation.prototype.setDeleteJson = function (value) { - if (value instanceof Uint8Array) { - _super.prototype.setDeleteJson.call(this, value); - return; - } - if (typeof value === "string" || value instanceof String) { - _super.prototype.setDeleteJson.call(this, value.toString()); - return; - } - var jsonStr = JSON.stringify(value); - _super.prototype.setDeleteJson.call(this, (0, util_1.strToU8)(jsonStr)); - }; - Mutation.prototype.getSetNquads = function () { - var value = _super.prototype.getSetNquads.call(this); - if (value instanceof Uint8Array) { - return (0, util_1.u8ToStr)(value); - } - return (0, util_1.b64ToStr)(value); - }; - Mutation.prototype.getSetNquads_asB64 = function () { - var value = _super.prototype.getSetNquads.call(this); - if (value instanceof Uint8Array) { - return jspb.Message.bytesAsB64(value); - } - return value; - }; - Mutation.prototype.getSetNquads_asU8 = function () { - var value = _super.prototype.getSetNquads.call(this); - if (typeof value === "string" || value instanceof String) { - return jspb.Message.bytesAsU8(value.toString()); - } - return value; - }; - Mutation.prototype.setSetNquads = function (value) { - if (value instanceof Uint8Array) { - _super.prototype.setSetNquads.call(this, value); - return; - } - if ((0, util_1.isBase64)(value)) { - _super.prototype.setSetNquads.call(this, value); - return; - } - _super.prototype.setSetNquads.call(this, (0, util_1.strToB64)(value)); - }; - Mutation.prototype.getDelNquads = function () { - var value = _super.prototype.getDelNquads.call(this); - if (value instanceof Uint8Array) { - return (0, util_1.u8ToStr)(value); - } - return (0, util_1.b64ToStr)(value); - }; - Mutation.prototype.getDelNquads_asB64 = function () { - var value = _super.prototype.getDelNquads.call(this); - if (value instanceof Uint8Array) { - return jspb.Message.bytesAsB64(value); - } - return value; - }; - Mutation.prototype.getDelNquads_asU8 = function () { - var value = _super.prototype.getDelNquads.call(this); - if (typeof value === "string" || value instanceof String) { - return jspb.Message.bytesAsU8(value.toString()); - } - return value; - }; - Mutation.prototype.setDelNquads = function (value) { - if (value instanceof Uint8Array) { - _super.prototype.setDelNquads.call(this, value); - return; - } - if ((0, util_1.isBase64)(value)) { - _super.prototype.setDelNquads.call(this, value); - return; - } - _super.prototype.setDelNquads.call(this, (0, util_1.strToB64)(value)); - }; - return Mutation; -}(messages.Mutation)); -exports.Mutation = Mutation; + __extends(Mutation, _super) + function Mutation() { + return (_super !== null && _super.apply(this, arguments)) || this + } + Mutation.prototype.getSetJson = function () { + var jsonStr + var value = _super.prototype.getSetJson.call(this) + if (value instanceof Uint8Array) { + jsonStr = (0, util_1.u8ToStr)(value) + } else { + jsonStr = (0, util_1.b64ToStr)(value) + } + return (0, util_1.strToJson)(jsonStr) + } + Mutation.prototype.getSetJson_asB64 = function () { + var value = _super.prototype.getSetJson.call(this) + if (value instanceof Uint8Array) { + return jspb.Message.bytesAsB64(value) + } + return value + } + Mutation.prototype.getSetJson_asU8 = function () { + var value = _super.prototype.getSetJson.call(this) + if (typeof value === "string" || value instanceof String) { + return jspb.Message.bytesAsU8(value.toString()) + } + return value + } + Mutation.prototype.setSetJson = function (value) { + if (value instanceof Uint8Array) { + _super.prototype.setSetJson.call(this, value) + return + } + if (typeof value === "string" || value instanceof String) { + _super.prototype.setSetJson.call(this, value.toString()) + return + } + var jsonStr = JSON.stringify(value) + _super.prototype.setSetJson.call(this, (0, util_1.strToU8)(jsonStr)) + } + Mutation.prototype.getDeleteJson = function () { + var jsonStr + var value = _super.prototype.getDeleteJson.call(this) + if (value instanceof Uint8Array) { + jsonStr = (0, util_1.u8ToStr)(value) + } else { + jsonStr = (0, util_1.b64ToStr)(value) + } + return (0, util_1.strToJson)(jsonStr) + } + Mutation.prototype.getDeleteJson_asB64 = function () { + var value = _super.prototype.getDeleteJson.call(this) + if (value instanceof Uint8Array) { + return jspb.Message.bytesAsB64(value) + } + return value + } + Mutation.prototype.getDeleteJson_asU8 = function () { + var value = _super.prototype.getDeleteJson.call(this) + if (typeof value === "string" || value instanceof String) { + return jspb.Message.bytesAsU8(value.toString()) + } + return value + } + Mutation.prototype.setDeleteJson = function (value) { + if (value instanceof Uint8Array) { + _super.prototype.setDeleteJson.call(this, value) + return + } + if (typeof value === "string" || value instanceof String) { + _super.prototype.setDeleteJson.call(this, value.toString()) + return + } + var jsonStr = JSON.stringify(value) + _super.prototype.setDeleteJson.call(this, (0, util_1.strToU8)(jsonStr)) + } + Mutation.prototype.getSetNquads = function () { + var value = _super.prototype.getSetNquads.call(this) + if (value instanceof Uint8Array) { + return (0, util_1.u8ToStr)(value) + } + return (0, util_1.b64ToStr)(value) + } + Mutation.prototype.getSetNquads_asB64 = function () { + var value = _super.prototype.getSetNquads.call(this) + if (value instanceof Uint8Array) { + return jspb.Message.bytesAsB64(value) + } + return value + } + Mutation.prototype.getSetNquads_asU8 = function () { + var value = _super.prototype.getSetNquads.call(this) + if (typeof value === "string" || value instanceof String) { + return jspb.Message.bytesAsU8(value.toString()) + } + return value + } + Mutation.prototype.setSetNquads = function (value) { + if (value instanceof Uint8Array) { + _super.prototype.setSetNquads.call(this, value) + return + } + if ((0, util_1.isBase64)(value)) { + _super.prototype.setSetNquads.call(this, value) + return + } + _super.prototype.setSetNquads.call(this, (0, util_1.strToB64)(value)) + } + Mutation.prototype.getDelNquads = function () { + var value = _super.prototype.getDelNquads.call(this) + if (value instanceof Uint8Array) { + return (0, util_1.u8ToStr)(value) + } + return (0, util_1.b64ToStr)(value) + } + Mutation.prototype.getDelNquads_asB64 = function () { + var value = _super.prototype.getDelNquads.call(this) + if (value instanceof Uint8Array) { + return jspb.Message.bytesAsB64(value) + } + return value + } + Mutation.prototype.getDelNquads_asU8 = function () { + var value = _super.prototype.getDelNquads.call(this) + if (typeof value === "string" || value instanceof String) { + return jspb.Message.bytesAsU8(value.toString()) + } + return value + } + Mutation.prototype.setDelNquads = function (value) { + if (value instanceof Uint8Array) { + _super.prototype.setDelNquads.call(this, value) + return + } + if ((0, util_1.isBase64)(value)) { + _super.prototype.setDelNquads.call(this, value) + return + } + _super.prototype.setDelNquads.call(this, (0, util_1.strToB64)(value)) + } + return Mutation +})(messages.Mutation) +exports.Mutation = Mutation diff --git a/lib/util.d.ts b/lib/util.d.ts index bb2bef5..21e7a63 100644 --- a/lib/util.d.ts +++ b/lib/util.d.ts @@ -1,17 +1,23 @@ -import * as jspb from "google-protobuf"; +import * as jspb from "google-protobuf" export declare function errorCode(err: any): { - valid: boolean; - code: number; -}; -export declare function isAbortedError(err: any): boolean; -export declare function isConflictError(err: any): boolean; -export declare function isUnauthenticatedError(err: any): boolean; -export declare function promisify1(f: (arg: A, cb: (err?: Error, res?: T) => void) => void, thisContext?: any): (arg: A) => Promise; -export declare function promisify3(f: (argA: A, argB: B, argC: C, cb: (err?: Error, res?: T) => void) => void, thisContext?: any): (argA: A, argB: B, argC: C) => Promise; -export declare function stringifyMessage(msg: jspb.Message): string; -export { isBase64 } from "is-base64"; -export declare function strToB64(str: string): string; -export declare function strToU8(str: string): Uint8Array; -export declare function b64ToStr(b64Str: string): string; -export declare function u8ToStr(arr: Uint8Array): string; -export declare function strToJson(jsonStr: string): any; + valid: boolean + code: number +} +export declare function isAbortedError(err: any): boolean +export declare function isConflictError(err: any): boolean +export declare function isUnauthenticatedError(err: any): boolean +export declare function promisify1( + f: (arg: A, cb: (err?: Error, res?: T) => void) => void, + thisContext?: any, +): (arg: A) => Promise +export declare function promisify3( + f: (argA: A, argB: B, argC: C, cb: (err?: Error, res?: T) => void) => void, + thisContext?: any, +): (argA: A, argB: B, argC: C) => Promise +export declare function stringifyMessage(msg: jspb.Message): string +export { isBase64 } from "is-base64" +export declare function strToB64(str: string): string +export declare function strToU8(str: string): Uint8Array +export declare function b64ToStr(b64Str: string): string +export declare function u8ToStr(arr: Uint8Array): string +export declare function strToJson(jsonStr: string): any diff --git a/lib/util.js b/lib/util.js index fcd7e56..de37863 100644 --- a/lib/util.js +++ b/lib/util.js @@ -1,96 +1,98 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.isBase64 = void 0; -exports.errorCode = errorCode; -exports.isAbortedError = isAbortedError; -exports.isConflictError = isConflictError; -exports.isUnauthenticatedError = isUnauthenticatedError; -exports.promisify1 = promisify1; -exports.promisify3 = promisify3; -exports.stringifyMessage = stringifyMessage; -exports.strToB64 = strToB64; -exports.strToU8 = strToU8; -exports.b64ToStr = b64ToStr; -exports.u8ToStr = u8ToStr; -exports.strToJson = strToJson; -var grpc = require("@grpc/grpc-js"); +"use strict" +Object.defineProperty(exports, "__esModule", { value: true }) +exports.isBase64 = void 0 +exports.errorCode = errorCode +exports.isAbortedError = isAbortedError +exports.isConflictError = isConflictError +exports.isUnauthenticatedError = isUnauthenticatedError +exports.promisify1 = promisify1 +exports.promisify3 = promisify3 +exports.stringifyMessage = stringifyMessage +exports.strToB64 = strToB64 +exports.strToU8 = strToU8 +exports.b64ToStr = b64ToStr +exports.u8ToStr = u8ToStr +exports.strToJson = strToJson +var grpc = require("@grpc/grpc-js") function errorCode(err) { - if (err === undefined || - typeof err !== "object" || - !err.hasOwnProperty("code") || - typeof err.code !== "number") { - return { - valid: false, - code: -1, - }; - } + if ( + err === undefined || + typeof err !== "object" || + !Object.prototype.hasOwnProperty.call(err, "code") || + typeof err.code !== "number" + ) { return { - valid: true, - code: err.code, - }; + valid: false, + code: -1, + } + } + return { + valid: true, + code: err.code, + } } function isAbortedError(err) { - var ec = errorCode(err); - return ec.valid && ec.code === grpc.status.ABORTED; + var ec = errorCode(err) + return ec.valid && ec.code === grpc.status.ABORTED } function isConflictError(err) { - var ec = errorCode(err); - return (ec.valid && - (ec.code === grpc.status.ABORTED || - ec.code === grpc.status.FAILED_PRECONDITION)); + var ec = errorCode(err) + return ( + ec.valid && (ec.code === grpc.status.ABORTED || ec.code === grpc.status.FAILED_PRECONDITION) + ) } function isUnauthenticatedError(err) { - var ec = errorCode(err); - return ec.valid && ec.code === grpc.status.UNAUTHENTICATED; + var ec = errorCode(err) + return ec.valid && ec.code === grpc.status.UNAUTHENTICATED } function promisify1(f, thisContext) { - return function (arg) { - return new Promise(function (resolve, reject) { - f.call(thisContext, arg, function (err, result) { - return err !== undefined && err !== null - ? reject(err) - : resolve(result); - }); - }); - }; + return function (arg) { + return new Promise(function (resolve, reject) { + f.call(thisContext, arg, function (err, result) { + return err !== undefined && err !== null ? reject(err) : resolve(result) + }) + }) + } } function promisify3(f, thisContext) { - return function (argA, argB, argC) { - return new Promise(function (resolve, reject) { - f.call(thisContext, argA, argB, argC, function (err, result) { - return err !== undefined && err !== null - ? reject(err) - : resolve(result); - }); - }); - }; + return function (argA, argB, argC) { + return new Promise(function (resolve, reject) { + f.call(thisContext, argA, argB, argC, function (err, result) { + return err !== undefined && err !== null ? reject(err) : resolve(result) + }) + }) + } } function stringifyMessage(msg) { - return JSON.stringify(msg.toObject()); + return JSON.stringify(msg.toObject()) } -var is_base64_1 = require("is-base64"); -Object.defineProperty(exports, "isBase64", { enumerable: true, get: function () { return is_base64_1.isBase64; } }); +var is_base64_1 = require("is-base64") +Object.defineProperty(exports, "isBase64", { + enumerable: true, + get: function () { + return is_base64_1.isBase64 + }, +}) function strToB64(str) { - return Buffer.from(str, "utf8").toString("base64"); + return Buffer.from(str, "utf8").toString("base64") } function strToU8(str) { - return new Uint8Array(Buffer.from(str, "utf8")); + return new Uint8Array(Buffer.from(str, "utf8")) } function b64ToStr(b64Str) { - return Buffer.from(b64Str, "base64").toString(); + return Buffer.from(b64Str, "base64").toString() } function u8ToStr(arr) { - var buf = Buffer.from(arr.buffer); - if (arr.byteLength !== arr.buffer.byteLength) { - buf = buf.slice(arr.byteOffset, arr.byteOffset + arr.byteLength); - } - return buf.toString(); + var buf = Buffer.from(arr.buffer) + if (arr.byteLength !== arr.buffer.byteLength) { + buf = buf.slice(arr.byteOffset, arr.byteOffset + arr.byteLength) + } + return buf.toString() } function strToJson(jsonStr) { - try { - return JSON.parse(jsonStr); - } - catch (e) { - return {}; - } + try { + return JSON.parse(jsonStr) + } catch (_a) { + return {} + } } diff --git a/package-lock.json b/package-lock.json index 5bbed4e..ce100aa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,40 +10,24 @@ "license": "Apache-2.0", "dependencies": { "@grpc/grpc-js": "^1.12.5", + "@improbable-eng/grpc-web": "^0.15.0", "@types/url-parse": "^1.4.11", - "@typescript-eslint/eslint-plugin-tslint": "^7.0.2", - "dgraph-js": "^21.3.1", - "eslint-plugin-lodash": "^8.0.0", "google-protobuf": "^3.21.4", "is-base64": "^1.1.0", "url-parse": "^1.5.10" }, "devDependencies": { + "@eslint/js": "^9.18.0", + "@trunkio/launcher": "^1.3.2", "@types/google-protobuf": "^3.15.12", - "@types/jest": "^29.5.14", + "@types/jest": "^29.2.15", "@types/node": "^22.10.5", - "@typescript-eslint/eslint-plugin": "^8.19.1", - "@typescript-eslint/parser": "^8.19.1", - "eslint": "^9.17.0", - "eslint-plugin-import": "^2.31.0", - "eslint-plugin-jest": "^28.10.0", - "eslint-plugin-jsdoc": "^50.6.1", - "eslint-plugin-jsx-a11y": "^6.10.2", - "eslint-plugin-no-null": "^1.0.2", - "eslint-plugin-prefer-arrow": "^1.2.3", - "eslint-plugin-react": "^7.37.3", - "eslint-plugin-security": "^3.0.1", - "eslint-plugin-unicorn": "^56.0.1", - "grpc_tools_node_protoc_ts": "^5.3.3", + "eslint": "^9.18.0", "grpc-tools": "^1.12.4", - "install-peers": "^1.0.4", "jest": "^29.7.0", - "jest-teamcity": "^1.12.0", - "rimraf": "^6.0.1", "ts-jest": "^29.2.5", - "ts-protoc-gen": "^0.15.0", - "tslint": "^6.1.3", - "typescript": "^5.7.2" + "typescript": "^5.7.2", + "typescript-eslint": "^8.20.0" } }, "node_modules/@ampproject/remapping": { @@ -63,6 +47,7 @@ "version": "7.24.7", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", + "dev": true, "dependencies": { "@babel/highlight": "^7.24.7", "picocolors": "^1.0.0" @@ -110,18 +95,6 @@ "url": "https://opencollective.com/babel" } }, - "node_modules/@babel/core/node_modules/json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "dev": true, - "bin": { - "json5": "lib/cli.js" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/@babel/core/node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", @@ -299,6 +272,7 @@ "version": "7.24.7", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", + "dev": true, "engines": { "node": ">=6.9.0" } @@ -329,6 +303,7 @@ "version": "7.24.7", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", + "dev": true, "dependencies": { "@babel/helper-validator-identifier": "^7.24.7", "chalk": "^2.4.2", @@ -343,6 +318,7 @@ "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" }, @@ -354,6 +330,7 @@ "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", @@ -367,6 +344,7 @@ "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" } @@ -374,12 +352,14 @@ "node_modules/@babel/highlight/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==" + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true }, "node_modules/@babel/highlight/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" } @@ -388,6 +368,7 @@ "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" }, @@ -648,24 +629,39 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, - "node_modules/@es-joy/jsdoccomment": { - "version": "0.49.0", - "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.49.0.tgz", - "integrity": "sha512-xjZTSFgECpb9Ohuk5yMX5RhUEbfeQcuOp8IF60e+wyzWEF0M5xeSgqsfLtvPEX8BIyOX9saZqzuGPmZ8oWc+5Q==", + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", "dev": true, + "license": "MIT", + "optional": true, + "peer": true, "dependencies": { - "comment-parser": "1.4.1", - "esquery": "^1.6.0", - "jsdoc-type-pratt-parser": "~4.1.0" + "@jridgewell/trace-mapping": "0.3.9" }, "engines": { - "node": ">=16" + "node": ">=12" + } + }, + "node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" } }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, "dependencies": { "eslint-visitor-keys": "^3.3.0" }, @@ -680,18 +676,20 @@ "version": "4.12.1", "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", + "dev": true, "license": "MIT", "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, "node_modules/@eslint/config-array": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.0.tgz", - "integrity": "sha512-zdHg2FPIFNKPdcHWtiNT+jEFCHYVplAXRDlQDyqy0zGx/q2parwh7brGJSiTxRk/TSMkbM//zt/f5CHgyTyaSQ==", + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.1.tgz", + "integrity": "sha512-fo6Mtm5mWyKjA/Chy1BYTdn5mGJoDNjC7C64ug20ADsRDGrA85bN3uK3MaKbeRkRuuIEAR5N33Jr1pbm411/PA==", + "dev": true, "license": "Apache-2.0", "dependencies": { - "@eslint/object-schema": "^2.1.4", + "@eslint/object-schema": "^2.1.5", "debug": "^4.3.1", "minimatch": "^3.1.2" }, @@ -700,10 +698,14 @@ } }, "node_modules/@eslint/core": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.9.0.tgz", - "integrity": "sha512-7ATR9F0e4W85D/0w7cU0SNj7qkAexMG+bAHEZOjo9akvGuhHE2m7umzWzfnpa0XAg5Kxc1BWmtPMV67jJ+9VUg==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.10.0.tgz", + "integrity": "sha512-gFHJ+xBOo4G3WRlR1e/3G8A6/KZAH6zcE/hkLRCZTi/B9avAG365QhFA8uOGzTMqgTghpn7/fSnscW++dpMSAw==", + "dev": true, "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } @@ -712,6 +714,7 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.2.0.tgz", "integrity": "sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==", + "dev": true, "license": "MIT", "dependencies": { "ajv": "^6.12.4", @@ -735,12 +738,14 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, "license": "Python-2.0" }, "node_modules/@eslint/eslintrc/node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, "license": "MIT", "dependencies": { "argparse": "^2.0.1" @@ -750,28 +755,33 @@ } }, "node_modules/@eslint/js": { - "version": "9.17.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.17.0.tgz", - "integrity": "sha512-Sxc4hqcs1kTu0iID3kcZDW3JHq2a77HO9P8CP6YEA/FpH3Ll8UXE2r/86Rz9YJLKme39S9vU5OWNjC6Xl0Cr3w==", + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.18.0.tgz", + "integrity": "sha512-fK6L7rxcq6/z+AaQMtiFTkvbHkBLNlwyRxHpKawP0x3u9+NC6MQTnFW+AdpwC6gfHTW0051cokQgtTN2FqlxQA==", + "dev": true, + "license": "MIT", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@eslint/object-schema": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.4.tgz", - "integrity": "sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.5.tgz", + "integrity": "sha512-o0bhxnL89h5Bae5T318nFoFzGy+YE5i/gGkoPAgkmTVdRKTiv3p8JHevPiPaMwoloKfEiiaHlawCqaZMqRm+XQ==", + "dev": true, "license": "Apache-2.0", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@eslint/plugin-kit": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.3.tgz", - "integrity": "sha512-2b/g5hRmpbb1o4GnTZax9N9m0FXzz9OV42ZzI4rDDMDuHUqigAiQCEWChBWCY4ztAGVRjoWT19v0yMmc5/L5kA==", + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.5.tgz", + "integrity": "sha512-lB05FkqEdUg2AA0xEbUz0SnkXT1LcCTa438W4IWTUh4hdOnVbQyOJ81OrDXsJk/LSiJHubgGEFoR5EHq1NsH1A==", + "dev": true, "license": "Apache-2.0", "dependencies": { + "@eslint/core": "^0.10.0", "levn": "^0.4.1" }, "engines": { @@ -811,6 +821,7 @@ "version": "0.19.1", "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "dev": true, "license": "Apache-2.0", "engines": { "node": ">=18.18.0" @@ -820,6 +831,7 @@ "version": "0.16.6", "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", + "dev": true, "license": "Apache-2.0", "dependencies": { "@humanfs/core": "^0.19.1", @@ -833,6 +845,7 @@ "version": "0.3.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", + "dev": true, "license": "Apache-2.0", "engines": { "node": ">=18.18" @@ -846,6 +859,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, "engines": { "node": ">=12.22" }, @@ -858,6 +872,7 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.1.tgz", "integrity": "sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==", + "dev": true, "license": "Apache-2.0", "engines": { "node": ">=18.18" @@ -867,100 +882,16 @@ "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@isaacs/cliui": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", - "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", - "dev": true, - "dependencies": { - "string-width": "^5.1.2", - "string-width-cjs": "npm:string-width@^4.2.0", - "strip-ansi": "^7.0.1", - "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", - "wrap-ansi": "^8.1.0", - "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@isaacs/cliui/node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true - }, - "node_modules/@isaacs/cliui/node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@isaacs/cliui/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dev": true, + "node_modules/@improbable-eng/grpc-web": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/@improbable-eng/grpc-web/-/grpc-web-0.15.0.tgz", + "integrity": "sha512-ERft9/0/8CmYalqOVnJnpdDry28q+j+nAlFFARdjyxXDJ+Mhgv9+F600QC8BR9ygOfrXRlAk6CvST2j+JCpQPg==", + "license": "Apache-2.0", "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" + "browser-headers": "^0.4.1" }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + "peerDependencies": { + "google-protobuf": "^3.14.0" } }, "node_modules/@istanbuljs/load-nyc-config": { @@ -1424,6 +1355,8 @@ "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -1436,6 +1369,8 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "license": "MIT", "engines": { "node": ">= 8" } @@ -1444,6 +1379,8 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -1452,28 +1389,6 @@ "node": ">= 8" } }, - "node_modules/@pkgjs/parseargs": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", - "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", - "dev": true, - "optional": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/@pkgr/core": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz", - "integrity": "sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.18.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/unts" - } - }, "node_modules/@protobufjs/aspromise": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", @@ -1528,12 +1443,6 @@ "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" }, - "node_modules/@rtsao/scc": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", - "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==", - "dev": true - }, "node_modules/@sinclair/typebox": { "version": "0.27.8", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", @@ -1558,6 +1467,60 @@ "@sinonjs/commons": "^3.0.0" } }, + "node_modules/@trunkio/launcher": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@trunkio/launcher/-/launcher-1.3.4.tgz", + "integrity": "sha512-4LCsFVvZtKht7EkbOq5gDsRLIBOH05ycNxm1Vrv+YzY+uOK2HueLBcLU8oejV9v01LTtWjfLJxonIgTSo7lwng==", + "dev": true, + "license": "ISC", + "dependencies": { + "semver": "^7.5.4", + "tar": "^6.2.0", + "yaml": "^2.2.0" + }, + "bin": { + "trunk": "trunk.js" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", + "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true + }, "node_modules/@types/babel__core": { "version": "7.20.5", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", @@ -1608,6 +1571,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", + "dev": true, "license": "MIT" }, "node_modules/@types/google-protobuf": { @@ -1654,6 +1618,7 @@ "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.14.tgz", "integrity": "sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ==", "dev": true, + "license": "MIT", "dependencies": { "expect": "^29.0.0", "pretty-format": "^29.0.0" @@ -1663,14 +1628,9 @@ "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, "license": "MIT" }, - "node_modules/@types/json5": { - "version": "0.0.29", - "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", - "dev": true - }, "node_modules/@types/node": { "version": "22.10.5", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.5.tgz", @@ -1679,18 +1639,6 @@ "undici-types": "~6.20.0" } }, - "node_modules/@types/normalize-package-data": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz", - "integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==", - "dev": true - }, - "node_modules/@types/semver": { - "version": "7.5.8", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", - "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", - "license": "MIT" - }, "node_modules/@types/stack-utils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", @@ -1718,16 +1666,17 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.19.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.19.1.tgz", - "integrity": "sha512-tJzcVyvvb9h/PB96g30MpxACd9IrunT7GF9wfA9/0TJ1LxGOJx1TdPzSbBBnNED7K9Ka8ybJsnEpiXPktolTLg==", + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.20.0.tgz", + "integrity": "sha512-naduuphVw5StFfqp4Gq4WhIBE2gN1GEmMUExpJYknZJdRnc+2gDzB8Z3+5+/Kv33hPQRDGzQO/0opHE72lZZ6A==", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.19.1", - "@typescript-eslint/type-utils": "8.19.1", - "@typescript-eslint/utils": "8.19.1", - "@typescript-eslint/visitor-keys": "8.19.1", + "@typescript-eslint/scope-manager": "8.20.0", + "@typescript-eslint/type-utils": "8.20.0", + "@typescript-eslint/utils": "8.20.0", + "@typescript-eslint/visitor-keys": "8.20.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -1746,139 +1695,129 @@ "typescript": ">=4.8.4 <5.8.0" } }, - "node_modules/@typescript-eslint/eslint-plugin-tslint": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin-tslint/-/eslint-plugin-tslint-7.0.2.tgz", - "integrity": "sha512-Os20XlgmnXPlfqcvO5I6asARarEXZ/BQ2WEHaphfN+d8CUq8H3lGM2ep3SGcwaF1PXpAxfNBDN8U4EYhliFfSQ==", + "node_modules/@typescript-eslint/parser": { + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.20.0.tgz", + "integrity": "sha512-gKXG7A5HMyjDIedBi6bUrDcun8GIjnI8qOwVLiY3rx6T/sHP/19XLJOnIq/FgQvWLHja5JN/LSE7eklNBr612g==", + "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/utils": "7.0.2" + "@typescript-eslint/scope-manager": "8.20.0", + "@typescript-eslint/types": "8.20.0", + "@typescript-eslint/typescript-estree": "8.20.0", + "@typescript-eslint/visitor-keys": "8.20.0", + "debug": "^4.3.4" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.56.0", - "tslint": "^5.0.0 || ^6.0.0", - "typescript": "*" + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, - "node_modules/@typescript-eslint/eslint-plugin-tslint/node_modules/@typescript-eslint/scope-manager": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.0.2.tgz", - "integrity": "sha512-l6sa2jF3h+qgN2qUMjVR3uCNGjWw4ahGfzIYsCtFrQJCjhbrDPdiihYT8FnnqFwsWX+20hK592yX9I2rxKTP4g==", + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.20.0.tgz", + "integrity": "sha512-J7+VkpeGzhOt3FeG1+SzhiMj9NzGD/M6KoGn9f4dbz3YzK9hvbhVTmLj/HiTp9DazIzJ8B4XcM80LrR9Dm1rJw==", + "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "7.0.2", - "@typescript-eslint/visitor-keys": "7.0.2" + "@typescript-eslint/types": "8.20.0", + "@typescript-eslint/visitor-keys": "8.20.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/eslint-plugin-tslint/node_modules/@typescript-eslint/types": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.0.2.tgz", - "integrity": "sha512-ZzcCQHj4JaXFjdOql6adYV4B/oFOFjPOC9XYwCaZFRvqN8Llfvv4gSxrkQkd2u4Ci62i2c6W6gkDwQJDaRc4nA==", + "node_modules/@typescript-eslint/type-utils": { + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.20.0.tgz", + "integrity": "sha512-bPC+j71GGvA7rVNAHAtOjbVXbLN5PkwqMvy1cwGeaxUoRQXVuKCebRoLzm+IPW/NtFFpstn1ummSIasD5t60GA==", + "dev": true, "license": "MIT", - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/eslint-plugin-tslint/node_modules/@typescript-eslint/typescript-estree": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.0.2.tgz", - "integrity": "sha512-3AMc8khTcELFWcKcPc0xiLviEvvfzATpdPj/DXuOGIdQIIFybf4DMT1vKRbuAEOFMwhWt7NFLXRkbjsvKZQyvw==", - "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/types": "7.0.2", - "@typescript-eslint/visitor-keys": "7.0.2", + "@typescript-eslint/typescript-estree": "8.20.0", + "@typescript-eslint/utils": "8.20.0", "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "minimatch": "9.0.3", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" + "ts-api-utils": "^2.0.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, - "node_modules/@typescript-eslint/eslint-plugin-tslint/node_modules/@typescript-eslint/utils": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.0.2.tgz", - "integrity": "sha512-PZPIONBIB/X684bhT1XlrkjNZJIEevwkKDsdwfiu1WeqBxYEEdIgVDgm8/bbKHVu+6YOpeRqcfImTdImx/4Bsw==", + "node_modules/@typescript-eslint/types": { + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.20.0.tgz", + "integrity": "sha512-cqaMiY72CkP+2xZRrFt3ExRBu0WmVitN/rYPZErA80mHjHx/Svgp8yfbzkJmDoQ/whcytOPO9/IZXnOc+wigRA==", + "dev": true, "license": "MIT", - "dependencies": { - "@eslint-community/eslint-utils": "^4.4.0", - "@types/json-schema": "^7.0.12", - "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "7.0.2", - "@typescript-eslint/types": "7.0.2", - "@typescript-eslint/typescript-estree": "7.0.2", - "semver": "^7.5.4" - }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.56.0" } }, - "node_modules/@typescript-eslint/eslint-plugin-tslint/node_modules/@typescript-eslint/visitor-keys": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.0.2.tgz", - "integrity": "sha512-8Y+YiBmqPighbm5xA2k4wKTxRzx9EkBu7Rlw+WHqMvRJ3RPz/BMBO9b2ru0LUNmXg120PHUXD5+SWFy2R8DqlQ==", + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.20.0.tgz", + "integrity": "sha512-Y7ncuy78bJqHI35NwzWol8E0X7XkRVS4K4P4TCyzWkOJih5NDvtoRDW4Ba9YJJoB2igm9yXDdYI/+fkiiAxPzA==", + "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "7.0.2", - "eslint-visitor-keys": "^3.4.1" + "@typescript-eslint/types": "8.20.0", + "@typescript-eslint/visitor-keys": "8.20.0", + "debug": "^4.3.4", + "fast-glob": "^3.3.2", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^2.0.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <5.8.0" } }, - "node_modules/@typescript-eslint/eslint-plugin-tslint/node_modules/brace-expansion": { + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } }, - "node_modules/@typescript-eslint/eslint-plugin-tslint/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" @@ -1890,29 +1829,17 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/ts-api-utils": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.0.0.tgz", - "integrity": "sha512-xCt/TOAc+EOHS1XPnijD3/yzpH6qg2xppZO1YDqGoVsNXfQfzHpOdNuXwrwOU8u4ITXJyDCTyt8w5g1sZv9ynQ==", - "dev": true, - "engines": { - "node": ">=18.12" - }, - "peerDependencies": { - "typescript": ">=4.8.4" - } - }, - "node_modules/@typescript-eslint/parser": { - "version": "8.19.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.19.1.tgz", - "integrity": "sha512-67gbfv8rAwawjYx3fYArwldTQKoYfezNUT4D5ioWetr/xCrxXxvleo3uuiFuKfejipvq+og7mjz3b0G2bVyUCw==", + "node_modules/@typescript-eslint/utils": { + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.20.0.tgz", + "integrity": "sha512-dq70RUw6UK9ei7vxc4KQtBRk7qkHZv447OUZ6RPQMQl71I3NZxQJX/f32Smr+iqWrB02pHKn2yAdHBb0KNrRMA==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.19.1", - "@typescript-eslint/types": "8.19.1", - "@typescript-eslint/typescript-estree": "8.19.1", - "@typescript-eslint/visitor-keys": "8.19.1", - "debug": "^4.3.4" + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "8.20.0", + "@typescript-eslint/types": "8.20.0", + "@typescript-eslint/typescript-estree": "8.20.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1926,14 +1853,15 @@ "typescript": ">=4.8.4 <5.8.0" } }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "8.19.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.19.1.tgz", - "integrity": "sha512-60L9KIuN/xgmsINzonOcMDSB8p82h95hoBfSBtXuO4jlR1R9L1xSkmVZKgCPVfavDlXihh4ARNjXhh1gGnLC7Q==", + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.20.0.tgz", + "integrity": "sha512-v/BpkeeYAsPkKCkR8BDwcno0llhzWVqPOamQrAEMdpZav2Y9OVjd9dwJyBLJWwf335B5DmlifECIkZRJCaGaHA==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.19.1", - "@typescript-eslint/visitor-keys": "8.19.1" + "@typescript-eslint/types": "8.20.0", + "eslint-visitor-keys": "^4.2.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1943,161 +1871,12 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/type-utils": { - "version": "8.19.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.19.1.tgz", - "integrity": "sha512-Rp7k9lhDKBMRJB/nM9Ksp1zs4796wVNyihG9/TU9R6KCJDNkQbc2EOKjrBtLYh3396ZdpXLtr/MkaSEmNMtykw==", - "dev": true, - "dependencies": { - "@typescript-eslint/typescript-estree": "8.19.1", - "@typescript-eslint/utils": "8.19.1", - "debug": "^4.3.4", - "ts-api-utils": "^2.0.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <5.8.0" - } - }, - "node_modules/@typescript-eslint/type-utils/node_modules/ts-api-utils": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.0.0.tgz", - "integrity": "sha512-xCt/TOAc+EOHS1XPnijD3/yzpH6qg2xppZO1YDqGoVsNXfQfzHpOdNuXwrwOU8u4ITXJyDCTyt8w5g1sZv9ynQ==", - "dev": true, - "engines": { - "node": ">=18.12" - }, - "peerDependencies": { - "typescript": ">=4.8.4" - } - }, - "node_modules/@typescript-eslint/types": { - "version": "8.19.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.19.1.tgz", - "integrity": "sha512-JBVHMLj7B1K1v1051ZaMMgLW4Q/jre5qGK0Ew6UgXz1Rqh+/xPzV1aW581OM00X6iOfyr1be+QyW8LOUf19BbA==", - "dev": true, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.19.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.19.1.tgz", - "integrity": "sha512-jk/TZwSMJlxlNnqhy0Eod1PNEvCkpY6MXOXE/WLlblZ6ibb32i2We4uByoKPv1d0OD2xebDv4hbs3fm11SMw8Q==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "8.19.1", - "@typescript-eslint/visitor-keys": "8.19.1", - "debug": "^4.3.4", - "fast-glob": "^3.3.2", - "is-glob": "^4.0.3", - "minimatch": "^9.0.4", - "semver": "^7.6.0", - "ts-api-utils": "^2.0.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "typescript": ">=4.8.4 <5.8.0" - } - }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/ts-api-utils": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.0.0.tgz", - "integrity": "sha512-xCt/TOAc+EOHS1XPnijD3/yzpH6qg2xppZO1YDqGoVsNXfQfzHpOdNuXwrwOU8u4ITXJyDCTyt8w5g1sZv9ynQ==", - "dev": true, - "engines": { - "node": ">=18.12" - }, - "peerDependencies": { - "typescript": ">=4.8.4" - } - }, - "node_modules/@typescript-eslint/utils": { - "version": "8.19.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.19.1.tgz", - "integrity": "sha512-IxG5gLO0Ne+KaUc8iW1A+XuKLd63o4wlbI1Zp692n1xojCl/THvgIKXJXBZixTh5dd5+yTJ/VXH7GJaaw21qXA==", - "dev": true, - "dependencies": { - "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.19.1", - "@typescript-eslint/types": "8.19.1", - "@typescript-eslint/typescript-estree": "8.19.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <5.8.0" - } - }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.19.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.19.1.tgz", - "integrity": "sha512-fzmjU8CHK853V/avYZAvuVut3ZTfwN5YtMaoi+X9Y9MA9keaWNHC3zEQ9zvyX/7Hj+5JkNyK1l7TOR2hevHB6Q==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "8.19.1", - "eslint-visitor-keys": "^4.2.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", - "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", "dev": true, + "license": "Apache-2.0", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, @@ -2115,6 +1894,7 @@ "version": "8.14.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "dev": true, "license": "MIT", "bin": { "acorn": "bin/acorn" @@ -2127,10 +1907,26 @@ "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, + "node_modules/acorn-walk": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", + "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "acorn": "^8.11.0" + }, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -2147,6 +1943,7 @@ "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", @@ -2228,15 +2025,6 @@ "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", "dev": true }, - "node_modules/are-docs-informative": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/are-docs-informative/-/are-docs-informative-0.0.2.tgz", - "integrity": "sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==", - "dev": true, - "engines": { - "node": ">=14" - } - }, "node_modules/are-we-there-yet": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", @@ -2251,337 +2039,142 @@ "node": ">=10" } }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true + }, "node_modules/argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, "dependencies": { "sprintf-js": "~1.0.2" } }, - "node_modules/aria-query": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.2.tgz", - "integrity": "sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==", + "node_modules/async": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", "dev": true, - "engines": { - "node": ">= 0.4" - } + "license": "MIT" }, - "node_modules/array-buffer-byte-length": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", - "integrity": "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==", + "node_modules/babel-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", + "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", "dev": true, "dependencies": { - "call-bound": "^1.0.3", - "is-array-buffer": "^3.0.5" + "@jest/transform": "^29.7.0", + "@types/babel__core": "^7.1.14", + "babel-plugin-istanbul": "^6.1.1", + "babel-preset-jest": "^29.6.3", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "slash": "^3.0.0" }, "engines": { - "node": ">= 0.4" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "peerDependencies": { + "@babel/core": "^7.8.0" } }, - "node_modules/array-includes": { - "version": "3.1.8", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.8.tgz", - "integrity": "sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==", + "node_modules/babel-plugin-istanbul": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", + "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", "dev": true, "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.2", - "es-object-atoms": "^1.0.0", - "get-intrinsic": "^1.2.4", - "is-string": "^1.0.7" - }, - "engines": { - "node": ">= 0.4" + "@babel/helper-plugin-utils": "^7.0.0", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-instrument": "^5.0.4", + "test-exclude": "^6.0.0" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "license": "MIT", "engines": { "node": ">=8" } }, - "node_modules/array.prototype.findlast": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/array.prototype.findlast/-/array.prototype.findlast-1.2.5.tgz", - "integrity": "sha512-CVvd6FHg1Z3POpBLxO6E6zr+rSKEQ9L6rZHAaY7lLfhKsWYUBBOuMs0e9o24oopj6H+geRCX0YJ+TJLBK2eHyQ==", + "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", + "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", "dev": true, "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.2", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0", - "es-shim-unscopables": "^1.0.2" + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=8" } }, - "node_modules/array.prototype.findlastindex": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz", - "integrity": "sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==", + "node_modules/babel-plugin-istanbul/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/babel-plugin-jest-hoist": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", + "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", "dev": true, "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.2", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0", - "es-shim-unscopables": "^1.0.2" + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__core": "^7.1.14", + "@types/babel__traverse": "^7.0.6" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/array.prototype.flat": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", - "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==", + "node_modules/babel-preset-current-node-syntax": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", + "integrity": "sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "es-shim-unscopables": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-bigint": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.8.3", + "@babel/plugin-syntax-import-meta": "^7.8.3", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.8.3", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-top-level-await": "^7.8.3" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "peerDependencies": { + "@babel/core": "^7.0.0" } }, - "node_modules/array.prototype.flatmap": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.3.tgz", - "integrity": "sha512-Y7Wt51eKJSyi80hFrJCePGGNo5ktJCslFuboqJsbf57CCPcm5zztluPlc4/aD8sWsKvlwatezpV4U1efk8kpjg==", + "node_modules/babel-preset-jest": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", + "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", "dev": true, "dependencies": { - "call-bind": "^1.0.8", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.5", - "es-shim-unscopables": "^1.0.2" + "babel-plugin-jest-hoist": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.tosorted": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/array.prototype.tosorted/-/array.prototype.tosorted-1.1.4.tgz", - "integrity": "sha512-p6Fx8B7b7ZhL/gmUsAy0D15WhvDccw3mnGNbZpi3pmeJdxtWsj2jEaI4Y6oo3XiHfzuSgPwKc04MYt6KgvC/wA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.3", - "es-errors": "^1.3.0", - "es-shim-unscopables": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/arraybuffer.prototype.slice": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.4.tgz", - "integrity": "sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==", - "dev": true, - "dependencies": { - "array-buffer-byte-length": "^1.0.1", - "call-bind": "^1.0.8", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.5", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.6", - "is-array-buffer": "^3.0.4" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/ast-types-flow": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.8.tgz", - "integrity": "sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ==", - "dev": true - }, - "node_modules/async": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz", - "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==", - "dev": true - }, - "node_modules/available-typed-arrays": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", - "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", - "dev": true, - "dependencies": { - "possible-typed-array-names": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/axe-core": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.10.0.tgz", - "integrity": "sha512-Mr2ZakwQ7XUAjp7pAwQWRhhK8mQQ6JAaNWSjmjxil0R8BPioMtQsTLOolGYkji1rcL++3dCqZA3zWqpT+9Ew6g==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/axobject-query": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz", - "integrity": "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/babel-jest": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", - "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", - "dev": true, - "dependencies": { - "@jest/transform": "^29.7.0", - "@types/babel__core": "^7.1.14", - "babel-plugin-istanbul": "^6.1.1", - "babel-preset-jest": "^29.6.3", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "slash": "^3.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "@babel/core": "^7.8.0" - } - }, - "node_modules/babel-plugin-istanbul": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", - "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@istanbuljs/load-nyc-config": "^1.0.0", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-instrument": "^5.0.4", - "test-exclude": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", - "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", - "dev": true, - "dependencies": { - "@babel/core": "^7.12.3", - "@babel/parser": "^7.14.7", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-coverage": "^3.2.0", - "semver": "^6.3.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/babel-plugin-istanbul/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/babel-plugin-jest-hoist": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", - "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", - "dev": true, - "dependencies": { - "@babel/template": "^7.3.3", - "@babel/types": "^7.3.3", - "@types/babel__core": "^7.1.14", - "@types/babel__traverse": "^7.0.6" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/babel-preset-current-node-syntax": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", - "integrity": "sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==", - "dev": true, - "dependencies": { - "@babel/plugin-syntax-async-generators": "^7.8.4", - "@babel/plugin-syntax-bigint": "^7.8.3", - "@babel/plugin-syntax-class-properties": "^7.8.3", - "@babel/plugin-syntax-import-meta": "^7.8.3", - "@babel/plugin-syntax-json-strings": "^7.8.3", - "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", - "@babel/plugin-syntax-numeric-separator": "^7.8.3", - "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", - "@babel/plugin-syntax-optional-chaining": "^7.8.3", - "@babel/plugin-syntax-top-level-await": "^7.8.3" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/babel-preset-jest": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", - "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", - "dev": true, - "dependencies": { - "babel-plugin-jest-hoist": "^29.6.3", - "babel-preset-current-node-syntax": "^1.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" }, "peerDependencies": { "@babel/core": "^7.0.0" @@ -2590,12 +2183,14 @@ "node_modules/balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha512-9Y0g0Q8rmSt+H33DfKv7FOc3v+iRI+o1lbzt8jGcIosYW37IIW/2XVYq5NPdmaD5NQ59Nk26Kl/vZbwW9Fr8vg==" + "integrity": "sha512-9Y0g0Q8rmSt+H33DfKv7FOc3v+iRI+o1lbzt8jGcIosYW37IIW/2XVYq5NPdmaD5NQ59Nk26Kl/vZbwW9Fr8vg==", + "dev": true }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2605,6 +2200,7 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, "dependencies": { "fill-range": "^7.1.1" }, @@ -2612,6 +2208,12 @@ "node": ">=8" } }, + "node_modules/browser-headers": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/browser-headers/-/browser-headers-0.4.1.tgz", + "integrity": "sha512-CA9hsySZVo9371qEHjHZtYxV2cFtVj5Wj/ZHi8ooEsrtm4vOnl9Y9HmyYWk9q+05d7K3rdoAE0j3MVEFVvtQtg==", + "license": "Apache-2.0" + }, "node_modules/browserslist": { "version": "4.24.0", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.0.tgz", @@ -2649,6 +2251,7 @@ "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==", "dev": true, + "license": "MIT", "dependencies": { "fast-json-stable-stringify": "2.x" }, @@ -2671,69 +2274,11 @@ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, - "node_modules/builtin-modules": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", - "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", - "dev": true, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/call-bind": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", - "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", - "dev": true, - "dependencies": { - "call-bind-apply-helpers": "^1.0.0", - "es-define-property": "^1.0.0", - "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/call-bind-apply-helpers": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", - "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", - "dev": true, - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/call-bound": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz", - "integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==", - "dev": true, - "dependencies": { - "call-bind-apply-helpers": "^1.0.1", - "get-intrinsic": "^1.2.6" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, "engines": { "node": ">=6" } @@ -2771,6 +2316,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -2821,18 +2367,6 @@ "integrity": "sha512-a3KdPAANPbNE4ZUv9h6LckSl9zLsYOP4MBmhIPkRaeyybt+r4UghLvq+xw/YwUcC1gqylCkL4rdVs3Lwupjm4Q==", "dev": true }, - "node_modules/clean-regexp": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/clean-regexp/-/clean-regexp-1.0.0.tgz", - "integrity": "sha512-GfisEZEJvzKrmGWkvfhgzcz/BllN1USeqD2V6tg14OAOgaCD2Z/PUEuxnAZ/nPvmaHRG7a8y77p1T/IRQ4D1Hw==", - "dev": true, - "dependencies": { - "escape-string-regexp": "^1.0.5" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/cliui": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", @@ -2887,24 +2421,11 @@ "color-support": "bin.js" } }, - "node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" - }, - "node_modules/comment-parser": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.1.tgz", - "integrity": "sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==", - "dev": true, - "engines": { - "node": ">= 12.0.0" - } - }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true }, "node_modules/console-control-strings": { "version": "1.1.0", @@ -2918,19 +2439,6 @@ "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", "dev": true }, - "node_modules/core-js-compat": { - "version": "3.38.1", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.38.1.tgz", - "integrity": "sha512-JRH6gfXxGmrzF3tZ57lFx97YARxCXPaMzPo6jELZhv88pBH5VXpQ+y0znKGlFnzuaihqhLbefxSJxWJMPtfDzw==", - "dev": true, - "dependencies": { - "browserslist": "^4.23.3" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/core-js" - } - }, "node_modules/create-jest": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", @@ -2952,10 +2460,20 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true + }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -2965,77 +2483,21 @@ "node": ">= 8" } }, - "node_modules/damerau-levenshtein": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz", - "integrity": "sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==", - "dev": true - }, - "node_modules/data-view-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz", - "integrity": "sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==", + "node_modules/debug": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", "dev": true, "dependencies": { - "call-bound": "^1.0.3", - "es-errors": "^1.3.0", - "is-data-view": "^1.0.2" + "ms": "2.1.2" }, "engines": { - "node": ">= 0.4" + "node": ">=6.0" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/data-view-byte-length": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz", - "integrity": "sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==", - "dev": true, - "dependencies": { - "call-bound": "^1.0.3", - "es-errors": "^1.3.0", - "is-data-view": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/inspect-js" - } - }, - "node_modules/data-view-byte-offset": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.1.tgz", - "integrity": "sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==", - "dev": true, - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "is-data-view": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/debug": { - "version": "4.3.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", - "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, "node_modules/dedent": { @@ -3055,7 +2517,8 @@ "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true }, "node_modules/deepmerge": { "version": "4.3.1", @@ -3066,40 +2529,6 @@ "node": ">=0.10.0" } }, - "node_modules/define-data-property": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", - "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "dev": true, - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/define-properties": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", - "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", - "dev": true, - "dependencies": { - "define-data-property": "^1.0.1", - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/delegates": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", @@ -3124,22 +2553,14 @@ "node": ">=8" } }, - "node_modules/dgraph-js": { - "version": "21.3.1", - "resolved": "https://registry.npmjs.org/dgraph-js/-/dgraph-js-21.3.1.tgz", - "integrity": "sha512-GyOOlhMXwKIVG3s9BD8Gz5UU5LCZJt2T8cEDKv3bo9wPWU+kjFHf5gXQZSPEAbaIiMG9UGk9VZkIIjY89a5uuA==", - "dependencies": { - "@grpc/grpc-js": "^1.2.5", - "@types/url-parse": "^1.4.3", - "google-protobuf": "^3.14.0", - "is-base64": "^1.1.0", - "url-parse": "^1.4.7" - } - }, "node_modules/diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "license": "BSD-3-Clause", + "optional": true, + "peer": true, "engines": { "node": ">=0.3.1" } @@ -3153,43 +2574,12 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "license": "MIT", - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/dunder-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", - "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", - "dev": true, - "dependencies": { - "call-bind-apply-helpers": "^1.0.1", - "es-errors": "^1.3.0", - "gopd": "^1.2.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true - }, "node_modules/ejs": { "version": "3.1.10", "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", "dev": true, + "license": "Apache-2.0", "dependencies": { "jake": "^10.8.5" }, @@ -3232,170 +2622,6 @@ "is-arrayish": "^0.2.1" } }, - "node_modules/es-abstract": { - "version": "1.23.7", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.7.tgz", - "integrity": "sha512-OygGC8kIcDhXX+6yAZRGLqwi2CmEXCbLQixeGUgYeR+Qwlppqmo7DIDr8XibtEBZp+fJcoYpoatp5qwLMEdcqQ==", - "dev": true, - "dependencies": { - "array-buffer-byte-length": "^1.0.2", - "arraybuffer.prototype.slice": "^1.0.4", - "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.8", - "call-bound": "^1.0.3", - "data-view-buffer": "^1.0.2", - "data-view-byte-length": "^1.0.2", - "data-view-byte-offset": "^1.0.1", - "es-define-property": "^1.0.1", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0", - "es-set-tostringtag": "^2.0.3", - "es-to-primitive": "^1.3.0", - "function.prototype.name": "^1.1.8", - "get-intrinsic": "^1.2.6", - "get-symbol-description": "^1.1.0", - "globalthis": "^1.0.4", - "gopd": "^1.2.0", - "has-property-descriptors": "^1.0.2", - "has-proto": "^1.2.0", - "has-symbols": "^1.1.0", - "hasown": "^2.0.2", - "internal-slot": "^1.1.0", - "is-array-buffer": "^3.0.5", - "is-callable": "^1.2.7", - "is-data-view": "^1.0.2", - "is-regex": "^1.2.1", - "is-shared-array-buffer": "^1.0.4", - "is-string": "^1.1.1", - "is-typed-array": "^1.1.15", - "is-weakref": "^1.1.0", - "math-intrinsics": "^1.1.0", - "object-inspect": "^1.13.3", - "object-keys": "^1.1.1", - "object.assign": "^4.1.7", - "regexp.prototype.flags": "^1.5.3", - "safe-array-concat": "^1.1.3", - "safe-regex-test": "^1.1.0", - "string.prototype.trim": "^1.2.10", - "string.prototype.trimend": "^1.0.9", - "string.prototype.trimstart": "^1.0.8", - "typed-array-buffer": "^1.0.3", - "typed-array-byte-length": "^1.0.3", - "typed-array-byte-offset": "^1.0.4", - "typed-array-length": "^1.0.7", - "unbox-primitive": "^1.1.0", - "which-typed-array": "^1.1.18" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/es-define-property": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", - "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-iterator-helpers": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-iterator-helpers/-/es-iterator-helpers-1.2.1.tgz", - "integrity": "sha512-uDn+FE1yrDzyC0pCo961B2IHbdM8y/ACZsKD4dG6WqrjV53BADjwa7D+1aom2rsNVfLyDgU/eigvlJGJ08OQ4w==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.3", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.6", - "es-errors": "^1.3.0", - "es-set-tostringtag": "^2.0.3", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.6", - "globalthis": "^1.0.4", - "gopd": "^1.2.0", - "has-property-descriptors": "^1.0.2", - "has-proto": "^1.2.0", - "has-symbols": "^1.1.0", - "internal-slot": "^1.1.0", - "iterator.prototype": "^1.1.4", - "safe-array-concat": "^1.1.3" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-module-lexer": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.4.tgz", - "integrity": "sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==", - "dev": true - }, - "node_modules/es-object-atoms": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", - "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", - "dev": true, - "dependencies": { - "es-errors": "^1.3.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-set-tostringtag": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", - "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", - "dev": true, - "dependencies": { - "get-intrinsic": "^1.2.4", - "has-tostringtag": "^1.0.2", - "hasown": "^2.0.1" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-shim-unscopables": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz", - "integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==", - "dev": true, - "dependencies": { - "hasown": "^2.0.0" - } - }, - "node_modules/es-to-primitive": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.3.0.tgz", - "integrity": "sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==", - "dev": true, - "dependencies": { - "is-callable": "^1.2.7", - "is-date-object": "^1.0.5", - "is-symbol": "^1.0.4" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/escalade": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", @@ -3408,22 +2634,25 @@ "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/eslint": { - "version": "9.17.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.17.0.tgz", - "integrity": "sha512-evtlNcpJg+cZLcnVKwsai8fExnqjGPicK7gnUtlNuzu+Fv9bI0aLpND5T44VLQtoMEnI57LoXO9XAkIXwohKrA==", + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.18.0.tgz", + "integrity": "sha512-+waTfRWQlSbpt3KWE+CjrPPYnbq9kfZIYUqapc0uBXyjTp8aYXZDsUH16m39Ryq3NjAVP4tjuF7KaukeqoCoaA==", + "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.12.1", "@eslint/config-array": "^0.19.0", - "@eslint/core": "^0.9.0", + "@eslint/core": "^0.10.0", "@eslint/eslintrc": "^3.2.0", - "@eslint/js": "9.17.0", - "@eslint/plugin-kit": "^0.2.3", + "@eslint/js": "9.18.0", + "@eslint/plugin-kit": "^0.2.5", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.1", @@ -3470,1681 +2699,701 @@ } } }, - "node_modules/eslint-import-resolver-node": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", - "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", + "node_modules/eslint-scope": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz", + "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "debug": "^3.2.7", - "is-core-module": "^2.13.0", - "resolve": "^1.22.4" + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint-import-resolver-node/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true, - "dependencies": { - "ms": "^2.1.1" + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint-module-utils": { - "version": "2.12.0", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.12.0.tgz", - "integrity": "sha512-wALZ0HFoytlyh/1+4wuZ9FJCD/leWHQzzrxJ8+rebyReSLk7LApMyd3WJaLVoN+D5+WIdJyDK1c6JnE65V4Zyg==", + "node_modules/eslint/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, - "dependencies": { - "debug": "^3.2.7" - }, "engines": { - "node": ">=4" + "node": ">=10" }, - "peerDependenciesMeta": { - "eslint": { - "optional": true - } + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint-module-utils/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "node_modules/eslint/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", "dev": true, - "dependencies": { - "ms": "^2.1.1" + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint-plugin-import": { - "version": "2.31.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.31.0.tgz", - "integrity": "sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==", + "node_modules/espree": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", + "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "@rtsao/scc": "^1.1.0", - "array-includes": "^3.1.8", - "array.prototype.findlastindex": "^1.2.5", - "array.prototype.flat": "^1.3.2", - "array.prototype.flatmap": "^1.3.2", - "debug": "^3.2.7", - "doctrine": "^2.1.0", - "eslint-import-resolver-node": "^0.3.9", - "eslint-module-utils": "^2.12.0", - "hasown": "^2.0.2", - "is-core-module": "^2.15.1", - "is-glob": "^4.0.3", - "minimatch": "^3.1.2", - "object.fromentries": "^2.0.8", - "object.groupby": "^1.0.3", - "object.values": "^1.2.0", - "semver": "^6.3.1", - "string.prototype.trimend": "^1.0.8", - "tsconfig-paths": "^3.15.0" + "acorn": "^8.14.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.0" }, "engines": { - "node": ">=4" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, - "peerDependencies": { - "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9" + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint-plugin-import/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "node_modules/espree/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", "dev": true, - "dependencies": { - "ms": "^2.1.1" + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint-plugin-import/node_modules/doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true, - "dependencies": { - "esutils": "^2.0.2" + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" }, "engines": { - "node": ">=0.10.0" + "node": ">=4" } }, - "node_modules/eslint-plugin-import/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "node_modules/esquery": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", "dev": true, - "bin": { - "semver": "bin/semver.js" + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" } }, - "node_modules/eslint-plugin-jest": { - "version": "28.10.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-28.10.0.tgz", - "integrity": "sha512-hyMWUxkBH99HpXT3p8hc7REbEZK3D+nk8vHXGgpB+XXsi0gO4PxMSP+pjfUzb67GnV9yawV9a53eUmcde1CCZA==", + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/utils": "^6.0.0 || ^7.0.0 || ^8.0.0" + "estraverse": "^5.2.0" }, "engines": { - "node": "^16.10.0 || ^18.12.0 || >=20.0.0" - }, - "peerDependencies": { - "@typescript-eslint/eslint-plugin": "^6.0.0 || ^7.0.0 || ^8.0.0", - "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0", - "jest": "*" - }, - "peerDependenciesMeta": { - "@typescript-eslint/eslint-plugin": { - "optional": true - }, - "jest": { - "optional": true - } + "node": ">=4.0" } }, - "node_modules/eslint-plugin-jsdoc": { - "version": "50.6.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-50.6.1.tgz", - "integrity": "sha512-UWyaYi6iURdSfdVVqvfOs2vdCVz0J40O/z/HTsv2sFjdjmdlUI/qlKLOTmwbPQ2tAfQnE5F9vqx+B+poF71DBQ==", + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@es-joy/jsdoccomment": "~0.49.0", - "are-docs-informative": "^0.0.2", - "comment-parser": "1.4.1", - "debug": "^4.3.6", - "escape-string-regexp": "^4.0.0", - "espree": "^10.1.0", - "esquery": "^1.6.0", - "parse-imports": "^2.1.1", - "semver": "^7.6.3", - "spdx-expression-parse": "^4.0.0", - "synckit": "^0.9.1" - }, "engines": { - "node": ">=18" - }, - "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0" + "node": ">=4.0" } }, - "node_modules/eslint-plugin-jsdoc/node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, "engines": { "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", + "dev": true, + "engines": { + "node": ">= 0.8.0" } }, - "node_modules/eslint-plugin-jsx-a11y": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.10.2.tgz", - "integrity": "sha512-scB3nz4WmG75pV8+3eRUQOHZlNSUhFNq37xnpgRkCCELU3XMvXAxLk1eqWWyE22Ki4Q01Fnsw9BA3cJHDPgn2Q==", + "node_modules/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", "dev": true, "dependencies": { - "aria-query": "^5.3.2", - "array-includes": "^3.1.8", - "array.prototype.flatmap": "^1.3.2", - "ast-types-flow": "^0.0.8", - "axe-core": "^4.10.0", - "axobject-query": "^4.1.0", - "damerau-levenshtein": "^1.0.8", - "emoji-regex": "^9.2.2", - "hasown": "^2.0.2", - "jsx-ast-utils": "^3.3.5", - "language-tags": "^1.0.9", - "minimatch": "^3.1.2", - "object.fromentries": "^2.0.8", - "safe-regex-test": "^1.0.3", - "string.prototype.includes": "^2.0.1" + "@jest/expect-utils": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0" }, "engines": { - "node": ">=4.0" - }, - "peerDependencies": { - "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/eslint-plugin-jsx-a11y/node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" }, - "node_modules/eslint-plugin-lodash": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-lodash/-/eslint-plugin-lodash-8.0.0.tgz", - "integrity": "sha512-7DA8485FolmWRzh+8t4S8Pzin2TTuWfb0ZW3j/2fYElgk82ZanFz8vDcvc4BBPceYdX1p/za+tkbO68maDBGGw==", + "node_modules/fast-glob": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "dev": true, "license": "MIT", "dependencies": { - "lodash": "^4.17.21" + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.8" }, "engines": { - "node": ">=10" - }, - "peerDependencies": { - "eslint": ">=9.0.0" + "node": ">=8.6.0" } }, - "node_modules/eslint-plugin-no-null": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-no-null/-/eslint-plugin-no-null-1.0.2.tgz", - "integrity": "sha512-uRDiz88zCO/2rzGfgG15DBjNsgwWtWiSo4Ezy7zzajUgpnFIqd1TjepKeRmJZHEfBGu58o2a8S0D7vglvvhkVA==", + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, - "engines": { - "node": ">=5.0.0" + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" }, - "peerDependencies": { - "eslint": ">=3.0.0" + "engines": { + "node": ">= 6" } }, - "node_modules/eslint-plugin-prefer-arrow": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-prefer-arrow/-/eslint-plugin-prefer-arrow-1.2.3.tgz", - "integrity": "sha512-J9I5PKCOJretVuiZRGvPQxCbllxGAV/viI20JO3LYblAodofBxyMnZAJ+WGeClHgANnSJberTNoFWWjrWKBuXQ==", + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "node_modules/fastq": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.18.0.tgz", + "integrity": "sha512-QKHXPW0hD8g4UET03SdOdunzSouc9N4AuHdsX8XNcTsuz+yYFILVNIX4l9yHABMhiEI9Db0JTTIpu0wB+Y1QQw==", "dev": true, - "peerDependencies": { - "eslint": ">=2.0.0" + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" } }, - "node_modules/eslint-plugin-react": { - "version": "7.37.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.37.3.tgz", - "integrity": "sha512-DomWuTQPFYZwF/7c9W2fkKkStqZmBd3uugfqBYLdkZ3Hii23WzZuOLUskGxB8qkSKqftxEeGL1TB2kMhrce0jA==", + "node_modules/fb-watchman": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", + "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", "dev": true, "dependencies": { - "array-includes": "^3.1.8", - "array.prototype.findlast": "^1.2.5", - "array.prototype.flatmap": "^1.3.3", - "array.prototype.tosorted": "^1.1.4", - "doctrine": "^2.1.0", - "es-iterator-helpers": "^1.2.1", - "estraverse": "^5.3.0", - "hasown": "^2.0.2", - "jsx-ast-utils": "^2.4.1 || ^3.0.0", - "minimatch": "^3.1.2", - "object.entries": "^1.1.8", - "object.fromentries": "^2.0.8", - "object.values": "^1.2.1", - "prop-types": "^15.8.1", - "resolve": "^2.0.0-next.5", - "semver": "^6.3.1", - "string.prototype.matchall": "^4.0.12", - "string.prototype.repeat": "^1.0.0" - }, - "engines": { - "node": ">=4" - }, - "peerDependencies": { - "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7" + "bser": "2.1.1" } }, - "node_modules/eslint-plugin-react/node_modules/doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "node_modules/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", "dev": true, + "license": "MIT", "dependencies": { - "esutils": "^2.0.2" + "flat-cache": "^4.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=16.0.0" } }, - "node_modules/eslint-plugin-react/node_modules/resolve": { - "version": "2.0.0-next.5", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.5.tgz", - "integrity": "sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==", + "node_modules/filelist": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", + "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "is-core-module": "^2.13.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "minimatch": "^5.0.1" } }, - "node_modules/eslint-plugin-react/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "node_modules/filelist/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, - "bin": { - "semver": "bin/semver.js" + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" } }, - "node_modules/eslint-plugin-security": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-security/-/eslint-plugin-security-3.0.1.tgz", - "integrity": "sha512-XjVGBhtDZJfyuhIxnQ/WMm385RbX3DBu7H1J7HNNhmB2tnGxMeqVSnYv79oAj992ayvIBZghsymwkYFS6cGH4Q==", + "node_modules/filelist/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, + "license": "ISC", "dependencies": { - "safe-regex": "^2.1.1" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" + "node": ">=10" } }, - "node_modules/eslint-plugin-unicorn": { - "version": "56.0.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-56.0.1.tgz", - "integrity": "sha512-FwVV0Uwf8XPfVnKSGpMg7NtlZh0G0gBarCaFcMUOoqPxXryxdYxTRRv4kH6B9TFCVIrjRXG+emcxIk2ayZilog==", + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.24.7", - "@eslint-community/eslint-utils": "^4.4.0", - "ci-info": "^4.0.0", - "clean-regexp": "^1.0.0", - "core-js-compat": "^3.38.1", - "esquery": "^1.6.0", - "globals": "^15.9.0", - "indent-string": "^4.0.0", - "is-builtin-module": "^3.2.1", - "jsesc": "^3.0.2", - "pluralize": "^8.0.0", - "read-pkg-up": "^7.0.1", - "regexp-tree": "^0.1.27", - "regjsparser": "^0.10.0", - "semver": "^7.6.3", - "strip-indent": "^3.0.0" - }, - "engines": { - "node": ">=18.18" - }, - "funding": { - "url": "https://github.com/sindresorhus/eslint-plugin-unicorn?sponsor=1" + "to-regex-range": "^5.0.1" }, - "peerDependencies": { - "eslint": ">=8.56.0" - } - }, - "node_modules/eslint-plugin-unicorn/node_modules/ci-info": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.0.0.tgz", - "integrity": "sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" - } - ], "engines": { "node": ">=8" } }, - "node_modules/eslint-plugin-unicorn/node_modules/globals": { - "version": "15.11.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-15.11.0.tgz", - "integrity": "sha512-yeyNSjdbyVaWurlwCpcA6XNBrHTMIeDdj0/hnvX/OLJ9ekOXYbLsLinH/MucQyGvNnXhidTdNhTtJaffL2sMfw==", + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, "engines": { - "node": ">=18" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint-scope": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz", - "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==", - "license": "BSD-2-Clause", + "node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "dev": true, + "license": "MIT", "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" + "flatted": "^3.2.9", + "keyv": "^4.5.4" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" + "node": ">=16" } }, - "node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node_modules/flatted": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz", + "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==", + "dev": true, + "license": "ISC" + }, + "node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0" }, - "funding": { - "url": "https://opencollective.com/eslint" + "engines": { + "node": ">= 8" } }, - "node_modules/eslint/node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint/node_modules/eslint-visitor-keys": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", - "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", - "license": "Apache-2.0", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/espree": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", - "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", - "license": "BSD-2-Clause", - "dependencies": { - "acorn": "^8.14.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^4.2.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", - "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", - "license": "Apache-2.0", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/esquery": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", - "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", - "dependencies": { - "estraverse": "^5.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "license": "BSD-2-Clause", - "dependencies": { - "estraverse": "^5.2.0" - }, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/execa": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", - "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", - "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/executioner": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/executioner/-/executioner-2.0.1.tgz", - "integrity": "sha512-idZAlKsxEZASjaIqP4PQ1txyS1bOcDwWCHy/8p5oMmLGV0XNCQPD6WWAOwJCUVsWItWzAN2BEash5N78PliaIw==", - "dev": true, - "dependencies": { - "mixly": "^1.0.0" - } - }, - "node_modules/exit": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", - "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", - "dev": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/expect": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", - "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", - "dev": true, - "dependencies": { - "@jest/expect-utils": "^29.7.0", - "jest-get-type": "^29.6.3", - "jest-matcher-utils": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-util": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "license": "MIT" - }, - "node_modules/fast-glob": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", - "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fast-glob/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" - }, - "node_modules/fastq": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", - "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/fb-watchman": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", - "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", - "dev": true, - "dependencies": { - "bser": "2.1.1" - } - }, - "node_modules/file-entry-cache": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", - "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", - "license": "MIT", - "dependencies": { - "flat-cache": "^4.0.0" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/filelist": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", - "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==", - "dev": true, - "dependencies": { - "minimatch": "^5.0.1" - } - }, - "node_modules/filelist/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/filelist/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/flat-cache": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", - "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", - "license": "MIT", - "dependencies": { - "flatted": "^3.2.9", - "keyv": "^4.5.4" - }, - "engines": { - "node": ">=16" - } - }, - "node_modules/flatted": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz", - "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==", - "license": "ISC" - }, - "node_modules/for-each": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", - "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", - "dev": true, - "dependencies": { - "is-callable": "^1.1.3" - } - }, - "node_modules/foreground-child": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.2.1.tgz", - "integrity": "sha512-PXUUyLqrR2XCWICfv6ukppP96sdFwWbNEnfEMt7jNsISjMsvaLNinAHNDYyvkyU+SZG2BTSbT5NjG+vZslfGTA==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.0", - "signal-exit": "^4.0.1" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/foreground-child/node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/fs-minipass": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", - "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", - "dev": true, - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/fs-minipass/node_modules/minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/fs-minipass/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/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" - }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/fulcon": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/fulcon/-/fulcon-1.0.2.tgz", - "integrity": "sha512-vYwUBqbdo9XK0NmN7cFmURmy2T1YHpEsTCbxGO3aErxx6a0Z/HkWXcqcPkk7yOuJ74mSAHGWGBSBBd6v3GKebA==", - "dev": true, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/function.prototype.name": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.8.tgz", - "integrity": "sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.3", - "define-properties": "^1.2.1", - "functions-have-names": "^1.2.3", - "hasown": "^2.0.2", - "is-callable": "^1.2.7" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/functions-have-names": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", - "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/gauge": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", - "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", - "deprecated": "This package is no longer supported.", - "dev": true, - "dependencies": { - "aproba": "^1.0.3 || ^2.0.0", - "color-support": "^1.1.2", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.1", - "object-assign": "^4.1.1", - "signal-exit": "^3.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "wide-align": "^1.1.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/gensync": { - "version": "1.0.0-beta.2", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", - "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", - "dev": true, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/get-intrinsic": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.6.tgz", - "integrity": "sha512-qxsEs+9A+u85HhllWJJFicJfPDhRmjzoYdl64aMWW9yRIJmSyxdn8IEkuIM530/7T+lv0TIHd8L6Q/ra0tEoeA==", - "dev": true, - "dependencies": { - "call-bind-apply-helpers": "^1.0.1", - "dunder-proto": "^1.0.0", - "es-define-property": "^1.0.1", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0", - "function-bind": "^1.1.2", - "gopd": "^1.2.0", - "has-symbols": "^1.1.0", - "hasown": "^2.0.2", - "math-intrinsics": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-package-type": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", - "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", - "dev": true, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/get-symbol-description": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz", - "integrity": "sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==", - "dev": true, - "dependencies": { - "call-bound": "^1.0.3", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.6" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "deprecated": "Glob versions prior to v9 are no longer supported", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dependencies": { - "is-glob": "^4.0.3" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/globals": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", - "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/globalthis": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", - "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", - "dev": true, - "dependencies": { - "define-properties": "^1.2.1", - "gopd": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "license": "MIT", - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/google-protobuf": { - "version": "3.21.4", - "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.21.4.tgz", - "integrity": "sha512-MnG7N936zcKTco4Jd2PX2U96Kf9PxygAPKBug+74LHzmHXmceN16MmRcdgZv+DGef/S9YvQAfRsNCn4cjf9yyQ==" - }, - "node_modules/gopd": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", - "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true - }, - "node_modules/graphemer": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", - "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", - "dev": true - }, - "node_modules/grpc_tools_node_protoc_ts": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/grpc_tools_node_protoc_ts/-/grpc_tools_node_protoc_ts-5.3.3.tgz", - "integrity": "sha512-M/YrklvVXMtuuj9kb42PxeouZhs7Ul+R4e/31XwrankUcKL8cQQP50Q9q+KEHGyHQaPt6VtKKsxMgLaKbCxeww==", - "dev": true, - "dependencies": { - "google-protobuf": "3.15.8", - "handlebars": "4.7.7" - }, - "bin": { - "protoc-gen-ts": "bin/protoc-gen-ts" - } - }, - "node_modules/grpc_tools_node_protoc_ts/node_modules/google-protobuf": { - "version": "3.15.8", - "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.15.8.tgz", - "integrity": "sha512-2jtfdqTaSxk0cuBJBtTTWsot4WtR9RVr2rXg7x7OoqiuOKopPrwXpM1G4dXIkLcUNRh3RKzz76C8IOkksZSeOw==", - "dev": true - }, - "node_modules/grpc-tools": { - "version": "1.12.4", - "resolved": "https://registry.npmjs.org/grpc-tools/-/grpc-tools-1.12.4.tgz", - "integrity": "sha512-5+mLAJJma3BjnW/KQp6JBjUMgvu7Mu3dBvBPd1dcbNIb+qiR0817zDpgPjS7gRb+l/8EVNIa3cB02xI9JLToKg==", - "dev": true, - "hasInstallScript": true, - "dependencies": { - "@mapbox/node-pre-gyp": "^1.0.5" - }, - "bin": { - "grpc_tools_node_protoc": "bin/protoc.js", - "grpc_tools_node_protoc_plugin": "bin/protoc_plugin.js" - } - }, - "node_modules/handlebars": { - "version": "4.7.7", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", - "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", + "node_modules/fs-minipass/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", "dev": true, "dependencies": { - "minimist": "^1.2.5", - "neo-async": "^2.6.0", - "source-map": "^0.6.1", - "wordwrap": "^1.0.0" - }, - "bin": { - "handlebars": "bin/handlebars" - }, - "engines": { - "node": ">=0.4.7" - }, - "optionalDependencies": { - "uglify-js": "^3.1.4" - } - }, - "node_modules/has-bigints": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", - "integrity": "sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==", - "dev": true, - "engines": { - "node": ">= 0.4" + "yallist": "^4.0.0" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "engines": { "node": ">=8" } }, - "node_modules/has-property-descriptors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", - "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "dev": true, - "dependencies": { - "es-define-property": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-proto": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.2.0.tgz", - "integrity": "sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==", - "dev": true, - "dependencies": { - "dunder-proto": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", - "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-tostringtag": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", - "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", - "dev": true, - "dependencies": { - "has-symbols": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", - "dev": true - }, - "node_modules/hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/hosted-git-info": { - "version": "2.8.9", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "node_modules/fs-minipass/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", - "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, - "node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "dev": true, - "dependencies": { - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/human-signals": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", - "dev": true, - "engines": { - "node": ">=10.17.0" - } - }, - "node_modules/ignore": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", - "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", - "engines": { - "node": ">= 4" - } - }, - "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "license": "MIT", - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/import-local": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", - "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", - "dev": true, - "dependencies": { - "pkg-dir": "^4.2.0", - "resolve-cwd": "^3.0.0" - }, - "bin": { - "import-local-fixture": "fixtures/cli.js" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "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==", - "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/install-peers": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/install-peers/-/install-peers-1.0.4.tgz", - "integrity": "sha512-0POFG2zRn/rt0uO1tUekCDhq6t6l3HDjxR42+Hcbjmj75Gv4yuqEfMe63HC76piO1lsctAp/cQW+Ny+i/SxTlg==", + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, "hasInstallScript": true, - "dependencies": { - "executioner": "^2.0.1" - } - }, - "node_modules/internal-slot": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", - "integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==", - "dev": true, - "dependencies": { - "es-errors": "^1.3.0", - "hasown": "^2.0.2", - "side-channel": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/is-array-buffer": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", - "integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.3", - "get-intrinsic": "^1.2.6" - }, + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, - "node_modules/is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", - "dev": true - }, - "node_modules/is-async-function": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.0.0.tgz", - "integrity": "sha512-Y1JXKrfykRJGdlDwdKlLpLyMIiWqWvuSd17TvZk68PLAOGOoF4Xyav1z0Xhoi+gCYjZVeC5SI+hYFOfvXmGRCA==", + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "dev": true, - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-base64": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-base64/-/is-base64-1.1.0.tgz", - "integrity": "sha512-Nlhg7Z2dVC4/PTvIFkgVVNvPHSO2eR/Yd0XzhGiXCXEvWnptXlXa/clQ8aePPiMuxEGcWfzWbGw2Fe3d+Y3v1g==", - "bin": { - "is_base64": "bin/is-base64", - "is-base64": "bin/is-base64" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-bigint": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz", - "integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==", + "node_modules/gauge": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", + "deprecated": "This package is no longer supported.", "dev": true, "dependencies": { - "has-bigints": "^1.0.2" + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", + "signal-exit": "^3.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=10" } }, - "node_modules/is-boolean-object": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.1.tgz", - "integrity": "sha512-l9qO6eFlUETHtuihLcYOaLKByJ1f+N4kthcU9YjHy3N+B3hWv0y/2Nd0mu/7lTFnRQHTrSdXF50HQ3bl5fEnng==", + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", "dev": true, - "dependencies": { - "call-bound": "^1.0.2", - "has-tostringtag": "^1.0.2" - }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=6.9.0" } }, - "node_modules/is-builtin-module": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.1.tgz", - "integrity": "sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==", + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", "dev": true, - "dependencies": { - "builtin-modules": "^3.3.0" - }, "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8.0.0" } }, - "node_modules/is-callable": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", - "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true, "engines": { - "node": ">= 0.4" + "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-core-module": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", - "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", + "node_modules/glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, "dependencies": { - "hasown": "^2.0.2" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" }, "engines": { - "node": ">= 0.4" + "node": "*" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/is-data-view": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.2.tgz", - "integrity": "sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==", + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, "dependencies": { - "call-bound": "^1.0.2", - "get-intrinsic": "^1.2.6", - "is-typed-array": "^1.1.13" + "is-glob": "^4.0.3" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=10.13.0" } }, - "node_modules/is-date-object": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz", - "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", + "node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", "dev": true, - "dependencies": { - "call-bound": "^1.0.2", - "has-tostringtag": "^1.0.2" - }, + "license": "MIT", "engines": { - "node": ">= 0.4" + "node": ">=18" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "engines": { - "node": ">=0.10.0" - } + "node_modules/google-protobuf": { + "version": "3.21.4", + "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.21.4.tgz", + "integrity": "sha512-MnG7N936zcKTco4Jd2PX2U96Kf9PxygAPKBug+74LHzmHXmceN16MmRcdgZv+DGef/S9YvQAfRsNCn4cjf9yyQ==" }, - "node_modules/is-finalizationregistry": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.1.tgz", - "integrity": "sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==", + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, + "node_modules/grpc-tools": { + "version": "1.12.4", + "resolved": "https://registry.npmjs.org/grpc-tools/-/grpc-tools-1.12.4.tgz", + "integrity": "sha512-5+mLAJJma3BjnW/KQp6JBjUMgvu7Mu3dBvBPd1dcbNIb+qiR0817zDpgPjS7gRb+l/8EVNIa3cB02xI9JLToKg==", "dev": true, + "hasInstallScript": true, "dependencies": { - "call-bound": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" + "@mapbox/node-pre-gyp": "^1.0.5" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "bin": { + "grpc_tools_node_protoc": "bin/protoc.js", + "grpc_tools_node_protoc_plugin": "bin/protoc_plugin.js" } }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, "engines": { "node": ">=8" } }, - "node_modules/is-generator-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", - "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", - "dev": true, - "engines": { - "node": ">=6" - } + "node_modules/has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", + "dev": true }, - "node_modules/is-generator-function": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", - "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", "dev": true, "dependencies": { - "has-tostringtag": "^1.0.0" + "function-bind": "^1.1.2" }, "engines": { "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, "dependencies": { - "is-extglob": "^2.1.1" + "agent-base": "6", + "debug": "4" }, "engines": { - "node": ">=0.10.0" + "node": ">= 6" } }, - "node_modules/is-map": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", - "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", + "node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", "dev": true, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "engines": { - "node": ">=0.12.0" + "node": ">=10.17.0" } }, - "node_modules/is-number-object": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz", - "integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==", + "node_modules/ignore": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", "dev": true, - "dependencies": { - "call-bound": "^1.0.3", - "has-tostringtag": "^1.0.2" - }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">= 4" } }, - "node_modules/is-regex": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", - "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, + "license": "MIT", "dependencies": { - "call-bound": "^1.0.2", - "gopd": "^1.2.0", - "has-tostringtag": "^1.0.2", - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-set": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", - "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", - "dev": true, "engines": { - "node": ">= 0.4" + "node": ">=6" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-shared-array-buffer": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz", - "integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==", + "node_modules/import-local": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", + "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", "dev": true, "dependencies": { - "call-bound": "^1.0.3" + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" }, "engines": { - "node": ">= 0.4" + "node": ">=8" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=0.8.19" } }, - "node_modules/is-string": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz", - "integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==", + "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==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", "dev": true, "dependencies": { - "call-bound": "^1.0.3", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "once": "^1.3.0", + "wrappy": "1" } }, - "node_modules/is-symbol": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz", - "integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==", + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true + }, + "node_modules/is-base64": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-base64/-/is-base64-1.1.0.tgz", + "integrity": "sha512-Nlhg7Z2dVC4/PTvIFkgVVNvPHSO2eR/Yd0XzhGiXCXEvWnptXlXa/clQ8aePPiMuxEGcWfzWbGw2Fe3d+Y3v1g==", + "bin": { + "is_base64": "bin/is-base64", + "is-base64": "bin/is-base64" + } + }, + "node_modules/is-core-module": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", + "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", "dev": true, "dependencies": { - "call-bound": "^1.0.2", - "has-symbols": "^1.1.0", - "safe-regex-test": "^1.1.0" + "hasown": "^2.0.2" }, "engines": { "node": ">= 0.4" @@ -5153,74 +3402,70 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-typed-array": { - "version": "1.1.15", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", - "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true, - "dependencies": { - "which-typed-array": "^1.1.16" - }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=0.10.0" } }, - "node_modules/is-weakmap": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", - "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-generator-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", "dev": true, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=6" } }, - "node_modules/is-weakref": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.1.0.tgz", - "integrity": "sha512-SXM8Nwyys6nT5WP6pltOwKytLV7FqQ4UiibxVmW+EIosHcmCqkkjViTb5SNssDlkCiEYRP1/pdWUKVvZBmsR2Q==", + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "dependencies": { - "call-bound": "^1.0.2" + "is-extglob": "^2.1.1" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=0.10.0" } }, - "node_modules/is-weakset": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz", - "integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==", + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, - "dependencies": { - "call-bound": "^1.0.3", - "get-intrinsic": "^1.2.6" - }, "engines": { - "node": ">= 0.4" + "node": ">=0.12.0" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "engines": { + "node": ">=8" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/isarray": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "dev": true - }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true }, "node_modules/istanbul-lib-coverage": { "version": "3.2.2", @@ -5303,46 +3548,12 @@ "node": ">=8" } }, - "node_modules/iterator.prototype": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/iterator.prototype/-/iterator.prototype-1.1.4.tgz", - "integrity": "sha512-x4WH0BWmrMmg4oHHl+duwubhrvczGlyuGAZu3nvrf0UXOfPu8IhZObFEr7DE/iv01YgVZrsOiRcqw2srkKEDIA==", - "dev": true, - "dependencies": { - "define-data-property": "^1.1.4", - "es-object-atoms": "^1.0.0", - "get-intrinsic": "^1.2.6", - "has-symbols": "^1.1.0", - "reflect.getprototypeof": "^1.0.8", - "set-function-name": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/jackspeak": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.0.1.tgz", - "integrity": "sha512-cub8rahkh0Q/bw1+GxP7aeSe29hHHn2V4m29nnDlvCdlgU+3UGxkZp7Z53jLUdpX3jdTO0nJZUDl3xvbWc2Xog==", - "dev": true, - "dependencies": { - "@isaacs/cliui": "^8.0.2" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - }, - "optionalDependencies": { - "@pkgjs/parseargs": "^0.11.0" - } - }, "node_modules/jake": { - "version": "10.9.1", - "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.1.tgz", - "integrity": "sha512-61btcOHNnLnsOdtLgA5efqQWjnSi/vow5HbI7HMdKKWqvrKR1bLK3BPlJn9gcSaP2ewuamUSMB5XEy76KUIS2w==", + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.2.tgz", + "integrity": "sha512-2P4SQ0HrLQ+fw6llpLnOaGAvN2Zu6778SJMrCUwns4fOoG9ayrTiZk3VV8sCPkVZF8ab0zksVpS8FDY5pRCNBA==", "dev": true, + "license": "Apache-2.0", "dependencies": { "async": "^3.2.3", "chalk": "^4.0.2", @@ -5792,12 +4003,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-teamcity": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/jest-teamcity/-/jest-teamcity-1.12.0.tgz", - "integrity": "sha512-6NR0wHEkFj1Ke3gp6utDkq5pfsKLBI2W12iHDuAZYUtvfoBFAuZTqeQL9QBEWZV7n+KcSsdYRVMElWDaLYb/3w==", - "dev": true - }, "node_modules/jest-util": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", @@ -5929,12 +4134,14 @@ "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true }, "node_modules/js-yaml": { "version": "3.14.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -5943,31 +4150,11 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/jsdoc-type-pratt-parser": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.1.0.tgz", - "integrity": "sha512-Hicd6JK5Njt2QB6XYFS7ok9e37O8AYk3jTcppG4YVQnYjOemymvTcmc7OWsmq/Qqj5TdRFO5/x/tIPmBeRtGHg==", - "dev": true, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/jsesc": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz", - "integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==", - "dev": true, - "bin": { - "jsesc": "bin/jsesc" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, "license": "MIT" }, "node_modules/json-parse-even-better-errors": { @@ -5980,44 +4167,33 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, "license": "MIT" }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==" + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true }, "node_modules/json5": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", - "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true, - "dependencies": { - "minimist": "^1.2.0" - }, + "license": "MIT", "bin": { "json5": "lib/cli.js" - } - }, - "node_modules/jsx-ast-utils": { - "version": "3.3.5", - "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", - "integrity": "sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==", - "dev": true, - "dependencies": { - "array-includes": "^3.1.6", - "array.prototype.flat": "^1.3.1", - "object.assign": "^4.1.4", - "object.values": "^1.1.6" }, "engines": { - "node": ">=4.0" + "node": ">=6" } }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, "license": "MIT", "dependencies": { "json-buffer": "3.0.1" @@ -6032,24 +4208,6 @@ "node": ">=6" } }, - "node_modules/language-subtag-registry": { - "version": "0.3.23", - "resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.23.tgz", - "integrity": "sha512-0K65Lea881pHotoGEa5gDlMxt3pctLi2RplBb7Ezh4rRdLEOtgi7n4EwK9lamnUCkKBqaeKRVebTq6BAxSkpXQ==", - "dev": true - }, - "node_modules/language-tags": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/language-tags/-/language-tags-1.0.9.tgz", - "integrity": "sha512-MbjN408fEndfiQXbFQ1vnd+1NoLDsnQW41410oQBXiyXDMYH5z505juWa4KUE1LqxRC7DgOgZDbKLxHIwm27hA==", - "dev": true, - "dependencies": { - "language-subtag-registry": "^0.3.20" - }, - "engines": { - "node": ">=0.10" - } - }, "node_modules/leven": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", @@ -6063,6 +4221,7 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" @@ -6081,6 +4240,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, "dependencies": { "p-locate": "^5.0.0" }, @@ -6091,11 +4251,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, "node_modules/lodash.camelcase": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", @@ -6105,30 +4260,20 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true }, "node_modules/long": { "version": "5.2.3", "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" }, - "node_modules/loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "dev": true, - "dependencies": { - "js-tokens": "^3.0.0 || ^4.0.0" - }, - "bin": { - "loose-envify": "cli.js" - } - }, "node_modules/lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", @@ -6166,7 +4311,8 @@ "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/makeerror": { "version": "1.0.12", @@ -6177,15 +4323,6 @@ "tmpl": "1.0.5" } }, - "node_modules/math-intrinsics": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", - "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -6196,6 +4333,8 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "license": "MIT", "engines": { "node": ">= 8" } @@ -6204,6 +4343,7 @@ "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" @@ -6221,19 +4361,11 @@ "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", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -6241,14 +4373,6 @@ "node": "*" } }, - "node_modules/minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/minipass": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", @@ -6289,43 +4413,16 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, - "node_modules/mixly": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/mixly/-/mixly-1.0.0.tgz", - "integrity": "sha512-ks+xIMVeIDwuYK4LnOMXTfmiEI8oo3tFNFirpHd60C4r2H0wMwKN5/qHCrFBKFK+BYx2Gp7qs+evUJw7QO9D2w==", - "dev": true, - "dependencies": { - "fulcon": "^1.0.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/mkdirp": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - "dependencies": { - "minimist": "^1.2.6" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==" - }, - "node_modules/neo-async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", - "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, "node_modules/node-fetch": { @@ -6365,35 +4462,14 @@ "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", "dev": true, - "dependencies": { - "abbrev": "1" - }, - "bin": { - "nopt": "bin/nopt.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, - "dependencies": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "node_modules/normalize-package-data/node_modules/semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", - "dev": true, + "dependencies": { + "abbrev": "1" + }, "bin": { - "semver": "bin/semver" + "nopt": "bin/nopt.js" + }, + "engines": { + "node": ">=6" } }, "node_modules/normalize-path": { @@ -6439,115 +4515,11 @@ "node": ">=0.10.0" } }, - "node_modules/object-inspect": { - "version": "1.13.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", - "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object.assign": { - "version": "4.1.7", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz", - "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.3", - "define-properties": "^1.2.1", - "es-object-atoms": "^1.0.0", - "has-symbols": "^1.1.0", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object.entries": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.8.tgz", - "integrity": "sha512-cmopxi8VwRIAw/fkijJohSfpef5PdN0pMQJN6VC/ZKvn0LIknWD8KtgY6KlQdEc4tIjcQ3HxSMmnvtzIscdaYQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object.fromentries": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", - "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.2", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object.groupby": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", - "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object.values": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.1.tgz", - "integrity": "sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.3", - "define-properties": "^1.2.1", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, "dependencies": { "wrappy": "1" } @@ -6571,6 +4543,7 @@ "version": "0.9.4", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, "dependencies": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", @@ -6587,6 +4560,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, "dependencies": { "yocto-queue": "^0.1.0" }, @@ -6601,6 +4575,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, "dependencies": { "p-limit": "^3.0.2" }, @@ -6620,16 +4595,11 @@ "node": ">=6" } }, - "node_modules/package-json-from-dist": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz", - "integrity": "sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==", - "dev": true - }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, "license": "MIT", "dependencies": { "callsites": "^3.0.0" @@ -6638,19 +4608,6 @@ "node": ">=6" } }, - "node_modules/parse-imports": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/parse-imports/-/parse-imports-2.1.1.tgz", - "integrity": "sha512-TDT4HqzUiTMO1wJRwg/t/hYk8Wdp3iF/ToMIlAoVQfL1Xs/sTxq1dKWSMjMbQmIarfWKymOyly40+zmPHXMqCA==", - "dev": true, - "dependencies": { - "es-module-lexer": "^1.5.3", - "slashes": "^3.0.12" - }, - "engines": { - "node": ">= 18" - } - }, "node_modules/parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -6673,6 +4630,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, "engines": { "node": ">=8" } @@ -6681,6 +4639,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -6689,6 +4648,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, "engines": { "node": ">=8" } @@ -6696,60 +4656,20 @@ "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" - }, - "node_modules/path-scurry": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", - "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", - "dev": true, - "dependencies": { - "lru-cache": "^11.0.0", - "minipass": "^7.1.2" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/path-scurry/node_modules/lru-cache": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.0.0.tgz", - "integrity": "sha512-Qv32eSV1RSCfhY3fpPE2GNZ8jgM9X7rdAfemLWqTUxwiyIC4jJ6Sy0fZ8H+oLWevO6i4/bizg7c8d8i6bxrzbA==", - "dev": true, - "engines": { - "node": "20 || >=22" - } - }, - "node_modules/path-scurry/node_modules/minipass": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", - "dev": true, - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "license": "MIT", - "engines": { - "node": ">=8" - } + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true }, "node_modules/picocolors": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz", - "integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==" + "integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==", + "dev": true }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, "engines": { "node": ">=8.6" }, @@ -6830,28 +4750,11 @@ "node": ">=8" } }, - "node_modules/pluralize": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", - "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/possible-typed-array-names": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", - "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, "engines": { "node": ">= 0.8.0" } @@ -6895,23 +4798,6 @@ "node": ">= 6" } }, - "node_modules/prop-types": { - "version": "15.8.1", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", - "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", - "dev": true, - "dependencies": { - "loose-envify": "^1.4.0", - "object-assign": "^4.1.1", - "react-is": "^16.13.1" - } - }, - "node_modules/prop-types/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", - "dev": true - }, "node_modules/protobufjs": { "version": "7.3.2", "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.3.2.tgz", @@ -6939,6 +4825,7 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -6969,6 +4856,7 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, "funding": [ { "type": "github", @@ -6982,7 +4870,8 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/react-is": { "version": "18.3.1", @@ -6990,190 +4879,18 @@ "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", "dev": true }, - "node_modules/read-pkg": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", - "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", - "dev": true, - "dependencies": { - "@types/normalize-package-data": "^2.4.0", - "normalize-package-data": "^2.5.0", - "parse-json": "^5.0.0", - "type-fest": "^0.6.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/read-pkg-up": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", - "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", - "dev": true, - "dependencies": { - "find-up": "^4.1.0", - "read-pkg": "^5.2.0", - "type-fest": "^0.8.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/read-pkg-up/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/read-pkg-up/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/read-pkg-up/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/read-pkg-up/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/read-pkg-up/node_modules/type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/read-pkg/node_modules/type-fest": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", - "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/reflect.getprototypeof": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.9.tgz", - "integrity": "sha512-r0Ay04Snci87djAsI4U+WNRcSw5S4pOH7qFjd/veA5gC7TbqESR3tcj28ia95L/fYUDw11JKP7uqUKUAfVvV5Q==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.8", - "define-properties": "^1.2.1", - "dunder-proto": "^1.0.1", - "es-abstract": "^1.23.6", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.6", - "gopd": "^1.2.0", - "which-builtin-type": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/regexp-tree": { - "version": "0.1.27", - "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.27.tgz", - "integrity": "sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==", - "dev": true, - "bin": { - "regexp-tree": "bin/regexp-tree" - } - }, - "node_modules/regexp.prototype.flags": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.3.tgz", - "integrity": "sha512-vqlC04+RQoFalODCbCumG2xIOvapzVMHwsyIGM/SIE8fRhFFsXeH8/QQ+s0T0kDAhKc4k30s73/0ydkHQz6HlQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-errors": "^1.3.0", - "set-function-name": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/regjsparser": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.10.0.tgz", - "integrity": "sha512-qx+xQGZVsy55CH0a1hiVwHmqjLryfh7wQyF5HO07XJ9f7dQMY/gPQHhlyDkIzJKC+x2fUCpCcUODUUUFrm7SHA==", + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, "dependencies": { - "jsesc": "~0.5.0" + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" }, - "bin": { - "regjsparser": "bin/parser" - } - }, - "node_modules/regjsparser/node_modules/jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==", - "dev": true, - "bin": { - "jsesc": "bin/jsesc" + "engines": { + "node": ">= 6" } }, "node_modules/require-directory": { @@ -7193,6 +4910,7 @@ "version": "1.22.8", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, "dependencies": { "is-core-module": "^2.13.0", "path-parse": "^1.0.7", @@ -7230,6 +4948,7 @@ "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, "license": "MIT", "engines": { "node": ">=4" @@ -7248,90 +4967,18 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "license": "MIT", "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" } }, - "node_modules/rimraf": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.0.1.tgz", - "integrity": "sha512-9dkvaxAsk/xNXSJzMgFqqMCuFgt2+KsOFek3TMLfo8NCPfWpBmqwyNn5Y+NX56QUYfCtsyhF3ayiboEoUmJk/A==", - "dev": true, - "dependencies": { - "glob": "^11.0.0", - "package-json-from-dist": "^1.0.0" - }, - "bin": { - "rimraf": "dist/esm/bin.mjs" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/rimraf/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/rimraf/node_modules/glob": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.0.tgz", - "integrity": "sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==", - "dev": true, - "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^4.0.1", - "minimatch": "^10.0.0", - "minipass": "^7.1.2", - "package-json-from-dist": "^1.0.0", - "path-scurry": "^2.0.0" - }, - "bin": { - "glob": "dist/esm/bin.mjs" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/rimraf/node_modules/minimatch": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz", - "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/rimraf/node_modules/minipass": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", - "dev": true, - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, "funding": [ { "type": "github", @@ -7346,29 +4993,11 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "queue-microtask": "^1.2.2" } }, - "node_modules/safe-array-concat": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.3.tgz", - "integrity": "sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.2", - "get-intrinsic": "^1.2.6", - "has-symbols": "^1.1.0", - "isarray": "^2.0.5" - }, - "engines": { - "node": ">=0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -7389,36 +5018,11 @@ } ] }, - "node_modules/safe-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-2.1.1.tgz", - "integrity": "sha512-rx+x8AMzKb5Q5lQ95Zoi6ZbJqwCLkqi3XuJXp5P3rT8OEc6sZCJG5AE5dU3lsgRr/F4Bs31jSlVN+j5KrsGu9A==", - "dev": true, - "dependencies": { - "regexp-tree": "~0.1.1" - } - }, - "node_modules/safe-regex-test": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", - "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", - "dev": true, - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "is-regex": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/semver": { "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, "bin": { "semver": "bin/semver.js" }, @@ -7432,42 +5036,11 @@ "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", "dev": true }, - "node_modules/set-function-length": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", - "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", - "dev": true, - "dependencies": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/set-function-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", - "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", - "dev": true, - "dependencies": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "functions-have-names": "^1.2.3", - "has-property-descriptors": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, "dependencies": { "shebang-regex": "^3.0.0" }, @@ -7479,80 +5052,9 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "engines": { - "node": ">=8" - } - }, - "node_modules/side-channel": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", - "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", - "dev": true, - "dependencies": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.3", - "side-channel-list": "^1.0.0", - "side-channel-map": "^1.0.1", - "side-channel-weakmap": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-list": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", - "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", - "dev": true, - "dependencies": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-map": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", - "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", - "dev": true, - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-weakmap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", - "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", "dev": true, - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3", - "side-channel-map": "^1.0.1" - }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=8" } }, "node_modules/signal-exit": { @@ -7571,16 +5073,11 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, "engines": { "node": ">=8" } }, - "node_modules/slashes": { - "version": "3.0.12", - "resolved": "https://registry.npmjs.org/slashes/-/slashes-3.0.12.tgz", - "integrity": "sha512-Q9VME8WyGkc7pJf6QEkj3wE+2CnvZMI+XJhwdTPR8Z/kWQRXi7boAWLDibRPyHRTUTPx5FaU7MsyrjI3yLB4HA==", - "dev": true - }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -7600,52 +5097,11 @@ "source-map": "^0.6.0" } }, - "node_modules/spdx-correct": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", - "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", - "dev": true, - "dependencies": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "node_modules/spdx-correct/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-exceptions": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", - "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", - "dev": true - }, - "node_modules/spdx-expression-parse": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-4.0.0.tgz", - "integrity": "sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ==", - "dev": true, - "dependencies": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "node_modules/spdx-license-ids": { - "version": "3.0.18", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.18.tgz", - "integrity": "sha512-xxRs31BqRYHwiMzudOrpSiHtZ8i/GeionCBDSilhYRj+9gIcI8wCZTlXZKu9vZIVqViP3dcp9qE5G6AlIaD+TQ==", - "dev": true - }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "dev": true }, "node_modules/stack-utils": { "version": "2.0.6", @@ -7661,187 +5117,52 @@ }, "node_modules/stack-utils/node_modules/escape-string-regexp": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", - "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, - "node_modules/string-length": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", - "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", - "dev": true, - "dependencies": { - "char-regex": "^1.0.2", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/string-width-cjs": { - "name": "string-width", - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/string.prototype.includes": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/string.prototype.includes/-/string.prototype.includes-2.0.1.tgz", - "integrity": "sha512-o7+c9bW6zpAdJHTtujeePODAhkuicdAryFsfVKwA+wGw89wJ4GTY484WTucM9hLtDEOpOvI+aHnzqnC5lHp4Rg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.3" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/string.prototype.matchall": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.12.tgz", - "integrity": "sha512-6CC9uyBL+/48dYizRf7H7VAYCMCNTBeM78x/VTUe9bFEaxBepPJDa1Ow99LqI/1yF7kuy7Q3cQsYMrcjGUcskA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.3", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.6", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0", - "get-intrinsic": "^1.2.6", - "gopd": "^1.2.0", - "has-symbols": "^1.1.0", - "internal-slot": "^1.1.0", - "regexp.prototype.flags": "^1.5.3", - "set-function-name": "^2.0.2", - "side-channel": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/string.prototype.repeat": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/string.prototype.repeat/-/string.prototype.repeat-1.0.0.tgz", - "integrity": "sha512-0u/TldDbKD8bFCQ/4f5+mNRrXwZ8hg2w7ZR8wa16e8z9XpePWl3eGEcUD0OXpEH/VJH/2G3gjUtR3ZOiBe2S/w==", - "dev": true, - "dependencies": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5" - } - }, - "node_modules/string.prototype.trim": { - "version": "1.2.10", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz", - "integrity": "sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", "dev": true, - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.2", - "define-data-property": "^1.1.4", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.5", - "es-object-atoms": "^1.0.0", - "has-property-descriptors": "^1.0.2" - }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=8" } }, - "node_modules/string.prototype.trimend": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz", - "integrity": "sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==", + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "dev": true, "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.2", - "define-properties": "^1.2.1", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "safe-buffer": "~5.2.0" } }, - "node_modules/string.prototype.trimstart": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", - "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", + "node_modules/string-length": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", + "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-object-atoms": "^1.0.0" + "char-regex": "^1.0.2", + "strip-ansi": "^6.0.0" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=10" } }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dependencies": { - "ansi-regex": "^5.0.1" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" }, "engines": { "node": ">=8" } }, - "node_modules/strip-ansi-cjs": { - "name": "strip-ansi", + "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -7849,15 +5170,6 @@ "node": ">=8" } }, - "node_modules/strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/strip-final-newline": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", @@ -7867,22 +5179,11 @@ "node": ">=6" } }, - "node_modules/strip-indent": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", - "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", - "dev": true, - "dependencies": { - "min-indent": "^1.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, "engines": { "node": ">=8" }, @@ -7894,6 +5195,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -7905,6 +5207,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, "engines": { "node": ">= 0.4" }, @@ -7912,28 +5215,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/synckit": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.9.1.tgz", - "integrity": "sha512-7gr8p9TQP6RAHusBOSLs46F4564ZrjV8xFmw5zCmgmhGUcw2hxsShhJ6CEiHQMgPDwAQ1fWHPM0ypc4RMAig4A==", - "dev": true, - "dependencies": { - "@pkgr/core": "^0.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": "^14.18.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/unts" - } - }, - "node_modules/synckit/node_modules/tslib": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", - "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==", - "dev": true - }, "node_modules/tar": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", @@ -7977,355 +5258,179 @@ "dependencies": { "@istanbuljs/schema": "^0.1.2", "glob": "^7.1.4", - "minimatch": "^3.0.4" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/tmpl": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", - "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", - "dev": true - }, - "node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", - "dev": true - }, - "node_modules/ts-api-utils": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", - "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", - "engines": { - "node": ">=16" - }, - "peerDependencies": { - "typescript": ">=4.2.0" - } - }, - "node_modules/ts-jest": { - "version": "29.2.5", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.2.5.tgz", - "integrity": "sha512-KD8zB2aAZrcKIdGk4OwpJggeLcH1FgrICqDSROWqlnJXGCXK4Mn6FcdK2B6670Xr73lHMG1kHw8R87A0ecZ+vA==", - "dev": true, - "dependencies": { - "bs-logger": "^0.2.6", - "ejs": "^3.1.10", - "fast-json-stable-stringify": "^2.1.0", - "jest-util": "^29.0.0", - "json5": "^2.2.3", - "lodash.memoize": "^4.1.2", - "make-error": "^1.3.6", - "semver": "^7.6.3", - "yargs-parser": "^21.1.1" - }, - "bin": { - "ts-jest": "cli.js" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0" - }, - "peerDependencies": { - "@babel/core": ">=7.0.0-beta.0 <8", - "@jest/transform": "^29.0.0", - "@jest/types": "^29.0.0", - "babel-jest": "^29.0.0", - "jest": "^29.0.0", - "typescript": ">=4.3 <6" - }, - "peerDependenciesMeta": { - "@babel/core": { - "optional": true - }, - "@jest/transform": { - "optional": true - }, - "@jest/types": { - "optional": true - }, - "babel-jest": { - "optional": true - }, - "esbuild": { - "optional": true - } - } - }, - "node_modules/ts-jest/node_modules/json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "dev": true, - "bin": { - "json5": "lib/cli.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/ts-protoc-gen": { - "version": "0.15.0", - "resolved": "https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.15.0.tgz", - "integrity": "sha512-TycnzEyrdVDlATJ3bWFTtra3SCiEP0W0vySXReAuEygXCUr1j2uaVyL0DhzjwuUdQoW5oXPwk6oZWeA0955V+g==", - "dev": true, - "dependencies": { - "google-protobuf": "^3.15.5" - }, - "bin": { - "protoc-gen-ts": "bin/protoc-gen-ts" - } - }, - "node_modules/tsconfig-paths": { - "version": "3.15.0", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", - "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", - "dev": true, - "dependencies": { - "@types/json5": "^0.0.29", - "json5": "^1.0.2", - "minimist": "^1.2.6", - "strip-bom": "^3.0.0" - } - }, - "node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, - "node_modules/tslint": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-6.1.3.tgz", - "integrity": "sha512-IbR4nkT96EQOvKE2PW/djGz8iGNeJ4rF2mBfiYaR/nvUWYKJhLwimoJKgjIFEIDibBtOevj7BqCRL4oHeWWUCg==", - "deprecated": "TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.", - "dependencies": { - "@babel/code-frame": "^7.0.0", - "builtin-modules": "^1.1.1", - "chalk": "^2.3.0", - "commander": "^2.12.1", - "diff": "^4.0.1", - "glob": "^7.1.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "mkdirp": "^0.5.3", - "resolve": "^1.3.2", - "semver": "^5.3.0", - "tslib": "^1.13.0", - "tsutils": "^2.29.0" - }, - "bin": { - "tslint": "bin/tslint" - }, - "engines": { - "node": ">=4.8.0" - }, - "peerDependencies": { - "typescript": ">=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >=3.0.0-dev || >= 3.1.0-dev || >= 3.2.0-dev || >= 4.0.0-dev" - } - }, - "node_modules/tslint/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==", - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/tslint/node_modules/builtin-modules": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha512-wxXCdllwGhI2kCC0MnvTGYTMvnVZTvqgypkiTI8Pa5tcz2i6VqsqwYGgqwXji+4RgCzms6EajE4IxiUH6HH8nQ==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/tslint/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==", - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/tslint/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==", - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/tslint/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==" - }, - "node_modules/tslint/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==", - "engines": { - "node": ">=4" - } - }, - "node_modules/tslint/node_modules/semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/tslint/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==", - "dependencies": { - "has-flag": "^3.0.0" + "minimatch": "^3.0.4" }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/tsutils": { - "version": "2.29.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", - "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", - "dependencies": { - "tslib": "^1.8.1" - }, - "peerDependencies": { - "typescript": ">=2.1.0 || >=2.1.0-dev || >=2.2.0-dev || >=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >= 3.0.0-dev || >= 3.1.0-dev" + "node_modules/tmpl": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", + "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", + "dev": true + }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "dev": true, + "engines": { + "node": ">=4" } }, - "node_modules/type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, "dependencies": { - "prelude-ls": "^1.2.1" + "is-number": "^7.0.0" }, "engines": { - "node": ">= 0.8.0" + "node": ">=8.0" } }, - "node_modules/type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "dev": true + }, + "node_modules/ts-api-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.0.0.tgz", + "integrity": "sha512-xCt/TOAc+EOHS1XPnijD3/yzpH6qg2xppZO1YDqGoVsNXfQfzHpOdNuXwrwOU8u4ITXJyDCTyt8w5g1sZv9ynQ==", "dev": true, + "license": "MIT", "engines": { - "node": ">=4" + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" } }, - "node_modules/typed-array-buffer": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", - "integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==", + "node_modules/ts-jest": { + "version": "29.2.5", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.2.5.tgz", + "integrity": "sha512-KD8zB2aAZrcKIdGk4OwpJggeLcH1FgrICqDSROWqlnJXGCXK4Mn6FcdK2B6670Xr73lHMG1kHw8R87A0ecZ+vA==", "dev": true, + "license": "MIT", "dependencies": { - "call-bound": "^1.0.3", - "es-errors": "^1.3.0", - "is-typed-array": "^1.1.14" + "bs-logger": "^0.2.6", + "ejs": "^3.1.10", + "fast-json-stable-stringify": "^2.1.0", + "jest-util": "^29.0.0", + "json5": "^2.2.3", + "lodash.memoize": "^4.1.2", + "make-error": "^1.3.6", + "semver": "^7.6.3", + "yargs-parser": "^21.1.1" + }, + "bin": { + "ts-jest": "cli.js" }, "engines": { - "node": ">= 0.4" + "node": "^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0" + }, + "peerDependencies": { + "@babel/core": ">=7.0.0-beta.0 <8", + "@jest/transform": "^29.0.0", + "@jest/types": "^29.0.0", + "babel-jest": "^29.0.0", + "jest": "^29.0.0", + "typescript": ">=4.3 <6" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "@jest/transform": { + "optional": true + }, + "@jest/types": { + "optional": true + }, + "babel-jest": { + "optional": true + }, + "esbuild": { + "optional": true + } } }, - "node_modules/typed-array-byte-length": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.3.tgz", - "integrity": "sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==", + "node_modules/ts-node": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", "dev": true, - "dependencies": { - "call-bind": "^1.0.8", - "for-each": "^0.3.3", - "gopd": "^1.2.0", - "has-proto": "^1.2.0", - "is-typed-array": "^1.1.14" + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" }, - "engines": { - "node": ">= 0.4" + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } } }, - "node_modules/typed-array-byte-offset": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.4.tgz", - "integrity": "sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==", + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, "dependencies": { - "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.8", - "for-each": "^0.3.3", - "gopd": "^1.2.0", - "has-proto": "^1.2.0", - "is-typed-array": "^1.1.15", - "reflect.getprototypeof": "^1.0.9" + "prelude-ls": "^1.2.1" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">= 0.8.0" } }, - "node_modules/typed-array-length": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.7.tgz", - "integrity": "sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==", + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true, - "dependencies": { - "call-bind": "^1.0.7", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "is-typed-array": "^1.1.13", - "possible-typed-array-names": "^1.0.0", - "reflect.getprototypeof": "^1.0.6" - }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=4" } }, "node_modules/typescript": { "version": "5.7.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", + "dev": true, "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", @@ -8335,35 +5440,27 @@ "node": ">=14.17" } }, - "node_modules/uglify-js": { - "version": "3.18.0", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.18.0.tgz", - "integrity": "sha512-SyVVbcNBCk0dzr9XL/R/ySrmYf0s372K6/hFklzgcp2lBFyXtw4I7BOdDjlLhE1aVqaI/SHWXWmYdlZxuyF38A==", - "dev": true, - "optional": true, - "bin": { - "uglifyjs": "bin/uglifyjs" - }, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/unbox-primitive": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz", - "integrity": "sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==", + "node_modules/typescript-eslint": { + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.20.0.tgz", + "integrity": "sha512-Kxz2QRFsgbWj6Xcftlw3Dd154b3cEPFqQC+qMZrMypSijPd4UanKKvoKDrJ4o8AIfZFKAF+7sMaEIR8mTElozA==", "dev": true, + "license": "MIT", "dependencies": { - "call-bound": "^1.0.3", - "has-bigints": "^1.0.2", - "has-symbols": "^1.1.0", - "which-boxed-primitive": "^1.1.1" + "@typescript-eslint/eslint-plugin": "8.20.0", + "@typescript-eslint/parser": "8.20.0", + "@typescript-eslint/utils": "8.20.0" }, "engines": { - "node": ">= 0.4" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/undici-types": { @@ -8406,6 +5503,7 @@ "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, "license": "BSD-2-Clause", "dependencies": { "punycode": "^2.1.0" @@ -8426,6 +5524,15 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "dev": true }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true + }, "node_modules/v8-to-istanbul": { "version": "9.3.0", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", @@ -8440,26 +5547,6 @@ "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/validate-npm-package-license/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/walker": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", @@ -8489,6 +5576,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, "dependencies": { "isexe": "^2.0.0" }, @@ -8499,90 +5587,6 @@ "node": ">= 8" } }, - "node_modules/which-boxed-primitive": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz", - "integrity": "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==", - "dev": true, - "dependencies": { - "is-bigint": "^1.1.0", - "is-boolean-object": "^1.2.1", - "is-number-object": "^1.1.1", - "is-string": "^1.1.1", - "is-symbol": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/which-builtin-type": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.2.1.tgz", - "integrity": "sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==", - "dev": true, - "dependencies": { - "call-bound": "^1.0.2", - "function.prototype.name": "^1.1.6", - "has-tostringtag": "^1.0.2", - "is-async-function": "^2.0.0", - "is-date-object": "^1.1.0", - "is-finalizationregistry": "^1.1.0", - "is-generator-function": "^1.0.10", - "is-regex": "^1.2.1", - "is-weakref": "^1.0.2", - "isarray": "^2.0.5", - "which-boxed-primitive": "^1.1.0", - "which-collection": "^1.0.2", - "which-typed-array": "^1.1.16" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/which-collection": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", - "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", - "dev": true, - "dependencies": { - "is-map": "^2.0.3", - "is-set": "^2.0.3", - "is-weakmap": "^2.0.2", - "is-weakset": "^2.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/which-typed-array": { - "version": "1.1.18", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.18.tgz", - "integrity": "sha512-qEcY+KJYlWyLH9vNbsr6/5j59AXk5ni5aakf8ldzBvGde6Iz4sxZGkJyWSAueTG7QhOvNRYb1lDdFmL5Td0QKA==", - "dev": true, - "dependencies": { - "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.8", - "call-bound": "^1.0.3", - "for-each": "^0.3.3", - "gopd": "^1.2.0", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/wide-align": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", @@ -8596,16 +5600,11 @@ "version": "1.2.5", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, "engines": { "node": ">=0.10.0" } }, - "node_modules/wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", - "dev": true - }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -8622,28 +5621,11 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/wrap-ansi-cjs": { - "name": "wrap-ansi", - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true }, "node_modules/write-file-atomic": { "version": "4.0.2", @@ -8672,6 +5654,19 @@ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "dev": true }, + "node_modules/yaml": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz", + "integrity": "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==", + "dev": true, + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/yargs": { "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", @@ -8697,10 +5692,23 @@ "node": ">=12" } }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "engines": { + "node": ">=6" + } + }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, "engines": { "node": ">=10" }, diff --git a/package.json b/package.json index a9a6226..0cfab49 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,17 @@ { "name": "dgraph-js", "version": "24.1.0", + "type": "module", "description": "Official javascript client for Dgraph", "license": "Apache-2.0", "repository": { "type": "git", - "url": "https://github.com/dgraph-io/dgraph-js.git" + "url": "https://github.com/hypermodeinc/dgraph-js.git" }, "bugs": { - "url": "https://github.com/dgraph-io/dgraph-js/issues" + "url": "https://github.com/hypermodeinc/dgraph-js/issues" }, - "homepage": "https://github.com/dgraph-io/dgraph-js#readme", + "homepage": "https://github.com/hypermodeinc/dgraph-js#readme", "files": [ "lib", "generated" @@ -18,54 +19,35 @@ "main": "lib/index.js", "typings": "lib/index.d.ts", "scripts": { - "clean": "rimraf coverage", "rm": "rm -fr node_modules package-lock.json yarn.lock", "build:protos:msgs": "protoc --plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts --js_out=import_style=commonjs,binary:./generated/ --ts_out=service=false:./generated/ --proto_path=./protos/ api.proto", "build:protos:srvs": "grpc_tools_node_protoc --grpc_out=grpc_js:./generated/ --proto_path=./protos/ api.proto", "build:protos": "yarn build:protos:msgs && yarn build:protos:srvs", "build": "tsc -p tsconfig.release.json", "build:watch": "tsc -w -p tsconfig.release.json", - "lint": "eslint -c .eslintrc.js --ext .ts .", - "lint:fix": "eslint . --ext .ts --fix", - "pretest": "yarn lint", + "lint": "trunk check", "test": "jest --coverage --runInBand", "test:watch": "jest --watch", "coveralls": "cat ./coverage/lcov.info | coveralls" }, "devDependencies": { + "@trunkio/launcher": "^1.3.2", "@types/google-protobuf": "^3.15.12", - "@types/jest": "^29.5.14", "@types/node": "^22.10.5", - "@typescript-eslint/eslint-plugin": "^8.19.1", - "@typescript-eslint/parser": "^8.19.1", - "eslint": "^9.17.0", - "eslint-plugin-import": "^2.31.0", - "eslint-plugin-jest": "^28.10.0", - "eslint-plugin-jsdoc": "^50.6.1", - "eslint-plugin-jsx-a11y": "^6.10.2", - "eslint-plugin-no-null": "^1.0.2", - "eslint-plugin-prefer-arrow": "^1.2.3", - "eslint-plugin-react": "^7.37.3", - "eslint-plugin-security": "^3.0.1", - "eslint-plugin-unicorn": "^56.0.1", - "grpc_tools_node_protoc_ts": "^5.3.3", + "eslint": "^9.18.0", + "@eslint/js": "^9.18.0", "grpc-tools": "^1.12.4", - "install-peers": "^1.0.4", "jest": "^29.7.0", - "jest-teamcity": "^1.12.0", - "rimraf": "^6.0.1", "ts-jest": "^29.2.5", - "ts-protoc-gen": "^0.15.0", - "tslint": "^6.1.3", - "typescript": "^5.7.2" + "@types/jest": "^29.2.15", + "typescript": "^5.7.2", + "typescript-eslint": "^8.20.0" }, "dependencies": { "@grpc/grpc-js": "^1.12.5", "@types/url-parse": "^1.4.11", - "@typescript-eslint/eslint-plugin-tslint": "^7.0.2", - "dgraph-js": "^21.3.1", - "eslint-plugin-lodash": "^8.0.0", "google-protobuf": "^3.21.4", + "@improbable-eng/grpc-web": "^0.15.0", "is-base64": "^1.1.0", "url-parse": "^1.5.10" } diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh index f5cbf5b..bab6ce8 100644 --- a/scripts/run-tests.sh +++ b/scripts/run-tests.sh @@ -3,86 +3,86 @@ sleepTime=5 function wait-for-healthy() { - printf 'wait-for-healthy: waiting for %s to return 200 OK\n' "$1" - tries=0 - until curl -sL -w "%{http_code}\\n" "$1" -o /dev/null | grep -q 200; do - tries=$tries+1 - if [[ $tries -gt 300 ]]; then - printf "wait-for-healthy: Took longer than 1 minute to be healthy.\n" - printf "wait-for-healthy: Waiting stopped.\n" - return 1 - fi - sleep 0.2 - done - printf "wait-for-healthy: done.\n" + printf 'wait-for-healthy: waiting for %s to return 200 OK\n' "$1" + tries=0 + until curl -sL -w '%{http_code}\n' "$1" -o /dev/null | grep -q 200 || true; do + tries=${tries}+1 + if [[ ${tries} -gt 300 ]]; then + printf "wait-for-healthy: Took longer than 1 minute to be healthy.\n" + printf "wait-for-healthy: Waiting stopped.\n" + return 1 + fi + sleep 0.2 + done + printf "wait-for-healthy: done.\n" } function errorCheck { - EXIT_CODE=$1 - ERROR_MESSAGE=$2 - - if [[ EXIT_CODE -ne 0 ]]; then - echo $ERROR_MESSAGE - stopCluster - exit $EXIT_CODE - fi - return 0 + EXIT_CODE=$1 + ERROR_MESSAGE=$2 + + if [[ EXIT_CODE -ne 0 ]]; then + echo "${ERROR_MESSAGE}" + stopCluster + exit "${EXIT_CODE}" + fi + return 0 } function stopCluster { - echo "shutting down dgraph alpha and zero..." - kill -9 $(pgrep -f "dgraph zero") > /dev/null # kill dgraph zero - kill -9 $(pgrep -f "dgraph alpha") > /dev/null # kill dgraph alpha - - if pgrep -x dgraph > /dev/null - then - echo "sleeping for 5 seconds so dgraph can shutdown" - sleep 5 - fi - - echo "cluster teardown complete" - return 0 + echo "shutting down dgraph alpha and zero..." + kill -9 $(pgrep -f "dgraph zero") || true # kill dgraph zero + kill -9 $(pgrep -f "dgraph alpha") || true # kill dgraph alpha + + if pgrep -x dgraph >/dev/null || true; then + echo "sleeping for 5 seconds so dgraph can shutdown" + sleep 5 + fi + + echo "cluster teardown complete" + return 0 } function startAlpha { - echo -e "starting dgraph alpha..." - head -c 1024 /dev/random > $SRCDIR/dgraph-local-data/acl-secret.txt - dgraph alpha -p $SRCDIR/dgraph-local-data/p \ - -w $SRCDIR/dgraph-local-data/w \ - --bindall \ - --my localhost:7080 \ - --acl "access-ttl=1h; refresh-ttl=1d; secret-file=$SRCDIR/dgraph-local-data/acl-secret.txt" \ - > $SRCDIR/dgraph-local-data/alpha.log 2>&1 & - - # wait for alpha to be healthy - ALPHA_HTTP_ADDR="localhost:8080" - wait-for-healthy $ALPHA_HTTP_ADDR/health - errorCheck $? "dgraph alpha could not come up" - sleep $sleepTime - return 0 + echo -e "starting dgraph alpha..." + head -c 1024 /dev/random >"${SRCDIR}"/dgraph-local-data/acl-secret.txt + dgraph alpha -p "${SRCDIR}"/dgraph-local-data/p \ + -w "${SRCDIR}"/dgraph-local-data/w \ + --bindall \ + --my localhost:7080 \ + --acl "access-ttl=1h; refresh-ttl=1d; secret-file=${SRCDIR}/dgraph-local-data/acl-secret.txt" \ + >"${SRCDIR}"/dgraph-local-data/alpha.log 2>&1 & + + # wait for alpha to be healthy + ALPHA_HTTP_ADDR="localhost:8080" + wait-for-healthy "${ALPHA_HTTP_ADDR}"/health + errorCheck $? "dgraph alpha could not come up" + sleep "${sleepTime}" + return 0 } function startZero { - echo -e "starting dgraph zero..." - dgraph zero --my localhost:5080 --bindall \ - -w $SRCDIR/dgraph-local-data/wz > $SRCDIR/dgraph-local-data/zero.log 2>&1 & - - # wait for zero to be healthy - ZERO_HTTP_ADDR="localhost:6080" - wait-for-healthy $ZERO_HTTP_ADDR/health - errorCheck $? "dgraph zero could not come up" - sleep $sleepTime + echo -e "starting dgraph zero..." + dgraph zero --my localhost:5080 --bindall \ + -w "${SRCDIR}"/dgraph-local-data/wz >"${SRCDIR}"/dgraph-local-data/zero.log 2>&1 & + + # wait for zero to be healthy + ZERO_HTTP_ADDR="localhost:6080" + wait-for-healthy "${ZERO_HTTP_ADDR}"/health + errorCheck $? "dgraph zero could not come up" + sleep "${sleepTime}" } function init { - echo -e "initializing..." - rm -rf $SRCDIR/dgraph-local-data - mkdir $SRCDIR/dgraph-local-data + echo -e "initializing..." + rm -rf "${SRCDIR}"/dgraph-local-data + mkdir "${SRCDIR}"/dgraph-local-data } # find parent directory of test script -readonly _SRCDIR=$(readlink -f ${BASH_SOURCE[0]%/*}) -SRCDIR=$(dirname $_SRCDIR) +readonly _SRCDIR +_SRCDIR=$(readlink -f "${BASH_SOURCE[0]%/*}") +SRCDIR=$(dirname "${_SRCDIR}") init startZero @@ -95,5 +95,5 @@ npm test errorCheck $? "dgraph-js-http client tests FAILED" stopCluster -rm -rf $SRCDIR/local-dgraph-data +rm -rf "${SRCDIR}"/local-dgraph-data exit 0 diff --git a/src/client.ts b/src/client.ts index ebb6dc1..47e49c8 100644 --- a/src/client.ts +++ b/src/client.ts @@ -1,106 +1,105 @@ -import * as grpc from "@grpc/grpc-js"; +import * as grpc from "@grpc/grpc-js" -import * as messages from "../generated/api_pb"; +import * as messages from "../generated/api_pb" -import { DgraphClientStub } from "./clientStub"; -import { ERR_NO_CLIENTS } from "./errors"; -import { Txn, TxnOptions } from "./txn"; -import * as types from "./types"; -import { isUnauthenticatedError, stringifyMessage } from "./util"; +import { DgraphClientStub } from "./clientStub" +import { ERR_NO_CLIENTS } from "./errors" +import { Txn, TxnOptions } from "./txn" +import * as types from "./types" +import { isUnauthenticatedError, stringifyMessage } from "./util" /** * Client is a transaction aware client to a set of Dgraph server instances. */ export class DgraphClient { - private readonly clients: DgraphClientStub[]; - private debugMode: boolean = false; - - /** - * Creates a new Client for interacting with the Dgraph store. - * - * The client can be backed by multiple connections (to the same server, or - * multiple servers in a cluster). - */ - constructor(...clients: DgraphClientStub[]) { - if (clients.length === 0) { - throw ERR_NO_CLIENTS; - } - - this.clients = clients; + private readonly clients: DgraphClientStub[] + private debugMode: boolean = false + + /** + * Creates a new Client for interacting with the Dgraph store. + * + * The client can be backed by multiple connections (to the same server, or + * multiple servers in a cluster). + */ + constructor(...clients: DgraphClientStub[]) { + if (clients.length === 0) { + throw ERR_NO_CLIENTS } - /** - * By setting various fields of api.Operation, alter can be used to do the - * following: - * - * 1. Modify the schema. - * - * 2. Drop a predicate. - * - * 3. Drop the database. - */ - public async alter( - op: messages.Operation, - metadata?: grpc.Metadata | null, - options?: grpc.CallOptions | null, - ): Promise { - this.debug(`Alter request:\n${stringifyMessage(op)}`); - - const c = this.anyClient(); - let payload: messages.Payload; - const operation = async () => c.alter(op, metadata, options); - try { - payload = await operation(); - } catch (e) { - if (isJwtExpired(e) === true) { - await c.retryLogin(metadata, options); - payload = await operation(); - } else { - throw e; - } - } - const pl: types.Payload = types.createPayload(payload); - this.debug(`Alter response:\n${stringifyMessage(pl)}`); - - return pl; + this.clients = clients + } + + /** + * By setting various fields of api.Operation, alter can be used to do the + * following: + * + * 1. Modify the schema. + * + * 2. Drop a predicate. + * + * 3. Drop the database. + */ + public async alter( + op: messages.Operation, + metadata?: grpc.Metadata | null, + options?: grpc.CallOptions | null, + ): Promise { + this.debug(`Alter request:\n${stringifyMessage(op)}`) + + const c = this.anyClient() + let payload: messages.Payload + const operation = async () => c.alter(op, metadata, options) + try { + payload = await operation() + } catch (e) { + if (isJwtExpired(e) === true) { + await c.retryLogin(metadata, options) + payload = await operation() + } else { + throw e + } } - - /** - * newTxn creates a new transaction. - */ - public newTxn(txnOpts?: TxnOptions): Txn { - return new Txn(this, txnOpts); - } - - /** - * setDebugMode switches on/off the debug mode which prints helpful debug messages - * while performing alters, queries and mutations. - */ - public setDebugMode(mode: boolean = true): void { - this.debugMode = mode; - } - - /** - * debug prints a message on the console if debug mode is switched on. - */ - public debug(msg: string): void { - if (this.debugMode) { - // eslint-disable-next-line no-console - console.log(msg); - } + const pl: types.Payload = types.createPayload(payload) + this.debug(`Alter response:\n${stringifyMessage(pl)}`) + + return pl + } + + /** + * newTxn creates a new transaction. + */ + public newTxn(txnOpts?: TxnOptions): Txn { + return new Txn(this, txnOpts) + } + + /** + * setDebugMode switches on/off the debug mode which prints helpful debug messages + * while performing alters, queries and mutations. + */ + public setDebugMode(mode: boolean = true): void { + this.debugMode = mode + } + + /** + * debug prints a message on the console if debug mode is switched on. + */ + public debug(msg: string): void { + if (this.debugMode) { + console.log(msg) } + } - public anyClient(): DgraphClientStub { - return this.clients[Math.floor(Math.random() * this.clients.length)]; - } + public anyClient(): DgraphClientStub { + return this.clients[Math.floor(Math.random() * this.clients.length)] + } } // isJwtExpired returns true if the error indicates that the jwt has expired. -export function isJwtExpired(err: any): Boolean { // tslint:disable-line no-any - if (!err) { - return false; - } - return isUnauthenticatedError(err); +export function isJwtExpired(err: any): boolean { + if (!err) { + return false + } + return isUnauthenticatedError(err) } /** @@ -110,20 +109,16 @@ export function isJwtExpired(err: any): Boolean { // tslint:disable-line no-any * This helper function doesn't run the mutation on the server. It must be done * by the user after the function returns. */ -export function deleteEdges( - mu: types.Mutation, - uid: string, - ...predicates: string[] -): void { - for (const predicate of predicates) { - const nquad = new messages.NQuad(); - nquad.setSubject(uid); - nquad.setPredicate(predicate); - - const ov = new messages.Value(); - ov.setDefaultVal("_STAR_ALL"); - nquad.setObjectValue(ov); - - mu.addDel(nquad); - } +export function deleteEdges(mu: types.Mutation, uid: string, ...predicates: string[]): void { + for (const predicate of predicates) { + const nquad = new messages.NQuad() + nquad.setSubject(uid) + nquad.setPredicate(predicate) + + const ov = new messages.Value() + ov.setDefaultVal("_STAR_ALL") + nquad.setObjectValue(ov) + + mu.addDel(nquad) + } } diff --git a/src/clientStub.ts b/src/clientStub.ts index 951b9ed..3617ee9 100644 --- a/src/clientStub.ts +++ b/src/clientStub.ts @@ -1,232 +1,214 @@ -import * as grpc from "@grpc/grpc-js"; +import * as grpc from "@grpc/grpc-js" -import * as services from "../generated/api_grpc_pb"; -import * as messages from "../generated/api_pb"; +import * as services from "../generated/api_grpc_pb" +import * as messages from "../generated/api_pb" -import { ERR_REFRESH_JWT_EMPTY } from "./errors"; -import { promisify1, promisify3 } from "./util"; +import { ERR_REFRESH_JWT_EMPTY } from "./errors" +import { promisify1, promisify3 } from "./util" /** * Stub is a stub/client connecting to a single dgraph server instance. */ export class DgraphClientStub { - private readonly stub: services.DgraphClient; - - private accessJwt: string = ""; - private refreshJwt: string = ""; - - private readonly promisified: { - login( - req: messages.LoginRequest, - metadata?: grpc.Metadata, - options?: grpc.CallOptions, - ): Promise; - - alter( - op: messages.Operation, - metadata?: grpc.Metadata, - options?: grpc.CallOptions, - ): Promise; - - query( - req: messages.Request, - metadata?: grpc.Metadata, - options?: grpc.CallOptions, - ): Promise; - - mutate( - mu: messages.Mutation, - metadata?: grpc.Metadata, - options?: grpc.CallOptions, - ): Promise; - - commitOrAbort( - ctx: messages.TxnContext, - metadata?: grpc.Metadata, - options?: grpc.CallOptions, - ): Promise; - - checkVersion( - check: messages.Check, - metadata?: grpc.Metadata, - options?: grpc.CallOptions, - ): Promise; - - waitForReady(deadline: grpc.Deadline): Promise; - }; - - constructor( - addr?: string, - credentials?: grpc.ChannelCredentials, - options?: object, - ) { - if (addr === undefined) { - // eslint-disable-next-line no-param-reassign - addr = "localhost:9080"; - } - if (credentials === undefined) { - // eslint-disable-next-line no-param-reassign - credentials = grpc.credentials.createInsecure(); - } - - this.stub = new services.DgraphClient(addr, credentials, options); - this.promisified = { - login: promisify3(this.stub.login, this.stub), - alter: promisify3(this.stub.alter, this.stub), - query: promisify3(this.stub.query, this.stub), - mutate: promisify3(this.stub.mutate, this.stub), - commitOrAbort: promisify3(this.stub.commitOrAbort, this.stub), - checkVersion: promisify3(this.stub.checkVersion, this.stub), - waitForReady: promisify1(this.stub.waitForReady, this.stub), - }; + private readonly stub: services.DgraphClient + + private accessJwt: string = "" + private refreshJwt: string = "" + + private readonly promisified: { + login( + req: messages.LoginRequest, + metadata?: grpc.Metadata, + options?: grpc.CallOptions, + ): Promise + + alter( + op: messages.Operation, + metadata?: grpc.Metadata, + options?: grpc.CallOptions, + ): Promise + + query( + req: messages.Request, + metadata?: grpc.Metadata, + options?: grpc.CallOptions, + ): Promise + + mutate( + mu: messages.Mutation, + metadata?: grpc.Metadata, + options?: grpc.CallOptions, + ): Promise + + commitOrAbort( + ctx: messages.TxnContext, + metadata?: grpc.Metadata, + options?: grpc.CallOptions, + ): Promise + + checkVersion( + check: messages.Check, + metadata?: grpc.Metadata, + options?: grpc.CallOptions, + ): Promise + + waitForReady(deadline: grpc.Deadline): Promise + } + + constructor(addr?: string, credentials?: grpc.ChannelCredentials, options?: object) { + if (addr === undefined) { + addr = "localhost:9080" } - - public async login( - userid?: string, - password?: string, - refreshJwt?: string, - metadata?: grpc.Metadata, - options?: grpc.CallOptions, - ): Promise { - return this.loginIntoNamespace(userid, password, 0, refreshJwt, metadata, options); - } - - public async loginIntoNamespace( - userid?: string, - password?: string, - namespace?: number, - refreshJwt?: string, - metadata?: grpc.Metadata, - options?: grpc.CallOptions, - ): Promise { - const req = new messages.LoginRequest(); - if (userid !== undefined) { - req.setUserid(userid); - req.setPassword(password); - req.setNamespace(namespace); - } else if (refreshJwt !== undefined) { - // Use the caller-supplied refreshJwt - req.setRefreshToken(refreshJwt); - } else { - req.setRefreshToken(this.refreshJwt); - } - const resp = await this.promisified.login( - req, - this.ensureMetadata(metadata), - ensureCallOptions(options), - ); - const jwtResponse = messages.Jwt.deserializeBinary(resp.getJson_asU8()); - this.accessJwt = jwtResponse.getAccessJwt(); - this.refreshJwt = jwtResponse.getRefreshJwt(); - return jwtResponse; - } - - public alter( - op: messages.Operation, - metadata?: grpc.Metadata, - options?: grpc.CallOptions, - ): Promise { - return this.promisified.alter( - op, - this.ensureMetadata(metadata), - ensureCallOptions(options), - ); - } - - public async retryLogin( - metadata?: grpc.Metadata, - options?: grpc.CallOptions, - ): Promise { - if (this.refreshJwt.length === 0) { - throw ERR_REFRESH_JWT_EMPTY; - } - const req = new messages.LoginRequest(); - req.setRefreshToken(this.refreshJwt); - const resp = await this.promisified.login( - req, - this.ensureMetadata(metadata), - ensureCallOptions(options), - ); - const jwtResponse = messages.Jwt.deserializeBinary(resp.getJson_asU8()); - this.accessJwt = jwtResponse.getAccessJwt(); - this.refreshJwt = jwtResponse.getRefreshJwt(); - return jwtResponse; - } - - public query( - req: messages.Request, - metadata?: grpc.Metadata, - options?: grpc.CallOptions, - ): Promise { - return this.promisified.query( - req, - this.ensureMetadata(metadata), - ensureCallOptions(options), - ); + if (credentials === undefined) { + credentials = grpc.credentials.createInsecure() } - public mutate( - mu: messages.Mutation, - metadata?: grpc.Metadata, - options?: grpc.CallOptions, - ): Promise { - return this.promisified.mutate( - mu, - this.ensureMetadata(metadata), - ensureCallOptions(options), - ); + this.stub = new services.DgraphClient(addr, credentials, options) + this.promisified = { + login: promisify3(this.stub.login, this.stub), + alter: promisify3(this.stub.alter, this.stub), + query: promisify3(this.stub.query, this.stub), + mutate: promisify3(this.stub.mutate, this.stub), + commitOrAbort: promisify3(this.stub.commitOrAbort, this.stub), + checkVersion: promisify3(this.stub.checkVersion, this.stub), + waitForReady: promisify1(this.stub.waitForReady, this.stub), } - - public commitOrAbort( - ctx: messages.TxnContext, - metadata?: grpc.Metadata, - options?: grpc.CallOptions, - ): Promise { - return this.promisified.commitOrAbort( - ctx, - this.ensureMetadata(metadata), - ensureCallOptions(options), - ); + } + + public async login( + userid?: string, + password?: string, + refreshJwt?: string, + metadata?: grpc.Metadata, + options?: grpc.CallOptions, + ): Promise { + return this.loginIntoNamespace(userid, password, 0, refreshJwt, metadata, options) + } + + public async loginIntoNamespace( + userid?: string, + password?: string, + namespace?: number, + refreshJwt?: string, + metadata?: grpc.Metadata, + options?: grpc.CallOptions, + ): Promise { + const req = new messages.LoginRequest() + if (userid !== undefined) { + req.setUserid(userid) + req.setPassword(password) + req.setNamespace(namespace) + } else if (refreshJwt !== undefined) { + // Use the caller-supplied refreshJwt + req.setRefreshToken(refreshJwt) + } else { + req.setRefreshToken(this.refreshJwt) } - - public checkVersion( - check: messages.Check, - metadata?: grpc.Metadata, - options?: grpc.CallOptions, - ): Promise { - return this.promisified.checkVersion( - check, - this.ensureMetadata(metadata), - ensureCallOptions(options), - ); + const resp = await this.promisified.login( + req, + this.ensureMetadata(metadata), + ensureCallOptions(options), + ) + const jwtResponse = messages.Jwt.deserializeBinary(resp.getJson_asU8()) + this.accessJwt = jwtResponse.getAccessJwt() + this.refreshJwt = jwtResponse.getRefreshJwt() + return jwtResponse + } + + public alter( + op: messages.Operation, + metadata?: grpc.Metadata, + options?: grpc.CallOptions, + ): Promise { + return this.promisified.alter(op, this.ensureMetadata(metadata), ensureCallOptions(options)) + } + + public async retryLogin( + metadata?: grpc.Metadata, + options?: grpc.CallOptions, + ): Promise { + if (this.refreshJwt.length === 0) { + throw ERR_REFRESH_JWT_EMPTY } - - public waitForReady(deadline: grpc.Deadline): Promise { - return this.promisified.waitForReady(deadline); - } - - public close(): void { - return this.stub.close(); - } - - public grpcClient(): grpc.Client { - return this.stub; - } - - private ensureMetadata(metadata?: grpc.Metadata): grpc.Metadata { - const newMeta = metadata === undefined ? new grpc.Metadata() : metadata; - if (this.accessJwt !== "") { - newMeta.set("accessJwt", this.accessJwt); - } - return newMeta; + const req = new messages.LoginRequest() + req.setRefreshToken(this.refreshJwt) + const resp = await this.promisified.login( + req, + this.ensureMetadata(metadata), + ensureCallOptions(options), + ) + const jwtResponse = messages.Jwt.deserializeBinary(resp.getJson_asU8()) + this.accessJwt = jwtResponse.getAccessJwt() + this.refreshJwt = jwtResponse.getRefreshJwt() + return jwtResponse + } + + public query( + req: messages.Request, + metadata?: grpc.Metadata, + options?: grpc.CallOptions, + ): Promise { + return this.promisified.query(req, this.ensureMetadata(metadata), ensureCallOptions(options)) + } + + public mutate( + mu: messages.Mutation, + metadata?: grpc.Metadata, + options?: grpc.CallOptions, + ): Promise { + return this.promisified.mutate(mu, this.ensureMetadata(metadata), ensureCallOptions(options)) + } + + public commitOrAbort( + ctx: messages.TxnContext, + metadata?: grpc.Metadata, + options?: grpc.CallOptions, + ): Promise { + return this.promisified.commitOrAbort( + ctx, + this.ensureMetadata(metadata), + ensureCallOptions(options), + ) + } + + public checkVersion( + check: messages.Check, + metadata?: grpc.Metadata, + options?: grpc.CallOptions, + ): Promise { + return this.promisified.checkVersion( + check, + this.ensureMetadata(metadata), + ensureCallOptions(options), + ) + } + + public waitForReady(deadline: grpc.Deadline): Promise { + return this.promisified.waitForReady(deadline) + } + + public close(): void { + return this.stub.close() + } + + public grpcClient(): grpc.Client { + return this.stub + } + + private ensureMetadata(metadata?: grpc.Metadata): grpc.Metadata { + const newMeta = metadata === undefined ? new grpc.Metadata() : metadata + if (this.accessJwt !== "") { + newMeta.set("accessJwt", this.accessJwt) } + return newMeta + } } function ensureCallOptions(options?: grpc.CallOptions): grpc.CallOptions { - return options === undefined - ? { - propagate_flags: grpc.propagate.DEFAULTS, - credentials: undefined, - } - : options; + return options === undefined + ? { + propagate_flags: grpc.propagate.DEFAULTS, + credentials: undefined, + } + : options } diff --git a/src/clientStubFromSlash.ts b/src/clientStubFromSlash.ts index 818620c..301b6ac 100644 --- a/src/clientStubFromSlash.ts +++ b/src/clientStubFromSlash.ts @@ -1,43 +1,34 @@ -import * as grpc from "@grpc/grpc-js"; -import * as Url from "url-parse"; -import { DgraphClientStub } from "./clientStub"; +import * as grpc from "@grpc/grpc-js" +import * as Url from "url-parse" +import { DgraphClientStub } from "./clientStub" -const PORT = "443"; +const PORT = "443" /** * @deprecated since v21.3 and will be removed in v21.07 release. * Please use {@link clientStubFromCloudEndpoint} instead. */ -export function clientStubFromSlashGraphQLEndpoint( - graphqlEndpoint: string, - apiKey: string, -) { - return clientStubFromCloudEndpoint(graphqlEndpoint, apiKey); +export function clientStubFromSlashGraphQLEndpoint(graphqlEndpoint: string, apiKey: string) { + return clientStubFromCloudEndpoint(graphqlEndpoint, apiKey) } -export function clientStubFromCloudEndpoint( - graphqlEndpoint: string, - apiKey: string, -) { - const url = new Url(graphqlEndpoint); - const urlParts = url.host.split("."); - const firstHalf = urlParts[0]; - const secondHalf = `${urlParts.splice(1).join(".")}:${PORT}`; - const backenedURL = `${firstHalf}.grpc.${secondHalf}`; +export function clientStubFromCloudEndpoint(graphqlEndpoint: string, apiKey: string) { + const url = new Url(graphqlEndpoint) + const urlParts = url.host.split(".") + const firstHalf = urlParts[0] + const secondHalf = `${urlParts.splice(1).join(".")}:${PORT}` + const backenedURL = `${firstHalf}.grpc.${secondHalf}` - const metaCreds = grpc.credentials.createFromMetadataGenerator( - ( - _: Object, - callback: (_: undefined, metadata: grpc.Metadata) => void, - ) => { - const metadata = new grpc.Metadata(); - metadata.add("authorization", apiKey); - callback(undefined, metadata); - }, - ); - const credentials = grpc.credentials.combineChannelCredentials( - grpc.credentials.createSsl(), - metaCreds, - ); - return new DgraphClientStub(backenedURL, credentials); + const metaCreds = grpc.credentials.createFromMetadataGenerator( + (_: object, callback: (_: undefined, metadata: grpc.Metadata) => void) => { + const metadata = new grpc.Metadata() + metadata.add("authorization", apiKey) + callback(undefined, metadata) + }, + ) + const credentials = grpc.credentials.combineChannelCredentials( + grpc.credentials.createSsl(), + metaCreds, + ) + return new DgraphClientStub(backenedURL, credentials) } diff --git a/src/dgraph.ts b/src/dgraph.ts index 2ea2a25..8f25b7c 100644 --- a/src/dgraph.ts +++ b/src/dgraph.ts @@ -1,30 +1,30 @@ // Export all the required message types. -export * from "./types"; +export * from "./types" export { - Operation, - Request, - TxnContext, - Check, - Version, - NQuad, - Value, - Facet, - Latency, -} from "../generated/api_pb"; + Operation, + Request, + TxnContext, + Check, + Version, + NQuad, + Value, + Facet, + Latency, +} from "../generated/api_pb" // Export DgraphClientStub class. -export * from "./clientStub"; +export * from "./clientStub" // Export DgraphClient class and deleteEdges function. -export * from "./client"; +export * from "./client" //Export clientStubFromSlashGraphQLEndpoint function. -export * from "./clientStubFromSlash"; +export * from "./clientStubFromSlash" // Export Txn class. -export * from "./txn"; +export * from "./txn" // Export error constants. -export * from "./errors"; +export * from "./errors" -export * as grpc from "@grpc/grpc-js"; +export * as grpc from "@grpc/grpc-js" diff --git a/src/errors.ts b/src/errors.ts index d500175..3619ac8 100644 --- a/src/errors.ts +++ b/src/errors.ts @@ -1,6 +1,8 @@ -export const ERR_NO_CLIENTS = new Error("No clients provided in DgraphClient constructor"); -export const ERR_FINISHED = new Error("Transaction has already been committed or discarded"); -export const ERR_ABORTED = new Error("Transaction has been aborted. Please retry"); -export const ERR_BEST_EFFORT_REQUIRED_READ_ONLY = new Error("Best effort only works for read-only queries"); -export const ERR_READ_ONLY = new Error("Readonly transaction cannot run mutations or be committed"); -export const ERR_REFRESH_JWT_EMPTY = new Error("refresh jwt should not be empty"); +export const ERR_NO_CLIENTS = new Error("No clients provided in DgraphClient constructor") +export const ERR_FINISHED = new Error("Transaction has already been committed or discarded") +export const ERR_ABORTED = new Error("Transaction has been aborted. Please retry") +export const ERR_BEST_EFFORT_REQUIRED_READ_ONLY = new Error( + "Best effort only works for read-only queries", +) +export const ERR_READ_ONLY = new Error("Readonly transaction cannot run mutations or be committed") +export const ERR_REFRESH_JWT_EMPTY = new Error("refresh jwt should not be empty") diff --git a/src/index.ts b/src/index.ts index 12f8aea..aba1422 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,4 @@ -import * as dgraph from "./dgraph"; +import * as dgraph from "./dgraph" -export * from "./dgraph"; -export default dgraph; +export * from "./dgraph" +export default dgraph diff --git a/src/txn.ts b/src/txn.ts index 8dad53f..aa46d2f 100644 --- a/src/txn.ts +++ b/src/txn.ts @@ -1,21 +1,21 @@ -import * as grpc from "@grpc/grpc-js"; +import * as grpc from "@grpc/grpc-js" -import * as messages from "../generated/api_pb"; +import * as messages from "../generated/api_pb" -import { DgraphClient, isJwtExpired } from "./client"; +import { DgraphClient, isJwtExpired } from "./client" import { - ERR_ABORTED, - ERR_BEST_EFFORT_REQUIRED_READ_ONLY, - ERR_FINISHED, - ERR_READ_ONLY, -} from "./errors"; -import * as types from "./types"; -import { isAbortedError, isConflictError, stringifyMessage } from "./util"; + ERR_ABORTED, + ERR_BEST_EFFORT_REQUIRED_READ_ONLY, + ERR_FINISHED, + ERR_READ_ONLY, +} from "./errors" +import * as types from "./types" +import { isAbortedError, isConflictError, stringifyMessage } from "./util" export type TxnOptions = { - readOnly?: boolean; - bestEffort?: boolean; -}; + readOnly?: boolean + bestEffort?: boolean +} /** * Txn is a single atomic transaction. @@ -32,318 +32,300 @@ export type TxnOptions = { * after calling commit. */ export class Txn { - private readonly dc: DgraphClient; - private readonly ctx: messages.TxnContext; - private finished: boolean = false; - private mutated: boolean = false; - private readonly useReadOnly: boolean = false; - private readonly useBestEffort: boolean = false; - - constructor(dc: DgraphClient, txnOpts?: TxnOptions) { - this.dc = dc; - this.ctx = new messages.TxnContext(); - const defaultedTxnOpts = { - readOnly: false, - bestEffort: false, - ...txnOpts, - }; - this.useReadOnly = defaultedTxnOpts.readOnly; - this.useBestEffort = defaultedTxnOpts.bestEffort; - if (this.useBestEffort && !this.useReadOnly) { - this.dc.debug( - `Client attempted to query using best-effort without setting the transaction to read-only`, - ); - throw ERR_BEST_EFFORT_REQUIRED_READ_ONLY; - } + private readonly dc: DgraphClient + private readonly ctx: messages.TxnContext + private finished: boolean = false + private mutated: boolean = false + private readonly useReadOnly: boolean = false + private readonly useBestEffort: boolean = false + + constructor(dc: DgraphClient, txnOpts?: TxnOptions) { + this.dc = dc + this.ctx = new messages.TxnContext() + const defaultedTxnOpts = { + readOnly: false, + bestEffort: false, + ...txnOpts, } - - /** - * query sends a query to one of the connected Dgraph instances. If no mutations - * need to be made in the same transaction, it's convenient to chain the method, - * e.g. client.newTxn().query("..."). - */ - public query( - q: string, - metadata?: grpc.Metadata, - options?: grpc.CallOptions, - ): Promise { - return this.queryWithVars(q, undefined, metadata, options); + this.useReadOnly = defaultedTxnOpts.readOnly + this.useBestEffort = defaultedTxnOpts.bestEffort + if (this.useBestEffort && !this.useReadOnly) { + this.dc.debug( + `Client attempted to query using best-effort without setting the transaction to read-only`, + ) + throw ERR_BEST_EFFORT_REQUIRED_READ_ONLY + } + } + + /** + * query sends a query to one of the connected Dgraph instances. If no mutations + * need to be made in the same transaction, it's convenient to chain the method, + * e.g. client.newTxn().query("..."). + */ + public query( + q: string, + metadata?: grpc.Metadata, + options?: grpc.CallOptions, + ): Promise { + return this.queryWithVars(q, undefined, metadata, options) + } + + /** + * queryWithVars is like query, but allows a variable map to be used. This can + * provide safety against injection attacks. + */ + public async queryWithVars( + q: string, + vars?: { [k: string]: any }, + metadata?: grpc.Metadata, + options?: grpc.CallOptions, + ): Promise { + if (this.finished) { + this.dc.debug(`Query request (ERR_FINISHED):\nquery = ${q}\nvars = ${vars}`) + throw ERR_FINISHED } - /** - * queryWithVars is like query, but allows a variable map to be used. This can - * provide safety against injection attacks. - */ - public async queryWithVars( - q: string, - vars?: { [k: string]: any }, // tslint:disable-line no-any - metadata?: grpc.Metadata, - options?: grpc.CallOptions, - ): Promise { - if (this.finished) { - this.dc.debug( - `Query request (ERR_FINISHED):\nquery = ${q}\nvars = ${vars}`, - ); - throw ERR_FINISHED; - } - - const req = new messages.Request(); - req.setQuery(q); - req.setStartTs(this.ctx.getStartTs()); - req.setReadOnly(this.useReadOnly); - req.setBestEffort(this.useBestEffort); - - if (vars !== undefined) { - const varsMap = req.getVarsMap(); - Object.keys(vars).forEach((key: string) => { - const value = vars[key]; - if (typeof value === "string" || value instanceof String) { - varsMap.set(key, value.toString()); - } - }); + const req = new messages.Request() + req.setQuery(q) + req.setStartTs(this.ctx.getStartTs()) + req.setReadOnly(this.useReadOnly) + req.setBestEffort(this.useBestEffort) + + if (vars !== undefined) { + const varsMap = req.getVarsMap() + Object.keys(vars).forEach((key: string) => { + const value = vars[key] + if (typeof value === "string" || value instanceof String) { + varsMap.set(key, value.toString()) } - - return this.doRequest(req, metadata, options); + }) } - /** - * query sends a query to one of the connected Dgraph instances. If no mutations - * need to be made in the same transaction, it's convenient to chain the method, - * e.g. client.newTxn().query("..."). - */ - public queryRDF( - q: string, - metadata?: grpc.Metadata, - options?: grpc.CallOptions - ): Promise { - return this.queryRDFWithVars(q, undefined, metadata, options); + return this.doRequest(req, metadata, options) + } + + /** + * query sends a query to one of the connected Dgraph instances. If no mutations + * need to be made in the same transaction, it's convenient to chain the method, + * e.g. client.newTxn().query("..."). + */ + public queryRDF( + q: string, + metadata?: grpc.Metadata, + options?: grpc.CallOptions, + ): Promise { + return this.queryRDFWithVars(q, undefined, metadata, options) + } + + /** + * queryRDFWithVars is like query, but allows a variable map to be used. This can + * provide safety against injection attacks. + */ + public async queryRDFWithVars( + q: string, + vars?: { [k: string]: any }, + metadata?: grpc.Metadata, + options?: grpc.CallOptions, + ): Promise { + if (this.finished) { + this.dc.debug(`Query request (ERR_FINISHED):\nquery = ${q}\nvars = ${vars}`) + throw ERR_FINISHED } - /** - * queryRDFWithVars is like query, but allows a variable map to be used. This can - * provide safety against injection attacks. - */ - public async queryRDFWithVars( - q: string, - vars?: { [k: string]: any }, // tslint:disable-line no-any - metadata?: grpc.Metadata, - options?: grpc.CallOptions - ): Promise { - if (this.finished) { - this.dc.debug( - `Query request (ERR_FINISHED):\nquery = ${q}\nvars = ${vars}` - ); - throw ERR_FINISHED; - } - - const req = new messages.Request(); - req.setQuery(q); - req.setStartTs(this.ctx.getStartTs()); - req.setReadOnly(this.useReadOnly); - req.setBestEffort(this.useBestEffort); - req.setRespFormat(messages.Request.RespFormat.RDF); - - if (vars !== undefined) { - const varsMap = req.getVarsMap(); - Object.keys(vars).forEach((key: string) => { - const value = vars[key]; - if (typeof value === "string" || value instanceof String) { - varsMap.set(key, value.toString()); - } - }); + const req = new messages.Request() + req.setQuery(q) + req.setStartTs(this.ctx.getStartTs()) + req.setReadOnly(this.useReadOnly) + req.setBestEffort(this.useBestEffort) + req.setRespFormat(messages.Request.RespFormat.RDF) + + if (vars !== undefined) { + const varsMap = req.getVarsMap() + Object.keys(vars).forEach((key: string) => { + const value = vars[key] + if (typeof value === "string" || value instanceof String) { + varsMap.set(key, value.toString()) } - - return this.doRequest(req, metadata, options); + }) } - /** - * mutate allows data stored on Dgraph instances to be modified. The fields in - * Mutation come in pairs, set and delete. Mutations can either be encoded as - * JSON or as RDFs. - * - * If commitNow is set, then this call will result in the transaction being - * committed. In this case, an explicit call to commit doesn't need to - * subsequently be made. - * - * If the mutation fails, then the transaction is discarded and all future - * operations on it will fail. - */ - public async mutate( - mu: types.Mutation, - metadata?: grpc.Metadata, - options?: grpc.CallOptions, - ): Promise { - const req = new messages.Request(); - req.setStartTs(this.ctx.getStartTs()); - req.setMutationsList([mu]); - req.setCommitNow(mu.getCommitNow()); - - return this.doRequest(req, metadata, options); + return this.doRequest(req, metadata, options) + } + + /** + * mutate allows data stored on Dgraph instances to be modified. The fields in + * Mutation come in pairs, set and delete. Mutations can either be encoded as + * JSON or as RDFs. + * + * If commitNow is set, then this call will result in the transaction being + * committed. In this case, an explicit call to commit doesn't need to + * subsequently be made. + * + * If the mutation fails, then the transaction is discarded and all future + * operations on it will fail. + */ + public async mutate( + mu: types.Mutation, + metadata?: grpc.Metadata, + options?: grpc.CallOptions, + ): Promise { + const req = new messages.Request() + req.setStartTs(this.ctx.getStartTs()) + req.setMutationsList([mu]) + req.setCommitNow(mu.getCommitNow()) + + return this.doRequest(req, metadata, options) + } + + public async doRequest( + req: messages.Request, + metadata?: grpc.Metadata, + options?: grpc.CallOptions, + ): Promise { + const mutationList = req.getMutationsList() + if (this.finished) { + this.dc.debug( + `Do request (ERR_FINISHED):\nquery = ${req.getQuery()}\nvars = ${req.getVarsMap()}`, + ) + this.dc.debug(`Do request (ERR_FINISHED):\nmutation = ${stringifyMessage(mutationList[0])}`) + throw ERR_FINISHED } - public async doRequest( - req: messages.Request, - metadata?: grpc.Metadata, - options?: grpc.CallOptions, - ): Promise { - const mutationList = req.getMutationsList(); - if (this.finished) { - this.dc.debug( - `Do request (ERR_FINISHED):\nquery = ${req.getQuery()}\nvars = ${req.getVarsMap()}`, - ); - this.dc.debug( - `Do request (ERR_FINISHED):\nmutation = ${stringifyMessage( - mutationList[0], - )}`, - ); - throw ERR_FINISHED; - } - - if (mutationList.length > 0) { - if (this.useReadOnly) { - this.dc.debug( - `Do request (ERR_READ_ONLY):\nmutation = ${stringifyMessage( - mutationList[0], - )}`, - ); - throw ERR_READ_ONLY; - } - this.mutated = true; - } - - req.setStartTs(this.ctx.getStartTs()); - req.setHash(this.ctx.getHash()); - this.dc.debug(`Do request:\n${stringifyMessage(req)}`); + if (mutationList.length > 0) { + if (this.useReadOnly) { + this.dc.debug( + `Do request (ERR_READ_ONLY):\nmutation = ${stringifyMessage(mutationList[0])}`, + ) + throw ERR_READ_ONLY + } + this.mutated = true + } - let resp: types.Response; - const c = this.dc.anyClient(); - const operation = async () => c.query(req, metadata, options); + req.setStartTs(this.ctx.getStartTs()) + req.setHash(this.ctx.getHash()) + this.dc.debug(`Do request:\n${stringifyMessage(req)}`) + + let resp: types.Response + const c = this.dc.anyClient() + const operation = async () => c.query(req, metadata, options) + try { + resp = types.createResponse(await operation()) + } catch (e) { + if (isJwtExpired(e) === true) { + await c.retryLogin(metadata, options) + resp = types.createResponse(await operation()) + } else { + // Since a mutation error occurred, the txn should no longer be used (some + // mutations could have applied but not others, but we don't know which ones). + // Discarding the transaction enforces that the user cannot use the txn further. try { - resp = types.createResponse(await operation()); - } catch (e) { - if (isJwtExpired(e) === true) { - await c.retryLogin(metadata, options); - resp = types.createResponse(await operation()); - } else { - // Since a mutation error occurred, the txn should no longer be used (some - // mutations could have applied but not others, but we don't know which ones). - // Discarding the transaction enforces that the user cannot use the txn further. - try { - await this.discard(metadata, options); - } catch (e) { - // Ignore error - user should see the original error. - } - - // Transaction could be aborted(status.ABORTED) if commitNow was true, or server - // could send a message that this mutation conflicts(status.FAILED_PRECONDITION) - // with another transaction. - throw isAbortedError(e) || isConflictError(e) ? ERR_ABORTED : e; - } - } - - if (req.getCommitNow()) { - this.finished = true; + await this.discard(metadata, options) + } catch { + // Ignore error - user should see the original error. } - this.mergeContext(resp.getTxn()); - this.dc.debug(`Do request:\nresponse = ${stringifyMessage(resp)}`); - - return resp; + // Transaction could be aborted(status.ABORTED) if commitNow was true, or server + // could send a message that this mutation conflicts(status.FAILED_PRECONDITION) + // with another transaction. + throw isAbortedError(e) || isConflictError(e) ? ERR_ABORTED : e + } } - /** - * commit commits any mutations that have been made in the transaction. Once - * commit has been called, the lifespan of the transaction is complete. - * - * Errors could be thrown for various reasons. Notably, ERR_ABORTED could be - * thrown if transactions that modify the same data are being run concurrently. - * It's up to the user to decide if they wish to retry. In this case, the user - * should create a new transaction. - */ - public async commit( - metadata?: grpc.Metadata, - options?: grpc.CallOptions, - ): Promise { - if (this.finished) { - throw ERR_FINISHED; - } + if (req.getCommitNow()) { + this.finished = true + } - this.finished = true; - if (!this.mutated) { - return; - } + this.mergeContext(resp.getTxn()) + this.dc.debug(`Do request:\nresponse = ${stringifyMessage(resp)}`) + + return resp + } + + /** + * commit commits any mutations that have been made in the transaction. Once + * commit has been called, the lifespan of the transaction is complete. + * + * Errors could be thrown for various reasons. Notably, ERR_ABORTED could be + * thrown if transactions that modify the same data are being run concurrently. + * It's up to the user to decide if they wish to retry. In this case, the user + * should create a new transaction. + */ + public async commit(metadata?: grpc.Metadata, options?: grpc.CallOptions): Promise { + if (this.finished) { + throw ERR_FINISHED + } - const c = this.dc.anyClient(); - const operation = async () => - c.commitOrAbort(this.ctx, metadata, options); - try { - await operation(); - } catch (e) { - if (isJwtExpired(e) === true) { - await c.retryLogin(metadata, options); - await operation(); - } else { - throw isAbortedError(e) ? ERR_ABORTED : e; - } - } + this.finished = true + if (!this.mutated) { + return } - /** - * discard cleans up the resources associated with an uncommitted transaction - * that contains mutations. It is a no-op on transactions that have already been - * committed or don't contain mutations. Therefore it is safe (and recommended) - * to call it in a finally block. - * - * In some cases, the transaction can't be discarded, e.g. the grpc connection - * is unavailable. In these cases, the server will eventually do the transaction - * clean up. - */ - public async discard( - metadata?: grpc.Metadata, - options?: grpc.CallOptions, - ): Promise { - if (this.finished) { - return; - } + const c = this.dc.anyClient() + const operation = async () => c.commitOrAbort(this.ctx, metadata, options) + try { + await operation() + } catch (e) { + if (isJwtExpired(e) === true) { + await c.retryLogin(metadata, options) + await operation() + } else { + throw isAbortedError(e) ? ERR_ABORTED : e + } + } + } + + /** + * discard cleans up the resources associated with an uncommitted transaction + * that contains mutations. It is a no-op on transactions that have already been + * committed or don't contain mutations. Therefore it is safe (and recommended) + * to call it in a finally block. + * + * In some cases, the transaction can't be discarded, e.g. the grpc connection + * is unavailable. In these cases, the server will eventually do the transaction + * clean up. + */ + public async discard(metadata?: grpc.Metadata, options?: grpc.CallOptions): Promise { + if (this.finished) { + return + } - this.finished = true; - if (!this.mutated) { - return; - } + this.finished = true + if (!this.mutated) { + return + } - this.ctx.setAborted(true); - const c = this.dc.anyClient(); - const operation = async () => - c.commitOrAbort(this.ctx, metadata, options); - try { - await operation(); - } catch (e) { - if (isJwtExpired(e) === true) { - await c.retryLogin(metadata, options); - await operation(); - } else { - throw isAbortedError(e) ? ERR_ABORTED : e; - } - } + this.ctx.setAborted(true) + const c = this.dc.anyClient() + const operation = async () => c.commitOrAbort(this.ctx, metadata, options) + try { + await operation() + } catch (e) { + if (isJwtExpired(e) === true) { + await c.retryLogin(metadata, options) + await operation() + } else { + throw isAbortedError(e) ? ERR_ABORTED : e + } } + } - private mergeContext(src?: messages.TxnContext): void { - if (src === undefined) { - // This condition will be true only if the server doesn't return a txn context after a query or mutation. - return; - } + private mergeContext(src?: messages.TxnContext): void { + if (src === undefined) { + // This condition will be true only if the server doesn't return a txn context after a query or mutation. + return + } - this.ctx.setHash(src.getHash()); + this.ctx.setHash(src.getHash()) - if (this.ctx.getStartTs() === 0) { - this.ctx.setStartTs(src.getStartTs()); - } else if (this.ctx.getStartTs() !== src.getStartTs()) { - // This condition should never be true. - throw new Error("StartTs mismatch"); - } + if (this.ctx.getStartTs() === 0) { + this.ctx.setStartTs(src.getStartTs()) + } else if (this.ctx.getStartTs() !== src.getStartTs()) { + // This condition should never be true. + throw new Error("StartTs mismatch") + } - for (const key of src.getKeysList()) { - this.ctx.addKeys(key); - } + for (const key of src.getKeysList()) { + this.ctx.addKeys(key) } + } } diff --git a/src/types.ts b/src/types.ts index e27cd85..b99c607 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,10 +1,8 @@ -import * as jspb from "google-protobuf"; +import * as jspb from "google-protobuf" -import * as messages from "../generated/api_pb"; +import * as messages from "../generated/api_pb" -import { b64ToStr, isBase64, strToB64, strToJson, strToU8, u8ToStr } from "./util"; - -// tslint:disable max-classes-per-file +import { b64ToStr, isBase64, strToB64, strToJson, strToU8, u8ToStr } from "./util" // Alter classes. @@ -12,56 +10,56 @@ import { b64ToStr, isBase64, strToB64, strToJson, strToU8, u8ToStr } from "./uti * Payload represents the return value of an alter operation. */ export class Payload extends messages.Payload { - public getData(): any { // tslint:disable-line no-any - let jsonStr: string; - const value = super.getData(); - if (value instanceof Uint8Array) { - jsonStr = u8ToStr(value); - } else { - jsonStr = b64ToStr(value); - } - - return strToJson(jsonStr); + public getData(): any { + let jsonStr: string + const value = super.getData() + if (value instanceof Uint8Array) { + jsonStr = u8ToStr(value) + } else { + jsonStr = b64ToStr(value) } - public getData_asB64(): string { - const value = super.getData(); - if (value instanceof Uint8Array) { - return jspb.Message.bytesAsB64(value); - } + return strToJson(jsonStr) + } - return value; + public getData_asB64(): string { + const value = super.getData() + if (value instanceof Uint8Array) { + return jspb.Message.bytesAsB64(value) } - public getData_asU8(): Uint8Array { - const value = super.getData(); - if (typeof value === "string" || value instanceof String) { - return jspb.Message.bytesAsU8(value.toString()); - } + return value + } - return value; + public getData_asU8(): Uint8Array { + const value = super.getData() + if (typeof value === "string" || value instanceof String) { + return jspb.Message.bytesAsU8(value.toString()) } - public setData(value: any): void { // tslint:disable-line no-any - if (value instanceof Uint8Array) { - super.setData(value); - return; - } - if (typeof value === "string" || value instanceof String) { - super.setData(value.toString()); - return; - } - - const jsonStr = JSON.stringify(value); - super.setData(strToU8(jsonStr)); + return value + } + + public setData(value: any): void { + if (value instanceof Uint8Array) { + super.setData(value) + return + } + if (typeof value === "string" || value instanceof String) { + super.setData(value.toString()) + return } + + const jsonStr = JSON.stringify(value) + super.setData(strToU8(jsonStr)) + } } export function createPayload(oldPayload: messages.Payload): Payload { - return messages.Payload.deserializeBinaryFromReader( - new Payload(), - new jspb.BinaryReader(oldPayload.serializeBinary()), - ); + return messages.Payload.deserializeBinaryFromReader( + new Payload(), + new jspb.BinaryReader(oldPayload.serializeBinary()), + ) } // Mutation and Query classes. @@ -70,56 +68,56 @@ export function createPayload(oldPayload: messages.Payload): Payload { * Response represents the return value of a mutation or query operations. */ export class Response extends messages.Response { - public getJson(): any { // tslint:disable-line no-any - let jsonStr: string; - const value = super.getJson(); - if (value instanceof Uint8Array) { - jsonStr = u8ToStr(value); - } else { - jsonStr = b64ToStr(value); - } - - return strToJson(jsonStr); + public getJson(): any { + let jsonStr: string + const value = super.getJson() + if (value instanceof Uint8Array) { + jsonStr = u8ToStr(value) + } else { + jsonStr = b64ToStr(value) } - public getJson_asB64(): string { - const value = super.getJson(); - if (value instanceof Uint8Array) { - return jspb.Message.bytesAsB64(value); - } + return strToJson(jsonStr) + } - return value; + public getJson_asB64(): string { + const value = super.getJson() + if (value instanceof Uint8Array) { + return jspb.Message.bytesAsB64(value) } - public getJson_asU8(): Uint8Array { - const value = super.getJson(); - if (typeof value === "string" || value instanceof String) { - return jspb.Message.bytesAsU8(value.toString()); - } + return value + } - return value; + public getJson_asU8(): Uint8Array { + const value = super.getJson() + if (typeof value === "string" || value instanceof String) { + return jspb.Message.bytesAsU8(value.toString()) } - public setJson(value: any): void { // tslint:disable-line no-any - if (value instanceof Uint8Array) { - super.setJson(value); - return; - } - if (typeof value === "string" || value instanceof String) { - super.setJson(value.toString()); - return; - } - - const jsonStr = JSON.stringify(value); - super.setJson(strToU8(jsonStr)); + return value + } + + public setJson(value: any): void { + if (value instanceof Uint8Array) { + super.setJson(value) + return } + if (typeof value === "string" || value instanceof String) { + super.setJson(value.toString()) + return + } + + const jsonStr = JSON.stringify(value) + super.setJson(strToU8(jsonStr)) + } } export function createResponse(oldResponse: messages.Response): Response { - return messages.Response.deserializeBinaryFromReader( - new Response(), - new jspb.BinaryReader(oldResponse.serializeBinary()), - ); + return messages.Response.deserializeBinaryFromReader( + new Response(), + new jspb.BinaryReader(oldResponse.serializeBinary()), + ) } // Mutate classes. @@ -128,171 +126,171 @@ export function createResponse(oldResponse: messages.Response): Response { * Mutation represents the request value of a muatate operation. */ export class Mutation extends messages.Mutation { - public getSetJson(): any { // tslint:disable-line no-any - let jsonStr: string; - const value = super.getSetJson(); - if (value instanceof Uint8Array) { - jsonStr = u8ToStr(value); - } else { - jsonStr = b64ToStr(value); - } - - return strToJson(jsonStr); + public getSetJson(): any { + let jsonStr: string + const value = super.getSetJson() + if (value instanceof Uint8Array) { + jsonStr = u8ToStr(value) + } else { + jsonStr = b64ToStr(value) } - public getSetJson_asB64(): string { - const value = super.getSetJson(); - if (value instanceof Uint8Array) { - return jspb.Message.bytesAsB64(value); - } + return strToJson(jsonStr) + } - return value; + public getSetJson_asB64(): string { + const value = super.getSetJson() + if (value instanceof Uint8Array) { + return jspb.Message.bytesAsB64(value) } - public getSetJson_asU8(): Uint8Array { - const value = super.getSetJson(); - if (typeof value === "string" || value instanceof String) { - return jspb.Message.bytesAsU8(value.toString()); - } + return value + } - return value; + public getSetJson_asU8(): Uint8Array { + const value = super.getSetJson() + if (typeof value === "string" || value instanceof String) { + return jspb.Message.bytesAsU8(value.toString()) } - public setSetJson(value: any): void { // tslint:disable-line no-any - if (value instanceof Uint8Array) { - super.setSetJson(value); - return; - } - if (typeof value === "string" || value instanceof String) { - super.setSetJson(value.toString()); - return; - } - - const jsonStr = JSON.stringify(value); - super.setSetJson(strToU8(jsonStr)); - } + return value + } - public getDeleteJson(): any { // tslint:disable-line no-any - let jsonStr: string; - const value = super.getDeleteJson(); - if (value instanceof Uint8Array) { - jsonStr = u8ToStr(value); - } else { - jsonStr = b64ToStr(value); - } + public setSetJson(value: any): void { + if (value instanceof Uint8Array) { + super.setSetJson(value) + return + } + if (typeof value === "string" || value instanceof String) { + super.setSetJson(value.toString()) + return + } - return strToJson(jsonStr); + const jsonStr = JSON.stringify(value) + super.setSetJson(strToU8(jsonStr)) + } + + public getDeleteJson(): any { + let jsonStr: string + const value = super.getDeleteJson() + if (value instanceof Uint8Array) { + jsonStr = u8ToStr(value) + } else { + jsonStr = b64ToStr(value) } - public getDeleteJson_asB64(): string { - const value = super.getDeleteJson(); - if (value instanceof Uint8Array) { - return jspb.Message.bytesAsB64(value); - } + return strToJson(jsonStr) + } - return value; + public getDeleteJson_asB64(): string { + const value = super.getDeleteJson() + if (value instanceof Uint8Array) { + return jspb.Message.bytesAsB64(value) } - public getDeleteJson_asU8(): Uint8Array { - const value = super.getDeleteJson(); - if (typeof value === "string" || value instanceof String) { - return jspb.Message.bytesAsU8(value.toString()); - } + return value + } - return value; + public getDeleteJson_asU8(): Uint8Array { + const value = super.getDeleteJson() + if (typeof value === "string" || value instanceof String) { + return jspb.Message.bytesAsU8(value.toString()) } - public setDeleteJson(value: any): void { // tslint:disable-line no-any - if (value instanceof Uint8Array) { - super.setDeleteJson(value); - return; - } - if (typeof value === "string" || value instanceof String) { - super.setDeleteJson(value.toString()); - return; - } - - const jsonStr = JSON.stringify(value); - super.setDeleteJson(strToU8(jsonStr)); + return value + } + + public setDeleteJson(value: any): void { + if (value instanceof Uint8Array) { + super.setDeleteJson(value) + return + } + if (typeof value === "string" || value instanceof String) { + super.setDeleteJson(value.toString()) + return } - public getSetNquads(): Uint8Array | string { - const value = super.getSetNquads(); - if (value instanceof Uint8Array) { - return u8ToStr(value); - } + const jsonStr = JSON.stringify(value) + super.setDeleteJson(strToU8(jsonStr)) + } - return b64ToStr(value); + public getSetNquads(): Uint8Array | string { + const value = super.getSetNquads() + if (value instanceof Uint8Array) { + return u8ToStr(value) } - public getSetNquads_asB64(): string { - const value = super.getSetNquads(); - if (value instanceof Uint8Array) { - return jspb.Message.bytesAsB64(value); - } + return b64ToStr(value) + } - return value; + public getSetNquads_asB64(): string { + const value = super.getSetNquads() + if (value instanceof Uint8Array) { + return jspb.Message.bytesAsB64(value) } - public getSetNquads_asU8(): Uint8Array { - const value = super.getSetNquads(); - if (typeof value === "string" || value instanceof String) { - return jspb.Message.bytesAsU8(value.toString()); - } + return value + } - return value; + public getSetNquads_asU8(): Uint8Array { + const value = super.getSetNquads() + if (typeof value === "string" || value instanceof String) { + return jspb.Message.bytesAsU8(value.toString()) } - public setSetNquads(value: Uint8Array | string): void { - if (value instanceof Uint8Array) { - super.setSetNquads(value); - return; - } - if (isBase64(value)) { - super.setSetNquads(value); - return; - } - - super.setSetNquads(strToB64(value)); + return value + } + + public setSetNquads(value: Uint8Array | string): void { + if (value instanceof Uint8Array) { + super.setSetNquads(value) + return + } + if (isBase64(value)) { + super.setSetNquads(value) + return } - public getDelNquads(): Uint8Array | string { - const value = super.getDelNquads(); - if (value instanceof Uint8Array) { - return u8ToStr(value); - } + super.setSetNquads(strToB64(value)) + } - return b64ToStr(value); + public getDelNquads(): Uint8Array | string { + const value = super.getDelNquads() + if (value instanceof Uint8Array) { + return u8ToStr(value) } - public getDelNquads_asB64(): string { - const value = super.getDelNquads(); - if (value instanceof Uint8Array) { - return jspb.Message.bytesAsB64(value); - } + return b64ToStr(value) + } - return value; + public getDelNquads_asB64(): string { + const value = super.getDelNquads() + if (value instanceof Uint8Array) { + return jspb.Message.bytesAsB64(value) } - public getDelNquads_asU8(): Uint8Array { - const value = super.getDelNquads(); - if (typeof value === "string" || value instanceof String) { - return jspb.Message.bytesAsU8(value.toString()); - } + return value + } - return value; + public getDelNquads_asU8(): Uint8Array { + const value = super.getDelNquads() + if (typeof value === "string" || value instanceof String) { + return jspb.Message.bytesAsU8(value.toString()) } - public setDelNquads(value: Uint8Array | string): void { - if (value instanceof Uint8Array) { - super.setDelNquads(value); - return; - } - if (isBase64(value)) { - super.setDelNquads(value); - return; - } - - super.setDelNquads(strToB64(value)); + return value + } + + public setDelNquads(value: Uint8Array | string): void { + if (value instanceof Uint8Array) { + super.setDelNquads(value) + return } + if (isBase64(value)) { + super.setDelNquads(value) + return + } + + super.setDelNquads(strToB64(value)) + } } diff --git a/src/util.ts b/src/util.ts index 9bcbcbd..ed4c880 100644 --- a/src/util.ts +++ b/src/util.ts @@ -1,123 +1,104 @@ -import * as grpc from "@grpc/grpc-js"; -import * as jspb from "google-protobuf"; +import * as grpc from "@grpc/grpc-js" +import * as jspb from "google-protobuf" -export function errorCode(err: any): { valid: boolean; code: number } { // tslint:disable-line no-any - if ( - err === undefined || - typeof err !== "object" || - !err.hasOwnProperty("code") || // eslint-disable-line @typescript-eslint/tslint/config - typeof err.code !== "number" // eslint-disable-line @typescript-eslint/tslint/config - ) { - return { - valid: false, - code: -1, - }; +export function errorCode(err: any): { valid: boolean; code: number } { + if ( + err === undefined || + typeof err !== "object" || + !Object.prototype.hasOwnProperty.call(err, "code") || + typeof (err as { code?: any }).code !== "number" + ) { + return { + valid: false, + code: -1, } + } - return { - valid: true, - code: (<{ code: number }>err).code, - }; + return { + valid: true, + code: (<{ code: number }>err).code, + } } -export function isAbortedError(err: any): boolean { // tslint:disable-line no-any - const ec = errorCode(err); - return ec.valid && ec.code === grpc.status.ABORTED; +export function isAbortedError(err: any): boolean { + const ec = errorCode(err) + return ec.valid && ec.code === grpc.status.ABORTED } -export function isConflictError(err: any): boolean { // tslint:disable-line no-any - const ec = errorCode(err); - return ( - ec.valid && - (ec.code === grpc.status.ABORTED || - ec.code === grpc.status.FAILED_PRECONDITION) - ); +export function isConflictError(err: any): boolean { + const ec = errorCode(err) + return ( + ec.valid && (ec.code === grpc.status.ABORTED || ec.code === grpc.status.FAILED_PRECONDITION) + ) } -export function isUnauthenticatedError(err: any): boolean { // tslint:disable-line no-any - const ec = errorCode(err); - return ec.valid && ec.code === grpc.status.UNAUTHENTICATED; +export function isUnauthenticatedError(err: any): boolean { + const ec = errorCode(err) + return ec.valid && ec.code === grpc.status.UNAUTHENTICATED } export function promisify1( - f: (arg: A, cb: (err?: Error, res?: T) => void) => void, - thisContext?: any, // tslint:disable-line no-any + f: (arg: A, cb: (err?: Error, res?: T) => void) => void, + thisContext?: any, ): (arg: A) => Promise { - return (arg: A) => { - // tslint:disable-next-line no-any - return new Promise( - ( - resolve: (value?: T | PromiseLike) => void, - reject: (reason?: any) => void // tslint:disable-line no-any - ): void => { - f.call(thisContext, arg, (err?: Error, result?: T): void => - err !== undefined && err !== null - ? reject(err) - : resolve(result) - ); - } - ); - }; + return (arg: A) => { + return new Promise( + (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void): void => { + f.call(thisContext, arg, (err?: Error, result?: T): void => + err !== undefined && err !== null ? reject(err) : resolve(result), + ) + }, + ) + } } export function promisify3( - f: (argA: A, argB: B, argC: C, cb: (err?: Error, res?: T) => void) => void, - thisContext?: any, // tslint:disable-line no-any + f: (argA: A, argB: B, argC: C, cb: (err?: Error, res?: T) => void) => void, + thisContext?: any, ): (argA: A, argB: B, argC: C) => Promise { - return (argA: A, argB: B, argC: C) => { - // tslint:disable-next-line no-any - return new Promise( - ( - resolve: (value?: T | PromiseLike) => void, - reject: (reason?: any) => void, // tslint:disable-line no-any - ): void => { - f.call( - thisContext, - argA, - argB, - argC, - (err?: Error, result?: T): void => - err !== undefined && err !== null - ? reject(err) - : resolve(result), - ); - }, - ); - }; + return (argA: A, argB: B, argC: C) => { + return new Promise( + (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void): void => { + f.call(thisContext, argA, argB, argC, (err?: Error, result?: T): void => + err !== undefined && err !== null ? reject(err) : resolve(result), + ) + }, + ) + } } export function stringifyMessage(msg: jspb.Message): string { - return JSON.stringify(msg.toObject()); + return JSON.stringify(msg.toObject()) } -export { isBase64 } from "is-base64"; +export { isBase64 } from "is-base64" export function strToB64(str: string): string { - return Buffer.from(str, "utf8").toString("base64"); + return Buffer.from(str, "utf8").toString("base64") } export function strToU8(str: string): Uint8Array { - return new Uint8Array(Buffer.from(str, "utf8")); + return new Uint8Array(Buffer.from(str, "utf8")) } export function b64ToStr(b64Str: string): string { - return Buffer.from(b64Str, "base64").toString(); + return Buffer.from(b64Str, "base64").toString() } export function u8ToStr(arr: Uint8Array): string { - let buf = Buffer.from(arr.buffer); - if (arr.byteLength !== arr.buffer.byteLength) { - // Respect the "view", i.e. byteOffset and byteLength, without doing a copy. - buf = buf.slice(arr.byteOffset, arr.byteOffset + arr.byteLength); - } + let buf = Buffer.from(arr.buffer) + if (arr.byteLength !== arr.buffer.byteLength) { + // Respect the "view", i.e. byteOffset and byteLength, without doing a copy. + buf = buf.slice(arr.byteOffset, arr.byteOffset + arr.byteLength) + } - return buf.toString(); + return buf.toString() } -export function strToJson(jsonStr: string): any { // tslint:disable-line no-any - try { - return JSON.parse(jsonStr); - } catch (e) { - return {}; - } +export function strToJson(jsonStr: string): any { + try { + return JSON.parse(jsonStr) + } catch { + return {} + } } diff --git a/tests/client.spec.ts b/tests/client.spec.ts index 5cdce82..054aa19 100644 --- a/tests/client.spec.ts +++ b/tests/client.spec.ts @@ -1,37 +1,35 @@ -import * as dgraph from "../src"; +import * as dgraph from "../src" -import { createClient, createClientStub } from "./helper"; +import { createClient, createClientStub } from "./helper" -/* eslint-disable no-console */ describe("client", () => { - describe("constructor", () => { - it("should throw no clients error if no client stubs are passed", () => { - expect.assertions(1); - - try { - // eslint-disable-next-line no-unused-expressions - new dgraph.DgraphClient(); - } catch (e) { - expect(e).toBe(dgraph.ERR_NO_CLIENTS); - } - }); - - it("should handle debug mode", () => { - console.log = jest.fn(); - - const msg = "test message"; - const client = createClient(createClientStub()); - - client.debug(msg); - expect(console.log).not.toHaveBeenCalled(); - - client.setDebugMode(); - client.debug(msg); - expect(console.log).toHaveBeenCalledTimes(1); - - client.setDebugMode(false); - client.debug(msg); - expect(console.log).toHaveBeenCalledTimes(1); - }); - }); -}); + describe("constructor", () => { + it("should throw no clients error if no client stubs are passed", () => { + expect.assertions(1) + + try { + new dgraph.DgraphClient() + } catch (e) { + expect(e).toBe(dgraph.ERR_NO_CLIENTS) + } + }) + + it("should handle debug mode", () => { + console.log = jest.fn() + + const msg = "test message" + const client = createClient(createClientStub()) + + client.debug(msg) + expect(console.log).not.toHaveBeenCalled() + + client.setDebugMode() + client.debug(msg) + expect(console.log).toHaveBeenCalledTimes(1) + + client.setDebugMode(false) + client.debug(msg) + expect(console.log).toHaveBeenCalledTimes(1) + }) + }) +}) diff --git a/tests/clientStub.spec.ts b/tests/clientStub.spec.ts index f9164e5..d65e924 100644 --- a/tests/clientStub.spec.ts +++ b/tests/clientStub.spec.ts @@ -1,97 +1,75 @@ -import * as grpc from "@grpc/grpc-js"; +import * as grpc from "@grpc/grpc-js" -import * as dgraph from "../src"; +import * as dgraph from "../src" -import { SERVER_ADDR, SERVER_CREDENTIALS, setup } from "./helper"; +import { SERVER_ADDR, SERVER_CREDENTIALS, setup } from "./helper" -function validateVersionObject(version: dgraph.Version){ - const tag = version.getTag(); - expect(typeof tag).toEqual("string"); - expect(tag).toBeDefined(); +function validateVersionObject(version: dgraph.Version) { + const tag = version.getTag() + expect(typeof tag).toEqual("string") + expect(tag).toBeDefined() } async function checkVersion(stub: dgraph.DgraphClientStub): Promise { - validateVersionObject(await stub.checkVersion(new dgraph.Check())); + validateVersionObject(await stub.checkVersion(new dgraph.Check())) } describe("clientStub", () => { - describe("login", () => { - it("Really should login", async () => { - const client = await setup(); - const stub = client.anyClient(); + describe("login", () => { + it("Really should login", async () => { + const client = await setup() + const stub = client.anyClient() - await expect( - stub.login("groot", "password"), - ).resolves.toBeDefined(); - }); - }); + await expect(stub.login("groot", "password")).resolves.toBeDefined() + }) + }) - describe("checkVersion", () => { - it("should check version", async () => { - const client = await setup(); - await checkVersion(client.anyClient()); - }); + describe("checkVersion", () => { + it("should check version", async () => { + const client = await setup() + await checkVersion(client.anyClient()) + }) - it("should check version with metadata", async () => { - const clientStub = new dgraph.DgraphClientStub( - SERVER_ADDR, - SERVER_CREDENTIALS, - ); - validateVersionObject( - await clientStub.checkVersion( - new dgraph.Check(), - new grpc.Metadata(), - ), - ); - }); + it("should check version with metadata", async () => { + const clientStub = new dgraph.DgraphClientStub(SERVER_ADDR, SERVER_CREDENTIALS) + validateVersionObject(await clientStub.checkVersion(new dgraph.Check(), new grpc.Metadata())) + }) - it("should check version with call options", async () => { - const clientStub = new dgraph.DgraphClientStub( - SERVER_ADDR, - SERVER_CREDENTIALS, - ); - const p = clientStub.checkVersion(new dgraph.Check(), undefined, { - credentials: undefined, - deadline: 0, - propagate_flags: grpc.propagate.DEFAULTS, - }); + it("should check version with call options", async () => { + const clientStub = new dgraph.DgraphClientStub(SERVER_ADDR, SERVER_CREDENTIALS) + const p = clientStub.checkVersion(new dgraph.Check(), undefined, { + credentials: undefined, + deadline: 0, + propagate_flags: grpc.propagate.DEFAULTS, + }) - await expect(p).rejects.toBeDefined(); - }); - }); + await expect(p).rejects.toBeDefined() + }) + }) - describe("waitForReady", () => { - it("should provide a promisified version of grpc.Client#waitForReady", async () => { - const clientStub = new dgraph.DgraphClientStub( - SERVER_ADDR, - SERVER_CREDENTIALS, - ); - await clientStub.waitForReady(Date.now() + 500); - await checkVersion(clientStub); - }); - }); + describe("waitForReady", () => { + it("should provide a promisified version of grpc.Client#waitForReady", async () => { + const clientStub = new dgraph.DgraphClientStub(SERVER_ADDR, SERVER_CREDENTIALS) + await clientStub.waitForReady(Date.now() + 500) + await checkVersion(clientStub) + }) + }) - describe("close", () => { - it("should close channel", async () => { - const clientStub = new dgraph.DgraphClientStub( - SERVER_ADDR, - SERVER_CREDENTIALS, - ); - clientStub.close(); - const p = clientStub.checkVersion(new dgraph.Check()); - await expect(p).rejects.toBeDefined(); - }); - }); + describe("close", () => { + it("should close channel", async () => { + const clientStub = new dgraph.DgraphClientStub(SERVER_ADDR, SERVER_CREDENTIALS) + clientStub.close() + const p = clientStub.checkVersion(new dgraph.Check()) + await expect(p).rejects.toBeDefined() + }) + }) - describe("grpcClient", () => { - it("should close channel if grpc client is closed", async () => { - const clientStub = new dgraph.DgraphClientStub( - SERVER_ADDR, - SERVER_CREDENTIALS, - ); - clientStub.grpcClient().close(); - const p = clientStub.checkVersion(new dgraph.Check()); - await expect(p).rejects.toBeDefined(); - }); - }); -}); + describe("grpcClient", () => { + it("should close channel if grpc client is closed", async () => { + const clientStub = new dgraph.DgraphClientStub(SERVER_ADDR, SERVER_CREDENTIALS) + clientStub.grpcClient().close() + const p = clientStub.checkVersion(new dgraph.Check()) + await expect(p).rejects.toBeDefined() + }) + }) +}) diff --git a/tests/helper.ts b/tests/helper.ts index da8ec05..33e0183 100644 --- a/tests/helper.ts +++ b/tests/helper.ts @@ -1,73 +1,65 @@ -import * as grpc from "@grpc/grpc-js"; +import * as grpc from "@grpc/grpc-js" -import * as dgraph from "../src"; +import * as dgraph from "../src" -// tslint:disable-next-line strict-boolean-expressions -export const SERVER_ADDR = process.env.DGRAPH_SERVER_ADDR || "localhost:9080"; -export const SERVER_CREDENTIALS = grpc.credentials.createInsecure(); +export const SERVER_ADDR = process.env.DGRAPH_SERVER_ADDR || "localhost:9080" +export const SERVER_CREDENTIALS = grpc.credentials.createInsecure() export function createClientStub(): dgraph.DgraphClientStub { - return new dgraph.DgraphClientStub(SERVER_ADDR, SERVER_CREDENTIALS); + return new dgraph.DgraphClientStub(SERVER_ADDR, SERVER_CREDENTIALS) } -export function createClient( - clientStub: dgraph.DgraphClientStub, -): dgraph.DgraphClient { - return new dgraph.DgraphClient(clientStub); +export function createClient(clientStub: dgraph.DgraphClientStub): dgraph.DgraphClient { + return new dgraph.DgraphClient(clientStub) } -export function setSchema( - c: dgraph.DgraphClient, - schema: string, -): Promise { - const op = new dgraph.Operation(); - op.setSchema(schema); - return c.alter(op); +export function setSchema(c: dgraph.DgraphClient, schema: string): Promise { + const op = new dgraph.Operation() + op.setSchema(schema) + return c.alter(op) } export function dropAll(c: dgraph.DgraphClient): Promise { - const op = new dgraph.Operation(); - op.setDropAll(true); - return c.alter(op); + const op = new dgraph.Operation() + op.setDropAll(true) + return c.alter(op) } export async function setup(): Promise { - const stub = new dgraph.DgraphClientStub(SERVER_ADDR, SERVER_CREDENTIALS); - await stub.login("groot", "password"); + const stub = new dgraph.DgraphClientStub(SERVER_ADDR, SERVER_CREDENTIALS) + await stub.login("groot", "password") - const c = new dgraph.DgraphClient(stub); + const c = new dgraph.DgraphClient(stub) - await dropAll(c); - return c; + await dropAll(c) + return c } export function wait(time: number): Promise { - return new Promise( - (resolve: (value?: void | PromiseLike) => void): void => { - setTimeout(resolve, time); - }, - ); + return new Promise((resolve: (value?: void | PromiseLike) => void): void => { + setTimeout(resolve, time) + }) } export async function tryUpsert( - client: dgraph.DgraphClient, - query: string, - mutation: dgraph.Mutation, - blankNodeLabel: string, + client: dgraph.DgraphClient, + query: string, + mutation: dgraph.Mutation, + blankNodeLabel: string, ): Promise { - const txn = client.newTxn(); + const txn = client.newTxn() - const req = new dgraph.Request(); - req.setQuery(query); - req.setMutationsList([mutation]); - req.setCommitNow(true); + const req = new dgraph.Request() + req.setQuery(query) + req.setMutationsList([mutation]) + req.setCommitNow(true) - try { - // Update account only if matching uid found. - const response = await txn.doRequest(req); - const uid = response.getUidsMap().get(blankNodeLabel); - expect(uid).not.toEqual(""); - } finally { - await txn.discard(); - } + try { + // Update account only if matching uid found. + const response = await txn.doRequest(req) + const uid = response.getUidsMap().get(blankNodeLabel) + expect(uid).not.toEqual("") + } finally { + await txn.discard() + } } diff --git a/tests/integration/acctUpsert.spec.ts b/tests/integration/acctUpsert.spec.ts index bad730d..5969eb8 100644 --- a/tests/integration/acctUpsert.spec.ts +++ b/tests/integration/acctUpsert.spec.ts @@ -1,172 +1,176 @@ -import * as dgraph from "../../src"; +import * as dgraph from "../../src" -import { setSchema, setup } from "../helper"; +import { setSchema, setup } from "../helper" -const concurrency = 3; -const timeout = 5 * 60 * 1000; // 5 minutes in milliseconds +const concurrency = 3 +const timeout = 5 * 60 * 1000 // 5 minutes in milliseconds -// tslint:disable-next-line no-string-based-set-timeout -jest.setTimeout(timeout * 2); +jest.setTimeout(timeout * 2) -let client: dgraph.DgraphClient; +let client: dgraph.DgraphClient -const firsts = ["Paul", "Eric", "Jack", "John", "Martin"]; -const lasts = ["Brown", "Smith", "Robinson", "Waters", "Taylor"]; -const ages = [20, 25, 30, 35]; +const firsts = ["Paul", "Eric", "Jack", "John", "Martin"] +const lasts = ["Brown", "Smith", "Robinson", "Waters", "Taylor"] +const ages = [20, 25, 30, 35] type Account = { - first: string; - last: string; - age: number; -}; -const accounts: Account[] = []; - -firsts.forEach((first: string): void => lasts.forEach((last: string): void => ages.forEach((age: number): void => { - accounts.push({ + first: string + last: string + age: number +} +const accounts: Account[] = [] + +firsts.forEach((first: string): void => + lasts.forEach((last: string): void => + ages.forEach((age: number): void => { + accounts.push({ first, last, age, - }); -}))); + }) + }), + ), +) async function tryUpsert(account: Account): Promise { - const txn = client.newTxn(); + const txn = client.newTxn() - const q = `{ + const q = `{ find(func: eq(first, "${account.first}")) @filter(eq(last, "${account.last}") AND eq(age, "${account.age}")) { uid: _uid_ } - }`; - - try { - const res = await txn.query(q); - const resJson: { - find: { uid: string }[]; - } = res.getJson(); // eslint-disable-line @typescript-eslint/tslint/config - expect(resJson.find.length).toBeLessThanOrEqual(1); - - let mu: dgraph.Mutation; - let uid: string; - if (resJson.find.length === 1) { - uid = resJson.find[0].uid; - } else { - mu = new dgraph.Mutation(); - mu.setSetNquads(` + }` + + try { + const res = await txn.query(q) + const resJson: { + find: { uid: string }[] + } = res.getJson() + expect(resJson.find.length).toBeLessThanOrEqual(1) + + let mu: dgraph.Mutation + let uid: string + if (resJson.find.length === 1) { + uid = resJson.find[0].uid + } else { + mu = new dgraph.Mutation() + mu.setSetNquads(` _:acct "${account.first}" . _:acct "${account.last}" . _:acct "${account.age}"^^ . - `); + `) - const ag = await txn.mutate(mu); - uid = ag.getUidsMap().get("acct"); - expect(uid).not.toEqual(""); - } + const ag = await txn.mutate(mu) + uid = ag.getUidsMap().get("acct") + expect(uid).not.toEqual("") + } - mu = new dgraph.Mutation(); - // Time used here is in milliseconds. - mu.setSetNquads(`<${uid}> "${new Date().getTime()}"^^ .`); - await txn.mutate(mu); + mu = new dgraph.Mutation() + // Time used here is in milliseconds. + mu.setSetNquads(`<${uid}> "${new Date().getTime()}"^^ .`) + await txn.mutate(mu) - await txn.commit(); - } finally { - await txn.discard(); - } + await txn.commit() + } finally { + await txn.discard() + } } -let startStatus = 0; // set at the start of doUpserts -let lastStatus = 0; -let cancelled = false; // cancelled due to timeout +let startStatus = 0 // set at the start of doUpserts +let lastStatus = 0 +let cancelled = false // cancelled due to timeout -let successCount = 0; -let retryCount = 0; +let successCount = 0 +let retryCount = 0 function conditionalLog(): void { - const now = new Date().getTime(); - if (now - lastStatus > 1000 && !cancelled) { - // eslint-disable-next-line no-console - console.log(`Success: ${successCount}, Retries: ${retryCount}, Total Time: ${now - startStatus} ms`); - lastStatus = now; - } + const now = new Date().getTime() + if (now - lastStatus > 1000 && !cancelled) { + console.log( + `Success: ${successCount}, Retries: ${retryCount}, Total Time: ${now - startStatus} ms`, + ) + lastStatus = now + } } async function upsert(account: Account): Promise { - let done = false; - while (!done && !cancelled) { - try { - await tryUpsert(account); - successCount += 1; - done = true; - } catch (e) { - expect(e).toBe(dgraph.ERR_ABORTED); - retryCount += 1; - } - - conditionalLog(); + let done = false + while (!done && !cancelled) { + try { + await tryUpsert(account) + successCount += 1 + done = true + } catch (e) { + expect(e).toBe(dgraph.ERR_ABORTED) + retryCount += 1 } - if (!done) { - throw new Error(`Timeout elapsed: ${timeout / 1000}s`); - } + conditionalLog() + } + + if (!done) { + throw new Error(`Timeout elapsed: ${timeout / 1000}s`) + } } async function doUpserts(): Promise { - const promises: Promise[] = []; - for (const account of accounts) { - for (let i = 0; i < concurrency; i += 1) { - promises.push(upsert(account)); - } + const promises: Promise[] = [] + for (const account of accounts) { + for (let i = 0; i < concurrency; i += 1) { + promises.push(upsert(account)) } + } - startStatus = new Date().getTime(); - const id = setTimeout( - () => { - cancelled = true; - }, - timeout, - ); - - await Promise.all(promises).then(() => { - clearTimeout(id); - }); + startStatus = new Date().getTime() + const id = setTimeout(() => { + cancelled = true + }, timeout) + + await Promise.all(promises).then(() => { + clearTimeout(id) + }) } async function checkIntegrity(): Promise { - const res = await client.newTxn().query(`{ + const res = await client.newTxn().query(`{ all(func: anyofterms(first, "${firsts.join(" ")}")) { first last age } - }`); - - const data: { - all: Account[]; - } = res.getJson(); // eslint-disable-line @typescript-eslint/tslint/config - - const accountSet: { [key: string]: boolean } = {}; - for (const account of data.all) { - expect(account.first).toBeTruthy(); - expect(account.last).toBeTruthy(); - expect(account.age).toBeTruthy(); - accountSet[`${account.first}_${account.last}_${account.age}`] = true; - } - - for (const account of accounts) { - expect(accountSet[`${account.first}_${account.last}_${account.age}`]).toBe(true); - } + }`) + + const data: { + all: Account[] + } = res.getJson() + + const accountSet: { [key: string]: boolean } = {} + for (const account of data.all) { + expect(account.first).toBeTruthy() + expect(account.last).toBeTruthy() + expect(account.age).toBeTruthy() + accountSet[`${account.first}_${account.last}_${account.age}`] = true + } + + for (const account of accounts) { + expect(accountSet[`${account.first}_${account.last}_${account.age}`]).toBe(true) + } } describe("acctUpsert", () => { - it("should successfully perform upsert load test", async () => { - client = await setup(); - await setSchema(client, ` + it("should successfully perform upsert load test", async () => { + client = await setup() + await setSchema( + client, + ` first: string @index(term) . last: string @index(hash) . age: int @index(int) . when: int . - `); + `, + ) - await doUpserts(); - await checkIntegrity(); - }); -}); + await doUpserts() + await checkIntegrity() + }) +}) diff --git a/tests/integration/acl.spec.ts b/tests/integration/acl.spec.ts index f4377c3..2440516 100644 --- a/tests/integration/acl.spec.ts +++ b/tests/integration/acl.spec.ts @@ -1,176 +1,175 @@ -import { fail } from "assert"; -import { exec } from "child_process"; -import { promisify } from "util"; +import { fail } from "assert" +import { exec } from "child_process" +import { promisify } from "util" -import * as dgraph from "../../src"; -import { createClient, createClientStub, SERVER_ADDR, setSchema, setup, wait } from "../helper"; +import * as dgraph from "../../src" +import { createClient, createClientStub, SERVER_ADDR, setSchema, setup, wait } from "../helper" -const JEST_TIMEOUT = 60 * 1000; // 1 minute in milliseconds -const WAIT_FOR_SIX_SECONDS = 6 * 1000; // 6 seconds in milliseconds +const JEST_TIMEOUT = 60 * 1000 // 1 minute in milliseconds +const WAIT_FOR_SIX_SECONDS = 6 * 1000 // 6 seconds in milliseconds -// tslint:disable-next-line no-string-based-set-timeout -jest.setTimeout(JEST_TIMEOUT); +jest.setTimeout(JEST_TIMEOUT) -let client: dgraph.DgraphClient; +let client: dgraph.DgraphClient -const GUARDIAN_CREDS = "user=groot;password=password;namespace=0"; -const USERID = "alice"; -const USERPWD = "alicepassword"; -const PRED = "name"; -const DEV_GROUP = "dev"; +const GUARDIAN_CREDS = "user=groot;password=password;namespace=0" +const USERID = "alice" +const USERPWD = "alicepassword" +const PRED = "name" +const DEV_GROUP = "dev" -// tslint:disable-next-line mocha-no-side-effect-code -const execute = promisify(exec); +const execute = promisify(exec) - // tslint:disable-next-line mocha-no-side-effect-code const MUTATE_PERMISSION_DENIED = new Error(`7 PERMISSION_DENIED:\ - unauthorized to mutate following predicates: ${PRED} \n`); - // tslint:disable-next-line mocha-no-side-effect-code + unauthorized to mutate following predicates: ${PRED} \n`) const ALTER_PERMISSION_DENIED = new Error(`7 PERMISSION_DENIED:\ - unauthorized to alter following predicates: ${PRED} \n`); - -async function cmd(command: string){ - try { - await execute(command); - } catch (err) { - fail(`Failed to execute command:\n\t${command}\nError: ${err}`); - } + unauthorized to alter following predicates: ${PRED} \n`) + +async function cmd(command: string) { + try { + await execute(command) + } catch (err) { + fail(`Failed to execute command:\n\t${command}\nError: ${err}`) + } } async function insertSampleData() { - const txn = client.newTxn(); - const mu = new dgraph.Mutation(); - mu.setSetNquads(` + const txn = client.newTxn() + const mu = new dgraph.Mutation() + mu.setSetNquads(` _:prashant <${PRED}> "Prashant" . - `); - mu.setCommitNow(true); - const res = await txn.mutate(mu); - const uid = res.getUidsMap().get("prashant"); - expect(uid).toBeDefined(); + `) + mu.setCommitNow(true) + const res = await txn.mutate(mu) + const uid = res.getUidsMap().get("prashant") + expect(uid).toBeDefined() } async function loginUser(): Promise { - const aclClientStub = createClientStub(); - try { - await aclClientStub.login(USERID, USERPWD); - } catch (e) { - fail(`Login error: \tUSERID - ${USERID} \tUSERPWD - ${USERPWD}\n${e}`); - } - return createClient(aclClientStub); + const aclClientStub = createClientStub() + try { + await aclClientStub.login(USERID, USERPWD) + } catch (e) { + fail(`Login error: \tUSERID - ${USERID} \tUSERPWD - ${USERPWD}\n${e}`) + } + return createClient(aclClientStub) } async function aclSetup() { - client = await setup(); - await setSchema(client, ` + client = await setup() + await setSchema( + client, + ` ${PRED}: string . - `); - await insertSampleData(); - await addUser(); - await addGroup(); - await addUserToGroup(); - return loginUser(); + `, + ) + await insertSampleData() + await addUser() + await addGroup() + await addUserToGroup() + return loginUser() } async function addUser() { - const command = `dgraph acl -a \'${SERVER_ADDR}\' add -u \'${USERID}\' -p \'${USERPWD}\' --guardian-creds \'${GUARDIAN_CREDS}\'`; - await cmd(command); + const command = `dgraph acl -a '${SERVER_ADDR}' add -u '${USERID}' -p '${USERPWD}' --guardian-creds '${GUARDIAN_CREDS}'` + await cmd(command) } async function addGroup() { - const command = `dgraph acl -a \'${SERVER_ADDR}\' add -g \'${DEV_GROUP}\' --guardian-creds \'${GUARDIAN_CREDS}\'`; - await cmd(command); + const command = `dgraph acl -a '${SERVER_ADDR}' add -g '${DEV_GROUP}' --guardian-creds '${GUARDIAN_CREDS}'` + await cmd(command) } async function addUserToGroup() { - const command = `dgraph acl -a \'${SERVER_ADDR}\' mod -u \'${USERID}\' -l \'${DEV_GROUP}\' --guardian-creds \'${GUARDIAN_CREDS}\'`; - await cmd(command); + const command = `dgraph acl -a '${SERVER_ADDR}' mod -u '${USERID}' -l '${DEV_GROUP}' --guardian-creds '${GUARDIAN_CREDS}'` + await cmd(command) } async function changePermission(permission: number) { - const command = `dgraph acl -a \'${SERVER_ADDR}\' mod -g \'${DEV_GROUP}\' -p \'${PRED}\' -m \'${permission}\' --guardian-creds \'${GUARDIAN_CREDS}\'`; - await cmd(command); - await wait(WAIT_FOR_SIX_SECONDS); + const command = `dgraph acl -a '${SERVER_ADDR}' mod -g '${DEV_GROUP}' -p '${PRED}' -m '${permission}' --guardian-creds '${GUARDIAN_CREDS}'` + await cmd(command) + await wait(WAIT_FOR_SIX_SECONDS) } -async function tryReading(aclClient: dgraph.DgraphClient): Promise { - const txn = aclClient.newTxn(); - const res: dgraph.Response = await txn.query(`{ +async function tryReading(aclClient: dgraph.DgraphClient): Promise { + const txn = aclClient.newTxn() + const res: dgraph.Response = await txn.query(`{ me(func: has(${PRED})) { ${PRED} } - }`); - const data = res.getJson(); - if (data.me === undefined) { - expect(data).toEqual({}); - return false; - } else { - expect(data.me).not.toHaveLength(0); - return true; - } + }`) + const data = res.getJson() + if (data.me === undefined) { + expect(data).toEqual({}) + return false + } else { + expect(data.me).not.toHaveLength(0) + return true + } } -async function tryWriting(aclClient: dgraph.DgraphClient): Promise { - const txn = aclClient.newTxn(); - try { - const mu = new dgraph.Mutation(); - mu.setSetNquads(` +async function tryWriting(aclClient: dgraph.DgraphClient): Promise { + const txn = aclClient.newTxn() + try { + const mu = new dgraph.Mutation() + mu.setSetNquads(` _:ashish <${PRED}> "Ashish" . - `); - mu.setCommitNow(true); - const res = await txn.mutate(mu); - const uid = res.getUidsMap().get("ashish"); - expect(uid).toBeDefined(); - return true; - } catch (e) { - expect(e).toEqual(MUTATE_PERMISSION_DENIED); - return false; - } + `) + mu.setCommitNow(true) + const res = await txn.mutate(mu) + const uid = res.getUidsMap().get("ashish") + expect(uid).toBeDefined() + return true + } catch (e) { + expect(e).toEqual(MUTATE_PERMISSION_DENIED) + return false + } } -async function tryAltering(aclClient: dgraph.DgraphClient): Promise { - try { - const operation = new dgraph.Operation(); - operation.setSchema(` +async function tryAltering(aclClient: dgraph.DgraphClient): Promise { + try { + const operation = new dgraph.Operation() + operation.setSchema(` ${PRED}: string @index(exact, term) . - `); - await aclClient.alter(operation); - return true; - } catch (e) { - expect(e).toEqual(ALTER_PERMISSION_DENIED); - return false; - } + `) + await aclClient.alter(operation) + return true + } catch (e) { + expect(e).toEqual(ALTER_PERMISSION_DENIED) + return false + } } describe("ACL tests", () => { - it("has no access", async () => { - const aclClient = await aclSetup(); - await changePermission(0); - await expect(tryReading(aclClient)).resolves.toBe(false); - await expect(tryWriting(aclClient)).resolves.toBe(false); - await expect(tryAltering(aclClient)).resolves.toBe(false); - }); - - it("only has read access", async () => { - const aclClient = await aclSetup(); - await changePermission(4); - await expect(tryReading(aclClient)).resolves.toBe(true); - await expect(tryWriting(aclClient)).resolves.toBe(false); - await expect(tryAltering(aclClient)).resolves.toBe(false); - }); - - it("only has write access", async () => { - const aclClient = await aclSetup(); - await changePermission(2); - await expect(tryReading(aclClient)).resolves.toBe(false); - await expect(tryWriting(aclClient)).resolves.toBe(true); - await expect(tryAltering(aclClient)).resolves.toBe(false); - }); - - it("only has modify access", async () => { - const aclClient = await aclSetup(); - await changePermission(1); - await expect(tryReading(aclClient)).resolves.toBe(false); - await expect(tryWriting(aclClient)).resolves.toBe(false); - await expect(tryAltering(aclClient)).resolves.toBe(true); - }); -}); + it("has no access", async () => { + const aclClient = await aclSetup() + await changePermission(0) + await expect(tryReading(aclClient)).resolves.toBe(false) + await expect(tryWriting(aclClient)).resolves.toBe(false) + await expect(tryAltering(aclClient)).resolves.toBe(false) + }) + + it("only has read access", async () => { + const aclClient = await aclSetup() + await changePermission(4) + await expect(tryReading(aclClient)).resolves.toBe(true) + await expect(tryWriting(aclClient)).resolves.toBe(false) + await expect(tryAltering(aclClient)).resolves.toBe(false) + }) + + it("only has write access", async () => { + const aclClient = await aclSetup() + await changePermission(2) + await expect(tryReading(aclClient)).resolves.toBe(false) + await expect(tryWriting(aclClient)).resolves.toBe(true) + await expect(tryAltering(aclClient)).resolves.toBe(false) + }) + + it("only has modify access", async () => { + const aclClient = await aclSetup() + await changePermission(1) + await expect(tryReading(aclClient)).resolves.toBe(false) + await expect(tryWriting(aclClient)).resolves.toBe(false) + await expect(tryAltering(aclClient)).resolves.toBe(true) + }) +}) diff --git a/tests/integration/bank.spec.ts b/tests/integration/bank.spec.ts index 7aceba3..4ed54f9 100644 --- a/tests/integration/bank.spec.ts +++ b/tests/integration/bank.spec.ts @@ -1,156 +1,151 @@ -import * as dgraph from "../../src"; +import * as dgraph from "../../src" +import * as crypto from "crypto" +import { setSchema, setup, wait } from "../helper" -import { setSchema, setup, wait } from "../helper"; +const concurrency = 5 +const totalAccounts = 100 +const totalTxns = 1000 +const initialBalance = 100 +const timeout = 5 * 60 * 1000 // 5 minutes in milliseconds -const concurrency = 5; -const totalAccounts = 100; -const totalTxns = 1000; -const initialBalance = 100; -const timeout = 5 * 60 * 1000; // 5 minutes in milliseconds +jest.setTimeout(timeout * 2) -// tslint:disable-next-line no-string-based-set-timeout -jest.setTimeout(timeout * 2); - -let client: dgraph.DgraphClient; +let client: dgraph.DgraphClient type Account = { - bal: number; -}; + bal: number +} -const uids: string[] = []; +const uids: string[] = [] async function createAccounts(): Promise { - await setSchema(client, "bal: int ."); - - const accounts: Account[] = []; - for (let i = 0; i < totalAccounts; i += 1) { - accounts.push({ - bal: initialBalance, - }); - } - - const txn = client.newTxn(); - const mu = new dgraph.Mutation(); - mu.setSetJson(accounts); - const ag = await txn.mutate(mu); - await txn.commit(); - - ag.getUidsMap() - .forEach((value: string): void => { - uids.push(value); - }); + await setSchema(client, "bal: int .") + + const accounts: Account[] = [] + for (let i = 0; i < totalAccounts; i += 1) { + accounts.push({ + bal: initialBalance, + }) + } + + const txn = client.newTxn() + const mu = new dgraph.Mutation() + mu.setSetJson(accounts) + const ag = await txn.mutate(mu) + await txn.commit() + + ag.getUidsMap().forEach((value: string): void => { + uids.push(value) + }) } -let startStatus = 0; // set before Promise.all -let cancelled = false; -let finished = false; +let startStatus = 0 // set before Promise.all +let cancelled = false +let finished = false -let runs = 0; -let aborts = 0; +let runs = 0 +let aborts = 0 async function runTotal(): Promise { - const res = await client.newTxn() - .query(`{ + const res = await client.newTxn().query(`{ var(func: uid(${uids.join(",")})) { b as bal } total() { bal: sum(val(b)) } - }`); - expect(res.getJson().total[0].bal).toBe(uids.length * initialBalance); + }`) + expect(res.getJson().total[0].bal).toBe(uids.length * initialBalance) - // eslint-disable-next-line no-console - console.log(`Runs: ${runs}, Aborts: ${aborts}, Total Time: ${new Date().getTime() - startStatus} ms`); + console.log( + `Runs: ${runs}, Aborts: ${aborts}, Total Time: ${new Date().getTime() - startStatus} ms`, + ) } async function runTotalInLoop(): Promise { - while (!finished && !cancelled) { - try { - await runTotal(); - await wait(1000); - } catch (e) { - finished = true; - throw e; - } + while (!finished && !cancelled) { + try { + await runTotal() + await wait(1000) + } catch (e) { + finished = true + throw e } + } } async function runTxn(): Promise { - let fromUid: string; - let toUid: string; - // eslint-disable-next-line no-constant-condition - while (true) { - fromUid = uids[Math.floor(Math.random() * uids.length)]; - toUid = uids[Math.floor(Math.random() * uids.length)]; - - if (fromUid !== toUid) { - break; - } - } + let fromUid: string + let toUid: string - const txn = client.newTxn(); - try { - const res = await txn.query(`{both(func: uid(${fromUid}, ${toUid})) { uid, bal }}`); - const accountsWithUid: { - uid: string; - bal: number; - }[] = res.getJson().both; // eslint-disable-line @typescript-eslint/tslint/config - expect(accountsWithUid).toHaveLength(2); - - accountsWithUid[0].bal += 5; - accountsWithUid[1].bal -= 5; - - const mu = new dgraph.Mutation(); - mu.setSetJson(accountsWithUid); - await txn.mutate(mu); - await txn.commit(); - } finally { - await txn.discard(); + while (true) { + fromUid = uids[crypto.randomInt(uids.length)] + toUid = uids[crypto.randomInt(uids.length)] + + if (fromUid !== toUid) { + break } + } + + const txn = client.newTxn() + try { + const res = await txn.query(`{both(func: uid(${fromUid}, ${toUid})) { uid, bal }}`) + const accountsWithUid: { + uid: string + bal: number + }[] = res.getJson().both + expect(accountsWithUid).toHaveLength(2) + + accountsWithUid[0].bal += 5 + accountsWithUid[1].bal -= 5 + + const mu = new dgraph.Mutation() + mu.setSetJson(accountsWithUid) + await txn.mutate(mu) + await txn.commit() + } finally { + await txn.discard() + } } async function runTxnInLoop(): Promise { - while (!finished && !cancelled) { - try { - await runTxn(); - runs += 1; - if (runs > totalTxns) { - finished = true; - return; - } - } catch (e) { - aborts += 1; - } + while (!finished && !cancelled) { + try { + await runTxn() + runs += 1 + if (runs > totalTxns) { + finished = true + return + } + } catch { + aborts += 1 } + } - if (!finished) { - throw new Error(`Timeout elapsed: ${timeout / 1000}s`); - } + if (!finished) { + throw new Error(`Timeout elapsed: ${timeout / 1000}s`) + } } describe("bank", () => { - it("should successfully perform transaction load test", async () => { - client = await setup(); - await createAccounts(); + it("should successfully perform transaction load test", async () => { + client = await setup() + await createAccounts() - const promises = [runTotalInLoop()]; - for (let i = 0; i < concurrency; i += 1) { - promises.push(runTxnInLoop()); - } + const promises = [runTotalInLoop()] + for (let i = 0; i < concurrency; i += 1) { + promises.push(runTxnInLoop()) + } - startStatus = new Date().getTime(); - const id = setTimeout( - () => { - cancelled = true; - }, - timeout, - ); + startStatus = new Date().getTime() + const id = setTimeout(() => { + cancelled = true + }, timeout) - await Promise.all(promises); + await Promise.all(promises) - if (!cancelled) { - clearTimeout(id); - } - }); -}); + if (!cancelled) { + clearTimeout(id) + } + }) +}) diff --git a/tests/integration/bulkSetDelete.spec.ts b/tests/integration/bulkSetDelete.spec.ts index dc9a48b..78ee364 100644 --- a/tests/integration/bulkSetDelete.spec.ts +++ b/tests/integration/bulkSetDelete.spec.ts @@ -1,114 +1,120 @@ -import * as dgraph from "../../src"; +import * as dgraph from "../../src" -import { setSchema, setup } from "../helper"; +import { setSchema, setup } from "../helper" -let client: dgraph.DgraphClient; +let client: dgraph.DgraphClient type Profile = { - name: string; - email: string; - age: number; -}; + name: string + email: string + age: number +} const profiles: Profile[] = [ - { name: "Aman", email: "aman@dgraph.io", age: 26 }, - { name: "Animesh", email: "animesh@dgraph.io", age: 24 }, - { name: "Ashish", email: "ashish@dgraph.io", age: 26 }, - { name: "Prashant", email: "prashant@dgraph.io", age: 23 }, -]; -const names: string[] = []; + { name: "Aman", email: "aman@dgraph.io", age: 26 }, + { name: "Animesh", email: "animesh@dgraph.io", age: 24 }, + { name: "Ashish", email: "ashish@dgraph.io", age: 26 }, + { name: "Prashant", email: "prashant@dgraph.io", age: 23 }, +] +const names: string[] = [] profiles.forEach((profile: Profile): void => { - names.push(profile.name); -}); + names.push(profile.name) +}) function getMutationNquads() { - let mutationNquads = ""; - profiles.forEach((profile: Profile) => { - const blankNodeLabel = `_:${profile.name.toLocaleLowerCase()}`; - mutationNquads += ` + let mutationNquads = "" + profiles.forEach((profile: Profile) => { + const blankNodeLabel = `_:${profile.name.toLocaleLowerCase()}` + mutationNquads += ` ${blankNodeLabel} "${profile.name}" . ${blankNodeLabel} "${profile.email}" . ${blankNodeLabel} "${profile.age}"^^ . - `; - }); - return mutationNquads; + ` + }) + return mutationNquads } async function doBulkSet() { - const txn = client.newTxn(); - const mu = new dgraph.Mutation(); - mu.setSetNquads(getMutationNquads()); + const txn = client.newTxn() + const mu = new dgraph.Mutation() + mu.setSetNquads(getMutationNquads()) - const req = new dgraph.Request(); - req.addMutations(mu); - req.setCommitNow(true); + const req = new dgraph.Request() + req.addMutations(mu) + req.setCommitNow(true) - await txn.doRequest(req); + await txn.doRequest(req) - const res = await readProfiles(); - expect(res).toEqual({all: profiles}); + const res = await readProfiles() + expect(res).toEqual({ all: profiles }) } async function readProfiles() { - const query = `query { + const query = `query { all(func: anyofterms(name, "${names.join(", ")}"), orderasc: name) { name email age } - }`; - const req = new dgraph.Request(); - req.setQuery(query); - const res = await client.newTxn().doRequest(req); + }` + const req = new dgraph.Request() + req.setQuery(query) + const res = await client.newTxn().doRequest(req) - return res.getJson(); + return res.getJson() } async function doBulkDelete() { - const txn = client.newTxn(); - const query = `query { + const txn = client.newTxn() + const query = `query { a as var(func: eq(name, "Prashant")) - }`; - const mu = new dgraph.Mutation(); - mu.setDelNquads(` + }` + const mu = new dgraph.Mutation() + mu.setDelNquads(` uid(a) * . uid(a) * . uid(a) * . - `); + `) - const req = new dgraph.Request(); - req.addMutations(mu); - req.setQuery(query); - req.setCommitNow(true); + const req = new dgraph.Request() + req.addMutations(mu) + req.setQuery(query) + req.setCommitNow(true) - await txn.doRequest(req); + await txn.doRequest(req) - const res = await readProfiles(); - const tempProfiles = profiles; - tempProfiles.pop(); - expect(res).toEqual({ all: tempProfiles }); + const res = await readProfiles() + const tempProfiles = profiles + tempProfiles.pop() + expect(res).toEqual({ all: tempProfiles }) } describe("Bulk operations using doRequest", () => { - it("successfully perform bulk set", async () => { - client = await setup(); - await setSchema(client, ` + it("successfully perform bulk set", async () => { + client = await setup() + await setSchema( + client, + ` name: string @index(term) . email: string @index(exact) . age: int @index(int) . - `); + `, + ) - await doBulkSet(); - }); + await doBulkSet() + }) - it("successfully perform bulk delete", async () => { - client = await setup(); - await setSchema(client, ` + it("successfully perform bulk delete", async () => { + client = await setup() + await setSchema( + client, + ` name: string @index(term) . email: string @index(exact) . age: int @index(int) . - `); + `, + ) - await doBulkSet(); - await doBulkDelete(); - }); -}); + await doBulkSet() + await doBulkDelete() + }) +}) diff --git a/tests/integration/conditionalUpsert.spec.ts b/tests/integration/conditionalUpsert.spec.ts index ce3bf04..7e65cb2 100644 --- a/tests/integration/conditionalUpsert.spec.ts +++ b/tests/integration/conditionalUpsert.spec.ts @@ -1,172 +1,182 @@ -import * as dgraph from "../../src"; +import * as dgraph from "../../src" -import { setSchema, setup, tryUpsert } from "../helper"; +import { setSchema, setup, tryUpsert } from "../helper" -let client: dgraph.DgraphClient; +let client: dgraph.DgraphClient type Profile = { - uid?: string; - name?: string; - email?: string; - age?: number; - friend?: [Profile]; -}; + uid?: string + name?: string + email?: string + age?: number + friend?: [Profile] +} const profiles: Profile[] = [ - { uid: "_:alice", name: "Alice", email: "alice@dgraph.io", age: 25 }, - { uid: "_:bob", name: "Bob", email: "bob@dgraph.io", age: 28 }, - { uid: "_:prashant", name: "Prashant", email: "prashant@dgraph.io", age: 23 }, -]; -const names: string[] = []; + { uid: "_:alice", name: "Alice", email: "alice@dgraph.io", age: 25 }, + { uid: "_:bob", name: "Bob", email: "bob@dgraph.io", age: 28 }, + { + uid: "_:prashant", + name: "Prashant", + email: "prashant@dgraph.io", + age: 23, + }, +] +const names: string[] = [] profiles.forEach((profile: Profile): void => { - names.push(profile.name); -}); + names.push(profile.name) +}) async function performMutation(person: Profile): Promise { - const txn = client.newTxn(); + const txn = client.newTxn() - const mu = new dgraph.Mutation(); - mu.setSetJson(person); + const mu = new dgraph.Mutation() + mu.setSetJson(person) - const res = await txn.mutate(mu); - await txn.commit(); - const uid = res.getUidsMap().get(person.uid.slice(2)); - expect(uid).not.toEqual(""); - return uid; + const res = await txn.mutate(mu) + await txn.commit() + const uid = res.getUidsMap().get(person.uid.slice(2)) + expect(uid).not.toEqual("") + return uid } async function doConditionalUpsert(): Promise { - const p1: Profile = { uid: await performMutation(profiles[0]) }; - const p2: Profile = { uid: await performMutation(profiles[1]) }; - const friends: [Profile] = [p1]; - friends.push(p2); - const alphaProfile: Profile = { - uid: profiles[2].uid, - name: profiles[2].name, - email: profiles[2].email, - age: profiles[2].age, - friend: friends, - }; - await performMutation(alphaProfile); - - const profile: Profile = { - uid: "uid(profile)", - name: "Prashant Shahi", - email: "prashant@dgraph.io", - age: 24, - }; - const query = `query { + const p1: Profile = { uid: await performMutation(profiles[0]) } + const p2: Profile = { uid: await performMutation(profiles[1]) } + const friends: [Profile] = [p1] + friends.push(p2) + const alphaProfile: Profile = { + uid: profiles[2].uid, + name: profiles[2].name, + email: profiles[2].email, + age: profiles[2].age, + friend: friends, + } + await performMutation(alphaProfile) + + const profile: Profile = { + uid: "uid(profile)", + name: "Prashant Shahi", + email: "prashant@dgraph.io", + age: 24, + } + const query = `query { profile as var(func: eq(email, "${profile.email}")) { friends as friend } - }`; - const mu = new dgraph.Mutation(); - mu.setCond(`@if(eq(len(friends), 2))`); - mu.setSetNquads(` + }` + const mu = new dgraph.Mutation() + mu.setCond(`@if(eq(len(friends), 2))`) + mu.setSetNquads(` uid(profile) "${profile.name}" . uid(profile) "${profile.email}" . uid(profile) "${profile.age}"^^ . - `); + `) - await tryUpsert(client, query, mu, profile.uid); + await tryUpsert(client, query, mu, profile.uid) } async function checkUpsertIntegrity(expectedObject: Profile): Promise { - const query = `{ + const query = `{ all(func: eq(email, "prashant@dgraph.io")) { name email age } - }`; - const res = await client.newTxn().query(query); - - const data: { - all: Profile[]; - } = res.getJson(); // eslint-disable-line @typescript-eslint/tslint/config - - const profileSet: { [key: string]: boolean } = {}; - for (const profile of data.all) { - expect(profile.name).toBeTruthy(); - expect(profile.email).toBeTruthy(); - expect(profile.age).toBeTruthy(); - profileSet[`${profile.name}_${profile.email}_${profile.age}`] = true; - } + }` + const res = await client.newTxn().query(query) + + const data: { + all: Profile[] + } = res.getJson() + + const profileSet: { [key: string]: boolean } = {} + for (const profile of data.all) { + expect(profile.name).toBeTruthy() + expect(profile.email).toBeTruthy() + expect(profile.age).toBeTruthy() + profileSet[`${profile.name}_${profile.email}_${profile.age}`] = true + } - const receivedObject: Profile = data.all[0]; + const receivedObject: Profile = data.all[0] - expect(Object.keys(profileSet).length).toEqual(1); - expect(receivedObject).toEqual(expectedObject); + expect(Object.keys(profileSet).length).toEqual(1) + expect(receivedObject).toEqual(expectedObject) } async function doUnconditionalUpsert(): Promise { - const p1: Profile = { uid: await performMutation(profiles[0]) }; - const p2: Profile = { uid: await performMutation(profiles[1]) }; - const friends: [Profile] = [p1]; - friends.push(p2); - const alphaProfile: Profile = { - uid: profiles[2].uid, - name: profiles[2].name, - email: profiles[2].email, - age: profiles[2].age, - friend: friends, - }; - await performMutation(alphaProfile); - - const profile: Profile = { - uid: "uid(profile)", - name: "Prashant Shahi", - email: "prashant@dgraph.io", - age: 24, - }; - const query = `query { + const p1: Profile = { uid: await performMutation(profiles[0]) } + const p2: Profile = { uid: await performMutation(profiles[1]) } + const friends: [Profile] = [p1] + friends.push(p2) + const alphaProfile: Profile = { + uid: profiles[2].uid, + name: profiles[2].name, + email: profiles[2].email, + age: profiles[2].age, + friend: friends, + } + await performMutation(alphaProfile) + + const profile: Profile = { + uid: "uid(profile)", + name: "Prashant Shahi", + email: "prashant@dgraph.io", + age: 24, + } + const query = `query { profile as var(func: eq(email, "${profile.email}")) { friends as friend } - }`; - const mu = new dgraph.Mutation(); - mu.setCond(`@if(gt(len(friends), 2))`); - mu.setSetNquads(` + }` + const mu = new dgraph.Mutation() + mu.setCond(`@if(gt(len(friends), 2))`) + mu.setSetNquads(` uid(profile) "${profile.name}" . uid(profile) "${profile.email}" . uid(profile) "${profile.age}"^^ . - `); + `) - await tryUpsert(client, query, mu, profile.uid); + await tryUpsert(client, query, mu, profile.uid) } describe("conditional upsert", () => { - - it("successfully perform conditional upsert", async () => { - client = await setup(); - await setSchema(client, ` + it("successfully perform conditional upsert", async () => { + client = await setup() + await setSchema( + client, + ` name: string @index(term) . email: string @index(exact) . age: int @index(int) . friend: [uid] @reverse . - `); - await doConditionalUpsert(); - const expectedObject: Profile = { - name: "Prashant Shahi", - email: "prashant@dgraph.io", - age: 24, - }; - await checkUpsertIntegrity(expectedObject); - }); - - it("when @if condition is false, do not perform upsert", async () => { - client = await setup(); - await setSchema(client, ` + `, + ) + await doConditionalUpsert() + const expectedObject: Profile = { + name: "Prashant Shahi", + email: "prashant@dgraph.io", + age: 24, + } + await checkUpsertIntegrity(expectedObject) + }) + + it("when @if condition is false, do not perform upsert", async () => { + client = await setup() + await setSchema( + client, + ` name: string @index(term) . email: string @index(exact) . age: int @index(int) . friend: [uid] @reverse . - `); - await doUnconditionalUpsert(); - const expectedObject: Profile = { - name: "Prashant", - email: "prashant@dgraph.io", - age: 23, - }; - await checkUpsertIntegrity(expectedObject); - }); -}); + `, + ) + await doUnconditionalUpsert() + const expectedObject: Profile = { + name: "Prashant", + email: "prashant@dgraph.io", + age: 23, + } + await checkUpsertIntegrity(expectedObject) + }) +}) diff --git a/tests/integration/conflict.spec.ts b/tests/integration/conflict.spec.ts index 8f6d3bb..aeb009f 100644 --- a/tests/integration/conflict.spec.ts +++ b/tests/integration/conflict.spec.ts @@ -1,58 +1,58 @@ -import * as dgraph from "../../src"; +import * as dgraph from "../../src" -import { setup } from "../helper"; +import { setup } from "../helper" describe("conflict", () => { - it("aborts when TxnConflict raises exception", async () => { - const client = await setup(); - - const txn1 = client.newTxn(); - - let mu = new dgraph.Mutation(); - mu.setSetNquads('_:alice "Alice" .'); - const res = await txn1.mutate(mu); - const uid = res.getUidsMap().get("alice"); - - const txn2 = client.newTxn(); - mu = new dgraph.Mutation(); - mu.setSetNquads(`<${uid}> "Alice" .`); - await txn2.mutate(mu); - - const p1 = txn1.commit(); - await expect(p1).resolves.toBeUndefined(); - - const p2 = txn2.commit(); - await expect(p2).rejects.toBe(dgraph.ERR_ABORTED); - }); - - it("aborts when TxnReadOnly raises exception", async () => { - const client = await setup(); - const txnOption: dgraph.TxnOptions = { - readOnly: true, - }; - const txn1 = client.newTxn(txnOption); - - const mu = new dgraph.Mutation(); - mu.setSetNquads('_:alice "Alice" .'); - const res = txn1.mutate(mu); - await expect(res).rejects.toBe(dgraph.ERR_READ_ONLY); - }); - - it("aborts when TxnFinished raises exception", async () => { - const client = await setup(); - - const txn1 = client.newTxn(); - - const mu = new dgraph.Mutation(); - mu.setSetNquads('_:alice "Alice" .'); - const res = await txn1.mutate(mu); - const uid = res.getUidsMap().get("alice"); - expect(uid).not.toBe(""); - - const p1 = txn1.commit(); - await expect(p1).resolves.toBeUndefined(); - - const p2 = txn1.commit(); - await expect(p2).rejects.toBe(dgraph.ERR_FINISHED); - }); -}); + it("aborts when TxnConflict raises exception", async () => { + const client = await setup() + + const txn1 = client.newTxn() + + let mu = new dgraph.Mutation() + mu.setSetNquads('_:alice "Alice" .') + const res = await txn1.mutate(mu) + const uid = res.getUidsMap().get("alice") + + const txn2 = client.newTxn() + mu = new dgraph.Mutation() + mu.setSetNquads(`<${uid}> "Alice" .`) + await txn2.mutate(mu) + + const p1 = txn1.commit() + await expect(p1).resolves.toBeUndefined() + + const p2 = txn2.commit() + await expect(p2).rejects.toBe(dgraph.ERR_ABORTED) + }) + + it("aborts when TxnReadOnly raises exception", async () => { + const client = await setup() + const txnOption: dgraph.TxnOptions = { + readOnly: true, + } + const txn1 = client.newTxn(txnOption) + + const mu = new dgraph.Mutation() + mu.setSetNquads('_:alice "Alice" .') + const res = txn1.mutate(mu) + await expect(res).rejects.toBe(dgraph.ERR_READ_ONLY) + }) + + it("aborts when TxnFinished raises exception", async () => { + const client = await setup() + + const txn1 = client.newTxn() + + const mu = new dgraph.Mutation() + mu.setSetNquads('_:alice "Alice" .') + const res = await txn1.mutate(mu) + const uid = res.getUidsMap().get("alice") + expect(uid).not.toBe("") + + const p1 = txn1.commit() + await expect(p1).resolves.toBeUndefined() + + const p2 = txn1.commit() + await expect(p2).rejects.toBe(dgraph.ERR_FINISHED) + }) +}) diff --git a/tests/integration/delete.spec.ts b/tests/integration/delete.spec.ts index 5e5deec..3a7fee6 100644 --- a/tests/integration/delete.spec.ts +++ b/tests/integration/delete.spec.ts @@ -1,143 +1,142 @@ -import * as dgraph from "../../src"; +import * as dgraph from "../../src" -import { setSchema, setup } from "../helper"; +import { setSchema, setup } from "../helper" -let client: dgraph.DgraphClient; +let client: dgraph.DgraphClient async function performUpsert(mu: dgraph.Mutation, query: string, vars: object) { - const req = new dgraph.Request(); - req.addMutations(mu); - req.setQuery(query); - req.setCommitNow(true); - if (vars !== undefined) { - const varsMap = req.getVarsMap(); - req.setQuery(query); - Object.keys(vars).forEach((key: string) => { - varsMap.set(key, vars[key]); - }); - } - await expect(client.newTxn().doRequest(req)).resolves.toBeDefined(); + const req = new dgraph.Request() + req.addMutations(mu) + req.setQuery(query) + req.setCommitNow(true) + if (vars !== undefined) { + const varsMap = req.getVarsMap() + req.setQuery(query) + Object.keys(vars).forEach((key: string) => { + varsMap.set(key, vars[key]) + }) + } + await expect(client.newTxn().doRequest(req)).resolves.toBeDefined() } async function performMutation(mu: dgraph.Mutation, blankNodeLabel: string): Promise { - mu.setCommitNow(true); - const res = await client.newTxn().mutate(mu); - const uid = res.getUidsMap().get(blankNodeLabel); - expect(uid).not.toEqual(""); - return uid; + mu.setCommitNow(true) + const res = await client.newTxn().mutate(mu) + const uid = res.getUidsMap().get(blankNodeLabel) + expect(uid).not.toEqual("") + return uid } async function performJsonMutation(jsonObj: object, blankNodeLabel: string): Promise { - const mu = new dgraph.Mutation(); - mu.setSetJson(jsonObj); - return performMutation(mu, blankNodeLabel); + const mu = new dgraph.Mutation() + mu.setSetJson(jsonObj) + return performMutation(mu, blankNodeLabel) } async function performNquadMutation(nquads: string, blankNodeLabel: string): Promise { - const mu = new dgraph.Mutation(); - mu.setSetNquads(nquads); - return performMutation(mu, blankNodeLabel); + const mu = new dgraph.Mutation() + mu.setSetNquads(nquads) + return performMutation(mu, blankNodeLabel) } async function performNquadDeletion(nquads: string, blankNodeLabel: string): Promise { - const mu = new dgraph.Mutation(); - mu.setDelNquads(nquads); - return performMutation(mu, blankNodeLabel); + const mu = new dgraph.Mutation() + mu.setDelNquads(nquads) + return performMutation(mu, blankNodeLabel) } -async function checkIntegrity(updatedProfile: Object, query: string, vars?: object) { - const res = await client.newTxn().queryWithVars(query, vars); - const receivedObject = res.getJson().all[0]; - expect(receivedObject).toEqual(updatedProfile); +async function checkIntegrity(updatedProfile: object, query: string, vars?: object) { + const res = await client.newTxn().queryWithVars(query, vars) + const receivedObject = res.getJson().all[0] + expect(receivedObject).toEqual(updatedProfile) } async function upsertDeletionWithVars(): Promise { - const jsonObj = { - uid: "_:prashant", - name: "Prashant", - "dgraph.type": "Person", - }; - await performJsonMutation(jsonObj, "prashant"); - const expectedObj = { - name: "Prashant", - }; - const query = `{ + const jsonObj = { + uid: "_:prashant", + name: "Prashant", + "dgraph.type": "Person", + } + await performJsonMutation(jsonObj, "prashant") + const expectedObj = { + name: "Prashant", + } + const query = `{ all(func: has(name)) { name } - }`; - await checkIntegrity(expectedObj, query); - const deleteJsonObj = { - uid: "uid(user)", - }; - const query2 = `query all($userName: string) { + }` + await checkIntegrity(expectedObj, query) + const deleteJsonObj = { + uid: "uid(user)", + } + const query2 = `query all($userName: string) { user as all(func: eq(name, $userName)) - }`; - const vars = { - $userName: "Prashant", - }; - const mu = new dgraph.Mutation(); - mu.setDeleteJson(deleteJsonObj); - await performUpsert(mu, query2, vars); - await checkIntegrity(undefined, query); + }` + const vars = { + $userName: "Prashant", + } + const mu = new dgraph.Mutation() + mu.setDeleteJson(deleteJsonObj) + await performUpsert(mu, query2, vars) + await checkIntegrity(undefined, query) } describe("delete", () => { - it("should delete node", async () => { - client = await setup(); + it("should delete node", async () => { + client = await setup() - const nquads = '_:alice "Alice" .'; - const uid = await performNquadMutation(nquads, "alice"); + const nquads = '_:alice "Alice" .' + const uid = await performNquadMutation(nquads, "alice") - const q = `{ + const q = `{ all(func: uid(${uid})) { name } - }`; - const expectedJson = { - name: "Alice", - }; - await checkIntegrity(expectedJson, q); - - const nquads2 = `<${uid}> * .`; - await performNquadDeletion(nquads2, uid.toString()); - - const res = await client.newTxn().query(q); - expect(res.getJson().all).toHaveLength(0); - }); - - it("should delete edges", async () => { - client = await setup(); - await setSchema(client, "age: int .\nmarried: bool ."); - - const jsonObj = { - uid: "_:alice", - name: "Alice", - age: 26, - loc: "Riley Street", - married: true, - schools: [ - { - name: "Crown Public School", - }, - ], - friends: [ - { - name: "Bob", - age: 24, - }, - { - name: "Charlie", - age: 29, - }, - ], - }; - const uid = await performJsonMutation(jsonObj, "alice"); - - const expectedJson = jsonObj; - // tslint:disable-next-line no-dynamic-delete no-string-literal - delete expectedJson["uid"]; - const query = `{ + }` + const expectedJson = { + name: "Alice", + } + await checkIntegrity(expectedJson, q) + + const nquads2 = `<${uid}> * .` + await performNquadDeletion(nquads2, uid.toString()) + + const res = await client.newTxn().query(q) + expect(res.getJson().all).toHaveLength(0) + }) + + it("should delete edges", async () => { + client = await setup() + await setSchema(client, "age: int .\nmarried: bool .") + + const jsonObj = { + uid: "_:alice", + name: "Alice", + age: 26, + loc: "Riley Street", + married: true, + schools: [ + { + name: "Crown Public School", + }, + ], + friends: [ + { + name: "Bob", + age: 24, + }, + { + name: "Charlie", + age: 29, + }, + ], + } + const uid = await performJsonMutation(jsonObj, "alice") + + const expectedJson = jsonObj + delete expectedJson["uid"] + const query = `{ all(func: uid(${uid})) { name age @@ -151,27 +150,30 @@ describe("delete", () => { age } } - }`; - await checkIntegrity(expectedJson, query); - - const mu = new dgraph.Mutation(); - dgraph.deleteEdges(mu, uid, "friends"); - mu.setCommitNow(true); - await client.newTxn().mutate(mu); - - const res = await client.newTxn().query(query); - expect(res.getJson().all[0].friends).toBeFalsy(); - }); - - it("should delete a node with upsert using graphql", async () => { - client = await setup(); - await setSchema(client, ` + }` + await checkIntegrity(expectedJson, query) + + const mu = new dgraph.Mutation() + dgraph.deleteEdges(mu, uid, "friends") + mu.setCommitNow(true) + await client.newTxn().mutate(mu) + + const res = await client.newTxn().query(query) + expect(res.getJson().all[0].friends).toBeFalsy() + }) + + it("should delete a node with upsert using graphql", async () => { + client = await setup() + await setSchema( + client, + ` name: string @index(hash) . type Person { name: string } - `); - await upsertDeletionWithVars(); - }); -}); + `, + ) + await upsertDeletionWithVars() + }) +}) diff --git a/tests/integration/doRequest.spec.ts b/tests/integration/doRequest.spec.ts index 13c9746..4699451 100644 --- a/tests/integration/doRequest.spec.ts +++ b/tests/integration/doRequest.spec.ts @@ -1,84 +1,91 @@ -import * as dgraph from "../../src"; +import * as dgraph from "../../src" -import { setSchema, setup } from "../helper"; +import { setSchema, setup } from "../helper" -const data = ["200", "300", "400"]; -const UNKNOWN_CODE = "2 UNKNOWN"; +const data = ["200", "300", "400"] +const UNKNOWN_CODE = "2 UNKNOWN" -async function createMutation(element: Object) { - const mu = new dgraph.Mutation(); - mu.setSetJson(element); - return mu; +async function createMutation(element: object) { + const mu = new dgraph.Mutation() + mu.setSetJson(element) + return mu } describe("doRequest", () => { - it("insert 3Quads(mutation) and then query finishes successfully", async () => { - const client = await setup(); - await setSchema(client, "name: string @index(fulltext) ."); + it("insert 3Quads(mutation) and then query finishes successfully", async () => { + const client = await setup() + await setSchema(client, "name: string @index(fulltext) .") - const uids: string[] = []; - let res: dgraph.Response; - let req: dgraph.Request; - for (const datum of data) { - const nquad = new dgraph.NQuad(); - nquad.setSubject(`_:${datum}`); - nquad.setPredicate("name"); + const uids: string[] = [] + let res: dgraph.Response + let req: dgraph.Request + for (const datum of data) { + const nquad = new dgraph.NQuad() + nquad.setSubject(`_:${datum}`) + nquad.setPredicate("name") - const objectValue = new dgraph.Value(); - objectValue.setStrVal(`ok ${datum}`); - nquad.setObjectValue(objectValue); + const objectValue = new dgraph.Value() + objectValue.setStrVal(`ok ${datum}`) + nquad.setObjectValue(objectValue) - const mu = new dgraph.Mutation(); - mu.addSet(nquad); + const mu = new dgraph.Mutation() + mu.addSet(nquad) - req = new dgraph.Request(); - req.setMutationsList([mu]); - req.setCommitNow(true); + req = new dgraph.Request() + req.setMutationsList([mu]) + req.setCommitNow(true) - res = await client.newTxn().doRequest(req); - uids.push(res.getUidsMap().get(datum)); - } - const query = `{ me(func: uid(${uids.join(",")})) { name }}`; - req = new dgraph.Request(); - req.setQuery(query); - res = await client.newTxn().doRequest(req); + res = await client.newTxn().doRequest(req) + uids.push(res.getUidsMap().get(datum)) + } + const query = `{ me(func: uid(${uids.join(",")})) { name }}` + req = new dgraph.Request() + req.setQuery(query) + res = await client.newTxn().doRequest(req) - expect(res.getJson()).toEqual({ me: [{ name: "ok 200" }, { name: "ok 300" }, { name: "ok 400" }] }); - }); + expect(res.getJson()).toEqual({ + me: [{ name: "ok 200" }, { name: "ok 300" }, { name: "ok 400" }], + }) + }) - it("performs two mutations and then query finishes successfully", async () => { - const client = await setup(); - await setSchema(client, ` + it("performs two mutations and then query finishes successfully", async () => { + const client = await setup() + await setSchema( + client, + ` name: string @index(fulltext) . - `); - const dataSet = [ - { name: `ok ${data[0]}` }, - { name: `ok ${data[1]}` }, - ]; - const mu1 = await createMutation(dataSet[0]); - const mu2 = await createMutation(dataSet[1]); - const req = new dgraph.Request(); - req.setMutationsList([mu1, mu2]); - req.setCommitNow(true); - const resp = client.newTxn().doRequest(req); - await expect(resp).resolves.toBeDefined(); + `, + ) + const dataSet = [{ name: `ok ${data[0]}` }, { name: `ok ${data[1]}` }] + const mu1 = await createMutation(dataSet[0]) + const mu2 = await createMutation(dataSet[1]) + const req = new dgraph.Request() + req.setMutationsList([mu1, mu2]) + req.setCommitNow(true) + const resp = client.newTxn().doRequest(req) + await expect(resp).resolves.toBeDefined() - const query = `{ me(func: has(name), orderasc: name) { name }}`; - const res = await client.newTxn().query(query); - expect(res.getJson()).toEqual({ me: [{ name: "ok 200" }, { name: "ok 300" }] }); - }); + const query = `{ me(func: has(name), orderasc: name) { name }}` + const res = await client.newTxn().query(query) + expect(res.getJson()).toEqual({ + me: [{ name: "ok 200" }, { name: "ok 300" }], + }) + }) - it("fails with zero mutations since either a mutation or a query is required", async () => { - const client = await setup(); - await setSchema(client, ` + it("fails with zero mutations since either a mutation or a query is required", async () => { + const client = await setup() + await setSchema( + client, + ` name: string @index(fulltext) . - `); + `, + ) - const req = new dgraph.Request(); - req.setCommitNow(true); + const req = new dgraph.Request() + req.setCommitNow(true) - const res = client.newTxn().doRequest(req); - const EMPTY_ERROR = new Error(`${UNKNOWN_CODE}: empty request`); - await expect(res).rejects.toEqual(EMPTY_ERROR); - }); -}); + const res = client.newTxn().doRequest(req) + const EMPTY_ERROR = new Error(`${UNKNOWN_CODE}: empty request`) + await expect(res).rejects.toEqual(EMPTY_ERROR) + }) +}) diff --git a/tests/integration/mutate.spec.ts b/tests/integration/mutate.spec.ts index 2a23bab..f0379c8 100644 --- a/tests/integration/mutate.spec.ts +++ b/tests/integration/mutate.spec.ts @@ -1,85 +1,91 @@ -import * as dgraph from "../../src"; +import * as dgraph from "../../src" -import { setSchema, setup } from "../helper"; +import { setSchema, setup } from "../helper" -const data = ["200", "300", "400"]; +const data = ["200", "300", "400"] describe("mutate", () => { - it("should insert 3Quads", async () => { - const client = await setup(); - await setSchema(client, "name: string @index(fulltext) ."); + it("should insert 3Quads", async () => { + const client = await setup() + await setSchema(client, "name: string @index(fulltext) .") - const uids: string[] = []; - let txn = client.newTxn(); - try { - for (const datum of data) { - const nquad = new dgraph.NQuad(); - nquad.setSubject(`_:${datum}`); - nquad.setPredicate("name"); + const uids: string[] = [] + let txn = client.newTxn() + try { + for (const datum of data) { + const nquad = new dgraph.NQuad() + nquad.setSubject(`_:${datum}`) + nquad.setPredicate("name") - const ov = new dgraph.Value(); - ov.setStrVal(`ok ${datum}`); - nquad.setObjectValue(ov); + const ov = new dgraph.Value() + ov.setStrVal(`ok ${datum}`) + nquad.setObjectValue(ov) - const mu = new dgraph.Mutation(); - mu.addSet(nquad); + const mu = new dgraph.Mutation() + mu.addSet(nquad) - const ag = await txn.mutate(mu); - uids.push(ag.getUidsMap().get(datum)); - } + const ag = await txn.mutate(mu) + uids.push(ag.getUidsMap().get(datum)) + } - await txn.commit(); - } finally { - await txn.discard(); - } + await txn.commit() + } finally { + await txn.discard() + } - txn = client.newTxn(); - const query = `{ me(func: uid(${uids.join(",")})) { name }}`; - const res = await txn.query(query); - await txn.commit(); + txn = client.newTxn() + const query = `{ me(func: uid(${uids.join(",")})) { name }}` + const res = await txn.query(query) + await txn.commit() - expect(res.getJson()).toEqual({ me: [{ name: "ok 200" }, { name: "ok 300" }, { name: "ok 400" }] }); - }); + expect(res.getJson()).toEqual({ + me: [{ name: "ok 200" }, { name: "ok 300" }, { name: "ok 400" }], + }) + }) - it("should insert vector", async () => { - const client = await setup(); - await setSchema(client, `project_discription_v: float32vector @index(hnsw(exponent: "5", metric: "euclidean")) .`); + it("should insert vector", async () => { + const client = await setup() + await setSchema( + client, + `project_discription_v: float32vector @index(hnsw(exponent: "5", metric: "euclidean")) .`, + ) - let txn = client.newTxn(); - try { - const nquad = new dgraph.NQuad(); - nquad.setSubject(`0x1011`); - nquad.setPredicate("project_discription_v"); + let txn = client.newTxn() + try { + const nquad = new dgraph.NQuad() + nquad.setSubject(`0x1011`) + nquad.setPredicate("project_discription_v") - const ov = new dgraph.Value(); - const vector = new Float32Array([5.1, 5.1, 1.1]); - const uint8Array = new Uint8Array(vector.buffer); - ov.setVfloat32Val(uint8Array) - nquad.setObjectValue(ov); + const ov = new dgraph.Value() + const vector = new Float32Array([5.1, 5.1, 1.1]) + const uint8Array = new Uint8Array(vector.buffer) + ov.setVfloat32Val(uint8Array) + nquad.setObjectValue(ov) - const mu = new dgraph.Mutation(); - mu.addSet(nquad); - await txn.mutate(mu); - await txn.commit(); - } finally { - await txn.discard(); - } + const mu = new dgraph.Mutation() + mu.addSet(nquad) + await txn.mutate(mu) + await txn.commit() + } finally { + await txn.discard() + } - txn = client.newTxn(); - const query = `query { q (func: uid(0x1011)) { + txn = client.newTxn() + const query = `query { q (func: uid(0x1011)) { uid project_discription_v } - } `; - const res = await txn.query(query); - await txn.commit(); - expect(res.getJson()).toEqual({ - q: [ - { - uid: "0x1011", - project_discription_v: [5.1, 5.1, 1.1] - } - ] - }); }); -}); + } ` + const res = await txn.query(query) + await txn.commit() + expect(res.getJson()).toEqual({ + q: [ + { + uid: "0x1011", + project_discription_v: [5.1, 5.1, 1.1], + }, + ], + }) + }) +}) diff --git a/tests/integration/typeSystem.spec.ts b/tests/integration/typeSystem.spec.ts index 01d07e7..c5ec0c8 100644 --- a/tests/integration/typeSystem.spec.ts +++ b/tests/integration/typeSystem.spec.ts @@ -1,58 +1,60 @@ -import * as dgraph from "../../src"; +import * as dgraph from "../../src" -import { setSchema, setup } from "../helper"; +import { setSchema, setup } from "../helper" -let client: dgraph.DgraphClient; +let client: dgraph.DgraphClient async function performMutation() { - const mu = new dgraph.Mutation(); - mu.setSetNquads(` + const mu = new dgraph.Mutation() + mu.setSetNquads(` _:prashant "Prashant" . _:prashant "23" . _:prashant "Person" . - `); - mu.setCommitNow(true); + `) + mu.setCommitNow(true) - const resp = await client.newTxn().mutate(mu); - expect(resp.getUidsMap().get("prashant")).toBeDefined(); + const resp = await client.newTxn().mutate(mu) + expect(resp.getUidsMap().get("prashant")).toBeDefined() - await expandQuery(1); + await expandQuery(1) } async function performDeletion() { - const req = new dgraph.Request(); - const q = `query { + const req = new dgraph.Request() + const q = `query { me as var(func: eq(name, "Prashant")) - }`; - req.setQuery(q); + }` + req.setQuery(q) - const mu = new dgraph.Mutation(); - mu.setDelNquads(`uid(me) * * .`); - req.setMutationsList([mu]); - req.setCommitNow(true); + const mu = new dgraph.Mutation() + mu.setDelNquads(`uid(me) * * .`) + req.setMutationsList([mu]) + req.setCommitNow(true) - const resp = await client.newTxn().doRequest(req); - const uid = resp.getUidsMap().get("uid(me)"); - expect(uid).toBeUndefined(); + const resp = await client.newTxn().doRequest(req) + const uid = resp.getUidsMap().get("uid(me)") + expect(uid).toBeUndefined() - await expandQuery(0); + await expandQuery(0) } async function expandQuery(personCount: number) { - const q = `{ + const q = `{ all(func: type(Person)) { expand(_all_) } - }`; - const resp = await client.newTxn().query(q); - const data = resp.getJson(); - expect(data.all.length).toEqual(personCount); + }` + const resp = await client.newTxn().query(q) + const data = resp.getJson() + expect(data.all.length).toEqual(personCount) } describe("Type system/directive", () => { - it("query fields expand using type system", async () => { - client = await setup(); - await setSchema(client, ` + it("query fields expand using type system", async () => { + client = await setup() + await setSchema( + client, + ` name: string @index(term) . age: int @index(int) . @@ -60,14 +62,17 @@ describe("Type system/directive", () => { name age } - `); + `, + ) - await performMutation(); - }); + await performMutation() + }) - it("performs s * * delete", async () => { - client = await setup(); - await setSchema(client, ` + it("performs s * * delete", async () => { + client = await setup() + await setSchema( + client, + ` name: string @index(term) . age: int @index(int) . @@ -75,9 +80,10 @@ describe("Type system/directive", () => { name age } - `); + `, + ) - await performMutation(); - await performDeletion(); - }); -}); + await performMutation() + await performDeletion() + }) +}) diff --git a/tests/integration/upsert.spec.ts b/tests/integration/upsert.spec.ts index 7862201..2c926d6 100644 --- a/tests/integration/upsert.spec.ts +++ b/tests/integration/upsert.spec.ts @@ -1,411 +1,424 @@ -import * as dgraph from "../../src"; +import * as dgraph from "../../src" -import { setSchema, setup, tryUpsert } from "../helper"; +import { setSchema, setup, tryUpsert } from "../helper" -const concurrency = 3; -const FIVE_MINUTES_IN_SECONDS = 5 * 60 * 1000; // 5 minutes in milliseconds +const concurrency = 3 +const FIVE_MINUTES_IN_SECONDS = 5 * 60 * 1000 // 5 minutes in milliseconds -// tslint:disable-next-line no-string-based-set-timeout -jest.setTimeout(FIVE_MINUTES_IN_SECONDS * 2); +jest.setTimeout(FIVE_MINUTES_IN_SECONDS * 2) -let client: dgraph.DgraphClient; +let client: dgraph.DgraphClient -const firsts = ["Paul", "Eric", "Jack", "John", "Martin"]; -const lasts = ["Brown", "Smith", "Robinson", "Waters", "Taylor"]; -const ages = [20, 25, 30, 35]; +const firsts = ["Paul", "Eric", "Jack", "John", "Martin"] +const lasts = ["Brown", "Smith", "Robinson", "Waters", "Taylor"] +const ages = [20, 25, 30, 35] type Account = { - first: string; - last: string; - age: number; -}; -const accounts: Account[] = []; - -firsts.forEach((first: string): void => lasts.forEach((last: string): void => ages.forEach((age: number): void => { - accounts.push({ + first: string + last: string + age: number +} +const accounts: Account[] = [] + +firsts.forEach((first: string): void => + lasts.forEach((last: string): void => + ages.forEach((age: number): void => { + accounts.push({ first, last, age, - }); -}))); + }) + }), + ), +) -let startStatus = 0; // set at the start of doUpserts -let lastStatus = 0; -let cancelled = false; // cancelled due to timeout +let startStatus = 0 // set at the start of doUpserts +let lastStatus = 0 +let cancelled = false // cancelled due to timeout -let successCount = 0; -let retryCount = 0; +let successCount = 0 +let retryCount = 0 function conditionalLog(): void { - const now = new Date().getTime(); - if (now - lastStatus > 1000 && !cancelled) { - // eslint-disable-next-line no-console - console.log(`Success: ${successCount}, Retries: ${retryCount}, Total Time: ${now - startStatus} ms`); - lastStatus = now; - } + const now = new Date().getTime() + if (now - lastStatus > 1000 && !cancelled) { + console.log( + `Success: ${successCount}, Retries: ${retryCount}, Total Time: ${now - startStatus} ms`, + ) + lastStatus = now + } } async function upsert(account: Account): Promise { - let done = false; - const query = `query { + let done = false + const query = `query { account as var(func: eq(first, "${account.first}")) @filter(eq(last, "${account.last}") AND eq(age, "${account.age}")) - }`; - const mu = new dgraph.Mutation(); - mu.setSetNquads(` + }` + const mu = new dgraph.Mutation() + mu.setSetNquads(` uid(account) "${account.first}" . uid(account) "${account.last}" . uid(account) "${account.age}"^^ . - `); - const blankNodeLabel = `uid(account)`; - while (!done && !cancelled) { - try { - await tryUpsert(client, query, mu, blankNodeLabel); - successCount += 1; - done = true; - } catch (e) { - expect(e).toBe(dgraph.ERR_ABORTED); - retryCount += 1; - } - - conditionalLog(); + `) + const blankNodeLabel = `uid(account)` + while (!done && !cancelled) { + try { + await tryUpsert(client, query, mu, blankNodeLabel) + successCount += 1 + done = true + } catch (e) { + expect(e).toBe(dgraph.ERR_ABORTED) + retryCount += 1 } - if (!done) { - throw new Error(`Timeout elapsed: ${FIVE_MINUTES_IN_SECONDS / 1000}s`); - } + conditionalLog() + } + + if (!done) { + throw new Error(`Timeout elapsed: ${FIVE_MINUTES_IN_SECONDS / 1000}s`) + } } async function doUpserts(): Promise { - const promises: Promise[] = []; - for (const account of accounts) { - for (let i = 0; i < concurrency; i += 1) { - promises.push(upsert(account)); - } + const promises: Promise[] = [] + for (const account of accounts) { + for (let i = 0; i < concurrency; i += 1) { + promises.push(upsert(account)) } + } - startStatus = new Date().getTime(); - const id = setTimeout( - () => { - cancelled = true; - }, - FIVE_MINUTES_IN_SECONDS, - ); - - await Promise.all(promises).then(() => { - clearTimeout(id); - }); + startStatus = new Date().getTime() + const id = setTimeout(() => { + cancelled = true + }, FIVE_MINUTES_IN_SECONDS) + + await Promise.all(promises).then(() => { + clearTimeout(id) + }) } async function checkIntegrity(): Promise { - const res = await client.newTxn().query(`{ + const res = await client.newTxn().query(`{ all(func: anyofterms(first, "${firsts.join(" ")}")) { first last age } - }`); - - const data: { - all: Account[]; - } = res.getJson(); // eslint-disable-line @typescript-eslint/tslint/config - - const accountSet: { [key: string]: boolean } = {}; - for (const account of data.all) { - expect(account.first).toBeTruthy(); - expect(account.last).toBeTruthy(); - expect(account.age).toBeTruthy(); - accountSet[`${account.first}_${account.last}_${account.age}`] = true; } - - for (const account of accounts) { - expect(accountSet[`${account.first}_${account.last}_${account.age}`]).toBe(true); - } + }`) + + const data: { + all: Account[] + } = res.getJson() + + const accountSet: { [key: string]: boolean } = {} + for (const account of data.all) { + expect(account.first).toBeTruthy() + expect(account.last).toBeTruthy() + expect(account.age).toBeTruthy() + accountSet[`${account.first}_${account.last}_${account.age}`] = true + } + + for (const account of accounts) { + expect(accountSet[`${account.first}_${account.last}_${account.age}`]).toBe(true) + } } type Profile = { - uid?: string; - name: string; - email: string; - age: number; -}; + uid?: string + name: string + email: string + age: number +} const profiles: Profile[] = [ - { name: "Alice", email: "alice@dgraph.io", age: 25 }, - { name: "Bob", email: "bob@dgraph.io", age: 28 }, - { name: "Prashant", email: "prashant@dgraph.io", age: 23 }, -]; -const names: string[] = []; + { name: "Alice", email: "alice@dgraph.io", age: 25 }, + { name: "Bob", email: "bob@dgraph.io", age: 28 }, + { name: "Prashant", email: "prashant@dgraph.io", age: 23 }, +] +const names: string[] = [] profiles.forEach((profile: Profile): void => { - names.push(profile.name); -}); + names.push(profile.name) +}) async function doUpsert(): Promise { - await performMutation(profiles[0]); - await performMutation(profiles[1]); - await performMutation(profiles[2]); - await checkMutationIntegrity(profiles); - const updatedProfile: Profile = { - name: "Prashant Shahi", - email: "prashant@dgraph.io", - age: 24, - }; - await performUpsert(updatedProfile); - await checkUpsertIntegrity(); + await performMutation(profiles[0]) + await performMutation(profiles[1]) + await performMutation(profiles[2]) + await checkMutationIntegrity(profiles) + const updatedProfile: Profile = { + name: "Prashant Shahi", + email: "prashant@dgraph.io", + age: 24, + } + await performUpsert(updatedProfile) + await checkUpsertIntegrity() } async function doInsertUpsert(): Promise { - await performMutation(profiles[0]); - await performMutation(profiles[1]); - await performMutation(profiles[2]); - const tempProfiles: Profile[] = JSON.parse(JSON.stringify(profiles)); - await checkMutationIntegrity(tempProfiles); - const updatedProfile: Profile = { - uid: "uid(profile)", - name: "Prashant Shahi", - email: "prashantshahi@dgraph.io", - age: 24, - }; - await performUpsert(updatedProfile); - tempProfiles.push(updatedProfile); - await checkMutationIntegrity(tempProfiles); + await performMutation(profiles[0]) + await performMutation(profiles[1]) + await performMutation(profiles[2]) + const tempProfiles: Profile[] = JSON.parse(JSON.stringify(profiles)) + await checkMutationIntegrity(tempProfiles) + const updatedProfile: Profile = { + uid: "uid(profile)", + name: "Prashant Shahi", + email: "prashantshahi@dgraph.io", + age: 24, + } + await performUpsert(updatedProfile) + tempProfiles.push(updatedProfile) + await checkMutationIntegrity(tempProfiles) } async function doJsonUpsert(): Promise { - await performJsonMutation(profiles[0]); - await performJsonMutation(profiles[1]); - await performJsonMutation(profiles[2]); - const tempProfiles: Profile[] = JSON.parse(JSON.stringify(profiles)); - await checkMutationIntegrity(tempProfiles); - - const updatedProfile: Profile = { - name: "Prashant Shahi", - email: "prashant@dgraph.io", - age: 24, - }; - await performJsonUpsert(updatedProfile); - await checkUpsertIntegrity(); - tempProfiles.pop(); - tempProfiles.push(updatedProfile); - await checkMutationIntegrity(tempProfiles); + await performJsonMutation(profiles[0]) + await performJsonMutation(profiles[1]) + await performJsonMutation(profiles[2]) + const tempProfiles: Profile[] = JSON.parse(JSON.stringify(profiles)) + await checkMutationIntegrity(tempProfiles) + + const updatedProfile: Profile = { + name: "Prashant Shahi", + email: "prashant@dgraph.io", + age: 24, + } + await performJsonUpsert(updatedProfile) + await checkUpsertIntegrity() + tempProfiles.pop() + tempProfiles.push(updatedProfile) + await checkMutationIntegrity(tempProfiles) } async function performJsonMutation(profile: Profile): Promise { - const txn = client.newTxn(); - const mu = new dgraph.Mutation(); - const blankNodeLabel = profile.name.toLocaleLowerCase(); - profile.uid = `_:${blankNodeLabel}`; - mu.setSetJson(profile); - - const res = await txn.mutate(mu); - await txn.commit(); - const uid = res.getUidsMap().get(blankNodeLabel); - expect(uid).not.toEqual(""); + const txn = client.newTxn() + const mu = new dgraph.Mutation() + const blankNodeLabel = profile.name.toLocaleLowerCase() + profile.uid = `_:${blankNodeLabel}` + mu.setSetJson(profile) + + const res = await txn.mutate(mu) + await txn.commit() + const uid = res.getUidsMap().get(blankNodeLabel) + expect(uid).not.toEqual("") } async function performMutation(profile: Profile): Promise { - const txn = client.newTxn(); - const mu = new dgraph.Mutation(); - const blankNodeLabel = `${profile.name.toLocaleLowerCase()}`; + const txn = client.newTxn() + const mu = new dgraph.Mutation() + const blankNodeLabel = `${profile.name.toLocaleLowerCase()}` - mu.setSetNquads(` + mu.setSetNquads(` _:${blankNodeLabel} "${profile.name}" . _:${blankNodeLabel} "${profile.email}" . _:${blankNodeLabel} "${profile.age}"^^ . - `); + `) - const res = await txn.mutate(mu); - await txn.commit(); - const uid = res.getUidsMap().get(blankNodeLabel); - expect(uid).not.toEqual(""); + const res = await txn.mutate(mu) + await txn.commit() + const uid = res.getUidsMap().get(blankNodeLabel) + expect(uid).not.toEqual("") } async function performUpsert(profile: Profile): Promise { - const query = `query { + const query = `query { profile as var(func: eq(email, "${profile.email}")) - }`; - const mu = new dgraph.Mutation(); - const blankNodeLabel = `uid(profile)`; - mu.setSetNquads(` + }` + const mu = new dgraph.Mutation() + const blankNodeLabel = `uid(profile)` + mu.setSetNquads(` ${blankNodeLabel} "${profile.name}" . ${blankNodeLabel} "${profile.email}" . ${blankNodeLabel} "${profile.age}"^^ . - `); + `) - await tryUpsert(client, query, mu, blankNodeLabel); + await tryUpsert(client, query, mu, blankNodeLabel) } async function performJsonUpsert(profile: Profile): Promise { - const query = `query { + const query = `query { profile as var(func: eq(email, "${profile.email}")) - }`; - const mu = new dgraph.Mutation(); - const blankNodeLabel = `uid(profile)`; - profile.uid = blankNodeLabel; - mu.setSetJson(profile); - const req = new dgraph.Request(); - req.setQuery(query); - req.setMutationsList([mu]); - req.setCommitNow(true); - - const response = await client.newTxn().doRequest(req); - const uid = response.getUidsMap().get(blankNodeLabel); - expect(uid).not.toEqual(""); + }` + const mu = new dgraph.Mutation() + const blankNodeLabel = `uid(profile)` + profile.uid = blankNodeLabel + mu.setSetJson(profile) + const req = new dgraph.Request() + req.setQuery(query) + req.setMutationsList([mu]) + req.setCommitNow(true) + + const response = await client.newTxn().doRequest(req) + const uid = response.getUidsMap().get(blankNodeLabel) + expect(uid).not.toEqual("") } async function checkMutationIntegrity(ourProfiles: Profile[]): Promise { - const query = `{ + const query = `{ all(func: anyofterms(name, "${names.join(" ")}")) { uid name email age } - }`; - const res = await client.newTxn().query(query); - - const data: { - all: Profile[]; - } = res.getJson(); // eslint-disable-line @typescript-eslint/tslint/config - - const profileSet: { [key: string]: boolean } = {}; - for (const profile of data.all) { - expect(profile.name).toBeTruthy(); - expect(profile.email).toBeTruthy(); - expect(profile.age).toBeTruthy(); - profileSet[`${profile.name}_${profile.email}_${profile.age}`] = true; - } - - expect(data.all.length).toEqual(ourProfiles.length); - for (const profile of ourProfiles) { - expect(profileSet[`${profile.name}_${profile.email}_${profile.age}`]).toBe(true); - } + }` + const res = await client.newTxn().query(query) + + const data: { + all: Profile[] + } = res.getJson() + + const profileSet: { [key: string]: boolean } = {} + for (const profile of data.all) { + expect(profile.name).toBeTruthy() + expect(profile.email).toBeTruthy() + expect(profile.age).toBeTruthy() + profileSet[`${profile.name}_${profile.email}_${profile.age}`] = true + } + + expect(data.all.length).toEqual(ourProfiles.length) + for (const profile of ourProfiles) { + expect(profileSet[`${profile.name}_${profile.email}_${profile.age}`]).toBe(true) + } } async function checkUpsertIntegrity(): Promise { - const query = `{ + const query = `{ all(func: eq(email, "prashant@dgraph.io")) { name email age } - }`; - const res = await client.newTxn().query(query); - - const data: { - all: Profile[]; - } = res.getJson(); // eslint-disable-line @typescript-eslint/tslint/config - - const profileSet: { [key: string]: boolean } = {}; - for (const profile of data.all) { - expect(profile.name).toBeTruthy(); - expect(profile.email).toBeTruthy(); - expect(profile.age).toBeTruthy(); - profileSet[`${profile.name}_${profile.email}_${profile.age}`] = true; - } - - const receivedObject: Profile = data.all[0]; - const expectedObject: Profile = { - name: "Prashant Shahi", - email: "prashant@dgraph.io", - age: 24, - }; - - expect(Object.keys(profileSet).length).toEqual(1); - expect(receivedObject).toEqual(expectedObject); + }` + const res = await client.newTxn().query(query) + + const data: { + all: Profile[] + } = res.getJson() + + const profileSet: { [key: string]: boolean } = {} + for (const profile of data.all) { + expect(profile.name).toBeTruthy() + expect(profile.email).toBeTruthy() + expect(profile.age).toBeTruthy() + profileSet[`${profile.name}_${profile.email}_${profile.age}`] = true + } + + const receivedObject: Profile = data.all[0] + const expectedObject: Profile = { + name: "Prashant Shahi", + email: "prashant@dgraph.io", + age: 24, + } + + expect(Object.keys(profileSet).length).toEqual(1) + expect(receivedObject).toEqual(expectedObject) } async function doInsertUpsertWithVars(): Promise { - await performMutation(profiles[0]); - const jsonObj = { - uid: "uid(person)", - name: "Prashant Shahi", - email: "prashantshahi@dgraph.io", - age: "24", - }; - const query = `query q($email: string) { + await performMutation(profiles[0]) + const jsonObj = { + uid: "uid(person)", + name: "Prashant Shahi", + email: "prashantshahi@dgraph.io", + age: "24", + } + const query = `query q($email: string) { person as q(func: eq(email, $email)) - }`; - const vars = { - $email: "prashant@dgraph.io", - }; - - const txn = client.newTxn(); - const mu = new dgraph.Mutation(); - mu.setSetJson(jsonObj); - - const req = new dgraph.Request(); - const varsMap = req.getVarsMap(); - req.setQuery(query); - Object.keys(vars).forEach((key: string) => { - varsMap.set(key, vars[key]); - }); - req.addMutations(mu); - req.setCommitNow(true); - - try { - // Update account only if matching uid found. - const response = await txn.doRequest(req); - const uid = response.getUidsMap().get("uid(person)"); - expect(uid).not.toEqual(""); - } finally { - await txn.discard(); - } - - const updatedProfile: Profile = { - name: "Prashant Shahi", - email: "prashantshahi@dgraph.io", - age: 24, - }; - const query2 = `query q($email: string) { + }` + const vars = { + $email: "prashant@dgraph.io", + } + + const txn = client.newTxn() + const mu = new dgraph.Mutation() + mu.setSetJson(jsonObj) + + const req = new dgraph.Request() + const varsMap = req.getVarsMap() + req.setQuery(query) + Object.keys(vars).forEach((key: string) => { + varsMap.set(key, vars[key]) + }) + req.addMutations(mu) + req.setCommitNow(true) + + try { + // Update account only if matching uid found. + const response = await txn.doRequest(req) + const uid = response.getUidsMap().get("uid(person)") + expect(uid).not.toEqual("") + } finally { + await txn.discard() + } + + const updatedProfile: Profile = { + name: "Prashant Shahi", + email: "prashantshahi@dgraph.io", + age: 24, + } + const query2 = `query q($email: string) { all(func: eq(email, $email)) { name email age } - }`; - const vars2 = { - $email: "prashantshahi@dgraph.io", - }; - const res = await client.newTxn().queryWithVars(query2, vars2); - const data: { - all: Profile[]; - } = res.getJson(); // eslint-disable-line @typescript-eslint/tslint/config - const receivedObject: Profile = data.all[0]; - expect(receivedObject).toEqual(updatedProfile); + }` + const vars2 = { + $email: "prashantshahi@dgraph.io", + } + const res = await client.newTxn().queryWithVars(query2, vars2) + const data: { + all: Profile[] + } = res.getJson() + const receivedObject: Profile = data.all[0] + expect(receivedObject).toEqual(updatedProfile) } describe("upsert using doRequest", () => { - it("update existing data with upsert", async () => { - client = await setup(); - await setSchema(client, ` + it("update existing data with upsert", async () => { + client = await setup() + await setSchema( + client, + ` name: string @index(term) . email: string @index(exact) . age: int @index(int) . - `); - await doUpsert(); - }); - - it("create new data with upsert", async () => { - client = await setup(); - await setSchema(client, ` + `, + ) + await doUpsert() + }) + + it("create new data with upsert", async () => { + client = await setup() + await setSchema( + client, + ` name: string @index(term) . email: string @index(exact) . age: int @index(int) . - `); - await doInsertUpsert(); - }); - - it("create new data with GraphQL variables", async () => { - client = await setup(); - await setSchema(client, ` + `, + ) + await doInsertUpsert() + }) + + it("create new data with GraphQL variables", async () => { + client = await setup() + await setSchema( + client, + ` name: string @index(term) . email: string @index(exact) . age: int @index(int) . - `); - await doInsertUpsertWithVars(); - }); - - it("successfully performs upsert loadset", async () => { - client = await setup(); - await setSchema(client, ` + `, + ) + await doInsertUpsertWithVars() + }) + + it("successfully performs upsert loadset", async () => { + client = await setup() + await setSchema( + client, + ` first: string @index(term) . last: string @index(hash) . age: int @index(int) . @@ -416,18 +429,22 @@ describe("upsert using doRequest", () => { last age } - `); - await doUpserts(); - await checkIntegrity(); - }); - - it("successfully performs upsert using JSON", async () => { - client = await setup(); - await setSchema(client, ` + `, + ) + await doUpserts() + await checkIntegrity() + }) + + it("successfully performs upsert using JSON", async () => { + client = await setup() + await setSchema( + client, + ` name: string @index(term) . email: string @index(exact) . age: int @index(int) . - `); - await doJsonUpsert(); - }); -}); + `, + ) + await doJsonUpsert() + }) +}) diff --git a/tests/tslint.json b/tests/tslint.json deleted file mode 100644 index 426cddf..0000000 --- a/tests/tslint.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": [ - "../tslint.json" - ], - "rules": { - "no-unsafe-any": false - } -} diff --git a/tests/txn.spec.ts b/tests/txn.spec.ts index 4c4b6a7..e3d1cc7 100644 --- a/tests/txn.spec.ts +++ b/tests/txn.spec.ts @@ -1,212 +1,203 @@ -import * as dgraph from "../src"; +import * as dgraph from "../src" -import { setSchema, setup } from "./helper"; +import { setSchema, setup } from "./helper" -const timeout = 1 * 60 * 1000; // 1 minute in milliseconds +const timeout = 1 * 60 * 1000 // 1 minute in milliseconds -// tslint:disable-next-line no-string-based-set-timeout -jest.setTimeout(timeout * 2); +jest.setTimeout(timeout * 2) -let client: dgraph.DgraphClient; +let client: dgraph.DgraphClient describe("txn", () => { - describe("queryWithVars", () => { - let uid; - beforeAll(async () => { - client = await setup(); - await setSchema(client, "name: string @index(exact) ."); - - const mu = new dgraph.Mutation(); - mu.setCommitNow(true); - mu.setSetNquads('_:alice "Alice" .'); - const mutres = await client.newTxn().mutate(mu); - uid = mutres.getUidsMap().get("alice"); - }); - - it("should query with variables", async () => { - let res = await client.newTxn().queryWithVars( - "query me($a: string) { me(func: eq(name, $a)) { name }}", - { - $a: "Alice", - }, - ); - let resJson: { - me: { name: string }[]; - } = res.getJson(); // eslint-disable-line @typescript-eslint/tslint/config - expect(resJson.me).toHaveLength(1); - expect(resJson.me[0].name).toEqual("Alice"); - - res = await client.newTxn().queryWithVars( - "query me($a: string) { me(func: eq(name, $a)) { name }}", - { - $a: new String("Alice"), // tslint:disable-line no-construct - $b: true, // non-string properties are ignored - }, - ); - resJson = res.getJson(); // eslint-disable-line @typescript-eslint/tslint/config - expect(resJson.me).toHaveLength(1); - expect(resJson.me[0].name).toEqual("Alice"); - }); - - it("should query with variables RDF", async () => { - let res = await client - .newTxn() - .queryRDFWithVars( - "query me($a: string) { me(func: eq(name, $a)) { name }}", - { - $a: "Alice", - } - ); - let resRdf = res.getRdf_asB64(); - let buff = Buffer.from(resRdf, "base64"); - expect(buff.toString("utf-8")).toEqual( - `<${uid}> \"Alice\" .\n` - ); - - res = await client - .newTxn() - .queryRDFWithVars( - "query me($a: string) { me(func: eq(name, $a)) { name }}", - { - $a: new String("Alice"), // tslint:disable-line no-construct - $b: true, // non-string properties are ignored - } - ); - resRdf = res.getRdf_asB64(); - buff = Buffer.from(resRdf, "base64"); - expect(buff.toString("utf-8")).toEqual( - `<${uid}> \"Alice\" .\n` - ); - }); - - it("should ignore properties with non-string values", async () => { - const res = await client.newTxn().queryWithVars( - "query me($a: string) { me(func: eq(name, $a)) { name }}", - { - $a: 1, // non-string properties are ignored - }, - ); - const resJson: { - me: { name: string }[]; - } = res.getJson(); // eslint-disable-line @typescript-eslint/tslint/config - expect(resJson.me).toHaveLength(0); - }); - - it("should throw finished error if txn is already finished", async () => { - const txn = client.newTxn(); - await txn.commit(); - - const p = txn.query('{ me(func: eq(name, "Alice")) { name }}'); - await expect(p).rejects.toBe(dgraph.ERR_FINISHED); - }); - - it("should succeed without increasing startTs (readOnly=true)", async () => { - const res = await client.newTxn().query('{ me(func: eq(name, "Alice")) { name }}'); - const startTs = res.getTxn().getStartTs(); - const res2 = await client.newTxn({ readOnly: true }).query('{ me(func: eq(name, "Alice")) { name }}'); - const startTs2 = res2.getTxn().getStartTs(); - expect(startTs).not.toBe(startTs2); // we expect these to be different, the first query increases startTs - const res3 = await client.newTxn({ readOnly: true }).query('{ me(func: eq(name, "Alice")) { name }}'); - const startTs3 = res3.getTxn().getStartTs(); - expect(startTs2).toBe(startTs3); // we expect these to be same, because readOnly doesn't increase startTs - }); - - it("should succeed without error (readOnly=true, bestEffort=true)", async () => { - const res = await client.newTxn().query('{ me(func: eq(name, "Alice")) { name }}'); - const startTs = res.getTxn().getStartTs(); - const res2 = await client.newTxn({ readOnly: true, bestEffort: true }).query('{ me(func: eq(name, "Alice")) { name }}'); - const startTs2 = res2.getTxn().getStartTs(); - expect(startTs2).toBeGreaterThanOrEqual(startTs); - }); - - it("should throw error (readOnly=false, bestEffort=true)", () => { - const test = () => client.newTxn({ bestEffort: true }); - expect(test).toThrow(dgraph.ERR_BEST_EFFORT_REQUIRED_READ_ONLY); - }); - - }); - - describe("mutate", () => { - beforeAll(async () => { - client = await setup(); - await setSchema(client, "name: string @index(exact) ."); - }); - - it("should throw finished error if txn is already finished", async () => { - const txn = client.newTxn(); - await txn.commit(); - - const mu = new dgraph.Mutation(); - mu.setSetNquads('_:alice "Alice" .'); - const p = txn.mutate(mu); - await expect(p).rejects.toBe(dgraph.ERR_FINISHED); - }); - - it("should throw error and discard if Stub.mutate throws an error", async () => { - const txn = client.newTxn(); - - const mu = new dgraph.Mutation(); - // There is an error in the mutation NQuad. - mu.setSetNquads('alice "Alice" .'); - const p1 = txn.mutate(mu); - await expect(p1).rejects.toBeDefined(); - - const p2 = txn.commit(); - await expect(p2).rejects.toBe(dgraph.ERR_FINISHED); - }); - }); - - describe("commit", () => { - beforeAll(async () => { - client = await setup(); - await setSchema(client, "name: string @index(exact) ."); - }); - - it("should throw finished error if txn is already finished", async () => { - const txn = client.newTxn(); - await txn.commit(); - - const p = txn.commit(); - await expect(p).rejects.toBe(dgraph.ERR_FINISHED); - }); - - it("should throw finished error after mutation with commitNow", async () => { - const txn = client.newTxn(); - - const mu = new dgraph.Mutation(); - mu.setSetNquads('_:alice "Alice" .'); - mu.setCommitNow(true); - await txn.mutate(mu); - - const p = txn.commit(); - await expect(p).rejects.toBe(dgraph.ERR_FINISHED); - }); - }); - - describe("discard", () => { - beforeAll(async () => { - client = await setup(); - await setSchema(client, "name: string @index(exact) ."); - }); - - it("should resolve and do nothing if txn is already finished", async () => { - const txn = client.newTxn(); - await txn.commit(); - - const p = txn.discard(); - await expect(p).resolves.toBeUndefined(); - }); - - it("should resolve and do nothing after mutation with commitNow", async () => { - const txn = client.newTxn(); - - const mu = new dgraph.Mutation(); - mu.setSetNquads('_:alice "Alice" .'); - mu.setCommitNow(true); - await txn.mutate(mu); - - const p = txn.discard(); - await expect(p).resolves.toBeUndefined(); - }); - }); -}); + describe("queryWithVars", () => { + let uid + beforeAll(async () => { + client = await setup() + await setSchema(client, "name: string @index(exact) .") + + const mu = new dgraph.Mutation() + mu.setCommitNow(true) + mu.setSetNquads('_:alice "Alice" .') + const mutres = await client.newTxn().mutate(mu) + uid = mutres.getUidsMap().get("alice") + }) + + it("should query with variables", async () => { + let res = await client + .newTxn() + .queryWithVars("query me($a: string) { me(func: eq(name, $a)) { name }}", { + $a: "Alice", + }) + let resJson: { + me: { name: string }[] + } = res.getJson() + expect(resJson.me).toHaveLength(1) + expect(resJson.me[0].name).toEqual("Alice") + + res = await client + .newTxn() + .queryWithVars("query me($a: string) { me(func: eq(name, $a)) { name }}", { + $a: new String("Alice"), + $b: true, + }) + resJson = res.getJson() + expect(resJson.me).toHaveLength(1) + expect(resJson.me[0].name).toEqual("Alice") + }) + + it("should query with variables RDF", async () => { + let res = await client + .newTxn() + .queryRDFWithVars("query me($a: string) { me(func: eq(name, $a)) { name }}", { + $a: "Alice", + }) + let resRdf = res.getRdf_asB64() + let buff = Buffer.from(resRdf, "base64") + expect(buff.toString("utf-8")).toEqual(`<${uid}> "Alice" .\n`) + + res = await client + .newTxn() + .queryRDFWithVars("query me($a: string) { me(func: eq(name, $a)) { name }}", { + $a: new String("Alice"), + $b: true, + }) + resRdf = res.getRdf_asB64() + buff = Buffer.from(resRdf, "base64") + expect(buff.toString("utf-8")).toEqual(`<${uid}> "Alice" .\n`) + }) + + it("should ignore properties with non-string values", async () => { + const res = await client + .newTxn() + .queryWithVars("query me($a: string) { me(func: eq(name, $a)) { name }}", { + $a: 1, // non-string properties are ignored + }) + const resJson: { + me: { name: string }[] + } = res.getJson() + expect(resJson.me).toHaveLength(0) + }) + + it("should throw finished error if txn is already finished", async () => { + const txn = client.newTxn() + await txn.commit() + + const p = txn.query('{ me(func: eq(name, "Alice")) { name }}') + await expect(p).rejects.toBe(dgraph.ERR_FINISHED) + }) + + it("should succeed without increasing startTs (readOnly=true)", async () => { + const res = await client.newTxn().query('{ me(func: eq(name, "Alice")) { name }}') + const startTs = res.getTxn().getStartTs() + const res2 = await client + .newTxn({ readOnly: true }) + .query('{ me(func: eq(name, "Alice")) { name }}') + const startTs2 = res2.getTxn().getStartTs() + expect(startTs).not.toBe(startTs2) // we expect these to be different, the first query increases startTs + const res3 = await client + .newTxn({ readOnly: true }) + .query('{ me(func: eq(name, "Alice")) { name }}') + const startTs3 = res3.getTxn().getStartTs() + expect(startTs2).toBe(startTs3) // we expect these to be same, because readOnly doesn't increase startTs + }) + + it("should succeed without error (readOnly=true, bestEffort=true)", async () => { + const res = await client.newTxn().query('{ me(func: eq(name, "Alice")) { name }}') + const startTs = res.getTxn().getStartTs() + const res2 = await client + .newTxn({ readOnly: true, bestEffort: true }) + .query('{ me(func: eq(name, "Alice")) { name }}') + const startTs2 = res2.getTxn().getStartTs() + expect(startTs2).toBeGreaterThanOrEqual(startTs) + }) + + it("should throw error (readOnly=false, bestEffort=true)", () => { + const test = () => client.newTxn({ bestEffort: true }) + expect(test).toThrow(dgraph.ERR_BEST_EFFORT_REQUIRED_READ_ONLY) + }) + }) + + describe("mutate", () => { + beforeAll(async () => { + client = await setup() + await setSchema(client, "name: string @index(exact) .") + }) + + it("should throw finished error if txn is already finished", async () => { + const txn = client.newTxn() + await txn.commit() + + const mu = new dgraph.Mutation() + mu.setSetNquads('_:alice "Alice" .') + const p = txn.mutate(mu) + await expect(p).rejects.toBe(dgraph.ERR_FINISHED) + }) + + it("should throw error and discard if Stub.mutate throws an error", async () => { + const txn = client.newTxn() + + const mu = new dgraph.Mutation() + // There is an error in the mutation NQuad. + mu.setSetNquads('alice "Alice" .') + const p1 = txn.mutate(mu) + await expect(p1).rejects.toBeDefined() + + const p2 = txn.commit() + await expect(p2).rejects.toBe(dgraph.ERR_FINISHED) + }) + }) + + describe("commit", () => { + beforeAll(async () => { + client = await setup() + await setSchema(client, "name: string @index(exact) .") + }) + + it("should throw finished error if txn is already finished", async () => { + const txn = client.newTxn() + await txn.commit() + + const p = txn.commit() + await expect(p).rejects.toBe(dgraph.ERR_FINISHED) + }) + + it("should throw finished error after mutation with commitNow", async () => { + const txn = client.newTxn() + + const mu = new dgraph.Mutation() + mu.setSetNquads('_:alice "Alice" .') + mu.setCommitNow(true) + await txn.mutate(mu) + + const p = txn.commit() + await expect(p).rejects.toBe(dgraph.ERR_FINISHED) + }) + }) + + describe("discard", () => { + beforeAll(async () => { + client = await setup() + await setSchema(client, "name: string @index(exact) .") + }) + + it("should resolve and do nothing if txn is already finished", async () => { + const txn = client.newTxn() + await txn.commit() + + const p = txn.discard() + await expect(p).resolves.toBeUndefined() + }) + + it("should resolve and do nothing after mutation with commitNow", async () => { + const txn = client.newTxn() + + const mu = new dgraph.Mutation() + mu.setSetNquads('_:alice "Alice" .') + mu.setCommitNow(true) + await txn.mutate(mu) + + const p = txn.discard() + await expect(p).resolves.toBeUndefined() + }) + }) +}) diff --git a/tests/types.spec.ts b/tests/types.spec.ts index 9b22f24..9557215 100644 --- a/tests/types.spec.ts +++ b/tests/types.spec.ts @@ -1,218 +1,218 @@ -import * as dgraph from "../src"; -import { b64ToStr, strToB64, strToU8, u8ToStr } from "../src/util"; +import * as dgraph from "../src" +import { b64ToStr, strToB64, strToU8, u8ToStr } from "../src/util" -const obj = { k1: "v1" }; -const setNquads = '_:alice "Alice"'; -const delNquads = "<0x7569> * * ."; +const obj = { k1: "v1" } +const setNquads = '_:alice "Alice"' +const delNquads = "<0x7569> * * ." describe("types", () => { - describe("Payload", () => { - it("should set and get data", () => { - const p = new dgraph.Payload(); - - p.setData(obj); - let o = p.getData(); - expect(o).toEqual(obj); - - p.setData(strToB64(JSON.stringify(obj))); - o = p.getData(); - expect(o).toEqual(obj); - - p.setData(strToU8(JSON.stringify(obj))); - o = p.getData(); - expect(o).toEqual(obj); - }); - - it("should get data as b64", () => { - const p = new dgraph.Payload(); - p.setData(obj); - - const b64 = p.getData_asB64(); - const o = JSON.parse(b64ToStr(b64)); - expect(o).toEqual(obj); - }); - - it("should get data as u8", () => { - const p = new dgraph.Payload(); - p.setData(obj); - - const u8 = p.getData_asU8(); - const o = JSON.parse(u8ToStr(u8)); - expect(o).toEqual(obj); - }); - }); - - describe("Response", () => { - it("should set and get json", () => { - const p = new dgraph.Response(); - - p.setJson(obj); - let o = p.getJson(); - expect(o).toEqual(obj); - - p.setJson(strToB64(JSON.stringify(obj))); - o = p.getJson(); - expect(o).toEqual(obj); - - p.setJson(strToU8(JSON.stringify(obj))); - o = p.getJson(); - expect(o).toEqual(obj); - }); - - it("should get json as b64", () => { - const p = new dgraph.Response(); - p.setJson(obj); - - const b64 = p.getJson_asB64(); - const o = JSON.parse(b64ToStr(b64)); - expect(o).toEqual(obj); - }); - - it("should get json as u8", () => { - const p = new dgraph.Response(); - p.setJson(obj); - - const u8 = p.getJson_asU8(); - const o = JSON.parse(u8ToStr(u8)); - expect(o).toEqual(obj); - }); - }); - - describe("Mutation", () => { - it("should set and get setJson", () => { - const p = new dgraph.Mutation(); - - p.setSetJson(obj); - let o = p.getSetJson(); - expect(o).toEqual(obj); - - p.setSetJson(strToB64(JSON.stringify(obj))); - o = p.getSetJson(); - expect(o).toEqual(obj); - - p.setSetJson(strToU8(JSON.stringify(obj))); - o = p.getSetJson(); - expect(o).toEqual(obj); - }); - - it("should get setJson as b64", () => { - const p = new dgraph.Mutation(); - p.setSetJson(obj); - - const b64 = p.getSetJson_asB64(); - const o = JSON.parse(b64ToStr(b64)); - expect(o).toEqual(obj); - }); - - it("should get setJson as u8", () => { - const p = new dgraph.Mutation(); - p.setSetJson(obj); - - const u8 = p.getSetJson_asU8(); - const o = JSON.parse(u8ToStr(u8)); - expect(o).toEqual(obj); - }); - - it("should set and get deleteJson", () => { - const p = new dgraph.Mutation(); - - p.setDeleteJson(obj); - let o = p.getDeleteJson(); - expect(o).toEqual(obj); - - p.setDeleteJson(strToB64(JSON.stringify(obj))); - o = p.getDeleteJson(); - expect(o).toEqual(obj); - - p.setDeleteJson(strToU8(JSON.stringify(obj))); - o = p.getDeleteJson(); - expect(o).toEqual(obj); - }); - - it("should get deleteJson as b64", () => { - const p = new dgraph.Mutation(); - p.setDeleteJson(obj); - - const b64 = p.getDeleteJson_asB64(); - const o = JSON.parse(b64ToStr(b64)); - expect(o).toEqual(obj); - }); - - it("should get deleteJson as u8", () => { - const p = new dgraph.Mutation(); - p.setDeleteJson(obj); - - const u8 = p.getDeleteJson_asU8(); - const o = JSON.parse(u8ToStr(u8)); - expect(o).toEqual(obj); - }); - - it("should set and get setNquads", () => { - const p = new dgraph.Mutation(); - - p.setSetNquads(setNquads); - let nq = p.getSetNquads(); - expect(nq).toEqual(setNquads); - - p.setSetNquads(strToB64(setNquads)); - nq = p.getSetNquads(); - expect(nq).toEqual(setNquads); - - p.setSetNquads(strToU8(setNquads)); - nq = p.getSetNquads(); - expect(nq).toEqual(setNquads); - }); - - it("should get setNquads as b64", () => { - const p = new dgraph.Mutation(); - p.setSetNquads(setNquads); - - const b64 = p.getSetNquads_asB64(); - const nq = b64ToStr(b64); - expect(nq).toEqual(setNquads); - }); - - it("should get setNquads as u8", () => { - const p = new dgraph.Mutation(); - p.setSetNquads(setNquads); - - const u8 = p.getSetNquads_asU8(); - const nq = u8ToStr(u8); - expect(nq).toEqual(setNquads); - }); - - it("should set and get delNquads", () => { - const p = new dgraph.Mutation(); - - p.setDelNquads(delNquads); - let nq = p.getDelNquads(); - expect(nq).toEqual(delNquads); - - p.setDelNquads(strToB64(delNquads)); - nq = p.getDelNquads(); - expect(nq).toEqual(delNquads); - - p.setDelNquads(strToU8(delNquads)); - nq = p.getDelNquads(); - expect(nq).toEqual(delNquads); - }); - - it("should get delNquads as b64", () => { - const p = new dgraph.Mutation(); - p.setDelNquads(delNquads); - - const b64 = p.getDelNquads_asB64(); - const nq = b64ToStr(b64); - expect(nq).toEqual(delNquads); - }); - - it("should get delNquads as u8", () => { - const p = new dgraph.Mutation(); - p.setDelNquads(delNquads); - - const u8 = p.getDelNquads_asU8(); - const nq = u8ToStr(u8); - expect(nq).toEqual(delNquads); - }); - }); -}); + describe("Payload", () => { + it("should set and get data", () => { + const p = new dgraph.Payload() + + p.setData(obj) + let o = p.getData() + expect(o).toEqual(obj) + + p.setData(strToB64(JSON.stringify(obj))) + o = p.getData() + expect(o).toEqual(obj) + + p.setData(strToU8(JSON.stringify(obj))) + o = p.getData() + expect(o).toEqual(obj) + }) + + it("should get data as b64", () => { + const p = new dgraph.Payload() + p.setData(obj) + + const b64 = p.getData_asB64() + const o = JSON.parse(b64ToStr(b64)) + expect(o).toEqual(obj) + }) + + it("should get data as u8", () => { + const p = new dgraph.Payload() + p.setData(obj) + + const u8 = p.getData_asU8() + const o = JSON.parse(u8ToStr(u8)) + expect(o).toEqual(obj) + }) + }) + + describe("Response", () => { + it("should set and get json", () => { + const p = new dgraph.Response() + + p.setJson(obj) + let o = p.getJson() + expect(o).toEqual(obj) + + p.setJson(strToB64(JSON.stringify(obj))) + o = p.getJson() + expect(o).toEqual(obj) + + p.setJson(strToU8(JSON.stringify(obj))) + o = p.getJson() + expect(o).toEqual(obj) + }) + + it("should get json as b64", () => { + const p = new dgraph.Response() + p.setJson(obj) + + const b64 = p.getJson_asB64() + const o = JSON.parse(b64ToStr(b64)) + expect(o).toEqual(obj) + }) + + it("should get json as u8", () => { + const p = new dgraph.Response() + p.setJson(obj) + + const u8 = p.getJson_asU8() + const o = JSON.parse(u8ToStr(u8)) + expect(o).toEqual(obj) + }) + }) + + describe("Mutation", () => { + it("should set and get setJson", () => { + const p = new dgraph.Mutation() + + p.setSetJson(obj) + let o = p.getSetJson() + expect(o).toEqual(obj) + + p.setSetJson(strToB64(JSON.stringify(obj))) + o = p.getSetJson() + expect(o).toEqual(obj) + + p.setSetJson(strToU8(JSON.stringify(obj))) + o = p.getSetJson() + expect(o).toEqual(obj) + }) + + it("should get setJson as b64", () => { + const p = new dgraph.Mutation() + p.setSetJson(obj) + + const b64 = p.getSetJson_asB64() + const o = JSON.parse(b64ToStr(b64)) + expect(o).toEqual(obj) + }) + + it("should get setJson as u8", () => { + const p = new dgraph.Mutation() + p.setSetJson(obj) + + const u8 = p.getSetJson_asU8() + const o = JSON.parse(u8ToStr(u8)) + expect(o).toEqual(obj) + }) + + it("should set and get deleteJson", () => { + const p = new dgraph.Mutation() + + p.setDeleteJson(obj) + let o = p.getDeleteJson() + expect(o).toEqual(obj) + + p.setDeleteJson(strToB64(JSON.stringify(obj))) + o = p.getDeleteJson() + expect(o).toEqual(obj) + + p.setDeleteJson(strToU8(JSON.stringify(obj))) + o = p.getDeleteJson() + expect(o).toEqual(obj) + }) + + it("should get deleteJson as b64", () => { + const p = new dgraph.Mutation() + p.setDeleteJson(obj) + + const b64 = p.getDeleteJson_asB64() + const o = JSON.parse(b64ToStr(b64)) + expect(o).toEqual(obj) + }) + + it("should get deleteJson as u8", () => { + const p = new dgraph.Mutation() + p.setDeleteJson(obj) + + const u8 = p.getDeleteJson_asU8() + const o = JSON.parse(u8ToStr(u8)) + expect(o).toEqual(obj) + }) + + it("should set and get setNquads", () => { + const p = new dgraph.Mutation() + + p.setSetNquads(setNquads) + let nq = p.getSetNquads() + expect(nq).toEqual(setNquads) + + p.setSetNquads(strToB64(setNquads)) + nq = p.getSetNquads() + expect(nq).toEqual(setNquads) + + p.setSetNquads(strToU8(setNquads)) + nq = p.getSetNquads() + expect(nq).toEqual(setNquads) + }) + + it("should get setNquads as b64", () => { + const p = new dgraph.Mutation() + p.setSetNquads(setNquads) + + const b64 = p.getSetNquads_asB64() + const nq = b64ToStr(b64) + expect(nq).toEqual(setNquads) + }) + + it("should get setNquads as u8", () => { + const p = new dgraph.Mutation() + p.setSetNquads(setNquads) + + const u8 = p.getSetNquads_asU8() + const nq = u8ToStr(u8) + expect(nq).toEqual(setNquads) + }) + + it("should set and get delNquads", () => { + const p = new dgraph.Mutation() + + p.setDelNquads(delNquads) + let nq = p.getDelNquads() + expect(nq).toEqual(delNquads) + + p.setDelNquads(strToB64(delNquads)) + nq = p.getDelNquads() + expect(nq).toEqual(delNquads) + + p.setDelNquads(strToU8(delNquads)) + nq = p.getDelNquads() + expect(nq).toEqual(delNquads) + }) + + it("should get delNquads as b64", () => { + const p = new dgraph.Mutation() + p.setDelNquads(delNquads) + + const b64 = p.getDelNquads_asB64() + const nq = b64ToStr(b64) + expect(nq).toEqual(delNquads) + }) + + it("should get delNquads as u8", () => { + const p = new dgraph.Mutation() + p.setDelNquads(delNquads) + + const u8 = p.getDelNquads_asU8() + const nq = u8ToStr(u8) + expect(nq).toEqual(delNquads) + }) + }) +}) diff --git a/tests/util.spec.ts b/tests/util.spec.ts index a20509c..a3a4956 100644 --- a/tests/util.spec.ts +++ b/tests/util.spec.ts @@ -1,204 +1,161 @@ -import * as grpc from "@grpc/grpc-js"; +import * as grpc from "@grpc/grpc-js" // Non-exported functions. -import { - isAbortedError, - isBase64, - isConflictError, - promisify1, - promisify3, -} from "../src/util"; - -function fnAddThisVal1( - a: number, - cb: (err?: Error, res?: number) => void, -): void { - // eslint-disable-next-line no-invalid-this - cb(undefined, (<{ val: number }>this).val + a); +import { isAbortedError, isBase64, isConflictError, promisify1, promisify3 } from "../src/util" + +function fnAddThisVal1(a: number, cb: (err?: Error, res?: number) => void): void { + cb(undefined, (<{ val: number }>this).val + a) } function fnAddThisVal3( - a: number, - b: number, - c: number, - cb: (err?: Error, res?: number) => void, + a: number, + b: number, + c: number, + cb: (err?: Error, res?: number) => void, ): void { - // eslint-disable-next-line no-invalid-this - cb(undefined, (<{ val: number }>this).val + a + b + c); + cb(undefined, (<{ val: number }>this).val + a + b + c) } describe("util", () => { - describe("promisify1", () => { - it("should handle valid response in callback", async () => { - const f = (_: number, cb: (err?: Error, res?: number) => void) => { - cb(undefined, 2); - }; - - await expect(promisify1(f, undefined)(1)).resolves.toBe(2); - }); - - it("should handle error in callback", async () => { - const e = new Error(); - const f = (_: number, cb: (err?: Error, res?: number) => void) => { - cb(e); - }; - - await expect(promisify1(f, undefined)(1)).rejects.toBe(e); - }); - - it("should handle error if valid response is also present in callback", async () => { - const e = new Error(); - const f = (_: number, cb: (err?: Error, res?: number) => void) => { - cb(e, 2); - }; - - await expect(promisify1(f, undefined)(1)).rejects.toBe(e); - }); - - it("should handle callback called without arguments", async () => { - const f = (_: number, cb: (err?: Error, res?: number) => void) => { - cb(); - }; - - await expect(promisify1(f, undefined)(1)).resolves.toBeUndefined(); - }); - - it("should handle thisContext argument", async () => { - const o = { - val: 45, - }; - - await expect(promisify1(fnAddThisVal1, o)(5)).resolves.toEqual(50); - }); - }); - - describe("promisify3", () => { - it("should handle valid response in callback", async () => { - // tslint:disable-next-line variable-name - const f = ( - _A: number, - b: number, - _C: number, - cb: (err?: Error, res?: number) => void, - ) => { - cb(undefined, b); - }; - - await expect(promisify3(f, undefined)(1, 2, 3)).resolves.toBe(2); - await expect(promisify3(f, undefined)(1, 22, 3)).resolves.toBe(22); - }); - - it("should handle error in callback", async () => { - const e = new Error(); - // tslint:disable-next-line variable-name - const f = ( - _A: number, - _B: number, - _C: number, - cb: (err?: Error, res?: number) => void, - ) => { - cb(e); - }; - - await expect(promisify3(f, undefined)(1, 2, 3)).rejects.toBe(e); - }); - - it("should handle error if valid response is also present in callback", async () => { - const e = new Error(); - // tslint:disable-next-line variable-name - const f = ( - _A: number, - b: number, - _C: number, - cb: (err?: Error, res?: number) => void, - ) => { - cb(e, b); - }; - - await expect(promisify3(f, undefined)(1, 2, 3)).rejects.toBe(e); - }); - - it("should handle callback called without arguments", async () => { - // tslint:disable-next-line variable-name - const f = ( - _A: number, - _B: number, - _C: number, - cb: (err?: Error, res?: number) => void, - ) => { - cb(); - }; - - await expect( - promisify3(f, undefined)(1, 2, 3), - ).resolves.toBeUndefined(); - }); - - it("should handle thisContext argument", async () => { - const o = { - val: 45, - }; - - await expect( - promisify3(fnAddThisVal3, o)(5, 10, 15), - ).resolves.toEqual(75); - }); - }); - - describe("isAbortedError", () => { - it("should return false for undefined and null", () => { - expect(isAbortedError(undefined)).toBe(false); - }); - - it("should return false for objects not having code property", () => { - expect(isAbortedError(() => true)).toBe(false); - expect(isAbortedError([1, 2, 3])).toBe(false); - expect(isAbortedError({ a: 1, b: "b" })).toBe(false); - }); - - it("should return true for objects correct having correct code value", () => { - expect(isAbortedError({ code: grpc.status.ABORTED })).toBe(true); - expect( - isAbortedError({ code: grpc.status.FAILED_PRECONDITION }), - ).toBe(false); - expect(isAbortedError({ code: grpc.status.OK })).toBe(false); - }); - }); - - describe("isConflictError", () => { - it("should return false for undefined", () => { - expect(isConflictError(undefined)).toBe(false); - }); - - it("should return false for objects not having code property", () => { - expect(isConflictError(() => true)).toBe(false); - expect(isConflictError([1, 2, 3])).toBe(false); - expect(isConflictError({ a: 1, b: "b" })).toBe(false); - }); - - it("should return true for objects correct having correct code value", () => { - expect(isConflictError({ code: grpc.status.ABORTED })).toBe(true); - expect( - isConflictError({ code: grpc.status.FAILED_PRECONDITION }), - ).toBe(true); - expect(isConflictError({ code: grpc.status.OK })).toBe(false); - }); - }); - - describe("isBase64", () => { - it("should return true for valid base64 strings", () => { - expect(isBase64("")).toBe(true); - expect(isBase64("yz==")).toBe(true); - expect(isBase64("uwAxyz==")).toBe(true); - expect(isBase64("uwAxyzp=")).toBe(true); - expect(isBase64("uwAxyzp5")).toBe(true); - }); - - it("should return false for invalid base64 strings", () => { - expect(isBase64("a")).toBe(false); - expect(isBase64("abcdef")).toBe(false); - expect(isBase64("sad$")).toBe(false); - expect(isBase64("dddddd=")).toBe(false); - }); - }); -}); + describe("promisify1", () => { + it("should handle valid response in callback", async () => { + const f = (_: number, cb: (err?: Error, res?: number) => void) => { + cb(undefined, 2) + } + + await expect(promisify1(f, undefined)(1)).resolves.toBe(2) + }) + + it("should handle error in callback", async () => { + const e = new Error() + const f = (_: number, cb: (err?: Error, res?: number) => void) => { + cb(e) + } + + await expect(promisify1(f, undefined)(1)).rejects.toBe(e) + }) + + it("should handle error if valid response is also present in callback", async () => { + const e = new Error() + const f = (_: number, cb: (err?: Error, res?: number) => void) => { + cb(e, 2) + } + + await expect(promisify1(f, undefined)(1)).rejects.toBe(e) + }) + + it("should handle callback called without arguments", async () => { + const f = (_: number, cb: (err?: Error, res?: number) => void) => { + cb() + } + + await expect(promisify1(f, undefined)(1)).resolves.toBeUndefined() + }) + + it("should handle thisContext argument", async () => { + const o = { + val: 45, + } + + await expect(promisify1(fnAddThisVal1, o)(5)).resolves.toEqual(50) + }) + }) + + describe("promisify3", () => { + it("should handle valid response in callback", async () => { + const f = (_A: number, b: number, _C: number, cb: (err?: Error, res?: number) => void) => { + cb(undefined, b) + } + + await expect(promisify3(f, undefined)(1, 2, 3)).resolves.toBe(2) + await expect(promisify3(f, undefined)(1, 22, 3)).resolves.toBe(22) + }) + + it("should handle error in callback", async () => { + const e = new Error() + const f = (_A: number, _B: number, _C: number, cb: (err?: Error, res?: number) => void) => { + cb(e) + } + + await expect(promisify3(f, undefined)(1, 2, 3)).rejects.toBe(e) + }) + + it("should handle error if valid response is also present in callback", async () => { + const e = new Error() + const f = (_A: number, b: number, _C: number, cb: (err?: Error, res?: number) => void) => { + cb(e, b) + } + + await expect(promisify3(f, undefined)(1, 2, 3)).rejects.toBe(e) + }) + + it("should handle callback called without arguments", async () => { + const f = (_A: number, _B: number, _C: number, cb: (err?: Error, res?: number) => void) => { + cb() + } + + await expect(promisify3(f, undefined)(1, 2, 3)).resolves.toBeUndefined() + }) + + it("should handle thisContext argument", async () => { + const o = { + val: 45, + } + + await expect(promisify3(fnAddThisVal3, o)(5, 10, 15)).resolves.toEqual(75) + }) + }) + + describe("isAbortedError", () => { + it("should return false for undefined and null", () => { + expect(isAbortedError(undefined)).toBe(false) + }) + + it("should return false for objects not having code property", () => { + expect(isAbortedError(() => true)).toBe(false) + expect(isAbortedError([1, 2, 3])).toBe(false) + expect(isAbortedError({ a: 1, b: "b" })).toBe(false) + }) + + it("should return true for objects correct having correct code value", () => { + expect(isAbortedError({ code: grpc.status.ABORTED })).toBe(true) + expect(isAbortedError({ code: grpc.status.FAILED_PRECONDITION })).toBe(false) + expect(isAbortedError({ code: grpc.status.OK })).toBe(false) + }) + }) + + describe("isConflictError", () => { + it("should return false for undefined", () => { + expect(isConflictError(undefined)).toBe(false) + }) + + it("should return false for objects not having code property", () => { + expect(isConflictError(() => true)).toBe(false) + expect(isConflictError([1, 2, 3])).toBe(false) + expect(isConflictError({ a: 1, b: "b" })).toBe(false) + }) + + it("should return true for objects correct having correct code value", () => { + expect(isConflictError({ code: grpc.status.ABORTED })).toBe(true) + expect(isConflictError({ code: grpc.status.FAILED_PRECONDITION })).toBe(true) + expect(isConflictError({ code: grpc.status.OK })).toBe(false) + }) + }) + + describe("isBase64", () => { + it("should return true for valid base64 strings", () => { + expect(isBase64("")).toBe(true) + expect(isBase64("yz==")).toBe(true) + expect(isBase64("uwAxyz==")).toBe(true) + expect(isBase64("uwAxyzp=")).toBe(true) + expect(isBase64("uwAxyzp5")).toBe(true) + }) + + it("should return false for invalid base64 strings", () => { + expect(isBase64("a")).toBe(false) + expect(isBase64("abcdef")).toBe(false) + expect(isBase64("sad$")).toBe(false) + expect(isBase64("dddddd=")).toBe(false) + }) + }) +}) diff --git a/tsconfig.json b/tsconfig.json index 7c204f2..02fed3f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,9 +2,7 @@ "compilerOptions": { "module": "commonjs", "target": "es5", - "lib": [ - "es2015" - ], + "lib": ["es2015"], "moduleResolution": "node", "allowSyntheticDefaultImports": true, "alwaysStrict": true, @@ -21,8 +19,5 @@ "outDir": "lib", "baseUrl": "." }, - "include": [ - "src/**/*", - "tests/**/*" - ] + "include": ["src/**/*", "tests/**/*"] } diff --git a/tsconfig.release.json b/tsconfig.release.json index 5474ea7..8f1dea5 100644 --- a/tsconfig.release.json +++ b/tsconfig.release.json @@ -3,7 +3,5 @@ "compilerOptions": { "removeComments": true }, - "include": [ - "src/**/*" - ] + "include": ["src/**/*"] } diff --git a/tslint.json b/tslint.json deleted file mode 100644 index c283611..0000000 --- a/tslint.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "extends": ["tslint-microsoft-contrib"], - "rules": { - "missing-jsdoc": false, - "no-relative-imports": false, - "import-name": false, - "export-name": false, - "promise-function-async": false, - "no-void-expression": false, - "newline-before-return": false, - "no-backbone-get-set-outside-model": false, - "no-single-line-block-comment": false, - "insecure-random": false, - "no-multiline-string": false, - "newline-per-chained-call": false, - "no-default-export": false, - "trailing-comma": [ - false, - { - "multiline": "always", - "singleline": "never" - } - ], - "typedef": [ - true, - "parameter", - "arrow-parameter", - "property-declaration", - "member-variable-declaration" - ], - "quotemark": [true, "double", "avoid-escape"] - } -}