@greensecurity/javascript-sdk 0.44.0-beta.57 → 0.44.0-beta.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -1
- package/dist/commonjs/__tests__/reports.test.d.ts +2 -0
- package/dist/commonjs/__tests__/reports.test.d.ts.map +1 -0
- package/dist/commonjs/__tests__/reports.test.js +53 -0
- package/dist/commonjs/__tests__/reports.test.js.map +1 -0
- package/dist/commonjs/__tests__/smartBadgeGetPsks.test.d.ts +2 -0
- package/dist/commonjs/__tests__/smartBadgeGetPsks.test.d.ts.map +1 -0
- package/dist/commonjs/__tests__/smartBadgeGetPsks.test.js +60 -0
- package/dist/commonjs/__tests__/smartBadgeGetPsks.test.js.map +1 -0
- package/dist/commonjs/__tests__/smartBadgeReportVerifiedPsk.test.d.ts +2 -0
- package/dist/commonjs/__tests__/smartBadgeReportVerifiedPsk.test.d.ts.map +1 -0
- package/dist/commonjs/__tests__/smartBadgeReportVerifiedPsk.test.js +46 -0
- package/dist/commonjs/__tests__/smartBadgeReportVerifiedPsk.test.js.map +1 -0
- package/dist/commonjs/__tests__/vendors.test.js +1 -1
- package/dist/commonjs/__tests__/vendors.test.js.map +1 -1
- package/dist/commonjs/__tests__/vendorscans.test.js +44 -0
- package/dist/commonjs/__tests__/vendorscans.test.js.map +1 -1
- package/dist/commonjs/__tests__/webhooks.test.js +5 -4
- package/dist/commonjs/__tests__/webhooks.test.js.map +1 -1
- package/dist/commonjs/__tests__/zones.test.js +3 -32
- package/dist/commonjs/__tests__/zones.test.js.map +1 -1
- package/dist/commonjs/admin-funcs/smartBadgeGetPsks.d.ts +3 -0
- package/dist/commonjs/admin-funcs/smartBadgeGetPsks.d.ts.map +1 -0
- package/dist/commonjs/admin-funcs/smartBadgeGetPsks.js +23 -0
- package/dist/commonjs/admin-funcs/smartBadgeGetPsks.js.map +1 -0
- package/dist/commonjs/admin-funcs/smartBadgeMacAddress.d.ts +2 -0
- package/dist/commonjs/admin-funcs/smartBadgeMacAddress.d.ts.map +1 -0
- package/dist/commonjs/admin-funcs/smartBadgeMacAddress.js +25 -0
- package/dist/commonjs/admin-funcs/smartBadgeMacAddress.js.map +1 -0
- package/dist/commonjs/admin-funcs/smartBadgeReportVerifiedPsk.d.ts +6 -0
- package/dist/commonjs/admin-funcs/smartBadgeReportVerifiedPsk.d.ts.map +1 -0
- package/dist/commonjs/admin-funcs/smartBadgeReportVerifiedPsk.js +18 -0
- package/dist/commonjs/admin-funcs/smartBadgeReportVerifiedPsk.js.map +1 -0
- package/dist/commonjs/funcs/reportsGetFullReport.d.ts +43 -0
- package/dist/commonjs/funcs/reportsGetFullReport.d.ts.map +1 -0
- package/dist/commonjs/funcs/reportsGetFullReport.js +148 -0
- package/dist/commonjs/funcs/reportsGetFullReport.js.map +1 -0
- package/dist/commonjs/funcs/reportsInitiateScheduledReport.d.ts +37 -0
- package/dist/commonjs/funcs/reportsInitiateScheduledReport.d.ts.map +1 -0
- package/dist/commonjs/funcs/reportsInitiateScheduledReport.js +139 -0
- package/dist/commonjs/funcs/reportsInitiateScheduledReport.js.map +1 -0
- package/dist/commonjs/funcs/vendorScansVendorScanGpsCheckoutConfig.d.ts +18 -0
- package/dist/commonjs/funcs/vendorScansVendorScanGpsCheckoutConfig.d.ts.map +1 -0
- package/dist/commonjs/funcs/vendorScansVendorScanGpsCheckoutConfig.js +124 -0
- package/dist/commonjs/funcs/vendorScansVendorScanGpsCheckoutConfig.js.map +1 -0
- package/dist/commonjs/funcs/vendorScansVendorScanGpsScanOut.d.ts +20 -0
- package/dist/commonjs/funcs/vendorScansVendorScanGpsScanOut.d.ts.map +1 -0
- package/dist/commonjs/funcs/vendorScansVendorScanGpsScanOut.js +126 -0
- package/dist/commonjs/funcs/vendorScansVendorScanGpsScanOut.js.map +1 -0
- package/dist/commonjs/funcs/vendorsUpdateVendorDetails.d.ts +14 -1
- package/dist/commonjs/funcs/vendorsUpdateVendorDetails.d.ts.map +1 -1
- package/dist/commonjs/funcs/vendorsUpdateVendorDetails.js +14 -1
- package/dist/commonjs/funcs/vendorsUpdateVendorDetails.js.map +1 -1
- package/dist/commonjs/index.extras.d.ts +4 -0
- package/dist/commonjs/index.extras.d.ts.map +1 -1
- package/dist/commonjs/index.extras.js +5 -1
- package/dist/commonjs/index.extras.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/models/components/facility.d.ts +10 -0
- package/dist/commonjs/models/components/facility.d.ts.map +1 -1
- package/dist/commonjs/models/components/facility.js +8 -0
- package/dist/commonjs/models/components/facility.js.map +1 -1
- package/dist/commonjs/models/components/zone.d.ts +7 -0
- package/dist/commonjs/models/components/zone.d.ts.map +1 -1
- package/dist/commonjs/models/components/zone.js +8 -0
- package/dist/commonjs/models/components/zone.js.map +1 -1
- package/dist/commonjs/models/errors/apivalidationerrorresponse.d.ts +38 -0
- package/dist/commonjs/models/errors/apivalidationerrorresponse.d.ts.map +1 -0
- package/dist/commonjs/models/errors/apivalidationerrorresponse.js +78 -0
- package/dist/commonjs/models/errors/apivalidationerrorresponse.js.map +1 -0
- package/dist/commonjs/models/errors/index.d.ts +2 -0
- package/dist/commonjs/models/errors/index.d.ts.map +1 -1
- package/dist/commonjs/models/errors/index.js +2 -0
- package/dist/commonjs/models/errors/index.js.map +1 -1
- package/dist/commonjs/models/errors/unprocessableentityorvalidationerror.d.ts +13 -0
- package/dist/commonjs/models/errors/unprocessableentityorvalidationerror.d.ts.map +1 -0
- package/dist/commonjs/models/errors/unprocessableentityorvalidationerror.js +20 -0
- package/dist/commonjs/models/errors/unprocessableentityorvalidationerror.js.map +1 -0
- package/dist/commonjs/models/operations/getfullreport.d.ts +73 -0
- package/dist/commonjs/models/operations/getfullreport.d.ts.map +1 -0
- package/dist/commonjs/models/operations/getfullreport.js +107 -0
- package/dist/commonjs/models/operations/getfullreport.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +4 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +4 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/initiatescheduledreport.d.ts +30 -0
- package/dist/commonjs/models/operations/initiatescheduledreport.d.ts.map +1 -0
- package/dist/commonjs/models/operations/initiatescheduledreport.js +69 -0
- package/dist/commonjs/models/operations/initiatescheduledreport.js.map +1 -0
- package/dist/commonjs/models/operations/vendorscangpscheckoutconfig.d.ts +57 -0
- package/dist/commonjs/models/operations/vendorscangpscheckoutconfig.d.ts.map +1 -0
- package/dist/commonjs/models/operations/vendorscangpscheckoutconfig.js +81 -0
- package/dist/commonjs/models/operations/vendorscangpscheckoutconfig.js.map +1 -0
- package/dist/commonjs/models/operations/vendorscangpsscanout.d.ts +81 -0
- package/dist/commonjs/models/operations/vendorscangpsscanout.d.ts.map +1 -0
- package/dist/commonjs/models/operations/vendorscangpsscanout.js +96 -0
- package/dist/commonjs/models/operations/vendorscangpsscanout.js.map +1 -0
- package/dist/commonjs/react-query/index.d.ts +4 -0
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +4 -0
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/react-query/reportsGetFullReport.core.d.ts +12 -0
- package/dist/commonjs/react-query/reportsGetFullReport.core.d.ts.map +1 -0
- package/dist/commonjs/react-query/reportsGetFullReport.core.js +39 -0
- package/dist/commonjs/react-query/reportsGetFullReport.core.js.map +1 -0
- package/dist/commonjs/react-query/reportsGetFullReport.d.ts +75 -0
- package/dist/commonjs/react-query/reportsGetFullReport.d.ts.map +1 -0
- package/dist/commonjs/react-query/reportsGetFullReport.js +111 -0
- package/dist/commonjs/react-query/reportsGetFullReport.js.map +1 -0
- package/dist/commonjs/react-query/reportsInitiateScheduledReport.d.ts +46 -0
- package/dist/commonjs/react-query/reportsInitiateScheduledReport.d.ts.map +1 -0
- package/dist/commonjs/react-query/reportsInitiateScheduledReport.js +68 -0
- package/dist/commonjs/react-query/reportsInitiateScheduledReport.js.map +1 -0
- package/dist/commonjs/react-query/vendorScansVendorScanGpsCheckoutConfig.core.d.ts +12 -0
- package/dist/commonjs/react-query/vendorScansVendorScanGpsCheckoutConfig.core.d.ts.map +1 -0
- package/dist/commonjs/react-query/vendorScansVendorScanGpsCheckoutConfig.core.js +39 -0
- package/dist/commonjs/react-query/vendorScansVendorScanGpsCheckoutConfig.core.js.map +1 -0
- package/dist/commonjs/react-query/vendorScansVendorScanGpsCheckoutConfig.d.ts +29 -0
- package/dist/commonjs/react-query/vendorScansVendorScanGpsCheckoutConfig.d.ts.map +1 -0
- package/dist/commonjs/react-query/vendorScansVendorScanGpsCheckoutConfig.js +69 -0
- package/dist/commonjs/react-query/vendorScansVendorScanGpsCheckoutConfig.js.map +1 -0
- package/dist/commonjs/react-query/vendorScansVendorScanGpsScanOut.d.ts +31 -0
- package/dist/commonjs/react-query/vendorScansVendorScanGpsScanOut.d.ts.map +1 -0
- package/dist/commonjs/react-query/vendorScansVendorScanGpsScanOut.js +53 -0
- package/dist/commonjs/react-query/vendorScansVendorScanGpsScanOut.js.map +1 -0
- package/dist/commonjs/react-query/vendorsUpdateVendorDetails.d.ts +14 -1
- package/dist/commonjs/react-query/vendorsUpdateVendorDetails.d.ts.map +1 -1
- package/dist/commonjs/react-query/vendorsUpdateVendorDetails.js +14 -1
- package/dist/commonjs/react-query/vendorsUpdateVendorDetails.js.map +1 -1
- package/dist/commonjs/sdk/reports.d.ts +59 -0
- package/dist/commonjs/sdk/reports.d.ts.map +1 -0
- package/dist/commonjs/sdk/reports.js +72 -0
- package/dist/commonjs/sdk/reports.js.map +1 -0
- package/dist/commonjs/sdk/sdk.d.ts +3 -0
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +4 -0
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/commonjs/sdk/vendors.d.ts +14 -1
- package/dist/commonjs/sdk/vendors.d.ts.map +1 -1
- package/dist/commonjs/sdk/vendors.js +14 -1
- package/dist/commonjs/sdk/vendors.js.map +1 -1
- package/dist/commonjs/sdk/vendorscans.d.ts +16 -0
- package/dist/commonjs/sdk/vendorscans.d.ts.map +1 -1
- package/dist/commonjs/sdk/vendorscans.js +22 -0
- package/dist/commonjs/sdk/vendorscans.js.map +1 -1
- package/dist/esm/__tests__/reports.test.d.ts +2 -0
- package/dist/esm/__tests__/reports.test.d.ts.map +1 -0
- package/dist/esm/__tests__/reports.test.js +51 -0
- package/dist/esm/__tests__/reports.test.js.map +1 -0
- package/dist/esm/__tests__/smartBadgeGetPsks.test.d.ts +2 -0
- package/dist/esm/__tests__/smartBadgeGetPsks.test.d.ts.map +1 -0
- package/dist/esm/__tests__/smartBadgeGetPsks.test.js +58 -0
- package/dist/esm/__tests__/smartBadgeGetPsks.test.js.map +1 -0
- package/dist/esm/__tests__/smartBadgeReportVerifiedPsk.test.d.ts +2 -0
- package/dist/esm/__tests__/smartBadgeReportVerifiedPsk.test.d.ts.map +1 -0
- package/dist/esm/__tests__/smartBadgeReportVerifiedPsk.test.js +44 -0
- package/dist/esm/__tests__/smartBadgeReportVerifiedPsk.test.js.map +1 -0
- package/dist/esm/__tests__/vendors.test.js +1 -1
- package/dist/esm/__tests__/vendors.test.js.map +1 -1
- package/dist/esm/__tests__/vendorscans.test.js +44 -0
- package/dist/esm/__tests__/vendorscans.test.js.map +1 -1
- package/dist/esm/__tests__/webhooks.test.js +5 -4
- package/dist/esm/__tests__/webhooks.test.js.map +1 -1
- package/dist/esm/__tests__/zones.test.js +3 -32
- package/dist/esm/__tests__/zones.test.js.map +1 -1
- package/dist/esm/admin-funcs/smartBadgeGetPsks.d.ts +3 -0
- package/dist/esm/admin-funcs/smartBadgeGetPsks.d.ts.map +1 -0
- package/dist/esm/admin-funcs/smartBadgeGetPsks.js +20 -0
- package/dist/esm/admin-funcs/smartBadgeGetPsks.js.map +1 -0
- package/dist/esm/admin-funcs/smartBadgeMacAddress.d.ts +2 -0
- package/dist/esm/admin-funcs/smartBadgeMacAddress.d.ts.map +1 -0
- package/dist/esm/admin-funcs/smartBadgeMacAddress.js +22 -0
- package/dist/esm/admin-funcs/smartBadgeMacAddress.js.map +1 -0
- package/dist/esm/admin-funcs/smartBadgeReportVerifiedPsk.d.ts +6 -0
- package/dist/esm/admin-funcs/smartBadgeReportVerifiedPsk.d.ts.map +1 -0
- package/dist/esm/admin-funcs/smartBadgeReportVerifiedPsk.js +15 -0
- package/dist/esm/admin-funcs/smartBadgeReportVerifiedPsk.js.map +1 -0
- package/dist/esm/funcs/reportsGetFullReport.d.ts +43 -0
- package/dist/esm/funcs/reportsGetFullReport.d.ts.map +1 -0
- package/dist/esm/funcs/reportsGetFullReport.js +112 -0
- package/dist/esm/funcs/reportsGetFullReport.js.map +1 -0
- package/dist/esm/funcs/reportsInitiateScheduledReport.d.ts +37 -0
- package/dist/esm/funcs/reportsInitiateScheduledReport.d.ts.map +1 -0
- package/dist/esm/funcs/reportsInitiateScheduledReport.js +103 -0
- package/dist/esm/funcs/reportsInitiateScheduledReport.js.map +1 -0
- package/dist/esm/funcs/vendorScansVendorScanGpsCheckoutConfig.d.ts +18 -0
- package/dist/esm/funcs/vendorScansVendorScanGpsCheckoutConfig.d.ts.map +1 -0
- package/dist/esm/funcs/vendorScansVendorScanGpsCheckoutConfig.js +88 -0
- package/dist/esm/funcs/vendorScansVendorScanGpsCheckoutConfig.js.map +1 -0
- package/dist/esm/funcs/vendorScansVendorScanGpsScanOut.d.ts +20 -0
- package/dist/esm/funcs/vendorScansVendorScanGpsScanOut.d.ts.map +1 -0
- package/dist/esm/funcs/vendorScansVendorScanGpsScanOut.js +90 -0
- package/dist/esm/funcs/vendorScansVendorScanGpsScanOut.js.map +1 -0
- package/dist/esm/funcs/vendorsUpdateVendorDetails.d.ts +14 -1
- package/dist/esm/funcs/vendorsUpdateVendorDetails.d.ts.map +1 -1
- package/dist/esm/funcs/vendorsUpdateVendorDetails.js +14 -1
- package/dist/esm/funcs/vendorsUpdateVendorDetails.js.map +1 -1
- package/dist/esm/index.extras.d.ts +4 -0
- package/dist/esm/index.extras.d.ts.map +1 -1
- package/dist/esm/index.extras.js +5 -1
- package/dist/esm/index.extras.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/models/components/facility.d.ts +10 -0
- package/dist/esm/models/components/facility.d.ts.map +1 -1
- package/dist/esm/models/components/facility.js +8 -0
- package/dist/esm/models/components/facility.js.map +1 -1
- package/dist/esm/models/components/zone.d.ts +7 -0
- package/dist/esm/models/components/zone.d.ts.map +1 -1
- package/dist/esm/models/components/zone.js +8 -0
- package/dist/esm/models/components/zone.js.map +1 -1
- package/dist/esm/models/errors/apivalidationerrorresponse.d.ts +38 -0
- package/dist/esm/models/errors/apivalidationerrorresponse.d.ts.map +1 -0
- package/dist/esm/models/errors/apivalidationerrorresponse.js +41 -0
- package/dist/esm/models/errors/apivalidationerrorresponse.js.map +1 -0
- package/dist/esm/models/errors/index.d.ts +2 -0
- package/dist/esm/models/errors/index.d.ts.map +1 -1
- package/dist/esm/models/errors/index.js +2 -0
- package/dist/esm/models/errors/index.js.map +1 -1
- package/dist/esm/models/errors/unprocessableentityorvalidationerror.d.ts +13 -0
- package/dist/esm/models/errors/unprocessableentityorvalidationerror.d.ts.map +1 -0
- package/dist/esm/models/errors/unprocessableentityorvalidationerror.js +16 -0
- package/dist/esm/models/errors/unprocessableentityorvalidationerror.js.map +1 -0
- package/dist/esm/models/operations/getfullreport.d.ts +73 -0
- package/dist/esm/models/operations/getfullreport.d.ts.map +1 -0
- package/dist/esm/models/operations/getfullreport.js +68 -0
- package/dist/esm/models/operations/getfullreport.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +4 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +4 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/initiatescheduledreport.d.ts +30 -0
- package/dist/esm/models/operations/initiatescheduledreport.d.ts.map +1 -0
- package/dist/esm/models/operations/initiatescheduledreport.js +31 -0
- package/dist/esm/models/operations/initiatescheduledreport.js.map +1 -0
- package/dist/esm/models/operations/vendorscangpscheckoutconfig.d.ts +57 -0
- package/dist/esm/models/operations/vendorscangpscheckoutconfig.d.ts.map +1 -0
- package/dist/esm/models/operations/vendorscangpscheckoutconfig.js +43 -0
- package/dist/esm/models/operations/vendorscangpscheckoutconfig.js.map +1 -0
- package/dist/esm/models/operations/vendorscangpsscanout.d.ts +81 -0
- package/dist/esm/models/operations/vendorscangpsscanout.d.ts.map +1 -0
- package/dist/esm/models/operations/vendorscangpsscanout.js +57 -0
- package/dist/esm/models/operations/vendorscangpsscanout.js.map +1 -0
- package/dist/esm/react-query/index.d.ts +4 -0
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +4 -0
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/react-query/reportsGetFullReport.core.d.ts +12 -0
- package/dist/esm/react-query/reportsGetFullReport.core.d.ts.map +1 -0
- package/dist/esm/react-query/reportsGetFullReport.core.js +34 -0
- package/dist/esm/react-query/reportsGetFullReport.core.js.map +1 -0
- package/dist/esm/react-query/reportsGetFullReport.d.ts +75 -0
- package/dist/esm/react-query/reportsGetFullReport.d.ts.map +1 -0
- package/dist/esm/react-query/reportsGetFullReport.js +101 -0
- package/dist/esm/react-query/reportsGetFullReport.js.map +1 -0
- package/dist/esm/react-query/reportsInitiateScheduledReport.d.ts +46 -0
- package/dist/esm/react-query/reportsInitiateScheduledReport.d.ts.map +1 -0
- package/dist/esm/react-query/reportsInitiateScheduledReport.js +63 -0
- package/dist/esm/react-query/reportsInitiateScheduledReport.js.map +1 -0
- package/dist/esm/react-query/vendorScansVendorScanGpsCheckoutConfig.core.d.ts +12 -0
- package/dist/esm/react-query/vendorScansVendorScanGpsCheckoutConfig.core.d.ts.map +1 -0
- package/dist/esm/react-query/vendorScansVendorScanGpsCheckoutConfig.core.js +34 -0
- package/dist/esm/react-query/vendorScansVendorScanGpsCheckoutConfig.core.js.map +1 -0
- package/dist/esm/react-query/vendorScansVendorScanGpsCheckoutConfig.d.ts +29 -0
- package/dist/esm/react-query/vendorScansVendorScanGpsCheckoutConfig.d.ts.map +1 -0
- package/dist/esm/react-query/vendorScansVendorScanGpsCheckoutConfig.js +59 -0
- package/dist/esm/react-query/vendorScansVendorScanGpsCheckoutConfig.js.map +1 -0
- package/dist/esm/react-query/vendorScansVendorScanGpsScanOut.d.ts +31 -0
- package/dist/esm/react-query/vendorScansVendorScanGpsScanOut.d.ts.map +1 -0
- package/dist/esm/react-query/vendorScansVendorScanGpsScanOut.js +48 -0
- package/dist/esm/react-query/vendorScansVendorScanGpsScanOut.js.map +1 -0
- package/dist/esm/react-query/vendorsUpdateVendorDetails.d.ts +14 -1
- package/dist/esm/react-query/vendorsUpdateVendorDetails.d.ts.map +1 -1
- package/dist/esm/react-query/vendorsUpdateVendorDetails.js +14 -1
- package/dist/esm/react-query/vendorsUpdateVendorDetails.js.map +1 -1
- package/dist/esm/sdk/reports.d.ts +59 -0
- package/dist/esm/sdk/reports.d.ts.map +1 -0
- package/dist/esm/sdk/reports.js +68 -0
- package/dist/esm/sdk/reports.js.map +1 -0
- package/dist/esm/sdk/sdk.d.ts +3 -0
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +4 -0
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/dist/esm/sdk/vendors.d.ts +14 -1
- package/dist/esm/sdk/vendors.d.ts.map +1 -1
- package/dist/esm/sdk/vendors.js +14 -1
- package/dist/esm/sdk/vendors.js.map +1 -1
- package/dist/esm/sdk/vendorscans.d.ts +16 -0
- package/dist/esm/sdk/vendorscans.d.ts.map +1 -1
- package/dist/esm/sdk/vendorscans.js +22 -0
- package/dist/esm/sdk/vendorscans.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/__tests__/reports.test.ts +57 -0
- package/src/__tests__/smartBadgeGetPsks.test.ts +76 -0
- package/src/__tests__/smartBadgeReportVerifiedPsk.test.ts +61 -0
- package/src/__tests__/vendors.test.ts +1 -1
- package/src/__tests__/vendorscans.test.ts +50 -0
- package/src/__tests__/webhooks.test.ts +5 -4
- package/src/__tests__/zones.test.ts +3 -32
- package/src/admin-funcs/smartBadgeGetPsks.ts +23 -0
- package/src/admin-funcs/smartBadgeMacAddress.ts +25 -0
- package/src/admin-funcs/smartBadgeReportVerifiedPsk.ts +25 -0
- package/src/funcs/reportsGetFullReport.ts +204 -0
- package/src/funcs/reportsInitiateScheduledReport.ts +205 -0
- package/src/funcs/vendorScansVendorScanGpsCheckoutConfig.ts +180 -0
- package/src/funcs/vendorScansVendorScanGpsScanOut.ts +182 -0
- package/src/funcs/vendorsUpdateVendorDetails.ts +14 -1
- package/src/index.extras.ts +5 -1
- package/src/lib/config.ts +3 -3
- package/src/models/components/facility.ts +18 -0
- package/src/models/components/zone.ts +15 -0
- package/src/models/errors/apivalidationerrorresponse.ts +71 -0
- package/src/models/errors/index.ts +2 -0
- package/src/models/errors/unprocessableentityorvalidationerror.ts +45 -0
- package/src/models/operations/getfullreport.ts +159 -0
- package/src/models/operations/index.ts +4 -0
- package/src/models/operations/initiatescheduledreport.ts +87 -0
- package/src/models/operations/vendorscangpscheckoutconfig.ts +118 -0
- package/src/models/operations/vendorscangpsscanout.ts +167 -0
- package/src/react-query/index.ts +4 -0
- package/src/react-query/reportsGetFullReport.core.ts +76 -0
- package/src/react-query/reportsGetFullReport.ts +190 -0
- package/src/react-query/reportsInitiateScheduledReport.ts +133 -0
- package/src/react-query/vendorScansVendorScanGpsCheckoutConfig.core.ts +78 -0
- package/src/react-query/vendorScansVendorScanGpsCheckoutConfig.ts +150 -0
- package/src/react-query/vendorScansVendorScanGpsScanOut.ts +117 -0
- package/src/react-query/vendorsUpdateVendorDetails.ts +14 -1
- package/src/sdk/reports.ts +85 -0
- package/src/sdk/sdk.ts +6 -0
- package/src/sdk/vendors.ts +14 -1
- package/src/sdk/vendorscans.ts +40 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Turns a badge MAC address into a path segment for the smart badge routes.
|
|
2
|
+
//
|
|
3
|
+
// Validated rather than only encoded. encodeURIComponent leaves `.` untouched — it is in the unreserved
|
|
4
|
+
// set — and GreenSecurityCore._createRequest resolves the finished route with `new URL(path, baseURL)`
|
|
5
|
+
// (lib/sdks.ts:136), which canonicalizes dot segments. So a macAddress of `..` survives encoding intact
|
|
6
|
+
// and turns `/api/smart-badges/../psks` into `/api/psks`, leaving the intended route before the backend
|
|
7
|
+
// validates anything; `.` collapses to `/api/smart-badges/psks` the same way. Encoding cannot close
|
|
8
|
+
// that, because there is nothing to encode. Rejecting anything that is not a MAC address can.
|
|
9
|
+
//
|
|
10
|
+
// The accepted forms are bare hex, colon-separated and dash-separated, matching what the backend's
|
|
11
|
+
// VendorScan.normalize_mac_address handles minus the dot-separated form: Rails treats a dot in a path
|
|
12
|
+
// segment as a format separator, so that form never reaches these routes anyway. The backreference
|
|
13
|
+
// keeps the separator consistent, so `c3:00-00:83:ba:4d` is not accepted either.
|
|
14
|
+
const MAC_ADDRESS = /^(?:[0-9a-fA-F]{12}|[0-9a-fA-F]{2}([:-])(?:[0-9a-fA-F]{2}\1){4}[0-9a-fA-F]{2})$/;
|
|
15
|
+
|
|
16
|
+
export function smartBadgeMacAddressPathSegment(macAddress: string): string {
|
|
17
|
+
if (!MAC_ADDRESS.test(macAddress)) {
|
|
18
|
+
throw new Error(
|
|
19
|
+
"Invalid smart badge MAC address: expected 12 hex digits, optionally colon- or dash-separated, " +
|
|
20
|
+
`got ${JSON.stringify(macAddress)}`
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return encodeURIComponent(macAddress);
|
|
25
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { APIPromise } from "../types/async.js";
|
|
2
|
+
import { $doPost, internalApiResult } from "./doAdmin.js";
|
|
3
|
+
import { smartBadgeMacAddressPathSegment } from "./smartBadgeMacAddress.js";
|
|
4
|
+
|
|
5
|
+
export type smartBadgeReportVerifiedPskRequest = {
|
|
6
|
+
psk: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
// Records which pre-shared key a badge actually accepted, so the next write to it goes straight to
|
|
10
|
+
// that key instead of paying for a rejected handshake and a reconnect.
|
|
11
|
+
//
|
|
12
|
+
// The key travels in the body rather than the query string to keep it out of access and proxy logs.
|
|
13
|
+
//
|
|
14
|
+
// macAddress is validated and encoded for the same reason as in smartBadgeGetPsks, and it matters more
|
|
15
|
+
// here: this request is an authenticated POST, so a value that escapes the route redirects that rather
|
|
16
|
+
// than a read.
|
|
17
|
+
export function smartBadgeReportVerifiedPsk(
|
|
18
|
+
macAddress: string,
|
|
19
|
+
request: smartBadgeReportVerifiedPskRequest
|
|
20
|
+
): internalApiResult {
|
|
21
|
+
return new APIPromise($doPost(
|
|
22
|
+
`/smart-badges/${smartBadgeMacAddressPathSegment(macAddress)}/psk-verified`,
|
|
23
|
+
request
|
|
24
|
+
));
|
|
25
|
+
}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { GreenSecurityCore } from "../core.js";
|
|
6
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import { GreenSecurityError } from "../models/errors/greensecurityerror.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/httpclienterrors.js";
|
|
22
|
+
import * as errors from "../models/errors/index.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Get a generated report's status and download URL
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Returns a completed report run and a short-lived signed `report_url` (valid 5 minutes).
|
|
34
|
+
*
|
|
35
|
+
* Only a completed run returns the `full_report` payload. A run that has not finished does
|
|
36
|
+
* **not** come back with a `status` field to inspect — it returns an error envelope. Poll on
|
|
37
|
+
* the status code alone; `409` is the only retryable outcome, so no error-message matching is
|
|
38
|
+
* needed:
|
|
39
|
+
*
|
|
40
|
+
* | Status | Meaning | What to do |
|
|
41
|
+
* | --- | --- | --- |
|
|
42
|
+
* | `200` | The run finished. | Download `full_report.report_url` within 5 minutes. |
|
|
43
|
+
* | `409` | Still pending or processing. | Retry, but bound it — see below. |
|
|
44
|
+
* | `422` | Terminal: the run was canceled or failed, or the id is not a positive integer. | Stop. |
|
|
45
|
+
* | `404` | No such run, or it is outside your access scope. | Stop. |
|
|
46
|
+
* | `403` | Your account is locked, or lacks the `scheduled_reports` view permission. | Stop. |
|
|
47
|
+
*
|
|
48
|
+
* **Bound your polling.** A `409` is not a promise that the run will finish. Report
|
|
49
|
+
* generation has no terminal failure state today, so a run whose generation crashed part way
|
|
50
|
+
* through stays in `processing` and keeps answering `409` indefinitely. Apply your own
|
|
51
|
+
* timeout or maximum attempt count and treat exhaustion as a failure; do not retry forever.
|
|
52
|
+
*
|
|
53
|
+
* Access control: the URL's `full_report_id` must be in the caller's read scope for
|
|
54
|
+
* `FullReport` — the facility or system it was run for, a recipient of the schedule that
|
|
55
|
+
* produced it, or a report whose app is activated for the API user. Callers outside that
|
|
56
|
+
* scope receive `404 Full report not found`.
|
|
57
|
+
*
|
|
58
|
+
* If set, this operation will use {@link Security.bearerJwt} from the global security.
|
|
59
|
+
*/
|
|
60
|
+
export function reportsGetFullReport(
|
|
61
|
+
client: GreenSecurityCore,
|
|
62
|
+
request: operations.GetFullReportRequest,
|
|
63
|
+
options?: RequestOptions,
|
|
64
|
+
): APIPromise<
|
|
65
|
+
Result<
|
|
66
|
+
operations.GetFullReportGetFullReportOk,
|
|
67
|
+
| errors.ApiErrorResponse
|
|
68
|
+
| errors.UnprocessableEntityOrValidationError
|
|
69
|
+
| GreenSecurityError
|
|
70
|
+
| ResponseValidationError
|
|
71
|
+
| ConnectionError
|
|
72
|
+
| RequestAbortedError
|
|
73
|
+
| RequestTimeoutError
|
|
74
|
+
| InvalidRequestError
|
|
75
|
+
| UnexpectedClientError
|
|
76
|
+
| SDKValidationError
|
|
77
|
+
>
|
|
78
|
+
> {
|
|
79
|
+
return new APIPromise($do(
|
|
80
|
+
client,
|
|
81
|
+
request,
|
|
82
|
+
options,
|
|
83
|
+
));
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
async function $do(
|
|
87
|
+
client: GreenSecurityCore,
|
|
88
|
+
request: operations.GetFullReportRequest,
|
|
89
|
+
options?: RequestOptions,
|
|
90
|
+
): Promise<
|
|
91
|
+
[
|
|
92
|
+
Result<
|
|
93
|
+
operations.GetFullReportGetFullReportOk,
|
|
94
|
+
| errors.ApiErrorResponse
|
|
95
|
+
| errors.UnprocessableEntityOrValidationError
|
|
96
|
+
| GreenSecurityError
|
|
97
|
+
| ResponseValidationError
|
|
98
|
+
| ConnectionError
|
|
99
|
+
| RequestAbortedError
|
|
100
|
+
| RequestTimeoutError
|
|
101
|
+
| InvalidRequestError
|
|
102
|
+
| UnexpectedClientError
|
|
103
|
+
| SDKValidationError
|
|
104
|
+
>,
|
|
105
|
+
APICall,
|
|
106
|
+
]
|
|
107
|
+
> {
|
|
108
|
+
const parsed = safeParse(
|
|
109
|
+
request,
|
|
110
|
+
(value) => operations.GetFullReportRequest$outboundSchema.parse(value),
|
|
111
|
+
"Input validation failed",
|
|
112
|
+
);
|
|
113
|
+
if (!parsed.ok) {
|
|
114
|
+
return [parsed, { status: "invalid" }];
|
|
115
|
+
}
|
|
116
|
+
const payload = parsed.value;
|
|
117
|
+
const body = null;
|
|
118
|
+
|
|
119
|
+
const pathParams = {
|
|
120
|
+
full_report_id: encodeSimple("full_report_id", payload.full_report_id, {
|
|
121
|
+
explode: false,
|
|
122
|
+
charEncoding: "percent",
|
|
123
|
+
}),
|
|
124
|
+
};
|
|
125
|
+
const path = pathToFunc("/reports/{full_report_id}")(pathParams);
|
|
126
|
+
|
|
127
|
+
const headers = new Headers(compactMap({
|
|
128
|
+
Accept: "application/json",
|
|
129
|
+
}));
|
|
130
|
+
|
|
131
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
132
|
+
const requestSecurity = resolveGlobalSecurity(securityInput, [1]);
|
|
133
|
+
|
|
134
|
+
const context = {
|
|
135
|
+
options: client._options,
|
|
136
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
137
|
+
operationID: "getFullReport",
|
|
138
|
+
oAuth2Scopes: null,
|
|
139
|
+
|
|
140
|
+
resolvedSecurity: requestSecurity,
|
|
141
|
+
|
|
142
|
+
securitySource: client._options.security,
|
|
143
|
+
retryConfig: options?.retries
|
|
144
|
+
|| client._options.retryConfig
|
|
145
|
+
|| { strategy: "none" },
|
|
146
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
const requestRes = client._createRequest(context, {
|
|
150
|
+
security: requestSecurity,
|
|
151
|
+
method: "GET",
|
|
152
|
+
baseURL: options?.serverURL,
|
|
153
|
+
path: path,
|
|
154
|
+
headers: headers,
|
|
155
|
+
body: body,
|
|
156
|
+
userAgent: client._options.userAgent,
|
|
157
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
158
|
+
}, options);
|
|
159
|
+
if (!requestRes.ok) {
|
|
160
|
+
return [requestRes, { status: "invalid" }];
|
|
161
|
+
}
|
|
162
|
+
const req = requestRes.value;
|
|
163
|
+
|
|
164
|
+
const doResult = await client._do(req, {
|
|
165
|
+
context,
|
|
166
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
167
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
168
|
+
retryConfig: context.retryConfig,
|
|
169
|
+
retryCodes: context.retryCodes,
|
|
170
|
+
});
|
|
171
|
+
if (!doResult.ok) {
|
|
172
|
+
return [doResult, { status: "request-error", request: req }];
|
|
173
|
+
}
|
|
174
|
+
const response = doResult.value;
|
|
175
|
+
|
|
176
|
+
const responseFields = {
|
|
177
|
+
HttpMeta: { Response: response, Request: req },
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
const [result] = await M.match<
|
|
181
|
+
operations.GetFullReportGetFullReportOk,
|
|
182
|
+
| errors.ApiErrorResponse
|
|
183
|
+
| errors.UnprocessableEntityOrValidationError
|
|
184
|
+
| GreenSecurityError
|
|
185
|
+
| ResponseValidationError
|
|
186
|
+
| ConnectionError
|
|
187
|
+
| RequestAbortedError
|
|
188
|
+
| RequestTimeoutError
|
|
189
|
+
| InvalidRequestError
|
|
190
|
+
| UnexpectedClientError
|
|
191
|
+
| SDKValidationError
|
|
192
|
+
>(
|
|
193
|
+
M.json(200, operations.GetFullReportGetFullReportOk$inboundSchema),
|
|
194
|
+
M.jsonErr([400, 401, 403, 404, 409], errors.ApiErrorResponse$inboundSchema),
|
|
195
|
+
M.jsonErr(422, errors.UnprocessableEntityOrValidationError$inboundSchema),
|
|
196
|
+
M.fail("4XX"),
|
|
197
|
+
M.fail([500, "5XX"]),
|
|
198
|
+
)(response, req, { extraFields: responseFields });
|
|
199
|
+
if (!result.ok) {
|
|
200
|
+
return [result, { status: "complete", request: req, response }];
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
return [result, { status: "complete", request: req, response }];
|
|
204
|
+
}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { GreenSecurityCore } from "../core.js";
|
|
6
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import { GreenSecurityError } from "../models/errors/greensecurityerror.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/httpclienterrors.js";
|
|
22
|
+
import * as errors from "../models/errors/index.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Generate a scheduled report now
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Immediately generates a new report run for a scheduled report, independent of its
|
|
34
|
+
* configured schedule. Returns a `poll_url` for the generated `FullReport`.
|
|
35
|
+
*
|
|
36
|
+
* Generation is asynchronous. Poll `GET /reports/{full_report_id}` on the **status code**,
|
|
37
|
+
* not on a status field: while the run is pending or processing that endpoint returns `409`
|
|
38
|
+
* with an error envelope and no `status` to read. Retry the `409` until it turns into `200`,
|
|
39
|
+
* which carries the `full_report` payload and the signed download URL. `409` is the only
|
|
40
|
+
* retryable status — a canceled or failed run returns `422`, so no error-message matching is
|
|
41
|
+
* needed to decide when to give up.
|
|
42
|
+
*
|
|
43
|
+
* Bound the retries with your own timeout or attempt limit. Report generation has no terminal
|
|
44
|
+
* failure state today, so a run whose generation crashed stays in `processing` and answers
|
|
45
|
+
* `409` indefinitely rather than turning into a `422`.
|
|
46
|
+
*
|
|
47
|
+
* Access control: the URL's `scheduled_report_id` must be in the caller's read scope
|
|
48
|
+
* for `ScheduledReport` — the facility or system it belongs to, a scheduled report the
|
|
49
|
+
* caller is an explicit recipient of, or a scheduled report whose app is activated for
|
|
50
|
+
* the API user. Callers outside that scope receive `404 Scheduled report not found`.
|
|
51
|
+
*
|
|
52
|
+
* If set, this operation will use {@link Security.bearerJwt} from the global security.
|
|
53
|
+
*/
|
|
54
|
+
export function reportsInitiateScheduledReport(
|
|
55
|
+
client: GreenSecurityCore,
|
|
56
|
+
request: operations.InitiateScheduledReportRequest,
|
|
57
|
+
options?: RequestOptions,
|
|
58
|
+
): APIPromise<
|
|
59
|
+
Result<
|
|
60
|
+
operations.InitiateScheduledReportInitiateScheduledReportOk,
|
|
61
|
+
| errors.ApiErrorResponse
|
|
62
|
+
| errors.UnprocessableEntityOrValidationError
|
|
63
|
+
| GreenSecurityError
|
|
64
|
+
| ResponseValidationError
|
|
65
|
+
| ConnectionError
|
|
66
|
+
| RequestAbortedError
|
|
67
|
+
| RequestTimeoutError
|
|
68
|
+
| InvalidRequestError
|
|
69
|
+
| UnexpectedClientError
|
|
70
|
+
| SDKValidationError
|
|
71
|
+
>
|
|
72
|
+
> {
|
|
73
|
+
return new APIPromise($do(
|
|
74
|
+
client,
|
|
75
|
+
request,
|
|
76
|
+
options,
|
|
77
|
+
));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
async function $do(
|
|
81
|
+
client: GreenSecurityCore,
|
|
82
|
+
request: operations.InitiateScheduledReportRequest,
|
|
83
|
+
options?: RequestOptions,
|
|
84
|
+
): Promise<
|
|
85
|
+
[
|
|
86
|
+
Result<
|
|
87
|
+
operations.InitiateScheduledReportInitiateScheduledReportOk,
|
|
88
|
+
| errors.ApiErrorResponse
|
|
89
|
+
| errors.UnprocessableEntityOrValidationError
|
|
90
|
+
| GreenSecurityError
|
|
91
|
+
| ResponseValidationError
|
|
92
|
+
| ConnectionError
|
|
93
|
+
| RequestAbortedError
|
|
94
|
+
| RequestTimeoutError
|
|
95
|
+
| InvalidRequestError
|
|
96
|
+
| UnexpectedClientError
|
|
97
|
+
| SDKValidationError
|
|
98
|
+
>,
|
|
99
|
+
APICall,
|
|
100
|
+
]
|
|
101
|
+
> {
|
|
102
|
+
const parsed = safeParse(
|
|
103
|
+
request,
|
|
104
|
+
(value) =>
|
|
105
|
+
operations.InitiateScheduledReportRequest$outboundSchema.parse(value),
|
|
106
|
+
"Input validation failed",
|
|
107
|
+
);
|
|
108
|
+
if (!parsed.ok) {
|
|
109
|
+
return [parsed, { status: "invalid" }];
|
|
110
|
+
}
|
|
111
|
+
const payload = parsed.value;
|
|
112
|
+
const body = null;
|
|
113
|
+
|
|
114
|
+
const pathParams = {
|
|
115
|
+
scheduled_report_id: encodeSimple(
|
|
116
|
+
"scheduled_report_id",
|
|
117
|
+
payload.scheduled_report_id,
|
|
118
|
+
{ explode: false, charEncoding: "percent" },
|
|
119
|
+
),
|
|
120
|
+
};
|
|
121
|
+
const path = pathToFunc("/scheduled-reports/{scheduled_report_id}")(
|
|
122
|
+
pathParams,
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
const headers = new Headers(compactMap({
|
|
126
|
+
Accept: "application/json",
|
|
127
|
+
}));
|
|
128
|
+
|
|
129
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
130
|
+
const requestSecurity = resolveGlobalSecurity(securityInput, [1]);
|
|
131
|
+
|
|
132
|
+
const context = {
|
|
133
|
+
options: client._options,
|
|
134
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
135
|
+
operationID: "initiateScheduledReport",
|
|
136
|
+
oAuth2Scopes: null,
|
|
137
|
+
|
|
138
|
+
resolvedSecurity: requestSecurity,
|
|
139
|
+
|
|
140
|
+
securitySource: client._options.security,
|
|
141
|
+
retryConfig: options?.retries
|
|
142
|
+
|| client._options.retryConfig
|
|
143
|
+
|| { strategy: "none" },
|
|
144
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
const requestRes = client._createRequest(context, {
|
|
148
|
+
security: requestSecurity,
|
|
149
|
+
method: "POST",
|
|
150
|
+
baseURL: options?.serverURL,
|
|
151
|
+
path: path,
|
|
152
|
+
headers: headers,
|
|
153
|
+
body: body,
|
|
154
|
+
userAgent: client._options.userAgent,
|
|
155
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
156
|
+
}, options);
|
|
157
|
+
if (!requestRes.ok) {
|
|
158
|
+
return [requestRes, { status: "invalid" }];
|
|
159
|
+
}
|
|
160
|
+
const req = requestRes.value;
|
|
161
|
+
|
|
162
|
+
const doResult = await client._do(req, {
|
|
163
|
+
context,
|
|
164
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
165
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
166
|
+
retryConfig: context.retryConfig,
|
|
167
|
+
retryCodes: context.retryCodes,
|
|
168
|
+
});
|
|
169
|
+
if (!doResult.ok) {
|
|
170
|
+
return [doResult, { status: "request-error", request: req }];
|
|
171
|
+
}
|
|
172
|
+
const response = doResult.value;
|
|
173
|
+
|
|
174
|
+
const responseFields = {
|
|
175
|
+
HttpMeta: { Response: response, Request: req },
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
const [result] = await M.match<
|
|
179
|
+
operations.InitiateScheduledReportInitiateScheduledReportOk,
|
|
180
|
+
| errors.ApiErrorResponse
|
|
181
|
+
| errors.UnprocessableEntityOrValidationError
|
|
182
|
+
| GreenSecurityError
|
|
183
|
+
| ResponseValidationError
|
|
184
|
+
| ConnectionError
|
|
185
|
+
| RequestAbortedError
|
|
186
|
+
| RequestTimeoutError
|
|
187
|
+
| InvalidRequestError
|
|
188
|
+
| UnexpectedClientError
|
|
189
|
+
| SDKValidationError
|
|
190
|
+
>(
|
|
191
|
+
M.json(
|
|
192
|
+
200,
|
|
193
|
+
operations.InitiateScheduledReportInitiateScheduledReportOk$inboundSchema,
|
|
194
|
+
),
|
|
195
|
+
M.jsonErr([400, 401, 403, 404], errors.ApiErrorResponse$inboundSchema),
|
|
196
|
+
M.jsonErr(422, errors.UnprocessableEntityOrValidationError$inboundSchema),
|
|
197
|
+
M.fail("4XX"),
|
|
198
|
+
M.fail([500, "5XX"]),
|
|
199
|
+
)(response, req, { extraFields: responseFields });
|
|
200
|
+
if (!result.ok) {
|
|
201
|
+
return [result, { status: "complete", request: req, response }];
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
return [result, { status: "complete", request: req, response }];
|
|
205
|
+
}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { GreenSecurityCore } from "../core.js";
|
|
6
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import { GreenSecurityError } from "../models/errors/greensecurityerror.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/httpclienterrors.js";
|
|
22
|
+
import * as errors from "../models/errors/index.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Automatic GPS check-out configuration
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Returns the geofence a client should arm to detect that the vendor has left the location this scan belongs to. A facility that has automatic GPS check-out configured owns the geofence for every one of its zones; only when it does not does the zone's own setting apply.
|
|
34
|
+
*/
|
|
35
|
+
export function vendorScansVendorScanGpsCheckoutConfig(
|
|
36
|
+
client: GreenSecurityCore,
|
|
37
|
+
request: operations.VendorScanGpsCheckoutConfigRequest,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): APIPromise<
|
|
40
|
+
Result<
|
|
41
|
+
operations.VendorScanGpsCheckoutConfigVendorScanGpsCheckoutConfigOk,
|
|
42
|
+
| errors.ApiErrorResponse
|
|
43
|
+
| GreenSecurityError
|
|
44
|
+
| ResponseValidationError
|
|
45
|
+
| ConnectionError
|
|
46
|
+
| RequestAbortedError
|
|
47
|
+
| RequestTimeoutError
|
|
48
|
+
| InvalidRequestError
|
|
49
|
+
| UnexpectedClientError
|
|
50
|
+
| SDKValidationError
|
|
51
|
+
>
|
|
52
|
+
> {
|
|
53
|
+
return new APIPromise($do(
|
|
54
|
+
client,
|
|
55
|
+
request,
|
|
56
|
+
options,
|
|
57
|
+
));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async function $do(
|
|
61
|
+
client: GreenSecurityCore,
|
|
62
|
+
request: operations.VendorScanGpsCheckoutConfigRequest,
|
|
63
|
+
options?: RequestOptions,
|
|
64
|
+
): Promise<
|
|
65
|
+
[
|
|
66
|
+
Result<
|
|
67
|
+
operations.VendorScanGpsCheckoutConfigVendorScanGpsCheckoutConfigOk,
|
|
68
|
+
| errors.ApiErrorResponse
|
|
69
|
+
| GreenSecurityError
|
|
70
|
+
| ResponseValidationError
|
|
71
|
+
| ConnectionError
|
|
72
|
+
| RequestAbortedError
|
|
73
|
+
| RequestTimeoutError
|
|
74
|
+
| InvalidRequestError
|
|
75
|
+
| UnexpectedClientError
|
|
76
|
+
| SDKValidationError
|
|
77
|
+
>,
|
|
78
|
+
APICall,
|
|
79
|
+
]
|
|
80
|
+
> {
|
|
81
|
+
const parsed = safeParse(
|
|
82
|
+
request,
|
|
83
|
+
(value) =>
|
|
84
|
+
operations.VendorScanGpsCheckoutConfigRequest$outboundSchema.parse(value),
|
|
85
|
+
"Input validation failed",
|
|
86
|
+
);
|
|
87
|
+
if (!parsed.ok) {
|
|
88
|
+
return [parsed, { status: "invalid" }];
|
|
89
|
+
}
|
|
90
|
+
const payload = parsed.value;
|
|
91
|
+
const body = null;
|
|
92
|
+
|
|
93
|
+
const pathParams = {
|
|
94
|
+
id: encodeSimple("id", payload.id, {
|
|
95
|
+
explode: false,
|
|
96
|
+
charEncoding: "percent",
|
|
97
|
+
}),
|
|
98
|
+
};
|
|
99
|
+
const path = pathToFunc("/vendor-scans/{id}/gps-checkout-config")(pathParams);
|
|
100
|
+
|
|
101
|
+
const headers = new Headers(compactMap({
|
|
102
|
+
Accept: "application/json",
|
|
103
|
+
}));
|
|
104
|
+
|
|
105
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
106
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
107
|
+
|
|
108
|
+
const context = {
|
|
109
|
+
options: client._options,
|
|
110
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
111
|
+
operationID: "vendorScanGpsCheckoutConfig",
|
|
112
|
+
oAuth2Scopes: null,
|
|
113
|
+
|
|
114
|
+
resolvedSecurity: requestSecurity,
|
|
115
|
+
|
|
116
|
+
securitySource: client._options.security,
|
|
117
|
+
retryConfig: options?.retries
|
|
118
|
+
|| client._options.retryConfig
|
|
119
|
+
|| { strategy: "none" },
|
|
120
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
const requestRes = client._createRequest(context, {
|
|
124
|
+
security: requestSecurity,
|
|
125
|
+
method: "GET",
|
|
126
|
+
baseURL: options?.serverURL,
|
|
127
|
+
path: path,
|
|
128
|
+
headers: headers,
|
|
129
|
+
body: body,
|
|
130
|
+
userAgent: client._options.userAgent,
|
|
131
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
132
|
+
}, options);
|
|
133
|
+
if (!requestRes.ok) {
|
|
134
|
+
return [requestRes, { status: "invalid" }];
|
|
135
|
+
}
|
|
136
|
+
const req = requestRes.value;
|
|
137
|
+
|
|
138
|
+
const doResult = await client._do(req, {
|
|
139
|
+
context,
|
|
140
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
141
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
142
|
+
retryConfig: context.retryConfig,
|
|
143
|
+
retryCodes: context.retryCodes,
|
|
144
|
+
});
|
|
145
|
+
if (!doResult.ok) {
|
|
146
|
+
return [doResult, { status: "request-error", request: req }];
|
|
147
|
+
}
|
|
148
|
+
const response = doResult.value;
|
|
149
|
+
|
|
150
|
+
const responseFields = {
|
|
151
|
+
HttpMeta: { Response: response, Request: req },
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
const [result] = await M.match<
|
|
155
|
+
operations.VendorScanGpsCheckoutConfigVendorScanGpsCheckoutConfigOk,
|
|
156
|
+
| errors.ApiErrorResponse
|
|
157
|
+
| GreenSecurityError
|
|
158
|
+
| ResponseValidationError
|
|
159
|
+
| ConnectionError
|
|
160
|
+
| RequestAbortedError
|
|
161
|
+
| RequestTimeoutError
|
|
162
|
+
| InvalidRequestError
|
|
163
|
+
| UnexpectedClientError
|
|
164
|
+
| SDKValidationError
|
|
165
|
+
>(
|
|
166
|
+
M.json(
|
|
167
|
+
200,
|
|
168
|
+
operations
|
|
169
|
+
.VendorScanGpsCheckoutConfigVendorScanGpsCheckoutConfigOk$inboundSchema,
|
|
170
|
+
),
|
|
171
|
+
M.jsonErr([400, 401, 403, 404], errors.ApiErrorResponse$inboundSchema),
|
|
172
|
+
M.fail("4XX"),
|
|
173
|
+
M.fail([500, "5XX"]),
|
|
174
|
+
)(response, req, { extraFields: responseFields });
|
|
175
|
+
if (!result.ok) {
|
|
176
|
+
return [result, { status: "complete", request: req, response }];
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
return [result, { status: "complete", request: req, response }];
|
|
180
|
+
}
|