Skip to content

Commit 1a19409

Browse files
authored
docs(backend): note M2MToken timestamps are in milliseconds (#9122)
1 parent 7b581aa commit 1a19409

4 files changed

Lines changed: 15 additions & 7 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/backend': patch
3+
---
4+
5+
Clarify in the `M2MToken`, `APIKey`, and `IdPOAuthAccessToken` JSDoc that the timestamp properties (`expiration`, `lastUsedAt`, `createdAt`, and `updatedAt`) are Unix timestamps in milliseconds (not seconds).

‎packages/backend/src/api/resources/APIKey.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ export class APIKey {
2323
readonly revocationReason: string | null,
2424
/** Whether the API key has expired. */
2525
readonly expired: boolean,
26-
/** The Unix timestamp when the API key expires. `null` if the API key never expires. */
26+
/** The Unix timestamp (in milliseconds) when the API key expires. `null` if the API key never expires. */
2727
readonly expiration: number | null,
2828
/** The user ID for the user creating the API key. */
2929
readonly createdBy: string | null,
3030
/** A description for the API key. */
3131
readonly description: string | null,
32-
/** The Unix timestamp when the API key was last used to authenticate a request. */
32+
/** The Unix timestamp (in milliseconds) when the API key was last used to authenticate a request. */
3333
readonly lastUsedAt: number | null,
34-
/** The Unix timestamp when the API key was created. */
34+
/** The Unix timestamp (in milliseconds) when the API key was created. */
3535
readonly createdAt: number,
36-
/** The Unix timestamp when the API key was last updated. */
36+
/** The Unix timestamp (in milliseconds) when the API key was last updated. */
3737
readonly updatedAt: number,
3838
/** The API key secret. */
3939
readonly secret?: string,

‎packages/backend/src/api/resources/IdPOAuthAccessToken.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ export class IdPOAuthAccessToken {
1919
readonly revoked: boolean,
2020
readonly revocationReason: string | null,
2121
readonly expired: boolean,
22+
/** The Unix timestamp (in milliseconds) when the access token expires. */
2223
readonly expiration: number | null,
24+
/** The Unix timestamp (in milliseconds) when the access token was created. */
2325
readonly createdAt: number,
26+
/** The Unix timestamp (in milliseconds) when the access token was last updated. */
2427
readonly updatedAt: number,
2528
) {}
2629

‎packages/backend/src/api/resources/M2MToken.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ export class M2MToken {
5555
readonly revocationReason: string | null,
5656
/** Whether the M2M token has expired. */
5757
readonly expired: boolean,
58-
/** The Unix timestamp when the M2M token expires. */
58+
/** The Unix timestamp (in milliseconds) when the M2M token expires. */
5959
readonly expiration: number | null,
60-
/** The Unix timestamp when the M2M token was created. */
60+
/** The Unix timestamp (in milliseconds) when the M2M token was created. */
6161
readonly createdAt: number,
62-
/** The Unix timestamp when the M2M token was last updated. */
62+
/** The Unix timestamp (in milliseconds) when the M2M token was last updated. */
6363
readonly updatedAt: number,
6464
/** The token string. */
6565
readonly token?: string,

0 commit comments

Comments
 (0)