@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,152 @@
|
|
|
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 { userGetUserById } from "../funcs/userGetUserById.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 UserGetUserByIdQueryData = components.User;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Get user by id
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* Returns a user object for the user represented by the identifier in the path.
|
|
36
|
+
*/
|
|
37
|
+
export function useUserGetUserById(
|
|
38
|
+
request: operations.GetUserByIdRequest,
|
|
39
|
+
options?: QueryHookOptions<UserGetUserByIdQueryData>,
|
|
40
|
+
): UseQueryResult<UserGetUserByIdQueryData, Error> {
|
|
41
|
+
const client = useGreenSecurityContext();
|
|
42
|
+
return useQuery({
|
|
43
|
+
...buildUserGetUserByIdQuery(
|
|
44
|
+
client,
|
|
45
|
+
request,
|
|
46
|
+
options,
|
|
47
|
+
),
|
|
48
|
+
...options,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Get user by id
|
|
54
|
+
*
|
|
55
|
+
* @remarks
|
|
56
|
+
* Returns a user object for the user represented by the identifier in the path.
|
|
57
|
+
*/
|
|
58
|
+
export function useUserGetUserByIdSuspense(
|
|
59
|
+
request: operations.GetUserByIdRequest,
|
|
60
|
+
options?: SuspenseQueryHookOptions<UserGetUserByIdQueryData>,
|
|
61
|
+
): UseSuspenseQueryResult<UserGetUserByIdQueryData, Error> {
|
|
62
|
+
const client = useGreenSecurityContext();
|
|
63
|
+
return useSuspenseQuery({
|
|
64
|
+
...buildUserGetUserByIdQuery(
|
|
65
|
+
client,
|
|
66
|
+
request,
|
|
67
|
+
options,
|
|
68
|
+
),
|
|
69
|
+
...options,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function prefetchUserGetUserById(
|
|
74
|
+
queryClient: QueryClient,
|
|
75
|
+
client$: GreenSecurityCore,
|
|
76
|
+
request: operations.GetUserByIdRequest,
|
|
77
|
+
): Promise<void> {
|
|
78
|
+
return queryClient.prefetchQuery({
|
|
79
|
+
...buildUserGetUserByIdQuery(
|
|
80
|
+
client$,
|
|
81
|
+
request,
|
|
82
|
+
),
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function setUserGetUserByIdData(
|
|
87
|
+
client: QueryClient,
|
|
88
|
+
queryKeyBase: [id: number],
|
|
89
|
+
data: UserGetUserByIdQueryData,
|
|
90
|
+
): UserGetUserByIdQueryData | undefined {
|
|
91
|
+
const key = queryKeyUserGetUserById(...queryKeyBase);
|
|
92
|
+
|
|
93
|
+
return client.setQueryData<UserGetUserByIdQueryData>(key, data);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function invalidateUserGetUserById(
|
|
97
|
+
client: QueryClient,
|
|
98
|
+
queryKeyBase: TupleToPrefixes<[id: number]>,
|
|
99
|
+
filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
|
|
100
|
+
): Promise<void> {
|
|
101
|
+
return client.invalidateQueries({
|
|
102
|
+
...filters,
|
|
103
|
+
queryKey: [
|
|
104
|
+
"@greensecurity/javascript-sdk",
|
|
105
|
+
"user",
|
|
106
|
+
"getUserById",
|
|
107
|
+
...queryKeyBase,
|
|
108
|
+
],
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function invalidateAllUserGetUserById(
|
|
113
|
+
client: QueryClient,
|
|
114
|
+
filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
|
|
115
|
+
): Promise<void> {
|
|
116
|
+
return client.invalidateQueries({
|
|
117
|
+
...filters,
|
|
118
|
+
queryKey: ["@greensecurity/javascript-sdk", "user", "getUserById"],
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export function buildUserGetUserByIdQuery(
|
|
123
|
+
client$: GreenSecurityCore,
|
|
124
|
+
request: operations.GetUserByIdRequest,
|
|
125
|
+
options?: RequestOptions,
|
|
126
|
+
): {
|
|
127
|
+
queryKey: QueryKey;
|
|
128
|
+
queryFn: (context: QueryFunctionContext) => Promise<UserGetUserByIdQueryData>;
|
|
129
|
+
} {
|
|
130
|
+
return {
|
|
131
|
+
queryKey: queryKeyUserGetUserById(request.id),
|
|
132
|
+
queryFn: async function userGetUserByIdQueryFn(
|
|
133
|
+
ctx,
|
|
134
|
+
): Promise<UserGetUserByIdQueryData> {
|
|
135
|
+
const sig = combineSignals(ctx.signal, options?.fetchOptions?.signal);
|
|
136
|
+
const mergedOptions = {
|
|
137
|
+
...options,
|
|
138
|
+
fetchOptions: { ...options?.fetchOptions, signal: sig },
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
return unwrapAsync(userGetUserById(
|
|
142
|
+
client$,
|
|
143
|
+
request,
|
|
144
|
+
mergedOptions,
|
|
145
|
+
));
|
|
146
|
+
},
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export function queryKeyUserGetUserById(id: number): QueryKey {
|
|
151
|
+
return ["@greensecurity/javascript-sdk", "user", "getUserById", id];
|
|
152
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
MutationKey,
|
|
7
|
+
useMutation,
|
|
8
|
+
UseMutationResult,
|
|
9
|
+
} from "@tanstack/react-query";
|
|
10
|
+
import { GreenSecurityCore } from "../core.js";
|
|
11
|
+
import { userLogsUserIntoTheSystem } from "../funcs/userLogsUserIntoTheSystem.js";
|
|
12
|
+
import { combineSignals } from "../lib/primitives.js";
|
|
13
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
14
|
+
import * as operations from "../models/operations/index.js";
|
|
15
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
16
|
+
import { useGreenSecurityContext } from "./_context.js";
|
|
17
|
+
import { MutationHookOptions } from "./_types.js";
|
|
18
|
+
|
|
19
|
+
export type UserLogsUserIntoTheSystemMutationVariables = {
|
|
20
|
+
request: operations.LogsUserIntoTheSystemRequestBody;
|
|
21
|
+
options?: RequestOptions;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type UserLogsUserIntoTheSystemMutationData =
|
|
25
|
+
operations.LogsUserIntoTheSystemResponse;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Logs user into the system
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* This endpoint allows a user to authenticate themselves and retrieve a permanent token for access.
|
|
32
|
+
*
|
|
33
|
+
* Permanent tokens should only ever be stored in an encrypted storage because they represent a fully logged in user.
|
|
34
|
+
*
|
|
35
|
+
* 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.
|
|
36
|
+
*
|
|
37
|
+
* 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.
|
|
38
|
+
*
|
|
39
|
+
* 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.
|
|
40
|
+
*
|
|
41
|
+
* The ideal flow for a login sequence is the following:
|
|
42
|
+
*
|
|
43
|
+
* 1. Present an email address field only and allow the user to submit
|
|
44
|
+
* 2. Send `email` and `return_url` payload to this endpoint
|
|
45
|
+
* 3. Follow the flow based on the response `requires` field
|
|
46
|
+
*
|
|
47
|
+
* Requires: `password`
|
|
48
|
+
*
|
|
49
|
+
* 1. Show a password field for the user to fill out
|
|
50
|
+
* 2. Submit the `email` and `password` to this endpoint
|
|
51
|
+
* 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
|
|
52
|
+
* 4. Submit `email`, `password`, `mfa_code` to this endpoint
|
|
53
|
+
* 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.
|
|
54
|
+
*
|
|
55
|
+
* Requires: `saml_login`
|
|
56
|
+
*
|
|
57
|
+
* 1. [Open a browser](https://docs.expo.dev/versions/latest/sdk/webbrowser/#webbrowseropenauthsessionasyncurl-redirecturl-options) to the url returned in `sso_url`
|
|
58
|
+
* 2. User completes sign-in using their configured SAML IdP
|
|
59
|
+
* 3. Site redirects to your selected `return_url`
|
|
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
|
+
* 5. Fetch the user object from `/users/me` using the token
|
|
62
|
+
*/
|
|
63
|
+
export function useUserLogsUserIntoTheSystemMutation(
|
|
64
|
+
options?: MutationHookOptions<
|
|
65
|
+
UserLogsUserIntoTheSystemMutationData,
|
|
66
|
+
Error,
|
|
67
|
+
UserLogsUserIntoTheSystemMutationVariables
|
|
68
|
+
>,
|
|
69
|
+
): UseMutationResult<
|
|
70
|
+
UserLogsUserIntoTheSystemMutationData,
|
|
71
|
+
Error,
|
|
72
|
+
UserLogsUserIntoTheSystemMutationVariables
|
|
73
|
+
> {
|
|
74
|
+
const client = useGreenSecurityContext();
|
|
75
|
+
return useMutation({
|
|
76
|
+
...buildUserLogsUserIntoTheSystemMutation(client, options),
|
|
77
|
+
...options,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function mutationKeyUserLogsUserIntoTheSystem(): MutationKey {
|
|
82
|
+
return ["@greensecurity/javascript-sdk", "user", "logsUserIntoTheSystem"];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function buildUserLogsUserIntoTheSystemMutation(
|
|
86
|
+
client$: GreenSecurityCore,
|
|
87
|
+
hookOptions?: RequestOptions,
|
|
88
|
+
): {
|
|
89
|
+
mutationKey: MutationKey;
|
|
90
|
+
mutationFn: (
|
|
91
|
+
variables: UserLogsUserIntoTheSystemMutationVariables,
|
|
92
|
+
) => Promise<UserLogsUserIntoTheSystemMutationData>;
|
|
93
|
+
} {
|
|
94
|
+
return {
|
|
95
|
+
mutationKey: mutationKeyUserLogsUserIntoTheSystem(),
|
|
96
|
+
mutationFn: function userLogsUserIntoTheSystemMutationFn({
|
|
97
|
+
request,
|
|
98
|
+
options,
|
|
99
|
+
}): Promise<UserLogsUserIntoTheSystemMutationData> {
|
|
100
|
+
const mergedOptions = {
|
|
101
|
+
...hookOptions,
|
|
102
|
+
...options,
|
|
103
|
+
fetchOptions: {
|
|
104
|
+
...hookOptions?.fetchOptions,
|
|
105
|
+
...options?.fetchOptions,
|
|
106
|
+
signal: combineSignals(
|
|
107
|
+
hookOptions?.fetchOptions?.signal,
|
|
108
|
+
options?.fetchOptions?.signal,
|
|
109
|
+
),
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
return unwrapAsync(userLogsUserIntoTheSystem(
|
|
113
|
+
client$,
|
|
114
|
+
request,
|
|
115
|
+
mergedOptions,
|
|
116
|
+
));
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
MutationKey,
|
|
7
|
+
useMutation,
|
|
8
|
+
UseMutationResult,
|
|
9
|
+
} from "@tanstack/react-query";
|
|
10
|
+
import { GreenSecurityCore } from "../core.js";
|
|
11
|
+
import { vendorsCreateVendorRegistration } from "../funcs/vendorsCreateVendorRegistration.js";
|
|
12
|
+
import { combineSignals } from "../lib/primitives.js";
|
|
13
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
14
|
+
import * as operations from "../models/operations/index.js";
|
|
15
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
16
|
+
import { useGreenSecurityContext } from "./_context.js";
|
|
17
|
+
import { MutationHookOptions } from "./_types.js";
|
|
18
|
+
|
|
19
|
+
export type VendorsCreateVendorRegistrationMutationVariables = {
|
|
20
|
+
request: operations.CreateVendorRegistrationRequestBody;
|
|
21
|
+
options?: RequestOptions;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type VendorsCreateVendorRegistrationMutationData =
|
|
25
|
+
operations.CreateVendorRegistrationResponseBody;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Create vendor registration
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* Create an initial vendor registration. Once successful, the vendor will be able to continue to filling out the rest of their onboarding profile.
|
|
32
|
+
*/
|
|
33
|
+
export function useVendorsCreateVendorRegistrationMutation(
|
|
34
|
+
options?: MutationHookOptions<
|
|
35
|
+
VendorsCreateVendorRegistrationMutationData,
|
|
36
|
+
Error,
|
|
37
|
+
VendorsCreateVendorRegistrationMutationVariables
|
|
38
|
+
>,
|
|
39
|
+
): UseMutationResult<
|
|
40
|
+
VendorsCreateVendorRegistrationMutationData,
|
|
41
|
+
Error,
|
|
42
|
+
VendorsCreateVendorRegistrationMutationVariables
|
|
43
|
+
> {
|
|
44
|
+
const client = useGreenSecurityContext();
|
|
45
|
+
return useMutation({
|
|
46
|
+
...buildVendorsCreateVendorRegistrationMutation(client, options),
|
|
47
|
+
...options,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function mutationKeyVendorsCreateVendorRegistration(): MutationKey {
|
|
52
|
+
return [
|
|
53
|
+
"@greensecurity/javascript-sdk",
|
|
54
|
+
"vendors",
|
|
55
|
+
"createVendorRegistration",
|
|
56
|
+
];
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function buildVendorsCreateVendorRegistrationMutation(
|
|
60
|
+
client$: GreenSecurityCore,
|
|
61
|
+
hookOptions?: RequestOptions,
|
|
62
|
+
): {
|
|
63
|
+
mutationKey: MutationKey;
|
|
64
|
+
mutationFn: (
|
|
65
|
+
variables: VendorsCreateVendorRegistrationMutationVariables,
|
|
66
|
+
) => Promise<VendorsCreateVendorRegistrationMutationData>;
|
|
67
|
+
} {
|
|
68
|
+
return {
|
|
69
|
+
mutationKey: mutationKeyVendorsCreateVendorRegistration(),
|
|
70
|
+
mutationFn: function vendorsCreateVendorRegistrationMutationFn({
|
|
71
|
+
request,
|
|
72
|
+
options,
|
|
73
|
+
}): Promise<VendorsCreateVendorRegistrationMutationData> {
|
|
74
|
+
const mergedOptions = {
|
|
75
|
+
...hookOptions,
|
|
76
|
+
...options,
|
|
77
|
+
fetchOptions: {
|
|
78
|
+
...hookOptions?.fetchOptions,
|
|
79
|
+
...options?.fetchOptions,
|
|
80
|
+
signal: combineSignals(
|
|
81
|
+
hookOptions?.fetchOptions?.signal,
|
|
82
|
+
options?.fetchOptions?.signal,
|
|
83
|
+
),
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
return unwrapAsync(vendorsCreateVendorRegistration(
|
|
87
|
+
client$,
|
|
88
|
+
request,
|
|
89
|
+
mergedOptions,
|
|
90
|
+
));
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
}
|
|
@@ -0,0 +1,194 @@
|
|
|
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 { vendorsListVendorJobTitles } from "../funcs/vendorsListVendorJobTitles.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 VendorsListVendorJobTitlesQueryData =
|
|
30
|
+
operations.ListVendorJobTitlesResponseBody;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* List vendor job titles
|
|
34
|
+
*
|
|
35
|
+
* @remarks
|
|
36
|
+
* List valid job titles for Vendors. This can be used during sign up or in a filter.
|
|
37
|
+
*/
|
|
38
|
+
export function useVendorsListVendorJobTitles(
|
|
39
|
+
request: operations.ListVendorJobTitlesRequest,
|
|
40
|
+
options?: QueryHookOptions<VendorsListVendorJobTitlesQueryData>,
|
|
41
|
+
): UseQueryResult<VendorsListVendorJobTitlesQueryData, Error> {
|
|
42
|
+
const client = useGreenSecurityContext();
|
|
43
|
+
return useQuery({
|
|
44
|
+
...buildVendorsListVendorJobTitlesQuery(
|
|
45
|
+
client,
|
|
46
|
+
request,
|
|
47
|
+
options,
|
|
48
|
+
),
|
|
49
|
+
...options,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* List vendor job titles
|
|
55
|
+
*
|
|
56
|
+
* @remarks
|
|
57
|
+
* List valid job titles for Vendors. This can be used during sign up or in a filter.
|
|
58
|
+
*/
|
|
59
|
+
export function useVendorsListVendorJobTitlesSuspense(
|
|
60
|
+
request: operations.ListVendorJobTitlesRequest,
|
|
61
|
+
options?: SuspenseQueryHookOptions<VendorsListVendorJobTitlesQueryData>,
|
|
62
|
+
): UseSuspenseQueryResult<VendorsListVendorJobTitlesQueryData, Error> {
|
|
63
|
+
const client = useGreenSecurityContext();
|
|
64
|
+
return useSuspenseQuery({
|
|
65
|
+
...buildVendorsListVendorJobTitlesQuery(
|
|
66
|
+
client,
|
|
67
|
+
request,
|
|
68
|
+
options,
|
|
69
|
+
),
|
|
70
|
+
...options,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function prefetchVendorsListVendorJobTitles(
|
|
75
|
+
queryClient: QueryClient,
|
|
76
|
+
client$: GreenSecurityCore,
|
|
77
|
+
request: operations.ListVendorJobTitlesRequest,
|
|
78
|
+
): Promise<void> {
|
|
79
|
+
return queryClient.prefetchQuery({
|
|
80
|
+
...buildVendorsListVendorJobTitlesQuery(
|
|
81
|
+
client$,
|
|
82
|
+
request,
|
|
83
|
+
),
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function setVendorsListVendorJobTitlesData(
|
|
88
|
+
client: QueryClient,
|
|
89
|
+
queryKeyBase: [
|
|
90
|
+
parameters: {
|
|
91
|
+
sort?: string | null | undefined;
|
|
92
|
+
desc?: components.Desc | undefined;
|
|
93
|
+
page?: number | undefined;
|
|
94
|
+
itemsPerPage?: number | undefined;
|
|
95
|
+
jobLike?: string | undefined;
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
data: VendorsListVendorJobTitlesQueryData,
|
|
99
|
+
): VendorsListVendorJobTitlesQueryData | undefined {
|
|
100
|
+
const key = queryKeyVendorsListVendorJobTitles(...queryKeyBase);
|
|
101
|
+
|
|
102
|
+
return client.setQueryData<VendorsListVendorJobTitlesQueryData>(key, data);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export function invalidateVendorsListVendorJobTitles(
|
|
106
|
+
client: QueryClient,
|
|
107
|
+
queryKeyBase: TupleToPrefixes<
|
|
108
|
+
[parameters: {
|
|
109
|
+
sort?: string | null | undefined;
|
|
110
|
+
desc?: components.Desc | undefined;
|
|
111
|
+
page?: number | undefined;
|
|
112
|
+
itemsPerPage?: number | undefined;
|
|
113
|
+
jobLike?: string | undefined;
|
|
114
|
+
}]
|
|
115
|
+
>,
|
|
116
|
+
filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
|
|
117
|
+
): Promise<void> {
|
|
118
|
+
return client.invalidateQueries({
|
|
119
|
+
...filters,
|
|
120
|
+
queryKey: [
|
|
121
|
+
"@greensecurity/javascript-sdk",
|
|
122
|
+
"vendors",
|
|
123
|
+
"listVendorJobTitles",
|
|
124
|
+
...queryKeyBase,
|
|
125
|
+
],
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export function invalidateAllVendorsListVendorJobTitles(
|
|
130
|
+
client: QueryClient,
|
|
131
|
+
filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
|
|
132
|
+
): Promise<void> {
|
|
133
|
+
return client.invalidateQueries({
|
|
134
|
+
...filters,
|
|
135
|
+
queryKey: [
|
|
136
|
+
"@greensecurity/javascript-sdk",
|
|
137
|
+
"vendors",
|
|
138
|
+
"listVendorJobTitles",
|
|
139
|
+
],
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export function buildVendorsListVendorJobTitlesQuery(
|
|
144
|
+
client$: GreenSecurityCore,
|
|
145
|
+
request: operations.ListVendorJobTitlesRequest,
|
|
146
|
+
options?: RequestOptions,
|
|
147
|
+
): {
|
|
148
|
+
queryKey: QueryKey;
|
|
149
|
+
queryFn: (
|
|
150
|
+
context: QueryFunctionContext,
|
|
151
|
+
) => Promise<VendorsListVendorJobTitlesQueryData>;
|
|
152
|
+
} {
|
|
153
|
+
return {
|
|
154
|
+
queryKey: queryKeyVendorsListVendorJobTitles({
|
|
155
|
+
sort: request.sort,
|
|
156
|
+
desc: request.desc,
|
|
157
|
+
page: request.page,
|
|
158
|
+
itemsPerPage: request.itemsPerPage,
|
|
159
|
+
jobLike: request.jobLike,
|
|
160
|
+
}),
|
|
161
|
+
queryFn: async function vendorsListVendorJobTitlesQueryFn(
|
|
162
|
+
ctx,
|
|
163
|
+
): Promise<VendorsListVendorJobTitlesQueryData> {
|
|
164
|
+
const sig = combineSignals(ctx.signal, options?.fetchOptions?.signal);
|
|
165
|
+
const mergedOptions = {
|
|
166
|
+
...options,
|
|
167
|
+
fetchOptions: { ...options?.fetchOptions, signal: sig },
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
return unwrapAsync(vendorsListVendorJobTitles(
|
|
171
|
+
client$,
|
|
172
|
+
request,
|
|
173
|
+
mergedOptions,
|
|
174
|
+
));
|
|
175
|
+
},
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export function queryKeyVendorsListVendorJobTitles(
|
|
180
|
+
parameters: {
|
|
181
|
+
sort?: string | null | undefined;
|
|
182
|
+
desc?: components.Desc | undefined;
|
|
183
|
+
page?: number | undefined;
|
|
184
|
+
itemsPerPage?: number | undefined;
|
|
185
|
+
jobLike?: string | undefined;
|
|
186
|
+
},
|
|
187
|
+
): QueryKey {
|
|
188
|
+
return [
|
|
189
|
+
"@greensecurity/javascript-sdk",
|
|
190
|
+
"vendors",
|
|
191
|
+
"listVendorJobTitles",
|
|
192
|
+
parameters,
|
|
193
|
+
];
|
|
194
|
+
}
|
package/src/sdk/index.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { organizationsGetFacility } from "../funcs/organizationsGetFacility.js";
|
|
6
|
+
import { organizationsListOrSearchFacilities } from "../funcs/organizationsListOrSearchFacilities.js";
|
|
7
|
+
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
8
|
+
import * as components from "../models/components/index.js";
|
|
9
|
+
import * as operations from "../models/operations/index.js";
|
|
10
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
11
|
+
|
|
12
|
+
export class Organizations extends ClientSDK {
|
|
13
|
+
/**
|
|
14
|
+
* List or search facilities
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
* List or search facilities.
|
|
18
|
+
*
|
|
19
|
+
* Available `expand` scopes are:
|
|
20
|
+
*
|
|
21
|
+
* - facility.appointment_policy
|
|
22
|
+
* - facility.contacts
|
|
23
|
+
* - facility.vendor_counts
|
|
24
|
+
* - facility.flu_credential
|
|
25
|
+
* - facility.scrubs_policy
|
|
26
|
+
* - facility.system
|
|
27
|
+
* - facility.vendor_guest_policy
|
|
28
|
+
* - facility.vendor_policy
|
|
29
|
+
* - facility.visitor_policy
|
|
30
|
+
* - facility.workflow
|
|
31
|
+
*/
|
|
32
|
+
async listOrSearchFacilities(
|
|
33
|
+
request: operations.ListOrSearchFacilitiesRequest,
|
|
34
|
+
options?: RequestOptions,
|
|
35
|
+
): Promise<operations.ListOrSearchFacilitiesResponseBody> {
|
|
36
|
+
return unwrapAsync(organizationsListOrSearchFacilities(
|
|
37
|
+
this,
|
|
38
|
+
request,
|
|
39
|
+
options,
|
|
40
|
+
));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Get facility
|
|
45
|
+
*
|
|
46
|
+
* @remarks
|
|
47
|
+
* Retrieve an individual facility.
|
|
48
|
+
*/
|
|
49
|
+
async getFacility(
|
|
50
|
+
request: operations.GetFacilityRequest,
|
|
51
|
+
options?: RequestOptions,
|
|
52
|
+
): Promise<components.Facility> {
|
|
53
|
+
return unwrapAsync(organizationsGetFacility(
|
|
54
|
+
this,
|
|
55
|
+
request,
|
|
56
|
+
options,
|
|
57
|
+
));
|
|
58
|
+
}
|
|
59
|
+
}
|
package/src/sdk/sdk.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { ClientSDK } from "../lib/sdks.js";
|
|
6
|
+
import { Organizations } from "./organizations.js";
|
|
7
|
+
import { User } from "./user.js";
|
|
8
|
+
import { Vendors } from "./vendors.js";
|
|
9
|
+
|
|
10
|
+
export class GreenSecurity extends ClientSDK {
|
|
11
|
+
private _vendors?: Vendors;
|
|
12
|
+
get vendors(): Vendors {
|
|
13
|
+
return (this._vendors ??= new Vendors(this._options));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
private _user?: User;
|
|
17
|
+
get user(): User {
|
|
18
|
+
return (this._user ??= new User(this._options));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
private _organizations?: Organizations;
|
|
22
|
+
get organizations(): Organizations {
|
|
23
|
+
return (this._organizations ??= new Organizations(this._options));
|
|
24
|
+
}
|
|
25
|
+
}
|