@greensecurity/javascript-sdk 0.44.0-beta.71 → 0.44.0-beta.72
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 +1 -4
- package/dist/commonjs/__tests__/vendors.test.js +1 -1
- package/dist/commonjs/__tests__/vendorscans.test.js +2 -21
- package/dist/commonjs/__tests__/vendorscans.test.js.map +1 -1
- package/dist/commonjs/__tests__/webhooks.test.js +6 -5
- package/dist/commonjs/__tests__/webhooks.test.js.map +1 -1
- package/dist/commonjs/__tests__/zones.test.js +8 -11
- package/dist/commonjs/__tests__/zones.test.js.map +1 -1
- package/dist/commonjs/funcs/invoicesInvoicesExport.js +2 -0
- package/dist/commonjs/funcs/invoicesInvoicesExport.js.map +1 -1
- package/dist/commonjs/funcs/invoicesListInvoices.js +2 -0
- package/dist/commonjs/funcs/invoicesListInvoices.js.map +1 -1
- package/dist/commonjs/funcs/vendorScansExportVendorScans.d.ts +3 -3
- package/dist/commonjs/funcs/vendorScansExportVendorScans.js +3 -3
- package/dist/commonjs/funcs/vendorScansVendorScanOut.d.ts +1 -1
- package/dist/commonjs/funcs/vendorScansVendorScanOut.js +3 -2
- package/dist/commonjs/funcs/vendorScansVendorScanOut.js.map +1 -1
- package/dist/commonjs/funcs/vendorsAddVendorCredentialFileForAutoClassification.js +1 -1
- package/dist/commonjs/funcs/vendorsAddVendorCredentialFileForAutoClassification.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/vendorcredentialfileforautoclassificationrequest.d.ts +5 -0
- package/dist/commonjs/models/components/vendorcredentialfileforautoclassificationrequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/vendorcredentialfileforautoclassificationrequest.js +2 -0
- package/dist/commonjs/models/components/vendorcredentialfileforautoclassificationrequest.js.map +1 -1
- package/dist/commonjs/models/operations/index.d.ts +0 -1
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +0 -1
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/invoicesexport.d.ts +10 -0
- package/dist/commonjs/models/operations/invoicesexport.d.ts.map +1 -1
- package/dist/commonjs/models/operations/invoicesexport.js +4 -0
- package/dist/commonjs/models/operations/invoicesexport.js.map +1 -1
- package/dist/commonjs/models/operations/listinvoices.d.ts +10 -0
- package/dist/commonjs/models/operations/listinvoices.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listinvoices.js +4 -0
- package/dist/commonjs/models/operations/listinvoices.js.map +1 -1
- package/dist/commonjs/models/operations/vendorscanout.d.ts +15 -0
- package/dist/commonjs/models/operations/vendorscanout.d.ts.map +1 -1
- package/dist/commonjs/models/operations/vendorscanout.js +19 -1
- package/dist/commonjs/models/operations/vendorscanout.js.map +1 -1
- package/dist/commonjs/react-query/index.d.ts +0 -1
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +0 -1
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/react-query/invoicesInvoicesExport.core.d.ts +2 -0
- package/dist/commonjs/react-query/invoicesInvoicesExport.core.d.ts.map +1 -1
- package/dist/commonjs/react-query/invoicesInvoicesExport.core.js +2 -0
- package/dist/commonjs/react-query/invoicesInvoicesExport.core.js.map +1 -1
- package/dist/commonjs/react-query/invoicesInvoicesExport.d.ts +4 -0
- package/dist/commonjs/react-query/invoicesInvoicesExport.d.ts.map +1 -1
- package/dist/commonjs/react-query/invoicesInvoicesExport.js.map +1 -1
- package/dist/commonjs/react-query/invoicesListInvoices.core.d.ts +4 -0
- package/dist/commonjs/react-query/invoicesListInvoices.core.d.ts.map +1 -1
- package/dist/commonjs/react-query/invoicesListInvoices.core.js +4 -0
- package/dist/commonjs/react-query/invoicesListInvoices.core.js.map +1 -1
- package/dist/commonjs/react-query/invoicesListInvoices.d.ts +4 -0
- package/dist/commonjs/react-query/invoicesListInvoices.d.ts.map +1 -1
- package/dist/commonjs/react-query/invoicesListInvoices.js.map +1 -1
- package/dist/commonjs/react-query/vendorScansExportVendorScans.d.ts +6 -6
- package/dist/commonjs/react-query/vendorScansExportVendorScans.js +6 -6
- package/dist/commonjs/react-query/vendorScansVendorScanOut.d.ts +1 -1
- package/dist/commonjs/react-query/vendorScansVendorScanOut.js +1 -1
- package/dist/commonjs/sdk/vendorscans.d.ts +4 -13
- package/dist/commonjs/sdk/vendorscans.d.ts.map +1 -1
- package/dist/commonjs/sdk/vendorscans.js +4 -16
- package/dist/commonjs/sdk/vendorscans.js.map +1 -1
- package/dist/esm/__tests__/vendors.test.js +1 -1
- package/dist/esm/__tests__/vendorscans.test.js +3 -22
- package/dist/esm/__tests__/vendorscans.test.js.map +1 -1
- package/dist/esm/__tests__/webhooks.test.js +6 -5
- package/dist/esm/__tests__/webhooks.test.js.map +1 -1
- package/dist/esm/__tests__/zones.test.js +8 -11
- package/dist/esm/__tests__/zones.test.js.map +1 -1
- package/dist/esm/funcs/invoicesInvoicesExport.js +2 -0
- package/dist/esm/funcs/invoicesInvoicesExport.js.map +1 -1
- package/dist/esm/funcs/invoicesListInvoices.js +2 -0
- package/dist/esm/funcs/invoicesListInvoices.js.map +1 -1
- package/dist/esm/funcs/vendorScansExportVendorScans.d.ts +3 -3
- package/dist/esm/funcs/vendorScansExportVendorScans.js +3 -3
- package/dist/esm/funcs/vendorScansVendorScanOut.d.ts +1 -1
- package/dist/esm/funcs/vendorScansVendorScanOut.js +4 -3
- package/dist/esm/funcs/vendorScansVendorScanOut.js.map +1 -1
- package/dist/esm/funcs/vendorsAddVendorCredentialFileForAutoClassification.js +1 -1
- package/dist/esm/funcs/vendorsAddVendorCredentialFileForAutoClassification.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/vendorcredentialfileforautoclassificationrequest.d.ts +5 -0
- package/dist/esm/models/components/vendorcredentialfileforautoclassificationrequest.d.ts.map +1 -1
- package/dist/esm/models/components/vendorcredentialfileforautoclassificationrequest.js +2 -0
- package/dist/esm/models/components/vendorcredentialfileforautoclassificationrequest.js.map +1 -1
- package/dist/esm/models/operations/index.d.ts +0 -1
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +0 -1
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/invoicesexport.d.ts +10 -0
- package/dist/esm/models/operations/invoicesexport.d.ts.map +1 -1
- package/dist/esm/models/operations/invoicesexport.js +4 -0
- package/dist/esm/models/operations/invoicesexport.js.map +1 -1
- package/dist/esm/models/operations/listinvoices.d.ts +10 -0
- package/dist/esm/models/operations/listinvoices.d.ts.map +1 -1
- package/dist/esm/models/operations/listinvoices.js +4 -0
- package/dist/esm/models/operations/listinvoices.js.map +1 -1
- package/dist/esm/models/operations/vendorscanout.d.ts +15 -0
- package/dist/esm/models/operations/vendorscanout.d.ts.map +1 -1
- package/dist/esm/models/operations/vendorscanout.js +17 -0
- package/dist/esm/models/operations/vendorscanout.js.map +1 -1
- package/dist/esm/react-query/index.d.ts +0 -1
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +0 -1
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/react-query/invoicesInvoicesExport.core.d.ts +2 -0
- package/dist/esm/react-query/invoicesInvoicesExport.core.d.ts.map +1 -1
- package/dist/esm/react-query/invoicesInvoicesExport.core.js +2 -0
- package/dist/esm/react-query/invoicesInvoicesExport.core.js.map +1 -1
- package/dist/esm/react-query/invoicesInvoicesExport.d.ts +4 -0
- package/dist/esm/react-query/invoicesInvoicesExport.d.ts.map +1 -1
- package/dist/esm/react-query/invoicesInvoicesExport.js.map +1 -1
- package/dist/esm/react-query/invoicesListInvoices.core.d.ts +4 -0
- package/dist/esm/react-query/invoicesListInvoices.core.d.ts.map +1 -1
- package/dist/esm/react-query/invoicesListInvoices.core.js +4 -0
- package/dist/esm/react-query/invoicesListInvoices.core.js.map +1 -1
- package/dist/esm/react-query/invoicesListInvoices.d.ts +4 -0
- package/dist/esm/react-query/invoicesListInvoices.d.ts.map +1 -1
- package/dist/esm/react-query/invoicesListInvoices.js.map +1 -1
- package/dist/esm/react-query/vendorScansExportVendorScans.d.ts +6 -6
- package/dist/esm/react-query/vendorScansExportVendorScans.js +6 -6
- package/dist/esm/react-query/vendorScansVendorScanOut.d.ts +1 -1
- package/dist/esm/react-query/vendorScansVendorScanOut.js +1 -1
- package/dist/esm/sdk/vendorscans.d.ts +4 -13
- package/dist/esm/sdk/vendorscans.d.ts.map +1 -1
- package/dist/esm/sdk/vendorscans.js +4 -16
- package/dist/esm/sdk/vendorscans.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/__tests__/vendors.test.ts +1 -1
- package/src/__tests__/vendorscans.test.ts +5 -24
- package/src/__tests__/webhooks.test.ts +6 -5
- package/src/__tests__/zones.test.ts +8 -11
- package/src/funcs/invoicesInvoicesExport.ts +2 -0
- package/src/funcs/invoicesListInvoices.ts +2 -0
- package/src/funcs/vendorScansExportVendorScans.ts +3 -3
- package/src/funcs/vendorScansVendorScanOut.ts +4 -3
- package/src/funcs/vendorsAddVendorCredentialFileForAutoClassification.ts +4 -1
- package/src/lib/config.ts +3 -3
- package/src/models/components/vendorcredentialfileforautoclassificationrequest.ts +7 -0
- package/src/models/operations/index.ts +0 -1
- package/src/models/operations/invoicesexport.ts +14 -0
- package/src/models/operations/listinvoices.ts +14 -0
- package/src/models/operations/vendorscanout.ts +43 -0
- package/src/react-query/index.ts +0 -1
- package/src/react-query/invoicesInvoicesExport.core.ts +4 -0
- package/src/react-query/invoicesInvoicesExport.ts +4 -0
- package/src/react-query/invoicesListInvoices.core.ts +8 -0
- package/src/react-query/invoicesListInvoices.ts +4 -0
- package/src/react-query/vendorScansExportVendorScans.ts +6 -6
- package/src/react-query/vendorScansVendorScanOut.ts +1 -1
- package/src/sdk/vendorscans.ts +4 -24
- package/dist/commonjs/funcs/vendorScansVendorScanGpsScanOut.d.ts +0 -20
- package/dist/commonjs/funcs/vendorScansVendorScanGpsScanOut.d.ts.map +0 -1
- package/dist/commonjs/funcs/vendorScansVendorScanGpsScanOut.js +0 -126
- package/dist/commonjs/funcs/vendorScansVendorScanGpsScanOut.js.map +0 -1
- package/dist/commonjs/models/operations/vendorscangpsscanout.d.ts +0 -81
- package/dist/commonjs/models/operations/vendorscangpsscanout.d.ts.map +0 -1
- package/dist/commonjs/models/operations/vendorscangpsscanout.js +0 -96
- package/dist/commonjs/models/operations/vendorscangpsscanout.js.map +0 -1
- package/dist/commonjs/react-query/vendorScansVendorScanGpsScanOut.d.ts +0 -31
- package/dist/commonjs/react-query/vendorScansVendorScanGpsScanOut.d.ts.map +0 -1
- package/dist/commonjs/react-query/vendorScansVendorScanGpsScanOut.js +0 -53
- package/dist/commonjs/react-query/vendorScansVendorScanGpsScanOut.js.map +0 -1
- package/dist/esm/funcs/vendorScansVendorScanGpsScanOut.d.ts +0 -20
- package/dist/esm/funcs/vendorScansVendorScanGpsScanOut.d.ts.map +0 -1
- package/dist/esm/funcs/vendorScansVendorScanGpsScanOut.js +0 -90
- package/dist/esm/funcs/vendorScansVendorScanGpsScanOut.js.map +0 -1
- package/dist/esm/models/operations/vendorscangpsscanout.d.ts +0 -81
- package/dist/esm/models/operations/vendorscangpsscanout.d.ts.map +0 -1
- package/dist/esm/models/operations/vendorscangpsscanout.js +0 -57
- package/dist/esm/models/operations/vendorscangpsscanout.js.map +0 -1
- package/dist/esm/react-query/vendorScansVendorScanGpsScanOut.d.ts +0 -31
- package/dist/esm/react-query/vendorScansVendorScanGpsScanOut.d.ts.map +0 -1
- package/dist/esm/react-query/vendorScansVendorScanGpsScanOut.js +0 -48
- package/dist/esm/react-query/vendorScansVendorScanGpsScanOut.js.map +0 -1
- package/src/funcs/vendorScansVendorScanGpsScanOut.ts +0 -182
- package/src/models/operations/vendorscangpsscanout.ts +0 -167
- package/src/react-query/vendorScansVendorScanGpsScanOut.ts +0 -117
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
5
|
-
import { matchStatusCode } from "../lib/http.js";
|
|
6
|
-
import * as M from "../lib/matchers.js";
|
|
7
|
-
import { compactMap } from "../lib/primitives.js";
|
|
8
|
-
import { safeParse } from "../lib/schemas.js";
|
|
9
|
-
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
10
|
-
import { pathToFunc } from "../lib/url.js";
|
|
11
|
-
import * as errors from "../models/errors/index.js";
|
|
12
|
-
import * as operations from "../models/operations/index.js";
|
|
13
|
-
import { APIPromise } from "../types/async.js";
|
|
14
|
-
/**
|
|
15
|
-
* Automatic GPS check-out
|
|
16
|
-
*
|
|
17
|
-
* @remarks
|
|
18
|
-
* Reports the device's current position and scans the vendor out when it lies outside the geofence returned by the GPS check-out configuration endpoint. The distance is always recomputed server-side. Reporting the same exit twice is a no-op.
|
|
19
|
-
*
|
|
20
|
-
* When an accuracy radius is supplied it is discounted from the distance before the comparison. The vendor is checked out only when the entire error margin clears the geofence AND the reported accuracy is at most 328 ft (100 m). When only half the margin clears it — or the margin clears it entirely but is wider than that ceiling — the visit is left open and the vendor is sent a reminder to check out instead, once per check-in; the response then reports `success: false` with `outcome: possibly_left`.
|
|
21
|
-
*/
|
|
22
|
-
export function vendorScansVendorScanGpsScanOut(client, request, options) {
|
|
23
|
-
return new APIPromise($do(client, request, options));
|
|
24
|
-
}
|
|
25
|
-
async function $do(client, request, options) {
|
|
26
|
-
const parsed = safeParse(request, (value) => operations.VendorScanGpsScanOutRequest$outboundSchema.parse(value), "Input validation failed");
|
|
27
|
-
if (!parsed.ok) {
|
|
28
|
-
return [parsed, { status: "invalid" }];
|
|
29
|
-
}
|
|
30
|
-
const payload = parsed.value;
|
|
31
|
-
const body = encodeJSON("body", payload.RequestBody, { explode: true });
|
|
32
|
-
const pathParams = {
|
|
33
|
-
id: encodeSimple("id", payload.id, {
|
|
34
|
-
explode: false,
|
|
35
|
-
charEncoding: "percent",
|
|
36
|
-
}),
|
|
37
|
-
};
|
|
38
|
-
const path = pathToFunc("/vendor-scans/{id}/gps-scan-out")(pathParams);
|
|
39
|
-
const headers = new Headers(compactMap({
|
|
40
|
-
"Content-Type": "application/json",
|
|
41
|
-
Accept: "application/json",
|
|
42
|
-
}));
|
|
43
|
-
const securityInput = await extractSecurity(client._options.security);
|
|
44
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
45
|
-
const context = {
|
|
46
|
-
options: client._options,
|
|
47
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
48
|
-
operationID: "vendorScanGpsScanOut",
|
|
49
|
-
oAuth2Scopes: null,
|
|
50
|
-
resolvedSecurity: requestSecurity,
|
|
51
|
-
securitySource: client._options.security,
|
|
52
|
-
retryConfig: options?.retries
|
|
53
|
-
|| client._options.retryConfig
|
|
54
|
-
|| { strategy: "none" },
|
|
55
|
-
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
56
|
-
};
|
|
57
|
-
const requestRes = client._createRequest(context, {
|
|
58
|
-
security: requestSecurity,
|
|
59
|
-
method: "POST",
|
|
60
|
-
baseURL: options?.serverURL,
|
|
61
|
-
path: path,
|
|
62
|
-
headers: headers,
|
|
63
|
-
body: body,
|
|
64
|
-
userAgent: client._options.userAgent,
|
|
65
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
66
|
-
}, options);
|
|
67
|
-
if (!requestRes.ok) {
|
|
68
|
-
return [requestRes, { status: "invalid" }];
|
|
69
|
-
}
|
|
70
|
-
const req = requestRes.value;
|
|
71
|
-
const doResult = await client._do(req, {
|
|
72
|
-
context,
|
|
73
|
-
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
74
|
-
retryConfig: context.retryConfig,
|
|
75
|
-
retryCodes: context.retryCodes,
|
|
76
|
-
});
|
|
77
|
-
if (!doResult.ok) {
|
|
78
|
-
return [doResult, { status: "request-error", request: req }];
|
|
79
|
-
}
|
|
80
|
-
const response = doResult.value;
|
|
81
|
-
const responseFields = {
|
|
82
|
-
HttpMeta: { Response: response, Request: req },
|
|
83
|
-
};
|
|
84
|
-
const [result] = await M.match(M.json(200, operations.VendorScanGpsScanOutVendorScanGpsScanOutOk$inboundSchema), M.jsonErr([400, 401, 403, 404, 422], errors.ApiErrorResponse$inboundSchema), M.fail("4XX"), M.fail([500, "5XX"]))(response, req, { extraFields: responseFields });
|
|
85
|
-
if (!result.ok) {
|
|
86
|
-
return [result, { status: "complete", request: req, response }];
|
|
87
|
-
}
|
|
88
|
-
return [result, { status: "complete", request: req, response }];
|
|
89
|
-
}
|
|
90
|
-
//# sourceMappingURL=vendorScansVendorScanGpsScanOut.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vendorScansVendorScanGpsScanOut.js","sourceRoot":"","sources":["../../../src/funcs/vendorScansVendorScanGpsScanOut.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,CAAC,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAS3C,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AAGpD,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAW,UAAU,EAAE,M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as z from "zod/v3";
|
|
2
|
-
import { OpenEnum } from "../../types/enums.js";
|
|
3
|
-
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
4
|
-
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
5
|
-
export type VendorScanGpsScanOutVendorScanGpsScanOutRequest = {
|
|
6
|
-
/**
|
|
7
|
-
* Reported latitude, between -90 and 90.
|
|
8
|
-
*/
|
|
9
|
-
latitude: number;
|
|
10
|
-
/**
|
|
11
|
-
* Reported longitude, between -180 and 180.
|
|
12
|
-
*/
|
|
13
|
-
longitude: number;
|
|
14
|
-
/**
|
|
15
|
-
* Reported accuracy radius in FEET (not meters). The vendor is only checked out when the distance beyond the geofence exceeds it and it is no wider than 328 ft (100 m); a wider margin can earn a reminder but never a check-out.
|
|
16
|
-
*/
|
|
17
|
-
accuracy?: number | null | undefined;
|
|
18
|
-
};
|
|
19
|
-
export type VendorScanGpsScanOutRequest = {
|
|
20
|
-
/**
|
|
21
|
-
* The identifier of the object
|
|
22
|
-
*/
|
|
23
|
-
id: number;
|
|
24
|
-
requestBody: VendorScanGpsScanOutVendorScanGpsScanOutRequest;
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* Which branch the server took. `possibly_left` means the vendor was only reminded and the check-in is still open, so a client watching a geofence should stay armed — it is the one case that answers `success: false` without being a refusal like `checkout_failed`.
|
|
28
|
-
*/
|
|
29
|
-
export declare const Outcome: {
|
|
30
|
-
readonly CheckedOut: "checked_out";
|
|
31
|
-
readonly PossiblyLeft: "possibly_left";
|
|
32
|
-
readonly InsideRadius: "inside_radius";
|
|
33
|
-
readonly AlreadyCheckedOut: "already_checked_out";
|
|
34
|
-
readonly CheckoutFailed: "checkout_failed";
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* Which branch the server took. `possibly_left` means the vendor was only reminded and the check-in is still open, so a client watching a geofence should stay armed — it is the one case that answers `success: false` without being a refusal like `checkout_failed`.
|
|
38
|
-
*/
|
|
39
|
-
export type Outcome = OpenEnum<typeof Outcome>;
|
|
40
|
-
/**
|
|
41
|
-
* The request was successful, and the server has returned the requested resource in the response body.
|
|
42
|
-
*/
|
|
43
|
-
export type VendorScanGpsScanOutVendorScanGpsScanOutOk = {
|
|
44
|
-
error?: string | null | undefined;
|
|
45
|
-
reason?: string | null | undefined;
|
|
46
|
-
/**
|
|
47
|
-
* Smart badge LED payload data. Only present when the scan-out response can update a smart badge locally.
|
|
48
|
-
*/
|
|
49
|
-
badgeData?: string | null | undefined;
|
|
50
|
-
/**
|
|
51
|
-
* True when the vendor was checked out, was already checked out, or is still inside the geofence. False when the check-out was refused, and when the position was too imprecise to act on and only earned a reminder.
|
|
52
|
-
*/
|
|
53
|
-
success: boolean;
|
|
54
|
-
/**
|
|
55
|
-
* Which branch the server took. `possibly_left` means the vendor was only reminded and the check-in is still open, so a client watching a geofence should stay armed — it is the one case that answers `success: false` without being a refusal like `checkout_failed`.
|
|
56
|
-
*/
|
|
57
|
-
outcome: Outcome;
|
|
58
|
-
};
|
|
59
|
-
/** @internal */
|
|
60
|
-
export type VendorScanGpsScanOutVendorScanGpsScanOutRequest$Outbound = {
|
|
61
|
-
latitude: number;
|
|
62
|
-
longitude: number;
|
|
63
|
-
accuracy?: number | null | undefined;
|
|
64
|
-
};
|
|
65
|
-
/** @internal */
|
|
66
|
-
export declare const VendorScanGpsScanOutVendorScanGpsScanOutRequest$outboundSchema: z.ZodType<VendorScanGpsScanOutVendorScanGpsScanOutRequest$Outbound, z.ZodTypeDef, VendorScanGpsScanOutVendorScanGpsScanOutRequest>;
|
|
67
|
-
export declare function vendorScanGpsScanOutVendorScanGpsScanOutRequestToJSON(vendorScanGpsScanOutVendorScanGpsScanOutRequest: VendorScanGpsScanOutVendorScanGpsScanOutRequest): string;
|
|
68
|
-
/** @internal */
|
|
69
|
-
export type VendorScanGpsScanOutRequest$Outbound = {
|
|
70
|
-
id: number;
|
|
71
|
-
RequestBody: VendorScanGpsScanOutVendorScanGpsScanOutRequest$Outbound;
|
|
72
|
-
};
|
|
73
|
-
/** @internal */
|
|
74
|
-
export declare const VendorScanGpsScanOutRequest$outboundSchema: z.ZodType<VendorScanGpsScanOutRequest$Outbound, z.ZodTypeDef, VendorScanGpsScanOutRequest>;
|
|
75
|
-
export declare function vendorScanGpsScanOutRequestToJSON(vendorScanGpsScanOutRequest: VendorScanGpsScanOutRequest): string;
|
|
76
|
-
/** @internal */
|
|
77
|
-
export declare const Outcome$inboundSchema: z.ZodType<Outcome, z.ZodTypeDef, unknown>;
|
|
78
|
-
/** @internal */
|
|
79
|
-
export declare const VendorScanGpsScanOutVendorScanGpsScanOutOk$inboundSchema: z.ZodType<VendorScanGpsScanOutVendorScanGpsScanOutOk, z.ZodTypeDef, unknown>;
|
|
80
|
-
export declare function vendorScanGpsScanOutVendorScanGpsScanOutOkFromJSON(jsonString: string): SafeParseResult<VendorScanGpsScanOutVendorScanGpsScanOutOk, SDKValidationError>;
|
|
81
|
-
//# sourceMappingURL=vendorscangpsscanout.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vendorscangpsscanout.d.ts","sourceRoot":"","sources":["../../../../src/models/operations/vendorscangpsscanout.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAI5B,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,MAAM,MAAM,+CAA+C,GAAG;IAC5D;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACxC;;OAEG;IACH,EAAE,EA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AED,gBAAgB;AAChB,eAAO,MAAM,qBAAqB,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,UAAU,EAAE,OAAO,CAC1C,CAAC;AAEnC,gBAAgB;AAChB,eAAO,MAAM,wDAAwD,EACnE,CAAC,CAAC,OAAO,CAAC,0CAA0C,EAAE,CAAC,CAAC,UAAU,EAAE,OAAO,CAWvE,CAAC;AAEP,wBAAgB,kDAAkD,CAChE,UAAU,EAAE,MAAM,GACjB,eAAe,CAChB,0CAA0C,EAC1C,kBAAkB,CACnB,CASA"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
import * as z from "zod/v3";
|
|
5
|
-
import { remap as remap$ } from "../../lib/primitives.js";
|
|
6
|
-
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
-
import * as openEnums from "../../types/enums.js";
|
|
8
|
-
import * as types from "../../types/primitives.js";
|
|
9
|
-
/**
|
|
10
|
-
* Which branch the server took. `possibly_left` means the vendor was only reminded and the check-in is still open, so a client watching a geofence should stay armed — it is the one case that answers `success: false` without being a refusal like `checkout_failed`.
|
|
11
|
-
*/
|
|
12
|
-
export const Outcome = {
|
|
13
|
-
CheckedOut: "checked_out",
|
|
14
|
-
PossiblyLeft: "possibly_left",
|
|
15
|
-
InsideRadius: "inside_radius",
|
|
16
|
-
AlreadyCheckedOut: "already_checked_out",
|
|
17
|
-
CheckoutFailed: "checkout_failed",
|
|
18
|
-
};
|
|
19
|
-
/** @internal */
|
|
20
|
-
export const VendorScanGpsScanOutVendorScanGpsScanOutRequest$outboundSchema = z.object({
|
|
21
|
-
latitude: z.number(),
|
|
22
|
-
longitude: z.number(),
|
|
23
|
-
accuracy: z.nullable(z.number()).optional(),
|
|
24
|
-
});
|
|
25
|
-
export function vendorScanGpsScanOutVendorScanGpsScanOutRequestToJSON(vendorScanGpsScanOutVendorScanGpsScanOutRequest) {
|
|
26
|
-
return JSON.stringify(VendorScanGpsScanOutVendorScanGpsScanOutRequest$outboundSchema.parse(vendorScanGpsScanOutVendorScanGpsScanOutRequest));
|
|
27
|
-
}
|
|
28
|
-
/** @internal */
|
|
29
|
-
export const VendorScanGpsScanOutRequest$outboundSchema = z.object({
|
|
30
|
-
id: z.number().int(),
|
|
31
|
-
requestBody: z.lazy(() => VendorScanGpsScanOutVendorScanGpsScanOutRequest$outboundSchema),
|
|
32
|
-
}).transform((v) => {
|
|
33
|
-
return remap$(v, {
|
|
34
|
-
requestBody: "RequestBody",
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
export function vendorScanGpsScanOutRequestToJSON(vendorScanGpsScanOutRequest) {
|
|
38
|
-
return JSON.stringify(VendorScanGpsScanOutRequest$outboundSchema.parse(vendorScanGpsScanOutRequest));
|
|
39
|
-
}
|
|
40
|
-
/** @internal */
|
|
41
|
-
export const Outcome$inboundSchema = openEnums.inboundSchema(Outcome);
|
|
42
|
-
/** @internal */
|
|
43
|
-
export const VendorScanGpsScanOutVendorScanGpsScanOutOk$inboundSchema = z.object({
|
|
44
|
-
error: z.nullable(types.string()).optional(),
|
|
45
|
-
reason: z.nullable(types.string()).optional(),
|
|
46
|
-
badge_data: z.nullable(types.string()).optional(),
|
|
47
|
-
success: types.boolean(),
|
|
48
|
-
outcome: Outcome$inboundSchema,
|
|
49
|
-
}).transform((v) => {
|
|
50
|
-
return remap$(v, {
|
|
51
|
-
"badge_data": "badgeData",
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
export function vendorScanGpsScanOutVendorScanGpsScanOutOkFromJSON(jsonString) {
|
|
55
|
-
return safeParse(jsonString, (x) => VendorScanGpsScanOutVendorScanGpsScanOutOk$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VendorScanGpsScanOutVendorScanGpsScanOutOk' from JSON`);
|
|
56
|
-
}
|
|
57
|
-
//# sourceMappingURL=vendorscangpsscanout.js.map
|
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query";
|
|
2
|
-
import { GreenSecurityCore } from "../core.js";
|
|
3
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
4
|
-
import { GreenSecurityError } from "../models/errors/greensecurityerror.js";
|
|
5
|
-
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
6
|
-
import * as errors from "../models/errors/index.js";
|
|
7
|
-
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
8
|
-
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
9
|
-
import * as operations from "../models/operations/index.js";
|
|
10
|
-
import { MutationHookOptions } from "./_types.js";
|
|
11
|
-
export type VendorScansVendorScanGpsScanOutMutationVariables = {
|
|
12
|
-
request: operations.VendorScanGpsScanOutRequest;
|
|
13
|
-
options?: RequestOptions;
|
|
14
|
-
};
|
|
15
|
-
export type VendorScansVendorScanGpsScanOutMutationData = operations.VendorScanGpsScanOutVendorScanGpsScanOutOk;
|
|
16
|
-
export type VendorScansVendorScanGpsScanOutMutationError = errors.ApiErrorResponse | GreenSecurityError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError;
|
|
17
|
-
/**
|
|
18
|
-
* Automatic GPS check-out
|
|
19
|
-
*
|
|
20
|
-
* @remarks
|
|
21
|
-
* Reports the device's current position and scans the vendor out when it lies outside the geofence returned by the GPS check-out configuration endpoint. The distance is always recomputed server-side. Reporting the same exit twice is a no-op.
|
|
22
|
-
*
|
|
23
|
-
* When an accuracy radius is supplied it is discounted from the distance before the comparison. The vendor is checked out only when the entire error margin clears the geofence AND the reported accuracy is at most 328 ft (100 m). When only half the margin clears it — or the margin clears it entirely but is wider than that ceiling — the visit is left open and the vendor is sent a reminder to check out instead, once per check-in; the response then reports `success: false` with `outcome: possibly_left`.
|
|
24
|
-
*/
|
|
25
|
-
export declare function useVendorScansVendorScanGpsScanOutMutation(options?: MutationHookOptions<VendorScansVendorScanGpsScanOutMutationData, VendorScansVendorScanGpsScanOutMutationError, VendorScansVendorScanGpsScanOutMutationVariables>): UseMutationResult<VendorScansVendorScanGpsScanOutMutationData, VendorScansVendorScanGpsScanOutMutationError, VendorScansVendorScanGpsScanOutMutationVariables>;
|
|
26
|
-
export declare function mutationKeyVendorScansVendorScanGpsScanOut(): MutationKey;
|
|
27
|
-
export declare function buildVendorScansVendorScanGpsScanOutMutation(client$: GreenSecurityCore, hookOptions?: RequestOptions): {
|
|
28
|
-
mutationKey: MutationKey;
|
|
29
|
-
mutationFn: (variables: VendorScansVendorScanGpsScanOutMutationVariables) => Promise<VendorScansVendorScanGpsScanOutMutationData>;
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=vendorScansVendorScanGpsScanOut.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vendorScansVendorScanGpsScanOut.d.ts","sourceRoot":"","sources":["../../../src/react-query/vendorScansVendorScanGpsScanOut.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,WAAW,EAEX,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAG/C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,MAAM,gDAAgD,GAAG;IAC7D,OAAO,EAAE,UAAU,CAAC,2BAA2B,CAAC;IAChD,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,2CAA2C,GACrD,UAAU,CAAC,0CAA0C,CAAC;AAExD,MAAM,MAAM,4CAA4C,GACpD,MAAM,CAAC,gBAAgB,GACvB,kBAAkB,GAClB,uBAAuB,GACvB,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,CAAC;AAEvB;;;;;;;GAOG;AACH,wBAAgB,0CAA0C,CACxD,OAAO,CAAC,EAAE,mBAAmB,CAC3B,2CAA2C,EAC3C,4CAA4C,EAC5C,gDAAgD,CACjD,GACA,iBAAiB,CAClB,2CAA2C,EAC3C,4CAA4C,EAC5C,gDAAgD,CACjD,CAMA;AAED,wBAAgB,0CAA0C,IAAI,WAAW,CAMxE;AAED,wBAAgB,4CAA4C,CAC1D,OAAO,EAAE,iBAAiB,EAC1B,WAAW,CAAC,EAAE,cAAc,GAC3B;IACD,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,EAAE,CACV,SAAS,EAAE,gDAAgD,KACxD,OAAO,CAAC,2CAA2C,CAAC,CAAC;CAC3D,CA0BA"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
import { useMutation, } from "@tanstack/react-query";
|
|
5
|
-
import { vendorScansVendorScanGpsScanOut } from "../funcs/vendorScansVendorScanGpsScanOut.js";
|
|
6
|
-
import { combineSignals } from "../lib/primitives.js";
|
|
7
|
-
import { unwrapAsync } from "../types/fp.js";
|
|
8
|
-
import { useGreenSecurityContext } from "./_context.js";
|
|
9
|
-
/**
|
|
10
|
-
* Automatic GPS check-out
|
|
11
|
-
*
|
|
12
|
-
* @remarks
|
|
13
|
-
* Reports the device's current position and scans the vendor out when it lies outside the geofence returned by the GPS check-out configuration endpoint. The distance is always recomputed server-side. Reporting the same exit twice is a no-op.
|
|
14
|
-
*
|
|
15
|
-
* When an accuracy radius is supplied it is discounted from the distance before the comparison. The vendor is checked out only when the entire error margin clears the geofence AND the reported accuracy is at most 328 ft (100 m). When only half the margin clears it — or the margin clears it entirely but is wider than that ceiling — the visit is left open and the vendor is sent a reminder to check out instead, once per check-in; the response then reports `success: false` with `outcome: possibly_left`.
|
|
16
|
-
*/
|
|
17
|
-
export function useVendorScansVendorScanGpsScanOutMutation(options) {
|
|
18
|
-
const client = useGreenSecurityContext();
|
|
19
|
-
return useMutation({
|
|
20
|
-
...buildVendorScansVendorScanGpsScanOutMutation(client, options),
|
|
21
|
-
...options,
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
export function mutationKeyVendorScansVendorScanGpsScanOut() {
|
|
25
|
-
return [
|
|
26
|
-
"@greensecurity/javascript-sdk",
|
|
27
|
-
"vendor_scans",
|
|
28
|
-
"vendorScanGpsScanOut",
|
|
29
|
-
];
|
|
30
|
-
}
|
|
31
|
-
export function buildVendorScansVendorScanGpsScanOutMutation(client$, hookOptions) {
|
|
32
|
-
return {
|
|
33
|
-
mutationKey: mutationKeyVendorScansVendorScanGpsScanOut(),
|
|
34
|
-
mutationFn: function vendorScansVendorScanGpsScanOutMutationFn({ request, options, }) {
|
|
35
|
-
const mergedOptions = {
|
|
36
|
-
...hookOptions,
|
|
37
|
-
...options,
|
|
38
|
-
fetchOptions: {
|
|
39
|
-
...hookOptions?.fetchOptions,
|
|
40
|
-
...options?.fetchOptions,
|
|
41
|
-
signal: combineSignals(hookOptions?.fetchOptions?.signal, options?.fetchOptions?.signal),
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
return unwrapAsync(vendorScansVendorScanGpsScanOut(client$, request, mergedOptions));
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=vendorScansVendorScanGpsScanOut.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vendorScansVendorScanGpsScanOut.js","sourceRoot":"","sources":["../../../src/react-query/vendorScansVendorScanGpsScanOut.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAEL,WAAW,GAEZ,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,+BAA+B,EAAE,MAAM,6CAA6C,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AActD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAsBxD;;;;;;;GAOG;AACH,MAAM,UAAU,0CAA0C,CACxD,OAIC;IAMD,MAAM,MAAM,GAAG,uBAAuB,EAAE,CAAC;IACzC,OAAO,WAAW,CAAC;QACjB,GAAG,4CAA4C,CAAC,MAAM,EAAE,OAAO,CAAC;QAChE,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,0CAA0C;IACxD,OAAO;QACL,+BAA+B;QAC/B,cAAc;QACd,sBAAsB;KACvB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,4CAA4C,CAC1D,OAA0B,EAC1B,WAA4B;IAO5B,OAAO;QACL,WAAW,EAAE,0CAA0C,EAAE;QACzD,UAAU,EAAE,SAAS,yCAAyC,CAAC,EAC7D,OAAO,EACP,OAAO,GACR;YACC,MAAM,aAAa,GAAG;gBACpB,GAAG,WAAW;gBACd,GAAG,OAAO;gBACV,YAAY,EAAE;oBACZ,GAAG,WAAW,EAAE,YAAY;oBAC5B,GAAG,OAAO,EAAE,YAAY;oBACxB,MAAM,EAAE,cAAc,CACpB,WAAW,EAAE,YAAY,EAAE,MAAM,EACjC,OAAO,EAAE,YAAY,EAAE,MAAM,CAC9B;iBACF;aACF,CAAC;YACF,OAAO,WAAW,CAAC,+BAA+B,CAChD,OAAO,EACP,OAAO,EACP,aAAa,CACd,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { GreenSecurityCore } from "../core.js";
|
|
6
|
-
import { encodeJSON, 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
|
|
31
|
-
*
|
|
32
|
-
* @remarks
|
|
33
|
-
* Reports the device's current position and scans the vendor out when it lies outside the geofence returned by the GPS check-out configuration endpoint. The distance is always recomputed server-side. Reporting the same exit twice is a no-op.
|
|
34
|
-
*
|
|
35
|
-
* When an accuracy radius is supplied it is discounted from the distance before the comparison. The vendor is checked out only when the entire error margin clears the geofence AND the reported accuracy is at most 328 ft (100 m). When only half the margin clears it — or the margin clears it entirely but is wider than that ceiling — the visit is left open and the vendor is sent a reminder to check out instead, once per check-in; the response then reports `success: false` with `outcome: possibly_left`.
|
|
36
|
-
*/
|
|
37
|
-
export function vendorScansVendorScanGpsScanOut(
|
|
38
|
-
client: GreenSecurityCore,
|
|
39
|
-
request: operations.VendorScanGpsScanOutRequest,
|
|
40
|
-
options?: RequestOptions,
|
|
41
|
-
): APIPromise<
|
|
42
|
-
Result<
|
|
43
|
-
operations.VendorScanGpsScanOutVendorScanGpsScanOutOk,
|
|
44
|
-
| errors.ApiErrorResponse
|
|
45
|
-
| GreenSecurityError
|
|
46
|
-
| ResponseValidationError
|
|
47
|
-
| ConnectionError
|
|
48
|
-
| RequestAbortedError
|
|
49
|
-
| RequestTimeoutError
|
|
50
|
-
| InvalidRequestError
|
|
51
|
-
| UnexpectedClientError
|
|
52
|
-
| SDKValidationError
|
|
53
|
-
>
|
|
54
|
-
> {
|
|
55
|
-
return new APIPromise($do(
|
|
56
|
-
client,
|
|
57
|
-
request,
|
|
58
|
-
options,
|
|
59
|
-
));
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
async function $do(
|
|
63
|
-
client: GreenSecurityCore,
|
|
64
|
-
request: operations.VendorScanGpsScanOutRequest,
|
|
65
|
-
options?: RequestOptions,
|
|
66
|
-
): Promise<
|
|
67
|
-
[
|
|
68
|
-
Result<
|
|
69
|
-
operations.VendorScanGpsScanOutVendorScanGpsScanOutOk,
|
|
70
|
-
| errors.ApiErrorResponse
|
|
71
|
-
| GreenSecurityError
|
|
72
|
-
| ResponseValidationError
|
|
73
|
-
| ConnectionError
|
|
74
|
-
| RequestAbortedError
|
|
75
|
-
| RequestTimeoutError
|
|
76
|
-
| InvalidRequestError
|
|
77
|
-
| UnexpectedClientError
|
|
78
|
-
| SDKValidationError
|
|
79
|
-
>,
|
|
80
|
-
APICall,
|
|
81
|
-
]
|
|
82
|
-
> {
|
|
83
|
-
const parsed = safeParse(
|
|
84
|
-
request,
|
|
85
|
-
(value) =>
|
|
86
|
-
operations.VendorScanGpsScanOutRequest$outboundSchema.parse(value),
|
|
87
|
-
"Input validation failed",
|
|
88
|
-
);
|
|
89
|
-
if (!parsed.ok) {
|
|
90
|
-
return [parsed, { status: "invalid" }];
|
|
91
|
-
}
|
|
92
|
-
const payload = parsed.value;
|
|
93
|
-
const body = encodeJSON("body", payload.RequestBody, { explode: true });
|
|
94
|
-
|
|
95
|
-
const pathParams = {
|
|
96
|
-
id: encodeSimple("id", payload.id, {
|
|
97
|
-
explode: false,
|
|
98
|
-
charEncoding: "percent",
|
|
99
|
-
}),
|
|
100
|
-
};
|
|
101
|
-
const path = pathToFunc("/vendor-scans/{id}/gps-scan-out")(pathParams);
|
|
102
|
-
|
|
103
|
-
const headers = new Headers(compactMap({
|
|
104
|
-
"Content-Type": "application/json",
|
|
105
|
-
Accept: "application/json",
|
|
106
|
-
}));
|
|
107
|
-
|
|
108
|
-
const securityInput = await extractSecurity(client._options.security);
|
|
109
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
110
|
-
|
|
111
|
-
const context = {
|
|
112
|
-
options: client._options,
|
|
113
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
114
|
-
operationID: "vendorScanGpsScanOut",
|
|
115
|
-
oAuth2Scopes: null,
|
|
116
|
-
|
|
117
|
-
resolvedSecurity: requestSecurity,
|
|
118
|
-
|
|
119
|
-
securitySource: client._options.security,
|
|
120
|
-
retryConfig: options?.retries
|
|
121
|
-
|| client._options.retryConfig
|
|
122
|
-
|| { strategy: "none" },
|
|
123
|
-
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
const requestRes = client._createRequest(context, {
|
|
127
|
-
security: requestSecurity,
|
|
128
|
-
method: "POST",
|
|
129
|
-
baseURL: options?.serverURL,
|
|
130
|
-
path: path,
|
|
131
|
-
headers: headers,
|
|
132
|
-
body: body,
|
|
133
|
-
userAgent: client._options.userAgent,
|
|
134
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
135
|
-
}, options);
|
|
136
|
-
if (!requestRes.ok) {
|
|
137
|
-
return [requestRes, { status: "invalid" }];
|
|
138
|
-
}
|
|
139
|
-
const req = requestRes.value;
|
|
140
|
-
|
|
141
|
-
const doResult = await client._do(req, {
|
|
142
|
-
context,
|
|
143
|
-
isErrorStatusCode: (statusCode: number) =>
|
|
144
|
-
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
145
|
-
retryConfig: context.retryConfig,
|
|
146
|
-
retryCodes: context.retryCodes,
|
|
147
|
-
});
|
|
148
|
-
if (!doResult.ok) {
|
|
149
|
-
return [doResult, { status: "request-error", request: req }];
|
|
150
|
-
}
|
|
151
|
-
const response = doResult.value;
|
|
152
|
-
|
|
153
|
-
const responseFields = {
|
|
154
|
-
HttpMeta: { Response: response, Request: req },
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
const [result] = await M.match<
|
|
158
|
-
operations.VendorScanGpsScanOutVendorScanGpsScanOutOk,
|
|
159
|
-
| errors.ApiErrorResponse
|
|
160
|
-
| GreenSecurityError
|
|
161
|
-
| ResponseValidationError
|
|
162
|
-
| ConnectionError
|
|
163
|
-
| RequestAbortedError
|
|
164
|
-
| RequestTimeoutError
|
|
165
|
-
| InvalidRequestError
|
|
166
|
-
| UnexpectedClientError
|
|
167
|
-
| SDKValidationError
|
|
168
|
-
>(
|
|
169
|
-
M.json(
|
|
170
|
-
200,
|
|
171
|
-
operations.VendorScanGpsScanOutVendorScanGpsScanOutOk$inboundSchema,
|
|
172
|
-
),
|
|
173
|
-
M.jsonErr([400, 401, 403, 404, 422], errors.ApiErrorResponse$inboundSchema),
|
|
174
|
-
M.fail("4XX"),
|
|
175
|
-
M.fail([500, "5XX"]),
|
|
176
|
-
)(response, req, { extraFields: responseFields });
|
|
177
|
-
if (!result.ok) {
|
|
178
|
-
return [result, { status: "complete", request: req, response }];
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
return [result, { status: "complete", request: req, response }];
|
|
182
|
-
}
|