diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b512c09 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/node_modules/.bin/esbuild b/node_modules/.bin/esbuild deleted file mode 120000 index c83ac07..0000000 --- a/node_modules/.bin/esbuild +++ /dev/null @@ -1 +0,0 @@ -../esbuild/bin/esbuild \ No newline at end of file diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json deleted file mode 100644 index b25faa6..0000000 --- a/node_modules/.package-lock.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "name": "keycloak-admin-client-cjs", - "version": "24.0.4", - "lockfileVersion": 3, - "requires": true, - "packages": { - "node_modules/@esbuild/darwin-arm64": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.3.tgz", - "integrity": "sha512-U3fuQ0xNiAkXOmQ6w5dKpEvXQRSpHOnbw7gEfHCRXPeTKW9sBzVck6C5Yneb8LfJm0l6le4NQfkNPnWMSlTFUQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@keycloak/keycloak-admin-client": { - "version": "24.0.4", - "resolved": "https://registry.npmjs.org/@keycloak/keycloak-admin-client/-/keycloak-admin-client-24.0.4.tgz", - "integrity": "sha512-2edCUgTcTZg4YBJOH/oQoAyfA2MInMrrEJTid5YQpbk1R5awUhgcswQYSFsiWQEiOOYelaApO/eUt8MZqxpRGA==", - "license": "Apache-2.0", - "dependencies": { - "camelize-ts": "^3.0.0", - "url-join": "^5.0.0", - "url-template": "^3.1.1" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/camelize-ts": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camelize-ts/-/camelize-ts-3.0.0.tgz", - "integrity": "sha512-cgRwKKavoDKLTjO4FQTs3dRBePZp/2Y9Xpud0FhuCOTE86M2cniKN4CCXgRnsyXNMmQMifVHcv6SPaMtTx6ofQ==", - "license": "MIT", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, - "node_modules/esbuild": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.3.tgz", - "integrity": "sha512-Kgq0/ZsAPzKrbOjCQcjoSmPoWhlcVnGAUo7jvaLHoxW1Drto0KGkR1xBNg2Cp43b9ImvxmPEJZ9xkfcnqPsfBw==", - "dev": true, - "hasInstallScript": true, - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=12" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.21.3", - "@esbuild/android-arm": "0.21.3", - "@esbuild/android-arm64": "0.21.3", - "@esbuild/android-x64": "0.21.3", - "@esbuild/darwin-arm64": "0.21.3", - "@esbuild/darwin-x64": "0.21.3", - "@esbuild/freebsd-arm64": "0.21.3", - "@esbuild/freebsd-x64": "0.21.3", - "@esbuild/linux-arm": "0.21.3", - "@esbuild/linux-arm64": "0.21.3", - "@esbuild/linux-ia32": "0.21.3", - "@esbuild/linux-loong64": "0.21.3", - "@esbuild/linux-mips64el": "0.21.3", - "@esbuild/linux-ppc64": "0.21.3", - "@esbuild/linux-riscv64": "0.21.3", - "@esbuild/linux-s390x": "0.21.3", - "@esbuild/linux-x64": "0.21.3", - "@esbuild/netbsd-x64": "0.21.3", - "@esbuild/openbsd-x64": "0.21.3", - "@esbuild/sunos-x64": "0.21.3", - "@esbuild/win32-arm64": "0.21.3", - "@esbuild/win32-ia32": "0.21.3", - "@esbuild/win32-x64": "0.21.3" - } - }, - "node_modules/url-join": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/url-join/-/url-join-5.0.0.tgz", - "integrity": "sha512-n2huDr9h9yzd6exQVnH/jU5mr+Pfx08LRXXZhkLLetAMESRj+anQsTAh940iMrIetKAmry9coFuZQ2jY8/p3WA==", - "license": "MIT", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, - "node_modules/url-template": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/url-template/-/url-template-3.1.1.tgz", - "integrity": "sha512-4oszoaEKE/mQOtAmdMWqIRHmkxWkUZMnXFnjQ5i01CuRSK3uluxcH1MRVVVWmhlnzT1SCDfKxxficm2G37qzCA==", - "license": "BSD-3-Clause", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - } - } -} diff --git a/node_modules/.yarn-integrity b/node_modules/.yarn-integrity deleted file mode 100644 index 9428930..0000000 --- a/node_modules/.yarn-integrity +++ /dev/null @@ -1,19 +0,0 @@ -{ - "systemParams": "darwin-arm64-115", - "modulesFolders": [ - "node_modules" - ], - "flags": [], - "linkedModules": [], - "topLevelPatterns": [ - "@keycloak/keycloak-admin-client@24.0.4" - ], - "lockfileEntries": { - "@keycloak/keycloak-admin-client@24.0.4": "https://registry.yarnpkg.com/@keycloak/keycloak-admin-client/-/keycloak-admin-client-24.0.4.tgz#61d42ad037fcec8b836a79cb5a1959451d143816", - "camelize-ts@^3.0.0": "https://registry.yarnpkg.com/camelize-ts/-/camelize-ts-3.0.0.tgz#b9a7b4ff802464dc3d6475637a64a9742ad3db09", - "url-join@^5.0.0": "https://registry.yarnpkg.com/url-join/-/url-join-5.0.0.tgz#c2f1e5cbd95fa91082a93b58a1f42fecb4bdbcf1", - "url-template@^3.1.1": "https://registry.yarnpkg.com/url-template/-/url-template-3.1.1.tgz#c220d5f3f793d28b0de341002112879cc8a43905" - }, - "files": [], - "artifacts": {} -} \ No newline at end of file diff --git a/node_modules/@esbuild/darwin-arm64/README.md b/node_modules/@esbuild/darwin-arm64/README.md deleted file mode 100644 index c2c0398..0000000 --- a/node_modules/@esbuild/darwin-arm64/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# esbuild - -This is the macOS ARM 64-bit binary for esbuild, a JavaScript bundler and minifier. See https://github.com/evanw/esbuild for details. diff --git a/node_modules/@esbuild/darwin-arm64/bin/esbuild b/node_modules/@esbuild/darwin-arm64/bin/esbuild deleted file mode 100755 index f95d333..0000000 Binary files a/node_modules/@esbuild/darwin-arm64/bin/esbuild and /dev/null differ diff --git a/node_modules/@esbuild/darwin-arm64/package.json b/node_modules/@esbuild/darwin-arm64/package.json deleted file mode 100644 index 54ca4b7..0000000 --- a/node_modules/@esbuild/darwin-arm64/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@esbuild/darwin-arm64", - "version": "0.21.3", - "description": "The macOS ARM 64-bit binary for esbuild, a JavaScript bundler.", - "repository": { - "type": "git", - "url": "git+https://github.com/evanw/esbuild.git" - }, - "license": "MIT", - "preferUnplugged": true, - "engines": { - "node": ">=12" - }, - "os": [ - "darwin" - ], - "cpu": [ - "arm64" - ] -} diff --git a/node_modules/@keycloak/keycloak-admin-client/LICENSE b/node_modules/@keycloak/keycloak-admin-client/LICENSE deleted file mode 100644 index 261eeb9..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/node_modules/@keycloak/keycloak-admin-client/README.md b/node_modules/@keycloak/keycloak-admin-client/README.md deleted file mode 100644 index 5ec4249..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/README.md +++ /dev/null @@ -1,459 +0,0 @@ -## Keycloak Admin Client - -## Features - -- TypeScript supported -- Latest Keycloak version supported -- [Complete resource definitions](./src/defs) -- [Well-tested for supported APIs](./test) - -## Install - -```sh -npm install @keycloak/keycloak-admin-client -``` - -## Usage - -```js -import KcAdminClient from '@keycloak/keycloak-admin-client'; - -// To configure the client, pass an object to override any of these options: -// { -// baseUrl: 'http://127.0.0.1:8080', -// realmName: 'master', -// requestOptions: { -// /* Fetch request options https://developer.mozilla.org/en-US/docs/Web/API/fetch#options */ -// }, -// } -const kcAdminClient = new KcAdminClient(); - -// Authorize with username / password -await kcAdminClient.auth({ - username: 'admin', - password: 'admin', - grantType: 'password', - clientId: 'admin-cli', - totp: '123456', // optional Time-based One-time Password if OTP is required in authentication flow -}); - -// List first page of users -const users = await kcAdminClient.users.find({ first: 0, max: 10 }); - -// find users by attributes -const users = await kcAdminClient.users.find({ q: "phone:123" }); - -// Override client configuration for all further requests: -kcAdminClient.setConfig({ - realmName: 'another-realm', -}); - -// This operation will now be performed in 'another-realm' if the user has access. -const groups = await kcAdminClient.groups.find(); - -// Set a `realm` property to override the realm for only a single operation. -// For example, creating a user in another realm: -await this.kcAdminClient.users.create({ - realm: 'a-third-realm', - username: 'username', - email: 'user@example.com', -}); -``` - -To refresh the access token provided by Keycloak, an OpenID client like [panva/node-openid-client](https://github.com/panva/node-openid-client) can be used like this: - -```js -import {Issuer} from 'openid-client'; - -const keycloakIssuer = await Issuer.discover( - 'http://localhost:8080/realms/master', -); - -const client = new keycloakIssuer.Client({ - client_id: 'admin-cli', // Same as `clientId` passed to client.auth() - token_endpoint_auth_method: 'none', // to send only client_id in the header -}); - -// Use the grant type 'password' -let tokenSet = await client.grant({ - grant_type: 'password', - username: 'admin', - password: 'admin', -}); - -// Periodically using refresh_token grant flow to get new access token here -setInterval(async () => { - const refreshToken = tokenSet.refresh_token; - tokenSet = await client.refresh(refreshToken); - kcAdminClient.setAccessToken(tokenSet.access_token); -}, 58 * 1000); // 58 seconds -``` - -In cases where you don't have a refresh token, eg. in a client credentials flow, you can simply call `kcAdminClient.auth` to get a new access token, like this: - -```js -const credentials = { - grantType: 'client_credentials', - clientId: 'clientId', - clientSecret: 'some-client-secret-uuid', -}; -await kcAdminClient.auth(credentials); - -setInterval(() => kcAdminClient.auth(credentials), 58 * 1000); // 58 seconds -``` - -## Building and running the tests - -To build the source do a build: - -```bash -pnpm run build -``` - -Start the Keycloak server: - -```bash -pnpm run server:start -``` - -If you started your container manually make sure there is an admin user named 'admin' with password 'admin'. -Then start the tests with: - -```bash -pnpm test -``` - -## Supported APIs - -### [Realm admin](https://www.keycloak.org/docs-api/20.0.2/rest-api/index.html#_realms_admin_resource) - -Demo code: https://github.com/keycloak/keycloak/blob/main/js/libs/keycloak-admin-client/test/realms.spec.ts - -- Import a realm from a full representation of that realm (`POST /`) -- Get the top-level representation of the realm (`GET /{realm}`) -- Update the top-level information of the realm (`PUT /{realm}`) -- Delete the realm (`DELETE /{realm}`) -- Partial export of existing realm into a JSON file (`POST /{realm}/partial-export`) -- Get users management permissions (`GET /{realm}/users-management-permissions`) -- Enable users management permissions (`PUT /{realm}/users-management-permissions`) -- Get events (`GET /{realm}/events`) -- Get admin events (`GET /{realm}/admin-events`) -- Remove all user sessions (`POST /{realm}/logout-all`) -- Remove a specific user session (`DELETE /{realm}/sessions/{session}`) -- Get client policies policies (`GET /{realm}/client-policies/policies`) -- Update client policies policies (`PUT /{realm}/client-policies/policies`) -- Get client policies profiles (`GET /{realm}/client-policies/profiles`) -- Update client policies profiles (`PUT /{realm}/client-policies/profiles`) -- Get a group by path (`GET /{realm}/group-by-path/{path}`) -### [Role](https://www.keycloak.org/docs-api/20.0.2/rest-api/index.html#_roles_resource) - -Demo code: https://github.com/keycloak/keycloak/blob/main/js/libs/keycloak-admin-client/test/roles.spec.ts - -- Create a new role for the realm (`POST /{realm}/roles`) -- Get all roles for the realm (`GET /{realm}/roles`) -- Get a role by name (`GET /{realm}/roles/{role-name}`) -- Update a role by name (`PUT /{realm}/roles/{role-name}`) -- Delete a role by name (`DELETE /{realm}/roles/{role-name}`) -- Get all users in a role by name for the realm (`GET /{realm}/roles/{role-name}/users`) - -### [Roles (by ID)](https://www.keycloak.org/docs-api/20.0.2/rest-api/index.html#_roles_by_id_resource) - -- Get a specific role (`GET /{realm}/roles-by-id/{role-id}`) -- Update the role (`PUT /{realm}/roles-by-id/{role-id}`) -- Delete the role (`DELETE /{realm}/roles-by-id/{role-id}`) -- Make the role a composite role by associating some child roles(`POST /{realm}/roles-by-id/{role-id}/composites`) -- Get role’s children Returns a set of role’s children provided the role is a composite. (`GET /{realm}/roles-by-id/{role-id}/composites`) -- Remove a set of roles from the role’s composite (`DELETE /{realm}/roles-by-id/{role-id}/composites`) -- Get client-level roles for the client that are in the role’s composite (`GET /{realm}/roles-by-id/{role-id}/composites/clients/{client}`) -- Get realm-level roles that are in the role’s composite (`GET /{realm}/roles-by-id/{role-id}/composites/realm`) - -### [User](https://www.keycloak.org/docs-api/20.0.2/rest-api/index.html#_users_resource) - -Demo code: https://github.com/keycloak/keycloak/blob/main/js/libs/keycloak-admin-client/test/users.spec.ts - -- Create a new user (`POST /{realm}/users`) -- Get users Returns a list of users, filtered according to query parameters (`GET /{realm}/users`) -- Get representation of the user (`GET /{realm}/users/{id}`) -- Update the user (`PUT /{realm}/users/{id}`) -- Delete the user (`DELETE /{realm}/users/{id}`) -- Count users (`GET /{realm}/users/count`) -- Send a update account email to the user An email contains a link the user can click to perform a set of required actions. (`PUT /{realm}/users/{id}/execute-actions-email`) -- Get user groups (`GET /{realm}/users/{id}/groups`) -- Add user to group (`PUT /{realm}/users/{id}/groups/{groupId}`) -- Delete user from group (`DELETE /{realm}/users/{id}/groups/{groupId}`) -- Remove TOTP from the user (`PUT /{realm}/users/{id}/remove-totp`) -- Set up a temporary password for the user User will have to reset the temporary password next time they log in. (`PUT /{realm}/users/{id}/reset-password`) -- Send an email-verification email to the user An email contains a link the user can click to verify their email address. (`PUT /{realm}/users/{id}/send-verify-email`) -- Update a credential label for a user (`PUT /{realm}/users/{id}/credentials/{credentialId}/userLabel`) -- Move a credential to a position behind another credential (`POST /{realm}/users/{id}/credentials/{credentialId}/moveAfter/{newPreviousCredentialId}`) -- Move a credential to a first position in the credentials list of the user (`PUT /{realm}/users/{id}/credentials/{credentialId}/moveToFirst`) - -### User group-mapping - -Demo code: https://github.com/keycloak/keycloak/blob/main/js/libs/keycloak-admin-client/test/users.spec.ts#L178 - -- Add user to group (`PUT /{id}/groups/{groupId}`) -- List all user groups (`GET /{id}/groups`) -- Count user groups (`GET /{id}/groups/count`) -- Remove user from group (`DELETE /{id}/groups/{groupId}`) - -### User role-mapping - -Demo code: https://github.com/keycloak/keycloak/blob/main/js/libs/keycloak-admin-client/test/users.spec.ts#L352 - -- Get user role-mappings (`GET /{realm}/users/{id}/role-mappings`) -- Add realm-level role mappings to the user (`POST /{realm}/users/{id}/role-mappings/realm`) -- Get realm-level role mappings (`GET /{realm}/users/{id}/role-mappings/realm`) -- Delete realm-level role mappings (`DELETE /{realm}/users/{id}/role-mappings/realm`) -- Get realm-level roles that can be mapped (`GET /{realm}/users/{id}/role-mappings/realm/available`) -- Get effective realm-level role mappings This will recurse all composite roles to get the result. (`GET /{realm}/users/{id}/role-mappings/realm/composite`) - -### [Group](https://www.keycloak.org/docs-api/20.0.2/rest-api/index.html#_groups_resource) - -Demo code: https://github.com/keycloak/keycloak/blob/main/js/libs/keycloak-admin-client/test/groups.spec.ts - -- Create (`POST /{realm}/groups`) -- List (`GET /{realm}/groups`) -- Get one (`GET /{realm}/groups/{id}`) -- Update (`PUT /{realm}/groups/{id}`) -- Delete (`DELETE /{realm}/groups/{id}`) -- Count (`GET /{realm}/groups/count`) -- List members (`GET /{realm}/groups/{id}/members`) -- Set or create child (`POST /{realm}/groups/{id}/children`) -- Get children (`GET /{realm}/groups/{id}/children`) - -### Group role-mapping - -Demo code: https://github.com/keycloak/keycloak/blob/main/js/libs/keycloak-admin-client/test/groups.spec.ts#L103 - -- Get group role-mappings (`GET /{realm}/groups/{id}/role-mappings`) -- Add realm-level role mappings to the group (`POST /{realm}/groups/{id}/role-mappings/realm`) -- Get realm-level role mappings (`GET /{realm}/groups/{id}/role-mappings/realm`) -- Delete realm-level role mappings (`DELETE /{realm}/groups/{id}/role-mappings/realm`) -- Get realm-level roles that can be mapped (`GET /{realm}/groups/{id}/role-mappings/realm/available`) -- Get effective realm-level role mappings This will recurse all composite roles to get the result. (`GET /{realm}/groups/{id}/role-mappings/realm/composite`) - -### [Client](https://www.keycloak.org/docs-api/20.0.2/rest-api/index.html#_clients_resource) - -Demo code: https://github.com/keycloak/keycloak/blob/main/js/libs/keycloak-admin-client/test/clients.spec.ts - -- Create a new client (`POST /{realm}/clients`) -- Get clients belonging to the realm (`GET /{realm}/clients`) -- Get representation of the client (`GET /{realm}/clients/{id}`) -- Update the client (`PUT /{realm}/clients/{id}`) -- Delete the client (`DELETE /{realm}/clients/{id}`) - -### [Client roles](https://www.keycloak.org/docs-api/20.0.2/rest-api/index.html#_roles_resource) - -Demo code: https://github.com/keycloak/keycloak/blob/main/js/libs/keycloak-admin-client/test/clients.spec.ts - -- Create a new role for the client (`POST /{realm}/clients/{id}/roles`) -- Get all roles for the client (`GET /{realm}/clients/{id}/roles`) -- Get a role by name (`GET /{realm}/clients/{id}/roles/{role-name}`) -- Update a role by name (`PUT /{realm}/clients/{id}/roles/{role-name}`) -- Delete a role by name (`DELETE /{realm}/clients/{id}/roles/{role-name}`) - -### [Client role-mapping for group](https://www.keycloak.org/docs-api/20.0.2/rest-api/index.html#_client_role_mappings_resource) - -Demo code: https://github.com/keycloak/keycloak/blob/main/js/libs/keycloak-admin-client/test/groups.spec.ts#L192 - -- Add client-level roles to the group role mapping (`POST /{realm}/groups/{id}/role-mappings/clients/{client}`) -- Get client-level role mappings for the group (`GET /{realm}/groups/{id}/role-mappings/clients/{client}`) -- Delete client-level roles from group role mapping (`DELETE /{realm}/groups/{id}/role-mappings/clients/{client}`) -- Get available client-level roles that can be mapped to the group (`GET /{realm}/groups/{id}/role-mappings/clients/{client}/available`) -- Get effective client-level role mappings This will recurse all composite roles to get the result. (`GET /{realm}/groups/{id}/role-mappings/clients/{client}/composite`) - -### [Client role-mapping for user](https://www.keycloak.org/docs-api/20.0.2/rest-api/index.html#_client_role_mappings_resource) - -Demo code: https://github.com/keycloak/keycloak/blob/main/js/libs/keycloak-admin-client/test/users.spec.ts#L352 - -- Add client-level roles to the user role mapping (`POST /{realm}/users/{id}/role-mappings/clients/{client}`) -- Get client-level role mappings for the user (`GET /{realm}/users/{id}/role-mappings/clients/{client}`) -- Delete client-level roles from user role mapping (`DELETE /{realm}/users/{id}/role-mappings/clients/{client}`) -- Get available client-level roles that can be mapped to the user (`GET /{realm}/users/{id}/role-mappings/clients/{client}/available`) -- Get effective client-level role mappings This will recurse all composite roles to get the result. (`GET /{realm}/users/{id}/role-mappings/clients/{client}/composite`) - -### [Client Attribute Certificate](https://www.keycloak.org/docs-api/20.0.2/rest-api/index.html#_client_attribute_certificate_resource) - -- Get key info (`GET /{realm}/clients/{id}/certificates/{attr}`) -- Get a keystore file for the client, containing private key and public certificate (`POST /{realm}/clients/{id}/certificates/{attr}/download`) -- Generate a new certificate with new key pair (`POST /{realm}/clients/{id}/certificates/{attr}/generate`) -- Generate a new keypair and certificate, and get the private key file Generates a keypair and certificate and serves the private key in a specified keystore format. (`POST /{realm}/clients/{id}/certificates/{attr}/generate-and-download`) -- Upload certificate and eventually private key (`POST /{realm}/clients/{id}/certificates/{attr}/upload`) -- Upload only certificate, not private key (`POST /{realm}/clients/{id}/certificates/{attr}/upload-certificate`) - -### [Identity Providers](https://www.keycloak.org/docs-api/20.0.2/rest-api/index.html#_identity_providers_resource) - -Demo code: https://github.com/keycloak/keycloak/blob/main/js/libs/keycloak-admin-client/test/idp.spec.ts - -- Create a new identity provider (`POST /{realm}/identity-provider/instances`) -- Get identity providers (`GET /{realm}/identity-provider/instances`) -- Get the identity provider (`GET /{realm}/identity-provider/instances/{alias}`) -- Update the identity provider (`PUT /{realm}/identity-provider/instances/{alias}`) -- Delete the identity provider (`DELETE /{realm}/identity-provider/instances/{alias}`) -- Find identity provider factory (`GET /{realm}/identity-provider/providers/{providerId}`) -- Create a new identity provider mapper (`POST /{realm}/identity-provider/instances/{alias}/mappers`) -- Get identity provider mappers (`GET /{realm}/identity-provider/instances/{alias}/mappers`) -- Get the identity provider mapper (`GET /{realm}/identity-provider/instances/{alias}/mappers/{id}`) -- Update the identity provider mapper (`PUT /{realm}/identity-provider/instances/{alias}/mappers/{id}`) -- Delete the identity provider mapper (`DELETE /{realm}/identity-provider/instances/{alias}/mappers/{id}`) -- Find the identity provider mapper types (`GET /{realm}/identity-provider/instances/{alias}/mapper-types`) - -### [Client Scopes](https://www.keycloak.org/docs-api/20.0.2/rest-api/index.html#_client_scopes_resource) - -Demo code: https://github.com/keycloak/keycloak/blob/main/js/libs/keycloak-admin-client/test/clientScopes.spec.ts - -- Create a new client scope (`POST /{realm}/client-scopes`) -- Get client scopes belonging to the realm (`GET /{realm}/client-scopes`) -- Get representation of the client scope (`GET /{realm}/client-scopes/{id}`) -- Update the client scope (`PUT /{realm}/client-scopes/{id}`) -- Delete the client scope (`DELETE /{realm}/client-scopes/{id}`) - -### [Client Scopes for realm](https://www.keycloak.org/docs-api/20.0.2/rest-api/index.html#_client_scopes_resource) - -Demo code: https://github.com/keycloak/keycloak/blob/main/js/libs/keycloak-admin-client/test/clientScopes.spec.ts - -- Get realm default client scopes (`GET /{realm}/default-default-client-scopes`) -- Add realm default client scope (`PUT /{realm}/default-default-client-scopes/{id}`) -- Delete realm default client scope (`DELETE /{realm}/default-default-client-scopes/{id}`) -- Get realm optional client scopes (`GET /{realm}/default-optional-client-scopes`) -- Add realm optional client scope (`PUT /{realm}/default-optional-client-scopes/{id}`) -- Delete realm optional client scope (`DELETE /{realm}/default-optional-client-scopes/{id}`) - -### [Client Scopes for client](https://www.keycloak.org/docs-api/20.0.2/rest-api/index.html#_client_scopes_resource) - -Demo code: https://github.com/keycloak/keycloak/blob/main/js/libs/keycloak-admin-client/test/clientScopes.spec.ts - -- Get default client scopes (`GET /{realm}/clients/{id}/default-client-scopes`) -- Add default client scope (`PUT /{realm}/clients/{id}/default-client-scopes/{clientScopeId}`) -- Delete default client scope (`DELETE /{realm}/clients/{id}/default-client-scopes/{clientScopeId}`) -- Get optional client scopes (`GET /{realm}/clients/{id}/optional-client-scopes`) -- Add optional client scope (`PUT /{realm}/clients/{id}/optional-client-scopes/{clientScopeId}`) -- Delete optional client scope (`DELETE /{realm}/clients/{id}/optional-client-scopes/{clientScopeId}`) - -### [Scope Mappings for client scopes](https://www.keycloak.org/docs-api/20.0.2/rest-api/index.html#_scope_mappings_resource) - -Demo code: https://github.com/keycloak/keycloak/blob/main/js/libs/keycloak-admin-client/test/clientScopes.spec.ts - -- Get all scope mappings for the client (`GET /{realm}/client-scopes/{id}/scope-mappings`) -- Add client-level roles to the client’s scope (`POST /{realm}/client-scopes/{id}/scope-mappings/clients/{client}`) -- Get the roles associated with a client’s scope (`GET /{realm}/client-scopes/{id}/scope-mappings/clients/{client}`) -- The available client-level roles (`GET /{realm}/client-scopes/{id}/scope-mappings/clients/{client}/available`) -- Get effective client roles (`GET /{realm}/client-scopes/{id}/scope-mappings/clients/{client}/composite`) -- Remove client-level roles from the client’s scope. (`DELETE /{realm}/client-scopes/{id}/scope-mappings/clients/{client}`) -- Add a set of realm-level roles to the client’s scope (`POST /{realm}/client-scopes/{id}/scope-mappings/realm`) -- Get realm-level roles associated with the client’s scope (`GET /{realm}/client-scopes/{id}/scope-mappings/realm`) -- Remove a set of realm-level roles from the client’s scope (`DELETE /{realm}/client-scopes/{id}/scope-mappings/realm`) -- Get realm-level roles that are available to attach to this client’s scope (`GET /{realm}/client-scopes/{id}/scope-mappings/realm/available`) -- Get effective realm-level roles associated with the client’s scope (`GET /{realm}/client-scopes/{id}/scope-mappings/realm/composite`) - -### [Scope Mappings for clients](https://www.keycloak.org/docs-api/20.0.2/rest-api/index.html#_scope_mappings_resource) - -Demo code: https://github.com/keycloak/keycloak/blob/main/js/libs/keycloak-admin-client/test/clientScopes.spec.ts - -- Get all scope mappings for the client (`GET /{realm}/clients/{id}/scope-mappings`) -- Add client-level roles to the client’s scope (`POST /{realm}/clients/{id}/scope-mappings/clients/{client}`) -- Get the roles associated with a client’s scope (`GET /{realm}/clients/{id}/scope-mappings/clients/{client}`) -- Remove client-level roles from the client’s scope. (`DELETE /{realm}/clients/{id}/scope-mappings/clients/{client}`) -- The available client-level roles (`GET /{realm}/clients/{id}/scope-mappings/clients/{client}/available`) -- Get effective client roles (`GET /{realm}/clients/{id}/scope-mappings/clients/{client}/composite`) -- Add a set of realm-level roles to the client’s scope (`POST /{realm}/clients/{id}/scope-mappings/realm`) -- Get realm-level roles associated with the client’s scope (`GET /{realm}/clients/{id}/scope-mappings/realm`) -- Remove a set of realm-level roles from the client’s scope (`DELETE /{realm}/clients/{id}/scope-mappings/realm`) -- Get realm-level roles that are available to attach to this client’s scope (`GET /{realm}/clients/{id}/scope-mappings/realm/available`) -- Get effective realm-level roles associated with the client’s scope (`GET /{realm}/clients/{id}/scope-mappings/realm/composite`) - -### [Protocol Mappers for client scopes](https://www.keycloak.org/docs-api/20.0.2/rest-api/index.html#_protocol_mappers_resource) - -Demo code: https://github.com/keycloak/keycloak/blob/main/js/libs/keycloak-admin-client/test/clientScopes.spec.ts - -- Create multiple mappers (`POST /{realm}/client-scopes/{id}/protocol-mappers/add-models`) -- Create a mapper (`POST /{realm}/client-scopes/{id}/protocol-mappers/models`) -- Get mappers (`GET /{realm}/client-scopes/{id}/protocol-mappers/models`) -- Get mapper by id (`GET /{realm}/client-scopes/{id}/protocol-mappers/models/{mapperId}`) -- Update the mapper (`PUT /{realm}/client-scopes/{id}/protocol-mappers/models/{mapperId}`) -- Delete the mapper (`DELETE /{realm}/client-scopes/{id}/protocol-mappers/models/{mapperId}`) -- Get mappers by name for a specific protocol (`GET /{realm}/client-scopes/{id}/protocol-mappers/protocol/{protocol}`) - -### [Protocol Mappers for clients](https://www.keycloak.org/docs-api/20.0.2/rest-api/index.html#_protocol_mappers_resource) - -Demo code: https://github.com/keycloak/keycloak/blob/main/js/libs/keycloak-admin-client/test/clients.spec.ts - -- Create multiple mappers (`POST /{realm}/clients/{id}/protocol-mappers/add-models`) -- Create a mapper (`POST /{realm}/clients/{id}/protocol-mappers/models`) -- Get mappers (`GET /{realm}/clients/{id}/protocol-mappers/models`) -- Get mapper by id (`GET /{realm}/clients/{id}/protocol-mappers/models/{mapperId}`) -- Update the mapper (`PUT /{realm}/clients/{id}/protocol-mappers/models/{mapperId}`) -- Delete the mapper (`DELETE /{realm}/clients/{id}/protocol-mappers/models/{mapperId}`) -- Get mappers by name for a specific protocol (`GET /{realm}/clients/{id}/protocol-mappers/protocol/{protocol}`) - -### [Component]() - -Supported for [user federation](https://www.keycloak.org/docs/latest/server_admin/index.html#_user-storage-federation). Demo code: https://github.com/keycloak/keycloak/blob/main/js/libs/keycloak-admin-client/test/components.spec.ts - -- Create (`POST /{realm}/components`) -- List (`GET /{realm}/components`) -- Get (`GET /{realm}/components/{id}`) -- Update (`PUT /{realm}/components/{id}`) -- Delete (`DELETE /{realm}/components/{id}`) - -### [Sessions for clients]() - -Demo code: https://github.com/keycloak/keycloak/blob/main/js/libs/keycloak-admin-client/test/clients.spec.ts - -- List user sessions for a specific client (`GET /{realm}/clients/{id}/user-sessions`) -- List offline sessions for a specific client (`GET /{realm}/clients/{id}/offline-sessions`) -- Get user session count for a specific client (`GET /{realm}/clients/{id}/session-count`) -- List offline session count for a specific client (`GET /{realm}/clients/{id}/offline-session-count`) - -### [Authentication Management: Required actions](https://www.keycloak.org/docs-api/20.0.2/rest-api/index.html#_authentication_management_resource) - -Demo code: https://github.com/keycloak/keycloak/blob/main/js/libs/keycloak-admin-client/test/authenticationManagement.spec.ts - -- Register a new required action (`POST /{realm}/authentication/register-required-action`) -- Get required actions. Returns a list of required actions. (`GET /{realm}/authentication/required-actions`) -- Get required action for alias (`GET /{realm}/authentication/required-actions/{alias}`) -- Update required action (`PUT /{realm}/authentication/required-actions/{alias}`) -- Delete required action (`DELETE /{realm}/authentication/required-actions/{alias}`) -- Lower required action’s priority (`POST /{realm}/authentication/required-actions/{alias}/lower-priority`) -- Raise required action’s priority (`POST /{realm}/authentication/required-actions/{alias}/raise-priority`) -- Get unregistered required actions Returns a list of unregistered required actions. (`GET /{realm}/authentication/unregistered-required-actions`) - -### [Authorization: Permission](https://www.keycloak.org/docs/8.0/authorization_services/#_overview) - -Demo code: https://github.com/keycloak/keycloak/blob/main/js/libs/keycloak-admin-client/test/clients.spec.ts - -- Create permission (`POST /{realm}/clients/{id}/authz/resource-server/permission/{type}`) -- Get permission (`GET /{realm}/clients/{id}/authz/resource-server/permission/{type}/{permissionId}`) -- Update permission (`PUT /{realm}/clients/{id}/authz/resource-server/permission/{type}/{permissionId}`) -- Delete permission (`DELETE /{realm}/clients/{id}/authz/resource-server/permission/{type}/{permissionId}`) - -### [Authorization: Policy](https://www.keycloak.org/docs/8.0/authorization_services/#_overview) - -Demo code: https://github.com/keycloak/keycloak/blob/main/js/libs/keycloak-admin-client/test/clients.spec.ts - -- Create policy (`POST /{realm}/clients/{id}/authz/resource-server/policy/{type}`) -- Get policy (`GET /{realm}/clients/{id}/authz/resource-server/policy/{type}/{policyId}`) -- Get policy by name (`GET /{realm}/clients/{id}/authz/resource-server/policy/search`) -- Update policy (`PUT /{realm}/clients/{id}/authz/resource-server/policy/{type}/{policyId}`) -- Delete policy (`DELETE /{realm}/clients/{id}/authz/resource-server/policy/{policyId}`) - -### [Attack Detection](https://www.keycloak.org/docs-api/20.0.2/rest-api/index.html#_attack_detection_resource) - -Demo code: https://github.com/keycloak/keycloak/blob/main/js/libs/keycloak-admin-client/test/attackDetection.spec.ts - -- Clear any user login failures for all users This can release temporary disabled users (`DELETE /{realm}/attack-detection/brute-force/users`) -- Get status of a username in brute force detection (`GET /{realm}/attack-detection/brute-force/users/{userId}`) -- Clear any user login failures for the user This can release temporary disabled user (`DELETE /{realm}/attack-detection/brute-force/users/{userId}`) - -## Not yet supported - -- [Authentication Management](https://www.keycloak.org/docs-api/20.0.2/rest-api/index.html#_authentication_management_resource) -- [Client Initial Access](https://www.keycloak.org/docs-api/20.0.2/rest-api/index.html#_client_initial_access_resource) -- [Client Registration Policy](https://www.keycloak.org/docs-api/20.0.2/rest-api/index.html#_client_registration_policy_resource) -- [Key](https://www.keycloak.org/docs-api/20.0.2/rest-api/index.html#_key_resource) -- [User Storage Provider](https://www.keycloak.org/docs-api/20.0.2/rest-api/index.html#_user_storage_provider_resource) - -## Maintainers - -This repo is originally developed by [Canner](https://www.cannercms.com) and [InfuseAI](https://infuseai.io) before being transferred under keycloak organization. diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/client.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/client.d.ts deleted file mode 100644 index ed71387..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/client.d.ts +++ /dev/null @@ -1,57 +0,0 @@ -import type { RequestArgs } from "./resources/agent.js"; -import { AttackDetection } from "./resources/attackDetection.js"; -import { AuthenticationManagement } from "./resources/authenticationManagement.js"; -import { Cache } from "./resources/cache.js"; -import { ClientPolicies } from "./resources/clientPolicies.js"; -import { Clients } from "./resources/clients.js"; -import { ClientScopes } from "./resources/clientScopes.js"; -import { Components } from "./resources/components.js"; -import { Groups } from "./resources/groups.js"; -import { IdentityProviders } from "./resources/identityProviders.js"; -import { Realms } from "./resources/realms.js"; -import { Roles } from "./resources/roles.js"; -import { ServerInfo } from "./resources/serverInfo.js"; -import { Users } from "./resources/users.js"; -import { UserStorageProvider } from "./resources/userStorageProvider.js"; -import { WhoAmI } from "./resources/whoAmI.js"; -import { Credentials } from "./utils/auth.js"; -export interface TokenProvider { - getAccessToken: () => Promise; -} -export interface ConnectionConfig { - baseUrl?: string; - realmName?: string; - requestOptions?: RequestInit; - requestArgOptions?: Pick; -} -export declare class KeycloakAdminClient { - #private; - users: Users; - userStorageProvider: UserStorageProvider; - groups: Groups; - roles: Roles; - clients: Clients; - realms: Realms; - clientScopes: ClientScopes; - clientPolicies: ClientPolicies; - identityProviders: IdentityProviders; - components: Components; - serverInfo: ServerInfo; - whoAmI: WhoAmI; - attackDetection: AttackDetection; - authenticationManagement: AuthenticationManagement; - cache: Cache; - baseUrl: string; - realmName: string; - scope?: string; - accessToken?: string; - refreshToken?: string; - constructor(connectionConfig?: ConnectionConfig); - auth(credentials: Credentials): Promise; - registerTokenProvider(provider: TokenProvider): void; - setAccessToken(token: string): void; - getAccessToken(): Promise; - getRequestOptions(): RequestInit | undefined; - getGlobalRequestArgOptions(): Pick | undefined; - setConfig(connectionConfig: ConnectionConfig): void; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/client.js b/node_modules/@keycloak/keycloak-admin-client/lib/client.js deleted file mode 100644 index 447efe8..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/client.js +++ /dev/null @@ -1,109 +0,0 @@ -import { AttackDetection } from "./resources/attackDetection.js"; -import { AuthenticationManagement } from "./resources/authenticationManagement.js"; -import { Cache } from "./resources/cache.js"; -import { ClientPolicies } from "./resources/clientPolicies.js"; -import { Clients } from "./resources/clients.js"; -import { ClientScopes } from "./resources/clientScopes.js"; -import { Components } from "./resources/components.js"; -import { Groups } from "./resources/groups.js"; -import { IdentityProviders } from "./resources/identityProviders.js"; -import { Realms } from "./resources/realms.js"; -import { Roles } from "./resources/roles.js"; -import { ServerInfo } from "./resources/serverInfo.js"; -import { Users } from "./resources/users.js"; -import { UserStorageProvider } from "./resources/userStorageProvider.js"; -import { WhoAmI } from "./resources/whoAmI.js"; -import { getToken } from "./utils/auth.js"; -import { defaultBaseUrl, defaultRealm } from "./utils/constants.js"; -export class KeycloakAdminClient { - // Resources - users; - userStorageProvider; - groups; - roles; - clients; - realms; - clientScopes; - clientPolicies; - identityProviders; - components; - serverInfo; - whoAmI; - attackDetection; - authenticationManagement; - cache; - // Members - baseUrl; - realmName; - scope; - accessToken; - refreshToken; - #requestOptions; - #globalRequestArgOptions; - #tokenProvider; - constructor(connectionConfig) { - this.baseUrl = connectionConfig?.baseUrl || defaultBaseUrl; - this.realmName = connectionConfig?.realmName || defaultRealm; - this.#requestOptions = connectionConfig?.requestOptions; - this.#globalRequestArgOptions = connectionConfig?.requestArgOptions; - // Initialize resources - this.users = new Users(this); - this.userStorageProvider = new UserStorageProvider(this); - this.groups = new Groups(this); - this.roles = new Roles(this); - this.clients = new Clients(this); - this.realms = new Realms(this); - this.clientScopes = new ClientScopes(this); - this.clientPolicies = new ClientPolicies(this); - this.identityProviders = new IdentityProviders(this); - this.components = new Components(this); - this.authenticationManagement = new AuthenticationManagement(this); - this.serverInfo = new ServerInfo(this); - this.whoAmI = new WhoAmI(this); - this.attackDetection = new AttackDetection(this); - this.cache = new Cache(this); - } - async auth(credentials) { - const { accessToken, refreshToken } = await getToken({ - baseUrl: this.baseUrl, - realmName: this.realmName, - scope: this.scope, - credentials, - requestOptions: this.#requestOptions, - }); - this.accessToken = accessToken; - this.refreshToken = refreshToken; - } - registerTokenProvider(provider) { - if (this.#tokenProvider) { - throw new Error("An existing token provider was already registered."); - } - this.#tokenProvider = provider; - } - setAccessToken(token) { - this.accessToken = token; - } - async getAccessToken() { - if (this.#tokenProvider) { - return this.#tokenProvider.getAccessToken(); - } - return this.accessToken; - } - getRequestOptions() { - return this.#requestOptions; - } - getGlobalRequestArgOptions() { - return this.#globalRequestArgOptions; - } - setConfig(connectionConfig) { - if (typeof connectionConfig.baseUrl === "string" && - connectionConfig.baseUrl) { - this.baseUrl = connectionConfig.baseUrl; - } - if (typeof connectionConfig.realmName === "string" && - connectionConfig.realmName) { - this.realmName = connectionConfig.realmName; - } - this.#requestOptions = connectionConfig.requestOptions; - } -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/AccessTokenAccess.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/AccessTokenAccess.d.ts deleted file mode 100644 index 6995d2d..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/AccessTokenAccess.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export default interface AccessTokenAccess { - roles?: string[]; - verify_caller?: boolean; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/AccessTokenAccess.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/AccessTokenAccess.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/AccessTokenAccess.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/PermissonRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/PermissonRepresentation.d.ts deleted file mode 100644 index 23c44fa..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/PermissonRepresentation.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export default interface PermissionRepresentation { - claims?: { - [index: string]: string; - }; - rsid?: string; - rsname?: string; - scopes?: string[]; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/PermissonRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/PermissonRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/PermissonRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/accessTokenCertConf.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/accessTokenCertConf.d.ts deleted file mode 100644 index 45ddc57..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/accessTokenCertConf.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export default interface AccessTokenCertConf { - "x5t#S256"?: string; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/accessTokenCertConf.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/accessTokenCertConf.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/accessTokenCertConf.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/accessTokenRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/accessTokenRepresentation.d.ts deleted file mode 100644 index b42a07a..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/accessTokenRepresentation.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -import type AccessTokenAccess from "./AccessTokenAccess.js"; -import type AccessTokenCertConf from "./accessTokenCertConf.js"; -import type AddressClaimSet from "./addressClaimSet.js"; -import type { Category } from "./resourceServerRepresentation.js"; -export default interface AccessTokenRepresentation { - acr?: string; - address?: AddressClaimSet; - "allowed-origins"?: string[]; - at_hash?: string; - auth_time?: number; - authorization?: AccessTokenRepresentation; - azp?: string; - birthdate?: string; - c_hash?: string; - category?: Category; - claims_locales?: string; - cnf?: AccessTokenCertConf; - email?: string; - email_verified?: boolean; - exp?: number; - family_name?: string; - gender: string; - given_name?: string; - iat?: number; - iss?: string; - jti?: string; - locale?: string; - middle_name?: string; - name?: string; - nbf?: number; - nickname?: string; - nonce?: string; - otherClaims?: { - [index: string]: string; - }; - phone_number?: string; - phone_number_verified?: boolean; - picture?: string; - preferred_username?: string; - profile?: string; - realm_access?: AccessTokenAccess; - s_hash?: string; - scope?: string; - session_state?: string; - sub?: string; - "trusted-certs"?: string[]; - typ?: string; - updated_at?: number; - website?: string; - zoneinfo?: string; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/accessTokenRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/accessTokenRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/accessTokenRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/addressClaimSet.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/addressClaimSet.d.ts deleted file mode 100644 index 2ee29d7..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/addressClaimSet.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export default interface AddressClaimSet { - country?: string; - formatted?: string; - locality?: string; - postal_code?: string; - region?: string; - street_address?: string; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/addressClaimSet.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/addressClaimSet.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/addressClaimSet.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/adminEventRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/adminEventRepresentation.d.ts deleted file mode 100644 index 286df54..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/adminEventRepresentation.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type AuthDetailsRepresentation from "./authDetailsRepresentation.js"; -export default interface AdminEventRepresentation { - authDetails?: AuthDetailsRepresentation; - error?: string; - operationType?: string; - realmId?: string; - representation?: string; - resourcePath?: string; - resourceType?: string; - time?: number; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/adminEventRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/adminEventRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/adminEventRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/authDetailsRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/authDetailsRepresentation.d.ts deleted file mode 100644 index 0a916e0..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/authDetailsRepresentation.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export default interface AuthDetailsRepresentation { - clientId?: string; - ipAddress?: string; - realmId?: string; - userId?: string; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/authDetailsRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/authDetailsRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/authDetailsRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/authenticationExecutionExportRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/authenticationExecutionExportRepresentation.d.ts deleted file mode 100644 index c677e52..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/authenticationExecutionExportRepresentation.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_authenticationexecutionexportrepresentation - */ -export default interface AuthenticationExecutionExportRepresentation { - flowAlias?: string; - userSetupAllowed?: boolean; - authenticatorConfig?: string; - authenticator?: string; - requirement?: string; - priority?: number; - autheticatorFlow?: boolean; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/authenticationExecutionExportRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/authenticationExecutionExportRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/authenticationExecutionExportRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/authenticationExecutionInfoRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/authenticationExecutionInfoRepresentation.d.ts deleted file mode 100644 index a12f596..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/authenticationExecutionInfoRepresentation.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_authenticationexecutioninforepresentation - */ -export default interface AuthenticationExecutionInfoRepresentation { - id?: string; - requirement?: string; - displayName?: string; - alias?: string; - description?: string; - requirementChoices?: string[]; - configurable?: boolean; - authenticationFlow?: boolean; - providerId?: string; - authenticationConfig?: string; - flowId?: string; - level?: number; - index?: number; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/authenticationExecutionInfoRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/authenticationExecutionInfoRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/authenticationExecutionInfoRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/authenticationFlowRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/authenticationFlowRepresentation.d.ts deleted file mode 100644 index 4784254..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/authenticationFlowRepresentation.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type AuthenticationExecutionExportRepresentation from "./authenticationExecutionExportRepresentation.js"; -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_authenticationflowrepresentation - */ -export default interface AuthenticationFlowRepresentation { - id?: string; - alias?: string; - description?: string; - providerId?: string; - topLevel?: boolean; - builtIn?: boolean; - authenticationExecutions?: AuthenticationExecutionExportRepresentation[]; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/authenticationFlowRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/authenticationFlowRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/authenticationFlowRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/authenticatorConfigInfoRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/authenticatorConfigInfoRepresentation.d.ts deleted file mode 100644 index af20c07..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/authenticatorConfigInfoRepresentation.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_authenticatorconfiginforepresentation - */ -export default interface AuthenticatorConfigInfoRepresentation { - name?: string; - providerId?: string; - helpText?: string; - properties?: ConfigPropertyRepresentation[]; -} -export interface ConfigPropertyRepresentation { - name?: string; - label?: string; - helpText?: string; - type?: string; - defaultValue?: any; - options?: string[]; - secret?: boolean; - required?: boolean; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/authenticatorConfigInfoRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/authenticatorConfigInfoRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/authenticatorConfigInfoRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/authenticatorConfigRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/authenticatorConfigRepresentation.d.ts deleted file mode 100644 index 8db2730..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/authenticatorConfigRepresentation.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_authenticatorconfigrepresentation - */ -export default interface AuthenticatorConfigRepresentation { - id?: string; - alias?: string; - config?: { - [index: string]: string; - }; -} -export interface AuthenticationProviderRepresentation { - id?: string; - displayName?: string; - description?: string; - supportsSecret?: boolean; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/authenticatorConfigRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/authenticatorConfigRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/authenticatorConfigRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/certificateRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/certificateRepresentation.d.ts deleted file mode 100644 index 2fc265d..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/certificateRepresentation.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/#_certificaterepresentation - */ -export default interface CertificateRepresentation { - privateKey?: string; - publicKey?: string; - certificate?: string; - kid?: string; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/certificateRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/certificateRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/certificateRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientInitialAccessPresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientInitialAccessPresentation.d.ts deleted file mode 100644 index a41c768..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientInitialAccessPresentation.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_clientinitialaccesspresentation - */ -export default interface ClientInitialAccessPresentation { - id?: string; - token?: string; - timestamp?: number; - expiration?: number; - count?: number; - remainingCount?: number; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientInitialAccessPresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientInitialAccessPresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientInitialAccessPresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientPoliciesRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientPoliciesRepresentation.d.ts deleted file mode 100644 index 7144d39..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientPoliciesRepresentation.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type ClientPolicyRepresentation from "./clientPolicyRepresentation.js"; -/** - * https://www.keycloak.org/docs-api/15.0/rest-api/#_clientpoliciesrepresentation - */ -export default interface ClientPoliciesRepresentation { - policies?: ClientPolicyRepresentation[]; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientPoliciesRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientPoliciesRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientPoliciesRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientPolicyConditionRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientPolicyConditionRepresentation.d.ts deleted file mode 100644 index f03322a..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientPolicyConditionRepresentation.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/15.0/rest-api/#_clientpolicyconditionrepresentation - */ -export default interface ClientPolicyConditionRepresentation { - condition?: string; - configuration?: object; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientPolicyConditionRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientPolicyConditionRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientPolicyConditionRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientPolicyExecutorRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientPolicyExecutorRepresentation.d.ts deleted file mode 100644 index bf443ff..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientPolicyExecutorRepresentation.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/15.0/rest-api/#_clientpolicyexecutorrepresentation - */ -export default interface ClientPolicyExecutorRepresentation { - configuration?: object; - executor?: string; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientPolicyExecutorRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientPolicyExecutorRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientPolicyExecutorRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientPolicyRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientPolicyRepresentation.d.ts deleted file mode 100644 index 30127cf..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientPolicyRepresentation.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type ClientPolicyConditionRepresentation from "./clientPolicyConditionRepresentation.js"; -/** - * https://www.keycloak.org/docs-api/15.0/rest-api/#_clientpolicyrepresentation - */ -export default interface ClientPolicyRepresentation { - conditions?: ClientPolicyConditionRepresentation[]; - description?: string; - enabled?: boolean; - name?: string; - profiles?: string[]; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientPolicyRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientPolicyRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientPolicyRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientProfileRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientProfileRepresentation.d.ts deleted file mode 100644 index 431dcb4..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientProfileRepresentation.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type ClientPolicyExecutorRepresentation from "./clientPolicyExecutorRepresentation.js"; -/** - * https://www.keycloak.org/docs-api/15.0/rest-api/#_clientprofilerepresentation - */ -export default interface ClientProfileRepresentation { - description?: string; - executors?: ClientPolicyExecutorRepresentation[]; - name?: string; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientProfileRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientProfileRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientProfileRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientProfilesRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientProfilesRepresentation.d.ts deleted file mode 100644 index 7c2b98c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientProfilesRepresentation.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type ClientProfileRepresentation from "./clientProfileRepresentation.js"; -/** - * https://www.keycloak.org/docs-api/15.0/rest-api/#_clientprofilesrepresentation - */ -export default interface ClientProfilesRepresentation { - globalProfiles?: ClientProfileRepresentation[]; - profiles?: ClientProfileRepresentation[]; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientProfilesRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientProfilesRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientProfilesRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientRepresentation.d.ts deleted file mode 100644 index 8563136..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientRepresentation.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_clientrepresentation - */ -import type ResourceServerRepresentation from "./resourceServerRepresentation.js"; -import type ProtocolMapperRepresentation from "./protocolMapperRepresentation.js"; -export default interface ClientRepresentation { - access?: Record; - adminUrl?: string; - attributes?: Record; - authenticationFlowBindingOverrides?: Record; - authorizationServicesEnabled?: boolean; - authorizationSettings?: ResourceServerRepresentation; - baseUrl?: string; - bearerOnly?: boolean; - clientAuthenticatorType?: string; - clientId?: string; - consentRequired?: boolean; - defaultClientScopes?: string[]; - defaultRoles?: string[]; - description?: string; - directAccessGrantsEnabled?: boolean; - enabled?: boolean; - alwaysDisplayInConsole?: boolean; - frontchannelLogout?: boolean; - fullScopeAllowed?: boolean; - id?: string; - implicitFlowEnabled?: boolean; - name?: string; - nodeReRegistrationTimeout?: number; - notBefore?: number; - optionalClientScopes?: string[]; - origin?: string; - protocol?: string; - protocolMappers?: ProtocolMapperRepresentation[]; - publicClient?: boolean; - redirectUris?: string[]; - registeredNodes?: Record; - registrationAccessToken?: string; - rootUrl?: string; - secret?: string; - serviceAccountsEnabled?: boolean; - standardFlowEnabled?: boolean; - surrogateAuthRequired?: boolean; - webOrigins?: string[]; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientScopeRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientScopeRepresentation.d.ts deleted file mode 100644 index a4bac69..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientScopeRepresentation.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_clientscoperepresentation - */ -import type ProtocolMapperRepresentation from "./protocolMapperRepresentation.js"; -export default interface ClientScopeRepresentation { - attributes?: Record; - description?: string; - id?: string; - name?: string; - protocol?: string; - protocolMappers?: ProtocolMapperRepresentation[]; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientScopeRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientScopeRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientScopeRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientSessionStat.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientSessionStat.d.ts deleted file mode 100644 index e1f3eae..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientSessionStat.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface ClientSessionStat { - id: string; - clientId: string; - active: string; - offline: string; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientSessionStat.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientSessionStat.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/clientSessionStat.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/componentExportRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/componentExportRepresentation.d.ts deleted file mode 100644 index d7709ab..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/componentExportRepresentation.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_componentexportrepresentation - */ -export default interface ComponentExportRepresentation { - id?: string; - name?: string; - providerId?: string; - subType?: string; - subComponents?: { - [index: string]: ComponentExportRepresentation; - }; - config?: { - [index: string]: string; - }; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/componentExportRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/componentExportRepresentation.js deleted file mode 100644 index ad9c2e1..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/componentExportRepresentation.js +++ /dev/null @@ -1,4 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_componentexportrepresentation - */ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/componentRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/componentRepresentation.d.ts deleted file mode 100644 index 8011e9c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/componentRepresentation.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_componentrepresentation - */ -export default interface ComponentRepresentation { - id?: string; - name?: string; - providerId?: string; - providerType?: string; - parentId?: string; - subType?: string; - config?: { - [index: string]: string | string[]; - }; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/componentRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/componentRepresentation.js deleted file mode 100644 index 9943052..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/componentRepresentation.js +++ /dev/null @@ -1,4 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_componentrepresentation - */ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/componentTypeRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/componentTypeRepresentation.d.ts deleted file mode 100644 index a1b16e6..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/componentTypeRepresentation.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { ConfigPropertyRepresentation } from "./configPropertyRepresentation.js"; -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_componenttyperepresentation - */ -export default interface ComponentTypeRepresentation { - id: string; - helpText: string; - properties: ConfigPropertyRepresentation[]; - metadata: { - [index: string]: any; - }; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/componentTypeRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/componentTypeRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/componentTypeRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/configPropertyRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/configPropertyRepresentation.d.ts deleted file mode 100644 index 98e8377..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/configPropertyRepresentation.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_configpropertyrepresentation - */ -export interface ConfigPropertyRepresentation { - name?: string; - label?: string; - helpText?: string; - type?: string; - defaultValue?: object; - options?: string[]; - secret?: boolean; - required?: boolean; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/configPropertyRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/configPropertyRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/configPropertyRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/credentialRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/credentialRepresentation.d.ts deleted file mode 100644 index 7594202..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/credentialRepresentation.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_credentialrepresentation - */ -export default interface CredentialRepresentation { - createdDate?: number; - credentialData?: string; - id?: string; - priority?: number; - secretData?: string; - temporary?: boolean; - type?: string; - userLabel?: string; - value?: string; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/credentialRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/credentialRepresentation.js deleted file mode 100644 index 7dffc8a..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/credentialRepresentation.js +++ /dev/null @@ -1,4 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_credentialrepresentation - */ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/effectiveMessageBundleRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/effectiveMessageBundleRepresentation.d.ts deleted file mode 100644 index 168935d..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/effectiveMessageBundleRepresentation.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export default interface EffectiveMessageBundleRepresentation { - key: string; - value: string; - source: "THEME" | "REALM"; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/effectiveMessageBundleRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/effectiveMessageBundleRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/effectiveMessageBundleRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/evaluationResultRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/evaluationResultRepresentation.d.ts deleted file mode 100644 index da3a1ba..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/evaluationResultRepresentation.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { DecisionEffect } from "./policyRepresentation.js"; -import type PolicyResultRepresentation from "./policyResultRepresentation.js"; -import type ResourceRepresentation from "./resourceRepresentation.js"; -import type ScopeRepresentation from "./scopeRepresentation.js"; -export default interface EvaluationResultRepresentation { - resource?: ResourceRepresentation; - scopes?: ScopeRepresentation[]; - policies?: PolicyResultRepresentation[]; - status?: DecisionEffect; - allowedScopes?: ScopeRepresentation[]; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/evaluationResultRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/evaluationResultRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/evaluationResultRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/eventRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/eventRepresentation.d.ts deleted file mode 100644 index ab56a60..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/eventRepresentation.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_eventrepresentation - */ -import type EventType from "./eventTypes.js"; -export default interface EventRepresentation { - clientId?: string; - details?: Record; - error?: string; - ipAddress?: string; - realmId?: string; - sessionId?: string; - time?: number; - type?: EventType; - userId?: string; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/eventRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/eventRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/eventRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/eventTypes.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/eventTypes.d.ts deleted file mode 100644 index 2efa1a3..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/eventTypes.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -type EventType = "LOGIN" | "LOGIN_ERROR" | "REGISTER" | "REGISTER_ERROR" | "LOGOUT" | "LOGOUT_ERROR" | "CODE_TO_TOKEN" | "CODE_TO_TOKEN_ERROR" | "CLIENT_LOGIN" | "CLIENT_LOGIN_ERROR" | "REFRESH_TOKEN" | "REFRESH_TOKEN_ERROR" | "VALIDATE_ACCESS_TOKEN" | "VALIDATE_ACCESS_TOKEN_ERROR" | "INTROSPECT_TOKEN" | "INTROSPECT_TOKEN_ERROR" | "FEDERATED_IDENTITY_LINK" | "FEDERATED_IDENTITY_LINK_ERROR" | "REMOVE_FEDERATED_IDENTITY" | "REMOVE_FEDERATED_IDENTITY_ERROR" | "UPDATE_EMAIL" | "UPDATE_EMAIL_ERROR" | "UPDATE_PROFILE" | "UPDATE_PROFILE_ERROR" | "UPDATE_PASSWORD" | "UPDATE_PASSWORD_ERROR" | "UPDATE_TOTP" | "UPDATE_TOTP_ERROR" | "VERIFY_EMAIL" | "VERIFY_EMAIL_ERROR" | "REMOVE_TOTP" | "REMOVE_TOTP_ERROR" | "REVOKE_GRANT" | "REVOKE_GRANT_ERROR" | "SEND_VERIFY_EMAIL" | "SEND_VERIFY_EMAIL_ERROR" | "SEND_RESET_PASSWORD" | "SEND_RESET_PASSWORD_ERROR" | "SEND_IDENTITY_PROVIDER_LINK" | "SEND_IDENTITY_PROVIDER_LINK_ERROR" | "RESET_PASSWORD" | "RESET_PASSWORD_ERROR" | "RESTART_AUTHENTICATION" | "RESTART_AUTHENTICATION_ERROR" | "INVALID_SIGNATURE" | "INVALID_SIGNATURE_ERROR" | "REGISTER_NODE" | "REGISTER_NODE_ERROR" | "UNREGISTER_NODE" | "UNREGISTER_NODE_ERROR" | "USER_INFO_REQUEST" | "USER_INFO_REQUEST_ERROR" | "IDENTITY_PROVIDER_LINK_ACCOUNT" | "IDENTITY_PROVIDER_LINK_ACCOUNT_ERROR" | "IDENTITY_PROVIDER_LOGIN" | "IDENTITY_PROVIDER_LOGIN_ERROR" | "IDENTITY_PROVIDER_FIRST_LOGIN" | "IDENTITY_PROVIDER_FIRST_LOGIN_ERROR" | "IDENTITY_PROVIDER_POST_LOGIN" | "IDENTITY_PROVIDER_POST_LOGIN_ERROR" | "IDENTITY_PROVIDER_RESPONSE" | "IDENTITY_PROVIDER_RESPONSE_ERROR" | "IDENTITY_PROVIDER_RETRIEVE_TOKEN" | "IDENTITY_PROVIDER_RETRIEVE_TOKEN_ERROR" | "IMPERSONATE" | "IMPERSONATE_ERROR" | "CUSTOM_REQUIRED_ACTION" | "CUSTOM_REQUIRED_ACTION_ERROR" | "EXECUTE_ACTIONS" | "EXECUTE_ACTIONS_ERROR" | "EXECUTE_ACTION_TOKEN" | "EXECUTE_ACTION_TOKEN_ERROR" | "CLIENT_INFO" | "CLIENT_INFO_ERROR" | "CLIENT_REGISTER" | "CLIENT_REGISTER_ERROR" | "CLIENT_UPDATE" | "CLIENT_UPDATE_ERROR" | "CLIENT_DELETE" | "CLIENT_DELETE_ERROR" | "CLIENT_INITIATED_ACCOUNT_LINKING" | "CLIENT_INITIATED_ACCOUNT_LINKING_ERROR" | "TOKEN_EXCHANGE" | "TOKEN_EXCHANGE_ERROR" | "PERMISSION_TOKEN" | "PERMISSION_TOKEN_ERROR"; -export default EventType; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/eventTypes.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/eventTypes.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/eventTypes.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/featureRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/featureRepresentation.d.ts deleted file mode 100644 index 3efc6f6..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/featureRepresentation.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -export default interface FeatureRepresentation { - name: string; - label: string; - type: FeatureType; - enabled: boolean; - dependencies: string[]; -} -export declare enum FeatureType { - Default = "DEFAULT", - DisabledByDefault = "DISABLED_BY_DEFAULT", - Preview = "PREVIEW", - PreviewDisabledByDefault = "PREVIEW_DISABLED_BY_DEFAULT", - Experimental = "EXPERIMENTAL", - Deprecated = "DEPRECATED" -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/featureRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/featureRepresentation.js deleted file mode 100644 index b0e9df2..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/featureRepresentation.js +++ /dev/null @@ -1,9 +0,0 @@ -export var FeatureType; -(function (FeatureType) { - FeatureType["Default"] = "DEFAULT"; - FeatureType["DisabledByDefault"] = "DISABLED_BY_DEFAULT"; - FeatureType["Preview"] = "PREVIEW"; - FeatureType["PreviewDisabledByDefault"] = "PREVIEW_DISABLED_BY_DEFAULT"; - FeatureType["Experimental"] = "EXPERIMENTAL"; - FeatureType["Deprecated"] = "DEPRECATED"; -})(FeatureType || (FeatureType = {})); diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/federatedIdentityRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/federatedIdentityRepresentation.d.ts deleted file mode 100644 index f568f9e..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/federatedIdentityRepresentation.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_federatedidentityrepresentation - */ -export default interface FederatedIdentityRepresentation { - identityProvider?: string; - userId?: string; - userName?: string; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/federatedIdentityRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/federatedIdentityRepresentation.js deleted file mode 100644 index 058a074..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/federatedIdentityRepresentation.js +++ /dev/null @@ -1,4 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_federatedidentityrepresentation - */ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/globalRequestResult.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/globalRequestResult.d.ts deleted file mode 100644 index d7c2818..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/globalRequestResult.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_globalrequestresult - */ -export default interface GlobalRequestResult { - successRequests?: string[]; - failedRequests?: string[]; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/globalRequestResult.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/globalRequestResult.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/globalRequestResult.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/groupRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/groupRepresentation.d.ts deleted file mode 100644 index c6d8150..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/groupRepresentation.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_grouprepresentation - */ -export default interface GroupRepresentation { - id?: string; - name?: string; - path?: string; - subGroupCount?: number; - subGroups?: GroupRepresentation[]; - access?: Record; - attributes?: Record; - clientRoles?: Record; - realmRoles?: string[]; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/groupRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/groupRepresentation.js deleted file mode 100644 index ba23410..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/groupRepresentation.js +++ /dev/null @@ -1,4 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_grouprepresentation - */ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/identityProviderMapperRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/identityProviderMapperRepresentation.d.ts deleted file mode 100644 index 58b4202..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/identityProviderMapperRepresentation.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_identityprovidermapperrepresentation - */ -export default interface IdentityProviderMapperRepresentation { - config?: any; - id?: string; - identityProviderAlias?: string; - identityProviderMapper?: string; - name?: string; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/identityProviderMapperRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/identityProviderMapperRepresentation.js deleted file mode 100644 index c55dd03..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/identityProviderMapperRepresentation.js +++ /dev/null @@ -1,4 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_identityprovidermapperrepresentation - */ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/identityProviderMapperTypeRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/identityProviderMapperTypeRepresentation.d.ts deleted file mode 100644 index 1296564..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/identityProviderMapperTypeRepresentation.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ConfigPropertyRepresentation } from "./configPropertyRepresentation.js"; -export interface IdentityProviderMapperTypeRepresentation { - id?: string; - name?: string; - category?: string; - helpText?: string; - properties?: ConfigPropertyRepresentation[]; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/identityProviderMapperTypeRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/identityProviderMapperTypeRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/identityProviderMapperTypeRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/identityProviderRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/identityProviderRepresentation.d.ts deleted file mode 100644 index 0ed0a0f..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/identityProviderRepresentation.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_identityproviderrepresentation - */ -export default interface IdentityProviderRepresentation { - addReadTokenRoleOnCreate?: boolean; - alias?: string; - config?: Record; - displayName?: string; - enabled?: boolean; - firstBrokerLoginFlowAlias?: string; - internalId?: string; - linkOnly?: boolean; - postBrokerLoginFlowAlias?: string; - providerId?: string; - storeToken?: boolean; - trustEmail?: boolean; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/identityProviderRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/identityProviderRepresentation.js deleted file mode 100644 index f578c20..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/identityProviderRepresentation.js +++ /dev/null @@ -1,4 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_identityproviderrepresentation - */ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/keyMetadataRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/keyMetadataRepresentation.d.ts deleted file mode 100644 index 093e2ca..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/keyMetadataRepresentation.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_keysmetadatarepresentation-keymetadatarepresentation - */ -export default interface KeysMetadataRepresentation { - active?: { - [index: string]: string; - }; - keys?: KeyMetadataRepresentation[]; -} -export interface KeyMetadataRepresentation { - providerId?: string; - providerPriority?: number; - kid?: string; - status?: string; - type?: string; - algorithm?: string; - publicKey?: string; - certificate?: string; - validTo?: string; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/keyMetadataRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/keyMetadataRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/keyMetadataRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/keystoreConfig.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/keystoreConfig.d.ts deleted file mode 100644 index ef83480..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/keystoreConfig.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/#_keystoreconfig - */ -export default interface KeyStoreConfig { - realmCertificate?: boolean; - storePassword?: string; - keyPassword?: string; - keyAlias?: string; - realmAlias?: string; - format?: string; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/keystoreConfig.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/keystoreConfig.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/keystoreConfig.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/managementPermissionReference.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/managementPermissionReference.d.ts deleted file mode 100644 index 9a6c1d5..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/managementPermissionReference.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export interface ManagementPermissionReference { - enabled?: boolean; - resource?: string; - scopePermissions?: Record; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/managementPermissionReference.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/managementPermissionReference.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/managementPermissionReference.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/mappingsRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/mappingsRepresentation.d.ts deleted file mode 100644 index 4948d4f..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/mappingsRepresentation.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_mappingsrepresentation - */ -import type RoleRepresentation from "./roleRepresentation.js"; -export default interface MappingsRepresentation { - clientMappings?: Record; - realmMappings?: RoleRepresentation[]; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/mappingsRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/mappingsRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/mappingsRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/passwordPolicyTypeRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/passwordPolicyTypeRepresentation.d.ts deleted file mode 100644 index 6803e17..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/passwordPolicyTypeRepresentation.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_passwordpolicytyperepresentation - */ -export default interface PasswordPolicyTypeRepresentation { - id?: string; - displayName?: string; - configType?: string; - defaultValue?: string; - multipleSupported?: boolean; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/passwordPolicyTypeRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/passwordPolicyTypeRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/passwordPolicyTypeRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/policyEvaluationResponse.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/policyEvaluationResponse.d.ts deleted file mode 100644 index 16acd16..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/policyEvaluationResponse.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type AccessTokenRepresentation from "./accessTokenRepresentation.js"; -import type EvaluationResultRepresentation from "./evaluationResultRepresentation.js"; -import type { DecisionEffect } from "./policyRepresentation.js"; -export default interface PolicyEvaluationResponse { - results?: EvaluationResultRepresentation[]; - entitlements?: boolean; - status?: DecisionEffect; - rpt?: AccessTokenRepresentation; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/policyEvaluationResponse.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/policyEvaluationResponse.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/policyEvaluationResponse.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/policyProviderRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/policyProviderRepresentation.d.ts deleted file mode 100644 index 24ffe1d..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/policyProviderRepresentation.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export default interface PolicyProviderRepresentation { - type?: string; - name?: string; - group?: string; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/policyProviderRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/policyProviderRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/policyProviderRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/policyRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/policyRepresentation.d.ts deleted file mode 100644 index 654747d..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/policyRepresentation.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_policyrepresentation - */ -export declare enum DecisionStrategy { - AFFIRMATIVE = "AFFIRMATIVE", - UNANIMOUS = "UNANIMOUS", - CONSENSUS = "CONSENSUS" -} -export declare enum DecisionEffect { - Permit = "PERMIT", - Deny = "DENY" -} -export declare enum Logic { - POSITIVE = "POSITIVE", - NEGATIVE = "NEGATIVE" -} -export interface PolicyRoleRepresentation { - id: string; - required?: boolean; -} -export default interface PolicyRepresentation { - config?: Record; - decisionStrategy?: DecisionStrategy; - description?: string; - id?: string; - logic?: Logic; - name?: string; - owner?: string; - policies?: string[]; - resources?: string[]; - scopes?: string[]; - type?: string; - users?: string[]; - roles?: PolicyRoleRepresentation[]; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/policyRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/policyRepresentation.js deleted file mode 100644 index b4a7bd3..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/policyRepresentation.js +++ /dev/null @@ -1,19 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_policyrepresentation - */ -export var DecisionStrategy; -(function (DecisionStrategy) { - DecisionStrategy["AFFIRMATIVE"] = "AFFIRMATIVE"; - DecisionStrategy["UNANIMOUS"] = "UNANIMOUS"; - DecisionStrategy["CONSENSUS"] = "CONSENSUS"; -})(DecisionStrategy || (DecisionStrategy = {})); -export var DecisionEffect; -(function (DecisionEffect) { - DecisionEffect["Permit"] = "PERMIT"; - DecisionEffect["Deny"] = "DENY"; -})(DecisionEffect || (DecisionEffect = {})); -export var Logic; -(function (Logic) { - Logic["POSITIVE"] = "POSITIVE"; - Logic["NEGATIVE"] = "NEGATIVE"; -})(Logic || (Logic = {})); diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/policyResultRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/policyResultRepresentation.d.ts deleted file mode 100644 index bcea4cd..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/policyResultRepresentation.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type PolicyRepresentation from "./policyRepresentation.js"; -import type { DecisionEffect } from "./policyRepresentation.js"; -export default interface PolicyResultRepresentation { - policy?: PolicyRepresentation; - status?: DecisionEffect; - associatedPolicies?: PolicyResultRepresentation[]; - scopes?: string[]; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/policyResultRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/policyResultRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/policyResultRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/profileInfoRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/profileInfoRepresentation.d.ts deleted file mode 100644 index 74151b2..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/profileInfoRepresentation.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_profileinforepresentation - */ -export default interface ProfileInfoRepresentation { - name?: string; - disabledFeatures?: string[]; - previewFeatures?: string[]; - experimentalFeatures?: string[]; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/profileInfoRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/profileInfoRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/profileInfoRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/protocolMapperRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/protocolMapperRepresentation.d.ts deleted file mode 100644 index d227c6d..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/protocolMapperRepresentation.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_protocolmapperrepresentation - */ -export default interface ProtocolMapperRepresentation { - config?: Record; - id?: string; - name?: string; - protocol?: string; - protocolMapper?: string; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/protocolMapperRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/protocolMapperRepresentation.js deleted file mode 100644 index 7cd1600..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/protocolMapperRepresentation.js +++ /dev/null @@ -1,4 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_protocolmapperrepresentation - */ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/realmEventsConfigRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/realmEventsConfigRepresentation.d.ts deleted file mode 100644 index 35cc05e..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/realmEventsConfigRepresentation.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/#_realmeventsconfigrepresentation - */ -export interface RealmEventsConfigRepresentation { - eventsEnabled?: boolean; - eventsExpiration?: number; - eventsListeners?: string[]; - enabledEventTypes?: string[]; - adminEventsEnabled?: boolean; - adminEventsDetailsEnabled?: boolean; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/realmEventsConfigRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/realmEventsConfigRepresentation.js deleted file mode 100644 index d693686..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/realmEventsConfigRepresentation.js +++ /dev/null @@ -1,4 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/#_realmeventsconfigrepresentation - */ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/realmRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/realmRepresentation.d.ts deleted file mode 100644 index 12ce2ec..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/realmRepresentation.d.ts +++ /dev/null @@ -1,134 +0,0 @@ -import type ClientRepresentation from "./clientRepresentation.js"; -import type ComponentExportRepresentation from "./componentExportRepresentation.js"; -import type UserRepresentation from "./userRepresentation.js"; -import type GroupRepresentation from "./groupRepresentation.js"; -import type IdentityProviderRepresentation from "./identityProviderRepresentation.js"; -import type RequiredActionProviderRepresentation from "./requiredActionProviderRepresentation.js"; -import type RolesRepresentation from "./rolesRepresentation.js"; -import type ClientProfilesRepresentation from "./clientProfilesRepresentation.js"; -import type ClientPoliciesRepresentation from "./clientPoliciesRepresentation.js"; -import type RoleRepresentation from "./roleRepresentation.js"; -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_realmrepresentation - */ -export default interface RealmRepresentation { - accessCodeLifespan?: number; - accessCodeLifespanLogin?: number; - accessCodeLifespanUserAction?: number; - accessTokenLifespan?: number; - accessTokenLifespanForImplicitFlow?: number; - accountTheme?: string; - actionTokenGeneratedByAdminLifespan?: number; - actionTokenGeneratedByUserLifespan?: number; - adminEventsDetailsEnabled?: boolean; - adminEventsEnabled?: boolean; - adminTheme?: string; - attributes?: Record; - authenticationFlows?: any[]; - authenticatorConfig?: any[]; - browserFlow?: string; - browserSecurityHeaders?: Record; - bruteForceProtected?: boolean; - clientAuthenticationFlow?: string; - clientScopeMappings?: Record; - clientScopes?: any[]; - clients?: ClientRepresentation[]; - clientPolicies?: ClientPoliciesRepresentation; - clientProfiles?: ClientProfilesRepresentation; - components?: { - [index: string]: ComponentExportRepresentation; - }; - defaultDefaultClientScopes?: string[]; - defaultGroups?: string[]; - defaultLocale?: string; - defaultOptionalClientScopes?: string[]; - defaultRoles?: string[]; - defaultRole?: RoleRepresentation; - defaultSignatureAlgorithm?: string; - directGrantFlow?: string; - displayName?: string; - displayNameHtml?: string; - dockerAuthenticationFlow?: string; - duplicateEmailsAllowed?: boolean; - editUsernameAllowed?: boolean; - emailTheme?: string; - enabled?: boolean; - enabledEventTypes?: string[]; - eventsEnabled?: boolean; - eventsExpiration?: number; - eventsListeners?: string[]; - failureFactor?: number; - federatedUsers?: UserRepresentation[]; - groups?: GroupRepresentation[]; - id?: string; - identityProviderMappers?: any[]; - identityProviders?: IdentityProviderRepresentation[]; - internationalizationEnabled?: boolean; - keycloakVersion?: string; - loginTheme?: string; - loginWithEmailAllowed?: boolean; - maxDeltaTimeSeconds?: number; - maxFailureWaitSeconds?: number; - maxTemporaryLockouts?: number; - minimumQuickLoginWaitSeconds?: number; - notBefore?: number; - oauth2DeviceCodeLifespan?: number; - oauth2DevicePollingInterval?: number; - offlineSessionIdleTimeout?: number; - offlineSessionMaxLifespan?: number; - offlineSessionMaxLifespanEnabled?: boolean; - otpPolicyAlgorithm?: string; - otpPolicyDigits?: number; - otpPolicyInitialCounter?: number; - otpPolicyLookAheadWindow?: number; - otpPolicyPeriod?: number; - otpPolicyType?: string; - otpSupportedApplications?: string[]; - otpPolicyCodeReusable?: boolean; - passwordPolicy?: string; - permanentLockout?: boolean; - protocolMappers?: any[]; - quickLoginCheckMilliSeconds?: number; - realm?: string; - refreshTokenMaxReuse?: number; - registrationAllowed?: boolean; - registrationEmailAsUsername?: boolean; - registrationFlow?: string; - rememberMe?: boolean; - requiredActions?: RequiredActionProviderRepresentation[]; - resetCredentialsFlow?: string; - resetPasswordAllowed?: boolean; - revokeRefreshToken?: boolean; - roles?: RolesRepresentation; - scopeMappings?: any[]; - smtpServer?: Record; - sslRequired?: string; - ssoSessionIdleTimeout?: number; - ssoSessionIdleTimeoutRememberMe?: number; - ssoSessionMaxLifespan?: number; - ssoSessionMaxLifespanRememberMe?: number; - clientSessionIdleTimeout?: number; - clientSessionMaxLifespan?: number; - supportedLocales?: string[]; - userFederationMappers?: any[]; - userFederationProviders?: any[]; - userManagedAccessAllowed?: boolean; - users?: UserRepresentation[]; - verifyEmail?: boolean; - waitIncrementSeconds?: number; -} -export type PartialImportRealmRepresentation = RealmRepresentation & { - ifResourceExists: "FAIL" | "SKIP" | "OVERWRITE"; -}; -export type PartialImportResponse = { - overwritten: number; - added: number; - skipped: number; - results: PartialImportResult[]; -}; -export type PartialImportResult = { - action: string; - resourceType: string; - resourceName: string; - id: string; -}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/realmRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/realmRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/realmRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/requiredActionProviderRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/requiredActionProviderRepresentation.d.ts deleted file mode 100644 index 7d4e63c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/requiredActionProviderRepresentation.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_requiredactionproviderrepresentation - */ -export declare enum RequiredActionAlias { - VERIFY_EMAIL = "VERIFY_EMAIL", - UPDATE_PROFILE = "UPDATE_PROFILE", - CONFIGURE_TOTP = "CONFIGURE_TOTP", - UPDATE_PASSWORD = "UPDATE_PASSWORD", - TERMS_AND_CONDITIONS = "TERMS_AND_CONDITIONS" -} -export default interface RequiredActionProviderRepresentation { - alias?: string; - config?: Record; - defaultAction?: boolean; - enabled?: boolean; - name?: string; - providerId?: string; - priority?: number; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/requiredActionProviderRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/requiredActionProviderRepresentation.js deleted file mode 100644 index eb85d04..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/requiredActionProviderRepresentation.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_requiredactionproviderrepresentation - */ -export var RequiredActionAlias; -(function (RequiredActionAlias) { - RequiredActionAlias["VERIFY_EMAIL"] = "VERIFY_EMAIL"; - RequiredActionAlias["UPDATE_PROFILE"] = "UPDATE_PROFILE"; - RequiredActionAlias["CONFIGURE_TOTP"] = "CONFIGURE_TOTP"; - RequiredActionAlias["UPDATE_PASSWORD"] = "UPDATE_PASSWORD"; - RequiredActionAlias["TERMS_AND_CONDITIONS"] = "TERMS_AND_CONDITIONS"; -})(RequiredActionAlias || (RequiredActionAlias = {})); diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/requiredActionProviderSimpleRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/requiredActionProviderSimpleRepresentation.d.ts deleted file mode 100644 index d668788..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/requiredActionProviderSimpleRepresentation.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export default interface RequiredActionProviderSimpleRepresentation { - id?: string; - name?: string; - providerId?: string; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/requiredActionProviderSimpleRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/requiredActionProviderSimpleRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/requiredActionProviderSimpleRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/resourceEvaluation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/resourceEvaluation.d.ts deleted file mode 100644 index d83a223..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/resourceEvaluation.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type ResourceRepresentation from "./resourceRepresentation.js"; -export default interface ResourceEvaluation { - roleIds?: string[]; - clientId: string; - userId: string; - resources?: ResourceRepresentation[]; - entitlements: boolean; - context: { - attributes: { - [key: string]: string; - }; - }; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/resourceEvaluation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/resourceEvaluation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/resourceEvaluation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/resourceRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/resourceRepresentation.d.ts deleted file mode 100644 index 8b8652d..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/resourceRepresentation.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_resourcerepresentation - */ -import type { ResourceOwnerRepresentation } from "./resourceServerRepresentation.js"; -import type ScopeRepresentation from "./scopeRepresentation.js"; -export default interface ResourceRepresentation { - name?: string; - type?: string; - owner?: ResourceOwnerRepresentation; - ownerManagedAccess?: boolean; - displayName?: string; - attributes?: { - [index: string]: string[]; - }; - _id?: string; - uris?: string[]; - scopes?: ScopeRepresentation[]; - icon_uri?: string; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/resourceRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/resourceRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/resourceRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/resourceServerRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/resourceServerRepresentation.d.ts deleted file mode 100644 index 550c453..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/resourceServerRepresentation.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_policyrepresentation - */ -import type PolicyRepresentation from "./policyRepresentation.js"; -import type ResourceRepresentation from "./resourceRepresentation.js"; -import type ScopeRepresentation from "./scopeRepresentation.js"; -export default interface ResourceServerRepresentation { - id?: string; - clientId?: string; - name?: string; - allowRemoteResourceManagement?: boolean; - policyEnforcementMode?: PolicyEnforcementMode; - resources?: ResourceRepresentation[]; - policies?: PolicyRepresentation[]; - scopes?: ScopeRepresentation[]; - decisionStrategy?: DecisionStrategy; -} -export interface ResourceOwnerRepresentation { - id?: string; - name?: string; -} -export interface AbstractPolicyRepresentation { - id?: string; - name?: string; - description?: string; - type?: string; - policies?: string[]; - resources?: string[]; - scopes?: string[]; - logic?: Logic; - decisionStrategy?: DecisionStrategy; - owner?: string; - resourcesData?: ResourceRepresentation[]; - scopesData?: ScopeRepresentation[]; -} -export type PolicyEnforcementMode = "ENFORCING" | "PERMISSIVE" | "DISABLED"; -export type DecisionStrategy = "AFFIRMATIVE" | "UNANIMOUS" | "CONSENSUS"; -export type Logic = "POSITIVE" | "NEGATIVE"; -export type Category = "INTERNAL" | "ACCESS" | "ID" | "ADMIN" | "USERINFO"; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/resourceServerRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/resourceServerRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/resourceServerRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/roleRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/roleRepresentation.d.ts deleted file mode 100644 index 887b120..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/roleRepresentation.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_rolerepresentation - */ -export default interface RoleRepresentation { - id?: string; - name?: string; - description?: string; - scopeParamRequired?: boolean; - composite?: boolean; - composites?: Composites; - clientRole?: boolean; - containerId?: string; - attributes?: { - [index: string]: string[]; - }; -} -export interface Composites { - realm?: string[]; - client?: { - [index: string]: string[]; - }; - application?: { - [index: string]: string[]; - }; -} -export interface RoleMappingPayload extends RoleRepresentation { - id: string; - name: string; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/roleRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/roleRepresentation.js deleted file mode 100644 index ed0b15c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/roleRepresentation.js +++ /dev/null @@ -1,4 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_rolerepresentation - */ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/rolesRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/rolesRepresentation.d.ts deleted file mode 100644 index 155909e..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/rolesRepresentation.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_rolesrepresentation - */ -import type RoleRepresentation from "./roleRepresentation.js"; -export default interface RolesRepresentation { - realm?: RoleRepresentation[]; - client?: { - [index: string]: RoleRepresentation[]; - }; - application?: { - [index: string]: RoleRepresentation[]; - }; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/rolesRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/rolesRepresentation.js deleted file mode 100644 index 59215db..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/rolesRepresentation.js +++ /dev/null @@ -1,4 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_rolesrepresentation - */ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/scopeRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/scopeRepresentation.d.ts deleted file mode 100644 index 84b4144..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/scopeRepresentation.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_scoperepresentation - */ -import type PolicyRepresentation from "./policyRepresentation.js"; -import type ResourceRepresentation from "./resourceRepresentation.js"; -export default interface ScopeRepresentation { - displayName?: string; - iconUri?: string; - id?: string; - name?: string; - policies?: PolicyRepresentation[]; - resources?: ResourceRepresentation[]; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/scopeRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/scopeRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/scopeRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/serverInfoRepesentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/serverInfoRepesentation.d.ts deleted file mode 100644 index 7ed2687..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/serverInfoRepesentation.d.ts +++ /dev/null @@ -1,94 +0,0 @@ -import type ComponentTypeRepresentation from "./componentTypeRepresentation.js"; -import type { ConfigPropertyRepresentation } from "./configPropertyRepresentation.js"; -import FeatureRepresentation from "./featureRepresentation.js"; -import type PasswordPolicyTypeRepresentation from "./passwordPolicyTypeRepresentation.js"; -import type ProfileInfoRepresentation from "./profileInfoRepresentation.js"; -import type ProtocolMapperRepresentation from "./protocolMapperRepresentation.js"; -import type SystemInfoRepresentation from "./systemInfoRepersantation.js"; -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_serverinforepresentation - */ -export interface ServerInfoRepresentation { - systemInfo?: SystemInfoRepresentation; - memoryInfo?: MemoryInfoRepresentation; - profileInfo?: ProfileInfoRepresentation; - features?: FeatureRepresentation[]; - cryptoInfo?: CryptoInfoRepresentation; - themes?: { - [index: string]: ThemeInfoRepresentation[]; - }; - socialProviders?: { - [index: string]: string; - }[]; - identityProviders?: { - [index: string]: string; - }[]; - clientImporters?: { - [index: string]: string; - }[]; - providers?: { - [index: string]: SpiInfoRepresentation; - }; - protocolMapperTypes?: { - [index: string]: ProtocolMapperTypeRepresentation[]; - }; - builtinProtocolMappers?: { - [index: string]: ProtocolMapperRepresentation[]; - }; - clientInstallations?: { - [index: string]: ClientInstallationRepresentation[]; - }; - componentTypes?: { - [index: string]: ComponentTypeRepresentation[]; - }; - passwordPolicies?: PasswordPolicyTypeRepresentation[]; - enums?: { - [index: string]: string[]; - }; -} -export interface ThemeInfoRepresentation { - name: string; - locales?: string[]; -} -export interface SpiInfoRepresentation { - internal: boolean; - providers: { - [index: string]: ProviderRepresentation; - }; -} -export interface ProviderRepresentation { - order: number; - operationalInfo?: Record; -} -export interface ClientInstallationRepresentation { - id: string; - protocol: string; - downloadOnly: boolean; - displayType: string; - helpText: string; - filename: string; - mediaType: string; -} -export interface MemoryInfoRepresentation { - total: number; - totalFormated: string; - used: number; - usedFormated: string; - free: number; - freePercentage: number; - freeFormated: string; -} -export interface ProtocolMapperTypeRepresentation { - id: string; - name: string; - category: string; - helpText: string; - priority: number; - properties: ConfigPropertyRepresentation[]; -} -export interface CryptoInfoRepresentation { - cryptoProvider: string; - supportedKeystoreTypes: string[]; - clientSignatureSymmetricAlgorithms: string[]; - clientSignatureAsymmetricAlgorithms: string[]; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/serverInfoRepesentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/serverInfoRepesentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/serverInfoRepesentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/synchronizationResultRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/synchronizationResultRepresentation.d.ts deleted file mode 100644 index cd49f6b..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/synchronizationResultRepresentation.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_synchronizationresult - */ -export default interface SynchronizationResultRepresentation { - ignored?: boolean; - added?: number; - updated?: number; - removed?: number; - failed?: number; - status?: string; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/synchronizationResultRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/synchronizationResultRepresentation.js deleted file mode 100644 index bb4beeb..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/synchronizationResultRepresentation.js +++ /dev/null @@ -1,4 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_synchronizationresult - */ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/systemInfoRepersantation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/systemInfoRepersantation.d.ts deleted file mode 100644 index c80b67a..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/systemInfoRepersantation.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_systeminforepresentation - */ -export default interface SystemInfoRepresentation { - version?: string; - serverTime?: string; - uptime?: string; - uptimeMillis?: number; - javaVersion?: string; - javaVendor?: string; - javaVm?: string; - javaVmVersion?: string; - javaRuntime?: string; - javaHome?: string; - osName?: string; - osArchitecture?: string; - osVersion?: string; - fileEncoding?: string; - userName?: string; - userDir?: string; - userTimezone?: string; - userLocale?: string; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/systemInfoRepersantation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/systemInfoRepersantation.js deleted file mode 100644 index 19f9a01..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/systemInfoRepersantation.js +++ /dev/null @@ -1,4 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_systeminforepresentation - */ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/testLdapConnection.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/testLdapConnection.d.ts deleted file mode 100644 index 4a69e95..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/testLdapConnection.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/#_testldapconnectionrepresentation - */ -export default interface TestLdapConnectionRepresentation { - action?: string; - connectionUrl?: string; - bindDn?: string; - bindCredential?: string; - useTruststoreSpi?: string; - connectionTimeout?: string; - componentId?: string; - startTls?: string; - authType?: string; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/testLdapConnection.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/testLdapConnection.js deleted file mode 100644 index 3b9b58f..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/testLdapConnection.js +++ /dev/null @@ -1,4 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/#_testldapconnectionrepresentation - */ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/userConsentRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/userConsentRepresentation.d.ts deleted file mode 100644 index 10db8ca..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/userConsentRepresentation.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/#_userconsentrepresentation - */ -export default interface UserConsentRepresentation { - clientId?: string; - createDate?: string; - grantedClientScopes?: string[]; - lastUpdatedDate?: number; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/userConsentRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/userConsentRepresentation.js deleted file mode 100644 index 4c15077..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/userConsentRepresentation.js +++ /dev/null @@ -1,4 +0,0 @@ -/** - * https://www.keycloak.org/docs-api/11.0/rest-api/#_userconsentrepresentation - */ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/userProfileMetadata.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/userProfileMetadata.d.ts deleted file mode 100644 index 5f62d6a..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/userProfileMetadata.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -export interface UserProfileConfig { - attributes?: UserProfileAttribute[]; - groups?: UserProfileGroup[]; - unmanagedAttributePolicy?: UnmanagedAttributePolicy; -} -export interface UserProfileAttribute { - name?: string; - validations?: Record; - validators?: Record; - annotations?: Record; - required?: UserProfileAttributeRequired; - readOnly?: boolean; - permissions?: UserProfileAttributePermissions; - selector?: UserProfileAttributeSelector; - displayName?: string; - group?: string; - multivalued?: boolean; -} -export interface UserProfileAttributeRequired { - roles?: string[]; - scopes?: string[]; -} -export interface UserProfileAttributePermissions { - view?: string[]; - edit?: string[]; -} -export interface UserProfileAttributeSelector { - scopes?: string[]; -} -export interface UserProfileGroup { - name?: string; - displayHeader?: string; - displayDescription?: string; - annotations?: Record; -} -export interface UserProfileAttributeMetadata { - name?: string; - displayName?: string; - required?: boolean; - readOnly?: boolean; - group?: string; - annotations?: Record; - validators?: Record>; - multivalued?: boolean; -} -export interface UserProfileAttributeGroupMetadata { - name?: string; - displayHeader?: string; - displayDescription?: string; - annotations?: Record; -} -export interface UserProfileMetadata { - attributes?: UserProfileAttributeMetadata[]; - groups?: UserProfileAttributeGroupMetadata[]; -} -export declare enum UnmanagedAttributePolicy { - Disabled = "DISABLED", - Enabled = "ENABLED", - AdminView = "ADMIN_VIEW", - AdminEdit = "ADMIN_EDIT" -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/userProfileMetadata.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/userProfileMetadata.js deleted file mode 100644 index 2f5e790..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/userProfileMetadata.js +++ /dev/null @@ -1,7 +0,0 @@ -export var UnmanagedAttributePolicy; -(function (UnmanagedAttributePolicy) { - UnmanagedAttributePolicy["Disabled"] = "DISABLED"; - UnmanagedAttributePolicy["Enabled"] = "ENABLED"; - UnmanagedAttributePolicy["AdminView"] = "ADMIN_VIEW"; - UnmanagedAttributePolicy["AdminEdit"] = "ADMIN_EDIT"; -})(UnmanagedAttributePolicy || (UnmanagedAttributePolicy = {})); diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/userRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/userRepresentation.d.ts deleted file mode 100644 index 5d26cd1..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/userRepresentation.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type CredentialRepresentation from "./credentialRepresentation.js"; -import type FederatedIdentityRepresentation from "./federatedIdentityRepresentation.js"; -import type { RequiredActionAlias } from "./requiredActionProviderRepresentation.js"; -import type UserConsentRepresentation from "./userConsentRepresentation.js"; -import type { UserProfileMetadata } from "./userProfileMetadata.js"; -export default interface UserRepresentation { - id?: string; - createdTimestamp?: number; - username?: string; - enabled?: boolean; - totp?: boolean; - emailVerified?: boolean; - disableableCredentialTypes?: string[]; - requiredActions?: (RequiredActionAlias | string)[]; - notBefore?: number; - access?: Record; - attributes?: Record; - clientConsents?: UserConsentRepresentation[]; - clientRoles?: Record; - credentials?: CredentialRepresentation[]; - email?: string; - federatedIdentities?: FederatedIdentityRepresentation[]; - federationLink?: string; - firstName?: string; - groups?: string[]; - lastName?: string; - origin?: string; - realmRoles?: string[]; - self?: string; - serviceAccountClientId?: string; - userProfileMetadata?: UserProfileMetadata; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/userRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/userRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/userRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/userSessionRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/userSessionRepresentation.d.ts deleted file mode 100644 index 18dffd3..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/userSessionRepresentation.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export default interface UserSessionRepresentation { - id?: string; - clients?: Record; - ipAddress?: string; - lastAccess?: number; - start?: number; - userId?: string; - username?: string; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/userSessionRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/userSessionRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/userSessionRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/whoAmIRepresentation.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/defs/whoAmIRepresentation.d.ts deleted file mode 100644 index 5192e6e..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/whoAmIRepresentation.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -export type AccessChecker = { - hasAll: (...types: AccessType[]) => boolean; - hasAny: (...types: AccessType[]) => boolean; -}; -export type AccessTypeFunc = (accessChecker: AccessChecker) => boolean; -export type AccessType = "view-realm" | "view-identity-providers" | "manage-identity-providers" | "impersonation" | "create-client" | "manage-users" | "query-realms" | "view-authorization" | "query-clients" | "query-users" | "manage-events" | "manage-realm" | "view-events" | "view-users" | "view-clients" | "manage-authorization" | "manage-clients" | "query-groups" | "anyone" | AccessTypeFunc; -export default interface WhoAmIRepresentation { - userId: string; - realm: string; - displayName: string; - locale: string; - createRealm: boolean; - realm_access: { - [key: string]: AccessType[]; - }; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/defs/whoAmIRepresentation.js b/node_modules/@keycloak/keycloak-admin-client/lib/defs/whoAmIRepresentation.js deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/defs/whoAmIRepresentation.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/index.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/index.d.ts deleted file mode 100644 index 3f4b49e..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { KeycloakAdminClient } from "./client.js"; -import { RequiredActionAlias } from "./defs/requiredActionProviderRepresentation.js"; -export declare const requiredAction: typeof RequiredActionAlias; -export default KeycloakAdminClient; -export { NetworkError, fetchWithError } from "./utils/fetchWithError.js"; -export type { NetworkErrorOptions } from "./utils/fetchWithError.js"; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/index.js b/node_modules/@keycloak/keycloak-admin-client/lib/index.js deleted file mode 100644 index 3fd77fd..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/index.js +++ /dev/null @@ -1,5 +0,0 @@ -import { KeycloakAdminClient } from "./client.js"; -import { RequiredActionAlias } from "./defs/requiredActionProviderRepresentation.js"; -export const requiredAction = RequiredActionAlias; -export default KeycloakAdminClient; -export { NetworkError, fetchWithError } from "./utils/fetchWithError.js"; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/resources/agent.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/resources/agent.d.ts deleted file mode 100644 index 671e286..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/resources/agent.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import type { KeycloakAdminClient } from "../client.js"; -type Method = "GET" | "POST" | "PUT" | "DELETE"; -export interface RequestArgs { - method: Method; - path?: string; - urlParamKeys?: string[]; - queryParamKeys?: string[]; - keyTransform?: Record; - catchNotFound?: boolean; - payloadKey?: string; - returnResourceIdInLocationHeader?: { - field: string; - }; - /** - * Keys to be ignored, meaning that they will not be filtered out of the request payload even if they are a part of `urlParamKeys` or `queryParamKeys`, - */ - ignoredKeys?: string[]; - headers?: HeadersInit; -} -export declare class Agent { - #private; - constructor({ client, path, getUrlParams, getBaseUrl, }: { - client: KeycloakAdminClient; - path?: string; - getUrlParams?: () => Record; - getBaseUrl?: () => string; - }); - request({ method, path, urlParamKeys, queryParamKeys, catchNotFound, keyTransform, payloadKey, returnResourceIdInLocationHeader, ignoredKeys, headers, }: RequestArgs): (payload?: any, options?: Pick) => Promise; - updateRequest({ method, path, urlParamKeys, queryParamKeys, catchNotFound, keyTransform, payloadKey, returnResourceIdInLocationHeader, headers, }: RequestArgs): (query?: any, payload?: any) => Promise; -} -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/resources/agent.js b/node_modules/@keycloak/keycloak-admin-client/lib/resources/agent.js deleted file mode 100644 index 2c799df..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/resources/agent.js +++ /dev/null @@ -1,175 +0,0 @@ -import urlJoin from "url-join"; -import { parseTemplate } from "url-template"; -import { fetchWithError, NetworkError, parseResponse, } from "../utils/fetchWithError.js"; -import { stringifyQueryParams } from "../utils/stringifyQueryParams.js"; -// constants -const SLASH = "/"; -const pick = (value, keys) => Object.fromEntries(Object.entries(value).filter(([key]) => keys.includes(key))); -const omit = (value, keys) => Object.fromEntries(Object.entries(value).filter(([key]) => !keys.includes(key))); -export class Agent { - #client; - #basePath; - #getBaseParams; - #getBaseUrl; - constructor({ client, path = "/", getUrlParams = () => ({}), getBaseUrl = () => client.baseUrl, }) { - this.#client = client; - this.#getBaseParams = getUrlParams; - this.#getBaseUrl = getBaseUrl; - this.#basePath = path; - } - request({ method, path = "", urlParamKeys = [], queryParamKeys = [], catchNotFound = false, keyTransform, payloadKey, returnResourceIdInLocationHeader, ignoredKeys, headers, }) { - return async (payload = {}, options) => { - const baseParams = this.#getBaseParams?.() ?? {}; - // Filter query parameters by queryParamKeys - const queryParams = queryParamKeys.length > 0 - ? pick(payload, queryParamKeys) - : undefined; - // Add filtered payload parameters to base parameters - const allUrlParamKeys = [...Object.keys(baseParams), ...urlParamKeys]; - const urlParams = { ...baseParams, ...pick(payload, allUrlParamKeys) }; - if (!(payload instanceof FormData)) { - // Omit url parameters and query parameters from payload - const omittedKeys = ignoredKeys - ? [...allUrlParamKeys, ...queryParamKeys].filter((key) => !ignoredKeys.includes(key)) - : [...allUrlParamKeys, ...queryParamKeys]; - payload = omit(payload, omittedKeys); - } - // Transform keys of both payload and queryParams - if (keyTransform) { - this.#transformKey(payload, keyTransform); - this.#transformKey(queryParams, keyTransform); - } - return this.#requestWithParams({ - method, - path, - payload, - urlParams, - queryParams, - // catchNotFound precedence: global > local > default - catchNotFound, - ...(this.#client.getGlobalRequestArgOptions() ?? options ?? {}), - payloadKey, - returnResourceIdInLocationHeader, - headers, - }); - }; - } - updateRequest({ method, path = "", urlParamKeys = [], queryParamKeys = [], catchNotFound = false, keyTransform, payloadKey, returnResourceIdInLocationHeader, headers, }) { - return async (query = {}, payload = {}) => { - const baseParams = this.#getBaseParams?.() ?? {}; - // Filter query parameters by queryParamKeys - const queryParams = queryParamKeys - ? pick(query, queryParamKeys) - : undefined; - // Add filtered query parameters to base parameters - const allUrlParamKeys = [...Object.keys(baseParams), ...urlParamKeys]; - const urlParams = { - ...baseParams, - ...pick(query, allUrlParamKeys), - }; - // Transform keys of queryParams - if (keyTransform) { - this.#transformKey(queryParams, keyTransform); - } - return this.#requestWithParams({ - method, - path, - payload, - urlParams, - queryParams, - catchNotFound, - payloadKey, - returnResourceIdInLocationHeader, - headers, - }); - }; - } - async #requestWithParams({ method, path, payload, urlParams, queryParams, catchNotFound, payloadKey, returnResourceIdInLocationHeader, headers, }) { - const newPath = urlJoin(this.#basePath, path); - // Parse template and replace with values from urlParams - const pathTemplate = parseTemplate(newPath); - const parsedPath = pathTemplate.expand(urlParams); - const url = new URL(`${this.#getBaseUrl?.() ?? ""}${parsedPath}`); - const requestOptions = { ...this.#client.getRequestOptions() }; - const requestHeaders = new Headers([ - ...new Headers(requestOptions.headers).entries(), - ["authorization", `Bearer ${await this.#client.getAccessToken()}`], - ["accept", "application/json, text/plain, */*"], - ...new Headers(headers).entries(), - ]); - const searchParams = {}; - // Add payload parameters to search params if method is 'GET'. - if (method === "GET") { - Object.assign(searchParams, payload); - } - else if (requestHeaders.get("content-type") === "text/plain") { - // Pass the payload as a plain string if the content type is 'text/plain'. - requestOptions.body = payload; - } - else if (payload instanceof FormData) { - requestOptions.body = payload; - } - else { - // Otherwise assume it's JSON and stringify it. - requestOptions.body = JSON.stringify(payloadKey ? payload[payloadKey] : payload); - } - if (!requestHeaders.has("content-type") && !(payload instanceof FormData)) { - requestHeaders.set("content-type", "application/json"); - } - if (queryParams) { - Object.assign(searchParams, queryParams); - } - url.search = stringifyQueryParams(searchParams); - try { - const res = await fetchWithError(url, { - ...requestOptions, - headers: requestHeaders, - method, - }); - // now we get the response of the http request - // if `resourceIdInLocationHeader` is true, we'll get the resourceId from the location header field - // todo: find a better way to find the id in path, maybe some kind of pattern matching - // for now, we simply split the last sub-path of the path returned in location header field - if (returnResourceIdInLocationHeader) { - const locationHeader = res.headers.get("location"); - if (typeof locationHeader !== "string") { - throw new Error(`location header is not found in request: ${res.url}`); - } - const resourceId = locationHeader.split(SLASH).pop(); - if (!resourceId) { - // throw an error to let users know the response is not expected - throw new Error(`resourceId is not found in Location header from request: ${res.url}`); - } - // return with format {[field]: string} - const { field } = returnResourceIdInLocationHeader; - return { [field]: resourceId }; - } - if (Object.entries(headers || []).find(([key, value]) => key.toLowerCase() === "accept" && - value === "application/octet-stream")) { - return res.arrayBuffer(); - } - return parseResponse(res); - } - catch (err) { - if (err instanceof NetworkError && - err.response.status === 404 && - catchNotFound) { - return null; - } - throw err; - } - } - #transformKey(payload, keyMapping) { - if (!payload) { - return; - } - Object.keys(keyMapping).some((key) => { - if (typeof payload[key] === "undefined") { - return false; - } - const newKey = keyMapping[key]; - payload[newKey] = payload[key]; - delete payload[key]; - }); - } -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/resources/attackDetection.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/resources/attackDetection.d.ts deleted file mode 100644 index d0fbb2d..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/resources/attackDetection.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import Resource from "./resource.js"; -import type KeycloakAdminClient from "../index.js"; -export declare class AttackDetection extends Resource<{ - realm?: string; -}> { - findOne: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise | undefined>; - del: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - delAll: (payload?: { - realm?: string | undefined; - } | undefined, options?: Pick | undefined) => Promise; - constructor(client: KeycloakAdminClient); -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/resources/attackDetection.js b/node_modules/@keycloak/keycloak-admin-client/lib/resources/attackDetection.js deleted file mode 100644 index 737e7cb..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/resources/attackDetection.js +++ /dev/null @@ -1,27 +0,0 @@ -import Resource from "./resource.js"; -export class AttackDetection extends Resource { - findOne = this.makeRequest({ - method: "GET", - path: "/users/{id}", - urlParamKeys: ["id"], - catchNotFound: true, - }); - del = this.makeRequest({ - method: "DELETE", - path: "/users/{id}", - urlParamKeys: ["id"], - }); - delAll = this.makeRequest({ - method: "DELETE", - path: "/users", - }); - constructor(client) { - super(client, { - path: "/admin/realms/{realm}/attack-detection/brute-force", - getUrlParams: () => ({ - realm: client.realmName, - }), - getBaseUrl: () => client.baseUrl, - }); - } -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/resources/authenticationManagement.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/resources/authenticationManagement.d.ts deleted file mode 100644 index e4ac126..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/resources/authenticationManagement.d.ts +++ /dev/null @@ -1,157 +0,0 @@ -import Resource from "./resource.js"; -import type RequiredActionProviderRepresentation from "../defs/requiredActionProviderRepresentation.js"; -import type { KeycloakAdminClient } from "../client.js"; -import type AuthenticationExecutionInfoRepresentation from "../defs/authenticationExecutionInfoRepresentation.js"; -import type AuthenticationFlowRepresentation from "../defs/authenticationFlowRepresentation.js"; -import type AuthenticatorConfigRepresentation from "../defs/authenticatorConfigRepresentation.js"; -import type { AuthenticationProviderRepresentation } from "../defs/authenticatorConfigRepresentation.js"; -import type AuthenticatorConfigInfoRepresentation from "../defs/authenticatorConfigInfoRepresentation.js"; -import type RequiredActionProviderSimpleRepresentation from "../defs/requiredActionProviderSimpleRepresentation.js"; -export declare class AuthenticationManagement extends Resource<{ - realm?: string; -}> { - /** - * Authentication Management - * https://www.keycloak.org/docs-api/8.0/rest-api/index.html#_authentication_management_resource - */ - registerRequiredAction: (payload?: (Record & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - getRequiredActions: (payload?: (void & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - getRequiredActionForAlias: (payload?: ({ - alias: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - getClientAuthenticatorProviders: (payload?: (void & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - getAuthenticatorProviders: (payload?: (void & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - getFormActionProviders: (payload?: (void & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - updateRequiredAction: (query: { - alias: string; - } & { - realm?: string | undefined; - }, payload: RequiredActionProviderRepresentation) => Promise; - deleteRequiredAction: (payload?: ({ - alias: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - lowerRequiredActionPriority: (payload?: ({ - alias: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - raiseRequiredActionPriority: (payload?: ({ - alias: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - getUnregisteredRequiredActions: (payload?: (void & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - getFlows: (payload?: { - realm?: string | undefined; - } | undefined, options?: Pick | undefined) => Promise; - getFlow: (payload?: ({ - flowId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - getFormProviders: (payload?: (void & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - createFlow: (payload?: (AuthenticationFlowRepresentation & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - copyFlow: (payload?: ({ - flow: string; - newName: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - deleteFlow: (payload?: ({ - flowId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - updateFlow: (query: { - flowId: string; - } & { - realm?: string | undefined; - }, payload: AuthenticationFlowRepresentation) => Promise; - getExecutions: (payload?: ({ - flow: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - addExecution: (query: { - flow: string; - } & { - realm?: string | undefined; - }, payload: AuthenticationExecutionInfoRepresentation) => Promise; - addExecutionToFlow: (payload?: ({ - flow: string; - provider: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - addFlowToFlow: (payload?: ({ - flow: string; - alias: string; - type: string; - provider: string; - description: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - updateExecution: (query: { - flow: string; - } & { - realm?: string | undefined; - }, payload: AuthenticationExecutionInfoRepresentation) => Promise; - delExecution: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - lowerPriorityExecution: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - raisePriorityExecution: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - getConfigDescription: (payload?: ({ - providerId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - createConfig: (payload?: (AuthenticatorConfigRepresentation & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - updateConfig: (payload?: (AuthenticatorConfigRepresentation & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - getConfig: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - delConfig: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - constructor(client: KeycloakAdminClient); -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/resources/authenticationManagement.js b/node_modules/@keycloak/keycloak-admin-client/lib/resources/authenticationManagement.js deleted file mode 100644 index c539927..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/resources/authenticationManagement.js +++ /dev/null @@ -1,175 +0,0 @@ -import Resource from "./resource.js"; -export class AuthenticationManagement extends Resource { - /** - * Authentication Management - * https://www.keycloak.org/docs-api/8.0/rest-api/index.html#_authentication_management_resource - */ - // Register a new required action - registerRequiredAction = this.makeRequest({ - method: "POST", - path: "/register-required-action", - }); - // Get required actions. Returns a list of required actions. - getRequiredActions = this.makeRequest({ - method: "GET", - path: "/required-actions", - }); - // Get required action for alias - getRequiredActionForAlias = this.makeRequest({ - method: "GET", - path: "/required-actions/{alias}", - urlParamKeys: ["alias"], - catchNotFound: true, - }); - getClientAuthenticatorProviders = this.makeRequest({ - method: "GET", - path: "/client-authenticator-providers", - }); - getAuthenticatorProviders = this.makeRequest({ - method: "GET", - path: "/authenticator-providers", - }); - getFormActionProviders = this.makeRequest({ - method: "GET", - path: "/form-action-providers", - }); - // Update required action - updateRequiredAction = this.makeUpdateRequest({ - method: "PUT", - path: "/required-actions/{alias}", - urlParamKeys: ["alias"], - }); - // Delete required action - deleteRequiredAction = this.makeRequest({ - method: "DELETE", - path: "/required-actions/{alias}", - urlParamKeys: ["alias"], - }); - // Lower required action’s priority - lowerRequiredActionPriority = this.makeRequest({ - method: "POST", - path: "/required-actions/{alias}/lower-priority", - urlParamKeys: ["alias"], - }); - // Raise required action’s priority - raiseRequiredActionPriority = this.makeRequest({ - method: "POST", - path: "/required-actions/{alias}/raise-priority", - urlParamKeys: ["alias"], - }); - // Get unregistered required actions Returns a list of unregistered required actions. - getUnregisteredRequiredActions = this.makeRequest({ - method: "GET", - path: "/unregistered-required-actions", - }); - getFlows = this.makeRequest({ - method: "GET", - path: "/flows", - }); - getFlow = this.makeRequest({ - method: "GET", - path: "/flows/{flowId}", - urlParamKeys: ["flowId"], - }); - getFormProviders = this.makeRequest({ - method: "GET", - path: "/form-providers", - }); - createFlow = this.makeRequest({ - method: "POST", - path: "/flows", - returnResourceIdInLocationHeader: { field: "id" }, - }); - copyFlow = this.makeRequest({ - method: "POST", - path: "/flows/{flow}/copy", - urlParamKeys: ["flow"], - }); - deleteFlow = this.makeRequest({ - method: "DELETE", - path: "/flows/{flowId}", - urlParamKeys: ["flowId"], - }); - updateFlow = this.makeUpdateRequest({ - method: "PUT", - path: "/flows/{flowId}", - urlParamKeys: ["flowId"], - }); - getExecutions = this.makeRequest({ - method: "GET", - path: "/flows/{flow}/executions", - urlParamKeys: ["flow"], - }); - addExecution = this.makeUpdateRequest({ - method: "POST", - path: "/flows/{flow}/executions", - urlParamKeys: ["flow"], - }); - addExecutionToFlow = this.makeRequest({ - method: "POST", - path: "/flows/{flow}/executions/execution", - urlParamKeys: ["flow"], - returnResourceIdInLocationHeader: { field: "id" }, - }); - addFlowToFlow = this.makeRequest({ - method: "POST", - path: "/flows/{flow}/executions/flow", - urlParamKeys: ["flow"], - returnResourceIdInLocationHeader: { field: "id" }, - }); - updateExecution = this.makeUpdateRequest({ - method: "PUT", - path: "/flows/{flow}/executions", - urlParamKeys: ["flow"], - }); - delExecution = this.makeRequest({ - method: "DELETE", - path: "/executions/{id}", - urlParamKeys: ["id"], - }); - lowerPriorityExecution = this.makeRequest({ - method: "POST", - path: "/executions/{id}/lower-priority", - urlParamKeys: ["id"], - }); - raisePriorityExecution = this.makeRequest({ - method: "POST", - path: "/executions/{id}/raise-priority", - urlParamKeys: ["id"], - }); - getConfigDescription = this.makeRequest({ - method: "GET", - path: "config-description/{providerId}", - urlParamKeys: ["providerId"], - }); - createConfig = this.makeRequest({ - method: "POST", - path: "/executions/{id}/config", - urlParamKeys: ["id"], - returnResourceIdInLocationHeader: { field: "id" }, - }); - updateConfig = this.makeRequest({ - method: "PUT", - path: "/config/{id}", - urlParamKeys: ["id"], - }); - getConfig = this.makeRequest({ - method: "GET", - path: "/config/{id}", - urlParamKeys: ["id"], - }); - delConfig = this.makeRequest({ - method: "DELETE", - path: "/config/{id}", - urlParamKeys: ["id"], - }); - constructor(client) { - super(client, { - path: "/admin/realms/{realm}/authentication", - getUrlParams: () => ({ - realm: client.realmName, - }), - getBaseUrl: () => client.baseUrl, - }); - } -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/resources/cache.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/resources/cache.d.ts deleted file mode 100644 index 200700a..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/resources/cache.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import Resource from "./resource.js"; -import type { KeycloakAdminClient } from "../client.js"; -export declare class Cache extends Resource<{ - realm?: string; -}> { - clearUserCache: (payload?: { - realm?: string | undefined; - } | undefined, options?: Pick | undefined) => Promise; - constructor(client: KeycloakAdminClient); -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/resources/cache.js b/node_modules/@keycloak/keycloak-admin-client/lib/resources/cache.js deleted file mode 100644 index b37b8bd..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/resources/cache.js +++ /dev/null @@ -1,16 +0,0 @@ -import Resource from "./resource.js"; -export class Cache extends Resource { - clearUserCache = this.makeRequest({ - method: "POST", - path: "/clear-user-cache", - }); - constructor(client) { - super(client, { - path: "/admin/realms/{realm}", - getUrlParams: () => ({ - realm: client.realmName, - }), - getBaseUrl: () => client.baseUrl, - }); - } -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/resources/clientPolicies.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/resources/clientPolicies.d.ts deleted file mode 100644 index 29814ce..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/resources/clientPolicies.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import Resource from "./resource.js"; -import type { KeycloakAdminClient } from "../client.js"; -import type ClientProfilesRepresentation from "../defs/clientProfilesRepresentation.js"; -import type ClientPoliciesRepresentation from "../defs/clientPoliciesRepresentation.js"; -/** - * https://www.keycloak.org/docs-api/15.0/rest-api/#_client_registration_policy_resource - */ -export declare class ClientPolicies extends Resource<{ - realm?: string; -}> { - constructor(client: KeycloakAdminClient); - listProfiles: (payload?: ({ - includeGlobalProfiles?: boolean | undefined; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - createProfiles: (payload?: (ClientProfilesRepresentation & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - listPolicies: (payload?: { - realm?: string | undefined; - } | undefined, options?: Pick | undefined) => Promise; - updatePolicy: (payload?: (ClientPoliciesRepresentation & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/resources/clientPolicies.js b/node_modules/@keycloak/keycloak-admin-client/lib/resources/clientPolicies.js deleted file mode 100644 index 6554b77..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/resources/clientPolicies.js +++ /dev/null @@ -1,37 +0,0 @@ -import Resource from "./resource.js"; -/** - * https://www.keycloak.org/docs-api/15.0/rest-api/#_client_registration_policy_resource - */ -export class ClientPolicies extends Resource { - constructor(client) { - super(client, { - path: "/admin/realms/{realm}/client-policies", - getUrlParams: () => ({ - realm: client.realmName, - }), - getBaseUrl: () => client.baseUrl, - }); - } - /* Client Profiles */ - listProfiles = this.makeRequest({ - method: "GET", - path: "/profiles", - queryParamKeys: ["include-global-profiles"], - keyTransform: { - includeGlobalProfiles: "include-global-profiles", - }, - }); - createProfiles = this.makeRequest({ - method: "PUT", - path: "/profiles", - }); - /* Client Policies */ - listPolicies = this.makeRequest({ - method: "GET", - path: "/policies", - }); - updatePolicy = this.makeRequest({ - method: "PUT", - path: "/policies", - }); -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/resources/clientScopes.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/resources/clientScopes.d.ts deleted file mode 100644 index 443d12c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/resources/clientScopes.d.ts +++ /dev/null @@ -1,196 +0,0 @@ -import type ClientScopeRepresentation from "../defs/clientScopeRepresentation.js"; -import Resource from "./resource.js"; -import type { KeycloakAdminClient } from "../client.js"; -import type ProtocolMapperRepresentation from "../defs/protocolMapperRepresentation.js"; -import type MappingsRepresentation from "../defs/mappingsRepresentation.js"; -import type RoleRepresentation from "../defs/roleRepresentation.js"; -export declare class ClientScopes extends Resource<{ - realm?: string; -}> { - find: (payload?: { - realm?: string | undefined; - } | undefined, options?: Pick | undefined) => Promise; - create: (payload?: (ClientScopeRepresentation & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise<{ - id: string; - }>; - /** - * Client-Scopes by id - */ - findOne: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - update: (query: { - id: string; - } & { - realm?: string | undefined; - }, payload: ClientScopeRepresentation) => Promise; - del: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - /** - * Default Client-Scopes - */ - listDefaultClientScopes: (payload?: (void & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - addDefaultClientScope: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - delDefaultClientScope: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - /** - * Default Optional Client-Scopes - */ - listDefaultOptionalClientScopes: (payload?: (void & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - addDefaultOptionalClientScope: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - delDefaultOptionalClientScope: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - /** - * Protocol Mappers - */ - addMultipleProtocolMappers: (query: { - id: string; - } & { - realm?: string | undefined; - }, payload: ProtocolMapperRepresentation[]) => Promise; - addProtocolMapper: (query: { - id: string; - } & { - realm?: string | undefined; - }, payload: ProtocolMapperRepresentation) => Promise; - listProtocolMappers: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - findProtocolMapper: (payload?: ({ - id: string; - mapperId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - findProtocolMappersByProtocol: (payload?: ({ - id: string; - protocol: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - updateProtocolMapper: (query: { - id: string; - mapperId: string; - } & { - realm?: string | undefined; - }, payload: ProtocolMapperRepresentation) => Promise; - delProtocolMapper: (payload?: ({ - id: string; - mapperId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - /** - * Scope Mappings - */ - listScopeMappings: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - addClientScopeMappings: (query: { - id: string; - client: string; - } & { - realm?: string | undefined; - }, payload: RoleRepresentation[]) => Promise; - listClientScopeMappings: (payload?: ({ - id: string; - client: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - listAvailableClientScopeMappings: (payload?: ({ - id: string; - client: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - listCompositeClientScopeMappings: (payload?: ({ - id: string; - client: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - delClientScopeMappings: (query: { - id: string; - client: string; - } & { - realm?: string | undefined; - }, payload: RoleRepresentation[]) => Promise; - addRealmScopeMappings: (query: { - id: string; - } & { - realm?: string | undefined; - }, payload: RoleRepresentation[]) => Promise; - listRealmScopeMappings: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - listAvailableRealmScopeMappings: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - listCompositeRealmScopeMappings: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - delRealmScopeMappings: (query: { - id: string; - } & { - realm?: string | undefined; - }, payload: RoleRepresentation[]) => Promise; - constructor(client: KeycloakAdminClient); - /** - * Find client scope by name. - */ - findOneByName(payload: { - realm?: string; - name: string; - }): Promise; - /** - * Delete client scope by name. - */ - delByName(payload: { - realm?: string; - name: string; - }): Promise; - /** - * Find single protocol mapper by name. - */ - findProtocolMapperByName(payload: { - realm?: string; - id: string; - name: string; - }): Promise; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/resources/clientScopes.js b/node_modules/@keycloak/keycloak-admin-client/lib/resources/clientScopes.js deleted file mode 100644 index b1e79f3..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/resources/clientScopes.js +++ /dev/null @@ -1,204 +0,0 @@ -import Resource from "./resource.js"; -export class ClientScopes extends Resource { - find = this.makeRequest({ - method: "GET", - path: "/client-scopes", - }); - create = this.makeRequest({ - method: "POST", - path: "/client-scopes", - returnResourceIdInLocationHeader: { field: "id" }, - }); - /** - * Client-Scopes by id - */ - findOne = this.makeRequest({ - method: "GET", - path: "/client-scopes/{id}", - urlParamKeys: ["id"], - catchNotFound: true, - }); - update = this.makeUpdateRequest({ - method: "PUT", - path: "/client-scopes/{id}", - urlParamKeys: ["id"], - }); - del = this.makeRequest({ - method: "DELETE", - path: "/client-scopes/{id}", - urlParamKeys: ["id"], - }); - /** - * Default Client-Scopes - */ - listDefaultClientScopes = this.makeRequest({ - method: "GET", - path: "/default-default-client-scopes", - }); - addDefaultClientScope = this.makeRequest({ - method: "PUT", - path: "/default-default-client-scopes/{id}", - urlParamKeys: ["id"], - }); - delDefaultClientScope = this.makeRequest({ - method: "DELETE", - path: "/default-default-client-scopes/{id}", - urlParamKeys: ["id"], - }); - /** - * Default Optional Client-Scopes - */ - listDefaultOptionalClientScopes = this.makeRequest({ - method: "GET", - path: "/default-optional-client-scopes", - }); - addDefaultOptionalClientScope = this.makeRequest({ - method: "PUT", - path: "/default-optional-client-scopes/{id}", - urlParamKeys: ["id"], - }); - delDefaultOptionalClientScope = this.makeRequest({ - method: "DELETE", - path: "/default-optional-client-scopes/{id}", - urlParamKeys: ["id"], - }); - /** - * Protocol Mappers - */ - addMultipleProtocolMappers = this.makeUpdateRequest({ - method: "POST", - path: "/client-scopes/{id}/protocol-mappers/add-models", - urlParamKeys: ["id"], - }); - addProtocolMapper = this.makeUpdateRequest({ - method: "POST", - path: "/client-scopes/{id}/protocol-mappers/models", - urlParamKeys: ["id"], - }); - listProtocolMappers = this.makeRequest({ - method: "GET", - path: "/client-scopes/{id}/protocol-mappers/models", - urlParamKeys: ["id"], - }); - findProtocolMapper = this.makeRequest({ - method: "GET", - path: "/client-scopes/{id}/protocol-mappers/models/{mapperId}", - urlParamKeys: ["id", "mapperId"], - catchNotFound: true, - }); - findProtocolMappersByProtocol = this.makeRequest({ - method: "GET", - path: "/client-scopes/{id}/protocol-mappers/protocol/{protocol}", - urlParamKeys: ["id", "protocol"], - catchNotFound: true, - }); - updateProtocolMapper = this.makeUpdateRequest({ - method: "PUT", - path: "/client-scopes/{id}/protocol-mappers/models/{mapperId}", - urlParamKeys: ["id", "mapperId"], - }); - delProtocolMapper = this.makeRequest({ - method: "DELETE", - path: "/client-scopes/{id}/protocol-mappers/models/{mapperId}", - urlParamKeys: ["id", "mapperId"], - }); - /** - * Scope Mappings - */ - listScopeMappings = this.makeRequest({ - method: "GET", - path: "/client-scopes/{id}/scope-mappings", - urlParamKeys: ["id"], - }); - addClientScopeMappings = this.makeUpdateRequest({ - method: "POST", - path: "/client-scopes/{id}/scope-mappings/clients/{client}", - urlParamKeys: ["id", "client"], - }); - listClientScopeMappings = this.makeRequest({ - method: "GET", - path: "/client-scopes/{id}/scope-mappings/clients/{client}", - urlParamKeys: ["id", "client"], - }); - listAvailableClientScopeMappings = this.makeRequest({ - method: "GET", - path: "/client-scopes/{id}/scope-mappings/clients/{client}/available", - urlParamKeys: ["id", "client"], - }); - listCompositeClientScopeMappings = this.makeRequest({ - method: "GET", - path: "/client-scopes/{id}/scope-mappings/clients/{client}/composite", - urlParamKeys: ["id", "client"], - }); - delClientScopeMappings = this.makeUpdateRequest({ - method: "DELETE", - path: "/client-scopes/{id}/scope-mappings/clients/{client}", - urlParamKeys: ["id", "client"], - }); - addRealmScopeMappings = this.makeUpdateRequest({ - method: "POST", - path: "/client-scopes/{id}/scope-mappings/realm", - urlParamKeys: ["id"], - }); - listRealmScopeMappings = this.makeRequest({ - method: "GET", - path: "/client-scopes/{id}/scope-mappings/realm", - urlParamKeys: ["id"], - }); - listAvailableRealmScopeMappings = this.makeRequest({ - method: "GET", - path: "/client-scopes/{id}/scope-mappings/realm/available", - urlParamKeys: ["id"], - }); - listCompositeRealmScopeMappings = this.makeRequest({ - method: "GET", - path: "/client-scopes/{id}/scope-mappings/realm/composite", - urlParamKeys: ["id"], - }); - delRealmScopeMappings = this.makeUpdateRequest({ - method: "DELETE", - path: "/client-scopes/{id}/scope-mappings/realm", - urlParamKeys: ["id"], - }); - constructor(client) { - super(client, { - path: "/admin/realms/{realm}", - getUrlParams: () => ({ - realm: client.realmName, - }), - getBaseUrl: () => client.baseUrl, - }); - } - /** - * Find client scope by name. - */ - async findOneByName(payload) { - const allScopes = await this.find({ - ...(payload.realm ? { realm: payload.realm } : {}), - }); - return allScopes.find((item) => item.name === payload.name); - } - /** - * Delete client scope by name. - */ - async delByName(payload) { - const scope = await this.findOneByName(payload); - if (!scope) { - throw new Error("Scope not found."); - } - await this.del({ - ...(payload.realm ? { realm: payload.realm } : {}), - id: scope.id, - }); - } - /** - * Find single protocol mapper by name. - */ - async findProtocolMapperByName(payload) { - const allProtocolMappers = await this.listProtocolMappers({ - id: payload.id, - ...(payload.realm ? { realm: payload.realm } : {}), - }); - return allProtocolMappers.find((mapper) => mapper.name === payload.name); - } -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/resources/clients.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/resources/clients.d.ts deleted file mode 100644 index 125ac25..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/resources/clients.d.ts +++ /dev/null @@ -1,671 +0,0 @@ -import type { KeycloakAdminClient } from "../client.js"; -import type CertificateRepresentation from "../defs/certificateRepresentation.js"; -import type ClientRepresentation from "../defs/clientRepresentation.js"; -import type ClientScopeRepresentation from "../defs/clientScopeRepresentation.js"; -import type CredentialRepresentation from "../defs/credentialRepresentation.js"; -import type GlobalRequestResult from "../defs/globalRequestResult.js"; -import type KeyStoreConfig from "../defs/keystoreConfig.js"; -import type { ManagementPermissionReference } from "../defs/managementPermissionReference.js"; -import type MappingsRepresentation from "../defs/mappingsRepresentation.js"; -import type PolicyEvaluationResponse from "../defs/policyEvaluationResponse.js"; -import type PolicyProviderRepresentation from "../defs/policyProviderRepresentation.js"; -import type PolicyRepresentation from "../defs/policyRepresentation.js"; -import type ProtocolMapperRepresentation from "../defs/protocolMapperRepresentation.js"; -import type ResourceEvaluation from "../defs/resourceEvaluation.js"; -import type ResourceRepresentation from "../defs/resourceRepresentation.js"; -import type ResourceServerRepresentation from "../defs/resourceServerRepresentation.js"; -import type RoleRepresentation from "../defs/roleRepresentation.js"; -import type ScopeRepresentation from "../defs/scopeRepresentation.js"; -import type UserRepresentation from "../defs/userRepresentation.js"; -import type UserSessionRepresentation from "../defs/userSessionRepresentation.js"; -import Resource from "./resource.js"; -export interface PaginatedQuery { - first?: number; - max?: number; -} -export interface ClientQuery extends PaginatedQuery { - clientId?: string; - viewableOnly?: boolean; - search?: boolean; -} -export interface ResourceQuery extends PaginatedQuery { - id?: string; - name?: string; - type?: string; - owner?: string; - uri?: string; - deep?: boolean; -} -export interface PolicyQuery extends PaginatedQuery { - id?: string; - name?: string; - type?: string; - resource?: string; - scope?: string; - permission?: string; - owner?: string; - fields?: string; -} -export declare class Clients extends Resource<{ - realm?: string; -}> { - find: (payload?: (ClientQuery & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - create: (payload?: (ClientRepresentation & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise<{ - id: string; - }>; - /** - * Single client - */ - findOne: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - update: (query: { - id: string; - } & { - realm?: string | undefined; - }, payload: ClientRepresentation) => Promise; - del: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - /** - * Client roles - */ - createRole: (payload?: (RoleRepresentation & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise<{ - roleName: string; - }>; - listRoles: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - findRole: (payload?: ({ - id: string; - roleName: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - updateRole: (query: { - id: string; - roleName: string; - } & { - realm?: string | undefined; - }, payload: RoleRepresentation) => Promise; - delRole: (payload?: ({ - id: string; - roleName: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - findUsersWithRole: (payload?: ({ - id: string; - roleName: string; - first?: number | undefined; - max?: number | undefined; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - /** - * Service account user - */ - getServiceAccountUser: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - /** - * Client secret - */ - generateNewClientSecret: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - invalidateSecret: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - generateRegistrationAccessToken: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise<{ - registrationAccessToken: string; - }>; - getClientSecret: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - /** - * Client Scopes - */ - listDefaultClientScopes: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - addDefaultClientScope: (payload?: ({ - id: string; - clientScopeId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - delDefaultClientScope: (payload?: ({ - id: string; - clientScopeId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - listOptionalClientScopes: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - addOptionalClientScope: (payload?: ({ - id: string; - clientScopeId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - delOptionalClientScope: (payload?: ({ - id: string; - clientScopeId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - /** - * Protocol Mappers - */ - addMultipleProtocolMappers: (query: { - id: string; - } & { - realm?: string | undefined; - }, payload: ProtocolMapperRepresentation[]) => Promise; - addProtocolMapper: (query: { - id: string; - } & { - realm?: string | undefined; - }, payload: ProtocolMapperRepresentation) => Promise; - listProtocolMappers: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - findProtocolMapperById: (payload?: ({ - id: string; - mapperId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - findProtocolMappersByProtocol: (payload?: ({ - id: string; - protocol: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - updateProtocolMapper: (query: { - id: string; - mapperId: string; - } & { - realm?: string | undefined; - }, payload: ProtocolMapperRepresentation) => Promise; - delProtocolMapper: (payload?: ({ - id: string; - mapperId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - /** - * Scope Mappings - */ - listScopeMappings: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - addClientScopeMappings: (query: { - id: string; - client: string; - } & { - realm?: string | undefined; - }, payload: RoleRepresentation[]) => Promise; - listClientScopeMappings: (payload?: ({ - id: string; - client: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - listAvailableClientScopeMappings: (payload?: ({ - id: string; - client: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - listCompositeClientScopeMappings: (payload?: ({ - id: string; - client: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - delClientScopeMappings: (query: { - id: string; - client: string; - } & { - realm?: string | undefined; - }, payload: RoleRepresentation[]) => Promise; - evaluatePermission: (payload?: ({ - id: string; - roleContainer: string; - type: "granted" | "not-granted"; - scope: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - evaluateListProtocolMapper: (payload?: ({ - id: string; - scope: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - evaluateGenerateAccessToken: (payload?: ({ - id: string; - scope: string; - userId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise>; - evaluateGenerateUserInfo: (payload?: ({ - id: string; - scope: string; - userId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise>; - evaluateGenerateIdToken: (payload?: ({ - id: string; - scope: string; - userId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise>; - addRealmScopeMappings: (query: { - id: string; - } & { - realm?: string | undefined; - }, payload: RoleRepresentation[]) => Promise; - listRealmScopeMappings: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - listAvailableRealmScopeMappings: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - listCompositeRealmScopeMappings: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - delRealmScopeMappings: (query: { - id: string; - } & { - realm?: string | undefined; - }, payload: RoleRepresentation[]) => Promise; - /** - * Sessions - */ - listSessions: (payload?: ({ - id: string; - first?: number | undefined; - max?: number | undefined; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - listOfflineSessions: (payload?: ({ - id: string; - first?: number | undefined; - max?: number | undefined; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - getSessionCount: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise<{ - count: number; - }>; - /** - * Resource - */ - getResourceServer: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - updateResourceServer: (query: { - id: string; - } & { - realm?: string | undefined; - }, payload: ResourceServerRepresentation) => Promise; - listResources: (payload?: (ResourceQuery & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - createResource: (query: { - id: string; - } & { - realm?: string | undefined; - }, payload: ResourceRepresentation) => Promise; - getResource: (payload?: ({ - id: string; - resourceId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - updateResource: (query: { - id: string; - resourceId: string; - } & { - realm?: string | undefined; - }, payload: ResourceRepresentation) => Promise; - delResource: (payload?: ({ - id: string; - resourceId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - importResource: (query: { - id: string; - } & { - realm?: string | undefined; - }, payload: ResourceServerRepresentation) => Promise; - exportResource: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - evaluateResource: (query: { - id: string; - } & { - realm?: string | undefined; - }, payload: ResourceEvaluation) => Promise; - /** - * Policy - */ - listPolicies: (payload?: (PolicyQuery & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise<"" | PolicyRepresentation[]>; - findPolicyByName: (payload?: ({ - id: string; - name: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - updatePolicy: (query: { - id: string; - type: string; - policyId: string; - } & { - realm?: string | undefined; - }, payload: PolicyRepresentation) => Promise; - createPolicy: (query: { - id: string; - type: string; - } & { - realm?: string | undefined; - }, payload: PolicyRepresentation) => Promise; - findOnePolicy: (payload?: ({ - id: string; - type: string; - policyId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - listDependentPolicies: (payload?: ({ - id: string; - policyId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - delPolicy: (payload?: ({ - id: string; - policyId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - listPolicyProviders: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - createOrUpdatePolicy(payload: { - id: string; - policyName: string; - policy: PolicyRepresentation; - }): Promise; - /** - * Scopes - */ - listAllScopes: (payload?: ({ - id: string; - name?: string | undefined; - deep?: boolean | undefined; - } & PaginatedQuery & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - listAllResourcesByScope: (payload?: ({ - id: string; - scopeId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - listAllPermissionsByScope: (payload?: ({ - id: string; - scopeId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - listPermissionsByResource: (payload?: ({ - id: string; - resourceId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - listScopesByResource: (payload?: ({ - id: string; - resourceName: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise<{ - id: string; - name: string; - }[]>; - createAuthorizationScope: (query: { - id: string; - } & { - realm?: string | undefined; - }, payload: ScopeRepresentation) => Promise; - updateAuthorizationScope: (query: { - id: string; - scopeId: string; - } & { - realm?: string | undefined; - }, payload: ScopeRepresentation) => Promise; - getAuthorizationScope: (payload?: ({ - id: string; - scopeId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - delAuthorizationScope: (payload?: ({ - id: string; - scopeId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - /** - * Permissions - */ - findPermissions: (payload?: ({ - id: string; - name?: string | undefined; - resource?: string | undefined; - scope?: string | undefined; - } & PaginatedQuery & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - createPermission: (query: { - id: string; - type: string; - } & { - realm?: string | undefined; - }, payload: PolicyRepresentation) => Promise; - updatePermission: (query: { - id: string; - type: string; - permissionId: string; - } & { - realm?: string | undefined; - }, payload: PolicyRepresentation) => Promise; - delPermission: (payload?: ({ - id: string; - type: string; - permissionId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - findOnePermission: (payload?: ({ - id: string; - type: string; - permissionId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - getAssociatedScopes: (payload?: ({ - id: string; - permissionId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise<{ - id: string; - name: string; - }[]>; - getAssociatedResources: (payload?: ({ - id: string; - permissionId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise<{ - _id: string; - name: string; - }[]>; - getAssociatedPolicies: (payload?: ({ - id: string; - permissionId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - getOfflineSessionCount: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise<{ - count: number; - }>; - getInstallationProviders: (payload?: ({ - id: string; - providerId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - pushRevocation: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - addClusterNode: (payload?: ({ - id: string; - node: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - deleteClusterNode: (payload?: ({ - id: string; - node: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - testNodesAvailable: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - getKeyInfo: (payload?: ({ - id: string; - attr: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - generateKey: (payload?: ({ - id: string; - attr: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - downloadKey: (query: { - id: string; - attr: string; - } & { - realm?: string | undefined; - }, payload: KeyStoreConfig) => Promise; - generateAndDownloadKey: (query: { - id: string; - attr: string; - } & { - realm?: string | undefined; - }, payload: KeyStoreConfig) => Promise; - uploadKey: (query: { - id: string; - attr: string; - } & { - realm?: string | undefined; - }, payload: FormData) => Promise; - uploadCertificate: (query: { - id: string; - attr: string; - } & { - realm?: string | undefined; - }, payload: FormData) => Promise; - updateFineGrainPermission: (query: { - id: string; - } & { - realm?: string | undefined; - }, payload: ManagementPermissionReference) => Promise; - listFineGrainPermissions: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - constructor(client: KeycloakAdminClient); - /** - * Find single protocol mapper by name. - */ - findProtocolMapperByName(payload: { - realm?: string; - id: string; - name: string; - }): Promise; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/resources/clients.js b/node_modules/@keycloak/keycloak-admin-client/lib/resources/clients.js deleted file mode 100644 index d38c558..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/resources/clients.js +++ /dev/null @@ -1,577 +0,0 @@ -import Resource from "./resource.js"; -export class Clients extends Resource { - find = this.makeRequest({ - method: "GET", - }); - create = this.makeRequest({ - method: "POST", - returnResourceIdInLocationHeader: { field: "id" }, - }); - /** - * Single client - */ - findOne = this.makeRequest({ - method: "GET", - path: "/{id}", - urlParamKeys: ["id"], - catchNotFound: true, - }); - update = this.makeUpdateRequest({ - method: "PUT", - path: "/{id}", - urlParamKeys: ["id"], - }); - del = this.makeRequest({ - method: "DELETE", - path: "/{id}", - urlParamKeys: ["id"], - }); - /** - * Client roles - */ - createRole = this.makeRequest({ - method: "POST", - path: "/{id}/roles", - urlParamKeys: ["id"], - returnResourceIdInLocationHeader: { field: "roleName" }, - }); - listRoles = this.makeRequest({ - method: "GET", - path: "/{id}/roles", - urlParamKeys: ["id"], - }); - findRole = this.makeRequest({ - method: "GET", - path: "/{id}/roles/{roleName}", - urlParamKeys: ["id", "roleName"], - catchNotFound: true, - }); - updateRole = this.makeUpdateRequest({ - method: "PUT", - path: "/{id}/roles/{roleName}", - urlParamKeys: ["id", "roleName"], - }); - delRole = this.makeRequest({ - method: "DELETE", - path: "/{id}/roles/{roleName}", - urlParamKeys: ["id", "roleName"], - }); - findUsersWithRole = this.makeRequest({ - method: "GET", - path: "/{id}/roles/{roleName}/users", - urlParamKeys: ["id", "roleName"], - }); - /** - * Service account user - */ - getServiceAccountUser = this.makeRequest({ - method: "GET", - path: "/{id}/service-account-user", - urlParamKeys: ["id"], - }); - /** - * Client secret - */ - generateNewClientSecret = this.makeRequest({ - method: "POST", - path: "/{id}/client-secret", - urlParamKeys: ["id"], - }); - invalidateSecret = this.makeRequest({ - method: "DELETE", - path: "/{id}/client-secret/rotated", - urlParamKeys: ["id"], - }); - generateRegistrationAccessToken = this.makeRequest({ - method: "POST", - path: "/{id}/registration-access-token", - urlParamKeys: ["id"], - }); - getClientSecret = this.makeRequest({ - method: "GET", - path: "/{id}/client-secret", - urlParamKeys: ["id"], - }); - /** - * Client Scopes - */ - listDefaultClientScopes = this.makeRequest({ - method: "GET", - path: "/{id}/default-client-scopes", - urlParamKeys: ["id"], - }); - addDefaultClientScope = this.makeRequest({ - method: "PUT", - path: "/{id}/default-client-scopes/{clientScopeId}", - urlParamKeys: ["id", "clientScopeId"], - }); - delDefaultClientScope = this.makeRequest({ - method: "DELETE", - path: "/{id}/default-client-scopes/{clientScopeId}", - urlParamKeys: ["id", "clientScopeId"], - }); - listOptionalClientScopes = this.makeRequest({ - method: "GET", - path: "/{id}/optional-client-scopes", - urlParamKeys: ["id"], - }); - addOptionalClientScope = this.makeRequest({ - method: "PUT", - path: "/{id}/optional-client-scopes/{clientScopeId}", - urlParamKeys: ["id", "clientScopeId"], - }); - delOptionalClientScope = this.makeRequest({ - method: "DELETE", - path: "/{id}/optional-client-scopes/{clientScopeId}", - urlParamKeys: ["id", "clientScopeId"], - }); - /** - * Protocol Mappers - */ - addMultipleProtocolMappers = this.makeUpdateRequest({ - method: "POST", - path: "/{id}/protocol-mappers/add-models", - urlParamKeys: ["id"], - }); - addProtocolMapper = this.makeUpdateRequest({ - method: "POST", - path: "/{id}/protocol-mappers/models", - urlParamKeys: ["id"], - }); - listProtocolMappers = this.makeRequest({ - method: "GET", - path: "/{id}/protocol-mappers/models", - urlParamKeys: ["id"], - }); - findProtocolMapperById = this.makeRequest({ - method: "GET", - path: "/{id}/protocol-mappers/models/{mapperId}", - urlParamKeys: ["id", "mapperId"], - catchNotFound: true, - }); - findProtocolMappersByProtocol = this.makeRequest({ - method: "GET", - path: "/{id}/protocol-mappers/protocol/{protocol}", - urlParamKeys: ["id", "protocol"], - catchNotFound: true, - }); - updateProtocolMapper = this.makeUpdateRequest({ - method: "PUT", - path: "/{id}/protocol-mappers/models/{mapperId}", - urlParamKeys: ["id", "mapperId"], - }); - delProtocolMapper = this.makeRequest({ - method: "DELETE", - path: "/{id}/protocol-mappers/models/{mapperId}", - urlParamKeys: ["id", "mapperId"], - }); - /** - * Scope Mappings - */ - listScopeMappings = this.makeRequest({ - method: "GET", - path: "/{id}/scope-mappings", - urlParamKeys: ["id"], - }); - addClientScopeMappings = this.makeUpdateRequest({ - method: "POST", - path: "/{id}/scope-mappings/clients/{client}", - urlParamKeys: ["id", "client"], - }); - listClientScopeMappings = this.makeRequest({ - method: "GET", - path: "/{id}/scope-mappings/clients/{client}", - urlParamKeys: ["id", "client"], - }); - listAvailableClientScopeMappings = this.makeRequest({ - method: "GET", - path: "/{id}/scope-mappings/clients/{client}/available", - urlParamKeys: ["id", "client"], - }); - listCompositeClientScopeMappings = this.makeRequest({ - method: "GET", - path: "/{id}/scope-mappings/clients/{client}/composite", - urlParamKeys: ["id", "client"], - }); - delClientScopeMappings = this.makeUpdateRequest({ - method: "DELETE", - path: "/{id}/scope-mappings/clients/{client}", - urlParamKeys: ["id", "client"], - }); - evaluatePermission = this.makeRequest({ - method: "GET", - path: "/{id}/evaluate-scopes/scope-mappings/{roleContainer}/{type}", - urlParamKeys: ["id", "roleContainer", "type"], - queryParamKeys: ["scope"], - }); - evaluateListProtocolMapper = this.makeRequest({ - method: "GET", - path: "/{id}/evaluate-scopes/protocol-mappers", - urlParamKeys: ["id"], - queryParamKeys: ["scope"], - }); - evaluateGenerateAccessToken = this.makeRequest({ - method: "GET", - path: "/{id}/evaluate-scopes/generate-example-access-token", - urlParamKeys: ["id"], - queryParamKeys: ["scope", "userId"], - }); - evaluateGenerateUserInfo = this.makeRequest({ - method: "GET", - path: "/{id}/evaluate-scopes/generate-example-userinfo", - urlParamKeys: ["id"], - queryParamKeys: ["scope", "userId"], - }); - evaluateGenerateIdToken = this.makeRequest({ - method: "GET", - path: "/{id}/evaluate-scopes/generate-example-id-token", - urlParamKeys: ["id"], - queryParamKeys: ["scope", "userId"], - }); - addRealmScopeMappings = this.makeUpdateRequest({ - method: "POST", - path: "/{id}/scope-mappings/realm", - urlParamKeys: ["id", "client"], - }); - listRealmScopeMappings = this.makeRequest({ - method: "GET", - path: "/{id}/scope-mappings/realm", - urlParamKeys: ["id"], - }); - listAvailableRealmScopeMappings = this.makeRequest({ - method: "GET", - path: "/{id}/scope-mappings/realm/available", - urlParamKeys: ["id"], - }); - listCompositeRealmScopeMappings = this.makeRequest({ - method: "GET", - path: "/{id}/scope-mappings/realm/composite", - urlParamKeys: ["id"], - }); - delRealmScopeMappings = this.makeUpdateRequest({ - method: "DELETE", - path: "/{id}/scope-mappings/realm", - urlParamKeys: ["id"], - }); - /** - * Sessions - */ - listSessions = this.makeRequest({ - method: "GET", - path: "/{id}/user-sessions", - urlParamKeys: ["id"], - }); - listOfflineSessions = this.makeRequest({ - method: "GET", - path: "/{id}/offline-sessions", - urlParamKeys: ["id"], - }); - getSessionCount = this.makeRequest({ - method: "GET", - path: "/{id}/session-count", - urlParamKeys: ["id"], - }); - /** - * Resource - */ - getResourceServer = this.makeRequest({ - method: "GET", - path: "{id}/authz/resource-server", - urlParamKeys: ["id"], - }); - updateResourceServer = this.makeUpdateRequest({ - method: "PUT", - path: "{id}/authz/resource-server", - urlParamKeys: ["id"], - }); - listResources = this.makeRequest({ - method: "GET", - path: "{id}/authz/resource-server/resource", - urlParamKeys: ["id"], - }); - createResource = this.makeUpdateRequest({ - method: "POST", - path: "{id}/authz/resource-server/resource", - urlParamKeys: ["id"], - }); - getResource = this.makeRequest({ - method: "GET", - path: "{id}/authz/resource-server/resource/{resourceId}", - urlParamKeys: ["id", "resourceId"], - }); - updateResource = this.makeUpdateRequest({ - method: "PUT", - path: "/{id}/authz/resource-server/resource/{resourceId}", - urlParamKeys: ["id", "resourceId"], - }); - delResource = this.makeRequest({ - method: "DELETE", - path: "/{id}/authz/resource-server/resource/{resourceId}", - urlParamKeys: ["id", "resourceId"], - }); - importResource = this.makeUpdateRequest({ - method: "POST", - path: "/{id}/authz/resource-server/import", - urlParamKeys: ["id"], - }); - exportResource = this.makeRequest({ - method: "GET", - path: "/{id}/authz/resource-server/settings", - urlParamKeys: ["id"], - }); - evaluateResource = this.makeUpdateRequest({ - method: "POST", - path: "{id}/authz/resource-server/policy/evaluate", - urlParamKeys: ["id"], - }); - /** - * Policy - */ - listPolicies = this.makeRequest({ - method: "GET", - path: "{id}/authz/resource-server/policy", - urlParamKeys: ["id"], - }); - findPolicyByName = this.makeRequest({ - method: "GET", - path: "{id}/authz/resource-server/policy/search", - urlParamKeys: ["id"], - }); - updatePolicy = this.makeUpdateRequest({ - method: "PUT", - path: "/{id}/authz/resource-server/policy/{type}/{policyId}", - urlParamKeys: ["id", "type", "policyId"], - }); - createPolicy = this.makeUpdateRequest({ - method: "POST", - path: "/{id}/authz/resource-server/policy/{type}", - urlParamKeys: ["id", "type"], - }); - findOnePolicy = this.makeRequest({ - method: "GET", - path: "/{id}/authz/resource-server/policy/{type}/{policyId}", - urlParamKeys: ["id", "type", "policyId"], - catchNotFound: true, - }); - listDependentPolicies = this.makeRequest({ - method: "GET", - path: "/{id}/authz/resource-server/policy/{policyId}/dependentPolicies", - urlParamKeys: ["id", "policyId"], - }); - delPolicy = this.makeRequest({ - method: "DELETE", - path: "{id}/authz/resource-server/policy/{policyId}", - urlParamKeys: ["id", "policyId"], - }); - listPolicyProviders = this.makeRequest({ - method: "GET", - path: "/{id}/authz/resource-server/policy/providers", - urlParamKeys: ["id"], - }); - async createOrUpdatePolicy(payload) { - const policyFound = await this.findPolicyByName({ - id: payload.id, - name: payload.policyName, - }); - if (policyFound) { - await this.updatePolicy({ - id: payload.id, - policyId: policyFound.id, - type: payload.policy.type, - }, payload.policy); - return this.findPolicyByName({ - id: payload.id, - name: payload.policyName, - }); - } - else { - return this.createPolicy({ id: payload.id, type: payload.policy.type }, payload.policy); - } - } - /** - * Scopes - */ - listAllScopes = this.makeRequest({ - method: "GET", - path: "/{id}/authz/resource-server/scope", - urlParamKeys: ["id"], - }); - listAllResourcesByScope = this.makeRequest({ - method: "GET", - path: "/{id}/authz/resource-server/scope/{scopeId}/resources", - urlParamKeys: ["id", "scopeId"], - }); - listAllPermissionsByScope = this.makeRequest({ - method: "GET", - path: "/{id}/authz/resource-server/scope/{scopeId}/permissions", - urlParamKeys: ["id", "scopeId"], - }); - listPermissionsByResource = this.makeRequest({ - method: "GET", - path: "/{id}/authz/resource-server/resource/{resourceId}/permissions", - urlParamKeys: ["id", "resourceId"], - }); - listScopesByResource = this.makeRequest({ - method: "GET", - path: "/{id}/authz/resource-server/resource/{resourceName}/scopes", - urlParamKeys: ["id", "resourceName"], - }); - createAuthorizationScope = this.makeUpdateRequest({ - method: "POST", - path: "{id}/authz/resource-server/scope", - urlParamKeys: ["id"], - }); - updateAuthorizationScope = this.makeUpdateRequest({ - method: "PUT", - path: "/{id}/authz/resource-server/scope/{scopeId}", - urlParamKeys: ["id", "scopeId"], - }); - getAuthorizationScope = this.makeRequest({ - method: "GET", - path: "/{id}/authz/resource-server/scope/{scopeId}", - urlParamKeys: ["id", "scopeId"], - }); - delAuthorizationScope = this.makeRequest({ - method: "DELETE", - path: "/{id}/authz/resource-server/scope/{scopeId}", - urlParamKeys: ["id", "scopeId"], - }); - /** - * Permissions - */ - findPermissions = this.makeRequest({ - method: "GET", - path: "{id}/authz/resource-server/permission", - urlParamKeys: ["id"], - }); - createPermission = this.makeUpdateRequest({ - method: "POST", - path: "/{id}/authz/resource-server/permission/{type}", - urlParamKeys: ["id", "type"], - }); - updatePermission = this.makeUpdateRequest({ - method: "PUT", - path: "/{id}/authz/resource-server/permission/{type}/{permissionId}", - urlParamKeys: ["id", "type", "permissionId"], - }); - delPermission = this.makeRequest({ - method: "DELETE", - path: "/{id}/authz/resource-server/permission/{type}/{permissionId}", - urlParamKeys: ["id", "type", "permissionId"], - }); - findOnePermission = this.makeRequest({ - method: "GET", - path: "/{id}/authz/resource-server/permission/{type}/{permissionId}", - urlParamKeys: ["id", "type", "permissionId"], - }); - getAssociatedScopes = this.makeRequest({ - method: "GET", - path: "/{id}/authz/resource-server/policy/{permissionId}/scopes", - urlParamKeys: ["id", "permissionId"], - }); - getAssociatedResources = this.makeRequest({ - method: "GET", - path: "/{id}/authz/resource-server/policy/{permissionId}/resources", - urlParamKeys: ["id", "permissionId"], - }); - getAssociatedPolicies = this.makeRequest({ - method: "GET", - path: "/{id}/authz/resource-server/policy/{permissionId}/associatedPolicies", - urlParamKeys: ["id", "permissionId"], - }); - getOfflineSessionCount = this.makeRequest({ - method: "GET", - path: "/{id}/offline-session-count", - urlParamKeys: ["id"], - }); - getInstallationProviders = this.makeRequest({ - method: "GET", - path: "/{id}/installation/providers/{providerId}", - urlParamKeys: ["id", "providerId"], - }); - pushRevocation = this.makeRequest({ - method: "POST", - path: "/{id}/push-revocation", - urlParamKeys: ["id"], - }); - addClusterNode = this.makeRequest({ - method: "POST", - path: "/{id}/nodes", - urlParamKeys: ["id"], - }); - deleteClusterNode = this.makeRequest({ - method: "DELETE", - path: "/{id}/nodes/{node}", - urlParamKeys: ["id", "node"], - }); - testNodesAvailable = this.makeRequest({ - method: "GET", - path: "/{id}/test-nodes-available", - urlParamKeys: ["id"], - }); - getKeyInfo = this.makeRequest({ - method: "GET", - path: "/{id}/certificates/{attr}", - urlParamKeys: ["id", "attr"], - }); - generateKey = this.makeRequest({ - method: "POST", - path: "/{id}/certificates/{attr}/generate", - urlParamKeys: ["id", "attr"], - }); - downloadKey = this.makeUpdateRequest({ - method: "POST", - path: "/{id}/certificates/{attr}/download", - urlParamKeys: ["id", "attr"], - headers: { - accept: "application/octet-stream", - }, - }); - generateAndDownloadKey = this.makeUpdateRequest({ - method: "POST", - path: "/{id}/certificates/{attr}/generate-and-download", - urlParamKeys: ["id", "attr"], - headers: { - accept: "application/octet-stream", - }, - }); - uploadKey = this.makeUpdateRequest({ - method: "POST", - path: "/{id}/certificates/{attr}/upload", - urlParamKeys: ["id", "attr"], - }); - uploadCertificate = this.makeUpdateRequest({ - method: "POST", - path: "/{id}/certificates/{attr}/upload-certificate", - urlParamKeys: ["id", "attr"], - }); - updateFineGrainPermission = this.makeUpdateRequest({ - method: "PUT", - path: "/{id}/management/permissions", - urlParamKeys: ["id"], - }); - listFineGrainPermissions = this.makeRequest({ - method: "GET", - path: "/{id}/management/permissions", - urlParamKeys: ["id"], - }); - constructor(client) { - super(client, { - path: "/admin/realms/{realm}/clients", - getUrlParams: () => ({ - realm: client.realmName, - }), - getBaseUrl: () => client.baseUrl, - }); - } - /** - * Find single protocol mapper by name. - */ - async findProtocolMapperByName(payload) { - const allProtocolMappers = await this.listProtocolMappers({ - id: payload.id, - ...(payload.realm ? { realm: payload.realm } : {}), - }); - return allProtocolMappers.find((mapper) => mapper.name === payload.name); - } -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/resources/components.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/resources/components.d.ts deleted file mode 100644 index 71f3d38..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/resources/components.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -import Resource from "./resource.js"; -import type ComponentRepresentation from "../defs/componentRepresentation.js"; -import type ComponentTypeRepresentation from "../defs/componentTypeRepresentation.js"; -import type { KeycloakAdminClient } from "../client.js"; -export interface ComponentQuery { - name?: string; - parent?: string; - type?: string; -} -export declare class Components extends Resource<{ - realm?: string; -}> { - /** - * components - * https://www.keycloak.org/docs-api/11.0/rest-api/#_component_resource - */ - find: (payload?: (ComponentQuery & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - create: (payload?: (ComponentRepresentation & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise<{ - id: string; - }>; - findOne: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - update: (query: { - id: string; - } & { - realm?: string | undefined; - }, payload: ComponentRepresentation) => Promise; - del: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - listSubComponents: (payload?: ({ - id: string; - type: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - constructor(client: KeycloakAdminClient); -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/resources/components.js b/node_modules/@keycloak/keycloak-admin-client/lib/resources/components.js deleted file mode 100644 index a7e1293..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/resources/components.js +++ /dev/null @@ -1,45 +0,0 @@ -import Resource from "./resource.js"; -export class Components extends Resource { - /** - * components - * https://www.keycloak.org/docs-api/11.0/rest-api/#_component_resource - */ - find = this.makeRequest({ - method: "GET", - }); - create = this.makeRequest({ - method: "POST", - returnResourceIdInLocationHeader: { field: "id" }, - }); - findOne = this.makeRequest({ - method: "GET", - path: "/{id}", - urlParamKeys: ["id"], - catchNotFound: true, - }); - update = this.makeUpdateRequest({ - method: "PUT", - path: "/{id}", - urlParamKeys: ["id"], - }); - del = this.makeRequest({ - method: "DELETE", - path: "/{id}", - urlParamKeys: ["id"], - }); - listSubComponents = this.makeRequest({ - method: "GET", - path: "/{id}/sub-component-types", - urlParamKeys: ["id"], - queryParamKeys: ["type"], - }); - constructor(client) { - super(client, { - path: "/admin/realms/{realm}/components", - getUrlParams: () => ({ - realm: client.realmName, - }), - getBaseUrl: () => client.baseUrl, - }); - } -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/resources/groups.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/resources/groups.d.ts deleted file mode 100644 index d645bfd..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/resources/groups.d.ts +++ /dev/null @@ -1,202 +0,0 @@ -import type { KeycloakAdminClient } from "../client.js"; -import type GroupRepresentation from "../defs/groupRepresentation.js"; -import type { ManagementPermissionReference } from "../defs/managementPermissionReference.js"; -import type MappingsRepresentation from "../defs/mappingsRepresentation.js"; -import type RoleRepresentation from "../defs/roleRepresentation.js"; -import type { RoleMappingPayload } from "../defs/roleRepresentation.js"; -import type UserRepresentation from "../defs/userRepresentation.js"; -import Resource from "./resource.js"; -interface Query { - q?: string; - search?: string; - exact?: boolean; -} -interface PaginatedQuery { - first?: number; - max?: number; -} -interface SummarizedQuery { - briefRepresentation?: boolean; -} -export type GroupQuery = Query & PaginatedQuery & SummarizedQuery; -export type SubGroupQuery = PaginatedQuery & SummarizedQuery & { - parentId: string; -}; -export interface GroupCountQuery { - search?: string; - top?: boolean; -} -export declare class Groups extends Resource<{ - realm?: string; -}> { - find: (payload?: (Query & PaginatedQuery & SummarizedQuery & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - create: (payload?: (GroupRepresentation & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise<{ - id: string; - }>; - updateRoot: (payload?: (GroupRepresentation & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - /** - * Single user - */ - findOne: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - update: (query: { - id: string; - } & { - realm?: string | undefined; - }, payload: GroupRepresentation) => Promise; - del: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - count: (payload?: (GroupCountQuery & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise<{ - count: number; - }>; - /** - * Set or create child. - * This will just set the parent if it exists. Create it and set the parent if the group doesn’t exist. - * @deprecated Use `createChildGroup` or `updateChildGroup` instead. - */ - setOrCreateChild: (query: { - id: string; - } & { - realm?: string | undefined; - }, payload: GroupRepresentation) => Promise<{ - id: string; - }>; - /** - * Creates a child group on the specified parent group. If the group already exists, then an error is returned. - */ - createChildGroup: (query: { - id: string; - } & { - realm?: string | undefined; - }, payload: Omit) => Promise<{ - id: string; - }>; - /** - * Updates a child group on the specified parent group. If the group doesn’t exist, then an error is returned. - * Can be used to move a group from one parent to another. - */ - updateChildGroup: (query: { - id: string; - } & { - realm?: string | undefined; - }, payload: GroupRepresentation) => Promise; - /** - * Finds all subgroups on the specified parent group matching the provided parameters. - */ - listSubGroups: (payload?: (PaginatedQuery & SummarizedQuery & { - parentId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - /** - * Members - */ - listMembers: (payload?: ({ - id: string; - first?: number | undefined; - max?: number | undefined; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - /** - * Role mappings - * https://www.keycloak.org/docs-api/11.0/rest-api/#_role_mapper_resource - */ - listRoleMappings: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - addRealmRoleMappings: (payload?: ({ - id: string; - roles: RoleMappingPayload[]; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - listRealmRoleMappings: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - delRealmRoleMappings: (payload?: ({ - id: string; - roles: RoleMappingPayload[]; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - listAvailableRealmRoleMappings: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - listCompositeRealmRoleMappings: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - /** - * Client role mappings - * https://www.keycloak.org/docs-api/11.0/rest-api/#_client_role_mappings_resource - */ - listClientRoleMappings: (payload?: ({ - id: string; - clientUniqueId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - addClientRoleMappings: (payload?: ({ - id: string; - clientUniqueId: string; - roles: RoleMappingPayload[]; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - delClientRoleMappings: (payload?: ({ - id: string; - clientUniqueId: string; - roles: RoleMappingPayload[]; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - listAvailableClientRoleMappings: (payload?: ({ - id: string; - clientUniqueId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - listCompositeClientRoleMappings: (payload?: ({ - id: string; - clientUniqueId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - /** - * Authorization permissions - */ - updatePermission: (query: { - id: string; - } & { - realm?: string | undefined; - }, payload: ManagementPermissionReference) => Promise; - listPermissions: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - constructor(client: KeycloakAdminClient); -} -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/resources/groups.js b/node_modules/@keycloak/keycloak-admin-client/lib/resources/groups.js deleted file mode 100644 index 4079637..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/resources/groups.js +++ /dev/null @@ -1,182 +0,0 @@ -import Resource from "./resource.js"; -export class Groups extends Resource { - find = this.makeRequest({ - method: "GET", - queryParamKeys: [ - "search", - "q", - "exact", - "briefRepresentation", - "first", - "max", - ], - }); - create = this.makeRequest({ - method: "POST", - returnResourceIdInLocationHeader: { field: "id" }, - }); - updateRoot = this.makeRequest({ - method: "POST", - }); - /** - * Single user - */ - findOne = this.makeRequest({ - method: "GET", - path: "/{id}", - urlParamKeys: ["id"], - catchNotFound: true, - }); - update = this.makeUpdateRequest({ - method: "PUT", - path: "/{id}", - urlParamKeys: ["id"], - }); - del = this.makeRequest({ - method: "DELETE", - path: "/{id}", - urlParamKeys: ["id"], - }); - count = this.makeRequest({ - method: "GET", - path: "/count", - }); - /** - * Set or create child. - * This will just set the parent if it exists. Create it and set the parent if the group doesn’t exist. - * @deprecated Use `createChildGroup` or `updateChildGroup` instead. - */ - setOrCreateChild = this.makeUpdateRequest({ - method: "POST", - path: "/{id}/children", - urlParamKeys: ["id"], - returnResourceIdInLocationHeader: { field: "id" }, - }); - /** - * Creates a child group on the specified parent group. If the group already exists, then an error is returned. - */ - createChildGroup = this.makeUpdateRequest({ - method: "POST", - path: "/{id}/children", - urlParamKeys: ["id"], - returnResourceIdInLocationHeader: { field: "id" }, - }); - /** - * Updates a child group on the specified parent group. If the group doesn’t exist, then an error is returned. - * Can be used to move a group from one parent to another. - */ - updateChildGroup = this.makeUpdateRequest({ - method: "POST", - path: "/{id}/children", - urlParamKeys: ["id"], - }); - /** - * Finds all subgroups on the specified parent group matching the provided parameters. - */ - listSubGroups = this.makeRequest({ - method: "GET", - path: "/{parentId}/children", - urlParamKeys: ["parentId"], - queryParamKeys: ["first", "max", "briefRepresentation"], - catchNotFound: true, - }); - /** - * Members - */ - listMembers = this.makeRequest({ - method: "GET", - path: "/{id}/members", - urlParamKeys: ["id"], - catchNotFound: true, - }); - /** - * Role mappings - * https://www.keycloak.org/docs-api/11.0/rest-api/#_role_mapper_resource - */ - listRoleMappings = this.makeRequest({ - method: "GET", - path: "/{id}/role-mappings", - urlParamKeys: ["id"], - }); - addRealmRoleMappings = this.makeRequest({ - method: "POST", - path: "/{id}/role-mappings/realm", - urlParamKeys: ["id"], - payloadKey: "roles", - }); - listRealmRoleMappings = this.makeRequest({ - method: "GET", - path: "/{id}/role-mappings/realm", - urlParamKeys: ["id"], - }); - delRealmRoleMappings = this.makeRequest({ - method: "DELETE", - path: "/{id}/role-mappings/realm", - urlParamKeys: ["id"], - payloadKey: "roles", - }); - listAvailableRealmRoleMappings = this.makeRequest({ - method: "GET", - path: "/{id}/role-mappings/realm/available", - urlParamKeys: ["id"], - }); - // Get effective realm-level role mappings This will recurse all composite roles to get the result. - listCompositeRealmRoleMappings = this.makeRequest({ - method: "GET", - path: "/{id}/role-mappings/realm/composite", - urlParamKeys: ["id"], - }); - /** - * Client role mappings - * https://www.keycloak.org/docs-api/11.0/rest-api/#_client_role_mappings_resource - */ - listClientRoleMappings = this.makeRequest({ - method: "GET", - path: "/{id}/role-mappings/clients/{clientUniqueId}", - urlParamKeys: ["id", "clientUniqueId"], - }); - addClientRoleMappings = this.makeRequest({ - method: "POST", - path: "/{id}/role-mappings/clients/{clientUniqueId}", - urlParamKeys: ["id", "clientUniqueId"], - payloadKey: "roles", - }); - delClientRoleMappings = this.makeRequest({ - method: "DELETE", - path: "/{id}/role-mappings/clients/{clientUniqueId}", - urlParamKeys: ["id", "clientUniqueId"], - payloadKey: "roles", - }); - listAvailableClientRoleMappings = this.makeRequest({ - method: "GET", - path: "/{id}/role-mappings/clients/{clientUniqueId}/available", - urlParamKeys: ["id", "clientUniqueId"], - }); - listCompositeClientRoleMappings = this.makeRequest({ - method: "GET", - path: "/{id}/role-mappings/clients/{clientUniqueId}/composite", - urlParamKeys: ["id", "clientUniqueId"], - }); - /** - * Authorization permissions - */ - updatePermission = this.makeUpdateRequest({ - method: "PUT", - path: "/{id}/management/permissions", - urlParamKeys: ["id"], - }); - listPermissions = this.makeRequest({ - method: "GET", - path: "/{id}/management/permissions", - urlParamKeys: ["id"], - }); - constructor(client) { - super(client, { - path: "/admin/realms/{realm}/groups", - getUrlParams: () => ({ - realm: client.realmName, - }), - getBaseUrl: () => client.baseUrl, - }); - } -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/resources/identityProviders.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/resources/identityProviders.d.ts deleted file mode 100644 index 0738ff6..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/resources/identityProviders.d.ts +++ /dev/null @@ -1,107 +0,0 @@ -import type { KeycloakAdminClient } from "../client.js"; -import type IdentityProviderMapperRepresentation from "../defs/identityProviderMapperRepresentation.js"; -import type { IdentityProviderMapperTypeRepresentation } from "../defs/identityProviderMapperTypeRepresentation.js"; -import type IdentityProviderRepresentation from "../defs/identityProviderRepresentation.js"; -import type { ManagementPermissionReference } from "../defs/managementPermissionReference.js"; -import Resource from "./resource.js"; -export interface PaginatedQuery { - first?: number; - max?: number; -} -export interface IdentityProvidersQuery extends PaginatedQuery { - search?: string; -} -export declare class IdentityProviders extends Resource<{ - realm?: string; -}> { - /** - * Identity provider - * https://www.keycloak.org/docs-api/11.0/rest-api/#_identity_providers_resource - */ - find: (payload?: (IdentityProvidersQuery & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - create: (payload?: (IdentityProviderRepresentation & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise<{ - id: string; - }>; - findOne: (payload?: ({ - alias: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - update: (query: { - alias: string; - } & { - realm?: string | undefined; - }, payload: IdentityProviderRepresentation) => Promise; - del: (payload?: ({ - alias: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - findFactory: (payload?: ({ - providerId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - findMappers: (payload?: ({ - alias: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - findOneMapper: (payload?: ({ - alias: string; - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - createMapper: (payload?: ({ - alias: string; - identityProviderMapper: IdentityProviderMapperRepresentation; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise<{ - id: string; - }>; - updateMapper: (query: { - alias: string; - id: string; - } & { - realm?: string | undefined; - }, payload: IdentityProviderMapperRepresentation) => Promise; - delMapper: (payload?: ({ - alias: string; - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - findMapperTypes: (payload?: ({ - alias: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise>; - importFromUrl: (payload?: ((FormData | { - fromUrl: string; - providerId: string; - }) & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise>; - updatePermission: (query: { - alias: string; - } & { - realm?: string | undefined; - }, payload: ManagementPermissionReference) => Promise; - listPermissions: (payload?: ({ - alias: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - reloadKeys: (payload?: ({ - alias: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - constructor(client: KeycloakAdminClient); -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/resources/identityProviders.js b/node_modules/@keycloak/keycloak-admin-client/lib/resources/identityProviders.js deleted file mode 100644 index 683e2c8..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/resources/identityProviders.js +++ /dev/null @@ -1,98 +0,0 @@ -import Resource from "./resource.js"; -export class IdentityProviders extends Resource { - /** - * Identity provider - * https://www.keycloak.org/docs-api/11.0/rest-api/#_identity_providers_resource - */ - find = this.makeRequest({ - method: "GET", - path: "/instances", - }); - create = this.makeRequest({ - method: "POST", - path: "/instances", - returnResourceIdInLocationHeader: { field: "id" }, - }); - findOne = this.makeRequest({ - method: "GET", - path: "/instances/{alias}", - urlParamKeys: ["alias"], - catchNotFound: true, - }); - update = this.makeUpdateRequest({ - method: "PUT", - path: "/instances/{alias}", - urlParamKeys: ["alias"], - }); - del = this.makeRequest({ - method: "DELETE", - path: "/instances/{alias}", - urlParamKeys: ["alias"], - }); - findFactory = this.makeRequest({ - method: "GET", - path: "/providers/{providerId}", - urlParamKeys: ["providerId"], - }); - findMappers = this.makeRequest({ - method: "GET", - path: "/instances/{alias}/mappers", - urlParamKeys: ["alias"], - }); - findOneMapper = this.makeRequest({ - method: "GET", - path: "/instances/{alias}/mappers/{id}", - urlParamKeys: ["alias", "id"], - catchNotFound: true, - }); - createMapper = this.makeRequest({ - method: "POST", - path: "/instances/{alias}/mappers", - urlParamKeys: ["alias"], - payloadKey: "identityProviderMapper", - returnResourceIdInLocationHeader: { field: "id" }, - }); - updateMapper = this.makeUpdateRequest({ - method: "PUT", - path: "/instances/{alias}/mappers/{id}", - urlParamKeys: ["alias", "id"], - }); - delMapper = this.makeRequest({ - method: "DELETE", - path: "/instances/{alias}/mappers/{id}", - urlParamKeys: ["alias", "id"], - }); - findMapperTypes = this.makeRequest({ - method: "GET", - path: "/instances/{alias}/mapper-types", - urlParamKeys: ["alias"], - }); - importFromUrl = this.makeRequest({ - method: "POST", - path: "/import-config", - }); - updatePermission = this.makeUpdateRequest({ - method: "PUT", - path: "/instances/{alias}/management/permissions", - urlParamKeys: ["alias"], - }); - listPermissions = this.makeRequest({ - method: "GET", - path: "/instances/{alias}/management/permissions", - urlParamKeys: ["alias"], - }); - reloadKeys = this.makeRequest({ - method: "GET", - path: "/instances/{alias}/reload-keys", - urlParamKeys: ["alias"], - }); - constructor(client) { - super(client, { - path: "/admin/realms/{realm}/identity-provider", - getUrlParams: () => ({ - realm: client.realmName, - }), - getBaseUrl: () => client.baseUrl, - }); - } -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/resources/realms.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/resources/realms.d.ts deleted file mode 100644 index fce6b28..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/resources/realms.d.ts +++ /dev/null @@ -1,186 +0,0 @@ -import Resource from "./resource.js"; -import type AdminEventRepresentation from "../defs/adminEventRepresentation.js"; -import type RealmRepresentation from "../defs/realmRepresentation.js"; -import type { PartialImportRealmRepresentation, PartialImportResponse } from "../defs/realmRepresentation.js"; -import type EventRepresentation from "../defs/eventRepresentation.js"; -import type EventType from "../defs/eventTypes.js"; -import type KeysMetadataRepresentation from "../defs/keyMetadataRepresentation.js"; -import type ClientInitialAccessPresentation from "../defs/clientInitialAccessPresentation.js"; -import type TestLdapConnectionRepresentation from "../defs/testLdapConnection.js"; -import type { KeycloakAdminClient } from "../client.js"; -import type { RealmEventsConfigRepresentation } from "../defs/realmEventsConfigRepresentation.js"; -import type GlobalRequestResult from "../defs/globalRequestResult.js"; -import type GroupRepresentation from "../defs/groupRepresentation.js"; -import type { ManagementPermissionReference } from "../defs/managementPermissionReference.js"; -import type ComponentTypeRepresentation from "../defs/componentTypeRepresentation.js"; -import type { ClientSessionStat } from "../defs/clientSessionStat.js"; -export declare class Realms extends Resource { - /** - * Realm - * https://www.keycloak.org/docs-api/11.0/rest-api/#_realms_admin_resource - */ - find: (payload?: { - briefRepresentation?: boolean | undefined; - } | undefined, options?: Pick | undefined) => Promise; - create: (payload?: RealmRepresentation | undefined, options?: Pick | undefined) => Promise<{ - realmName: string; - }>; - findOne: (payload?: { - realm: string; - } | undefined, options?: Pick | undefined) => Promise; - update: (query: { - realm: string; - }, payload: RealmRepresentation) => Promise; - del: (payload?: { - realm: string; - } | undefined, options?: Pick | undefined) => Promise; - partialImport: (payload?: { - realm: string; - rep: PartialImportRealmRepresentation; - } | undefined, options?: Pick | undefined) => Promise; - export: (payload?: { - realm: string; - exportClients?: boolean | undefined; - exportGroupsAndRoles?: boolean | undefined; - } | undefined, options?: Pick | undefined) => Promise; - getDefaultGroups: (payload?: { - realm: string; - } | undefined, options?: Pick | undefined) => Promise; - addDefaultGroup: (payload?: { - realm: string; - id: string; - } | undefined, options?: Pick | undefined) => Promise; - removeDefaultGroup: (payload?: { - realm: string; - id: string; - } | undefined, options?: Pick | undefined) => Promise; - getGroupByPath: (payload?: { - path: string; - realm: string; - } | undefined, options?: Pick | undefined) => Promise; - /** - * Get events Returns all events, or filters them based on URL query parameters listed here - */ - findEvents: (payload?: { - realm: string; - client?: string | undefined; - dateFrom?: string | undefined; - dateTo?: string | undefined; - first?: number | undefined; - ipAddress?: string | undefined; - max?: number | undefined; - type?: EventType | EventType[] | undefined; - user?: string | undefined; - } | undefined, options?: Pick | undefined) => Promise; - getConfigEvents: (payload?: { - realm: string; - } | undefined, options?: Pick | undefined) => Promise; - updateConfigEvents: (query: { - realm: string; - }, payload: RealmEventsConfigRepresentation) => Promise; - clearEvents: (payload?: { - realm: string; - } | undefined, options?: Pick | undefined) => Promise; - clearAdminEvents: (payload?: { - realm: string; - } | undefined, options?: Pick | undefined) => Promise; - getClientRegistrationPolicyProviders: (payload?: { - realm: string; - } | undefined, options?: Pick | undefined) => Promise; - getClientsInitialAccess: (payload?: { - realm: string; - } | undefined, options?: Pick | undefined) => Promise; - createClientsInitialAccess: (query: { - realm: string; - }, payload: { - count?: number | undefined; - expiration?: number | undefined; - }) => Promise; - delClientsInitialAccess: (payload?: { - realm: string; - id: string; - } | undefined, options?: Pick | undefined) => Promise; - /** - * Remove a specific user session. - */ - removeSession: (payload?: { - realm: string; - sessionId: string; - } | undefined, options?: Pick | undefined) => Promise; - /** - * Get admin events Returns all admin events, or filters events based on URL query parameters listed here - */ - findAdminEvents: (payload?: { - realm: string; - authClient?: string | undefined; - authIpAddress?: string | undefined; - authRealm?: string | undefined; - authUser?: string | undefined; - dateFrom?: Date | undefined; - dateTo?: Date | undefined; - first?: number | undefined; - max?: number | undefined; - operationTypes?: string | undefined; - resourcePath?: string | undefined; - resourceTypes?: string | undefined; - } | undefined, options?: Pick | undefined) => Promise; - /** - * Users management permissions - */ - getUsersManagementPermissions: (payload?: { - realm: string; - } | undefined, options?: Pick | undefined) => Promise; - updateUsersManagementPermissions: (payload?: { - realm: string; - enabled: boolean; - } | undefined, options?: Pick | undefined) => Promise; - /** - * Sessions - */ - getClientSessionStats: (payload?: { - realm: string; - } | undefined, options?: Pick | undefined) => Promise; - logoutAll: (payload?: { - realm: string; - } | undefined, options?: Pick | undefined) => Promise; - deleteSession: (payload?: { - realm: string; - session: string; - isOffline: boolean; - } | undefined, options?: Pick | undefined) => Promise; - pushRevocation: (payload?: { - realm: string; - } | undefined, options?: Pick | undefined) => Promise; - getKeys: (payload?: { - realm: string; - } | undefined, options?: Pick | undefined) => Promise; - testLDAPConnection: (query: { - realm: string; - }, payload: TestLdapConnectionRepresentation) => Promise; - testSMTPConnection: (query: { - realm: string; - }, payload: Record) => Promise; - ldapServerCapabilities: (query: { - realm: string; - }, payload: TestLdapConnectionRepresentation) => Promise; - getRealmSpecificLocales: (payload?: { - realm: string; - } | undefined, options?: Pick | undefined) => Promise; - getRealmLocalizationTexts: (payload?: { - realm: string; - selectedLocale: string; - first?: number | undefined; - max?: number | undefined; - } | undefined, options?: Pick | undefined) => Promise>; - addLocalization: (query: { - realm: string; - selectedLocale: string; - key: string; - }, payload: string) => Promise; - deleteRealmLocalizationTexts: (payload?: { - realm: string; - selectedLocale: string; - key?: string | undefined; - } | undefined, options?: Pick | undefined) => Promise; - constructor(client: KeycloakAdminClient); -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/resources/realms.js b/node_modules/@keycloak/keycloak-admin-client/lib/resources/realms.js deleted file mode 100644 index 7fc43bc..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/resources/realms.js +++ /dev/null @@ -1,235 +0,0 @@ -import Resource from "./resource.js"; -export class Realms extends Resource { - /** - * Realm - * https://www.keycloak.org/docs-api/11.0/rest-api/#_realms_admin_resource - */ - find = this.makeRequest({ - method: "GET", - }); - create = this.makeRequest({ - method: "POST", - returnResourceIdInLocationHeader: { field: "realmName" }, - }); - findOne = this.makeRequest({ - method: "GET", - path: "/{realm}", - urlParamKeys: ["realm"], - catchNotFound: true, - }); - update = this.makeUpdateRequest({ - method: "PUT", - path: "/{realm}", - urlParamKeys: ["realm"], - }); - del = this.makeRequest({ - method: "DELETE", - path: "/{realm}", - urlParamKeys: ["realm"], - }); - partialImport = this.makeRequest({ - method: "POST", - path: "/{realm}/partialImport", - urlParamKeys: ["realm"], - payloadKey: "rep", - }); - export = this.makeRequest({ - method: "POST", - path: "/{realm}/partial-export", - urlParamKeys: ["realm"], - queryParamKeys: ["exportClients", "exportGroupsAndRoles"], - }); - getDefaultGroups = this.makeRequest({ - method: "GET", - path: "/{realm}/default-groups", - urlParamKeys: ["realm"], - }); - addDefaultGroup = this.makeRequest({ - method: "PUT", - path: "/{realm}/default-groups/{id}", - urlParamKeys: ["realm", "id"], - }); - removeDefaultGroup = this.makeRequest({ - method: "DELETE", - path: "/{realm}/default-groups/{id}", - urlParamKeys: ["realm", "id"], - }); - getGroupByPath = this.makeRequest({ - method: "GET", - path: "/{realm}/group-by-path/{path}", - urlParamKeys: ["realm", "path"], - }); - /** - * Get events Returns all events, or filters them based on URL query parameters listed here - */ - findEvents = this.makeRequest({ - method: "GET", - path: "/{realm}/events", - urlParamKeys: ["realm"], - queryParamKeys: [ - "client", - "dateFrom", - "dateTo", - "first", - "ipAddress", - "max", - "type", - "user", - ], - }); - getConfigEvents = this.makeRequest({ - method: "GET", - path: "/{realm}/events/config", - urlParamKeys: ["realm"], - }); - updateConfigEvents = this.makeUpdateRequest({ - method: "PUT", - path: "/{realm}/events/config", - urlParamKeys: ["realm"], - }); - clearEvents = this.makeRequest({ - method: "DELETE", - path: "/{realm}/events", - urlParamKeys: ["realm"], - }); - clearAdminEvents = this.makeRequest({ - method: "DELETE", - path: "/{realm}/admin-events", - urlParamKeys: ["realm"], - }); - getClientRegistrationPolicyProviders = this.makeRequest({ - method: "GET", - path: "/{realm}/client-registration-policy/providers", - urlParamKeys: ["realm"], - }); - getClientsInitialAccess = this.makeRequest({ - method: "GET", - path: "/{realm}/clients-initial-access", - urlParamKeys: ["realm"], - }); - createClientsInitialAccess = this.makeUpdateRequest({ - method: "POST", - path: "/{realm}/clients-initial-access", - urlParamKeys: ["realm"], - }); - delClientsInitialAccess = this.makeRequest({ - method: "DELETE", - path: "/{realm}/clients-initial-access/{id}", - urlParamKeys: ["realm", "id"], - }); - /** - * Remove a specific user session. - */ - removeSession = this.makeRequest({ - method: "DELETE", - path: "/{realm}/sessions/{sessionId}", - urlParamKeys: ["realm", "sessionId"], - catchNotFound: true, - }); - /** - * Get admin events Returns all admin events, or filters events based on URL query parameters listed here - */ - findAdminEvents = this.makeRequest({ - method: "GET", - path: "/{realm}/admin-events", - urlParamKeys: ["realm"], - queryParamKeys: [ - "authClient", - "authIpAddress", - "authRealm", - "authUser", - "dateFrom", - "dateTo", - "max", - "first", - "operationTypes", - "resourcePath", - "resourceTypes", - ], - }); - /** - * Users management permissions - */ - getUsersManagementPermissions = this.makeRequest({ - method: "GET", - path: "/{realm}/users-management-permissions", - urlParamKeys: ["realm"], - }); - updateUsersManagementPermissions = this.makeRequest({ - method: "PUT", - path: "/{realm}/users-management-permissions", - urlParamKeys: ["realm"], - }); - /** - * Sessions - */ - getClientSessionStats = this.makeRequest({ - method: "GET", - path: "/{realm}/client-session-stats", - urlParamKeys: ["realm"], - }); - logoutAll = this.makeRequest({ - method: "POST", - path: "/{realm}/logout-all", - urlParamKeys: ["realm"], - }); - deleteSession = this.makeRequest({ - method: "DELETE", - path: "/{realm}/sessions/{session}", - urlParamKeys: ["realm", "session"], - queryParamKeys: ["isOffline"], - }); - pushRevocation = this.makeRequest({ - method: "POST", - path: "/{realm}/push-revocation", - urlParamKeys: ["realm"], - ignoredKeys: ["realm"], - }); - getKeys = this.makeRequest({ - method: "GET", - path: "/{realm}/keys", - urlParamKeys: ["realm"], - }); - testLDAPConnection = this.makeUpdateRequest({ - method: "POST", - path: "/{realm}/testLDAPConnection", - urlParamKeys: ["realm"], - }); - testSMTPConnection = this.makeUpdateRequest({ - method: "POST", - path: "/{realm}/testSMTPConnection", - urlParamKeys: ["realm"], - }); - ldapServerCapabilities = this.makeUpdateRequest({ - method: "POST", - path: "/{realm}/ldap-server-capabilities", - urlParamKeys: ["realm"], - }); - getRealmSpecificLocales = this.makeRequest({ - method: "GET", - path: "/{realm}/localization", - urlParamKeys: ["realm"], - }); - getRealmLocalizationTexts = this.makeRequest({ - method: "GET", - path: "/{realm}/localization/{selectedLocale}", - urlParamKeys: ["realm", "selectedLocale"], - }); - addLocalization = this.makeUpdateRequest({ - method: "PUT", - path: "/{realm}/localization/{selectedLocale}/{key}", - urlParamKeys: ["realm", "selectedLocale", "key"], - headers: { "content-type": "text/plain" }, - }); - deleteRealmLocalizationTexts = this.makeRequest({ - method: "DELETE", - path: "/{realm}/localization/{selectedLocale}/{key}", - urlParamKeys: ["realm", "selectedLocale", "key"], - }); - constructor(client) { - super(client, { - path: "/admin/realms", - getBaseUrl: () => client.baseUrl, - }); - } -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/resources/resource.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/resources/resource.d.ts deleted file mode 100644 index 539854f..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/resources/resource.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { KeycloakAdminClient } from "../client.js"; -import { RequestArgs } from "./agent.js"; -export default class Resource { - #private; - constructor(client: KeycloakAdminClient, settings?: { - path?: string; - getUrlParams?: () => Record; - getBaseUrl?: () => string; - }); - makeRequest: (args: RequestArgs) => (payload?: (PayloadType & ParamType) | undefined, options?: Pick) => Promise; - makeUpdateRequest: (args: RequestArgs) => (query: QueryType & ParamType, payload: PayloadType) => Promise; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/resources/resource.js b/node_modules/@keycloak/keycloak-admin-client/lib/resources/resource.js deleted file mode 100644 index 9e1ef9a..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/resources/resource.js +++ /dev/null @@ -1,17 +0,0 @@ -import { Agent } from "./agent.js"; -export default class Resource { - #agent; - constructor(client, settings = {}) { - this.#agent = new Agent({ - client, - ...settings, - }); - } - makeRequest = (args) => { - return this.#agent.request(args); - }; - // update request will take three types: query, payload and response - makeUpdateRequest = (args) => { - return this.#agent.updateRequest(args); - }; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/resources/roles.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/resources/roles.d.ts deleted file mode 100644 index 683a77f..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/resources/roles.d.ts +++ /dev/null @@ -1,112 +0,0 @@ -import Resource from "./resource.js"; -import type RoleRepresentation from "../defs/roleRepresentation.js"; -import type UserRepresentation from "../defs/userRepresentation.js"; -import type { KeycloakAdminClient } from "../client.js"; -import type { ManagementPermissionReference } from "../defs/managementPermissionReference.js"; -export interface RoleQuery { - first?: number; - max?: number; - search?: string; - briefRepresentation?: boolean; -} -export declare class Roles extends Resource<{ - realm?: string; -}> { - /** - * Realm roles - */ - find: (payload?: (RoleQuery & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - create: (payload?: (RoleRepresentation & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise<{ - roleName: string; - }>; - /** - * Roles by name - */ - findOneByName: (payload?: ({ - name: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - updateByName: (query: { - name: string; - } & { - realm?: string | undefined; - }, payload: RoleRepresentation) => Promise; - delByName: (payload?: ({ - name: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - findUsersWithRole: (payload?: ({ - name: string; - first?: number | undefined; - max?: number | undefined; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - /** - * Roles by id - */ - findOneById: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - createComposite: (query: { - roleId: string; - } & { - realm?: string | undefined; - }, payload: RoleRepresentation[]) => Promise; - getCompositeRoles: (payload?: ({ - id: string; - search?: string | undefined; - first?: number | undefined; - max?: number | undefined; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - getCompositeRolesForRealm: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - getCompositeRolesForClient: (payload?: ({ - id: string; - clientId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - delCompositeRoles: (query: { - id: string; - } & { - realm?: string | undefined; - }, payload: RoleRepresentation[]) => Promise; - updateById: (query: { - id: string; - } & { - realm?: string | undefined; - }, payload: RoleRepresentation) => Promise; - delById: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - /** - * Authorization permissions - */ - updatePermission: (query: { - id: string; - } & { - realm?: string | undefined; - }, payload: ManagementPermissionReference) => Promise; - listPermissions: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - constructor(client: KeycloakAdminClient); -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/resources/roles.js b/node_modules/@keycloak/keycloak-admin-client/lib/resources/roles.js deleted file mode 100644 index af89250..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/resources/roles.js +++ /dev/null @@ -1,106 +0,0 @@ -import Resource from "./resource.js"; -export class Roles extends Resource { - /** - * Realm roles - */ - find = this.makeRequest({ - method: "GET", - path: "/roles", - }); - create = this.makeRequest({ - method: "POST", - path: "/roles", - returnResourceIdInLocationHeader: { field: "roleName" }, - }); - /** - * Roles by name - */ - findOneByName = this.makeRequest({ - method: "GET", - path: "/roles/{name}", - urlParamKeys: ["name"], - catchNotFound: true, - }); - updateByName = this.makeUpdateRequest({ - method: "PUT", - path: "/roles/{name}", - urlParamKeys: ["name"], - }); - delByName = this.makeRequest({ - method: "DELETE", - path: "/roles/{name}", - urlParamKeys: ["name"], - }); - findUsersWithRole = this.makeRequest({ - method: "GET", - path: "/roles/{name}/users", - urlParamKeys: ["name"], - catchNotFound: true, - }); - /** - * Roles by id - */ - findOneById = this.makeRequest({ - method: "GET", - path: "/roles-by-id/{id}", - urlParamKeys: ["id"], - catchNotFound: true, - }); - createComposite = this.makeUpdateRequest({ - method: "POST", - path: "/roles-by-id/{roleId}/composites", - urlParamKeys: ["roleId"], - }); - getCompositeRoles = this.makeRequest({ - method: "GET", - path: "/roles-by-id/{id}/composites", - urlParamKeys: ["id"], - }); - getCompositeRolesForRealm = this.makeRequest({ - method: "GET", - path: "/roles-by-id/{id}/composites/realm", - urlParamKeys: ["id"], - }); - getCompositeRolesForClient = this.makeRequest({ - method: "GET", - path: "/roles-by-id/{id}/composites/clients/{clientId}", - urlParamKeys: ["id", "clientId"], - }); - delCompositeRoles = this.makeUpdateRequest({ - method: "DELETE", - path: "/roles-by-id/{id}/composites", - urlParamKeys: ["id"], - }); - updateById = this.makeUpdateRequest({ - method: "PUT", - path: "/roles-by-id/{id}", - urlParamKeys: ["id"], - }); - delById = this.makeRequest({ - method: "DELETE", - path: "/roles-by-id/{id}", - urlParamKeys: ["id"], - }); - /** - * Authorization permissions - */ - updatePermission = this.makeUpdateRequest({ - method: "PUT", - path: "/roles-by-id/{id}/management/permissions", - urlParamKeys: ["id"], - }); - listPermissions = this.makeRequest({ - method: "GET", - path: "/roles-by-id/{id}/management/permissions", - urlParamKeys: ["id"], - }); - constructor(client) { - super(client, { - path: "/admin/realms/{realm}", - getUrlParams: () => ({ - realm: client.realmName, - }), - getBaseUrl: () => client.baseUrl, - }); - } -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/resources/serverInfo.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/resources/serverInfo.d.ts deleted file mode 100644 index 69db308..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/resources/serverInfo.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import Resource from "./resource.js"; -import type { ServerInfoRepresentation } from "../defs/serverInfoRepesentation.js"; -import type KeycloakAdminClient from "../index.js"; -import type EffectiveMessageBundleRepresentation from "../defs/effectiveMessageBundleRepresentation.js"; -export interface MessageBundleQuery { - realm: string; - theme?: string; - themeType?: string; - locale?: string; - source?: boolean; -} -export declare class ServerInfo extends Resource { - constructor(client: KeycloakAdminClient); - find: (payload?: {} | undefined, options?: Pick | undefined) => Promise; - findEffectiveMessageBundles: (payload?: MessageBundleQuery | undefined, options?: Pick | undefined) => Promise; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/resources/serverInfo.js b/node_modules/@keycloak/keycloak-admin-client/lib/resources/serverInfo.js deleted file mode 100644 index a516fac..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/resources/serverInfo.js +++ /dev/null @@ -1,19 +0,0 @@ -import Resource from "./resource.js"; -export class ServerInfo extends Resource { - constructor(client) { - super(client, { - path: "/", - getBaseUrl: () => client.baseUrl, - }); - } - find = this.makeRequest({ - method: "GET", - path: "/admin/serverinfo", - }); - findEffectiveMessageBundles = this.makeRequest({ - method: "GET", - path: "/resources/{realm}/{themeType}/{locale}", - urlParamKeys: ["realm", "themeType", "locale"], - queryParamKeys: ["theme", "source"], - }); -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/resources/userStorageProvider.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/resources/userStorageProvider.d.ts deleted file mode 100644 index 777a31d..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/resources/userStorageProvider.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -import type { KeycloakAdminClient } from "../client.js"; -import type SynchronizationResultRepresentation from "../defs/synchronizationResultRepresentation.js"; -import Resource from "./resource.js"; -type ActionType = "triggerFullSync" | "triggerChangedUsersSync"; -export type DirectionType = "fedToKeycloak" | "keycloakToFed"; -type NameResponse = { - id: string; - name: string; -}; -export declare class UserStorageProvider extends Resource<{ - realm?: string; -}> { - name: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - removeImportedUsers: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - sync: (payload?: ({ - id: string; - action?: ActionType | undefined; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - unlinkUsers: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - mappersSync: (payload?: ({ - id: string; - parentId: string; - direction?: DirectionType | undefined; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - constructor(client: KeycloakAdminClient); -} -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/resources/userStorageProvider.js b/node_modules/@keycloak/keycloak-admin-client/lib/resources/userStorageProvider.js deleted file mode 100644 index 6992a7e..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/resources/userStorageProvider.js +++ /dev/null @@ -1,39 +0,0 @@ -import Resource from "./resource.js"; -export class UserStorageProvider extends Resource { - name = this.makeRequest({ - method: "GET", - path: "/{id}/name", - urlParamKeys: ["id"], - }); - removeImportedUsers = this.makeRequest({ - method: "POST", - path: "/{id}/remove-imported-users", - urlParamKeys: ["id"], - }); - sync = this.makeRequest({ - method: "POST", - path: "/{id}/sync", - urlParamKeys: ["id"], - queryParamKeys: ["action"], - }); - unlinkUsers = this.makeRequest({ - method: "POST", - path: "/{id}/unlink-users", - urlParamKeys: ["id"], - }); - mappersSync = this.makeRequest({ - method: "POST", - path: "/{parentId}/mappers/{id}/sync", - urlParamKeys: ["id", "parentId"], - queryParamKeys: ["direction"], - }); - constructor(client) { - super(client, { - path: "/admin/realms/{realm}/user-storage", - getUrlParams: () => ({ - realm: client.realmName, - }), - getBaseUrl: () => client.baseUrl, - }); - } -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/resources/users.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/resources/users.d.ts deleted file mode 100644 index 3d61122..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/resources/users.d.ts +++ /dev/null @@ -1,329 +0,0 @@ -import type { KeycloakAdminClient } from "../client.js"; -import type CredentialRepresentation from "../defs/credentialRepresentation.js"; -import type FederatedIdentityRepresentation from "../defs/federatedIdentityRepresentation.js"; -import type GroupRepresentation from "../defs/groupRepresentation.js"; -import type MappingsRepresentation from "../defs/mappingsRepresentation.js"; -import type RoleRepresentation from "../defs/roleRepresentation.js"; -import type { RoleMappingPayload } from "../defs/roleRepresentation.js"; -import type UserConsentRepresentation from "../defs/userConsentRepresentation.js"; -import type { UserProfileConfig, UserProfileMetadata } from "../defs/userProfileMetadata.js"; -import type UserRepresentation from "../defs/userRepresentation.js"; -import type UserSessionRepresentation from "../defs/userSessionRepresentation.js"; -import Resource from "./resource.js"; -interface SearchQuery { - search?: string; -} -interface PaginationQuery { - first?: number; - max?: number; -} -interface UserBaseQuery { - email?: string; - firstName?: string; - lastName?: string; - username?: string; -} -export interface UserQuery extends PaginationQuery, SearchQuery, UserBaseQuery { - exact?: boolean; - [key: string]: string | number | undefined | boolean; -} -export declare class Users extends Resource<{ - realm?: string; -}> { - find: (payload?: (UserQuery & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - create: (payload?: (UserRepresentation & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise<{ - id: string; - }>; - /** - * Single user - */ - findOne: (payload?: ({ - id: string; - userProfileMetadata?: boolean | undefined; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - update: (query: { - id: string; - } & { - realm?: string | undefined; - }, payload: UserRepresentation) => Promise; - del: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - count: (payload?: (UserBaseQuery & SearchQuery & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - getProfile: (payload?: { - realm?: string | undefined; - } | undefined, options?: Pick | undefined) => Promise; - updateProfile: (payload?: (UserProfileConfig & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - getProfileMetadata: (payload?: { - realm?: string | undefined; - } | undefined, options?: Pick | undefined) => Promise; - /** - * role mappings - */ - listRoleMappings: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - addRealmRoleMappings: (payload?: ({ - id: string; - roles: RoleMappingPayload[]; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - listRealmRoleMappings: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - delRealmRoleMappings: (payload?: ({ - id: string; - roles: RoleMappingPayload[]; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - listAvailableRealmRoleMappings: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - listCompositeRealmRoleMappings: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - /** - * Client role mappings - * https://www.keycloak.org/docs-api/11.0/rest-api/#_client_role_mappings_resource - */ - listClientRoleMappings: (payload?: ({ - id: string; - clientUniqueId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - addClientRoleMappings: (payload?: ({ - id: string; - clientUniqueId: string; - roles: RoleMappingPayload[]; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - delClientRoleMappings: (payload?: ({ - id: string; - clientUniqueId: string; - roles: RoleMappingPayload[]; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - listAvailableClientRoleMappings: (payload?: ({ - id: string; - clientUniqueId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - listCompositeClientRoleMappings: (payload?: ({ - id: string; - clientUniqueId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - /** - * Send a update account email to the user - * an email contains a link the user can click to perform a set of required actions. - */ - executeActionsEmail: (payload?: ({ - id: string; - clientId?: string | undefined; - lifespan?: number | undefined; - redirectUri?: string | undefined; - actions?: string[] | undefined; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - /** - * Group - */ - listGroups: (payload?: ({ - id: string; - briefRepresentation?: boolean | undefined; - } & PaginationQuery & SearchQuery & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - addToGroup: (payload?: ({ - id: string; - groupId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - delFromGroup: (payload?: ({ - id: string; - groupId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - countGroups: (payload?: ({ - id: string; - search?: string | undefined; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise<{ - count: number; - }>; - /** - * Federated Identity - */ - listFederatedIdentities: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - addToFederatedIdentity: (payload?: ({ - id: string; - federatedIdentityId: string; - federatedIdentity: FederatedIdentityRepresentation; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - delFromFederatedIdentity: (payload?: ({ - id: string; - federatedIdentityId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - /** - * remove totp - */ - removeTotp: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - /** - * reset password - */ - resetPassword: (payload?: ({ - id: string; - credential: CredentialRepresentation; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - getUserStorageCredentialTypes: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - /** - * get user credentials - */ - getCredentials: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - /** - * delete user credentials - */ - deleteCredential: (payload?: ({ - id: string; - credentialId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - /** - * update a credential label for a user - */ - updateCredentialLabel: (query: { - id: string; - credentialId: string; - } & { - realm?: string | undefined; - }, payload: string) => Promise; - moveCredentialPositionDown: (payload?: ({ - id: string; - credentialId: string; - newPreviousCredentialId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - moveCredentialPositionUp: (payload?: ({ - id: string; - credentialId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - /** - * send verify email - */ - sendVerifyEmail: (payload?: ({ - id: string; - clientId?: string | undefined; - redirectUri?: string | undefined; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - /** - * list user sessions - */ - listSessions: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - /** - * list offline sessions associated with the user and client - */ - listOfflineSessions: (payload?: ({ - id: string; - clientId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - /** - * logout user from all sessions - */ - logout: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - /** - * list consents granted by the user - */ - listConsents: (payload?: ({ - id: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - impersonation: (query: { - id: string; - } & { - realm?: string | undefined; - }, payload: { - user: string; - realm: string; - }) => Promise>; - /** - * revoke consent and offline tokens for particular client from user - */ - revokeConsent: (payload?: ({ - id: string; - clientId: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; - constructor(client: KeycloakAdminClient); -} -export {}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/resources/users.js b/node_modules/@keycloak/keycloak-admin-client/lib/resources/users.js deleted file mode 100644 index 9f3892c..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/resources/users.js +++ /dev/null @@ -1,295 +0,0 @@ -import Resource from "./resource.js"; -export class Users extends Resource { - find = this.makeRequest({ - method: "GET", - }); - create = this.makeRequest({ - method: "POST", - returnResourceIdInLocationHeader: { field: "id" }, - }); - /** - * Single user - */ - findOne = this.makeRequest({ - method: "GET", - path: "/{id}", - urlParamKeys: ["id"], - catchNotFound: true, - }); - update = this.makeUpdateRequest({ - method: "PUT", - path: "/{id}", - urlParamKeys: ["id"], - }); - del = this.makeRequest({ - method: "DELETE", - path: "/{id}", - urlParamKeys: ["id"], - }); - count = this.makeRequest({ - method: "GET", - path: "/count", - }); - getProfile = this.makeRequest({ - method: "GET", - path: "/profile", - }); - updateProfile = this.makeRequest({ - method: "PUT", - path: "/profile", - }); - getProfileMetadata = this.makeRequest({ - method: "GET", - path: "/profile/metadata", - }); - /** - * role mappings - */ - listRoleMappings = this.makeRequest({ - method: "GET", - path: "/{id}/role-mappings", - urlParamKeys: ["id"], - }); - addRealmRoleMappings = this.makeRequest({ - method: "POST", - path: "/{id}/role-mappings/realm", - urlParamKeys: ["id"], - payloadKey: "roles", - }); - listRealmRoleMappings = this.makeRequest({ - method: "GET", - path: "/{id}/role-mappings/realm", - urlParamKeys: ["id"], - }); - delRealmRoleMappings = this.makeRequest({ - method: "DELETE", - path: "/{id}/role-mappings/realm", - urlParamKeys: ["id"], - payloadKey: "roles", - }); - listAvailableRealmRoleMappings = this.makeRequest({ - method: "GET", - path: "/{id}/role-mappings/realm/available", - urlParamKeys: ["id"], - }); - // Get effective realm-level role mappings This will recurse all composite roles to get the result. - listCompositeRealmRoleMappings = this.makeRequest({ - method: "GET", - path: "/{id}/role-mappings/realm/composite", - urlParamKeys: ["id"], - }); - /** - * Client role mappings - * https://www.keycloak.org/docs-api/11.0/rest-api/#_client_role_mappings_resource - */ - listClientRoleMappings = this.makeRequest({ - method: "GET", - path: "/{id}/role-mappings/clients/{clientUniqueId}", - urlParamKeys: ["id", "clientUniqueId"], - }); - addClientRoleMappings = this.makeRequest({ - method: "POST", - path: "/{id}/role-mappings/clients/{clientUniqueId}", - urlParamKeys: ["id", "clientUniqueId"], - payloadKey: "roles", - }); - delClientRoleMappings = this.makeRequest({ - method: "DELETE", - path: "/{id}/role-mappings/clients/{clientUniqueId}", - urlParamKeys: ["id", "clientUniqueId"], - payloadKey: "roles", - }); - listAvailableClientRoleMappings = this.makeRequest({ - method: "GET", - path: "/{id}/role-mappings/clients/{clientUniqueId}/available", - urlParamKeys: ["id", "clientUniqueId"], - }); - listCompositeClientRoleMappings = this.makeRequest({ - method: "GET", - path: "/{id}/role-mappings/clients/{clientUniqueId}/composite", - urlParamKeys: ["id", "clientUniqueId"], - }); - /** - * Send a update account email to the user - * an email contains a link the user can click to perform a set of required actions. - */ - executeActionsEmail = this.makeRequest({ - method: "PUT", - path: "/{id}/execute-actions-email", - urlParamKeys: ["id"], - payloadKey: "actions", - queryParamKeys: ["lifespan", "redirectUri", "clientId"], - keyTransform: { - clientId: "client_id", - redirectUri: "redirect_uri", - }, - }); - /** - * Group - */ - listGroups = this.makeRequest({ - method: "GET", - path: "/{id}/groups", - urlParamKeys: ["id"], - }); - addToGroup = this.makeRequest({ - method: "PUT", - path: "/{id}/groups/{groupId}", - urlParamKeys: ["id", "groupId"], - }); - delFromGroup = this.makeRequest({ - method: "DELETE", - path: "/{id}/groups/{groupId}", - urlParamKeys: ["id", "groupId"], - }); - countGroups = this.makeRequest({ - method: "GET", - path: "/{id}/groups/count", - urlParamKeys: ["id"], - }); - /** - * Federated Identity - */ - listFederatedIdentities = this.makeRequest({ - method: "GET", - path: "/{id}/federated-identity", - urlParamKeys: ["id"], - }); - addToFederatedIdentity = this.makeRequest({ - method: "POST", - path: "/{id}/federated-identity/{federatedIdentityId}", - urlParamKeys: ["id", "federatedIdentityId"], - payloadKey: "federatedIdentity", - }); - delFromFederatedIdentity = this.makeRequest({ - method: "DELETE", - path: "/{id}/federated-identity/{federatedIdentityId}", - urlParamKeys: ["id", "federatedIdentityId"], - }); - /** - * remove totp - */ - removeTotp = this.makeRequest({ - method: "PUT", - path: "/{id}/remove-totp", - urlParamKeys: ["id"], - }); - /** - * reset password - */ - resetPassword = this.makeRequest({ - method: "PUT", - path: "/{id}/reset-password", - urlParamKeys: ["id"], - payloadKey: "credential", - }); - getUserStorageCredentialTypes = this.makeRequest({ - method: "GET", - path: "/{id}/configured-user-storage-credential-types", - urlParamKeys: ["id"], - }); - /** - * get user credentials - */ - getCredentials = this.makeRequest({ - method: "GET", - path: "/{id}/credentials", - urlParamKeys: ["id"], - }); - /** - * delete user credentials - */ - deleteCredential = this.makeRequest({ - method: "DELETE", - path: "/{id}/credentials/{credentialId}", - urlParamKeys: ["id", "credentialId"], - }); - /** - * update a credential label for a user - */ - updateCredentialLabel = this.makeUpdateRequest({ - method: "PUT", - path: "/{id}/credentials/{credentialId}/userLabel", - urlParamKeys: ["id", "credentialId"], - headers: { "content-type": "text/plain" }, - }); - // Move a credential to a position behind another credential - moveCredentialPositionDown = this.makeRequest({ - method: "POST", - path: "/{id}/credentials/{credentialId}/moveAfter/{newPreviousCredentialId}", - urlParamKeys: ["id", "credentialId", "newPreviousCredentialId"], - }); - // Move a credential to a first position in the credentials list of the user - moveCredentialPositionUp = this.makeRequest({ - method: "POST", - path: "/{id}/credentials/{credentialId}/moveToFirst", - urlParamKeys: ["id", "credentialId"], - }); - /** - * send verify email - */ - sendVerifyEmail = this.makeRequest({ - method: "PUT", - path: "/{id}/send-verify-email", - urlParamKeys: ["id"], - queryParamKeys: ["clientId", "redirectUri"], - keyTransform: { - clientId: "client_id", - redirectUri: "redirect_uri", - }, - }); - /** - * list user sessions - */ - listSessions = this.makeRequest({ - method: "GET", - path: "/{id}/sessions", - urlParamKeys: ["id"], - }); - /** - * list offline sessions associated with the user and client - */ - listOfflineSessions = this.makeRequest({ - method: "GET", - path: "/{id}/offline-sessions/{clientId}", - urlParamKeys: ["id", "clientId"], - }); - /** - * logout user from all sessions - */ - logout = this.makeRequest({ - method: "POST", - path: "/{id}/logout", - urlParamKeys: ["id"], - }); - /** - * list consents granted by the user - */ - listConsents = this.makeRequest({ - method: "GET", - path: "/{id}/consents", - urlParamKeys: ["id"], - }); - impersonation = this.makeUpdateRequest({ - method: "POST", - path: "/{id}/impersonation", - urlParamKeys: ["id"], - }); - /** - * revoke consent and offline tokens for particular client from user - */ - revokeConsent = this.makeRequest({ - method: "DELETE", - path: "/{id}/consents/{clientId}", - urlParamKeys: ["id", "clientId"], - }); - constructor(client) { - super(client, { - path: "/admin/realms/{realm}/users", - getUrlParams: () => ({ - realm: client.realmName, - }), - getBaseUrl: () => client.baseUrl, - }); - } -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/resources/whoAmI.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/resources/whoAmI.d.ts deleted file mode 100644 index cb37808..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/resources/whoAmI.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type WhoAmIRepresentation from "../defs/whoAmIRepresentation.js"; -import type KeycloakAdminClient from "../index.js"; -import Resource from "./resource.js"; -export declare class WhoAmI extends Resource<{ - realm?: string; -}> { - constructor(client: KeycloakAdminClient); - find: (payload?: ({ - currentRealm: string; - } & { - realm?: string | undefined; - }) | undefined, options?: Pick | undefined) => Promise; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/resources/whoAmI.js b/node_modules/@keycloak/keycloak-admin-client/lib/resources/whoAmI.js deleted file mode 100644 index 959046a..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/resources/whoAmI.js +++ /dev/null @@ -1,17 +0,0 @@ -import Resource from "./resource.js"; -export class WhoAmI extends Resource { - constructor(client) { - super(client, { - path: "/admin/{realm}/console", - getUrlParams: () => ({ - realm: client.realmName, - }), - getBaseUrl: () => client.baseUrl, - }); - } - find = this.makeRequest({ - method: "GET", - path: "/whoami", - queryParamKeys: ["currentRealm"], - }); -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/utils/auth.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/utils/auth.d.ts deleted file mode 100644 index ff65f9e..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/utils/auth.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -export type GrantTypes = "client_credentials" | "password" | "refresh_token"; -export interface Credentials { - username?: string; - password?: string; - grantType: GrantTypes; - clientId: string; - clientSecret?: string; - totp?: string; - offlineToken?: boolean; - refreshToken?: string; - scopes?: string[]; -} -export interface Settings { - realmName?: string; - baseUrl?: string; - scope?: string; - credentials: Credentials; - requestOptions?: RequestInit; -} -export interface TokenResponseRaw { - access_token: string; - expires_in: string; - refresh_expires_in: number; - refresh_token: string; - token_type: string; - not_before_policy: number; - session_state: string; - scope: string; - id_token?: string; -} -export interface TokenResponse { - accessToken: string; - expiresIn: string; - refreshExpiresIn: number; - refreshToken: string; - tokenType: string; - notBeforePolicy: number; - sessionState: string; - scope: string; - idToken?: string; -} -export declare const getToken: (settings: Settings) => Promise; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/utils/auth.js b/node_modules/@keycloak/keycloak-admin-client/lib/utils/auth.js deleted file mode 100644 index 397e8a4..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/utils/auth.js +++ /dev/null @@ -1,54 +0,0 @@ -import camelize from "camelize-ts"; -import { defaultBaseUrl, defaultRealm } from "./constants.js"; -import { fetchWithError } from "./fetchWithError.js"; -import { stringifyQueryParams } from "./stringifyQueryParams.js"; -// See: https://developer.mozilla.org/en-US/docs/Glossary/Base64 -const bytesToBase64 = (bytes) => btoa(Array.from(bytes, (byte) => String.fromCodePoint(byte)).join("")); -const toBase64 = (input) => bytesToBase64(new TextEncoder().encode(input)); -// See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent#encoding_for_rfc3986 -const encodeRFC3986URIComponent = (input) => encodeURIComponent(input).replace(/[!'()*]/g, (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`); -// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent -// Specifically, the section on encoding `application/x-www-form-urlencoded`. -const encodeFormURIComponent = (data) => encodeRFC3986URIComponent(data).replaceAll("%20", "+"); -export const getToken = async (settings) => { - // Construct URL - const baseUrl = settings.baseUrl || defaultBaseUrl; - const realmName = settings.realmName || defaultRealm; - const url = `${baseUrl}/realms/${realmName}/protocol/openid-connect/token`; - // Prepare credentials for openid-connect token request - // ref: http://openid.net/specs/openid-connect-core-1_0.html#TokenEndpoint - const credentials = settings.credentials || {}; - const payload = stringifyQueryParams({ - username: credentials.username, - password: credentials.password, - grant_type: credentials.grantType, - client_id: credentials.clientId, - totp: credentials.totp, - ...(credentials.offlineToken ? { scope: "offline_access" } : {}), - ...(credentials.scopes ? { scope: credentials.scopes.join(" ") } : {}), - ...(credentials.refreshToken - ? { - refresh_token: credentials.refreshToken, - client_secret: credentials.clientSecret, - } - : {}), - }); - const options = settings.requestOptions ?? {}; - const headers = new Headers(options.headers); - if (credentials.clientSecret) { - // See: https://datatracker.ietf.org/doc/html/rfc6749#section-2.3.1 - const username = encodeFormURIComponent(credentials.clientId); - const password = encodeFormURIComponent(credentials.clientSecret); - // See: https://datatracker.ietf.org/doc/html/rfc2617#section-2 - headers.set("authorization", `Basic ${toBase64(`${username}:${password}`)}`); - } - headers.set("content-type", "application/x-www-form-urlencoded"); - const response = await fetchWithError(url, { - ...options, - method: "POST", - headers, - body: payload, - }); - const data = await response.json(); - return camelize(data); -}; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/utils/constants.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/utils/constants.d.ts deleted file mode 100644 index 51d3f9a..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/utils/constants.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const defaultBaseUrl = "http://127.0.0.1:8180"; -export declare const defaultRealm = "master"; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/utils/constants.js b/node_modules/@keycloak/keycloak-admin-client/lib/utils/constants.js deleted file mode 100644 index eaee4ff..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/utils/constants.js +++ /dev/null @@ -1,2 +0,0 @@ -export const defaultBaseUrl = "http://127.0.0.1:8180"; -export const defaultRealm = "master"; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/utils/fetchWithError.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/utils/fetchWithError.d.ts deleted file mode 100644 index 8943615..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/utils/fetchWithError.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -export type NetworkErrorOptions = { - response: Response; - responseData: unknown; -}; -export declare class NetworkError extends Error { - response: Response; - responseData: unknown; - constructor(message: string, options: NetworkErrorOptions); -} -export declare function fetchWithError(input: RequestInfo | URL, init?: RequestInit): Promise; -export declare function parseResponse(response: Response): Promise; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/utils/fetchWithError.js b/node_modules/@keycloak/keycloak-admin-client/lib/utils/fetchWithError.js deleted file mode 100644 index 62962f8..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/utils/fetchWithError.js +++ /dev/null @@ -1,32 +0,0 @@ -export class NetworkError extends Error { - response; - responseData; - constructor(message, options) { - super(message); - this.response = options.response; - this.responseData = options.responseData; - } -} -export async function fetchWithError(input, init) { - const response = await fetch(input, init); - if (!response.ok) { - const responseData = await parseResponse(response); - throw new NetworkError("Network response was not OK.", { - response, - responseData, - }); - } - return response; -} -export async function parseResponse(response) { - if (!response.body) { - return ""; - } - const data = await response.text(); - try { - return JSON.parse(data); - // eslint-disable-next-line no-empty - } - catch (error) { } - return data; -} diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/utils/stringifyQueryParams.d.ts b/node_modules/@keycloak/keycloak-admin-client/lib/utils/stringifyQueryParams.d.ts deleted file mode 100644 index 3690fd1..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/utils/stringifyQueryParams.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function stringifyQueryParams(params: Record): string; diff --git a/node_modules/@keycloak/keycloak-admin-client/lib/utils/stringifyQueryParams.js b/node_modules/@keycloak/keycloak-admin-client/lib/utils/stringifyQueryParams.js deleted file mode 100644 index 25c0f15..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/lib/utils/stringifyQueryParams.js +++ /dev/null @@ -1,25 +0,0 @@ -export function stringifyQueryParams(params) { - const searchParams = new URLSearchParams(); - for (const [key, value] of Object.entries(params)) { - // Ignore undefined and null values. - if (value === undefined || value === null) { - continue; - } - // Ignore empty strings. - if (typeof value === "string" && value.length === 0) { - continue; - } - // Ignore empty arrays. - if (Array.isArray(value) && value.length === 0) { - continue; - } - // Append each entry of an array as a separate parameter, or the value itself otherwise. - if (Array.isArray(value)) { - value.forEach((item) => searchParams.append(key, item.toString())); - } - else { - searchParams.append(key, value.toString()); - } - } - return searchParams.toString(); -} diff --git a/node_modules/@keycloak/keycloak-admin-client/package.json b/node_modules/@keycloak/keycloak-admin-client/package.json deleted file mode 100644 index 406e323..0000000 --- a/node_modules/@keycloak/keycloak-admin-client/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "@keycloak/keycloak-admin-client", - "version": "24.0.4", - "description": "A client to interact with Keycloak's Administration API", - "type": "module", - "main": "lib/index.js", - "files": [ - "lib" - ], - "types": "lib/index.d.ts", - "engines": { - "node": ">=18" - }, - "wireit": { - "build": { - "command": "tsc --pretty", - "files": [ - "src/**", - "package.json", - "tsconfig.json" - ], - "output": [ - "lib/**" - ] - }, - "lint": { - "command": "eslint . --ext js,jsx,mjs,ts,tsx" - }, - "test": { - "command": "TS_NODE_PROJECT=tsconfig.test.json mocha --recursive \"test/**/*.spec.ts\" --timeout 10000" - } - }, - "dependencies": { - "camelize-ts": "^3.0.0", - "url-join": "^5.0.0", - "url-template": "^3.1.1" - }, - "devDependencies": { - "@faker-js/faker": "^8.4.1", - "@types/chai": "^4.3.12", - "@types/lodash-es": "^4.17.12", - "@types/mocha": "^10.0.6", - "@types/node": "^20.11.24", - "chai": "^5.1.0", - "lodash-es": "^4.17.21", - "mocha": "^10.3.0", - "ts-node": "^10.9.2" - }, - "author": { - "name": "Red Hat, Inc.", - "url": "https://www.keycloak.org/" - }, - "license": "Apache-2.0", - "repository": { - "type": "git", - "url": "https://github.com/keycloak/keycloak.git" - }, - "homepage": "https://www.keycloak.org/", - "scripts": { - "build": "wireit", - "lint": "wireit", - "test": "wireit" - } -} \ No newline at end of file diff --git a/node_modules/camelize-ts/README.md b/node_modules/camelize-ts/README.md deleted file mode 100644 index c434c79..0000000 --- a/node_modules/camelize-ts/README.md +++ /dev/null @@ -1,136 +0,0 @@ -camelize-ts -=== -[![CI](https://github.com/kbrabrand/camelize-ts/actions/workflows/main.yml/badge.svg)](https://github.com/kbrabrand/camelize-ts/actions/workflows/main.yml) - -A typescript typed camelCase function that recursively camel cases a snake cased or pascal cased object structure. It camel cases a simple string too, if you need that. - -`camelize-ts` is [`snakify-ts`](https://www.npmjs.com/package/snakify-ts)’ twin 👯. - -## Why do this again? -This has obviously been done before, and the "new" thing with this pacakge is not camel casing itself but the fact that it is a generic that, given the form of the input data structure, will provide you with typing for the returned object structure so that it fits with other types. - -As an example I've been using it to camelize PostgreSQL rows (returned with snake case) before passing them to other functions in our GraphQL server (using camel cased property names). - -## Example -```ts -import camelize from 'camelize-ts' - -// Expects camel case -function nameIt({ - firstName, - lastName -}: { - id: number, - firstName: string, - lastName: string, - roles: string[] -}) { return `${firstName} ${lastName}` } - -// camel case snake_cased stuff from postgres -const camelizedUser = camelize({ - id: 1, - first_name: 'Grim', - last_name: 'Reaper', - roles: ['user', 'admin'] -}) - -console.log(JSON.stringify(camelizedUser, null, 2)) -console.log(nameIt(camelizedUser) -``` - -output: - -```sh -{ - "id": 1, - "firstName": "Grim", - "lastName": "Reaper", - "roles": [ - "user", - "admin" - ] -} - -Grim Reaper -``` - -It also converts pascal cased object fields to camel case. - -```ts -import camelize from 'camelize-ts' - -const camelizedUser = camelize({ - Id: 1, - first_name: 'Grim', - last_name: 'Reaper', - greetings: { - Morning: 'Good morning!', - Night: 'Good night!' - }, - roles: ['user', 'admin'], - UpdatedAt: '2000-01-01T00:00:00.000Z' -}) - -console.log(JSON.stringify(camelizedUser, null, 2)) -``` - -output: - -```sh -{ - "id": 1, - "firstName": "Grim", - "lastName": "Reaper", - "greetings": { - "morning": "Good morning!", - "night": "Good night!" - }, - "roles": [ - "user", - "admin" - ], - "updatedAt": "2000-01-01T00:00:00.000Z" -} -``` - - -### Shallow option -By default camelize will traverse to the bottom of the object/array structure you pass. If you want to perform a shallow camelize, touching only the top level of the value you can pass true for the `shallow` option (second argument). - -### Type inference -You don't need to pass a type to `camelize` since it uses argument inference to find the type to convert. But if you need to, you can pass a type like this: - -```ts -camelize< - // type of value to camelize - { first_name: string }, - - // whether or not to perform shallow camelization - true ->( - // value to camelize, type must match the specified type - value, - - // shallow, must match what's set as the second type argument above (after the type) - true -) -``` - -#### Type conversion -If you need to convert just a type, you can use the `Camelize` generic type to do this: - -```ts -import { Camelize } from 'camelize-ts' - -type MySnakePerson = { first_name: string } -type MyCamelPerson = Camelize -``` - -## Running tests -```sh -npm run test // one time/CI -npm run test:watch // on each file change -``` - -## Licence -MIT diff --git a/node_modules/camelize-ts/dist/index.d.ts b/node_modules/camelize-ts/dist/index.d.ts deleted file mode 100644 index 7d15ebf..0000000 --- a/node_modules/camelize-ts/dist/index.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -declare type CamelCase = S extends `${infer P1}_${infer P2}${infer P3}` ? `${P1}${Uppercase}${CamelCase}` : S; -declare type CamelizeObject = { - [K in keyof T as Uncapitalize>]: T[K] extends Date ? T[K] : T[K] extends RegExp ? T[K] : T[K] extends Array ? U extends ({} | undefined) ? Array> : T[K] : T[K] extends ({} | undefined) ? S extends true ? T[K] : CamelizeObject : T[K]; -}; -export declare type Camelize = T extends Array<(infer U)> ? Array> : CamelizeObject; -export default function camelize( -/** - * Value to be camelized - */ -obj: T, -/** - * If true, only the top level keys of the obj will be camel cased - */ -shallow?: S): T extends String ? string : Camelize; -export {}; diff --git a/node_modules/camelize-ts/dist/index.js b/node_modules/camelize-ts/dist/index.js deleted file mode 100644 index b8ec9e3..0000000 --- a/node_modules/camelize-ts/dist/index.js +++ /dev/null @@ -1,38 +0,0 @@ -function camelCase(str) { - return str.replace(/[_.-](\w|$)/g, function (_, x) { - return x.toUpperCase(); - }); -} -function walk(obj, shallow = false) { - if (!obj || typeof obj !== "object") - return obj; - if (obj instanceof Date || obj instanceof RegExp) - return obj; - if (Array.isArray(obj)) - return obj.map(v => { - if (!shallow) { - return walk(v); - } - if (typeof v === 'object') - return walk(v, shallow); - return v; - }); - return Object.keys(obj).reduce((res, key) => { - const camel = camelCase(key); - const uncapitalized = camel.charAt(0).toLowerCase() + camel.slice(1); - res[uncapitalized] = shallow ? obj[key] : walk(obj[key]); - return res; - }, {}); -} -export default function camelize( -/** - * Value to be camelized - */ -obj, -/** - * If true, only the top level keys of the obj will be camel cased - */ -shallow) { - return typeof obj === "string" ? camelCase(obj) : walk(obj, shallow); -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/camelize-ts/dist/index.js.map b/node_modules/camelize-ts/dist/index.js.map deleted file mode 100644 index 5714adc..0000000 --- a/node_modules/camelize-ts/dist/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"AAyBA,SAAS,SAAS,CAAC,GAAW;IAC5B,OAAO,GAAG,CAAC,OAAO,CAAC,cAAc,EAAE,UAAU,CAAC,EAAE,CAAC;QAC7C,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;IAC3B,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,IAAI,CAAC,GAAG,EAAE,OAAO,GAAG,KAAK;IAChC,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,GAAG,CAAC;IAChD,IAAI,GAAG,YAAY,IAAI,IAAI,GAAG,YAAY,MAAM;QAAE,OAAO,GAAG,CAAC;IAC7D,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QAAE,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;YACzC,IAAI,CAAC,OAAO,EAAE;gBAAE,OAAO,IAAI,CAAC,CAAC,CAAC,CAAA;aAAE;YAChC,IAAI,OAAO,CAAC,KAAK,QAAQ;gBAAE,OAAO,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,CAAA;YAClD,OAAO,CAAC,CAAA;QACV,CAAC,CAAC,CAAA;IAEF,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QAC1C,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC;QAC7B,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACrE,GAAG,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;QACzD,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC;AAED,MAAM,CAAC,OAAO,UAAU,QAAQ;AAC9B;;GAEG;AACH,GAAM;AAEN;;GAEG;AACH,OAAW;IAEX,OAAO,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AACvE,CAAC","sourcesContent":["type CamelCase =\n S extends `${infer P1}_${infer P2}${infer P3}`\n ? `${P1}${Uppercase}${CamelCase}`\n : S;\n\ntype CamelizeObject = {\n [K in keyof T as Uncapitalize>]:\n T[K] extends Date ? T[K] :\n T[K] extends RegExp ? T[K] :\n T[K] extends Array\n ? U extends ({} | undefined)\n ? Array>\n : T[K]\n : T[K] extends ({} | undefined)\n ? S extends true\n ? T[K]\n : CamelizeObject\n : T[K]\n};\n\nexport type Camelize =\n T extends Array<(infer U)>\n ? Array>\n : CamelizeObject;\n\nfunction camelCase(str: string) {\n return str.replace(/[_.-](\\w|$)/g, function (_, x) {\n return x.toUpperCase();\n });\n}\n\nfunction walk(obj, shallow = false): any {\n if (!obj || typeof obj !== \"object\") return obj;\n if (obj instanceof Date || obj instanceof RegExp) return obj;\n if (Array.isArray(obj)) return obj.map(v => {\n if (!shallow) { return walk(v) }\n if (typeof v === 'object') return walk(v, shallow)\n return v\n })\n\n return Object.keys(obj).reduce((res, key) => {\n const camel = camelCase(key);\n const uncapitalized = camel.charAt(0).toLowerCase() + camel.slice(1);\n res[uncapitalized] = shallow ? obj[key] : walk(obj[key]);\n return res;\n }, {});\n}\n\nexport default function camelize(\n /**\n * Value to be camelized\n */\n obj: T,\n\n /**\n * If true, only the top level keys of the obj will be camel cased\n */\n shallow?: S\n): T extends String ? string : Camelize {\n return typeof obj === \"string\" ? camelCase(obj) : walk(obj, shallow);\n}\n"]} \ No newline at end of file diff --git a/node_modules/camelize-ts/package.json b/node_modules/camelize-ts/package.json deleted file mode 100644 index 092b061..0000000 --- a/node_modules/camelize-ts/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "camelize-ts", - "version": "3.0.0", - "description": "Recursive camel casing of object property names with proper typing", - "type": "module", - "main": "./dist/index.js", - "exports": "./dist/index.js", - "types": "./dist/index.d.ts", - "sideEffects": false, - "files": [ - "dist" - ], - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "scripts": { - "test": "jest", - "test:coverage": "jest --coverage", - "test:watch": "jest --watch --verbose", - "build": "tsc", - "prepublishOnly": "npm run build" - }, - "repository": "kbrabrand/camelize-ts", - "author": { - "name": "Kristoffer Brabrand", - "email": "kristoffer@brabrand.no", - "url": "https://github.com/kbrabrand" - }, - "license": "MIT", - "keywords": [ - "camel-case", - "json", - "transform", - "typescript" - ], - "devDependencies": { - "@types/jest": "^27.4.0", - "jest": "^27.4.7", - "ts-jest": "^27.1.3", - "typescript": "^4.5.5" - }, - "jest": { - "collectCoverageFrom": [ - "./*" - ], - "transform": { - "^.+\\.tsx?$": "ts-jest" - }, - "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$", - "moduleFileExtensions": [ - "ts", - "tsx", - "js", - "jsx", - "json", - "node" - ], - "clearMocks": true - } -} diff --git a/node_modules/esbuild/LICENSE.md b/node_modules/esbuild/LICENSE.md deleted file mode 100644 index 2027e8d..0000000 --- a/node_modules/esbuild/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Evan Wallace - -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. diff --git a/node_modules/esbuild/README.md b/node_modules/esbuild/README.md deleted file mode 100644 index 93863d1..0000000 --- a/node_modules/esbuild/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# esbuild - -This is a JavaScript bundler and minifier. See https://github.com/evanw/esbuild and the [JavaScript API documentation](https://esbuild.github.io/api/) for details. diff --git a/node_modules/esbuild/bin/esbuild b/node_modules/esbuild/bin/esbuild deleted file mode 100755 index f95d333..0000000 Binary files a/node_modules/esbuild/bin/esbuild and /dev/null differ diff --git a/node_modules/esbuild/install.js b/node_modules/esbuild/install.js deleted file mode 100644 index d97764e..0000000 --- a/node_modules/esbuild/install.js +++ /dev/null @@ -1,285 +0,0 @@ -"use strict"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); - -// lib/npm/node-platform.ts -var fs = require("fs"); -var os = require("os"); -var path = require("path"); -var ESBUILD_BINARY_PATH = process.env.ESBUILD_BINARY_PATH || ESBUILD_BINARY_PATH; -var isValidBinaryPath = (x) => !!x && x !== "/usr/bin/esbuild"; -var knownWindowsPackages = { - "win32 arm64 LE": "@esbuild/win32-arm64", - "win32 ia32 LE": "@esbuild/win32-ia32", - "win32 x64 LE": "@esbuild/win32-x64" -}; -var knownUnixlikePackages = { - "aix ppc64 BE": "@esbuild/aix-ppc64", - "android arm64 LE": "@esbuild/android-arm64", - "darwin arm64 LE": "@esbuild/darwin-arm64", - "darwin x64 LE": "@esbuild/darwin-x64", - "freebsd arm64 LE": "@esbuild/freebsd-arm64", - "freebsd x64 LE": "@esbuild/freebsd-x64", - "linux arm LE": "@esbuild/linux-arm", - "linux arm64 LE": "@esbuild/linux-arm64", - "linux ia32 LE": "@esbuild/linux-ia32", - "linux mips64el LE": "@esbuild/linux-mips64el", - "linux ppc64 LE": "@esbuild/linux-ppc64", - "linux riscv64 LE": "@esbuild/linux-riscv64", - "linux s390x BE": "@esbuild/linux-s390x", - "linux x64 LE": "@esbuild/linux-x64", - "linux loong64 LE": "@esbuild/linux-loong64", - "netbsd x64 LE": "@esbuild/netbsd-x64", - "openbsd x64 LE": "@esbuild/openbsd-x64", - "sunos x64 LE": "@esbuild/sunos-x64" -}; -var knownWebAssemblyFallbackPackages = { - "android arm LE": "@esbuild/android-arm", - "android x64 LE": "@esbuild/android-x64" -}; -function pkgAndSubpathForCurrentPlatform() { - let pkg; - let subpath; - let isWASM = false; - let platformKey = `${process.platform} ${os.arch()} ${os.endianness()}`; - if (platformKey in knownWindowsPackages) { - pkg = knownWindowsPackages[platformKey]; - subpath = "esbuild.exe"; - } else if (platformKey in knownUnixlikePackages) { - pkg = knownUnixlikePackages[platformKey]; - subpath = "bin/esbuild"; - } else if (platformKey in knownWebAssemblyFallbackPackages) { - pkg = knownWebAssemblyFallbackPackages[platformKey]; - subpath = "bin/esbuild"; - isWASM = true; - } else { - throw new Error(`Unsupported platform: ${platformKey}`); - } - return { pkg, subpath, isWASM }; -} -function downloadedBinPath(pkg, subpath) { - const esbuildLibDir = path.dirname(require.resolve("esbuild")); - return path.join(esbuildLibDir, `downloaded-${pkg.replace("/", "-")}-${path.basename(subpath)}`); -} - -// lib/npm/node-install.ts -var fs2 = require("fs"); -var os2 = require("os"); -var path2 = require("path"); -var zlib = require("zlib"); -var https = require("https"); -var child_process = require("child_process"); -var versionFromPackageJSON = require(path2.join(__dirname, "package.json")).version; -var toPath = path2.join(__dirname, "bin", "esbuild"); -var isToPathJS = true; -function validateBinaryVersion(...command) { - command.push("--version"); - let stdout; - try { - stdout = child_process.execFileSync(command.shift(), command, { - // Without this, this install script strangely crashes with the error - // "EACCES: permission denied, write" but only on Ubuntu Linux when node is - // installed from the Snap Store. This is not a problem when you download - // the official version of node. The problem appears to be that stderr - // (i.e. file descriptor 2) isn't writable? - // - // More info: - // - https://snapcraft.io/ (what the Snap Store is) - // - https://nodejs.org/dist/ (download the official version of node) - // - https://github.com/evanw/esbuild/issues/1711#issuecomment-1027554035 - // - stdio: "pipe" - }).toString().trim(); - } catch (err) { - if (os2.platform() === "darwin" && /_SecTrustEvaluateWithError/.test(err + "")) { - let os3 = "this version of macOS"; - try { - os3 = "macOS " + child_process.execFileSync("sw_vers", ["-productVersion"]).toString().trim(); - } catch { - } - throw new Error(`The "esbuild" package cannot be installed because ${os3} is too outdated. - -The Go compiler (which esbuild relies on) no longer supports ${os3}, -which means the "esbuild" binary executable can't be run. You can either: - - * Update your version of macOS to one that the Go compiler supports - * Use the "esbuild-wasm" package instead of the "esbuild" package - * Build esbuild yourself using an older version of the Go compiler -`); - } - throw err; - } - if (stdout !== versionFromPackageJSON) { - throw new Error(`Expected ${JSON.stringify(versionFromPackageJSON)} but got ${JSON.stringify(stdout)}`); - } -} -function isYarn() { - const { npm_config_user_agent } = process.env; - if (npm_config_user_agent) { - return /\byarn\//.test(npm_config_user_agent); - } - return false; -} -function fetch(url) { - return new Promise((resolve, reject) => { - https.get(url, (res) => { - if ((res.statusCode === 301 || res.statusCode === 302) && res.headers.location) - return fetch(res.headers.location).then(resolve, reject); - if (res.statusCode !== 200) - return reject(new Error(`Server responded with ${res.statusCode}`)); - let chunks = []; - res.on("data", (chunk) => chunks.push(chunk)); - res.on("end", () => resolve(Buffer.concat(chunks))); - }).on("error", reject); - }); -} -function extractFileFromTarGzip(buffer, subpath) { - try { - buffer = zlib.unzipSync(buffer); - } catch (err) { - throw new Error(`Invalid gzip data in archive: ${err && err.message || err}`); - } - let str = (i, n) => String.fromCharCode(...buffer.subarray(i, i + n)).replace(/\0.*$/, ""); - let offset = 0; - subpath = `package/${subpath}`; - while (offset < buffer.length) { - let name = str(offset, 100); - let size = parseInt(str(offset + 124, 12), 8); - offset += 512; - if (!isNaN(size)) { - if (name === subpath) return buffer.subarray(offset, offset + size); - offset += size + 511 & ~511; - } - } - throw new Error(`Could not find ${JSON.stringify(subpath)} in archive`); -} -function installUsingNPM(pkg, subpath, binPath) { - const env = { ...process.env, npm_config_global: void 0 }; - const esbuildLibDir = path2.dirname(require.resolve("esbuild")); - const installDir = path2.join(esbuildLibDir, "npm-install"); - fs2.mkdirSync(installDir); - try { - fs2.writeFileSync(path2.join(installDir, "package.json"), "{}"); - child_process.execSync( - `npm install --loglevel=error --prefer-offline --no-audit --progress=false ${pkg}@${versionFromPackageJSON}`, - { cwd: installDir, stdio: "pipe", env } - ); - const installedBinPath = path2.join(installDir, "node_modules", pkg, subpath); - fs2.renameSync(installedBinPath, binPath); - } finally { - try { - removeRecursive(installDir); - } catch { - } - } -} -function removeRecursive(dir) { - for (const entry of fs2.readdirSync(dir)) { - const entryPath = path2.join(dir, entry); - let stats; - try { - stats = fs2.lstatSync(entryPath); - } catch { - continue; - } - if (stats.isDirectory()) removeRecursive(entryPath); - else fs2.unlinkSync(entryPath); - } - fs2.rmdirSync(dir); -} -function applyManualBinaryPathOverride(overridePath) { - const pathString = JSON.stringify(overridePath); - fs2.writeFileSync(toPath, `#!/usr/bin/env node -require('child_process').execFileSync(${pathString}, process.argv.slice(2), { stdio: 'inherit' }); -`); - const libMain = path2.join(__dirname, "lib", "main.js"); - const code = fs2.readFileSync(libMain, "utf8"); - fs2.writeFileSync(libMain, `var ESBUILD_BINARY_PATH = ${pathString}; -${code}`); -} -function maybeOptimizePackage(binPath) { - if (os2.platform() !== "win32" && !isYarn()) { - const tempPath = path2.join(__dirname, "bin-esbuild"); - try { - fs2.linkSync(binPath, tempPath); - fs2.renameSync(tempPath, toPath); - isToPathJS = false; - fs2.unlinkSync(tempPath); - } catch { - } - } -} -async function downloadDirectlyFromNPM(pkg, subpath, binPath) { - const url = `https://registry.npmjs.org/${pkg}/-/${pkg.replace("@esbuild/", "")}-${versionFromPackageJSON}.tgz`; - console.error(`[esbuild] Trying to download ${JSON.stringify(url)}`); - try { - fs2.writeFileSync(binPath, extractFileFromTarGzip(await fetch(url), subpath)); - fs2.chmodSync(binPath, 493); - } catch (e) { - console.error(`[esbuild] Failed to download ${JSON.stringify(url)}: ${e && e.message || e}`); - throw e; - } -} -async function checkAndPreparePackage() { - if (isValidBinaryPath(ESBUILD_BINARY_PATH)) { - if (!fs2.existsSync(ESBUILD_BINARY_PATH)) { - console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${ESBUILD_BINARY_PATH}`); - } else { - applyManualBinaryPathOverride(ESBUILD_BINARY_PATH); - return; - } - } - const { pkg, subpath } = pkgAndSubpathForCurrentPlatform(); - let binPath; - try { - binPath = require.resolve(`${pkg}/${subpath}`); - } catch (e) { - console.error(`[esbuild] Failed to find package "${pkg}" on the file system - -This can happen if you use the "--no-optional" flag. The "optionalDependencies" -package.json feature is used by esbuild to install the correct binary executable -for your current platform. This install script will now attempt to work around -this. If that fails, you need to remove the "--no-optional" flag to use esbuild. -`); - binPath = downloadedBinPath(pkg, subpath); - try { - console.error(`[esbuild] Trying to install package "${pkg}" using npm`); - installUsingNPM(pkg, subpath, binPath); - } catch (e2) { - console.error(`[esbuild] Failed to install package "${pkg}" using npm: ${e2 && e2.message || e2}`); - try { - await downloadDirectlyFromNPM(pkg, subpath, binPath); - } catch (e3) { - throw new Error(`Failed to install package "${pkg}"`); - } - } - } - maybeOptimizePackage(binPath); -} -checkAndPreparePackage().then(() => { - if (isToPathJS) { - validateBinaryVersion(process.execPath, toPath); - } else { - validateBinaryVersion(toPath); - } -}); diff --git a/node_modules/esbuild/lib/main.d.ts b/node_modules/esbuild/lib/main.d.ts deleted file mode 100644 index df6482e..0000000 --- a/node_modules/esbuild/lib/main.d.ts +++ /dev/null @@ -1,703 +0,0 @@ -export type Platform = 'browser' | 'node' | 'neutral' -export type Format = 'iife' | 'cjs' | 'esm' -export type Loader = 'base64' | 'binary' | 'copy' | 'css' | 'dataurl' | 'default' | 'empty' | 'file' | 'js' | 'json' | 'jsx' | 'local-css' | 'text' | 'ts' | 'tsx' -export type LogLevel = 'verbose' | 'debug' | 'info' | 'warning' | 'error' | 'silent' -export type Charset = 'ascii' | 'utf8' -export type Drop = 'console' | 'debugger' - -interface CommonOptions { - /** Documentation: https://esbuild.github.io/api/#sourcemap */ - sourcemap?: boolean | 'linked' | 'inline' | 'external' | 'both' - /** Documentation: https://esbuild.github.io/api/#legal-comments */ - legalComments?: 'none' | 'inline' | 'eof' | 'linked' | 'external' - /** Documentation: https://esbuild.github.io/api/#source-root */ - sourceRoot?: string - /** Documentation: https://esbuild.github.io/api/#sources-content */ - sourcesContent?: boolean - - /** Documentation: https://esbuild.github.io/api/#format */ - format?: Format - /** Documentation: https://esbuild.github.io/api/#global-name */ - globalName?: string - /** Documentation: https://esbuild.github.io/api/#target */ - target?: string | string[] - /** Documentation: https://esbuild.github.io/api/#supported */ - supported?: Record - /** Documentation: https://esbuild.github.io/api/#platform */ - platform?: Platform - - /** Documentation: https://esbuild.github.io/api/#mangle-props */ - mangleProps?: RegExp - /** Documentation: https://esbuild.github.io/api/#mangle-props */ - reserveProps?: RegExp - /** Documentation: https://esbuild.github.io/api/#mangle-props */ - mangleQuoted?: boolean - /** Documentation: https://esbuild.github.io/api/#mangle-props */ - mangleCache?: Record - /** Documentation: https://esbuild.github.io/api/#drop */ - drop?: Drop[] - /** Documentation: https://esbuild.github.io/api/#drop-labels */ - dropLabels?: string[] - /** Documentation: https://esbuild.github.io/api/#minify */ - minify?: boolean - /** Documentation: https://esbuild.github.io/api/#minify */ - minifyWhitespace?: boolean - /** Documentation: https://esbuild.github.io/api/#minify */ - minifyIdentifiers?: boolean - /** Documentation: https://esbuild.github.io/api/#minify */ - minifySyntax?: boolean - /** Documentation: https://esbuild.github.io/api/#line-limit */ - lineLimit?: number - /** Documentation: https://esbuild.github.io/api/#charset */ - charset?: Charset - /** Documentation: https://esbuild.github.io/api/#tree-shaking */ - treeShaking?: boolean - /** Documentation: https://esbuild.github.io/api/#ignore-annotations */ - ignoreAnnotations?: boolean - - /** Documentation: https://esbuild.github.io/api/#jsx */ - jsx?: 'transform' | 'preserve' | 'automatic' - /** Documentation: https://esbuild.github.io/api/#jsx-factory */ - jsxFactory?: string - /** Documentation: https://esbuild.github.io/api/#jsx-fragment */ - jsxFragment?: string - /** Documentation: https://esbuild.github.io/api/#jsx-import-source */ - jsxImportSource?: string - /** Documentation: https://esbuild.github.io/api/#jsx-development */ - jsxDev?: boolean - /** Documentation: https://esbuild.github.io/api/#jsx-side-effects */ - jsxSideEffects?: boolean - - /** Documentation: https://esbuild.github.io/api/#define */ - define?: { [key: string]: string } - /** Documentation: https://esbuild.github.io/api/#pure */ - pure?: string[] - /** Documentation: https://esbuild.github.io/api/#keep-names */ - keepNames?: boolean - - /** Documentation: https://esbuild.github.io/api/#color */ - color?: boolean - /** Documentation: https://esbuild.github.io/api/#log-level */ - logLevel?: LogLevel - /** Documentation: https://esbuild.github.io/api/#log-limit */ - logLimit?: number - /** Documentation: https://esbuild.github.io/api/#log-override */ - logOverride?: Record - - /** Documentation: https://esbuild.github.io/api/#tsconfig-raw */ - tsconfigRaw?: string | TsconfigRaw -} - -export interface TsconfigRaw { - compilerOptions?: { - alwaysStrict?: boolean - baseUrl?: string - experimentalDecorators?: boolean - importsNotUsedAsValues?: 'remove' | 'preserve' | 'error' - jsx?: 'preserve' | 'react-native' | 'react' | 'react-jsx' | 'react-jsxdev' - jsxFactory?: string - jsxFragmentFactory?: string - jsxImportSource?: string - paths?: Record - preserveValueImports?: boolean - strict?: boolean - target?: string - useDefineForClassFields?: boolean - verbatimModuleSyntax?: boolean - } -} - -export interface BuildOptions extends CommonOptions { - /** Documentation: https://esbuild.github.io/api/#bundle */ - bundle?: boolean - /** Documentation: https://esbuild.github.io/api/#splitting */ - splitting?: boolean - /** Documentation: https://esbuild.github.io/api/#preserve-symlinks */ - preserveSymlinks?: boolean - /** Documentation: https://esbuild.github.io/api/#outfile */ - outfile?: string - /** Documentation: https://esbuild.github.io/api/#metafile */ - metafile?: boolean - /** Documentation: https://esbuild.github.io/api/#outdir */ - outdir?: string - /** Documentation: https://esbuild.github.io/api/#outbase */ - outbase?: string - /** Documentation: https://esbuild.github.io/api/#external */ - external?: string[] - /** Documentation: https://esbuild.github.io/api/#packages */ - packages?: 'external' - /** Documentation: https://esbuild.github.io/api/#alias */ - alias?: Record - /** Documentation: https://esbuild.github.io/api/#loader */ - loader?: { [ext: string]: Loader } - /** Documentation: https://esbuild.github.io/api/#resolve-extensions */ - resolveExtensions?: string[] - /** Documentation: https://esbuild.github.io/api/#main-fields */ - mainFields?: string[] - /** Documentation: https://esbuild.github.io/api/#conditions */ - conditions?: string[] - /** Documentation: https://esbuild.github.io/api/#write */ - write?: boolean - /** Documentation: https://esbuild.github.io/api/#allow-overwrite */ - allowOverwrite?: boolean - /** Documentation: https://esbuild.github.io/api/#tsconfig */ - tsconfig?: string - /** Documentation: https://esbuild.github.io/api/#out-extension */ - outExtension?: { [ext: string]: string } - /** Documentation: https://esbuild.github.io/api/#public-path */ - publicPath?: string - /** Documentation: https://esbuild.github.io/api/#entry-names */ - entryNames?: string - /** Documentation: https://esbuild.github.io/api/#chunk-names */ - chunkNames?: string - /** Documentation: https://esbuild.github.io/api/#asset-names */ - assetNames?: string - /** Documentation: https://esbuild.github.io/api/#inject */ - inject?: string[] - /** Documentation: https://esbuild.github.io/api/#banner */ - banner?: { [type: string]: string } - /** Documentation: https://esbuild.github.io/api/#footer */ - footer?: { [type: string]: string } - /** Documentation: https://esbuild.github.io/api/#entry-points */ - entryPoints?: string[] | Record | { in: string, out: string }[] - /** Documentation: https://esbuild.github.io/api/#stdin */ - stdin?: StdinOptions - /** Documentation: https://esbuild.github.io/plugins/ */ - plugins?: Plugin[] - /** Documentation: https://esbuild.github.io/api/#working-directory */ - absWorkingDir?: string - /** Documentation: https://esbuild.github.io/api/#node-paths */ - nodePaths?: string[]; // The "NODE_PATH" variable from Node.js -} - -export interface StdinOptions { - contents: string | Uint8Array - resolveDir?: string - sourcefile?: string - loader?: Loader -} - -export interface Message { - id: string - pluginName: string - text: string - location: Location | null - notes: Note[] - - /** - * Optional user-specified data that is passed through unmodified. You can - * use this to stash the original error, for example. - */ - detail: any -} - -export interface Note { - text: string - location: Location | null -} - -export interface Location { - file: string - namespace: string - /** 1-based */ - line: number - /** 0-based, in bytes */ - column: number - /** in bytes */ - length: number - lineText: string - suggestion: string -} - -export interface OutputFile { - path: string - contents: Uint8Array - hash: string - /** "contents" as text (changes automatically with "contents") */ - readonly text: string -} - -export interface BuildResult { - errors: Message[] - warnings: Message[] - /** Only when "write: false" */ - outputFiles: OutputFile[] | (ProvidedOptions['write'] extends false ? never : undefined) - /** Only when "metafile: true" */ - metafile: Metafile | (ProvidedOptions['metafile'] extends true ? never : undefined) - /** Only when "mangleCache" is present */ - mangleCache: Record | (ProvidedOptions['mangleCache'] extends Object ? never : undefined) -} - -export interface BuildFailure extends Error { - errors: Message[] - warnings: Message[] -} - -/** Documentation: https://esbuild.github.io/api/#serve-arguments */ -export interface ServeOptions { - port?: number - host?: string - servedir?: string - keyfile?: string - certfile?: string - fallback?: string - onRequest?: (args: ServeOnRequestArgs) => void -} - -export interface ServeOnRequestArgs { - remoteAddress: string - method: string - path: string - status: number - /** The time to generate the response, not to send it */ - timeInMS: number -} - -/** Documentation: https://esbuild.github.io/api/#serve-return-values */ -export interface ServeResult { - port: number - host: string -} - -export interface TransformOptions extends CommonOptions { - /** Documentation: https://esbuild.github.io/api/#sourcefile */ - sourcefile?: string - /** Documentation: https://esbuild.github.io/api/#loader */ - loader?: Loader - /** Documentation: https://esbuild.github.io/api/#banner */ - banner?: string - /** Documentation: https://esbuild.github.io/api/#footer */ - footer?: string -} - -export interface TransformResult { - code: string - map: string - warnings: Message[] - /** Only when "mangleCache" is present */ - mangleCache: Record | (ProvidedOptions['mangleCache'] extends Object ? never : undefined) - /** Only when "legalComments" is "external" */ - legalComments: string | (ProvidedOptions['legalComments'] extends 'external' ? never : undefined) -} - -export interface TransformFailure extends Error { - errors: Message[] - warnings: Message[] -} - -export interface Plugin { - name: string - setup: (build: PluginBuild) => (void | Promise) -} - -export interface PluginBuild { - /** Documentation: https://esbuild.github.io/plugins/#build-options */ - initialOptions: BuildOptions - - /** Documentation: https://esbuild.github.io/plugins/#resolve */ - resolve(path: string, options?: ResolveOptions): Promise - - /** Documentation: https://esbuild.github.io/plugins/#on-start */ - onStart(callback: () => - (OnStartResult | null | void | Promise)): void - - /** Documentation: https://esbuild.github.io/plugins/#on-end */ - onEnd(callback: (result: BuildResult) => - (OnEndResult | null | void | Promise)): void - - /** Documentation: https://esbuild.github.io/plugins/#on-resolve */ - onResolve(options: OnResolveOptions, callback: (args: OnResolveArgs) => - (OnResolveResult | null | undefined | Promise)): void - - /** Documentation: https://esbuild.github.io/plugins/#on-load */ - onLoad(options: OnLoadOptions, callback: (args: OnLoadArgs) => - (OnLoadResult | null | undefined | Promise)): void - - /** Documentation: https://esbuild.github.io/plugins/#on-dispose */ - onDispose(callback: () => void): void - - // This is a full copy of the esbuild library in case you need it - esbuild: { - context: typeof context, - build: typeof build, - buildSync: typeof buildSync, - transform: typeof transform, - transformSync: typeof transformSync, - formatMessages: typeof formatMessages, - formatMessagesSync: typeof formatMessagesSync, - analyzeMetafile: typeof analyzeMetafile, - analyzeMetafileSync: typeof analyzeMetafileSync, - initialize: typeof initialize, - version: typeof version, - } -} - -/** Documentation: https://esbuild.github.io/plugins/#resolve-options */ -export interface ResolveOptions { - pluginName?: string - importer?: string - namespace?: string - resolveDir?: string - kind?: ImportKind - pluginData?: any -} - -/** Documentation: https://esbuild.github.io/plugins/#resolve-results */ -export interface ResolveResult { - errors: Message[] - warnings: Message[] - - path: string - external: boolean - sideEffects: boolean - namespace: string - suffix: string - pluginData: any -} - -export interface OnStartResult { - errors?: PartialMessage[] - warnings?: PartialMessage[] -} - -export interface OnEndResult { - errors?: PartialMessage[] - warnings?: PartialMessage[] -} - -/** Documentation: https://esbuild.github.io/plugins/#on-resolve-options */ -export interface OnResolveOptions { - filter: RegExp - namespace?: string -} - -/** Documentation: https://esbuild.github.io/plugins/#on-resolve-arguments */ -export interface OnResolveArgs { - path: string - importer: string - namespace: string - resolveDir: string - kind: ImportKind - pluginData: any -} - -export type ImportKind = - | 'entry-point' - - // JS - | 'import-statement' - | 'require-call' - | 'dynamic-import' - | 'require-resolve' - - // CSS - | 'import-rule' - | 'composes-from' - | 'url-token' - -/** Documentation: https://esbuild.github.io/plugins/#on-resolve-results */ -export interface OnResolveResult { - pluginName?: string - - errors?: PartialMessage[] - warnings?: PartialMessage[] - - path?: string - external?: boolean - sideEffects?: boolean - namespace?: string - suffix?: string - pluginData?: any - - watchFiles?: string[] - watchDirs?: string[] -} - -/** Documentation: https://esbuild.github.io/plugins/#on-load-options */ -export interface OnLoadOptions { - filter: RegExp - namespace?: string -} - -/** Documentation: https://esbuild.github.io/plugins/#on-load-arguments */ -export interface OnLoadArgs { - path: string - namespace: string - suffix: string - pluginData: any - with: Record -} - -/** Documentation: https://esbuild.github.io/plugins/#on-load-results */ -export interface OnLoadResult { - pluginName?: string - - errors?: PartialMessage[] - warnings?: PartialMessage[] - - contents?: string | Uint8Array - resolveDir?: string - loader?: Loader - pluginData?: any - - watchFiles?: string[] - watchDirs?: string[] -} - -export interface PartialMessage { - id?: string - pluginName?: string - text?: string - location?: Partial | null - notes?: PartialNote[] - detail?: any -} - -export interface PartialNote { - text?: string - location?: Partial | null -} - -/** Documentation: https://esbuild.github.io/api/#metafile */ -export interface Metafile { - inputs: { - [path: string]: { - bytes: number - imports: { - path: string - kind: ImportKind - external?: boolean - original?: string - with?: Record - }[] - format?: 'cjs' | 'esm' - with?: Record - } - } - outputs: { - [path: string]: { - bytes: number - inputs: { - [path: string]: { - bytesInOutput: number - } - } - imports: { - path: string - kind: ImportKind | 'file-loader' - external?: boolean - }[] - exports: string[] - entryPoint?: string - cssBundle?: string - } - } -} - -export interface FormatMessagesOptions { - kind: 'error' | 'warning' - color?: boolean - terminalWidth?: number -} - -export interface AnalyzeMetafileOptions { - color?: boolean - verbose?: boolean -} - -export interface WatchOptions { -} - -export interface BuildContext { - /** Documentation: https://esbuild.github.io/api/#rebuild */ - rebuild(): Promise> - - /** Documentation: https://esbuild.github.io/api/#watch */ - watch(options?: WatchOptions): Promise - - /** Documentation: https://esbuild.github.io/api/#serve */ - serve(options?: ServeOptions): Promise - - cancel(): Promise - dispose(): Promise -} - -// This is a TypeScript type-level function which replaces any keys in "In" -// that aren't in "Out" with "never". We use this to reject properties with -// typos in object literals. See: https://stackoverflow.com/questions/49580725 -type SameShape = In & { [Key in Exclude]: never } - -/** - * This function invokes the "esbuild" command-line tool for you. It returns a - * promise that either resolves with a "BuildResult" object or rejects with a - * "BuildFailure" object. - * - * - Works in node: yes - * - Works in browser: yes - * - * Documentation: https://esbuild.github.io/api/#build - */ -export declare function build(options: SameShape): Promise> - -/** - * This is the advanced long-running form of "build" that supports additional - * features such as watch mode and a local development server. - * - * - Works in node: yes - * - Works in browser: no - * - * Documentation: https://esbuild.github.io/api/#build - */ -export declare function context(options: SameShape): Promise> - -/** - * This function transforms a single JavaScript file. It can be used to minify - * JavaScript, convert TypeScript/JSX to JavaScript, or convert newer JavaScript - * to older JavaScript. It returns a promise that is either resolved with a - * "TransformResult" object or rejected with a "TransformFailure" object. - * - * - Works in node: yes - * - Works in browser: yes - * - * Documentation: https://esbuild.github.io/api/#transform - */ -export declare function transform(input: string | Uint8Array, options?: SameShape): Promise> - -/** - * Converts log messages to formatted message strings suitable for printing in - * the terminal. This allows you to reuse the built-in behavior of esbuild's - * log message formatter. This is a batch-oriented API for efficiency. - * - * - Works in node: yes - * - Works in browser: yes - */ -export declare function formatMessages(messages: PartialMessage[], options: FormatMessagesOptions): Promise - -/** - * Pretty-prints an analysis of the metafile JSON to a string. This is just for - * convenience to be able to match esbuild's pretty-printing exactly. If you want - * to customize it, you can just inspect the data in the metafile yourself. - * - * - Works in node: yes - * - Works in browser: yes - * - * Documentation: https://esbuild.github.io/api/#analyze - */ -export declare function analyzeMetafile(metafile: Metafile | string, options?: AnalyzeMetafileOptions): Promise - -/** - * A synchronous version of "build". - * - * - Works in node: yes - * - Works in browser: no - * - * Documentation: https://esbuild.github.io/api/#build - */ -export declare function buildSync(options: SameShape): BuildResult - -/** - * A synchronous version of "transform". - * - * - Works in node: yes - * - Works in browser: no - * - * Documentation: https://esbuild.github.io/api/#transform - */ -export declare function transformSync(input: string | Uint8Array, options?: SameShape): TransformResult - -/** - * A synchronous version of "formatMessages". - * - * - Works in node: yes - * - Works in browser: no - */ -export declare function formatMessagesSync(messages: PartialMessage[], options: FormatMessagesOptions): string[] - -/** - * A synchronous version of "analyzeMetafile". - * - * - Works in node: yes - * - Works in browser: no - * - * Documentation: https://esbuild.github.io/api/#analyze - */ -export declare function analyzeMetafileSync(metafile: Metafile | string, options?: AnalyzeMetafileOptions): string - -/** - * This configures the browser-based version of esbuild. It is necessary to - * call this first and wait for the returned promise to be resolved before - * making other API calls when using esbuild in the browser. - * - * - Works in node: yes - * - Works in browser: yes ("options" is required) - * - * Documentation: https://esbuild.github.io/api/#browser - */ -export declare function initialize(options: InitializeOptions): Promise - -export interface InitializeOptions { - /** - * The URL of the "esbuild.wasm" file. This must be provided when running - * esbuild in the browser. - */ - wasmURL?: string | URL - - /** - * The result of calling "new WebAssembly.Module(buffer)" where "buffer" - * is a typed array or ArrayBuffer containing the binary code of the - * "esbuild.wasm" file. - * - * You can use this as an alternative to "wasmURL" for environments where it's - * not possible to download the WebAssembly module. - */ - wasmModule?: WebAssembly.Module - - /** - * By default esbuild runs the WebAssembly-based browser API in a web worker - * to avoid blocking the UI thread. This can be disabled by setting "worker" - * to false. - */ - worker?: boolean -} - -export let version: string - -// Call this function to terminate esbuild's child process. The child process -// is not terminated and re-created after each API call because it's more -// efficient to keep it around when there are multiple API calls. -// -// In node this happens automatically before the parent node process exits. So -// you only need to call this if you know you will not make any more esbuild -// API calls and you want to clean up resources. -// -// Unlike node, Deno lacks the necessary APIs to clean up child processes -// automatically. You must manually call stop() in Deno when you're done -// using esbuild or Deno will continue running forever. -// -// Another reason you might want to call this is if you are using esbuild from -// within a Deno test. Deno fails tests that create a child process without -// killing it before the test ends, so you have to call this function (and -// await the returned promise) in every Deno test that uses esbuild. -export declare function stop(): Promise - -// Note: These declarations exist to avoid type errors when you omit "dom" from -// "lib" in your "tsconfig.json" file. TypeScript confusingly declares the -// global "WebAssembly" type in "lib.dom.d.ts" even though it has nothing to do -// with the browser DOM and is present in many non-browser JavaScript runtimes -// (e.g. node and deno). Declaring it here allows esbuild's API to be used in -// these scenarios. -// -// There's an open issue about getting this problem corrected (although these -// declarations will need to remain even if this is fixed for backward -// compatibility with older TypeScript versions): -// -// https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/826 -// -declare global { - namespace WebAssembly { - interface Module { - } - } - interface URL { - } -} diff --git a/node_modules/esbuild/lib/main.js b/node_modules/esbuild/lib/main.js deleted file mode 100644 index e30c4b7..0000000 --- a/node_modules/esbuild/lib/main.js +++ /dev/null @@ -1,2227 +0,0 @@ -"use strict"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// lib/npm/node.ts -var node_exports = {}; -__export(node_exports, { - analyzeMetafile: () => analyzeMetafile, - analyzeMetafileSync: () => analyzeMetafileSync, - build: () => build, - buildSync: () => buildSync, - context: () => context, - default: () => node_default, - formatMessages: () => formatMessages, - formatMessagesSync: () => formatMessagesSync, - initialize: () => initialize, - stop: () => stop, - transform: () => transform, - transformSync: () => transformSync, - version: () => version -}); -module.exports = __toCommonJS(node_exports); - -// lib/shared/stdio_protocol.ts -function encodePacket(packet) { - let visit = (value) => { - if (value === null) { - bb.write8(0); - } else if (typeof value === "boolean") { - bb.write8(1); - bb.write8(+value); - } else if (typeof value === "number") { - bb.write8(2); - bb.write32(value | 0); - } else if (typeof value === "string") { - bb.write8(3); - bb.write(encodeUTF8(value)); - } else if (value instanceof Uint8Array) { - bb.write8(4); - bb.write(value); - } else if (value instanceof Array) { - bb.write8(5); - bb.write32(value.length); - for (let item of value) { - visit(item); - } - } else { - let keys = Object.keys(value); - bb.write8(6); - bb.write32(keys.length); - for (let key of keys) { - bb.write(encodeUTF8(key)); - visit(value[key]); - } - } - }; - let bb = new ByteBuffer(); - bb.write32(0); - bb.write32(packet.id << 1 | +!packet.isRequest); - visit(packet.value); - writeUInt32LE(bb.buf, bb.len - 4, 0); - return bb.buf.subarray(0, bb.len); -} -function decodePacket(bytes) { - let visit = () => { - switch (bb.read8()) { - case 0: - return null; - case 1: - return !!bb.read8(); - case 2: - return bb.read32(); - case 3: - return decodeUTF8(bb.read()); - case 4: - return bb.read(); - case 5: { - let count = bb.read32(); - let value2 = []; - for (let i = 0; i < count; i++) { - value2.push(visit()); - } - return value2; - } - case 6: { - let count = bb.read32(); - let value2 = {}; - for (let i = 0; i < count; i++) { - value2[decodeUTF8(bb.read())] = visit(); - } - return value2; - } - default: - throw new Error("Invalid packet"); - } - }; - let bb = new ByteBuffer(bytes); - let id = bb.read32(); - let isRequest = (id & 1) === 0; - id >>>= 1; - let value = visit(); - if (bb.ptr !== bytes.length) { - throw new Error("Invalid packet"); - } - return { id, isRequest, value }; -} -var ByteBuffer = class { - constructor(buf = new Uint8Array(1024)) { - this.buf = buf; - this.len = 0; - this.ptr = 0; - } - _write(delta) { - if (this.len + delta > this.buf.length) { - let clone = new Uint8Array((this.len + delta) * 2); - clone.set(this.buf); - this.buf = clone; - } - this.len += delta; - return this.len - delta; - } - write8(value) { - let offset = this._write(1); - this.buf[offset] = value; - } - write32(value) { - let offset = this._write(4); - writeUInt32LE(this.buf, value, offset); - } - write(bytes) { - let offset = this._write(4 + bytes.length); - writeUInt32LE(this.buf, bytes.length, offset); - this.buf.set(bytes, offset + 4); - } - _read(delta) { - if (this.ptr + delta > this.buf.length) { - throw new Error("Invalid packet"); - } - this.ptr += delta; - return this.ptr - delta; - } - read8() { - return this.buf[this._read(1)]; - } - read32() { - return readUInt32LE(this.buf, this._read(4)); - } - read() { - let length = this.read32(); - let bytes = new Uint8Array(length); - let ptr = this._read(bytes.length); - bytes.set(this.buf.subarray(ptr, ptr + length)); - return bytes; - } -}; -var encodeUTF8; -var decodeUTF8; -var encodeInvariant; -if (typeof TextEncoder !== "undefined" && typeof TextDecoder !== "undefined") { - let encoder = new TextEncoder(); - let decoder = new TextDecoder(); - encodeUTF8 = (text) => encoder.encode(text); - decodeUTF8 = (bytes) => decoder.decode(bytes); - encodeInvariant = 'new TextEncoder().encode("")'; -} else if (typeof Buffer !== "undefined") { - encodeUTF8 = (text) => Buffer.from(text); - decodeUTF8 = (bytes) => { - let { buffer, byteOffset, byteLength } = bytes; - return Buffer.from(buffer, byteOffset, byteLength).toString(); - }; - encodeInvariant = 'Buffer.from("")'; -} else { - throw new Error("No UTF-8 codec found"); -} -if (!(encodeUTF8("") instanceof Uint8Array)) - throw new Error(`Invariant violation: "${encodeInvariant} instanceof Uint8Array" is incorrectly false - -This indicates that your JavaScript environment is broken. You cannot use -esbuild in this environment because esbuild relies on this invariant. This -is not a problem with esbuild. You need to fix your environment instead. -`); -function readUInt32LE(buffer, offset) { - return buffer[offset++] | buffer[offset++] << 8 | buffer[offset++] << 16 | buffer[offset++] << 24; -} -function writeUInt32LE(buffer, value, offset) { - buffer[offset++] = value; - buffer[offset++] = value >> 8; - buffer[offset++] = value >> 16; - buffer[offset++] = value >> 24; -} - -// lib/shared/common.ts -var quote = JSON.stringify; -var buildLogLevelDefault = "warning"; -var transformLogLevelDefault = "silent"; -function validateTarget(target) { - validateStringValue(target, "target"); - if (target.indexOf(",") >= 0) throw new Error(`Invalid target: ${target}`); - return target; -} -var canBeAnything = () => null; -var mustBeBoolean = (value) => typeof value === "boolean" ? null : "a boolean"; -var mustBeString = (value) => typeof value === "string" ? null : "a string"; -var mustBeRegExp = (value) => value instanceof RegExp ? null : "a RegExp object"; -var mustBeInteger = (value) => typeof value === "number" && value === (value | 0) ? null : "an integer"; -var mustBeFunction = (value) => typeof value === "function" ? null : "a function"; -var mustBeArray = (value) => Array.isArray(value) ? null : "an array"; -var mustBeObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value) ? null : "an object"; -var mustBeEntryPoints = (value) => typeof value === "object" && value !== null ? null : "an array or an object"; -var mustBeWebAssemblyModule = (value) => value instanceof WebAssembly.Module ? null : "a WebAssembly.Module"; -var mustBeObjectOrNull = (value) => typeof value === "object" && !Array.isArray(value) ? null : "an object or null"; -var mustBeStringOrBoolean = (value) => typeof value === "string" || typeof value === "boolean" ? null : "a string or a boolean"; -var mustBeStringOrObject = (value) => typeof value === "string" || typeof value === "object" && value !== null && !Array.isArray(value) ? null : "a string or an object"; -var mustBeStringOrArray = (value) => typeof value === "string" || Array.isArray(value) ? null : "a string or an array"; -var mustBeStringOrUint8Array = (value) => typeof value === "string" || value instanceof Uint8Array ? null : "a string or a Uint8Array"; -var mustBeStringOrURL = (value) => typeof value === "string" || value instanceof URL ? null : "a string or a URL"; -function getFlag(object, keys, key, mustBeFn) { - let value = object[key]; - keys[key + ""] = true; - if (value === void 0) return void 0; - let mustBe = mustBeFn(value); - if (mustBe !== null) throw new Error(`${quote(key)} must be ${mustBe}`); - return value; -} -function checkForInvalidFlags(object, keys, where) { - for (let key in object) { - if (!(key in keys)) { - throw new Error(`Invalid option ${where}: ${quote(key)}`); - } - } -} -function validateInitializeOptions(options) { - let keys = /* @__PURE__ */ Object.create(null); - let wasmURL = getFlag(options, keys, "wasmURL", mustBeStringOrURL); - let wasmModule = getFlag(options, keys, "wasmModule", mustBeWebAssemblyModule); - let worker = getFlag(options, keys, "worker", mustBeBoolean); - checkForInvalidFlags(options, keys, "in initialize() call"); - return { - wasmURL, - wasmModule, - worker - }; -} -function validateMangleCache(mangleCache) { - let validated; - if (mangleCache !== void 0) { - validated = /* @__PURE__ */ Object.create(null); - for (let key in mangleCache) { - let value = mangleCache[key]; - if (typeof value === "string" || value === false) { - validated[key] = value; - } else { - throw new Error(`Expected ${quote(key)} in mangle cache to map to either a string or false`); - } - } - } - return validated; -} -function pushLogFlags(flags, options, keys, isTTY2, logLevelDefault) { - let color = getFlag(options, keys, "color", mustBeBoolean); - let logLevel = getFlag(options, keys, "logLevel", mustBeString); - let logLimit = getFlag(options, keys, "logLimit", mustBeInteger); - if (color !== void 0) flags.push(`--color=${color}`); - else if (isTTY2) flags.push(`--color=true`); - flags.push(`--log-level=${logLevel || logLevelDefault}`); - flags.push(`--log-limit=${logLimit || 0}`); -} -function validateStringValue(value, what, key) { - if (typeof value !== "string") { - throw new Error(`Expected value for ${what}${key !== void 0 ? " " + quote(key) : ""} to be a string, got ${typeof value} instead`); - } - return value; -} -function pushCommonFlags(flags, options, keys) { - let legalComments = getFlag(options, keys, "legalComments", mustBeString); - let sourceRoot = getFlag(options, keys, "sourceRoot", mustBeString); - let sourcesContent = getFlag(options, keys, "sourcesContent", mustBeBoolean); - let target = getFlag(options, keys, "target", mustBeStringOrArray); - let format = getFlag(options, keys, "format", mustBeString); - let globalName = getFlag(options, keys, "globalName", mustBeString); - let mangleProps = getFlag(options, keys, "mangleProps", mustBeRegExp); - let reserveProps = getFlag(options, keys, "reserveProps", mustBeRegExp); - let mangleQuoted = getFlag(options, keys, "mangleQuoted", mustBeBoolean); - let minify = getFlag(options, keys, "minify", mustBeBoolean); - let minifySyntax = getFlag(options, keys, "minifySyntax", mustBeBoolean); - let minifyWhitespace = getFlag(options, keys, "minifyWhitespace", mustBeBoolean); - let minifyIdentifiers = getFlag(options, keys, "minifyIdentifiers", mustBeBoolean); - let lineLimit = getFlag(options, keys, "lineLimit", mustBeInteger); - let drop = getFlag(options, keys, "drop", mustBeArray); - let dropLabels = getFlag(options, keys, "dropLabels", mustBeArray); - let charset = getFlag(options, keys, "charset", mustBeString); - let treeShaking = getFlag(options, keys, "treeShaking", mustBeBoolean); - let ignoreAnnotations = getFlag(options, keys, "ignoreAnnotations", mustBeBoolean); - let jsx = getFlag(options, keys, "jsx", mustBeString); - let jsxFactory = getFlag(options, keys, "jsxFactory", mustBeString); - let jsxFragment = getFlag(options, keys, "jsxFragment", mustBeString); - let jsxImportSource = getFlag(options, keys, "jsxImportSource", mustBeString); - let jsxDev = getFlag(options, keys, "jsxDev", mustBeBoolean); - let jsxSideEffects = getFlag(options, keys, "jsxSideEffects", mustBeBoolean); - let define = getFlag(options, keys, "define", mustBeObject); - let logOverride = getFlag(options, keys, "logOverride", mustBeObject); - let supported = getFlag(options, keys, "supported", mustBeObject); - let pure = getFlag(options, keys, "pure", mustBeArray); - let keepNames = getFlag(options, keys, "keepNames", mustBeBoolean); - let platform = getFlag(options, keys, "platform", mustBeString); - let tsconfigRaw = getFlag(options, keys, "tsconfigRaw", mustBeStringOrObject); - if (legalComments) flags.push(`--legal-comments=${legalComments}`); - if (sourceRoot !== void 0) flags.push(`--source-root=${sourceRoot}`); - if (sourcesContent !== void 0) flags.push(`--sources-content=${sourcesContent}`); - if (target) { - if (Array.isArray(target)) flags.push(`--target=${Array.from(target).map(validateTarget).join(",")}`); - else flags.push(`--target=${validateTarget(target)}`); - } - if (format) flags.push(`--format=${format}`); - if (globalName) flags.push(`--global-name=${globalName}`); - if (platform) flags.push(`--platform=${platform}`); - if (tsconfigRaw) flags.push(`--tsconfig-raw=${typeof tsconfigRaw === "string" ? tsconfigRaw : JSON.stringify(tsconfigRaw)}`); - if (minify) flags.push("--minify"); - if (minifySyntax) flags.push("--minify-syntax"); - if (minifyWhitespace) flags.push("--minify-whitespace"); - if (minifyIdentifiers) flags.push("--minify-identifiers"); - if (lineLimit) flags.push(`--line-limit=${lineLimit}`); - if (charset) flags.push(`--charset=${charset}`); - if (treeShaking !== void 0) flags.push(`--tree-shaking=${treeShaking}`); - if (ignoreAnnotations) flags.push(`--ignore-annotations`); - if (drop) for (let what of drop) flags.push(`--drop:${validateStringValue(what, "drop")}`); - if (dropLabels) flags.push(`--drop-labels=${Array.from(dropLabels).map((what) => validateStringValue(what, "dropLabels")).join(",")}`); - if (mangleProps) flags.push(`--mangle-props=${mangleProps.source}`); - if (reserveProps) flags.push(`--reserve-props=${reserveProps.source}`); - if (mangleQuoted !== void 0) flags.push(`--mangle-quoted=${mangleQuoted}`); - if (jsx) flags.push(`--jsx=${jsx}`); - if (jsxFactory) flags.push(`--jsx-factory=${jsxFactory}`); - if (jsxFragment) flags.push(`--jsx-fragment=${jsxFragment}`); - if (jsxImportSource) flags.push(`--jsx-import-source=${jsxImportSource}`); - if (jsxDev) flags.push(`--jsx-dev`); - if (jsxSideEffects) flags.push(`--jsx-side-effects`); - if (define) { - for (let key in define) { - if (key.indexOf("=") >= 0) throw new Error(`Invalid define: ${key}`); - flags.push(`--define:${key}=${validateStringValue(define[key], "define", key)}`); - } - } - if (logOverride) { - for (let key in logOverride) { - if (key.indexOf("=") >= 0) throw new Error(`Invalid log override: ${key}`); - flags.push(`--log-override:${key}=${validateStringValue(logOverride[key], "log override", key)}`); - } - } - if (supported) { - for (let key in supported) { - if (key.indexOf("=") >= 0) throw new Error(`Invalid supported: ${key}`); - const value = supported[key]; - if (typeof value !== "boolean") throw new Error(`Expected value for supported ${quote(key)} to be a boolean, got ${typeof value} instead`); - flags.push(`--supported:${key}=${value}`); - } - } - if (pure) for (let fn of pure) flags.push(`--pure:${validateStringValue(fn, "pure")}`); - if (keepNames) flags.push(`--keep-names`); -} -function flagsForBuildOptions(callName, options, isTTY2, logLevelDefault, writeDefault) { - var _a2; - let flags = []; - let entries = []; - let keys = /* @__PURE__ */ Object.create(null); - let stdinContents = null; - let stdinResolveDir = null; - pushLogFlags(flags, options, keys, isTTY2, logLevelDefault); - pushCommonFlags(flags, options, keys); - let sourcemap = getFlag(options, keys, "sourcemap", mustBeStringOrBoolean); - let bundle = getFlag(options, keys, "bundle", mustBeBoolean); - let splitting = getFlag(options, keys, "splitting", mustBeBoolean); - let preserveSymlinks = getFlag(options, keys, "preserveSymlinks", mustBeBoolean); - let metafile = getFlag(options, keys, "metafile", mustBeBoolean); - let outfile = getFlag(options, keys, "outfile", mustBeString); - let outdir = getFlag(options, keys, "outdir", mustBeString); - let outbase = getFlag(options, keys, "outbase", mustBeString); - let tsconfig = getFlag(options, keys, "tsconfig", mustBeString); - let resolveExtensions = getFlag(options, keys, "resolveExtensions", mustBeArray); - let nodePathsInput = getFlag(options, keys, "nodePaths", mustBeArray); - let mainFields = getFlag(options, keys, "mainFields", mustBeArray); - let conditions = getFlag(options, keys, "conditions", mustBeArray); - let external = getFlag(options, keys, "external", mustBeArray); - let packages = getFlag(options, keys, "packages", mustBeString); - let alias = getFlag(options, keys, "alias", mustBeObject); - let loader = getFlag(options, keys, "loader", mustBeObject); - let outExtension = getFlag(options, keys, "outExtension", mustBeObject); - let publicPath = getFlag(options, keys, "publicPath", mustBeString); - let entryNames = getFlag(options, keys, "entryNames", mustBeString); - let chunkNames = getFlag(options, keys, "chunkNames", mustBeString); - let assetNames = getFlag(options, keys, "assetNames", mustBeString); - let inject = getFlag(options, keys, "inject", mustBeArray); - let banner = getFlag(options, keys, "banner", mustBeObject); - let footer = getFlag(options, keys, "footer", mustBeObject); - let entryPoints = getFlag(options, keys, "entryPoints", mustBeEntryPoints); - let absWorkingDir = getFlag(options, keys, "absWorkingDir", mustBeString); - let stdin = getFlag(options, keys, "stdin", mustBeObject); - let write = (_a2 = getFlag(options, keys, "write", mustBeBoolean)) != null ? _a2 : writeDefault; - let allowOverwrite = getFlag(options, keys, "allowOverwrite", mustBeBoolean); - let mangleCache = getFlag(options, keys, "mangleCache", mustBeObject); - keys.plugins = true; - checkForInvalidFlags(options, keys, `in ${callName}() call`); - if (sourcemap) flags.push(`--sourcemap${sourcemap === true ? "" : `=${sourcemap}`}`); - if (bundle) flags.push("--bundle"); - if (allowOverwrite) flags.push("--allow-overwrite"); - if (splitting) flags.push("--splitting"); - if (preserveSymlinks) flags.push("--preserve-symlinks"); - if (metafile) flags.push(`--metafile`); - if (outfile) flags.push(`--outfile=${outfile}`); - if (outdir) flags.push(`--outdir=${outdir}`); - if (outbase) flags.push(`--outbase=${outbase}`); - if (tsconfig) flags.push(`--tsconfig=${tsconfig}`); - if (packages) flags.push(`--packages=${packages}`); - if (resolveExtensions) { - let values = []; - for (let value of resolveExtensions) { - validateStringValue(value, "resolve extension"); - if (value.indexOf(",") >= 0) throw new Error(`Invalid resolve extension: ${value}`); - values.push(value); - } - flags.push(`--resolve-extensions=${values.join(",")}`); - } - if (publicPath) flags.push(`--public-path=${publicPath}`); - if (entryNames) flags.push(`--entry-names=${entryNames}`); - if (chunkNames) flags.push(`--chunk-names=${chunkNames}`); - if (assetNames) flags.push(`--asset-names=${assetNames}`); - if (mainFields) { - let values = []; - for (let value of mainFields) { - validateStringValue(value, "main field"); - if (value.indexOf(",") >= 0) throw new Error(`Invalid main field: ${value}`); - values.push(value); - } - flags.push(`--main-fields=${values.join(",")}`); - } - if (conditions) { - let values = []; - for (let value of conditions) { - validateStringValue(value, "condition"); - if (value.indexOf(",") >= 0) throw new Error(`Invalid condition: ${value}`); - values.push(value); - } - flags.push(`--conditions=${values.join(",")}`); - } - if (external) for (let name of external) flags.push(`--external:${validateStringValue(name, "external")}`); - if (alias) { - for (let old in alias) { - if (old.indexOf("=") >= 0) throw new Error(`Invalid package name in alias: ${old}`); - flags.push(`--alias:${old}=${validateStringValue(alias[old], "alias", old)}`); - } - } - if (banner) { - for (let type in banner) { - if (type.indexOf("=") >= 0) throw new Error(`Invalid banner file type: ${type}`); - flags.push(`--banner:${type}=${validateStringValue(banner[type], "banner", type)}`); - } - } - if (footer) { - for (let type in footer) { - if (type.indexOf("=") >= 0) throw new Error(`Invalid footer file type: ${type}`); - flags.push(`--footer:${type}=${validateStringValue(footer[type], "footer", type)}`); - } - } - if (inject) for (let path3 of inject) flags.push(`--inject:${validateStringValue(path3, "inject")}`); - if (loader) { - for (let ext in loader) { - if (ext.indexOf("=") >= 0) throw new Error(`Invalid loader extension: ${ext}`); - flags.push(`--loader:${ext}=${validateStringValue(loader[ext], "loader", ext)}`); - } - } - if (outExtension) { - for (let ext in outExtension) { - if (ext.indexOf("=") >= 0) throw new Error(`Invalid out extension: ${ext}`); - flags.push(`--out-extension:${ext}=${validateStringValue(outExtension[ext], "out extension", ext)}`); - } - } - if (entryPoints) { - if (Array.isArray(entryPoints)) { - for (let i = 0, n = entryPoints.length; i < n; i++) { - let entryPoint = entryPoints[i]; - if (typeof entryPoint === "object" && entryPoint !== null) { - let entryPointKeys = /* @__PURE__ */ Object.create(null); - let input = getFlag(entryPoint, entryPointKeys, "in", mustBeString); - let output = getFlag(entryPoint, entryPointKeys, "out", mustBeString); - checkForInvalidFlags(entryPoint, entryPointKeys, "in entry point at index " + i); - if (input === void 0) throw new Error('Missing property "in" for entry point at index ' + i); - if (output === void 0) throw new Error('Missing property "out" for entry point at index ' + i); - entries.push([output, input]); - } else { - entries.push(["", validateStringValue(entryPoint, "entry point at index " + i)]); - } - } - } else { - for (let key in entryPoints) { - entries.push([key, validateStringValue(entryPoints[key], "entry point", key)]); - } - } - } - if (stdin) { - let stdinKeys = /* @__PURE__ */ Object.create(null); - let contents = getFlag(stdin, stdinKeys, "contents", mustBeStringOrUint8Array); - let resolveDir = getFlag(stdin, stdinKeys, "resolveDir", mustBeString); - let sourcefile = getFlag(stdin, stdinKeys, "sourcefile", mustBeString); - let loader2 = getFlag(stdin, stdinKeys, "loader", mustBeString); - checkForInvalidFlags(stdin, stdinKeys, 'in "stdin" object'); - if (sourcefile) flags.push(`--sourcefile=${sourcefile}`); - if (loader2) flags.push(`--loader=${loader2}`); - if (resolveDir) stdinResolveDir = resolveDir; - if (typeof contents === "string") stdinContents = encodeUTF8(contents); - else if (contents instanceof Uint8Array) stdinContents = contents; - } - let nodePaths = []; - if (nodePathsInput) { - for (let value of nodePathsInput) { - value += ""; - nodePaths.push(value); - } - } - return { - entries, - flags, - write, - stdinContents, - stdinResolveDir, - absWorkingDir, - nodePaths, - mangleCache: validateMangleCache(mangleCache) - }; -} -function flagsForTransformOptions(callName, options, isTTY2, logLevelDefault) { - let flags = []; - let keys = /* @__PURE__ */ Object.create(null); - pushLogFlags(flags, options, keys, isTTY2, logLevelDefault); - pushCommonFlags(flags, options, keys); - let sourcemap = getFlag(options, keys, "sourcemap", mustBeStringOrBoolean); - let sourcefile = getFlag(options, keys, "sourcefile", mustBeString); - let loader = getFlag(options, keys, "loader", mustBeString); - let banner = getFlag(options, keys, "banner", mustBeString); - let footer = getFlag(options, keys, "footer", mustBeString); - let mangleCache = getFlag(options, keys, "mangleCache", mustBeObject); - checkForInvalidFlags(options, keys, `in ${callName}() call`); - if (sourcemap) flags.push(`--sourcemap=${sourcemap === true ? "external" : sourcemap}`); - if (sourcefile) flags.push(`--sourcefile=${sourcefile}`); - if (loader) flags.push(`--loader=${loader}`); - if (banner) flags.push(`--banner=${banner}`); - if (footer) flags.push(`--footer=${footer}`); - return { - flags, - mangleCache: validateMangleCache(mangleCache) - }; -} -function createChannel(streamIn) { - const requestCallbacksByKey = {}; - const closeData = { didClose: false, reason: "" }; - let responseCallbacks = {}; - let nextRequestID = 0; - let nextBuildKey = 0; - let stdout = new Uint8Array(16 * 1024); - let stdoutUsed = 0; - let readFromStdout = (chunk) => { - let limit = stdoutUsed + chunk.length; - if (limit > stdout.length) { - let swap = new Uint8Array(limit * 2); - swap.set(stdout); - stdout = swap; - } - stdout.set(chunk, stdoutUsed); - stdoutUsed += chunk.length; - let offset = 0; - while (offset + 4 <= stdoutUsed) { - let length = readUInt32LE(stdout, offset); - if (offset + 4 + length > stdoutUsed) { - break; - } - offset += 4; - handleIncomingPacket(stdout.subarray(offset, offset + length)); - offset += length; - } - if (offset > 0) { - stdout.copyWithin(0, offset, stdoutUsed); - stdoutUsed -= offset; - } - }; - let afterClose = (error) => { - closeData.didClose = true; - if (error) closeData.reason = ": " + (error.message || error); - const text = "The service was stopped" + closeData.reason; - for (let id in responseCallbacks) { - responseCallbacks[id](text, null); - } - responseCallbacks = {}; - }; - let sendRequest = (refs, value, callback) => { - if (closeData.didClose) return callback("The service is no longer running" + closeData.reason, null); - let id = nextRequestID++; - responseCallbacks[id] = (error, response) => { - try { - callback(error, response); - } finally { - if (refs) refs.unref(); - } - }; - if (refs) refs.ref(); - streamIn.writeToStdin(encodePacket({ id, isRequest: true, value })); - }; - let sendResponse = (id, value) => { - if (closeData.didClose) throw new Error("The service is no longer running" + closeData.reason); - streamIn.writeToStdin(encodePacket({ id, isRequest: false, value })); - }; - let handleRequest = async (id, request) => { - try { - if (request.command === "ping") { - sendResponse(id, {}); - return; - } - if (typeof request.key === "number") { - const requestCallbacks = requestCallbacksByKey[request.key]; - if (!requestCallbacks) { - return; - } - const callback = requestCallbacks[request.command]; - if (callback) { - await callback(id, request); - return; - } - } - throw new Error(`Invalid command: ` + request.command); - } catch (e) { - const errors = [extractErrorMessageV8(e, streamIn, null, void 0, "")]; - try { - sendResponse(id, { errors }); - } catch { - } - } - }; - let isFirstPacket = true; - let handleIncomingPacket = (bytes) => { - if (isFirstPacket) { - isFirstPacket = false; - let binaryVersion = String.fromCharCode(...bytes); - if (binaryVersion !== "0.21.3") { - throw new Error(`Cannot start service: Host version "${"0.21.3"}" does not match binary version ${quote(binaryVersion)}`); - } - return; - } - let packet = decodePacket(bytes); - if (packet.isRequest) { - handleRequest(packet.id, packet.value); - } else { - let callback = responseCallbacks[packet.id]; - delete responseCallbacks[packet.id]; - if (packet.value.error) callback(packet.value.error, {}); - else callback(null, packet.value); - } - }; - let buildOrContext = ({ callName, refs, options, isTTY: isTTY2, defaultWD: defaultWD2, callback }) => { - let refCount = 0; - const buildKey = nextBuildKey++; - const requestCallbacks = {}; - const buildRefs = { - ref() { - if (++refCount === 1) { - if (refs) refs.ref(); - } - }, - unref() { - if (--refCount === 0) { - delete requestCallbacksByKey[buildKey]; - if (refs) refs.unref(); - } - } - }; - requestCallbacksByKey[buildKey] = requestCallbacks; - buildRefs.ref(); - buildOrContextImpl( - callName, - buildKey, - sendRequest, - sendResponse, - buildRefs, - streamIn, - requestCallbacks, - options, - isTTY2, - defaultWD2, - (err, res) => { - try { - callback(err, res); - } finally { - buildRefs.unref(); - } - } - ); - }; - let transform2 = ({ callName, refs, input, options, isTTY: isTTY2, fs: fs3, callback }) => { - const details = createObjectStash(); - let start = (inputPath) => { - try { - if (typeof input !== "string" && !(input instanceof Uint8Array)) - throw new Error('The input to "transform" must be a string or a Uint8Array'); - let { - flags, - mangleCache - } = flagsForTransformOptions(callName, options, isTTY2, transformLogLevelDefault); - let request = { - command: "transform", - flags, - inputFS: inputPath !== null, - input: inputPath !== null ? encodeUTF8(inputPath) : typeof input === "string" ? encodeUTF8(input) : input - }; - if (mangleCache) request.mangleCache = mangleCache; - sendRequest(refs, request, (error, response) => { - if (error) return callback(new Error(error), null); - let errors = replaceDetailsInMessages(response.errors, details); - let warnings = replaceDetailsInMessages(response.warnings, details); - let outstanding = 1; - let next = () => { - if (--outstanding === 0) { - let result = { - warnings, - code: response.code, - map: response.map, - mangleCache: void 0, - legalComments: void 0 - }; - if ("legalComments" in response) result.legalComments = response == null ? void 0 : response.legalComments; - if (response.mangleCache) result.mangleCache = response == null ? void 0 : response.mangleCache; - callback(null, result); - } - }; - if (errors.length > 0) return callback(failureErrorWithLog("Transform failed", errors, warnings), null); - if (response.codeFS) { - outstanding++; - fs3.readFile(response.code, (err, contents) => { - if (err !== null) { - callback(err, null); - } else { - response.code = contents; - next(); - } - }); - } - if (response.mapFS) { - outstanding++; - fs3.readFile(response.map, (err, contents) => { - if (err !== null) { - callback(err, null); - } else { - response.map = contents; - next(); - } - }); - } - next(); - }); - } catch (e) { - let flags = []; - try { - pushLogFlags(flags, options, {}, isTTY2, transformLogLevelDefault); - } catch { - } - const error = extractErrorMessageV8(e, streamIn, details, void 0, ""); - sendRequest(refs, { command: "error", flags, error }, () => { - error.detail = details.load(error.detail); - callback(failureErrorWithLog("Transform failed", [error], []), null); - }); - } - }; - if ((typeof input === "string" || input instanceof Uint8Array) && input.length > 1024 * 1024) { - let next = start; - start = () => fs3.writeFile(input, next); - } - start(null); - }; - let formatMessages2 = ({ callName, refs, messages, options, callback }) => { - if (!options) throw new Error(`Missing second argument in ${callName}() call`); - let keys = {}; - let kind = getFlag(options, keys, "kind", mustBeString); - let color = getFlag(options, keys, "color", mustBeBoolean); - let terminalWidth = getFlag(options, keys, "terminalWidth", mustBeInteger); - checkForInvalidFlags(options, keys, `in ${callName}() call`); - if (kind === void 0) throw new Error(`Missing "kind" in ${callName}() call`); - if (kind !== "error" && kind !== "warning") throw new Error(`Expected "kind" to be "error" or "warning" in ${callName}() call`); - let request = { - command: "format-msgs", - messages: sanitizeMessages(messages, "messages", null, "", terminalWidth), - isWarning: kind === "warning" - }; - if (color !== void 0) request.color = color; - if (terminalWidth !== void 0) request.terminalWidth = terminalWidth; - sendRequest(refs, request, (error, response) => { - if (error) return callback(new Error(error), null); - callback(null, response.messages); - }); - }; - let analyzeMetafile2 = ({ callName, refs, metafile, options, callback }) => { - if (options === void 0) options = {}; - let keys = {}; - let color = getFlag(options, keys, "color", mustBeBoolean); - let verbose = getFlag(options, keys, "verbose", mustBeBoolean); - checkForInvalidFlags(options, keys, `in ${callName}() call`); - let request = { - command: "analyze-metafile", - metafile - }; - if (color !== void 0) request.color = color; - if (verbose !== void 0) request.verbose = verbose; - sendRequest(refs, request, (error, response) => { - if (error) return callback(new Error(error), null); - callback(null, response.result); - }); - }; - return { - readFromStdout, - afterClose, - service: { - buildOrContext, - transform: transform2, - formatMessages: formatMessages2, - analyzeMetafile: analyzeMetafile2 - } - }; -} -function buildOrContextImpl(callName, buildKey, sendRequest, sendResponse, refs, streamIn, requestCallbacks, options, isTTY2, defaultWD2, callback) { - const details = createObjectStash(); - const isContext = callName === "context"; - const handleError = (e, pluginName) => { - const flags = []; - try { - pushLogFlags(flags, options, {}, isTTY2, buildLogLevelDefault); - } catch { - } - const message = extractErrorMessageV8(e, streamIn, details, void 0, pluginName); - sendRequest(refs, { command: "error", flags, error: message }, () => { - message.detail = details.load(message.detail); - callback(failureErrorWithLog(isContext ? "Context failed" : "Build failed", [message], []), null); - }); - }; - let plugins; - if (typeof options === "object") { - const value = options.plugins; - if (value !== void 0) { - if (!Array.isArray(value)) return handleError(new Error(`"plugins" must be an array`), ""); - plugins = value; - } - } - if (plugins && plugins.length > 0) { - if (streamIn.isSync) return handleError(new Error("Cannot use plugins in synchronous API calls"), ""); - handlePlugins( - buildKey, - sendRequest, - sendResponse, - refs, - streamIn, - requestCallbacks, - options, - plugins, - details - ).then( - (result) => { - if (!result.ok) return handleError(result.error, result.pluginName); - try { - buildOrContextContinue(result.requestPlugins, result.runOnEndCallbacks, result.scheduleOnDisposeCallbacks); - } catch (e) { - handleError(e, ""); - } - }, - (e) => handleError(e, "") - ); - return; - } - try { - buildOrContextContinue(null, (result, done) => done([], []), () => { - }); - } catch (e) { - handleError(e, ""); - } - function buildOrContextContinue(requestPlugins, runOnEndCallbacks, scheduleOnDisposeCallbacks) { - const writeDefault = streamIn.hasFS; - const { - entries, - flags, - write, - stdinContents, - stdinResolveDir, - absWorkingDir, - nodePaths, - mangleCache - } = flagsForBuildOptions(callName, options, isTTY2, buildLogLevelDefault, writeDefault); - if (write && !streamIn.hasFS) throw new Error(`The "write" option is unavailable in this environment`); - const request = { - command: "build", - key: buildKey, - entries, - flags, - write, - stdinContents, - stdinResolveDir, - absWorkingDir: absWorkingDir || defaultWD2, - nodePaths, - context: isContext - }; - if (requestPlugins) request.plugins = requestPlugins; - if (mangleCache) request.mangleCache = mangleCache; - const buildResponseToResult = (response, callback2) => { - const result = { - errors: replaceDetailsInMessages(response.errors, details), - warnings: replaceDetailsInMessages(response.warnings, details), - outputFiles: void 0, - metafile: void 0, - mangleCache: void 0 - }; - const originalErrors = result.errors.slice(); - const originalWarnings = result.warnings.slice(); - if (response.outputFiles) result.outputFiles = response.outputFiles.map(convertOutputFiles); - if (response.metafile) result.metafile = JSON.parse(response.metafile); - if (response.mangleCache) result.mangleCache = response.mangleCache; - if (response.writeToStdout !== void 0) console.log(decodeUTF8(response.writeToStdout).replace(/\n$/, "")); - runOnEndCallbacks(result, (onEndErrors, onEndWarnings) => { - if (originalErrors.length > 0 || onEndErrors.length > 0) { - const error = failureErrorWithLog("Build failed", originalErrors.concat(onEndErrors), originalWarnings.concat(onEndWarnings)); - return callback2(error, null, onEndErrors, onEndWarnings); - } - callback2(null, result, onEndErrors, onEndWarnings); - }); - }; - let latestResultPromise; - let provideLatestResult; - if (isContext) - requestCallbacks["on-end"] = (id, request2) => new Promise((resolve) => { - buildResponseToResult(request2, (err, result, onEndErrors, onEndWarnings) => { - const response = { - errors: onEndErrors, - warnings: onEndWarnings - }; - if (provideLatestResult) provideLatestResult(err, result); - latestResultPromise = void 0; - provideLatestResult = void 0; - sendResponse(id, response); - resolve(); - }); - }); - sendRequest(refs, request, (error, response) => { - if (error) return callback(new Error(error), null); - if (!isContext) { - return buildResponseToResult(response, (err, res) => { - scheduleOnDisposeCallbacks(); - return callback(err, res); - }); - } - if (response.errors.length > 0) { - return callback(failureErrorWithLog("Context failed", response.errors, response.warnings), null); - } - let didDispose = false; - const result = { - rebuild: () => { - if (!latestResultPromise) latestResultPromise = new Promise((resolve, reject) => { - let settlePromise; - provideLatestResult = (err, result2) => { - if (!settlePromise) settlePromise = () => err ? reject(err) : resolve(result2); - }; - const triggerAnotherBuild = () => { - const request2 = { - command: "rebuild", - key: buildKey - }; - sendRequest(refs, request2, (error2, response2) => { - if (error2) { - reject(new Error(error2)); - } else if (settlePromise) { - settlePromise(); - } else { - triggerAnotherBuild(); - } - }); - }; - triggerAnotherBuild(); - }); - return latestResultPromise; - }, - watch: (options2 = {}) => new Promise((resolve, reject) => { - if (!streamIn.hasFS) throw new Error(`Cannot use the "watch" API in this environment`); - const keys = {}; - checkForInvalidFlags(options2, keys, `in watch() call`); - const request2 = { - command: "watch", - key: buildKey - }; - sendRequest(refs, request2, (error2) => { - if (error2) reject(new Error(error2)); - else resolve(void 0); - }); - }), - serve: (options2 = {}) => new Promise((resolve, reject) => { - if (!streamIn.hasFS) throw new Error(`Cannot use the "serve" API in this environment`); - const keys = {}; - const port = getFlag(options2, keys, "port", mustBeInteger); - const host = getFlag(options2, keys, "host", mustBeString); - const servedir = getFlag(options2, keys, "servedir", mustBeString); - const keyfile = getFlag(options2, keys, "keyfile", mustBeString); - const certfile = getFlag(options2, keys, "certfile", mustBeString); - const fallback = getFlag(options2, keys, "fallback", mustBeString); - const onRequest = getFlag(options2, keys, "onRequest", mustBeFunction); - checkForInvalidFlags(options2, keys, `in serve() call`); - const request2 = { - command: "serve", - key: buildKey, - onRequest: !!onRequest - }; - if (port !== void 0) request2.port = port; - if (host !== void 0) request2.host = host; - if (servedir !== void 0) request2.servedir = servedir; - if (keyfile !== void 0) request2.keyfile = keyfile; - if (certfile !== void 0) request2.certfile = certfile; - if (fallback !== void 0) request2.fallback = fallback; - sendRequest(refs, request2, (error2, response2) => { - if (error2) return reject(new Error(error2)); - if (onRequest) { - requestCallbacks["serve-request"] = (id, request3) => { - onRequest(request3.args); - sendResponse(id, {}); - }; - } - resolve(response2); - }); - }), - cancel: () => new Promise((resolve) => { - if (didDispose) return resolve(); - const request2 = { - command: "cancel", - key: buildKey - }; - sendRequest(refs, request2, () => { - resolve(); - }); - }), - dispose: () => new Promise((resolve) => { - if (didDispose) return resolve(); - didDispose = true; - const request2 = { - command: "dispose", - key: buildKey - }; - sendRequest(refs, request2, () => { - resolve(); - scheduleOnDisposeCallbacks(); - refs.unref(); - }); - }) - }; - refs.ref(); - callback(null, result); - }); - } -} -var handlePlugins = async (buildKey, sendRequest, sendResponse, refs, streamIn, requestCallbacks, initialOptions, plugins, details) => { - let onStartCallbacks = []; - let onEndCallbacks = []; - let onResolveCallbacks = {}; - let onLoadCallbacks = {}; - let onDisposeCallbacks = []; - let nextCallbackID = 0; - let i = 0; - let requestPlugins = []; - let isSetupDone = false; - plugins = [...plugins]; - for (let item of plugins) { - let keys = {}; - if (typeof item !== "object") throw new Error(`Plugin at index ${i} must be an object`); - const name = getFlag(item, keys, "name", mustBeString); - if (typeof name !== "string" || name === "") throw new Error(`Plugin at index ${i} is missing a name`); - try { - let setup = getFlag(item, keys, "setup", mustBeFunction); - if (typeof setup !== "function") throw new Error(`Plugin is missing a setup function`); - checkForInvalidFlags(item, keys, `on plugin ${quote(name)}`); - let plugin = { - name, - onStart: false, - onEnd: false, - onResolve: [], - onLoad: [] - }; - i++; - let resolve = (path3, options = {}) => { - if (!isSetupDone) throw new Error('Cannot call "resolve" before plugin setup has completed'); - if (typeof path3 !== "string") throw new Error(`The path to resolve must be a string`); - let keys2 = /* @__PURE__ */ Object.create(null); - let pluginName = getFlag(options, keys2, "pluginName", mustBeString); - let importer = getFlag(options, keys2, "importer", mustBeString); - let namespace = getFlag(options, keys2, "namespace", mustBeString); - let resolveDir = getFlag(options, keys2, "resolveDir", mustBeString); - let kind = getFlag(options, keys2, "kind", mustBeString); - let pluginData = getFlag(options, keys2, "pluginData", canBeAnything); - checkForInvalidFlags(options, keys2, "in resolve() call"); - return new Promise((resolve2, reject) => { - const request = { - command: "resolve", - path: path3, - key: buildKey, - pluginName: name - }; - if (pluginName != null) request.pluginName = pluginName; - if (importer != null) request.importer = importer; - if (namespace != null) request.namespace = namespace; - if (resolveDir != null) request.resolveDir = resolveDir; - if (kind != null) request.kind = kind; - else throw new Error(`Must specify "kind" when calling "resolve"`); - if (pluginData != null) request.pluginData = details.store(pluginData); - sendRequest(refs, request, (error, response) => { - if (error !== null) reject(new Error(error)); - else resolve2({ - errors: replaceDetailsInMessages(response.errors, details), - warnings: replaceDetailsInMessages(response.warnings, details), - path: response.path, - external: response.external, - sideEffects: response.sideEffects, - namespace: response.namespace, - suffix: response.suffix, - pluginData: details.load(response.pluginData) - }); - }); - }); - }; - let promise = setup({ - initialOptions, - resolve, - onStart(callback) { - let registeredText = `This error came from the "onStart" callback registered here:`; - let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onStart"); - onStartCallbacks.push({ name, callback, note: registeredNote }); - plugin.onStart = true; - }, - onEnd(callback) { - let registeredText = `This error came from the "onEnd" callback registered here:`; - let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onEnd"); - onEndCallbacks.push({ name, callback, note: registeredNote }); - plugin.onEnd = true; - }, - onResolve(options, callback) { - let registeredText = `This error came from the "onResolve" callback registered here:`; - let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onResolve"); - let keys2 = {}; - let filter = getFlag(options, keys2, "filter", mustBeRegExp); - let namespace = getFlag(options, keys2, "namespace", mustBeString); - checkForInvalidFlags(options, keys2, `in onResolve() call for plugin ${quote(name)}`); - if (filter == null) throw new Error(`onResolve() call is missing a filter`); - let id = nextCallbackID++; - onResolveCallbacks[id] = { name, callback, note: registeredNote }; - plugin.onResolve.push({ id, filter: filter.source, namespace: namespace || "" }); - }, - onLoad(options, callback) { - let registeredText = `This error came from the "onLoad" callback registered here:`; - let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onLoad"); - let keys2 = {}; - let filter = getFlag(options, keys2, "filter", mustBeRegExp); - let namespace = getFlag(options, keys2, "namespace", mustBeString); - checkForInvalidFlags(options, keys2, `in onLoad() call for plugin ${quote(name)}`); - if (filter == null) throw new Error(`onLoad() call is missing a filter`); - let id = nextCallbackID++; - onLoadCallbacks[id] = { name, callback, note: registeredNote }; - plugin.onLoad.push({ id, filter: filter.source, namespace: namespace || "" }); - }, - onDispose(callback) { - onDisposeCallbacks.push(callback); - }, - esbuild: streamIn.esbuild - }); - if (promise) await promise; - requestPlugins.push(plugin); - } catch (e) { - return { ok: false, error: e, pluginName: name }; - } - } - requestCallbacks["on-start"] = async (id, request) => { - let response = { errors: [], warnings: [] }; - await Promise.all(onStartCallbacks.map(async ({ name, callback, note }) => { - try { - let result = await callback(); - if (result != null) { - if (typeof result !== "object") throw new Error(`Expected onStart() callback in plugin ${quote(name)} to return an object`); - let keys = {}; - let errors = getFlag(result, keys, "errors", mustBeArray); - let warnings = getFlag(result, keys, "warnings", mustBeArray); - checkForInvalidFlags(result, keys, `from onStart() callback in plugin ${quote(name)}`); - if (errors != null) response.errors.push(...sanitizeMessages(errors, "errors", details, name, void 0)); - if (warnings != null) response.warnings.push(...sanitizeMessages(warnings, "warnings", details, name, void 0)); - } - } catch (e) { - response.errors.push(extractErrorMessageV8(e, streamIn, details, note && note(), name)); - } - })); - sendResponse(id, response); - }; - requestCallbacks["on-resolve"] = async (id, request) => { - let response = {}, name = "", callback, note; - for (let id2 of request.ids) { - try { - ({ name, callback, note } = onResolveCallbacks[id2]); - let result = await callback({ - path: request.path, - importer: request.importer, - namespace: request.namespace, - resolveDir: request.resolveDir, - kind: request.kind, - pluginData: details.load(request.pluginData) - }); - if (result != null) { - if (typeof result !== "object") throw new Error(`Expected onResolve() callback in plugin ${quote(name)} to return an object`); - let keys = {}; - let pluginName = getFlag(result, keys, "pluginName", mustBeString); - let path3 = getFlag(result, keys, "path", mustBeString); - let namespace = getFlag(result, keys, "namespace", mustBeString); - let suffix = getFlag(result, keys, "suffix", mustBeString); - let external = getFlag(result, keys, "external", mustBeBoolean); - let sideEffects = getFlag(result, keys, "sideEffects", mustBeBoolean); - let pluginData = getFlag(result, keys, "pluginData", canBeAnything); - let errors = getFlag(result, keys, "errors", mustBeArray); - let warnings = getFlag(result, keys, "warnings", mustBeArray); - let watchFiles = getFlag(result, keys, "watchFiles", mustBeArray); - let watchDirs = getFlag(result, keys, "watchDirs", mustBeArray); - checkForInvalidFlags(result, keys, `from onResolve() callback in plugin ${quote(name)}`); - response.id = id2; - if (pluginName != null) response.pluginName = pluginName; - if (path3 != null) response.path = path3; - if (namespace != null) response.namespace = namespace; - if (suffix != null) response.suffix = suffix; - if (external != null) response.external = external; - if (sideEffects != null) response.sideEffects = sideEffects; - if (pluginData != null) response.pluginData = details.store(pluginData); - if (errors != null) response.errors = sanitizeMessages(errors, "errors", details, name, void 0); - if (warnings != null) response.warnings = sanitizeMessages(warnings, "warnings", details, name, void 0); - if (watchFiles != null) response.watchFiles = sanitizeStringArray(watchFiles, "watchFiles"); - if (watchDirs != null) response.watchDirs = sanitizeStringArray(watchDirs, "watchDirs"); - break; - } - } catch (e) { - response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details, note && note(), name)] }; - break; - } - } - sendResponse(id, response); - }; - requestCallbacks["on-load"] = async (id, request) => { - let response = {}, name = "", callback, note; - for (let id2 of request.ids) { - try { - ({ name, callback, note } = onLoadCallbacks[id2]); - let result = await callback({ - path: request.path, - namespace: request.namespace, - suffix: request.suffix, - pluginData: details.load(request.pluginData), - with: request.with - }); - if (result != null) { - if (typeof result !== "object") throw new Error(`Expected onLoad() callback in plugin ${quote(name)} to return an object`); - let keys = {}; - let pluginName = getFlag(result, keys, "pluginName", mustBeString); - let contents = getFlag(result, keys, "contents", mustBeStringOrUint8Array); - let resolveDir = getFlag(result, keys, "resolveDir", mustBeString); - let pluginData = getFlag(result, keys, "pluginData", canBeAnything); - let loader = getFlag(result, keys, "loader", mustBeString); - let errors = getFlag(result, keys, "errors", mustBeArray); - let warnings = getFlag(result, keys, "warnings", mustBeArray); - let watchFiles = getFlag(result, keys, "watchFiles", mustBeArray); - let watchDirs = getFlag(result, keys, "watchDirs", mustBeArray); - checkForInvalidFlags(result, keys, `from onLoad() callback in plugin ${quote(name)}`); - response.id = id2; - if (pluginName != null) response.pluginName = pluginName; - if (contents instanceof Uint8Array) response.contents = contents; - else if (contents != null) response.contents = encodeUTF8(contents); - if (resolveDir != null) response.resolveDir = resolveDir; - if (pluginData != null) response.pluginData = details.store(pluginData); - if (loader != null) response.loader = loader; - if (errors != null) response.errors = sanitizeMessages(errors, "errors", details, name, void 0); - if (warnings != null) response.warnings = sanitizeMessages(warnings, "warnings", details, name, void 0); - if (watchFiles != null) response.watchFiles = sanitizeStringArray(watchFiles, "watchFiles"); - if (watchDirs != null) response.watchDirs = sanitizeStringArray(watchDirs, "watchDirs"); - break; - } - } catch (e) { - response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details, note && note(), name)] }; - break; - } - } - sendResponse(id, response); - }; - let runOnEndCallbacks = (result, done) => done([], []); - if (onEndCallbacks.length > 0) { - runOnEndCallbacks = (result, done) => { - (async () => { - const onEndErrors = []; - const onEndWarnings = []; - for (const { name, callback, note } of onEndCallbacks) { - let newErrors; - let newWarnings; - try { - const value = await callback(result); - if (value != null) { - if (typeof value !== "object") throw new Error(`Expected onEnd() callback in plugin ${quote(name)} to return an object`); - let keys = {}; - let errors = getFlag(value, keys, "errors", mustBeArray); - let warnings = getFlag(value, keys, "warnings", mustBeArray); - checkForInvalidFlags(value, keys, `from onEnd() callback in plugin ${quote(name)}`); - if (errors != null) newErrors = sanitizeMessages(errors, "errors", details, name, void 0); - if (warnings != null) newWarnings = sanitizeMessages(warnings, "warnings", details, name, void 0); - } - } catch (e) { - newErrors = [extractErrorMessageV8(e, streamIn, details, note && note(), name)]; - } - if (newErrors) { - onEndErrors.push(...newErrors); - try { - result.errors.push(...newErrors); - } catch { - } - } - if (newWarnings) { - onEndWarnings.push(...newWarnings); - try { - result.warnings.push(...newWarnings); - } catch { - } - } - } - done(onEndErrors, onEndWarnings); - })(); - }; - } - let scheduleOnDisposeCallbacks = () => { - for (const cb of onDisposeCallbacks) { - setTimeout(() => cb(), 0); - } - }; - isSetupDone = true; - return { - ok: true, - requestPlugins, - runOnEndCallbacks, - scheduleOnDisposeCallbacks - }; -}; -function createObjectStash() { - const map = /* @__PURE__ */ new Map(); - let nextID = 0; - return { - load(id) { - return map.get(id); - }, - store(value) { - if (value === void 0) return -1; - const id = nextID++; - map.set(id, value); - return id; - } - }; -} -function extractCallerV8(e, streamIn, ident) { - let note; - let tried = false; - return () => { - if (tried) return note; - tried = true; - try { - let lines = (e.stack + "").split("\n"); - lines.splice(1, 1); - let location = parseStackLinesV8(streamIn, lines, ident); - if (location) { - note = { text: e.message, location }; - return note; - } - } catch { - } - }; -} -function extractErrorMessageV8(e, streamIn, stash, note, pluginName) { - let text = "Internal error"; - let location = null; - try { - text = (e && e.message || e) + ""; - } catch { - } - try { - location = parseStackLinesV8(streamIn, (e.stack + "").split("\n"), ""); - } catch { - } - return { id: "", pluginName, text, location, notes: note ? [note] : [], detail: stash ? stash.store(e) : -1 }; -} -function parseStackLinesV8(streamIn, lines, ident) { - let at = " at "; - if (streamIn.readFileSync && !lines[0].startsWith(at) && lines[1].startsWith(at)) { - for (let i = 1; i < lines.length; i++) { - let line = lines[i]; - if (!line.startsWith(at)) continue; - line = line.slice(at.length); - while (true) { - let match = /^(?:new |async )?\S+ \((.*)\)$/.exec(line); - if (match) { - line = match[1]; - continue; - } - match = /^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(line); - if (match) { - line = match[1]; - continue; - } - match = /^(\S+):(\d+):(\d+)$/.exec(line); - if (match) { - let contents; - try { - contents = streamIn.readFileSync(match[1], "utf8"); - } catch { - break; - } - let lineText = contents.split(/\r\n|\r|\n|\u2028|\u2029/)[+match[2] - 1] || ""; - let column = +match[3] - 1; - let length = lineText.slice(column, column + ident.length) === ident ? ident.length : 0; - return { - file: match[1], - namespace: "file", - line: +match[2], - column: encodeUTF8(lineText.slice(0, column)).length, - length: encodeUTF8(lineText.slice(column, column + length)).length, - lineText: lineText + "\n" + lines.slice(1).join("\n"), - suggestion: "" - }; - } - break; - } - } - } - return null; -} -function failureErrorWithLog(text, errors, warnings) { - let limit = 5; - text += errors.length < 1 ? "" : ` with ${errors.length} error${errors.length < 2 ? "" : "s"}:` + errors.slice(0, limit + 1).map((e, i) => { - if (i === limit) return "\n..."; - if (!e.location) return ` -error: ${e.text}`; - let { file, line, column } = e.location; - let pluginText = e.pluginName ? `[plugin: ${e.pluginName}] ` : ""; - return ` -${file}:${line}:${column}: ERROR: ${pluginText}${e.text}`; - }).join(""); - let error = new Error(text); - for (const [key, value] of [["errors", errors], ["warnings", warnings]]) { - Object.defineProperty(error, key, { - configurable: true, - enumerable: true, - get: () => value, - set: (value2) => Object.defineProperty(error, key, { - configurable: true, - enumerable: true, - value: value2 - }) - }); - } - return error; -} -function replaceDetailsInMessages(messages, stash) { - for (const message of messages) { - message.detail = stash.load(message.detail); - } - return messages; -} -function sanitizeLocation(location, where, terminalWidth) { - if (location == null) return null; - let keys = {}; - let file = getFlag(location, keys, "file", mustBeString); - let namespace = getFlag(location, keys, "namespace", mustBeString); - let line = getFlag(location, keys, "line", mustBeInteger); - let column = getFlag(location, keys, "column", mustBeInteger); - let length = getFlag(location, keys, "length", mustBeInteger); - let lineText = getFlag(location, keys, "lineText", mustBeString); - let suggestion = getFlag(location, keys, "suggestion", mustBeString); - checkForInvalidFlags(location, keys, where); - if (lineText) { - const relevantASCII = lineText.slice( - 0, - (column && column > 0 ? column : 0) + (length && length > 0 ? length : 0) + (terminalWidth && terminalWidth > 0 ? terminalWidth : 80) - ); - if (!/[\x7F-\uFFFF]/.test(relevantASCII) && !/\n/.test(lineText)) { - lineText = relevantASCII; - } - } - return { - file: file || "", - namespace: namespace || "", - line: line || 0, - column: column || 0, - length: length || 0, - lineText: lineText || "", - suggestion: suggestion || "" - }; -} -function sanitizeMessages(messages, property, stash, fallbackPluginName, terminalWidth) { - let messagesClone = []; - let index = 0; - for (const message of messages) { - let keys = {}; - let id = getFlag(message, keys, "id", mustBeString); - let pluginName = getFlag(message, keys, "pluginName", mustBeString); - let text = getFlag(message, keys, "text", mustBeString); - let location = getFlag(message, keys, "location", mustBeObjectOrNull); - let notes = getFlag(message, keys, "notes", mustBeArray); - let detail = getFlag(message, keys, "detail", canBeAnything); - let where = `in element ${index} of "${property}"`; - checkForInvalidFlags(message, keys, where); - let notesClone = []; - if (notes) { - for (const note of notes) { - let noteKeys = {}; - let noteText = getFlag(note, noteKeys, "text", mustBeString); - let noteLocation = getFlag(note, noteKeys, "location", mustBeObjectOrNull); - checkForInvalidFlags(note, noteKeys, where); - notesClone.push({ - text: noteText || "", - location: sanitizeLocation(noteLocation, where, terminalWidth) - }); - } - } - messagesClone.push({ - id: id || "", - pluginName: pluginName || fallbackPluginName, - text: text || "", - location: sanitizeLocation(location, where, terminalWidth), - notes: notesClone, - detail: stash ? stash.store(detail) : -1 - }); - index++; - } - return messagesClone; -} -function sanitizeStringArray(values, property) { - const result = []; - for (const value of values) { - if (typeof value !== "string") throw new Error(`${quote(property)} must be an array of strings`); - result.push(value); - } - return result; -} -function convertOutputFiles({ path: path3, contents, hash }) { - let text = null; - return { - path: path3, - contents, - hash, - get text() { - const binary = this.contents; - if (text === null || binary !== contents) { - contents = binary; - text = decodeUTF8(binary); - } - return text; - } - }; -} - -// lib/npm/node-platform.ts -var fs = require("fs"); -var os = require("os"); -var path = require("path"); -var ESBUILD_BINARY_PATH = process.env.ESBUILD_BINARY_PATH || ESBUILD_BINARY_PATH; -var isValidBinaryPath = (x) => !!x && x !== "/usr/bin/esbuild"; -var packageDarwin_arm64 = "@esbuild/darwin-arm64"; -var packageDarwin_x64 = "@esbuild/darwin-x64"; -var knownWindowsPackages = { - "win32 arm64 LE": "@esbuild/win32-arm64", - "win32 ia32 LE": "@esbuild/win32-ia32", - "win32 x64 LE": "@esbuild/win32-x64" -}; -var knownUnixlikePackages = { - "aix ppc64 BE": "@esbuild/aix-ppc64", - "android arm64 LE": "@esbuild/android-arm64", - "darwin arm64 LE": "@esbuild/darwin-arm64", - "darwin x64 LE": "@esbuild/darwin-x64", - "freebsd arm64 LE": "@esbuild/freebsd-arm64", - "freebsd x64 LE": "@esbuild/freebsd-x64", - "linux arm LE": "@esbuild/linux-arm", - "linux arm64 LE": "@esbuild/linux-arm64", - "linux ia32 LE": "@esbuild/linux-ia32", - "linux mips64el LE": "@esbuild/linux-mips64el", - "linux ppc64 LE": "@esbuild/linux-ppc64", - "linux riscv64 LE": "@esbuild/linux-riscv64", - "linux s390x BE": "@esbuild/linux-s390x", - "linux x64 LE": "@esbuild/linux-x64", - "linux loong64 LE": "@esbuild/linux-loong64", - "netbsd x64 LE": "@esbuild/netbsd-x64", - "openbsd x64 LE": "@esbuild/openbsd-x64", - "sunos x64 LE": "@esbuild/sunos-x64" -}; -var knownWebAssemblyFallbackPackages = { - "android arm LE": "@esbuild/android-arm", - "android x64 LE": "@esbuild/android-x64" -}; -function pkgAndSubpathForCurrentPlatform() { - let pkg; - let subpath; - let isWASM = false; - let platformKey = `${process.platform} ${os.arch()} ${os.endianness()}`; - if (platformKey in knownWindowsPackages) { - pkg = knownWindowsPackages[platformKey]; - subpath = "esbuild.exe"; - } else if (platformKey in knownUnixlikePackages) { - pkg = knownUnixlikePackages[platformKey]; - subpath = "bin/esbuild"; - } else if (platformKey in knownWebAssemblyFallbackPackages) { - pkg = knownWebAssemblyFallbackPackages[platformKey]; - subpath = "bin/esbuild"; - isWASM = true; - } else { - throw new Error(`Unsupported platform: ${platformKey}`); - } - return { pkg, subpath, isWASM }; -} -function pkgForSomeOtherPlatform() { - const libMainJS = require.resolve("esbuild"); - const nodeModulesDirectory = path.dirname(path.dirname(path.dirname(libMainJS))); - if (path.basename(nodeModulesDirectory) === "node_modules") { - for (const unixKey in knownUnixlikePackages) { - try { - const pkg = knownUnixlikePackages[unixKey]; - if (fs.existsSync(path.join(nodeModulesDirectory, pkg))) return pkg; - } catch { - } - } - for (const windowsKey in knownWindowsPackages) { - try { - const pkg = knownWindowsPackages[windowsKey]; - if (fs.existsSync(path.join(nodeModulesDirectory, pkg))) return pkg; - } catch { - } - } - } - return null; -} -function downloadedBinPath(pkg, subpath) { - const esbuildLibDir = path.dirname(require.resolve("esbuild")); - return path.join(esbuildLibDir, `downloaded-${pkg.replace("/", "-")}-${path.basename(subpath)}`); -} -function generateBinPath() { - if (isValidBinaryPath(ESBUILD_BINARY_PATH)) { - if (!fs.existsSync(ESBUILD_BINARY_PATH)) { - console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${ESBUILD_BINARY_PATH}`); - } else { - return { binPath: ESBUILD_BINARY_PATH, isWASM: false }; - } - } - const { pkg, subpath, isWASM } = pkgAndSubpathForCurrentPlatform(); - let binPath; - try { - binPath = require.resolve(`${pkg}/${subpath}`); - } catch (e) { - binPath = downloadedBinPath(pkg, subpath); - if (!fs.existsSync(binPath)) { - try { - require.resolve(pkg); - } catch { - const otherPkg = pkgForSomeOtherPlatform(); - if (otherPkg) { - let suggestions = ` -Specifically the "${otherPkg}" package is present but this platform -needs the "${pkg}" package instead. People often get into this -situation by installing esbuild on Windows or macOS and copying "node_modules" -into a Docker image that runs Linux, or by copying "node_modules" between -Windows and WSL environments. - -If you are installing with npm, you can try not copying the "node_modules" -directory when you copy the files over, and running "npm ci" or "npm install" -on the destination platform after the copy. Or you could consider using yarn -instead of npm which has built-in support for installing a package on multiple -platforms simultaneously. - -If you are installing with yarn, you can try listing both this platform and the -other platform in your ".yarnrc.yml" file using the "supportedArchitectures" -feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures -Keep in mind that this means multiple copies of esbuild will be present. -`; - if (pkg === packageDarwin_x64 && otherPkg === packageDarwin_arm64 || pkg === packageDarwin_arm64 && otherPkg === packageDarwin_x64) { - suggestions = ` -Specifically the "${otherPkg}" package is present but this platform -needs the "${pkg}" package instead. People often get into this -situation by installing esbuild with npm running inside of Rosetta 2 and then -trying to use it with node running outside of Rosetta 2, or vice versa (Rosetta -2 is Apple's on-the-fly x86_64-to-arm64 translation service). - -If you are installing with npm, you can try ensuring that both npm and node are -not running under Rosetta 2 and then reinstalling esbuild. This likely involves -changing how you installed npm and/or node. For example, installing node with -the universal installer here should work: https://nodejs.org/en/download/. Or -you could consider using yarn instead of npm which has built-in support for -installing a package on multiple platforms simultaneously. - -If you are installing with yarn, you can try listing both "arm64" and "x64" -in your ".yarnrc.yml" file using the "supportedArchitectures" feature: -https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures -Keep in mind that this means multiple copies of esbuild will be present. -`; - } - throw new Error(` -You installed esbuild for another platform than the one you're currently using. -This won't work because esbuild is written with native code and needs to -install a platform-specific binary executable. -${suggestions} -Another alternative is to use the "esbuild-wasm" package instead, which works -the same way on all platforms. But it comes with a heavy performance cost and -can sometimes be 10x slower than the "esbuild" package, so you may also not -want to do that. -`); - } - throw new Error(`The package "${pkg}" could not be found, and is needed by esbuild. - -If you are installing esbuild with npm, make sure that you don't specify the -"--no-optional" or "--omit=optional" flags. The "optionalDependencies" feature -of "package.json" is used by esbuild to install the correct binary executable -for your current platform.`); - } - throw e; - } - } - if (/\.zip\//.test(binPath)) { - let pnpapi; - try { - pnpapi = require("pnpapi"); - } catch (e) { - } - if (pnpapi) { - const root = pnpapi.getPackageInformation(pnpapi.topLevel).packageLocation; - const binTargetPath = path.join( - root, - "node_modules", - ".cache", - "esbuild", - `pnpapi-${pkg.replace("/", "-")}-${"0.21.3"}-${path.basename(subpath)}` - ); - if (!fs.existsSync(binTargetPath)) { - fs.mkdirSync(path.dirname(binTargetPath), { recursive: true }); - fs.copyFileSync(binPath, binTargetPath); - fs.chmodSync(binTargetPath, 493); - } - return { binPath: binTargetPath, isWASM }; - } - } - return { binPath, isWASM }; -} - -// lib/npm/node.ts -var child_process = require("child_process"); -var crypto = require("crypto"); -var path2 = require("path"); -var fs2 = require("fs"); -var os2 = require("os"); -var tty = require("tty"); -var worker_threads; -if (process.env.ESBUILD_WORKER_THREADS !== "0") { - try { - worker_threads = require("worker_threads"); - } catch { - } - let [major, minor] = process.versions.node.split("."); - if ( - // { - if ((!ESBUILD_BINARY_PATH || false) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) { - throw new Error( - `The esbuild JavaScript API cannot be bundled. Please mark the "esbuild" package as external so it's not included in the bundle. - -More information: The file containing the code for esbuild's JavaScript API (${__filename}) does not appear to be inside the esbuild package on the file system, which usually means that the esbuild package was bundled into another file. This is problematic because the API needs to run a binary executable inside the esbuild package which is located using a relative path from the API code to the executable. If the esbuild package is bundled, the relative path will be incorrect and the executable won't be found.` - ); - } - if (false) { - return ["node", [path2.join(__dirname, "..", "bin", "esbuild")]]; - } else { - const { binPath, isWASM } = generateBinPath(); - if (isWASM) { - return ["node", [binPath]]; - } else { - return [binPath, []]; - } - } -}; -var isTTY = () => tty.isatty(2); -var fsSync = { - readFile(tempFile, callback) { - try { - let contents = fs2.readFileSync(tempFile, "utf8"); - try { - fs2.unlinkSync(tempFile); - } catch { - } - callback(null, contents); - } catch (err) { - callback(err, null); - } - }, - writeFile(contents, callback) { - try { - let tempFile = randomFileName(); - fs2.writeFileSync(tempFile, contents); - callback(tempFile); - } catch { - callback(null); - } - } -}; -var fsAsync = { - readFile(tempFile, callback) { - try { - fs2.readFile(tempFile, "utf8", (err, contents) => { - try { - fs2.unlink(tempFile, () => callback(err, contents)); - } catch { - callback(err, contents); - } - }); - } catch (err) { - callback(err, null); - } - }, - writeFile(contents, callback) { - try { - let tempFile = randomFileName(); - fs2.writeFile(tempFile, contents, (err) => err !== null ? callback(null) : callback(tempFile)); - } catch { - callback(null); - } - } -}; -var version = "0.21.3"; -var build = (options) => ensureServiceIsRunning().build(options); -var context = (buildOptions) => ensureServiceIsRunning().context(buildOptions); -var transform = (input, options) => ensureServiceIsRunning().transform(input, options); -var formatMessages = (messages, options) => ensureServiceIsRunning().formatMessages(messages, options); -var analyzeMetafile = (messages, options) => ensureServiceIsRunning().analyzeMetafile(messages, options); -var buildSync = (options) => { - if (worker_threads && !isInternalWorkerThread) { - if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); - return workerThreadService.buildSync(options); - } - let result; - runServiceSync((service) => service.buildOrContext({ - callName: "buildSync", - refs: null, - options, - isTTY: isTTY(), - defaultWD, - callback: (err, res) => { - if (err) throw err; - result = res; - } - })); - return result; -}; -var transformSync = (input, options) => { - if (worker_threads && !isInternalWorkerThread) { - if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); - return workerThreadService.transformSync(input, options); - } - let result; - runServiceSync((service) => service.transform({ - callName: "transformSync", - refs: null, - input, - options: options || {}, - isTTY: isTTY(), - fs: fsSync, - callback: (err, res) => { - if (err) throw err; - result = res; - } - })); - return result; -}; -var formatMessagesSync = (messages, options) => { - if (worker_threads && !isInternalWorkerThread) { - if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); - return workerThreadService.formatMessagesSync(messages, options); - } - let result; - runServiceSync((service) => service.formatMessages({ - callName: "formatMessagesSync", - refs: null, - messages, - options, - callback: (err, res) => { - if (err) throw err; - result = res; - } - })); - return result; -}; -var analyzeMetafileSync = (metafile, options) => { - if (worker_threads && !isInternalWorkerThread) { - if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads); - return workerThreadService.analyzeMetafileSync(metafile, options); - } - let result; - runServiceSync((service) => service.analyzeMetafile({ - callName: "analyzeMetafileSync", - refs: null, - metafile: typeof metafile === "string" ? metafile : JSON.stringify(metafile), - options, - callback: (err, res) => { - if (err) throw err; - result = res; - } - })); - return result; -}; -var stop = () => { - if (stopService) stopService(); - if (workerThreadService) workerThreadService.stop(); - return Promise.resolve(); -}; -var initializeWasCalled = false; -var initialize = (options) => { - options = validateInitializeOptions(options || {}); - if (options.wasmURL) throw new Error(`The "wasmURL" option only works in the browser`); - if (options.wasmModule) throw new Error(`The "wasmModule" option only works in the browser`); - if (options.worker) throw new Error(`The "worker" option only works in the browser`); - if (initializeWasCalled) throw new Error('Cannot call "initialize" more than once'); - ensureServiceIsRunning(); - initializeWasCalled = true; - return Promise.resolve(); -}; -var defaultWD = process.cwd(); -var longLivedService; -var stopService; -var ensureServiceIsRunning = () => { - if (longLivedService) return longLivedService; - let [command, args] = esbuildCommandAndArgs(); - let child = child_process.spawn(command, args.concat(`--service=${"0.21.3"}`, "--ping"), { - windowsHide: true, - stdio: ["pipe", "pipe", "inherit"], - cwd: defaultWD - }); - let { readFromStdout, afterClose, service } = createChannel({ - writeToStdin(bytes) { - child.stdin.write(bytes, (err) => { - if (err) afterClose(err); - }); - }, - readFileSync: fs2.readFileSync, - isSync: false, - hasFS: true, - esbuild: node_exports - }); - child.stdin.on("error", afterClose); - child.on("error", afterClose); - const stdin = child.stdin; - const stdout = child.stdout; - stdout.on("data", readFromStdout); - stdout.on("end", afterClose); - stopService = () => { - stdin.destroy(); - stdout.destroy(); - child.kill(); - initializeWasCalled = false; - longLivedService = void 0; - stopService = void 0; - }; - let refCount = 0; - child.unref(); - if (stdin.unref) { - stdin.unref(); - } - if (stdout.unref) { - stdout.unref(); - } - const refs = { - ref() { - if (++refCount === 1) child.ref(); - }, - unref() { - if (--refCount === 0) child.unref(); - } - }; - longLivedService = { - build: (options) => new Promise((resolve, reject) => { - service.buildOrContext({ - callName: "build", - refs, - options, - isTTY: isTTY(), - defaultWD, - callback: (err, res) => err ? reject(err) : resolve(res) - }); - }), - context: (options) => new Promise((resolve, reject) => service.buildOrContext({ - callName: "context", - refs, - options, - isTTY: isTTY(), - defaultWD, - callback: (err, res) => err ? reject(err) : resolve(res) - })), - transform: (input, options) => new Promise((resolve, reject) => service.transform({ - callName: "transform", - refs, - input, - options: options || {}, - isTTY: isTTY(), - fs: fsAsync, - callback: (err, res) => err ? reject(err) : resolve(res) - })), - formatMessages: (messages, options) => new Promise((resolve, reject) => service.formatMessages({ - callName: "formatMessages", - refs, - messages, - options, - callback: (err, res) => err ? reject(err) : resolve(res) - })), - analyzeMetafile: (metafile, options) => new Promise((resolve, reject) => service.analyzeMetafile({ - callName: "analyzeMetafile", - refs, - metafile: typeof metafile === "string" ? metafile : JSON.stringify(metafile), - options, - callback: (err, res) => err ? reject(err) : resolve(res) - })) - }; - return longLivedService; -}; -var runServiceSync = (callback) => { - let [command, args] = esbuildCommandAndArgs(); - let stdin = new Uint8Array(); - let { readFromStdout, afterClose, service } = createChannel({ - writeToStdin(bytes) { - if (stdin.length !== 0) throw new Error("Must run at most one command"); - stdin = bytes; - }, - isSync: true, - hasFS: true, - esbuild: node_exports - }); - callback(service); - let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.21.3"}`), { - cwd: defaultWD, - windowsHide: true, - input: stdin, - // We don't know how large the output could be. If it's too large, the - // command will fail with ENOBUFS. Reserve 16mb for now since that feels - // like it should be enough. Also allow overriding this with an environment - // variable. - maxBuffer: +process.env.ESBUILD_MAX_BUFFER || 16 * 1024 * 1024 - }); - readFromStdout(stdout); - afterClose(null); -}; -var randomFileName = () => { - return path2.join(os2.tmpdir(), `esbuild-${crypto.randomBytes(32).toString("hex")}`); -}; -var workerThreadService = null; -var startWorkerThreadService = (worker_threads2) => { - let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel(); - let worker = new worker_threads2.Worker(__filename, { - workerData: { workerPort, defaultWD, esbuildVersion: "0.21.3" }, - transferList: [workerPort], - // From node's documentation: https://nodejs.org/api/worker_threads.html - // - // Take care when launching worker threads from preload scripts (scripts loaded - // and run using the `-r` command line flag). Unless the `execArgv` option is - // explicitly set, new Worker threads automatically inherit the command line flags - // from the running process and will preload the same preload scripts as the main - // thread. If the preload script unconditionally launches a worker thread, every - // thread spawned will spawn another until the application crashes. - // - execArgv: [] - }); - let nextID = 0; - let fakeBuildError = (text) => { - let error = new Error(`Build failed with 1 error: -error: ${text}`); - let errors = [{ id: "", pluginName: "", text, location: null, notes: [], detail: void 0 }]; - error.errors = errors; - error.warnings = []; - return error; - }; - let validateBuildSyncOptions = (options) => { - if (!options) return; - let plugins = options.plugins; - if (plugins && plugins.length > 0) throw fakeBuildError(`Cannot use plugins in synchronous API calls`); - }; - let applyProperties = (object, properties) => { - for (let key in properties) { - object[key] = properties[key]; - } - }; - let runCallSync = (command, args) => { - let id = nextID++; - let sharedBuffer = new SharedArrayBuffer(8); - let sharedBufferView = new Int32Array(sharedBuffer); - let msg = { sharedBuffer, id, command, args }; - worker.postMessage(msg); - let status = Atomics.wait(sharedBufferView, 0, 0); - if (status !== "ok" && status !== "not-equal") throw new Error("Internal error: Atomics.wait() failed: " + status); - let { message: { id: id2, resolve, reject, properties } } = worker_threads2.receiveMessageOnPort(mainPort); - if (id !== id2) throw new Error(`Internal error: Expected id ${id} but got id ${id2}`); - if (reject) { - applyProperties(reject, properties); - throw reject; - } - return resolve; - }; - worker.unref(); - return { - buildSync(options) { - validateBuildSyncOptions(options); - return runCallSync("build", [options]); - }, - transformSync(input, options) { - return runCallSync("transform", [input, options]); - }, - formatMessagesSync(messages, options) { - return runCallSync("formatMessages", [messages, options]); - }, - analyzeMetafileSync(metafile, options) { - return runCallSync("analyzeMetafile", [metafile, options]); - }, - stop() { - worker.terminate(); - workerThreadService = null; - } - }; -}; -var startSyncServiceWorker = () => { - let workerPort = worker_threads.workerData.workerPort; - let parentPort = worker_threads.parentPort; - let extractProperties = (object) => { - let properties = {}; - if (object && typeof object === "object") { - for (let key in object) { - properties[key] = object[key]; - } - } - return properties; - }; - try { - let service = ensureServiceIsRunning(); - defaultWD = worker_threads.workerData.defaultWD; - parentPort.on("message", (msg) => { - (async () => { - let { sharedBuffer, id, command, args } = msg; - let sharedBufferView = new Int32Array(sharedBuffer); - try { - switch (command) { - case "build": - workerPort.postMessage({ id, resolve: await service.build(args[0]) }); - break; - case "transform": - workerPort.postMessage({ id, resolve: await service.transform(args[0], args[1]) }); - break; - case "formatMessages": - workerPort.postMessage({ id, resolve: await service.formatMessages(args[0], args[1]) }); - break; - case "analyzeMetafile": - workerPort.postMessage({ id, resolve: await service.analyzeMetafile(args[0], args[1]) }); - break; - default: - throw new Error(`Invalid command: ${command}`); - } - } catch (reject) { - workerPort.postMessage({ id, reject, properties: extractProperties(reject) }); - } - Atomics.add(sharedBufferView, 0, 1); - Atomics.notify(sharedBufferView, 0, Infinity); - })(); - }); - } catch (reject) { - parentPort.on("message", (msg) => { - let { sharedBuffer, id } = msg; - let sharedBufferView = new Int32Array(sharedBuffer); - workerPort.postMessage({ id, reject, properties: extractProperties(reject) }); - Atomics.add(sharedBufferView, 0, 1); - Atomics.notify(sharedBufferView, 0, Infinity); - }); - } -}; -if (isInternalWorkerThread) { - startSyncServiceWorker(); -} -var node_default = node_exports; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - analyzeMetafile, - analyzeMetafileSync, - build, - buildSync, - context, - formatMessages, - formatMessagesSync, - initialize, - stop, - transform, - transformSync, - version -}); diff --git a/node_modules/esbuild/package.json b/node_modules/esbuild/package.json deleted file mode 100644 index ef96334..0000000 --- a/node_modules/esbuild/package.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "esbuild", - "version": "0.21.3", - "description": "An extremely fast JavaScript and CSS bundler and minifier.", - "repository": { - "type": "git", - "url": "git+https://github.com/evanw/esbuild.git" - }, - "scripts": { - "postinstall": "node install.js" - }, - "main": "lib/main.js", - "types": "lib/main.d.ts", - "engines": { - "node": ">=12" - }, - "bin": { - "esbuild": "bin/esbuild" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.21.3", - "@esbuild/android-arm": "0.21.3", - "@esbuild/android-arm64": "0.21.3", - "@esbuild/android-x64": "0.21.3", - "@esbuild/darwin-arm64": "0.21.3", - "@esbuild/darwin-x64": "0.21.3", - "@esbuild/freebsd-arm64": "0.21.3", - "@esbuild/freebsd-x64": "0.21.3", - "@esbuild/linux-arm": "0.21.3", - "@esbuild/linux-arm64": "0.21.3", - "@esbuild/linux-ia32": "0.21.3", - "@esbuild/linux-loong64": "0.21.3", - "@esbuild/linux-mips64el": "0.21.3", - "@esbuild/linux-ppc64": "0.21.3", - "@esbuild/linux-riscv64": "0.21.3", - "@esbuild/linux-s390x": "0.21.3", - "@esbuild/linux-x64": "0.21.3", - "@esbuild/netbsd-x64": "0.21.3", - "@esbuild/openbsd-x64": "0.21.3", - "@esbuild/sunos-x64": "0.21.3", - "@esbuild/win32-arm64": "0.21.3", - "@esbuild/win32-ia32": "0.21.3", - "@esbuild/win32-x64": "0.21.3" - }, - "license": "MIT" -} diff --git a/node_modules/url-join/LICENSE b/node_modules/url-join/LICENSE deleted file mode 100644 index 4c2ef04..0000000 --- a/node_modules/url-join/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2015 José F. Romaniello - -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. diff --git a/node_modules/url-join/README.md b/node_modules/url-join/README.md deleted file mode 100644 index b024446..0000000 --- a/node_modules/url-join/README.md +++ /dev/null @@ -1,29 +0,0 @@ -Join all arguments together and normalize the resulting URL. - -## Install - -```bash -npm install url-join -``` - -If you want to use it directly in a browser use a CDN like [Skypack](https://www.skypack.dev/view/url-join). - -## Usage - -```javascript -import urlJoin from 'url-join'; - -const fullUrl = urlJoin('http://www.google.com', 'a', '/b/cd', '?foo=123'); - -console.log(fullUrl); -``` - -Prints: - -``` -'http://www.google.com/a/b/cd?foo=123' -``` - -## License - -MIT diff --git a/node_modules/url-join/lib/url-join.d.ts b/node_modules/url-join/lib/url-join.d.ts deleted file mode 100644 index 317c2ba..0000000 --- a/node_modules/url-join/lib/url-join.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Join all arguments together and normalize the resulting url. - * This works similar to `path.join` but you shouldn't use `path.join` for urls since it works - * differently depending on the operating system and also doesn't work for some cases. - */ -declare function urlJoin(...parts: string[]): string; -declare function urlJoin(parts: string[]): string; - -export default urlJoin; diff --git a/node_modules/url-join/lib/url-join.js b/node_modules/url-join/lib/url-join.js deleted file mode 100644 index 37f1303..0000000 --- a/node_modules/url-join/lib/url-join.js +++ /dev/null @@ -1,70 +0,0 @@ -function normalize (strArray) { - var resultArray = []; - if (strArray.length === 0) { return ''; } - - if (typeof strArray[0] !== 'string') { - throw new TypeError('Url must be a string. Received ' + strArray[0]); - } - - // If the first part is a plain protocol, we combine it with the next part. - if (strArray[0].match(/^[^/:]+:\/*$/) && strArray.length > 1) { - var first = strArray.shift(); - strArray[0] = first + strArray[0]; - } - - // There must be two or three slashes in the file protocol, two slashes in anything else. - if (strArray[0].match(/^file:\/\/\//)) { - strArray[0] = strArray[0].replace(/^([^/:]+):\/*/, '$1:///'); - } else { - strArray[0] = strArray[0].replace(/^([^/:]+):\/*/, '$1://'); - } - - for (var i = 0; i < strArray.length; i++) { - var component = strArray[i]; - - if (typeof component !== 'string') { - throw new TypeError('Url must be a string. Received ' + component); - } - - if (component === '') { continue; } - - if (i > 0) { - // Removing the starting slashes for each component but the first. - component = component.replace(/^[\/]+/, ''); - } - if (i < strArray.length - 1) { - // Removing the ending slashes for each component but the last. - component = component.replace(/[\/]+$/, ''); - } else { - // For the last component we will combine multiple slashes to a single one. - component = component.replace(/[\/]+$/, '/'); - } - - resultArray.push(component); - - } - - var str = resultArray.join('/'); - // Each input component is now separated by a single slash except the possible first plain protocol part. - - // remove trailing slash before parameters or hash - str = str.replace(/\/(\?|&|#[^!])/g, '$1'); - - // replace ? in parameters with & - var parts = str.split('?'); - str = parts.shift() + (parts.length > 0 ? '?': '') + parts.join('&'); - - return str; -} - -export default function urlJoin() { - var input; - - if (typeof arguments[0] === 'object') { - input = arguments[0]; - } else { - input = [].slice.call(arguments); - } - - return normalize(input); -} diff --git a/node_modules/url-join/package.json b/node_modules/url-join/package.json deleted file mode 100644 index 56e3048..0000000 --- a/node_modules/url-join/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "url-join", - "version": "5.0.0", - "description": "Join urls and normalize as in path.join.", - "type": "module", - "main": "./lib/url-join.js", - "exports": "./lib/url-join.js", - "types": "./lib/url-join.d.ts", - "sideEffects": false, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "scripts": { - "test": "mocha --require should" - }, - "files": [ - "lib" - ], - "repository": { - "type": "git", - "url": "git://github.com/jfromaniello/url-join.git" - }, - "keywords": [ - "url", - "join" - ], - "author": "José F. Romaniello (http://joseoncode.com)", - "license": "MIT", - "devDependencies": { - "conventional-changelog": "^3.1.25", - "mocha": "^9.2.2", - "should": "~13.2.3" - } -} diff --git a/node_modules/url-template/LICENSE b/node_modules/url-template/LICENSE deleted file mode 100644 index cc868f4..0000000 --- a/node_modules/url-template/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ -BSD 3-Clause License - -Copyright (c) 2012-2014, Bram Stein - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/url-template/README.md b/node_modules/url-template/README.md deleted file mode 100644 index 84aa67a..0000000 --- a/node_modules/url-template/README.md +++ /dev/null @@ -1,33 +0,0 @@ -## A JavaScript URI template implementation - -This is a simple URI template implementation following the [RFC 6570 URI Template specification](http://tools.ietf.org/html/rfc6570). The implementation supports all levels defined in the specification and is extensively tested. - -## Installation - -For use with Node.js or build tools you can install it through npm: - -```sh -$ npm install url-template -``` - -If you want to use it directly in a browser use a CDN like [Skypack](https://www.skypack.dev/view/url-template). - -## Example - -```js -import { parseTemplate } from 'url-template'; - -const emailUrlTemplate = parseTemplate('/{email}/{folder}/{id}'); -const emailUrl = emailUrlTemplate.expand({ - email: 'user@domain', - folder: 'test', - id: 42 -}); - -console.log(emailUrl); -// Returns '/user@domain/test/42' -``` - -## A note on error handling and reporting - -The RFC states that errors in the templates could optionally be handled and reported to the user. This implementation takes a slightly different approach in that it tries to do a best effort template expansion and leaves erroneous expressions in the returned URI instead of throwing errors. So for example, the incorrect expression `{unclosed` will return `{unclosed` as output. The leaves incorrect URLs to be handled by your URL library of choice. diff --git a/node_modules/url-template/lib/url-template.d.ts b/node_modules/url-template/lib/url-template.d.ts deleted file mode 100644 index 8a9b227..0000000 --- a/node_modules/url-template/lib/url-template.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export type PrimitiveValue = string | number | boolean | null; - -export interface Template { - expand(context: Record>): string; -} - -export function parseTemplate(template: string): Template; diff --git a/node_modules/url-template/lib/url-template.js b/node_modules/url-template/lib/url-template.js deleted file mode 100644 index 92c234b..0000000 --- a/node_modules/url-template/lib/url-template.js +++ /dev/null @@ -1,135 +0,0 @@ -function encodeReserved(str) { - return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) { - if (!/%[0-9A-Fa-f]/.test(part)) { - part = encodeURI(part).replace(/%5B/g, '[').replace(/%5D/g, ']'); - } - return part; - }).join(''); -} - -function encodeUnreserved(str) { - return encodeURIComponent(str).replace(/[!'()*]/g, function (c) { - return '%' + c.charCodeAt(0).toString(16).toUpperCase(); - }); -} - -function encodeValue(operator, value, key) { - value = (operator === '+' || operator === '#') ? encodeReserved(value) : encodeUnreserved(value); - - if (key) { - return encodeUnreserved(key) + '=' + value; - } else { - return value; - } -} - -function isDefined(value) { - return value !== undefined && value !== null; -} - -function isKeyOperator(operator) { - return operator === ';' || operator === '&' || operator === '?'; -} - -function getValues(context, operator, key, modifier) { - var value = context[key], - result = []; - - if (isDefined(value) && value !== '') { - if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') { - value = value.toString(); - - if (modifier && modifier !== '*') { - value = value.substring(0, parseInt(modifier, 10)); - } - - result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : null)); - } else { - if (modifier === '*') { - if (Array.isArray(value)) { - value.filter(isDefined).forEach(function (value) { - result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : null)); - }); - } else { - Object.keys(value).forEach(function (k) { - if (isDefined(value[k])) { - result.push(encodeValue(operator, value[k], k)); - } - }); - } - } else { - var tmp = []; - - if (Array.isArray(value)) { - value.filter(isDefined).forEach(function (value) { - tmp.push(encodeValue(operator, value)); - }); - } else { - Object.keys(value).forEach(function (k) { - if (isDefined(value[k])) { - tmp.push(encodeUnreserved(k)); - tmp.push(encodeValue(operator, value[k].toString())); - } - }); - } - - if (isKeyOperator(operator)) { - result.push(encodeUnreserved(key) + '=' + tmp.join(',')); - } else if (tmp.length !== 0) { - result.push(tmp.join(',')); - } - } - } - } else { - if (operator === ';') { - if (isDefined(value)) { - result.push(encodeUnreserved(key)); - } - } else if (value === '' && (operator === '&' || operator === '?')) { - result.push(encodeUnreserved(key) + '='); - } else if (value === '') { - result.push(''); - } - } - return result; -} - -export function parseTemplate(template) { - var operators = ['+', '#', '.', '/', ';', '?', '&']; - - return { - expand: function (context) { - return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) { - if (expression) { - var operator = null, - values = []; - - if (operators.indexOf(expression.charAt(0)) !== -1) { - operator = expression.charAt(0); - expression = expression.substr(1); - } - - expression.split(/,/g).forEach(function (variable) { - var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable); - values.push.apply(values, getValues(context, operator, tmp[1], tmp[2] || tmp[3])); - }); - - if (operator && operator !== '+') { - var separator = ','; - - if (operator === '?') { - separator = '&'; - } else if (operator !== '#') { - separator = operator; - } - return (values.length !== 0 ? operator : '') + values.join(separator); - } else { - return values.join(','); - } - } else { - return encodeReserved(literal); - } - }); - } - }; -} diff --git a/node_modules/url-template/package.json b/node_modules/url-template/package.json deleted file mode 100644 index df60018..0000000 --- a/node_modules/url-template/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "url-template", - "version": "3.1.1", - "description": "A URI template implementation (RFC 6570 compliant)", - "author": "Bram Stein (https://www.bramstein.com)", - "keywords": [ - "uri-template", - "uri template", - "uri", - "url", - "rfc 6570", - "url template", - "url-template" - ], - "devDependencies": { - "chai": "^4.3.6", - "mocha": "^10.0.0" - }, - "license": "BSD-3-Clause", - "repository": { - "type": "git", - "url": "git://github.com/bramstein/url-template.git" - }, - "type": "module", - "main": "./lib/url-template.js", - "exports": "./lib/url-template.js", - "types": "./lib/url-template.d.ts", - "sideEffects": false, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "scripts": { - "test": "node --experimental-json-modules node_modules/mocha/bin/mocha --reporter spec" - }, - "files": [ - "lib" - ] -}