From 670491b4f8f5391055b27019929fa23c12d0dafe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aran=C4=91el=20=C5=A0arenac?= <11753867+big-kahuna-burger@users.noreply.github.com> Date: Sun, 24 Dec 2023 14:45:00 +0100 Subject: [PATCH] docs: adds jsdocs to timestamp helpers (#619) Co-authored-by: Filip Skokan Resolves #618 --- docs/classes/jwt_encrypt.EncryptJWT.md | 61 +++++++++++++++++++- docs/classes/jwt_produce.ProduceJWT.md | 61 +++++++++++++++++++- docs/classes/jwt_sign.SignJWT.md | 61 +++++++++++++++++++- docs/classes/jwt_unsecured.UnsecuredJWT.md | 61 +++++++++++++++++++- src/jwt/produce.ts | 66 +++++++++++++++++++--- 5 files changed, 290 insertions(+), 20 deletions(-) diff --git a/docs/classes/jwt_encrypt.EncryptJWT.md b/docs/classes/jwt_encrypt.EncryptJWT.md index fd3ee09652..2b77f63dd6 100644 --- a/docs/classes/jwt_encrypt.EncryptJWT.md +++ b/docs/classes/jwt_encrypt.EncryptJWT.md @@ -176,11 +176,29 @@ ___ Set the "exp" (Expiration Time) Claim. +- If a `number` is passed as an argument it is used as the claim directly. +- If a `Date` instance is passed as an argument it is converted to unix timestamp and used as the + claim. +- If a `string` is passed as an argument it is resolved to a time span, and then added to the + current unix timestamp and used as the claim. + +Format used for time span should be a number followed by a unit, such as "5 minutes" or "1 +day". + +Valid units are: "sec", "secs", "second", "seconds", "s", "minute", "minutes", "min", "mins", +"m", "hour", "hours", "hr", "hrs", "h", "day", "days", "d", "week", "weeks", "w", "year", +"years", "yr", "yrs", and "y". It is not possible to specify months. 365.25 days is used as an +alias for a year. + +If the string is suffixed with "ago", or prefixed with a "-", the resulting time span gets +subtracted from the current unix timestamp. A "from now" suffix can also be used for +readability when adding to the current unix timestamp. + #### Parameters | Name | Type | Description | | :------ | :------ | :------ | -| `input` | `string` \| `number` \| [`Date`]( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date ) | "exp" (Expiration Time) Claim value to set on the JWT Claims Set. When number is passed that is used as a value, when string is passed it is resolved to a time span and added to the current timestamp. | +| `input` | `string` \| `number` \| [`Date`]( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date ) | "exp" (Expiration Time) Claim value to set on the JWT Claims Set. | #### Returns @@ -218,11 +236,30 @@ ___ Set the "iat" (Issued At) Claim. +- If no argument is used the current unix timestamp is used as the claim. +- If a `number` is passed as an argument it is used as the claim directly. +- If a `Date` instance is passed as an argument it is converted to unix timestamp and used as the + claim. +- If a `string` is passed as an argument it is resolved to a time span, and then added to the + current unix timestamp and used as the claim. + +Format used for time span should be a number followed by a unit, such as "5 minutes" or "1 +day". + +Valid units are: "sec", "secs", "second", "seconds", "s", "minute", "minutes", "min", "mins", +"m", "hour", "hours", "hr", "hrs", "h", "day", "days", "d", "week", "weeks", "w", "year", +"years", "yr", "yrs", and "y". It is not possible to specify months. 365.25 days is used as an +alias for a year. + +If the string is suffixed with "ago", or prefixed with a "-", the resulting time span gets +subtracted from the current unix timestamp. A "from now" suffix can also be used for +readability when adding to the current unix timestamp. + #### Parameters | Name | Type | Description | | :------ | :------ | :------ | -| `input?` | `number` \| [`Date`]( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date ) | "iat" (Issued At) Claim value to set on the JWT Claims Set. Default is current timestamp. | +| `input?` | `string` \| `number` \| [`Date`]( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date ) | "iat" (Expiration Time) Claim value to set on the JWT Claims Set. | #### Returns @@ -293,11 +330,29 @@ ___ Set the "nbf" (Not Before) Claim. +- If a `number` is passed as an argument it is used as the claim directly. +- If a `Date` instance is passed as an argument it is converted to unix timestamp and used as the + claim. +- If a `string` is passed as an argument it is resolved to a time span, and then added to the + current unix timestamp and used as the claim. + +Format used for time span should be a number followed by a unit, such as "5 minutes" or "1 +day". + +Valid units are: "sec", "secs", "second", "seconds", "s", "minute", "minutes", "min", "mins", +"m", "hour", "hours", "hr", "hrs", "h", "day", "days", "d", "week", "weeks", "w", "year", +"years", "yr", "yrs", and "y". It is not possible to specify months. 365.25 days is used as an +alias for a year. + +If the string is suffixed with "ago", or prefixed with a "-", the resulting time span gets +subtracted from the current unix timestamp. A "from now" suffix can also be used for +readability when adding to the current unix timestamp. + #### Parameters | Name | Type | Description | | :------ | :------ | :------ | -| `input` | `string` \| `number` \| [`Date`]( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date ) | "nbf" (Not Before) Claim value to set on the JWT Claims Set. When number is passed that is used as a value, when string is passed it is resolved to a time span and added to the current timestamp. | +| `input` | `string` \| `number` \| [`Date`]( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date ) | "nbf" (Not Before) Claim value to set on the JWT Claims Set. | #### Returns diff --git a/docs/classes/jwt_produce.ProduceJWT.md b/docs/classes/jwt_produce.ProduceJWT.md index e874b68b6f..05bcd4a5da 100644 --- a/docs/classes/jwt_produce.ProduceJWT.md +++ b/docs/classes/jwt_produce.ProduceJWT.md @@ -62,11 +62,29 @@ ___ Set the "exp" (Expiration Time) Claim. +- If a `number` is passed as an argument it is used as the claim directly. +- If a `Date` instance is passed as an argument it is converted to unix timestamp and used as the + claim. +- If a `string` is passed as an argument it is resolved to a time span, and then added to the + current unix timestamp and used as the claim. + +Format used for time span should be a number followed by a unit, such as "5 minutes" or "1 +day". + +Valid units are: "sec", "secs", "second", "seconds", "s", "minute", "minutes", "min", "mins", +"m", "hour", "hours", "hr", "hrs", "h", "day", "days", "d", "week", "weeks", "w", "year", +"years", "yr", "yrs", and "y". It is not possible to specify months. 365.25 days is used as an +alias for a year. + +If the string is suffixed with "ago", or prefixed with a "-", the resulting time span gets +subtracted from the current unix timestamp. A "from now" suffix can also be used for +readability when adding to the current unix timestamp. + #### Parameters | Name | Type | Description | | :------ | :------ | :------ | -| `input` | `string` \| `number` \| [`Date`]( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date ) | "exp" (Expiration Time) Claim value to set on the JWT Claims Set. When number is passed that is used as a value, when string is passed it is resolved to a time span and added to the current timestamp. | +| `input` | `string` \| `number` \| [`Date`]( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date ) | "exp" (Expiration Time) Claim value to set on the JWT Claims Set. | #### Returns @@ -80,11 +98,30 @@ ___ Set the "iat" (Issued At) Claim. +- If no argument is used the current unix timestamp is used as the claim. +- If a `number` is passed as an argument it is used as the claim directly. +- If a `Date` instance is passed as an argument it is converted to unix timestamp and used as the + claim. +- If a `string` is passed as an argument it is resolved to a time span, and then added to the + current unix timestamp and used as the claim. + +Format used for time span should be a number followed by a unit, such as "5 minutes" or "1 +day". + +Valid units are: "sec", "secs", "second", "seconds", "s", "minute", "minutes", "min", "mins", +"m", "hour", "hours", "hr", "hrs", "h", "day", "days", "d", "week", "weeks", "w", "year", +"years", "yr", "yrs", and "y". It is not possible to specify months. 365.25 days is used as an +alias for a year. + +If the string is suffixed with "ago", or prefixed with a "-", the resulting time span gets +subtracted from the current unix timestamp. A "from now" suffix can also be used for +readability when adding to the current unix timestamp. + #### Parameters | Name | Type | Description | | :------ | :------ | :------ | -| `input?` | `number` \| [`Date`]( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date ) | "iat" (Issued At) Claim value to set on the JWT Claims Set. Default is current timestamp. | +| `input?` | `string` \| `number` \| [`Date`]( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date ) | "iat" (Expiration Time) Claim value to set on the JWT Claims Set. | #### Returns @@ -134,11 +171,29 @@ ___ Set the "nbf" (Not Before) Claim. +- If a `number` is passed as an argument it is used as the claim directly. +- If a `Date` instance is passed as an argument it is converted to unix timestamp and used as the + claim. +- If a `string` is passed as an argument it is resolved to a time span, and then added to the + current unix timestamp and used as the claim. + +Format used for time span should be a number followed by a unit, such as "5 minutes" or "1 +day". + +Valid units are: "sec", "secs", "second", "seconds", "s", "minute", "minutes", "min", "mins", +"m", "hour", "hours", "hr", "hrs", "h", "day", "days", "d", "week", "weeks", "w", "year", +"years", "yr", "yrs", and "y". It is not possible to specify months. 365.25 days is used as an +alias for a year. + +If the string is suffixed with "ago", or prefixed with a "-", the resulting time span gets +subtracted from the current unix timestamp. A "from now" suffix can also be used for +readability when adding to the current unix timestamp. + #### Parameters | Name | Type | Description | | :------ | :------ | :------ | -| `input` | `string` \| `number` \| [`Date`]( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date ) | "nbf" (Not Before) Claim value to set on the JWT Claims Set. When number is passed that is used as a value, when string is passed it is resolved to a time span and added to the current timestamp. | +| `input` | `string` \| `number` \| [`Date`]( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date ) | "nbf" (Not Before) Claim value to set on the JWT Claims Set. | #### Returns diff --git a/docs/classes/jwt_sign.SignJWT.md b/docs/classes/jwt_sign.SignJWT.md index 50faca2993..ad55364efe 100644 --- a/docs/classes/jwt_sign.SignJWT.md +++ b/docs/classes/jwt_sign.SignJWT.md @@ -162,11 +162,29 @@ ___ Set the "exp" (Expiration Time) Claim. +- If a `number` is passed as an argument it is used as the claim directly. +- If a `Date` instance is passed as an argument it is converted to unix timestamp and used as the + claim. +- If a `string` is passed as an argument it is resolved to a time span, and then added to the + current unix timestamp and used as the claim. + +Format used for time span should be a number followed by a unit, such as "5 minutes" or "1 +day". + +Valid units are: "sec", "secs", "second", "seconds", "s", "minute", "minutes", "min", "mins", +"m", "hour", "hours", "hr", "hrs", "h", "day", "days", "d", "week", "weeks", "w", "year", +"years", "yr", "yrs", and "y". It is not possible to specify months. 365.25 days is used as an +alias for a year. + +If the string is suffixed with "ago", or prefixed with a "-", the resulting time span gets +subtracted from the current unix timestamp. A "from now" suffix can also be used for +readability when adding to the current unix timestamp. + #### Parameters | Name | Type | Description | | :------ | :------ | :------ | -| `input` | `string` \| `number` \| [`Date`]( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date ) | "exp" (Expiration Time) Claim value to set on the JWT Claims Set. When number is passed that is used as a value, when string is passed it is resolved to a time span and added to the current timestamp. | +| `input` | `string` \| `number` \| [`Date`]( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date ) | "exp" (Expiration Time) Claim value to set on the JWT Claims Set. | #### Returns @@ -180,11 +198,30 @@ ___ Set the "iat" (Issued At) Claim. +- If no argument is used the current unix timestamp is used as the claim. +- If a `number` is passed as an argument it is used as the claim directly. +- If a `Date` instance is passed as an argument it is converted to unix timestamp and used as the + claim. +- If a `string` is passed as an argument it is resolved to a time span, and then added to the + current unix timestamp and used as the claim. + +Format used for time span should be a number followed by a unit, such as "5 minutes" or "1 +day". + +Valid units are: "sec", "secs", "second", "seconds", "s", "minute", "minutes", "min", "mins", +"m", "hour", "hours", "hr", "hrs", "h", "day", "days", "d", "week", "weeks", "w", "year", +"years", "yr", "yrs", and "y". It is not possible to specify months. 365.25 days is used as an +alias for a year. + +If the string is suffixed with "ago", or prefixed with a "-", the resulting time span gets +subtracted from the current unix timestamp. A "from now" suffix can also be used for +readability when adding to the current unix timestamp. + #### Parameters | Name | Type | Description | | :------ | :------ | :------ | -| `input?` | `number` \| [`Date`]( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date ) | "iat" (Issued At) Claim value to set on the JWT Claims Set. Default is current timestamp. | +| `input?` | `string` \| `number` \| [`Date`]( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date ) | "iat" (Expiration Time) Claim value to set on the JWT Claims Set. | #### Returns @@ -234,11 +271,29 @@ ___ Set the "nbf" (Not Before) Claim. +- If a `number` is passed as an argument it is used as the claim directly. +- If a `Date` instance is passed as an argument it is converted to unix timestamp and used as the + claim. +- If a `string` is passed as an argument it is resolved to a time span, and then added to the + current unix timestamp and used as the claim. + +Format used for time span should be a number followed by a unit, such as "5 minutes" or "1 +day". + +Valid units are: "sec", "secs", "second", "seconds", "s", "minute", "minutes", "min", "mins", +"m", "hour", "hours", "hr", "hrs", "h", "day", "days", "d", "week", "weeks", "w", "year", +"years", "yr", "yrs", and "y". It is not possible to specify months. 365.25 days is used as an +alias for a year. + +If the string is suffixed with "ago", or prefixed with a "-", the resulting time span gets +subtracted from the current unix timestamp. A "from now" suffix can also be used for +readability when adding to the current unix timestamp. + #### Parameters | Name | Type | Description | | :------ | :------ | :------ | -| `input` | `string` \| `number` \| [`Date`]( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date ) | "nbf" (Not Before) Claim value to set on the JWT Claims Set. When number is passed that is used as a value, when string is passed it is resolved to a time span and added to the current timestamp. | +| `input` | `string` \| `number` \| [`Date`]( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date ) | "nbf" (Not Before) Claim value to set on the JWT Claims Set. | #### Returns diff --git a/docs/classes/jwt_unsecured.UnsecuredJWT.md b/docs/classes/jwt_unsecured.UnsecuredJWT.md index feb3164945..e8b4a8fd1b 100644 --- a/docs/classes/jwt_unsecured.UnsecuredJWT.md +++ b/docs/classes/jwt_unsecured.UnsecuredJWT.md @@ -129,11 +129,29 @@ ___ Set the "exp" (Expiration Time) Claim. +- If a `number` is passed as an argument it is used as the claim directly. +- If a `Date` instance is passed as an argument it is converted to unix timestamp and used as the + claim. +- If a `string` is passed as an argument it is resolved to a time span, and then added to the + current unix timestamp and used as the claim. + +Format used for time span should be a number followed by a unit, such as "5 minutes" or "1 +day". + +Valid units are: "sec", "secs", "second", "seconds", "s", "minute", "minutes", "min", "mins", +"m", "hour", "hours", "hr", "hrs", "h", "day", "days", "d", "week", "weeks", "w", "year", +"years", "yr", "yrs", and "y". It is not possible to specify months. 365.25 days is used as an +alias for a year. + +If the string is suffixed with "ago", or prefixed with a "-", the resulting time span gets +subtracted from the current unix timestamp. A "from now" suffix can also be used for +readability when adding to the current unix timestamp. + #### Parameters | Name | Type | Description | | :------ | :------ | :------ | -| `input` | `string` \| `number` \| [`Date`]( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date ) | "exp" (Expiration Time) Claim value to set on the JWT Claims Set. When number is passed that is used as a value, when string is passed it is resolved to a time span and added to the current timestamp. | +| `input` | `string` \| `number` \| [`Date`]( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date ) | "exp" (Expiration Time) Claim value to set on the JWT Claims Set. | #### Returns @@ -147,11 +165,30 @@ ___ Set the "iat" (Issued At) Claim. +- If no argument is used the current unix timestamp is used as the claim. +- If a `number` is passed as an argument it is used as the claim directly. +- If a `Date` instance is passed as an argument it is converted to unix timestamp and used as the + claim. +- If a `string` is passed as an argument it is resolved to a time span, and then added to the + current unix timestamp and used as the claim. + +Format used for time span should be a number followed by a unit, such as "5 minutes" or "1 +day". + +Valid units are: "sec", "secs", "second", "seconds", "s", "minute", "minutes", "min", "mins", +"m", "hour", "hours", "hr", "hrs", "h", "day", "days", "d", "week", "weeks", "w", "year", +"years", "yr", "yrs", and "y". It is not possible to specify months. 365.25 days is used as an +alias for a year. + +If the string is suffixed with "ago", or prefixed with a "-", the resulting time span gets +subtracted from the current unix timestamp. A "from now" suffix can also be used for +readability when adding to the current unix timestamp. + #### Parameters | Name | Type | Description | | :------ | :------ | :------ | -| `input?` | `number` \| [`Date`]( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date ) | "iat" (Issued At) Claim value to set on the JWT Claims Set. Default is current timestamp. | +| `input?` | `string` \| `number` \| [`Date`]( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date ) | "iat" (Expiration Time) Claim value to set on the JWT Claims Set. | #### Returns @@ -201,11 +238,29 @@ ___ Set the "nbf" (Not Before) Claim. +- If a `number` is passed as an argument it is used as the claim directly. +- If a `Date` instance is passed as an argument it is converted to unix timestamp and used as the + claim. +- If a `string` is passed as an argument it is resolved to a time span, and then added to the + current unix timestamp and used as the claim. + +Format used for time span should be a number followed by a unit, such as "5 minutes" or "1 +day". + +Valid units are: "sec", "secs", "second", "seconds", "s", "minute", "minutes", "min", "mins", +"m", "hour", "hours", "hr", "hrs", "h", "day", "days", "d", "week", "weeks", "w", "year", +"years", "yr", "yrs", and "y". It is not possible to specify months. 365.25 days is used as an +alias for a year. + +If the string is suffixed with "ago", or prefixed with a "-", the resulting time span gets +subtracted from the current unix timestamp. A "from now" suffix can also be used for +readability when adding to the current unix timestamp. + #### Parameters | Name | Type | Description | | :------ | :------ | :------ | -| `input` | `string` \| `number` \| [`Date`]( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date ) | "nbf" (Not Before) Claim value to set on the JWT Claims Set. When number is passed that is used as a value, when string is passed it is resolved to a time span and added to the current timestamp. | +| `input` | `string` \| `number` \| [`Date`]( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date ) | "nbf" (Not Before) Claim value to set on the JWT Claims Set. | #### Returns diff --git a/src/jwt/produce.ts b/src/jwt/produce.ts index e6d356336a..cb54962d87 100644 --- a/src/jwt/produce.ts +++ b/src/jwt/produce.ts @@ -66,9 +66,25 @@ export class ProduceJWT { /** * Set the "nbf" (Not Before) Claim. * - * @param input "nbf" (Not Before) Claim value to set on the JWT Claims Set. When number is passed - * that is used as a value, when string is passed it is resolved to a time span and added to the - * current timestamp. + * - If a `number` is passed as an argument it is used as the claim directly. + * - If a `Date` instance is passed as an argument it is converted to unix timestamp and used as the + * claim. + * - If a `string` is passed as an argument it is resolved to a time span, and then added to the + * current unix timestamp and used as the claim. + * + * Format used for time span should be a number followed by a unit, such as "5 minutes" or "1 + * day". + * + * Valid units are: "sec", "secs", "second", "seconds", "s", "minute", "minutes", "min", "mins", + * "m", "hour", "hours", "hr", "hrs", "h", "day", "days", "d", "week", "weeks", "w", "year", + * "years", "yr", "yrs", and "y". It is not possible to specify months. 365.25 days is used as an + * alias for a year. + * + * If the string is suffixed with "ago", or prefixed with a "-", the resulting time span gets + * subtracted from the current unix timestamp. A "from now" suffix can also be used for + * readability when adding to the current unix timestamp. + * + * @param input "nbf" (Not Before) Claim value to set on the JWT Claims Set. */ setNotBefore(input: number | string | Date) { if (typeof input === 'number') { @@ -84,9 +100,25 @@ export class ProduceJWT { /** * Set the "exp" (Expiration Time) Claim. * - * @param input "exp" (Expiration Time) Claim value to set on the JWT Claims Set. When number is - * passed that is used as a value, when string is passed it is resolved to a time span and added - * to the current timestamp. + * - If a `number` is passed as an argument it is used as the claim directly. + * - If a `Date` instance is passed as an argument it is converted to unix timestamp and used as the + * claim. + * - If a `string` is passed as an argument it is resolved to a time span, and then added to the + * current unix timestamp and used as the claim. + * + * Format used for time span should be a number followed by a unit, such as "5 minutes" or "1 + * day". + * + * Valid units are: "sec", "secs", "second", "seconds", "s", "minute", "minutes", "min", "mins", + * "m", "hour", "hours", "hr", "hrs", "h", "day", "days", "d", "week", "weeks", "w", "year", + * "years", "yr", "yrs", and "y". It is not possible to specify months. 365.25 days is used as an + * alias for a year. + * + * If the string is suffixed with "ago", or prefixed with a "-", the resulting time span gets + * subtracted from the current unix timestamp. A "from now" suffix can also be used for + * readability when adding to the current unix timestamp. + * + * @param input "exp" (Expiration Time) Claim value to set on the JWT Claims Set. */ setExpirationTime(input: number | string | Date) { if (typeof input === 'number') { @@ -102,8 +134,26 @@ export class ProduceJWT { /** * Set the "iat" (Issued At) Claim. * - * @param input "iat" (Issued At) Claim value to set on the JWT Claims Set. Default is current - * timestamp. + * - If no argument is used the current unix timestamp is used as the claim. + * - If a `number` is passed as an argument it is used as the claim directly. + * - If a `Date` instance is passed as an argument it is converted to unix timestamp and used as the + * claim. + * - If a `string` is passed as an argument it is resolved to a time span, and then added to the + * current unix timestamp and used as the claim. + * + * Format used for time span should be a number followed by a unit, such as "5 minutes" or "1 + * day". + * + * Valid units are: "sec", "secs", "second", "seconds", "s", "minute", "minutes", "min", "mins", + * "m", "hour", "hours", "hr", "hrs", "h", "day", "days", "d", "week", "weeks", "w", "year", + * "years", "yr", "yrs", and "y". It is not possible to specify months. 365.25 days is used as an + * alias for a year. + * + * If the string is suffixed with "ago", or prefixed with a "-", the resulting time span gets + * subtracted from the current unix timestamp. A "from now" suffix can also be used for + * readability when adding to the current unix timestamp. + * + * @param input "iat" (Expiration Time) Claim value to set on the JWT Claims Set. */ setIssuedAt(input?: number | string | Date) { if (typeof input === 'undefined') {