@inrupt/solid-client-authn-browser 1.12.4 → 1.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ClientAuthentication.js +5 -1
- package/dist/ClientAuthentication.js.map +1 -1
- package/dist/login/oidc/IssuerConfigFetcher.js +1 -2
- package/dist/login/oidc/IssuerConfigFetcher.js.map +1 -1
- package/dist/login/oidc/incomingRedirectHandler/AuthCodeRedirectHandler.js +4 -0
- package/dist/login/oidc/incomingRedirectHandler/AuthCodeRedirectHandler.js.map +1 -1
- package/dist/solid-client-authn.bundle.js +1 -1
- package/package.json +4 -4
- package/src/ClientAuthentication.spec.ts +73 -21
- package/src/ClientAuthentication.ts +33 -25
- package/src/Session.spec.ts +20 -20
- package/src/Session.ts +20 -20
- package/src/__mocks__/ClientAuthentication.ts +20 -20
- package/src/constant.ts +20 -20
- package/src/defaultSession.spec.ts +20 -20
- package/src/defaultSession.ts +20 -20
- package/src/dependencies.node.spec.ts +20 -20
- package/src/dependencies.spec.ts +20 -20
- package/src/dependencies.ts +20 -20
- package/src/index.browser.spec.ts +20 -20
- package/src/index.browser.ts +20 -20
- package/src/index.spec.ts +20 -20
- package/src/index.ts +20 -20
- package/src/login/__mocks__/LoginHandler.ts +20 -20
- package/src/login/oidc/AggregateOidcHandler.spec.ts +20 -20
- package/src/login/oidc/AggregateOidcHandler.ts +20 -20
- package/src/login/oidc/AggregateRedirectHandler.ts +20 -20
- package/src/login/oidc/ClientRegistrar.spec.ts +20 -20
- package/src/login/oidc/ClientRegistrar.ts +20 -20
- package/src/login/oidc/IssuerConfigFetcher.spec.ts +20 -20
- package/src/login/oidc/IssuerConfigFetcher.ts +21 -25
- package/src/login/oidc/OidcLoginHandler.spec.ts +20 -20
- package/src/login/oidc/OidcLoginHandler.ts +20 -20
- package/src/login/oidc/Redirector.spec.ts +20 -20
- package/src/login/oidc/Redirector.ts +20 -20
- package/src/login/oidc/__mocks__/ClientRegistrar.ts +20 -20
- package/src/login/oidc/__mocks__/IOidcHandler.ts +20 -20
- package/src/login/oidc/__mocks__/IOidcOptions.ts +20 -20
- package/src/login/oidc/__mocks__/IssuerConfigFetcher.ts +20 -20
- package/src/login/oidc/__mocks__/Redirector.ts +20 -20
- package/src/login/oidc/incomingRedirectHandler/AuthCodeRedirectHandler.spec.ts +42 -20
- package/src/login/oidc/incomingRedirectHandler/AuthCodeRedirectHandler.ts +28 -20
- package/src/login/oidc/incomingRedirectHandler/ErrorOidcHandler.spec.ts +20 -20
- package/src/login/oidc/incomingRedirectHandler/ErrorOidcHandler.ts +20 -20
- package/src/login/oidc/incomingRedirectHandler/FallbackRedirectHandler.spec.ts +20 -20
- package/src/login/oidc/incomingRedirectHandler/FallbackRedirectHandler.ts +20 -20
- package/src/login/oidc/oidcHandlers/AuthorizationCodeWithPkceOidcHandler.spec.ts +20 -20
- package/src/login/oidc/oidcHandlers/AuthorizationCodeWithPkceOidcHandler.ts +20 -20
- package/src/login/oidc/oidcHandlers/OidcHandlerCanHandleTest.ts +20 -20
- package/src/login/oidc/refresh/TokenRefresher.spec.ts +20 -20
- package/src/login/oidc/refresh/TokenRefresher.ts +20 -20
- package/src/login/oidc/refresh/__mocks__/TokenRefresher.ts +20 -20
- package/src/logout/GeneralLogoutHandler.spec.ts +20 -20
- package/src/logout/GeneralLogoutHandler.ts +20 -20
- package/src/logout/__mocks__/LogoutHandler.ts +20 -20
- package/src/sessionInfo/SessionInfoManager.spec.ts +20 -20
- package/src/sessionInfo/SessionInfoManager.ts +20 -20
- package/src/sessionInfo/__mocks__/SessionInfoManager.ts +20 -20
- package/src/storage/BrowserStorage.spec.ts +20 -20
- package/src/storage/BrowserStorage.ts +20 -20
- package/src/storage/StorageUtility.ts +20 -20
- package/src/storage/__mocks__/LocalStorage.ts +20 -20
- package/src/util/UUIDGenerator.spec.ts +20 -20
- package/src/util/UuidGenerator.ts +20 -20
- package/src/util/__mocks__/UuidGenerator.ts +20 -20
- package/webpack.browser.js +20 -0
- package/webpack.common.js +20 -0
- package/webpack.config.js +20 -0
- package/webpack.dev.js +20 -0
- package/webpack.prod.js +20 -0
- package/.eslintrc.js +0 -4
- package/dist/util/urlPath.d.ts +0 -1
- package/dist/util/urlPath.js +0 -11
- package/dist/util/urlPath.js.map +0 -1
- package/src/util/urlPath.spec.ts +0 -55
- package/src/util/urlPath.ts +0 -41
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 Inrupt Inc.
|
|
3
|
+
//
|
|
4
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
// of this software and associated documentation files (the "Software"), to deal in
|
|
6
|
+
// the Software without restriction, including without limitation the rights to use,
|
|
7
|
+
// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
|
8
|
+
// Software, and to permit persons to whom the Software is furnished to do so,
|
|
9
|
+
// subject to the following conditions:
|
|
10
|
+
//
|
|
11
|
+
// The above copyright notice and this permission notice shall be included in
|
|
12
|
+
// all copies or substantial portions of the Software.
|
|
13
|
+
//
|
|
14
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
15
|
+
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
16
|
+
// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
17
|
+
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
18
|
+
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
19
|
+
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
20
|
+
//
|
|
21
21
|
|
|
22
22
|
import {
|
|
23
23
|
ISessionInfo,
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 Inrupt Inc.
|
|
3
|
+
//
|
|
4
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
// of this software and associated documentation files (the "Software"), to deal in
|
|
6
|
+
// the Software without restriction, including without limitation the rights to use,
|
|
7
|
+
// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
|
8
|
+
// Software, and to permit persons to whom the Software is furnished to do so,
|
|
9
|
+
// subject to the following conditions:
|
|
10
|
+
//
|
|
11
|
+
// The above copyright notice and this permission notice shall be included in
|
|
12
|
+
// all copies or substantial portions of the Software.
|
|
13
|
+
//
|
|
14
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
15
|
+
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
16
|
+
// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
17
|
+
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
18
|
+
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
19
|
+
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
20
|
+
//
|
|
21
21
|
|
|
22
22
|
import { describe, it, expect } from "@jest/globals";
|
|
23
23
|
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 Inrupt Inc.
|
|
3
|
+
//
|
|
4
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
// of this software and associated documentation files (the "Software"), to deal in
|
|
6
|
+
// the Software without restriction, including without limitation the rights to use,
|
|
7
|
+
// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
|
8
|
+
// Software, and to permit persons to whom the Software is furnished to do so,
|
|
9
|
+
// subject to the following conditions:
|
|
10
|
+
//
|
|
11
|
+
// The above copyright notice and this permission notice shall be included in
|
|
12
|
+
// all copies or substantial portions of the Software.
|
|
13
|
+
//
|
|
14
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
15
|
+
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
16
|
+
// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
17
|
+
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
18
|
+
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
19
|
+
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
20
|
+
//
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* @hidden
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 Inrupt Inc.
|
|
3
|
+
//
|
|
4
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
// of this software and associated documentation files (the "Software"), to deal in
|
|
6
|
+
// the Software without restriction, including without limitation the rights to use,
|
|
7
|
+
// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
|
8
|
+
// Software, and to permit persons to whom the Software is furnished to do so,
|
|
9
|
+
// subject to the following conditions:
|
|
10
|
+
//
|
|
11
|
+
// The above copyright notice and this permission notice shall be included in
|
|
12
|
+
// all copies or substantial portions of the Software.
|
|
13
|
+
//
|
|
14
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
15
|
+
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
16
|
+
// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
17
|
+
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
18
|
+
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
19
|
+
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
20
|
+
//
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* @hidden
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 Inrupt Inc.
|
|
3
|
+
//
|
|
4
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
// of this software and associated documentation files (the "Software"), to deal in
|
|
6
|
+
// the Software without restriction, including without limitation the rights to use,
|
|
7
|
+
// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
|
8
|
+
// Software, and to permit persons to whom the Software is furnished to do so,
|
|
9
|
+
// subject to the following conditions:
|
|
10
|
+
//
|
|
11
|
+
// The above copyright notice and this permission notice shall be included in
|
|
12
|
+
// all copies or substantial portions of the Software.
|
|
13
|
+
//
|
|
14
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
15
|
+
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
16
|
+
// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
17
|
+
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
18
|
+
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
19
|
+
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
20
|
+
//
|
|
21
21
|
|
|
22
22
|
export class LocalStorageMock {
|
|
23
23
|
public store: {
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 Inrupt Inc.
|
|
3
|
+
//
|
|
4
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
// of this software and associated documentation files (the "Software"), to deal in
|
|
6
|
+
// the Software without restriction, including without limitation the rights to use,
|
|
7
|
+
// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
|
8
|
+
// Software, and to permit persons to whom the Software is furnished to do so,
|
|
9
|
+
// subject to the following conditions:
|
|
10
|
+
//
|
|
11
|
+
// The above copyright notice and this permission notice shall be included in
|
|
12
|
+
// all copies or substantial portions of the Software.
|
|
13
|
+
//
|
|
14
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
15
|
+
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
16
|
+
// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
17
|
+
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
18
|
+
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
19
|
+
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
20
|
+
//
|
|
21
21
|
|
|
22
22
|
import { jest, it, describe, expect } from "@jest/globals";
|
|
23
23
|
import UuidGenerator from "./UuidGenerator";
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 Inrupt Inc.
|
|
3
|
+
//
|
|
4
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
// of this software and associated documentation files (the "Software"), to deal in
|
|
6
|
+
// the Software without restriction, including without limitation the rights to use,
|
|
7
|
+
// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
|
8
|
+
// Software, and to permit persons to whom the Software is furnished to do so,
|
|
9
|
+
// subject to the following conditions:
|
|
10
|
+
//
|
|
11
|
+
// The above copyright notice and this permission notice shall be included in
|
|
12
|
+
// all copies or substantial portions of the Software.
|
|
13
|
+
//
|
|
14
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
15
|
+
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
16
|
+
// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
17
|
+
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
18
|
+
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
19
|
+
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
20
|
+
//
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* @hidden
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 Inrupt Inc.
|
|
3
|
+
//
|
|
4
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
// of this software and associated documentation files (the "Software"), to deal in
|
|
6
|
+
// the Software without restriction, including without limitation the rights to use,
|
|
7
|
+
// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
|
8
|
+
// Software, and to permit persons to whom the Software is furnished to do so,
|
|
9
|
+
// subject to the following conditions:
|
|
10
|
+
//
|
|
11
|
+
// The above copyright notice and this permission notice shall be included in
|
|
12
|
+
// all copies or substantial portions of the Software.
|
|
13
|
+
//
|
|
14
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
15
|
+
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
16
|
+
// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
17
|
+
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
18
|
+
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
19
|
+
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
20
|
+
//
|
|
21
21
|
|
|
22
22
|
import { jest } from "@jest/globals";
|
|
23
23
|
import { IUuidGenerator } from "../UuidGenerator";
|
package/webpack.browser.js
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 Inrupt Inc.
|
|
3
|
+
//
|
|
4
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
// of this software and associated documentation files (the "Software"), to deal in
|
|
6
|
+
// the Software without restriction, including without limitation the rights to use,
|
|
7
|
+
// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
|
8
|
+
// Software, and to permit persons to whom the Software is furnished to do so,
|
|
9
|
+
// subject to the following conditions:
|
|
10
|
+
//
|
|
11
|
+
// The above copyright notice and this permission notice shall be included in
|
|
12
|
+
// all copies or substantial portions of the Software.
|
|
13
|
+
//
|
|
14
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
15
|
+
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
16
|
+
// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
17
|
+
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
18
|
+
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
19
|
+
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
20
|
+
//
|
|
1
21
|
const { merge } = require("webpack-merge");
|
|
2
22
|
const path = require("path");
|
|
3
23
|
|
package/webpack.common.js
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 Inrupt Inc.
|
|
3
|
+
//
|
|
4
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
// of this software and associated documentation files (the "Software"), to deal in
|
|
6
|
+
// the Software without restriction, including without limitation the rights to use,
|
|
7
|
+
// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
|
8
|
+
// Software, and to permit persons to whom the Software is furnished to do so,
|
|
9
|
+
// subject to the following conditions:
|
|
10
|
+
//
|
|
11
|
+
// The above copyright notice and this permission notice shall be included in
|
|
12
|
+
// all copies or substantial portions of the Software.
|
|
13
|
+
//
|
|
14
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
15
|
+
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
16
|
+
// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
17
|
+
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
18
|
+
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
19
|
+
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
20
|
+
//
|
|
1
21
|
module.exports = {
|
|
2
22
|
entry: "./src/index.browser.ts",
|
|
3
23
|
module: {
|
package/webpack.config.js
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 Inrupt Inc.
|
|
3
|
+
//
|
|
4
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
// of this software and associated documentation files (the "Software"), to deal in
|
|
6
|
+
// the Software without restriction, including without limitation the rights to use,
|
|
7
|
+
// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
|
8
|
+
// Software, and to permit persons to whom the Software is furnished to do so,
|
|
9
|
+
// subject to the following conditions:
|
|
10
|
+
//
|
|
11
|
+
// The above copyright notice and this permission notice shall be included in
|
|
12
|
+
// all copies or substantial portions of the Software.
|
|
13
|
+
//
|
|
14
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
15
|
+
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
16
|
+
// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
17
|
+
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
18
|
+
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
19
|
+
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
20
|
+
//
|
|
1
21
|
const { merge } = require("webpack-merge");
|
|
2
22
|
|
|
3
23
|
const commonConfig = require("./webpack.common.js");
|
package/webpack.dev.js
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 Inrupt Inc.
|
|
3
|
+
//
|
|
4
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
// of this software and associated documentation files (the "Software"), to deal in
|
|
6
|
+
// the Software without restriction, including without limitation the rights to use,
|
|
7
|
+
// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
|
8
|
+
// Software, and to permit persons to whom the Software is furnished to do so,
|
|
9
|
+
// subject to the following conditions:
|
|
10
|
+
//
|
|
11
|
+
// The above copyright notice and this permission notice shall be included in
|
|
12
|
+
// all copies or substantial portions of the Software.
|
|
13
|
+
//
|
|
14
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
15
|
+
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
16
|
+
// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
17
|
+
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
18
|
+
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
19
|
+
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
20
|
+
//
|
|
1
21
|
const path = require("path");
|
|
2
22
|
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
|
3
23
|
|
package/webpack.prod.js
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 Inrupt Inc.
|
|
3
|
+
//
|
|
4
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
// of this software and associated documentation files (the "Software"), to deal in
|
|
6
|
+
// the Software without restriction, including without limitation the rights to use,
|
|
7
|
+
// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
|
8
|
+
// Software, and to permit persons to whom the Software is furnished to do so,
|
|
9
|
+
// subject to the following conditions:
|
|
10
|
+
//
|
|
11
|
+
// The above copyright notice and this permission notice shall be included in
|
|
12
|
+
// all copies or substantial portions of the Software.
|
|
13
|
+
//
|
|
14
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
15
|
+
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
16
|
+
// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
17
|
+
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
18
|
+
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
19
|
+
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
20
|
+
//
|
|
1
21
|
module.exports = {
|
|
2
22
|
mode: "production",
|
|
3
23
|
};
|
package/.eslintrc.js
DELETED
package/dist/util/urlPath.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function appendToUrlPathname(url: string, append: string): string;
|
package/dist/util/urlPath.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.appendToUrlPathname = void 0;
|
|
4
|
-
function appendToUrlPathname(url, append) {
|
|
5
|
-
const parsedUrl = new URL(url);
|
|
6
|
-
const path = parsedUrl.pathname;
|
|
7
|
-
parsedUrl.pathname = `${path}${path.endsWith("/") ? "" : "/"}${append.startsWith("/") ? append.substring(1) : append}`;
|
|
8
|
-
return parsedUrl.toString();
|
|
9
|
-
}
|
|
10
|
-
exports.appendToUrlPathname = appendToUrlPathname;
|
|
11
|
-
//# sourceMappingURL=urlPath.js.map
|
package/dist/util/urlPath.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"urlPath.js","sourceRoot":"","sources":["../../src/util/urlPath.ts"],"names":[],"mappings":";;;AAgCA,SAAgB,mBAAmB,CAAC,GAAW,EAAE,MAAc;IAC7D,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;IAC/B,MAAM,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC;IAChC,SAAS,CAAC,QAAQ,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,GAC1D,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MACjD,EAAE,CAAC;IAEH,OAAO,SAAS,CAAC,QAAQ,EAAE,CAAC;AAC9B,CAAC;AARD,kDAQC"}
|
package/src/util/urlPath.spec.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2022 Inrupt Inc.
|
|
3
|
-
*
|
|
4
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
-
* of this software and associated documentation files (the "Software"), to deal in
|
|
6
|
-
* the Software without restriction, including without limitation the rights to use,
|
|
7
|
-
* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
|
8
|
-
* Software, and to permit persons to whom the Software is furnished to do so,
|
|
9
|
-
* subject to the following conditions:
|
|
10
|
-
*
|
|
11
|
-
* The above copyright notice and this permission notice shall be included in
|
|
12
|
-
* all copies or substantial portions of the Software.
|
|
13
|
-
*
|
|
14
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
15
|
-
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
16
|
-
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
17
|
-
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
18
|
-
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
19
|
-
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
import { describe, it, expect } from "@jest/globals";
|
|
23
|
-
import { appendToUrlPathname } from "./urlPath";
|
|
24
|
-
|
|
25
|
-
describe("urlPath", () => {
|
|
26
|
-
it("should remove one slash if empty path", () => {
|
|
27
|
-
expect(appendToUrlPathname("https://ex.com/", "/test")).toBe(
|
|
28
|
-
"https://ex.com/test"
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
expect(
|
|
32
|
-
appendToUrlPathname("https://ex.com/", "////only-remove-one-slash")
|
|
33
|
-
).toBe("https://ex.com////only-remove-one-slash");
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
it("should remove one slash if non-empty path", () => {
|
|
37
|
-
expect(appendToUrlPathname("https://ex.com/a/", "/test")).toBe(
|
|
38
|
-
"https://ex.com/a/test"
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
expect(
|
|
42
|
-
appendToUrlPathname("https://ex.com/a/", "////only-remove-one-slash")
|
|
43
|
-
).toBe("https://ex.com/a////only-remove-one-slash");
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
it("should add a slash before appending slash", () => {
|
|
47
|
-
expect(appendToUrlPathname("https://ex.com", "test")).toBe(
|
|
48
|
-
"https://ex.com/test"
|
|
49
|
-
);
|
|
50
|
-
|
|
51
|
-
expect(appendToUrlPathname("https://ex.com/a", "test")).toBe(
|
|
52
|
-
"https://ex.com/a/test"
|
|
53
|
-
);
|
|
54
|
-
});
|
|
55
|
-
});
|
package/src/util/urlPath.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2022 Inrupt Inc.
|
|
3
|
-
*
|
|
4
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
-
* of this software and associated documentation files (the "Software"), to deal in
|
|
6
|
-
* the Software without restriction, including without limitation the rights to use,
|
|
7
|
-
* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
|
8
|
-
* Software, and to permit persons to whom the Software is furnished to do so,
|
|
9
|
-
* subject to the following conditions:
|
|
10
|
-
*
|
|
11
|
-
* The above copyright notice and this permission notice shall be included in
|
|
12
|
-
* all copies or substantial portions of the Software.
|
|
13
|
-
*
|
|
14
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
15
|
-
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
16
|
-
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
17
|
-
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
18
|
-
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
19
|
-
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* @hidden
|
|
24
|
-
* @packageDocumentation
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Utility that appends the specified value to end of the specified URL's path.
|
|
29
|
-
*
|
|
30
|
-
* @param url the URL to whose path we append the specified value
|
|
31
|
-
* @param append the value to append to the URL's path
|
|
32
|
-
*/
|
|
33
|
-
export function appendToUrlPathname(url: string, append: string): string {
|
|
34
|
-
const parsedUrl = new URL(url);
|
|
35
|
-
const path = parsedUrl.pathname;
|
|
36
|
-
parsedUrl.pathname = `${path}${path.endsWith("/") ? "" : "/"}${
|
|
37
|
-
append.startsWith("/") ? append.substring(1) : append
|
|
38
|
-
}`;
|
|
39
|
-
|
|
40
|
-
return parsedUrl.toString();
|
|
41
|
-
}
|