@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
package/src/sdk/user.ts
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { userGetCurrentUser } from "../funcs/userGetCurrentUser.js";
|
|
6
|
+
import { userGetUserById } from "../funcs/userGetUserById.js";
|
|
7
|
+
import { userLogsUserIntoTheSystem } from "../funcs/userLogsUserIntoTheSystem.js";
|
|
8
|
+
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
9
|
+
import * as components from "../models/components/index.js";
|
|
10
|
+
import * as operations from "../models/operations/index.js";
|
|
11
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
12
|
+
|
|
13
|
+
export class User extends ClientSDK {
|
|
14
|
+
/**
|
|
15
|
+
* Get current user
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* Returns a user object for the user represented by the authorization token
|
|
19
|
+
*/
|
|
20
|
+
async getCurrentUser(
|
|
21
|
+
options?: RequestOptions,
|
|
22
|
+
): Promise<components.User> {
|
|
23
|
+
return unwrapAsync(userGetCurrentUser(
|
|
24
|
+
this,
|
|
25
|
+
options,
|
|
26
|
+
));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Get user by id
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Returns a user object for the user represented by the identifier in the path.
|
|
34
|
+
*/
|
|
35
|
+
async getUserById(
|
|
36
|
+
request: operations.GetUserByIdRequest,
|
|
37
|
+
options?: RequestOptions,
|
|
38
|
+
): Promise<components.User> {
|
|
39
|
+
return unwrapAsync(userGetUserById(
|
|
40
|
+
this,
|
|
41
|
+
request,
|
|
42
|
+
options,
|
|
43
|
+
));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Logs user into the system
|
|
48
|
+
*
|
|
49
|
+
* @remarks
|
|
50
|
+
* This endpoint allows a user to authenticate themselves and retrieve a permanent token for access.
|
|
51
|
+
*
|
|
52
|
+
* Permanent tokens should only ever be stored in an encrypted storage because they represent a fully logged in user.
|
|
53
|
+
*
|
|
54
|
+
* 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.
|
|
55
|
+
*
|
|
56
|
+
* 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.
|
|
57
|
+
*
|
|
58
|
+
* 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.
|
|
59
|
+
*
|
|
60
|
+
* The ideal flow for a login sequence is the following:
|
|
61
|
+
*
|
|
62
|
+
* 1. Present an email address field only and allow the user to submit
|
|
63
|
+
* 2. Send `email` and `return_url` payload to this endpoint
|
|
64
|
+
* 3. Follow the flow based on the response `requires` field
|
|
65
|
+
*
|
|
66
|
+
* Requires: `password`
|
|
67
|
+
*
|
|
68
|
+
* 1. Show a password field for the user to fill out
|
|
69
|
+
* 2. Submit the `email` and `password` to this endpoint
|
|
70
|
+
* 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
|
|
71
|
+
* 4. Submit `email`, `password`, `mfa_code` to this endpoint
|
|
72
|
+
* 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.
|
|
73
|
+
*
|
|
74
|
+
* Requires: `saml_login`
|
|
75
|
+
*
|
|
76
|
+
* 1. [Open a browser](https://docs.expo.dev/versions/latest/sdk/webbrowser/#webbrowseropenauthsessionasyncurl-redirecturl-options) to the url returned in `sso_url`
|
|
77
|
+
* 2. User completes sign-in using their configured SAML IdP
|
|
78
|
+
* 3. Site redirects to your selected `return_url`
|
|
79
|
+
* 4. The `user_token` will be appended as a query string parameter to your `return_url` - you must parse this token and store it
|
|
80
|
+
* 5. Fetch the user object from `/users/me` using the token
|
|
81
|
+
*/
|
|
82
|
+
async logsUserIntoTheSystem(
|
|
83
|
+
request: operations.LogsUserIntoTheSystemRequestBody,
|
|
84
|
+
options?: RequestOptions,
|
|
85
|
+
): Promise<operations.LogsUserIntoTheSystemResponse> {
|
|
86
|
+
return unwrapAsync(userLogsUserIntoTheSystem(
|
|
87
|
+
this,
|
|
88
|
+
request,
|
|
89
|
+
options,
|
|
90
|
+
));
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { vendorsCreateVendorRegistration } from "../funcs/vendorsCreateVendorRegistration.js";
|
|
6
|
+
import { vendorsListVendorJobTitles } from "../funcs/vendorsListVendorJobTitles.js";
|
|
7
|
+
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
8
|
+
import * as operations from "../models/operations/index.js";
|
|
9
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
10
|
+
|
|
11
|
+
export class Vendors extends ClientSDK {
|
|
12
|
+
/**
|
|
13
|
+
* Create vendor registration
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* Create an initial vendor registration. Once successful, the vendor will be able to continue to filling out the rest of their onboarding profile.
|
|
17
|
+
*/
|
|
18
|
+
async createVendorRegistration(
|
|
19
|
+
request: operations.CreateVendorRegistrationRequestBody,
|
|
20
|
+
options?: RequestOptions,
|
|
21
|
+
): Promise<operations.CreateVendorRegistrationResponseBody> {
|
|
22
|
+
return unwrapAsync(vendorsCreateVendorRegistration(
|
|
23
|
+
this,
|
|
24
|
+
request,
|
|
25
|
+
options,
|
|
26
|
+
));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* List vendor job titles
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* List valid job titles for Vendors. This can be used during sign up or in a filter.
|
|
34
|
+
*/
|
|
35
|
+
async listVendorJobTitles(
|
|
36
|
+
request: operations.ListVendorJobTitlesRequest,
|
|
37
|
+
options?: RequestOptions,
|
|
38
|
+
): Promise<operations.ListVendorJobTitlesResponseBody> {
|
|
39
|
+
return unwrapAsync(vendorsListVendorJobTitles(
|
|
40
|
+
this,
|
|
41
|
+
request,
|
|
42
|
+
options,
|
|
43
|
+
));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
|
|
7
|
+
export const blobLikeSchema: z.ZodType<Blob, z.ZodTypeDef, Blob> =
|
|
8
|
+
z.custom<Blob>(isBlobLike, {
|
|
9
|
+
message: "expected a Blob, File or Blob-like object",
|
|
10
|
+
fatal: true,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export function isBlobLike(val: unknown): val is Blob {
|
|
14
|
+
if (val instanceof Blob) {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (typeof val !== "object" || val == null || !(Symbol.toStringTag in val)) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const name = val[Symbol.toStringTag];
|
|
23
|
+
if (typeof name !== "string") {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
if (name !== "Blob" && name !== "File") {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return "stream" in val && typeof val.stream === "function";
|
|
31
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
|
|
7
|
+
export function constDateTime(
|
|
8
|
+
val: string,
|
|
9
|
+
): z.ZodType<string, z.ZodTypeDef, unknown> {
|
|
10
|
+
return z.custom<string>((v) => {
|
|
11
|
+
return (
|
|
12
|
+
typeof v === "string" && new Date(v).getTime() === new Date(val).getTime()
|
|
13
|
+
);
|
|
14
|
+
}, `Value must be equivelant to ${val}`);
|
|
15
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
declare const __brand: unique symbol;
|
|
6
|
+
export type Unrecognized<T> = T & { [__brand]: "unrecognized" };
|
|
7
|
+
|
|
8
|
+
export function catchUnrecognizedEnum<T>(value: T): Unrecognized<T> {
|
|
9
|
+
return value as Unrecognized<T>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
type Prettify<T> = { [K in keyof T]: T[K] } & {};
|
|
13
|
+
export type ClosedEnum<T> = T[keyof T];
|
|
14
|
+
export type OpenEnum<T> =
|
|
15
|
+
| Prettify<T[keyof T]>
|
|
16
|
+
| Unrecognized<T[keyof T] extends number ? number : string>;
|
package/src/types/fp.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A monad that captures the result of a function call or an error if it was not
|
|
7
|
+
* successful. Railway programming, enabled by this type, can be a nicer
|
|
8
|
+
* alternative to traditional exception throwing because it allows functions to
|
|
9
|
+
* declare all _known_ errors with static types and then check for them
|
|
10
|
+
* exhaustively in application code. Thrown exception have a type of `unknown`
|
|
11
|
+
* and break out of regular control flow of programs making them harder to
|
|
12
|
+
* inspect and more verbose work with due to try-catch blocks.
|
|
13
|
+
*/
|
|
14
|
+
export type Result<T, E = unknown> =
|
|
15
|
+
| { ok: true; value: T; error?: never }
|
|
16
|
+
| { ok: false; value?: never; error: E };
|
|
17
|
+
|
|
18
|
+
export function OK<V>(value: V): Result<V, never> {
|
|
19
|
+
return { ok: true, value };
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function ERR<E>(error: E): Result<never, E> {
|
|
23
|
+
return { ok: false, error };
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* unwrap is a convenience function for extracting a value from a result or
|
|
28
|
+
* throwing if there was an error.
|
|
29
|
+
*/
|
|
30
|
+
export function unwrap<T>(r: Result<T, unknown>): T {
|
|
31
|
+
if (!r.ok) {
|
|
32
|
+
throw r.error;
|
|
33
|
+
}
|
|
34
|
+
return r.value;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* unwrapAsync is a convenience function for resolving a value from a Promise
|
|
39
|
+
* of a result or rejecting if an error occurred.
|
|
40
|
+
*/
|
|
41
|
+
export async function unwrapAsync<T>(
|
|
42
|
+
pr: Promise<Result<T, unknown>>,
|
|
43
|
+
): Promise<T> {
|
|
44
|
+
const r = await pr;
|
|
45
|
+
if (!r.ok) {
|
|
46
|
+
throw r.error;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return r.value;
|
|
50
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export { blobLikeSchema, isBlobLike } from "./blobs.js";
|
|
6
|
+
export { catchUnrecognizedEnum } from "./enums.js";
|
|
7
|
+
export type { ClosedEnum, OpenEnum, Unrecognized } from "./enums.js";
|
|
8
|
+
export type { Result } from "./fp.js";
|
|
9
|
+
export type { PageIterator, Paginator } from "./operations.js";
|
|
10
|
+
export { createPageIterator } from "./operations.js";
|
|
11
|
+
export { RFCDate } from "./rfcdate.js";
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { Result } from "./fp.js";
|
|
6
|
+
|
|
7
|
+
export type Paginator<V> = () => Promise<V & { next: Paginator<V> }> | null;
|
|
8
|
+
|
|
9
|
+
export type PageIterator<V, PageState = unknown> = V & {
|
|
10
|
+
next: Paginator<V>;
|
|
11
|
+
[Symbol.asyncIterator]: () => AsyncIterableIterator<V>;
|
|
12
|
+
"~next"?: PageState | undefined;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export function createPageIterator<V>(
|
|
16
|
+
page: V & { next: Paginator<V> },
|
|
17
|
+
halt: (v: V) => boolean,
|
|
18
|
+
): {
|
|
19
|
+
[Symbol.asyncIterator]: () => AsyncIterableIterator<V>;
|
|
20
|
+
} {
|
|
21
|
+
return {
|
|
22
|
+
[Symbol.asyncIterator]: async function* paginator() {
|
|
23
|
+
yield page;
|
|
24
|
+
if (halt(page)) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
let p: typeof page | null = page;
|
|
29
|
+
for (p = await p.next(); p != null; p = await p.next()) {
|
|
30
|
+
yield p;
|
|
31
|
+
if (halt(p)) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* This utility create a special iterator that yields a single value and
|
|
41
|
+
* terminates. It is useful in paginated SDK functions that have early return
|
|
42
|
+
* paths when things go wrong.
|
|
43
|
+
*/
|
|
44
|
+
export function haltIterator<V extends object>(
|
|
45
|
+
v: V,
|
|
46
|
+
): PageIterator<V, undefined> {
|
|
47
|
+
return {
|
|
48
|
+
...v,
|
|
49
|
+
next: () => null,
|
|
50
|
+
[Symbol.asyncIterator]: async function* paginator() {
|
|
51
|
+
yield v;
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Converts an async iterator of `Result<V, E>` into an async iterator of `V`.
|
|
58
|
+
* When error results occur, the underlying error value is thrown.
|
|
59
|
+
*/
|
|
60
|
+
export async function unwrapResultIterator<V, PageState>(
|
|
61
|
+
iteratorPromise: Promise<PageIterator<Result<V, unknown>, PageState>>,
|
|
62
|
+
): Promise<PageIterator<V, PageState>> {
|
|
63
|
+
const resultIter = await iteratorPromise;
|
|
64
|
+
|
|
65
|
+
if (!resultIter.ok) {
|
|
66
|
+
throw resultIter.error;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return {
|
|
70
|
+
...resultIter.value,
|
|
71
|
+
next: unwrapPaginator(resultIter.next),
|
|
72
|
+
"~next": resultIter["~next"],
|
|
73
|
+
[Symbol.asyncIterator]: async function* paginator() {
|
|
74
|
+
for await (const page of resultIter) {
|
|
75
|
+
if (!page.ok) {
|
|
76
|
+
throw page.error;
|
|
77
|
+
}
|
|
78
|
+
yield page.value;
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function unwrapPaginator<V>(
|
|
85
|
+
paginator: Paginator<Result<V, unknown>>,
|
|
86
|
+
): Paginator<V> {
|
|
87
|
+
return () => {
|
|
88
|
+
const nextResult = paginator();
|
|
89
|
+
if (nextResult == null) {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
return nextResult.then((res) => {
|
|
93
|
+
if (!res.ok) {
|
|
94
|
+
throw res.error;
|
|
95
|
+
}
|
|
96
|
+
const out = {
|
|
97
|
+
...res.value,
|
|
98
|
+
next: unwrapPaginator(res.next),
|
|
99
|
+
};
|
|
100
|
+
return out;
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export const URL_OVERRIDE = Symbol("URL_OVERRIDE");
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const dateRE = /^\d{4}-\d{2}-\d{2}$/;
|
|
6
|
+
|
|
7
|
+
export class RFCDate {
|
|
8
|
+
private serialized: string;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Creates a new RFCDate instance using today's date.
|
|
12
|
+
*/
|
|
13
|
+
static today(): RFCDate {
|
|
14
|
+
return new RFCDate(new Date());
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Creates a new RFCDate instance using the provided input.
|
|
19
|
+
* If a string is used then in must be in the format YYYY-MM-DD.
|
|
20
|
+
*
|
|
21
|
+
* @param date A Date object or a date string in YYYY-MM-DD format
|
|
22
|
+
* @example
|
|
23
|
+
* new RFCDate("2022-01-01")
|
|
24
|
+
* @example
|
|
25
|
+
* new RFCDate(new Date())
|
|
26
|
+
*/
|
|
27
|
+
constructor(date: Date | string) {
|
|
28
|
+
if (typeof date === "string" && !dateRE.test(date)) {
|
|
29
|
+
throw new RangeError(
|
|
30
|
+
"RFCDate: date strings must be in the format YYYY-MM-DD: " + date,
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const value = new Date(date);
|
|
35
|
+
if (isNaN(+value)) {
|
|
36
|
+
throw new RangeError("RFCDate: invalid date provided: " + date);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
this.serialized = value.toISOString().slice(0, "YYYY-MM-DD".length);
|
|
40
|
+
if (!dateRE.test(this.serialized)) {
|
|
41
|
+
throw new TypeError(
|
|
42
|
+
`RFCDate: failed to build valid date with given value: ${date} serialized to ${this.serialized}`,
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
toJSON(): string {
|
|
48
|
+
return this.toString();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
toString(): string {
|
|
52
|
+
return this.serialized;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export function isReadableStream<T = Uint8Array>(
|
|
6
|
+
val: unknown,
|
|
7
|
+
): val is ReadableStream<T> {
|
|
8
|
+
if (typeof val !== "object" || val === null) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Check for the presence of methods specific to ReadableStream
|
|
13
|
+
const stream = val as ReadableStream<Uint8Array>;
|
|
14
|
+
|
|
15
|
+
// ReadableStream has methods like getReader, cancel, and tee
|
|
16
|
+
return (
|
|
17
|
+
typeof stream.getReader === "function" &&
|
|
18
|
+
typeof stream.cancel === "function" &&
|
|
19
|
+
typeof stream.tee === "function"
|
|
20
|
+
);
|
|
21
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"incremental": true,
|
|
4
|
+
"tsBuildInfoFile": ".tsbuildinfo",
|
|
5
|
+
"target": "ES2020",
|
|
6
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
7
|
+
"jsx": "react-jsx",
|
|
8
|
+
|
|
9
|
+
"module": "Node16",
|
|
10
|
+
"moduleResolution": "Node16",
|
|
11
|
+
|
|
12
|
+
"allowJs": true,
|
|
13
|
+
|
|
14
|
+
"declaration": true,
|
|
15
|
+
"declarationMap": true,
|
|
16
|
+
"sourceMap": true,
|
|
17
|
+
"outDir": ".",
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
// https://github.com/tsconfig/bases/blob/a1bf7c0fa2e094b068ca3e1448ca2ece4157977e/bases/strictest.json
|
|
21
|
+
"strict": true,
|
|
22
|
+
"allowUnusedLabels": false,
|
|
23
|
+
"allowUnreachableCode": false,
|
|
24
|
+
"exactOptionalPropertyTypes": true,
|
|
25
|
+
"useUnknownInCatchVariables": true,
|
|
26
|
+
"noFallthroughCasesInSwitch": true,
|
|
27
|
+
"noImplicitOverride": true,
|
|
28
|
+
"noImplicitReturns": true,
|
|
29
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
30
|
+
"noUncheckedIndexedAccess": true,
|
|
31
|
+
"noUnusedLocals": true,
|
|
32
|
+
"noUnusedParameters": true,
|
|
33
|
+
"isolatedModules": true,
|
|
34
|
+
"checkJs": true,
|
|
35
|
+
"esModuleInterop": true,
|
|
36
|
+
"skipLibCheck": true,
|
|
37
|
+
"forceConsistentCasingInFileNames": true
|
|
38
|
+
},
|
|
39
|
+
"include": ["src"],
|
|
40
|
+
"exclude": ["node_modules"]
|
|
41
|
+
}
|
package/types/blobs.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blobs.d.ts","sourceRoot":"","sources":["../src/types/blobs.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,eAAO,MAAM,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,UAAU,EAAE,IAAI,CAI3D,CAAC;AAEL,wBAAgB,UAAU,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,IAAI,CAkBpD"}
|
package/types/blobs.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.blobLikeSchema = void 0;
|
|
40
|
+
exports.isBlobLike = isBlobLike;
|
|
41
|
+
const z = __importStar(require("zod"));
|
|
42
|
+
exports.blobLikeSchema = z.custom(isBlobLike, {
|
|
43
|
+
message: "expected a Blob, File or Blob-like object",
|
|
44
|
+
fatal: true,
|
|
45
|
+
});
|
|
46
|
+
function isBlobLike(val) {
|
|
47
|
+
if (val instanceof Blob) {
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
if (typeof val !== "object" || val == null || !(Symbol.toStringTag in val)) {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
const name = val[Symbol.toStringTag];
|
|
54
|
+
if (typeof name !== "string") {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
if (name !== "Blob" && name !== "File") {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
return "stream" in val && typeof val.stream === "function";
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=blobs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blobs.js","sourceRoot":"","sources":["../src/types/blobs.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUH,gCAkBC;AA1BD,uCAAyB;AAEZ,QAAA,cAAc,GACzB,CAAC,CAAC,MAAM,CAAO,UAAU,EAAE;IACzB,OAAO,EAAE,2CAA2C;IACpD,KAAK,EAAE,IAAI;CACZ,CAAC,CAAC;AAEL,SAAgB,UAAU,CAAC,GAAY;IACrC,IAAI,GAAG,YAAY,IAAI,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,IAAI,IAAI,IAAI,CAAC,CAAC,MAAM,CAAC,WAAW,IAAI,GAAG,CAAC,EAAE,CAAC;QAC3E,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IACrC,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QACvC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,QAAQ,IAAI,GAAG,IAAI,OAAO,GAAG,CAAC,MAAM,KAAK,UAAU,CAAC;AAC7D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constdatetime.d.ts","sourceRoot":"","sources":["../src/types/constdatetime.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,wBAAgB,aAAa,CAC3B,GAAG,EAAE,MAAM,GACV,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,UAAU,EAAE,OAAO,CAAC,CAM1C"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.constDateTime = constDateTime;
|
|
40
|
+
const z = __importStar(require("zod"));
|
|
41
|
+
function constDateTime(val) {
|
|
42
|
+
return z.custom((v) => {
|
|
43
|
+
return (typeof v === "string" && new Date(v).getTime() === new Date(val).getTime());
|
|
44
|
+
}, `Value must be equivelant to ${val}`);
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=constdatetime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constdatetime.js","sourceRoot":"","sources":["../src/types/constdatetime.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIH,sCAQC;AAVD,uCAAyB;AAEzB,SAAgB,aAAa,CAC3B,GAAW;IAEX,OAAO,CAAC,CAAC,MAAM,CAAS,CAAC,CAAC,EAAE,EAAE;QAC5B,OAAO,CACL,OAAO,CAAC,KAAK,QAAQ,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,KAAK,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,CAC3E,CAAC;IACJ,CAAC,EAAE,+BAA+B,GAAG,EAAE,CAAC,CAAC;AAC3C,CAAC"}
|
package/types/enums.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare const __brand: unique symbol;
|
|
2
|
+
export type Unrecognized<T> = T & {
|
|
3
|
+
[__brand]: "unrecognized";
|
|
4
|
+
};
|
|
5
|
+
export declare function catchUnrecognizedEnum<T>(value: T): Unrecognized<T>;
|
|
6
|
+
type Prettify<T> = {
|
|
7
|
+
[K in keyof T]: T[K];
|
|
8
|
+
} & {};
|
|
9
|
+
export type ClosedEnum<T> = T[keyof T];
|
|
10
|
+
export type OpenEnum<T> = Prettify<T[keyof T]> | Unrecognized<T[keyof T] extends number ? number : string>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=enums.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../src/types/enums.ts"],"names":[],"mappings":"AAIA,OAAO,CAAC,MAAM,OAAO,EAAE,OAAO,MAAM,CAAC;AACrC,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG;IAAE,CAAC,OAAO,CAAC,EAAE,cAAc,CAAA;CAAE,CAAC;AAEhE,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAElE;AAED,KAAK,QAAQ,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,GAAG,EAAE,CAAC;AACjD,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AACvC,MAAM,MAAM,QAAQ,CAAC,CAAC,IAClB,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GACpB,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,CAAC"}
|
package/types/enums.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
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.catchUnrecognizedEnum = catchUnrecognizedEnum;
|
|
7
|
+
function catchUnrecognizedEnum(value) {
|
|
8
|
+
return value;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=enums.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enums.js","sourceRoot":"","sources":["../src/types/enums.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAKH,sDAEC;AAFD,SAAgB,qBAAqB,CAAI,KAAQ;IAC/C,OAAO,KAAwB,CAAC;AAClC,CAAC"}
|