@mantiq/auth 0.7.3 → 0.7.5
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.
package/package.json
CHANGED
|
@@ -40,4 +40,21 @@ export interface Authenticatable {
|
|
|
40
40
|
|
|
41
41
|
/** Get the primary key value. */
|
|
42
42
|
getKey(): string | number
|
|
43
|
+
|
|
44
|
+
// ── Token methods (present when HasApiTokens mixin is applied) ────
|
|
45
|
+
|
|
46
|
+
/** Create a new personal access token. */
|
|
47
|
+
createToken?(name: string, abilities?: string[], expiresAt?: Date): Promise<{ accessToken: any; plainTextToken: string }>
|
|
48
|
+
|
|
49
|
+
/** Get all tokens for this user. */
|
|
50
|
+
tokens?(): any
|
|
51
|
+
|
|
52
|
+
/** Get the current access token instance. */
|
|
53
|
+
currentAccessToken?(): any
|
|
54
|
+
|
|
55
|
+
/** Check if the current token has a given ability. */
|
|
56
|
+
tokenCan?(ability: string): boolean
|
|
57
|
+
|
|
58
|
+
/** Check if the current token lacks a given ability. */
|
|
59
|
+
tokenCant?(ability: string): boolean
|
|
43
60
|
}
|