-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add libs/custom-paper-handler (#3472)
* add custom-paper-handler and update flow.test.ts * remove unused files from libs/custom-paper-handler * ignore custom-paper-handler from coverage * set coverage threshold to 0 and remove ignore pattern from root cfg * remove outdated comment * Apply suggestions from code review Clean up package.json Co-authored-by: Brian Donovan <[email protected]> * Apply suggestions from code review Clean up logging Co-authored-by: Brian Donovan <[email protected]> * move ballot fixture to test/fixtures * ignore flow.test.ts and reduce timeout anyway * update pnpm-lock.yaml --------- Co-authored-by: Brian Donovan <[email protected]>
- Loading branch information
1 parent
f094e51
commit 0bb50ec
Showing
28 changed files
with
3,211 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,4 +25,4 @@ module.exports = { | |
'jest-watch-typeahead/testname', | ||
], | ||
cacheDirectory: '.jestcache' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from './base'; | ||
export * as Scan from './services/scan'; | ||
export * as PrintScan from './services/print-scan'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { z } from 'zod'; | ||
|
||
export type SimpleStatus = | ||
| 'no_paper' | ||
| 'paper_ready_to_load' // Paper is detected in the input area | ||
| 'parking_paper' | ||
| 'paper_parked' | ||
| 'printing_ballot' | ||
| 'ballot_printed' | ||
| 'ejecting'; | ||
|
||
export const SimpleStatusSchema: z.ZodSchema<SimpleStatus> = z.union([ | ||
z.literal('no_paper'), | ||
z.literal('paper_ready_to_load'), | ||
z.literal('parking_paper'), | ||
z.literal('paper_parked'), | ||
z.literal('printing_ballot'), | ||
z.literal('ballot_printed'), | ||
z.literal('ejecting'), | ||
]); | ||
|
||
export type SimpleServerStatus = SimpleStatus | 'no_hardware'; | ||
|
||
export const SimpleServerStatusSchema: z.ZodSchema<SimpleServerStatus> = | ||
z.union([SimpleStatusSchema, z.literal('no_hardware')]); | ||
|
||
/** | ||
* @url /print-scan/status | ||
* @method GET | ||
*/ | ||
export interface StatusResponse { | ||
status: SimpleServerStatus; | ||
} | ||
|
||
/** | ||
* @url /print-scan/status | ||
* @method GET | ||
*/ | ||
export const StatusResponseSchema: z.ZodSchema<StatusResponse> = z.object({ | ||
status: SimpleServerStatusSchema, | ||
}); | ||
|
||
/** | ||
* @url /print-scan/print | ||
* @method POST | ||
*/ | ||
export type PrintRequest = Uint8Array; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
build | ||
coverage | ||
jest.config.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"extends": ["plugin:vx/recommended"], | ||
"rules": { | ||
// Allow for bitwise operations which are necessary for usb protocol communication. | ||
"no-bitwise": "off", | ||
// Disable JSDOC rule: legacy code is not commented with JSDoc comments. Rule status will be reevaluated before production use | ||
"vx/gts-jsdoc": "off" | ||
} | ||
} |
Empty file.
Oops, something went wrong.