From 9c4caa4fc57e025735e979fc54794d583f656a4c Mon Sep 17 00:00:00 2001 From: Emelia Smith Date: Thu, 14 Apr 2022 21:01:11 +0200 Subject: [PATCH] chore: upgrade docs tooling (#238) * chore: remove comments from tsconfig.json to prevent formatting churn * chore: upgrade documentation tooling * chore: exclude tests from builds * chore: add developer script for cleaning up build output * docs: improve the clarity of the documentation * docs: support source urls on vercel * chore: rename webSocket property and mark as internal * chore: rename BaseNotificationOptions to NotificationOptions * chore: upgrade browser testApp This updates the dependencies, build target, and uses `file:` referenced version of this SDK when testing, no more `npm link` --- .eslintrc.js | 3 +- .github/workflows/e2e-browser.yml | 4 +- .gitignore | 1 + docs/{api => }/README.md | 23 +- docs/api/Makefile | 64 ++-- docs/api/conf.py | 67 +++- docs/api/requirements.txt | 6 +- docs/api/source/index.rst | 100 ++++- e2e/browser/test/README.md | 7 +- e2e/browser/testApp/package-lock.json | 515 +++++++++++++------------- e2e/browser/testApp/package.json | 16 +- e2e/browser/testApp/tsconfig.json | 2 +- package-lock.json | 137 +++++-- package.json | 15 +- rollup.config.js | 1 + src/index.ts | 4 +- src/interfaces.ts | 65 ++++ src/liveNotification.test.ts | 2 +- src/liveNotification.ts | 18 +- src/notification.test.ts | 3 +- src/notification.ts | 68 ++-- src/websocketNotification.test.ts | 20 +- src/websocketNotification.ts | 66 +++- tsconfig.json | 80 +--- vercel.json | 5 - 25 files changed, 771 insertions(+), 521 deletions(-) rename docs/{api => }/README.md (65%) create mode 100644 src/interfaces.ts delete mode 100644 vercel.json diff --git a/.eslintrc.js b/.eslintrc.js index 3c4628e6..4140e2c1 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -23,7 +23,8 @@ module.exports = { rules: { "import/prefer-default-export": 0, "max-classes-per-file": 0, - "jest/no-disabled-tests": 1 + "jest/no-disabled-tests": 1, + "no-shadow": [1, { allow: ["NotificationOptions"] }], }, parserOptions: { project: "./tsconfig.eslint.json", diff --git a/.github/workflows/e2e-browser.yml b/.github/workflows/e2e-browser.yml index 1e0869b4..91beac77 100644 --- a/.github/workflows/e2e-browser.yml +++ b/.github/workflows/e2e-browser.yml @@ -30,7 +30,7 @@ jobs: - run: npm ci - run: npm run build - run: npx playwright install --with-deps - - run: npm run test:e2e:browser:build + - run: npm run test:e2e:browser:setup - run: npm run test:e2e:browser env: E2E_TEST_ENVIRONMENT: ${{ matrix.environment-name }} @@ -51,4 +51,4 @@ jobs: continue-on-error: true with: name: dist - path: dist \ No newline at end of file + path: dist diff --git a/.gitignore b/.gitignore index b6033251..c3ed4484 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ LICENSE_DEPENDENCIES LICENSE_DEPENDENCIES_ALL docs/api/build/ docs/api/source/api/ +docs/api/docs-assets/ docs/dist/ docs/.DS_Store .env*.local diff --git a/docs/api/README.md b/docs/README.md similarity index 65% rename from docs/api/README.md rename to docs/README.md index 7ba1267e..75f6c5e3 100644 --- a/docs/api/README.md +++ b/docs/README.md @@ -15,28 +15,31 @@ To build: source /bin/activate ``` -2. Generate the API .md files: +2. Install the dependencies: - npm ci; npm run build-api-docs + ```sh + npm ci + npm run docs:install + ``` -3. Go to the directory for API docs: +3. Generate the docs source files and build the site: - cd docs/api + ```sh + npm run docs:build + ``` -4. Install the docs requirements (different from library docs requirements): +4. If you want to preview the docs site, you can use: ```sh - pip install -r requirements.txt + npm run docs:preview ``` -5. Make the API docs: +5. If you'd like to clean the generated docs and start fresh, you can use: ```sh - make html + npm run docs:clean ``` - There should be a `build/html` directory with the html artifacts. - When finished, can deactivate your virtual env. ## Third Party Licenses diff --git a/docs/api/Makefile b/docs/api/Makefile index d0e09914..581ef06a 100644 --- a/docs/api/Makefile +++ b/docs/api/Makefile @@ -8,7 +8,7 @@ SOURCEDIR = source GIT_BRANCH :=$(shell git rev-parse --abbrev-ref HEAD) BUILDDIR = build SPHINXOPTS = -d $(BUILDDIR)/doctrees -W -SOURCECOPYDIR = $(BUILDDIR)/source/ +SOURCECOPYDIR = $(BUILDDIR)/source # Will need later for scrubbing generated .md files MY_OS :=$(shell uname) @@ -17,47 +17,45 @@ ifeq ($(MY_OS),Darwin) IS_MAC="DEFINED" endif -# Put it first so that "make" without argument is like "make help". -help: - @$(SPHINXBUILD) -M help "$(SOURCECOPYDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) +.PHONY: Makefile help check clean clean-all prepare html dist +check: + $(if $(shell command -v $(SPHINXBUILD) 2> /dev/null),$(info Found `$(SPHINXBUILD)`),$(error sphinx-build is not available, please follow the instructions in ./docs/README.md)) -.PHONY: help clean Makefile migrate html +# Put it first so that "make" without argument is like "make help". +help: check + @$(SPHINXBUILD) -M help "$(SOURCECOPYDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) clean: if [ -d $(BUILDDIR) ]; then rm -rf $(BUILDDIR) ; fi; - if [ -d build/docs-assets ]; then rm -rf build/docs-assets ; fi; - -migrate: clean + if [ -d ../dist ]; then rm -rf ../dist ; fi; + +# clean-all has to be separate from clean as prepare depends on clean, +# but prepare also expects the typedoc build output to exist in source/api +clean-all: clean + if [ -d docs-assets ]; then rm -rf docs-assets ; fi; + if [ -d source/api ]; then rm -rf source/api ; fi; + +prepare: clean + if [ ! -d docs-assets ]; then git clone https://github.com/inrupt/docs-assets.git docs-assets; fi; +# Copying to SOURCECOPYDIR instead of copying source dir to BUILDDIR +# in case someone forgets to backslash after build/ +# Copying source/api/* to BUILDDIR. mkdir -p $(SOURCECOPYDIR) - - git clone https://github.com/inrupt/docs-assets.git build/docs-assets - - # Copying to SOURCECOPYDIR instead of copying source dir to BUILDDIR - # in case someone forgets to backslash after build/ - # Copying source/api/modules -> build/source/modules - # Copying source/api/classes -> build/source/classes - # Otherwise, after building the docs, the url is dev-tools/api/js/solid-client/api/modules or such. - cp -R $(SOURCEDIR)/index.rst $(SOURCECOPYDIR) - cp -R $(SOURCEDIR)/api/modules/ $(SOURCECOPYDIR)/modules/ - cp -R $(SOURCEDIR)/api/classes/ $(SOURCECOPYDIR)/classes/ - -html: Makefile migrate - -# To clean up cross-reference links in markdown (foo.md#somesection) -# If making html (e.g. foo.html), use sed to change .md# to .html# -# Also, on macOS, need -i '' but not for Linux - -ifdef IS_MAC - find . $(SOURCECOPYDIR) -type f -name "*.md" -exec sed -i '' -e 's?\.md#?\.html#?g' {} \; -else - find . $(SOURCECOPYDIR) -type f -name "*.md" -exec sed -i -e 's?\.md#?\.html#?g' {} \; -endif + cp -R $(SOURCEDIR)/api/* $(SOURCECOPYDIR) +# Note: remove the typedoc generated `index.md` since we use a custom index.rst instead + rm $(SOURCECOPYDIR)/index.md + +html: Makefile check prepare @$(SPHINXBUILD) -M $@ "$(SOURCECOPYDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -c . +dist: html + if [ -d ../dist ]; then rm -r ../dist; fi; + mkdir -p ../dist + cp -R $(BUILDDIR)/html/. ../dist/ + # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile migrate +%: Makefile check prepare @$(SPHINXBUILD) -M $@ "$(SOURCECOPYDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -c . - diff --git a/docs/api/conf.py b/docs/api/conf.py index 38b29a15..ad8b431b 100644 --- a/docs/api/conf.py +++ b/docs/api/conf.py @@ -52,13 +52,15 @@ # Add any paths that contain templates here, relative to this directory. -templates_path = ['./build/docs-assets/_templates'] +templates_path = ['./docs-assets/_templates'] # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. exclude_patterns = [ ] +extlinks = { } + # -- Options for HTML output ------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for @@ -67,17 +69,17 @@ #html_theme = 'alabaster' html_theme = 'inrupt' -html_theme_path = ['./build/docs-assets/themes'] +html_theme_path = ['./docs-assets/themes'] html_copy_source = False -html_title = 'Inrupt {0} API Documentation'.format(name) +html_title = 'Inrupt {0} Documentation'.format(name) # These theme options are declared in ./themes/inrupt/theme.conf # as well as some for pydata_sphinx_theme html_theme_options = { - 'project_title': 'Inrupt {0} API'.format(name), + 'project_title': '@inrupt/{0} API'.format(name), 'banner': True, 'banner_msg': 'This is an Alpha release of the API.', 'robots_index': True, @@ -87,26 +89,26 @@ 'github_branch': 'main', 'docs_project': 'developer-tools/api/javascript/{0}'.format(name), 'show_api_menu': True, - + # below are pydata_sphinx_theme "footer_items": [ "copyright.html"], "navbar_align": "left", "icon_links": [ { - "name": "Inrupt on Twitter", - "url": "https://twitter.com/inrupt", - "icon": "fab fa-twitter-square", - }, - { - "name": "Inrupt on LinkedIn", - "url": "https://www.linkedin.com/company/inrupt/", - "icon": "fab fa-linkedin", + "name": "Support Desk", + "url": "https://inrupt.atlassian.net/servicedesk", + "icon": "fas fa-tools", }, { "name": "Solid forum", "url": "https://forum.solidproject.org/", "icon": "fas fa-users", }, + { + "name": "Inrupt Blog", + "url": "https://inrupt.com/blog", + "icon": "fas fa-blog", + }, ], "favicons": [ { @@ -120,11 +122,46 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['./build/docs-assets/_static'] +html_static_path = ['./docs-assets/_static'] html_sidebars = { - '**': [ 'search-field.html', 'docs-sidebar.html'], + '**': [ 'search-field.html', 'docs-sidebar.html'], } locale_dirs = ['locale/'] # path is example but recommended. gettext_compact = False # optional. + +myst_heading_anchors = 6 +myst_url_schemes = [ 'https' ] +myst_enable_extensions = ['colon_fence'] + + +# Typedoc by default outputs all files as relative to their directory, but for +# Interfaces this is not what we want. Instead of +# `modules/type_IssueAccessRequestParameters.html` we want +# `interfaces/interfaces.IssueAccessRequestParameters.html`, additionally, we +# don't want a Module generated for all the Interfaces. +# +# This code removes the link from generated Interfaces to the Interfaces Module, +# and also excludes the Interfaces Module from being generated. +# +# This does require a doccomment of: +# +# /** +# * @module interfaces +# */ +# +# On each typescript file that declares Interfaces in src/types/* +# +# duplicateInterfaceHeading = re.compile(r"^\[interfaces\]\([^\)]+\)\.(\w+)$", re.MULTILINE) + +# def remove_interfaces_link(app, docname, source): +# if docname.startswith("interfaces/"): +# # First we strip the duplicate heading that typedoc inserts: +# source[0] = re.sub(duplicateInterfaceHeading, "", source[0]) +# # Then we remove any other links to the Interfaces module: +# source[0] = source[0].replace("[interfaces](../modules/interfaces.md)", "Interfaces") + +# def setup(app): +# exclude_patterns.append("modules/interfaces.md") +# app.connect("source-read", remove_interfaces_link) \ No newline at end of file diff --git a/docs/api/requirements.txt b/docs/api/requirements.txt index ab113255..e7d7aabe 100644 --- a/docs/api/requirements.txt +++ b/docs/api/requirements.txt @@ -1,5 +1,5 @@ # pip install -r requirements.txt -pydata-sphinx-theme==0.6.3 -myst-parser -Sphinx \ No newline at end of file +pydata-sphinx-theme==0.8.1 +myst-parser==0.17.0 +Sphinx==4.5.0 diff --git a/docs/api/source/index.rst b/docs/api/source/index.rst index 43285e2e..f3955dca 100644 --- a/docs/api/source/index.rst +++ b/docs/api/source/index.rst @@ -1,14 +1,108 @@ :orphan: -============================== -solid-client-notifications API -============================== +==================================================== +@inrupt/solid-client-notifications API Documentation +==================================================== +`@inrupt/solid-client-notifications +`__ is a +JavaScript library for subscribing to notifications sent by a Solid server. +These notifications may be sent synchronously or asynchronously. + +For Solid Servers that support notifications, they are sent when a resource is +created, updated, deleted, or when a child resource is added to or removed from +a container. + +**This library currently only supports notifications sent via WebSockets.** + +It is part of a `family open source JavaScript libraries +`__ +designed to support developers building Solid applications. + +Installation +------------ + +For the latest stable version of solid-client-notifications: + +.. code:: bash + + npm install @inrupt/solid-client-notifications + +Changelog +~~~~~~~~~ + +See `the release notes +`__. + + +Browser Support +~~~~~~~~~~~~~~~ + +Our JavaScript Client Libraries use relatively modern JavaScript features that +will work in all commonly-used browsers, except Internet Explorer. If you need +support for Internet Explorer, it is recommended to pass them through a tool +like `Babel `__, and to add polyfills for e.g. ``Map``, +``Set``, ``Promise``, ``Headers``, ``Array.prototype.includes``, +``Object.entries`` and ``String.prototype.endsWith``. + +Additionally, when using this package in an environment other than Node.js, you +will need `a polyfill for Node's buffer module +`__. + +Node.js Support +~~~~~~~~~~~~~~~ + +Our JavaScript Client Libraries track Node.js `LTS releases +`__, and support 12.x, 14.x, and 16.x. + +.. _issues--help: + +Issues & Help +------------- + +Solid Community Forum +~~~~~~~~~~~~~~~~~~~~~ + +If you have questions about working with Solid or just want to share what you're +working on, visit the `Solid forum `__. The +Solid forum is a good place to meet the rest of the community. + +Bugs and Feature Requests +~~~~~~~~~~~~~~~~~~~~~~~~~ + +- For public feedback, bug reports, and feature requests please file an issue + via `Github + `__. +- For non-public feedback or support inquiries please use the `Inrupt Service + Desk `__. + + +API Documentation +----------------- + +Modules +~~~~~~~ .. toctree:: :glob: :titlesonly: /modules/** + +Classes +~~~~~~~~~~ + +.. toctree:: + :glob: + :titlesonly: + /classes/** +Interfaces +~~~~~~~~~~ + +.. toctree:: + :glob: + :titlesonly: + + /interfaces/** diff --git a/e2e/browser/test/README.md b/e2e/browser/test/README.md index 3fb75b0c..c84dc065 100644 --- a/e2e/browser/test/README.md +++ b/e2e/browser/test/README.md @@ -17,8 +17,7 @@ library in the browser, and to verify whether the built code works after a pull request. One thing to note is that its dependency on `solid-client-notifications` should be -on the code _inside this repository_, rather than fetched from `npm`. This is achieved -using `npm link` during the setup (see the installation section for the details). +on the code _inside this repository_, rather than fetched from `npm`. ## The test code @@ -43,8 +42,8 @@ To run the tests, run: 1. `npm ci` at the root to install the test runner. 2. `npx playwright install` to download the latest versions of all browsers the - tests run in. 3.`npm run test:e2e:browser:build` to install the dependencies of the - application under test and link to the local library. + tests run in. 3.`npm run test:e2e:browser:setup` to install the dependencies of the + application under test. You can then run the tests using `npm run test:e2e:browser` at the root. diff --git a/e2e/browser/testApp/package-lock.json b/e2e/browser/testApp/package-lock.json index 4756267f..e7b9fae8 100644 --- a/e2e/browser/testApp/package-lock.json +++ b/e2e/browser/testApp/package-lock.json @@ -9,20 +9,70 @@ "version": "0.1.0", "dependencies": { "@inrupt/solid-client-authn-browser": "^1.11.7", - "@inrupt/solid-client-notifications": "^0.2.0", - "next": "12.1.2", + "@inrupt/solid-client-notifications": "file:../../../", + "next": "12.1.5", "react": "18.0.0", "react-dom": "18.0.0" }, "devDependencies": { - "@types/node": "17.0.23", - "@types/react": "17.0.43", - "@types/react-dom": "17.0.14", - "eslint": "8.12.0", - "eslint-config-next": "12.1.2", + "@types/node": "17.0.24", + "@types/react": "18.0.5", + "@types/react-dom": "18.0.0", + "eslint": "8.13.0", + "eslint-config-next": "12.1.5", "typescript": "4.6.3" } }, + "../../..": { + "name": "@inrupt/solid-client-notifications", + "version": "0.2.0", + "license": "MIT", + "dependencies": { + "@types/events": "^3.0.0", + "@types/ws": "^7.4.7", + "cross-fetch": "^3.1.5", + "events": "^3.3.0", + "isomorphic-ws": "^4.0.1", + "ws": "^7.5.5" + }, + "devDependencies": { + "@inrupt/eslint-config-base": "^0.2.0-alpha.1", + "@inrupt/eslint-config-lib": "^0.2.0-alpha.1", + "@inrupt/solid-client": "^1.21.0", + "@inrupt/solid-client-authn-browser": "^1.11.2", + "@inrupt/solid-client-authn-node": "^1.11.2", + "@playwright/test": "^1.20.1", + "@skypack/package-check": "^0.2.2", + "@types/dotenv-flow": "^3.2.0", + "@types/jest": "^27.0.2", + "@types/node": "^14.17.33", + "@typescript-eslint/eslint-plugin": "^4.33.0", + "@typescript-eslint/parser": "^4.33.0", + "dotenv-flow": "^3.2.0", + "eslint": "^7.32.0", + "eslint-config-airbnb-base": "^14.2.1", + "eslint-config-prettier": "^6.15.0", + "eslint-plugin-header": "^3.1.1", + "eslint-plugin-import": "^2.25.3", + "eslint-plugin-jest": "^23.20.0", + "eslint-plugin-license-header": "^0.2.1", + "eslint-plugin-prettier": "^3.4.1", + "jest": "^27.3.1", + "jest-fetch-mock": "^3.0.3", + "jest-websocket-mock": "^2.2.1", + "nlfurniss-typedoc-plugin-sourcefile-url": "^2.0.0", + "node-fetch": "^2.6.6", + "openid-client": "^4.9.1", + "prettier": "2.2.1", + "rimraf": "^3.0.2", + "rollup": "^2.60.0", + "rollup-plugin-typescript2": "^0.30.0", + "ts-jest": "^27.0.7", + "typedoc": "^0.22.12", + "typedoc-plugin-markdown": "^3.11.14", + "typescript": "^4.4.4" + } + }, "node_modules/@babel/runtime": { "version": "7.17.8", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.17.8.tgz", @@ -157,17 +207,8 @@ } }, "node_modules/@inrupt/solid-client-notifications": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@inrupt/solid-client-notifications/-/solid-client-notifications-0.2.0.tgz", - "integrity": "sha512-UacPgHTtxKxvif35IJlWN9aIcVTh83k2caG/9fV/vX3CYeSIT98RbAK93wciXzycFEXetZY0/Vklidvw7FIhyQ==", - "dependencies": { - "@types/events": "^3.0.0", - "@types/ws": "^7.4.7", - "cross-fetch": "^3.1.4", - "events": "^3.3.0", - "isomorphic-ws": "^4.0.1", - "ws": "^7.5.5" - } + "resolved": "../../..", + "link": true }, "node_modules/@inrupt/solid-common-vocab": { "version": "1.0.0", @@ -175,23 +216,23 @@ "integrity": "sha512-LcImhJqqPsNl/OlULzEEK2rYevty0eh1zaOLVz3lnydEU1DQkeaJ8fKBxKdp5/QjCtnIYcaDjh5U11PGh29Dgg==" }, "node_modules/@next/env": { - "version": "12.1.2", - "resolved": "https://registry.npmjs.org/@next/env/-/env-12.1.2.tgz", - "integrity": "sha512-A/P4ysmFScBFyu1ZV0Mr1Y89snyQhqGwsCrkEpK+itMF+y+pMqBoPVIyakUf4LXqGWJGiGFuIerihvSG70Ad8Q==" + "version": "12.1.5", + "resolved": "https://registry.npmjs.org/@next/env/-/env-12.1.5.tgz", + "integrity": "sha512-+34yUJslfJi7Lyx6ELuN8nWcOzi27izfYnZIC1Dqv7kmmfiBVxgzR3BXhlvEMTKC2IRJhXVs2FkMY+buQe3k7Q==" }, "node_modules/@next/eslint-plugin-next": { - "version": "12.1.2", - "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-12.1.2.tgz", - "integrity": "sha512-XqYRh6d98dpv2ynoOEC3VeNv99hxRGBuanRDKASfntdAZD9Zp4n+AugmNF0qwOQEHYgG1uvZW3A4Fi6Y/+kCQw==", + "version": "12.1.5", + "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-12.1.5.tgz", + "integrity": "sha512-Cnb8ERC5bNKBFrnMH6203sp/b0Y78QRx1XsFu+86oBtDBmQmOFoHu7teQjHm69ER73XKK3aGaeoLiXacHoUFsg==", "dev": true, "dependencies": { "glob": "7.1.7" } }, "node_modules/@next/swc-android-arm-eabi": { - "version": "12.1.2", - "resolved": "https://registry.npmjs.org/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-12.1.2.tgz", - "integrity": "sha512-iwalfLBhYmCIlj09czFbovj1SmTycf0AGR8CB357wgmEN8xIuznIwSsCH87AhwQ9apfNtdeDhxvuKmhS9T3FqQ==", + "version": "12.1.5", + "resolved": "https://registry.npmjs.org/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-12.1.5.tgz", + "integrity": "sha512-SKnGTdYcoN04Y2DvE0/Y7/MjkA+ltsmbuH/y/hR7Ob7tsj+8ZdOYuk+YvW1B8dY20nDPHP58XgDTSm2nA8BzzA==", "cpu": [ "arm" ], @@ -204,9 +245,9 @@ } }, "node_modules/@next/swc-android-arm64": { - "version": "12.1.2", - "resolved": "https://registry.npmjs.org/@next/swc-android-arm64/-/swc-android-arm64-12.1.2.tgz", - "integrity": "sha512-ZoR0Vx7czJhTgRAcFbzTKQc2n2ChC036/uc6PbgYiI/LreEnfmsV/CiREP0pUVs5ndntOX8kBA3BSbh4zCO5tQ==", + "version": "12.1.5", + "resolved": "https://registry.npmjs.org/@next/swc-android-arm64/-/swc-android-arm64-12.1.5.tgz", + "integrity": "sha512-YXiqgQ/9Rxg1dXp6brXbeQM1JDx9SwUY/36JiE+36FXqYEmDYbxld9qkX6GEzkc5rbwJ+RCitargnzEtwGW0mw==", "cpu": [ "arm64" ], @@ -219,9 +260,9 @@ } }, "node_modules/@next/swc-darwin-arm64": { - "version": "12.1.2", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-12.1.2.tgz", - "integrity": "sha512-VXv7lpqFjHwkK65CZHkjvBxlSBTG+l3O0Zl2zHniHj0xHzxJZvR8VFjV2zIMZCYSfVqeQ5yt2rjwuQ9zbpGtXQ==", + "version": "12.1.5", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-12.1.5.tgz", + "integrity": "sha512-y8mhldb/WFZ6lFeowkGfi0cO/lBdiBqDk4T4LZLvCpoQp4Or/NzUN6P5NzBQZ5/b4oUHM/wQICEM+1wKA4qIVw==", "cpu": [ "arm64" ], @@ -234,9 +275,9 @@ } }, "node_modules/@next/swc-darwin-x64": { - "version": "12.1.2", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-12.1.2.tgz", - "integrity": "sha512-evXxJQnXEnU+heWyun7d0UV6bhBcmoiyFGR3O3v9qdhGbeXh+SXYVxRO69juuh6V7RWRdlb1KQ0rGUNa1k0XSw==", + "version": "12.1.5", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-12.1.5.tgz", + "integrity": "sha512-wqJ3X7WQdTwSGi0kIDEmzw34QHISRIQ5uvC+VXmsIlCPFcMA+zM5723uh8NfuKGquDMiEMS31a83QgkuHMYbwQ==", "cpu": [ "x64" ], @@ -249,9 +290,9 @@ } }, "node_modules/@next/swc-linux-arm-gnueabihf": { - "version": "12.1.2", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-12.1.2.tgz", - "integrity": "sha512-LJV/wo6R0Ot7Y/20bZs00aBG4J333RT6H/5Q2AROE4Hnx7cenSktSnfU6WCnJgzYLSIHdbLs549LcZMULuVquw==", + "version": "12.1.5", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-12.1.5.tgz", + "integrity": "sha512-WnhdM5duONMvt2CncAl+9pim0wBxDS2lHoo7ub/o/i1bRbs11UTzosKzEXVaTDCUkCX2c32lIDi1WcN2ZPkcdw==", "cpu": [ "arm" ], @@ -264,9 +305,9 @@ } }, "node_modules/@next/swc-linux-arm64-gnu": { - "version": "12.1.2", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-12.1.2.tgz", - "integrity": "sha512-fjlYU1Y8kVjjRKyuyQBYLHPxjGOS2ox7U8TqAvtgKvd2PxqdsgW4sP+VDovRVPrZlGXNllKoJiqMO1OoR9fB6w==", + "version": "12.1.5", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-12.1.5.tgz", + "integrity": "sha512-Jq2H68yQ4bLUhR/XQnbw3LDW0GMQn355qx6rU36BthDLeGue7YV7MqNPa8GKvrpPocEMW77nWx/1yI6w6J07gw==", "cpu": [ "arm64" ], @@ -279,9 +320,9 @@ } }, "node_modules/@next/swc-linux-arm64-musl": { - "version": "12.1.2", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-12.1.2.tgz", - "integrity": "sha512-Y1JRDMHqSjLObjyrD1hf6ePrJcOF/mkw+LbAzoNgrHL1dSuIAqcz3jYunJt8T7Yw48xSJy6LPSL9BclAHwEwOA==", + "version": "12.1.5", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-12.1.5.tgz", + "integrity": "sha512-KgPjwdbhDqXI7ghNN8V/WAiLquc9Ebe8KBrNNEL0NQr+yd9CyKJ6KqjayVkmX+hbHzbyvbui/5wh/p3CZQ9xcQ==", "cpu": [ "arm64" ], @@ -294,9 +335,9 @@ } }, "node_modules/@next/swc-linux-x64-gnu": { - "version": "12.1.2", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-12.1.2.tgz", - "integrity": "sha512-5N4QSRT60ikQqCU8iHfYZzlhg6MFTLsKhMTARmhn8wLtZfN9VVyTFwZrJQWjV64dZc4JFeXDANGao8fm55y6bw==", + "version": "12.1.5", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-12.1.5.tgz", + "integrity": "sha512-O2ErUTvCJ6DkNTSr9pbu1n3tcqykqE/ebty1rwClzIYdOgpB3T2MfEPP+K7GhUR87wmN/hlihO9ch7qpVFDGKw==", "cpu": [ "x64" ], @@ -309,9 +350,9 @@ } }, "node_modules/@next/swc-linux-x64-musl": { - "version": "12.1.2", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-12.1.2.tgz", - "integrity": "sha512-b32F/xAgdYG4Pt0foFzhF+2uhvNxnEj7aJNp1R4EhZotdej2PzvFWcP/dGkc7MJl205pBz5oC3gHyILIIlW6XA==", + "version": "12.1.5", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-12.1.5.tgz", + "integrity": "sha512-1eIlZmlO/VRjxxzUBcVosf54AFU3ltAzHi+BJA+9U/lPxCYIsT+R4uO3QksRzRjKWhVQMRjEnlXyyq5SKJm7BA==", "cpu": [ "x64" ], @@ -324,9 +365,9 @@ } }, "node_modules/@next/swc-win32-arm64-msvc": { - "version": "12.1.2", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-12.1.2.tgz", - "integrity": "sha512-hVOcGmWDeVwO00Aclopsj6MoYhfJl5zA4vjAai9KjgclQTFZa/DC0vQjgKAHHKGT5oMHgjiq/G7L6P1/UfwYnw==", + "version": "12.1.5", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-12.1.5.tgz", + "integrity": "sha512-oromsfokbEuVb0CBLLE7R9qX3KGXucZpsojLpzUh1QJjuy1QkrPJncwr8xmWQnwgtQ6ecMWXgXPB+qtvizT9Tw==", "cpu": [ "arm64" ], @@ -339,9 +380,9 @@ } }, "node_modules/@next/swc-win32-ia32-msvc": { - "version": "12.1.2", - "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-12.1.2.tgz", - "integrity": "sha512-wnVDGIVz2pR3vIkyN6IE+1NvMSBrBj1jba11iR16m8TAPzZH/PrNsxr0a9N5VavEXXLcQpoUVvT+N7nflbRAHg==", + "version": "12.1.5", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-12.1.5.tgz", + "integrity": "sha512-a/51L5KzBpeZSW9LbekMo3I3Cwul+V+QKwbEIMA+Qwb2qrlcn1L9h3lt8cHqNTFt2y72ce6aTwDTw1lyi5oIRA==", "cpu": [ "ia32" ], @@ -354,9 +395,9 @@ } }, "node_modules/@next/swc-win32-x64-msvc": { - "version": "12.1.2", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-12.1.2.tgz", - "integrity": "sha512-MLNcurEpQp0+7OU9261f7PkN52xTGkfrt4IYTIXau7DO/aHj927oK6piIJdl9EOHdX/KN5W6qlyErj170PSHtw==", + "version": "12.1.5", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-12.1.5.tgz", + "integrity": "sha512-/SoXW1Ntpmpw3AXAzfDRaQidnd8kbZ2oSni8u5z0yw6t4RwJvmdZy1eOaAADRThWKV+2oU90++LSnXJIwBRWYQ==", "cpu": [ "x64" ], @@ -409,11 +450,6 @@ "integrity": "sha512-ZK5v4bJwgXldAUA8r3q9YKfCwOqoHTK/ZqRjSeRXQrBXWouoPnS4MQtgC4AXGiiBuUu5wxrRgTlv0ktmM4P1Aw==", "dev": true }, - "node_modules/@types/events": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", - "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==" - }, "node_modules/@types/jest": { "version": "27.4.1", "resolved": "https://registry.npmjs.org/@types/jest/-/jest-27.4.1.tgz", @@ -443,9 +479,9 @@ } }, "node_modules/@types/node": { - "version": "17.0.23", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.23.tgz", - "integrity": "sha512-UxDxWn7dl97rKVeVS61vErvw086aCYhDLyvRQZ5Rk65rZKepaFdm53GeqXaKBuOhED4e9uWq34IC3TdSdJJ2Gw==" + "version": "17.0.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.24.tgz", + "integrity": "sha512-aveCYRQbgTH9Pssp1voEP7HiuWlD2jW2BO56w+bVrJn04i61yh6mRfoKO6hEYQD9vF+W8Chkwc6j1M36uPkx4g==" }, "node_modules/@types/prop-types": { "version": "15.7.4", @@ -454,9 +490,9 @@ "dev": true }, "node_modules/@types/react": { - "version": "17.0.43", - "resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.43.tgz", - "integrity": "sha512-8Q+LNpdxf057brvPu1lMtC5Vn7J119xrP1aq4qiaefNioQUYANF/CYeK4NsKorSZyUGJ66g0IM+4bbjwx45o2A==", + "version": "18.0.5", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.5.tgz", + "integrity": "sha512-UPxNGInDCIKlfqBrm8LDXYWNfLHwIdisWcsH5GpMyGjhEDLFgTtlRBaoWuCua9HcyuE0rMkmAeZ3FXV1pYLIYQ==", "dev": true, "dependencies": { "@types/prop-types": "*", @@ -465,9 +501,9 @@ } }, "node_modules/@types/react-dom": { - "version": "17.0.14", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-17.0.14.tgz", - "integrity": "sha512-H03xwEP1oXmSfl3iobtmQ/2dHF5aBHr8aUMwyGZya6OW45G+xtdzmq6HkncefiBt5JU8DVyaWl/nWZbjZCnzAQ==", + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.0.0.tgz", + "integrity": "sha512-49897Y0UiCGmxZqpC8Blrf6meL8QUla6eb+BBhn69dTXlmuOlzkfr7HHY/O8J25e1lTUMs+YYxSlVDAaGHCOLg==", "dev": true, "dependencies": { "@types/react": "*" @@ -484,14 +520,6 @@ "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.4.tgz", "integrity": "sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==" }, - "node_modules/@types/ws": { - "version": "7.4.7", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", - "integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==", - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@typescript-eslint/parser": { "version": "5.10.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.10.1.tgz", @@ -1072,9 +1100,9 @@ } }, "node_modules/eslint": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.12.0.tgz", - "integrity": "sha512-it1oBL9alZg1S8UycLm5YDMAkIhtH6FtAzuZs6YvoGVldWjbS08BkAdb/ymP9LlAyq8koANu32U7Ib/w+UNh8Q==", + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.13.0.tgz", + "integrity": "sha512-D+Xei61eInqauAyTJ6C0q6x9mx7kTUC1KZ0m0LSEexR0V+e94K12LmWX076ZIsldwfQ2RONdaJe0re0TRGQbRQ==", "dev": true, "dependencies": { "@eslint/eslintrc": "^1.2.1", @@ -1124,12 +1152,12 @@ } }, "node_modules/eslint-config-next": { - "version": "12.1.2", - "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-12.1.2.tgz", - "integrity": "sha512-nJgSIB5lXoOsS2yY90i5L5ucI1uko+ykhcQkGkydXqs5GdPprY8Y1NKWW3N0OEzQvFyBcf7GHb/ohB21HoeEsg==", + "version": "12.1.5", + "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-12.1.5.tgz", + "integrity": "sha512-P+DCt5ti63KhC0qNLzrAmPcwRGq8pYqgcf/NNr1E+WjCrMkWdCAXkIANTquo+kcO1adR2k1lTo5GCrNUtKy4hQ==", "dev": true, "dependencies": { - "@next/eslint-plugin-next": "12.1.2", + "@next/eslint-plugin-next": "12.1.5", "@rushstack/eslint-patch": "1.0.8", "@typescript-eslint/parser": "5.10.1", "eslint-import-resolver-node": "0.3.4", @@ -2056,14 +2084,6 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, - "node_modules/isomorphic-ws": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", - "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==", - "peerDependencies": { - "ws": "*" - } - }, "node_modules/jest-diff": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-27.5.1.tgz", @@ -2301,15 +2321,14 @@ "dev": true }, "node_modules/next": { - "version": "12.1.2", - "resolved": "https://registry.npmjs.org/next/-/next-12.1.2.tgz", - "integrity": "sha512-JHPCsnFTBO0Z4SQxSYc611UA1WA+r/3y3Neg66AH5/gSO/oksfRnFw/zGX/FZ9+oOUHS9y3wJFawNpVYR2gJSQ==", + "version": "12.1.5", + "resolved": "https://registry.npmjs.org/next/-/next-12.1.5.tgz", + "integrity": "sha512-YGHDpyfgCfnT5GZObsKepmRnne7Kzp7nGrac07dikhutWQug7hHg85/+sPJ4ZW5Q2pDkb+n0FnmLkmd44htIJQ==", "dependencies": { - "@next/env": "12.1.2", + "@next/env": "12.1.5", "caniuse-lite": "^1.0.30001283", "postcss": "8.4.5", - "styled-jsx": "5.0.1", - "use-subscription": "1.5.1" + "styled-jsx": "5.0.1" }, "bin": { "next": "dist/bin/next" @@ -2318,18 +2337,18 @@ "node": ">=12.22.0" }, "optionalDependencies": { - "@next/swc-android-arm-eabi": "12.1.2", - "@next/swc-android-arm64": "12.1.2", - "@next/swc-darwin-arm64": "12.1.2", - "@next/swc-darwin-x64": "12.1.2", - "@next/swc-linux-arm-gnueabihf": "12.1.2", - "@next/swc-linux-arm64-gnu": "12.1.2", - "@next/swc-linux-arm64-musl": "12.1.2", - "@next/swc-linux-x64-gnu": "12.1.2", - "@next/swc-linux-x64-musl": "12.1.2", - "@next/swc-win32-arm64-msvc": "12.1.2", - "@next/swc-win32-ia32-msvc": "12.1.2", - "@next/swc-win32-x64-msvc": "12.1.2" + "@next/swc-android-arm-eabi": "12.1.5", + "@next/swc-android-arm64": "12.1.5", + "@next/swc-darwin-arm64": "12.1.5", + "@next/swc-darwin-x64": "12.1.5", + "@next/swc-linux-arm-gnueabihf": "12.1.5", + "@next/swc-linux-arm64-gnu": "12.1.5", + "@next/swc-linux-arm64-musl": "12.1.5", + "@next/swc-linux-x64-gnu": "12.1.5", + "@next/swc-linux-x64-musl": "12.1.5", + "@next/swc-win32-arm64-msvc": "12.1.5", + "@next/swc-win32-ia32-msvc": "12.1.5", + "@next/swc-win32-x64-msvc": "12.1.5" }, "peerDependencies": { "fibers": ">= 3.1.0", @@ -2350,17 +2369,6 @@ } } }, - "node_modules/next/node_modules/use-subscription": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/use-subscription/-/use-subscription-1.5.1.tgz", - "integrity": "sha512-Xv2a1P/yReAjAbhylMfFplFKj9GssgTwN7RlcTxBujFQcloStWNDQdc4g4NRWH9xS4i/FDk04vQBptAXoF3VcA==", - "dependencies": { - "object-assign": "^4.1.1" - }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0" - } - }, "node_modules/node-fetch": { "version": "2.6.7", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", @@ -2384,6 +2392,7 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -3268,26 +3277,6 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, - "node_modules/ws": { - "version": "7.5.7", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.7.tgz", - "integrity": "sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A==", - "engines": { - "node": ">=8.3.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", @@ -3414,15 +3403,48 @@ } }, "@inrupt/solid-client-notifications": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@inrupt/solid-client-notifications/-/solid-client-notifications-0.2.0.tgz", - "integrity": "sha512-UacPgHTtxKxvif35IJlWN9aIcVTh83k2caG/9fV/vX3CYeSIT98RbAK93wciXzycFEXetZY0/Vklidvw7FIhyQ==", - "requires": { + "version": "file:../../..", + "requires": { + "@inrupt/eslint-config-base": "^0.2.0-alpha.1", + "@inrupt/eslint-config-lib": "^0.2.0-alpha.1", + "@inrupt/solid-client": "^1.21.0", + "@inrupt/solid-client-authn-browser": "^1.11.2", + "@inrupt/solid-client-authn-node": "^1.11.2", + "@playwright/test": "^1.20.1", + "@skypack/package-check": "^0.2.2", + "@types/dotenv-flow": "^3.2.0", "@types/events": "^3.0.0", + "@types/jest": "^27.0.2", + "@types/node": "^14.17.33", "@types/ws": "^7.4.7", - "cross-fetch": "^3.1.4", + "@typescript-eslint/eslint-plugin": "^4.33.0", + "@typescript-eslint/parser": "^4.33.0", + "cross-fetch": "^3.1.5", + "dotenv-flow": "^3.2.0", + "eslint": "^7.32.0", + "eslint-config-airbnb-base": "^14.2.1", + "eslint-config-prettier": "^6.15.0", + "eslint-plugin-header": "^3.1.1", + "eslint-plugin-import": "^2.25.3", + "eslint-plugin-jest": "^23.20.0", + "eslint-plugin-license-header": "^0.2.1", + "eslint-plugin-prettier": "^3.4.1", "events": "^3.3.0", "isomorphic-ws": "^4.0.1", + "jest": "^27.3.1", + "jest-fetch-mock": "^3.0.3", + "jest-websocket-mock": "^2.2.1", + "nlfurniss-typedoc-plugin-sourcefile-url": "^2.0.0", + "node-fetch": "^2.6.6", + "openid-client": "^4.9.1", + "prettier": "2.2.1", + "rimraf": "^3.0.2", + "rollup": "^2.60.0", + "rollup-plugin-typescript2": "^0.30.0", + "ts-jest": "^27.0.7", + "typedoc": "^0.22.12", + "typedoc-plugin-markdown": "^3.11.14", + "typescript": "^4.4.4", "ws": "^7.5.5" } }, @@ -3432,89 +3454,89 @@ "integrity": "sha512-LcImhJqqPsNl/OlULzEEK2rYevty0eh1zaOLVz3lnydEU1DQkeaJ8fKBxKdp5/QjCtnIYcaDjh5U11PGh29Dgg==" }, "@next/env": { - "version": "12.1.2", - "resolved": "https://registry.npmjs.org/@next/env/-/env-12.1.2.tgz", - "integrity": "sha512-A/P4ysmFScBFyu1ZV0Mr1Y89snyQhqGwsCrkEpK+itMF+y+pMqBoPVIyakUf4LXqGWJGiGFuIerihvSG70Ad8Q==" + "version": "12.1.5", + "resolved": "https://registry.npmjs.org/@next/env/-/env-12.1.5.tgz", + "integrity": "sha512-+34yUJslfJi7Lyx6ELuN8nWcOzi27izfYnZIC1Dqv7kmmfiBVxgzR3BXhlvEMTKC2IRJhXVs2FkMY+buQe3k7Q==" }, "@next/eslint-plugin-next": { - "version": "12.1.2", - "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-12.1.2.tgz", - "integrity": "sha512-XqYRh6d98dpv2ynoOEC3VeNv99hxRGBuanRDKASfntdAZD9Zp4n+AugmNF0qwOQEHYgG1uvZW3A4Fi6Y/+kCQw==", + "version": "12.1.5", + "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-12.1.5.tgz", + "integrity": "sha512-Cnb8ERC5bNKBFrnMH6203sp/b0Y78QRx1XsFu+86oBtDBmQmOFoHu7teQjHm69ER73XKK3aGaeoLiXacHoUFsg==", "dev": true, "requires": { "glob": "7.1.7" } }, "@next/swc-android-arm-eabi": { - "version": "12.1.2", - "resolved": "https://registry.npmjs.org/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-12.1.2.tgz", - "integrity": "sha512-iwalfLBhYmCIlj09czFbovj1SmTycf0AGR8CB357wgmEN8xIuznIwSsCH87AhwQ9apfNtdeDhxvuKmhS9T3FqQ==", + "version": "12.1.5", + "resolved": "https://registry.npmjs.org/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-12.1.5.tgz", + "integrity": "sha512-SKnGTdYcoN04Y2DvE0/Y7/MjkA+ltsmbuH/y/hR7Ob7tsj+8ZdOYuk+YvW1B8dY20nDPHP58XgDTSm2nA8BzzA==", "optional": true }, "@next/swc-android-arm64": { - "version": "12.1.2", - "resolved": "https://registry.npmjs.org/@next/swc-android-arm64/-/swc-android-arm64-12.1.2.tgz", - "integrity": "sha512-ZoR0Vx7czJhTgRAcFbzTKQc2n2ChC036/uc6PbgYiI/LreEnfmsV/CiREP0pUVs5ndntOX8kBA3BSbh4zCO5tQ==", + "version": "12.1.5", + "resolved": "https://registry.npmjs.org/@next/swc-android-arm64/-/swc-android-arm64-12.1.5.tgz", + "integrity": "sha512-YXiqgQ/9Rxg1dXp6brXbeQM1JDx9SwUY/36JiE+36FXqYEmDYbxld9qkX6GEzkc5rbwJ+RCitargnzEtwGW0mw==", "optional": true }, "@next/swc-darwin-arm64": { - "version": "12.1.2", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-12.1.2.tgz", - "integrity": "sha512-VXv7lpqFjHwkK65CZHkjvBxlSBTG+l3O0Zl2zHniHj0xHzxJZvR8VFjV2zIMZCYSfVqeQ5yt2rjwuQ9zbpGtXQ==", + "version": "12.1.5", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-12.1.5.tgz", + "integrity": "sha512-y8mhldb/WFZ6lFeowkGfi0cO/lBdiBqDk4T4LZLvCpoQp4Or/NzUN6P5NzBQZ5/b4oUHM/wQICEM+1wKA4qIVw==", "optional": true }, "@next/swc-darwin-x64": { - "version": "12.1.2", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-12.1.2.tgz", - "integrity": "sha512-evXxJQnXEnU+heWyun7d0UV6bhBcmoiyFGR3O3v9qdhGbeXh+SXYVxRO69juuh6V7RWRdlb1KQ0rGUNa1k0XSw==", + "version": "12.1.5", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-12.1.5.tgz", + "integrity": "sha512-wqJ3X7WQdTwSGi0kIDEmzw34QHISRIQ5uvC+VXmsIlCPFcMA+zM5723uh8NfuKGquDMiEMS31a83QgkuHMYbwQ==", "optional": true }, "@next/swc-linux-arm-gnueabihf": { - "version": "12.1.2", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-12.1.2.tgz", - "integrity": "sha512-LJV/wo6R0Ot7Y/20bZs00aBG4J333RT6H/5Q2AROE4Hnx7cenSktSnfU6WCnJgzYLSIHdbLs549LcZMULuVquw==", + "version": "12.1.5", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-12.1.5.tgz", + "integrity": "sha512-WnhdM5duONMvt2CncAl+9pim0wBxDS2lHoo7ub/o/i1bRbs11UTzosKzEXVaTDCUkCX2c32lIDi1WcN2ZPkcdw==", "optional": true }, "@next/swc-linux-arm64-gnu": { - "version": "12.1.2", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-12.1.2.tgz", - "integrity": "sha512-fjlYU1Y8kVjjRKyuyQBYLHPxjGOS2ox7U8TqAvtgKvd2PxqdsgW4sP+VDovRVPrZlGXNllKoJiqMO1OoR9fB6w==", + "version": "12.1.5", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-12.1.5.tgz", + "integrity": "sha512-Jq2H68yQ4bLUhR/XQnbw3LDW0GMQn355qx6rU36BthDLeGue7YV7MqNPa8GKvrpPocEMW77nWx/1yI6w6J07gw==", "optional": true }, "@next/swc-linux-arm64-musl": { - "version": "12.1.2", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-12.1.2.tgz", - "integrity": "sha512-Y1JRDMHqSjLObjyrD1hf6ePrJcOF/mkw+LbAzoNgrHL1dSuIAqcz3jYunJt8T7Yw48xSJy6LPSL9BclAHwEwOA==", + "version": "12.1.5", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-12.1.5.tgz", + "integrity": "sha512-KgPjwdbhDqXI7ghNN8V/WAiLquc9Ebe8KBrNNEL0NQr+yd9CyKJ6KqjayVkmX+hbHzbyvbui/5wh/p3CZQ9xcQ==", "optional": true }, "@next/swc-linux-x64-gnu": { - "version": "12.1.2", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-12.1.2.tgz", - "integrity": "sha512-5N4QSRT60ikQqCU8iHfYZzlhg6MFTLsKhMTARmhn8wLtZfN9VVyTFwZrJQWjV64dZc4JFeXDANGao8fm55y6bw==", + "version": "12.1.5", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-12.1.5.tgz", + "integrity": "sha512-O2ErUTvCJ6DkNTSr9pbu1n3tcqykqE/ebty1rwClzIYdOgpB3T2MfEPP+K7GhUR87wmN/hlihO9ch7qpVFDGKw==", "optional": true }, "@next/swc-linux-x64-musl": { - "version": "12.1.2", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-12.1.2.tgz", - "integrity": "sha512-b32F/xAgdYG4Pt0foFzhF+2uhvNxnEj7aJNp1R4EhZotdej2PzvFWcP/dGkc7MJl205pBz5oC3gHyILIIlW6XA==", + "version": "12.1.5", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-12.1.5.tgz", + "integrity": "sha512-1eIlZmlO/VRjxxzUBcVosf54AFU3ltAzHi+BJA+9U/lPxCYIsT+R4uO3QksRzRjKWhVQMRjEnlXyyq5SKJm7BA==", "optional": true }, "@next/swc-win32-arm64-msvc": { - "version": "12.1.2", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-12.1.2.tgz", - "integrity": "sha512-hVOcGmWDeVwO00Aclopsj6MoYhfJl5zA4vjAai9KjgclQTFZa/DC0vQjgKAHHKGT5oMHgjiq/G7L6P1/UfwYnw==", + "version": "12.1.5", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-12.1.5.tgz", + "integrity": "sha512-oromsfokbEuVb0CBLLE7R9qX3KGXucZpsojLpzUh1QJjuy1QkrPJncwr8xmWQnwgtQ6ecMWXgXPB+qtvizT9Tw==", "optional": true }, "@next/swc-win32-ia32-msvc": { - "version": "12.1.2", - "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-12.1.2.tgz", - "integrity": "sha512-wnVDGIVz2pR3vIkyN6IE+1NvMSBrBj1jba11iR16m8TAPzZH/PrNsxr0a9N5VavEXXLcQpoUVvT+N7nflbRAHg==", + "version": "12.1.5", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-12.1.5.tgz", + "integrity": "sha512-a/51L5KzBpeZSW9LbekMo3I3Cwul+V+QKwbEIMA+Qwb2qrlcn1L9h3lt8cHqNTFt2y72ce6aTwDTw1lyi5oIRA==", "optional": true }, "@next/swc-win32-x64-msvc": { - "version": "12.1.2", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-12.1.2.tgz", - "integrity": "sha512-MLNcurEpQp0+7OU9261f7PkN52xTGkfrt4IYTIXau7DO/aHj927oK6piIJdl9EOHdX/KN5W6qlyErj170PSHtw==", + "version": "12.1.5", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-12.1.5.tgz", + "integrity": "sha512-/SoXW1Ntpmpw3AXAzfDRaQidnd8kbZ2oSni8u5z0yw6t4RwJvmdZy1eOaAADRThWKV+2oU90++LSnXJIwBRWYQ==", "optional": true }, "@nodelib/fs.scandir": { @@ -3549,11 +3571,6 @@ "integrity": "sha512-ZK5v4bJwgXldAUA8r3q9YKfCwOqoHTK/ZqRjSeRXQrBXWouoPnS4MQtgC4AXGiiBuUu5wxrRgTlv0ktmM4P1Aw==", "dev": true }, - "@types/events": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", - "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==" - }, "@types/jest": { "version": "27.4.1", "resolved": "https://registry.npmjs.org/@types/jest/-/jest-27.4.1.tgz", @@ -3583,9 +3600,9 @@ } }, "@types/node": { - "version": "17.0.23", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.23.tgz", - "integrity": "sha512-UxDxWn7dl97rKVeVS61vErvw086aCYhDLyvRQZ5Rk65rZKepaFdm53GeqXaKBuOhED4e9uWq34IC3TdSdJJ2Gw==" + "version": "17.0.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.24.tgz", + "integrity": "sha512-aveCYRQbgTH9Pssp1voEP7HiuWlD2jW2BO56w+bVrJn04i61yh6mRfoKO6hEYQD9vF+W8Chkwc6j1M36uPkx4g==" }, "@types/prop-types": { "version": "15.7.4", @@ -3594,9 +3611,9 @@ "dev": true }, "@types/react": { - "version": "17.0.43", - "resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.43.tgz", - "integrity": "sha512-8Q+LNpdxf057brvPu1lMtC5Vn7J119xrP1aq4qiaefNioQUYANF/CYeK4NsKorSZyUGJ66g0IM+4bbjwx45o2A==", + "version": "18.0.5", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.5.tgz", + "integrity": "sha512-UPxNGInDCIKlfqBrm8LDXYWNfLHwIdisWcsH5GpMyGjhEDLFgTtlRBaoWuCua9HcyuE0rMkmAeZ3FXV1pYLIYQ==", "dev": true, "requires": { "@types/prop-types": "*", @@ -3605,9 +3622,9 @@ } }, "@types/react-dom": { - "version": "17.0.14", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-17.0.14.tgz", - "integrity": "sha512-H03xwEP1oXmSfl3iobtmQ/2dHF5aBHr8aUMwyGZya6OW45G+xtdzmq6HkncefiBt5JU8DVyaWl/nWZbjZCnzAQ==", + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.0.0.tgz", + "integrity": "sha512-49897Y0UiCGmxZqpC8Blrf6meL8QUla6eb+BBhn69dTXlmuOlzkfr7HHY/O8J25e1lTUMs+YYxSlVDAaGHCOLg==", "dev": true, "requires": { "@types/react": "*" @@ -3624,14 +3641,6 @@ "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.4.tgz", "integrity": "sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==" }, - "@types/ws": { - "version": "7.4.7", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", - "integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==", - "requires": { - "@types/node": "*" - } - }, "@typescript-eslint/parser": { "version": "5.10.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.10.1.tgz", @@ -4023,9 +4032,9 @@ "dev": true }, "eslint": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.12.0.tgz", - "integrity": "sha512-it1oBL9alZg1S8UycLm5YDMAkIhtH6FtAzuZs6YvoGVldWjbS08BkAdb/ymP9LlAyq8koANu32U7Ib/w+UNh8Q==", + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.13.0.tgz", + "integrity": "sha512-D+Xei61eInqauAyTJ6C0q6x9mx7kTUC1KZ0m0LSEexR0V+e94K12LmWX076ZIsldwfQ2RONdaJe0re0TRGQbRQ==", "dev": true, "requires": { "@eslint/eslintrc": "^1.2.1", @@ -4066,12 +4075,12 @@ } }, "eslint-config-next": { - "version": "12.1.2", - "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-12.1.2.tgz", - "integrity": "sha512-nJgSIB5lXoOsS2yY90i5L5ucI1uko+ykhcQkGkydXqs5GdPprY8Y1NKWW3N0OEzQvFyBcf7GHb/ohB21HoeEsg==", + "version": "12.1.5", + "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-12.1.5.tgz", + "integrity": "sha512-P+DCt5ti63KhC0qNLzrAmPcwRGq8pYqgcf/NNr1E+WjCrMkWdCAXkIANTquo+kcO1adR2k1lTo5GCrNUtKy4hQ==", "dev": true, "requires": { - "@next/eslint-plugin-next": "12.1.2", + "@next/eslint-plugin-next": "12.1.5", "@rushstack/eslint-patch": "1.0.8", "@typescript-eslint/parser": "5.10.1", "eslint-import-resolver-node": "0.3.4", @@ -4768,12 +4777,6 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, - "isomorphic-ws": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", - "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==", - "requires": {} - }, "jest-diff": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-27.5.1.tgz", @@ -4963,37 +4966,26 @@ "dev": true }, "next": { - "version": "12.1.2", - "resolved": "https://registry.npmjs.org/next/-/next-12.1.2.tgz", - "integrity": "sha512-JHPCsnFTBO0Z4SQxSYc611UA1WA+r/3y3Neg66AH5/gSO/oksfRnFw/zGX/FZ9+oOUHS9y3wJFawNpVYR2gJSQ==", - "requires": { - "@next/env": "12.1.2", - "@next/swc-android-arm-eabi": "12.1.2", - "@next/swc-android-arm64": "12.1.2", - "@next/swc-darwin-arm64": "12.1.2", - "@next/swc-darwin-x64": "12.1.2", - "@next/swc-linux-arm-gnueabihf": "12.1.2", - "@next/swc-linux-arm64-gnu": "12.1.2", - "@next/swc-linux-arm64-musl": "12.1.2", - "@next/swc-linux-x64-gnu": "12.1.2", - "@next/swc-linux-x64-musl": "12.1.2", - "@next/swc-win32-arm64-msvc": "12.1.2", - "@next/swc-win32-ia32-msvc": "12.1.2", - "@next/swc-win32-x64-msvc": "12.1.2", + "version": "12.1.5", + "resolved": "https://registry.npmjs.org/next/-/next-12.1.5.tgz", + "integrity": "sha512-YGHDpyfgCfnT5GZObsKepmRnne7Kzp7nGrac07dikhutWQug7hHg85/+sPJ4ZW5Q2pDkb+n0FnmLkmd44htIJQ==", + "requires": { + "@next/env": "12.1.5", + "@next/swc-android-arm-eabi": "12.1.5", + "@next/swc-android-arm64": "12.1.5", + "@next/swc-darwin-arm64": "12.1.5", + "@next/swc-darwin-x64": "12.1.5", + "@next/swc-linux-arm-gnueabihf": "12.1.5", + "@next/swc-linux-arm64-gnu": "12.1.5", + "@next/swc-linux-arm64-musl": "12.1.5", + "@next/swc-linux-x64-gnu": "12.1.5", + "@next/swc-linux-x64-musl": "12.1.5", + "@next/swc-win32-arm64-msvc": "12.1.5", + "@next/swc-win32-ia32-msvc": "12.1.5", + "@next/swc-win32-x64-msvc": "12.1.5", "caniuse-lite": "^1.0.30001283", "postcss": "8.4.5", - "styled-jsx": "5.0.1", - "use-subscription": "1.5.1" - }, - "dependencies": { - "use-subscription": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/use-subscription/-/use-subscription-1.5.1.tgz", - "integrity": "sha512-Xv2a1P/yReAjAbhylMfFplFKj9GssgTwN7RlcTxBujFQcloStWNDQdc4g4NRWH9xS4i/FDk04vQBptAXoF3VcA==", - "requires": { - "object-assign": "^4.1.1" - } - } + "styled-jsx": "5.0.1" } }, "node-fetch": { @@ -5007,7 +4999,8 @@ "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true }, "object-inspect": { "version": "1.12.0", @@ -5620,12 +5613,6 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, - "ws": { - "version": "7.5.7", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.7.tgz", - "integrity": "sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A==", - "requires": {} - }, "yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", diff --git a/e2e/browser/testApp/package.json b/e2e/browser/testApp/package.json index d16be1a3..3b7d05b6 100644 --- a/e2e/browser/testApp/package.json +++ b/e2e/browser/testApp/package.json @@ -1,5 +1,5 @@ { - "name": "test", + "name": "test-app", "version": "0.1.0", "private": true, "scripts": { @@ -10,17 +10,17 @@ }, "dependencies": { "@inrupt/solid-client-authn-browser": "^1.11.7", - "@inrupt/solid-client-notifications": "*", - "next": "12.1.2", + "@inrupt/solid-client-notifications": "file:../../../", + "next": "12.1.5", "react": "18.0.0", "react-dom": "18.0.0" }, "devDependencies": { - "@types/node": "17.0.23", - "@types/react": "17.0.43", - "@types/react-dom": "17.0.14", - "eslint": "8.12.0", - "eslint-config-next": "12.1.2", + "@types/node": "17.0.24", + "@types/react": "18.0.5", + "@types/react-dom": "18.0.0", + "eslint": "8.13.0", + "eslint-config-next": "12.1.5", "typescript": "4.6.3" } } diff --git a/e2e/browser/testApp/tsconfig.json b/e2e/browser/testApp/tsconfig.json index 99710e85..74cf3613 100644 --- a/e2e/browser/testApp/tsconfig.json +++ b/e2e/browser/testApp/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "es5", + "target": "es2017", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, diff --git a/package-lock.json b/package-lock.json index 123dfc6a..1eb340d5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41,14 +41,16 @@ "jest": "^27.3.1", "jest-fetch-mock": "^3.0.3", "jest-websocket-mock": "^2.2.1", + "nlfurniss-typedoc-plugin-sourcefile-url": "^2.0.0", "node-fetch": "^2.6.6", "openid-client": "^4.9.1", "prettier": "2.2.1", + "rimraf": "^3.0.2", "rollup": "^2.60.0", "rollup-plugin-typescript2": "^0.30.0", "ts-jest": "^27.0.7", - "typedoc": "^0.22.10", - "typedoc-plugin-markdown": "^3.11.3", + "typedoc": "^0.22.12", + "typedoc-plugin-markdown": "^3.11.14", "typescript": "^4.4.4" } }, @@ -6481,9 +6483,9 @@ } }, "node_modules/marked": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.0.10.tgz", - "integrity": "sha512-+QvuFj0nGgO970fySghXGmuw+Fd0gD2x3+MqCWLIPf5oxdv1Ka6b2q+z9RP01P/IaKPMEramy+7cNy/Lw8c3hw==", + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.0.13.tgz", + "integrity": "sha512-lS/ZCa4X0gsRcfWs1eoh6dLnHr9kVH3K1t2X4M/tTtNouhZ7anS1Csb6464VGLQHv8b2Tw1cLeZQs58Jav8Rzw==", "dev": true, "bin": { "marked": "bin/marked.js" @@ -6632,6 +6634,15 @@ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, + "node_modules/nlfurniss-typedoc-plugin-sourcefile-url": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/nlfurniss-typedoc-plugin-sourcefile-url/-/nlfurniss-typedoc-plugin-sourcefile-url-2.0.0.tgz", + "integrity": "sha512-oLm4jxSz9BEj9qnD92FEWVX+ObKjxwiUzKAeFXuBOftLlq2/PdoUD/DwfRFYnuL3nbSycw+e+x90U3EVMdGEhw==", + "dev": true, + "peerDependencies": { + "typedoc": ">=0.22.0" + } + }, "node_modules/node-fetch": { "version": "2.6.7", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", @@ -7606,9 +7617,9 @@ } }, "node_modules/shiki": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.10.0.tgz", - "integrity": "sha512-iczxaIYeBFHTFrQPb9DVy2SKgYxC4Wo7Iucm7C17cCh2Ge/refnvHscUOxM85u57MfLoNOtjoEFUWt9gBexblA==", + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.10.1.tgz", + "integrity": "sha512-VsY7QJVzU51j5o1+DguUd+6vmCmZ5v/6gYu4vyYAhzjuNQU6P/vmSy4uQaOhvje031qQMiW0d2BwgMH52vqMng==", "dev": true, "dependencies": { "jsonc-parser": "^3.0.0", @@ -8167,16 +8178,16 @@ } }, "node_modules/typedoc": { - "version": "0.22.11", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.22.11.tgz", - "integrity": "sha512-pVr3hh6dkS3lPPaZz1fNpvcrqLdtEvXmXayN55czlamSgvEjh+57GUqfhAI1Xsuu/hNHUT1KNSx8LH2wBP/7SA==", + "version": "0.22.14", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.22.14.tgz", + "integrity": "sha512-tlf9wIcsrnQSjetStrnRutuy2RjZkG5PK2umwveZLTkuC2K9VywOZTdu2G19BdOPzGrhZjf9WK7pthXqnFQejg==", "dev": true, "dependencies": { "glob": "^7.2.0", "lunr": "^2.3.9", - "marked": "^4.0.10", - "minimatch": "^3.0.4", - "shiki": "^0.10.0" + "marked": "^4.0.12", + "minimatch": "^5.0.1", + "shiki": "^0.10.1" }, "bin": { "typedoc": "bin/typedoc" @@ -8185,13 +8196,13 @@ "node": ">= 12.10.0" }, "peerDependencies": { - "typescript": "4.0.x || 4.1.x || 4.2.x || 4.3.x || 4.4.x || 4.5.x" + "typescript": "4.0.x || 4.1.x || 4.2.x || 4.3.x || 4.4.x || 4.5.x || 4.6.x" } }, "node_modules/typedoc-plugin-markdown": { - "version": "3.11.12", - "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.11.12.tgz", - "integrity": "sha512-gb/RuzgZ1zCnRUOqUg6firIqU7xDs9s7hq0vlU/gAsFfVCnpl3NTM9vPyPON75nnpfVFCxr/hmKQ01k1CYY/Qg==", + "version": "3.11.14", + "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.11.14.tgz", + "integrity": "sha512-lh47OQvl0079nB18YL9wuTRRhMpjo300SZKfx/xpQY8qG+GINeSxTod95QBELeI0NP81sNtUbemRDrn5nyef4Q==", "dev": true, "dependencies": { "handlebars": "^4.7.7" @@ -8200,6 +8211,27 @@ "typedoc": ">=0.22.0" } }, + "node_modules/typedoc/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/typedoc/node_modules/minimatch": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", + "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/typescript": { "version": "4.5.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.3.tgz", @@ -8304,9 +8336,9 @@ } }, "node_modules/vscode-oniguruma": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.6.1.tgz", - "integrity": "sha512-vc4WhSIaVpgJ0jJIejjYxPvURJavX6QG41vu0mGhqywMkQqulezEqEQ3cO3gc8GvcOpX6ycmKGqRoROEMBNXTQ==", + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.6.2.tgz", + "integrity": "sha512-KH8+KKov5eS/9WhofZR8M8dMHWN2gTxjMsG4jd04YhpbPR91fUj7rYQ2/XjeHCJWbg7X++ApRIU9NUwM2vTvLA==", "dev": true }, "node_modules/vscode-textmate": { @@ -13433,9 +13465,9 @@ } }, "marked": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.0.10.tgz", - "integrity": "sha512-+QvuFj0nGgO970fySghXGmuw+Fd0gD2x3+MqCWLIPf5oxdv1Ka6b2q+z9RP01P/IaKPMEramy+7cNy/Lw8c3hw==", + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.0.13.tgz", + "integrity": "sha512-lS/ZCa4X0gsRcfWs1eoh6dLnHr9kVH3K1t2X4M/tTtNouhZ7anS1Csb6464VGLQHv8b2Tw1cLeZQs58Jav8Rzw==", "dev": true }, "merge-stream": { @@ -13550,6 +13582,13 @@ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, + "nlfurniss-typedoc-plugin-sourcefile-url": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/nlfurniss-typedoc-plugin-sourcefile-url/-/nlfurniss-typedoc-plugin-sourcefile-url-2.0.0.tgz", + "integrity": "sha512-oLm4jxSz9BEj9qnD92FEWVX+ObKjxwiUzKAeFXuBOftLlq2/PdoUD/DwfRFYnuL3nbSycw+e+x90U3EVMdGEhw==", + "dev": true, + "requires": {} + }, "node-fetch": { "version": "2.6.7", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", @@ -14256,9 +14295,9 @@ "dev": true }, "shiki": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.10.0.tgz", - "integrity": "sha512-iczxaIYeBFHTFrQPb9DVy2SKgYxC4Wo7Iucm7C17cCh2Ge/refnvHscUOxM85u57MfLoNOtjoEFUWt9gBexblA==", + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.10.1.tgz", + "integrity": "sha512-VsY7QJVzU51j5o1+DguUd+6vmCmZ5v/6gYu4vyYAhzjuNQU6P/vmSy4uQaOhvje031qQMiW0d2BwgMH52vqMng==", "dev": true, "requires": { "jsonc-parser": "^3.0.0", @@ -14680,22 +14719,42 @@ } }, "typedoc": { - "version": "0.22.11", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.22.11.tgz", - "integrity": "sha512-pVr3hh6dkS3lPPaZz1fNpvcrqLdtEvXmXayN55czlamSgvEjh+57GUqfhAI1Xsuu/hNHUT1KNSx8LH2wBP/7SA==", + "version": "0.22.14", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.22.14.tgz", + "integrity": "sha512-tlf9wIcsrnQSjetStrnRutuy2RjZkG5PK2umwveZLTkuC2K9VywOZTdu2G19BdOPzGrhZjf9WK7pthXqnFQejg==", "dev": true, "requires": { "glob": "^7.2.0", "lunr": "^2.3.9", - "marked": "^4.0.10", - "minimatch": "^3.0.4", - "shiki": "^0.10.0" + "marked": "^4.0.12", + "minimatch": "^5.0.1", + "shiki": "^0.10.1" + }, + "dependencies": { + "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, + "requires": { + "balanced-match": "^1.0.0" + } + }, + "minimatch": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", + "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + } } }, "typedoc-plugin-markdown": { - "version": "3.11.12", - "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.11.12.tgz", - "integrity": "sha512-gb/RuzgZ1zCnRUOqUg6firIqU7xDs9s7hq0vlU/gAsFfVCnpl3NTM9vPyPON75nnpfVFCxr/hmKQ01k1CYY/Qg==", + "version": "3.11.14", + "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.11.14.tgz", + "integrity": "sha512-lh47OQvl0079nB18YL9wuTRRhMpjo300SZKfx/xpQY8qG+GINeSxTod95QBELeI0NP81sNtUbemRDrn5nyef4Q==", "dev": true, "requires": { "handlebars": "^4.7.7" @@ -14779,9 +14838,9 @@ } }, "vscode-oniguruma": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.6.1.tgz", - "integrity": "sha512-vc4WhSIaVpgJ0jJIejjYxPvURJavX6QG41vu0mGhqywMkQqulezEqEQ3cO3gc8GvcOpX6ycmKGqRoROEMBNXTQ==", + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.6.2.tgz", + "integrity": "sha512-KH8+KKov5eS/9WhofZR8M8dMHWN2gTxjMsG4jd04YhpbPR91fUj7rYQ2/XjeHCJWbg7X++ApRIU9NUwM2vTvLA==", "dev": true }, "vscode-textmate": { diff --git a/package.json b/package.json index 274f3ff4..ed52fab7 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,12 @@ "version": "0.2.0", "license": "MIT", "scripts": { + "clean": "rimraf dist umd", "build": "rollup --config rollup.config.js", - "build-api-docs": "typedoc", - "build-docs-preview-site": "npm run build-api-docs; cd docs/api; rm source/api/index.md; make html; cd ../; rm -r dist || true; mkdir -p dist/api; cp -r api/build/html/. dist/;", + "docs:clean": "cd docs/api; make clean-all", + "docs:install": "cd docs/api; pip install -r requirements.txt", + "docs:build": "typedoc && cd docs/api && make html dist", + "docs:preview": "python3 -m http.server --bind 127.0.0.1 --directory docs/dist", "lint": "npm run lint:check", "lint:fix": "npm run lint:eslint -- --fix && npm run lint:prettier -- --write", "lint:check": "npm run lint:eslint && npm run lint:prettier -- --check", @@ -15,7 +18,7 @@ "test": "jest src", "test:e2e:node": "jest --config=jest.e2e.config.js e2e/node", "test:e2e:browser": "cd e2e/browser/test && playwright test", - "test:e2e:browser:build": "cd e2e/browser/testApp && npm ci && npm link ../../../", + "test:e2e:browser:setup": "cd e2e/browser/testApp && npm ci", "licenses:list": "npx license-checker --production --csv --out LICENSE_DEPENDENCIES_ALL", "licenses:check": "npx license-checker --production --failOn \"AGPL-1.0-only; AGPL-1.0-or-later; AGPL-3.0-only; AGPL-3.0-or-later; Beerware; CC-BY-NC-1.0; CC-BY-NC-2.0; CC-BY-NC-2.5; CC-BY-NC-3.0; CC-BY-NC-4.0; CC-BY-NC-ND-1.0; CC-BY-NC-ND-2.0; CC-BY-NC-ND-2.5; CC-BY-NC-ND-3.0; CC-BY-NC-ND-4.0; CC-BY-NC-SA-1.0; CC-BY-NC-SA-2.0; CC-BY-NC-SA-2.5; CC-BY-NC-SA-3.0; CC-BY-NC-SA-4.0; CPAL-1.0; EUPL-1.0; EUPL-1.1; EUPL-1.1; GPL-1.0-only; GPL-1.0-or-later; GPL-2.0-only; GPL-2.0-or-later; GPL-3.0; GPL-3.0-only; GPL-3.0-or-later; SISSL; SISSL-1.2; WTFPL\"", "prepublishOnly": "npm run build" @@ -74,14 +77,16 @@ "jest": "^27.3.1", "jest-fetch-mock": "^3.0.3", "jest-websocket-mock": "^2.2.1", + "nlfurniss-typedoc-plugin-sourcefile-url": "^2.0.0", "node-fetch": "^2.6.6", "openid-client": "^4.9.1", "prettier": "2.2.1", + "rimraf": "^3.0.2", "rollup": "^2.60.0", "rollup-plugin-typescript2": "^0.30.0", "ts-jest": "^27.0.7", - "typedoc": "^0.22.10", - "typedoc-plugin-markdown": "^3.11.3", + "typedoc": "^0.22.12", + "typedoc-plugin-markdown": "^3.11.14", "typescript": "^4.4.4" }, "dependencies": { diff --git a/rollup.config.js b/rollup.config.js index 40ea79a7..13d33041 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -54,6 +54,7 @@ export default { compilerOptions: { module: "esnext", }, + exclude: ["**/*.test.ts"], }, }), ], diff --git a/src/index.ts b/src/index.ts index e40a0a4b..bcfffacd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -24,9 +24,9 @@ export { statuses, NegotiationInfo, NotificationConnectionInfo, - BaseNotificationOptions, + NotificationOptions, FeatureOptions, -} from "./notification"; +} from "./interfaces"; export { WebsocketNotification } from "./websocketNotification"; diff --git a/src/interfaces.ts b/src/interfaces.ts new file mode 100644 index 00000000..474460e2 --- /dev/null +++ b/src/interfaces.ts @@ -0,0 +1,65 @@ +// +// Copyright 2022 Inrupt Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal in +// the Software without restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the +// Software, and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +import { fetch as crossFetch } from "cross-fetch"; + +export type protocols = "ws" | string; +export type statuses = "connecting" | "connected" | "closing" | "closed"; + +/** @internal */ +export interface NegotiationInfo { + endpoint: string; + procotol: protocols; + features: FeatureOptions; +} + +/** @internal */ +export interface NotificationConnectionInfo { + endpoint: string; + protocol: protocols; + subprotocol: string; +} + +export interface NotificationOptions { + features?: FeatureOptions; + /** + * Automatically discovered based on the topic passed + */ + gateway?: string; + /** + * Automatically discovered based on the topic passed + */ + host?: string; + + /** + * A WHATWG Fetch API compatible function used when making requests for + * discovering metadata for notifications. See the documentation for + * `setSessionFetch` in the `WebsocketNotification` class. + */ + fetch?: typeof crossFetch; +} + +export interface FeatureOptions { + state?: string; + ttl?: number; + rate?: number; + filter?: string; +} diff --git a/src/liveNotification.test.ts b/src/liveNotification.test.ts index 81391d2a..e9a2bba8 100644 --- a/src/liveNotification.test.ts +++ b/src/liveNotification.test.ts @@ -21,7 +21,7 @@ import EventEmitter from "events"; import { LiveNotification } from "./liveNotification"; -import { protocols } from "./notification"; +import { protocols } from "./interfaces"; describe("LiveNotification", () => { test("has an EventEmitter", () => { diff --git a/src/liveNotification.ts b/src/liveNotification.ts index f7fa11ef..ed137514 100644 --- a/src/liveNotification.ts +++ b/src/liveNotification.ts @@ -22,22 +22,24 @@ import { EventEmitter } from "events"; import { NotImplementedError } from "./errors"; -import { - BaseNotification, - BaseNotificationOptions, - protocols, -} from "./notification"; +import { BaseNotification } from "./notification"; +import { NotificationOptions, protocols } from "./interfaces"; +/** + * @internal + */ export class LiveNotification extends BaseNotification { + /** @internal */ protocol?: protocols; + /** @internal */ emitter: EventEmitter; // TODO move constructor options to options instead of arguments constructor( topic: string, protocolList: protocols[], - options?: BaseNotificationOptions + options?: NotificationOptions ) { super(topic, protocolList, options); this.emitter = new EventEmitter(); @@ -54,7 +56,7 @@ export class LiveNotification extends BaseNotification { }; /* eslint @typescript-eslint/no-explicit-any: 0 */ - on = (eventName: string, eventFn: (arg?: any) => void): void => { - this.emitter.on(eventName, eventFn); + on = (eventName: string, listener: (...args: any[]) => void): void => { + this.emitter.on(eventName, listener); }; } diff --git a/src/notification.test.ts b/src/notification.test.ts index e6e43dcd..166bda3a 100644 --- a/src/notification.test.ts +++ b/src/notification.test.ts @@ -24,7 +24,8 @@ import fetch from "jest-fetch-mock"; import { fetch as fetchFn } from "@inrupt/solid-client-authn-browser"; -import { BaseNotification, protocols } from "./notification"; +import { BaseNotification } from "./notification"; +import { protocols } from "./interfaces"; jest.mock("@inrupt/solid-client-authn-browser"); diff --git a/src/notification.ts b/src/notification.ts index c5746b9c..ffbec97b 100644 --- a/src/notification.ts +++ b/src/notification.ts @@ -21,49 +21,38 @@ import { fetch as crossFetch } from "cross-fetch"; import { FetchError } from "./errors"; - -export type protocols = "ws" | string; -export type statuses = "connecting" | "connected" | "closing" | "closed"; - -export type NegotiationInfo = { - endpoint: string; - procotol: protocols; - features: FeatureOptions; -}; - -export type NotificationConnectionInfo = { - endpoint: string; - protocol: protocols; - subprotocol: string; -}; - -export type BaseNotificationOptions = { - features?: FeatureOptions; - gateway?: string; - host?: string; - fetch?: typeof crossFetch; -}; - -export type FeatureOptions = { - state?: string; - ttl?: number; - rate?: number; - filter?: string; -}; - +import { + protocols, + FeatureOptions, + statuses, + NotificationOptions, + NegotiationInfo, + NotificationConnectionInfo, +} from "./interfaces"; + +/** + * @internal + */ export class BaseNotification { + /** @internal */ topic: string; + /** @internal */ host: string; + /** @internal */ gateway?: string; + /** @internal */ fetch: typeof crossFetch; + /** @internal */ protocols: Array; + /** @internal */ features: FeatureOptions; + /** @internal */ status: statuses = "closed"; /** @internal */ @@ -77,9 +66,10 @@ export class BaseNotification { return new URL("/.well-known/solid", host).href; } - // Dynamically import solid-client-authn-browser so that Notifiction doesn't have a hard + // Dynamically import solid-client-authn-browser so that Notification doesn't have a hard // dependency. /* eslint consistent-return: 0 */ + /** @internal */ static async getDefaultSessionFetch(): Promise< typeof crossFetch | undefined > { @@ -96,7 +86,7 @@ export class BaseNotification { constructor( topic: string, protocolList: protocols[], - options: BaseNotificationOptions = {} + options: NotificationOptions = {} ) { const { gateway, host, features = {}, fetch: fetchFn } = options; @@ -116,6 +106,18 @@ export class BaseNotification { this.host = host || BaseNotification.getRootDomain(topic); } + /** + * Allows setting a [WHATWG Fetch API][fetch] compatible function + * for making HTTP requests. When [@inrupt/solid-client-authn-browser][scab] + * is available and this property is not set, `fetch` will be imported from + * there. Otherwise, the HTTP requests will be unauthenticated. + * + * [fetch]: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API + * + * [scab]: https://npmjs.com/package/@inrupt/solid-client-authn-browser + * + * @param sessionFetch + */ setSessionFetch = (sessionFetch: typeof crossFetch = crossFetch): void => { this.fetch = sessionFetch; }; @@ -151,6 +153,7 @@ export class BaseNotification { return notificationGateway; } + /** @internal */ async fetchProtocolNegotiationInfo(): Promise { if (!this.gateway) { await this.fetchNegotiationGatewayUrl(); @@ -184,6 +187,7 @@ export class BaseNotification { return response.json(); } + /** @internal */ async fetchNotificationConnectionInfo(): Promise { const { endpoint } = await this.fetchProtocolNegotiationInfo(); diff --git a/src/websocketNotification.test.ts b/src/websocketNotification.test.ts index 929d9869..b80c50c1 100644 --- a/src/websocketNotification.test.ts +++ b/src/websocketNotification.test.ts @@ -85,7 +85,7 @@ describe("WebsocketNotification", () => { const ws = new WebsocketNotification(topic, { fetch: fetchFn }); await ws.connect(wssEndpoint); - ws.webSocket?.onopen({} as OpenEvent); + ws.websocket?.onopen({} as OpenEvent); expect(ws.status).toEqual("connected"); }); @@ -101,8 +101,8 @@ describe("WebsocketNotification", () => { ws.on("message", messageSpy); await ws.connect(wssEndpoint); - ws.webSocket?.onopen({} as OpenEvent); - ws.webSocket?.onmessage({ data: message } as MessageEvent); + ws.websocket?.onopen({} as OpenEvent); + ws.websocket?.onmessage({ data: message } as MessageEvent); expect(messageSpy).toHaveBeenCalledWith(message); }); @@ -118,7 +118,7 @@ describe("WebsocketNotification", () => { await ws.connect(wssEndpoint); - ws.webSocket?.onerror({} as ErrorEvent); + ws.websocket?.onerror({} as ErrorEvent); expect(errorSpy).toHaveBeenCalled(); }); @@ -129,11 +129,11 @@ describe("WebsocketNotification", () => { const ws = new WebsocketNotification(topic, { fetch: fetchFn }); await ws.connect(wssEndpoint); - ws.webSocket?.onopen({} as OpenEvent); + ws.websocket?.onopen({} as OpenEvent); expect(ws.status).toEqual("connected"); - ws.webSocket?.onclose({} as CloseEvent); + ws.websocket?.onclose({} as CloseEvent); expect(ws.status).toEqual("closed"); }); @@ -147,7 +147,7 @@ describe("WebsocketNotification", () => { ws.on("closed", closedSpy); await ws.connect(wssEndpoint); - ws.webSocket?.onclose({} as CloseEvent); + ws.websocket?.onclose({} as CloseEvent); expect(closedSpy).toHaveBeenCalled(); }); @@ -164,9 +164,9 @@ describe("WebsocketNotification", () => { await ws.connect(wssEndpoint); ws.disconnect(); - ws.webSocket?.onclose({} as CloseEvent); + ws.websocket?.onclose({} as CloseEvent); - expect(ws.webSocket).toBeUndefined(); + expect(ws.websocket).toBeUndefined(); }); it("does nothing if the websocket was never initialized", () => { @@ -176,7 +176,7 @@ describe("WebsocketNotification", () => { ws.disconnect(); - expect(ws.webSocket).toBeUndefined(); + expect(ws.websocket).toBeUndefined(); }); }); }); diff --git a/src/websocketNotification.ts b/src/websocketNotification.ts index fdfc3fca..e4bc2780 100644 --- a/src/websocketNotification.ts +++ b/src/websocketNotification.ts @@ -22,17 +22,61 @@ // Typescript and eslint are fighting over whether these are globals /* eslint no-shadow: 0 */ import IsoWebSocket, { MessageEvent, ErrorEvent } from "isomorphic-ws"; -import { BaseNotificationOptions } from "./notification"; +import { NotificationOptions, statuses } from "./interfaces"; import { LiveNotification } from "./liveNotification"; +/** + * Constructor for a WebSocket Notification instance, which allows subscribing to resources in the solid ecosystem. + * See the [Solid Notifications Protocol Specification](https://solid.github.io/notifications/protocol) for more details. + * + * ```typescript + * import { getDefaultSession } from '@inrupt/solid-authn-browser'; + * // or for node.js: + * // import { Session } from '@inrupt/solid-authn-node'; + * + * const session = getDefaultSession(); + * // for node.js: + * // const session = new Session(); + * // await session.login({ + * // oidcIssuer, + * // clientId, + * // clientSecret, + * // }); + * + * const socket = new WebsocketNotification(parentContainerUrl, { + * fetch: session.fetch, + * }); + * + * socket.on("message", (message) => { + * const notification = JSON.parse(message); + * console.log("Change:", notification); + * }); + * + * // Connect for receiving notifications: + * await socket.connect(); + * + * // later: + * socket.disconnect(); + * ``` + */ export class WebsocketNotification extends LiveNotification { - webSocket?: IsoWebSocket; + /** @internal */ + websocket?: IsoWebSocket; - constructor(topic: string, options?: BaseNotificationOptions) { + /** @internal */ + status: statuses = "closed"; + + constructor(topic: string, options?: NotificationOptions) { // Hardcode the protocol to WS to ask the server specifically for a websocket connection super(topic, ["ws"], options); } + /** + * Connects the websocket to start receiving notifications. If no + * `providedEndpoint` or `providedSubprotocol` parameter is present, then + * those will automatically be discovered based on the capabilities of the + * host of the resource that you're subscribing to notifications for. + */ connect = async ( providedEndpoint?: string, providedSubprotocol?: string @@ -48,32 +92,32 @@ export class WebsocketNotification extends LiveNotification { subprotocol = connectionInfo.subprotocol; } - this.webSocket = new IsoWebSocket(endpoint, subprotocol); + this.websocket = new IsoWebSocket(endpoint, subprotocol); - this.webSocket.onopen = () => { + this.websocket.onopen = () => { this.status = "connected"; this.emitter.emit("connected"); }; - this.webSocket.onmessage = (e: MessageEvent) => { + this.websocket.onmessage = (e: MessageEvent) => { this.emitter.emit("message", e.data); }; // TODO auto-reconnect once we get a TTL from notification connection info - this.webSocket.onclose = () => { + this.websocket.onclose = () => { this.status = "closed"; this.emitter.emit("closed"); }; - this.webSocket.onerror = (e: ErrorEvent) => { + this.websocket.onerror = (e: ErrorEvent) => { this.emitter.emit("error", e); }; }; disconnect = (): void => { - if (this.webSocket) { - this.webSocket.close(); - this.webSocket = undefined; + if (this.websocket) { + this.websocket.close(); + this.websocket = undefined; } }; } diff --git a/tsconfig.json b/tsconfig.json index 04f7744b..23da46cb 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,77 +1,28 @@ { "compilerOptions": { - /* Basic Options */ - "target": "es2017", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */ - "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ - "lib": ["es6", "dom"], /* Specify library files to be included in the compilation. */ - // "allowJs": true, /* Allow javascript files to be compiled. */ - // "checkJs": true, /* Report errors in .js files. */ - // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ - "declaration": true, /* Generates corresponding '.d.ts' file. */ - // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ - // "sourceMap": true, /* Generates corresponding '.map' file. */ - // "outFile": "./", /* Concatenate and emit output to single file. */ - "outDir": ".", /* Redirect output structure to the directory. */ - "rootDir": "src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ - // "composite": true, /* Enable project compilation */ - // "removeComments": true, /* Do not emit comments to output. */ - // "noEmit": true, /* Do not emit outputs. */ - // "importHelpers": true, /* Import emit helpers from 'tslib'. */ - // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ - // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ - - /* Strict Type-Checking Options */ - "strict": true, /* Enable all strict type-checking options. */ - // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* Enable strict null checks. */ - // "strictFunctionTypes": true, /* Enable strict checking of function types. */ - // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ - // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ - // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ - - /* Additional Checks */ - // "noUnusedLocals": true, /* Report errors on unused locals. */ - // "noUnusedParameters": true, /* Report errors on unused parameters. */ - // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ - // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ - - /* Module Resolution Options */ - // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ - // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ - // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ - // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ - // "typeRoots": [], /* List of folders to include type definitions from. */ + "target": "es2017", + "module": "commonjs", + "lib": ["es6", "dom"], + "declaration": true, + "outDir": ".", + "rootDir": "src", + "strict": true, // https://github.com/microsoft/TypeScript/wiki/Performance#controlling-types-inclusion: - "types": ["jest"], /* Type declaration files to be included in compilation. */ - // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ - // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ - - /* Source Map Options */ - // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ - // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ - + "types": ["jest"], + "esModuleInterop": true, // Prevent developers on different OSes from running into problems: "forceConsistentCasingInFileNames": true, - - /* Advanced Options */ - "stripInternal": true, /* Do not emit declarations for code that has an @internal annotation in it’s JSDoc comment. */ - - /* Experimental Options */ - // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ - // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ + // Advanced Options + "stripInternal": true }, "typedocOptions": { "out": "docs/api/source/api", "entryPoints": [ // The source files of everything listed under `exports` in our package.json // (i.e. public API's that should be documented) should be listed here: - "src/liveNotification.ts", - "src/notification.ts", + "src/interfaces.ts", "src/websocketNotification.ts", - "src/errors.ts", + "src/errors.ts" ], "exclude": [ "node_modules/**", @@ -82,11 +33,14 @@ // End-to-end tests: "e2e/**", // Re-exported functions are already documented in their own modules: - "src/index.ts", + "src/index.ts" ], "theme": "markdown", "readme": "none", "entryDocument": "index.md", + // This is used to get source URLs working on Vercel, where the git remote + // isn't automatically detected. See the nlfurniss-typedoc-plugin-sourcefile-url plugin + "sourcefile-url-prefix": "https://github.com/inrupt/solid-client-notifications-js/blob/main/" }, "include": ["src/**/*.ts", ".eslintrc.js"], "exclude": ["**/node_modules", "tests/**/*.js"] diff --git a/vercel.json b/vercel.json deleted file mode 100644 index 7ae9a3de..00000000 --- a/vercel.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "github": { - "silent": true - } -}