🏷️ 型
共通 TypeScript 型は types 名前空間からエクスポートされます。これらは
型のみの契約です。実行時の名前空間が別途必要でない場合は、import type でインポートしてください。
import type {types} from '@nodeblocks/backend-sdk';
type AuthSecrets = types.AuthSecrets;
type MailService = types.MailService;
type GoogleOAuthDriver = types.GoogleOAuthDriver;
エクスポートモジュール
この名前空間は、以下のソースモジュールを再エクスポートします。
| モジュール | 主な契約 |
|---|---|
authentication | AuthSecrets、トークン情報型、Authenticator、TokenVerification |
email | EmailConfig、MailData、MailOptions、MailService |
http | HttpStatusCode |
oauth | プロバイダー定数、OAuth ドライバー、コールバック、プロフィール、リクエスト型 |
organization | OrganizationMember |
utils | ObjectPath、ObjectPathsMatchingTuple、SameLengthArray |
ルートおよびサービス合成を記述する型は、types ではなく
primitives にあります。たとえば RouteConfig、RouteHandlerPayload、Service、
ServiceDefinition、Validator です。
プロバイダー契約は ドライバー »、トークン契約は 認証 ユーティリティ »、合成契約は ルート » を参照してください。