@greensecurity/javascript-sdk 0.15.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -19
- package/bin/mcp-server.js +834 -198
- package/bin/mcp-server.js.map +45 -32
- package/funcs/organizationsListOrSearchFacilities.d.ts +1 -1
- package/funcs/organizationsListOrSearchFacilities.d.ts.map +1 -1
- package/funcs/organizationsListOrSearchFacilities.js +2 -2
- package/funcs/organizationsListOrSearchFacilities.js.map +1 -1
- package/funcs/supportArticlesGetSupportArticle.d.ts +25 -0
- package/funcs/supportArticlesGetSupportArticle.d.ts.map +1 -0
- package/funcs/supportArticlesGetSupportArticle.js +132 -0
- package/funcs/supportArticlesGetSupportArticle.js.map +1 -0
- package/funcs/supportArticlesListOrSearchSupportArticles.d.ts +16 -0
- package/funcs/supportArticlesListOrSearchSupportArticles.d.ts.map +1 -0
- package/funcs/supportArticlesListOrSearchSupportArticles.js +118 -0
- package/funcs/supportArticlesListOrSearchSupportArticles.js.map +1 -0
- package/funcs/{userGetCurrentUser.d.ts → usersGetCurrentUser.d.ts} +2 -2
- package/funcs/usersGetCurrentUser.d.ts.map +1 -0
- package/funcs/{userGetCurrentUser.js → usersGetCurrentUser.js} +3 -3
- package/funcs/usersGetCurrentUser.js.map +1 -0
- package/funcs/{userGetUserById.d.ts → usersGetUserById.d.ts} +2 -2
- package/funcs/usersGetUserById.d.ts.map +1 -0
- package/funcs/{userGetUserById.js → usersGetUserById.js} +3 -3
- package/funcs/usersGetUserById.js.map +1 -0
- package/funcs/{userLogsUserIntoTheSystem.d.ts → usersLogsUserIntoTheSystem.d.ts} +2 -2
- package/funcs/usersLogsUserIntoTheSystem.d.ts.map +1 -0
- package/funcs/{userLogsUserIntoTheSystem.js → usersLogsUserIntoTheSystem.js} +3 -3
- package/funcs/usersLogsUserIntoTheSystem.js.map +1 -0
- package/funcs/{userMagiclink.d.ts → usersMagiclink.d.ts} +2 -2
- package/funcs/usersMagiclink.d.ts.map +1 -0
- package/funcs/{userMagiclink.js → usersMagiclink.js} +4 -4
- package/funcs/usersMagiclink.js.map +1 -0
- package/funcs/{userPassword.d.ts → usersPassword.d.ts} +2 -2
- package/funcs/usersPassword.d.ts.map +1 -0
- package/funcs/{userPassword.js → usersPassword.js} +4 -4
- package/funcs/usersPassword.js.map +1 -0
- package/funcs/{userPasswordResetRequest.d.ts → usersPasswordResetRequest.d.ts} +2 -2
- package/funcs/usersPasswordResetRequest.d.ts.map +1 -0
- package/funcs/{userPasswordResetRequest.js → usersPasswordResetRequest.js} +4 -4
- package/funcs/usersPasswordResetRequest.js.map +1 -0
- package/funcs/vendorsCreateVendorRegistration.d.ts +1 -1
- package/funcs/vendorsCreateVendorRegistration.d.ts.map +1 -1
- package/funcs/vendorsCreateVendorRegistration.js +2 -1
- package/funcs/vendorsCreateVendorRegistration.js.map +1 -1
- package/funcs/vendorsListVendorCredentials.d.ts +16 -0
- package/funcs/vendorsListVendorCredentials.d.ts.map +1 -0
- package/funcs/vendorsListVendorCredentials.js +124 -0
- package/funcs/vendorsListVendorCredentials.js.map +1 -0
- package/funcs/vendorsListVendorJobTitles.d.ts +1 -1
- package/funcs/vendorsListVendorJobTitles.d.ts.map +1 -1
- package/funcs/vendorsListVendorJobTitles.js +1 -1
- package/funcs/vendorsListVendorJobTitles.js.map +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.d.ts.map +1 -1
- package/mcp-server/server.js +19 -13
- package/mcp-server/server.js.map +1 -1
- package/mcp-server/tools/supportArticlesGetSupportArticle.d.ts +8 -0
- package/mcp-server/tools/supportArticlesGetSupportArticle.d.ts.map +1 -0
- package/mcp-server/tools/supportArticlesGetSupportArticle.js +71 -0
- package/mcp-server/tools/supportArticlesGetSupportArticle.js.map +1 -0
- package/mcp-server/tools/supportArticlesListOrSearchSupportArticles.d.ts +8 -0
- package/mcp-server/tools/supportArticlesListOrSearchSupportArticles.d.ts.map +1 -0
- package/mcp-server/tools/supportArticlesListOrSearchSupportArticles.js +64 -0
- package/mcp-server/tools/supportArticlesListOrSearchSupportArticles.js.map +1 -0
- package/mcp-server/tools/usersGetCurrentUser.d.ts +3 -0
- package/mcp-server/tools/usersGetCurrentUser.d.ts.map +1 -0
- package/mcp-server/tools/usersGetCurrentUser.js +26 -0
- package/mcp-server/tools/usersGetCurrentUser.js.map +1 -0
- package/mcp-server/tools/usersGetUserById.d.ts +8 -0
- package/mcp-server/tools/usersGetUserById.d.ts.map +1 -0
- package/mcp-server/tools/usersGetUserById.js +64 -0
- package/mcp-server/tools/usersGetUserById.js.map +1 -0
- package/mcp-server/tools/usersLogsUserIntoTheSystem.d.ts +8 -0
- package/mcp-server/tools/usersLogsUserIntoTheSystem.d.ts.map +1 -0
- package/mcp-server/tools/usersLogsUserIntoTheSystem.js +94 -0
- package/mcp-server/tools/usersLogsUserIntoTheSystem.js.map +1 -0
- package/mcp-server/tools/usersMagiclink.d.ts +8 -0
- package/mcp-server/tools/usersMagiclink.d.ts.map +1 -0
- package/mcp-server/tools/usersMagiclink.js +64 -0
- package/mcp-server/tools/usersMagiclink.js.map +1 -0
- package/mcp-server/tools/usersPassword.d.ts +8 -0
- package/mcp-server/tools/usersPassword.d.ts.map +1 -0
- package/mcp-server/tools/usersPassword.js +65 -0
- package/mcp-server/tools/usersPassword.js.map +1 -0
- package/mcp-server/tools/usersPasswordResetRequest.d.ts +8 -0
- package/mcp-server/tools/usersPasswordResetRequest.d.ts.map +1 -0
- package/mcp-server/tools/usersPasswordResetRequest.js +64 -0
- package/mcp-server/tools/usersPasswordResetRequest.js.map +1 -0
- package/mcp-server/tools/vendorsListVendorCredentials.d.ts +8 -0
- package/mcp-server/tools/vendorsListVendorCredentials.d.ts.map +1 -0
- package/mcp-server/tools/vendorsListVendorCredentials.js +64 -0
- package/mcp-server/tools/vendorsListVendorCredentials.js.map +1 -0
- package/models/components/{status.d.ts → activestatus.d.ts} +8 -8
- package/models/components/activestatus.d.ts.map +1 -0
- package/models/components/{status.js → activestatus.js} +12 -13
- package/models/components/activestatus.js.map +1 -0
- package/models/components/contact.d.ts +8 -8
- package/models/components/contact.d.ts.map +1 -1
- package/models/components/contact.js +14 -13
- package/models/components/contact.js.map +1 -1
- package/models/components/credentialstatus.d.ts +49 -0
- package/models/components/credentialstatus.d.ts.map +1 -0
- package/models/components/credentialstatus.js +68 -0
- package/models/components/credentialstatus.js.map +1 -0
- package/models/components/expand.d.ts +12 -0
- package/models/components/expand.d.ts.map +1 -1
- package/models/components/expand.js +4 -0
- package/models/components/expand.js.map +1 -1
- package/models/components/index.d.ts +5 -1
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +5 -1
- package/models/components/index.js.map +1 -1
- package/models/components/supportarticle.d.ts +43 -0
- package/models/components/supportarticle.d.ts.map +1 -0
- package/models/components/supportarticle.js +92 -0
- package/models/components/supportarticle.js.map +1 -0
- package/models/components/vendorcredentialslim.d.ts +44 -0
- package/models/components/vendorcredentialslim.d.ts.map +1 -0
- package/models/components/vendorcredentialslim.js +94 -0
- package/models/components/vendorcredentialslim.js.map +1 -0
- package/models/components/vendorrequiredcredential.d.ts +42 -0
- package/models/components/vendorrequiredcredential.d.ts.map +1 -0
- package/models/components/vendorrequiredcredential.js +96 -0
- package/models/components/vendorrequiredcredential.js.map +1 -0
- package/models/operations/createvendorregistration.d.ts +13 -13
- package/models/operations/createvendorregistration.d.ts.map +1 -1
- package/models/operations/createvendorregistration.js +18 -16
- package/models/operations/createvendorregistration.js.map +1 -1
- package/models/operations/getsupportarticle.d.ts +38 -0
- package/models/operations/getsupportarticle.d.ts.map +1 -0
- package/models/operations/getsupportarticle.js +72 -0
- package/models/operations/getsupportarticle.js.map +1 -0
- package/models/operations/index.d.ts +3 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +3 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/listorsearchfacilities.d.ts +15 -15
- package/models/operations/listorsearchfacilities.d.ts.map +1 -1
- package/models/operations/listorsearchfacilities.js +20 -18
- package/models/operations/listorsearchfacilities.js.map +1 -1
- package/models/operations/listorsearchsupportarticles.d.ts +81 -0
- package/models/operations/listorsearchsupportarticles.d.ts.map +1 -0
- package/models/operations/listorsearchsupportarticles.js +114 -0
- package/models/operations/listorsearchsupportarticles.js.map +1 -0
- package/models/operations/listvendorcredentials.d.ts +122 -0
- package/models/operations/listvendorcredentials.d.ts.map +1 -0
- package/models/operations/listvendorcredentials.js +169 -0
- package/models/operations/listvendorcredentials.js.map +1 -0
- package/models/operations/listvendorjobtitles.d.ts +13 -13
- package/models/operations/listvendorjobtitles.d.ts.map +1 -1
- package/models/operations/listvendorjobtitles.js +16 -16
- package/models/operations/listvendorjobtitles.js.map +1 -1
- package/models/operations/magiclink.d.ts +13 -13
- package/models/operations/magiclink.d.ts.map +1 -1
- package/models/operations/magiclink.js +16 -16
- package/models/operations/magiclink.js.map +1 -1
- package/models/operations/password.d.ts +13 -13
- package/models/operations/password.d.ts.map +1 -1
- package/models/operations/password.js +16 -16
- package/models/operations/password.js.map +1 -1
- package/models/operations/passwordresetrequest.d.ts +13 -13
- package/models/operations/passwordresetrequest.d.ts.map +1 -1
- package/models/operations/passwordresetrequest.js +16 -16
- package/models/operations/passwordresetrequest.js.map +1 -1
- package/package.json +1 -1
- package/react-query/index.d.ts +9 -6
- package/react-query/index.d.ts.map +1 -1
- package/react-query/index.js +9 -6
- package/react-query/index.js.map +1 -1
- package/react-query/organizationsListOrSearchFacilities.d.ts +4 -4
- package/react-query/organizationsListOrSearchFacilities.d.ts.map +1 -1
- package/react-query/organizationsListOrSearchFacilities.js +1 -1
- package/react-query/organizationsListOrSearchFacilities.js.map +1 -1
- package/react-query/supportArticlesGetSupportArticle.d.ts +57 -0
- package/react-query/supportArticlesGetSupportArticle.d.ts.map +1 -0
- package/react-query/supportArticlesGetSupportArticle.js +113 -0
- package/react-query/supportArticlesGetSupportArticle.js.map +1 -0
- package/react-query/supportArticlesListOrSearchSupportArticles.d.ts +50 -0
- package/react-query/supportArticlesListOrSearchSupportArticles.d.ts.map +1 -0
- package/react-query/supportArticlesListOrSearchSupportArticles.js +101 -0
- package/react-query/supportArticlesListOrSearchSupportArticles.js.map +1 -0
- package/react-query/usersGetCurrentUser.d.ts +29 -0
- package/react-query/usersGetCurrentUser.d.ts.map +1 -0
- package/react-query/usersGetCurrentUser.js +75 -0
- package/react-query/usersGetCurrentUser.js.map +1 -0
- package/react-query/usersGetUserById.d.ts +31 -0
- package/react-query/usersGetUserById.d.ts.map +1 -0
- package/react-query/usersGetUserById.js +87 -0
- package/react-query/usersGetUserById.js.map +1 -0
- package/react-query/{userLogsUserIntoTheSystem.d.ts → usersLogsUserIntoTheSystem.d.ts} +7 -7
- package/react-query/usersLogsUserIntoTheSystem.d.ts.map +1 -0
- package/react-query/{userLogsUserIntoTheSystem.js → usersLogsUserIntoTheSystem.js} +13 -13
- package/react-query/usersLogsUserIntoTheSystem.js.map +1 -0
- package/react-query/usersMagiclink.d.ts +23 -0
- package/react-query/usersMagiclink.d.ts.map +1 -0
- package/react-query/{userMagiclink.js → usersMagiclink.js} +13 -13
- package/react-query/usersMagiclink.js.map +1 -0
- package/react-query/usersPassword.d.ts +24 -0
- package/react-query/usersPassword.d.ts.map +1 -0
- package/react-query/{userPassword.js → usersPassword.js} +13 -13
- package/react-query/usersPassword.js.map +1 -0
- package/react-query/usersPasswordResetRequest.d.ts +23 -0
- package/react-query/usersPasswordResetRequest.d.ts.map +1 -0
- package/react-query/{userPasswordResetRequest.js → usersPasswordResetRequest.js} +13 -13
- package/react-query/usersPasswordResetRequest.js.map +1 -0
- package/react-query/vendorsCreateVendorRegistration.d.ts +1 -1
- package/react-query/vendorsCreateVendorRegistration.d.ts.map +1 -1
- package/react-query/vendorsListVendorCredentials.d.ts +55 -0
- package/react-query/vendorsListVendorCredentials.d.ts.map +1 -0
- package/react-query/vendorsListVendorCredentials.js +103 -0
- package/react-query/vendorsListVendorCredentials.js.map +1 -0
- package/react-query/vendorsListVendorJobTitles.d.ts +1 -1
- package/react-query/vendorsListVendorJobTitles.d.ts.map +1 -1
- package/sdk/organizations.d.ts +1 -1
- package/sdk/organizations.d.ts.map +1 -1
- package/sdk/sdk.d.ts +6 -3
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +7 -3
- package/sdk/sdk.js.map +1 -1
- package/sdk/supportarticles.d.ts +27 -0
- package/sdk/supportarticles.d.ts.map +1 -0
- package/sdk/supportarticles.js +39 -0
- package/sdk/supportarticles.js.map +1 -0
- package/sdk/{user.d.ts → users.d.ts} +5 -5
- package/sdk/users.d.ts.map +1 -0
- package/sdk/{user.js → users.js} +16 -16
- package/sdk/users.js.map +1 -0
- package/sdk/vendors.d.ts +9 -2
- package/sdk/vendors.d.ts.map +1 -1
- package/sdk/vendors.js +10 -0
- package/sdk/vendors.js.map +1 -1
- package/src/__tests__/organizations.test.ts +5 -175
- package/src/__tests__/supportarticles.test.ts +63 -0
- package/src/__tests__/user.test.ts +13 -7
- package/src/__tests__/vendors.test.ts +7 -1
- package/src/funcs/organizationsListOrSearchFacilities.ts +8 -5
- package/src/funcs/supportArticlesGetSupportArticle.ts +181 -0
- package/src/funcs/supportArticlesListOrSearchSupportArticles.ts +165 -0
- package/src/funcs/{userGetCurrentUser.ts → usersGetCurrentUser.ts} +1 -1
- package/src/funcs/{userGetUserById.ts → usersGetUserById.ts} +1 -1
- package/src/funcs/{userLogsUserIntoTheSystem.ts → usersLogsUserIntoTheSystem.ts} +1 -1
- package/src/funcs/{userMagiclink.ts → usersMagiclink.ts} +5 -5
- package/src/funcs/{userPassword.ts → usersPassword.ts} +5 -5
- package/src/funcs/{userPasswordResetRequest.ts → usersPasswordResetRequest.ts} +8 -5
- package/src/funcs/vendorsCreateVendorRegistration.ts +8 -4
- package/src/funcs/vendorsListVendorCredentials.ts +169 -0
- package/src/funcs/vendorsListVendorJobTitles.ts +7 -4
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +19 -13
- package/src/mcp-server/tools/supportArticlesGetSupportArticle.ts +46 -0
- package/src/mcp-server/tools/supportArticlesListOrSearchSupportArticles.ts +39 -0
- package/src/mcp-server/tools/{userGetCurrentUser.ts → usersGetCurrentUser.ts} +4 -4
- package/src/mcp-server/tools/{userGetUserById.ts → usersGetUserById.ts} +4 -4
- package/src/mcp-server/tools/{userLogsUserIntoTheSystem.ts → usersLogsUserIntoTheSystem.ts} +4 -4
- package/src/mcp-server/tools/{userMagiclink.ts → usersMagiclink.ts} +4 -4
- package/src/mcp-server/tools/{userPassword.ts → usersPassword.ts} +4 -4
- package/src/mcp-server/tools/{userPasswordResetRequest.ts → usersPasswordResetRequest.ts} +4 -4
- package/src/mcp-server/tools/vendorsListVendorCredentials.ts +37 -0
- package/src/models/components/activestatus.ts +38 -0
- package/src/models/components/contact.ts +14 -16
- package/src/models/components/credentialstatus.ts +44 -0
- package/src/models/components/expand.ts +4 -0
- package/src/models/components/index.ts +5 -1
- package/src/models/components/supportarticle.ts +99 -0
- package/src/models/components/vendorcredentialslim.ts +106 -0
- package/src/models/components/vendorrequiredcredential.ts +106 -0
- package/src/models/operations/createvendorregistration.ts +39 -32
- package/src/models/operations/getsupportarticle.ts +77 -0
- package/src/models/operations/index.ts +3 -0
- package/src/models/operations/listorsearchfacilities.ts +49 -37
- package/src/models/operations/listorsearchsupportarticles.ts +186 -0
- package/src/models/operations/listvendorcredentials.ts +281 -0
- package/src/models/operations/listvendorjobtitles.ts +31 -22
- package/src/models/operations/magiclink.ts +21 -21
- package/src/models/operations/password.ts +21 -21
- package/src/models/operations/passwordresetrequest.ts +39 -31
- package/src/react-query/index.ts +9 -6
- package/src/react-query/organizationsListOrSearchFacilities.ts +5 -5
- package/src/react-query/supportArticlesGetSupportArticle.ts +192 -0
- package/src/react-query/supportArticlesListOrSearchSupportArticles.ts +201 -0
- package/src/react-query/{userGetCurrentUser.ts → usersGetCurrentUser.ts} +27 -27
- package/src/react-query/{userGetUserById.ts → usersGetUserById.ts} +31 -29
- package/src/react-query/{userLogsUserIntoTheSystem.ts → usersLogsUserIntoTheSystem.ts} +18 -18
- package/src/react-query/{userMagiclink.ts → usersMagiclink.ts} +18 -18
- package/src/react-query/{userPassword.ts → usersPassword.ts} +18 -18
- package/src/react-query/{userPasswordResetRequest.ts → usersPasswordResetRequest.ts} +19 -19
- package/src/react-query/vendorsCreateVendorRegistration.ts +1 -1
- package/src/react-query/vendorsListVendorCredentials.ts +200 -0
- package/src/react-query/vendorsListVendorJobTitles.ts +1 -1
- package/src/sdk/organizations.ts +1 -1
- package/src/sdk/sdk.ts +10 -4
- package/src/sdk/supportarticles.ts +53 -0
- package/src/sdk/{user.ts → users.ts} +16 -16
- package/src/sdk/vendors.ts +22 -2
- package/funcs/userGetCurrentUser.d.ts.map +0 -1
- package/funcs/userGetCurrentUser.js.map +0 -1
- package/funcs/userGetUserById.d.ts.map +0 -1
- package/funcs/userGetUserById.js.map +0 -1
- package/funcs/userLogsUserIntoTheSystem.d.ts.map +0 -1
- package/funcs/userLogsUserIntoTheSystem.js.map +0 -1
- package/funcs/userMagiclink.d.ts.map +0 -1
- package/funcs/userMagiclink.js.map +0 -1
- package/funcs/userPassword.d.ts.map +0 -1
- package/funcs/userPassword.js.map +0 -1
- package/funcs/userPasswordResetRequest.d.ts.map +0 -1
- package/funcs/userPasswordResetRequest.js.map +0 -1
- package/models/components/status.d.ts.map +0 -1
- package/models/components/status.js.map +0 -1
- package/react-query/userGetCurrentUser.d.ts +0 -29
- package/react-query/userGetCurrentUser.d.ts.map +0 -1
- package/react-query/userGetCurrentUser.js +0 -75
- package/react-query/userGetCurrentUser.js.map +0 -1
- package/react-query/userGetUserById.d.ts +0 -31
- package/react-query/userGetUserById.d.ts.map +0 -1
- package/react-query/userGetUserById.js +0 -87
- package/react-query/userGetUserById.js.map +0 -1
- package/react-query/userLogsUserIntoTheSystem.d.ts.map +0 -1
- package/react-query/userLogsUserIntoTheSystem.js.map +0 -1
- package/react-query/userMagiclink.d.ts +0 -23
- package/react-query/userMagiclink.d.ts.map +0 -1
- package/react-query/userMagiclink.js.map +0 -1
- package/react-query/userPassword.d.ts +0 -24
- package/react-query/userPassword.d.ts.map +0 -1
- package/react-query/userPassword.js.map +0 -1
- package/react-query/userPasswordResetRequest.d.ts +0 -23
- package/react-query/userPasswordResetRequest.d.ts.map +0 -1
- package/react-query/userPasswordResetRequest.js.map +0 -1
- package/sdk/user.d.ts.map +0 -1
- package/sdk/user.js.map +0 -1
- package/src/models/components/status.ts +0 -38
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
InvalidateQueryFilters,
|
|
7
|
+
QueryClient,
|
|
8
|
+
QueryFunctionContext,
|
|
9
|
+
QueryKey,
|
|
10
|
+
useQuery,
|
|
11
|
+
UseQueryResult,
|
|
12
|
+
useSuspenseQuery,
|
|
13
|
+
UseSuspenseQueryResult,
|
|
14
|
+
} from "@tanstack/react-query";
|
|
15
|
+
import { GreenSecurityCore } from "../core.js";
|
|
16
|
+
import { supportArticlesListOrSearchSupportArticles } from "../funcs/supportArticlesListOrSearchSupportArticles.js";
|
|
17
|
+
import { combineSignals } from "../lib/primitives.js";
|
|
18
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
19
|
+
import * as components from "../models/components/index.js";
|
|
20
|
+
import * as operations from "../models/operations/index.js";
|
|
21
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
22
|
+
import { useGreenSecurityContext } from "./_context.js";
|
|
23
|
+
import {
|
|
24
|
+
QueryHookOptions,
|
|
25
|
+
SuspenseQueryHookOptions,
|
|
26
|
+
TupleToPrefixes,
|
|
27
|
+
} from "./_types.js";
|
|
28
|
+
|
|
29
|
+
export type SupportArticlesListOrSearchSupportArticlesQueryData =
|
|
30
|
+
operations.ListOrSearchSupportArticlesListOrSearchArticlesOk;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* List or search support articles
|
|
34
|
+
*
|
|
35
|
+
* @remarks
|
|
36
|
+
* List or search support articles for FAQ.
|
|
37
|
+
*/
|
|
38
|
+
export function useSupportArticlesListOrSearchSupportArticles(
|
|
39
|
+
request: operations.ListOrSearchSupportArticlesRequest,
|
|
40
|
+
options?: QueryHookOptions<
|
|
41
|
+
SupportArticlesListOrSearchSupportArticlesQueryData
|
|
42
|
+
>,
|
|
43
|
+
): UseQueryResult<SupportArticlesListOrSearchSupportArticlesQueryData, Error> {
|
|
44
|
+
const client = useGreenSecurityContext();
|
|
45
|
+
return useQuery({
|
|
46
|
+
...buildSupportArticlesListOrSearchSupportArticlesQuery(
|
|
47
|
+
client,
|
|
48
|
+
request,
|
|
49
|
+
options,
|
|
50
|
+
),
|
|
51
|
+
...options,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* List or search support articles
|
|
57
|
+
*
|
|
58
|
+
* @remarks
|
|
59
|
+
* List or search support articles for FAQ.
|
|
60
|
+
*/
|
|
61
|
+
export function useSupportArticlesListOrSearchSupportArticlesSuspense(
|
|
62
|
+
request: operations.ListOrSearchSupportArticlesRequest,
|
|
63
|
+
options?: SuspenseQueryHookOptions<
|
|
64
|
+
SupportArticlesListOrSearchSupportArticlesQueryData
|
|
65
|
+
>,
|
|
66
|
+
): UseSuspenseQueryResult<
|
|
67
|
+
SupportArticlesListOrSearchSupportArticlesQueryData,
|
|
68
|
+
Error
|
|
69
|
+
> {
|
|
70
|
+
const client = useGreenSecurityContext();
|
|
71
|
+
return useSuspenseQuery({
|
|
72
|
+
...buildSupportArticlesListOrSearchSupportArticlesQuery(
|
|
73
|
+
client,
|
|
74
|
+
request,
|
|
75
|
+
options,
|
|
76
|
+
),
|
|
77
|
+
...options,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function prefetchSupportArticlesListOrSearchSupportArticles(
|
|
82
|
+
queryClient: QueryClient,
|
|
83
|
+
client$: GreenSecurityCore,
|
|
84
|
+
request: operations.ListOrSearchSupportArticlesRequest,
|
|
85
|
+
): Promise<void> {
|
|
86
|
+
return queryClient.prefetchQuery({
|
|
87
|
+
...buildSupportArticlesListOrSearchSupportArticlesQuery(
|
|
88
|
+
client$,
|
|
89
|
+
request,
|
|
90
|
+
),
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export function setSupportArticlesListOrSearchSupportArticlesData(
|
|
95
|
+
client: QueryClient,
|
|
96
|
+
queryKeyBase: [
|
|
97
|
+
parameters: {
|
|
98
|
+
sort?: string | null | undefined;
|
|
99
|
+
desc?: components.Desc | undefined;
|
|
100
|
+
page?: number | undefined;
|
|
101
|
+
itemsPerPage?: number | undefined;
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
data: SupportArticlesListOrSearchSupportArticlesQueryData,
|
|
105
|
+
): SupportArticlesListOrSearchSupportArticlesQueryData | undefined {
|
|
106
|
+
const key = queryKeySupportArticlesListOrSearchSupportArticles(
|
|
107
|
+
...queryKeyBase,
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
return client.setQueryData<
|
|
111
|
+
SupportArticlesListOrSearchSupportArticlesQueryData
|
|
112
|
+
>(key, data);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export function invalidateSupportArticlesListOrSearchSupportArticles(
|
|
116
|
+
client: QueryClient,
|
|
117
|
+
queryKeyBase: TupleToPrefixes<
|
|
118
|
+
[parameters: {
|
|
119
|
+
sort?: string | null | undefined;
|
|
120
|
+
desc?: components.Desc | undefined;
|
|
121
|
+
page?: number | undefined;
|
|
122
|
+
itemsPerPage?: number | undefined;
|
|
123
|
+
}]
|
|
124
|
+
>,
|
|
125
|
+
filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
|
|
126
|
+
): Promise<void> {
|
|
127
|
+
return client.invalidateQueries({
|
|
128
|
+
...filters,
|
|
129
|
+
queryKey: [
|
|
130
|
+
"@greensecurity/javascript-sdk",
|
|
131
|
+
"support_articles",
|
|
132
|
+
"listOrSearchSupportArticles",
|
|
133
|
+
...queryKeyBase,
|
|
134
|
+
],
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export function invalidateAllSupportArticlesListOrSearchSupportArticles(
|
|
139
|
+
client: QueryClient,
|
|
140
|
+
filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
|
|
141
|
+
): Promise<void> {
|
|
142
|
+
return client.invalidateQueries({
|
|
143
|
+
...filters,
|
|
144
|
+
queryKey: [
|
|
145
|
+
"@greensecurity/javascript-sdk",
|
|
146
|
+
"support_articles",
|
|
147
|
+
"listOrSearchSupportArticles",
|
|
148
|
+
],
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export function buildSupportArticlesListOrSearchSupportArticlesQuery(
|
|
153
|
+
client$: GreenSecurityCore,
|
|
154
|
+
request: operations.ListOrSearchSupportArticlesRequest,
|
|
155
|
+
options?: RequestOptions,
|
|
156
|
+
): {
|
|
157
|
+
queryKey: QueryKey;
|
|
158
|
+
queryFn: (
|
|
159
|
+
context: QueryFunctionContext,
|
|
160
|
+
) => Promise<SupportArticlesListOrSearchSupportArticlesQueryData>;
|
|
161
|
+
} {
|
|
162
|
+
return {
|
|
163
|
+
queryKey: queryKeySupportArticlesListOrSearchSupportArticles({
|
|
164
|
+
sort: request.sort,
|
|
165
|
+
desc: request.desc,
|
|
166
|
+
page: request.page,
|
|
167
|
+
itemsPerPage: request.itemsPerPage,
|
|
168
|
+
}),
|
|
169
|
+
queryFn: async function supportArticlesListOrSearchSupportArticlesQueryFn(
|
|
170
|
+
ctx,
|
|
171
|
+
): Promise<SupportArticlesListOrSearchSupportArticlesQueryData> {
|
|
172
|
+
const sig = combineSignals(ctx.signal, options?.fetchOptions?.signal);
|
|
173
|
+
const mergedOptions = {
|
|
174
|
+
...options,
|
|
175
|
+
fetchOptions: { ...options?.fetchOptions, signal: sig },
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
return unwrapAsync(supportArticlesListOrSearchSupportArticles(
|
|
179
|
+
client$,
|
|
180
|
+
request,
|
|
181
|
+
mergedOptions,
|
|
182
|
+
));
|
|
183
|
+
},
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export function queryKeySupportArticlesListOrSearchSupportArticles(
|
|
188
|
+
parameters: {
|
|
189
|
+
sort?: string | null | undefined;
|
|
190
|
+
desc?: components.Desc | undefined;
|
|
191
|
+
page?: number | undefined;
|
|
192
|
+
itemsPerPage?: number | undefined;
|
|
193
|
+
},
|
|
194
|
+
): QueryKey {
|
|
195
|
+
return [
|
|
196
|
+
"@greensecurity/javascript-sdk",
|
|
197
|
+
"support_articles",
|
|
198
|
+
"listOrSearchSupportArticles",
|
|
199
|
+
parameters,
|
|
200
|
+
];
|
|
201
|
+
}
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
UseSuspenseQueryResult,
|
|
14
14
|
} from "@tanstack/react-query";
|
|
15
15
|
import { GreenSecurityCore } from "../core.js";
|
|
16
|
-
import {
|
|
16
|
+
import { usersGetCurrentUser } from "../funcs/usersGetCurrentUser.js";
|
|
17
17
|
import { combineSignals } from "../lib/primitives.js";
|
|
18
18
|
import { RequestOptions } from "../lib/sdks.js";
|
|
19
19
|
import * as components from "../models/components/index.js";
|
|
@@ -21,7 +21,7 @@ import { unwrapAsync } from "../types/fp.js";
|
|
|
21
21
|
import { useGreenSecurityContext } from "./_context.js";
|
|
22
22
|
import { QueryHookOptions, SuspenseQueryHookOptions } from "./_types.js";
|
|
23
23
|
|
|
24
|
-
export type
|
|
24
|
+
export type UsersGetCurrentUserQueryData = components.User;
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* Get current user
|
|
@@ -29,12 +29,12 @@ export type UserGetCurrentUserQueryData = components.User;
|
|
|
29
29
|
* @remarks
|
|
30
30
|
* Returns a user object for the user represented by the authorization token
|
|
31
31
|
*/
|
|
32
|
-
export function
|
|
33
|
-
options?: QueryHookOptions<
|
|
34
|
-
): UseQueryResult<
|
|
32
|
+
export function useUsersGetCurrentUser(
|
|
33
|
+
options?: QueryHookOptions<UsersGetCurrentUserQueryData>,
|
|
34
|
+
): UseQueryResult<UsersGetCurrentUserQueryData, Error> {
|
|
35
35
|
const client = useGreenSecurityContext();
|
|
36
36
|
return useQuery({
|
|
37
|
-
...
|
|
37
|
+
...buildUsersGetCurrentUserQuery(
|
|
38
38
|
client,
|
|
39
39
|
options,
|
|
40
40
|
),
|
|
@@ -48,12 +48,12 @@ export function useUserGetCurrentUser(
|
|
|
48
48
|
* @remarks
|
|
49
49
|
* Returns a user object for the user represented by the authorization token
|
|
50
50
|
*/
|
|
51
|
-
export function
|
|
52
|
-
options?: SuspenseQueryHookOptions<
|
|
53
|
-
): UseSuspenseQueryResult<
|
|
51
|
+
export function useUsersGetCurrentUserSuspense(
|
|
52
|
+
options?: SuspenseQueryHookOptions<UsersGetCurrentUserQueryData>,
|
|
53
|
+
): UseSuspenseQueryResult<UsersGetCurrentUserQueryData, Error> {
|
|
54
54
|
const client = useGreenSecurityContext();
|
|
55
55
|
return useSuspenseQuery({
|
|
56
|
-
...
|
|
56
|
+
...buildUsersGetCurrentUserQuery(
|
|
57
57
|
client,
|
|
58
58
|
options,
|
|
59
59
|
),
|
|
@@ -61,57 +61,57 @@ export function useUserGetCurrentUserSuspense(
|
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
export function
|
|
64
|
+
export function prefetchUsersGetCurrentUser(
|
|
65
65
|
queryClient: QueryClient,
|
|
66
66
|
client$: GreenSecurityCore,
|
|
67
67
|
): Promise<void> {
|
|
68
68
|
return queryClient.prefetchQuery({
|
|
69
|
-
...
|
|
69
|
+
...buildUsersGetCurrentUserQuery(
|
|
70
70
|
client$,
|
|
71
71
|
),
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
export function
|
|
75
|
+
export function setUsersGetCurrentUserData(
|
|
76
76
|
client: QueryClient,
|
|
77
|
-
data:
|
|
78
|
-
):
|
|
79
|
-
const key =
|
|
77
|
+
data: UsersGetCurrentUserQueryData,
|
|
78
|
+
): UsersGetCurrentUserQueryData | undefined {
|
|
79
|
+
const key = queryKeyUsersGetCurrentUser();
|
|
80
80
|
|
|
81
|
-
return client.setQueryData<
|
|
81
|
+
return client.setQueryData<UsersGetCurrentUserQueryData>(key, data);
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
export function
|
|
84
|
+
export function invalidateAllUsersGetCurrentUser(
|
|
85
85
|
client: QueryClient,
|
|
86
86
|
filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
|
|
87
87
|
): Promise<void> {
|
|
88
88
|
return client.invalidateQueries({
|
|
89
89
|
...filters,
|
|
90
|
-
queryKey: ["@greensecurity/javascript-sdk", "
|
|
90
|
+
queryKey: ["@greensecurity/javascript-sdk", "users", "getCurrentUser"],
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
export function
|
|
94
|
+
export function buildUsersGetCurrentUserQuery(
|
|
95
95
|
client$: GreenSecurityCore,
|
|
96
96
|
options?: RequestOptions,
|
|
97
97
|
): {
|
|
98
98
|
queryKey: QueryKey;
|
|
99
99
|
queryFn: (
|
|
100
100
|
context: QueryFunctionContext,
|
|
101
|
-
) => Promise<
|
|
101
|
+
) => Promise<UsersGetCurrentUserQueryData>;
|
|
102
102
|
} {
|
|
103
103
|
return {
|
|
104
|
-
queryKey:
|
|
105
|
-
queryFn: async function
|
|
104
|
+
queryKey: queryKeyUsersGetCurrentUser(),
|
|
105
|
+
queryFn: async function usersGetCurrentUserQueryFn(
|
|
106
106
|
ctx,
|
|
107
|
-
): Promise<
|
|
107
|
+
): Promise<UsersGetCurrentUserQueryData> {
|
|
108
108
|
const sig = combineSignals(ctx.signal, options?.fetchOptions?.signal);
|
|
109
109
|
const mergedOptions = {
|
|
110
110
|
...options,
|
|
111
111
|
fetchOptions: { ...options?.fetchOptions, signal: sig },
|
|
112
112
|
};
|
|
113
113
|
|
|
114
|
-
return unwrapAsync(
|
|
114
|
+
return unwrapAsync(usersGetCurrentUser(
|
|
115
115
|
client$,
|
|
116
116
|
mergedOptions,
|
|
117
117
|
));
|
|
@@ -119,6 +119,6 @@ export function buildUserGetCurrentUserQuery(
|
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
export function
|
|
123
|
-
return ["@greensecurity/javascript-sdk", "
|
|
122
|
+
export function queryKeyUsersGetCurrentUser(): QueryKey {
|
|
123
|
+
return ["@greensecurity/javascript-sdk", "users", "getCurrentUser"];
|
|
124
124
|
}
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
UseSuspenseQueryResult,
|
|
14
14
|
} from "@tanstack/react-query";
|
|
15
15
|
import { GreenSecurityCore } from "../core.js";
|
|
16
|
-
import {
|
|
16
|
+
import { usersGetUserById } from "../funcs/usersGetUserById.js";
|
|
17
17
|
import { combineSignals } from "../lib/primitives.js";
|
|
18
18
|
import { RequestOptions } from "../lib/sdks.js";
|
|
19
19
|
import * as components from "../models/components/index.js";
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
TupleToPrefixes,
|
|
27
27
|
} from "./_types.js";
|
|
28
28
|
|
|
29
|
-
export type
|
|
29
|
+
export type UsersGetUserByIdQueryData = components.User;
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* Get user by id
|
|
@@ -34,13 +34,13 @@ export type UserGetUserByIdQueryData = components.User;
|
|
|
34
34
|
* @remarks
|
|
35
35
|
* Returns a user object for the user represented by the identifier in the path.
|
|
36
36
|
*/
|
|
37
|
-
export function
|
|
37
|
+
export function useUsersGetUserById(
|
|
38
38
|
request: operations.GetUserByIdRequest,
|
|
39
|
-
options?: QueryHookOptions<
|
|
40
|
-
): UseQueryResult<
|
|
39
|
+
options?: QueryHookOptions<UsersGetUserByIdQueryData>,
|
|
40
|
+
): UseQueryResult<UsersGetUserByIdQueryData, Error> {
|
|
41
41
|
const client = useGreenSecurityContext();
|
|
42
42
|
return useQuery({
|
|
43
|
-
...
|
|
43
|
+
...buildUsersGetUserByIdQuery(
|
|
44
44
|
client,
|
|
45
45
|
request,
|
|
46
46
|
options,
|
|
@@ -55,13 +55,13 @@ export function useUserGetUserById(
|
|
|
55
55
|
* @remarks
|
|
56
56
|
* Returns a user object for the user represented by the identifier in the path.
|
|
57
57
|
*/
|
|
58
|
-
export function
|
|
58
|
+
export function useUsersGetUserByIdSuspense(
|
|
59
59
|
request: operations.GetUserByIdRequest,
|
|
60
|
-
options?: SuspenseQueryHookOptions<
|
|
61
|
-
): UseSuspenseQueryResult<
|
|
60
|
+
options?: SuspenseQueryHookOptions<UsersGetUserByIdQueryData>,
|
|
61
|
+
): UseSuspenseQueryResult<UsersGetUserByIdQueryData, Error> {
|
|
62
62
|
const client = useGreenSecurityContext();
|
|
63
63
|
return useSuspenseQuery({
|
|
64
|
-
...
|
|
64
|
+
...buildUsersGetUserByIdQuery(
|
|
65
65
|
client,
|
|
66
66
|
request,
|
|
67
67
|
options,
|
|
@@ -70,30 +70,30 @@ export function useUserGetUserByIdSuspense(
|
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
export function
|
|
73
|
+
export function prefetchUsersGetUserById(
|
|
74
74
|
queryClient: QueryClient,
|
|
75
75
|
client$: GreenSecurityCore,
|
|
76
76
|
request: operations.GetUserByIdRequest,
|
|
77
77
|
): Promise<void> {
|
|
78
78
|
return queryClient.prefetchQuery({
|
|
79
|
-
...
|
|
79
|
+
...buildUsersGetUserByIdQuery(
|
|
80
80
|
client$,
|
|
81
81
|
request,
|
|
82
82
|
),
|
|
83
83
|
});
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
export function
|
|
86
|
+
export function setUsersGetUserByIdData(
|
|
87
87
|
client: QueryClient,
|
|
88
88
|
queryKeyBase: [id: number],
|
|
89
|
-
data:
|
|
90
|
-
):
|
|
91
|
-
const key =
|
|
89
|
+
data: UsersGetUserByIdQueryData,
|
|
90
|
+
): UsersGetUserByIdQueryData | undefined {
|
|
91
|
+
const key = queryKeyUsersGetUserById(...queryKeyBase);
|
|
92
92
|
|
|
93
|
-
return client.setQueryData<
|
|
93
|
+
return client.setQueryData<UsersGetUserByIdQueryData>(key, data);
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
export function
|
|
96
|
+
export function invalidateUsersGetUserById(
|
|
97
97
|
client: QueryClient,
|
|
98
98
|
queryKeyBase: TupleToPrefixes<[id: number]>,
|
|
99
99
|
filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
|
|
@@ -102,43 +102,45 @@ export function invalidateUserGetUserById(
|
|
|
102
102
|
...filters,
|
|
103
103
|
queryKey: [
|
|
104
104
|
"@greensecurity/javascript-sdk",
|
|
105
|
-
"
|
|
105
|
+
"users",
|
|
106
106
|
"getUserById",
|
|
107
107
|
...queryKeyBase,
|
|
108
108
|
],
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
export function
|
|
112
|
+
export function invalidateAllUsersGetUserById(
|
|
113
113
|
client: QueryClient,
|
|
114
114
|
filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
|
|
115
115
|
): Promise<void> {
|
|
116
116
|
return client.invalidateQueries({
|
|
117
117
|
...filters,
|
|
118
|
-
queryKey: ["@greensecurity/javascript-sdk", "
|
|
118
|
+
queryKey: ["@greensecurity/javascript-sdk", "users", "getUserById"],
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
export function
|
|
122
|
+
export function buildUsersGetUserByIdQuery(
|
|
123
123
|
client$: GreenSecurityCore,
|
|
124
124
|
request: operations.GetUserByIdRequest,
|
|
125
125
|
options?: RequestOptions,
|
|
126
126
|
): {
|
|
127
127
|
queryKey: QueryKey;
|
|
128
|
-
queryFn: (
|
|
128
|
+
queryFn: (
|
|
129
|
+
context: QueryFunctionContext,
|
|
130
|
+
) => Promise<UsersGetUserByIdQueryData>;
|
|
129
131
|
} {
|
|
130
132
|
return {
|
|
131
|
-
queryKey:
|
|
132
|
-
queryFn: async function
|
|
133
|
+
queryKey: queryKeyUsersGetUserById(request.id),
|
|
134
|
+
queryFn: async function usersGetUserByIdQueryFn(
|
|
133
135
|
ctx,
|
|
134
|
-
): Promise<
|
|
136
|
+
): Promise<UsersGetUserByIdQueryData> {
|
|
135
137
|
const sig = combineSignals(ctx.signal, options?.fetchOptions?.signal);
|
|
136
138
|
const mergedOptions = {
|
|
137
139
|
...options,
|
|
138
140
|
fetchOptions: { ...options?.fetchOptions, signal: sig },
|
|
139
141
|
};
|
|
140
142
|
|
|
141
|
-
return unwrapAsync(
|
|
143
|
+
return unwrapAsync(usersGetUserById(
|
|
142
144
|
client$,
|
|
143
145
|
request,
|
|
144
146
|
mergedOptions,
|
|
@@ -147,6 +149,6 @@ export function buildUserGetUserByIdQuery(
|
|
|
147
149
|
};
|
|
148
150
|
}
|
|
149
151
|
|
|
150
|
-
export function
|
|
151
|
-
return ["@greensecurity/javascript-sdk", "
|
|
152
|
+
export function queryKeyUsersGetUserById(id: number): QueryKey {
|
|
153
|
+
return ["@greensecurity/javascript-sdk", "users", "getUserById", id];
|
|
152
154
|
}
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
UseMutationResult,
|
|
9
9
|
} from "@tanstack/react-query";
|
|
10
10
|
import { GreenSecurityCore } from "../core.js";
|
|
11
|
-
import {
|
|
11
|
+
import { usersLogsUserIntoTheSystem } from "../funcs/usersLogsUserIntoTheSystem.js";
|
|
12
12
|
import { combineSignals } from "../lib/primitives.js";
|
|
13
13
|
import { RequestOptions } from "../lib/sdks.js";
|
|
14
14
|
import * as operations from "../models/operations/index.js";
|
|
@@ -16,12 +16,12 @@ import { unwrapAsync } from "../types/fp.js";
|
|
|
16
16
|
import { useGreenSecurityContext } from "./_context.js";
|
|
17
17
|
import { MutationHookOptions } from "./_types.js";
|
|
18
18
|
|
|
19
|
-
export type
|
|
19
|
+
export type UsersLogsUserIntoTheSystemMutationVariables = {
|
|
20
20
|
request: operations.LogsUserIntoTheSystemRequestBody;
|
|
21
21
|
options?: RequestOptions;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
export type
|
|
24
|
+
export type UsersLogsUserIntoTheSystemMutationData =
|
|
25
25
|
operations.LogsUserIntoTheSystemResponse;
|
|
26
26
|
|
|
27
27
|
/**
|
|
@@ -60,43 +60,43 @@ export type UserLogsUserIntoTheSystemMutationData =
|
|
|
60
60
|
* 4. The `user_token` will be appended as a query string parameter to your `return_url` - you must parse this token and store it
|
|
61
61
|
* 5. Fetch the user object from `/users/me` using the token
|
|
62
62
|
*/
|
|
63
|
-
export function
|
|
63
|
+
export function useUsersLogsUserIntoTheSystemMutation(
|
|
64
64
|
options?: MutationHookOptions<
|
|
65
|
-
|
|
65
|
+
UsersLogsUserIntoTheSystemMutationData,
|
|
66
66
|
Error,
|
|
67
|
-
|
|
67
|
+
UsersLogsUserIntoTheSystemMutationVariables
|
|
68
68
|
>,
|
|
69
69
|
): UseMutationResult<
|
|
70
|
-
|
|
70
|
+
UsersLogsUserIntoTheSystemMutationData,
|
|
71
71
|
Error,
|
|
72
|
-
|
|
72
|
+
UsersLogsUserIntoTheSystemMutationVariables
|
|
73
73
|
> {
|
|
74
74
|
const client = useGreenSecurityContext();
|
|
75
75
|
return useMutation({
|
|
76
|
-
...
|
|
76
|
+
...buildUsersLogsUserIntoTheSystemMutation(client, options),
|
|
77
77
|
...options,
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
export function
|
|
82
|
-
return ["@greensecurity/javascript-sdk", "
|
|
81
|
+
export function mutationKeyUsersLogsUserIntoTheSystem(): MutationKey {
|
|
82
|
+
return ["@greensecurity/javascript-sdk", "users", "logsUserIntoTheSystem"];
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
export function
|
|
85
|
+
export function buildUsersLogsUserIntoTheSystemMutation(
|
|
86
86
|
client$: GreenSecurityCore,
|
|
87
87
|
hookOptions?: RequestOptions,
|
|
88
88
|
): {
|
|
89
89
|
mutationKey: MutationKey;
|
|
90
90
|
mutationFn: (
|
|
91
|
-
variables:
|
|
92
|
-
) => Promise<
|
|
91
|
+
variables: UsersLogsUserIntoTheSystemMutationVariables,
|
|
92
|
+
) => Promise<UsersLogsUserIntoTheSystemMutationData>;
|
|
93
93
|
} {
|
|
94
94
|
return {
|
|
95
|
-
mutationKey:
|
|
96
|
-
mutationFn: function
|
|
95
|
+
mutationKey: mutationKeyUsersLogsUserIntoTheSystem(),
|
|
96
|
+
mutationFn: function usersLogsUserIntoTheSystemMutationFn({
|
|
97
97
|
request,
|
|
98
98
|
options,
|
|
99
|
-
}): Promise<
|
|
99
|
+
}): Promise<UsersLogsUserIntoTheSystemMutationData> {
|
|
100
100
|
const mergedOptions = {
|
|
101
101
|
...hookOptions,
|
|
102
102
|
...options,
|
|
@@ -109,7 +109,7 @@ export function buildUserLogsUserIntoTheSystemMutation(
|
|
|
109
109
|
),
|
|
110
110
|
},
|
|
111
111
|
};
|
|
112
|
-
return unwrapAsync(
|
|
112
|
+
return unwrapAsync(usersLogsUserIntoTheSystem(
|
|
113
113
|
client$,
|
|
114
114
|
request,
|
|
115
115
|
mergedOptions,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
UseMutationResult,
|
|
9
9
|
} from "@tanstack/react-query";
|
|
10
10
|
import { GreenSecurityCore } from "../core.js";
|
|
11
|
-
import {
|
|
11
|
+
import { usersMagiclink } from "../funcs/usersMagiclink.js";
|
|
12
12
|
import { combineSignals } from "../lib/primitives.js";
|
|
13
13
|
import { RequestOptions } from "../lib/sdks.js";
|
|
14
14
|
import * as operations from "../models/operations/index.js";
|
|
@@ -16,12 +16,12 @@ import { unwrapAsync } from "../types/fp.js";
|
|
|
16
16
|
import { useGreenSecurityContext } from "./_context.js";
|
|
17
17
|
import { MutationHookOptions } from "./_types.js";
|
|
18
18
|
|
|
19
|
-
export type
|
|
19
|
+
export type UsersMagiclinkMutationVariables = {
|
|
20
20
|
request: operations.MagiclinkRequestBody;
|
|
21
21
|
options?: RequestOptions;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
export type
|
|
24
|
+
export type UsersMagiclinkMutationData = operations.MagiclinkMagiclinkOk;
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* Magic link
|
|
@@ -29,43 +29,43 @@ export type UserMagiclinkMutationData = operations.MagiclinkResponseBody;
|
|
|
29
29
|
* @remarks
|
|
30
30
|
* It sends an email with a magic link to allow the user to log in.
|
|
31
31
|
*/
|
|
32
|
-
export function
|
|
32
|
+
export function useUsersMagiclinkMutation(
|
|
33
33
|
options?: MutationHookOptions<
|
|
34
|
-
|
|
34
|
+
UsersMagiclinkMutationData,
|
|
35
35
|
Error,
|
|
36
|
-
|
|
36
|
+
UsersMagiclinkMutationVariables
|
|
37
37
|
>,
|
|
38
38
|
): UseMutationResult<
|
|
39
|
-
|
|
39
|
+
UsersMagiclinkMutationData,
|
|
40
40
|
Error,
|
|
41
|
-
|
|
41
|
+
UsersMagiclinkMutationVariables
|
|
42
42
|
> {
|
|
43
43
|
const client = useGreenSecurityContext();
|
|
44
44
|
return useMutation({
|
|
45
|
-
...
|
|
45
|
+
...buildUsersMagiclinkMutation(client, options),
|
|
46
46
|
...options,
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
export function
|
|
51
|
-
return ["@greensecurity/javascript-sdk", "
|
|
50
|
+
export function mutationKeyUsersMagiclink(): MutationKey {
|
|
51
|
+
return ["@greensecurity/javascript-sdk", "users", "magiclink"];
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
export function
|
|
54
|
+
export function buildUsersMagiclinkMutation(
|
|
55
55
|
client$: GreenSecurityCore,
|
|
56
56
|
hookOptions?: RequestOptions,
|
|
57
57
|
): {
|
|
58
58
|
mutationKey: MutationKey;
|
|
59
59
|
mutationFn: (
|
|
60
|
-
variables:
|
|
61
|
-
) => Promise<
|
|
60
|
+
variables: UsersMagiclinkMutationVariables,
|
|
61
|
+
) => Promise<UsersMagiclinkMutationData>;
|
|
62
62
|
} {
|
|
63
63
|
return {
|
|
64
|
-
mutationKey:
|
|
65
|
-
mutationFn: function
|
|
64
|
+
mutationKey: mutationKeyUsersMagiclink(),
|
|
65
|
+
mutationFn: function usersMagiclinkMutationFn({
|
|
66
66
|
request,
|
|
67
67
|
options,
|
|
68
|
-
}): Promise<
|
|
68
|
+
}): Promise<UsersMagiclinkMutationData> {
|
|
69
69
|
const mergedOptions = {
|
|
70
70
|
...hookOptions,
|
|
71
71
|
...options,
|
|
@@ -78,7 +78,7 @@ export function buildUserMagiclinkMutation(
|
|
|
78
78
|
),
|
|
79
79
|
},
|
|
80
80
|
};
|
|
81
|
-
return unwrapAsync(
|
|
81
|
+
return unwrapAsync(usersMagiclink(
|
|
82
82
|
client$,
|
|
83
83
|
request,
|
|
84
84
|
mergedOptions,
|