@greensecurity/javascript-sdk 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.devcontainer/README.md +35 -0
- package/.devcontainer/devcontainer.json +45 -0
- package/FUNCTIONS.md +109 -0
- package/REACT_QUERY.md +318 -0
- package/README.md +561 -0
- package/RUNTIMES.md +48 -0
- package/core.d.ts +10 -0
- package/core.d.ts.map +1 -0
- package/core.js +17 -0
- package/core.js.map +1 -0
- package/docs/sdks/greensecurity/README.md +14 -0
- package/docs/sdks/organizations/README.md +252 -0
- package/docs/sdks/user/README.md +348 -0
- package/docs/sdks/vendors/README.md +219 -0
- package/funcs/organizationsGetFacility.d.ts +17 -0
- package/funcs/organizationsGetFacility.d.ts.map +1 -0
- package/funcs/organizationsGetFacility.js +117 -0
- package/funcs/organizationsGetFacility.js.map +1 -0
- package/funcs/organizationsListOrSearchFacilities.d.ts +28 -0
- package/funcs/organizationsListOrSearchFacilities.d.ts.map +1 -0
- package/funcs/organizationsListOrSearchFacilities.js +131 -0
- package/funcs/organizationsListOrSearchFacilities.js.map +1 -0
- package/funcs/userGetCurrentUser.d.ts +16 -0
- package/funcs/userGetCurrentUser.d.ts.map +1 -0
- package/funcs/userGetCurrentUser.js +101 -0
- package/funcs/userGetCurrentUser.js.map +1 -0
- package/funcs/userGetUserById.d.ts +17 -0
- package/funcs/userGetUserById.d.ts.map +1 -0
- package/funcs/userGetUserById.js +117 -0
- package/funcs/userGetUserById.js.map +1 -0
- package/funcs/userLogsUserIntoTheSystem.d.ts +46 -0
- package/funcs/userLogsUserIntoTheSystem.d.ts.map +1 -0
- package/funcs/userLogsUserIntoTheSystem.js +137 -0
- package/funcs/userLogsUserIntoTheSystem.js.map +1 -0
- package/funcs/vendorsCreateVendorRegistration.d.ts +16 -0
- package/funcs/vendorsCreateVendorRegistration.d.ts.map +1 -0
- package/funcs/vendorsCreateVendorRegistration.js +107 -0
- package/funcs/vendorsCreateVendorRegistration.js.map +1 -0
- package/funcs/vendorsListVendorJobTitles.d.ts +16 -0
- package/funcs/vendorsListVendorJobTitles.d.ts.map +1 -0
- package/funcs/vendorsListVendorJobTitles.js +114 -0
- package/funcs/vendorsListVendorJobTitles.js.map +1 -0
- package/hooks/hooks.d.ts +24 -0
- package/hooks/hooks.d.ts.map +1 -0
- package/hooks/hooks.js +86 -0
- package/hooks/hooks.js.map +1 -0
- package/hooks/index.d.ts +3 -0
- package/hooks/index.d.ts.map +1 -0
- package/hooks/index.js +22 -0
- package/hooks/index.js.map +1 -0
- package/hooks/registration.d.ts +3 -0
- package/hooks/registration.d.ts.map +1 -0
- package/hooks/registration.js +15 -0
- package/hooks/registration.js.map +1 -0
- package/hooks/types.d.ts +78 -0
- package/hooks/types.d.ts.map +1 -0
- package/hooks/types.js +6 -0
- package/hooks/types.js.map +1 -0
- package/index.d.ts +4 -0
- package/index.d.ts.map +1 -0
- package/index.js +46 -0
- package/index.js.map +1 -0
- package/jsr.json +27 -0
- package/lib/base64.d.ts +10 -0
- package/lib/base64.d.ts.map +1 -0
- package/lib/base64.js +71 -0
- package/lib/base64.js.map +1 -0
- package/lib/config.d.ts +38 -0
- package/lib/config.d.ts.map +1 -0
- package/lib/config.js +46 -0
- package/lib/config.js.map +1 -0
- package/lib/dlv.d.ts +14 -0
- package/lib/dlv.d.ts.map +1 -0
- package/lib/dlv.js +49 -0
- package/lib/dlv.js.map +1 -0
- package/lib/encodings.d.ts +52 -0
- package/lib/encodings.d.ts.map +1 -0
- package/lib/encodings.js +368 -0
- package/lib/encodings.js.map +1 -0
- package/lib/env.d.ts +16 -0
- package/lib/env.d.ts.map +1 -0
- package/lib/env.js +66 -0
- package/lib/env.js.map +1 -0
- package/lib/files.d.ts +8 -0
- package/lib/files.d.ts.map +1 -0
- package/lib/files.js +36 -0
- package/lib/files.js.map +1 -0
- package/lib/http.d.ts +67 -0
- package/lib/http.d.ts.map +1 -0
- package/lib/http.js +217 -0
- package/lib/http.js.map +1 -0
- package/lib/is-plain-object.d.ts +2 -0
- package/lib/is-plain-object.d.ts.map +1 -0
- package/lib/is-plain-object.js +41 -0
- package/lib/is-plain-object.js.map +1 -0
- package/lib/logger.d.ts +6 -0
- package/lib/logger.d.ts.map +1 -0
- package/lib/logger.js +6 -0
- package/lib/logger.js.map +1 -0
- package/lib/matchers.d.ts +64 -0
- package/lib/matchers.d.ts.map +1 -0
- package/lib/matchers.js +204 -0
- package/lib/matchers.js.map +1 -0
- package/lib/primitives.d.ts +23 -0
- package/lib/primitives.d.ts.map +1 -0
- package/lib/primitives.js +104 -0
- package/lib/primitives.js.map +1 -0
- package/lib/retries.d.ts +38 -0
- package/lib/retries.d.ts.map +1 -0
- package/lib/retries.js +153 -0
- package/lib/retries.js.map +1 -0
- package/lib/schemas.d.ts +19 -0
- package/lib/schemas.d.ts.map +1 -0
- package/lib/schemas.js +62 -0
- package/lib/schemas.js.map +1 -0
- package/lib/sdks.d.ts +60 -0
- package/lib/sdks.d.ts.map +1 -0
- package/lib/sdks.js +280 -0
- package/lib/sdks.js.map +1 -0
- package/lib/security.d.ts +82 -0
- package/lib/security.d.ts.map +1 -0
- package/lib/security.js +145 -0
- package/lib/security.js.map +1 -0
- package/lib/url.d.ts +5 -0
- package/lib/url.d.ts.map +1 -0
- package/lib/url.js +25 -0
- package/lib/url.js.map +1 -0
- package/models/components/contact.d.ts +135 -0
- package/models/components/contact.d.ts.map +1 -0
- package/models/components/contact.js +172 -0
- package/models/components/contact.js.map +1 -0
- package/models/components/departmentsummary.d.ts +34 -0
- package/models/components/departmentsummary.d.ts.map +1 -0
- package/models/components/departmentsummary.js +71 -0
- package/models/components/departmentsummary.js.map +1 -0
- package/models/components/desc.d.ts +25 -0
- package/models/components/desc.d.ts.map +1 -0
- package/models/components/desc.js +66 -0
- package/models/components/desc.js.map +1 -0
- package/models/components/expand.d.ts +79 -0
- package/models/components/expand.d.ts.map +1 -0
- package/models/components/expand.js +79 -0
- package/models/components/expand.js.map +1 -0
- package/models/components/facility.d.ts +544 -0
- package/models/components/facility.d.ts.map +1 -0
- package/models/components/facility.js +797 -0
- package/models/components/facility.js.map +1 -0
- package/models/components/facilitysummary.d.ts +34 -0
- package/models/components/facilitysummary.d.ts.map +1 -0
- package/models/components/facilitysummary.js +71 -0
- package/models/components/facilitysummary.js.map +1 -0
- package/models/components/imageset.d.ts +38 -0
- package/models/components/imageset.d.ts.map +1 -0
- package/models/components/imageset.js +75 -0
- package/models/components/imageset.js.map +1 -0
- package/models/components/index.d.ts +20 -0
- package/models/components/index.d.ts.map +1 -0
- package/models/components/index.js +39 -0
- package/models/components/index.js.map +1 -0
- package/models/components/loginemailandpassword.d.ts +45 -0
- package/models/components/loginemailandpassword.d.ts.map +1 -0
- package/models/components/loginemailandpassword.js +82 -0
- package/models/components/loginemailandpassword.js.map +1 -0
- package/models/components/loginrequirementsfromemail.d.ts +40 -0
- package/models/components/loginrequirementsfromemail.d.ts.map +1 -0
- package/models/components/loginrequirementsfromemail.js +80 -0
- package/models/components/loginrequirementsfromemail.js.map +1 -0
- package/models/components/mfarequiredresponse.d.ts +98 -0
- package/models/components/mfarequiredresponse.d.ts.map +1 -0
- package/models/components/mfarequiredresponse.js +126 -0
- package/models/components/mfarequiredresponse.js.map +1 -0
- package/models/components/pager.d.ts +69 -0
- package/models/components/pager.d.ts.map +1 -0
- package/models/components/pager.js +97 -0
- package/models/components/pager.js.map +1 -0
- package/models/components/passwordrequiredresponse.d.ts +62 -0
- package/models/components/passwordrequiredresponse.d.ts.map +1 -0
- package/models/components/passwordrequiredresponse.js +92 -0
- package/models/components/passwordrequiredresponse.js.map +1 -0
- package/models/components/samlloginrequiredresponse.d.ts +73 -0
- package/models/components/samlloginrequiredresponse.d.ts.map +1 -0
- package/models/components/samlloginrequiredresponse.js +106 -0
- package/models/components/samlloginrequiredresponse.js.map +1 -0
- package/models/components/security.d.ts +31 -0
- package/models/components/security.d.ts.map +1 -0
- package/models/components/security.js +80 -0
- package/models/components/security.js.map +1 -0
- package/models/components/status.d.ts +37 -0
- package/models/components/status.d.ts.map +1 -0
- package/models/components/status.js +65 -0
- package/models/components/status.js.map +1 -0
- package/models/components/systemsummary.d.ts +34 -0
- package/models/components/systemsummary.d.ts.map +1 -0
- package/models/components/systemsummary.js +71 -0
- package/models/components/systemsummary.js.map +1 -0
- package/models/components/user.d.ts +265 -0
- package/models/components/user.d.ts.map +1 -0
- package/models/components/user.js +284 -0
- package/models/components/user.js.map +1 -0
- package/models/components/vendorjobtitle.d.ts +41 -0
- package/models/components/vendorjobtitle.d.ts.map +1 -0
- package/models/components/vendorjobtitle.js +71 -0
- package/models/components/vendorjobtitle.js.map +1 -0
- package/models/components/vendortype.d.ts +69 -0
- package/models/components/vendortype.d.ts.map +1 -0
- package/models/components/vendortype.js +135 -0
- package/models/components/vendortype.js.map +1 -0
- package/models/errors/apierror.d.ts +8 -0
- package/models/errors/apierror.d.ts.map +1 -0
- package/models/errors/apierror.js +21 -0
- package/models/errors/apierror.js.map +1 -0
- package/models/errors/apierrorresponse.d.ts +51 -0
- package/models/errors/apierrorresponse.d.ts.map +1 -0
- package/models/errors/apierrorresponse.js +91 -0
- package/models/errors/apierrorresponse.js.map +1 -0
- package/models/errors/httpclienterrors.d.ts +44 -0
- package/models/errors/httpclienterrors.d.ts.map +1 -0
- package/models/errors/httpclienterrors.js +78 -0
- package/models/errors/httpclienterrors.js.map +1 -0
- package/models/errors/index.d.ts +5 -0
- package/models/errors/index.d.ts.map +1 -0
- package/models/errors/index.js +24 -0
- package/models/errors/index.js.map +1 -0
- package/models/errors/sdkvalidationerror.d.ts +20 -0
- package/models/errors/sdkvalidationerror.d.ts.map +1 -0
- package/models/errors/sdkvalidationerror.js +115 -0
- package/models/errors/sdkvalidationerror.js.map +1 -0
- package/models/operations/createvendorregistration.d.ts +115 -0
- package/models/operations/createvendorregistration.d.ts.map +1 -0
- package/models/operations/createvendorregistration.js +143 -0
- package/models/operations/createvendorregistration.js.map +1 -0
- package/models/operations/getfacility.d.ts +32 -0
- package/models/operations/getfacility.d.ts.map +1 -0
- package/models/operations/getfacility.js +69 -0
- package/models/operations/getfacility.js.map +1 -0
- package/models/operations/getuserbyid.d.ts +32 -0
- package/models/operations/getuserbyid.d.ts.map +1 -0
- package/models/operations/getuserbyid.js +69 -0
- package/models/operations/getuserbyid.js.map +1 -0
- package/models/operations/index.d.ts +7 -0
- package/models/operations/index.d.ts.map +1 -0
- package/models/operations/index.js +26 -0
- package/models/operations/index.js.map +1 -0
- package/models/operations/listorsearchfacilities.d.ts +110 -0
- package/models/operations/listorsearchfacilities.d.ts.map +1 -0
- package/models/operations/listorsearchfacilities.js +130 -0
- package/models/operations/listorsearchfacilities.js.map +1 -0
- package/models/operations/listvendorjobtitles.d.ts +86 -0
- package/models/operations/listvendorjobtitles.d.ts.map +1 -0
- package/models/operations/listvendorjobtitles.js +118 -0
- package/models/operations/listvendorjobtitles.js.map +1 -0
- package/models/operations/logsuserintothesystem.d.ts +98 -0
- package/models/operations/logsuserintothesystem.d.ts.map +1 -0
- package/models/operations/logsuserintothesystem.js +164 -0
- package/models/operations/logsuserintothesystem.js.map +1 -0
- package/package.json +41 -0
- package/react-query/_context.d.ts +8 -0
- package/react-query/_context.d.ts.map +1 -0
- package/react-query/_context.js +21 -0
- package/react-query/_context.js.map +1 -0
- package/react-query/_types.d.ts +14 -0
- package/react-query/_types.d.ts.map +1 -0
- package/react-query/_types.js +6 -0
- package/react-query/_types.js.map +1 -0
- package/react-query/index.d.ts +10 -0
- package/react-query/index.d.ts.map +1 -0
- package/react-query/index.js +32 -0
- package/react-query/index.js.map +1 -0
- package/react-query/organizationsGetFacility.d.ts +31 -0
- package/react-query/organizationsGetFacility.d.ts.map +1 -0
- package/react-query/organizationsGetFacility.js +87 -0
- package/react-query/organizationsGetFacility.js.map +1 -0
- package/react-query/organizationsListOrSearchFacilities.d.ts +91 -0
- package/react-query/organizationsListOrSearchFacilities.d.ts.map +1 -0
- package/react-query/organizationsListOrSearchFacilities.js +132 -0
- package/react-query/organizationsListOrSearchFacilities.js.map +1 -0
- package/react-query/userGetCurrentUser.d.ts +29 -0
- package/react-query/userGetCurrentUser.d.ts.map +1 -0
- package/react-query/userGetCurrentUser.js +75 -0
- package/react-query/userGetCurrentUser.js.map +1 -0
- package/react-query/userGetUserById.d.ts +31 -0
- package/react-query/userGetUserById.d.ts.map +1 -0
- package/react-query/userGetUserById.js +87 -0
- package/react-query/userGetUserById.js.map +1 -0
- package/react-query/userLogsUserIntoTheSystem.d.ts +53 -0
- package/react-query/userLogsUserIntoTheSystem.d.ts.map +1 -0
- package/react-query/userLogsUserIntoTheSystem.js +77 -0
- package/react-query/userLogsUserIntoTheSystem.js.map +1 -0
- package/react-query/vendorsCreateVendorRegistration.d.ts +23 -0
- package/react-query/vendorsCreateVendorRegistration.d.ts.map +1 -0
- package/react-query/vendorsCreateVendorRegistration.js +51 -0
- package/react-query/vendorsCreateVendorRegistration.js.map +1 -0
- package/react-query/vendorsListVendorJobTitles.d.ts +53 -0
- package/react-query/vendorsListVendorJobTitles.d.ts.map +1 -0
- package/react-query/vendorsListVendorJobTitles.js +102 -0
- package/react-query/vendorsListVendorJobTitles.js.map +1 -0
- package/sdk/index.d.ts +2 -0
- package/sdk/index.d.ts.map +1 -0
- package/sdk/index.js +21 -0
- package/sdk/index.js.map +1 -0
- package/sdk/organizations.d.ts +33 -0
- package/sdk/organizations.d.ts.map +1 -0
- package/sdk/organizations.js +45 -0
- package/sdk/organizations.js.map +1 -0
- package/sdk/sdk.d.ts +13 -0
- package/sdk/sdk.d.ts.map +1 -0
- package/sdk/sdk.js +23 -0
- package/sdk/sdk.js.map +1 -0
- package/sdk/user.d.ts +57 -0
- package/sdk/user.d.ts.map +1 -0
- package/sdk/user.js +72 -0
- package/sdk/user.js.map +1 -0
- package/sdk/vendors.d.ts +19 -0
- package/sdk/vendors.d.ts.map +1 -0
- package/sdk/vendors.js +32 -0
- package/sdk/vendors.js.map +1 -0
- package/src/core.ts +13 -0
- package/src/funcs/organizationsGetFacility.ts +144 -0
- package/src/funcs/organizationsListOrSearchFacilities.ts +152 -0
- package/src/funcs/userGetCurrentUser.ts +118 -0
- package/src/funcs/userGetUserById.ts +141 -0
- package/src/funcs/userLogsUserIntoTheSystem.ts +161 -0
- package/src/funcs/vendorsCreateVendorRegistration.ts +132 -0
- package/src/funcs/vendorsListVendorJobTitles.ts +141 -0
- package/src/hooks/hooks.ts +132 -0
- package/src/hooks/index.ts +6 -0
- package/src/hooks/registration.ts +14 -0
- package/src/hooks/types.ts +110 -0
- package/src/index.ts +7 -0
- package/src/lib/base64.ts +37 -0
- package/src/lib/config.ts +76 -0
- package/src/lib/dlv.ts +53 -0
- package/src/lib/encodings.ts +483 -0
- package/src/lib/env.ts +43 -0
- package/src/lib/files.ts +40 -0
- package/src/lib/http.ts +323 -0
- package/src/lib/is-plain-object.ts +43 -0
- package/src/lib/logger.ts +9 -0
- package/src/lib/matchers.ts +322 -0
- package/src/lib/primitives.ts +136 -0
- package/src/lib/retries.ts +218 -0
- package/src/lib/schemas.ts +91 -0
- package/src/lib/sdks.ts +400 -0
- package/src/lib/security.ts +260 -0
- package/src/lib/url.ts +33 -0
- package/src/models/components/contact.ts +268 -0
- package/src/models/components/departmentsummary.ts +73 -0
- package/src/models/components/desc.ts +48 -0
- package/src/models/components/expand.ts +52 -0
- package/src/models/components/facility.ts +1334 -0
- package/src/models/components/facilitysummary.ts +71 -0
- package/src/models/components/imageset.ts +77 -0
- package/src/models/components/index.ts +23 -0
- package/src/models/components/loginemailandpassword.ts +95 -0
- package/src/models/components/loginrequirementsfromemail.ts +88 -0
- package/src/models/components/mfarequiredresponse.ts +160 -0
- package/src/models/components/pager.ts +126 -0
- package/src/models/components/passwordrequiredresponse.ts +105 -0
- package/src/models/components/samlloginrequiredresponse.ts +136 -0
- package/src/models/components/security.ts +75 -0
- package/src/models/components/status.ts +38 -0
- package/src/models/components/systemsummary.ts +69 -0
- package/src/models/components/user.ts +451 -0
- package/src/models/components/vendorjobtitle.ts +76 -0
- package/src/models/components/vendortype.ts +170 -0
- package/src/models/errors/apierror.ts +27 -0
- package/src/models/errors/apierrorresponse.ts +95 -0
- package/src/models/errors/httpclienterrors.ts +62 -0
- package/src/models/errors/index.ts +8 -0
- package/src/models/errors/sdkvalidationerror.ts +97 -0
- package/src/models/operations/createvendorregistration.ts +237 -0
- package/src/models/operations/getfacility.ts +69 -0
- package/src/models/operations/getuserbyid.ts +69 -0
- package/src/models/operations/index.ts +10 -0
- package/src/models/operations/listorsearchfacilities.ts +219 -0
- package/src/models/operations/listvendorjobtitles.ts +179 -0
- package/src/models/operations/logsuserintothesystem.ts +270 -0
- package/src/react-query/_types.ts +91 -0
- package/src/react-query/index.ts +14 -0
- package/src/react-query/organizationsGetFacility.ts +154 -0
- package/src/react-query/organizationsListOrSearchFacilities.ts +241 -0
- package/src/react-query/userGetCurrentUser.ts +124 -0
- package/src/react-query/userGetUserById.ts +152 -0
- package/src/react-query/userLogsUserIntoTheSystem.ts +119 -0
- package/src/react-query/vendorsCreateVendorRegistration.ts +93 -0
- package/src/react-query/vendorsListVendorJobTitles.ts +194 -0
- package/src/sdk/index.ts +5 -0
- package/src/sdk/organizations.ts +59 -0
- package/src/sdk/sdk.ts +25 -0
- package/src/sdk/user.ts +92 -0
- package/src/sdk/vendors.ts +45 -0
- package/src/types/blobs.ts +31 -0
- package/src/types/constdatetime.ts +15 -0
- package/src/types/enums.ts +16 -0
- package/src/types/fp.ts +50 -0
- package/src/types/index.ts +11 -0
- package/src/types/operations.ts +105 -0
- package/src/types/rfcdate.ts +54 -0
- package/src/types/streams.ts +21 -0
- package/tsconfig.json +41 -0
- package/types/blobs.d.ts +4 -0
- package/types/blobs.d.ts.map +1 -0
- package/types/blobs.js +62 -0
- package/types/blobs.js.map +1 -0
- package/types/constdatetime.d.ts +3 -0
- package/types/constdatetime.d.ts.map +1 -0
- package/types/constdatetime.js +46 -0
- package/types/constdatetime.js.map +1 -0
- package/types/enums.d.ts +12 -0
- package/types/enums.d.ts.map +1 -0
- package/types/enums.js +10 -0
- package/types/enums.js.map +1 -0
- package/types/fp.d.ts +31 -0
- package/types/fp.d.ts.map +1 -0
- package/types/fp.js +37 -0
- package/types/fp.js.map +1 -0
- package/types/index.d.ts +8 -0
- package/types/index.d.ts.map +1 -0
- package/types/index.js +16 -0
- package/types/index.js.map +1 -0
- package/types/operations.d.ts +27 -0
- package/types/operations.d.ts.map +1 -0
- package/types/operations.js +83 -0
- package/types/operations.js.map +1 -0
- package/types/rfcdate.d.ts +21 -0
- package/types/rfcdate.d.ts.map +1 -0
- package/types/rfcdate.js +46 -0
- package/types/rfcdate.js.map +1 -0
- package/types/streams.d.ts +2 -0
- package/types/streams.d.ts.map +1 -0
- package/types/streams.js +18 -0
- package/types/streams.js.map +1 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useOrganizationsListOrSearchFacilities = useOrganizationsListOrSearchFacilities;
|
|
7
|
+
exports.useOrganizationsListOrSearchFacilitiesSuspense = useOrganizationsListOrSearchFacilitiesSuspense;
|
|
8
|
+
exports.prefetchOrganizationsListOrSearchFacilities = prefetchOrganizationsListOrSearchFacilities;
|
|
9
|
+
exports.setOrganizationsListOrSearchFacilitiesData = setOrganizationsListOrSearchFacilitiesData;
|
|
10
|
+
exports.invalidateOrganizationsListOrSearchFacilities = invalidateOrganizationsListOrSearchFacilities;
|
|
11
|
+
exports.invalidateAllOrganizationsListOrSearchFacilities = invalidateAllOrganizationsListOrSearchFacilities;
|
|
12
|
+
exports.buildOrganizationsListOrSearchFacilitiesQuery = buildOrganizationsListOrSearchFacilitiesQuery;
|
|
13
|
+
exports.queryKeyOrganizationsListOrSearchFacilities = queryKeyOrganizationsListOrSearchFacilities;
|
|
14
|
+
const react_query_1 = require("@tanstack/react-query");
|
|
15
|
+
const organizationsListOrSearchFacilities_js_1 = require("../funcs/organizationsListOrSearchFacilities.js");
|
|
16
|
+
const primitives_js_1 = require("../lib/primitives.js");
|
|
17
|
+
const fp_js_1 = require("../types/fp.js");
|
|
18
|
+
const _context_js_1 = require("./_context.js");
|
|
19
|
+
/**
|
|
20
|
+
* List or search facilities
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
* List or search facilities.
|
|
24
|
+
*
|
|
25
|
+
* Available `expand` scopes are:
|
|
26
|
+
*
|
|
27
|
+
* - facility.appointment_policy
|
|
28
|
+
* - facility.contacts
|
|
29
|
+
* - facility.vendor_counts
|
|
30
|
+
* - facility.flu_credential
|
|
31
|
+
* - facility.scrubs_policy
|
|
32
|
+
* - facility.system
|
|
33
|
+
* - facility.vendor_guest_policy
|
|
34
|
+
* - facility.vendor_policy
|
|
35
|
+
* - facility.visitor_policy
|
|
36
|
+
* - facility.workflow
|
|
37
|
+
*/
|
|
38
|
+
function useOrganizationsListOrSearchFacilities(request, options) {
|
|
39
|
+
const client = (0, _context_js_1.useGreenSecurityContext)();
|
|
40
|
+
return (0, react_query_1.useQuery)({
|
|
41
|
+
...buildOrganizationsListOrSearchFacilitiesQuery(client, request, options),
|
|
42
|
+
...options,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* List or search facilities
|
|
47
|
+
*
|
|
48
|
+
* @remarks
|
|
49
|
+
* List or search facilities.
|
|
50
|
+
*
|
|
51
|
+
* Available `expand` scopes are:
|
|
52
|
+
*
|
|
53
|
+
* - facility.appointment_policy
|
|
54
|
+
* - facility.contacts
|
|
55
|
+
* - facility.vendor_counts
|
|
56
|
+
* - facility.flu_credential
|
|
57
|
+
* - facility.scrubs_policy
|
|
58
|
+
* - facility.system
|
|
59
|
+
* - facility.vendor_guest_policy
|
|
60
|
+
* - facility.vendor_policy
|
|
61
|
+
* - facility.visitor_policy
|
|
62
|
+
* - facility.workflow
|
|
63
|
+
*/
|
|
64
|
+
function useOrganizationsListOrSearchFacilitiesSuspense(request, options) {
|
|
65
|
+
const client = (0, _context_js_1.useGreenSecurityContext)();
|
|
66
|
+
return (0, react_query_1.useSuspenseQuery)({
|
|
67
|
+
...buildOrganizationsListOrSearchFacilitiesQuery(client, request, options),
|
|
68
|
+
...options,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function prefetchOrganizationsListOrSearchFacilities(queryClient, client$, request) {
|
|
72
|
+
return queryClient.prefetchQuery({
|
|
73
|
+
...buildOrganizationsListOrSearchFacilitiesQuery(client$, request),
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
function setOrganizationsListOrSearchFacilitiesData(client, queryKeyBase, data) {
|
|
77
|
+
const key = queryKeyOrganizationsListOrSearchFacilities(...queryKeyBase);
|
|
78
|
+
return client.setQueryData(key, data);
|
|
79
|
+
}
|
|
80
|
+
function invalidateOrganizationsListOrSearchFacilities(client, queryKeyBase, filters) {
|
|
81
|
+
return client.invalidateQueries({
|
|
82
|
+
...filters,
|
|
83
|
+
queryKey: [
|
|
84
|
+
"@greensecurity/javascript-sdk",
|
|
85
|
+
"organizations",
|
|
86
|
+
"listOrSearchFacilities",
|
|
87
|
+
...queryKeyBase,
|
|
88
|
+
],
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
function invalidateAllOrganizationsListOrSearchFacilities(client, filters) {
|
|
92
|
+
return client.invalidateQueries({
|
|
93
|
+
...filters,
|
|
94
|
+
queryKey: [
|
|
95
|
+
"@greensecurity/javascript-sdk",
|
|
96
|
+
"organizations",
|
|
97
|
+
"listOrSearchFacilities",
|
|
98
|
+
],
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
function buildOrganizationsListOrSearchFacilitiesQuery(client$, request, options) {
|
|
102
|
+
return {
|
|
103
|
+
queryKey: queryKeyOrganizationsListOrSearchFacilities({
|
|
104
|
+
sort: request.sort,
|
|
105
|
+
desc: request.desc,
|
|
106
|
+
page: request.page,
|
|
107
|
+
itemsPerPage: request.itemsPerPage,
|
|
108
|
+
expand: request.expand,
|
|
109
|
+
systemId: request.systemId,
|
|
110
|
+
nameLike: request.nameLike,
|
|
111
|
+
stateLike: request.stateLike,
|
|
112
|
+
status: request.status,
|
|
113
|
+
}),
|
|
114
|
+
queryFn: async function organizationsListOrSearchFacilitiesQueryFn(ctx) {
|
|
115
|
+
const sig = (0, primitives_js_1.combineSignals)(ctx.signal, options?.fetchOptions?.signal);
|
|
116
|
+
const mergedOptions = {
|
|
117
|
+
...options,
|
|
118
|
+
fetchOptions: { ...options?.fetchOptions, signal: sig },
|
|
119
|
+
};
|
|
120
|
+
return (0, fp_js_1.unwrapAsync)((0, organizationsListOrSearchFacilities_js_1.organizationsListOrSearchFacilities)(client$, request, mergedOptions));
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
function queryKeyOrganizationsListOrSearchFacilities(parameters) {
|
|
125
|
+
return [
|
|
126
|
+
"@greensecurity/javascript-sdk",
|
|
127
|
+
"organizations",
|
|
128
|
+
"listOrSearchFacilities",
|
|
129
|
+
parameters,
|
|
130
|
+
];
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=organizationsListOrSearchFacilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organizationsListOrSearchFacilities.js","sourceRoot":"","sources":["../src/react-query/organizationsListOrSearchFacilities.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAgDH,wFAaC;AAqBD,wGAeC;AAED,kGAWC;AAED,gGAuBC;AAED,sGA0BC;AAED,4GAYC;AAED,sGAsCC;AAED,kGAmBC;AA5OD,uDAS+B;AAE/B,4GAAsG;AACtG,wDAAsD;AAItD,0CAA6C;AAC7C,+CAAwD;AAUxD;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,sCAAsC,CACpD,OAAiD,EACjD,OAAwE;IAExE,MAAM,MAAM,GAAG,IAAA,qCAAuB,GAAE,CAAC;IACzC,OAAO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,OAAiD,EACjD,OAAwB;IAOxB,OAAO;QACL,QAAQ,EAAE,2CAA2C,CAAC;YACpD,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,YAAY,EAAE,OAAO,CAAC,YAAY;YAClC,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,MAAM,EAAE,OAAO,CAAC,MAAM;SACvB,CAAC;QACF,OAAO,EAAE,KAAK,UAAU,0CAA0C,CAChE,GAAG;YAEH,MAAM,GAAG,GAAG,IAAA,8BAAc,EAAC,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;YACtE,MAAM,aAAa,GAAG;gBACpB,GAAG,OAAO;gBACV,YAAY,EAAE,EAAE,GAAG,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE;aACxD,CAAC;YAEF,OAAO,IAAA,mBAAW,EAAC,IAAA,4EAAmC,EACpD,OAAO,EACP,OAAO,EACP,aAAa,CACd,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC;AAED,SAAgB,2CAA2C,CACzD,UAUC;IAED,OAAO;QACL,+BAA+B;QAC/B,eAAe;QACf,wBAAwB;QACxB,UAAU;KACX,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { InvalidateQueryFilters, QueryClient, QueryFunctionContext, QueryKey, UseQueryResult, UseSuspenseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import { GreenSecurityCore } from "../core.js";
|
|
3
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
4
|
+
import * as components from "../models/components/index.js";
|
|
5
|
+
import { QueryHookOptions, SuspenseQueryHookOptions } from "./_types.js";
|
|
6
|
+
export type UserGetCurrentUserQueryData = components.User;
|
|
7
|
+
/**
|
|
8
|
+
* Get current user
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* Returns a user object for the user represented by the authorization token
|
|
12
|
+
*/
|
|
13
|
+
export declare function useUserGetCurrentUser(options?: QueryHookOptions<UserGetCurrentUserQueryData>): UseQueryResult<UserGetCurrentUserQueryData, Error>;
|
|
14
|
+
/**
|
|
15
|
+
* Get current user
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* Returns a user object for the user represented by the authorization token
|
|
19
|
+
*/
|
|
20
|
+
export declare function useUserGetCurrentUserSuspense(options?: SuspenseQueryHookOptions<UserGetCurrentUserQueryData>): UseSuspenseQueryResult<UserGetCurrentUserQueryData, Error>;
|
|
21
|
+
export declare function prefetchUserGetCurrentUser(queryClient: QueryClient, client$: GreenSecurityCore): Promise<void>;
|
|
22
|
+
export declare function setUserGetCurrentUserData(client: QueryClient, data: UserGetCurrentUserQueryData): UserGetCurrentUserQueryData | undefined;
|
|
23
|
+
export declare function invalidateAllUserGetCurrentUser(client: QueryClient, filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">): Promise<void>;
|
|
24
|
+
export declare function buildUserGetCurrentUserQuery(client$: GreenSecurityCore, options?: RequestOptions): {
|
|
25
|
+
queryKey: QueryKey;
|
|
26
|
+
queryFn: (context: QueryFunctionContext) => Promise<UserGetCurrentUserQueryData>;
|
|
27
|
+
};
|
|
28
|
+
export declare function queryKeyUserGetCurrentUser(): QueryKey;
|
|
29
|
+
//# sourceMappingURL=userGetCurrentUser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userGetCurrentUser.d.ts","sourceRoot":"","sources":["../src/react-query/userGetCurrentUser.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,sBAAsB,EACtB,WAAW,EACX,oBAAoB,EACpB,QAAQ,EAER,cAAc,EAEd,sBAAsB,EACvB,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 -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useUserGetCurrentUser = useUserGetCurrentUser;
|
|
7
|
+
exports.useUserGetCurrentUserSuspense = useUserGetCurrentUserSuspense;
|
|
8
|
+
exports.prefetchUserGetCurrentUser = prefetchUserGetCurrentUser;
|
|
9
|
+
exports.setUserGetCurrentUserData = setUserGetCurrentUserData;
|
|
10
|
+
exports.invalidateAllUserGetCurrentUser = invalidateAllUserGetCurrentUser;
|
|
11
|
+
exports.buildUserGetCurrentUserQuery = buildUserGetCurrentUserQuery;
|
|
12
|
+
exports.queryKeyUserGetCurrentUser = queryKeyUserGetCurrentUser;
|
|
13
|
+
const react_query_1 = require("@tanstack/react-query");
|
|
14
|
+
const userGetCurrentUser_js_1 = require("../funcs/userGetCurrentUser.js");
|
|
15
|
+
const primitives_js_1 = require("../lib/primitives.js");
|
|
16
|
+
const fp_js_1 = require("../types/fp.js");
|
|
17
|
+
const _context_js_1 = require("./_context.js");
|
|
18
|
+
/**
|
|
19
|
+
* Get current user
|
|
20
|
+
*
|
|
21
|
+
* @remarks
|
|
22
|
+
* Returns a user object for the user represented by the authorization token
|
|
23
|
+
*/
|
|
24
|
+
function useUserGetCurrentUser(options) {
|
|
25
|
+
const client = (0, _context_js_1.useGreenSecurityContext)();
|
|
26
|
+
return (0, react_query_1.useQuery)({
|
|
27
|
+
...buildUserGetCurrentUserQuery(client, options),
|
|
28
|
+
...options,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Get current user
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* Returns a user object for the user represented by the authorization token
|
|
36
|
+
*/
|
|
37
|
+
function useUserGetCurrentUserSuspense(options) {
|
|
38
|
+
const client = (0, _context_js_1.useGreenSecurityContext)();
|
|
39
|
+
return (0, react_query_1.useSuspenseQuery)({
|
|
40
|
+
...buildUserGetCurrentUserQuery(client, options),
|
|
41
|
+
...options,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function prefetchUserGetCurrentUser(queryClient, client$) {
|
|
45
|
+
return queryClient.prefetchQuery({
|
|
46
|
+
...buildUserGetCurrentUserQuery(client$),
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function setUserGetCurrentUserData(client, data) {
|
|
50
|
+
const key = queryKeyUserGetCurrentUser();
|
|
51
|
+
return client.setQueryData(key, data);
|
|
52
|
+
}
|
|
53
|
+
function invalidateAllUserGetCurrentUser(client, filters) {
|
|
54
|
+
return client.invalidateQueries({
|
|
55
|
+
...filters,
|
|
56
|
+
queryKey: ["@greensecurity/javascript-sdk", "user", "getCurrentUser"],
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function buildUserGetCurrentUserQuery(client$, options) {
|
|
60
|
+
return {
|
|
61
|
+
queryKey: queryKeyUserGetCurrentUser(),
|
|
62
|
+
queryFn: async function userGetCurrentUserQueryFn(ctx) {
|
|
63
|
+
const sig = (0, primitives_js_1.combineSignals)(ctx.signal, options?.fetchOptions?.signal);
|
|
64
|
+
const mergedOptions = {
|
|
65
|
+
...options,
|
|
66
|
+
fetchOptions: { ...options?.fetchOptions, signal: sig },
|
|
67
|
+
};
|
|
68
|
+
return (0, fp_js_1.unwrapAsync)((0, userGetCurrentUser_js_1.userGetCurrentUser)(client$, mergedOptions));
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
function queryKeyUserGetCurrentUser() {
|
|
73
|
+
return ["@greensecurity/javascript-sdk", "user", "getCurrentUser"];
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=userGetCurrentUser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userGetCurrentUser.js","sourceRoot":"","sources":["../src/react-query/userGetCurr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B;IAOxB,OAAO;QACL,QAAQ,EAAE,0BAA0B,EAAE;QACtC,OAAO,EAAE,KAAK,UAAU,yBAAyB,CAC/C,GAAG;YAEH,MAAM,GAAG,GAAG,IAAA,8BAAc,EAAC,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;YACtE,MAAM,aAAa,GAAG;gBACpB,GAAG,OAAO;gBACV,YAAY,EAAE,EAAE,GAAG,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE;aACxD,CAAC;YAEF,OAAO,IAAA,mBAAW,EAAC,IAAA,0CAAkB,EACnC,OAAO,EACP,aAAa,CACd,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC;AAED,SAAgB,0BAA0B;IACxC,OAAO,CAAC,+BAA+B,EAAE,MAAM,EAAE,gBAAgB,CAAC,CAAC;AACrE,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { InvalidateQueryFilters, QueryClient, QueryFunctionContext, QueryKey, UseQueryResult, UseSuspenseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import { GreenSecurityCore } from "../core.js";
|
|
3
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
4
|
+
import * as components from "../models/components/index.js";
|
|
5
|
+
import * as operations from "../models/operations/index.js";
|
|
6
|
+
import { QueryHookOptions, SuspenseQueryHookOptions, TupleToPrefixes } from "./_types.js";
|
|
7
|
+
export type UserGetUserByIdQueryData = components.User;
|
|
8
|
+
/**
|
|
9
|
+
* Get user by id
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* Returns a user object for the user represented by the identifier in the path.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useUserGetUserById(request: operations.GetUserByIdRequest, options?: QueryHookOptions<UserGetUserByIdQueryData>): UseQueryResult<UserGetUserByIdQueryData, Error>;
|
|
15
|
+
/**
|
|
16
|
+
* Get user by id
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* Returns a user object for the user represented by the identifier in the path.
|
|
20
|
+
*/
|
|
21
|
+
export declare function useUserGetUserByIdSuspense(request: operations.GetUserByIdRequest, options?: SuspenseQueryHookOptions<UserGetUserByIdQueryData>): UseSuspenseQueryResult<UserGetUserByIdQueryData, Error>;
|
|
22
|
+
export declare function prefetchUserGetUserById(queryClient: QueryClient, client$: GreenSecurityCore, request: operations.GetUserByIdRequest): Promise<void>;
|
|
23
|
+
export declare function setUserGetUserByIdData(client: QueryClient, queryKeyBase: [id: number], data: UserGetUserByIdQueryData): UserGetUserByIdQueryData | undefined;
|
|
24
|
+
export declare function invalidateUserGetUserById(client: QueryClient, queryKeyBase: TupleToPrefixes<[id: number]>, filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">): Promise<void>;
|
|
25
|
+
export declare function invalidateAllUserGetUserById(client: QueryClient, filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">): Promise<void>;
|
|
26
|
+
export declare function buildUserGetUserByIdQuery(client$: GreenSecurityCore, request: operations.GetUserByIdRequest, options?: RequestOptions): {
|
|
27
|
+
queryKey: QueryKey;
|
|
28
|
+
queryFn: (context: QueryFunctionContext) => Promise<UserGetUserByIdQueryData>;
|
|
29
|
+
};
|
|
30
|
+
export declare function queryKeyUserGetUserById(id: number): QueryKey;
|
|
31
|
+
//# sourceMappingURL=userGetUserById.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userGetUserById.d.ts","sourceRoot":"","sources":["../src/react-query/userGetUserById.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,sBAAsB,EACtB,WAAW,EACX,oBAAoB,EACpB,QAAQ,EAER,cAAc,EAEd,sBAAsB,EACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAG/C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,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,GACzE,OAAO,CAAC,IAAI,CAAC,CAKf;AAED,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,UAAU,CAAC,kBAAkB,EACtC,OAAO,CAAC,EAAE,cAAc,GACvB;IACD,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,CAAC,OAAO,EAAE,oBAAoB,KAAK,OAAO,CAAC,wBAAwB,CAAC,CAAC;CAC/E,CAmBA;AAED,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,CAE5D"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useUserGetUserById = useUserGetUserById;
|
|
7
|
+
exports.useUserGetUserByIdSuspense = useUserGetUserByIdSuspense;
|
|
8
|
+
exports.prefetchUserGetUserById = prefetchUserGetUserById;
|
|
9
|
+
exports.setUserGetUserByIdData = setUserGetUserByIdData;
|
|
10
|
+
exports.invalidateUserGetUserById = invalidateUserGetUserById;
|
|
11
|
+
exports.invalidateAllUserGetUserById = invalidateAllUserGetUserById;
|
|
12
|
+
exports.buildUserGetUserByIdQuery = buildUserGetUserByIdQuery;
|
|
13
|
+
exports.queryKeyUserGetUserById = queryKeyUserGetUserById;
|
|
14
|
+
const react_query_1 = require("@tanstack/react-query");
|
|
15
|
+
const userGetUserById_js_1 = require("../funcs/userGetUserById.js");
|
|
16
|
+
const primitives_js_1 = require("../lib/primitives.js");
|
|
17
|
+
const fp_js_1 = require("../types/fp.js");
|
|
18
|
+
const _context_js_1 = require("./_context.js");
|
|
19
|
+
/**
|
|
20
|
+
* Get user by id
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
* Returns a user object for the user represented by the identifier in the path.
|
|
24
|
+
*/
|
|
25
|
+
function useUserGetUserById(request, options) {
|
|
26
|
+
const client = (0, _context_js_1.useGreenSecurityContext)();
|
|
27
|
+
return (0, react_query_1.useQuery)({
|
|
28
|
+
...buildUserGetUserByIdQuery(client, request, options),
|
|
29
|
+
...options,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Get user by id
|
|
34
|
+
*
|
|
35
|
+
* @remarks
|
|
36
|
+
* Returns a user object for the user represented by the identifier in the path.
|
|
37
|
+
*/
|
|
38
|
+
function useUserGetUserByIdSuspense(request, options) {
|
|
39
|
+
const client = (0, _context_js_1.useGreenSecurityContext)();
|
|
40
|
+
return (0, react_query_1.useSuspenseQuery)({
|
|
41
|
+
...buildUserGetUserByIdQuery(client, request, options),
|
|
42
|
+
...options,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function prefetchUserGetUserById(queryClient, client$, request) {
|
|
46
|
+
return queryClient.prefetchQuery({
|
|
47
|
+
...buildUserGetUserByIdQuery(client$, request),
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function setUserGetUserByIdData(client, queryKeyBase, data) {
|
|
51
|
+
const key = queryKeyUserGetUserById(...queryKeyBase);
|
|
52
|
+
return client.setQueryData(key, data);
|
|
53
|
+
}
|
|
54
|
+
function invalidateUserGetUserById(client, queryKeyBase, filters) {
|
|
55
|
+
return client.invalidateQueries({
|
|
56
|
+
...filters,
|
|
57
|
+
queryKey: [
|
|
58
|
+
"@greensecurity/javascript-sdk",
|
|
59
|
+
"user",
|
|
60
|
+
"getUserById",
|
|
61
|
+
...queryKeyBase,
|
|
62
|
+
],
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function invalidateAllUserGetUserById(client, filters) {
|
|
66
|
+
return client.invalidateQueries({
|
|
67
|
+
...filters,
|
|
68
|
+
queryKey: ["@greensecurity/javascript-sdk", "user", "getUserById"],
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function buildUserGetUserByIdQuery(client$, request, options) {
|
|
72
|
+
return {
|
|
73
|
+
queryKey: queryKeyUserGetUserById(request.id),
|
|
74
|
+
queryFn: async function userGetUserByIdQueryFn(ctx) {
|
|
75
|
+
const sig = (0, primitives_js_1.combineSignals)(ctx.signal, options?.fetchOptions?.signal);
|
|
76
|
+
const mergedOptions = {
|
|
77
|
+
...options,
|
|
78
|
+
fetchOptions: { ...options?.fetchOptions, signal: sig },
|
|
79
|
+
};
|
|
80
|
+
return (0, fp_js_1.unwrapAsync)((0, userGetUserById_js_1.userGetUserById)(client$, request, mergedOptions));
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
function queryKeyUserGetUserById(id) {
|
|
85
|
+
return ["@greensecurity/javascript-sdk", "user", "getUserById", id];
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=userGetUserById.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userGetUserById.js","sourceRoot":"","sources":["../src/react-query/userGetUserById.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAkCH,gDAaC;AAQD,gEAaC;AAED,0DAWC;AAED,wDAQC;AAED,8DAcC;AAED,oEAQC;AAED,8DA0BC;AAED,0DAEC;AAnJD,uDAS+B;AAE/B,oEAA8D;AAC9D,wDAAsD;AAItD,0CAA6C;AAC7C,+CAAwD;AASxD;;;;;GAKG;AACH,SAAgB,kBAAkB,CAChC,OAAsC,EACtC,OAAoD;IAEpD,MAAM,MAAM,GAAG,IAAA,qCAAuB,GAAE,CAAC;IACzC,OAAO,IAAA,sBAAQ,EAAC;QACd,GAAG,yBAAyB,CAC1B,MAAM,EACN,OAAO,EACP,OAAO,CACR;QACD,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,SAAgB,0BAA0B,CACxC,OAAsC,EACtC,OAA4D;IAE5D,MAAM,MAAM,GAAG,IAAA,qCAAuB,GAAE,CAAC;IACzC,OAAO,IAAA,8BAAgB,EAAC;Q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B,GAAG,OAAO;gBACV,YAAY,EAAE,EAAE,GAAG,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE;aACxD,CAAC;YAEF,OAAO,IAAA,mBAAW,EAAC,IAAA,oCAAe,EAChC,OAAO,EACP,OAAO,EACP,aAAa,CACd,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC;AAED,SAAgB,uBAAuB,CAAC,EAAU;IAChD,OAAO,CAAC,+BAA+B,EAAE,MAAM,EAAE,aAAa,EAAE,EAAE,CAAC,CAAC;AACtE,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { MutationKey, UseMutationResult } from "@tanstack/react-query";
|
|
2
|
+
import { GreenSecurityCore } from "../core.js";
|
|
3
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
4
|
+
import * as operations from "../models/operations/index.js";
|
|
5
|
+
import { MutationHookOptions } from "./_types.js";
|
|
6
|
+
export type UserLogsUserIntoTheSystemMutationVariables = {
|
|
7
|
+
request: operations.LogsUserIntoTheSystemRequestBody;
|
|
8
|
+
options?: RequestOptions;
|
|
9
|
+
};
|
|
10
|
+
export type UserLogsUserIntoTheSystemMutationData = operations.LogsUserIntoTheSystemResponse;
|
|
11
|
+
/**
|
|
12
|
+
* Logs user into the system
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* This endpoint allows a user to authenticate themselves and retrieve a permanent token for access.
|
|
16
|
+
*
|
|
17
|
+
* Permanent tokens should only ever be stored in an encrypted storage because they represent a fully logged in user.
|
|
18
|
+
*
|
|
19
|
+
* Users may log in with `email/password`, `SAML`, `magic link` or `mfa`. The application should handle all of the above as equally valid login methods.
|
|
20
|
+
*
|
|
21
|
+
* The most common way to authenticate a user is to log in with an email and password. If the user provides valid credentials, the server will either respond with a full user object including the token.
|
|
22
|
+
*
|
|
23
|
+
* When the user's account is protected via MFA, the server will send a 6 digit code to the user via their default MFA provider. You should collect that code and resend the email, password and mfa_code together to get a successful authentication.
|
|
24
|
+
*
|
|
25
|
+
* The ideal flow for a login sequence is the following:
|
|
26
|
+
*
|
|
27
|
+
* 1. Present an email address field only and allow the user to submit
|
|
28
|
+
* 2. Send `email` and `return_url` payload to this endpoint
|
|
29
|
+
* 3. Follow the flow based on the response `requires` field
|
|
30
|
+
*
|
|
31
|
+
* Requires: `password`
|
|
32
|
+
*
|
|
33
|
+
* 1. Show a password field for the user to fill out
|
|
34
|
+
* 2. Submit the `email` and `password` to this endpoint
|
|
35
|
+
* 3. If the response is `200`, the login is done. If the response is `201`, then check if `requires: mfa_code` is returned and show MFA flow
|
|
36
|
+
* 4. Submit `email`, `password`, `mfa_code` to this endpoint
|
|
37
|
+
* 5. If the response is `200`, the login is done. Otherwise, show the appropriate error to the user and go back to step 1 or 3 depending on the error.
|
|
38
|
+
*
|
|
39
|
+
* Requires: `saml_login`
|
|
40
|
+
*
|
|
41
|
+
* 1. [Open a browser](https://docs.expo.dev/versions/latest/sdk/webbrowser/#webbrowseropenauthsessionasyncurl-redirecturl-options) to the url returned in `sso_url`
|
|
42
|
+
* 2. User completes sign-in using their configured SAML IdP
|
|
43
|
+
* 3. Site redirects to your selected `return_url`
|
|
44
|
+
* 4. The `user_token` will be appended as a query string parameter to your `return_url` - you must parse this token and store it
|
|
45
|
+
* 5. Fetch the user object from `/users/me` using the token
|
|
46
|
+
*/
|
|
47
|
+
export declare function useUserLogsUserIntoTheSystemMutation(options?: MutationHookOptions<UserLogsUserIntoTheSystemMutationData, Error, UserLogsUserIntoTheSystemMutationVariables>): UseMutationResult<UserLogsUserIntoTheSystemMutationData, Error, UserLogsUserIntoTheSystemMutationVariables>;
|
|
48
|
+
export declare function mutationKeyUserLogsUserIntoTheSystem(): MutationKey;
|
|
49
|
+
export declare function buildUserLogsUserIntoTheSystemMutation(client$: GreenSecurityCore, hookOptions?: RequestOptions): {
|
|
50
|
+
mutationKey: MutationKey;
|
|
51
|
+
mutationFn: (variables: UserLogsUserIntoTheSystemMutationVariables) => Promise<UserLogsUserIntoTheSystemMutationData>;
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=userLogsUserIntoTheSystem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userLogsUserIntoTheSystem.d.ts","sourceRoot":"","sources":["../src/react-query/userLogsUserIntoTheSystem.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,WAAW,EAEX,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAG/C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,MAAM,0CAA0C,GAAG;IACvD,OAAO,EAAE,UAAU,CAAC,gCAAgC,CAAC;IACrD,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,qCAAqC,GAC/C,UAAU,CAAC,6BAA6B,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,oCAAoC,CAClD,OAAO,CAAC,EAAE,mBAAmB,CAC3B,qCAAqC,EACrC,KAAK,EACL,0CAA0C,CAC3C,GACA,iBAAiB,CAClB,qCAAqC,EACrC,KAAK,EACL,0CAA0C,CAC3C,CAMA;AAED,wBAAgB,oCAAoC,IAAI,WAAW,CAElE;AAED,wBAAgB,sCAAsC,CACpD,OAAO,EAAE,iBAAiB,EAC1B,WAAW,CAAC,EAAE,cAAc,GAC3B;IACD,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,EAAE,CACV,SAAS,EAAE,0CAA0C,KAClD,OAAO,CAAC,qCAAqC,CAAC,CAAC;CACrD,CA0BA"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useUserLogsUserIntoTheSystemMutation = useUserLogsUserIntoTheSystemMutation;
|
|
7
|
+
exports.mutationKeyUserLogsUserIntoTheSystem = mutationKeyUserLogsUserIntoTheSystem;
|
|
8
|
+
exports.buildUserLogsUserIntoTheSystemMutation = buildUserLogsUserIntoTheSystemMutation;
|
|
9
|
+
const react_query_1 = require("@tanstack/react-query");
|
|
10
|
+
const userLogsUserIntoTheSystem_js_1 = require("../funcs/userLogsUserIntoTheSystem.js");
|
|
11
|
+
const primitives_js_1 = require("../lib/primitives.js");
|
|
12
|
+
const fp_js_1 = require("../types/fp.js");
|
|
13
|
+
const _context_js_1 = require("./_context.js");
|
|
14
|
+
/**
|
|
15
|
+
* Logs user into the system
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* This endpoint allows a user to authenticate themselves and retrieve a permanent token for access.
|
|
19
|
+
*
|
|
20
|
+
* Permanent tokens should only ever be stored in an encrypted storage because they represent a fully logged in user.
|
|
21
|
+
*
|
|
22
|
+
* Users may log in with `email/password`, `SAML`, `magic link` or `mfa`. The application should handle all of the above as equally valid login methods.
|
|
23
|
+
*
|
|
24
|
+
* The most common way to authenticate a user is to log in with an email and password. If the user provides valid credentials, the server will either respond with a full user object including the token.
|
|
25
|
+
*
|
|
26
|
+
* When the user's account is protected via MFA, the server will send a 6 digit code to the user via their default MFA provider. You should collect that code and resend the email, password and mfa_code together to get a successful authentication.
|
|
27
|
+
*
|
|
28
|
+
* The ideal flow for a login sequence is the following:
|
|
29
|
+
*
|
|
30
|
+
* 1. Present an email address field only and allow the user to submit
|
|
31
|
+
* 2. Send `email` and `return_url` payload to this endpoint
|
|
32
|
+
* 3. Follow the flow based on the response `requires` field
|
|
33
|
+
*
|
|
34
|
+
* Requires: `password`
|
|
35
|
+
*
|
|
36
|
+
* 1. Show a password field for the user to fill out
|
|
37
|
+
* 2. Submit the `email` and `password` to this endpoint
|
|
38
|
+
* 3. If the response is `200`, the login is done. If the response is `201`, then check if `requires: mfa_code` is returned and show MFA flow
|
|
39
|
+
* 4. Submit `email`, `password`, `mfa_code` to this endpoint
|
|
40
|
+
* 5. If the response is `200`, the login is done. Otherwise, show the appropriate error to the user and go back to step 1 or 3 depending on the error.
|
|
41
|
+
*
|
|
42
|
+
* Requires: `saml_login`
|
|
43
|
+
*
|
|
44
|
+
* 1. [Open a browser](https://docs.expo.dev/versions/latest/sdk/webbrowser/#webbrowseropenauthsessionasyncurl-redirecturl-options) to the url returned in `sso_url`
|
|
45
|
+
* 2. User completes sign-in using their configured SAML IdP
|
|
46
|
+
* 3. Site redirects to your selected `return_url`
|
|
47
|
+
* 4. The `user_token` will be appended as a query string parameter to your `return_url` - you must parse this token and store it
|
|
48
|
+
* 5. Fetch the user object from `/users/me` using the token
|
|
49
|
+
*/
|
|
50
|
+
function useUserLogsUserIntoTheSystemMutation(options) {
|
|
51
|
+
const client = (0, _context_js_1.useGreenSecurityContext)();
|
|
52
|
+
return (0, react_query_1.useMutation)({
|
|
53
|
+
...buildUserLogsUserIntoTheSystemMutation(client, options),
|
|
54
|
+
...options,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
function mutationKeyUserLogsUserIntoTheSystem() {
|
|
58
|
+
return ["@greensecurity/javascript-sdk", "user", "logsUserIntoTheSystem"];
|
|
59
|
+
}
|
|
60
|
+
function buildUserLogsUserIntoTheSystemMutation(client$, hookOptions) {
|
|
61
|
+
return {
|
|
62
|
+
mutationKey: mutationKeyUserLogsUserIntoTheSystem(),
|
|
63
|
+
mutationFn: function userLogsUserIntoTheSystemMutationFn({ request, options, }) {
|
|
64
|
+
const mergedOptions = {
|
|
65
|
+
...hookOptions,
|
|
66
|
+
...options,
|
|
67
|
+
fetchOptions: {
|
|
68
|
+
...hookOptions?.fetchOptions,
|
|
69
|
+
...options?.fetchOptions,
|
|
70
|
+
signal: (0, primitives_js_1.combineSignals)(hookOptions?.fetchOptions?.signal, options?.fetchOptions?.signal),
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
return (0, fp_js_1.unwrapAsync)((0, userLogsUserIntoTheSystem_js_1.userLogsUserIntoTheSystem)(client$, request, mergedOptions));
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=userLogsUserIntoTheSystem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userLogsUserIntoTheSystem.js","sourceRoot":"","sources":["../src/react-query/userLogsUserIntoTheSystem.ts"],"names":[],"mappings":";AAAA;;GAEG;;AA4DH,oFAgBC;AAED,oFAEC;AAED,wFAkCC;AAlHD,uDAI+B;AAE/B,wFAAkF;AAClF,wDAAsD;AAGtD,0CAA6C;AAC7C,+CAAwD;AAWxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,SAAgB,oCAAoC,CAClD,OAIC;IAMD,MAAM,MAAM,GAAG,IAAA,qCAAuB,GAAE,CAAC;IACzC,OAAO,IAAA,yBAAW,EAAC;QACjB,GAAG,sCAAsC,CAAC,MAAM,EAAE,OAAO,CAAC;QAC1D,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,oCAAoC;IAClD,OAAO,CAAC,+BAA+B,EAAE,MAAM,EAAE,uBAAuB,CAAC,CAAC;AAC5E,CAAC;AAED,SAAgB,sCAAsC,CACpD,OAA0B,EAC1B,WAA4B;IAO5B,OAAO;QACL,WAAW,EAAE,oCAAoC,EAAE;QACnD,UAAU,EAAE,SAAS,mCAAmC,CAAC,EACvD,OAAO,EACP,OAAO,GACR;YACC,MAAM,aAAa,GAAG;gBACpB,GAAG,WAAW;gBACd,GAAG,OAAO;gBACV,YAAY,EAAE;oBACZ,GAAG,WAAW,EAAE,YAAY;oBAC5B,GAAG,OAAO,EAAE,YAAY;oBACxB,MAAM,EAAE,IAAA,8BAAc,EACpB,WAAW,EAAE,YAAY,EAAE,MAAM,EACjC,OAAO,EAAE,YAAY,EAAE,MAAM,CAC9B;iBACF;aACF,CAAC;YACF,OAAO,IAAA,mBAAW,EAAC,IAAA,wDAAyB,EAC1C,OAAO,EACP,OAAO,EACP,aAAa,CACd,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { MutationKey, UseMutationResult } from "@tanstack/react-query";
|
|
2
|
+
import { GreenSecurityCore } from "../core.js";
|
|
3
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
4
|
+
import * as operations from "../models/operations/index.js";
|
|
5
|
+
import { MutationHookOptions } from "./_types.js";
|
|
6
|
+
export type VendorsCreateVendorRegistrationMutationVariables = {
|
|
7
|
+
request: operations.CreateVendorRegistrationRequestBody;
|
|
8
|
+
options?: RequestOptions;
|
|
9
|
+
};
|
|
10
|
+
export type VendorsCreateVendorRegistrationMutationData = operations.CreateVendorRegistrationResponseBody;
|
|
11
|
+
/**
|
|
12
|
+
* Create vendor registration
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* Create an initial vendor registration. Once successful, the vendor will be able to continue to filling out the rest of their onboarding profile.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useVendorsCreateVendorRegistrationMutation(options?: MutationHookOptions<VendorsCreateVendorRegistrationMutationData, Error, VendorsCreateVendorRegistrationMutationVariables>): UseMutationResult<VendorsCreateVendorRegistrationMutationData, Error, VendorsCreateVendorRegistrationMutationVariables>;
|
|
18
|
+
export declare function mutationKeyVendorsCreateVendorRegistration(): MutationKey;
|
|
19
|
+
export declare function buildVendorsCreateVendorRegistrationMutation(client$: GreenSecurityCore, hookOptions?: RequestOptions): {
|
|
20
|
+
mutationKey: MutationKey;
|
|
21
|
+
mutationFn: (variables: VendorsCreateVendorRegistrationMutationVariables) => Promise<VendorsCreateVendorRegistrationMutationData>;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=vendorsCreateVendorRegistration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vendorsCreateVendorRegistration.d.ts","sourceRoot":"","sources":["../src/react-query/vendorsCreateVendorRegistration.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,WAAW,EAEX,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAG/C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,MAAM,gDAAgD,GAAG;IAC7D,OAAO,EAAE,UAAU,CAAC,mCAAmC,CAAC;IACxD,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,2CAA2C,GACrD,UAAU,CAAC,oCAAoC,CAAC;AAElD;;;;;GAKG;AACH,wBAAgB,0CAA0C,CACxD,OAAO,CAAC,EAAE,mBAAmB,CAC3B,2CAA2C,EAC3C,KAAK,EACL,gDAAgD,CACjD,GACA,iBAAiB,CAClB,2CAA2C,EAC3C,KAAK,EACL,gDAAgD,CACjD,CAMA;AAED,wBAAgB,0CAA0C,IAAI,WAAW,CAMxE;AAED,wBAAgB,4CAA4C,CAC1D,OAAO,EAAE,iBAAiB,EAC1B,WAAW,CAAC,EAAE,cAAc,GAC3B;IACD,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,EAAE,CACV,SAAS,EAAE,gDAAgD,KACxD,OAAO,CAAC,2CAA2C,CAAC,CAAC;CAC3D,CA0BA"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useVendorsCreateVendorRegistrationMutation = useVendorsCreateVendorRegistrationMutation;
|
|
7
|
+
exports.mutationKeyVendorsCreateVendorRegistration = mutationKeyVendorsCreateVendorRegistration;
|
|
8
|
+
exports.buildVendorsCreateVendorRegistrationMutation = buildVendorsCreateVendorRegistrationMutation;
|
|
9
|
+
const react_query_1 = require("@tanstack/react-query");
|
|
10
|
+
const vendorsCreateVendorRegistration_js_1 = require("../funcs/vendorsCreateVendorRegistration.js");
|
|
11
|
+
const primitives_js_1 = require("../lib/primitives.js");
|
|
12
|
+
const fp_js_1 = require("../types/fp.js");
|
|
13
|
+
const _context_js_1 = require("./_context.js");
|
|
14
|
+
/**
|
|
15
|
+
* Create vendor registration
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* Create an initial vendor registration. Once successful, the vendor will be able to continue to filling out the rest of their onboarding profile.
|
|
19
|
+
*/
|
|
20
|
+
function useVendorsCreateVendorRegistrationMutation(options) {
|
|
21
|
+
const client = (0, _context_js_1.useGreenSecurityContext)();
|
|
22
|
+
return (0, react_query_1.useMutation)({
|
|
23
|
+
...buildVendorsCreateVendorRegistrationMutation(client, options),
|
|
24
|
+
...options,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function mutationKeyVendorsCreateVendorRegistration() {
|
|
28
|
+
return [
|
|
29
|
+
"@greensecurity/javascript-sdk",
|
|
30
|
+
"vendors",
|
|
31
|
+
"createVendorRegistration",
|
|
32
|
+
];
|
|
33
|
+
}
|
|
34
|
+
function buildVendorsCreateVendorRegistrationMutation(client$, hookOptions) {
|
|
35
|
+
return {
|
|
36
|
+
mutationKey: mutationKeyVendorsCreateVendorRegistration(),
|
|
37
|
+
mutationFn: function vendorsCreateVendorRegistrationMutationFn({ request, options, }) {
|
|
38
|
+
const mergedOptions = {
|
|
39
|
+
...hookOptions,
|
|
40
|
+
...options,
|
|
41
|
+
fetchOptions: {
|
|
42
|
+
...hookOptions?.fetchOptions,
|
|
43
|
+
...options?.fetchOptions,
|
|
44
|
+
signal: (0, primitives_js_1.combineSignals)(hookOptions?.fetchOptions?.signal, options?.fetchOptions?.signal),
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
return (0, fp_js_1.unwrapAsync)((0, vendorsCreateVendorRegistration_js_1.vendorsCreateVendorRegistration)(client$, request, mergedOptions));
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=vendorsCreateVendorRegistration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vendorsCreateVendorRegistration.js","sourceRoot":"","sources":["../src/react-query/vendorsCreateVendorRegistration.ts"],"names":[],"mappings":";AAAA;;GAEG;;AA8BH,gGAgBC;AAED,gGAMC;AAED,oGAkCC;AAxFD,uDAI+B;AAE/B,oGAA8F;AAC9F,wDAAsD;AAGtD,0CAA6C;AAC7C,+CAAwD;AAWxD;;;;;GAKG;AACH,SAAgB,0CAA0C,CACxD,OAIC;IAMD,MAAM,MAAM,GAAG,IAAA,qCAAuB,GAAE,CAAC;IACzC,OAAO,IAAA,yBAAW,EAAC;QACjB,GAAG,4CAA4C,CAAC,MAAM,EAAE,OAAO,CAAC;QAChE,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,0CAA0C;IACxD,OAAO;QACL,+BAA+B;QAC/B,SAAS;QACT,0BAA0B;KAC3B,CAAC;AACJ,CAAC;AAED,SAAgB,4CAA4C,CAC1D,OAA0B,EAC1B,WAA4B;IAO5B,OAAO;QACL,WAAW,EAAE,0CAA0C,EAAE;QACzD,UAAU,EAAE,SAAS,yCAAyC,CAAC,EAC7D,OAAO,EACP,OAAO,GACR;YACC,MAAM,aAAa,GAAG;gBACpB,GAAG,WAAW;gBACd,GAAG,OAAO;gBACV,YAAY,EAAE;oBACZ,GAAG,WAAW,EAAE,YAAY;oBAC5B,GAAG,OAAO,EAAE,YAAY;oBACxB,MAAM,EAAE,IAAA,8BAAc,EACpB,WAAW,EAAE,YAAY,EAAE,MAAM,EACjC,OAAO,EAAE,YAAY,EAAE,MAAM,CAC9B;iBACF;aACF,CAAC;YACF,OAAO,IAAA,mBAAW,EAAC,IAAA,oEAA+B,EAChD,OAAO,EACP,OAAO,EACP,aAAa,CACd,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
|