mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 20:38:52 +00:00
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Introduced user access tokens, enabling users to generate, list, and revoke personal access tokens via the GraphQL API. * Added GraphQL mutations and queries for managing access tokens, including token creation (with optional expiration), listing, and revocation. * Implemented authentication support for private API endpoints using access tokens in addition to session cookies. * **Bug Fixes** * None. * **Tests** * Added comprehensive tests for access token creation, listing, revocation, expiration handling, and authentication using tokens. * **Chores** * Updated backend models, schema, and database migrations to support access token functionality. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
57 lines
1.2 KiB
TypeScript
57 lines
1.2 KiB
TypeScript
declare namespace Express {
|
|
interface Request {
|
|
session?: import('./core/auth/session').Session;
|
|
token?: import('./core/auth/session').TokenSession;
|
|
}
|
|
}
|
|
|
|
declare type Exact<T extends { [key: string]: unknown }> = {
|
|
[K in keyof T]: T[K];
|
|
};
|
|
|
|
declare type Leaf<T> = T & { __leaf: true };
|
|
declare type NonLeaf<T> = T extends Leaf<infer V> ? V : T;
|
|
|
|
declare type DeeplyEraseLeaf<T> = T extends Leaf<infer V> ? V
|
|
:
|
|
{
|
|
[K in keyof T]: DeeplyEraseLeaf<T[K]>
|
|
}
|
|
|
|
declare type PrimitiveType =
|
|
| string
|
|
| number
|
|
| boolean
|
|
| symbol
|
|
| null
|
|
| undefined
|
|
|
|
declare type UnionToIntersection<T> = (
|
|
T extends any ? (x: T) => any : never
|
|
) extends (x: infer R) => any
|
|
? R
|
|
: never;
|
|
|
|
declare type ConstructorOf<T> = {
|
|
new (): T;
|
|
};
|
|
|
|
declare type DeepPartial<T> =
|
|
T extends Array<infer U>
|
|
? DeepPartial<U>[]
|
|
: T extends ReadonlyArray<infer U>
|
|
? ReadonlyArray<DeepPartial<U>>
|
|
: T extends Record<string, any>
|
|
? {
|
|
[K in keyof T]?: DeepPartial<T[K]>;
|
|
}
|
|
: T;
|
|
|
|
declare type DeepReadonly<T> = {
|
|
readonly [K in keyof T]: T[K] extends object ? DeepReadonly<T[K]> : T[K];
|
|
};
|
|
|
|
declare type AFFiNEModule =
|
|
| import('@nestjs/common').Type
|
|
| import('@nestjs/common').DynamicModule;
|