Description
Reference: https://fusionauth.io/docs/v1/tech/apis/actioning-users/#take-an-action-on-a-user
To cause the action to be applied indefinitely, or until the action is canceled or modified, set this value to 9223372036854775807.
Since Java API uses Long
and the expiry
field TypeScript definition uses number
, trying to use that number literal will give TypeScript warning "Numeric literals with absolute values equal to 2^53 or greater are too large to be represented accurately as integers.ts(80008)"
And also when executing the result is:
Invalid JSON in the request body. The property was [action.expiry]. The error was [Possible conversion error]. The detailed exception was [Numeric value (9223372036854776000) out of range of long (-9223372036854775808 - 9223372036854775807)
at [Source: (org.apache.catalina.connector.CoyoteInputStream); line: 1, column: 181] (through reference chain: io.fusionauth.domain.api.user.ActionRequest["action"]->io.fusionauth.domain.api.user.ActionRequest$ActionData["expiry"])].
Workaround
Use: '9223372036854775807' as any
Proposed Solution
If possible, change the type to number | string | undefined
which is probably a good-enough compromise retaining backwards compatibility.
If not possible, then string | undefined
is more flexible.