@greensecurity/javascript-sdk 0.44.0-beta.71 → 0.44.0-beta.73

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.
Files changed (180) hide show
  1. package/README.md +1 -4
  2. package/dist/commonjs/__tests__/vendors.test.js +1 -1
  3. package/dist/commonjs/__tests__/vendorscans.test.js +2 -21
  4. package/dist/commonjs/__tests__/vendorscans.test.js.map +1 -1
  5. package/dist/commonjs/__tests__/zones.test.js +34 -6
  6. package/dist/commonjs/__tests__/zones.test.js.map +1 -1
  7. package/dist/commonjs/funcs/invoicesInvoicesExport.js +2 -0
  8. package/dist/commonjs/funcs/invoicesInvoicesExport.js.map +1 -1
  9. package/dist/commonjs/funcs/invoicesListInvoices.js +2 -0
  10. package/dist/commonjs/funcs/invoicesListInvoices.js.map +1 -1
  11. package/dist/commonjs/funcs/vendorScansExportVendorScans.d.ts +3 -3
  12. package/dist/commonjs/funcs/vendorScansExportVendorScans.js +3 -3
  13. package/dist/commonjs/funcs/vendorScansVendorScanOut.d.ts +1 -1
  14. package/dist/commonjs/funcs/vendorScansVendorScanOut.js +3 -2
  15. package/dist/commonjs/funcs/vendorScansVendorScanOut.js.map +1 -1
  16. package/dist/commonjs/funcs/vendorsAddVendorCredentialFileForAutoClassification.js +1 -1
  17. package/dist/commonjs/funcs/vendorsAddVendorCredentialFileForAutoClassification.js.map +1 -1
  18. package/dist/commonjs/lib/config.d.ts +3 -3
  19. package/dist/commonjs/lib/config.js +3 -3
  20. package/dist/commonjs/models/components/vendorcredentialfileforautoclassificationrequest.d.ts +5 -0
  21. package/dist/commonjs/models/components/vendorcredentialfileforautoclassificationrequest.d.ts.map +1 -1
  22. package/dist/commonjs/models/components/vendorcredentialfileforautoclassificationrequest.js +2 -0
  23. package/dist/commonjs/models/components/vendorcredentialfileforautoclassificationrequest.js.map +1 -1
  24. package/dist/commonjs/models/operations/index.d.ts +0 -1
  25. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  26. package/dist/commonjs/models/operations/index.js +0 -1
  27. package/dist/commonjs/models/operations/index.js.map +1 -1
  28. package/dist/commonjs/models/operations/invoicesexport.d.ts +10 -0
  29. package/dist/commonjs/models/operations/invoicesexport.d.ts.map +1 -1
  30. package/dist/commonjs/models/operations/invoicesexport.js +4 -0
  31. package/dist/commonjs/models/operations/invoicesexport.js.map +1 -1
  32. package/dist/commonjs/models/operations/listinvoices.d.ts +10 -0
  33. package/dist/commonjs/models/operations/listinvoices.d.ts.map +1 -1
  34. package/dist/commonjs/models/operations/listinvoices.js +4 -0
  35. package/dist/commonjs/models/operations/listinvoices.js.map +1 -1
  36. package/dist/commonjs/models/operations/vendorscanout.d.ts +15 -0
  37. package/dist/commonjs/models/operations/vendorscanout.d.ts.map +1 -1
  38. package/dist/commonjs/models/operations/vendorscanout.js +19 -1
  39. package/dist/commonjs/models/operations/vendorscanout.js.map +1 -1
  40. package/dist/commonjs/react-query/index.d.ts +0 -1
  41. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  42. package/dist/commonjs/react-query/index.js +0 -1
  43. package/dist/commonjs/react-query/index.js.map +1 -1
  44. package/dist/commonjs/react-query/invoicesInvoicesExport.core.d.ts +2 -0
  45. package/dist/commonjs/react-query/invoicesInvoicesExport.core.d.ts.map +1 -1
  46. package/dist/commonjs/react-query/invoicesInvoicesExport.core.js +2 -0
  47. package/dist/commonjs/react-query/invoicesInvoicesExport.core.js.map +1 -1
  48. package/dist/commonjs/react-query/invoicesInvoicesExport.d.ts +4 -0
  49. package/dist/commonjs/react-query/invoicesInvoicesExport.d.ts.map +1 -1
  50. package/dist/commonjs/react-query/invoicesInvoicesExport.js.map +1 -1
  51. package/dist/commonjs/react-query/invoicesListInvoices.core.d.ts +4 -0
  52. package/dist/commonjs/react-query/invoicesListInvoices.core.d.ts.map +1 -1
  53. package/dist/commonjs/react-query/invoicesListInvoices.core.js +4 -0
  54. package/dist/commonjs/react-query/invoicesListInvoices.core.js.map +1 -1
  55. package/dist/commonjs/react-query/invoicesListInvoices.d.ts +4 -0
  56. package/dist/commonjs/react-query/invoicesListInvoices.d.ts.map +1 -1
  57. package/dist/commonjs/react-query/invoicesListInvoices.js.map +1 -1
  58. package/dist/commonjs/react-query/vendorScansExportVendorScans.d.ts +6 -6
  59. package/dist/commonjs/react-query/vendorScansExportVendorScans.js +6 -6
  60. package/dist/commonjs/react-query/vendorScansVendorScanOut.d.ts +1 -1
  61. package/dist/commonjs/react-query/vendorScansVendorScanOut.js +1 -1
  62. package/dist/commonjs/sdk/vendorscans.d.ts +4 -13
  63. package/dist/commonjs/sdk/vendorscans.d.ts.map +1 -1
  64. package/dist/commonjs/sdk/vendorscans.js +4 -16
  65. package/dist/commonjs/sdk/vendorscans.js.map +1 -1
  66. package/dist/esm/__tests__/vendors.test.js +1 -1
  67. package/dist/esm/__tests__/vendorscans.test.js +3 -22
  68. package/dist/esm/__tests__/vendorscans.test.js.map +1 -1
  69. package/dist/esm/__tests__/zones.test.js +34 -6
  70. package/dist/esm/__tests__/zones.test.js.map +1 -1
  71. package/dist/esm/funcs/invoicesInvoicesExport.js +2 -0
  72. package/dist/esm/funcs/invoicesInvoicesExport.js.map +1 -1
  73. package/dist/esm/funcs/invoicesListInvoices.js +2 -0
  74. package/dist/esm/funcs/invoicesListInvoices.js.map +1 -1
  75. package/dist/esm/funcs/vendorScansExportVendorScans.d.ts +3 -3
  76. package/dist/esm/funcs/vendorScansExportVendorScans.js +3 -3
  77. package/dist/esm/funcs/vendorScansVendorScanOut.d.ts +1 -1
  78. package/dist/esm/funcs/vendorScansVendorScanOut.js +4 -3
  79. package/dist/esm/funcs/vendorScansVendorScanOut.js.map +1 -1
  80. package/dist/esm/funcs/vendorsAddVendorCredentialFileForAutoClassification.js +1 -1
  81. package/dist/esm/funcs/vendorsAddVendorCredentialFileForAutoClassification.js.map +1 -1
  82. package/dist/esm/lib/config.d.ts +3 -3
  83. package/dist/esm/lib/config.js +3 -3
  84. package/dist/esm/models/components/vendorcredentialfileforautoclassificationrequest.d.ts +5 -0
  85. package/dist/esm/models/components/vendorcredentialfileforautoclassificationrequest.d.ts.map +1 -1
  86. package/dist/esm/models/components/vendorcredentialfileforautoclassificationrequest.js +2 -0
  87. package/dist/esm/models/components/vendorcredentialfileforautoclassificationrequest.js.map +1 -1
  88. package/dist/esm/models/operations/index.d.ts +0 -1
  89. package/dist/esm/models/operations/index.d.ts.map +1 -1
  90. package/dist/esm/models/operations/index.js +0 -1
  91. package/dist/esm/models/operations/index.js.map +1 -1
  92. package/dist/esm/models/operations/invoicesexport.d.ts +10 -0
  93. package/dist/esm/models/operations/invoicesexport.d.ts.map +1 -1
  94. package/dist/esm/models/operations/invoicesexport.js +4 -0
  95. package/dist/esm/models/operations/invoicesexport.js.map +1 -1
  96. package/dist/esm/models/operations/listinvoices.d.ts +10 -0
  97. package/dist/esm/models/operations/listinvoices.d.ts.map +1 -1
  98. package/dist/esm/models/operations/listinvoices.js +4 -0
  99. package/dist/esm/models/operations/listinvoices.js.map +1 -1
  100. package/dist/esm/models/operations/vendorscanout.d.ts +15 -0
  101. package/dist/esm/models/operations/vendorscanout.d.ts.map +1 -1
  102. package/dist/esm/models/operations/vendorscanout.js +17 -0
  103. package/dist/esm/models/operations/vendorscanout.js.map +1 -1
  104. package/dist/esm/react-query/index.d.ts +0 -1
  105. package/dist/esm/react-query/index.d.ts.map +1 -1
  106. package/dist/esm/react-query/index.js +0 -1
  107. package/dist/esm/react-query/index.js.map +1 -1
  108. package/dist/esm/react-query/invoicesInvoicesExport.core.d.ts +2 -0
  109. package/dist/esm/react-query/invoicesInvoicesExport.core.d.ts.map +1 -1
  110. package/dist/esm/react-query/invoicesInvoicesExport.core.js +2 -0
  111. package/dist/esm/react-query/invoicesInvoicesExport.core.js.map +1 -1
  112. package/dist/esm/react-query/invoicesInvoicesExport.d.ts +4 -0
  113. package/dist/esm/react-query/invoicesInvoicesExport.d.ts.map +1 -1
  114. package/dist/esm/react-query/invoicesInvoicesExport.js.map +1 -1
  115. package/dist/esm/react-query/invoicesListInvoices.core.d.ts +4 -0
  116. package/dist/esm/react-query/invoicesListInvoices.core.d.ts.map +1 -1
  117. package/dist/esm/react-query/invoicesListInvoices.core.js +4 -0
  118. package/dist/esm/react-query/invoicesListInvoices.core.js.map +1 -1
  119. package/dist/esm/react-query/invoicesListInvoices.d.ts +4 -0
  120. package/dist/esm/react-query/invoicesListInvoices.d.ts.map +1 -1
  121. package/dist/esm/react-query/invoicesListInvoices.js.map +1 -1
  122. package/dist/esm/react-query/vendorScansExportVendorScans.d.ts +6 -6
  123. package/dist/esm/react-query/vendorScansExportVendorScans.js +6 -6
  124. package/dist/esm/react-query/vendorScansVendorScanOut.d.ts +1 -1
  125. package/dist/esm/react-query/vendorScansVendorScanOut.js +1 -1
  126. package/dist/esm/sdk/vendorscans.d.ts +4 -13
  127. package/dist/esm/sdk/vendorscans.d.ts.map +1 -1
  128. package/dist/esm/sdk/vendorscans.js +4 -16
  129. package/dist/esm/sdk/vendorscans.js.map +1 -1
  130. package/jsr.json +1 -1
  131. package/package.json +1 -1
  132. package/src/__tests__/vendors.test.ts +1 -1
  133. package/src/__tests__/vendorscans.test.ts +5 -24
  134. package/src/__tests__/zones.test.ts +34 -6
  135. package/src/funcs/invoicesInvoicesExport.ts +2 -0
  136. package/src/funcs/invoicesListInvoices.ts +2 -0
  137. package/src/funcs/vendorScansExportVendorScans.ts +3 -3
  138. package/src/funcs/vendorScansVendorScanOut.ts +4 -3
  139. package/src/funcs/vendorsAddVendorCredentialFileForAutoClassification.ts +4 -1
  140. package/src/lib/config.ts +3 -3
  141. package/src/models/components/vendorcredentialfileforautoclassificationrequest.ts +7 -0
  142. package/src/models/operations/index.ts +0 -1
  143. package/src/models/operations/invoicesexport.ts +14 -0
  144. package/src/models/operations/listinvoices.ts +14 -0
  145. package/src/models/operations/vendorscanout.ts +43 -0
  146. package/src/react-query/index.ts +0 -1
  147. package/src/react-query/invoicesInvoicesExport.core.ts +4 -0
  148. package/src/react-query/invoicesInvoicesExport.ts +4 -0
  149. package/src/react-query/invoicesListInvoices.core.ts +8 -0
  150. package/src/react-query/invoicesListInvoices.ts +4 -0
  151. package/src/react-query/vendorScansExportVendorScans.ts +6 -6
  152. package/src/react-query/vendorScansVendorScanOut.ts +1 -1
  153. package/src/sdk/vendorscans.ts +4 -24
  154. package/dist/commonjs/funcs/vendorScansVendorScanGpsScanOut.d.ts +0 -20
  155. package/dist/commonjs/funcs/vendorScansVendorScanGpsScanOut.d.ts.map +0 -1
  156. package/dist/commonjs/funcs/vendorScansVendorScanGpsScanOut.js +0 -126
  157. package/dist/commonjs/funcs/vendorScansVendorScanGpsScanOut.js.map +0 -1
  158. package/dist/commonjs/models/operations/vendorscangpsscanout.d.ts +0 -81
  159. package/dist/commonjs/models/operations/vendorscangpsscanout.d.ts.map +0 -1
  160. package/dist/commonjs/models/operations/vendorscangpsscanout.js +0 -96
  161. package/dist/commonjs/models/operations/vendorscangpsscanout.js.map +0 -1
  162. package/dist/commonjs/react-query/vendorScansVendorScanGpsScanOut.d.ts +0 -31
  163. package/dist/commonjs/react-query/vendorScansVendorScanGpsScanOut.d.ts.map +0 -1
  164. package/dist/commonjs/react-query/vendorScansVendorScanGpsScanOut.js +0 -53
  165. package/dist/commonjs/react-query/vendorScansVendorScanGpsScanOut.js.map +0 -1
  166. package/dist/esm/funcs/vendorScansVendorScanGpsScanOut.d.ts +0 -20
  167. package/dist/esm/funcs/vendorScansVendorScanGpsScanOut.d.ts.map +0 -1
  168. package/dist/esm/funcs/vendorScansVendorScanGpsScanOut.js +0 -90
  169. package/dist/esm/funcs/vendorScansVendorScanGpsScanOut.js.map +0 -1
  170. package/dist/esm/models/operations/vendorscangpsscanout.d.ts +0 -81
  171. package/dist/esm/models/operations/vendorscangpsscanout.d.ts.map +0 -1
  172. package/dist/esm/models/operations/vendorscangpsscanout.js +0 -57
  173. package/dist/esm/models/operations/vendorscangpsscanout.js.map +0 -1
  174. package/dist/esm/react-query/vendorScansVendorScanGpsScanOut.d.ts +0 -31
  175. package/dist/esm/react-query/vendorScansVendorScanGpsScanOut.d.ts.map +0 -1
  176. package/dist/esm/react-query/vendorScansVendorScanGpsScanOut.js +0 -48
  177. package/dist/esm/react-query/vendorScansVendorScanGpsScanOut.js.map +0 -1
  178. package/src/funcs/vendorScansVendorScanGpsScanOut.ts +0 -182
  179. package/src/models/operations/vendorscangpsscanout.ts +0 -167
  180. package/src/react-query/vendorScansVendorScanGpsScanOut.ts +0 -117
@@ -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
@@ -1 +0,0 @@
1
- {"version":3,"file":"vendorscangpsscanout.js","sourceRoot":"","sources":["../../../../src/models/operations/vendorscangpsscanout.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAGlD,OAAO,KAAK,KAAK,MAAM,2BAA2B,CAAC;AA0BnD;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,UAAU,EAAE,aAAa;IACzB,YAAY,EAAE,eAAe;IAC7B,YAAY,EAAE,eAAe;IAC7B,iBAAiB,EAAE,qBAAqB;IACxC,cAAc,EAAE,iBAAiB;CACzB,CAAC;AAiCX,gBAAgB;AAChB,MAAM,CAAC,MAAM,8DAA8D,GAKrE,CAAC,CAAC,MAAM,CAAC;IACX,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC5C,CAAC,CAAC;AAEL,MAAM,UAAU,qDAAqD,CACnE,+CACiD;IAEjD,OAAO,IAAI,CAAC,SAAS,CACnB,8DAA8D,CAAC,KAAK,CAClE,+CAA+C,CAChD,CACF,CAAC;AACJ,CAAC;AAQD,gBAAgB;AAChB,MAAM,CAAC,MAAM,0CAA0C,GAInD,CAAC,CAAC,MAAM,CAAC;IACX,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IACpB,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CACvB,8DAA8D,CAC/D;CACF,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,MAAM,CAAC,CAAC,EAAE;QACf,WAAW,EAAE,aAAa;KAC3B,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,MAAM,UAAU,iCAAiC,CAC/C,2BAAwD;IAExD,OAAO,IAAI,CAAC,SAAS,CACnB,0CAA0C,CAAC,KAAK,CAC9C,2BAA2B,CAC5B,CACF,CAAC;AACJ,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,qBAAqB,GAChC,SAAS,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;AAEnC,gBAAgB;AAChB,MAAM,CAAC,MAAM,wDAAwD,GAEjE,CAAC,CAAC,MAAM,CAAC;IACP,KAAK,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC5C,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC7C,UAAU,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACjD,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE;IACxB,OAAO,EAAE,qBAAqB;CAC/B,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,MAAM,CAAC,CAAC,EAAE;QACf,YAAY,EAAE,WAAW;KAC1B,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEP,MAAM,UAAU,kDAAkD,CAChE,UAAkB;IAKlB,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CACJ,wDAAwD,CAAC,KAAK,CAC5D,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CACd,EACH,wEAAwE,CACzE,CAAC;AACJ,CAAC"}
@@ -1,31 +0,0 @@
1
- import { MutationKey, UseMutationResult } from "@tanstack/react-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
- }
@@ -1,167 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod/v3";
6
- import { remap as remap$ } from "../../lib/primitives.js";
7
- import { safeParse } from "../../lib/schemas.js";
8
- import * as openEnums from "../../types/enums.js";
9
- import { OpenEnum } from "../../types/enums.js";
10
- import { Result as SafeParseResult } from "../../types/fp.js";
11
- import * as types from "../../types/primitives.js";
12
- import { SDKValidationError } from "../errors/sdkvalidationerror.js";
13
-
14
- export type VendorScanGpsScanOutVendorScanGpsScanOutRequest = {
15
- /**
16
- * Reported latitude, between -90 and 90.
17
- */
18
- latitude: number;
19
- /**
20
- * Reported longitude, between -180 and 180.
21
- */
22
- longitude: number;
23
- /**
24
- * 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.
25
- */
26
- accuracy?: number | null | undefined;
27
- };
28
-
29
- export type VendorScanGpsScanOutRequest = {
30
- /**
31
- * The identifier of the object
32
- */
33
- id: number;
34
- requestBody: VendorScanGpsScanOutVendorScanGpsScanOutRequest;
35
- };
36
-
37
- /**
38
- * 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`.
39
- */
40
- export const Outcome = {
41
- CheckedOut: "checked_out",
42
- PossiblyLeft: "possibly_left",
43
- InsideRadius: "inside_radius",
44
- AlreadyCheckedOut: "already_checked_out",
45
- CheckoutFailed: "checkout_failed",
46
- } as const;
47
- /**
48
- * 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`.
49
- */
50
- export type Outcome = OpenEnum<typeof Outcome>;
51
-
52
- /**
53
- * The request was successful, and the server has returned the requested resource in the response body.
54
- */
55
- export type VendorScanGpsScanOutVendorScanGpsScanOutOk = {
56
- error?: string | null | undefined;
57
- reason?: string | null | undefined;
58
- /**
59
- * Smart badge LED payload data. Only present when the scan-out response can update a smart badge locally.
60
- */
61
- badgeData?: string | null | undefined;
62
- /**
63
- * 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.
64
- */
65
- success: boolean;
66
- /**
67
- * 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`.
68
- */
69
- outcome: Outcome;
70
- };
71
-
72
- /** @internal */
73
- export type VendorScanGpsScanOutVendorScanGpsScanOutRequest$Outbound = {
74
- latitude: number;
75
- longitude: number;
76
- accuracy?: number | null | undefined;
77
- };
78
-
79
- /** @internal */
80
- export const VendorScanGpsScanOutVendorScanGpsScanOutRequest$outboundSchema:
81
- z.ZodType<
82
- VendorScanGpsScanOutVendorScanGpsScanOutRequest$Outbound,
83
- z.ZodTypeDef,
84
- VendorScanGpsScanOutVendorScanGpsScanOutRequest
85
- > = z.object({
86
- latitude: z.number(),
87
- longitude: z.number(),
88
- accuracy: z.nullable(z.number()).optional(),
89
- });
90
-
91
- export function vendorScanGpsScanOutVendorScanGpsScanOutRequestToJSON(
92
- vendorScanGpsScanOutVendorScanGpsScanOutRequest:
93
- VendorScanGpsScanOutVendorScanGpsScanOutRequest,
94
- ): string {
95
- return JSON.stringify(
96
- VendorScanGpsScanOutVendorScanGpsScanOutRequest$outboundSchema.parse(
97
- vendorScanGpsScanOutVendorScanGpsScanOutRequest,
98
- ),
99
- );
100
- }
101
-
102
- /** @internal */
103
- export type VendorScanGpsScanOutRequest$Outbound = {
104
- id: number;
105
- RequestBody: VendorScanGpsScanOutVendorScanGpsScanOutRequest$Outbound;
106
- };
107
-
108
- /** @internal */
109
- export const VendorScanGpsScanOutRequest$outboundSchema: z.ZodType<
110
- VendorScanGpsScanOutRequest$Outbound,
111
- z.ZodTypeDef,
112
- VendorScanGpsScanOutRequest
113
- > = z.object({
114
- id: z.number().int(),
115
- requestBody: z.lazy(() =>
116
- VendorScanGpsScanOutVendorScanGpsScanOutRequest$outboundSchema
117
- ),
118
- }).transform((v) => {
119
- return remap$(v, {
120
- requestBody: "RequestBody",
121
- });
122
- });
123
-
124
- export function vendorScanGpsScanOutRequestToJSON(
125
- vendorScanGpsScanOutRequest: VendorScanGpsScanOutRequest,
126
- ): string {
127
- return JSON.stringify(
128
- VendorScanGpsScanOutRequest$outboundSchema.parse(
129
- vendorScanGpsScanOutRequest,
130
- ),
131
- );
132
- }
133
-
134
- /** @internal */
135
- export const Outcome$inboundSchema: z.ZodType<Outcome, z.ZodTypeDef, unknown> =
136
- openEnums.inboundSchema(Outcome);
137
-
138
- /** @internal */
139
- export const VendorScanGpsScanOutVendorScanGpsScanOutOk$inboundSchema:
140
- z.ZodType<VendorScanGpsScanOutVendorScanGpsScanOutOk, z.ZodTypeDef, unknown> =
141
- z.object({
142
- error: z.nullable(types.string()).optional(),
143
- reason: z.nullable(types.string()).optional(),
144
- badge_data: z.nullable(types.string()).optional(),
145
- success: types.boolean(),
146
- outcome: Outcome$inboundSchema,
147
- }).transform((v) => {
148
- return remap$(v, {
149
- "badge_data": "badgeData",
150
- });
151
- });
152
-
153
- export function vendorScanGpsScanOutVendorScanGpsScanOutOkFromJSON(
154
- jsonString: string,
155
- ): SafeParseResult<
156
- VendorScanGpsScanOutVendorScanGpsScanOutOk,
157
- SDKValidationError
158
- > {
159
- return safeParse(
160
- jsonString,
161
- (x) =>
162
- VendorScanGpsScanOutVendorScanGpsScanOutOk$inboundSchema.parse(
163
- JSON.parse(x),
164
- ),
165
- `Failed to parse 'VendorScanGpsScanOutVendorScanGpsScanOutOk' from JSON`,
166
- );
167
- }
@@ -1,117 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import {
6
- MutationKey,
7
- useMutation,
8
- UseMutationResult,
9
- } from "@tanstack/react-query";
10
- import { GreenSecurityCore } from "../core.js";
11
- import { vendorScansVendorScanGpsScanOut } from "../funcs/vendorScansVendorScanGpsScanOut.js";
12
- import { combineSignals } from "../lib/primitives.js";
13
- import { RequestOptions } from "../lib/sdks.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 { unwrapAsync } from "../types/fp.js";
27
- import { useGreenSecurityContext } from "./_context.js";
28
- import { MutationHookOptions } from "./_types.js";
29
-
30
- export type VendorScansVendorScanGpsScanOutMutationVariables = {
31
- request: operations.VendorScanGpsScanOutRequest;
32
- options?: RequestOptions;
33
- };
34
-
35
- export type VendorScansVendorScanGpsScanOutMutationData =
36
- operations.VendorScanGpsScanOutVendorScanGpsScanOutOk;
37
-
38
- export type VendorScansVendorScanGpsScanOutMutationError =
39
- | errors.ApiErrorResponse
40
- | GreenSecurityError
41
- | ResponseValidationError
42
- | ConnectionError
43
- | RequestAbortedError
44
- | RequestTimeoutError
45
- | InvalidRequestError
46
- | UnexpectedClientError
47
- | SDKValidationError;
48
-
49
- /**
50
- * Automatic GPS check-out
51
- *
52
- * @remarks
53
- * 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.
54
- *
55
- * 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`.
56
- */
57
- export function useVendorScansVendorScanGpsScanOutMutation(
58
- options?: MutationHookOptions<
59
- VendorScansVendorScanGpsScanOutMutationData,
60
- VendorScansVendorScanGpsScanOutMutationError,
61
- VendorScansVendorScanGpsScanOutMutationVariables
62
- >,
63
- ): UseMutationResult<
64
- VendorScansVendorScanGpsScanOutMutationData,
65
- VendorScansVendorScanGpsScanOutMutationError,
66
- VendorScansVendorScanGpsScanOutMutationVariables
67
- > {
68
- const client = useGreenSecurityContext();
69
- return useMutation({
70
- ...buildVendorScansVendorScanGpsScanOutMutation(client, options),
71
- ...options,
72
- });
73
- }
74
-
75
- export function mutationKeyVendorScansVendorScanGpsScanOut(): MutationKey {
76
- return [
77
- "@greensecurity/javascript-sdk",
78
- "vendor_scans",
79
- "vendorScanGpsScanOut",
80
- ];
81
- }
82
-
83
- export function buildVendorScansVendorScanGpsScanOutMutation(
84
- client$: GreenSecurityCore,
85
- hookOptions?: RequestOptions,
86
- ): {
87
- mutationKey: MutationKey;
88
- mutationFn: (
89
- variables: VendorScansVendorScanGpsScanOutMutationVariables,
90
- ) => Promise<VendorScansVendorScanGpsScanOutMutationData>;
91
- } {
92
- return {
93
- mutationKey: mutationKeyVendorScansVendorScanGpsScanOut(),
94
- mutationFn: function vendorScansVendorScanGpsScanOutMutationFn({
95
- request,
96
- options,
97
- }): Promise<VendorScansVendorScanGpsScanOutMutationData> {
98
- const mergedOptions = {
99
- ...hookOptions,
100
- ...options,
101
- fetchOptions: {
102
- ...hookOptions?.fetchOptions,
103
- ...options?.fetchOptions,
104
- signal: combineSignals(
105
- hookOptions?.fetchOptions?.signal,
106
- options?.fetchOptions?.signal,
107
- ),
108
- },
109
- };
110
- return unwrapAsync(vendorScansVendorScanGpsScanOut(
111
- client$,
112
- request,
113
- mergedOptions,
114
- ));
115
- },
116
- };
117
- }