@alneas/appkit-core API リファレンス
@alneas/appkit-core API リファレンス
Section titled “@alneas/appkit-core API リファレンス”FUNCTION storage.sha256Hex
Section titled “FUNCTION storage.sha256Hex”小文字の16進数表記の SHA-256 ダイジェストを同期的に計算します。
export function sha256Hex(data: Uint8Array | ArrayBuffer | string): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
data |
string | ArrayBuffer | Uint8Array<ArrayBufferLike> |
必須 | - ハッシュ化するバイト列です。文字列入力はUTF-8でエンコードされます。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: 64文字の小文字16進数ダイジェストです。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { sha256Hex } from '@alneas/appkit-core/storage/crypto';
console.log(sha256Hex("hello"));---
### `FUNCTION` `storage.sha256Bytes`
ネイティブの暗号機能に依存せず、SHA-256 ダイジェストを同期的に計算します。
```typescriptexport function sha256Bytes(data: Uint8Array | ArrayBuffer | string): Uint8Array引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
data |
string | ArrayBuffer | Uint8Array<ArrayBufferLike> |
必須 | - ハッシュ化するバイト列です。文字列入力はUTF-8でエンコードされます。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Uint8Array<ArrayBufferLike> - Description: 新しい32バイトのダイジェストです。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { sha256Bytes } from '@alneas/appkit-core/storage/crypto';
console.log(sha256Bytes("hello"));---
### `FUNCTION` `storage.hmacSha256`
SHA-256 を用いた HMAC でバイト列に同期的に署名します。
```typescriptexport function hmacSha256( key: Uint8Array | ArrayBuffer | string, data: Uint8Array | ArrayBuffer | string,): Uint8Array引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string | ArrayBuffer | Uint8Array<ArrayBufferLike> |
必須 | - 署名用の秘密バイト列です。文字列にはUTF-8を使用します。 |
data |
string | ArrayBuffer | Uint8Array<ArrayBufferLike> |
必須 | - メッセージのバイト列です。文字列には UTF-8 を使用します。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Uint8Array<ArrayBufferLike> - Description: 新しい32バイトの認証コードです。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { hmacSha256 } from '@alneas/appkit-core/storage/crypto';
console.log(hmacSha256("example-key", "hello"));---
### `FUNCTION` `storage.hmacSha256Hex`
HMAC-SHA256 でバイト列に署名し、小文字の16進数表記で返します。
```typescriptexport function hmacSha256Hex( key: Uint8Array | ArrayBuffer | string, data: Uint8Array | ArrayBuffer | string,): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string | ArrayBuffer | Uint8Array<ArrayBufferLike> |
必須 | - 署名用の秘密バイト列です。文字列にはUTF-8を使用します。 |
data |
string | ArrayBuffer | Uint8Array<ArrayBufferLike> |
必須 | - メッセージのバイト列です。文字列には UTF-8 を使用します。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: 64文字の小文字16進数による認証コードです。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { hmacSha256Hex } from '@alneas/appkit-core/storage/crypto';
console.log(hmacSha256Hex("example-key", "hello"));---
### `FUNCTION` `storage.base64EncodeUtf8`
UTF-8 テキストを標準 Base64 にエンコードします。
```typescriptexport function base64EncodeUtf8(str: string): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
str |
string |
必須 | - エンコードする Unicode テキストです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: UTF-8 バイト列を表す Base64 テキストです。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { base64EncodeUtf8 } from '@alneas/appkit-core/storage/crypto';
console.log(base64EncodeUtf8("hello 日本語"));---
### `FUNCTION` `storage.base64DecodeUtf8`
標準 Base64 のバイト列を UTF-8 テキストにデコードします。
```typescriptexport function base64DecodeUtf8(base64: string): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
base64 |
string |
必須 | - デコードする標準 Base64 エンコード文字列です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: デコードされたテキストです。不正な UTF-8 には置換文字を使用します。
例外 (Throws)
Section titled “例外 (Throws)”atob が不正な Base64 を拒否すると、例外をスローします。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { base64DecodeUtf8 } from '@alneas/appkit-core/storage/crypto';
console.log(base64DecodeUtf8("aGVsbG8="));---
### `CLASS` `storage.S3CompatibleRuntime`
S3、R2、OCI に共通のランタイムクライアントです。常に標準の fetch + SigV4 を使用します。無関係な SDK をインストールしても動作は変わりません。
```typescriptclass storage.S3CompatibleRuntime使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { S3CompatibleRuntime, type S3RuntimeConfig } from "@alneas/appkit-core/storage";
export function createRuntime(config: S3RuntimeConfig) { return new S3CompatibleRuntime(config);}---
### `FUNCTION` `storage.presignS3GetUrl`
SDK を使用せずに署名付きダウンロード URL を生成します。
```typescriptexport function presignS3GetUrl(config: S3RuntimeConfig, key: string, options?: StorageURLOptions): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
config |
S3RuntimeConfig |
必須 | - ホストが提供するバケット、署名用の認証情報、およびエンドポイント設定です。 |
key |
string |
必須 | - 設定されたバケット内のキーです。 |
options |
StorageURLOptions | undefined |
任意 | - 省略可能な有効期間で、1から604800までの整数秒です。デフォルトは config.defaultExpiresIn または3600です。GET は downloadFilename もサポートします。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: ネットワークリクエストや存在確認を行わずに生成する署名付き URL です。
例外 (Throws)
Section titled “例外 (Throws)”有効期間が無効な場合、またはエンドポイント設定が不正な場合に例外をスローします。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { presignS3GetUrl, type S3RuntimeConfig } from "@alneas/appkit-core/storage";
export function sign(config: S3RuntimeConfig) { return presignS3GetUrl(config, "reports/note.txt", { expiresIn: 300 });}---
### `FUNCTION` `storage.presignS3PutUrl`
署名付き PUT URL を生成します。生成された URL をそのまま使用し、HTTP PUT でバイト列をアップロードしてください。
```typescriptexport function presignS3PutUrl(config: S3RuntimeConfig, key: string, options?: Pick<StorageURLOptions, 'expiresIn'>): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
config |
S3RuntimeConfig |
必須 | - ホストが提供するバケット、署名用の認証情報、およびエンドポイント設定です。 |
key |
string |
必須 | - 設定されたバケット内のキーです。 |
options |
Pick<StorageURLOptions, "expiresIn"> | undefined |
任意 | - 省略可能な有効期間で、1から604800までの整数秒です。デフォルトは config.defaultExpiresIn または3600です。GET は downloadFilename もサポートします。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: ネットワークリクエストや存在確認を行わずに生成する署名付き URL です。
例外 (Throws)
Section titled “例外 (Throws)”有効期間が無効な場合、またはエンドポイント設定が不正な場合に例外をスローします。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { presignS3PutUrl, type S3RuntimeConfig } from "@alneas/appkit-core/storage";
export function sign(config: S3RuntimeConfig) { return presignS3PutUrl(config, "reports/note.txt", { expiresIn: 300 });}---
### `INTERFACE` `storage.S3RuntimeConfig`
署名付き S3 互換リクエストの認証情報、エンドポイントのアドレス指定、および有効期限のデフォルト設定です。
```typescriptexport interface S3RuntimeConfig {
/** SigV4 signing region; use the provider-required region (for example auto for R2). */ region: string;
/** Bucket namespace to address in request paths or hostnames. */ bucket: string;
/** Optional absolute S3-compatible endpoint; omitted uses the AWS regional endpoint. */ endpoint?: string;
/** Credential identifier included in SigV4 authorization; supplied by the host. */ accessKeyId: string;
/** Host-supplied signing secret; keep it outside untrusted client code. */ secretAccessKey: string;
/** For a custom endpoint, use bucket-in-path addressing unless explicitly false. */ forcePathStyle?: boolean;
/** Default signed-URL lifetime in whole seconds (1–604800); omitted uses 3600. */ defaultExpiresIn?: number;}INTERFACE storage.S3PutInput
Section titled “INTERFACE storage.S3PutInput”1 回の署名付き PUT リクエストで送信するオブジェクト本体とヘッダーです。
export interface S3PutInput {
/** Destination key within the configured bucket. */ key: string;
/** Complete payload bytes or UTF-8 text to send. */ body: Uint8Array | string;
/** Optional Content-Type header; omitted sends no MIME header. */ contentType?: string;
/** Optional Cache-Control response metadata to store. */ cacheControl?: string;
/** Optional string metadata stored under lowercase x-amz-meta-* headers; non-ASCII values are encoded. */ metadata?: Record<string, string>;
/** Optional retention mode header; requires provider-side Object Lock support and permissions. */ objectLockMode?: 'GOVERNANCE' | 'COMPLIANCE';
/** Optional absolute retention expiry sent as an ISO timestamp. */ objectLockRetainUntilDate?: Date;}CLASS storage.S3StorageAdapter
Section titled “CLASS storage.S3StorageAdapter”AWS S3 用のストレージアダプターです。
コンプライアンス要件に従った原本書類の保存のため、Object Lock (WORM) をサポートします。
- Object Lock (Compliance/Governance) のサポート
- SHA-256 ハッシュの自動計算とメタデータの保存
- 署名付き URL の生成
- タグによるメタデータの保存
class storage.S3StorageAdapter使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { S3StorageAdapter, type S3StorageConfig } from '@alneas/appkit-core/storage';
// The host supplies storage configuration and enforces its access policy.export function createStorage(config: S3StorageConfig) { return new S3StorageAdapter(config);}---
### `FUNCTION` `storage.calculateSHA256`
データの SHA-256 ハッシュを計算します(Web 標準に準拠し、ブラウザーで動作します)。
```typescriptexport function calculateSHA256(data: Uint8Array | ArrayBuffer | string): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
data |
string | ArrayBuffer | Uint8Array<ArrayBufferLike> |
必須 | - ハッシュを計算するデータ |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: 16進数にエンコードされたハッシュ文字列
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { calculateSHA256 } from "@alneas/appkit-core/storage";
console.log(calculateSHA256("hello"));---
### `INTERFACE` `storage.S3UploadOptions`
S3 アップロード用の追加オプションです。
```typescriptexport interface S3UploadOptions extends StorageUploadOptions {
/** Precomputed SHA-256 hash. */ hash?: string;
/** Object Lock retention expiration date. */ retentionUntilDate?: Date;
/** Object Lock mode (GOVERNANCE or COMPLIANCE). */ objectLockMode?: 'GOVERNANCE' | 'COMPLIANCE';}CLASS storage.R2StorageAdapter
Section titled “CLASS storage.R2StorageAdapter”Cloudflare R2 (S3 互換) 用のストレージアダプターです。
- S3 互換 API の使用
- 署名付き URL(有効期限付き、非公開ファイル用)
- 署名なし URL(公開バケット用)
- ファイルのアップロード、ダウンロード、一覧取得、コピー、移動操作
class storage.R2StorageAdapter使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { R2StorageAdapter, type R2StorageConfig } from '@alneas/appkit-core/storage';
// The host supplies storage configuration and enforces its access policy.export function createStorage(config: R2StorageConfig) { return new R2StorageAdapter(config);}---
### `CLASS` `storage.OCIStorageAdapter`
OCI Object Storage (S3 互換) 用のストレージアダプターです。
コンプライアンス要件に従った原本書類の保存のため、Object Lock (Retention Rules) をサポートします。
## 機能- OCI S3 互換 API の使用- Object Lock (Retention Rules) のサポート- SHA-256 ハッシュの自動計算とメタデータの保存- 署名付き URL の生成
```typescriptclass storage.OCIStorageAdapter使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { OCIStorageAdapter, type OCIStorageConfig } from '@alneas/appkit-core/storage';
// The host supplies storage configuration and enforces its access policy.export function createStorage(config: OCIStorageConfig) { return new OCIStorageAdapter(config);}---
### `INTERFACE` `storage.OCIUploadOptions`
OCI アップロード用の追加オプションです。
```typescriptexport interface OCIUploadOptions extends StorageUploadOptions {
/** Precomputed SHA-256 hash. */ hash?: string;
/** Object Lock (Retention Rules) retention expiration date. */ retentionUntilDate?: Date;}FUNCTION storage.zipStored
Section titled “FUNCTION storage.zipStored”UTF-8 の名前と非圧縮のエントリを使用して、メモリ内に ZIP アーカイブを作成します。
export function zipStored(files: readonly { /** Unique relative archive entry name, encoded as UTF-8; traversal and absolute paths are rejected. */ key: string; /** Uncompressed bytes copied into the archive for this entry. */ data: Uint8Array }[]): Uint8Array引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
files |
readonly { key: string; data: Uint8Array; }[] |
必須 | - アーカイブ内の順序で並んだエントリです。名前は一意の相対スラッシュパスである必要があり、空のセグメント、ドットセグメント、バックスラッシュ、NUL は使用できません。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Uint8Array<ArrayBufferLike> - Description: 新しく割り当てられたアーカイブのバイト列です。入力が空の場合は、有効な空の ZIP を作成します。
補足 (Remarks)
Section titled “補足 (Remarks)”すべてのエントリデータとアーカイブ出力をメモリ内に保持します。圧縮、ファイルシステムへの書き込み、ZIP64 はサポートしません。
例外 (Throws)
Section titled “例外 (Throws)”名前が安全でない場合や重複している場合、エントリ数が65535を超える場合、またはサイズやオフセットに ZIP64 が必要な場合に例外をスローします。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { zipStored } from "@alneas/appkit-core/storage/zip";
const archive = zipStored([{ key: "notes/readme.txt", data: new TextEncoder().encode("hello") }]);console.log(archive.byteLength);---
### `TYPE` `storage.BinaryData`
バイナリデータの表現です(ブラウザー、Edge、Node.js の各ランタイムに対応します)。
```typescriptexport type BinaryData = Uint8Array | ArrayBuffer | Blob | ReadableStream | string;INTERFACE storage.StorageObject
Section titled “INTERFACE storage.StorageObject”ストレージ内のファイルオブジェクトを表します。
export interface StorageObject {
/** Unique object key (path). */ key: string;
/** File size in bytes. */ size?: number;
/** MIME type. */ contentType?: string;
/** Last modified timestamp. */ lastModified?: Date;
/** ETag for caching and versioning. */ etag?: string;
/** Custom metadata key-value pairs. */ metadata?: Record<string, string>;}使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { StorageObject } from "@alneas/appkit-core/storage";
const object: StorageObject = { key: "notes.txt", size: 5, contentType: "text/plain" };console.log(object.key);---
### `INTERFACE` `storage.StorageUploadOptions`
選択されたストレージアダプターが解釈するアップロード設定です。
```typescriptexport interface StorageUploadOptions {
/** MIME type to send. Only LocalStorageAdapter infers it from the extension when omitted. */ contentType?: string;
/** Custom metadata forwarded by remote adapters; ignored by LocalStorageAdapter. */ metadata?: Record<string, string>;
/** Cache-Control value forwarded by remote adapters; ignored by LocalStorageAdapter. */ cacheControl?: string;
/** Reserved access hint, ignored by all supplied adapters; neither true nor false changes access policy. */ public?: boolean;}補足 (Remarks)
Section titled “補足 (Remarks)”アクセス制御は、ホストのファイルシステムやサーバー、またはリモートバケットのポリシーが担います。
付属のアダプターは public を無視します。アップロードによってアクセス設定が行われることはありません。
ローカルストレージでは、contentType が省略された場合、キーの拡張子から MIME タイプを
推定します。S3、R2、OCI は、明示的に指定された contentType のみを転送します。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { StorageAdapter, StorageUploadOptions } from '@alneas/appkit-core/storage';
// The host supplies an adapter configured for its storage and access policy.export async function uploadReport(storage: StorageAdapter, report: Uint8Array) { const options: StorageUploadOptions = { contentType: 'application/pdf', metadata: { author: 'Taro Yamada' }, cacheControl: 'max-age=3600', }; return storage.upload('docs/report.pdf', report, options);}---
### `INTERFACE` `storage.StorageURLOptions`
URL 生成用のオプションです。
```typescriptexport interface StorageURLOptions {
/** Expiration time for signed URLs in seconds. */ expiresIn?: number;
/** Filename for forced download attachment. */ downloadFilename?: string;
/** Whether to generate a signed URL (default: true for private objects). */ signed?: boolean;}使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { StorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: StorageAdapter) { return storage.getUrl("notes.txt", { signed: true, expiresIn: 300 });}---
### `INTERFACE` `storage.StorageListOptions`
オブジェクトの一覧取得用のオプションです。
```typescriptexport interface StorageListOptions {
/** Prefix to filter objects by. */ prefix?: string;
/** Delimiter character (e.g. '/' for hierarchical directory listing). */ delimiter?: string;
/** Provider listing limit; local storage counts objects and prefixes together (default 1000). */ limit?: number;
/** Provider continuation token; ignored by LocalStorageAdapter. */ cursor?: string;
/** Provider metadata request; local storage ignores this and always includes file metadata. */ includeMetadata?: boolean;}使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { StorageAdapter, StorageListOptions } from '@alneas/appkit-core/storage';
export async function listInvoiceDirectory(storage: StorageAdapter) { const options: StorageListOptions = { prefix: 'invoices/2026/', delimiter: '/', limit: 100, }; return storage.list(options);}---
### `INTERFACE` `storage.StorageListResult`
一覧取得で返されるオブジェクトと、プロバイダー固有の継続情報です。
```typescriptexport interface StorageListResult {
/** Array of storage objects. */ objects: StorageObject[];
/** Array of common prefixes (subdirectories). */ prefixes?: string[];
/** Provider continuation token, if supported and returned; absence alone does not guarantee completeness. */ nextCursor?: string;
/** Provider continuation indicator; local storage reports only whether the listing limit was reached. */ hasMore: boolean;}補足 (Remarks)
Section titled “補足 (Remarks)”LocalStorageAdapter は nextCursor を返しません。hasMore は、 追加のエントリが存在しなくても、オブジェクトとプレフィックスの合計数が上限に達したことを意味します。 ローカルの一覧取得では、cursor を使用してその上限を超えて取得を続けることはできません。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { StorageAdapter } from '@alneas/appkit-core/storage';
export async function listInvoices(storage: StorageAdapter) { const options = { prefix: 'invoices/', limit: 100 }; const first = await storage.list(options); // Continue only when the adapter actually supplies a cursor. const next = first.hasMore && first.nextCursor !== undefined ? await storage.list({ ...options, cursor: first.nextCursor }) : undefined; return { first, next };}---
### `INTERFACE` `storage.StorageAdapter`
統一ストレージアダプターインターフェースです。
異なるストレージプロバイダー(ローカルファイルシステム、Cloudflare R2、AWS S3 など)でのファイル操作に、一貫した API を提供します。
## 実装- `LocalStorageAdapter`: ローカルファイルシステム(開発およびテスト用)- `R2StorageAdapter`: Cloudflare R2(本番環境での配信用)
```typescriptexport interface StorageAdapter {
/** * Uploads a file to storage. * * @param key - Object key (path) * @param data - File data (Uint8Array, Blob, ReadableStream, or string) * @param options - Adapter-specific settings; see {@link StorageUploadOptions} for MIME and access-policy limits. * @returns Metadata reported by the selected adapter for the uploaded object. * @throws Rejects when the selected adapter rejects the upload. * @remarks The host configures persistence and access control. The public option * does not change access policy in any supplied adapter. * * @example * ```typescript * import type { StorageAdapter } from '@alneas/appkit-core/storage'; * * export async function saveInvoice(storage: StorageAdapter, pdfBuffer: Uint8Array) { * return storage.upload('invoices/2026/inv-001.pdf', pdfBuffer, { * contentType: 'application/pdf', * }); * } * ``` */ upload( key: string, data: Uint8Array | Blob | ReadableStream | string, options?: StorageUploadOptions, ): Promise<StorageObject>;
/** * Downloads a file from storage. * * @param key - Object key (path) * @returns File data as Uint8Array, or null if not found * * @example * ```typescript * import type { StorageAdapter } from '@alneas/appkit-core/storage'; * * export async function example(storage: StorageAdapter) { * return storage.download("reports/note.txt"); * } * ``` */ download(key: string): Promise<Uint8Array | null>;
/** * Retrieves a URL to access the object. * * @param key - Object key (path) * @param options - URL generation options * @returns URL string (signed or public depending on options) * * @example * ```typescript * import type { StorageAdapter } from '@alneas/appkit-core/storage'; * * export async function example(storage: StorageAdapter) { * return storage.getUrl("reports/note.txt", { expiresIn: 300 }); * } * ``` */ getUrl(key: string, options?: StorageURLOptions): Promise<string>;
/** * Signs a URL for a direct HTTP PUT upload. * * @param key - Destination object key. * @param options - Optional expiry in seconds, defaulting to the configured value or 3600; valid range 1–604800. * @returns A signed PUT URL; no object is uploaded by this call. * @throws Rejects when the supplied adapter rejects the operation. * @example * ```typescript * import type { StorageAdapter } from '@alneas/appkit-core/storage'; * * export async function example(storage: StorageAdapter) { * return storage.getUploadUrl?.("reports/note.txt", { expiresIn: 300 }); * } * ``` */ getUploadUrl?(key: string, options?: Pick<StorageURLOptions, 'expiresIn'>): Promise<string>;
/** * Signs a URL for an HTTP GET download. * * @param key - Object key to retrieve. * @param options - Optional expiry in seconds (1–604800) and download filename; signing is always performed. * @returns A signed GET URL; no object is fetched by this call. * @throws Rejects when the supplied adapter rejects the operation. * @example * ```typescript * import type { StorageAdapter } from '@alneas/appkit-core/storage'; * * export async function example(storage: StorageAdapter) { * return storage.getDownloadUrl?.("reports/note.txt", { expiresIn: 300 }); * } * ``` */ getDownloadUrl?(key: string, options?: StorageURLOptions): Promise<string>;
/** * Deletes an object from storage. * * @param key - Object key (path) * @returns True if deleted successfully, false if the object did not exist * * @example * ```typescript * import type { StorageAdapter } from '@alneas/appkit-core/storage'; * * export async function example(storage: StorageAdapter) { * return storage.delete("reports/note.txt"); * } * ``` */ delete(key: string): Promise<boolean>;
/** * Checks whether an object exists in storage. * * @param key - Object key (path) * @returns True if the object exists * * @example * ```typescript * import type { StorageAdapter } from '@alneas/appkit-core/storage'; * * export async function example(storage: StorageAdapter) { * return storage.exists("reports/note.txt"); * } * ``` */ exists(key: string): Promise<boolean>;
/** * Retrieves object metadata without downloading the content. * * @param key - Object key (path) * @returns Object metadata, or null if not found * * @example * ```typescript * import type { StorageAdapter } from '@alneas/appkit-core/storage'; * * export async function example(storage: StorageAdapter) { * return storage.head("reports/note.txt"); * } * ``` */ head(key: string): Promise<StorageObject | null>;
/** * Lists objects in storage. * * @param options - Provider-specific filters and limits; omitted options use adapter defaults. * @returns Objects, optional prefixes and provider-specific continuation information; see {@link StorageListResult}. * @throws Rejects when the selected adapter rejects the listing request. * @remarks LocalStorageAdapter ignores cursor and never supplies nextCursor. Its * hasMore reports reaching the limit, so it cannot drive a pagination loop. * @example * ```typescript * import type { StorageAdapter } from '@alneas/appkit-core/storage'; * * export async function firstInvoicePage(storage: StorageAdapter) { * return storage.list({ prefix: 'invoices/2026/', limit: 50 }); * } * ``` */ list(options?: StorageListOptions): Promise<StorageListResult>;
/** * Copies an object to a new key. * * @param sourceKey - Source object key * @param destinationKey - Destination object key * @returns Metadata of the copied object * * @example * ```typescript * import type { StorageAdapter } from '@alneas/appkit-core/storage'; * * export async function example(storage: StorageAdapter) { * return storage.copy?.("reports/note.txt", "archive/note.txt"); * } * ``` */ copy?(sourceKey: string, destinationKey: string): Promise<StorageObject>;
/** * Moves an object to a new key (copy + delete). * * @param sourceKey - Source object key * @param destinationKey - Destination object key * @returns Metadata of the moved object * * @example * ```typescript * import type { StorageAdapter } from '@alneas/appkit-core/storage'; * * export async function example(storage: StorageAdapter) { * return storage.move?.("reports/note.txt", "archive/note.txt"); * } * ``` */ move?(sourceKey: string, destinationKey: string): Promise<StorageObject>;}使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { StorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: StorageAdapter) { return storage.upload("notes.txt", "hello", { contentType: "text/plain" });}---
### `INTERFACE` `storage.LocalStorageConfig`
LocalStorageAdapter の設定です。
```typescriptexport interface LocalStorageConfig {
/** Base directory for storage. */ baseDir: string;
/** Base URL for generating public URLs (optional). */ baseUrl?: string;}使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { LocalStorageConfig } from "@alneas/appkit-core/storage";
// The host provides real credentials/endpoint or its application-owned local directory.export function inspectConfig(config: LocalStorageConfig) { return config.baseDir;}---
### `INTERFACE` `storage.R2StorageConfig`
R2StorageAdapter (S3 互換) の設定です。
```typescriptexport interface R2StorageConfig {
/** Signing region for a custom S3-compatible endpoint; defaults to R2 auto. */ region?: string;
/** Cloudflare account ID. */ accountId: string;
/** R2 bucket name. */ bucket: string;
/** Host-supplied credential identifier included in signed remote requests. */ accessKeyId: string;
/** Host-supplied signing secret; keep it outside untrusted client code. */ secretAccessKey: string;
/** Custom endpoint URL (optional, auto-derived from accountId). */ endpoint?: string;
/** Public bucket URL for unsigned access (optional). */ publicUrl?: string;
/** Default expiration time for signed URLs in seconds (default: 3600). */ defaultExpiresIn?: number;}使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { R2StorageConfig } from "@alneas/appkit-core/storage";
// The host provides real credentials/endpoint or its application-owned local directory.export function inspectConfig(config: R2StorageConfig) { return config.bucket;}---
### `INTERFACE` `storage.S3StorageConfig`
S3StorageAdapter の設定です。
Object Lock をサポートする AWS S3 バケットの設定です。法令上のコンプライアンス要件に従った原本書類の保存に使用できます。
```typescriptexport interface S3StorageConfig {
/** AWS region. */ region: string;
/** S3 bucket name. */ bucket: string;
/** Host-supplied credential identifier included in signed remote requests. */ accessKeyId: string;
/** Host-supplied signing secret; keep it outside untrusted client code. */ secretAccessKey: string;
/** Custom endpoint URL (optional, e.g. LocalStack). */ endpoint?: string;
/** Whether Object Lock is enabled (default: false). */ objectLockEnabled?: boolean;
/** Object Lock retention mode (default: COMPLIANCE). */ objectLockMode?: 'GOVERNANCE' | 'COMPLIANCE';
/** Default retention period in days (default: 2555 days = 7 years). */ defaultRetentionDays?: number;
/** Default expiration time for signed URLs in seconds (default: 3600). */ defaultExpiresIn?: number;}使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { S3StorageConfig } from "@alneas/appkit-core/storage";
// The host provides real credentials/endpoint or its application-owned local directory.export function inspectConfig(config: S3StorageConfig) { return config.bucket;}---
### `INTERFACE` `storage.OCIStorageConfig`
OCIStorageAdapter (S3 互換) の設定です。
Object Lock (Retention Rules) をサポートする OCI Object Storage バケットの設定です。法令上のコンプライアンス要件に従った原本書類の保存に使用できます。
```typescriptexport interface OCIStorageConfig {
/** OCI tenancy namespace. */ namespace: string;
/** OCI region (e.g. ap-tokyo-1). */ region: string;
/** Bucket name. */ bucket: string;
/** Host-supplied credential identifier included in signed remote requests. */ accessKeyId: string;
/** Host-supplied signing secret; keep it outside untrusted client code. */ secretAccessKey: string;
/** Custom endpoint URL (optional). */ endpoint?: string;
/** Whether Object Lock is enabled (default: false). */ objectLockEnabled?: boolean;
/** * Object Lock retention mode (default: GOVERNANCE). * - COMPLIANCE: No user (including administrators) can delete objects during retention. Risk of retained data post-cancellation. * - GOVERNANCE: Users with administrative privileges can delete objects. Requires internal administration rules for legal compliance. */ objectLockMode?: 'GOVERNANCE' | 'COMPLIANCE';
/** Default retention period in days (default: 2555 days = 7 years). */ defaultRetentionDays?: number;
/** Default expiration time for signed URLs in seconds (default: 3600). */ defaultExpiresIn?: number;}使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { OCIStorageConfig } from "@alneas/appkit-core/storage";
// The host provides real credentials/endpoint or its application-owned local directory.export function inspectConfig(config: OCIStorageConfig) { return config.bucket;}---
### `FUNCTION` `data.csv.parseCsv`
CSV 文字列を解析するための便利なヘルパー関数です。
```typescriptexport function parseCsv(csvContent: string, config?: CSVParseConfig): string[][]引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
csvContent |
string |
必須 | |
config |
CSVParseConfig | undefined |
任意 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string[][]
INTERFACE data.csv.CSVParseConfig
Section titled “INTERFACE data.csv.CSVParseConfig”CSV 解析の設定オプション
export interface CSVParseConfig { /** Delimiter character (default: ,) */ delimiter: string; /** Quotation character (default: ") */ quoteChar: string; /** Escape character (default: ") */ escapeChar: string; /** Whether the CSV includes a header row (for compatibility, header row is still included in result even if true) */ hasHeader: boolean; /** Whether to skip empty lines */ skipEmptyLines: boolean; /** Whether to trim leading and trailing whitespace from values */ trimWhitespace: boolean;}CONST data.csv.DEFAULT_CSV_PARSE_CONFIG
Section titled “CONST data.csv.DEFAULT_CSV_PARSE_CONFIG”エクスポートされるシンボル data.csv.DEFAULT_CSV_PARSE_CONFIG
export const data.csv.DEFAULT_CSV_PARSE_CONFIG: CSVParseConfigCLASS data.csv.CSVParser
Section titled “CLASS data.csv.CSVParser”CSV データを解析するクラスです。 RFC 4180 に準拠した解析(引用符とエスケープの処理)をサポートします。
class data.csv.CSVParserINTERFACE data.csv.CSVConfig
Section titled “INTERFACE data.csv.CSVConfig”CSV 生成の設定です。システム間のデータ交換用に元の値を保持するか、スプレッドシート用に escapeFormulae を有効にします。
export interface CSVConfig { /** Delimiter character (default: ,) */ delimiter: string; /** Quotation character (1 character, default: ") */ quoteChar: string; /** Character used to escape quote characters (1 character, default: ") */ escapeChar: string; /** Whether to include the header row in output */ includeHeader: boolean; /** 'never' throws an exception on values that require quoting. Quoting for formula safety takes precedence. */ stringWrapping: 'auto' | 'always' | 'never'; /** Prepends an apostrophe to formula-like strings (including headers). Defaults to false. Modifies the raw value. */ escapeFormulae?: boolean; /** Locale for Date cells; undefined uses the host locale. */ dateLocale?: string; /** Intl date options, including an explicit timezone when reproducibility matters. */ dateOptions?: Intl.DateTimeFormatOptions; /** Overrides Date cell formatting (e.g. ISO strings for machine interchange). */ dateFormatter?: (value: Date) => string;}CONST data.csv.DEFAULT_CSV_CONFIG
Section titled “CONST data.csv.DEFAULT_CSV_CONFIG”エクスポートされるシンボル data.csv.DEFAULT_CSV_CONFIG
export const data.csv.DEFAULT_CSV_CONFIG: CSVConfigINTERFACE data.csv.ColumnMapping
Section titled “INTERFACE data.csv.ColumnMapping”インターフェース data.csv.ColumnMapping
export interface ColumnMapping { columnId: string; columnLabel: string; include: boolean; order: number; customLabel?: string;}CLASS data.csv.CSVGenerator
Section titled “CLASS data.csv.CSVGenerator”列を選択し、並び順と日付書式を適用して、Papa Parse で CSV にシリアライズします。 負の数値を数値として保持しながら、数式のような文字列に対する保護を行います。
class data.csv.CSVGeneratorFUNCTION data.encoding.escapeHtml
Section titled “FUNCTION data.encoding.escapeHtml”HTML のテキストまたは属性のコンテキストに挿入する前に、テキストをエスケープします。
export function escapeHtml(value: unknown): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
value |
unknown |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string
FUNCTION data.encoding.sha256Hex
Section titled “FUNCTION data.encoding.sha256Hex”SHA-256 の16進数文字列を同期的に計算します。
export function sha256Hex(data: Uint8Array | ArrayBuffer | string): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
data |
string | ArrayBuffer | Uint8Array<ArrayBufferLike> |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string
FUNCTION data.encoding.hmacSha256
Section titled “FUNCTION data.encoding.hmacSha256”純粋な実装による HMAC-SHA256 署名を同期的に計算します。
export function hmacSha256( key: Uint8Array | ArrayBuffer | string, data: Uint8Array | ArrayBuffer | string,): Uint8Array引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string | ArrayBuffer | Uint8Array<ArrayBufferLike> |
必須 | |
data |
string | ArrayBuffer | Uint8Array<ArrayBufferLike> |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Uint8Array<ArrayBufferLike>
FUNCTION data.encoding.hmacSha256Hex
Section titled “FUNCTION data.encoding.hmacSha256Hex”HMAC-SHA256 署名を同期的に計算し、16進数文字列を返します。
export function hmacSha256Hex( key: Uint8Array | ArrayBuffer | string, data: Uint8Array | ArrayBuffer | string,): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string | ArrayBuffer | Uint8Array<ArrayBufferLike> |
必須 | |
data |
string | ArrayBuffer | Uint8Array<ArrayBufferLike> |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string
CONST data.encoding.sha256HexSync
Section titled “CONST data.encoding.sha256HexSync”エクスポートされるシンボル data.encoding.sha256HexSync
export const data.encoding.sha256HexSync: typeof sha256HexTYPE data.pdf.GenericRecord
Section titled “TYPE data.pdf.GenericRecord”汎用レコード型
export type GenericRecord = Record<string, unknown>;INTERFACE data.pdf.DocumentPartyInfo
Section titled “INTERFACE data.pdf.DocumentPartyInfo”取引当事者情報(顧客と仕入先で共通)
export interface DocumentPartyInfo { companyName: string; contactPerson?: string; address: string; zip?: string; tel?: string; fax?: string; email?: string;}INTERFACE data.pdf.DocumentLineItem
Section titled “INTERFACE data.pdf.DocumentLineItem”汎用明細項目
export interface DocumentLineItem { name: string; code?: string; specification?: string; quantity: number; unitCode: string; unitPrice: number; amount: number; remarks?: string;}INTERFACE data.pdf.BankAccountInfo
Section titled “INTERFACE data.pdf.BankAccountInfo”銀行口座情報
export interface BankAccountInfo { bankName: string; branchName: string; accountType: string; accountNumber: string; accountHolder: string;}INTERFACE data.pdf.DocumentTableColumn
Section titled “INTERFACE data.pdf.DocumentTableColumn”テーブルの列定義
export interface DocumentTableColumn { key: string; header: string; width: number | 'auto' | '*'; alignment?: 'left' | 'center' | 'right';}INTERFACE data.pdf.BusinessDocumentTemplate
Section titled “INTERFACE data.pdf.BusinessDocumentTemplate”テンプレート定義
export interface BusinessDocumentTemplate { documentType: 'quote' | 'invoice' | 'creditNote' | 'order' | 'delivery' | 'orderConfirmation'; title: string; leadText: string; documentNoLabel: string; dateLabel: string; dateValueKey: string; dueLabel?: string; dueValueKey?: string; partyRole: 'client' | 'supplier'; showStaffSeal?: boolean; showApproverSeal?: boolean; largeTotalLabel?: string; summaryFields?: Array<{ label: string; valueKey: string; formatterType?: 'date' | 'string' | 'paymentTerms' | 'expirationDate'; }>; useLegacyInvoiceSummaryTable?: boolean; tableConfig: { columns?: DocumentTableColumn[]; itemLabel: string; includeCodeInItem?: boolean; remarksHeader?: string; useLegacyInvoiceTableFormat?: boolean; }; bankAccountsKey?: string; showPaymentMethod?: boolean; footerNote?: string; showFooterText?: string;}INTERFACE data.pdf.BusinessDocumentConfig
Section titled “INTERFACE data.pdf.BusinessDocumentConfig”文書生成の設定 (DI)
export interface BusinessDocumentConfig { companyInfo: DocumentPartyInfo & { logo?: string }; taxRate?: number; currencyFormatter?: (amount: number) => string; dateFormatter?: (date: string, isKanji?: boolean) => string; defaultBankAccounts?: BankAccountInfo[]; sealGenerator?: (name: string) => string | null; styling?: { primaryColor?: string; pageMargins?: [number, number, number, number]; };}INTERFACE data.pdf.EdiStampData
Section titled “INTERFACE data.pdf.EdiStampData”文書データ(動的フィールドを許可)
export interface EdiStampData { label: string; name?: string;}INTERFACE data.pdf.BusinessDocumentData
Section titled “INTERFACE data.pdf.BusinessDocumentData”インターフェース data.pdf.BusinessDocumentData
export interface BusinessDocumentData extends GenericRecord { items: DocumentLineItem[]; client?: DocumentPartyInfo; supplier?: DocumentPartyInfo; bankAccount?: BankAccountInfo[]; paymentMethod?: string; remarks?: string; remark?: string; workDetail?: string; userName?: string; secondarySeal?: string; /** Stamp list (name and role). Takes precedence over showStaffSeal/showApproverSeal */ stamps?: EdiStampData[];}FUNCTION data.pdf.mergePdfTheme
Section titled “FUNCTION data.pdf.mergePdfTheme”デフォルトのテーマに、部分的なカスタムテーマ設定をマージします。
export function mergePdfTheme(customTheme?: PartialPdfTheme): PdfTheme引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
customTheme |
PartialPdfTheme | undefined |
任意 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
PdfTheme
INTERFACE data.pdf.PdfTheme
Section titled “INTERFACE data.pdf.PdfTheme”PDF 業務文書のテーマ定義
export interface PdfTheme { primaryColor: string; secondaryColor: string; accentColor: string; borderColor: string; backgroundColor: string; tableHeaderBg: string; tableRowAltBg: string; textColor: string; mutedTextColor: string; fontFamily: string; fontSize: { xs: number; sm: number; base: number; md: number; lg: number; xl: number; title: number; }; spacing: { pagePadding: number; sectionGap: number; itemGap: number; };}CONST data.pdf.defaultPdfTheme
Section titled “CONST data.pdf.defaultPdfTheme”エクスポートされるシンボル data.pdf.defaultPdfTheme
export const data.pdf.defaultPdfTheme: PdfThemeTYPE data.pdf.PartialPdfTheme
Section titled “TYPE data.pdf.PartialPdfTheme”型 data.pdf.PartialPdfTheme
export type PartialPdfTheme = Partial<Omit<PdfTheme, 'fontSize' | 'spacing'>> & { fontSize?: Partial<PdfTheme['fontSize']>; spacing?: Partial<PdfTheme['spacing']>;};INTERFACE data.edi.InvoiceData
Section titled “INTERFACE data.edi.InvoiceData”レンダラーに依存しない従来形式の EDI 変換結果です。PDF 出力には EdiPdfService を使用してください。
export interface InvoiceData { invoiceNumber: string; date: string; dueDate: string; seller: { name: string; address: string; email: string }; buyer: { name: string; address: string; email: string }; items: { description: string; quantity: number; price: number }[];}INTERFACE data.edi.QuoteData
Section titled “INTERFACE data.edi.QuoteData”レンダラーに依存しない従来形式の EDI 見積結果です。QuotePdfDocument の props ではありません。
export interface QuoteData { quoteNumber: string; quoteDate: string; quoteExpiryMonths: number; subject: string; place: string; constructionPeriod: string; paymentTerms: string; workDetail: string; remark?: string; client: { name: string; honorific?: string }; issuer: { companyName: string; address: string; tel: string; fax?: string; representative?: string; department?: string; inChargeName?: string; inChargeTel?: string; }; items: QuoteItem[]; adjustments?: { title: string; amount: number }[]; taxRate?: number;}INTERFACE data.edi.QuoteItem
Section titled “INTERFACE data.edi.QuoteItem”インターフェース data.edi.QuoteItem
export interface QuoteItem { description: string; unitPrice: number; quantity: number; unit: string;}TYPE data.edi.EdiDocType
Section titled “TYPE data.edi.EdiDocType”型 data.edi.EdiDocType
export type EdiDocType = | 'Invoice' | 'CreditNote' | 'PurchaseOrder' | 'DespatchAdvice' | 'RemittanceAdvice' | 'Quotation';TYPE data.edi.EdiDocTypeCode
Section titled “TYPE data.edi.EdiDocTypeCode”型 data.edi.EdiDocTypeCode
export type EdiDocTypeCode = '380' | '381' | '384' | '389' | null;TYPE data.edi.VatexCategoryId
Section titled “TYPE data.edi.VatexCategoryId”型 data.edi.VatexCategoryId
export type VatexCategoryId = 'S' | 'AA' | 'E' | 'G' | 'O';INTERFACE data.edi.EdiIdentifier
Section titled “INTERFACE data.edi.EdiIdentifier”インターフェース data.edi.EdiIdentifier
export interface EdiIdentifier { scheme: string; value: string;}INTERFACE data.edi.EdiAmount
Section titled “INTERFACE data.edi.EdiAmount”インターフェース data.edi.EdiAmount
export interface EdiAmount { value: number; currency: string;}INTERFACE data.edi.EdiAddress
Section titled “INTERFACE data.edi.EdiAddress”インターフェース data.edi.EdiAddress
export interface EdiAddress { country: string; subdivision?: string; city?: string; street_name?: string; postal_zone?: string;}INTERFACE data.edi.EdiParty
Section titled “INTERFACE data.edi.EdiParty”インターフェース data.edi.EdiParty
export interface EdiParty { id: EdiIdentifier; name: string; tax_id?: EdiIdentifier; legal_registration?: EdiIdentifier; endpoint_id?: EdiIdentifier; address?: EdiAddress;}INTERFACE data.edi.EdiTaxCategory
Section titled “INTERFACE data.edi.EdiTaxCategory”インターフェース data.edi.EdiTaxCategory
export interface EdiTaxCategory { id: VatexCategoryId; percent: number; tax_scheme: string;}INTERFACE data.edi.EdiTaxSubtotal
Section titled “INTERFACE data.edi.EdiTaxSubtotal”インターフェース data.edi.EdiTaxSubtotal
export interface EdiTaxSubtotal { taxable_amount: EdiAmount; tax_amount: EdiAmount; tax_category: EdiTaxCategory;}INTERFACE data.edi.EdiTaxTotal
Section titled “INTERFACE data.edi.EdiTaxTotal”インターフェース data.edi.EdiTaxTotal
export interface EdiTaxTotal { tax_amount: EdiAmount; tax_subtotals: EdiTaxSubtotal[];}INTERFACE data.edi.EdiFinancials
Section titled “INTERFACE data.edi.EdiFinancials”インターフェース data.edi.EdiFinancials
export interface EdiFinancials { tax_total: EdiTaxTotal; tax_inclusive_amount: EdiAmount; payable_amount: EdiAmount; prepaid_amount?: EdiAmount;}INTERFACE data.edi.EdiLine
Section titled “INTERFACE data.edi.EdiLine”インターフェース data.edi.EdiLine
export interface EdiLine { line_id: string; product_code?: string; description: string; quantity: number; unit_code: string; unit_price: number; net_amount: number; po_line_ref?: string; tax_category?: EdiTaxCategory;}INTERFACE data.edi.EdiAllowanceCharge
Section titled “INTERFACE data.edi.EdiAllowanceCharge”インターフェース data.edi.EdiAllowanceCharge
export interface EdiAllowanceCharge { indicator: boolean; reason_code?: string; reason?: string; amount: EdiAmount;}INTERFACE data.edi.EdiReference
Section titled “INTERFACE data.edi.EdiReference”インターフェース data.edi.EdiReference
export interface EdiReference { id: string; date?: string;}INTERFACE data.edi.EdiReferences
Section titled “INTERFACE data.edi.EdiReferences”インターフェース data.edi.EdiReferences
export interface EdiReferences { order_reference?: string; despatch_document_reference?: string; billing_reference?: EdiReference; quotation_reference?: string;}INTERFACE data.edi.EdiPayment
Section titled “INTERFACE data.edi.EdiPayment”インターフェース data.edi.EdiPayment
export interface EdiPayment { means_code?: string; payment_id?: string; due_date?: string; bank_accounts?: EdiBankAccount[];}INTERFACE data.edi.EdiBankAccount
Section titled “INTERFACE data.edi.EdiBankAccount”インターフェース data.edi.EdiBankAccount
export interface EdiBankAccount { bank_name: string; branch_name: string; account_type: string; account_number: string; account_holder: string;}INTERFACE data.edi.EdiAllocation
Section titled “INTERFACE data.edi.EdiAllocation”インターフェース data.edi.EdiAllocation
export interface EdiAllocation { invoice: { id: string }; allocated_amount: EdiAmount;}INTERFACE data.edi.EdiShipment
Section titled “INTERFACE data.edi.EdiShipment”インターフェース data.edi.EdiShipment
export interface EdiShipment { packages?: EdiPackage[];}INTERFACE data.edi.EdiPackage
Section titled “INTERFACE data.edi.EdiPackage”インターフェース data.edi.EdiPackage
export interface EdiPackage { id: string; level?: string; sscc?: string; gross_weight_kg?: number; children?: EdiPackage[];}INTERFACE data.edi.EdiExtensionEnvelope
Section titled “INTERFACE data.edi.EdiExtensionEnvelope”インターフェース data.edi.EdiExtensionEnvelope
export interface EdiExtensionEnvelope { namespace: string; extension_id: string; version: string; data: Record<string, unknown>;}INTERFACE data.edi.EdiStamp
Section titled “INTERFACE data.edi.EdiStamp”インターフェース data.edi.EdiStamp
export interface EdiStamp { label: string; name?: string; sealImageDataUrl?: string;}INTERFACE data.edi.EdiDocumentCommon
Section titled “INTERFACE data.edi.EdiDocumentCommon”インターフェース data.edi.EdiDocumentCommon
export interface EdiDocumentCommon { customization_id?: string; profile_id?: string; schema_version: string; profile?: string; doc_type: EdiDocType; doc_type_code: EdiDocTypeCode; id: string; issue_date: string; currency: string; note?: string; tax_point_date?: string; buyer_reference?: string; extensions?: EdiExtensionEnvelope[]; /** Stamp list (name and role). Non-standard Peppol extension, used for PDF rendering. */ stamps?: EdiStamp[];}INTERFACE data.edi.EdiDocumentParties
Section titled “INTERFACE data.edi.EdiDocumentParties”インターフェース data.edi.EdiDocumentParties
export interface EdiDocumentParties { supplier: EdiParty; buyer: EdiParty;}INTERFACE data.edi.EdiDocumentLines
Section titled “INTERFACE data.edi.EdiDocumentLines”インターフェース data.edi.EdiDocumentLines
export interface EdiDocumentLines { lines: EdiLine[];}INTERFACE data.edi.EdiInvoiceData
Section titled “INTERFACE data.edi.EdiInvoiceData”インターフェース data.edi.EdiInvoiceData
export interface EdiInvoiceData extends EdiDocumentCommon, EdiDocumentParties, EdiDocumentLines { doc_type: 'Invoice'; doc_type_code: '380' | '384' | '389'; references?: EdiReferences; allowances_charges?: EdiAllowanceCharge[]; financials: EdiFinancials; payment?: EdiPayment; shipment?: EdiShipment;}INTERFACE data.edi.EdiCreditNoteData
Section titled “INTERFACE data.edi.EdiCreditNoteData”インターフェース data.edi.EdiCreditNoteData
export interface EdiCreditNoteData extends EdiDocumentCommon, EdiDocumentParties, EdiDocumentLines { doc_type: 'CreditNote'; doc_type_code: '381'; references: EdiReferences & { billing_reference: EdiReference }; allowances_charges?: EdiAllowanceCharge[]; financials: EdiFinancials; payment?: EdiPayment;}INTERFACE data.edi.EdiPurchaseOrderData
Section titled “INTERFACE data.edi.EdiPurchaseOrderData”インターフェース data.edi.EdiPurchaseOrderData
export interface EdiPurchaseOrderData extends EdiDocumentCommon, EdiDocumentParties, EdiDocumentLines { doc_type: 'PurchaseOrder'; doc_type_code: null; references?: EdiReferences; allowances_charges?: EdiAllowanceCharge[]; financials?: EdiFinancials; shipment?: EdiShipment; quotation_reference?: string;}INTERFACE data.edi.EdiDespatchAdviceData
Section titled “INTERFACE data.edi.EdiDespatchAdviceData”インターフェース data.edi.EdiDespatchAdviceData
export interface EdiDespatchAdviceData extends EdiDocumentCommon, EdiDocumentParties, EdiDocumentLines { doc_type: 'DespatchAdvice'; doc_type_code: null; references: EdiReferences & { order_reference: string }; shipment?: EdiShipment;}INTERFACE data.edi.EdiRemittanceAdviceData
Section titled “INTERFACE data.edi.EdiRemittanceAdviceData”インターフェース data.edi.EdiRemittanceAdviceData
export interface EdiRemittanceAdviceData extends EdiDocumentCommon, EdiDocumentParties { doc_type: 'RemittanceAdvice'; doc_type_code: null; allocations: EdiAllocation[]; payment: EdiPayment; financials?: { paid_amount: EdiAmount; difference_amount?: EdiAmount; };}INTERFACE data.edi.EdiQuotationData
Section titled “INTERFACE data.edi.EdiQuotationData”インターフェース data.edi.EdiQuotationData
export interface EdiQuotationData extends EdiDocumentCommon, EdiDocumentParties, EdiDocumentLines { doc_type: 'Quotation'; doc_type_code: null; references?: EdiReferences; allowances_charges?: EdiAllowanceCharge[]; financials?: EdiFinancials; valid_from?: string; valid_until?: string;}TYPE data.edi.EdiDocument
Section titled “TYPE data.edi.EdiDocument”型 data.edi.EdiDocument
export type EdiDocument = | EdiInvoiceData | EdiCreditNoteData | EdiPurchaseOrderData | EdiDespatchAdviceData | EdiRemittanceAdviceData | EdiQuotationData;CONST data.edi.DOC_TYPE_CODES
Section titled “CONST data.edi.DOC_TYPE_CODES”EDI 文書種別コードの定数マップです。 Invoice / CreditNote の UNCL1001 コードを保持します。
export const data.edi.DOC_TYPE_CODES: Record<string, EdiDocTypeCode>FUNCTION data.edi.createAmount
Section titled “FUNCTION data.edi.createAmount”明示的に選択された通貨で金額を作成します。
export function createAmount(value: number, currency: string): EdiAmount引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
value |
number |
必須 | |
currency |
string |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
EdiAmount
FUNCTION data.edi.createIdentifier
Section titled “FUNCTION data.edi.createIdentifier”呼び出し元が選択した識別体系と値で、取引当事者の識別子を作成します。
export function createIdentifier(scheme: string, value: string): EdiIdentifier引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
scheme |
string |
必須 | |
value |
string |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
EdiIdentifier
FUNCTION data.edi.createTaxCategory
Section titled “FUNCTION data.edi.createTaxCategory”id、percent、scheme を持つ VATEX 税区分を作成します。
export function createTaxCategory( id: 'S' | 'AA' | 'E' | 'G' | 'O', percent: number, taxScheme = 'VAT',): EdiTaxCategory引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
id |
"S" | "AA" | "E" | "G" | "O" |
必須 | |
percent |
number |
必須 | |
taxScheme |
string |
任意 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
EdiTaxCategory
FUNCTION data.edi.createTaxSubtotal
Section titled “FUNCTION data.edi.createTaxSubtotal”課税対象額、税額、税区分を持つ Peppol TaxSubtotal を作成します。
export function createTaxSubtotal( taxableAmount: number, taxAmount: number, category: EdiTaxCategory, currency: string,): EdiTaxSubtotal引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
taxableAmount |
number |
必須 | |
taxAmount |
number |
必須 | |
category |
EdiTaxCategory |
必須 | |
currency |
string |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
EdiTaxSubtotal
FUNCTION data.edi.createFinancials
Section titled “FUNCTION data.edi.createFinancials”税額小計から EdiFinancials を作成し、合計を自動計算します。
export function createFinancials( subtotals: EdiTaxSubtotal[], prepaid = 0, currency: string,): EdiFinancials引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
subtotals |
EdiTaxSubtotal[] |
必須 | |
prepaid |
number |
任意 | |
currency |
string |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
EdiFinancials
FUNCTION data.edi.createLine
Section titled “FUNCTION data.edi.createLine”文書の明細項目を作成します。netAmount を指定しない場合、デフォルト値は quantity * unitPrice です。
export function createLine( lineId: string, description: string, quantity: number, unitCode: string, unitPrice: number, options?: { productCode?: string; netAmount?: number; poLineRef?: string; taxCategory?: EdiTaxCategory; },): EdiLine引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
lineId |
string |
必須 | |
description |
string |
必須 | |
quantity |
number |
必須 | |
unitCode |
string |
必須 | |
unitPrice |
number |
必須 | |
options |
{ productCode?: string; netAmount?: number; poLineRef?: string; taxCategory?: EdiTaxCategory; } | undefined |
任意 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
EdiLine
FUNCTION data.edi.createParty
Section titled “FUNCTION data.edi.createParty”Peppol ICD 識別子と任意の住所を持つ取引当事者を作成します。
export function createParty( id: EdiIdentifier, name: string, options?: { taxId?: EdiIdentifier; legalRegistration?: EdiIdentifier; endpointId?: EdiIdentifier; address?: EdiAddress; },): EdiParty引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
id |
EdiIdentifier |
必須 | |
name |
string |
必須 | |
options |
{ taxId?: EdiIdentifier; legalRegistration?: EdiIdentifier; endpointId?: EdiIdentifier; address?: EdiAddress; } | undefined |
任意 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
EdiParty
FUNCTION data.edi.createExtension
Section titled “FUNCTION data.edi.createExtension”extensions[] 配列用の拡張エンベロープを作成します。
export function createExtension( namespace: string, extensionId: string, version: string, data: Record<string, unknown>,): EdiExtensionEnvelope引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
namespace |
string |
必須 | |
extensionId |
string |
必須 | |
version |
string |
必須 | |
data |
Record<string, unknown> |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
EdiExtensionEnvelope
FUNCTION data.edi.createInvoice
Section titled “FUNCTION data.edi.createInvoice”明示的な通貨とプロファイルのコンテキストを使用して Invoice を作成します(doc_type_code のデフォルト値は 380 です)。
export function createInvoice( id: string, issueDate: string, supplier: EdiParty, buyer: EdiParty, lines: EdiLine[], financials: EdiFinancials, options: EdiDocumentContext & { docTypeCode?: '380' | '384' | '389'; references?: EdiInvoiceData['references']; allowancesCharges?: EdiInvoiceData['allowances_charges']; payment?: EdiPayment; note?: string; extensions?: EdiExtensionEnvelope[]; },): EdiInvoiceData引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
id |
string |
必須 | |
issueDate |
string |
必須 | |
supplier |
EdiParty |
必須 | |
buyer |
EdiParty |
必須 | |
lines |
EdiLine[] |
必須 | |
financials |
EdiFinancials |
必須 | |
options |
EdiDocumentContext & { docTypeCode?: "380" | "384" | "389"; references?: EdiInvoiceData["references"]; allowancesCharges?: EdiInvoiceData["allowances_charges"]; payment?: EdiPayment; note?: string; extensions?: EdiExtensionEnvelope[]; } |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
EdiInvoiceData
FUNCTION data.edi.createCreditNote
Section titled “FUNCTION data.edi.createCreditNote”元の請求書を参照する必須の billing_reference を持つ CreditNote を作成します。
export function createCreditNote( id: string, issueDate: string, supplier: EdiParty, buyer: EdiParty, lines: EdiLine[], financials: EdiFinancials, billingReference: EdiReference, options: EdiDocumentContext & { references?: Omit<EdiCreditNoteData['references'], 'billing_reference'>; allowancesCharges?: EdiCreditNoteData['allowances_charges']; payment?: EdiPayment; note?: string; extensions?: EdiExtensionEnvelope[]; },): EdiCreditNoteData引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
id |
string |
必須 | |
issueDate |
string |
必須 | |
supplier |
EdiParty |
必須 | |
buyer |
EdiParty |
必須 | |
lines |
EdiLine[] |
必須 | |
financials |
EdiFinancials |
必須 | |
billingReference |
EdiReference |
必須 | |
options |
EdiDocumentContext & { references?: Omit<EdiCreditNoteData["references"], "billing_reference">; allowancesCharges?: EdiCreditNoteData["allowances_charges"]; payment?: EdiPayment; note?: string; extensions?: EdiExtensionEnvelope[]; } |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
EdiCreditNoteData
FUNCTION data.edi.createPurchaseOrder
Section titled “FUNCTION data.edi.createPurchaseOrder”PurchaseOrder 文書を作成します。
export function createPurchaseOrder( id: string, issueDate: string, supplier: EdiParty, buyer: EdiParty, lines: EdiLine[], options: EdiDocumentContext & { references?: EdiPurchaseOrderData['references']; financials?: EdiFinancials; shipment?: EdiPurchaseOrderData['shipment']; note?: string; extensions?: EdiExtensionEnvelope[]; },): EdiPurchaseOrderData引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
id |
string |
必須 | |
issueDate |
string |
必須 | |
supplier |
EdiParty |
必須 | |
buyer |
EdiParty |
必須 | |
lines |
EdiLine[] |
必須 | |
options |
EdiDocumentContext & { references?: EdiPurchaseOrderData["references"]; financials?: EdiFinancials; shipment?: EdiPurchaseOrderData["shipment"]; note?: string; extensions?: EdiExtensionEnvelope[]; } |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
EdiPurchaseOrderData
FUNCTION data.edi.createQuotation
Section titled “FUNCTION data.edi.createQuotation”任意の有効期間を持つ Quotation 文書を作成します。
export function createQuotation( id: string, issueDate: string, supplier: EdiParty, buyer: EdiParty, lines: EdiLine[], options: EdiDocumentContext & { validFrom?: string; validUntil?: string; references?: EdiQuotationData['references']; financials?: EdiFinancials; allowancesCharges?: EdiQuotationData['allowances_charges']; note?: string; extensions?: EdiExtensionEnvelope[]; },): EdiQuotationData引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
id |
string |
必須 | |
issueDate |
string |
必須 | |
supplier |
EdiParty |
必須 | |
buyer |
EdiParty |
必須 | |
lines |
EdiLine[] |
必須 | |
options |
EdiDocumentContext & { validFrom?: string; validUntil?: string; references?: EdiQuotationData["references"]; financials?: EdiFinancials; allowancesCharges?: EdiQuotationData["allowances_charges"]; note?: string; extensions?: EdiExtensionEnvelope[]; } |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
EdiQuotationData
FUNCTION data.edi.createDespatchAdvice
Section titled “FUNCTION data.edi.createDespatchAdvice”PurchaseOrder に関連付けられた DespatchAdvice(納品書)を作成します。
export function createDespatchAdvice( id: string, issueDate: string, supplier: EdiParty, buyer: EdiParty, lines: EdiLine[], orderReference: string, options: EdiDocumentContext & { shipment?: EdiDespatchAdviceData['shipment']; note?: string; extensions?: EdiExtensionEnvelope[]; },): EdiDespatchAdviceData引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
id |
string |
必須 | |
issueDate |
string |
必須 | |
supplier |
EdiParty |
必須 | |
buyer |
EdiParty |
必須 | |
lines |
EdiLine[] |
必須 | |
orderReference |
string |
必須 | |
options |
EdiDocumentContext & { shipment?: EdiDespatchAdviceData["shipment"]; note?: string; extensions?: EdiExtensionEnvelope[]; } |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
EdiDespatchAdviceData
FUNCTION data.edi.createRemittanceAdvice
Section titled “FUNCTION data.edi.createRemittanceAdvice”請求書への充当情報を持つ RemittanceAdvice(支払充当通知)を作成します。
export function createRemittanceAdvice( id: string, issueDate: string, supplier: EdiParty, buyer: EdiParty, allocations: EdiAllocation[], payment: EdiPayment, options: EdiDocumentContext & { financials?: EdiRemittanceAdviceData['financials']; note?: string; extensions?: EdiExtensionEnvelope[]; },): EdiRemittanceAdviceData引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
id |
string |
必須 | |
issueDate |
string |
必須 | |
supplier |
EdiParty |
必須 | |
buyer |
EdiParty |
必須 | |
allocations |
EdiAllocation[] |
必須 | |
payment |
EdiPayment |
必須 | |
options |
EdiDocumentContext & { financials?: EdiRemittanceAdviceData["financials"]; note?: string; extensions?: EdiExtensionEnvelope[]; } |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
EdiRemittanceAdviceData
INTERFACE data.edi.EdiDocumentContext
Section titled “INTERFACE data.edi.EdiDocumentContext”呼び出し元が選択する EDI コンテキストです。地域別プロファイルや通貨の推論は行いません。
export interface EdiDocumentContext { currency: string; schemaVersion?: string; customizationId?: string; profileId?: string; profile?: string;}FUNCTION data.edi.toUblXml
Section titled “FUNCTION data.edi.toUblXml”表現されている UBL 2.1 の Invoice、CreditNote、Order、DespatchAdvice のフィールドをシリアライズします。 すべてのテキストと属性をエスケープします。出荷明細には poLineRef の明示的な指定が必要です。 金額の通貨は文書の通貨と一致している必要があります。これは JP PINT 認証ではなく、 UBL のすべての任意フィールドを完全にマッピングするものでもありません。対象プロファイルは別途検証してください。
export function toUblXml(doc: EdiDocument): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
doc |
EdiDocument |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string
FUNCTION data.edi.mapToUbl
Section titled “FUNCTION data.edi.mapToUbl”EDI 文書を、XML シリアライズ用のフラットな UBL フィールド構造にマッピングします。
export function mapToUbl(doc: EdiDocument): UblFieldMap引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
doc |
EdiDocument |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
UblFieldMap
FUNCTION data.edi.ublDocTypeFor
Section titled “FUNCTION data.edi.ublDocTypeFor”EDI の doc_type を UBL 文書種別にマッピングします。
export function ublDocTypeFor(docType: string): UblDocumentType引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
docType |
string |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
UblDocumentType
FUNCTION data.edi.ublNamespaceFor
Section titled “FUNCTION data.edi.ublNamespaceFor”指定された文書種別の UBL 名前空間 URI を取得します。
export function ublNamespaceFor(docType: UblDocumentType): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
docType |
UblDocumentType |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string
CONST data.edi.UBL_NAMESPACES
Section titled “CONST data.edi.UBL_NAMESPACES”エクスポートされるシンボル data.edi.UBL_NAMESPACES
export const data.edi.UBL_NAMESPACES: { readonly CBC: "urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"; readonly CAC: "urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"; readonly INVOICE: "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"; readonly CREDIT_NOTE: "urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2"; readonly ORDER: "urn:oasis:names:specification:ubl:schema:xsd:Order-2"; readonly DESPATCH_ADVICE: "urn:oasis:names:specification:ubl:schema:xsd:DespatchAdvice-2"; readonly XSI: "http://www.w3.org/2001/XMLSchema-instance"; }INTERFACE data.edi.UblFieldMap
Section titled “INTERFACE data.edi.UblFieldMap”EDI 文書を UBL XML に変換するための中間的なフラット構造です。 この構造は、中間表現として XML シリアライザーに渡されます。
export interface UblFieldMap { documentType: string; documentTypeCode: string | null; id: string; issueDate: string; note?: string; taxPointDate?: string; orderReference?: string; despatchDocumentReference?: string; billingReferenceId?: string; billingReferenceDate?: string; currency: string; supplier: UblPartyMap; buyer: UblPartyMap; lines: UblLineMap[]; taxSubtotals: UblTaxSubtotalMap[]; taxTotalAmount: number; taxInclusiveAmount: number; payableAmount: number; prepaidAmount?: number; allowancesCharges: UblAllowanceChargeMap[]; paymentMeansCode?: string; paymentId?: string;}INTERFACE data.edi.UblPartyMap
Section titled “INTERFACE data.edi.UblPartyMap”インターフェース data.edi.UblPartyMap
export interface UblPartyMap { endpointId?: string; endpointScheme?: string; id?: string; idScheme?: string; name: string; taxId?: string; taxIdScheme?: string; legalRegistrationId?: string; legalRegistrationScheme?: string; addressCountry?: string; addressSubdivision?: string; addressCity?: string; addressStreet?: string; addressPostalZone?: string;}INTERFACE data.edi.UblLineMap
Section titled “INTERFACE data.edi.UblLineMap”インターフェース data.edi.UblLineMap
export interface UblLineMap { id: string; productCode?: string; description: string; quantity: number; unitCode: string; unitPrice: number; netAmount: number; poLineRef?: string; taxCategoryId?: string; taxPercent?: number; taxScheme?: string;}INTERFACE data.edi.UblTaxSubtotalMap
Section titled “INTERFACE data.edi.UblTaxSubtotalMap”インターフェース data.edi.UblTaxSubtotalMap
export interface UblTaxSubtotalMap { taxableAmount: number; taxAmount: number; taxCategoryId: string; taxPercent: number; taxScheme: string;}INTERFACE data.edi.UblAllowanceChargeMap
Section titled “INTERFACE data.edi.UblAllowanceChargeMap”インターフェース data.edi.UblAllowanceChargeMap
export interface UblAllowanceChargeMap { indicator: boolean; reasonCode?: string; reason?: string; amount: number; currency: string;}TYPE data.edi.UblDocumentType
Section titled “TYPE data.edi.UblDocumentType”型 data.edi.UblDocumentType
export type UblDocumentType = | 'Invoice' | 'CreditNote' | 'Order' | 'DespatchAdvice';INTERFACE data.googleCalendar.EventDateTime
Section titled “INTERFACE data.googleCalendar.EventDateTime”Google Calendar 連携の型
Google Calendar API v3 のイベント形式を基に、独自の拡張を加えています。
export interface EventDateTime { /** ISO 8601 datetime for timed events (e.g., "2024-12-26T09:00:00+09:00") */ dateTime?: string; /** Date string for all-day events (e.g., "2024-12-26") */ date?: string; /** IANA timezone (e.g., "Asia/Tokyo") */ timeZone?: string;}INTERFACE data.googleCalendar.EventAttendee
Section titled “INTERFACE data.googleCalendar.EventAttendee”イベント参加者の情報
export interface EventAttendee { email: string; displayName?: string; responseStatus?: 'needsAction' | 'declined' | 'tentative' | 'accepted'; organizer?: boolean; self?: boolean; optional?: boolean;}INTERFACE data.googleCalendar.EventReminder
Section titled “INTERFACE data.googleCalendar.EventReminder”イベントのリマインダー設定
export interface EventReminder { useDefault: boolean; overrides?: { method: 'email' | 'popup'; minutes: number; }[];}INTERFACE data.googleCalendar.GoogleCalendarEvent
Section titled “INTERFACE data.googleCalendar.GoogleCalendarEvent”Google Calendar イベント - 主要なイベントスキーマ
ローカル保存に使用する標準のイベント形式です。 Google Calendar API v3 のイベント構造と互換性があります。
export interface GoogleCalendarEvent { // ---- Core Identifiers ---- /** Local event ID (UUID) */ id: string; /** Google Calendar event ID (if synced from Google) */ googleEventId?: string; /** Source calendar ID (e.g., "primary", email address) */ calendarId?: string;
// ---- Basic Info ---- /** Event title */ summary: string; /** Event description (HTML supported) */ description?: string; /** Location string */ location?: string;
// ---- Timing ---- /** Event start time */ start: EventDateTime; /** Event end time */ end: EventDateTime; /** Whether this is an all-day event */ allDay?: boolean;
// ---- Status & Visibility ---- /** Event status */ status?: 'confirmed' | 'tentative' | 'cancelled'; /** Event visibility */ visibility?: 'default' | 'public' | 'private' | 'confidential';
// ---- Recurrence ---- /** RRULE strings for recurring events */ recurrence?: string[]; /** Parent event ID for recurring event instances */ recurringEventId?: string;
// ---- Participants ---- /** Event attendees */ attendees?: EventAttendee[]; /** Event organizer */ organizer?: { email: string; displayName?: string; self?: boolean; }; /** Event creator */ creator?: { email: string; displayName?: string; self?: boolean; };
// ---- Reminders ---- /** Reminder settings */ reminders?: EventReminder;
// ---- User Ownership ---- /** User ID - owner of this event in the local system */ uid?: string;
// ---- Custom Extension Fields ---- /** Resource ID for resource calendar integration */ resourceId?: string; /** Custom color override (hex or color key) */ color?: string; /** Project-specific custom data */ customFields?: Record<string, unknown>;
// ---- Sync Metadata ---- /** Last sync timestamp (ISO 8601) */ syncedAt?: string; /** Origin of event */ source?: 'local' | 'google'; /** Google's version tag for conflict detection */ etag?: string; /** Event creation time (ISO 8601) */ created?: string; /** Event last update time (ISO 8601) */ updated?: string;
// ---- Links ---- /** HTML link to event in Google Calendar */ htmlLink?: string;}INTERFACE data.googleCalendar.CalendarListEntry
Section titled “INTERFACE data.googleCalendar.CalendarListEntry”Google Calendar API のカレンダー一覧エントリ
export interface CalendarListEntry { id: string; summary: string; description?: string; primary?: boolean; accessRole?: 'freeBusyReader' | 'reader' | 'writer' | 'owner'; backgroundColor?: string; foregroundColor?: string; selected?: boolean; timeZone?: string;}INTERFACE data.googleCalendar.TokenResponse
Section titled “INTERFACE data.googleCalendar.TokenResponse”Google Identity Services のトークンレスポンス
export interface TokenResponse { access_token: string; expires_in: number; token_type: string; scope: string; error?: string; error_description?: string;}INTERFACE data.googleCalendar.GoogleAuthState
Section titled “INTERFACE data.googleCalendar.GoogleAuthState”Google 認証の状態
export interface GoogleAuthState { isAuthenticated: boolean; accessToken: string | null; expiresAt: number | null; userEmail?: string; error?: string;}INTERFACE data.googleCalendar.GoogleAuthConfig
Section titled “INTERFACE data.googleCalendar.GoogleAuthConfig”Google 認証の設定
export interface GoogleAuthConfig { clientId: string; scopes?: string[]; /** Auto-select account if only one available */ autoSelect?: boolean;}INTERFACE data.googleCalendar.SyncOptions
Section titled “INTERFACE data.googleCalendar.SyncOptions”同期操作のオプション
export interface SyncOptions { /** Calendar ID to sync (default: "primary") */ calendarId?: string; /** Minimum time for events */ timeMin?: Date; /** Maximum time for events */ timeMax?: Date; /** Maximum number of events to fetch */ maxResults?: number; /** User ID to associate with imported events */ uid?: string; /** Whether to include deleted events */ showDeleted?: boolean;}INTERFACE data.googleCalendar.SyncResult
Section titled “INTERFACE data.googleCalendar.SyncResult”同期操作の結果
export interface SyncResult { success: boolean; eventsImported?: number; eventsExported?: number; eventsUpdated?: number; eventsDeleted?: number; errors?: string[]; syncToken?: string;}TYPE data.googleCalendar.SyncStatus
Section titled “TYPE data.googleCalendar.SyncStatus”同期状態
export type SyncStatus = 'idle' | 'syncing' | 'success' | 'error';INTERFACE data.googleCalendar.EventsListResponse
Section titled “INTERFACE data.googleCalendar.EventsListResponse”Google Calendar API のイベント一覧レスポンス
export interface EventsListResponse { kind: string; etag: string; summary: string; updated: string; timeZone: string; accessRole: string; nextPageToken?: string; nextSyncToken?: string; items: GoogleCalendarEvent[];}INTERFACE data.googleCalendar.CalendarListResponse
Section titled “INTERFACE data.googleCalendar.CalendarListResponse”Google Calendar API のカレンダー一覧レスポンス
export interface CalendarListResponse { kind: string; etag: string; nextPageToken?: string; nextSyncToken?: string; items: CalendarListEntry[];}CONST data.googleCalendar.CALENDAR_API_BASE
Section titled “CONST data.googleCalendar.CALENDAR_API_BASE”Google Calendar API のベース URL
export const data.googleCalendar.CALENDAR_API_BASE: "https://www.googleapis.com/calendar/v3"CONST data.googleCalendar.SCOPES_READONLY
Section titled “CONST data.googleCalendar.SCOPES_READONLY”読み取り専用アクセスのデフォルトスコープ
export const data.googleCalendar.SCOPES_READONLY: string[]CONST data.googleCalendar.SCOPES_READWRITE
Section titled “CONST data.googleCalendar.SCOPES_READWRITE”読み書きアクセスのデフォルトスコープ
export const data.googleCalendar.SCOPES_READWRITE: string[]CONST data.googleCalendar.SCOPES_FULL
Section titled “CONST data.googleCalendar.SCOPES_FULL”カレンダーへのフルアクセススコープ
export const data.googleCalendar.SCOPES_FULL: string[]INTERFACE data.googleCalendar.CalendarEvent
Section titled “INTERFACE data.googleCalendar.CalendarEvent”カレンダーイベント
export interface CalendarEvent { /** Unique identifier */ id: string; /** Associated resource ID */ resourceId?: string; /** Event title */ title: string; /** Start date and time */ start: Date; /** End date and time (exclusive). Must be strictly after start. */ end: Date; /** Description */ description?: string; /** Color override */ color?: string; /** Custom CSS class */ className?: string; /** Whether the event is all-day */ allDay?: boolean; /** Associated Google Calendar data */ googleEvent?: GoogleCalendarEvent; [key: string]: unknown;}使用例 (Example)
Section titled “使用例 (Example)”```tsconst event: CalendarEvent = { id: '1', title: 'Meeting', start: new Date('2024-01-15 10:00'), end: new Date('2024-01-15 11:00'), resourceId: 'room-a',};---
### `FUNCTION` `data.googleCalendar.getCalendarClient`
デフォルトのクライアントインスタンスを取得します。
```typescriptexport function getCalendarClient(): GoogleCalendarClient戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
GoogleCalendarClient
FUNCTION data.googleCalendar.createCalendarClient
Section titled “FUNCTION data.googleCalendar.createCalendarClient”カスタムのベース URL で新しいクライアントインスタンスを作成します。
export function createCalendarClient(baseUrl?: string): GoogleCalendarClient引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
baseUrl |
string | undefined |
任意 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
GoogleCalendarClient
CLASS data.googleCalendar.GoogleCalendarClient
Section titled “CLASS data.googleCalendar.GoogleCalendarClient”Google Calendar API クライアント
class data.googleCalendar.GoogleCalendarClient使用例 (Example)
Section titled “使用例 (Example)”```tsconst client = new GoogleCalendarClient();const calendars = await client.listCalendars();const events = await client.listEvents('primary', { timeMin: startOfMonth(new Date()), timeMax: endOfMonth(new Date())});---
### `FUNCTION` `data.googleCalendar.initGoogleAuth`
指定された設定で Google 認証を初期化します。
```typescriptexport async function initGoogleAuth(config: GoogleAuthConfig): Promise<void>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
config |
GoogleAuthConfig |
必須 | - clientId を含む認証設定 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<void> - Description: 初期化が完了すると解決される Promise
使用例 (Example)
Section titled “使用例 (Example)”```tsawait initGoogleAuth({ clientId: 'YOUR_CLIENT_ID.apps.googleusercontent.com' });---
### `FUNCTION` `data.googleCalendar.requestAccessToken`
アクセストークンをリクエストします(必要に応じて同意ポップアップを開きます)。
```typescriptexport function requestAccessToken(): Promise<TokenResponse>戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<TokenResponse> - Description: トークンレスポンスで解決される Promise
例外 (Throws)
Section titled “例外 (Throws)”認証が初期化されていない場合、またはユーザーがアクセスを拒否した場合のエラー
使用例 (Example)
Section titled “使用例 (Example)”```tsconst token = await requestAccessToken();console.log('Access token:', token.access_token);---
### `FUNCTION` `data.googleCalendar.isAuthenticated`
ユーザーが現在、有効なトークンで認証されているかどうかを確認します。
```typescriptexport function isAuthenticated(): boolean戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
boolean
FUNCTION data.googleCalendar.getAccessToken
Section titled “FUNCTION data.googleCalendar.getAccessToken”現在のアクセストークンを取得します(未認証の場合は null)。
export function getAccessToken(): string | null戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string | null
FUNCTION data.googleCalendar.getTokenExpiresAt
Section titled “FUNCTION data.googleCalendar.getTokenExpiresAt”トークンの有効期限を取得します。
export function getTokenExpiresAt(): number | null戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
number | null
FUNCTION data.googleCalendar.signOut
Section titled “FUNCTION data.googleCalendar.signOut”サインアウトし、現在のトークンを失効させます。
export function signOut(): void戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
void
FUNCTION data.googleCalendar.clearToken
Section titled “FUNCTION data.googleCalendar.clearToken”トークンを失効させずに、ローカルのトークン状態を消去します。
export function clearToken(): void戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
void
FUNCTION data.googleCalendar.isGisLoaded
Section titled “FUNCTION data.googleCalendar.isGisLoaded”GIS が読み込まれ、使用可能な状態かどうかを確認します。
export function isGisLoaded(): boolean戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
boolean
FUNCTION data.googleCalendar.getAuthConfig
Section titled “FUNCTION data.googleCalendar.getAuthConfig”現在の認証設定を取得します。
export function getAuthConfig(): GoogleAuthConfig | null戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
GoogleAuthConfig | null
FUNCTION data.googleCalendar.toCalendarEvent
Section titled “FUNCTION data.googleCalendar.toCalendarEvent”ResourceCalendar で表示するため、GoogleCalendarEvent を CalendarEvent に変換します。
export function toCalendarEvent(event: GoogleCalendarEvent): CalendarEvent引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
event |
GoogleCalendarEvent |
必須 | - Google Calendar のイベント |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
CalendarEvent - Description: ResourceCalendar に適した CalendarEvent
FUNCTION data.googleCalendar.toCalendarEvents
Section titled “FUNCTION data.googleCalendar.toCalendarEvents”GoogleCalendarEvents の配列を CalendarEvents に変換します。
export function toCalendarEvents(events: GoogleCalendarEvent[]): CalendarEvent[]引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
events |
GoogleCalendarEvent[] |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
CalendarEvent[]
FUNCTION data.googleCalendar.toGoogleEvent
Section titled “FUNCTION data.googleCalendar.toGoogleEvent”Google にエクスポートするため、CalendarEvent を GoogleCalendarEvent に変換します。
export function toGoogleEvent( event: CalendarEvent, options?: { uid?: string; calendarId?: string; timeZone?: string; },): GoogleCalendarEvent引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
event |
CalendarEvent |
必須 | - ResourceCalendar のカレンダーイベント |
options |
{ uid?: string; calendarId?: string; timeZone?: string; } | undefined |
任意 | - uid、calendarId などの追加オプション |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
GoogleCalendarEvent - Description: API に適した GoogleCalendarEvent
FUNCTION data.googleCalendar.toGoogleEvents
Section titled “FUNCTION data.googleCalendar.toGoogleEvents”CalendarEvents の配列を GoogleCalendarEvents に変換します。
export function toGoogleEvents( events: CalendarEvent[], options?: { uid?: string; calendarId?: string; timeZone?: string },): GoogleCalendarEvent[]引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
events |
CalendarEvent[] |
必須 | |
options |
{ uid?: string; calendarId?: string; timeZone?: string; } | undefined |
任意 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
GoogleCalendarEvent[]
FUNCTION data.googleCalendar.mergeEventData
Section titled “FUNCTION data.googleCalendar.mergeEventData”ローカルのカスタムフィールドを Google のイベントデータとマージします。 インポート時にローカルの拡張を保持するために使用します。
export function mergeEventData( googleEvent: GoogleCalendarEvent, localData?: Partial<GoogleCalendarEvent>,): GoogleCalendarEvent引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
googleEvent |
GoogleCalendarEvent |
必須 | - Google Calendar API のイベント |
localData |
Partial<GoogleCalendarEvent> | undefined |
任意 | - マージするローカルのカスタムデータ |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
GoogleCalendarEvent - Description: マージ済みのイベント
FUNCTION data.googleCalendar.prepareForImport
Section titled “FUNCTION data.googleCalendar.prepareForImport”インポートするイベント(Google からの受信)の準備を行います。 ローカル ID を生成し、同期メタデータを設定します。
export function prepareForImport( googleEvent: GoogleCalendarEvent, options?: { uid?: string; resourceId?: string; },): GoogleCalendarEvent引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
googleEvent |
GoogleCalendarEvent |
必須 | |
options |
{ uid?: string; resourceId?: string; } | undefined |
任意 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
GoogleCalendarEvent
FUNCTION data.googleCalendar.prepareForExport
Section titled “FUNCTION data.googleCalendar.prepareForExport”エクスポートするイベント(Google への送信)の準備を行います。 ローカル専用のフィールドを取り除きます。
export function prepareForExport( event: GoogleCalendarEvent,): Omit<GoogleCalendarEvent, 'id' | 'uid' | 'resourceId' | 'customFields' | 'syncedAt' | 'source'>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
event |
GoogleCalendarEvent |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Omit<GoogleCalendarEvent, "id" | "uid" | "resourceId" | "customFields" | "syncedAt" | "source">
FUNCTION data.googleCalendar.parseEventDateTime
Section titled “FUNCTION data.googleCalendar.parseEventDateTime”EventDateTime を解析して JavaScript の Date に変換します。
export function parseEventDateTime( dt: GoogleCalendarEvent['start'] | GoogleCalendarEvent['end'],): Date引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
dt |
import("./types").EventDateTime |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Date
FUNCTION data.googleCalendar.isAllDayEvent
Section titled “FUNCTION data.googleCalendar.isAllDayEvent”イベントが終日イベントかどうかを確認します。
export function isAllDayEvent(event: GoogleCalendarEvent): boolean引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
event |
GoogleCalendarEvent |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
boolean
FUNCTION data.googleCalendar.formatDateOnly
Section titled “FUNCTION data.googleCalendar.formatDateOnly”終日イベント用に Date を YYYY-MM-DD 形式に整形します。
export function formatDateOnly(date: Date): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
date |
Date |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string
FUNCTION data.googleCalendar.generateLocalId
Section titled “FUNCTION data.googleCalendar.generateLocalId”イベント用のローカル UUID を生成します。
export function generateLocalId(): string戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string
FUNCTION data.googleCalendar.isSameEvent
Section titled “FUNCTION data.googleCalendar.isSameEvent”2 つのイベントが等しいかどうかを ID で比較します。
export function isSameEvent(a: GoogleCalendarEvent, b: GoogleCalendarEvent): boolean引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
a |
GoogleCalendarEvent |
必須 | |
b |
GoogleCalendarEvent |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
boolean
FUNCTION data.googleCalendar.findMatchingEvent
Section titled “FUNCTION data.googleCalendar.findMatchingEvent”Google ID またはローカル ID で、一致するイベントを検索します。
export function findMatchingEvent( event: GoogleCalendarEvent, events: GoogleCalendarEvent[],): GoogleCalendarEvent | undefined引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
event |
GoogleCalendarEvent |
必須 | |
events |
GoogleCalendarEvent[] |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
GoogleCalendarEvent | undefined
FUNCTION data.googleCalendar.getEventDuration
Section titled “FUNCTION data.googleCalendar.getEventDuration”イベントの継続時間をミリ秒単位で取得します。
export function getEventDuration(event: GoogleCalendarEvent): number引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
event |
GoogleCalendarEvent |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
number
FUNCTION data.googleCalendar.sortEventsByStartTime
Section titled “FUNCTION data.googleCalendar.sortEventsByStartTime”イベントを開始時刻順に並べ替えます。
export function sortEventsByStartTime(events: GoogleCalendarEvent[]): GoogleCalendarEvent[]引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
events |
GoogleCalendarEvent[] |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
GoogleCalendarEvent[]
FUNCTION data.googleCalendar.setupWatchChannel
Section titled “FUNCTION data.googleCalendar.setupWatchChannel”サーバー関数を介して監視チャネルを設定します。
プッシュ通知を登録するには、アプリからこの関数を呼び出してください。 この認証付きサーバーエンドポイントと Webhook のデプロイは、アプリケーション側で管理します。
export async function setupWatchChannel(options: { calendarId: string; webhookUrl: string; functionUrl: string; accessToken: string;}): Promise<{ channelId: string; resourceId: string; expiration: string }>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
options |
{ calendarId: string; webhookUrl: string; functionUrl: string; accessToken: string; } |
必須 | - 監視の設定オプション |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<{ channelId: string; resourceId: string; expiration: string; }> - Description: チャネル情報で解決される Promise
INTERFACE data.CalendarEvent
Section titled “INTERFACE data.CalendarEvent”カレンダーイベント
export interface CalendarEvent { /** Unique identifier */ id: string; /** Associated resource ID */ resourceId?: string; /** Event title */ title: string; /** Start date and time */ start: Date; /** End date and time (exclusive). Must be strictly after start. */ end: Date; /** Description */ description?: string; /** Color override */ color?: string; /** Custom CSS class */ className?: string; /** Whether the event is all-day */ allDay?: boolean; /** Associated Google Calendar data */ googleEvent?: GoogleCalendarEvent; [key: string]: unknown;}使用例 (Example)
Section titled “使用例 (Example)”```tsconst event: CalendarEvent = { id: '1', title: 'Meeting', start: new Date('2024-01-15 10:00'), end: new Date('2024-01-15 11:00'), resourceId: 'room-a',};---
### `INTERFACE` `data.FieldDefinition`
インターフェース `data.FieldDefinition`
```typescriptexport interface FieldDefinition { type: FieldType; label?: string; group?: string; /** Field width hint (used in responsive grid) */ width?: FieldWidth; /** Mark as advanced field (displayed in collapsible section) */ advanced?: boolean; /** Step number in multi-step forms (1-indexed) */ step?: number; required?: boolean; min?: number; max?: number; minLength?: number; maxLength?: number; pattern?: string; options?: { label: string; value: string | number }[]; enum?: Array<string | number>; placeholder?: string; description?: string; defaultValue?: unknown; unique?: boolean; primaryKey?: boolean; references?: { table: string; column?: string; onDelete?: 'cascade' | 'restrict' | 'set null' | 'no action'; multiple?: boolean; ui?: FieldRelationDefinition; }; /** UI state: field is disabled/readonly */ disabled?: boolean; /** UI state: field is hidden */ hidden?: boolean; /** Reference to an enum constant name (e.g. 'role', 'prefecture') */ enumRef?: string; /** Grid column span (1-12) */ span?: number; /** For 'array' type: defines the item schema */ items?: FieldDefinition; /** For 'object' type: defines nested field schemas */ properties?: Record<string, FieldDefinition>;}INTERFACE data.FieldRelationDefinition
Section titled “INTERFACE data.FieldRelationDefinition”インターフェース data.FieldRelationDefinition
export interface FieldRelationDefinition { displayField: string; inputDisplay?: RelationInputDisplay; validateKey?: boolean; searchMode?: RelationSearchMode; searchFields?: string[]; searchTitle?: string;}TYPE data.FieldType
Section titled “TYPE data.FieldType”型 data.FieldType
export type FieldType = | 'text' | 'number' | 'email' | 'tel' | 'zip' | 'prefecture' | 'password' | 'date' | 'time' | 'timestring' | 'datetime' | 'file' | 'select' | 'boolean' | 'textarea' | 'json' | 'array' | 'object';TYPE data.FieldWidth
Section titled “TYPE data.FieldWidth”フィールド幅のヒントです。
- short: 狭い幅 (~150px) - 郵便番号、都道府県など
- medium: 中程度の幅 (~300px) - フォームフィールドのデフォルト
- long: 広い幅 (~450px) - 住所、長いテキストなど
- full: 全幅 (100%) - テキストエリア、説明など
export type FieldWidth = 'short' | 'medium' | 'long' | 'full';TYPE data.RelationInputDisplay
Section titled “TYPE data.RelationInputDisplay”型 data.RelationInputDisplay
export type RelationInputDisplay = 'key' | 'text' | 'both';TYPE data.RelationSearchMode
Section titled “TYPE data.RelationSearchMode”型 data.RelationSearchMode
export type RelationSearchMode = 'dialog' | 'rightpane';INTERFACE data.SchemaDefinition
Section titled “INTERFACE data.SchemaDefinition”インターフェース data.SchemaDefinition
export interface SchemaDefinition { name: string; table?: string; fields: Record<string, FieldDefinition>; /** Multi-step form step definitions */ steps?: SchemaStep[];}INTERFACE data.XUISearchSourceOptions
Section titled “INTERFACE data.XUISearchSourceOptions”インターフェース data.XUISearchSourceOptions
export interface XUISearchSourceOptions { /** Target collection or table name */ collection: string; /** ID field name (default: id) */ idField?: string; /** Label field name (default: name) */ labelField?: string; /** Description field name (optional) */ descriptionField?: string; /** Additional filter (optional) */ baseFilter?: Record<string, unknown>; /** Number of results to fetch (default: 20) */ limit?: number; /** Allow creating a new record when zero candidates exist */ createEnabled?: boolean;}INTERFACE data.XUIOptions
Section titled “INTERFACE data.XUIOptions”UI 表示オプション (x-ui)
react-jsonschema-form 形式の UI 定義です。 フォームの描画に関する設定を定義します。
export interface XUIOptions { /** Input UI component */ widget?: | 'textarea' | 'radio' | 'color' | 'range' | 'hidden' | 'select' | 'checkbox' | 'password' // Location widgets | 'country' | 'subdivision' | 'postalcode' // Subdivision aliases (resolve to subdivision with fixed country) | 'prefecture' | 'state' | 'province'; /** Display label */ label?: string; /** Placeholder text */ placeholder?: string; /** Supplementary help text */ help?: string; /** Hidden flag */ hidden?: boolean; /** Read-only */ readOnly?: boolean; /** Disabled */ disabled?: boolean; /** Auto-focus */ autoFocus?: boolean; /** Prefix icon/text for input field */ prefix?: string; /** Suffix icon/text for input field */ suffix?: string; /** Select options (explicit labels separate from enum) */ options?: Array<{ label: string; value: string | number }>; /** Allow custom arbitrary input outside candidates in `select` */ allowCustom?: boolean; /** Asynchronous search settings using DataAccess */ searchSource?: XUISearchSourceOptions; /** Async search debounce time (ms) */ searchDebounceMs?: number; /** Minimum character count to start async search */ searchMinLength?: number; /** Message when no options match */ noOptionsMessage?: string; /** Dialog title for creating new entry when zero candidates exist */ createDialogTitle?: string; /** ID label for create dialog */ createIdLabel?: string; /** Name label for create dialog */ createNameLabel?: string;
// Location widget options /** Dependent field name (country field referenced by subdivision) */ dependsOn?: string; /** Country field name (for postal code validation) */ countryField?: string; /** Use ISO format (for prefecture widget) */ useIsoCode?: boolean; /** Automatic formatting (for postal code) */ autoFormat?: boolean;
/** Layout settings */ layout?: { /** Grid column span (12-column grid) */ colSpan?: number | { xs?: number; sm?: number; md?: number; lg?: number }; /** Row span */ rowSpan?: number; /** Display order */ order?: number; /** Section identifier */ section?: string; /** Break before (new line flag) */ breakBefore?: boolean; }; /** Style settings */ style?: { /** Maximum width */ maxWidth?: string; /** Minimum height */ minHeight?: string; /** Custom CSS class */ className?: string; };
// Form layout options (migrated from legacy SchemaDefinition) /** Multi-step form: step number (1-based) */ step?: number; /** Progressive disclosure: hide in collapsed "advanced" section */ advanced?: boolean; /** Field grouping label (displayed as section heading) */ group?: string; /** Field width hint for form layout */ width?: 'short' | 'medium' | 'long' | 'full';}INTERFACE data.XCodelistOptions
Section titled “INTERFACE data.XCodelistOptions”コードリストの参照設定 (x-codelist)
export interface XCodelistOptions { /** Code list identifier (e.g. unit-codes, tax-categories) */ id: string; /** Optional version (e.g. 1.0.0) */ version?: string; /** Label field to use in UI */ labelField?: 'label_ja' | 'label_en'; /** Include deprecated codes */ includeDeprecated?: boolean; /** Label fallback order */ fallbackOrder?: Array<'label_ja' | 'label_en' | 'code'>;}INTERFACE data.XDBOptions
Section titled “INTERFACE data.XDBOptions”データベース定義オプション (x-db)
Supabase/PostgreSQL、Convex、MongoDB など、データベース固有の設定です。
export interface XDBOptions { /** Table or collection name (Root only) */ tableName?: string; /** Column name override */ columnName?: string; /** Compatibility: alias for columnName */ column?: string; /** Primary key flag */ primaryKey?: boolean; /** DB nullability. Primary key is always false. When omitted, true if type allows null or not required (compatibility rule). */ nullable?: boolean; /** Foreign key configuration */ foreignKey?: { table: string; field?: string; onDelete?: 'cascade' | 'restrict' | 'set null' | 'no action'; }; /** Compatibility: alias for foreignKey */ references?: { table: string; column?: string; onDelete?: 'cascade' | 'restrict' | 'set null' | 'no action'; }; /** Index creation */ index?: boolean; /** Unique constraint */ unique?: boolean; /** DB default value (SQL expression) */ default?: string; /** DB type override */ type?: string; /** Convex-specific type */ convexType?: string; /** CHECK constraint (SQL expression, e.g. "status IN ('draft', 'sent')") */ check?: string; /** * Flag to generate definitions in $defs as a separate table. * Specifies parent table name and parent ID column name. */ asTable?: { /** Generated table name */ tableName: string; /** Foreign key column name to parent table */ parentColumn?: string; /** Cascade on parent table deletion */ onDeleteCascade?: boolean; }; /** Skip DB generation flag */ skip?: boolean;}INTERFACE data.XZodOptions
Section titled “INTERFACE data.XZodOptions”Zod 検証の拡張 (x-zod)
export interface XZodOptions { /** Custom error messages */ errorMessages?: { required_error?: string; invalid_type_error?: string; too_small?: string; too_big?: string; invalid_string?: string; }; /** Type coercion flag */ coerce?: boolean; /** Transform processing */ transform?: 'trim' | 'toLowerCase' | 'toUpperCase'; /** Custom validation function name */ refine?: string;}INTERFACE data.XGenOptions
Section titled “INTERFACE data.XGenOptions”コード生成の拡張 (x-gen)
export interface XGenOptions { /** TypeScript type override */ tsType?: string;}INTERFACE data.XRLSPolicy
Section titled “INTERFACE data.XRLSPolicy”RLS ポリシー定義(個別の操作用)
SELECT、INSERT、UPDATE、DELETE 操作のポリシー設定です。
export interface XRLSPolicy { /** Allowed roles (authenticated, admin, service_role, etc.) */ roles?: string[]; /** * SQL condition expression (used in USING or WITH CHECK clause) * @example "auth.uid() = user_id" * @example "auth.role() = 'admin'" */ check?: string; /** * USING clause (for SELECT/UPDATE/DELETE) * Used for access control on existing rows */ using?: string; /** * WITH CHECK clause (for INSERT/UPDATE) * Used for validation on inserting or updating new rows */ withCheck?: string; /** Policy name suffix (used during automatic generation) */ policyName?: string;}INTERFACE data.XRLSOptions
Section titled “INTERFACE data.XRLSOptions”RLS 設定 (x-rls)
テーブル全体の行レベルセキュリティ設定です。 Supabase/PostgreSQL の RLS ポリシーを自動生成するために使用します。
export interface XRLSOptions { /** Enable RLS (default: true) */ enabled?: boolean; /** Force mode (default: false) */ force?: boolean; /** SELECT policy */ select?: XRLSPolicy; /** INSERT policy */ insert?: XRLSPolicy; /** UPDATE policy */ update?: XRLSPolicy; /** DELETE policy */ delete?: XRLSPolicy; /** Common policy for all operations (individual settings take precedence) */ all?: XRLSPolicy; /** Compatibility: policies array format */ policies?: XRLSLegacyPolicy[];}INTERFACE data.XRLSLegacyPolicy
Section titled “INTERFACE data.XRLSLegacyPolicy”互換性: 従来の RLS ポリシー形式
export interface XRLSLegacyPolicy { name: string; operation: string[] | string; roles?: string[]; using?: string; withCheck?: string;}INTERFACE data.XRLSFieldHint
Section titled “INTERFACE data.XRLSFieldHint”互換性: フィールドレベルの RLS ヒント
export interface XRLSFieldHint { column?: string; policy?: string;}TYPE data.XRuleOp
Section titled “TYPE data.XRuleOp”x-rules の演算子
export type XRuleOp = | 'eq' | 'neq' | 'lt' | 'lte' | 'gt' | 'gte' | 'in' | 'nin' | 'regex' | 'sum_eq';TYPE data.XRuleLiteral
Section titled “TYPE data.XRuleLiteral”x-rules のリテラル値
export type XRuleLiteral = | string | number | boolean | null | Array<string | number | boolean | null>;TYPE data.XRuleOperand
Section titled “TYPE data.XRuleOperand”x-rules のオペランド
export type XRuleOperand = { jsonpath: string } | { literal: XRuleLiteral };INTERFACE data.XRuleAssert
Section titled “INTERFACE data.XRuleAssert”x-rules の assert 条件
export interface XRuleAssert { op: XRuleOp; left: XRuleOperand; right: XRuleOperand;}INTERFACE data.XRuleCondition
Section titled “INTERFACE data.XRuleCondition”x-rules の when 条件
export interface XRuleCondition { jsonpath: string;}INTERFACE data.XRuleDefinition
Section titled “INTERFACE data.XRuleDefinition”x-rules のルール定義
export interface XRuleDefinition { id: string; severity: 'error' | 'warning' | 'info'; scope: 'document' | 'data' | 'item' | string; target?: string; when?: XRuleCondition; assert: XRuleAssert; message?: string; error_code?: string; field_paths?: string[];}INTERFACE data.JSONSchemaProperty
Section titled “INTERFACE data.JSONSchemaProperty”JSON Schema 2020-12 のプロパティ(拡張付き)
標準の JSON Schema 2020-12 + ベンダー拡張
export interface JSONSchemaProperty { // Standard JSON Schema fields type?: | 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object' | 'null' | ('string' | 'number' | 'integer' | 'boolean' | 'array' | 'object' | 'null')[]; format?: 'email' | 'date' | 'date-time' | 'time' | 'uri' | 'uuid' | 'password' | string; title?: string; description?: string; default?: unknown; enum?: readonly (string | number | boolean | null)[]; const?: unknown;
$ref?: string; // 2020-12: Reference to another schema readOnly?: boolean; writeOnly?: boolean;
// String constraints minLength?: number; maxLength?: number; pattern?: string;
// Number constraints minimum?: number; maximum?: number; exclusiveMinimum?: number; exclusiveMaximum?: number; multipleOf?: number;
// Array constraints items?: JSONSchemaProperty | false; prefixItems?: JSONSchemaProperty[]; // 2020-12: Tuple validation minItems?: number; maxItems?: number; uniqueItems?: boolean;
// Object constraints properties?: Record<string, JSONSchemaProperty>; required?: string[]; additionalProperties?: boolean | JSONSchemaProperty; unevaluatedProperties?: boolean | JSONSchemaProperty; // 2020-12 dependentRequired?: Record<string, string[]>; // 2020-12: Conditional requirements dependentSchemas?: Record<string, JSONSchemaProperty>; // 2020-12
// Vendor extensions 'x-ui'?: XUIOptions; 'x-db'?: XDBOptions; 'x-zod'?: XZodOptions; 'x-gen'?: XGenOptions; 'x-rules'?: XRuleDefinition[]; 'x-codelist'?: XCodelistOptions;}INTERFACE data.JSONSchema
Section titled “INTERFACE data.JSONSchema”ルートの JSON Schema オブジェクト(拡張付き)
export interface JSONSchema extends JSONSchemaProperty { $schema?: string; $id?: string; $defs?: Record<string, JSONSchemaProperty>; // 2020-12: Reusable definitions $anchor?: string; // 2020-12: In-document reference 'x-db'?: XDBOptions & { tableName: string }; 'x-rls'?: XRLSOptions | XRLSFieldHint; /** Multi-step form step definitions (migrated from legacy SchemaDefinition.steps) */ 'x-steps'?: Array<{ name: string; title: string; description?: string }>;}TYPE data.JSONSchemaExt
Section titled “TYPE data.JSONSchemaExt”型 data.JSONSchemaExt
export type JSONSchemaExt = JSONSchema;非推奨 (Deprecated)
Section titled “非推奨 (Deprecated)”代わりに JSONSchema を使用してください。
INTERFACE data.RegistryExtensionExample
Section titled “INTERFACE data.RegistryExtensionExample”レジストリのサンプルデータ
export interface RegistryExtensionExample { namespace: string; extension_id: string; version: string; data: Record<string, unknown>;}INTERFACE data.RegistryExtensionEntry
Section titled “INTERFACE data.RegistryExtensionEntry”レジストリの拡張エントリ
export interface RegistryExtensionEntry { namespace: string; extension_id: string; version_range: string; status: 'active' | 'draft' | 'deprecated' | string; title: string; description?: string; applies_to?: string[]; core_touchpoints?: string[]; validation?: string[]; examples?: RegistryExtensionExample[];}INTERFACE data.RegistryFile
Section titled “INTERFACE data.RegistryFile”レジストリファイル
export interface RegistryFile { registry_version: string; updated_at?: string; extensions: RegistryExtensionEntry[];}INTERFACE data.ExtensionEnvelope
Section titled “INTERFACE data.ExtensionEnvelope”拡張エンベロープ
export interface ExtensionEnvelope { namespace: string; extension_id: string; version: string; data: Record<string, unknown>;}INTERFACE data.ExtensionsContainer
Section titled “INTERFACE data.ExtensionsContainer”extensions 配列を含む文書
export interface ExtensionsContainer { extensions?: ExtensionEnvelope[];}INTERFACE data.DocumentHeader
Section titled “INTERFACE data.DocumentHeader”文書共通ヘッダー
export interface DocumentHeader { schema_version: string; profile: string; profile_version?: string; doc_type: string; id: string; issue_date: string; extensions?: ExtensionEnvelope[];}INTERFACE data.DirectoryCapabilities
Section titled “INTERFACE data.DirectoryCapabilities”ディレクトリの機能情報
export interface DirectoryCapabilities { enabled_profiles: string[]; enabled_extensions: string[];}INTERFACE data.FlatIssue
Section titled “INTERFACE data.FlatIssue”フラット化された検証エラー
export interface FlatIssue { level: 'error' | 'warning' | 'info'; code: string; path: string; message: string;}INTERFACE data.ValidationReport
Section titled “INTERFACE data.ValidationReport”検証レポート
export interface ValidationReport { header: import('./registry').HeaderValidationResult; registry: import('./registry').ExtensionsValidationResult; rules: import('./json-schema').XRuleViolation[]; registryExamples?: import('./registry').RegistryExampleValidationResult[];}INTERFACE data.FormatValidationReportResult
Section titled “INTERFACE data.FormatValidationReportResult”検証レポート + フラット化された配列
export interface FormatValidationReportResult { report: ValidationReport; flat: FlatIssue[];}TYPE data.FromSchema
Section titled “TYPE data.FromSchema”JSON Schema から TypeScript の型を導出します。
export type FromSchema<S> = S extends { properties: infer P extends Record<string, unknown>;} ? // Required properties { [K in keyof P as K extends RequiredKeys<S> ? K : never]: PropertyToTS<P[K]>; } & { // Optional properties [K in keyof P as K extends OptionalKeys<S, Extract<keyof P, string>> ? K : never]?: PropertyToTS<P[K]>; } extends infer O ? { [K in keyof O]: O[K] } : never : never;使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { FromSchema } from "./types";const userSchema = { properties: { id: { type: 'string' }, name: { type: 'string' } }, required: ['id', 'name'] } as const;type User = FromSchema<typeof userSchema>;// => { id: string; name: string; email?: string; ... }---
### `TYPE` `data.TableNameFromSchema`
JSON Schema からテーブル名を取得します。
```typescriptexport type TableNameFromSchema<S> = S extends { 'x-db': { tableName: infer T } } ? T : string;FUNCTION data.dereferenceSchema
Section titled “FUNCTION data.dereferenceSchema”JSON Schema 内の $ref を解決し、フラット化します。
$defs と $ref を使用するスキーマを、参照が解決されたフラットなスキーマに変換します。 Zod v4 の z.fromJSONSchema() に渡す前の処理に便利です。
export async function dereferenceSchema<T extends JSONSchema>(schema: T): Promise<T>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schema |
T |
必須 | - 参照を含む JSON Schema 外部ファイルおよび HTTP の参照は解決しないため、信頼できないスキーマによる I/O を防ぎます。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T> - Description: 参照解決済みの JSON Schema
使用例 (Example)
Section titled “使用例 (Example)”```typescriptconst schemaWithRefs = { $defs: { address: { type: "object", properties: {...} } }, properties: { billing: { $ref: "#/$defs/address" } }};
const flatSchema = await dereferenceSchema(schemaWithRefs);const zodSchema = z.fromJSONSchema(flatSchema);---
### `FUNCTION` `data.hasSchemaRefs`
同期的なバージョンです。スキーマの参照がすでに解決済みかどうかを確認します。
$ref の有無を単純に確認します。
```typescriptexport function hasSchemaRefs(schema: JSONSchema): boolean引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schema |
JSONSchema |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
boolean
FUNCTION data.inferWidget
Section titled “FUNCTION data.inferWidget”JSON Schema のプロパティからウィジェットの種類を推論します。
export function inferWidget(prop: JSONSchemaProperty): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
prop |
JSONSchemaProperty |
必須 | - JSON Schema のプロパティ |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: ウィジェットの種類
FUNCTION data.extractUIConfig
Section titled “FUNCTION data.extractUIConfig”JSON Schema のプロパティから UI 設定を抽出します。
export function extractUIConfig( prop: JSONSchemaProperty, key: string, required: string[] = [], codelistResolver?: (config: XCodelistOptions) => Array<{ label: string; value: string | number }>,): { type: string; label: string; placeholder?: string; help?: string; required: boolean; options?: Array<{ label: string; value: string | number }>; hidden?: boolean; readOnly?: boolean; disabled?: boolean; prefix?: string; suffix?: string;}引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
prop |
JSONSchemaProperty |
必須 | - JSON Schema のプロパティ |
key |
string |
必須 | - プロパティのキー(名前) |
required |
string[] |
任意 | - 必須フィールドの一覧 |
codelistResolver |
((config: XCodelistOptions) => Array<{ label: string; value: string | number; }>) | undefined |
任意 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
{ type: string; label: string; placeholder?: string; help?: string; required: boolean; options?: Array<{ label: string; value: string | number; }>; hidden?: boolean; readOnly?: boolean; disabled?: boolean; prefix?: string; suffix?: string; } - Description: UI 設定オブジェクト
FUNCTION data.inferPostgresType
Section titled “FUNCTION data.inferPostgresType”JSON Schema のプロパティから PostgreSQL の型を推論します。
export function inferPostgresType(prop: JSONSchemaProperty): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
prop |
JSONSchemaProperty |
必須 | - JSON Schema のプロパティ |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: PostgreSQL の型名
補足 (Remarks)
Section titled “補足 (Remarks)”date は date、date-time は timestamptz になります。null を許容するユニオン型に含まれる null は、物理型の推論から除外します。
例外 (Throws)
Section titled “例外 (Throws)”x-db.type の指定がなく、ユニオン型に複数の異種の型が含まれる場合です。
FUNCTION data.inferConvexValidator
Section titled “FUNCTION data.inferConvexValidator”JSON Schema のプロパティから Convex のバリデーターコードを生成します。
export function inferConvexValidator(prop: JSONSchemaProperty, indent: string = ''): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
prop |
JSONSchemaProperty |
必須 | - JSON Schema のプロパティ |
indent |
string |
任意 | - インデント文字列 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: Convex のバリデーターコード
FUNCTION data.createJSONSchema
Section titled “FUNCTION data.createJSONSchema”JSON Schema を作成するためのヘルパー関数です。
export function createJSONSchema<T extends JSONSchema>(schema: T): T引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schema |
T |
必須 | - JSON Schema オブジェクト |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
T - Description: 同じスキーマ(型安全性のため)
FUNCTION data.buildExtensionDataRef
Section titled “FUNCTION data.buildExtensionDataRef”拡張データスキーマの $ref URL を生成します。
export function buildExtensionDataRef( extension: { namespace: string; extension_id: string; version: string }, options: ExtensionDataRefOptions = {},): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
extension |
{ namespace: string; extension_id: string; version: string; } |
必須 | - namespace、extension_id、version を持つ拡張 |
options |
ExtensionDataRefOptions |
任意 | - ベース URL のオプション |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: data.schema.json の URL
FUNCTION data.extensionEnvelopeSchema
Section titled “FUNCTION data.extensionEnvelopeSchema”extensions 配列内のエンベロープスキーマを生成します。
export function extensionEnvelopeSchema( options: ExtensionEnvelopeSchemaOptions = {},): JSONSchemaProperty引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
options |
ExtensionEnvelopeSchemaOptions |
任意 | - data の $ref またはスキーマを指定するオプション |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
JSONSchemaProperty - Description: JSON Schema のプロパティ
FUNCTION data.headerSchema
Section titled “FUNCTION data.headerSchema”regional-edi の共通ヘッダー用スキーマを生成します。
export function headerSchema(options: HeaderSchemaOptions = {}): JSONSchemaProperty引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
options |
HeaderSchemaOptions |
任意 | - enum の制限オプション |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
JSONSchemaProperty - Description: JSON Schema のプロパティ
FUNCTION data.generateJSONSchemaDefaults
Section titled “FUNCTION data.generateJSONSchemaDefaults”JSON Schema からデフォルト値を生成します。
export function generateJSONSchemaDefaults(schema: JSONSchema): Record<string, unknown>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schema |
JSONSchema |
必須 | - JSON Schema オブジェクト |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Record<string, unknown> - Description: デフォルト値のオブジェクト
FUNCTION data.applyCodelistEnums
Section titled “FUNCTION data.applyCodelistEnums”x-codelist に基づいて enum を設定した JSON Schema を返します。
export function applyCodelistEnums( schema: JSONSchema, resolver: (config: XCodelistOptions) => string[],): JSONSchema引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schema |
JSONSchema |
必須 | - JSON Schema |
resolver |
(config: XCodelistOptions) => string[] |
必須 | - コードリストの enum 配列を返す関数 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
JSONSchema - Description: enum 解決済みの JSON Schema
FUNCTION data.collectXRuleViolations
Section titled “FUNCTION data.collectXRuleViolations”x-rules を評価し、違反の一覧を返します。
export function collectXRuleViolations( schema: JSONSchema, data: unknown, resolver: JsonPathResolver,): XRuleViolation[]引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schema |
JSONSchema |
必須 | - JSON Schema(x-rules を含む) |
data |
unknown |
必須 | - 検証対象のデータ |
resolver |
JsonPathResolver |
必須 | - JSONPath の評価関数 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
XRuleViolation[] - Description: 違反の配列
FUNCTION data.flattenXRuleViolations
Section titled “FUNCTION data.flattenXRuleViolations”x-rules の違反を、フラット化されたエラー配列に変換します。
export function flattenXRuleViolations(violations: XRuleViolation[]): FlatIssue[]引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
violations |
XRuleViolation[] |
必須 | - x-rules の違反 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
FlatIssue[] - Description: フラット化されたエラー配列
FUNCTION data.isJSONSchema
Section titled “FUNCTION data.isJSONSchema”値が JSONSchema かどうかを判定します。
export function isJSONSchema(schema: unknown): schema is JSONSchema引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schema |
unknown |
必須 | - 確認対象のオブジェクト |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
boolean - Description: 値が JSONSchema の場合は true
FUNCTION data.jsonSchemaTypeToFieldType
Section titled “FUNCTION data.jsonSchemaTypeToFieldType”JSON Schema の type + format を FieldType に変換します。
export function jsonSchemaTypeToFieldType(prop: JSONSchemaProperty): FieldType引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
prop |
JSONSchemaProperty |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
FieldType
FUNCTION data.jsonSchemaPropertyToFieldDefinition
Section titled “FUNCTION data.jsonSchemaPropertyToFieldDefinition”JSON Schema のプロパティを FieldDefinition に変換します。
export function jsonSchemaPropertyToFieldDefinition( prop: JSONSchemaProperty, key: string, required: string[],): FieldDefinition引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
prop |
JSONSchemaProperty |
必須 | |
key |
string |
必須 | |
required |
string[] |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
FieldDefinition
FUNCTION data.jsonSchemaToSchemaDefinition
Section titled “FUNCTION data.jsonSchemaToSchemaDefinition”JSONSchema を SchemaDefinition に変換します。
コンポーネントが従来の形式を必要とする場合に使用します。
export function jsonSchemaToSchemaDefinition(schema: JSONSchema): SchemaDefinition引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schema |
JSONSchema |
必須 | - JSON Schema オブジェクト |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
SchemaDefinition - Description: SchemaDefinition オブジェクト
使用例 (Example)
Section titled “使用例 (Example)”```typescriptconst legacy = jsonSchemaToSchemaDefinition(myJSONSchema);<SchemaDetailPage schema={legacy} />---
### `FUNCTION` `data.normalizeSchema`
関数 `data.normalizeSchema`
```typescriptexport function normalizeSchema(schema: JSONSchema | SchemaDefinition): SchemaDefinition引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schema |
JSONSchema | SchemaDefinition |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
SchemaDefinition
非推奨 (Deprecated)
Section titled “非推奨 (Deprecated)”代わりに normalizeToJSONSchema() を使用してください。 JSONSchema または SchemaDefinition を受け取り、SchemaDefinition を返します。
FUNCTION data.schemaDefinitionToJSONSchema
Section titled “FUNCTION data.schemaDefinitionToJSONSchema”SchemaDefinition(従来形式)を JSONSchema に変換します。
従来形式のスキーマを JSON Schema 2020-12 + ベンダー拡張に変換します。
export function schemaDefinitionToJSONSchema(schema: SchemaDefinition): JSONSchema引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schema |
SchemaDefinition |
必須 | - 従来形式の SchemaDefinition |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
JSONSchema - Description: JSONSchema
使用例 (Example)
Section titled “使用例 (Example)”```typescriptconst legacy: SchemaDefinition = { name: 'users', table: 'users', fields: { ... } };const jsonSchema = schemaDefinitionToJSONSchema(legacy);---
### `FUNCTION` `data.normalizeToJSONSchema`
スキーマを JSONSchema に正規化します(両方の形式に対応します)。
JSONSchema または SchemaDefinition のいずれかを受け取り、常に JSONSchema を返します。UI コンポーネントは内部でこの関数を使用して入力を正規化します。
```typescriptexport function normalizeToJSONSchema(schema: JSONSchema | SchemaDefinition): JSONSchema引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schema |
JSONSchema | SchemaDefinition |
必須 | - いずれかの形式のスキーマ |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
JSONSchema - Description: JSONSchema
使用例 (Example)
Section titled “使用例 (Example)”```typescript// Both formats workconst normalized = normalizeToJSONSchema(legacyOrNewSchema);---
### `INTERFACE` `data.ExtensionEnvelopeSchemaOptions`
インターフェース `data.ExtensionEnvelopeSchemaOptions`
```typescriptexport interface ExtensionEnvelopeSchemaOptions { /** Used when specifying data $ref */ dataRef?: string; /** Used when embedding data schema directly */ dataSchema?: JSONSchemaProperty;}INTERFACE data.ExtensionDataRefOptions
Section titled “INTERFACE data.ExtensionDataRefOptions”インターフェース data.ExtensionDataRefOptions
export interface ExtensionDataRefOptions { /** Base URL for extension data schema */ baseUrl?: string;}INTERFACE data.HeaderSchemaOptions
Section titled “INTERFACE data.HeaderSchemaOptions”インターフェース data.HeaderSchemaOptions
export interface HeaderSchemaOptions { /** enum restriction for doc_type */ docTypes?: string[]; /** enum restriction for profile */ profiles?: string[]; /** enum restriction for profile_version */ profileVersions?: string[]; /** enum restriction for schema_version */ versions?: string[];}TYPE data.JsonPathResolver
Section titled “TYPE data.JsonPathResolver”JSONPath を評価し、結果の配列を返す関数型です。
export type JsonPathResolver = (data: unknown, jsonpath: string) => unknown[];INTERFACE data.XRuleViolation
Section titled “INTERFACE data.XRuleViolation”インターフェース data.XRuleViolation
export interface XRuleViolation { ruleId: string; severity: XRuleDefinition['severity']; message?: string; errorCode?: string; fieldPaths?: string[]; target?: string; rule: XRuleDefinition;}FUNCTION data.createAjvValidator
Section titled “FUNCTION data.createAjvValidator”Ajv を使用してバリデーターを作成します。
export function createAjvValidator(options: AjvValidatorOptions = {})引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
options |
AjvValidatorOptions |
任意 | - 検証オプション。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
((schema: object, data: unknown, overrides?: Partial<AjvValidatorOptions>) => { valid: boolean; errors: string[]; rawErrors?: any[]; }) & { ajv: any; } - Description: 検証を実行する関数。
補足 (Remarks)
Section titled “補足 (Remarks)”$schema に基づいて draft-07/2020-12 を自動選択します。コンパイル済みの関数はインスタンス間で共有しません。
コンパイル後にスキーマオブジェクトを変更せず、代わりに新しいオブジェクトを渡してください。
返される ajv プロパティは、デフォルトのドラフト用のインスタンスです。addSchema/addKeyword を使用する場合は、ドラフトを明示的に指定してください。
デフォルトの処理では型強制を無効にし、デフォルト値の挿入や
キーの削除を行いません。明示的な ajvOptions によって入力の変更を有効にできます。未知の x-* キーワードは、
厳格モードが無効であるというだけで業務上の検証ルールになるわけではありません。
コンパイルや設定の失敗時には例外をスローし、データが無効な場合は valid: false を返します。
実行時のコンパイルには、AJV が生成する関数の実行を許可するホストが必要です。
INTERFACE data.AjvValidatorOptions
Section titled “INTERFACE data.AjvValidatorOptions”インターフェース data.AjvValidatorOptions
export interface AjvValidatorOptions { /** JSON Schema draft to use when $schema is unspecified. Defaults to draft-07. If explicitly specified, conflicting $schema values are rejected. */ draft?: 'draft-07' | '2020-12'; /** Ajv options */ ajvOptions?: Record<string, any>; /** Locale setting. If omitted, Ajv default messages are used. */ locale?: 'ja' | 'en';}FUNCTION data.createJsonPathPlusResolver
Section titled “FUNCTION data.createJsonPathPlusResolver”jsonpath-plus を使用して JSONPath リゾルバーを作成します。
export async function createJsonPathPlusResolver(): Promise<JsonPathResolver>戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<JsonPathResolver> - Description: JSONPath リゾルバー関数
例外 (Throws)
Section titled “例外 (Throws)”jsonpath-plus が見つからない場合です。
FUNCTION data.registerSchema
Section titled “FUNCTION data.registerSchema”スキーマをグローバルレジストリに登録します。
登録済みのスキーマは、getSchema() を使用して名前で取得できます。 スキーマ名は schema.title または schema[‘x-db’]?.tableName から解決します。
export function registerSchema(schema: JSONSchema): JSONSchema引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schema |
JSONSchema |
必須 | - 登録する JSONSchema |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
JSONSchema - Description: 登録済みのスキーマ
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { registerSchema } from '@alneas/appkit-core/data/schema/compiler';
registerSchema({ type: 'object', title: 'users', properties: { id: { type: 'string', 'x-db': { primaryKey: true } }, email: { type: 'string', format: 'email' }, }, required: ['id', 'email'],});---
### `FUNCTION` `data.getSchema`
レジストリから名前でスキーマを取得します。
```typescriptexport function getSchema(name: string): JSONSchema | undefined引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
name |
string |
必須 | - 取得するスキーマの名前(title または tableName) |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
JSONSchema | undefined - Description: JSONSchema、見つからない場合は undefined
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { registerSchema, getSchema } from '@alneas/appkit-core/data/schema/compiler';
registerSchema({ title: 'users', type: 'object', properties: { name: { type: 'string' } } });const userSchema = getSchema('users');if (userSchema) { console.log(userSchema.properties);}---
### `FUNCTION` `data.createSchema`
JSONSchema 定義を作成します。
スキーマを定義するための型安全なヘルパー関数です。createJSONSchema() と同様に、渡された定義をそのまま返します。
```typescriptexport function createSchema<T extends JSONSchema>(schema: T): T引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schema |
T |
必須 | - JSONSchema 定義 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
T - Description: 同じスキーマ定義
補足 (Remarks)
Section titled “補足 (Remarks)”これは入力をそのまま返すヘルパーであり、実行時バリデーターではありません。スキーマの複製や凍結は 行いません。データの検証には createAjvValidator を使用し、コンパイル済みのスキーマは変更しないでください。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { createSchema } from '@alneas/appkit-core/data/schema/compiler';
const userSchema = createSchema({ type: 'object', title: 'users', properties: { id: { type: 'string', 'x-db': { primaryKey: true } }, email: { type: 'string', format: 'email' }, }, required: ['id', 'email'],});---
### `FUNCTION` `data.createSchemaLegacy`
関数 `data.createSchemaLegacy`
```typescriptexport function createSchemaLegacy(schema: SchemaDefinition): SchemaDefinition引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schema |
SchemaDefinition |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
SchemaDefinition
非推奨 (Deprecated)
Section titled “非推奨 (Deprecated)”代わりに JSONSchema を指定して createSchema() を使用してください。
FUNCTION data.generateZodSchema
Section titled “FUNCTION data.generateZodSchema”JSONSchema から Zod 検証スキーマを生成します。
プロパティの型や形式に応じた適切な Zod バリデーターを生成し、 実装済みの JSON Schema 制約と、サポートされている x-zod 拡張を適用します。
export function generateZodSchema(schema: JSONSchema): z.ZodObject<z.ZodRawShape>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schema |
JSONSchema |
必須 | - JSONSchema スキーマ |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
z.ZodObject<Readonly<{ [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>; }>, z.core.$strip> - Description: Zod オブジェクトスキーマ
補足 (Remarks)
Section titled “補足 (Remarks)”部分的な変換であり、JSON Schema の評価器ではありません。additionalProperties、型の ユニオン、および正の multipleOf をサポートします。排他的な境界、合成、 参照、高度な配列制約は、一般に保持されません。format: date は 文字列型であることだけを確認します。JSON を正式に検証する境界では createAjvValidator を使用してください。 実装済みの x-zod オプションのみが有効です。宣言されていても、サポートされているとは限りません。 properties の宣言がなくても、ルートおよびネストされた required の項目を確認します。 enum はネストされた値だけでなく、ルートにも適用します。 宣言された、または required に指定された proto プロパティは、変換時に拒否します。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { generateZodSchema, type JSONSchema } from '@alneas/appkit-core/data/schema/compiler';
const userSchema = { title: 'users', type: 'object', properties: { email: { type: 'string', format: 'email' } }, required: ['email'],} satisfies JSONSchema;const zodSchema = generateZodSchema(userSchema);const result = zodSchema.safeParse({ email: '[email protected]' });console.log(result.success); // true---
### `FUNCTION` `data.generateZodSchemaLegacy`
関数 `data.generateZodSchemaLegacy`
```typescriptexport function generateZodSchemaLegacy(schema: SchemaDefinition): z.ZodObject<z.ZodRawShape>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schema |
SchemaDefinition |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
z.ZodObject<Readonly<{ [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>; }>, z.core.$strip>
非推奨 (Deprecated)
Section titled “非推奨 (Deprecated)”代わりに JSONSchema を指定して generateZodSchema() を使用してください。
FUNCTION data.generateZodSchemaCode
Section titled “FUNCTION data.generateZodSchemaCode”JSON Schema を、実行時に generateZodSchema を呼び出すモジュールにシリアライズします。
export function generateZodSchemaCode(schema: JSONSchema): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schema |
JSONSchema |
必須 | - JSON にシリアライズ可能なスキーマです。エクスポート名の接頭辞には、title、次に x-db.tableName、最後に “unnamed” を使用します。識別子に使用できない文字は アンダースコアに置き換え、先頭が数字の場合はアンダースコアを前置します。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: “./compiler” から generateZodSchema をインポートし、シリアライズした入力を JSON.parse で解析してそのヘルパーに渡し、 名前付きスキーマをエクスポートするモジュールソースです。
補足 (Remarks)
Section titled “補足 (Remarks)”出力は単独の z.object 式ではなく、この関数は スキーマの検証やコンパイルを行いません。出力されたモジュールを評価するとヘルパーが実行され、 スキーマ変換エラーが発生する可能性があります。同じディレクトリに generateZodSchema をエクスポートする コンパイラーモジュールを用意し、出力される拡張子なしの import をサポートするリゾルバーを使用してください。 ネイティブの Node.js ESM は、調整なしではその import を解決しません。 実行時ヘルパーは、Core の依存関係である Zod を使用します。
例外 (Throws)
Section titled “例外 (Throws)”循環する入力や BigInt などにより JSON シリアライズが失敗すると、例外をスローします。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { generateZodSchemaCode } from '@alneas/appkit-core/data/schema/compiler';
const code = generateZodSchemaCode({ title: 'users', type: 'object', properties: { name: { type: 'string' } },});console.log(code);// First line: import { generateZodSchema } from "./compiler";// Second line exports usersSchema = generateZodSchema(JSON.parse(...)).// For a bundler that resolves extensionless imports, a sibling compiler.ts can contain:// export { generateZodSchema } from '@alneas/appkit-core/data/schema/compiler';---
### `FUNCTION` `data.generateZodSchemaCodeLegacy`
関数 `data.generateZodSchemaCodeLegacy`
```typescriptexport function generateZodSchemaCodeLegacy(schema: SchemaDefinition): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schema |
SchemaDefinition |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string
非推奨 (Deprecated)
Section titled “非推奨 (Deprecated)”代わりに JSONSchema を指定して generateZodSchemaCode() を使用してください。
FUNCTION data.generateMongoSchema
Section titled “FUNCTION data.generateMongoSchema”JSONSchema から MongoDB/Mongoose のスキーマ定義を生成します。
export function generateMongoSchema(schema: JSONSchema): MongoSchemaDefinition引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schema |
JSONSchema |
必須 | - JSONSchema スキーマ |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
MongoSchemaDefinition - Description: Mongoose のスキーマ定義オブジェクト
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { generateMongoSchema, type JSONSchema } from '@alneas/appkit-core/data/schema/compiler';
const userSchema = { title: 'users', type: 'object', properties: { email: { type: 'string', format: 'email' } }, required: ['email'],} satisfies JSONSchema;const mongoSchema = generateMongoSchema(userSchema);console.log(mongoSchema.email); // Definition data; no database connection is created.---
### `FUNCTION` `data.generateMongoSchemaLegacy`
関数 `data.generateMongoSchemaLegacy`
```typescriptexport function generateMongoSchemaLegacy(schema: SchemaDefinition): MongoSchemaDefinition引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schema |
SchemaDefinition |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
MongoSchemaDefinition
非推奨 (Deprecated)
Section titled “非推奨 (Deprecated)”代わりに JSONSchema を指定して generateMongoSchema() を使用してください。
FUNCTION data.generateSupabaseTableSql
Section titled “FUNCTION data.generateSupabaseTableSql”関数 data.generateSupabaseTableSql
export function generateSupabaseTableSql(schema: SchemaDefinition): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schema |
SchemaDefinition |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string
非推奨 (Deprecated)
Section titled “非推奨 (Deprecated)”代わりに generateSqlFromJSONSchema() を使用してください。
FUNCTION data.generateDefaultValues
Section titled “FUNCTION data.generateDefaultValues”JSONSchema からフォーム用のデフォルト値オブジェクトを生成します。
json-schema.ts の generateJSONSchemaDefaults() に処理を委譲します。
export function generateDefaultValues(schema: JSONSchema): Record<string, unknown>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schema |
JSONSchema |
必須 | - JSONSchema スキーマ |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Record<string, unknown> - Description: デフォルト値のオブジェクト
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { generateDefaultValues, type JSONSchema } from '@alneas/appkit-core/data/schema/compiler';
const userSchema = { title: 'users', type: 'object', properties: { name: { type: 'string', default: 'Guest' } },} satisfies JSONSchema;console.log(generateDefaultValues(userSchema).name); // 'Guest'---
### `FUNCTION` `data.generateDefaultValuesLegacy`
関数 `data.generateDefaultValuesLegacy`
```typescriptexport function generateDefaultValuesLegacy(schema: SchemaDefinition): Record<string, unknown>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schema |
SchemaDefinition |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Record<string, unknown>
非推奨 (Deprecated)
Section titled “非推奨 (Deprecated)”代わりに JSONSchema を指定して generateDefaultValues() を使用してください。
FUNCTION data.generateConvexSchemaCode
Section titled “FUNCTION data.generateConvexSchemaCode”関数 data.generateConvexSchemaCode
export function generateConvexSchemaCode(schema: SchemaDefinition): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schema |
SchemaDefinition |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string
非推奨 (Deprecated)
Section titled “非推奨 (Deprecated)”代わりに generateConvexFromJSONSchema() を使用してください。
FUNCTION data.generateConvexSchemaCodeMultiple
Section titled “FUNCTION data.generateConvexSchemaCodeMultiple”関数 data.generateConvexSchemaCodeMultiple
export function generateConvexSchemaCodeMultiple(schemas: SchemaDefinition[]): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schemas |
SchemaDefinition[] |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string
非推奨 (Deprecated)
Section titled “非推奨 (Deprecated)”代わりに generateConvexFromJSONSchemaMultiple() を使用してください。
FUNCTION data.generateSqlFromJSONSchema
Section titled “FUNCTION data.generateSqlFromJSONSchema”JSON Schema から Supabase/PostgreSQL の CREATE TABLE SQL を生成します。
export function generateSqlFromJSONSchema(schema: JSONSchema): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schema |
JSONSchema |
必須 | - JSON Schema オブジェクト |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: CREATE TABLE SQL 文
補足 (Remarks)
Section titled “補足 (Remarks)”x-db.nullable を優先し、未指定の場合は null を許容する型を反映します。主キーは常に NOT NULL です。
例外 (Throws)
Section titled “例外 (Throws)”/properties が空または未指定の場合です(バンドルの呼び出し元は、選択したテーブルを明示的に渡してください)。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { generateSqlFromJSONSchema, type JSONSchema } from '@alneas/appkit-core/data/schema/compiler';
const userSchema = { title: 'users', type: 'object', properties: { id: { type: 'string', 'x-db': { primaryKey: true } }, name: { type: 'string' } },} satisfies JSONSchema;console.log(generateSqlFromJSONSchema(userSchema)); // Review the generated DDL before execution.---
### `FUNCTION` `data.generateConvexFromJSONSchema`
JSON Schema から Convex の schema.ts コードを生成します。
```typescriptexport function generateConvexFromJSONSchema(schema: JSONSchema): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schema |
JSONSchema |
必須 | - JSON Schema オブジェクト |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: Convex の schema.ts 用のコード文字列
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { generateConvexFromJSONSchema, type JSONSchema } from '@alneas/appkit-core/data/schema/compiler';
const userSchema = { title: 'users', type: 'object', properties: { name: { type: 'string' } }, required: ['name'],} satisfies JSONSchema;console.log(generateConvexFromJSONSchema(userSchema)); // Generated source text; no Convex client is required here.---
### `FUNCTION` `data.generateConvexFromJSONSchemaMultiple`
複数の JSON Schema から、単一の Convex schema.ts コード文字列を生成します。
```typescriptexport function generateConvexFromJSONSchemaMultiple(schemas: JSONSchema[]): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schemas |
JSONSchema[] |
必須 | - JSON Schema オブジェクトの配列 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: Convex の schema.ts 用のコード文字列
FUNCTION data.generateRLSFromJSONSchema
Section titled “FUNCTION data.generateRLSFromJSONSchema”JSON Schema から PostgreSQL の RLS ポリシー SQL を生成します。
x-rls 拡張に基づいて、ALTER TABLE ENABLE ROW LEVEL SECURITY 文と CREATE POLICY 文を生成します。
export function generateRLSFromJSONSchema(schema: JSONSchema): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schema |
JSONSchema |
必須 | - JSON Schema オブジェクト |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: RLS ポリシーの SQL 文(RLS が無効、またはポリシーがない場合は空文字列)
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { generateRLSFromJSONSchema, type JSONSchema } from '@alneas/appkit-core/data/schema/compiler';
const postSchema = { title: 'posts', type: 'object', properties: { user_id: { type: 'string' } }, 'x-rls': { enabled: true, select: { roles: ['authenticated'], using: 'auth.uid() = user_id' } },} satisfies JSONSchema;console.log(generateRLSFromJSONSchema(postSchema));// Generates ENABLE ROW LEVEL SECURITY and a SELECT policy using the supplied expression.// Review the SQL and host authentication setup before execution.---
### `FUNCTION` `data.generateRLSFromJSONSchemaMultiple`
複数の JSON Schema から RLS ポリシー SQL を一括生成します。
```typescriptexport function generateRLSFromJSONSchemaMultiple(schemas: JSONSchema[]): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schemas |
JSONSchema[] |
必須 | - JSON Schema オブジェクトの配列 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: RLS ポリシーの SQL 文
FUNCTION data.generateAlterTableFromJSONSchema
Section titled “FUNCTION data.generateAlterTableFromJSONSchema”JSON Schema から ALTER TABLE SQL を生成します。
既存のテーブルに新しい列を追加する ALTER TABLE 文を生成します。
export function generateAlterTableFromJSONSchema( schema: JSONSchema, existingColumns: string[] = [],): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schema |
JSONSchema |
必須 | - JSON Schema オブジェクト |
existingColumns |
string[] |
任意 | - 既存の列名の配列(これらの列は生成しません) |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: ALTER TABLE SQL 文
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { generateAlterTableFromJSONSchema, type JSONSchema } from '@alneas/appkit-core/data/schema/compiler';
const userSchema = { title: 'users', type: 'object', properties: { id: { type: 'string' }, name: { type: 'string' }, email: { type: 'string' } },} satisfies JSONSchema;console.log(generateAlterTableFromJSONSchema(userSchema, ['id', 'name']));// Generates ADD COLUMN for email; review the DDL before execution.---
### `FUNCTION` `data.generateIndexesFromJSONSchema`
JSON Schema からインデックス作成 SQL を生成します。
```typescriptexport function generateIndexesFromJSONSchema(schema: JSONSchema): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schema |
JSONSchema |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string
FUNCTION data.generateUpdatedAtTriggerFromJSONSchema
Section titled “FUNCTION data.generateUpdatedAtTriggerFromJSONSchema”JSON Schema から updated_at トリガーの SQL を生成します。
export function generateUpdatedAtTriggerFromJSONSchema(schema: JSONSchema): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schema |
JSONSchema |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string
FUNCTION data.generateMigrationFromJSONSchema
Section titled “FUNCTION data.generateMigrationFromJSONSchema”JSON Schema から完全なマイグレーション SQL を生成します。
CREATE TABLE または ALTER TABLE、 インデックス、RLS、トリガーを含む完全なマイグレーション SQL を生成します。
export function generateMigrationFromJSONSchema( schema: JSONSchema, options: MigrationOptions = {},): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schema |
JSONSchema |
必須 | - JSON Schema オブジェクト |
options |
MigrationOptions |
任意 | - マイグレーションのオプション |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: 完全なマイグレーション SQL
FUNCTION data.generateMigrationFromJSONSchemaMultiple
Section titled “FUNCTION data.generateMigrationFromJSONSchemaMultiple”複数の JSON Schema から一括マイグレーション SQL を生成します。
外部キーの依存関係を考慮してスキーマを並べ替え、 単一のマイグレーションファイルに出力します。
export function generateMigrationFromJSONSchemaMultiple( schemas: JSONSchema[], options: MigrationOptions = {},): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schemas |
JSONSchema[] |
必須 | - JSON Schema オブジェクトの配列 |
options |
MigrationOptions |
任意 | - マイグレーションのオプション |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: 完全なマイグレーション SQL
INTERFACE data.SchemaStep
Section titled “INTERFACE data.SchemaStep”複数ステップのフォーム用のステップ定義です。
export interface SchemaStep { /** Step identifier */ name: string; /** Display title of the step */ title: string; /** Step description (optional) */ description?: string;}TYPE data.MongoFieldType
Section titled “TYPE data.MongoFieldType”型 data.MongoFieldType
export type MongoFieldType = | typeof String | typeof Number | typeof Boolean | typeof Date | typeof Object;INTERFACE data.MongoFieldDefinition
Section titled “INTERFACE data.MongoFieldDefinition”インターフェース data.MongoFieldDefinition
export interface MongoFieldDefinition { type: MongoFieldType; required?: boolean; enum?: Array<string | number>; default?: unknown; unique?: boolean;}TYPE data.MongoSchemaDefinition
Section titled “TYPE data.MongoSchemaDefinition”型 data.MongoSchemaDefinition
export type MongoSchemaDefinition = Record<string, MongoFieldDefinition>;CONST data.schemaRegistry
Section titled “CONST data.schemaRegistry”グローバルスキーマレジストリです。
JSONSchema スキーマを名前で管理します。 キーは schema.title または schema[‘x-db’]?.tableName です。
export const data.schemaRegistry: Record<string, JSONSchema>INTERFACE data.MigrationOptions
Section titled “INTERFACE data.MigrationOptions”マイグレーション生成のオプションです。
export interface MigrationOptions { /** Existing table name (generates ALTER TABLE when specified) */ existingTable?: string; /** Include index generation */ includeIndexes?: boolean; /** Include RLS policy generation */ includeRLS?: boolean; /** Include updated_at trigger generation */ includeUpdatedAtTrigger?: boolean; /** Include table comment generation */ includeComments?: boolean;}FUNCTION data.generateMermaidERD
Section titled “FUNCTION data.generateMermaidERD”JSON Schema から Mermaid の ER 図を生成します。
export function generateMermaidERD(schemas: JSONSchema[]): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schemas |
JSONSchema[] |
必須 | - 表示する JSON Schema の配列 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: Mermaid erDiagram 形式の文字列
使用例 (Example)
Section titled “使用例 (Example)”```typescriptconst mermaid = generateMermaidERD([userSchema, orderSchema]);---
### `FUNCTION` `data.verifySchema`
JSON Schema(設計)を物理テーブル(実際の DB 構造)と比較して検証します。
```typescriptexport function verifySchema(schema: JSONSchema, physical: PhysicalTable): VerificationResult引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schema |
JSONSchema |
必須 | - 検証対象の JSON Schema(設計) |
physical |
PhysicalTable |
必須 | - データベースから取得した物理構造(実際の構造) |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
VerificationResult - Description: 検証結果
補足 (Remarks)
Section titled “補足 (Remarks)”PostgreSQL 用の生成処理と同じ型および NULL のマッピングを使用します。NULL 許容性の不一致は、どちらの方向でもエラーになります。 型の不一致は従来どおり警告となります。厳密に検証するには、問題の内容を直接確認してください。
INTERFACE data.PhysicalColumn
Section titled “INTERFACE data.PhysicalColumn”物理データベース列のメタデータです。
export interface PhysicalColumn { /** Column name */ name: string; /** Data type (e.g., udt_name) */ type: string; /** Nullable flag */ isNullable: boolean; /** Primary key flag */ isPrimaryKey: boolean; /** Unique constraint flag */ isUnique: boolean; /** Default value */ defaultValue?: string | null;}INTERFACE data.PhysicalTable
Section titled “INTERFACE data.PhysicalTable”物理データベーステーブルのメタデータです。
export interface PhysicalTable { /** Table name */ name: string; /** Array of column definitions */ columns: PhysicalColumn[];}INTERFACE data.VerificationIssue
Section titled “INTERFACE data.VerificationIssue”検証中に検出された問題です。
export interface VerificationIssue { /** Type of issue */ type: 'missing_table' | 'missing_column' | 'type_mismatch' | 'constraint_mismatch'; /** Path where issue occurred */ path: string; /** Expected value or state */ expected: string; /** Actual value or state */ actual: string; /** Severity level */ severity: 'error' | 'warning'; /** Human-readable error message */ message: string;}INTERFACE data.VerificationResult
Section titled “INTERFACE data.VerificationResult”検証結果のレポートです。
export interface VerificationResult { /** Whether valid without errors (zero severity: error issues) */ isValid: boolean; /** List of detected issues */ issues: VerificationIssue[];}FUNCTION data.physicalToJSONSchema
Section titled “FUNCTION data.physicalToJSONSchema”物理テーブルのメタデータ (PhysicalTable) から JSON Schema を生成します。
export function physicalToJSONSchema(physical: PhysicalTable): JSONSchema引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
physical |
PhysicalTable |
必須 | - 生成元の物理テーブルのメタデータ |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
JSONSchema - Description: 生成された JSON Schema
使用例 (Example)
Section titled “使用例 (Example)”```typescriptconst schema = physicalToJSONSchema(physicalTable);---
### `FUNCTION` `data.snakeToCamel`
snake_case の文字列を camelCase に変換します。
```typescriptexport function snakeToCamel(str: string): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
str |
string |
必須 | - 変換対象の文字列 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: camelCase に変換された文字列
使用例 (Example)
Section titled “使用例 (Example)”```typescriptsnakeToCamel('client_id'); // => 'clientId'---
### `FUNCTION` `data.camelToSnake`
camelCase の文字列を snake_case に変換します。
```typescriptexport function camelToSnake(str: string): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
str |
string |
必須 | - 変換対象の文字列 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: snake_case に変換された文字列
使用例 (Example)
Section titled “使用例 (Example)”```typescriptcamelToSnake('clientId'); // => 'client_id'---
### `FUNCTION` `data.capitalize`
文字列の先頭の文字を大文字にします。
```typescriptexport function capitalize(str: string): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
str |
string |
必須 | - 先頭を大文字にする対象の文字列 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: 先頭を大文字にした文字列
FUNCTION data.toSingular
Section titled “FUNCTION data.toSingular”英語の複数形の名詞を単数形に変換します。
pluralize パッケージを使用して、不規則な複数形に対応します。
export function toSingular(str: string): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
str |
string |
必須 | - 複数形の文字列 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: 単数形の文字列
使用例 (Example)
Section titled “使用例 (Example)”```typescripttoSingular('deliveries'); // => 'delivery'toSingular('orders'); // => 'order'toSingular('statuses'); // => 'status'toSingular('addresses'); // => 'address'---
### `FUNCTION` `data.jsonSchemaPropertyToTsType`
JSON Schema のプロパティから TypeScript の型文字列を生成します。
```typescriptexport function jsonSchemaPropertyToTsType(prop: JSONSchemaProperty, respectXGen = true): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
prop |
JSONSchemaProperty |
必須 | - JSON Schema のプロパティ定義 |
respectXGen |
boolean |
任意 | - x-gen.tsType による上書きを反映するかどうか |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: TypeScript の型の文字列表現
補足 (Remarks)
Section titled “補足 (Remarks)”type 配列のすべての要素(null を含む)を保持します。enum の文字列を JSON としてエスケープします。
FUNCTION data.generateTypeScriptFromSchemas
Section titled “FUNCTION data.generateTypeScriptFromSchemas”JSON Schema の配列から TypeScript のインターフェースコードを生成します。
export function generateTypeScriptFromSchemas( schemas: SchemaInput[], options: TypegenOptions = {},): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schemas |
SchemaInput[] |
必須 | - 入力スキーマの配列 |
options |
TypegenOptions |
任意 | - 型生成のオプション |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: 生成された TypeScript コード文字列
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { generateTypeScriptFromSchemas } from "./typegen";
const code = generateTypeScriptFromSchemas( [{ filename: 'clients.schema.json', schema: clientsSchema }], { camelCase: true, singularize: true });---
### `FUNCTION` `data.generateSchemaRegistry`
入力スキーマからスキーマレジストリの JSON を生成します。
```typescriptexport function generateSchemaRegistry( schemas: SchemaInput[], options: { registryVersion?: string; profile?: string; } = {},): SchemaRegistry引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
schemas |
SchemaInput[] |
必須 | - 入力スキーマの配列 |
options |
{ registryVersion?: string; profile?: string; } |
任意 | - レジストリのメタデータオプション |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
SchemaRegistry - Description: レジストリオブジェクト
INTERFACE data.TypegenOptions
Section titled “INTERFACE data.TypegenOptions”型生成のオプションです。
export interface TypegenOptions { /** Whether to convert property names to camelCase (default: false) */ camelCase?: boolean; /** Whether to singularize interface names (default: true) */ singularize?: boolean; /** Suffix used to avoid collisions with built-in names like 'file' (default: 'Record') */ conflictSuffix?: string; /** Header banner comment */ banner?: string; /** Whether to respect x-gen.tsType override (default: true) */ respectXGen?: boolean; /** Set of reserved names to avoid collisions with browser built-ins */ reservedNames?: Set<string>;}INTERFACE data.SchemaInput
Section titled “INTERFACE data.SchemaInput”スキーマの入力エントリです。
export interface SchemaInput { /** Filename (e.g., 'clients.schema.json') */ filename: string; /** Parsed JSON Schema */ schema: JSONSchema;}INTERFACE data.RegistryEntry
Section titled “INTERFACE data.RegistryEntry”スキーマレジストリの JSON エントリです。
export interface RegistryEntry { id: string; doc_type?: string; version: string; edi_version?: string; path: string; title: string;}INTERFACE data.SchemaRegistry
Section titled “INTERFACE data.SchemaRegistry”スキーマレジストリの JSON 構造です。
export interface SchemaRegistry { registry_version: string; updated_at: string; profile: string; schemas: RegistryEntry[];}FUNCTION data.zodToJSONSchema
Section titled “FUNCTION data.zodToJSONSchema”Zod スキーマから JSON Schema(2020-12 互換)を生成します。
export function zodToJSONSchema( zodSchema: z.ZodTypeAny, meta?: { title?: string; description?: string },): JSONSchema引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
zodSchema |
z.ZodTypeAny<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> |
必須 | - 変換対象の Zod オブジェクトスキーマ |
meta |
{ title?: string; description?: string; } | undefined |
任意 | - title や description などの追加メタデータ |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
JSONSchema - Description: JSONSchema
補足 (Remarks)
Section titled “補足 (Remarks)”内部の構造情報を含め、サポート対象の Zod の構造を調べる部分的なアダプターです。 情報を損失なく変換するものではありません。null を許容する型、デフォルト値、 追加の検証条件、変換処理は、一般に保持されません。結果を外部向けの契約として使用する前に、想定する有効なケースと 無効なケースを比較してください。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptconst userZod = z.object({ name: z.string().min(1), email: z.string().email(), role: z.enum(['admin', 'member']), age: z.number().optional(),});
const userJsonSchema = zodToJSONSchema(userZod, { title: 'User' });---
### `FUNCTION` `data.getSubdivisions`
指定した国の行政区画を取得します。
```typescriptexport function getSubdivisions(countryCode: string): SubdivisionOption[]引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
countryCode |
string |
必須 | - ISO 3166-1 alpha-2 コード |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
SubdivisionOption[] - Description: 行政区画の選択肢、または空の配列
FUNCTION data.getAllSubdivisions
Section titled “FUNCTION data.getAllSubdivisions”すべての行政区画を取得します(国が選択されていない場合用)。
export function getAllSubdivisions(): SubdivisionOption[]戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
SubdivisionOption[] - Description: すべての国の全行政区画
FUNCTION data.validatePostalCode
Section titled “FUNCTION data.validatePostalCode”指定した国の郵便番号を検証します。
export function validatePostalCode(code: string, countryCode: string): boolean引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
code |
string |
必須 | - 検証する郵便番号 |
countryCode |
string |
必須 | - ISO 3166-1 alpha-2 コード |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
boolean - Description: 有効な場合は true
FUNCTION data.formatJapanesePostalCode
Section titled “FUNCTION data.formatJapanesePostalCode”日本の郵便番号を整形します(ハイフンがない場合は追加します)。
export function formatJapanesePostalCode(code: string): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
code |
string |
必須 | - 未整形の郵便番号 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: 整形済みの郵便番号
FUNCTION data.getCountryFromSubdivision
Section titled “FUNCTION data.getCountryFromSubdivision”行政区画コードから国コードを取得します。
export function getCountryFromSubdivision(subdivisionCode: string): string | undefined引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
subdivisionCode |
string |
必須 | - ISO 3166-2 コード(例: JP-13) |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string | undefined - Description: 国コード(例: JP)
INTERFACE data.CountryOption
Section titled “INTERFACE data.CountryOption”地理データ - ISO 3166 コード。
国、行政区画、郵便番号パターンに関する ISO 標準データです。
export interface CountryOption { /** ISO 3166-1 alpha-2 code */ value: string; /** Japanese label */ label: string; /** English label */ labelEn: string;}INTERFACE data.SubdivisionOption
Section titled “INTERFACE data.SubdivisionOption”インターフェース data.SubdivisionOption
export interface SubdivisionOption { /** ISO 3166-2 code (e.g., JP-13, US-CA) */ value: string; /** Local label */ label: string; /** English label (optional) */ labelEn?: string;}INTERFACE data.PostalPattern
Section titled “INTERFACE data.PostalPattern”インターフェース data.PostalPattern
export interface PostalPattern { /** Validation regex */ pattern: RegExp; /** Format description */ format: string; /** Example value */ example: string;}CONST data.COUNTRIES
Section titled “CONST data.COUNTRIES”エクスポートされるシンボル data.COUNTRIES
export const data.COUNTRIES: CountryOption[]CONST data.SUBDIVISIONS
Section titled “CONST data.SUBDIVISIONS”エクスポートされるシンボル data.SUBDIVISIONS
export const data.SUBDIVISIONS: Record<string, SubdivisionOption[]>CONST data.POSTAL_PATTERNS
Section titled “CONST data.POSTAL_PATTERNS”エクスポートされるシンボル data.POSTAL_PATTERNS
export const data.POSTAL_PATTERNS: Record<string, PostalPattern>CONST data.SUBDIVISION_ALIASES
Section titled “CONST data.SUBDIVISION_ALIASES”ウィジェットの別名から固定の国コードへのマッピングです。 これらの別名によって、行政区画を特定の国に絞り込みます。
export const data.SUBDIVISION_ALIASES: Record<string, string>FUNCTION data.isCodelistCode
Section titled “FUNCTION data.isCodelistCode”値が CodelistCode の構造に一致するかどうかを判定します。
export function isCodelistCode(value: unknown): value is CodelistCode引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
value |
unknown |
必須 | - 確認対象の値 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
boolean - Description: 値が CodelistCode の場合は true
FUNCTION data.isCodelist
Section titled “FUNCTION data.isCodelist”値が Codelist の構造に一致するかどうかを判定します。
export function isCodelist(value: unknown): value is Codelist引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
value |
unknown |
必須 | - 確認対象の値 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
boolean - Description: 値が Codelist の場合は true
FUNCTION data.parseCodelist
Section titled “FUNCTION data.parseCodelist”値を検証し、有効な場合は Codelist として返します。
export function parseCodelist(value: unknown): Codelist引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
value |
unknown |
必須 | - 入力値 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Codelist - Description: 有効なコードリスト
例外 (Throws)
Section titled “例外 (Throws)”形式が無効な場合
FUNCTION data.resolveCodelistEnum
Section titled “FUNCTION data.resolveCodelistEnum”コードリストを列挙値の配列に変換します。
export function resolveCodelistEnum( codelist: Codelist, options: { includeDeprecated?: boolean } = {},): string[]引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
codelist |
Codelist |
必須 | - コードリストオブジェクト |
options |
{ includeDeprecated?: boolean; } |
任意 | - 非推奨コードの処理オプション |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string[] - Description: 列挙型用のコード文字列の配列
FUNCTION data.resolveCodelistEnumFromSchema
Section titled “FUNCTION data.resolveCodelistEnumFromSchema”スキーマの x-codelist 設定を使用して列挙値の配列を生成します。
export function resolveCodelistEnumFromSchema( codelist: Codelist, config?: XCodelistOptions,): string[]引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
codelist |
Codelist |
必須 | - コードリストオブジェクト |
config |
XCodelistOptions | undefined |
任意 | - スキーマの x-codelist 設定 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string[] - Description: 列挙型用のコード文字列の配列
FUNCTION data.resolveCodelistOptions
Section titled “FUNCTION data.resolveCodelistOptions”コードリストを UI 選択肢の配列に変換します。
export function resolveCodelistOptions( codelist: Codelist, options: CodelistResolveOptions = {},): CodelistOption[]引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
codelist |
Codelist |
必須 | - コードリストオブジェクト |
options |
CodelistResolveOptions |
任意 | - ラベルの言語と非推奨コードの処理オプション |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
CodelistOption[] - Description: UI 用の { label, value } の配列
FUNCTION data.resolveCodelistOptionsFromSchema
Section titled “FUNCTION data.resolveCodelistOptionsFromSchema”スキーマの x-codelist 設定を使用して、コードリストを UI 選択肢に変換します。
export function resolveCodelistOptionsFromSchema( codelist: Codelist, config?: XCodelistOptions,): CodelistOption[]引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
codelist |
Codelist |
必須 | - コードリストオブジェクト |
config |
XCodelistOptions | undefined |
任意 | - スキーマの x-codelist 設定 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
CodelistOption[] - Description: UI 用の { label, value } の配列
INTERFACE data.CodelistCode
Section titled “INTERFACE data.CodelistCode”インターフェース data.CodelistCode
export interface CodelistCode { code: string; label_ja?: string; label_en?: string; status?: 'active' | 'deprecated' | string;}INTERFACE data.Codelist
Section titled “INTERFACE data.Codelist”インターフェース data.Codelist
export interface Codelist { codelist_id: string; version: string; title?: string; codes: CodelistCode[];}INTERFACE data.CodelistOption
Section titled “INTERFACE data.CodelistOption”インターフェース data.CodelistOption
export interface CodelistOption { label: string; value: string;}INTERFACE data.CodelistResolveOptions
Section titled “INTERFACE data.CodelistResolveOptions”インターフェース data.CodelistResolveOptions
export interface CodelistResolveOptions { labelField?: 'label_ja' | 'label_en'; includeDeprecated?: boolean; /** Fallback order for label resolution */ fallbackOrder?: Array<'label_ja' | 'label_en' | 'code'>;}CLASS data.SchemaDataConverter
Section titled “CLASS data.SchemaDataConverter”JSON Schema 定義に基づいて、snake_case の DB データと camelCase の JS オブジェクトを双方向に変換するコンバーターです。
class data.SchemaDataConverter使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { SchemaDataConverter } from "..";const clientsSchema = { type: 'object', properties: { name: { type: 'string' } } } as const;
const converter = new SchemaDataConverter<Client>(clientsSchema);
// DB → JSconst jsClient = converter.fromDB(dbRow);console.log(jsClient.companyName); // Access via camelCase
// JS → DBconst dbPayload = converter.toDB({ companyName: '田川製作所' });// => { company_name: '田川製作所' }---
### `FUNCTION` `data.generateJsonExtensionSql`
仮想列・生成列とスキーマ制約を追加するための SQL 文を、各 SQL 方言に対応して生成します。無停止運用のガイドラインに従います。- Oracle / OCI ADB では NOVALIDATE / 仮想列を使用します- Postgres では NOT VALID / STORED 生成列を使用します- SQLite では STORED 生成列を使用します
```typescriptexport function generateJsonExtensionSql( tableName: string, extensions: TableJsonExtensions, dialect: SchemaDialect): string[]引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
tableName |
string |
必須 | |
extensions |
TableJsonExtensions |
必須 | |
dialect |
SchemaDialect |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string[]
FUNCTION data.buildJsonMergeExpression
Section titled “FUNCTION data.buildJsonMergeExpression”関数 data.buildJsonMergeExpression
export function buildJsonMergeExpression( jsonColumn: string, jsonPath: string, value: unknown, dialect: SchemaDialect, paramPlaceholder?: string): JsonMergeQuery引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
jsonColumn |
string |
必須 | |
jsonPath |
string |
必須 | |
value |
unknown |
必須 | |
dialect |
SchemaDialect |
必須 | |
paramPlaceholder |
string | undefined |
任意 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
JsonMergeQuery
TYPE data.SchemaDialect
Section titled “TYPE data.SchemaDialect”型 data.SchemaDialect
export type SchemaDialect = 'sqlite' | 'oracle' | 'postgres';INTERFACE data.VirtualColumnDefinition
Section titled “INTERFACE data.VirtualColumnDefinition”インターフェース data.VirtualColumnDefinition
export interface VirtualColumnDefinition { name: string; /** Expression to extract from the JSON column, e.g. "$.plugins.hotel.roomId" */ jsonPath: string; /** Physical target data type for each dialect */ type: Partial<Record<SchemaDialect, string>> & { default: string }; /** Optional documentation */ description?: string; /** Optional foreign key reference (must be tenant-scoped) */ references?: { table: string; /** Foreign key columns, default is ["tenant_id", "id"] */ columns: [string, string]; }; /** Whether to create a unique constraint or partial unique index */ unique?: boolean;}INTERFACE data.JsonSchemaValidationDefinition
Section titled “INTERFACE data.JsonSchemaValidationDefinition”インターフェース data.JsonSchemaValidationDefinition
export interface JsonSchemaValidationDefinition { name: string; /** JSON path inside the document to validate, e.g. "$.plugins.hotel" */ jsonPath?: string; /** JSON Schema (Draft 2020-12 compatible object) */ schema: Record<string, unknown>; description?: string;}INTERFACE data.TableJsonExtensions
Section titled “INTERFACE data.TableJsonExtensions”インターフェース data.TableJsonExtensions
export interface TableJsonExtensions { /** Column name storing the JSON document. Defaults to "payload" */ jsonColumn?: string; /** Virtual / generated column definitions */ virtualColumns?: VirtualColumnDefinition[]; /** JSON Schema validation constraints */ validations?: JsonSchemaValidationDefinition[];}INTERFACE data.JsonMergeQuery
Section titled “INTERFACE data.JsonMergeQuery”SQL 方言に応じた JSON 部分更新(マージ・設定)の式または文を構築します。 これにより、あるプラグインの属性を更新しても、共有ドキュメント内の他のプラグインの データやカスタムフィールドが上書きされたり削除されたりすることを防ぎます。
export interface JsonMergeQuery { /** The SQL expression representing the new JSON value after merge */ valueExpression: string; /** Parameterized placeholder or serialized value */ paramValue: unknown;}FUNCTION data.castValuesBySchema
Section titled “FUNCTION data.castValuesBySchema”JSON Schema による検証とは別に、フォームの値を変換します。デフォルト値の追加、 $ref の解決、合成スキーマの分岐選択、真偽値・日付・null 値の型強制は行いません。 数値用の空文字列は、null 許容の数値型では null、それ以外では undefined になります。 従来の数値解析では、意図的に数値として解釈できる先頭部分を受け入れ、整数では小数部を切り捨てます。 型が一致しないオブジェクト・配列の値や変換できない文字列は、検証のために保持します。 宣言済みの自身のプロパティ、prefixItems、items だけを走査し、未知のプロパティは保持します。 入力は変更しません。深さ 64 または訪問値数 10,000 を超えると例外をスローします(循環参照も対象です)。
export function castValuesBySchema( values: any, schema: JSONSchemaProperty, options: SchemaCastOptions = {},): any引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
values |
any |
必須 | |
schema |
JSONSchemaProperty |
必須 | |
options |
SchemaCastOptions |
任意 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
any
INTERFACE data.SchemaCastOptions
Section titled “INTERFACE data.SchemaCastOptions”インターフェース data.SchemaCastOptions
export interface SchemaCastOptions { /** Compatibility default: parseInt/parseFloat prefixes. strict accepts a complete finite JSON number and checks integer results with Number.isInteger. */ numericMode?: 'legacy' | 'strict';}CLASS data.MinHeap
Section titled “CLASS data.MinHeap”呼び出し元が指定した比較関数を使用して、値を二分最小ヒープに格納します。
class data.MinHeap補足 (Remarks)
Section titled “補足 (Remarks)”比較結果が等しい場合、挿入順序が安定して維持される保証はありません。 同じ優先度での順序が重要な場合は、比較関数にタイブレーカーを追加してください。操作は このインスタンスを変更します。呼び出し元間の同期機構は提供しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { MinHeap } from '@alneas/appkit-core/data/min-heap';const priorities = new MinHeap<number>((a, b) => a - b);priorities.push(3);priorities.push(1);console.log(priorities.peek()); // 1; the value remains in the heapconsole.log(priorities.pop()); // 1---
### `FUNCTION` `data.toInputDate`
値をホストのローカル時間に基づく HTML 日付入力用文字列に整形します。解析できない日付形式の文字列には、文字列処理によるフォールバックを適用します。
```typescriptexport function toInputDate(val: unknown): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
val |
unknown |
必須 | - Date、Date コンストラクターで扱える値、またはその他の入力です。数値のゼロを含む偽と評価される値は、空文字列になります。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: ホストのローカル日付要素から得た YYYY-MM-DD、解析できない文字列がそのパターンで始まる場合は先頭の 10 文字、それ以外の無効な入力や型強制の失敗時は空文字列です。
補足 (Remarks)
Section titled “補足 (Remarks)”日付の検証ではありません。字句的なフォールバックによって、実在しない日付が保持される場合があります。UTC 文字列は、ホストのローカル日付では異なる日として表示されることがあります。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { toInputDate } from '@alneas/appkit-core/data/date-utils';console.log(toInputDate(new Date(2024, 0, 15))); // '2024-01-15'console.log(toInputDate(null)); // ''---
### `FUNCTION` `data.toInputDateTime`
値をホストのローカル時間に基づく HTML datetime-local 文字列に整形し、文字列処理によるフォールバックを適用します。
```typescriptexport function toInputDateTime(val: unknown): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
val |
unknown |
必須 | - Date、Date コンストラクターで扱える値、またはその他の入力です。数値のゼロを含む偽と評価される値は、空文字列になります。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: ホストのローカル日時フィールドから得た YYYY-MM-DDTHH:mm、解析できない文字列の先頭がその形式に一致する場合は先頭の 16 文字、それ以外の失敗時は空文字列です。
補足 (Remarks)
Section titled “補足 (Remarks)”秒とタイムゾーンオフセットは省略されます。プレフィックスによるフォールバックは、実際の暦や時刻の範囲を検証しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { toInputDateTime } from '@alneas/appkit-core/data/date-utils';console.log(toInputDateTime(new Date(2024, 0, 15, 14, 30))); // '2024-01-15T14:30'console.log(toInputDateTime(null)); // ''---
### `TYPE` `data.MinFromMidnight`
型 `data.MinFromMidnight`
```typescriptexport type MinFromMidnight = number | undefined;TYPE data.Minutes
Section titled “TYPE data.Minutes”分単位の期間、または値がない状態を表します。小数や負の値も除外しません。
export type Minutes = number | undefined;CONST data.DEFAULT_LOCALE
Section titled “CONST data.DEFAULT_LOCALE”モジュール評価時に解決されたホストのロケールです。フォールバックは en-US です。ロケールを明示すると、整形結果を再現可能にできます。
export const data.DEFAULT_LOCALE: stringCONST data.TIME_ZONE_LOCAL
Section titled “CONST data.TIME_ZONE_LOCAL”モジュール評価時に解決されたホストのタイムゾーンです。フォールバックは UTC です。その後のホスト設定の変更には追従しません。
export const data.TIME_ZONE_LOCAL: stringCONST data.ONE_DAY_MS
Section titled “CONST data.ONE_DAY_MS”固定の 24 時間をミリ秒で表した期間です。ローカル暦の各日の実際の経過時間を表すものではありません。
export const data.ONE_DAY_MS: 86400000CONST data.ONE_HOUR_MS
Section titled “CONST data.ONE_HOUR_MS”固定の 1 時間をミリ秒で表した期間です。
export const data.ONE_HOUR_MS: 3600000CONST data.OFFSET_HOURS_LOCAL
Section titled “CONST data.OFFSET_HOURS_LOCAL”モジュール評価時に測定し、整数時間に丸めたホストの時差です。1 時間未満の端数を含むタイムゾーンでは精度が失われ、その後の夏時間の変更も反映されません。
export const data.OFFSET_HOURS_LOCAL: numberCONST data.toDate
Section titled “CONST data.toDate”既存の Date を同じ参照のまま返すか、JavaScript の Date コンストラクターで文字列を解析します。
export const data.toDate: (date: Date | string) => Date補足 (Remarks)
Section titled “補足 (Remarks)”検証、タイムゾーンの正規化、入力された Date の複製は行いません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { toDate } from '@alneas/appkit-core/data/date-utils';const original = new Date('2024-01-15T00:00:00Z');console.log(toDate(original) === original); // trueconsole.log(Number.isNaN(toDate('invalid').getTime())); // true---
### `CONST` `data.getDateParts`
Intl を使用して、指定したタイムゾーンにおけるある時点の暦フィールドを抽出します。
```typescriptexport const data.getDateParts: (date: Date, timeZone?: string) => { year: number; month: number; day: number; hour: number; minute: number; second: number; weekday: string; }例外 (Throws)
Section titled “例外 (Throws)”無効な時点や未対応のタイムゾーンに対する Intl のエラーを伝播します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { getDateParts } from '@alneas/appkit-core/data/date-utils';console.log(getDateParts(new Date('2024-01-15T23:30:00Z'), 'Asia/Tokyo').day); // 16---
### `CONST` `data.isTimeZoneValid`
タイムゾーンとロケールの組み合わせを Intl が受け入れるか確認します。
```typescriptexport const data.isTimeZoneValid: (timezone: string, locale?: string) => boolean使用例 (Example)
Section titled “使用例 (Example)”```tsimport { isTimeZoneValid } from '@alneas/appkit-core/data/date-utils';console.log(isTimeZoneValid('Asia/Tokyo', 'en-US')); // trueconsole.log(isTimeZoneValid('Invalid/Zone', 'en-US')); // false---
### `CONST` `data.getWeekdayNumber`
指定したタイムゾーンにおける、ある時点の曜日番号を返します。
```typescriptexport const data.getWeekdayNumber: (date: Date | string, timeZone?: string) => number例外 (Throws)
Section titled “例外 (Throws)”無効な日付や未対応のタイムゾーンに対する Intl のエラーを伝播します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { getWeekdayNumber } from '@alneas/appkit-core/data/date-utils';console.log(getWeekdayNumber('2024-01-15T12:00:00Z', 'UTC')); // 1---
### `CONST` `data.getWeekday`
指定したロケールとタイムゾーンで、曜日の短縮名を整形します。
```typescriptexport const data.getWeekday: (date: Date | string, locale?: string, timeZone?: string) => string例外 (Throws)
Section titled “例外 (Throws)”無効なロケールやタイムゾーンのオプションに対する Intl のエラーを伝播します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { getWeekday } from '@alneas/appkit-core/data/date-utils';console.log(getWeekday('2024-01-15T12:00:00Z', 'en-US', 'UTC')); // 'Mon'---
### `CONST` `data.isWeekend`
指定したタイムゾーンで、ある時点が土曜日または日曜日に当たるか確認します。
```typescriptexport const data.isWeekend: (date: Date | string, timeZone?: string) => boolean例外 (Throws)
Section titled “例外 (Throws)”無効な日付や未対応のタイムゾーンに対する Intl のエラーを伝播します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { isWeekend } from '@alneas/appkit-core/data/date-utils';console.log(isWeekend('2024-01-13T12:00:00Z', 'UTC')); // true---
### `TYPE` `data.HolidayCalendar`
抽出した暦フィールドが、ホストで定義した休日を表すか判定します。
```typescriptexport type HolidayCalendar = (parts: { /** Calendar year. */ year: number; /** Month from zero through eleven. */ month: number; /** Day of the month from one through thirty-one. */ day: number;}) => boolean;補足 (Remarks)
Section titled “補足 (Remarks)”この型は、地域データ、ネットワーク検索、法定祝日の判定を提供しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport type { HolidayCalendar } from '@alneas/appkit-core/data/date-utils';const newYear: HolidayCalendar = ({ month, day }) => month === 0 && day === 1;console.log(newYear({ year: 2024, month: 0, day: 1 })); // true---
### `CONST` `data.isPublicHoliday`
指定したカレンダーに問い合わせ、ある時点が指定したタイムゾーンで休日に当たるか判定します。
```typescriptexport const data.isPublicHoliday: (date: Date | string, calendar: HolidayCalendar, timeZone?: string) => boolean例外 (Throws)
Section titled “例外 (Throws)”日付やタイムゾーンのエラー、および calendar がスローする例外を伝播します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { isPublicHoliday, HolidayCalendar } from '@alneas/appkit-core/data/date-utils';const calendar: HolidayCalendar = ({ month, day }) => month === 0 && day === 1;console.log(isPublicHoliday('2024-01-01T12:00:00Z', calendar, 'UTC')); // true---
### `CONST` `data.isWeekendOrHoliday`
最初に週末かどうかを確認し、続いてホストが任意で提供する休日カレンダーを確認します。
```typescriptexport const data.isWeekendOrHoliday: (date: Date | string, timeZone?: string, calendar?: HolidayCalendar) => boolean例外 (Throws)
Section titled “例外 (Throws)”日付やタイムゾーンのエラー、および呼び出された calendar の例外を伝播します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { isWeekendOrHoliday } from '@alneas/appkit-core/data/date-utils';console.log(isWeekendOrHoliday('2024-01-13T12:00:00Z', 'UTC')); // true---
### `CONST` `data.getWeekdayWithHoliday`
指定したカレンダーでその日付が休日とされている場合に、呼び出し元が選択した接尾辞を付加します。
```typescriptexport const data.getWeekdayWithHoliday: (date: Date | string, locale?: string, timeZone?: string, calendar?: HolidayCalendar, holidaySuffix?: string) => string例外 (Throws)
Section titled “例外 (Throws)”Intl のオプションエラーと calendar の例外を伝播します。カレンダーの参照でも、無効な日付を拒否します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { getWeekdayWithHoliday } from '@alneas/appkit-core/data/date-utils';console.log(getWeekdayWithHoliday('2024-01-01T12:00:00Z', 'en-US', 'UTC', () => true, ' (holiday)')); // 'Mon (holiday)'---
### `CONST` `data.formatDate`
ある時点をローカライズされた日付に整形します。必要に応じて Intl の書式設定を上書きできます。
```typescriptexport const data.formatDate: (date: Date | string, options?: Intl.DateTimeFormatOptions, locale?: string) => string例外 (Throws)
Section titled “例外 (Throws)”無効なロケールや Intl のオプションエラーを伝播します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { formatDate } from '@alneas/appkit-core/data/date-utils';console.log(formatDate('2024-01-15T12:00:00Z', { timeZone: 'UTC' }, 'en-US')); // '1/15/2024'---
### `CONST` `data.formatTime`
ある時点の時刻を、モジュール読み込み時のローカルタイムゾーンで整形します。
```typescriptexport const data.formatTime: (date: Date | string, style?: "numeric" | "2-digit", includeSeconds?: boolean, locale?: string) => string例外 (Throws)
Section titled “例外 (Throws)”無効なロケールや Intl のオプションエラーを伝播します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { formatTime } from '@alneas/appkit-core/data/date-utils';const text = formatTime('2024-01-15T12:30:45Z', '2-digit', true, 'en-US');console.log(text); // Exact clock text depends on TIME_ZONE_LOCAL.---
### `CONST` `data.formatDateTime`
ある時点をローカライズされた日時に整形します。必要に応じて Intl の設定を上書きできます。
```typescriptexport const data.formatDateTime: (date: Date | string, options?: Intl.DateTimeFormatOptions, locale?: string) => string例外 (Throws)
Section titled “例外 (Throws)”無効なロケールや Intl のオプションエラーを伝播します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { formatDateTime } from '@alneas/appkit-core/data/date-utils';console.log(formatDateTime('2024-01-15T12:30:00Z', { timeZone: 'UTC' }, 'en-US'));---
### `CONST` `data.formatDateWithWeekday`
月を短縮表記した日付に、括弧で囲んだローカライズ済みの曜日を続けて整形します。
```typescriptexport const data.formatDateWithWeekday: (date: Date | string, locale?: string) => string例外 (Throws)
Section titled “例外 (Throws)”無効なロケールや Intl のオプションエラーを伝播します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { formatDateWithWeekday } from '@alneas/appkit-core/data/date-utils';console.log(formatDateWithWeekday('2024-01-15T12:00:00Z', 'en-US')); // Host timezone controls the day.---
### `CONST` `data.setTime`
指定したタイムゾーンで観測される日付上で、要求された現地時刻に当たる時点を選択します。
```typescriptexport const data.setTime: (date: Date | string, hour: number, minute?: number, second?: number, timeZone?: string) => Date補足 (Remarks)
Section titled “補足 (Remarks)”要求された現地日付の前後でオフセットをサンプリングします。これは、過去のタイムゾーンの曖昧さを解消する汎用 API ではありません。入力された Date オブジェクトは変更しません。
例外 (Throws)
Section titled “例外 (Throws)”時刻の値が整数でない場合や範囲外の場合、タイムゾーンの時刻の欠落により一致する時点が存在しない場合、または Date や Intl のタイムゾーン入力が無効な場合です。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { setTime } from '@alneas/appkit-core/data/date-utils';console.log(setTime('2024-01-15T12:00:00Z', 0, 0, 0, 'Asia/Tokyo').toISOString()); // '2024-01-14T15:00:00.000Z'---
### `CONST` `data.getTodayAt`
指定したタイムゾーンの現在の暦日において、要求された現地時刻に当たる時点を解決します。
```typescriptexport const data.getTodayAt: (hour?: number, minute?: number, second?: number, timeZone?: string) => Date例外 (Throws)
Section titled “例外 (Throws)”setTime の時刻範囲エラー、現地時刻が存在しないことによるエラー、および Intl のエラーを伝播します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { getTodayAt } from '@alneas/appkit-core/data/date-utils';console.log(getTodayAt(9, 0, 0, 'UTC').toISOString()); // Today's 09:00 UTC.---
### `CONST` `data.addDays`
ある時点に、固定の 24 時間の倍数を加算します。
```typescriptexport const data.addDays: (date: Date | string, days: number) => Date補足 (Remarks)
Section titled “補足 (Remarks)”夏時間の切り替えをまたいで現地時刻を維持するものではなく、暦上の日を操作するものでもありません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { addDays } from '@alneas/appkit-core/data/date-utils';console.log(addDays('2024-01-15T00:00:00Z', 7).toISOString()); // '2024-01-22T00:00:00.000Z'---
### `CONST` `data.addMonths`
ホストのタイムゾーンと JavaScript の Date.setMonth の桁あふれ規則に従って、月数を加算します。
```typescriptexport const data.addMonths: (date: Date | string, months: number) => Date補足 (Remarks)
Section titled “補足 (Remarks)”対象月の末日への補正、対象タイムゾーンの受け付け、入力された Date の変更は行いません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { addMonths } from '@alneas/appkit-core/data/date-utils';const start = new Date(2024, 0, 15, 12);console.log(addMonths(start, 2).getMonth()); // 2 (March in the host timezone)---
### `CONST` `data.addHours`
ある時点に、固定の 1 時間単位の期間を加算します。
```typescriptexport const data.addHours: (date: Date | string, hours: number) => Date使用例 (Example)
Section titled “使用例 (Example)”```tsimport { addHours } from '@alneas/appkit-core/data/date-utils';console.log(addHours('2024-01-15T00:00:00Z', 3).toISOString()); // '2024-01-15T03:00:00.000Z'---
### `CONST` `data.addMinutes`
ある時点に、固定の 1 分単位の期間を加算します。
```typescriptexport const data.addMinutes: (date: Date | string, minutes: number) => Date使用例 (Example)
Section titled “使用例 (Example)”```tsimport { addMinutes } from '@alneas/appkit-core/data/date-utils';console.log(addMinutes('2024-01-15T00:00:00Z', 30).toISOString()); // '2024-01-15T00:30:00.000Z'---
### `CONST` `data.getAge`
ホストのローカル時間における現在の暦日を使用して、誕生日を基準に満年齢を計算します。
```typescriptexport const data.getAge: (birthDate: Date | string) => number | null補足 (Remarks)
Section titled “補足 (Remarks)”この関数はシステムクロックを参照し、タイムゾーンや基準日を明示的に指定する手段は提供しません。法的な年齢要件の充足を判定するものではありません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { getAge } from '@alneas/appkit-core/data/date-utils';console.log(getAge('invalid')); // nullconsole.log(getAge('1990-05-15T12:00:00Z')); // Depends on today's host-local date.---
### `CONST` `data.getMinutesFromMidnight`
指定したタイムゾーンにおける、ある時点の時・分フィールドを抽出し、分数に変換します。
```typescriptexport const data.getMinutesFromMidnight: (date: Date | string, timeZone?: string) => number例外 (Throws)
Section titled “例外 (Throws)”無効な日付やタイムゾーンに対する Intl のエラーを伝播します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { getMinutesFromMidnight } from '@alneas/appkit-core/data/date-utils';console.log(getMinutesFromMidnight('2024-01-15T14:30:00Z', 'UTC')); // 870---
### `CONST` `data.isSameDay`
指定したタイムゾーンで、2 つの時点の暦上の年・月・日を比較します。
```typescriptexport const data.isSameDay: (date1: Date | string, date2: Date | string, timeZone?: string) => boolean例外 (Throws)
Section titled “例外 (Throws)”無効な日付やタイムゾーンに対する Intl のエラーを伝播します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { isSameDay } from '@alneas/appkit-core/data/date-utils';console.log(isSameDay('2024-01-15T10:00:00Z', '2024-01-15T22:00:00Z', 'UTC')); // true---
### `CONST` `data.compareTimes`
コロン区切りの 2 つの時刻文字列について、先頭の 2 フィールドを数値に変換して比較します。
```typescriptexport const data.compareTimes: (time1: string, time2: string) => -1 | 0 | 1補足 (Remarks)
Section titled “補足 (Remarks)”範囲や形式を検証するものではありません。秒と追加フィールドは無視し、負数や範囲外の数値フィールドも拒否しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { compareTimes } from '@alneas/appkit-core/data/date-utils';console.log(compareTimes('09:00', '14:30')); // -1console.log(compareTimes('invalid', '14:30')); // 0; validate before comparing.---
### `CONST` `data.compareDates`
指定したタイムゾーンの暦日を基準に、2 つの時点の前後関係を判定します。
```typescriptexport const data.compareDates: (date1: Date | string, date2: Date | string, timeZone?: string) => -1 | 0 | 1例外 (Throws)
Section titled “例外 (Throws)”無効な日付やタイムゾーンに対する Intl のエラーを伝播します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { compareDates } from '@alneas/appkit-core/data/date-utils';console.log(compareDates('2024-01-15T12:00:00Z', '2024-01-20T12:00:00Z', 'UTC')); // -1---
### `CONST` `data.isDateInRange`
ある時点が、両端を含む 2 つのタイムスタンプの範囲内にあるか確認します。
```typescriptexport const data.isDateInRange: (date: Date | string, start: Date | string, end: Date | string) => boolean補足 (Remarks)
Section titled “補足 (Remarks)”暦日ではなく時点を比較します。終了日が午前0時として解析される場合、その日の残りの時間は含まれません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { isDateInRange } from '@alneas/appkit-core/data/date-utils';console.log(isDateInRange('2024-01-15T12:00:00Z', '2024-01-01T00:00:00Z', '2024-01-31T23:59:59Z')); // true---
### `CONST` `data.isPast`
ある時点の、指定したタイムゾーンでの暦日が、今日の日付より前か確認します。
```typescriptexport const data.isPast: (date: Date | string, timeZone?: string) => boolean例外 (Throws)
Section titled “例外 (Throws)”compareDates からの日付やタイムゾーンのエラーを伝播します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { isPast } from '@alneas/appkit-core/data/date-utils';console.log(isPast(new Date(), 'UTC')); // false---
### `CONST` `data.isFuture`
ある時点の、指定したタイムゾーンでの暦日が、今日の日付より後か確認します。
```typescriptexport const data.isFuture: (date: Date | string, timeZone?: string) => boolean例外 (Throws)
Section titled “例外 (Throws)”compareDates からの日付やタイムゾーンのエラーを伝播します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { isFuture } from '@alneas/appkit-core/data/date-utils';console.log(isFuture(new Date(), 'UTC')); // false---
### `CONST` `data.isToday`
指定したタイムゾーンで、ある時点の暦日が今日と同じか確認します。
```typescriptexport const data.isToday: (date: Date | string, timeZone?: string) => boolean例外 (Throws)
Section titled “例外 (Throws)”isSameDay からの日付やタイムゾーンのエラーを伝播します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { isToday } from '@alneas/appkit-core/data/date-utils';console.log(isToday(new Date(), 'UTC')); // true---
### `CONST` `data.getTodayDateString`
システムの現在時点を、指定したタイムゾーンの日付文字列に整形します。
```typescriptexport const data.getTodayDateString: (timeZone?: string) => string例外 (Throws)
Section titled “例外 (Throws)”未対応のタイムゾーンに対する Intl のエラーを伝播します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { getTodayDateString } from '@alneas/appkit-core/data/date-utils';console.log(getTodayDateString('UTC')); // The current UTC calendar date.---
### `CONST` `data.getNowISOString`
システムの現在時点を、UTC の ISO タイムスタンプにシリアライズします。
```typescriptexport const data.getNowISOString: () => string使用例 (Example)
Section titled “使用例 (Example)”```tsimport { getNowISOString } from '@alneas/appkit-core/data/date-utils';console.log(getNowISOString()); // For example, a UTC timestamp ending in Z.---
### `CONST` `data.parseLocalDate`
Date で文字列を解析し、対象タイムゾーンで観測される暦日の午前 0 時に設定し直します。
```typescriptexport const data.parseLocalDate: (dateStr: string, timeZone?: string) => Date補足 (Remarks)
Section titled “補足 (Remarks)”UTC より遅いタイムゾーンでは、YYYY-MM-DD 形式の入力が前の暦日として解釈される場合があります。この実装を、タイムゾーンに依存しない汎用的な暦日パーサーとして使用してはいけません。
例外 (Throws)
Section titled “例外 (Throws)”setTime からの、無効な日付、タイムゾーン、または午前0時が存在しないことによるエラーを伝播します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { parseLocalDate } from '@alneas/appkit-core/data/date-utils';console.log(parseLocalDate('2024-01-15', 'UTC').toISOString()); // '2024-01-15T00:00:00.000Z'---
### `CONST` `data.formatToISOString`
Date.toISOString を使用して、Date を UTC の ISO タイムスタンプにシリアライズします。
```typescriptexport const data.formatToISOString: (date: Date) => string例外 (Throws)
Section titled “例外 (Throws)”date が無効な場合、Date.toISOString がスローする RangeError です。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { formatToISOString } from '@alneas/appkit-core/data/date-utils';console.log(formatToISOString(new Date('2024-01-15T00:00:00Z'))); // '2024-01-15T00:00:00.000Z'---
### `CONST` `data.getStartOfMonth`
指定したタイムゾーンの要素から月初日の文字列を構築し、その観測される日の午前 0 時に当たる時点を解決します。
```typescriptexport const data.getStartOfMonth: (date: Date | string, timeZone?: string) => Date補足 (Remarks)
Section titled “補足 (Remarks)”中間の ISO 日付のみの文字列は UTC として解析されます。UTC より遅いタイムゾーンでは、意図した月の初日ではなく、その前の暦日になる場合があります。
例外 (Throws)
Section titled “例外 (Throws)”Intl/setTime からの、無効な日付、タイムゾーン、または午前0時が存在しないことによるエラーを伝播します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { getStartOfMonth } from '@alneas/appkit-core/data/date-utils';console.log(getStartOfMonth('2024-01-15T12:00:00Z', 'UTC').toISOString()); // '2024-01-01T00:00:00.000Z'---
### `CONST` `data.getStartOfQuarter`
選択した暦上の四半期の初日を構築し、対象タイムゾーンで観測されるその日の午前 0 時に当たる時点を解決します。
```typescriptexport const data.getStartOfQuarter: (date: Date | string, timeZone?: string) => Date補足 (Remarks)
Section titled “補足 (Remarks)”日付のみの中間値は UTC として解析されます。UTC より遅いタイムゾーンでは、前の暦日になる場合があるため、これは暦上の四半期の境界を求める汎用 API ではありません。
例外 (Throws)
Section titled “例外 (Throws)”無効な日付、タイムゾーン、または午前0時が存在しないことによるエラーを伝播します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { getStartOfQuarter } from '@alneas/appkit-core/data/date-utils';console.log(getStartOfQuarter('2024-05-15T12:00:00Z', 'UTC').toISOString()); // '2024-04-01T00:00:00.000Z'---
### `CONST` `data.getStartOfYear`
指定したタイムゾーンの年における 1 月 1 日を構築し、その観測される日の午前 0 時に当たる時点を解決します。
```typescriptexport const data.getStartOfYear: (date: Date | string, timeZone?: string) => Date補足 (Remarks)
Section titled “補足 (Remarks)”中間の文字列は UTC として解析されます。UTC より遅いタイムゾーンでは、表示上の日付が前年の12月31日になる場合があります。
例外 (Throws)
Section titled “例外 (Throws)”無効な日付、タイムゾーン、または午前0時が存在しないことによるエラーを伝播します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { getStartOfYear } from '@alneas/appkit-core/data/date-utils';console.log(getStartOfYear('2024-05-15T12:00:00Z', 'UTC').toISOString()); // '2024-01-01T00:00:00.000Z'---
### `CONST` `data.getEndOfMonth`
getStartOfMonth の結果にホストのローカル時間で 1 か月を加算し、固定の 24 時間を減算します。
```typescriptexport const data.getEndOfMonth: (date: Date | string, timeZone?: string) => Date補足 (Remarks)
Section titled “補足 (Remarks)”対象タイムゾーンでの日付のみの解析、ホストのローカル時間での月のオーバーフロー、経過日数の減算は、タイムゾーンや夏時間の境界をまたいで相互に影響する可能性があります。暦上の月末の境界として扱う前に、結果を確認してください。
例外 (Throws)
Section titled “例外 (Throws)”getStartOfMonth からの、無効な日付、タイムゾーン、または午前0時が存在しないことによるエラーを伝播します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { getEndOfMonth } from '@alneas/appkit-core/data/date-utils';console.log(getEndOfMonth('2024-01-15T12:00:00Z', 'UTC').toISOString()); // Exact result also depends on the host timezone.---
### `FUNCTION` `data.parseCsv`
CSV 文字列を解析するための便利なヘルパー関数です。
```typescriptexport function parseCsv(csvContent: string, config?: CSVParseConfig): string[][]引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
csvContent |
string |
必須 | |
config |
CSVParseConfig | undefined |
任意 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string[][]
INTERFACE data.CSVParseConfig
Section titled “INTERFACE data.CSVParseConfig”CSV 解析の設定オプション
export interface CSVParseConfig { /** Delimiter character (default: ,) */ delimiter: string; /** Quotation character (default: ") */ quoteChar: string; /** Escape character (default: ") */ escapeChar: string; /** Whether the CSV includes a header row (for compatibility, header row is still included in result even if true) */ hasHeader: boolean; /** Whether to skip empty lines */ skipEmptyLines: boolean; /** Whether to trim leading and trailing whitespace from values */ trimWhitespace: boolean;}CONST data.DEFAULT_CSV_PARSE_CONFIG
Section titled “CONST data.DEFAULT_CSV_PARSE_CONFIG”エクスポートされるシンボル data.DEFAULT_CSV_PARSE_CONFIG
export const data.DEFAULT_CSV_PARSE_CONFIG: CSVParseConfigCLASS data.CSVParser
Section titled “CLASS data.CSVParser”CSV データを解析するクラスです。 RFC 4180 に準拠した解析(引用符とエスケープの処理)をサポートします。
class data.CSVParserINTERFACE data.CSVConfig
Section titled “INTERFACE data.CSVConfig”CSV 生成の設定です。システム間のデータ交換用に元の値を保持するか、スプレッドシート用に escapeFormulae を有効にします。
export interface CSVConfig { /** Delimiter character (default: ,) */ delimiter: string; /** Quotation character (1 character, default: ") */ quoteChar: string; /** Character used to escape quote characters (1 character, default: ") */ escapeChar: string; /** Whether to include the header row in output */ includeHeader: boolean; /** 'never' throws an exception on values that require quoting. Quoting for formula safety takes precedence. */ stringWrapping: 'auto' | 'always' | 'never'; /** Prepends an apostrophe to formula-like strings (including headers). Defaults to false. Modifies the raw value. */ escapeFormulae?: boolean; /** Locale for Date cells; undefined uses the host locale. */ dateLocale?: string; /** Intl date options, including an explicit timezone when reproducibility matters. */ dateOptions?: Intl.DateTimeFormatOptions; /** Overrides Date cell formatting (e.g. ISO strings for machine interchange). */ dateFormatter?: (value: Date) => string;}CONST data.DEFAULT_CSV_CONFIG
Section titled “CONST data.DEFAULT_CSV_CONFIG”エクスポートされるシンボル data.DEFAULT_CSV_CONFIG
export const data.DEFAULT_CSV_CONFIG: CSVConfigINTERFACE data.ColumnMapping
Section titled “INTERFACE data.ColumnMapping”インターフェース data.ColumnMapping
export interface ColumnMapping { columnId: string; columnLabel: string; include: boolean; order: number; customLabel?: string;}CLASS data.CSVGenerator
Section titled “CLASS data.CSVGenerator”列を選択し、並び順と日付書式を適用して、Papa Parse で CSV にシリアライズします。 負の数値を数値として保持しながら、数式のような文字列に対する保護を行います。
class data.CSVGeneratorTYPE data.ExcelCellType
Section titled “TYPE data.ExcelCellType”型 data.ExcelCellType
export type ExcelCellType = 'string' | 'number' | 'boolean' | 'date';INTERFACE data.ExcelCellStyle
Section titled “INTERFACE data.ExcelCellStyle”Excel のセルまたは列のスタイル定義
export interface ExcelCellStyle { /** Bold */ bold?: boolean; /** Italic */ italic?: boolean; /** Underline */ underline?: boolean; /** Font size (pt) */ fontSize?: number; /** Font color (e.g., "#1E3A8A") */ fontColor?: string; /** Background color (e.g., "#F1F5F9") */ backgroundColor?: string; /** Horizontal alignment */ horizontalAlign?: 'left' | 'center' | 'right'; /** Vertical alignment */ verticalAlign?: 'top' | 'center' | 'bottom'; /** Wrap text */ wrapText?: boolean; /** Border style (thin, thick, double, none, all, top, bottom) */ border?: 'thin' | 'thick' | 'double' | 'none' | 'all' | 'top' | 'bottom'; /** Border color (e.g., "#CBD5E1") */ borderColor?: string; /** Number or date format string (e.g., "#,##0", "¥#,##0", "yyyy-mm-dd", "0.0%") */ numberFormat?: string;}INTERFACE data.ExcelCellData
Section titled “INTERFACE data.ExcelCellData”任意の座標に直接配置するセルデータ(自由レイアウト用)
export interface ExcelCellData { /** Cell coordinate (e.g., "A1", "C5") */ cell: string; /** Cell value (string, number, boolean, etc.) */ value?: unknown; /** Formula (e.g., "=SUM(D5:D10)") */ formula?: string; /** Custom cell style */ style?: ExcelCellStyle;}INTERFACE data.ExcelColumnDefinition
Section titled “INTERFACE data.ExcelColumnDefinition”表の列定義(表形式データ用)
export interface ExcelColumnDefinition { /** Header display name */ header: string; /** Key name in row data object */ key: string; /** Column width in characters (adapter default when omitted; Excelize does not auto-fit) */ width?: number; /** Data type hint */ type?: ExcelCellType; /** Custom format string for number/date */ format?: string; /** Custom style for column header */ style?: ExcelCellStyle;}INTERFACE data.ExcelSheetData
Section titled “INTERFACE data.ExcelSheetData”Excel ワークシート 1 枚分のデータ
export interface ExcelSheetData { /** Sheet name */ name: string; /** Tabular column definitions list (specified when outputting tabular data) */ columns?: ExcelColumnDefinition[]; /** Tabular row data list */ rows?: Record<string, unknown>[]; /** Directly placed cells list (for free-layout, titles, notes, summary rows) */ cells?: ExcelCellData[]; /** Cell merge specifications (e.g., ["A1:D1", "B3:C3"]) */ merges?: string[]; /** Width specifications per column (e.g., { A: 12, B: 30 }) */ colWidths?: Record<string, number>; /** Height specifications per row (e.g., { 1: 35, 2: 20 }) */ rowHeights?: Record<number, number>; /** Starting row number for tabular data (default: 1 or following cells) */ startRow?: number; /** Whether to hide grid lines */ hideGridlines?: boolean;}INTERFACE data.ExcelWorkbookMetadata
Section titled “INTERFACE data.ExcelWorkbookMetadata”ブックのメタデータ(ドキュメントプロパティ)
export interface ExcelWorkbookMetadata { /** Document title */ title?: string; /** Subject */ subject?: string; /** Creator / Author */ creator?: string; /** Description */ description?: string;}INTERFACE data.ExcelWorkbookData
Section titled “INTERFACE data.ExcelWorkbookData”Excel 生成リクエスト全体のデータ構造
export interface ExcelWorkbookData { /** Metadata */ metadata?: ExcelWorkbookMetadata; /** Worksheet array */ sheets: ExcelSheetData[];}INTERFACE data.ExcelGenerateOptions
Section titled “INTERFACE data.ExcelGenerateOptions”Excel の生成とダウンロードのオプション
export interface ExcelGenerateOptions { /** Output format ('xlsx' | 'csv') */ format?: 'xlsx' | 'csv'; /** Timeout in milliseconds */ timeoutMs?: number; /** Default filename for download */ filename?: string; /** Additional headers or configuration parameters */ headers?: Record<string, string>;}INTERFACE data.ExcelAdapter
Section titled “INTERFACE data.ExcelAdapter”共通の Excel アダプターインターフェース
export interface ExcelAdapter { /** Adapter identifier name */ readonly name: string;
/** * Generates Excel or CSV binary data (Uint8Array). * @param data Workbook data definition * @param options Options */ generate(data: ExcelWorkbookData, options?: ExcelGenerateOptions): Promise<Uint8Array>;
/** * Generates file and triggers direct download in the browser. * @param data Workbook data definition * @param filename File name to save * @param options Options */ download( data: ExcelWorkbookData, filename?: string, options?: ExcelGenerateOptions ): Promise<void>;}FUNCTION data.triggerBrowserDownload
Section titled “FUNCTION data.triggerBrowserDownload”関数 data.triggerBrowserDownload
export function triggerBrowserDownload( data: Uint8Array | Blob, filename: string, mimeType = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'): void引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
data |
Uint8Array<ArrayBufferLike> | Blob |
必須 | |
filename |
string |
必須 | |
mimeType |
string |
任意 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
void
FUNCTION data.resolveFilename
Section titled “FUNCTION data.resolveFilename”ファイル名を解決します(省略時はメタデータのタイトルまたはフォールバック値を使用します)。
export function resolveFilename( filename?: string, metadataTitle?: string, fallback = 'export.xlsx'): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
filename |
string | undefined |
任意 | |
metadataTitle |
string | undefined |
任意 | |
fallback |
string |
任意 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string
INTERFACE data.HttpServerExcelAdapterConfig
Section titled “INTERFACE data.HttpServerExcelAdapterConfig”HttpServerExcelAdapter の設定オプション
export interface HttpServerExcelAdapterConfig { /** API endpoint URL (e.g., "http://localhost:8080/api/export-excel") */ endpointUrl: string; /** Default request headers (e.g., authentication tokens) */ headers?: Record<string, string>; /** Custom fetch function (for testing or SSR) */ customFetch?: typeof fetch;}CLASS data.HttpServerExcelAdapter
Section titled “CLASS data.HttpServerExcelAdapter”HTTP サーバー API 経由で Excel を生成するアダプター
class data.HttpServerExcelAdapter使用例 (Example)
Section titled “使用例 (Example)”```typescriptconst adapter = new HttpServerExcelAdapter({ endpointUrl: 'https://api.example.com/api/export-excel', headers: { Authorization: 'Bearer xxx' }});
await adapter.download(data, 'sales_report.xlsx');---
### `INTERFACE` `data.WasmExcelAdapterConfig`
WasmExcelAdapter の設定オプション
```typescriptexport interface WasmExcelAdapterConfig { /** URL to the WASM file (e.g., "/wasm/excel.wasm") */ wasmUrl?: string; /** Custom pre-initialized WASM executor function */ customExecutor?: (dataJson: string) => Promise<Uint8Array> | Uint8Array;}CLASS data.WasmExcelAdapter
Section titled “CLASS data.WasmExcelAdapter”WebAssembly 経由で Excel を生成するアダプター
class data.WasmExcelAdapter使用例 (Example)
Section titled “使用例 (Example)”```typescriptconst adapter = new WasmExcelAdapter({ wasmUrl: '/wasm/excel.wasm' });await adapter.download(data, 'offline_report.xlsx');---
### `INTERFACE` `data.MockExcelAdapterConfig`
MockExcelAdapter の設定オプション
```typescriptexport interface MockExcelAdapterConfig { /** Simulated processing delay in milliseconds (default: 300) */ delayMs?: number; /** Flag to simulate an error */ shouldFail?: boolean; /** Hook invoked when the download function is called */ onDownload?: (data: ExcelWorkbookData, filename: string) => void;}CLASS data.MockExcelAdapter
Section titled “CLASS data.MockExcelAdapter”モック Excel アダプター
class data.MockExcelAdapterINTERFACE data.CsvExcelAdapterConfig
Section titled “INTERFACE data.CsvExcelAdapterConfig”CsvExcelAdapter の設定オプション
export interface CsvExcelAdapterConfig { /** Delimiter character (default: ',') */ delimiter?: string; /** Target sheet index (default: 0) */ sheetIndex?: number; /** Whether to include BOM (to prevent character encoding issues in Excel, default: true) */ includeBom?: boolean;}CLASS data.CsvExcelAdapter
Section titled “CLASS data.CsvExcelAdapter”ExcelAdapter インターフェース経由で CSV を出力するアダプター
class data.CsvExcelAdapterFUNCTION data.calculateInvoiceAmounts
Section titled “FUNCTION data.calculateInvoiceAmounts”税と丸め処理の明示的なポリシーを使用して、請求金額を計算します。 JavaScript の number 演算を使用します。厳密な金額計算が必要な場合は、十進数の丸め戦略、 または別の十進数計算サービスを注入してください。
export function calculateInvoiceAmounts(input: InvoiceAmountsInput, options: InvoiceCalculationOptions): InvoiceAmountsResult引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
input |
InvoiceAmountsInput |
必須 | |
options |
InvoiceCalculationOptions |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
InvoiceAmountsResult
使用例 (Example)
Section titled “使用例 (Example)”calculateInvoiceAmounts({ subtotal: 999 }, { defaultTaxRate: 20, roundTax: Math.floor })INTERFACE data.InvoiceAmountsInput
Section titled “INTERFACE data.InvoiceAmountsInput”請求計算用の数値入力です。任意の値が null・空・無効の場合は未指定として扱い、明示的なゼロは保持します。
export interface InvoiceAmountsInput { subtotal: number; /** Percentage points, e.g. 20 means 20%. No regional rate is inferred. */ taxRate?: number | string | null; taxAmount?: number | string | null; totalAmount?: number | string | null;}INTERFACE data.InvoiceAmountsResult
Section titled “INTERFACE data.InvoiceAmountsResult”インターフェース data.InvoiceAmountsResult
export interface InvoiceAmountsResult { subtotal: number; taxRate: number; taxAmount: number; totalAmount: number }INTERFACE data.InvoiceCalculationOptions
Section titled “INTERFACE data.InvoiceCalculationOptions”アプリケーションが選択する計算ポリシーです。通貨・補助通貨単位と法令上の規則は、引き続き呼び出し元が管理します。
export interface InvoiceCalculationOptions { defaultTaxRate: number; /** Rounds the computed tax; for example Math.floor, Math.round, or a decimal/minor-unit adapter. */ roundTax: (amount: number) => number;}FUNCTION data.calculateCostFromLayers
Section titled “FUNCTION data.calculateCostFromLayers”指定した評価方法(LIFO / FIFO / 加重平均 / 標準)に基づき、在庫レイヤー情報から原価を計算します。
export function calculateCostFromLayers( layers: InventoryLayer[], requestedQuantity: number, method: CostMethod,): CostCalculationResult引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
layers |
InventoryLayer[] |
必須 | 在庫レイヤーの配列です。LIFO/FIFO では、適用順に事前に並べ替える必要があります(FIFO は古い順、LIFO は新しい順です)。 |
requestedQuantity |
number |
必須 | 原価計算の対象数量 |
method |
CostMethod |
必須 | 原価評価方法(‘LIFO’ | ‘FIFO’ | ‘WA’ | ‘STANDARD’) |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
CostCalculationResult - Description: 計算結果を含むオブジェクト
TYPE data.CostMethod
Section titled “TYPE data.CostMethod”型 data.CostMethod
export type CostMethod = 'LIFO' | 'FIFO' | 'WA' | 'STANDARD';INTERFACE data.CostCalculationResult
Section titled “INTERFACE data.CostCalculationResult”原価計算結果を表すインターフェースです。
export interface CostCalculationResult { /** Calculated unit cost */ unitCost: number; /** Calculated total cost */ totalCost: number; /** Cost valuation method used */ method: CostMethod; /** Source of cost calculation ('project': inventory layer, 'standard': standard cost) */ source: 'project' | 'standard'; /** Detailed list of inventory layers used in the calculation */ layers?: Array<{ id: string; quantity: number; unitCost: number; totalCost: number; }>;}INTERFACE data.InventoryLayer
Section titled “INTERFACE data.InventoryLayer”在庫レイヤー情報を表すインターフェースです。
export interface InventoryLayer { /** Unique identifier (ID) for the layer */ id: string; /** Total quantity received */ quantity: number; /** Received quantity (string or number, for raw DB value compatibility) */ quantityReceived?: number | string; /** Unit cost of this layer upon receipt */ unitCost: number; /** Total cost of this layer */ totalCost: number; /** Remaining quantity available for allocation */ remainingQuantity: number; /** Remaining quantity (string or number, for raw DB value compatibility) */ quantityRemaining?: number | string; /** Receipt date (millisecond timestamp or null) */ receiptDate: number | null; /** Associated purchase order ID, if any */ orderId: string | null;}FUNCTION data.normalizePopulateOptions
Section titled “FUNCTION data.normalizePopulateOptions”データに問い合わせることなく、正規の結合名と互換性のための別名を解決します。
export function normalizePopulateOptions(p: PopulateOptions): { /** Related collection copied from the request. */ collection: string; /** Canonical or legacy local reference, or an empty string. */ localRef: string; /** Canonical/legacy remote reference, or '_id'. */ foreignRef: string; /** Explicit alias or the local reference without a conventional suffix. */ as: string; /** True unless the request explicitly disabled unwinding. */ unwind: boolean;}引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
p |
PopulateOptions |
必須 | - 結合リクエストです。空でない正規名は field と foreignField より優先されます。リモート参照がない場合は ‘_id’ になります。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
{ collection: string; localRef: string; foreignRef: string; as: string; unwind: boolean; } - Description: collection を保持し、as が空の場合は末尾の ‘_id’ または ‘_reference’ を除いて エイリアスを生成し、p.unwind が明示的に false でない限り unwind を true に設定する 新しいオブジェクトです。ネストされた populate や拡張情報はコピーしません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { normalizePopulateOptions } from '@alneas/appkit-core/data';const relation = normalizePopulateOptions({ collection: 'users', localRef: 'user_id' });console.log(relation.as, relation.foreignRef, relation.unwind); // 'user', '_id', true---
### `TYPE` `data.FetchLike`
ホストが提供する Fetch 互換トランスポートを通じて、HTTP リクエストを送信します。
```typescriptexport type FetchLike = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;補足 (Remarks)
Section titled “補足 (Remarks)”ホストがネットワーク機能、認証情報、認可ポリシーを提供します。 拒否とキャンセルの動作は、そのトランスポートに依存します。この型は 再試行、レスポンスステータスの検証、実行環境固有の fetch プロパティを追加しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport type { FetchLike } from '@alneas/appkit-core/data';export async function readHealth(fetchImpl: FetchLike, url: URL) { const response = await fetchImpl(url, { method: 'GET' }); if (!response.ok) throw new Error(`HTTP ${response.status}`); return response.text();}---
### `TYPE` `data.Filter`
レコード取得のフィルター条件です。
これらは一般的なフィルターの規約です。対応する演算子と値の意味はアダプターごとに異なり、そのアダプターが検証します。- `$eq` (eq): 等しい- `$neq` (neq): 等しくない- `$lt` (lt), `$lte` (lte): より小さい / 以下- `$gt` (gt), `$gte` (gte): より大きい / 以上- `$in` (in): 配列に含まれる- `$nin` (nin): 配列に含まれない- `$regex`: 正規表現に一致する
```typescriptexport type Filter = Record<string, unknown>;使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { Filter } from '@alneas/appkit-core/data';const active: Filter = { status: 'active' };const eligible: Filter = { age: { $gte: 18 }, role: { $in: ['admin', 'editor'] },};console.log(active, eligible);---
### `TYPE` `data.DocType`
QueryOptions.docType を通じて要求する業務文書の分類を指定します。列挙された値は規約であり、他の文字列も TypeScript の値として有効です。この型は、文書の検証や文書標準への準拠の強制を行いません。
```typescriptexport type DocType = 'Invoice' | 'PurchaseOrder' | 'DespatchAdvice' | 'RemittanceAdvice' | string;INTERFACE data.QueryOptions
Section titled “INTERFACE data.QueryOptions”アダプター固有のフィルター、並び順、取得フィールドの選択、ページネーションの動作を要求します。
export interface QueryOptions { /** Transport cancellation request; an adapter may ignore it. Cancellation is not a backend rollback. */ signal?: AbortSignal; /** Sort order: 1 = ascending, -1 = descending */ sort?: Record<string, number>; /** Upper limit on the number of records to retrieve */ limit?: number; /** Number of records to skip (for pagination) */ skip?: number; /** Configuration for joining related collections (populate) */ populate?: PopulateOptions[]; /** Field projection to limit retrieved fields */ projection?: string[] | Record<string, unknown>; /** Filter by regional-edi document type */ docType?: DocType; /** Requests automatic pagination when explicit limit/skip are absent; only adapters documenting this option implement it. */ paginateAll?: boolean;
/** Additional adapter-specific options; their names, validation and defaults are host-owned. */ [key: string]: unknown;}補足 (Remarks)
Section titled “補足 (Remarks)”省略可能なフィールドは要求する機能を記述します。アダプターは その一部のみをサポートする場合があります。キャンセル、 結合、プロジェクション、自動ページネーションに依存する前に、その実装を確認してください。どのオプションも認可を確立しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport type { QueryOptions } from '@alneas/appkit-core/data';const options: QueryOptions = { sort: { createdAt: -1 }, limit: 20, skip: 0 };console.log(options.limit);---
### `INTERFACE` `data.PopulateOptions`
ローカル参照と関連コレクションの間で要求する結合を記述します。
```typescriptexport interface PopulateOptions { /** Target collection or table name to join */ collection: string;
/** * Local reference field (e.g., 'user_id', 'order_reference'). * Based on regional-edi reference terminology. */ localRef?: string;
/** * Remote reference field; normalizePopulateOptions defaults an absent/empty value to '_id'. */ foreignRef?: string;
/** Alias for the joined data (e.g., 'user', 'order') */ as?: string;
/** Whether to flatten the related result. Normalization returns true unless this field is explicitly false. */ unwind?: boolean;
/** Nested populate configurations */ populate?: PopulateOptions[];
/** Additional adapter-specific options; their names, validation and defaults are host-owned. */ [key: string]: unknown;
// --- Backward-compatibility aliases (deprecated) ---
/** * Legacy local reference name, used only when localRef is absent or empty. * @deprecated Use localRef to avoid relying on the compatibility alias. */ field?: string;
/** * Legacy remote reference name, used only when foreignRef is absent or empty. * @deprecated Use foreignRef to avoid relying on the compatibility alias. */ foreignField?: string;}補足 (Remarks)
Section titled “補足 (Remarks)”結合のサポートはアダプター固有です。正規化ヘルパーは 名前とデフォルト値を補いますが、クエリの実行、リレーションシップの検証、その認可は行いません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { normalizePopulateOptions, type PopulateOptions } from '@alneas/appkit-core/data';const relation: PopulateOptions = { collection: 'users', localRef: 'user_id', foreignRef: 'id', as: 'user',};console.log(normalizePopulateOptions(relation).unwind); // true---
### `INTERFACE` `data.DataAccessAdapter`
レコード操作を、アプリケーションが選択したバックエンドに接続します。
```typescriptexport interface DataAccessAdapter { /** * Optional non-secret cache namespace for a tenant/backend. Defaults to adapter instance identity. * Equal explicit scopes intentionally share cached results, so use them only for equivalent access. * Never use tokens or unverified profile data. Change scope when the tenant/access boundary changes. */ readonly cacheScope?: string; /** * Retrieves records matching an adapter-supported filter. * @typeParam T - Expected adapter result shape; no runtime validation is implied. * @param collection - Backend collection or resource name. * @param filter - Optional criteria in the adapter's filter dialect; absence requests its unfiltered behavior. * @param options - Optional sorting, pagination, projection and transport requests. * @returns Records returned by the backend, including an empty array when no rows match. * @remarks Backend, transport and authorization failures can reject the promise. * Use the adapter's documented retry/cancellation policy; this contract supplies no rollback. * @example * ```ts * import type { DataAccessAdapter } from '@alneas/appkit-core/data'; * export async function findExample(adapter: DataAccessAdapter) { * return adapter.find<{ id: string }>('requests', { status: 'open' }, { limit: 20 }); * } * ``` */ find<T = unknown>(collection: string, filter?: Filter, options?: QueryOptions): Promise<T[]>;
/** * Retrieves a record using the backend's identifier lookup. * @typeParam T - Expected adapter result shape; no runtime validation is implied. * @param collection - Backend collection or resource name. * @param id - Identifier in the form accepted by the selected adapter. * @param options - Optional projection, populate and transport requests. * @returns The record or null according to the adapter's not-found behavior; some backends reject instead of returning null. * @remarks Backend, transport and authorization failures can reject the promise. * Use the adapter's documented retry/cancellation policy; this contract supplies no rollback. * @example * ```ts * import type { DataAccessAdapter } from '@alneas/appkit-core/data'; * export async function findOneExample(adapter: DataAccessAdapter) { * return adapter.findOne<{ id: string }>('requests', 'request-1'); * } * ``` */ findOne<T = unknown>(collection: string, id: string, options?: QueryOptions): Promise<T | null>;
/** * Requests creation of a record. * @typeParam T - Expected adapter result shape; no runtime validation is implied. * @param collection - Backend collection or resource name. * @param data - Fields to insert; server-generated fields and validation are backend-owned. * @param options - Optional adapter-specific write/transport settings. * @returns The adapter's created-record result; it need not be the same object as data. * @remarks Backend, transport and authorization failures can reject the promise. * Use the adapter's documented retry/cancellation policy; this contract supplies no rollback. * @example * ```ts * import type { DataAccessAdapter } from '@alneas/appkit-core/data'; * export async function createExample(adapter: DataAccessAdapter) { * return adapter.create<{ id: string; title: string }>('requests', { title: 'Review' }); * } * ``` */ create<T = unknown>( collection: string, data: Record<string, unknown>, options?: QueryOptions, ): Promise<T>;
/** * Requests a partial record update by identifier. * @typeParam T - Expected adapter result shape; no runtime validation is implied. * @param collection - Backend collection or resource name. * @param id - Identifier accepted by the selected adapter. * @param data - Fields or update operators supported by that adapter. * @param options - Optional adapter-specific write/transport settings. * @returns The adapter's update result as T. Omitted-field and returned-document semantics depend on the backend. * @remarks Backend, transport and authorization failures can reject the promise. * Use the adapter's documented retry/cancellation policy; this contract supplies no rollback. * @example * ```ts * import type { DataAccessAdapter } from '@alneas/appkit-core/data'; * export async function updateExample(adapter: DataAccessAdapter) { * return adapter.update<{ id: string }>('requests', 'request-1', { status: 'review' }); * } * ``` */ update<T = unknown>( collection: string, id: string, data: Record<string, unknown>, options?: QueryOptions, ): Promise<T>;
/** * Requests record replacement when supported by the adapter. * @typeParam T - Expected adapter result shape; no runtime validation is implied. * @param collection - Backend collection or resource name. * @param id - Identifier accepted by the selected adapter. * @param data - Requested new record contents; verify the adapter's omitted-field semantics. * @param options - Optional adapter-specific write/transport settings. * @returns The adapter's replacement result as T; this interface alone does not establish whole-record clearing semantics. * @remarks Backend, transport and authorization failures can reject the promise. * Use the adapter's documented retry/cancellation policy; this contract supplies no rollback. * @example * ```ts * import type { DataAccessAdapter } from '@alneas/appkit-core/data'; * export async function replaceExample(adapter: DataAccessAdapter) { * if (!adapter.replace) throw new Error('Replacement is unavailable'); * return adapter.replace<{ id: string }>('requests', 'request-1', { title: 'Revised' }); * } * ``` */ replace?<T = unknown>( collection: string, id: string, data: Record<string, unknown>, options?: QueryOptions, ): Promise<T>;
/** * Requests deletion of a record by identifier. * @typeParam T - Expected adapter result shape; no runtime validation is implied. * @param collection - Backend collection or resource name. * @param id - Identifier accepted by the selected adapter. * @param options - Optional adapter-specific write/transport settings. * @returns An adapter-defined deletion result as T, such as a boolean, count or deleted-record value. * @remarks Backend, transport and authorization failures can reject the promise. * Use the adapter's documented retry/cancellation policy; this contract supplies no rollback. * @example * ```ts * import type { DataAccessAdapter } from '@alneas/appkit-core/data'; * export async function deleteExample(adapter: DataAccessAdapter) { * return adapter.delete<unknown>('requests', 'request-1'); * } * ``` */ delete<T = unknown>(collection: string, id: string, options?: QueryOptions): Promise<T>;
/** * Runs an aggregation pipeline on an adapter supporting that capability. * @typeParam T - Expected adapter result shape; no runtime validation is implied. * @param collection - Backend collection or resource name. * @param pipeline - Ordered stages in the selected backend's supported pipeline dialect. * @param options - Optional adapter-specific aggregation/transport settings. * @returns Aggregation result rows; this interface does not validate stages or impose execution limits. * @remarks Backend, transport and authorization failures can reject the promise. * Use the adapter's documented retry/cancellation policy; this contract supplies no rollback. * @example * ```ts * import type { DataAccessAdapter } from '@alneas/appkit-core/data'; * export async function aggregateExample(adapter: DataAccessAdapter) { * if (!adapter.aggregate) throw new Error('Aggregation is unavailable'); * return adapter.aggregate<{ count: number }>('requests', [{ $count: 'count' }]); * } * ``` */ aggregate?<T = unknown>( collection: string, pipeline: unknown[], options?: QueryOptions, ): Promise<T[]>;
/** * Counts records matching an adapter-supported filter. * @param collection - Backend collection or resource name. * @param filter - Optional criteria in the adapter's supported filter dialect. * @param options - Optional adapter-specific query/transport settings. * @returns The backend-reported matching-record count. * @remarks Backend, transport and authorization failures can reject the promise. * Use the adapter's documented retry/cancellation policy; this contract supplies no rollback. * @example * ```ts * import type { DataAccessAdapter } from '@alneas/appkit-core/data'; * export async function countExample(adapter: DataAccessAdapter) { * return adapter.count('requests', { status: 'open' }); * } * ``` */ count(collection: string, filter?: Filter, options?: QueryOptions): Promise<number>;
/** * Requests insertion of multiple records on a capable adapter. * @typeParam T - Expected adapter result shape; no runtime validation is implied. * @param collection - Backend collection or resource name. * @param data - Records to insert; batching and transaction behavior are backend-specific. * @param options - Optional adapter-specific bulk-write/transport settings. * @returns Adapter-provided inserted-record results; ordering and partial failure behavior are implementation-specific. * @remarks Backend, transport and authorization failures can reject the promise. * Use the adapter's documented retry/cancellation policy; this contract supplies no rollback. * @example * ```ts * import type { DataAccessAdapter } from '@alneas/appkit-core/data'; * export async function createManyExample(adapter: DataAccessAdapter) { * if (!adapter.createMany) throw new Error('Bulk creation is unavailable'); * return adapter.createMany<{ id: string }>('requests', [{ title: 'First' }]); * } * ``` */ createMany?<T = unknown>( collection: string, data: Record<string, unknown>[], options?: QueryOptions, ): Promise<T[]>;
/** * Requests updates to records selected by a filter. * @typeParam T - Expected adapter result shape; no runtime validation is implied. * @param collection - Backend collection or resource name. * @param filter - Criteria identifying the requested update set. * @param data - Fields or update operators accepted by the backend. * @param options - Optional adapter-specific bulk-write/transport settings. * @returns Adapter-provided update results. Atomicity and partial outcomes are not standardized by this interface. * @remarks Backend, transport and authorization failures can reject the promise. * Use the adapter's documented retry/cancellation policy; this contract supplies no rollback. * @example * ```ts * import type { DataAccessAdapter } from '@alneas/appkit-core/data'; * export async function updateManyExample(adapter: DataAccessAdapter) { * if (!adapter.updateMany) throw new Error('Bulk update is unavailable'); * return adapter.updateMany<{ id: string }>('requests', { status: 'open' }, { status: 'review' }); * } * ``` */ updateMany?<T = unknown>( collection: string, filter: Filter, data: Record<string, unknown>, options?: QueryOptions, ): Promise<T[]>;
/** * Requests deletion of records selected by a filter. * @typeParam T - Expected adapter result shape; no runtime validation is implied. * @param collection - Backend collection or resource name. * @param filter - Criteria identifying the requested deletion set. * @param options - Optional adapter-specific bulk-write/transport settings. * @returns An array of adapter-defined deletion results; do not assume these are deleted records. * @remarks Backend, transport and authorization failures can reject the promise. * Use the adapter's documented retry/cancellation policy; this contract supplies no rollback. * @example * ```ts * import type { DataAccessAdapter } from '@alneas/appkit-core/data'; * export async function deleteManyExample(adapter: DataAccessAdapter) { * if (!adapter.deleteMany) throw new Error('Bulk deletion is unavailable'); * return adapter.deleteMany<unknown>('requests', { archived: true }); * } * ``` */ deleteMany?<T = unknown>( collection: string, filter: Filter, options?: QueryOptions, ): Promise<T[]>;
// --- Explicit MongoDB-style operations ---
/** * Inserts one record and returns operation metadata when supported. * @param collection - Backend collection or resource name. * @param data - Fields to insert, interpreted by the selected adapter. * @param options - Optional adapter-specific write/transport settings. * @returns Acknowledgement and available operation counts/identifiers; omitted metadata remains unknown. * @remarks Backend, transport and authorization failures can reject the promise. * Use the adapter's documented retry/cancellation policy; this contract supplies no rollback. * @example * ```ts * import type { DataAccessAdapter } from '@alneas/appkit-core/data'; * export async function insertOneExample(adapter: DataAccessAdapter) { * if (!adapter.insertOne) throw new Error('Operation metadata is unavailable'); * return adapter.insertOne('requests', { title: 'Review' }); * } * ``` */ insertOne?( collection: string, data: Record<string, unknown>, options?: QueryOptions, ): Promise<OperationResult>;
/** * Updates one selected record and returns operation metadata. * @param collection - Backend collection or resource name. * @param filter - Backend-supported selection criteria. * @param data - Fields or update operators accepted by the backend. * @param options - Optional adapter-specific write/transport settings. * @returns Acknowledgement and any reported match/modification counts. * @remarks Backend, transport and authorization failures can reject the promise. * Use the adapter's documented retry/cancellation policy; this contract supplies no rollback. * @example * ```ts * import type { DataAccessAdapter } from '@alneas/appkit-core/data'; * export async function updateOneExample(adapter: DataAccessAdapter) { * if (!adapter.updateOne) throw new Error('updateOne is unavailable'); * return adapter.updateOne('requests', { id: 'request-1' }, { status: 'review' }); * } * ``` */ updateOne?( collection: string, filter: Filter, data: Record<string, unknown>, options?: QueryOptions, ): Promise<OperationResult>;
/** * Requests replacement of one selected record and returns metadata. * @param collection - Backend collection or resource name. * @param filter - Backend-supported selection criteria. * @param data - Requested replacement contents; verify backend-specific omitted-field behavior. * @param options - Optional adapter-specific write/transport settings. * @returns Acknowledgement and any reported operation counts. Some adapters implement partial-update compatibility behavior. * @remarks Backend, transport and authorization failures can reject the promise. * Use the adapter's documented retry/cancellation policy; this contract supplies no rollback. * @example * ```ts * import type { DataAccessAdapter } from '@alneas/appkit-core/data'; * export async function replaceOneExample(adapter: DataAccessAdapter) { * if (!adapter.replaceOne) throw new Error('replaceOne is unavailable'); * return adapter.replaceOne('requests', { id: 'request-1' }, { title: 'Revised' }); * } * ``` */ replaceOne?( collection: string, filter: Filter, data: Record<string, unknown>, options?: QueryOptions, ): Promise<OperationResult>;
/** * Deletes one selected record and returns operation metadata. * @param collection - Backend collection or resource name. * @param filter - Backend-supported selection criteria. * @param options - Optional adapter-specific write/transport settings. * @returns Acknowledgement and any backend-reported deletion count. * @remarks Backend, transport and authorization failures can reject the promise. * Use the adapter's documented retry/cancellation policy; this contract supplies no rollback. * @example * ```ts * import type { DataAccessAdapter } from '@alneas/appkit-core/data'; * export async function deleteOneExample(adapter: DataAccessAdapter) { * if (!adapter.deleteOne) throw new Error('deleteOne is unavailable'); * return adapter.deleteOne('requests', { id: 'request-1' }); * } * ``` */ deleteOne?(collection: string, filter: Filter, options?: QueryOptions): Promise<OperationResult>;
/** * Requests an update and document result for one matching record. * @typeParam T - Expected adapter result shape; no runtime validation is implied. * @param collection - Backend collection or resource name. * @param filter - Backend-supported selection criteria. * @param data - Fields or update operators accepted by the backend. * @param options - Optional adapter-specific write/transport settings. * @returns An adapter-provided document or null; verify whether it returns the pre/post-update document and how missing records are handled. * @remarks Backend, transport and authorization failures can reject the promise. * Use the adapter's documented retry/cancellation policy; this contract supplies no rollback. * @example * ```ts * import type { DataAccessAdapter } from '@alneas/appkit-core/data'; * export async function findOneAndUpdateExample(adapter: DataAccessAdapter) { * if (!adapter.findOneAndUpdate) throw new Error('findOneAndUpdate is unavailable'); * return adapter.findOneAndUpdate<{ id: string }>('requests', { id: 'request-1' }, { status: 'review' }); * } * ``` */ findOneAndUpdate?<T = unknown>( collection: string, filter: Filter, data: Record<string, unknown>, options?: QueryOptions, ): Promise<T | null>;
/** * Requests replacement and a document result for one matching record. * @typeParam T - Expected adapter result shape; no runtime validation is implied. * @param collection - Backend collection or resource name. * @param filter - Backend-supported selection criteria. * @param data - Requested new contents; verify actual replacement versus partial-update behavior in the selected adapter. * @param options - Optional adapter-specific write/transport settings. * @returns An adapter-provided document or null. This interface does not guarantee whole-record replacement or a transaction across calls. * @remarks Backend, transport and authorization failures can reject the promise. * Use the adapter's documented retry/cancellation policy; this contract supplies no rollback. * @example * ```ts * import type { DataAccessAdapter } from '@alneas/appkit-core/data'; * export async function findOneAndReplaceExample(adapter: DataAccessAdapter) { * if (!adapter.findOneAndReplace) throw new Error('findOneAndReplace is unavailable'); * return adapter.findOneAndReplace<{ id: string }>('requests', { id: 'request-1' }, { title: 'Revised' }); * } * ``` */ findOneAndReplace?<T = unknown>( collection: string, filter: Filter, data: Record<string, unknown>, options?: QueryOptions, ): Promise<T | null>;
/** * Requests deletion and a document result for one matching record. * @typeParam T - Expected adapter result shape; no runtime validation is implied. * @param collection - Backend collection or resource name. * @param filter - Backend-supported selection criteria. * @param options - Optional adapter-specific write/transport settings. * @returns The adapter's deleted-document result or null; backend missing-record errors may reject instead. * @remarks Backend, transport and authorization failures can reject the promise. * Use the adapter's documented retry/cancellation policy; this contract supplies no rollback. * @example * ```ts * import type { DataAccessAdapter } from '@alneas/appkit-core/data'; * export async function findOneAndDeleteExample(adapter: DataAccessAdapter) { * if (!adapter.findOneAndDelete) throw new Error('findOneAndDelete is unavailable'); * return adapter.findOneAndDelete<{ id: string }>('requests', { id: 'request-1' }); * } * ``` */ findOneAndDelete?<T = unknown>( collection: string, filter: Filter, options?: QueryOptions, ): Promise<T | null>;}補足 (Remarks)
Section titled “補足 (Remarks)”認証、認可、トランザクション、 フィルタリング、識別子の変換は各実装が担います。省略可能なメソッドは、利用可能か確認する必要があります。 QueryOptions は要求を表すものであり、すべてのバックエンドでの保証ではありません。ジェネリックな 結果型は呼び出し元が期待する構造を記述し、レスポンスの検証は行いません。 操作は、バックエンドやトランスポートの障害により拒否される場合があります。キャンセルと再試行の ポリシーは実装固有であり、トランザクションのロールバックを意味しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport type { DataAccessAdapter } from '@alneas/appkit-core/data';export async function loadRequests(adapter: DataAccessAdapter) { return adapter.find<{ id: string; title: string }>('requests', { status: 'open' }, { limit: 20 });}---
### `INTERFACE` `data.OperationResult`
応答確認と、バックエンドが提供する操作件数または識別子を報告します。任意フィールドは、存在しないという理由だけでゼロを意味するものではありません。応答確認だけでは、永続性、業務上の不変条件、トランザクションは保証されません。
```typescriptexport interface OperationResult { /** Whether the operation was acknowledged */ acknowledged: boolean; /** Number of records matching the criteria */ matchedCount?: number; /** Number of records actually modified */ modifiedCount?: number; /** Number of records deleted */ deletedCount?: number; /** Inserted record ID */ insertedId?: string; /** Upserted record ID */ upsertedId?: string;}INTERFACE data.SearchableSelectOption
Section titled “INTERFACE data.SearchableSelectOption”検索候補の選択肢 1 件を表します。
export interface SearchableSelectOption { /** Value to be saved (e.g., ID) */ value: string | number; /** Display label (e.g., name) */ label: string; /** Optional supplementary description */ description?: string; /** Optional human-readable name */ name?: string; /** Optional human-readable code */ code?: string;}使用例 (Example)
Section titled “使用例 (Example)”```tsimport type { SearchableSelectOption } from '@alneas/appkit-core/data/common-types';const option: SearchableSelectOption = { value: 'item-1', label: 'Notebook', code: 'NB' };---
### `INTERFACE` `data.HeaderMapping`
CSV 列をデータベースのフィールドに対応付ける定義です。必須かどうかと dataType は、利用側の取り込み実装に対する指示です。このインターフェース自体は値の検証や変換を行いません。
```typescriptexport interface HeaderMapping { /** CSV column name */ csvColumn: string; /** Database field name */ dbField: string; /** Whether the field is required */ required: boolean; /** Host-defined conversion identifier, such as string; this interface imposes no vocabulary. */ dataType: string;}使用例 (Example)
Section titled “使用例 (Example)”```tsimport type { HeaderMapping } from '@alneas/appkit-core/data/common-types';const mapping: HeaderMapping = { csvColumn: 'Title', dbField: 'title', required: true, dataType: 'string' };---
### `INTERFACE` `data.UploadProgress`
アップロードの進行状況と結果を表します。カウンターの更新とエラーメッセージの内容は、取り込み実装が管理します。
```typescriptexport interface UploadProgress { /** Total number of records */ total: number; /** Number of processed records */ processed: number; /** Number of successful records */ successful: number; /** Number of failed records */ failed: number; /** List of error messages */ errors: string[];}使用例 (Example)
Section titled “使用例 (Example)”```tsimport type { UploadProgress } from '@alneas/appkit-core/data/common-types';const progress: UploadProgress = { total: 2, processed: 1, successful: 1, failed: 0, errors: [] };---
### `FUNCTION` `data.createResourceService`
特定のコレクションに紐付く CRUD メソッドを作成し、任意のホストハンドラーをサービスにコピーします。
```typescriptexport function createResourceService<T, TMetadata extends UploadFileMetadata = UploadFileMetadata>( dbAdapter: DataAccessAdapter, collection: string, options?: ResourceServiceOptions<T, TMetadata>,): ResourceService<T, TMetadata>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
dbAdapter |
DataAccessAdapter |
必須 | - 永続化、認証情報、認可を担当する、ホストが作成したアダプターです。 |
collection |
string |
必須 | - アダプターのすべての操作に渡す、バックエンドのコレクション名またはテーブル名です。 |
options |
ResourceServiceOptions<T, TMetadata> | undefined |
任意 | - 検索時のみ適用する任意のクエリデフォルト値と、ホストの取り込み・添付ハンドラーです。ハンドラーは自動生成しません。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
ResourceService<T, TMetadata> - Description: 新しいサービスです。bulkCreate と bulkUpdate は常に存在しますが、対応するアダプター機能がない場合は拒否します。
補足 (Remarks)
Section titled “補足 (Remarks)”エラーは伝播します。操作は、再試行、トランザクション、キャンセル、スキーマ変換、自動検証を追加しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { createResourceService } from '@alneas/appkit-core/data/resource-service';import type { DataAccessAdapter } from '@alneas/appkit-core/data';export function taskService(adapter: DataAccessAdapter) { return createResourceService<{ id: string; title: string }>(adapter, 'tasks');}---
### `TYPE` `data.CsvCellValue`
リソース取り込みハンドラーが受け入れるスカラーセルです。null と undefined は、ホストが定義する欠損値を表します。
```typescriptexport type CsvCellValue = string | number | boolean | null | undefined;TYPE data.CsvRow
Section titled “TYPE data.CsvRow”入力列名を CSV のスカラーセルに対応付けます。変換と検証は取り込みハンドラーが担当します。
export type CsvRow = Record<string, CsvCellValue>;INTERFACE data.UploadFileMetadata
Section titled “INTERFACE data.UploadFileMetadata”共通の任意分類フィールドを持つ、ホスト定義の添付メタデータです。このインターフェースも createResourceService も、メタデータの検証、アップロード、永続化を行いません。
export interface UploadFileMetadata { /** File type (DRAWING, PHOTO, etc.) */ fileType?: string; /** Major category classification */ category?: string; /** Minor subcategory classification */ subcategory?: string; /** File description */ description?: string; /** Custom tags */ tags?: string[]; /** * Additional application metadata passed unchanged to the host attachment implementation. */ [key: string]: unknown;}INTERFACE data.ResourceService
Section titled “INTERFACE data.ResourceService”アダプターを 1 つのコレクションに紐付け、必要に応じてホストの取り込み・添付ハンドラーを公開します。各操作では、バックエンド固有のフィルター、認可、拒否、削除の動作を維持します。
export interface ResourceService<T, TMetadata extends UploadFileMetadata = UploadFileMetadata> { /** * Returns matching records using a shallow merge of defaultQueryOptions and call options. * @param filters - Optional backend filter; absence selects an empty filter. * @param options - Per-call options overriding find defaults. * @returns Records returned by adapter.find, in backend-defined order. */ find: (filters?: Filter, options?: QueryOptions) => Promise<T[]>; /** * Looks up one record by identifier without applying find defaults. * @param id - Backend record identifier. * @param options - Options forwarded unchanged to adapter.findOne. * @returns Matching record or null, as reported by the adapter. */ findOne: (id: string, options?: QueryOptions) => Promise<T | null>; /** * Creates one record without applying find defaults. * @param data - Partial record passed to adapter.create; required-field handling belongs to the backend. * @param options - Options forwarded unchanged. * @returns Created record reported by the adapter. */ create: (data: Partial<T>, options?: QueryOptions) => Promise<T>; /** * Updates one record by identifier using the adapter's update semantics. * @param id - Backend record identifier. * @param data - Partial values to update. * @param options - Options forwarded unchanged. * @returns Updated record reported by the adapter. */ update: (id: string, data: Partial<T>, options?: QueryOptions) => Promise<T>; /** * Deletes one record using the adapter's physical or logical deletion policy. * @param id - Backend record identifier. * @param options - Options forwarded unchanged. * @returns Backend-specific deletion result; there is no common affected-row shape. */ delete: (id: string, options?: QueryOptions) => Promise<unknown>; /** * Delegates multiple records to the optional adapter.createMany capability. * @param data - Records submitted in one adapter call; atomicity and ordering are backend-specific. * @param options - Options forwarded unchanged. * @returns Created records; rejects with an unsupported-capability error when createMany is absent. */ bulkCreate: (data: Partial<T>[], options?: QueryOptions) => Promise<T[]>; /** * Delegates a filtered partial update to the optional adapter.updateMany capability. * @param filter - Backend filter selecting records. * @param data - Partial values submitted to updateMany. * @param options - Options forwarded unchanged. * @returns Updated records; rejects with an unsupported-capability error when updateMany is absent. */ bulkUpdate: (filter: Filter, data: Partial<T>, options?: QueryOptions) => Promise<T[]>; /** * Runs a host-provided CSV ingestion routine when supplied; absent when the factory receives no ingest handler. * @param data - Input rows with source column names. * @param mapping - Host-interpreted column mappings and conversion instructions. * @param options - Optional progress, batching and error-policy requests, with defaults determined by the handler. * @returns Host-reported counters and errors; partial writes and transactional behavior depend on that handler. */ ingest?: ( data: CsvRow[], mapping: HeaderMapping[], options?: { /** * Optional host progress callback. * @param processed - Number of rows the host reports as processed. * @param total - Total row count reported by the host. * @returns No result; callback error handling depends on the host ingestion implementation. */ onProgress?: (processed: number, total: number) => void; /** Batch size for chunked processing */ batchSize?: number; /** Whether to abort processing upon encountering an error */ stopOnError?: boolean; }, ) => Promise<UploadProgress>; /** * Invokes the host attachment handler when configured; the generic service adds no storage, validation or association logic. * @param file - Browser-compatible File to upload. * @param entityId - Target resource identifier interpreted by the handler. * @param metadata - Optional application metadata forwarded unchanged. * @returns The handler-specific upload/association result. */ attachFile?: (file: File, entityId: string, metadata?: TMetadata) => Promise<unknown>;}使用例 (Example)
Section titled “使用例 (Example)”```tsimport { createResourceService } from '@alneas/appkit-core/data/resource-service';import type { DataAccessAdapter } from '@alneas/appkit-core/data';export function taskService(adapter: DataAccessAdapter) { return createResourceService<{ id: string; title: string }>(adapter, 'tasks');}---
### `INTERFACE` `data.ResourceServiceOptions`
createResourceService のクエリデフォルト値と、任意のホスト機能を設定します。
```typescriptexport interface ResourceServiceOptions<_T, TMetadata extends UploadFileMetadata = UploadFileMetadata> { /** * Shallow defaults applied only by find. A per-call property overrides the default even when explicitly undefined; other operations do not merge these options. */ defaultQueryOptions?: QueryOptions; /** * Optional handler copied directly to the returned service without wrapping or default processing. * @param data - Input CSV rows. * @param mapping - Column mapping instructions. * @param options - Optional progress, batching and error policy interpreted by the host. * @returns Handler-specific completion counters and errors. */ ingest?: ( data: CsvRow[], mapping: HeaderMapping[], options?: { /** * Optional progress callback forwarded to the host ingestion implementation. * @param processed - Processed row count reported by the host. * @param total - Total row count reported by the host. * @returns No result; the generic factory does not invoke this callback. */ onProgress?: (processed: number, total: number) => void; /** * Optional batching request; no generic default or chunking is supplied by the factory. */ batchSize?: number; /** * Optional host error-policy request; the factory does not implement abort or rollback. */ stopOnError?: boolean; }, ) => Promise<UploadProgress>; /** * Optional handler copied directly to the returned service; no handler means no file capability. * @param file - Host-supplied File. * @param entityId - Resource identifier for association. * @param metadata - Optional typed metadata. * @returns Host-specific attachment result. */ attachFile?: (file: File, entityId: string, metadata?: TMetadata) => Promise<unknown>;}FUNCTION data.mapToOption
Section titled “FUNCTION data.mapToOption”厳密に型付けされていないレコードを、真と評価されるフィールドの優先順位に従って検索可能な選択肢に変換します。
export function mapToOption(item: OptionSource): SearchableSelectOption引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
item |
OptionSource |
必須 | - id と、任意の companyName、title、fileName、name、code、clientSideCode を提供するレコードです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
SearchableSelectOption - Description: value/name/label が文字列の新しい選択肢です。名前の優先順位は companyName、title、fileName、name、最後に String(id) です。コードは code、clientSideCode、空文字列の順に使用します。真と評価されるコードがなければ、description は undefined です。
補足 (Remarks)
Section titled “補足 (Remarks)”空の名前や数値コードのゼロなどの値はスキップします。レコードの検証や変更は行いません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { mapToOption } from '@alneas/appkit-core/data/search-handlers';console.log(mapToOption({ id: 7, title: 'Notebook', code: 'NB' }));// { value: '7', label: 'Notebook', description: 'NB', code: 'NB', name: 'Notebook' }---
### `FUNCTION` `data.createTableSearchHandler`
呼び出しごとにアダプターへ 1 回問い合わせる、非同期検索関数を作成します。
```typescriptexport function createTableSearchHandler( dbAdapter: DataAccessAdapter, options: SearchHandlerOptions,)引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
dbAdapter |
DataAccessAdapter |
必須 | - $or/$ilike によるフィルターと取得フィールドの選択に対応した、ホストが作成するアダプターです。認証情報と認可は引き続きホストの責任です。 |
options |
SearchHandlerOptions |
必須 | - 対象テーブル、カンマ区切りの取得フィールドと検索フィールド、および任意の件数制限・コード照合設定です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
(q: string) => Promise<SearchableSelectOption[]> - Description: 前後の空白を除去していないクエリ文字列を受け取り、変換済みの選択肢を返す関数です。空文字列でも問い合わせます。クエリが UTF-16 コード単位で 30 を超える場合は、id の完全一致条件を追加します。アダプターの拒否はそのまま伝播します。デバウンス、キャッシュ、重複排除、並べ替え、キャンセルは追加しません。
補足 (Remarks)
Section titled “補足 (Remarks)”クエリは、パーセント記号やアンダースコアをエスケープせずにパターンへ埋め込まれます。動作は、アダプターの演算子サポートに依存します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { createTableSearchHandler } from '@alneas/appkit-core/data/search-handlers';import type { DataAccessAdapter } from '@alneas/appkit-core/data';export function makeTaskSearch(adapter: DataAccessAdapter) { return createTableSearchHandler(adapter, { table: 'tasks', select: 'id,title,code', fields: ['title'], max: 20, });}---
### `INTERFACE` `data.SearchHandlerOptions`
createTableSearchHandler のバックエンドフィルターと取得フィールドの選択を設定します。SQL ワイルドカード文字のエスケープ、アクセスの認可、デバウンスやキャンセルの追加を行うオプションはありません。
```typescriptexport interface SearchHandlerOptions { /** Target database table/collection name */ table: string; /** Comma-separated list of column names to project when searching records (e.g. 'id, name, code') */ select: string; /** * Fields combined with $or and $ilike using `%query%`; supported operators and wildcard interpretation depend on the supplied adapter. An empty array still produces an empty $or unless an ID/code alternative is added. */ fields: string[]; /** * Requested result limit, defaulting to 100 when nullish. This factory does not validate positive/range limits or paginate. */ max?: number; /** * When true, a query containing only ASCII digits adds an exact code match with the original string. Leading zeroes are retained. */ includeNumericCode?: boolean;}TYPE data.OptionSource
Section titled “TYPE data.OptionSource”mapToOption 用の、厳密に型付けされていない入力レコードです。フィールドの型は実行時に検証せず、そのまま信頼します。識別子がない場合は、文字列リテラル undefined になります。
export type OptionSource = Record<string, unknown> & { /** * Identifier stringified into option.value; also the final display-name fallback. */ id?: string | number; /** * First truthy display-name choice, before title, fileName and name. */ companyName?: string; /** * Display-name choice after companyName and before fileName. */ title?: string; /** * Display-name choice after title and before name. */ fileName?: string; /** * Last named display-label choice before the stringified id. */ name?: string; /** * First truthy code choice; numeric zero is treated as absent. */ code?: string | number; /** * Fallback truthy code choice when code is falsy. */ clientSideCode?: string | number;};TYPE data.DecimalDecodeMode
Section titled “TYPE data.DecimalDecodeMode”設定された読み取り値を、BigNumber に類似したインスタンスまたは固定小数点文字列として選択します。未設定のフィールドは変更しません。
export type DecimalDecodeMode = 'bignumber' | 'string';TYPE data.DecimalRoundingMode
Section titled “TYPE data.DecimalRoundingMode”BigNumber.js 互換の丸めモード 0 から 8 です。指定する数値コンストラクターは、これらの値を同じ意味で解釈する必要があります。
export type DecimalRoundingMode = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;INTERFACE data.BigNumberLike
Section titled “INTERFACE data.BigNumberLike”ラッパーが使用する、十進数インスタンスの最小限の操作です。互換性のある厳密な十進数実装を指定してください。
export interface BigNumberLike { /** * Rounds to a decimal scale before write serialization. * @param decimalPlaces - Requested fractional digit count from field.scale. * @param roundingMode - Field/adapter rounding mode. * @returns Decimal instance whose toFixed serializes the rounded value; mutation behavior belongs to the supplied library. */ decimalPlaces: (decimalPlaces: number, roundingMode?: DecimalRoundingMode) => BigNumberLike; /** * Checks newly constructed decimal values before conversion. * @returns True when the instance represents a finite decimal according to the supplied library. */ isFinite: () => boolean; /** * Serializes a decimal to fixed-point text. * @param decimalPlaces - Optional fractional scale; absence requests the full fixed-point representation. * @returns Fixed-point decimal text with library-defined rounding when a scale is supplied. */ toFixed: (decimalPlaces?: number) => string;}INTERFACE data.BigNumberConstructorLike
Section titled “INTERFACE data.BigNumberConstructorLike”構造的な厳密十進数コンストラクターとインスタンス判定関数です。isBigNumber が受け入れた既存の値は、有限値かどうかを再確認せずにそのまま通します。
export interface BigNumberConstructorLike { /** * Constructs a decimal from input text or a JavaScript number. Numbers may already have lost precision before construction. * @param value - Decimal input; the wrapper checks isFinite on newly constructed results. * @returns A compatible decimal instance. * @example * ```ts * import { BigNumberDataAccessAdapter } from '@alneas/appkit-core/data/bignumber-adapter'; * import type { BigNumberConstructorLike } from '@alneas/appkit-core/data/bignumber-adapter'; * import type { DataAccessAdapter } from '@alneas/appkit-core/data'; * export function decimalAdapter(base: DataAccessAdapter, BigNumber: BigNumberConstructorLike) { * return new BigNumberDataAccessAdapter({ base, BigNumber, fields: { amount: { scale: 2 } }, decodeMode: 'string' }); * } * ``` */ new (value: string | number): BigNumberLike; /** * Recognizes existing decimal instances. * @param value - Value encountered during configured-field conversion. * @returns True when value can be used directly as a BigNumberLike; no additional finite check follows this branch. */ isBigNumber: (value: unknown) => value is BigNumberLike; /** * Optional half-up mode constant; the wrapper falls back to numeric mode 4 when absent. */ ROUND_HALF_UP?: DecimalRoundingMode;}INTERFACE data.DecimalFieldConfig
Section titled “INTERFACE data.DecimalFieldConfig”パスごとの書き込みスケール、書き込み時の丸め、読み取り表現です。null/undefined 値は保持します。スケールと範囲の検証は数値ライブラリが担当します。
export interface DecimalFieldConfig { /** * Decimal scale for DB serialization. * If set, values are rounded and zero-padded via `toFixed(scale)`. */ scale?: number; /** * Write rounding override, falling back to the adapter setting. Scaled read-side string conversion calls toFixed(scale) without this override and uses the supplied library default. */ roundingMode?: DecimalRoundingMode; /** * Decoded representation for read-side values. * Defaults to adapter-level `decodeMode`. */ decodeMode?: DecimalDecodeMode;}INTERFACE data.BigNumberDataAccessAdapterConfig
Section titled “INTERFACE data.BigNumberDataAccessAdapterConfig”ホストのアダプター、互換性のある十進数コンストラクター、設定された十進数パスです。ラッパーはバックエンドの保存型やスキーマを変更しません。
export interface BigNumberDataAccessAdapterConfig { /** * Wrapped adapter (Supabase/Mongo/Convex/Oracle ORDS etc.) */ base: DataAccessAdapter; /** * BigNumber constructor from `bignumber.js`. */ BigNumber: BigNumberConstructorLike; /** * Decimal field rules by dot path. * * Examples: * - `amount` * - `price.net_amount` * - `lines[].unit_price` (array wildcard) */ fields: Record<string, DecimalFieldConfig>; /** * Default decode mode for read-side conversion. * @default 'bignumber' */ decodeMode?: DecimalDecodeMode; /** * Default write rounding mode; falls back to BigNumber.ROUND_HALF_UP, then 4. Read-side string rounding uses the library default. */ roundingMode?: DecimalRoundingMode; /** * Defaults to true. Rejects configured non-null inputs that are neither recognized instances nor finite string/number conversions. False preserves unsupported/non-finite newly parsed inputs; exceptions thrown by the supplied library still propagate. Existing recognized instances are not checked for finiteness. */ strict?: boolean;}使用例 (Example)
Section titled “使用例 (Example)”```tsimport { BigNumberDataAccessAdapter } from '@alneas/appkit-core/data/bignumber-adapter';import type { BigNumberConstructorLike } from '@alneas/appkit-core/data/bignumber-adapter';import type { DataAccessAdapter } from '@alneas/appkit-core/data';export function decimalAdapter(base: DataAccessAdapter, BigNumber: BigNumberConstructorLike) { return new BigNumberDataAccessAdapter({ base, BigNumber, fields: { amount: { scale: 2 } }, decodeMode: 'string' });}---
### `CLASS` `data.BigNumberDataAccessAdapter`
ホストのアダプターをラップして、設定された十進数パスを固定小数点文字列にエンコードし、返された行を十進数インスタンスまたは文字列にデコードします。ドット区切りのパスと配列ワイルドカードに対応し、最初に一致した設定パスを適用します。入力の JavaScript 数値は、すでに精度が失われている可能性があります。
```typescriptclass data.BigNumberDataAccessAdapter補足 (Remarks)
Section titled “補足 (Remarks)”null/undefined はそのまま通過し、設定対象でない値は保持されます。走査したオブジェクトや配列は再構築しますが、変更しない値は参照を保持する場合があります。バックエンドの機能と認可は引き続き base が担います。省略可能なメソッドは公開されますが、base に対応する機能がなければ拒否されます。置換操作はベースアダプターの意味を維持します。書き込み成功後の変換でも、ロールバックせずに拒否される場合があります。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { BigNumberDataAccessAdapter } from '@alneas/appkit-core/data/bignumber-adapter';import type { BigNumberConstructorLike } from '@alneas/appkit-core/data/bignumber-adapter';import type { DataAccessAdapter } from '@alneas/appkit-core/data';export function decimalAdapter(base: DataAccessAdapter, BigNumber: BigNumberConstructorLike) { return new BigNumberDataAccessAdapter({ base, BigNumber, fields: { amount: { scale: 2 } }, decodeMode: 'string' });}---
### `INTERFACE` `data.MongoApiConfig`
MongoApiAdapter 用のホスト API エンドポイントと、任意の認証・トランスポートです。これは独自の HTTP プロトコルであり、MongoDB ドライバーによる直接接続ではありません。
```typescriptexport interface MongoApiConfig { /** * HTTP endpoint receiving POST JSON tuples of the form ["mongo/client", operation]. The host must implement this protocol and enforce authorization. */ baseUrl: string; /** * Optional token supplier invoked before every request. * @returns A token added as Bearer authorization when truthy; an empty string omits that header. Rejections prevent the request. */ getToken?: () => Promise<string>; /** * Optional host transport; defaults to global fetch when falsy. No cancellation signal or retry policy is added. */ fetch?: FetchLike;}CLASS data.MongoApiAdapter
Section titled “CLASS data.MongoApiAdapter”Mongo 形式の操作を、ホスト定義の HTTP API に送信します。各呼び出しで [“mongo/client”, operation] を POST し、解析済みの JSON 結果を、検証や Extended JSON/ObjectId 変換をせずに信頼します。認証、認可、Mongo の実行、レスポンスの構造はホストが管理します。
class data.MongoApiAdapter補足 (Remarks)
Section titled “補足 (Remarks)”QueryOptions.signal は fetch に渡されません。ネストされたオプション値は JSON シリアライズされます。シリアライズできない値は正規化されません。原子性はサーバー側の特性であり、このトランスポートラッパーは保証しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { MongoApiAdapter } from '@alneas/appkit-core/data/mongodb';import type { MongoApiConfig } from '@alneas/appkit-core/data/mongodb';export function connectMongoApi(config: MongoApiConfig) { return new MongoApiAdapter(config);}---
### `FUNCTION` `data.isConvexAdapter`
アダプターが true に等しい isConvex を公開しているかどうかだけを確認します。
```typescriptexport function isConvexAdapter(adapter: DataAccessAdapter): adapter is ConvexAdapter引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
adapter |
DataAccessAdapter |
必須 | - 検査対象のアダプターです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
boolean - Description: マーカーがあれば true となり、型を ConvexAdapter に絞り込みます。instanceof、クライアントのメソッド、参照マップの妥当性は確認しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { isConvexAdapter } from '@alneas/appkit-core/data/convex';import type { DataAccessAdapter } from '@alneas/appkit-core/data';export function getConvexClient(adapter: DataAccessAdapter) { return isConvexAdapter(adapter) ? adapter.getClient() : undefined;}---
### `INTERFACE` `data.ConvexQueryRefs`
コレクションごとのホストクエリ参照です。list は { filter, ...options }、get は { id }、count は { filter } を受け取ります。参照先の関数は、認可を実施し、これらの構造を実装する必要があります。
```typescriptexport interface ConvexQueryRefs { /** * Query returning a record array for { filter, ...options }; the adapter does not translate filter operators. */ list: unknown; /** * Query returning one record or null for { id }. */ get: unknown; /** * Optional query returning a number for { filter }; absence makes count reject. */ count?: unknown;}INTERFACE data.ConvexMutationRefs
Section titled “INTERFACE data.ConvexMutationRefs”コレクションごとのホストのミューテーション参照です。検証、永続化、認可、結果の構造はホストが管理します。
export interface ConvexMutationRefs { /** * Mutation accepting { data } and returning a created record. */ create: unknown; /** * Mutation accepting { id, data } and returning an updated record. */ update: unknown; /** * Mutation accepting { id } and returning its host-defined deletion result. */ delete: unknown; /** * Optional mutation accepting { items } and returning an array; absence selects sequential create calls without a shared transaction. */ createMany?: unknown; /** * Optional mutation accepting { filter, data } and returning an array; absence makes updateMany reject. */ updateMany?: unknown; /** * Optional mutation accepting { filter } and returning an array; absence makes deleteMany reject. */ deleteMany?: unknown;}INTERFACE data.ConvexAdapterConfig
Section titled “INTERFACE data.ConvexAdapterConfig”ホストクライアントと、コレクションから関数への対応付けです。アダプターはこれらの参照を直接保持し、関数の生成や契約の検証は行いません。
export interface ConvexAdapterConfig { /** ConvexReactClient instance */ client: ConvexReactClient; /** * Collection names mapped to host list/get and optional count references. * @see {@link ConvexQueryRefs}. */ queries: Record<string, ConvexQueryRefs>; /** * Collection names mapped to host CRUD and optional bulk references. * @see {@link ConvexMutationRefs}. */ mutations: Record<string, ConvexMutationRefs>;}使用例 (Example)
Section titled “使用例 (Example)”```tsimport { ConvexAdapter } from '@alneas/appkit-core/data/convex';import type { ConvexAdapterConfig } from '@alneas/appkit-core/data/convex';export function connectConvex(config: ConvexAdapterConfig) { return new ConvexAdapter(config);}---
### `CLASS` `data.ConvexAdapter`
コレクション操作を、明示的に設定した Convex のクエリ・ミューテーション関数に対応付けます。フィルターの変換やサーバー関数の提供は行わず、スキーマと権限はホストが管理します。isConvex は連携する React フック向けにアダプターを識別し、直接呼び出すメソッドは単発の Promise を返します。
```typescriptclass data.ConvexAdapter使用例 (Example)
Section titled “使用例 (Example)”```tsimport { ConvexAdapter } from '@alneas/appkit-core/data/convex';import type { ConvexAdapterConfig } from '@alneas/appkit-core/data/convex';export function connectConvex(config: ConvexAdapterConfig) { return new ConvexAdapter(config);}---
### `FUNCTION` `data.createSqliteDriver`
同期的な prepare/all/get/run 呼び出しを、非同期ドライバーインターフェースでラップします。各操作でステートメントを準備し、位置指定値を展開して渡します。ラッパーはデータベースのクローズ、トランザクションの追加、ドライバー結果の正規化を行いません。
```typescriptexport function createSqliteDriver(database: SqliteDatabaseLike): SqliteDriver引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
database |
SqliteDatabaseLike |
必須 | - SqliteDatabaseLike に適合する、ホスト管理のデータベースです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
SqliteDriver - Description: Promise がホストの結果で解決されるか、ホストのエラーで拒否されるドライバーです。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { SQLiteDataAccessAdapter, createSqliteDriver } from '@alneas/appkit-core/data/sqlite';import type { SqliteDatabaseLike } from '@alneas/appkit-core/data/sqlite';export function readOnlyAdapter(database: SqliteDatabaseLike) { return new SQLiteDataAccessAdapter({ driver: createSqliteDriver(database), readOnly: true });}---
### `TYPE` `data.SqliteValue`
SQLite ドライバーに渡すバインド値です。オブジェクト・配列は呼び出し元でシリアライズする必要があります。boolean や bigint を含むスカラー値の実際の対応範囲は、選択したドライバーによって異なります。
```typescriptexport type SqliteValue = string | number | boolean | bigint | null | Uint8Array;INTERFACE data.SqliteRunResult
Section titled “INTERFACE data.SqliteRunResult”ドライバーが提供する書き込みメタデータです。任意フィールドは createSqliteDriver によって補完されません。
export interface SqliteRunResult { /** Number of modified rows. Undefined if not returned by the driver. */ changes?: number; /** rowid of the inserted row. Undefined if not returned by the driver. */ lastInsertRowid?: number | string | bigint;}INTERFACE data.SqliteDriver
Section titled “INTERFACE data.SqliteDriver”同期的にも非同期にも利用できる、SQLite 実行機能の最小限のインターフェース仕様です。
node:sqlite や better-sqlite3 などの同期的な API は、
{@link createSqliteDriver} を使用してこの形式に変換できます。Cloudflare D1 のように
prepare().bind() が必要な API では、専用ドライバーを実装してください。
export interface SqliteDriver { /** * Executes SQL and returns all rows. * @typeParam T - Caller-expected row shape; the driver does not validate it. * @param sql - SQL text to prepare and execute. * @param params - Positional scalar values in placeholder order; compatibility belongs to the selected driver. * @returns A promise of the driver row array. */ all<T = Record<string, unknown>>( sql: string, params: readonly SqliteValue[], ): Promise<readonly T[]>; /** * Executes SQL and returns the first row, or null. * @typeParam T - Caller-expected row shape; the driver does not validate it. * @param sql - SQL text to prepare and execute. * @param params - Positional scalar values in placeholder order; compatibility belongs to the selected driver. * @returns A promise of the first row or null. */ get<T = Record<string, unknown>>(sql: string, params: readonly SqliteValue[]): Promise<T | null>; /** * Executes a write and returns driver metadata. * @param sql - SQL text to prepare and execute. * @param params - Positional scalar values in placeholder order; compatibility belongs to the selected driver. * @returns A promise of write metadata; changes and lastInsertRowid may be absent. */ run(sql: string, params: readonly SqliteValue[]): Promise<SqliteRunResult>;}INTERFACE data.SqlitePreparedStatementLike
Section titled “INTERFACE data.SqlitePreparedStatementLike”createSqliteDriver が利用する、同期的なプリペアドステートメントの構造です。ステートメントとデータベースの存続期間、およびバインドの互換性はホストが管理します。
export interface SqlitePreparedStatementLike { /** * Executes SQL and returns all rows. * @typeParam T - Caller-expected row shape; the driver does not validate it. * @param params - Positional scalar values in placeholder order; compatibility belongs to the selected driver. * @returns the driver row array. */ all<T = Record<string, unknown>>(...params: SqliteValue[]): readonly T[]; /** * Executes SQL and returns the first row, or null. * @typeParam T - Caller-expected row shape; the driver does not validate it. * @param params - Positional scalar values in placeholder order; compatibility belongs to the selected driver. * @returns the first row or null. */ get<T = Record<string, unknown>>(...params: SqliteValue[]): T | null; /** * Executes a write and returns driver metadata. * @param params - Positional scalar values in placeholder order; compatibility belongs to the selected driver. * @returns write metadata; changes and lastInsertRowid may be absent. */ run(...params: SqliteValue[]): SqliteRunResult;}INTERFACE data.SqliteDatabaseLike
Section titled “INTERFACE data.SqliteDatabaseLike”{@link createSqliteDriver} が受け入れる、Node SQLite データベースの構造的な型です。
export interface SqliteDatabaseLike { /** * Prepares SQL for execution through the host database. * @param sql - SQL text with positional bind placeholders. * @returns A synchronous statement; errors propagate through the driver wrapper. */ prepare(sql: string): SqlitePreparedStatementLike;}INTERFACE data.SqliteDataAccessAdapterConfig
Section titled “INTERFACE data.SqliteDataAccessAdapterConfig”{@link SQLiteDataAccessAdapter} の設定です。
driver を除くすべての設定は、アプリケーションのスキーマと
キャッシュ境界に合わせて設定します。SQL 識別子は、安全な英数字とアンダースコアに制限されます。
export interface SqliteDataAccessAdapterConfig { /** * Host-created driver executing SQL and managing connection/authorization lifecycle. */ driver: SqliteDriver; /** * Primary identifier column; defaults to id when nullish. Must match the restricted SQL identifier syntax. */ idColumn?: string; /** * When true, mutation operations that reach a write reject. Defaults to false; this adapter flag does not change database permissions. */ readOnly?: boolean; /** * Optional shared cache namespace exposed unchanged; it is not a credential or authorization policy. */ cacheScope?: string;}CLASS data.SQLiteDataAccessAdapter
Section titled “CLASS data.SQLiteDataAccessAdapter”ホスト管理のドライバーを使用し、コレクションの CRUD をパラメーター化された SQLite SQL にコンパイルします。識別子は ASCII の英字またはアンダースコアで始まり、その後に英字・数字・アンダースコアが続く形式を受け入れます。値はスカラーのバインド値です。このアダプターは、スキーマ作成、認可、結合、トランザクション、キャンセルへの対応を追加しません。
class data.SQLiteDataAccessAdapter補足 (Remarks)
Section titled “補足 (Remarks)”find はプロジェクション、ソート、limit、skip をサポートします。未対応の QueryOptions は無視され、フィルター演算子は明示的に制限されます。読み取りと書き込みの一連の処理はアトミックではありません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { SQLiteDataAccessAdapter, createSqliteDriver } from '@alneas/appkit-core/data/sqlite';import type { SqliteDatabaseLike } from '@alneas/appkit-core/data/sqlite';export function readOnlyAdapter(database: SqliteDatabaseLike) { return new SQLiteDataAccessAdapter({ driver: createSqliteDriver(database), readOnly: true });}---
### `FUNCTION` `data.createD1DataAccessAdapter`
SQL の実行やスキーマの作成を行わずに、D1 アダプターを作成します。
```typescriptexport function createD1DataAccessAdapter(config: D1DataAccessAdapterConfig): D1DataAccessAdapter引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
config |
D1DataAccessAdapterConfig |
必須 | - ホストのバインディングと、任意の共通 SQLite 設定です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
D1DataAccessAdapter - Description: 新しい D1DataAccessAdapter です。バインディングの所有権はホストが保持します。
例外 (Throws)
Section titled “例外 (Throws)”設定された識別子列が無効な場合のエラーです。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { createD1DataAccessAdapter } from '@alneas/appkit-core/data/d1';import type { D1DatabaseLike } from '@alneas/appkit-core/data/d1';export function contentAdapter(db: D1DatabaseLike) { return createD1DataAccessAdapter({ db, readOnly: true });}---
### `INTERFACE` `data.D1PreparedStatementLike`
ドライバーブリッジが利用する、非同期 D1 ステートメントの構造です。SQL の実行と認可はホストのバインディングが管理します。
```typescriptexport interface D1PreparedStatementLike { /** * Binds positional values before execution. * @param values - SQLite scalar values in placeholder order; actual compatibility follows the binding. * @returns The bound statement used for execution. */ bind(...values: import('./sqlite').SqliteValue[]): D1PreparedStatementLike; /** * Executes a query for all rows. * @typeParam T - Expected row shape, not runtime-validated. * @returns A promise of an object containing results; driver bridge extracts results directly. */ all<T = Record<string, unknown>>(): Promise<{ /** * Rows returned by the D1 binding, forwarded without row conversion. */ results: T[] }>; /** * Executes a query for its first row. * @typeParam T - Expected row shape, not runtime-validated. * @returns The first row or null. */ first<T = Record<string, unknown>>(): Promise<T | null>; /** * Executes a write through the host binding. * @returns Optional status and metadata. The adapter bridge reads meta only; it does not check success. */ run(): Promise<{ /** * Optional D1 status flag; the bridge does not independently inspect it. */ success?: boolean; /** * Optional write metadata forwarded to SQLite result fields. */ meta?: { /** * Affected-row count, exposed as changes when provided. */ changes?: number; /** * Inserted row identifier, exposed as lastInsertRowid when provided. */ last_row_id?: number | string } }>;}INTERFACE data.D1DatabaseLike
Section titled “INTERFACE data.D1DatabaseLike”prepare メソッドを持つ、ホスト提供の D1 バインディングです。この構造は、データベースの作成や Worker 環境の提供を行いません。
export interface D1DatabaseLike { /** * Prepares one SQL statement on the binding. * @param sql - SQL text generated by the SQLite adapter. * @returns A statement whose bind and execution methods are used by the bridge. */ prepare(sql: string): D1PreparedStatementLike;}INTERFACE data.D1DataAccessAdapterConfig
Section titled “INTERFACE data.D1DataAccessAdapterConfig”D1 バインディングと共通 SQLite 設定です。デフォルト値、識別子の検証、readOnly、cacheScope は SQLiteDataAccessAdapter と同じです。
export interface D1DataAccessAdapterConfig extends Omit<SqliteDataAccessAdapterConfig, 'driver'> { /** D1 binding injected from Cloudflare Workers. */ db: D1DatabaseLike;}CLASS data.D1DataAccessAdapter
Section titled “CLASS data.D1DataAccessAdapter”D1 の prepare/bind/all/first/run を SQLiteDataAccessAdapter に橋渡しします。非アトミックな読み取り・書き込みシーケンスや部分更新時の置換を含め、SQLite のフィルターと CRUD の制限を継承します。Worker バインディングやスキーマは作成しません。
class data.D1DataAccessAdapter使用例 (Example)
Section titled “使用例 (Example)”```tsimport { createD1DataAccessAdapter } from '@alneas/appkit-core/data/d1';import type { D1DatabaseLike } from '@alneas/appkit-core/data/d1';export function contentAdapter(db: D1DatabaseLike) { return createD1DataAccessAdapter({ db, readOnly: true });}---
### `FUNCTION` `data.getAdapterCacheScope`
明示的な共有キャッシュスコープ、またはこのアダプターオブジェクトの不透明な識別子を返します。
```typescriptexport function getAdapterCacheScope(adapter: object & { /** Explicit shared namespace; every defined string takes precedence over instance identity. */ readonly cacheScope?: string;}): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
adapter |
object & { readonly cacheScope?: string; } |
必須 | - cacheScope を任意で宣言するオブジェクトです。空文字列を含め、定義済みの文字列はすべて明示的なスコープを選択します。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description:
explicit:に、cacheScope が定義されている場合はその値を、それ以外は安定したインスタンススコープを続けたものです。同じ明示的な文字列は意図的にスコープを共有します。これは認可境界ではありません。
例外 (Throws)
Section titled “例外 (Throws)”プロパティアクセスの失敗、または新しいインスタンススコープが必要なときの crypto.randomUUID の欠如や失敗を伝播します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { getAdapterCacheScope } from '@alneas/appkit-core/data/cache-scope';console.log(getAdapterCacheScope({ cacheScope: 'catalog' })); // 'explicit:catalog'---
### `FUNCTION` `data.getInstanceCacheScope`
明示的な cacheScope プロパティの有無や値にかかわらず、1 つのオブジェクトに不透明な識別子を割り当てます。
```typescriptexport function getInstanceCacheScope(adapter: object): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
adapter |
object |
必須 | - WeakMap のキーとして使用するオブジェクトです。フィールドは検査しません。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: このモジュールインスタンス内で、同じオブジェクトを使って繰り返し呼び出した場合は、同じ
instance:UUID 文字列を返します。他のオブジェクト、および他の実行環境やモジュールのインスタンスは、独立した識別情報を持ちます。
例外 (Throws)
Section titled “例外 (Throws)”オブジェクトに対する最初の呼び出し時に、crypto.randomUUID の欠如や失敗を伝播します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { getInstanceCacheScope } from '@alneas/appkit-core/data/cache-scope';const adapter = {};console.log(getInstanceCacheScope(adapter) === getInstanceCacheScope(adapter)); // true---
### `INTERFACE` `data.WorkflowTransition`
フレームワークに依存しないステータス遷移メタデータです。ラベルとアイコンは利用側が管理します。
```typescriptexport interface WorkflowTransition { from: string; to: string; requiresApproval?: boolean; requiredFields?: string[];}INTERFACE data.WorkflowAction
Section titled “INTERFACE data.WorkflowAction”インターフェース data.WorkflowAction
export interface WorkflowAction { action: string; enabledStatuses: string[]; required?: boolean;}INTERFACE data.WorkflowDefinition
Section titled “INTERFACE data.WorkflowDefinition”インターフェース data.WorkflowDefinition
export interface WorkflowDefinition< TTransition extends WorkflowTransition = WorkflowTransition, TAction extends WorkflowAction = WorkflowAction, TInfo = unknown,> { id: string; label: string; statusOrder: string[]; transitions: TTransition[]; actions?: TAction[]; statusInfo: Record<string, TInfo>; defaultStatusInfo: TInfo;}CLASS data.WorkflowEngine
Section titled “CLASS data.WorkflowEngine”React や製品固有の規則に依存せず、設定された遷移・アクション・進捗を読み取ります。 遷移の実行、状態の永続化、フィールドの検証、ユーザーの認可は行いません。 互換性のため、設定と返されるエントリーは元の参照を保持します。
class data.WorkflowEngineINTERFACE data.TransitionValidationResult
Section titled “INTERFACE data.TransitionValidationResult”インターフェース data.TransitionValidationResult
export interface TransitionValidationResult { allowed: boolean; reason?: string;}INTERFACE data.WorkflowPolicy
Section titled “INTERFACE data.WorkflowPolicy”すべての判断は、アプリケーションが明示的に指定する必要があります。
export interface WorkflowPolicy<TContext> { validateTransition(context: TContext): TransitionValidationResult; requiresApproval(context: TContext): boolean; getRequiredFields(context: TContext): string[];}CLASS data.WorkflowPolicyEngine
Section titled “CLASS data.WorkflowPolicyEngine”アプリケーションが設定するポリシーです。金額のしきい値や文書・ステータスの規約は含みません。
class data.WorkflowPolicyEngineINTERFACE data.FileNode
Section titled “INTERFACE data.FileNode”レンダラー、選択状態、レイアウトから独立した、論理的なファイルまたはフォルダーです。
export interface FileNode { id: string; physicalKey?: string; name: string; kind: 'file' | 'folder'; size?: number; contentType?: string; lastModified?: Date; original?: StorageObject; metadata?: Record<string, string>; isVirtual?: boolean;}TYPE data.FileNodeKind
Section titled “TYPE data.FileNodeKind”型 data.FileNodeKind
export type FileNodeKind = FileNode['kind'];INTERFACE data.FileProvider
Section titled “INTERFACE data.FileProvider”ファイル操作は、認可、再帰的なフォルダー操作、法令への準拠を意味しません。
export interface FileProvider { listNodes(path: string): Promise<{ nodes: FileNode[]; hasMore: boolean }>; searchNodes(criteria: FileSearchCriteria): Promise<FileNode[]>; uploadFile(path: string, file: File | Blob, name: string): Promise<FileNode>; createFolder(path: string, name: string): Promise<FileNode>; getUrl(node: FileNode, options?: StorageURLOptions): Promise<string>; deleteNodes(ids: string[]): Promise<void>; renameNode(id: string, newName: string): Promise<FileNode>; moveNode(id: string, newPath: string): Promise<FileNode>; updateMetadata(id: string, metadata: Record<string, string>): Promise<FileNode>; verifyIntegrity?(id: string): Promise<{ valid: boolean; error?: string }>;}INTERFACE data.FileSearchCriteria
Section titled “INTERFACE data.FileSearchCriteria”インターフェース data.FileSearchCriteria
export interface FileSearchCriteria { query?: string; tags?: string[]; }INTERFACE data.FileRecord
Section titled “INTERFACE data.FileRecord”既存のレコード構造です。フォルダーレコードでは、ファイル専用の size/content_type が実行時に省略される場合があります。
export interface FileRecord { id: string; folder: string; filename: string; physical_key: string; size: number; content_type: string; /** Comma-separated tags, with no quoting or escaped commas. */ tags?: string; updated_at: string; kind: FileNodeKind;}TYPE data.FileRecordInput
Section titled “TYPE data.FileRecordInput”型 data.FileRecordInput
export type FileRecordInput = Omit<FileRecord, 'size' | 'content_type'> & Partial<Pick<FileRecord, 'size' | 'content_type'>>;INTERFACE data.UploadCompensationContext
Section titled “INTERFACE data.UploadCompensationContext”インターフェース data.UploadCompensationContext
export interface UploadCompensationContext { readonly cause: unknown; readonly record: Readonly<FileRecordInput>; readonly object: Readonly<StorageObject>;}INTERFACE data.DataAccessFileProviderOptions
Section titled “INTERFACE data.DataAccessFileProviderOptions”インターフェース data.DataAccessFileProviderOptions
export interface DataAccessFileProviderOptions { dataAccess: DataAccessAdapter; storage: StorageAdapter; collection?: string; physicalPrefix?: string; /** Default metadata-only. storage-and-metadata deletes the visible object key first, then its record. */ deleteMode?: 'metadata-only' | 'storage-and-metadata'; /** Default portable: literal case-insensitive filename substring + exact, case-sensitive AND tags. */ searchMode?: 'portable' | 'legacy-adapter'; /** Default 10,000. Bounds local search processing after the adapter has returned records, not network retrieval. */ maxSearchRecords?: number; /** Optional exhaustive, authorized candidate lookup for indexed/back-end search. Portable predicates still apply. */ searchRecords?: (criteria: Readonly<FileSearchCriteria>) => Promise<FileRecord[]>; /** Default retain. Compensation is opt-in because a rejected create may actually have committed. */ uploadFailurePolicy?: 'retain' | 'compensate'; /** Required for compensate: confirm definitive non-commit AND exclusive ownership of the uploaded key. A missing read-back alone is insufficient. */ canCompensateUpload?: (context: UploadCompensationContext) => boolean | Promise<boolean>; /** Generate a fresh, unique ID in the application's namespace. Default Web Crypto randomUUID. */ createId?: () => string;}TYPE data.FileCompensationStatus
Section titled “TYPE data.FileCompensationStatus”型 data.FileCompensationStatus
export type FileCompensationStatus = 'not-requested' | 'retained' | 'unconfirmed' | 'deleted' | 'failed';CLASS data.FileProviderOperationError
Section titled “CLASS data.FileProviderOperationError”整合性の回復に使用する部分的な失敗の詳細です。DB と blob の組み合わせは分散トランザクションではありません。
class data.FileProviderOperationErrorFUNCTION data.parseFileTags
Section titled “FUNCTION data.parseFileTags”比較用にカンマ区切りのタグを正規化します。元のメタデータは保持します。
export function parseFileTags(value: string | undefined): string[]引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
value |
string | undefined |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string[]
FUNCTION data.matchesFileRecord
Section titled “FUNCTION data.matchesFileRecord”環境に依存しないリテラル検索です。ユーザー入力を正規表現や DB 演算子として解釈することはありません。
export function matchesFileRecord(record: FileRecordInput, criteria: Readonly<FileSearchCriteria>): boolean引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
record |
FileRecordInput |
必須 | |
criteria |
Readonly<FileSearchCriteria> |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
boolean
CLASS data.DataAccessFileProvider
Section titled “CLASS data.DataAccessFileProvider”呼び出し元が指定する DB アダプターとストレージアダプターを組み合わせます。実行時のインポートでは、どちらの SDK も不要です。 デフォルトでは、削除はメタデータのみを対象とし、環境に依存しない検索を使用し、DB での失敗時もアップロード済みデータを保持します。 フォルダー操作はそのレコードだけに作用し、子要素の再帰的な名前変更・移動・削除は行いません。 認可、キーの排他的な所有権、並行処理はアプリケーションで設定してください。
class data.DataAccessFileProviderFUNCTION japan.legalDocument.parseLegalDocument
Section titled “FUNCTION japan.legalDocument.parseLegalDocument”Markdown 形式の日本語の法的文書を解析し、構造化データを返します。
export function parseLegalDocument(markdown: string): ParsedDocument引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
markdown |
string |
必須 | - 日本語の条文形式の Markdown です。先頭の YAML フロントマターは省略できます。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
ParsedDocument - Description: A new structured document; absent/invalid frontmatter falls back to title 無題, type contract and no parties.
補足 (Remarks)
Section titled “補足 (Remarks)”これは形式のパーサーであり、法的な検証ではありません。条文の見出しには 第
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { parseLegalDocument } from '@alneas/appkit-core/japan/legal-document/parser';
const parsed = parseLegalDocument([ '---', 'title: Sample agreement', 'documentType: contract', '---', '第1条(目的)', ' The parties agree to the following terms.',].join('\n'));console.log(parsed.metadata.title, parsed.blocks);---
### `FUNCTION` `japan.legalDocument.buildLegalDocumentPdfmakeContent`
ParsedDocument から、pdfmake のドキュメント定義のコンテンツを構築します。
```typescriptexport function buildLegalDocumentPdfmakeContent( parsed: ParsedDocument,)引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
parsed |
ParsedDocument |
必須 | - parseLegalDocument から得られる構造化ドキュメント、またはホストが提供する同等のモデルです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
{ content: any[]; styles: { docTitle: { fontSize: number; bold: boolean; alignment: string; }; docReference: { fontSize: number; }; articleHeader: { fontSize: number; bold: boolean; }; signatureRole: { fontSize: number; bold: boolean; margin: number[]; }; signatureText: { fontSize: number; }; }; pageSize: "A4"; pageMargins: [number, number, number, number]; defaultStyle: { fontSize: number; lineHeight: number; }; } - Description: pdfmake 形式のコンテンツ、スタイル、A4 のページ寸法設定、およびデフォルトのテキスト設定です。PDF のバイト列ではありません。
補足 (Remarks)
Section titled “補足 (Remarks)”ホストが pdfmake レンダラーと適切な日本語フォントを提供します。この関数は、法的有効性の確認や文書への署名を行いません。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { parseLegalDocument } from '@alneas/appkit-core/japan/legal-document/parser';import { buildLegalDocumentPdfmakeContent } from '@alneas/appkit-core/japan/pdf';
const definition = buildLegalDocumentPdfmakeContent(parseLegalDocument('第1条(目的)\n Sample terms.'));console.log(definition.pageSize, definition.content);---
### `TYPE` `japan.legalDocument.PartyType`
法的文書のメタデータで使用する当事者の区分です。個人または法人を表します。
```typescriptexport type PartyType = 'individual' | 'corporation';INTERFACE japan.legalDocument.PartyInfo
Section titled “INTERFACE japan.legalDocument.PartyInfo”法的文書の署名欄に印字する当事者情報です。
export interface PartyInfo {
/** Party role label printed in the signature block. */ role: string;
/** Discriminant selecting the party or content-block variant. */ type: PartyType;
/** Party display name; no identity verification is performed. */ name: string;
/** Party address text printed verbatim. */ address: string;
/** Optional corporate representative text. */ representative?: string;
/** Whether to include the seal placeholder in the signature block. */ seal: boolean;
/** Optional host-owned string metadata; the built-in pdfmake builder does not render it. */ additionalInfo?: Record<string, string>;}INTERFACE japan.legalDocument.LegalDocumentMetadata
Section titled “INTERFACE japan.legalDocument.LegalDocumentMetadata”Frontmatter から取得したタイトル、文書分類、日付、署名当事者の情報です。
export interface LegalDocumentMetadata {
/** Document or article heading text. */ title: string;
/** Application document-type key, default contract when parsed frontmatter omits it. */ documentType: string;
/** Optional document date text; no calendar parsing is performed. */ date?: string;
/** Optional era metadata retained from frontmatter; not used by the pdfmake builder. */ era?: string;
/** Optional reference text printed with the title. */ referenceNumber?: string;
/** Signing parties in display order. */ parties: PartyInfo[];}TYPE japan.legalDocument.DocumentBlock
Section titled “TYPE japan.legalDocument.DocumentBlock”判別可能な法的文書のコンテンツブロックです。type によって対応するペイロードのフィールドを選択します。
export type DocumentBlock = | { /** Discriminant for the title content block. */ type: 'title'; /** Display text for this block or article item; line breaks are preserved where the renderer supports them. */ text: string; /** Optional reference text printed with the title. */ referenceNumber?: string } | { /** Discriminant for the preamble content block. */ type: 'preamble'; /** Display text for this block or article item; line breaks are preserved where the renderer supports them. */ text: string } | { /** Discriminant for the article content block. */ type: 'article'; /** Article/item number as display text. */ number: string; /** Document or article heading text. */ title?: string; /** Article paragraphs and numbered items in source order. */ children: ArticleItem[] } | { /** Discriminant for the paragraph content block. */ type: 'paragraph'; /** Display text for this block or article item; line breaks are preserved where the renderer supports them. */ text: string } | { /** Discriminant for the date-block content block. */ type: 'date-block'; /** Display text for this block or article item; line breaks are preserved where the renderer supports them. */ text: string } | { /** Discriminant for the postamble content block. */ type: 'postamble'; /** Display text for this block or article item; line breaks are preserved where the renderer supports them. */ text: string } | { /** Discriminant for the signature-section content block. */ type: 'signature-section'; /** Signing parties in display order. */ parties: PartyInfo[] };INTERFACE japan.legalDocument.ArticleItem
Section titled “INTERFACE japan.legalDocument.ArticleItem”日本語の条文ブロック内に入れ子になる段落または番号付き項目です。
export interface ArticleItem {
/** Discriminant selecting the party or content-block variant. */ type: 'paragraph' | 'numbered-item';
/** Article/item number as display text. */ number?: string;
/** Display text for this block or article item; line breaks are preserved where the renderer supports them. */ text: string;}INTERFACE japan.legalDocument.ParsedDocument
Section titled “INTERFACE japan.legalDocument.ParsedDocument”ホストのレンダラー向けの、構造化された法的文書メタデータとコンテンツブロックです。
export interface ParsedDocument {
/** Parsed frontmatter values with parser defaults applied. */ metadata: LegalDocumentMetadata;
/** Title, prose, articles and optional date/signature blocks in render order. */ blocks: DocumentBlock[];}CONST japan.legalDocument.LAYOUT
Section titled “CONST japan.legalDocument.LAYOUT”法的文書のレイアウトの推奨値です。適用の可否と方法は、利用するレンダラーが決定します。
export const japan.legalDocument.LAYOUT: { readonly titleFontSize: 18; readonly titleReferenceFontSize: 11; readonly articleFontSize: 11; readonly bodyFontSize: 10; readonly preambleIndent: 0; readonly articleIndent: 0; readonly bodyIndent: 1; readonly numberedItemIndent: 2; readonly continuationIndent: 3; readonly lineHeight: 1.8; readonly signatureBlockRightMargin: 5; readonly pageMargins: { readonly top: 60; readonly right: 60; readonly bottom: 60; readonly left: 60; }; }使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { LAYOUT } from '@alneas/appkit-core/japan/legal-document/constants';
console.log(LAYOUT);---
### `CONST` `japan.legalDocument.DOCUMENT_TYPE_LABELS`
アプリケーションの法的文書分類をキーとする、日本語の表示タイトルです。
```typescriptexport const japan.legalDocument.DOCUMENT_TYPE_LABELS: Record<string, string>使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { DOCUMENT_TYPE_LABELS } from '@alneas/appkit-core/japan/legal-document/constants';
console.log(DOCUMENT_TYPE_LABELS);---
### `CONST` `japan.legalDocument.DOCUMENT_PREAMBLE`
特定の文書分類向けの、日本語の前文プリセットです。
```typescriptexport const japan.legalDocument.DOCUMENT_PREAMBLE: Record<string, string>使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { DOCUMENT_PREAMBLE } from '@alneas/appkit-core/japan/legal-document/constants';
console.log(DOCUMENT_PREAMBLE);---
### `CONST` `japan.legalDocument.DOCUMENT_POSTAMBLE`
特定の文書分類向けの、日本語の結びの文のプリセットです。
```typescriptexport const japan.legalDocument.DOCUMENT_POSTAMBLE: Record<string, string>使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { DOCUMENT_POSTAMBLE } from '@alneas/appkit-core/japan/legal-document/constants';
console.log(DOCUMENT_POSTAMBLE);---
### `INTERFACE` `japan.notifications.JapanesePaymentReminder`
円表示を使用する日本語の支払いリマインダーの整形に使う入力です。
```typescriptexport interface JapanesePaymentReminder { /** Payee display name. */ partnerName: string; /** Payment amount displayed with a yen prefix; no conversion or validation. */ amount: number; /** Due-date text interpolated verbatim. */ dueDate: string; /** Optional host invoice reference; not used by the built-in text formatter. */ invoiceId?: string }INTERFACE japan.notifications.JapaneseInventoryReminder
Section titled “INTERFACE japan.notifications.JapaneseInventoryReminder”日本語の在庫不足リマインダーの整形に使う入力です。
export interface JapaneseInventoryReminder { /** Product display name. */ productName: string; /** Current remaining stock count displayed verbatim. */ currentStock: number; /** Low-stock threshold displayed verbatim. */ threshold: number; /** Optional host product reference; not used by the built-in text formatter. */ productId?: string }CONST japan.notifications.japaneseNotificationMessages
Section titled “CONST japan.notifications.japaneseNotificationMessages”従来の円表示を含む、日本語の業務リマインダーのデフォルト設定です。
export const japan.notifications.japaneseNotificationMessages: Readonly<{ paymentTitle: "💰 支払期日のお知らせ"; paymentText: "支払期日のお知らせ"; paymentBody: (payload: JapanesePaymentReminder) => string; invoiceLabel: "請求書を確認"; inventoryTitle: "📦 在庫アラート"; inventoryText: "在庫アラート"; inventoryBody: (payload: JapaneseInventoryReminder) => string; productLabel: "商品を確認"; approveLabel: "承認"; rejectLabel: "却下"; }>補足 (Remarks)
Section titled “補足 (Remarks)”これらは文字列やフォーマッターのみです。通知の配信はホストが担います。金額の書式設定では、実行環境のデフォルトロケールを使用し、円のプレフィックスを付けます。通貨換算は行いません。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { japaneseNotificationMessages } from '@alneas/appkit-core/japan/notifications';
console.log(japaneseNotificationMessages.paymentBody({ partnerName: 'Example Supplier', amount: 1000, dueDate: '2026-10-31' }));console.log(japaneseNotificationMessages.inventoryBody({ productName: 'Paper', currentStock: 2, threshold: 5 }));---
### `FUNCTION` `japan.resolveSealLabel`
代替印影に表示するラベル(通常は姓)を解決します。
優先順位:1. `options.sealLabel`2. `options.familyName`3. `fullName` の解析(`nameOrder` の規則を適用)
`nameOrder: "auto"` の場合:- CJK 文字を含む名前: 最初のトークンを使用します- ラテン文字の単語が 2 個以上: 最後のトークンを使用します- それ以外: 最初のトークンを使用します
```typescriptexport function resolveSealLabel(fullName?: string, options: SealLabelOptions = {}): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
fullName |
string | undefined |
任意 | 氏名(任意) |
options |
SealLabelOptions |
任意 | ラベル解決オプションです。デフォルトは {} です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: 印影ラベル(空の場合は
"")
補足 (Remarks)
Section titled “補足 (Remarks)”オプションを省略した場合は {} がデフォルトです。ラベルの解析では名前の順序を自動判定し、最大3文字を使用します。PNG 出力には利用可能な DOM Canvas が必要で、利用できない場合や生成に失敗した場合は null を返します。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { resolveSealLabel } from '@alneas/appkit-core/japan/pdf/stamp';
console.log(resolveSealLabel('山田 太郎', { familyName: '山田' }));---
### `FUNCTION` `japan.createFallbackSealSvg`
代替印影の SVG 文字列を生成します。
保存済みの印影画像がない場合の代替として使用できます。出力は、文字を縦に並べたシンプルな赤い丸印です。
```typescriptexport function createFallbackSealSvg( fullName?: string, options: FallbackSealOptions = {},): string | null引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
fullName |
string | undefined |
任意 | 氏名(任意) |
options |
FallbackSealOptions |
任意 | 生成オプションです。デフォルトは {} です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string | null - Description: SVG 文字列です。印面のラベルを解決できない場合は
nullです。
補足 (Remarks)
Section titled “補足 (Remarks)”オプションを省略した場合は {} がデフォルトです。ラベルの解析では名前の順序を自動判定し、最大3文字を使用します。PNG 出力には利用可能な DOM Canvas が必要で、利用できない場合や生成に失敗した場合は null を返します。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { createFallbackSealSvg } from '@alneas/appkit-core/japan/pdf/stamp';
console.log(createFallbackSealSvg('山田 太郎', { familyName: '山田' }));---
### `FUNCTION` `japan.createFallbackSealPngDataUrl`
代替印影の PNG Data URL を生成します。Canvas API を利用できない環境では `null` を返します。
```typescriptexport function createFallbackSealPngDataUrl( fullName?: string, options: FallbackSealOptions = {},): string | null引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
fullName |
string | undefined |
任意 | 氏名(任意) |
options |
FallbackSealOptions |
任意 | 生成オプションです。デフォルトは {} です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string | null - Description: PNG Data URL です。生成に失敗した場合は
nullです。
補足 (Remarks)
Section titled “補足 (Remarks)”オプションを省略した場合は {} がデフォルトです。ラベルの解析では名前の順序を自動判定し、最大3文字を使用します。PNG 出力には利用可能な DOM Canvas が必要で、利用できない場合や生成に失敗した場合は null を返します。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { createFallbackSealPngDataUrl } from '@alneas/appkit-core/japan/pdf/stamp';
console.log(createFallbackSealPngDataUrl('山田 太郎', { familyName: '山田' }));---
### `FUNCTION` `japan.createFallbackSealDataUrl`
代替印影の Data URL を生成します。
`outputFormat` の動作:- `auto`(デフォルト): Canvas が利用可能なら PNG、それ以外は SVG です- `png`: PNG のみです(Canvas が利用できない場合は `null`)- `svg`: SVG のみです
```typescriptexport function createFallbackSealDataUrl( fullName?: string, options: FallbackSealOptions = {},): string | null引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
fullName |
string | undefined |
任意 | 氏名(任意) |
options |
FallbackSealOptions |
任意 | 生成オプションです。デフォルトは {} です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string | null - Description: Data URL です。印面のラベルを解決できない場合は
nullです。
補足 (Remarks)
Section titled “補足 (Remarks)”オプションを省略した場合は {} がデフォルトです。ラベルの解析では名前の順序を自動判定し、最大3文字を使用します。PNG 出力には利用可能な DOM Canvas が必要で、利用できない場合や生成に失敗した場合は null を返します。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { createFallbackSealDataUrl } from '@alneas/appkit-core/japan/pdf/stamp';
console.log(createFallbackSealDataUrl('山田 太郎', { familyName: '山田' }));---
### `TYPE` `japan.SealNameOrder`
名前の解析時に使用する姓名の順序の規則です。
- `auto`: 文字種と区切り文字から自動的に推測します- `family-first`: 姓を先にします(最初のトークンを姓として使用します)- `given-first`: 名を先にします(最後のトークンを姓として使用します)
```typescriptexport type SealNameOrder = 'auto' | 'family-first' | 'given-first';INTERFACE japan.SealLabelOptions
Section titled “INTERFACE japan.SealLabelOptions”印影ラベル(印面の文字)を決定するオプションです。
export interface SealLabelOptions {
/** * Explicit text to use on the seal face. * When specified, takes precedence over name parsing. */ sealLabel?: string;
/** * Explicit family name. * Used when `sealLabel` is not specified. */ familyName?: string;
/** * Ordering rule when inferring family name from `fullName`. * Defaults to `auto`. */ nameOrder?: SealNameOrder;
/** * Maximum character count for the seal face text. * Defaults to `3`. */ maxChars?: number;}INTERFACE japan.FallbackSealOptions
Section titled “INTERFACE japan.FallbackSealOptions”代替印影の SVG または Data URL を生成するオプションです。
export interface FallbackSealOptions extends SealLabelOptions {
/** * Overall dimension (square). * Applied when `width` / `height` are not specified. * Defaults to `256`. */ size?: number;
/** SVG width. */ width?: number;
/** SVG height. */ height?: number;
/** * Circle stroke color. * Defaults to `#c62828`. */ circleColor?: string;
/** * Text color. * Defaults to `#c62828`. */ textColor?: string;
/** * Circle stroke width. * Defaults to `8`. */ strokeWidth?: number;
/** * Font family for text. * Defaults to `sans-serif`. */ fontFamily?: string;
/** * Font weight for text. * Defaults to `700`. */ fontWeight?: string | number;
/** * Background color to use. * Transparent when omitted. */ backgroundColor?: string;
/** * Output image format. * * - `auto`: PNG if Canvas is available, otherwise SVG * - `png`: Prefer PNG (`null` if Canvas is unavailable) * - `svg`: Fixed to SVG * * Defaults to `auto`. */ outputFormat?: 'auto' | 'png' | 'svg';}FUNCTION japan.parseLegalDocument
Section titled “FUNCTION japan.parseLegalDocument”Markdown 形式の日本語の法的文書を解析し、構造化データを返します。
export function parseLegalDocument(markdown: string): ParsedDocument引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
markdown |
string |
必須 | - 日本語の条文形式の Markdown です。先頭の YAML フロントマターは省略できます。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
ParsedDocument - Description: A new structured document; absent/invalid frontmatter falls back to title 無題, type contract and no parties.
補足 (Remarks)
Section titled “補足 (Remarks)”これは形式のパーサーであり、法的な検証ではありません。条文の見出しには 第
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { parseLegalDocument } from '@alneas/appkit-core/japan/legal-document/parser';
const parsed = parseLegalDocument([ '---', 'title: Sample agreement', 'documentType: contract', '---', '第1条(目的)', ' The parties agree to the following terms.',].join('\n'));console.log(parsed.metadata.title, parsed.blocks);---
### `FUNCTION` `japan.buildLegalDocumentPdfmakeContent`
ParsedDocument から、pdfmake のドキュメント定義のコンテンツを構築します。
```typescriptexport function buildLegalDocumentPdfmakeContent( parsed: ParsedDocument,)引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
parsed |
ParsedDocument |
必須 | - parseLegalDocument から得られる構造化ドキュメント、またはホストが提供する同等のモデルです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
{ content: any[]; styles: { docTitle: { fontSize: number; bold: boolean; alignment: string; }; docReference: { fontSize: number; }; articleHeader: { fontSize: number; bold: boolean; }; signatureRole: { fontSize: number; bold: boolean; margin: number[]; }; signatureText: { fontSize: number; }; }; pageSize: "A4"; pageMargins: [number, number, number, number]; defaultStyle: { fontSize: number; lineHeight: number; }; } - Description: pdfmake 形式のコンテンツ、スタイル、A4 のページ寸法設定、およびデフォルトのテキスト設定です。PDF のバイト列ではありません。
補足 (Remarks)
Section titled “補足 (Remarks)”ホストが pdfmake レンダラーと適切な日本語フォントを提供します。この関数は、法的有効性の確認や文書への署名を行いません。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { parseLegalDocument } from '@alneas/appkit-core/japan/legal-document/parser';import { buildLegalDocumentPdfmakeContent } from '@alneas/appkit-core/japan/pdf';
const definition = buildLegalDocumentPdfmakeContent(parseLegalDocument('第1条(目的)\n Sample terms.'));console.log(definition.pageSize, definition.content);---
### `TYPE` `japan.PartyType`
法的文書のメタデータで使用する当事者の区分です。個人または法人を表します。
```typescriptexport type PartyType = 'individual' | 'corporation';INTERFACE japan.PartyInfo
Section titled “INTERFACE japan.PartyInfo”法的文書の署名欄に印字する当事者情報です。
export interface PartyInfo {
/** Party role label printed in the signature block. */ role: string;
/** Discriminant selecting the party or content-block variant. */ type: PartyType;
/** Party display name; no identity verification is performed. */ name: string;
/** Party address text printed verbatim. */ address: string;
/** Optional corporate representative text. */ representative?: string;
/** Whether to include the seal placeholder in the signature block. */ seal: boolean;
/** Optional host-owned string metadata; the built-in pdfmake builder does not render it. */ additionalInfo?: Record<string, string>;}INTERFACE japan.LegalDocumentMetadata
Section titled “INTERFACE japan.LegalDocumentMetadata”Frontmatter から取得したタイトル、文書分類、日付、署名当事者の情報です。
export interface LegalDocumentMetadata {
/** Document or article heading text. */ title: string;
/** Application document-type key, default contract when parsed frontmatter omits it. */ documentType: string;
/** Optional document date text; no calendar parsing is performed. */ date?: string;
/** Optional era metadata retained from frontmatter; not used by the pdfmake builder. */ era?: string;
/** Optional reference text printed with the title. */ referenceNumber?: string;
/** Signing parties in display order. */ parties: PartyInfo[];}TYPE japan.DocumentBlock
Section titled “TYPE japan.DocumentBlock”判別可能な法的文書のコンテンツブロックです。type によって対応するペイロードのフィールドを選択します。
export type DocumentBlock = | { /** Discriminant for the title content block. */ type: 'title'; /** Display text for this block or article item; line breaks are preserved where the renderer supports them. */ text: string; /** Optional reference text printed with the title. */ referenceNumber?: string } | { /** Discriminant for the preamble content block. */ type: 'preamble'; /** Display text for this block or article item; line breaks are preserved where the renderer supports them. */ text: string } | { /** Discriminant for the article content block. */ type: 'article'; /** Article/item number as display text. */ number: string; /** Document or article heading text. */ title?: string; /** Article paragraphs and numbered items in source order. */ children: ArticleItem[] } | { /** Discriminant for the paragraph content block. */ type: 'paragraph'; /** Display text for this block or article item; line breaks are preserved where the renderer supports them. */ text: string } | { /** Discriminant for the date-block content block. */ type: 'date-block'; /** Display text for this block or article item; line breaks are preserved where the renderer supports them. */ text: string } | { /** Discriminant for the postamble content block. */ type: 'postamble'; /** Display text for this block or article item; line breaks are preserved where the renderer supports them. */ text: string } | { /** Discriminant for the signature-section content block. */ type: 'signature-section'; /** Signing parties in display order. */ parties: PartyInfo[] };INTERFACE japan.ArticleItem
Section titled “INTERFACE japan.ArticleItem”日本語の条文ブロック内に入れ子になる段落または番号付き項目です。
export interface ArticleItem {
/** Discriminant selecting the party or content-block variant. */ type: 'paragraph' | 'numbered-item';
/** Article/item number as display text. */ number?: string;
/** Display text for this block or article item; line breaks are preserved where the renderer supports them. */ text: string;}INTERFACE japan.ParsedDocument
Section titled “INTERFACE japan.ParsedDocument”ホストのレンダラー向けの、構造化された法的文書メタデータとコンテンツブロックです。
export interface ParsedDocument {
/** Parsed frontmatter values with parser defaults applied. */ metadata: LegalDocumentMetadata;
/** Title, prose, articles and optional date/signature blocks in render order. */ blocks: DocumentBlock[];}CONST japan.LAYOUT
Section titled “CONST japan.LAYOUT”法的文書のレイアウトの推奨値です。適用の可否と方法は、利用するレンダラーが決定します。
export const japan.LAYOUT: { readonly titleFontSize: 18; readonly titleReferenceFontSize: 11; readonly articleFontSize: 11; readonly bodyFontSize: 10; readonly preambleIndent: 0; readonly articleIndent: 0; readonly bodyIndent: 1; readonly numberedItemIndent: 2; readonly continuationIndent: 3; readonly lineHeight: 1.8; readonly signatureBlockRightMargin: 5; readonly pageMargins: { readonly top: 60; readonly right: 60; readonly bottom: 60; readonly left: 60; }; }使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { LAYOUT } from '@alneas/appkit-core/japan/legal-document/constants';
console.log(LAYOUT);---
### `CONST` `japan.DOCUMENT_TYPE_LABELS`
アプリケーションの法的文書分類をキーとする、日本語の表示タイトルです。
```typescriptexport const japan.DOCUMENT_TYPE_LABELS: Record<string, string>使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { DOCUMENT_TYPE_LABELS } from '@alneas/appkit-core/japan/legal-document/constants';
console.log(DOCUMENT_TYPE_LABELS);---
### `CONST` `japan.DOCUMENT_PREAMBLE`
特定の文書分類向けの、日本語の前文プリセットです。
```typescriptexport const japan.DOCUMENT_PREAMBLE: Record<string, string>使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { DOCUMENT_PREAMBLE } from '@alneas/appkit-core/japan/legal-document/constants';
console.log(DOCUMENT_PREAMBLE);---
### `CONST` `japan.DOCUMENT_POSTAMBLE`
特定の文書分類向けの、日本語の結びの文のプリセットです。
```typescriptexport const japan.DOCUMENT_POSTAMBLE: Record<string, string>使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { DOCUMENT_POSTAMBLE } from '@alneas/appkit-core/japan/legal-document/constants';
console.log(DOCUMENT_POSTAMBLE);---
### `INTERFACE` `japan.JapanesePaymentReminder`
円表示を使用する日本語の支払いリマインダーの整形に使う入力です。
```typescriptexport interface JapanesePaymentReminder { /** Payee display name. */ partnerName: string; /** Payment amount displayed with a yen prefix; no conversion or validation. */ amount: number; /** Due-date text interpolated verbatim. */ dueDate: string; /** Optional host invoice reference; not used by the built-in text formatter. */ invoiceId?: string }INTERFACE japan.JapaneseInventoryReminder
Section titled “INTERFACE japan.JapaneseInventoryReminder”日本語の在庫不足リマインダーの整形に使う入力です。
export interface JapaneseInventoryReminder { /** Product display name. */ productName: string; /** Current remaining stock count displayed verbatim. */ currentStock: number; /** Low-stock threshold displayed verbatim. */ threshold: number; /** Optional host product reference; not used by the built-in text formatter. */ productId?: string }CONST japan.japaneseNotificationMessages
Section titled “CONST japan.japaneseNotificationMessages”従来の円表示を含む、日本語の業務リマインダーのデフォルト設定です。
export const japan.japaneseNotificationMessages: Readonly<{ paymentTitle: "💰 支払期日のお知らせ"; paymentText: "支払期日のお知らせ"; paymentBody: (payload: JapanesePaymentReminder) => string; invoiceLabel: "請求書を確認"; inventoryTitle: "📦 在庫アラート"; inventoryText: "在庫アラート"; inventoryBody: (payload: JapaneseInventoryReminder) => string; productLabel: "商品を確認"; approveLabel: "承認"; rejectLabel: "却下"; }>補足 (Remarks)
Section titled “補足 (Remarks)”これらは文字列やフォーマッターのみです。通知の配信はホストが担います。金額の書式設定では、実行環境のデフォルトロケールを使用し、円のプレフィックスを付けます。通貨換算は行いません。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { japaneseNotificationMessages } from '@alneas/appkit-core/japan/notifications';
console.log(japaneseNotificationMessages.paymentBody({ partnerName: 'Example Supplier', amount: 1000, dueDate: '2026-10-31' }));console.log(japaneseNotificationMessages.inventoryBody({ productName: 'Paper', currentStock: 2, threshold: 5 }));---
### `FUNCTION` `japan.japaneseHolidayCalendar`
データセットの検索のみを行います。タイムゾーンから暦日への変換は呼び出し元が担当します。
```typescriptexport function japaneseHolidayCalendar({ year, month, day }: JapaneseCalendarDate): boolean引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
{ year, month, day } |
JapaneseCalendarDate |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
boolean - Description: 構築された暦日を、インストール済みの holiday-jp データセットが祝日と判定するかどうかです。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { japaneseHolidayCalendar } from '@alneas/appkit-core/japan/holidays';
console.log(japaneseHolidayCalendar({ year: 2026, month: 0, day: 1 }));---
### `FUNCTION` `japan.createJapaneseHolidayCalendar`
日本のカレンダープロバイダーを選択し、特定日の休業指定の上書き設定をスナップショットとして保持します。holiday-jp を推奨し、引き続きデフォルトとします。計算モードは 2022–2099 年の計画用カレンダーであり、春分・秋分のデフォルト値は近似値で、過去の特例による移動は含みません。設定を更新した後はプロバイダーを再作成してください。告知情報は取得しません。データセットの選択で変わるのは動作であり、インストール済みの依存関係ではありません。計算のみを行うサブパスは別途利用でき、実行時に holiday-jp を読み込みません。
```typescriptexport function createJapaneseHolidayCalendar(options: JapaneseHolidayCalendarOptions = {}): (parts: JapaneseCalendarDate) => boolean引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
options |
JapaneseHolidayCalendarOptions |
任意 | データソースの選択、任意の春分・秋分日の解決関数、追加・除外する具体的な日付です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
(parts: JapaneseCalendarDate) => boolean - Description: data-engine の HolidayCalendar と互換性のある暦日判定関数です。
例外 (Throws)
Section titled “例外 (Throws)”暦日・上書き日付が無効な場合、または計算対象の年が対応範囲外の場合の RangeError です。
使用例 (Example)
Section titled “使用例 (Example)”import { createJapaneseHolidayCalendar } from '@alneas/appkit-core/japan/holidays';const recommended = createJapaneseHolidayCalendar(); // holiday-jpconst predicted = createJapaneseHolidayCalendar({ source: 'calculated' });predicted({ year: 2026, month: 8, day: 22 }); // trueINTERFACE japan.JapaneseCalendarDate
Section titled “INTERFACE japan.JapaneseCalendarDate”日本の祝日データセット用の暦日です。月は Date と同じくゼロ始まりです。
export interface JapaneseCalendarDate { /** Gregorian civil year; calculated mode accepts 2022–2099. */ year: number; /** Zero-based civil month (January 0 through December 11). */ month: number; /** One-based day within the selected civil month. */ day: number }INTERFACE japan.JapaneseHolidayCalendarOptions
Section titled “INTERFACE japan.JapaneseHolidayCalendarOptions”日本の祝日のデータソースを選択します。引き続き holiday-jp を推奨デフォルトとします。
export interface JapaneseHolidayCalendarOptions {
/** Holiday source; defaults to holiday-jp. Calculated mode is limited to 2022–2099 and approximate equinox defaults. */ source?: 'holiday-jp' | 'calculated';
/** * Used only by calculated mode. Provide announced equinox dates when needed. * * @param year - Gregorian calculated-calendar year, 2022–2099, requested on first lookup for that year. * @returns Announced March and September day-of-month values; callback errors propagate to calendar callers. * * @example * ```typescript * import type { JapaneseHolidayCalendarOptions } from '@alneas/appkit-core/japan/holidays'; * * export function calculatedOptions(equinoxDays: NonNullable<JapaneseHolidayCalendarOptions['equinoxDays']>) { * return { source: 'calculated', equinoxDays } satisfies JapaneseHolidayCalendarOptions; * } * ``` */ equinoxDays?: (year: number) => JapaneseEquinoxDays;
/** Exact YYYY-MM-DD closures; no automatic substitute/sandwich calculation is applied to overrides. */ additionalHolidays?: readonly string[];
/** Exact dates removed after additions; exclusions always win. */ excludedDates?: readonly string[];}INTERFACE graph.TaskNode
Section titled “INTERFACE graph.TaskNode”依存関係グラフ内のタスクノードを表します。
export interface TaskNode {
/** Unique identifier for the task */ id: string;
/** Human-readable task title */ title: string;
/** Estimated duration in hours (defaults to 1) */ durationHours?: number;
/** Execution status ('TODO' | 'IN_PROGRESS' | 'DONE' | string) */ status: string;
/** Due date deadline */ dueDate?: string | Date | null;
/** Assigned user or agent identifier */ assignee?: string;
/** Importance or priority level ('low' | 'medium' | 'high' | 'urgent', etc.) */ priority?: string;
/** Additional consumer-owned metadata indexed by field name; CPM ignores these fields. */ [key: string]: unknown;}INTERFACE graph.TaskEdge
Section titled “INTERFACE graph.TaskEdge”タスク間の依存関係の辺です(先行タスク -> 後続タスク)。
export interface TaskEdge {
/** Predecessor task ID (must be completed first) */ predecessorId: string;
/** Successor task ID (blocked until predecessor completes) */ successorId: string;
/** Dependency relationship type (default: 'FINISH_TO_START') */ dependencyType?: 'FINISH_TO_START' | 'START_TO_START' | 'FINISH_TO_FINISH' | string;
/** Lag or lead time in hours (default: 0) */ lagHours?: number;}INTERFACE graph.BlockerAnalysis
Section titled “INTERFACE graph.BlockerAnalysis”タスクのボトルネック・阻害要因の分析結果です。
export interface BlockerAnalysis {
/** Task identifier */ taskId: string;
/** Task title */ title: string;
/** Current execution status */ status: string;
/** Task IDs directly blocked by this task */ directBlockedIds: string[];
/** All downstream task IDs recursively blocked by this task */ allBlockedIds: string[];
/** Total count of downstream blocked tasks */ blockedCount: number;
/** Whether this task lies on the critical path */ isCritical: boolean;
/** Unblock priority score derived from blocked count, duration, and criticality */ unblockPriorityScore: number;}INTERFACE graph.CriticalPathResult
Section titled “INTERFACE graph.CriticalPathResult”CPM のスケジュール指標と、丸め後の余裕時間がゼロになるすべてのタスクです。
export interface CriticalPathResult {
/** Minimum total duration in hours required to complete the project */ totalDurationHours: number;
/** All tasks with slack rounded to zero, in topological order; may include multiple branches, not a single connected path. */ criticalPathTaskIds: string[];
/** Hour-based schedule metrics per task; slack is nonnegative and rounded to two decimal places. */ taskSchedules: Record< string, {
/** Earliest start offset from the project origin, in hours. */ earlyStart: number;
/** Earliest finish offset from the project origin, in hours. */ earlyFinish: number;
/** Latest start offset that preserves calculated project completion, in hours. */ lateStart: number;
/** Latest finish offset that preserves calculated project completion, in hours. */ lateFinish: number;
/** Nonnegative lateStart minus earlyStart, rounded to two decimal places, in hours. */ slack: number;
/** True when the rounded slack equals zero. */ isCritical: boolean; } >;}補足 (Remarks)
Section titled “補足 (Remarks)”クリティカルタスクの ID はトポロジカル順に並び、同順位の分岐や 接続されていないタスクにまたがる場合があります。隣り合う ID が依存関係の辺を意味するわけではありません。 依存関係の描画には元の辺を使用してください。入力が空の場合は、期間がゼロ、 ID リストが空、taskSchedules オブジェクトが空になります。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { calculateCriticalPath, type TaskNode, type TaskEdge } from '@alneas/appkit-core/graph';
const tasks: TaskNode[] = ['a', 'b', 'c', 'd'].map(id => ({ id, title: id, status: 'TODO', durationHours: 1,}));const edges: TaskEdge[] = [ { predecessorId: 'a', successorId: 'b' }, { predecessorId: 'a', successorId: 'c' }, { predecessorId: 'b', successorId: 'd' }, { predecessorId: 'c', successorId: 'd' },];const result = calculateCriticalPath(tasks, edges);console.log(result.criticalPathTaskIds); // ['a', 'b', 'c', 'd']; no b -> c edge.---
### `INTERFACE` `graph.DelayImpact`
遅延シミュレーション(What-If 分析)の影響結果です。
```typescriptexport interface DelayImpact {
/** The source task ID where delay was simulated */ sourceTaskId: string;
/** The simulated delay in hours */ delayHours: number;
/** Downstream task IDs whose early start is pushed back */ affectedTaskIds: string[];
/** Net delay impact on the overall project completion in hours */ projectDelayHours: number;
/** All updated zero-slack task IDs in topological order; these need not form a single connected path. */ newCriticalPathTaskIds: string[];}INTERFACE graph.TaskGraphAdapter
Section titled “INTERFACE graph.TaskGraphAdapter”抽象的なタスクグラフアダプターのインターフェースです。
データベースアダプター(OCI ADB、PostgreSQL、Neo4j)と インメモリ参照実装に共通する契約を定義します。
export interface TaskGraphAdapter {
/** * Load all tasks and dependency edges * * @returns Current graph arrays; ownership and refresh behavior belong to the adapter. * @throws Rejects when the implementation or its graph loader rejects. * * @example * ```typescript * import type { TaskGraphAdapter } from '@alneas/appkit-core/graph'; * * export async function example(adapter: TaskGraphAdapter) { * return adapter.loadGraph(); * } * ``` */ loadGraph(): Promise<{ /** Current task nodes supplied by the adapter. */ tasks: TaskNode[]; /** Current directed dependencies supplied by the adapter. */ edges: TaskEdge[] }>;
/** * Retrieve top blocking tasks ranked by unblock priority score * * @returns Task blocker rankings; an empty graph gives an empty array. * @throws Rejects when the implementation or its graph loader rejects. * * @example * ```typescript * import type { TaskGraphAdapter } from '@alneas/appkit-core/graph'; * * export async function example(adapter: TaskGraphAdapter) { * return adapter.getTopBlockers(); * } * ``` */ getTopBlockers(): Promise<BlockerAnalysis[]>;
/** * Calculate the critical path and per-task schedule metrics * * @returns Dependency schedule and all critical task IDs; tied branches can occur. * @throws Rejects when the implementation or its graph loader rejects. * * @example * ```typescript * import type { TaskGraphAdapter } from '@alneas/appkit-core/graph'; * * export async function example(adapter: TaskGraphAdapter) { * return adapter.getCriticalPath(); * } * ``` */ getCriticalPath(): Promise<CriticalPathResult>;
/** * Simulate the project-wide ripple effect of delaying a specific task * * @returns Recomputed impact after increasing one task duration, in hours. * @throws Rejects when the implementation or its graph loader rejects. * @param taskId - Existing task whose duration is increased. * @param delayHours - Finite nonnegative duration increase, in hours. * * @example * ```typescript * import type { TaskGraphAdapter } from '@alneas/appkit-core/graph'; * * export async function example(adapter: TaskGraphAdapter) { * return adapter.simulateDelay('a', 1); * } * ``` */ simulateDelay(taskId: string, delayHours: number): Promise<DelayImpact>;
/** * Verify that the dependency graph contains no cycles * * @returns Cycle detection flag and detected cycle paths. * @throws Rejects when the implementation or its graph loader rejects. * * @example * ```typescript * import type { TaskGraphAdapter } from '@alneas/appkit-core/graph'; * * export async function example(adapter: TaskGraphAdapter) { * return adapter.validateAcyclic(); * } * ``` */ validateAcyclic(): Promise<{ /** True when depth-first cycle detection found no cycle. */ isValid: boolean; /** Detected DFS cycle paths with repeated starting ID; empty for an acyclic graph. */ cycles: string[][] }>;}FUNCTION graph.buildAdjacencyList
Section titled “FUNCTION graph.buildAdjacencyList”依存関係の辺から、隣接リスト(後続タスクと先行タスク)を構築します。
export function buildAdjacencyList(edges: TaskEdge[]): {
/** Outgoing edges grouped by predecessor task ID. */ successors: Map<string, Array<{ /** Successor task ID in this outgoing edge. */ targetId: string; /** Dependency lag or lead in hours, using zero when omitted. */ lag: number }>>;
/** Incoming edges grouped by successor task ID. */ predecessors: Map<string, Array<{ /** Predecessor task ID in this incoming edge. */ targetId: string; /** Dependency lag or lead in hours, using zero when omitted. */ lag: number }>>;}引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
edges |
TaskEdge[] |
必須 | - 有向辺です。lagHours を省略するとゼロになります。ここでは ID と依存関係の種類を検証しません。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
{ successors: Map<string, Array<{ targetId: string; lag: number; }>>; predecessors: Map<string, Array<{ targetId: string; lag: number; }>>; } - Description: 辺に参加しているノードのエントリのみを含む、新しい後続ノードと先行ノードのマップです。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { buildAdjacencyList } from '@alneas/appkit-core/graph';
const tasks = [{ id: 'a', title: 'Draft', status: 'TODO', durationHours: 2 }];const edges: never[] = [];console.log(buildAdjacencyList(edges));---
### `FUNCTION` `graph.detectCycles`
依存関係グラフに循環参照(サイクル)が存在するか検出します。
```typescriptexport function detectCycles(tasks: TaskNode[], edges: TaskEdge[]): string[][]引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
tasks |
TaskNode[] |
必須 | - 深さ優先探索を開始するノードです。 |
edges |
TaskEdge[] |
必須 | - 走査する有向の依存関係です。このヘルパーは端点を検証しません。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string[][] - Description: 検出した循環経路の配列です。循環がない場合は空配列です。
補足 (Remarks)
Section titled “補足 (Remarks)”返されるパスは DFS の後退辺を反映したものであり、考えられるすべての単純閉路を列挙するものではありません。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { detectCycles } from '@alneas/appkit-core/graph';
const tasks = [{ id: 'a', title: 'Draft', status: 'TODO', durationHours: 2 }];const edges: never[] = [];console.log(detectCycles(tasks, edges));---
### `FUNCTION` `graph.topologicalSort`
Kahn のアルゴリズムを使用して、タスクグラフをトポロジカルソートします。
```typescriptexport function topologicalSort(tasks: TaskNode[], edges: TaskEdge[]): string[]引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
tasks |
TaskNode[] |
必須 | - 順序付けする、一意の ID を持つノードです。 |
edges |
TaskEdge[] |
必須 | - 端点が tasks 内に存在する必要がある有向の依存関係です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string[] - Description: 依存関係の順に並んだタスク ID です。入力が空の場合は空の配列を返します。このヘルパーはグラフを完全には検証しません。
例外 (Throws)
Section titled “例外 (Throws)”グラフに循環が存在する場合の Error です。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { topologicalSort } from '@alneas/appkit-core/graph';
const tasks = [{ id: 'a', title: 'Draft', status: 'TODO', durationHours: 2 }];const edges: never[] = [];console.log(topologicalSort(tasks, edges));---
### `FUNCTION` `graph.calculateCriticalPath`
クリティカルパス法(CPM)を使用して、タスクのスケジュールを作成し、クリティカルパスを決定します。
```typescriptexport function calculateCriticalPath( tasks: TaskNode[], edges: TaskEdge[],): CriticalPathResult引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
tasks |
TaskNode[] |
必須 | - タスクノードです。CPM では一意の ID と、有限かつ非負の期間が必要です。単位は時間、デフォルトは1です。 |
edges |
TaskEdge[] |
必須 | - 終了から開始への有向の依存関係です。CPM は FS/FINISH_TO_START と有限の lagHours を受け付けます。デフォルトは0です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
CriticalPathResult - Description: 時間単位のスケジュール指標、プロジェクト期間、および丸め後の余裕時間がゼロになるすべての ID をトポロジカル順に返します。入力が空の場合は、期間がゼロ、各コレクションが空になります。
補足 (Remarks)
Section titled “補足 (Remarks)”依存関係のみの分析です。リソース、期限、実行状況はスケジュールを制約しません。同順位のクリティカルな分岐が、1本の連結したパスを形成するとは限りません。
例外 (Throws)
Section titled “例外 (Throws)”ID の重複、無効な期間やラグ、不明な端点、未対応の依存関係の種類、または循環がある場合に例外をスローします。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { calculateCriticalPath } from '@alneas/appkit-core/graph';
const tasks = [{ id: 'a', title: 'Draft', status: 'TODO', durationHours: 2 }];const edges: never[] = [];console.log(calculateCriticalPath(tasks, edges));---
### `FUNCTION` `graph.analyzeBlockers`
タスク全体の阻害要因を分析します(進行を妨げている下流タスクの数による中心性ランキングです)。
```typescriptexport function analyzeBlockers(tasks: TaskNode[], edges: TaskEdge[]): BlockerAnalysis[]引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
tasks |
TaskNode[] |
必須 | - 順位付けするノードです。ステータスは結果に引き継がれ、フィルタリングには使用されません。 |
edges |
TaskEdge[] |
必須 | - 下流への到達可能性の判定に使用する有向の依存関係です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
BlockerAnalysis[] - Description: すべての入力タスクを、ブロック解除スコアの降順で順位付けします。入力が空の場合は空の配列を返します。
補足 (Remarks)
Section titled “補足 (Remarks)”CPM がグラフを拒否した場合、クリティカルフラグは false になりますが、到達可能性の分析は続行します。入力に循環がある場合、ノード自身に到達できることがあります。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { analyzeBlockers } from '@alneas/appkit-core/graph';
const tasks = [{ id: 'a', title: 'Draft', status: 'TODO', durationHours: 2 }];const edges: never[] = [];console.log(analyzeBlockers(tasks, edges));---
### `FUNCTION` `graph.simulateDelayImpact`
特定のタスクの遅延がプロジェクト全体に及ぼす波及効果をシミュレーションします(What-If 分析)。
```typescriptexport function simulateDelayImpact( tasks: TaskNode[], edges: TaskEdge[], sourceTaskId: string, delayHours: number,): DelayImpact引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
tasks |
TaskNode[] |
必須 | - タスクノードです。CPM では一意の ID と、有限かつ非負の期間が必要です。単位は時間、デフォルトは1です。 |
edges |
TaskEdge[] |
必須 | - 終了から開始への有向の依存関係です。CPM は FS/FINISH_TO_START と有限の lagHours を受け付けます。デフォルトは0です。 |
sourceTaskId |
string |
必須 | - 期間を延長する既存のタスクです。 |
delayHours |
number |
必須 | - 有限かつ非負の期間の増分です。単位は時間です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
DelayImpact - Description: 再計算されたプロジェクトの遅延、最早開始時刻が遅くなる他のタスク、および更新後のすべてのクリティカル ID です。入力配列は変更しません。
例外 (Throws)
Section titled “例外 (Throws)”遅延が無効な場合、対象の ID が存在しない場合、または CPM の検証に失敗した場合に例外をスローします。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { simulateDelayImpact } from '@alneas/appkit-core/graph';
const tasks = [{ id: 'a', title: 'Draft', status: 'TODO', durationHours: 2 }];const edges: never[] = [];console.log(simulateDelayImpact(tasks, edges, 'a', 1));---
### `INTERFACE` `graph.InMemoryTaskGraphAdapterOptions`
InMemoryTaskGraphAdapter の初期化オプションです。
```typescriptexport interface InMemoryTaskGraphAdapterOptions {
/** Initial array of tasks */ tasks?: TaskNode[];
/** Initial array of dependency edges */ edges?: TaskEdge[];
/** * Optional dynamic loader function to fetch graph data * * @returns Graph data to replace the current arrays before each analysis; rejected loader errors propagate. * @remarks Called without arguments for every loadGraph/analysis invocation. The host owns I/O, authorization and persistence. * * @example * ```typescript * import type { InMemoryTaskGraphAdapterOptions } from '@alneas/appkit-core/graph'; * * export function withLoader(loadData: NonNullable<InMemoryTaskGraphAdapterOptions['loadData']>) { * return { loadData } satisfies InMemoryTaskGraphAdapterOptions; * } * ``` */ loadData?: () => Promise<{ /** Task nodes supplied by the loader or current graph state; not deep-cloned. */ tasks: TaskNode[]; /** Directed dependencies supplied with the graph; not deep-cloned. */ edges: TaskEdge[] }>;}CLASS graph.InMemoryTaskGraphAdapter
Section titled “CLASS graph.InMemoryTaskGraphAdapter”インメモリのタスクグラフアダプターです。 外部 DB に依存せずに動作し、任意のローダー関数と併用することもできます。
class graph.InMemoryTaskGraphAdapter補足 (Remarks)
Section titled “補足 (Remarks)”永続ストレージは提供しません。初期配列と setData の配列は浅くコピーしますが、タスクオブジェクトと返される配列は共有されたままです。loadData が設定されている場合、グラフを読み込む分析呼び出しのたびに実行し、その失敗を伝播します。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { InMemoryTaskGraphAdapter } from '@alneas/appkit-core/graph';
const adapter = new InMemoryTaskGraphAdapter({ tasks: [{ id: 'a', title: 'Draft', status: 'TODO', durationHours: 2 }], edges: [],});console.log(await adapter.getCriticalPath());---
### `INTERFACE` `graph.GanttPlanningTask`
スケジュール作成用の入力のみです。表示用のフィールドは、利用側のタスク型が管理します。
```typescriptexport interface GanttPlanningTask {
/** Unique task identifier referenced by dependencies. */ id: string;
/** Fallback release/start date when start_date is absent. */ created_at: string | Date;
/** Optional release date; the planner never pulls tasks earlier than this date. */ start_date?: string | Date | null;
/** Optional exclusive end; omission infers one calendar-day span before calendar conversion. */ due_date?: string | Date | null;
/** Optional parent task ID; referenced parent rows are treated as summaries and excluded from leaf planning. */ parent_id?: string | null;
/** Optional resource identifier used when explicit resource assignments are absent. */ assignee_id?: string | null;
/** Optional nonnegative integer working-day duration; overrides date-derived duration, including zero-day milestones. */ durationDays?: number;
/** Optional simultaneous resource demand on every occupied working day; duplicate resource IDs are summed. */ resourceAssignments?: GanttResourceAssignment[];}INTERFACE graph.GanttDependency
Section titled “INTERFACE graph.GanttDependency”末端タスク間の有向依存関係です。終了日は含みません。
export interface GanttDependency {
/** Unique dependency ID. */ id: string;
/** Predecessor task ID. Summary tasks are not supported. */ sourceId: string;
/** Successor task ID. */ targetId: string;
/** Finish/Start endpoints: FS, SS, FF or SF. */ type: 'FS' | 'SS' | 'FF' | 'SF';
/** Integer lag: calendar days in legacy scheduling, working days with scheduling options. Negative values allow lead time. */ lagDays?: number;}INTERFACE graph.GanttWorkingCalendar
Section titled “INTERFACE graph.GanttWorkingCalendar”共有のローカル日付カレンダー 1 つです。国別の祝日の自動検索や、リソースごとの勤務シフトには対応しません。
export interface GanttWorkingCalendar {
/** Working weekdays, Sunday=0. Default Monday–Friday. Empty is allowed with workingDates. */ workingWeekdays?: number[];
/** Non-working local dates, strictly YYYY-MM-DD. */ holidays?: string[];
/** Explicit working-date overrides; take precedence over holidays and weekdays. */ workingDates?: string[];}INTERFACE graph.GanttResource
Section titled “INTERFACE graph.GanttResource”リソース容量は、タスクへの割り当てと同じ単位で表します。
export interface GanttResource {
/** Unique resource identifier. */ id: string;
/** Positive finite capacity; default 1. */ capacity?: number;}INTERFACE graph.GanttResourceAssignment
Section titled “INTERFACE graph.GanttResourceAssignment”分割されていないタスクのすべての稼働日で、リソースを同時に占有します。
export interface GanttResourceAssignment {
/** Must match a configured resource when an explicit resource list is supplied. */ resourceId: string;
/** Positive finite demand; default 1. Duplicate assignments are summed. */ units?: number;}INTERFACE graph.GanttResourceLeveling
Section titled “INTERFACE graph.GanttResourceLeveling”安定したトポロジカル順・入力順で、決定論的に逐次リソース平準化を行います。タスクの分割や最適性の保証はありません。
export interface GanttResourceLeveling {
/** Enable capacity-constrained scheduling. Default false. */ enabled?: boolean;
/** Omit to infer resources from assignments/assignee_id, each at capacity 1. */ resources?: GanttResource[];}INTERFACE graph.GanttSchedulingOptions
Section titled “INTERFACE graph.GanttSchedulingOptions”明示的に有効化する日単位の計画機能です。日付はローカル時間の午前 0 時または YYYY-MM-DD で指定する必要があります。終了日は、その日を含まない稼働日の境界です。
export interface GanttSchedulingOptions {
/** Omit for seven working days per week; an empty calendar object means Monday–Friday. */ calendar?: GanttWorkingCalendar;
/** Optional capacity leveling, never enabled implicitly. */ resourceLeveling?: GanttResourceLeveling;
/** Bounded search horizon from the earliest leaf start. Default 3660, maximum 36600 calendar days. */ maxCalendarDays?: number;}INTERFACE graph.GanttCriticalTask
Section titled “INTERFACE graph.GanttCriticalTask”依存関係のみを考慮した CPM の時期計算です。入力の開始日は開始可能日の制約であり、可能な限り早く開始するという指示ではありません。
export interface GanttCriticalTask {
/** Leaf task identifier. */ taskId: string;
/** Earliest feasible start/finish respecting release dates and dependencies. */ earlyStart: Date;
/** Exclusive earliest finish boundary on the shared working calendar. */ earlyFinish: Date;
/** Latest start/finish without delaying the dependency-only project finish. */ lateStart: Date;
/** Exclusive latest finish boundary that preserves dependency-only project completion. */ lateFinish: Date;
/** Total float in working days. Does not account for resource contention. */ totalFloatDays: number;
/** True when total float is zero. */ critical: boolean;}INTERFACE graph.GanttCriticalPath
Section titled “INTERFACE graph.GanttCriticalPath”末端タスクの CPM 分析です。リソース容量は意図的に考慮しません。
export interface GanttCriticalPath {
/** Per-task timing, in input order. Summary tasks are excluded. */ tasks: GanttCriticalTask[];
/** Zero-float task IDs; multiple critical branches may exist. */ taskIds: string[];
/** Tight links connecting zero-float tasks. */ dependencyIds: string[];
/** Dependency-only finish, or null for no leaf tasks. */ projectFinish: Date | null;}TYPE graph.GanttScheduledTask
Section titled “TYPE graph.GanttScheduledTask”依存関係と容量の診断を個別に含む、不変のスケジュール作成結果です。
export type GanttScheduledTask<T extends GanttPlanningTask> = { [K in keyof T]: K extends 'start_date' | 'due_date' ? T[K] | Date : T[K];} & Pick<GanttPlanningTask, 'start_date' | 'due_date'>;INTERFACE graph.GanttScheduleResult
Section titled “INTERFACE graph.GanttScheduleResult”スケジュール済みタスクのレコードと、個別の依存関係・容量の診断です。
export interface GanttScheduleResult<T extends GanttPlanningTask = GanttPlanningTask> {
/** Scheduled tasks in original order; summaries are left unchanged for the hierarchy rollup. */ tasks: GanttScheduledTask<T>[];
/** Dependency-only CPM, before leveling; this is not a resource-constrained critical chain. */ criticalPath: GanttCriticalPath;
/** Direct capacity delays and propagated predecessor delays, in working days. */ resourceDelays: Array<{ /** Leaf task whose schedule was delayed. */ taskId: string; /** Additional working days caused directly by resource-capacity contention. */ directDays: number; /** Additional working days inherited from predecessors after leveling. */ propagatedDays: number }>;
/** Finish after optional leveling, or null when empty. */ projectFinish: Date | null;}FUNCTION graph.planGanttTasks
Section titled “FUNCTION graph.planGanttTasks”共有カレンダーと任意のリソース容量を使用して、稼働日単位の計画を作成します。 日付はローカル時間の午前 0 時である必要があります(日付のみの文字列はローカル時間として解析します)。終了は、 その日を含まない次の稼働日の境界です。正の期間に稼働日がない場合は 1 日とします。durationDays は推定期間を上書きし、ゼロ日間のマイルストーンも指定できます。
リソースの優先順位は、安定したトポロジカル順・入力順で決定します。タスクの分割、 入力の開始日より前への移動、全体の完了期間を最短にする最適化は行いません。すべてのステータスを 対象にします。実績作業・固定済み作業や、個別のリソースカレンダーはモデル化しません。 サマリー行は保持しますが、計画対象からは除外します。無効な入力、循環、 容量を超える需要、探索上限への到達時には、入力を変更せずに例外をスローします。 CPM は平準化前に依存関係のみで計算し、容量による遅延は別途報告します。
export function planGanttTasks<T extends GanttPlanningTask>( tasks: T[], dependencies: GanttDependency[], options: GanttSchedulingOptions = {},): GanttScheduleResult<T>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
tasks |
T[] |
必須 | - 一意の ID と開始可能日を持つタスクレコードです。入力は変更しません。 |
dependencies |
GanttDependency[] |
必須 | - FS/SS/FF/SF と整数の lagDays を使用する、一意の有向リーフタスクリンクです。 |
options |
GanttSchedulingOptions |
任意 | - 省略可能な稼働日カレンダー、リソース平準化、探索範囲の上限です。プランナーでは {} がデフォルトです。scheduleGanttTasks で省略すると、従来の暦日と時刻に基づく動作を維持します。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
GanttScheduleResult<T> - Description: スケジュール設定済みのタスク、依存関係のみの CPM、キャパシティによる遅延、およびプロジェクト終了日時です。リーフ入力が空の場合は、診断情報が空、終了日時が null になります。
例外 (Throws)
Section titled “例外 (Throws)”グラフ、日付、カレンダー、期間の入力が無効な場合、または探索範囲の上限に達した場合に例外をスローします。稼働日プランナーは、実現不可能なリソース需要も拒否します。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { planGanttTasks } from '@alneas/appkit-core/graph';
const tasks = [{ id: 'a', created_at: '2026-10-20', durationDays: 2 }];const dependencies: never[] = [];console.log(planGanttTasks(tasks, dependencies, { calendar: {} }));---
### `FUNCTION` `graph.analyzeGanttCriticalPath`
依存関係のみを考慮した日単位の CPM です。リソース容量は無視します。入力の開始日は開始可能日の制約です。
```typescriptexport function analyzeGanttCriticalPath( tasks: GanttPlanningTask[], dependencies: GanttDependency[], options: GanttSchedulingOptions = {},): GanttCriticalPath引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
tasks |
GanttPlanningTask[] |
必須 | - 一意の ID と開始可能日を持つタスクレコードです。入力は変更しません。 |
dependencies |
GanttDependency[] |
必須 | - FS/SS/FF/SF と整数の lagDays を使用する、一意の有向リーフタスクリンクです。 |
options |
GanttSchedulingOptions |
任意 | - 省略可能な稼働日カレンダー、リソース平準化、探索範囲の上限です。プランナーでは {} がデフォルトです。scheduleGanttTasks で省略すると、従来の暦日と時刻に基づく動作を維持します。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
GanttCriticalPath - Description: 平準化前の、依存関係のみの CPM です。リーフ入力が空の場合、projectFinish は null になります。
例外 (Throws)
Section titled “例外 (Throws)”グラフ、日付、カレンダー、期間の入力が無効な場合、または探索範囲の上限に達した場合に例外をスローします。稼働日プランナーは、実現不可能なリソース需要も拒否します。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { analyzeGanttCriticalPath } from '@alneas/appkit-core/graph';
const tasks = [{ id: 'a', created_at: '2026-10-20', durationDays: 2 }];const dependencies: never[] = [];console.log(analyzeGanttCriticalPath(tasks, dependencies));---
### `FUNCTION` `graph.planningDate`
日単位の計画では、日未満の時刻を含むタイムスタンプを黙って切り捨てず、意図的に拒否します。
```typescriptexport function planningDate(value: string | Date): Date引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
value |
string | Date |
必須 | - ローカル時間の午前0時を表す Date、または有効な YYYY-MM-DD 形式の日付文字列です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Date - Description: 同じローカルの計画日を表す新しい Date です。
例外 (Throws)
Section titled “例外 (Throws)”無効な日付、または日単位より細かい時刻を含むタイムスタンプに対して例外をスローします。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { planningDate } from '@alneas/appkit-core/graph';
console.log(planningDate('2026-10-20'));---
### `FUNCTION` `graph.workingDayPredicate`
日付の判定を繰り返すために、共有カレンダーを一度だけコンパイルして検証します。
```typescriptexport function workingDayPredicate(calendar?: GanttWorkingCalendar)引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
calendar |
GanttWorkingCalendar | undefined |
任意 | - 省略可能な曜日と休日の上書き設定です。省略するとすべての日を許可し、{} を指定すると月曜日から金曜日を選択します。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
(date: Date) => boolean - Description: ローカル時間の Date を受け取り、その日付が稼働日かどうかを返す、再利用可能なコールバックです。明示的な workingDates は休日や曜日より優先されます。このコールバックは、入力された Date の有効性を検証しません。
例外 (Throws)
Section titled “例外 (Throws)”無効な曜日や例外日、または稼働日が1日もないカレンダーに対して例外をスローします。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { workingDayPredicate, planningDate } from '@alneas/appkit-core/graph';
const isWorking = workingDayPredicate({});console.log(isWorking(planningDate('2026-10-20')));---
### `FUNCTION` `graph.isGanttWorkingDay`
明示的な曜日、休日、稼働日の上書き設定に照らしてローカル日付を判定します。国別の祝日検索は行いません。
```typescriptexport function isGanttWorkingDay(date: Date, calendar?: GanttWorkingCalendar): boolean引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
date |
Date |
必須 | - ローカルの暦日を判定する対象となる、有効な Date です。 |
calendar |
GanttWorkingCalendar | undefined |
任意 | - 省略可能な曜日と休日の上書き設定です。省略するとすべての日を許可し、{} は月曜日から金曜日を意味します。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
boolean - Description: ローカル日付が、設定されたカレンダーの条件を満たすかどうかです。
例外 (Throws)
Section titled “例外 (Throws)”無効な日付やカレンダー設定に対して例外をスローします。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { isGanttWorkingDay, planningDate } from '@alneas/appkit-core/graph';
console.log(isGanttWorkingDay(planningDate('2026-10-20'), {}));---
### `FUNCTION` `graph.getGanttWorkingDuration`
[start,end) 内で占有する稼働日を数えます。非稼働日だけを含む正の期間は、1 稼働日とします。
```typescriptexport function getGanttWorkingDuration( task: GanttPlanningTask, calendar?: GanttWorkingCalendar,): number引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
task |
GanttPlanningTask |
必須 | - タスクの日付、または明示的な非負整数の durationDays です。明示的な期間が優先されます。 |
calendar |
GanttWorkingCalendar | undefined |
任意 | - 省略可能な稼働日ポリシーです。省略するとすべての日を許可します。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
number - Description: [start,end) 内で占有する稼働日数です。両端が等しい場合はゼロ、正の期間がある場合は少なくとも1です。
例外 (Throws)
Section titled “例外 (Throws)”無効な期間、日付、カレンダー、逆転した日付、または期間推定の走査が36600日を超えた場合に例外をスローします。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { getGanttWorkingDuration } from '@alneas/appkit-core/graph';
console.log(getGanttWorkingDuration({ id: 'a', created_at: '2026-10-20', durationDays: 2 }));---
### `FUNCTION` `graph.dependencyError`
描画や連鎖的な編集を有効にする前に検証します。グラフは一切変更しません。
```typescriptexport function dependencyError( tasks: GanttPlanningTask[], dependencies: GanttDependency[],): string | null引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
tasks |
GanttPlanningTask[] |
必須 | - ID とサマリー関係を検証するタスクレコードです。 |
dependencies |
GanttDependency[] |
必須 | - 検証する有向リーフタスクリンクです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string | null - Description: 依存関係が有効な場合は null、それ以外は診断文字列です。無効な依存関係はデータとして返します。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { dependencyError } from '@alneas/appkit-core/graph';
const tasks = [{ id: 'a', created_at: '2026-10-20', durationDays: 2 }];const dependencies: never[] = [];console.log(dependencyError(tasks, dependencies));---
### `FUNCTION` `graph.taskDates`
既存のタスクの日付規約を解決します。期日がない場合は、期間を 1 日とします。
```typescriptexport function taskDates(task: GanttPlanningTask)引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
task |
GanttPlanningTask |
必須 | - start_date または created_at と、省略可能な due_date を持つタスクです。期限がない場合は、開始日の1暦日後になります。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
{ start: Date; end: Date; } - Description: 従来の日付規則を使用して新しく作成する、開始と終了の Date 値です。
例外 (Throws)
Section titled “例外 (Throws)”日付が無効な場合、または終了が開始より前の場合に例外をスローします。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { taskDates } from '@alneas/appkit-core/graph';
console.log(taskDates({ id: 'a', created_at: '2026-10-20' }));---
### `FUNCTION` `graph.scheduleGanttTasks`
トポロジカル順で FS/SS/FF/SF 制約を適用し、後続タスクを後方にのみ移動します。ローカル日付演算を使用して、各タスクの暦日単位の期間と時刻を保持します。入力のタスク・リンクは変更しません。循環、ID の欠落、サマリーへの依存関係がある場合は例外をスローします。第 3 引数のオプションを指定すると、稼働カレンダーと任意の容量平準化を使用する、ローカル時間の午前 0 時を基準とした日単位の計画機能を有効にします。従来の時刻の動作を維持するには、この引数を省略してください。
```typescriptexport function scheduleGanttTasks<T extends GanttPlanningTask>( tasks: T[], dependencies: GanttDependency[], options?: GanttSchedulingOptions,): GanttScheduledTask<T>[]引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
tasks |
T[] |
必須 | - 一意の ID と開始可能日を持つタスクレコードです。入力は変更しません。 |
dependencies |
GanttDependency[] |
必須 | - FS/SS/FF/SF と整数の lagDays を使用する、一意の有向リーフタスクリンクです。 |
options |
GanttSchedulingOptions | undefined |
任意 | - 省略可能な稼働日カレンダー、リソース平準化、探索範囲の上限です。プランナーでは {} がデフォルトです。scheduleGanttTasks で省略すると、従来の暦日と時刻に基づく動作を維持します。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
GanttScheduledTask<T>[] - Description: スケジュール設定された日付を持つタスクを、入力順で返します。変更されないタスクは元の参照を保持する場合があります。
例外 (Throws)
Section titled “例外 (Throws)”グラフ、日付、カレンダー、期間の入力が無効な場合、または探索範囲の上限に達した場合に例外をスローします。稼働日プランナーは、実現不可能なリソース需要も拒否します。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { scheduleGanttTasks } from '@alneas/appkit-core/graph';
const tasks = [{ id: 'a', created_at: '2026-10-20', durationDays: 2 }];const dependencies: never[] = [];console.log(scheduleGanttTasks(tasks, dependencies));---
### `CLASS` `ai.AIChatError`
Appkit が管理するチャットの失敗です。呼び出し元のエラーと AbortError は、自動的にはラップしません。
```typescriptclass ai.AIChatError使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { AIChatError } from '@alneas/appkit-core/ai';
const error = new AIChatError('AI_HTTP_FAILURE', 'The host endpoint failed');console.log(error.code, error.docsUrl, error.recovery);---
### `FUNCTION` `ai.getAIErrorInfo`
固定の復旧メタデータです。未知のコードでは undefined を返します。ドキュメントの取得や再試行は行いません。
```typescriptexport function getAIErrorInfo(domain:AIErrorDomain,code:string):AIErrorInfo|undefined引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
domain |
"action" | "tool" | "chat" |
必須 | - chat、action、tool などのエラーカタログの分類です。 |
code |
string |
必須 | - 検索するコードです。大文字と小文字を区別して完全一致で照合します。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
AIErrorInfo | undefined - Description: 凍結された公開ガイドと復旧用メタデータです。ドメインやコードが不明な場合は undefined です。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { getAIErrorInfo } from '@alneas/appkit-core/ai';
console.log(getAIErrorInfo('chat', 'AI_HTTP_FAILURE'));---
### `TYPE` `ai.AIErrorDomain`
固定の復旧ガイダンスを選択するために使用する、エラーカタログの分類です。
```typescriptexport type AIErrorDomain = keyof typeof ERROR_CATALOG;TYPE ai.AIChatErrorCode
Section titled “TYPE ai.AIChatErrorCode”固定の公開復旧ドキュメントを持つ、Appkit チャットのエラーコードです。
export type AIChatErrorCode = keyof typeof ERROR_CATALOG.chat;INTERFACE ai.AIErrorInfo
Section titled “INTERFACE ai.AIErrorInfo”認識されたエラーコードに対する、公開ドキュメントと復旧メタデータです。
export interface AIErrorInfo { /** Absolute public guide URL explaining the catalogued failure. */ readonly docsUrl:string; /** Package-relative documentation file and anchor for this error code. */ readonly guide:string; /** Fixed recovery guidance for this failure; no automatic retry is performed. */ readonly recovery:string}TYPE ai.ActionResult
Section titled “TYPE ai.ActionResult”成功時の出力、またはアプリケーション向けの失敗の詳細を含む、ローカルアクションのディスパッチ結果です。
export type ActionResult<TOutput = unknown> = | {
/** Discriminant indicating whether this operation succeeded. */ ok: true;
/** Validated or projected result data carried by the successful variant. */ data: TOutput; } | {
/** Discriminant indicating whether this operation succeeded. */ ok: false;
/** Failure category for programmatic handling without inspecting display text. */ code: 'NOT_FOUND' | 'INVALID_INPUT' | 'EXECUTION_FAILED' | 'CANCELLED';
/** Human-readable failure description; see the owning boundary for sanitization rules. */ error: string;
/** Optional public documentation link explaining this failure category. */ readonly docsUrl?: string;
/** Optional fixed recovery guidance; no automatic retry is performed. */ readonly recovery?: string;
/** Original caught exception retained for the initiating application; avoid disclosing it to external tools. */ cause?: unknown; };TYPE ai.ActionValidationResult
Section titled “TYPE ai.ActionValidationResult”アクションの入力検証結果です。
export type ActionValidationResult<TInput> = | {
/** Discriminant indicating whether this operation succeeded. */ ok: true;
/** Validated or projected result data carried by the successful variant. */ data: TInput; } | {
/** Discriminant indicating whether this operation succeeded. */ ok: false;
/** Human-readable failure description; see the owning boundary for sanitization rules. */ error: string; };TYPE ai.ActionValidator
Section titled “TYPE ai.ActionValidator”アクション入力の検証関数です。 実行時の安全な実行を確保するため、すべてのアクションで必須です。
export type ActionValidator<TInput = unknown> = ( input: unknown) => ActionValidationResult<TInput>;使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { ActionValidator } from '@alneas/appkit-core/ai/action';
const validate: ActionValidator<string> = input => typeof input === 'string' ? { ok: true, data: input } : { ok: false, error: 'String required' };console.log(validate('hello'));---
### `INTERFACE` `ai.ActionDefinition`
実行可能なアクションの定義です。
```typescriptexport interface ActionDefinition<TInput = unknown, TOutput = unknown> {
/** Unique action identifier (e.g. 'table.filter', 'record.update') */ id: string;
/** Human- and agent-readable description of what this action does */ description: string;
/** * Runtime validator for the input argument. * Actions without input arguments should validate that input is undefined or null. * * @param input - Untrusted input passed to the synchronous validator immediately before handler dispatch. * @returns Validation success with typed input or failure; throwing is converted to INVALID_INPUT. * * @example * ```typescript * import type { ActionDefinition } from '@alneas/appkit-core/ai/action'; * * export function check(action: ActionDefinition<string, string>, input: unknown) { * return action.validate(input); * } * ``` */ validate: ActionValidator<TInput>;
/** * Action handler function. * Receives validated data and optional cooperative cancellation/progress context. * Returning success after an abort request still means the handler completed; no rollback is implied. * * @param input - Input produced by successful validation. * @param context - Optional signal/progress context supplied by the initiating application. * @returns The output directly or by promise; registry execution converts errors to failure results. * * @example * ```typescript * import type { ActionDefinition } from '@alneas/appkit-core/ai/action'; * * export async function run(action: ActionDefinition<string, string>) { * return action.handler('hello'); * } * ``` */ handler: (input: TInput, context?: ExecutionContext) => Promise<TOutput> | TOutput;
/** Optional metadata associated with the action */ metadata?: Record<string, unknown>;}INTERFACE ai.ActionDescriptor
Section titled “INTERFACE ai.ActionDescriptor”実行ハンドラーを含まない、公開用のアクション記述子です。メタデータの開示には、すべてホストの承認が必要です。
export interface ActionDescriptor {
/** Nonempty identifier used to correlate this object with its owning application/session. */ id: string;
/** Human- and model-readable description supplied explicitly by the application. */ description: string;
/** Optional metadata copied by reference into descriptors; the host must approve its disclosure. */ metadata?: Record<string, unknown>;}TYPE ai.ContextValueResult
Section titled “TYPE ai.ContextValueResult”コンテキスト値の取得結果です。
export type ContextValueResult<T = unknown> = | {
/** Discriminant indicating whether this operation succeeded. */ ok: true;
/** Operation/context value returned to the initiating application. */ value: T; } | {
/** Discriminant indicating whether this operation succeeded. */ ok: false;
/** Failure category for programmatic handling without inspecting display text. */ code: 'NOT_FOUND' | 'UNREGISTERED' | 'GETTER_FAILED';
/** Human-readable failure description; see the owning boundary for sanitization rules. */ error: string;
/** Original caught exception retained for the initiating application; avoid disclosing it to external tools. */ cause?: unknown; };TYPE ai.ContextGetter
Section titled “TYPE ai.ContextGetter”必要に応じてコンテキストの現在値を取得する関数です。
export type ContextGetter<T = unknown> = () => Promise<T> | T;使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { ContextGetter } from '@alneas/appkit-core/ai/action';
export async function read(getter: ContextGetter<string>) { return getter();}---
### `INTERFACE` `ai.ContextDefinition`
オンデマンドの画面コンテキストプロバイダーの定義です。
```typescriptexport interface ContextDefinition<T = unknown> {
/** Unique context key (e.g. 'selectedRecord', 'tableState') */ key: string;
/** Human- and agent-readable description of what this context represents */ description?: string;
/** * Getter function returning the latest context value * * @returns Latest application-owned context data; invoked on demand for each getContext call and may resolve asynchronously. * * @example * ```typescript * import type { ContextDefinition } from '@alneas/appkit-core/ai/action'; * * export async function read(context: ContextDefinition<string>) { * return context.getter(); * } * ``` */ getter: ContextGetter<T>;}INTERFACE ai.ContextDescriptor
Section titled “INTERFACE ai.ContextDescriptor”コンテキストの公開用記述子です(getter は含みません)。
export interface ContextDescriptor {
/** Application context registration key used for lookup. */ key: string;
/** Human- and model-readable description supplied explicitly by the application. */ description?: string;}CLASS ai.ActionRegistry
Section titled “CLASS ai.ActionRegistry”明示的な画面アクションと、オンデマンドのコンテキスト getter を管理するレジストリです。 フレームワークに依存せず、依存パッケージもありません。
class ai.ActionRegistry使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { ActionRegistry, defineActionTool, createActionToolBridge } from '@alneas/appkit-core/ai/action';
const registry = new ActionRegistry();const echo = defineActionTool<{ text: string }, { text: string }>({ id: 'echo', name: 'echo_text', description: 'Return the supplied text', inputSchema: { type: 'object', properties: { text: { type: 'string' } }, required: ['text'], additionalProperties: false }, parseInput: input => typeof input.text === 'string' ? { ok: true, data: { text: input.text } } : { ok: false, error: 'Text required' }, handler: input => ({ text: input.text }), mapOutput: value => value,});const unregister = registry.registerAction(echo.action);const bridge = createActionToolBridge(registry, { tools: [echo.tool] });try { console.log(await bridge.execute({ callId: 'call-1', name: 'echo_text', arguments: { text: 'hello' } }));} finally { bridge.close(); unregister();}---
### `TYPE` `ai.ActionToolInputSchema`
アプリケーションが管理する同期的な JSON Schema です。有限の JSON データであることと、対応ドラフトを実行時に確認します。
```typescriptexport type ActionToolInputSchema = Readonly<AnySchemaObject> & { /** Discriminant selecting the object variant. */ readonly type: 'object'; /** Disallowed asynchronous-schema marker; the boundary supports synchronous validation only. */ readonly $async?: never };TYPE ai.ActionToolValue
Section titled “TYPE ai.ActionToolValue”ツール境界で受け入れる JSON 値です。関数、undefined、非有限数は拒否します。
export type ActionToolValue = null | boolean | number | string | readonly ActionToolValue[] | ActionToolObject;INTERFACE ai.ActionToolObject
Section titled “INTERFACE ai.ActionToolObject”ツール境界における JSON オブジェクトです。
export interface ActionToolObject { readonly [key: string]: ActionToolValue }INTERFACE ai.ActionToolDescriptor
Section titled “INTERFACE ai.ActionToolDescriptor”プロバイダーに依存しないツール記述です。明示的に選択した公開情報だけを含みます。
export interface ActionToolDescriptor {
/** Tool name containing 1–64 ASCII letters, digits, underscores or hyphens. */ readonly name: string;
/** Human- and model-readable description supplied explicitly by the application. */ readonly description: string;
/** Synchronous draft-07 (default) or 2020-12 schema, with an object root. */ readonly inputSchema: ActionToolInputSchema;}TYPE ai.ActionToolBinding
Section titled “TYPE ai.ActionToolBinding”登録済みのアクションまたはコンテキスト 1 つを、公開ツール名で明示的に公開します。
export type ActionToolBinding = ActionToolDescriptor & {
/** * Required disclosure boundary. Select only values that may leave the application. * * @param value - Unknown action/context result to inspect and project synchronously. * @returns Explicit disclosure projection; invalid JSON or thrown projection errors become INVALID_OUTPUT. * * @example * ```typescript * import type { ActionToolBinding } from '@alneas/appkit-core/ai/action'; * * export function project(binding: ActionToolBinding, value: unknown) { * return binding.mapOutput(value); * } * ``` */ readonly mapOutput: (value: unknown) => unknown;} & ( | {
/** Discriminant selecting the action variant. */ readonly kind: 'action';
/** Registry action identifier exposed by this action binding. */ readonly actionId: string;
/** * Maps validated JSON arguments to the registered action input (e.g. {} to undefined). * * @param args - Schema-validated frozen JSON arguments. * @returns Registered action input; omission uses args unchanged, while exceptions become INVALID_INPUT. * * @example * ```typescript * import type { ActionToolBinding } from '@alneas/appkit-core/ai/action'; * * export function map(binding: Extract<ActionToolBinding, { kind: 'action' }>) { * return binding.mapInput ? binding.mapInput({}) : {}; * } * ``` */ readonly mapInput?: (args: ActionToolObject) => unknown; } | {
/** Discriminant selecting the context variant. */ readonly kind: 'context';
/** Registry context key exposed by this context binding. */ readonly contextKey: string; });INTERFACE ai.ActionToolCall
Section titled “INTERFACE ai.ActionToolCall”必要な情報がすべて揃った呼び出しです。アプリケーションは、ブリッジを呼び出す前にプロバイダーの JSON 文字列を解析します。
export interface ActionToolCall {
/** Application/provider call identifier; duplicates are rejected for the bridge lifetime. */ readonly callId: string;
/** Public tool/component name selected by the application; not inferred from executable code. */ readonly name: string;
/** Already-parsed untrusted input; schema validation still occurs before execution. */ readonly arguments: unknown;}TYPE ai.ActionToolErrorCode
Section titled “TYPE ai.ActionToolErrorCode”機密情報を除去したブリッジの失敗です。元の例外、メタデータ、バリデーターのメッセージは一切返しません。
export type ActionToolErrorCode = | 'INVALID_CALL' | 'NOT_EXPOSED' | 'NOT_AVAILABLE' | 'INVALID_INPUT' | 'CANCELLED' | 'EXECUTION_FAILED' | 'INVALID_OUTPUT' | 'DUPLICATE_CALL' | 'CALL_LIMIT' | 'CLOSED';TYPE ai.ActionToolResult
Section titled “TYPE ai.ActionToolResult”元の呼び出しに対応付けられた、JSON にシリアライズ可能な結果です。
export type ActionToolResult = { /** Application/provider call identifier; duplicates are rejected for the bridge lifetime. */ readonly callId: string; /** Public tool/component name selected by the application; not inferred from executable code. */ readonly name: string } & ( | { /** Discriminant indicating whether this operation succeeded. */ readonly ok: true; /** Validated or projected result data carried by the successful variant. */ readonly data: ActionToolValue } | { /** Discriminant indicating whether this operation succeeded. */ readonly ok: false; /** Failure category for programmatic handling without inspecting display text. */ readonly code: ActionToolErrorCode; /** Fixed sanitized bridge failure text; original exceptions and validator messages are not disclosed. */ readonly error: string; /** Optional public documentation link explaining this failure category. */ readonly docsUrl?: string; /** Optional fixed recovery guidance; no automatic retry is performed. */ readonly recovery?: string });INTERFACE ai.ActionToolBridgeOptions
Section titled “INTERFACE ai.ActionToolBridgeOptions”範囲が限定された 1 つのツールセッションです。新しい会話・セッションでは、新しいブリッジを開始してください。
export interface ActionToolBridgeOptions {
/** Explicit tool bindings available to this bridge; only registered targets are listed. */ readonly tools: readonly ActionToolBinding[];
/** Maximum unique valid call envelopes retained for duplicate rejection. Default 1000; no eviction. */ readonly maxCalls?: number;}INTERFACE ai.ActionToolBridge
Section titled “INTERFACE ai.ActionToolBridge”SDK に依存しないツールセッションです。トランスポートでも、サーバー側の認可境界でもありません。
export interface ActionToolBridge {
/** * Lists explicitly exposed tools whose action/context is currently registered. * * @returns Frozen descriptors of exposed targets currently registered; empty after close. * * @example * ```typescript * import type { ActionToolBridge } from '@alneas/appkit-core/ai/action'; * * export async function example(bridge: ActionToolBridge) { * return bridge.listTools(); * } * ``` */ listTools(): readonly ActionToolDescriptor[];
/** * Executes once per callId in this session, after schema and registered action validation. * * @param call - Assembled call envelope with a unique callId and already-parsed arguments. * @param context - Optional cooperative cancellation/progress context for action execution. * @returns A frozen JSON result or fixed sanitized failure; no automatic retry or durable deduplication. * * @example * ```typescript * import type { ActionToolBridge } from '@alneas/appkit-core/ai/action'; * * export async function example(bridge: ActionToolBridge) { * return bridge.execute({ callId: 'call-1', name: 'echo_text', arguments: { text: 'hello' } }); * } * ``` */ execute(call: ActionToolCall, context?: ExecutionContext): Promise<ActionToolResult>;
/** * Rejects future calls and suppresses in-flight results; does not undo started side effects. * * @returns No value; rejects future calls and suppresses in-flight results without undoing side effects. * * @example * ```typescript * import type { ActionToolBridge } from '@alneas/appkit-core/ai/action'; * * export async function example(bridge: ActionToolBridge) { * return bridge.close(); * } * ``` */ close(): void;}FUNCTION ai.createActionToolBridge
Section titled “FUNCTION ai.createActionToolBridge”画面レジストリへの、スコープが明示されたプロバイダー非依存のブリッジを作成します。
export function createActionToolBridge( registry: ActionRegistry, options: ActionToolBridgeOptions,): ActionToolBridge引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
registry |
ActionRegistry |
必須 | - 呼び出しのたびに現在の登録内容を確認するアプリケーションレジストリです。 |
options |
ActionToolBridgeOptions |
必須 | - 明示的なツールバインディングと、省略可能な正の安全な整数 maxCalls です。デフォルトは1000です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
ActionToolBridge - Description: list/execute/close を備えるメモリ内ブリッジです。close は、以後の結果と処理中の結果を抑止しますが、副作用を取り消しません。
補足 (Remarks)
Section titled “補足 (Remarks)”ツールのスキーマは、アプリケーションが管理する同期的な JSON Schema draft-07 または 2020-12 です。 スキーマは構築時に既存の Ajv アダプターでコンパイルし、型強制、 デフォルト値の適用、プロパティの削除は無効にします。登録済みのアクションバリデーターも引き続き実行します。 TypeScript の型からスキーマ、ハンドラー、権限、出力型を推論することはありません。 返すのは mapOutput の結果だけです。レジストリのメタデータ、エラー、原因はローカルに留めます。 ブリッジは呼び出し時点の登録内容を読み取り、実行中にそのアクションが 置き換えられた場合は結果を拒否します。コンテキストの存続期間の確認は、レジストリが管理します。 呼び出し ID の重複は、失敗した呼び出しを含め、このブリッジの存続期間中は拒否します。 これはローカルの再試行保護であり、永続的な冪等性やサーバー側の認可ではありません。 JSON スキーマ、引数、射影後の出力は、プレーンな有限の JSON データである必要があります。各値の上限は、 深さ 64 階層、10000 ノード、シリアライズ後の文字数 1000000 です。 ブリッジを作成しても、外部へのデータ公開や AI サービスへの接続は行いません。
例外 (Throws)
Section titled “例外 (Throws)”無効または重複した名前、無効な呼び出し上限やバインディング、あるいはスキーマやスナップショットのコンパイルエラーに対して例外をスローします。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { ActionRegistry, defineActionTool, createActionToolBridge } from '@alneas/appkit-core/ai/action';
const registry = new ActionRegistry();const echo = defineActionTool<{ text: string }, { text: string }>({ id: 'echo', name: 'echo_text', description: 'Return the supplied text', inputSchema: { type: 'object', properties: { text: { type: 'string' } }, required: ['text'], additionalProperties: false }, parseInput: input => typeof input.text === 'string' ? { ok: true, data: { text: input.text } } : { ok: false, error: 'Text required' }, handler: input => ({ text: input.text }), mapOutput: value => value,});const unregister = registry.registerAction(echo.action);const bridge = createActionToolBridge(registry, { tools: [echo.tool] });try { console.log(await bridge.execute({ callId: 'call-1', name: 'echo_text', arguments: { text: 'hello' } }));} finally { bridge.close(); unregister();}---
### `FUNCTION` `ai.defineActionTool`
1 つの入力スキーマとパーサーを使用して、型付きの Action と Tool を定義します。
```typescriptexport function defineActionTool<TInput, TOutput>(definition: ActionToolDefinition<TInput, TOutput>): DefinedActionTool<TInput, TOutput>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
definition |
ActionToolDefinition<TInput, TOutput> |
必須 | - 明示的な識別子、スキーマ、パーサー、ハンドラー、および公開情報のプロジェクションです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
DefinedActionTool<TInput, TOutput> - Description: 凍結されたアクション定義と明示的なアクションバインディングです。いずれも自動登録されません。
補足 (Remarks)
Section titled “補足 (Remarks)”これによって何かを登録したり公開したりすることはありません。registry.executeAction を直接 呼び出す場合も、必須の型付きパーサーより前にスキーマ検証を実行します。JSON Schema だけから TypeScript の型を断定することはありません。スキーマは、ブリッジの同期的な draft-07 / 2020-12 対応と、上限付きの不変 JSON スナップショットを使用します。型強制やデフォルト値の挿入は行いません。 パーサーの失敗と例外は、固定の入力エラーになります。パーサーは、検証済みデータをさらに絞り込んだり 変換したりできますが、同期的である必要があります。レジストリの ID は置き換え可能なため、mapOutput は引き続き unknown 型の 出力を検証します。プロバイダーのスキーマとトランスポートは、引き続きホストが管理します。
例外 (Throws)
Section titled “例外 (Throws)”無効な識別子、パーサー、ハンドラー、プロジェクションの欠如、またはスキーマやスナップショットのコンパイル失敗に対して例外をスローします。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { ActionRegistry, defineActionTool, createActionToolBridge } from '@alneas/appkit-core/ai/action';
const registry = new ActionRegistry();const echo = defineActionTool<{ text: string }, { text: string }>({ id: 'echo', name: 'echo_text', description: 'Return the supplied text', inputSchema: { type: 'object', properties: { text: { type: 'string' } }, required: ['text'], additionalProperties: false }, parseInput: input => typeof input.text === 'string' ? { ok: true, data: { text: input.text } } : { ok: false, error: 'Text required' }, handler: input => ({ text: input.text }), mapOutput: value => value,});const unregister = registry.registerAction(echo.action);const bridge = createActionToolBridge(registry, { tools: [echo.tool] });try { console.log(await bridge.execute({ callId: 'call-1', name: 'echo_text', arguments: { text: 'hello' } }));} finally { bridge.close(); unregister();}---
### `INTERFACE` `ai.ActionToolDefinition`
型付きアクションと、明示的に有効化するツールへの紐付けを定義する、単一の明示的なソースです。
```typescriptexport interface ActionToolDefinition<TInput, TOutput> extends ActionToolDescriptor {
/** Nonempty identifier used to correlate this object with its owning application/session. */ readonly id: string;
/** * Runs after schema validation; establish TInput using runtime checks or a synchronous parser. * * @param input - Schema-validated immutable JSON object. * @returns A synchronous typed input result; parser failure or exception becomes a fixed input error. * * @example * ```typescript * import type { ActionToolDefinition } from '@alneas/appkit-core/ai/action'; * * export function parse(definition: ActionToolDefinition<string, string>) { * return definition.parseInput({ text: 'hello' }); * } * ``` */ readonly parseInput: (input: ActionToolObject) => ActionValidationResult<TInput>;
/** * Runs the explicitly supplied typed action implementation. * * @param input - Typed input established by the schema and parser. * @param context - Optional cooperative cancellation/progress context. * @returns The local action output directly or by promise. * * @example * ```typescript * import type { ActionToolDefinition } from '@alneas/appkit-core/ai/action'; * * export async function run(definition: ActionToolDefinition<string, string>) { * return definition.handler('hello'); * } * ``` */ readonly handler: ActionDefinition<TInput, TOutput>['handler'];
/** * Output remains unknown: a registry can replace the action under the same ID. Validate and project it. * * @param value - Unknown current action result; the registry ID may have been replaced, so validate before disclosure. * @returns Explicitly selected data; bridge JSON snapshot validation rejects invalid outputs. * * @example * ```typescript * import type { ActionToolDefinition } from '@alneas/appkit-core/ai/action'; * * export function project(definition: ActionToolDefinition<string, string>, value: unknown) { * return definition.mapOutput(value); * } * ``` */ readonly mapOutput: (value: unknown) => unknown;}INTERFACE ai.DefinedActionTool
Section titled “INTERFACE ai.DefinedActionTool”アクションを明示的に登録し、ツールをブリッジまたは ScreenActionPanel に明示的に渡してください。
export interface DefinedActionTool<TInput, TOutput> {
/** Typed action definition to register explicitly before local execution. */ readonly action: ActionDefinition<TInput, TOutput>;
/** Explicit tool binding to pass to a bridge; creating it does not expose or register the action. */ readonly tool: Extract<ActionToolBinding, { kind: 'action' }>;}FUNCTION ai.createExecutionSession
Section titled “FUNCTION ai.createExecutionSession”フレームワークに依存しない実行セッションを作成します(履歴の上限はデフォルトで50、最大1000です)。 一度に実行される操作は1つです。cancelはステータスをcancellingに変更し、そのシグナルを中断します。 promiseとの競合処理や、キャンセルを無視するハンドラーのロック解除は行いません。 キャンセル後に正常に完了したハンドラーは、cancelRequested=trueのsucceededとして記録されます。 キャンセル要求後のAbortErrorのみがcancelledとして記録されます。それ以外のエラーは 失敗として扱われます。遅れて届いた進捗更新は無視されます。オブザーバーが実行を妨げることはありません。
履歴には、上限付きのラベルと進捗のみが含まれ、入力、結果、例外の詳細は含まれません。 これは一時的なUI状態であり、監査ログや永続的な重複排除の仕組みではありません。アプリケーションは、 サーバー側の認可、冪等性、コミット結果が不確実な場合の処理を自ら行う必要があります。
export function createExecutionSession(options: { /** Maximum in-memory history records retained, integer 1–1000; defaults to 50. */ readonly historyLimit?: number } = {}): ExecutionSession引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
options |
{ readonly historyLimit?: number; } |
任意 | - 省略可能な historyLimit 設定です。デフォルトは {} で、historyLimit は50です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
ExecutionSession - Description: 同時に1件のみ処理するメモリ内セッションです。不要になったら、ホストが閉じる必要があります。
例外 (Throws)
Section titled “例外 (Throws)”historyLimit が1から1000までの整数でない場合に例外をスローします。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { createExecutionSession } from '@alneas/appkit-core/ai/action';
const session = createExecutionSession();try { const outcome = await session.run('Sum values', ({ signal, reportProgress }) => { signal.throwIfAborted(); reportProgress({ completed: 1, total: 1, message: 'Calculated locally' }); return [1, 2, 3].reduce((sum, value) => sum + value, 0); }); console.log(outcome, session.getSnapshot());} finally { session.close();}---
### `INTERFACE` `ai.ExecutionProgress`
進捗値は有限値です。messageは、明示的に指定された公開用UIテキストであり、生の入力ではありません。
```typescriptexport interface ExecutionProgress {
/** Finite nonnegative completed-work units; invalid progress reports are ignored. */ readonly completed: number;
/** Optional finite total work units, at least completed; omission leaves total unknown. */ readonly total?: number;
/** Optional public progress text, at most 500 characters; do not include raw secrets or inputs. */ readonly message?: string;}INTERFACE ai.ExecutionContext
Section titled “INTERFACE ai.ExecutionContext”協調的な実行コンテキストです。キャンセルしても、完了した処理の効果はロールバックされません。
export interface ExecutionContext {
/** Abort signal for cooperative cancellation; cancellation does not roll back completed side effects. */ readonly signal: AbortSignal;
/** * Publishes a validated progress snapshot while this operation remains active. * * @param progress - Finite completed/optional total units and bounded public text; invalid reports are ignored. * @returns No value; publishes valid progress only while this execution is active. * * @example * ```typescript * import type { ExecutionContext } from '@alneas/appkit-core/ai/action'; * * export function report(context: ExecutionContext) { * context.reportProgress({ completed: 1, total: 2 }); * } * ``` */ readonly reportProgress: (progress: ExecutionProgress) => void;}INTERFACE ai.ExecutionRecord
Section titled “INTERFACE ai.ExecutionRecord”要約のみを保持するメモリ内履歴です。ペイロード、出力、生の例外は保持しません。
export interface ExecutionRecord {
/** Monotonically increasing in-memory execution ID, never reused within this session. */ readonly id: number;
/** Nonblank execution label, at most 200 characters, stored in transient history. */ readonly label: string;
/** Execution lifecycle state; cancellation can remain pending until the handler settles. */ readonly status: 'running' | 'cancelling' | 'succeeded' | 'failed' | 'cancelled';
/** Execution start timestamp in milliseconds since the Unix epoch. */ readonly startedAt: number;
/** Optional completion timestamp in milliseconds since the Unix epoch. */ readonly finishedAt?: number;
/** Whether cancellation was requested, even if the handler ultimately succeeded. */ readonly cancelRequested: boolean;
/** Most recently accepted progress snapshot; absent before the first valid report. */ readonly progress?: ExecutionProgress;}TYPE ai.ExecutionOutcome
Section titled “TYPE ai.ExecutionOutcome”生の値やエラーは、処理を開始したアプリケーションにのみ返され、履歴には保存されません。
export type ExecutionOutcome<T> = { /** Execution lifecycle state; cancellation can remain pending until the handler settles. */ readonly status: 'succeeded'; /** Operation/context value returned to the initiating application. */ readonly value: T } | { /** Execution lifecycle state; cancellation can remain pending until the handler settles. */ readonly status: 'failed'; /** Original thrown or rejected value, returned unchanged to the initiating host; inspect and sanitize before display. */ readonly error: unknown } | { /** Execution lifecycle state; cancellation can remain pending until the handler settles. */ readonly status: 'cancelled' };INTERFACE ai.ExecutionSession
Section titled “INTERFACE ai.ExecutionSession”同時に1つだけ実行し、外部ストアの購読用に上限付きの不変スナップショットを提供します。
export interface ExecutionSession {
/** * Reads the current stable immutable execution-history snapshot. * * @returns The same frozen array until the session state changes; initially empty. * * @example * ```typescript * import type { ExecutionSession } from '@alneas/appkit-core/ai/action'; * * export async function example(session: ExecutionSession) { * return session.getSnapshot(); * } * ``` */ getSnapshot(): readonly ExecutionRecord[];
/** * Subscribes to execution-history changes. * * @param listener - Zero-argument synchronous notification callback; return value is ignored and observer errors are caught. * @returns An unsubscribe callback; call it when the observer is disposed. * * @example * ```typescript * import type { ExecutionSession } from '@alneas/appkit-core/ai/action'; * * export async function example(session: ExecutionSession) { * return session.subscribe(() => console.log(session.getSnapshot())); * } * ``` */ subscribe(listener: () => void): () => void;
/** * Runs one operation while retaining the single-flight lock until it settles. * * @typeParam T - Value returned or resolved by the supplied work callback. * @param label - Nonblank public label of at most 200 characters. * @param work - Called once with signal/progress context; returns T or a promise of T. Throw/rejection becomes a failed/cancelled outcome. * @returns The operation outcome; cancellation followed by successful work still produces succeeded. * @throws Rejects a closed/busy session, invalid label or missing work callback. * * @example * ```typescript * import type { ExecutionSession } from '@alneas/appkit-core/ai/action'; * * export async function example(session: ExecutionSession) { * return session.run('Sum values', () => 1 + 2); * } * ``` */ run<T>(label: string, work: (context: ExecutionContext) => T | Promise<T>): Promise<ExecutionOutcome<T>>;
/** * Requests cooperative cancellation of the active operation. * * @returns No value; marks an active operation cancelling and aborts its signal. It does not release the lock or roll back effects. * * @example * ```typescript * import type { ExecutionSession } from '@alneas/appkit-core/ai/action'; * * export async function example(session: ExecutionSession) { * return session.cancel(); * } * ``` */ cancel(): void;
/** * Clears completed history while retaining an active execution record. * * @returns No value; publishes the filtered history snapshot without reusing IDs. * * @example * ```typescript * import type { ExecutionSession } from '@alneas/appkit-core/ai/action'; * * export async function example(session: ExecutionSession) { * return session.clearHistory(); * } * ``` */ clearHistory(): void;
/** * Prevents new work and requests cancellation of active work. * * @returns No value; future run calls reject, while active work retains the lock until settlement. * * @example * ```typescript * import type { ExecutionSession } from '@alneas/appkit-core/ai/action'; * * export async function example(session: ExecutionSession) { * return session.close(); * } * ``` */ close(): void;}TYPE ai.SupportedPrimitive
Section titled “TYPE ai.SupportedPrimitive”初期バージョンでサポートするプリミティブ値型です。 フィールドの削除、ネストしたオブジェクト、配列は初期バージョンの対象外です。 明示的なプリミティブ値またはnullのみに厳密に制限されます。
export type SupportedPrimitive = string | number | boolean | null;TYPE ai.FieldKey
Section titled “TYPE ai.FieldKey”対象レコードのキー型です(文字列キーに制限されます)。
export type FieldKey<TRecord> = Extract<keyof TRecord, string>;TYPE ai.FieldChange
Section titled “TYPE ai.FieldChange”フィールド変更の定義(Mapped Union)です。
各フィールドPについて、before / afterはTRecord[P] & SupportedPrimitiveに厳密に制約されます。 そのため、数値フィールドへの文字列の代入や、未知のフィールドの指定は、 コンパイル時の型エラーとして検出されます。
export type FieldChange< TRecord extends Record<string, any> = Record<string, any>, K extends FieldKey<TRecord> = FieldKey<TRecord>,> = { [P in K]: {
/** Target record string key whose before/after values are reviewed. */ readonly field: P;
/** Optional human-readable field label shown during review. */ readonly label?: string;
/** Expected primitive value at proposal creation, compared using Object.is for accepted changes. */ readonly before: TRecord[P] & SupportedPrimitive;
/** Proposed primitive value applied only when the field is accepted. */ readonly after: TRecord[P] & SupportedPrimitive;
/** Optional explanation for the proposed field change. */ readonly reason?: string; };}[K];TYPE ai.ProposalMetadata
Section titled “TYPE ai.ProposalMetadata”提案メタデータの型定義です。安全な不変性を保証し、共有参照による変更を防ぐため、 初期バージョンではプリミティブ値のマップに制限されます。
export type ProposalMetadata = Readonly<Record<string, SupportedPrimitive>>;TYPE ai.RecordProposal
Section titled “TYPE ai.RecordProposal”レコード変更提案(不変)です。
AIの提案、CSVインポート、一括変更などから生成されるデータ構造であり、 レビュー完了まで変更されません。
export type RecordProposal<TRecord extends Record<string, any> = Record<string, any>> = {
/** Nonempty identifier used to correlate this object with its owning application/session. */ readonly id: string;
/** Application identifier of the record to update; no database lookup occurs. */ readonly targetId: string;
/** Optional record display name retained by proposal validation. */ readonly targetName?: string;
/** Baseline string or finite-number version for strict equality checks; no coercion is performed. */ readonly baseVersion: string | number;
/** Nonempty unique-field primitive changes in proposal order after validation. */ readonly changes: readonly FieldChange<TRecord>[];
/** Creation timestamp text; validation supplies the current ISO timestamp when absent/non-string. */ readonly createdAt: string;
/** Optional application-owned metadata; disclosure decisions belong to the host. */ readonly metadata?: ProposalMetadata;};TYPE ai.FieldDecision
Section titled “TYPE ai.FieldDecision”個々のフィールドに対するレビュー判断です。
export type FieldDecision = 'accepted' | 'rejected' | 'pending';TYPE ai.ReviewDecisions
Section titled “TYPE ai.ReviewDecisions”フィールドごとの判断マップです(フィールド名をキーとします)。
export type ReviewDecisions<TRecord extends Record<string, any> = Record<string, any>> = Readonly<Partial<Record<FieldKey<TRecord>, FieldDecision>>>;TYPE ai.ProposalReviewStatus
Section titled “TYPE ai.ProposalReviewStatus”レビュー全体のステータスです(派生状態)。
export type ProposalReviewStatus = | 'all_pending' | 'partially_decided' | 'all_accepted' | 'all_rejected' | 'mixed';TYPE ai.ConsistencyCheckResult
Section titled “TYPE ai.ConsistencyCheckResult”現在の状態に対する整合性チェック結果です。
export type ConsistencyCheckResult<TRecord extends Record<string, any> = Record<string, any>> = | {
/** Discriminant indicating whether this operation succeeded. */ readonly ok: true; } | {
/** Discriminant indicating whether this operation succeeded. */ readonly ok: false;
/** Normalized finish category supplied by the adapter. */ readonly reason: 'version_mismatch';
/** Version recorded in the proposal that failed strict comparison. */ readonly expectedVersion: string | number;
/** Current host record version, compared strictly against the proposal base version. */ readonly currentVersion: string | number;
/** Human-readable description of the version or before-value conflict. */ readonly message: string; } | {
/** Discriminant indicating whether this operation succeeded. */ readonly ok: false;
/** Normalized finish category supplied by the adapter. */ readonly reason: 'before_value_mismatch';
/** Accepted fields whose current values differ from the proposal before values. */ readonly conflictedFields: readonly {
/** Target record string key whose before/after values are reviewed. */ readonly field: FieldKey<TRecord>;
/** Baseline primitive value expected for this accepted field. */ readonly expectedBefore: SupportedPrimitive;
/** Current source value observed during the consistency check. */ readonly actualCurrent: unknown; }[];
/** Human-readable description of the version or before-value conflict. */ readonly message: string; };TYPE ai.CandidateValidationResult
Section titled “TYPE ai.CandidateValidationResult”候補レコード全体に対するカスタム検証の結果です。
export type CandidateValidationResult = {
/** Whether validation passed; see errors for diagnostic details when false. */ readonly valid: boolean;
/** Optional field-keyed error messages supplied by the whole-record validator. */ readonly errors?: Readonly<Record<string, string>>;};TYPE ai.ApplyProposalPayload
Section titled “TYPE ai.ApplyProposalPayload”提案を適用するためのペイロードです。
export type ApplyProposalPayload<TRecord extends Record<string, any> = Record<string, any>> = {
/** Proposal identifier used to correlate a payload or preflight issue. */ readonly proposalId: string;
/** Application identifier of the record to update; no database lookup occurs. */ readonly targetId: string;
/** Baseline string or finite-number version for strict equality checks; no coercion is performed. */ readonly baseVersion: string | number;
/** Accepted field names in proposal order; the array is frozen. */ readonly acceptedFields: readonly FieldKey<TRecord>[];
/** Accepted field-change objects in proposal order; the array is frozen. */ readonly acceptedChanges: readonly FieldChange<TRecord>[];
/** Shallow copy of the source with accepted field changes applied; host owns persistence. */ readonly candidateRecord: Readonly<TRecord>;};FUNCTION ai.isSupportedPrimitive
Section titled “FUNCTION ai.isSupportedPrimitive”値が初期バージョンでサポートするプリミティブ値(文字列、有限の数値、真偽値、null)かどうかを確認します。
export function isSupportedPrimitive(value: unknown): value is SupportedPrimitive引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
value |
unknown |
必須 | 確認する値です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
boolean - Description: 有効なプリミティブ値の場合はtrueです。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { isSupportedPrimitive } from '@alneas/appkit-core/ai';
console.log(isSupportedPrimitive(Number.POSITIVE_INFINITY));---
### `FUNCTION` `ai.validateProposalInput`
外部入力を検証し、安全なRecordProposal<TRecord>を構築します。
```typescriptexport function validateProposalInput< TRecord extends Record<string, unknown> = Record<string, unknown>,>( input: unknown, options: ValidateProposalOptions<TRecord>): ProposalValidationResult<TRecord>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
input |
unknown |
必須 | 外部入力データです。 |
options |
ValidateProposalOptions<TRecord> |
必須 | 検証オプションです(許可フィールドと値のバリデーターは必須です)。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
ProposalValidationResult<TRecord> - Description: 検証結果です。
補足 (Remarks)
Section titled “補足 (Remarks)”成功時には、宣言されたプリミティブ型の変更フィールドとメタデータフィールドを複製して凍結します。不明な追加フィールドはコピーしません。危険な名前、および重複したフィールドや未登録のフィールドは拒否します。これは永続化や認可の境界ではありません。
例外 (Throws)
Section titled “例外 (Throws)”ホストのフィールドバリデーターの例外、および JSON 以外のオブジェクトのプロパティアクセスで発生するエラーを伝播します。通常の無効な提案データは、検証エラーとして返します。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { validateProposalInput, proposalFieldTypes } from '@alneas/appkit-core/ai/proposal';
const checked = validateProposalInput<{ name: string }>({ id: 'proposal-1', targetId: 'row-1', baseVersion: 1, changes: [{ field: 'name', before: 'Old', after: 'New' }], createdAt: '2026-10-20T00:00:00Z',}, { fields: { name: proposalFieldTypes.string } });console.log(checked);---
### `TYPE` `ai.ProposalValidationError`
検証エラーの詳細です。
```typescriptexport type ProposalValidationError = {
/** Field/input path associated with the validation diagnostic. */ readonly path: string;
/** Diagnostic text describing the rejected proposal field or value. */ readonly message: string;};TYPE ai.ProposalValidationResult
Section titled “TYPE ai.ProposalValidationResult”検証結果の型です。
export type ProposalValidationResult< TRecord extends Record<string, unknown> = Record<string, unknown>,> = | {
/** Discriminant indicating whether this operation succeeded. */ readonly ok: true;
/** Validated or projected result data carried by the successful variant. */ readonly data: RecordProposal<TRecord>; } | {
/** Discriminant indicating whether this operation succeeded. */ readonly ok: false;
/** Collected validation diagnostics; successful results contain no errors. */ readonly errors: readonly ProposalValidationError[]; };TYPE ai.FieldTypeValidator
Section titled “TYPE ai.FieldTypeValidator”各フィールドの値の型を検証するガード関数です。
export type FieldTypeValidator<TValue = unknown> = (value: unknown) => value is TValue;使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { FieldTypeValidator } from '@alneas/appkit-core/ai/proposal';
const isName: FieldTypeValidator<string> = value => typeof value === 'string';console.log(isName('Ada'));---
### `TYPE` `ai.ValidateProposalOptions`
明示的な許可フィールドのマップと、提案のプリミティブ値に対するホスト側のガードです。
```typescriptexport type ValidateProposalOptions<TRecord extends Record<string, unknown>> = {
/** * Definition map of fields allowed to be modified (required). * Unregistered fields are rejected as not modifiable. */ readonly fields: { readonly [K in FieldKey<TRecord>]?: FieldTypeValidator<TRecord[K] & SupportedPrimitive>; };};CONST ai.proposalFieldTypes
Section titled “CONST ai.proposalFieldTypes”よく使われるプリミティブ型向けの補助型ガードのコレクションです。
export const ai.proposalFieldTypes: { readonly string: (val: unknown) => val is string; readonly finiteNumber: (val: unknown) => val is number; readonly boolean: (val: unknown) => val is boolean; readonly null: (val: unknown) => val is null; readonly nullableString: (val: unknown) => val is string | null; readonly nullableFiniteNumber: (val: unknown) => val is number | null; readonly nullableBoolean: (val: unknown) => val is boolean | null; }使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { validateProposalInput, proposalFieldTypes } from '@alneas/appkit-core/ai/proposal';
const checked = validateProposalInput<{ name: string }>({ id: 'proposal-1', targetId: 'row-1', baseVersion: 1, changes: [{ field: 'name', before: 'Old', after: 'New' }], createdAt: '2026-10-20T00:00:00Z',}, { fields: { name: proposalFieldTypes.string } });console.log(checked);---
### `FUNCTION` `ai.buildCandidateRecord`
承認された変更を元データに適用し、純粋関数として候補レコードを構成します。元レコードと提案オブジェクトは変更しません。
```typescriptexport function buildCandidateRecord< TRecord extends Record<string, any> = Record<string, any>,>( currentRecord: TRecord, proposal: RecordProposal<TRecord>, decisions: ReviewDecisions<TRecord>): TRecord引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
currentRecord |
TRecord |
必須 | 最新の元レコードです。 |
proposal |
RecordProposal<TRecord> |
必須 | 変更提案です。 |
decisions |
Readonly<Partial<Record<Extract<keyof TRecord, string>, FieldDecision>>> |
必須 | フィールドごとの判断マップです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
TRecord - Description: 新しく構築された候補レコードです。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { buildCandidateRecord, type RecordProposal } from '@alneas/appkit-core/ai/proposal';
type Row = { name: string };const proposal: RecordProposal<Row> = { id: 'proposal-1', targetId: 'row-1', baseVersion: 1, changes: [{ field: 'name', before: 'Old', after: 'New' }], createdAt: '2026-10-20T00:00:00Z',};const current = { name: 'Old' };const decisions = { name: 'accepted' } as const;console.log(buildCandidateRecord(current, proposal, decisions));---
### `FUNCTION` `ai.verifyCurrentState`
現在の元データおよびバージョンと、提案内容との整合性を検証します。
1. バージョンの一致: proposal.baseVersionとcurrentVersionが厳密に等しいことを検証します。2. 変更前の値の一致: 承認されたフィールドについて、現在の値が提案のbefore値と厳密に一致するかを検証します。 (フォームでの未保存の手動編集などによる値の不一致を検出します)。
```typescriptexport function verifyCurrentState< TRecord extends Record<string, any> = Record<string, any>,>( currentRecord: TRecord, currentVersion: string | number, proposal: RecordProposal<TRecord>, decisions: ReviewDecisions<TRecord>): ConsistencyCheckResult<TRecord>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
currentRecord |
TRecord |
必須 | 現在のレコードデータです。 |
currentVersion |
string | number |
必須 | 現在のバージョンです。 |
proposal |
RecordProposal<TRecord> |
必須 | 変更提案です。 |
decisions |
Readonly<Partial<Record<Extract<keyof TRecord, string>, FieldDecision>>> |
必須 | フィールドごとの判断マップです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
ConsistencyCheckResult<TRecord> - Description: 整合性チェック結果です。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { verifyCurrentState, type RecordProposal } from '@alneas/appkit-core/ai/proposal';
type Row = { name: string };const proposal: RecordProposal<Row> = { id: 'proposal-1', targetId: 'row-1', baseVersion: 1, changes: [{ field: 'name', before: 'Old', after: 'New' }], createdAt: '2026-10-20T00:00:00Z',};const current = { name: 'Old' };const decisions = { name: 'accepted' } as const;console.log(verifyCurrentState(current, 1, proposal, decisions));---
### `FUNCTION` `ai.computeReviewStatus`
各フィールドの判断状態から、レビュー全体のステータスを計算します。
```typescriptexport function computeReviewStatus< TRecord extends Record<string, any> = Record<string, any>,>( proposal: RecordProposal<TRecord>, decisions: ReviewDecisions<TRecord>): ProposalReviewStatus引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
proposal |
RecordProposal<TRecord> |
必須 | 提案です。 |
decisions |
Readonly<Partial<Record<Extract<keyof TRecord, string>, FieldDecision>>> |
必須 | レビュー判断マップです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
ProposalReviewStatus - Description: レビューのステータスです。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { computeReviewStatus, type RecordProposal } from '@alneas/appkit-core/ai/proposal';
type Row = { name: string };const proposal: RecordProposal<Row> = { id: 'proposal-1', targetId: 'row-1', baseVersion: 1, changes: [{ field: 'name', before: 'Old', after: 'New' }], createdAt: '2026-10-20T00:00:00Z',};const current = { name: 'Old' };const decisions = { name: 'accepted' } as const;console.log(computeReviewStatus(proposal, decisions));---
### `FUNCTION` `ai.canApplyProposal`
変更提案を適用できるかどうかを総合的に評価します。
評価条件:1. 未決定の判断が残っていないことです。2. 少なくとも1つの変更が承認されていることです(すべて却下された場合は適用できません)。3. ベースバージョンと現在の値の整合性チェックに合格することです。4. 候補レコードのカスタム検証(candidateValidation)に合格することです。
```typescriptexport function canApplyProposal< TRecord extends Record<string, any> = Record<string, any>,>(params: {
/** Previously validated immutable field-change proposal to review. */ readonly proposal: RecordProposal<TRecord>;
/** Per-field accepted/rejected/pending choices; missing decisions are pending. */ readonly decisions: ReviewDecisions<TRecord>;
/** Previously computed version/before-value consistency result; this helper does not refresh storage. */ readonly consistency: ConsistencyCheckResult<TRecord>;
/** Optional whole-candidate validation result; invalid blocks application, omission skips this check. */ readonly candidateValidation?: CandidateValidationResult;}): boolean引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
params |
{ readonly proposal: RecordProposal<TRecord>; readonly decisions: ReviewDecisions<TRecord>; readonly consistency: ConsistencyCheckResult<TRecord>; readonly candidateValidation?: CandidateValidationResult; } |
必須 | 評価パラメーターです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
boolean - Description: 適用可能な場合はtrueです。
補足 (Remarks)
Section titled “補足 (Remarks)”candidateValidation は省略可能で、指定しない場合はレコード全体の検証をスキップします。提供された整合性データを評価するものであり、ストレージの再読み取りや書き込みは行いません。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { canApplyProposal, type RecordProposal } from '@alneas/appkit-core/ai/proposal';
type Row = { name: string };const proposal: RecordProposal<Row> = { id: 'proposal-1', targetId: 'row-1', baseVersion: 1, changes: [{ field: 'name', before: 'Old', after: 'New' }], createdAt: '2026-10-20T00:00:00Z',};const current = { name: 'Old' };const decisions = { name: 'accepted' } as const;console.log(canApplyProposal({ proposal, decisions, consistency: { ok: true } }));---
### `FUNCTION` `ai.buildApplyPayload`
適用リクエスト用の完全なペイロードを構築します。
```typescriptexport function buildApplyPayload< TRecord extends Record<string, any> = Record<string, any>,>(params: {
/** Previously validated immutable field-change proposal to review. */ readonly proposal: RecordProposal<TRecord>;
/** Shallow copy of the source with accepted field changes applied; host owns persistence. */ readonly candidateRecord: TRecord;
/** Per-field accepted/rejected/pending choices; missing decisions are pending. */ readonly decisions: ReviewDecisions<TRecord>;}): ApplyProposalPayload<TRecord>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
params |
{ readonly proposal: RecordProposal<TRecord>; readonly candidateRecord: TRecord; readonly decisions: ReviewDecisions<TRecord>; } |
必須 | 構築パラメーターです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
ApplyProposalPayload<TRecord> - Description: 適用ペイロードです。
補足 (Remarks)
Section titled “補足 (Remarks)”浅く凍結された候補と、凍結された受け入れ済みフィールド配列および変更配列を構成するだけです。整合性の確認、適格性の検証、永続化は行いません。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { buildApplyPayload, type RecordProposal } from '@alneas/appkit-core/ai/proposal';
type Row = { name: string };const proposal: RecordProposal<Row> = { id: 'proposal-1', targetId: 'row-1', baseVersion: 1, changes: [{ field: 'name', before: 'Old', after: 'New' }], createdAt: '2026-10-20T00:00:00Z',};const current = { name: 'Old' };const decisions = { name: 'accepted' } as const;console.log(buildApplyPayload({ proposal, decisions, candidateRecord: { name: "New" } }));---
### `FUNCTION` `ai.prepareProposalBatch`
複数レコードへの適用を開始する前に、選択されたすべてのレコードを準備します。単一提案の判断、変更前の値とバージョンのチェック、候補の検証を再利用します。提案IDがどこかで重複している場合や、選択された対象IDが重複している場合は、安全側に倒して失敗します。選択された各提案では、すべてのフィールドの判断が完了し、少なくとも1つの変更が承認されている必要があります。すべて却下された提案は明示的に除外してください。選択が空の場合は実行できません。
validateProposalInputで検証済みの提案を渡してください。これは外部入力のパーサー、レコード間の業務検証、データベーストランザクション、認可境界ではありません。ペイロードの候補は、buildApplyPayloadと同様、浅い不変スナップショットです。
```typescriptexport function prepareProposalBatch<TRecord extends Record<string, any> = Record<string, any>>( entries: readonly ProposalBatchEntry<TRecord>[], validateCandidate?: ProposalBatchValidator<TRecord>,): PreparedProposalBatch<TRecord>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
entries |
readonly ProposalBatchEntry<TRecord>[] |
必須 | - 現在のレコードとバージョン、選択内容、およびフィールドごとの判断を含む検証済みの提案です。どこにあっても、重複する提案 ID は拒否します。 |
validateCandidate |
ProposalBatchValidator<TRecord> | undefined |
任意 | - 選択された適格な候補に対して呼び出す、省略可能な同期的なレコード全体のコールバックです。行を許可するには valid=true を返してください。例外は invalid_candidate の問題になります。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
PreparedProposalBatch<TRecord> - Description: 凍結された事前検証の診断情報と、浅い不変性を持つペイロード候補です。問題が1つでもあるとペイロードリストは空になり、選択が空の場合は適用できません。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { prepareProposalBatch, type RecordProposal } from '@alneas/appkit-core/ai/proposal';
type Row = { name: string };const proposal: RecordProposal<Row> = { id: 'proposal-1', targetId: 'row-1', baseVersion: 1, changes: [{ field: 'name', before: 'Old', after: 'New' }], createdAt: '2026-10-20T00:00:00Z',};const current = { name: 'Old' };const decisions = { name: 'accepted' } as const;console.log(prepareProposalBatch([{ proposal, currentRecord: current, currentVersion: 1, selected: true, decisions }]));---
### `INTERFACE` `ai.ProposalBatchItem`
検証済みの提案1件と、アプリケーションが管理するその最新レコードおよびバージョンです。
```typescriptexport interface ProposalBatchItem<TRecord extends Record<string, any> = Record<string, any>> {
/** Previously validated immutable field-change proposal to review. */ readonly proposal: RecordProposal<TRecord>;
/** Latest application-owned source record used for candidate composition and before-value checks. */ readonly currentRecord: TRecord;
/** Current host record version, compared strictly against the proposal base version. */ readonly currentVersion: string | number;}INTERFACE ai.ProposalBatchEntry
Section titled “INTERFACE ai.ProposalBatchEntry”選択はフィールドの判断とは別に管理されます。除外されたレコードはバッチ処理を妨げません。
export interface ProposalBatchEntry<TRecord extends Record<string, any> = Record<string, any>> extends ProposalBatchItem<TRecord> {
/** Whether this entry participates in batch preflight; excluded entries do not block it except duplicate proposal IDs. */ readonly selected: boolean;
/** Per-field accepted/rejected/pending choices; missing decisions are pending. */ readonly decisions: ReviewDecisions<TRecord>;}INTERFACE ai.ProposalBatchIssue
Section titled “INTERFACE ai.ProposalBatchIssue”レコード単位の安全な事前チェック失敗です。バリデーターの例外は開示されません。
export interface ProposalBatchIssue {
/** Proposal identifier used to correlate a payload or preflight issue. */ readonly proposalId: string;
/** Failure category for programmatic handling without inspecting display text. */ readonly code: 'duplicate_proposal' | 'duplicate_target' | 'pending' | 'no_changes' | 'conflict' | 'invalid_candidate';}INTERFACE ai.PreparedProposalBatch
Section titled “INTERFACE ai.PreparedProposalBatch”事前チェックに失敗した場合、部分的に実行可能なペイロード一覧が公開されることはありません。
export interface PreparedProposalBatch<TRecord extends Record<string, any> = Record<string, any>> {
/** True when at least one entry is selected and every required preflight check passed. */ readonly canApply: boolean;
/** Number of selected entries, including those with preflight issues. */ readonly selectedCount: number;
/** Record-scoped preflight failures; empty when no failure was found. */ readonly issues: readonly ProposalBatchIssue[];
/** Shallow immutable apply payloads; empty whenever any preflight issue exists. */ readonly payloads: readonly ApplyProposalPayload<TRecord>[];}TYPE ai.ProposalBatchValidator
Section titled “TYPE ai.ProposalBatchValidator”純粋かつ同期的なレコード全体の検証です。事前チェック時と各行の処理直前に再利用します。
export type ProposalBatchValidator<TRecord extends Record<string, any> = Record<string, any>> = (candidate: TRecord, item: ProposalBatchItem<TRecord>) => CandidateValidationResult;使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { ProposalBatchValidator } from '@alneas/appkit-core/ai/proposal';
const validate: ProposalBatchValidator<{ name: string }> = candidate => ({ valid: candidate.name.trim().length > 0 });console.log(typeof validate);---
### `TYPE` `ai.GenerativeUIValue`
有限値からなるJSONデータです。実行可能な値やReactノードがUIドキュメントに含まれることはありません。
```typescriptexport type GenerativeUIValue = null | boolean | number | string | readonly GenerativeUIValue[] | GenerativeUIObject;INTERFACE ai.GenerativeUIObject
Section titled “INTERFACE ai.GenerativeUIObject”登録済みコンポーネントのバリデーターに渡す、不変のオブジェクトペイロードです。
export interface GenerativeUIObject { readonly [key: string]: GenerativeUIValue }INTERFACE ai.GenerativeUIBlock
Section titled “INTERFACE ai.GenerativeUIBlock”名前を明示した1つのUIコンポーネントとそのデータです。各型が受け入れる内容はアプリケーションが定義します。
export interface GenerativeUIBlock {
/** Unique block identifier within this document, nonblank and at most 128 characters. */ readonly id: string;
/** Explicit registered component name matching an ASCII letter followed by up to 63 letters/digits/underscore/dot/hyphen characters. */ readonly type: string;
/** Validated or projected result data carried by the successful variant. */ readonly data: GenerativeUIObject;}INTERFACE ai.GenerativeUIDocument
Section titled “INTERFACE ai.GenerativeUIDocument”フラットでバージョン付きのUIレスポンスです。レイアウトコード、実行可能なprops、リモートコンポーネントへの参照は含まれません。
export interface GenerativeUIDocument {
/** UI document envelope version; only literal 1 is supported. */ readonly version: 1;
/** Nonblank document identifier, at most 128 characters. */ readonly id: string;
/** Flat UI blocks, at most 32, with unique nonblank IDs; executable layout is not accepted. */ readonly blocks: readonly GenerativeUIBlock[];}TYPE ai.GenerativeUIDocumentResult
Section titled “TYPE ai.GenerativeUIDocumentResult”エンベロープの検証結果です。コンポーネント固有の検証はUIレジストリが担当します。
export type GenerativeUIDocumentResult = | { /** Discriminant indicating whether this operation succeeded. */ readonly ok: true; /** Validated or projected result data carried by the successful variant. */ readonly data: GenerativeUIDocument } | { /** Discriminant indicating whether this operation succeeded. */ readonly ok: false; /** Failure category for programmatic handling without inspecting display text. */ readonly code: 'INVALID_DOCUMENT'; /** Fixed envelope/schema failure text; raw parsing exceptions are not disclosed. */ readonly error: string };FUNCTION ai.validateGenerativeUIDocument
Section titled “FUNCTION ai.validateGenerativeUIDocument”完全に組み立てられたUIドキュメントを、UIに依存せずに検証し、スナップショットを作成します。
export function validateGenerativeUIDocument(input: unknown): GenerativeUIDocumentResult引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
input |
unknown |
必須 | - プロバイダーの JSON 解析やフラグメントの組み立て後に得られる、完全に組み立てられた信頼できない JSON ドキュメントです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
GenerativeUIDocumentResult - Description: 元の参照から切り離して凍結されたバージョン1のドキュメント、または固定の INVALID_DOCUMENT 失敗結果です。このエンベロープ層では、不明なコンポーネント名も許可します。
補足 (Remarks)
Section titled “補足 (Remarks)”バージョン1、ドキュメントID、一意のIDを持つ最大32個のフラットなブロックが必要です。
ブロックのプロパティはid/type/dataのみ、エンベロープのプロパティはversion/id/blocksのみです。
データはオブジェクトである必要があります。コンポーネント名は[A-Za-z][A-Za-z0-9_.-]{0,63}に一致する必要があります。
すべての値は、有限値からなるプレーンなJSONデータである必要があります。アクセサー、関数、循環参照、
疎な配列、クラスインスタンス、undefinedは使用できません。ドキュメント全体の上限は、ネスト64階層、
10000ノード、シリアライズ後の文字数1000000です。
成功時の結果は複製され、再帰的に凍結されます。呼び出し元の入力は変更しません。
これは構造を検証するものであり、業務データや認可を検証するものではありません。未知のコンポーネント名も
ここでは許可され、アプリケーションの明示的なUIレジストリで処理されます。
この関数を呼び出す前に、プロバイダーのJSONを解析し、ストリーミングの断片を組み立ててください。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { validateGenerativeUIDocument } from '@alneas/appkit-core/ai';
console.log(validateGenerativeUIDocument({ version: 1, id: 'response-1', blocks: [{ id: 'summary-1', type: 'summary', data: { text: 'hello' } }] }));---
### `FUNCTION` `ai.createGenerativeUIContract`
明示的なコンポーネント定義から、プロバイダーに依存しないdraft-07レスポンススキーマを構築します。
```typescriptexport function createGenerativeUIContract(components: readonly GenerativeUIComponentSchema[]): GenerativeUIContract引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
components |
readonly GenerativeUIComponentSchema[] |
必須 | - 最大32個の、一意の名前を持つコンポーネントスキーマです。各スキーマはインラインの同期的な draft-07 で、ルートはオブジェクトです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
GenerativeUIContract - Description: 凍結された合成スキーマ、コンポーネントのスナップショット、およびローカルの実行時検証ヘルパーです。
補足 (Remarks)
Section titled “補足 (Remarks)”一意の型名を最大32個指定でき、それぞれにルートがオブジェクトのインラインdataSchemaを持たせます。参照、 ID、アンカー、方言宣言、非同期スキーマは拒否されます(ネストした予約キーも含みます)。これにより、 スキーマの合成時に参照の基準が変わることや、方言の混在による曖昧さを防ぎます。 ネットワークからの読み込みは行いません。スキーマのスナップショットを作成して凍結し、 型強制変換、デフォルト値の挿入、削除を無効にした既存のAjvアダプターで直ちにコンパイルします。 無効なスキーマでは設定エラーがスローされます。 エクスポートされるスキーマは構造上の制約を記述します。実行時の検証では、これに加えて ブロックIDの一意性とJSONのサイズおよび深さの上限を強制します。カスタムの業務バリデーターと 認可は引き続きアプリケーションが担当します。プロバイダー固有のスキーマサブセットには、 アプリケーション側のアダプターが必要になる場合があります。この関数がAIサービスに接続することはありません。
例外 (Throws)
Section titled “例外 (Throws)”名前の重複や無効な名前、コンポーネント数の超過、禁止された参照キーや方言キー、JSON 以外のスナップショット、または Ajv のスキーマエラーに対して例外をスローします。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { createGenerativeUIContract } from '@alneas/appkit-core/ai/generative-ui';
const contract = createGenerativeUIContract([{ type: 'summary', dataSchema: { type: 'object', properties: { text: { type: 'string' } }, required: ['text'], additionalProperties: false,} }]);const checked = contract.validate({ version: 1, id: 'response-1', blocks: [ { id: 'summary-1', type: 'summary', data: { text: 'hello' } },] });console.log(checked);---
### `INTERFACE` `ai.GenerativeUIComponentSchema`
アプリケーションが管理するコンポーネントデータのスキーマです。インラインのdraft-07オブジェクトスキーマのみ使用できます。
```typescriptexport interface GenerativeUIComponentSchema {
/** Explicit registered component name matching an ASCII letter followed by up to 63 letters/digits/underscore/dot/hyphen characters. */ readonly type: string;
/** Inline synchronous draft-07 schema with an object root; reference/dialect keys are rejected. */ readonly dataSchema: GenerativeUIObject;}INTERFACE ai.GenerativeUIContract
Section titled “INTERFACE ai.GenerativeUIContract”同じ登録内容に対応する、共有レスポンススキーマと、入力を変更しない実行時バリデーターです。
export interface GenerativeUIContract {
/** Frozen composed response schema; runtime validation also checks unique IDs and bounded JSON. */ readonly schema: GenerativeUIObject;
/** Frozen component schema registrations used to compose this contract. */ readonly components: readonly GenerativeUIComponentSchema[];
/** * Also enforces envelope bounds and unique block IDs, which schema alone cannot express. * * @param input - Fully assembled untrusted document to check against envelope bounds and registered schemas. * @returns A frozen valid document snapshot or INVALID_DOCUMENT result; envelope validation failures are returned as data. * * @example * ```typescript * import type { GenerativeUIContract } from '@alneas/appkit-core/ai/generative-ui'; * * export async function example(contract: GenerativeUIContract) { * return contract.validate({ version: 1, id: 'response-1', blocks: [] }); * } * ``` */ validate(input: unknown): GenerativeUIDocumentResult;
/** * Returns false for unregistered types or invalid/beyond-limit JSON data. * * @param type - Explicit component type to look up. * @param input - Untrusted component data to snapshot and validate without mutation. * @returns False for unknown types, invalid schemas/data at this boundary or JSON snapshot violations; true for matching data. * * @example * ```typescript * import type { GenerativeUIContract } from '@alneas/appkit-core/ai/generative-ui'; * * export async function example(contract: GenerativeUIContract) { * return contract.validateData('summary', { text: 'hello' }); * } * ``` */ validateData(type: string, input: unknown): boolean;}FUNCTION ai.createAISDKChatAdapter
Section titled “FUNCTION ai.createAISDKChatAdapter”AI SDK UI Message Streamsを配信するホストエンドポイント用のHTTPトランスポートを作成します。
export function createAISDKChatAdapter(options: AIChatHTTPOptions): AIChatAdapter引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
options |
AIChatHTTPOptions |
必須 | - ホストの実際のエンドポイント、ヘッダー、省略可能な fetch 実装、およびデコード後の文字数上限です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
AIChatAdapter - Description: 凍結されたアダプターです。ネットワーク I/O は、ストリームの反復処理が開始されたときにのみ始まります。
例外 (Throws)
Section titled “例外 (Throws)”構築時に、エンドポイントがない場合、またはレスポンスの文字数上限が無効な場合に例外をスローします。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { createAISDKChatAdapter, type AIChatHTTPOptions } from '@alneas/appkit-core/ai/ai-chat';
// Use a host-controlled proxy/configuration; do not embed privileged server credentials in browsers.export function createAdapter(options: AIChatHTTPOptions) { return createAISDKChatAdapter(options);}---
### `TYPE` `ai.AIChatPart`
プロバイダーに依存しない会話パーツです。ツールはデータであり、アダプターが実行することはありません。
```typescriptexport type AIChatPart = | { /** Discriminant selecting the text variant. */ readonly type: 'text'; /** Text payload preserved without interpreting it as executable code. */ readonly text: string } | { /** Discriminant selecting the file variant. */ readonly type: 'file'; /** File/data location supplied by the host; handling and disclosure remain application-owned. */ readonly url: string; /** File MIME type supplied by the host; non-image OpenAI-compatible files require uploadFile. */ readonly mediaType: string; /** Optional original filename used for file presentation or multipart upload. */ readonly filename?: string } | { /** Discriminant selecting the tool-call variant. */ readonly type: 'tool-call'; /** Application/provider call identifier; duplicates are rejected for the bridge lifetime. */ readonly callId: string; /** Public tool/component name selected by the application; not inferred from executable code. */ readonly name: string; /** Assembled JSON object arguments for a tool call; this event does not execute the tool. */ readonly input: ActionToolObject } | { /** Discriminant selecting the tool-result variant. */ readonly type: 'tool-result'; /** Application/provider call identifier; duplicates are rejected for the bridge lifetime. */ readonly callId: string; /** Public tool/component name selected by the application; not inferred from executable code. */ readonly name: string; /** JSON-compatible tool result supplied by the host/provider; no tool is executed by chat adapters. */ readonly output: ActionToolValue; /** Optional marker indicating that the tool result represents a failure. */ readonly isError?: boolean } | { /** Discriminant selecting the data variant. */ readonly type: 'data'; /** Public tool/component name selected by the application; not inferred from executable code. */ readonly name: string; /** Validated or projected result data carried by the successful variant. */ readonly data: ActionToolValue; /** Optional application data-part identifier preserved by supported transports. */ readonly id?: string };INTERFACE ai.AIChatMessage
Section titled “INTERFACE ai.AIChatMessage”アプリケーションが提供する不変の会話履歴です。
export interface AIChatMessage {
/** Nonempty identifier used to correlate this object with its owning application/session. */ readonly id: string;
/** Conversation role; tool-role messages may contain only tool-result parts. */ readonly role: 'system' | 'user' | 'assistant' | 'tool';
/** Ordered immutable text/file/tool/data parts for this message. */ readonly parts: readonly AIChatPart[];
/** Optional application-owned metadata; disclosure decisions belong to the host. */ readonly metadata?: ActionToolValue;}INTERFACE ai.AIChatRequest
Section titled “INTERFACE ai.AIChatRequest”共通リクエストです。プロバイダーオプションはアプリケーションが管理し、モデルのレスポンスから取得することはありません。
export interface AIChatRequest {
/** Application conversation history; snapshots preserve order without trimming. */ readonly messages: readonly AIChatMessage[];
/** Optional explicitly disclosed public tool descriptors sent to the endpoint; handlers are not serialized. */ readonly tools?: readonly ActionToolDescriptor[];
/** Optional host-owned provider parameters; never trust model output as configuration. */ readonly parameters?: ActionToolObject;
/** Optional application conversation identifier forwarded when supported by the transport. */ readonly conversationId?: string;
/** AI SDK endpoint trigger, default submit-message when omitted by the request. */ readonly trigger?: 'submit-message' | 'regenerate-message';
/** Optional message identifier; the AI SDK adapter defaults to the last message ID. */ readonly messageId?: string;
/** Abort signal for cooperative cancellation; cancellation does not roll back completed side effects. */ readonly signal?: AbortSignal;}TYPE ai.AIChatEvent
Section titled “TYPE ai.AIChatEvent”ストリーミングされる、プロバイダーに依存しないイベントです。finishは明示的に必要です。EOFは正常完了を意味しません。
export type AIChatEvent = | { /** Discriminant selecting the text-delta variant. */ readonly type: 'text-delta'; /** Text payload preserved without interpreting it as executable code. */ readonly text: string } | Extract<AIChatPart, { type: 'tool-call' | 'tool-result' | 'data' }> | { /** Discriminant selecting the metadata variant. */ readonly type: 'metadata'; /** Optional application-owned metadata; disclosure decisions belong to the host. */ readonly metadata: ActionToolValue } | { /** Discriminant selecting the finish variant. */ readonly type: 'finish'; /** Normalized finish category supplied by the adapter. */ readonly reason: 'stop' | 'tool-calls' | 'length' | 'content-filter' | 'other' };INTERFACE ai.AIChatCapabilities
Section titled “INTERFACE ai.AIChatCapabilities”ケイパビリティは、アダプターのトランスポートがサポートする機能を示し、上流のすべてのモデルのサポートを示すものではありません。
export interface AIChatCapabilities {
/** Whether the transport carries tool descriptions/calls/results; it does not authorize or execute tools. */ readonly tools: boolean;
/** Whether the transport can carry structured data events; not a guarantee about every model. */ readonly structuredData: boolean;
/** Whether the transport can represent files; provider/upload requirements still apply. */ readonly files: boolean;}INTERFACE ai.AIChatAdapter
Section titled “INTERFACE ai.AIChatAdapter”Action、Proposal、Generative UIのアプリケーションコードを変更せずに、トランスポートを置き換えます。
export interface AIChatAdapter {
/** Stable adapter implementation identifier, such as ai-sdk-ui-stream. */ readonly id: string;
/** Transport-level feature flags; upstream model support remains host-selected. */ readonly capabilities: AIChatCapabilities;
/** * Must release network resources on abort or early iterator return. No automatic tool execution/retry. * * @param request - Host-owned messages/tools/parameters and optional signal; adapters must release I/O on abort/early return. * @returns An async iterable of normalized events including explicit finish; the transport does not execute tools or retry. * @throws Iteration propagates transport, parsing, validation or cancellation failures. * * @example * ```typescript * import type { AIChatAdapter } from '@alneas/appkit-core/ai/ai-chat'; * * export async function example(adapter: AIChatAdapter) { * return adapter.stream({ messages: [{ id: 'message-1', role: 'user', parts: [{ type: 'text', text: 'hello' }] }] }); * } * ``` */ stream(request: AIChatRequest): AsyncIterable<AIChatEvent>;}INTERFACE ai.AIChatHTTPOptions
Section titled “INTERFACE ai.AIChatHTTPOptions”HTTPトランスポートの設定です。ブラウザーではプロキシURLを指定してください。認証情報は引き続きホストが管理します。
export interface AIChatHTTPOptions {
/** HTTP endpoint/proxy URL selected by the application; credentials and access policy remain host-owned. */ readonly api: string;
/** Optional request headers snapshotted at adapter construction. */ readonly headers?: Readonly<Record<string, string>>;
/** * Optional host HTTP implementation; omitted uses globalThis.fetch. * * @param input - HTTP endpoint passed to the configured fetch implementation. * @param init - Request method, headers/body and optional cancellation signal. * @returns A standard Response promise; rejection propagates through the calling adapter. * @remarks Omission uses globalThis.fetch. The host implementation owns I/O and should honor AbortSignal. * * @example * ```typescript * import type { AIChatHTTPOptions } from '@alneas/appkit-core/ai/ai-chat'; * * export function endpoint(api: string, fetch: NonNullable<AIChatHTTPOptions['fetch']>) { * return { api, fetch } satisfies AIChatHTTPOptions; * } * ``` */ readonly fetch?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
/** Bounded stream size in decoded characters. Default 1,000,000; maximum 10,000,000. */ readonly maxResponseChars?: number;}FUNCTION ai.createOpenAICompatibleChatAdapter
Section titled “FUNCTION ai.createOpenAICompatibleChatAdapter”OpenAI互換のChat Completions HTTP/SSEアダプターです。1つのchoiceを使用し、ツールの 引数の断片を組み立ててから呼び出しを出力し、ツール結果の履歴を保持します。不完全な ストリームや無効なツールJSONは、完了したものとして扱わず、失敗します。ツールは実行しません。 任意のネイティブデータパーツは、このテキストおよびツール用プロトコルでは送信しません。プロバイダー固有の モデルやスキーマのサポートは、パラメーターで引き続き明示します。ケイパビリティはトランスポートレベルのものです。
export function createOpenAICompatibleChatAdapter(options: OpenAICompatibleChatOptions): AIChatAdapter引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
options |
OpenAICompatibleChatOptions |
必須 | - ホストの実際のエンドポイントとモデル、省略可能なヘッダー、fetch、ファイルアップロード連携、およびストリーム上限です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
AIChatAdapter - Description: 凍結された Chat Completions トランスポートです。作成時にはリクエストを送信しません。
例外 (Throws)
Section titled “例外 (Throws)”エンドポイントやモデルがない場合、またはレスポンス上限が無効な場合に例外をスローします。ストリームの反復処理では、HTTP、ストリーム、ツール、アップロードのエラーを伝播します。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { createOpenAICompatibleChatAdapter, type OpenAICompatibleChatOptions } from '@alneas/appkit-core/ai/ai-chat';
// Use a host-controlled proxy/configuration; do not embed privileged server credentials in browsers.export function createAdapter(options: OpenAICompatibleChatOptions) { return createOpenAICompatibleChatAdapter(options);}---
### `FUNCTION` `ai.createAIFileUpload`
従来のチャットファイルエンドポイント用の明示的なマルチパートアップロードアダプターです。base64データURLのみを受け入れます。
```typescriptexport function createAIFileUpload(options: AIChatHTTPOptions): NonNullable<OpenAICompatibleChatOptions['uploadFile']>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
options |
AIChatHTTPOptions |
必須 | - ホストのファイルアップロード用エンドポイント、ヘッダー、および省略可能な fetch 実装です。アップロードでは maxResponseChars を使用しません。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
(file: Extract<AIChatPart, { type: "file"; }>, signal?: AbortSignal) => Promise<{ id: string; type: string; }> - Description: base64 データ URL のファイルパートと省略可能な signal を受け取り、マルチパートフォームデータを POST し、サーバーのファイル ID と種類を返して解決するコールバックです。
補足 (Remarks)
Section titled “補足 (Remarks)”このコールバックは、無効な入力や base64 以外の入力、中止、HTTP の失敗、ID がないレスポンスに対して拒否されます。リモート URL のアップロード、リモートファイルの削除、アップロードサイズの制限は行いません。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { createAIFileUpload, type AIChatHTTPOptions } from '@alneas/appkit-core/ai/ai-chat';
export function createUploader(options: AIChatHTTPOptions) { return createAIFileUpload(options); // The host invokes this with an actual selected file.}---
### `INTERFACE` `ai.OpenAICompatibleChatOptions`
OpenAI互換のChat Completions設定です。エンドポイントとモデルを明示的に選択してください。
```typescriptexport interface OpenAICompatibleChatOptions extends AIChatHTTPOptions {
/** Nonblank model identifier selected by the host for the configured endpoint. */ readonly model: string;
/** * Explicit application file upload integration. Images are sent directly as image_url. * * @param file - Non-image file part selected for explicit upload before the chat request. * @param signal - Optional request cancellation signal that the host upload integration must honor. * @returns Remote file identifier/type, resolved before the file reference is sent; errors abort the chat request. * * @example * ```typescript * import type { OpenAICompatibleChatOptions } from '@alneas/appkit-core/ai/ai-chat'; * * export function withUpload(uploadFile: NonNullable<OpenAICompatibleChatOptions['uploadFile']>) { * return uploadFile; // Supply the host actual file integration, including cleanup policy. * } * ``` */ readonly uploadFile?: (file: Extract<AIChatPart, { /** Discriminant selecting the file variant. */ type: 'file' }>, signal?: AbortSignal) => Promise<{ /** Nonempty remote file identifier returned by the upload integration. */ id: string; /** Discriminant selecting the named component/record variant. */ type: string }>;
/** Preserve legacy endpoints that answer with AI SDK UI Message Streams. Default false. */ readonly acceptAISDKStream?: boolean;}FUNCTION ai.normalizeAIChatMessages
Section titled “FUNCTION ai.normalizeAIChatMessages”SDKやブラウザーの状態を使わずに、プロバイダーに依存しない履歴を検証し、元データから切り離します。 順序、ID、ロール、パーツ、メタデータを保持し、ロールを作り出したり、ツールを実行したりすることはありません。 ネストした値は再帰的に凍結されたJSONです。履歴全体の上限は、深さ64、値10,000個、 シリアライズ後のUTF-16コード単位数1,000,000です。削減や切り詰めは行いません。 返される外側の配列は新しい配列です。メッセージとパーツのスナップショットは不変のままです。
export function normalizeAIChatMessages(messages: readonly AIChatMessage[]): AIChatMessage[]引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
messages |
readonly AIChatMessage[] |
必須 | - ロール、パート、ID が明示された、解析済みのプロバイダーに依存しない履歴です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
AIChatMessage[] - Description: 元の参照から切り離して再帰的に凍結されたメッセージとパートの JSON スナップショットを含む、新しい外側の配列です。
例外 (Throws)
Section titled “例外 (Throws)”メッセージやパートの構造が不正な場合、JSON 以外の値がある場合、またはスナップショットのサイズ、深さ、ノード数の上限を超えた場合に例外をスローします。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { normalizeAIChatMessages } from '@alneas/appkit-core/ai';
console.log(normalizeAIChatMessages([{ id: 'message-1', role: 'user', parts: [{ type: 'text', text: 'hello' }] }]));---
### `FUNCTION` `ai.normalizeAIChatEvent`
アダプターイベントを検証し、スナップショットを作成します。ツールの認可や実行は行いません。
```typescriptexport function normalizeAIChatEvent(event: AIChatEvent): AIChatEvent引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
event |
AIChatEvent |
必須 | - 検証して元の参照から切り離す、組み立て済みのプロバイダーに依存しないイベントです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
AIChatEvent - Description: ツールを一切実行せずに得られる、再帰的に凍結された JSON イベントのスナップショットです。
例外 (Throws)
Section titled “例外 (Throws)”未対応のイベント構造、JSON 以外の値、またはスナップショットのサイズ、深さ、ノード数の上限超過に対して例外をスローします。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { normalizeAIChatEvent } from '@alneas/appkit-core/ai';
console.log(normalizeAIChatEvent({ type: 'text-delta', text: 'hello' }));---
### `FUNCTION` `ai.createAIChatStream`
HTTP、カスタム実装、SDKの利用側で共有する送信ライフサイクルです。戻る前にリクエストのスナップショットを作成し、要求に応じて遅延開始します。finishと、それに続くEOFを必須とし、finish後のイベントを拒否し、読み取り中でも中断をアダプターに転送します。キャンセルは速やかに確定します。I/Oを解放するには、アダプターがシグナルに従う必要があります。イテレーターのクリーンアップは要求しますが、応答しないnext()の完了を待ってから待機することはありません。ストレージ、再試行、再開、ツール実行、ブラウザーやSDKへの依存はありません。
```typescriptexport function createAIChatStream(adapter: AIChatAdapter, request: AIChatRequest, options: AIChatStreamOptions = {}): ReadableStream<AIChatEvent>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
adapter |
AIChatAdapter |
必須 | - ホストが提供するトランスポートです。そのイテレーターは、キャンセルに従い、ネットワークリソースを解放する必要があります。 |
request |
AIChatRequest |
必須 | - 会話リクエストです。createAIChatStream ではデータが要求される前に、streamAIChat では最初の反復処理時にスナップショットを作成します。 |
options |
AIChatStreamOptions |
任意 | - シリアライズされたイベントの、省略可能な文字数上限です。デフォルトは {} で、maxResponseChars は1000000です。最大値は10000000です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
ReadableStream<AIChatEvent> - Description: 遅延実行の ReadableStream です。アダプターのイテレーターを解放するには、消費するかキャンセルしてください。
例外 (Throws)
Section titled “例外 (Throws)”無効な設定や履歴、中止、無効なイベント、レスポンス上限超過、または finish のない EOF に対して、例外をスローするか拒否されます。finish 後のイベントも失敗となります。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { createAIChatStream, type AIChatAdapter } from '@alneas/appkit-core/ai/ai-chat';
export async function consume(adapter: AIChatAdapter) { const reader = createAIChatStream(adapter, { messages: [{ id: 'message-1', role: 'user', parts: [{ type: 'text', text: 'hello' }] }] }).getReader(); try { return await reader.read(); } finally { await reader.cancel(); reader.releaseLock(); }}---
### `FUNCTION` `ai.streamAIChat`
非同期イテラブル形式です。最初の反復時にスナップショットを作成し、早期return時にリーダーをクリーンアップします。
```typescriptexport async function* streamAIChat(adapter: AIChatAdapter, request: AIChatRequest, options?: AIChatStreamOptions): AsyncGenerator<AIChatEvent>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
adapter |
AIChatAdapter |
必須 | - ホストが提供するトランスポートです。そのイテレーターは、キャンセルに従い、ネットワークリソースを解放する必要があります。 |
request |
AIChatRequest |
必須 | - 会話リクエストです。createAIChatStream ではデータが要求される前に、streamAIChat では最初の反復処理時にスナップショットを作成します。 |
options |
AIChatStreamOptions | undefined |
任意 | - シリアライズされたイベントの、省略可能な文字数上限です。デフォルトは {} で、maxResponseChars は1000000です。最大値は10000000です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
AsyncGenerator<AIChatEvent, any, any> - Description: 遅延実行の非同期ジェネレーターです。途中で return すると、リーダーをキャンセルして解放します。
例外 (Throws)
Section titled “例外 (Throws)”無効な設定や履歴、中止、無効なイベント、レスポンス上限超過、または finish のない EOF に対して、例外をスローするか拒否されます。finish 後のイベントも失敗となります。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { streamAIChat, type AIChatAdapter } from '@alneas/appkit-core/ai/ai-chat';
export async function consume(adapter: AIChatAdapter) { for await (const event of streamAIChat(adapter, { messages: [{ id: 'message-1', role: 'user', parts: [{ type: 'text', text: 'hello' }] }] })) { console.log(event); }}---
### `INTERFACE` `ai.AIChatStreamOptions`
共有チャットストリームのライフサイクルにおける、シリアライズ済みイベントの文字数上限です。
```typescriptexport interface AIChatStreamOptions {
/** Sum of serialized normalized event characters, not bytes. Default 1,000,000; maximum 10,000,000. */ maxResponseChars?: number;}FUNCTION ai.extractAgentMessageText
Section titled “FUNCTION ai.extractAgentMessageText”形式の揺らぎを許容するJSONL出力から、完了したエージェントメッセージの文字列を抽出します。
export function extractAgentMessageText(output: string): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
output |
string |
必須 | - 行区切りのイベントやログの全文です。JSON 以外の行と無関係な行は無視します。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: 完了したエージェントメッセージを空行で連結したものです。空でないテキストを持つメッセージがない場合は、元の出力を返します。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { extractAgentMessageText } from '@alneas/appkit-core/ai';
console.log(extractAgentMessageText(JSON.stringify({ type: 'item.completed', item: { type: 'agent_message', text: 'hello' } })));---
### `INTERFACE` `ai.AgentMessageEvent`
agent_messageテキストを調べる対象となる、JSONL完了イベントの形式です。
```typescriptexport interface AgentMessageEvent {
/** Discriminant selecting the item.completed variant. */ readonly type: 'item.completed';
/** Optional completed event payload; only agent_message items with string text are extracted. */ readonly item?: {
/** Discriminant selecting the named component/record variant. */ readonly type?: string;
/** Text payload preserved without interpreting it as executable code. */ readonly text?: unknown; };}FUNCTION ai.createAjvValidator
Section titled “FUNCTION ai.createAjvValidator”Ajvベースのバリデーターを作成します。
export function createAjvValidator(options: AjvValidatorOptions = {})引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
options |
AjvValidatorOptions |
任意 | - 検証オプション。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
((schema: object, data: unknown, overrides?: Partial<AjvValidatorOptions>) => { valid: boolean; errors: string[]; rawErrors?: any[]; }) & { ajv: any; } - Description: 検証を実行する関数。
補足 (Remarks)
Section titled “補足 (Remarks)”$schemaに基づいてdraft-07/2020-12を自動選択します。コンパイル済み関数はインスタンス間で共有しません。 コンパイル後にスキーマを変更せず、新しいスキーマオブジェクトを指定してください。 返されるajvインスタンスはデフォルトのドラフトに対応します。addSchema/addKeywordを使う場合は、draftを明示的に指定してください。 デフォルトの処理経路では、型強制変換を無効にし、デフォルト値の挿入やキーの削除は 行いません。明示的なajvOptionsによって、入力の変更を有効にできます。未知のx-*キーワードは、 厳密モードが無効であるというだけで業務検証ルールになるわけではありません。 コンパイルや設定の失敗時には例外をスローします。データが無効な場合はvalid: falseを返します。 実行時コンパイルには、AJVが生成する関数の実行を許可するホストが必要です。
オプションを省略した場合は {} がデフォルトです。draft-07 を使用し、ロケールは明示的に指定せず、型強制を行わないデータ検証を使用します。
例外 (Throws)
Section titled “例外 (Throws)”構築時に Ajv の設定やフォーマット登録が失敗すると、例外をスローします。その後のスキーマコンパイルの失敗は、返されたバリデーターから伝播します。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { createAjvValidator } from '@alneas/appkit-core/ai/validation';
const validate = createAjvValidator({ locale: 'en' });console.log(validate({ type: 'object', properties: { name: { type: 'string' } }, required: ['name'] }, { name: 'Ada' }));---
### `INTERFACE` `ai.AjvValidatorOptions`
JSON Schemaのドラフト選択、Ajvの設定、診断メッセージのロケールです。
```typescriptexport interface AjvValidatorOptions {
/** Draft when $schema is not specified. Defaults to draft-07. If explicitly specified, different $schema declarations are rejected. */ draft?: 'draft-07' | '2020-12';
/** Ajv configuration options */ ajvOptions?: Record<string, any>;
/** Language configuration. Defaults to Ajv default messages when omitted. */ locale?: 'ja' | 'en';}FUNCTION ai.jsonSnapshot
Section titled “FUNCTION ai.jsonSnapshot”ツールとUIの境界で共有する、元データから切り離され、再帰的に凍結されたJSONスナップショットです。 走査する値は最大10,000個、深さは64(ルートは0)、シリアライズ後の JavaScript UTF-16コード単位数は1,000,000です。このサイズチェックはUTF-8のバイト数制限ではなく、 解析前のリクエストやストリームの制限を置き換えるものではありません。
export function jsonSnapshot(value: unknown): SnapshotValue引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
value |
unknown |
必須 | - 有限のプレーンな JSON 相当の入力です。アクセサー、toJSON フック、シンボル、疎な配列、クラスインスタンスは、意図的に呼び出すことなく拒否します。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
SnapshotValue - Description: 元の参照から切り離して再帰的に凍結された JSON データです。プリミティブ値は保持します。
例外 (Throws)
Section titled “例外 (Throws)”未対応の値や循環、深さが64を超える場合、走査した値が10000を超える場合、またはシリアライズ後の UTF-16 コード単位数が1000000を超える場合に例外をスローします。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { jsonSnapshot } from '@alneas/appkit-core/ai';
console.log(jsonSnapshot({ text: 'hello', values: [1, true, null] }));---
### `TYPE` `ai.SnapshotValue`
上限付きの入力スナップショットで使用する、有限値からなるJSONデータです。
```typescriptexport type SnapshotValue = null | boolean | number | string | readonly SnapshotValue[] | { readonly [key: string]: SnapshotValue };FUNCTION us.getUSFederalHolidays
Section titled “FUNCTION us.getUSFederalHolidays”現行の規則に基づく、毎年の全米共通の連邦祝日11日を一覧表示します。 振替モード(デフォルト)では、標準的な月曜日~金曜日の勤務日程に合わせ、 土曜日を金曜日に、日曜日を月曜日に移します。結果は選択された日付で絞り込みます。 翌年1月の元日が指定年の12月に振り替えられる場合も含みます。 州や地方の祝日、大統領就任式の日、行政命令による臨時休業日は含みません。 追加日付は指定どおりに使用し、選択された日付が一致する場合はラベルを置き換えます。 除外は最後に適用します。リモートデータは取得しません。 これは計画用の方針であり、民間雇用主の勤務日を決定するものではありません。 出典: https://www.opm.gov/policy-data-oversight/pay-leave/federal-holidays/
export function getUSFederalHolidays(year: number, options: USFederalHolidayOptions = {}): USFederalHoliday[]引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
year |
number |
必須 | 2021から2099までの暦年です。将来、規則が変わる可能性があります。 |
options |
USFederalHolidayOptions |
任意 | 振替モードと、明示的に追加または除外する休業日です。デフォルトは{}です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
USFederalHoliday[] - Description: 選択された日付がyearの範囲内にある、日付順に並べた新しいレコードです。
補足 (Remarks)
Section titled “補足 (Remarks)”オプションを省略した場合は {} がデフォルトです。observed=true で、追加日も除外日もありません。
例外 (Throws)
Section titled “例外 (Throws)”未対応の年や無効な上書き日付ではRangeError、名前のない追加項目ではTypeErrorです。
使用例 (Example)
Section titled “使用例 (Example)”import { getUSFederalHolidays } from '@alneas/appkit-core/us/holidays';getUSFederalHolidays(2026).find(day => day.actualDate === '2026-07-04')?.date; // '2026-07-03'FUNCTION us.usFederalHolidayCalendar
Section titled “FUNCTION us.usFederalHolidayCalendar”暦日が標準の振替連邦祝日カレンダーに該当するかを調べます。 data-engineのHolidayCalendarと構造的に互換性があります。エンジンへの依存はありません。
export function usFederalHolidayCalendar({ year, month, day }: USCalendarDate): boolean引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
{ year, month, day } |
USCalendarDate |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
boolean - Description: その暦日が振替を考慮した連邦祝日かどうかです。
例外 (Throws)
Section titled “例外 (Throws)”暦日が無効な場合、または年が2021–2099の範囲外の場合はRangeErrorです。
使用例 (Example)
Section titled “使用例 (Example)”import { usFederalHolidayCalendar } from '@alneas/appkit-core/us';usFederalHolidayCalendar({ year: 2026, month: 6, day: 3 }); // trueFUNCTION us.createUSFederalHolidayCalendar
Section titled “FUNCTION us.createUSFederalHolidayCalendar”アプリケーションのカレンダー上書き設定のスナップショットを使い、暦日プロバイダーを作成します。 組み込みの連邦祝日規則を変更せずに、発表済みの臨時休業や会社の方針を反映するために使用します。 外部サービスへのポーリングや、発表内容の推測は行いません。
export function createUSFederalHolidayCalendar(options: USFederalHolidayOptions = {}): (parts: USCalendarDate) => boolean引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
options |
USFederalHolidayOptions |
任意 | 振替モード、追加する休業日、除外日です。除外が優先されます。デフォルトは{}です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
(parts: USCalendarDate) => boolean - Description: data-engineのHolidayCalendarと構造的に互換性があります。月は0始まりです。
補足 (Remarks)
Section titled “補足 (Remarks)”オプションを省略した場合は {} がデフォルトです。observed=true で、追加日も除外日もありません。返されるコールバックは暦日を受け取り、同期的に真偽値を返します。無効な日付や年は RangeError で拒否します。
例外 (Throws)
Section titled “例外 (Throws)”無効な上書き日付ではRangeError、名前のない追加項目ではTypeErrorです。
使用例 (Example)
Section titled “使用例 (Example)”import { createUSFederalHolidayCalendar } from '@alneas/appkit-core/us/holidays';const calendar = createUSFederalHolidayCalendar({ additionalHolidays: [{ date: '2026-12-24', name: 'Company closure' }],});calendar({ year: 2026, month: 11, day: 24 }); // trueINTERFACE us.USCalendarDate
Section titled “INTERFACE us.USCalendarDate”暦日です。月はdata-engineのHolidayCalendarの契約に合わせて0始まりです。
export interface USCalendarDate { /** Gregorian civil year, restricted to 2021–2099 by the calendar provider. */ year: number; /** Zero-based month, January 0 through December 11. */ month: number; /** One-based valid day within the selected month. */ day: number }INTERFACE us.USFederalHoliday
Section titled “INTERFACE us.USFederalHoliday”連邦祝日の1回分の情報です。両方の日付はタイムゾーンなしのYYYY-MM-DD形式を使用します。
export interface USFederalHoliday {
/** Display name of the federal occurrence or host-supplied closure. */ name: string;
/** Date selected by the requested calendar mode, contained in the requested year. */ date: string;
/** Statutory holiday date; may belong to the following year in observed mode. */ actualDate: string;}INTERFACE us.USHolidayAddition
Section titled “INTERFACE us.USHolidayAddition”アプリケーションが選択する休業日です。自動的な日付移動は行わず、指定どおりに使用します。
export interface USHolidayAddition { /** Required nonblank display name for this explicit closure. */ name: string; /** Exact YYYY-MM-DD closure date from 2021–2099; no observance shift is applied. */ date: string }INTERFACE us.USFederalHolidayOptions
Section titled “INTERFACE us.USFederalHolidayOptions”連邦祝日の振替と、アプリケーションの明示的な休業日を設定します。除外が優先されます。
export interface USFederalHolidayOptions {
/** Apply standard Monday–Friday observance shifts when true (default); false uses statutory dates. */ observed?: boolean;
/** Additional YYYY-MM-DD closures, such as one-off announcements or company holidays. */ additionalHolidays?: readonly USHolidayAddition[];
/** Selected YYYY-MM-DD dates to remove, including observed rather than actual dates. */ excludedDates?: readonly string[];}FUNCTION us.formatUSD
Section titled “FUNCTION us.formatUSD”ドル単位の有限のUSD金額を、en-USを使用して小数点以下2桁で書式設定します。 表示にはIntlの丸めを使用します。会計計算や通貨換算ではありません。
export function formatUSD(amount: number): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
amount |
number |
必須 | ドル単位の金額です(1.25は$1.25を意味します)。負の金額による貸方も含みます。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: ローカライズされた通貨テキストです。
例外 (Throws)
Section titled “例外 (Throws)”金額がNaNまたは無限大の場合はRangeErrorです。
使用例 (Example)
Section titled “使用例 (Example)”import { formatUSD } from '@alneas/appkit-core/us/format';formatUSD(1234.5); // '$1,234.50'FUNCTION us.formatUSDate
Section titled “FUNCTION us.formatUSDate”ある瞬間を、明示的に選択したタイムゾーンのen-US数値日付形式で書式設定します。 米国には複数のタイムゾーンがあります。このAPIにはホストのローカルタイムゾーンを使うデフォルト設定はありません。
export function formatUSDate(date: Date, timeZone: string): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
date |
Date |
必須 | ある瞬間を表す有効なDateです。暦日の文字列は受け入れません。 |
timeZone |
string |
必須 | Intlのタイムゾーン識別子です。例としてAmerica/New_YorkやUTCがあります。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: 指定したタイムゾーンでの月/日/年のテキストです。
例外 (Throws)
Section titled “例外 (Throws)”Dateまたはタイムゾーンが無効な場合はRangeError、タイムゾーンがない場合はTypeErrorです。
使用例 (Example)
Section titled “使用例 (Example)”import { formatUSDate } from '@alneas/appkit-core/us/format';formatUSDate(new Date('2026-07-04T02:00:00Z'), 'America/New_York'); // '7/3/2026'CONST us.US_BUSINESS_DEFAULTS
Section titled “CONST us.US_BUSINESS_DEFAULTS”米国向けの表示設定です。通貨は税制やタイムゾーンを暗示しません。
export const us.US_BUSINESS_DEFAULTS: Readonly<{ readonly locale: "en-US"; readonly currency: "USD"; }>FUNCTION storage.S3CompatibleRuntime.getSignedGetUrl
Section titled “FUNCTION storage.S3CompatibleRuntime.getSignedGetUrl”HTTP GETによるダウンロード用のURLに署名します。
async getSignedGetUrl(key: string, options?: StorageURLOptions): Promise<string>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - 取得するオブジェクトキーです。 |
options |
StorageURLOptions | undefined |
任意 | - 省略可能な秒単位の有効期間(1–604800)とダウンロードファイル名です。署名は常に行います。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<string> - Description: 署名付き GET URL です。この呼び出しではオブジェクトを取得しません。
例外 (Throws)
Section titled “例外 (Throws)”有効期間が1–604800の整数秒の範囲外の場合、またはエンドポイント設定が不正な場合に拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { S3CompatibleRuntime } from '@alneas/appkit-core/storage';
export async function example(storage: S3CompatibleRuntime) { return storage.getSignedGetUrl("reports/note.txt", { expiresIn: 300 });}---
### `FUNCTION` `storage.S3CompatibleRuntime.getSignedPutUrl`
直接HTTP PUTでアップロードするためのURLに署名します。
```typescriptasync getSignedPutUrl(key: string, options?: Pick<StorageURLOptions, 'expiresIn'>): Promise<string>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - 保存先オブジェクトキーです。 |
options |
Pick<StorageURLOptions, "expiresIn"> | undefined |
任意 | - 任意の有効期間(秒)です。デフォルトは設定値または3600で、有効範囲は1–604800です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<string> - Description: 署名付きPUT URLです。この呼び出しではオブジェクトはアップロードされません。
例外 (Throws)
Section titled “例外 (Throws)”有効期間が1–604800の整数秒の範囲外の場合、またはエンドポイント設定が不正な場合に拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { S3CompatibleRuntime } from '@alneas/appkit-core/storage';
export async function example(storage: S3CompatibleRuntime) { return storage.getSignedPutUrl("reports/note.txt", { expiresIn: 300 });}---
### `FUNCTION` `storage.S3CompatibleRuntime.putObject`
SigV4認証と、任意のメタデータおよび保持ヘッダーを使用して、完全なペイロードをアップロードします。
```typescriptasync putObject(input: S3PutInput): Promise<void>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
input |
S3PutInput |
必須 | - 保存先キー、バッファリング済みのペイロード、および省略可能なヘッダーです。S3PutInput を参照してください。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<void> - Description: 戻り値はありません。HTTP PUT レスポンスが成功した後に解決します。
補足 (Remarks)
Section titled “補足 (Remarks)”バケットのアクセスポリシーの設定や MIME タイプの推定は行いません。
例外 (Throws)
Section titled “例外 (Throws)”署名やネットワークのエラー、無効な保持期限、または PUT レスポンスが成功を示さない場合に拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { S3CompatibleRuntime } from '@alneas/appkit-core/storage';
export async function example(runtime: S3CompatibleRuntime) { await runtime.putObject({ key: "notes.txt", body: "hello", contentType: "text/plain" });}---
### `FUNCTION` `storage.S3CompatibleRuntime.getObject`
保存されたオブジェクト全体をメモリに読み込みます。
```typescriptasync getObject(key: string): Promise<Uint8Array | null>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - 取得するオブジェクトキーです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<Uint8Array<ArrayBufferLike> | null> - Description: ダウンロードされたバイト列です。オブジェクトが存在しない場合はnullです。
例外 (Throws)
Section titled “例外 (Throws)”署名設定が無効な場合、ネットワーク障害が発生した場合、またはプロバイダーのレスポンスが成功を示さない場合に拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { S3CompatibleRuntime } from '@alneas/appkit-core/storage';
export async function example(storage: S3CompatibleRuntime) { return storage.getObject("reports/note.txt");}---
### `FUNCTION` `storage.S3CompatibleRuntime.deleteObject`
オブジェクトキーの削除を要求します。
```typescriptasync deleteObject(key: string): Promise<boolean>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - 削除するオブジェクトキーです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<boolean> - Description: 削除が確認されたかどうかです。捕捉されたトランスポート障害の場合もfalseになります。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { S3CompatibleRuntime } from '@alneas/appkit-core/storage';
export async function example(storage: S3CompatibleRuntime) { return storage.deleteObject("reports/note.txt");}---
### `FUNCTION` `storage.S3CompatibleRuntime.headObject`
オブジェクト本体をダウンロードせずにメタデータを取得します。
```typescriptasync headObject(key: string): Promise<StorageObject | null>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - 調べるオブジェクトキーです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<StorageObject | null> - Description: オブジェクトのメタデータです。キーが存在しない場合はnullです。
例外 (Throws)
Section titled “例外 (Throws)”署名設定が無効な場合、ネットワーク障害が発生した場合、またはプロバイダーのレスポンスが成功を示さない場合に拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { S3CompatibleRuntime } from '@alneas/appkit-core/storage';
export async function example(storage: S3CompatibleRuntime) { return storage.headObject("reports/note.txt");}---
### `FUNCTION` `storage.S3CompatibleRuntime.listObjects`
オブジェクトキーと任意の共通プレフィックスを、プロバイダーの1ページ分取得します。
```typescriptasync listObjects(options?: StorageListOptions): Promise<StorageListResult>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
options |
StorageListOptions | undefined |
任意 | - 任意のプレフィックス、区切り文字、ページ件数上限、継続トークンです。上限が未指定またはゼロの場合は1000を使用します。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<StorageListResult> - Description: プロバイダーの継続状態を含むオブジェクトとプレフィックスです。includeMetadataは無視されます。
例外 (Throws)
Section titled “例外 (Throws)”署名設定が無効な場合、ネットワーク障害が発生した場合、またはプロバイダーのレスポンスが成功を示さない場合に拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { S3CompatibleRuntime } from '@alneas/appkit-core/storage';
export async function example(storage: S3CompatibleRuntime) { return storage.listObjects({ prefix: "reports/", limit: 100 });}---
### `FUNCTION` `storage.S3CompatibleRuntime.copyObject`
オブジェクトをコピー先キーにコピーします。
```typescriptasync copyObject(sourceKey: string, destinationKey: string): Promise<StorageObject>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
sourceKey |
string |
必須 | - 既存のコピー元オブジェクトキーです。 |
destinationKey |
string |
必須 | - 作成または上書きするコピー先キーです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<StorageObject> - Description: コピー先を確認するメタデータです。同じキーへのコピーの場合はコピー元のメタデータです。
例外 (Throws)
Section titled “例外 (Throws)”署名設定が無効な場合、ネットワーク障害が発生した場合、またはプロバイダーのレスポンスが成功を示さない場合に拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { S3CompatibleRuntime } from '@alneas/appkit-core/storage';
export async function example(storage: S3CompatibleRuntime) { return storage.copyObject("reports/note.txt", "archive/note.txt");}---
### `CONST` `storage.S3RuntimeConfig.region`
SigV4署名リージョンです。プロバイダーが要求するリージョンを使用してください(R2の場合はautoなど)。
```typescriptexport const storage.S3RuntimeConfig.region: stringCONST storage.S3RuntimeConfig.bucket
Section titled “CONST storage.S3RuntimeConfig.bucket”リクエストのパスまたはホスト名で指定するバケットの名前空間です。
export const storage.S3RuntimeConfig.bucket: stringCONST storage.S3RuntimeConfig.endpoint
Section titled “CONST storage.S3RuntimeConfig.endpoint”任意のS3互換エンドポイントの絶対URLです。省略するとAWSのリージョン別エンドポイントを使用します。
export const storage.S3RuntimeConfig.endpoint: string | undefinedCONST storage.S3RuntimeConfig.accessKeyId
Section titled “CONST storage.S3RuntimeConfig.accessKeyId”SigV4認証に含める認証情報の識別子です。ホストが提供します。
export const storage.S3RuntimeConfig.accessKeyId: stringCONST storage.S3RuntimeConfig.secretAccessKey
Section titled “CONST storage.S3RuntimeConfig.secretAccessKey”ホストが提供する署名用シークレットです。信頼できないクライアントコードの外部で管理してください。
export const storage.S3RuntimeConfig.secretAccessKey: stringCONST storage.S3RuntimeConfig.forcePathStyle
Section titled “CONST storage.S3RuntimeConfig.forcePathStyle”カスタムエンドポイントでは、明示的にfalseにしない限り、パスにバケット名を含むアドレス指定を使用します。
export const storage.S3RuntimeConfig.forcePathStyle: boolean | undefinedCONST storage.S3RuntimeConfig.defaultExpiresIn
Section titled “CONST storage.S3RuntimeConfig.defaultExpiresIn”署名付きURLのデフォルト有効期間です。整数秒(1–604800)で指定し、省略すると3600を使用します。
export const storage.S3RuntimeConfig.defaultExpiresIn: number | undefinedCONST storage.S3PutInput.key
Section titled “CONST storage.S3PutInput.key”設定済みバケット内の送信先キーです。
export const storage.S3PutInput.key: stringCONST storage.S3PutInput.body
Section titled “CONST storage.S3PutInput.body”送信する完全なペイロードのバイト列またはUTF-8テキストです。
export const storage.S3PutInput.body: string | Uint8Array<ArrayBufferLike>CONST storage.S3PutInput.contentType
Section titled “CONST storage.S3PutInput.contentType”任意のContent-Typeヘッダーです。省略するとMIMEヘッダーは送信しません。
export const storage.S3PutInput.contentType: string | undefinedCONST storage.S3PutInput.cacheControl
Section titled “CONST storage.S3PutInput.cacheControl”保存する、任意のCache-Controlレスポンスメタデータです。
export const storage.S3PutInput.cacheControl: string | undefinedCONST storage.S3PutInput.metadata
Section titled “CONST storage.S3PutInput.metadata”小文字のx-amz-meta-*ヘッダーとして保存する、任意の文字列メタデータです。非ASCII値はエンコードします。
export const storage.S3PutInput.metadata: Record<string, string> | undefinedCONST storage.S3PutInput.objectLockMode
Section titled “CONST storage.S3PutInput.objectLockMode”任意の保持モードヘッダーです。プロバイダー側のObject Lockサポートと権限が必要です。
export const storage.S3PutInput.objectLockMode: "GOVERNANCE" | "COMPLIANCE" | undefinedCONST storage.S3PutInput.objectLockRetainUntilDate
Section titled “CONST storage.S3PutInput.objectLockRetainUntilDate”ISOタイムスタンプとして送信する、任意の絶対的な保持期限です。
export const storage.S3PutInput.objectLockRetainUntilDate: Date | undefinedFUNCTION storage.S3StorageAdapter.upload
Section titled “FUNCTION storage.S3StorageAdapter.upload”設定済みのストレージバックエンドにファイルデータを書き込みます。
async upload( key: string, data: Uint8Array | Blob | ReadableStream | string, options?: S3UploadOptions, ): Promise<StorageObject>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - 設定済みストレージ名前空間からの相対パスで表す、保存先オブジェクトキーです。 |
data |
string | Uint8Array<ArrayBufferLike> | Blob | ReadableStream<any> |
必須 | - 保存するバイト列またはテキストです。文字列はUTF-8を使用し、ストリームはメモリ内にバッファリングします。 |
options |
S3UploadOptions | undefined |
任意 | - 任意のMIMEタイプ、メタデータ、キャッシュ設定です。publicは無視されます。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<StorageObject> - Description: アップロードされたオブジェクトについて報告されたメタデータです。
補足 (Remarks)
Section titled “補足 (Remarks)”文字列とストリームはメモリ内に実体化します。MIME 検出はローカルのみです。リモートアップロードでそのヘッダーを送信するには contentType が必要です。ホストのアクセスポリシーは外部で管理されます。
例外 (Throws)
Section titled “例外 (Throws)”メソッドで false/null へのフォールバックが明記されていない限り、署名、ネットワーク、または成功を示さないバックエンドのレスポンスに対して拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { S3StorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: S3StorageAdapter) { return storage.upload("reports/note.txt", "hello", { contentType: "text/plain" });}---
### `FUNCTION` `storage.S3StorageAdapter.download`
保存されたオブジェクト全体をメモリに読み込みます。
```typescriptasync download(key: string): Promise<Uint8Array | null>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - 取得するオブジェクトキーです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<Uint8Array<ArrayBufferLike> | null> - Description: ダウンロードされたバイト列です。オブジェクトが存在しない場合はnullです。
例外 (Throws)
Section titled “例外 (Throws)”メソッドで false/null へのフォールバックが明記されていない限り、署名、ネットワーク、または成功を示さないバックエンドのレスポンスに対して拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { S3StorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: S3StorageAdapter) { return storage.download("reports/note.txt");}---
### `FUNCTION` `storage.S3StorageAdapter.getUploadUrl`
直接HTTP PUTでアップロードするためのURLに署名します。
```typescriptasync getUploadUrl(key: string, options?: Pick<StorageURLOptions, 'expiresIn'>): Promise<string>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - 保存先オブジェクトキーです。 |
options |
Pick<StorageURLOptions, "expiresIn"> | undefined |
任意 | - 任意の有効期間(秒)です。デフォルトは設定値または3600で、有効範囲は1–604800です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<string> - Description: 署名付きPUT URLです。この呼び出しではオブジェクトはアップロードされません。
例外 (Throws)
Section titled “例外 (Throws)”有効期間が無効(1–604800の整数秒の範囲外)な場合、またはエンドポイント設定が不正な場合に拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { S3StorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: S3StorageAdapter) { return storage.getUploadUrl("reports/note.txt", { expiresIn: 300 });}---
### `FUNCTION` `storage.S3StorageAdapter.getDownloadUrl`
HTTP GETによるダウンロード用のURLに署名します。
```typescriptasync getDownloadUrl(key: string, options?: StorageURLOptions): Promise<string>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - 取得するオブジェクトキーです。 |
options |
StorageURLOptions | undefined |
任意 | - 省略可能な秒単位の有効期間(1–604800)とダウンロードファイル名です。署名は常に行います。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<string> - Description: 署名付き GET URL です。この呼び出しではオブジェクトを取得しません。
例外 (Throws)
Section titled “例外 (Throws)”有効期間が無効(1–604800の整数秒の範囲外)な場合、またはエンドポイント設定が不正な場合に拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { S3StorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: S3StorageAdapter) { return storage.getDownloadUrl("reports/note.txt", { expiresIn: 300 });}---
### `FUNCTION` `storage.S3StorageAdapter.getUrl`
指定したオブジェクトキーを読み取るためのURLを構築します。
```typescriptasync getUrl(key: string, options?: StorageURLOptions): Promise<string>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - 対象とするオブジェクトキーです。 |
options |
StorageURLOptions | undefined |
任意 | - 省略可能な有効期間とダウンロードファイル名です。リモート署名はデフォルトで有効です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<string> - Description: URL 文字列です。生成時にオブジェクトの存在やアクセスポリシーは確認しません。
例外 (Throws)
Section titled “例外 (Throws)”有効期間が無効(1–604800の整数秒の範囲外)な場合、またはエンドポイント設定が不正な場合に拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { S3StorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: S3StorageAdapter) { return storage.getUrl("reports/note.txt", { expiresIn: 300 });}---
### `FUNCTION` `storage.S3StorageAdapter.delete`
オブジェクトキーの削除を要求します。
```typescriptasync delete(key: string): Promise<boolean>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - 削除するオブジェクトキーです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<boolean> - Description: 削除が確認されたかどうかです。捕捉されたトランスポート障害の場合もfalseになります。
補足 (Remarks)
Section titled “補足 (Remarks)”バージョン管理されたストレージでは、保持されている特定のバージョンではなく、キーを削除します。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { S3StorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: S3StorageAdapter) { return storage.delete("reports/note.txt");}---
### `FUNCTION` `storage.S3StorageAdapter.exists`
オブジェクトのメタデータを取得できるかどうかを確認します。
```typescriptasync exists(key: string): Promise<boolean>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - 調べるオブジェクトキーです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<boolean> - Description: メタデータの検索でキーが見つかった場合はtrue、存在しない場合はfalseです。
例外 (Throws)
Section titled “例外 (Throws)”メソッドで false/null へのフォールバックが明記されていない限り、署名、ネットワーク、または成功を示さないバックエンドのレスポンスに対して拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { S3StorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: S3StorageAdapter) { return storage.exists("reports/note.txt");}---
### `FUNCTION` `storage.S3StorageAdapter.head`
オブジェクト本体をダウンロードせずにメタデータを取得します。
```typescriptasync head(key: string): Promise<StorageObject | null>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - 調べるオブジェクトキーです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<StorageObject | null> - Description: オブジェクトのメタデータです。キーが存在しない場合はnullです。
例外 (Throws)
Section titled “例外 (Throws)”メソッドで false/null へのフォールバックが明記されていない限り、署名、ネットワーク、または成功を示さないバックエンドのレスポンスに対して拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { S3StorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: S3StorageAdapter) { return storage.head("reports/note.txt");}---
### `FUNCTION` `storage.S3StorageAdapter.list`
オブジェクトキーと任意の共通プレフィックスを、プロバイダーの1ページ分取得します。
```typescriptasync list(options?: StorageListOptions): Promise<StorageListResult>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
options |
StorageListOptions | undefined |
任意 | - 任意のプレフィックス、区切り文字、ページ件数上限、継続トークンです。上限が未指定またはゼロの場合は1000を使用します。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<StorageListResult> - Description: プロバイダーの継続状態を含むオブジェクトとプレフィックスです。includeMetadataは無視されます。
例外 (Throws)
Section titled “例外 (Throws)”メソッドで false/null へのフォールバックが明記されていない限り、署名、ネットワーク、または成功を示さないバックエンドのレスポンスに対して拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { S3StorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: S3StorageAdapter) { return storage.list({ prefix: "reports/", limit: 100 });}---
### `FUNCTION` `storage.S3StorageAdapter.copy`
オブジェクトをコピー先キーにコピーします。
```typescriptasync copy(sourceKey: string, destinationKey: string): Promise<StorageObject>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
sourceKey |
string |
必須 | - 既存のコピー元オブジェクトキーです。 |
destinationKey |
string |
必須 | - 作成または上書きするコピー先キーです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<StorageObject> - Description: コピー先を確認するメタデータです。同じキーへのコピーの場合はコピー元のメタデータです。
例外 (Throws)
Section titled “例外 (Throws)”メソッドで false/null へのフォールバックが明記されていない限り、署名、ネットワーク、または成功を示さないバックエンドのレスポンスに対して拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { S3StorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: S3StorageAdapter) { return storage.copy("reports/note.txt", "archive/note.txt");}---
### `FUNCTION` `storage.S3StorageAdapter.move`
オブジェクトをコピーしてから、コピー元キーを削除します。
```typescriptasync move(sourceKey: string, destinationKey: string): Promise<StorageObject>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
sourceKey |
string |
必須 | - 既存のコピー元オブジェクトキーです。 |
destinationKey |
string |
必須 | - 作成または上書きするコピー先キーです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<StorageObject> - Description: 移動元の削除後の移動先メタデータです。同じキーへの移動の場合は既存のメタデータです。
補足 (Remarks)
Section titled “補足 (Remarks)”コピーと削除は別々の操作です。失敗すると、コピー元とコピー先の両方が残る場合があります。リモートでの削除は、バケットのバージョン管理と保持設定によって制御されます。
例外 (Throws)
Section titled “例外 (Throws)”コピーエラー、同一キーのコピー元の欠如、またはコピー後のコピー元削除の失敗に対して拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { S3StorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: S3StorageAdapter) { return storage.move("reports/note.txt", "archive/note.txt");}---
### `FUNCTION` `storage.S3StorageAdapter.getHash`
保存されたx-sha256メタデータの値を読み取ります。
```typescriptasync getHash(key: string): Promise<string | null>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - 保存されたダイジェストを取得するオブジェクトキーです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<string | null> - Description: 保存されたダイジェスト文字列です。メタデータがない場合はnullです。
例外 (Throws)
Section titled “例外 (Throws)”メソッドで false/null へのフォールバックが明記されていない限り、署名、ネットワーク、または成功を示さないバックエンドのレスポンスに対して拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { S3StorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: S3StorageAdapter) { return storage.getHash("reports/note.txt");}---
### `FUNCTION` `storage.S3StorageAdapter.verifyHash`
ダウンロードしたバイト列を、保存されたSHA-256メタデータと比較します。
```typescriptasync verifyHash(key: string): Promise<boolean>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - ダウンロードして検証するオブジェクトキーです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<boolean> - Description: 保存されたダイジェストと一致する場合はtrueです。ダイジェストまたはオブジェクトがない場合や、不一致の場合はfalseです。
例外 (Throws)
Section titled “例外 (Throws)”メソッドで false/null へのフォールバックが明記されていない限り、署名、ネットワーク、または成功を示さないバックエンドのレスポンスに対して拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { S3StorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: S3StorageAdapter) { return storage.verifyHash("reports/note.txt");}---
### `CONST` `storage.S3UploadOptions.hash`
事前計算済みのSHA-256ハッシュです。
```typescriptexport const storage.S3UploadOptions.hash: string | undefinedCONST storage.S3UploadOptions.retentionUntilDate
Section titled “CONST storage.S3UploadOptions.retentionUntilDate”Object Lockの保持期限日です。
export const storage.S3UploadOptions.retentionUntilDate: Date | undefinedCONST storage.S3UploadOptions.objectLockMode
Section titled “CONST storage.S3UploadOptions.objectLockMode”Object Lockモードです(GOVERNANCEまたはCOMPLIANCE)。
export const storage.S3UploadOptions.objectLockMode: "GOVERNANCE" | "COMPLIANCE" | undefinedFUNCTION storage.R2StorageAdapter.upload
Section titled “FUNCTION storage.R2StorageAdapter.upload”設定済みのストレージバックエンドにファイルデータを書き込みます。
async upload( key: string, data: Uint8Array | Blob | ReadableStream | string, options?: StorageUploadOptions, ): Promise<StorageObject>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - 設定済みストレージ名前空間からの相対パスで表す、保存先オブジェクトキーです。 |
data |
string | Uint8Array<ArrayBufferLike> | Blob | ReadableStream<any> |
必須 | - 保存するバイト列またはテキストです。文字列はUTF-8を使用し、ストリームはメモリ内にバッファリングします。 |
options |
StorageUploadOptions | undefined |
任意 | - 任意のMIMEタイプ、メタデータ、キャッシュ設定です。publicは無視されます。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<StorageObject> - Description: アップロードされたオブジェクトについて報告されたメタデータです。
補足 (Remarks)
Section titled “補足 (Remarks)”文字列とストリームはメモリ内に実体化します。MIME 検出はローカルのみです。リモートアップロードでそのヘッダーを送信するには contentType が必要です。ホストのアクセスポリシーは外部で管理されます。
例外 (Throws)
Section titled “例外 (Throws)”メソッドで false/null へのフォールバックが明記されていない限り、署名、ネットワーク、または成功を示さないバックエンドのレスポンスに対して拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { R2StorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: R2StorageAdapter) { return storage.upload("reports/note.txt", "hello", { contentType: "text/plain" });}---
### `FUNCTION` `storage.R2StorageAdapter.download`
保存されたオブジェクト全体をメモリに読み込みます。
```typescriptasync download(key: string): Promise<Uint8Array | null>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - 取得するオブジェクトキーです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<Uint8Array<ArrayBufferLike> | null> - Description: ダウンロードされたバイト列です。オブジェクトが存在しない場合はnullです。
例外 (Throws)
Section titled “例外 (Throws)”メソッドで false/null へのフォールバックが明記されていない限り、署名、ネットワーク、または成功を示さないバックエンドのレスポンスに対して拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { R2StorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: R2StorageAdapter) { return storage.download("reports/note.txt");}---
### `FUNCTION` `storage.R2StorageAdapter.getUploadUrl`
直接HTTP PUTでアップロードするためのURLに署名します。
```typescriptasync getUploadUrl(key: string, options?: Pick<StorageURLOptions, 'expiresIn'>): Promise<string>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - 保存先オブジェクトキーです。 |
options |
Pick<StorageURLOptions, "expiresIn"> | undefined |
任意 | - 任意の有効期間(秒)です。デフォルトは設定値または3600で、有効範囲は1–604800です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<string> - Description: 署名付きPUT URLです。この呼び出しではオブジェクトはアップロードされません。
例外 (Throws)
Section titled “例外 (Throws)”有効期間が無効(1–604800の整数秒の範囲外)な場合、またはエンドポイント設定が不正な場合に拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { R2StorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: R2StorageAdapter) { return storage.getUploadUrl("reports/note.txt", { expiresIn: 300 });}---
### `FUNCTION` `storage.R2StorageAdapter.getDownloadUrl`
HTTP GETによるダウンロード用のURLに署名します。
```typescriptasync getDownloadUrl(key: string, options?: StorageURLOptions): Promise<string>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - 取得するオブジェクトキーです。 |
options |
StorageURLOptions | undefined |
任意 | - 省略可能な秒単位の有効期間(1–604800)とダウンロードファイル名です。署名は常に行います。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<string> - Description: 署名付き GET URL です。この呼び出しではオブジェクトを取得しません。
例外 (Throws)
Section titled “例外 (Throws)”有効期間が無効(1–604800の整数秒の範囲外)な場合、またはエンドポイント設定が不正な場合に拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { R2StorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: R2StorageAdapter) { return storage.getDownloadUrl("reports/note.txt", { expiresIn: 300 });}---
### `FUNCTION` `storage.R2StorageAdapter.getUrl`
指定したオブジェクトキーを読み取るためのURLを構築します。
```typescriptasync getUrl(key: string, options?: StorageURLOptions): Promise<string>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - 対象とするオブジェクトキーです。 |
options |
StorageURLOptions | undefined |
任意 | - 省略可能な有効期間とダウンロードファイル名です。リモート署名はデフォルトで有効です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<string> - Description: URL 文字列です。生成時にオブジェクトの存在やアクセスポリシーは確認しません。
補足 (Remarks)
Section titled “補足 (Remarks)”signed:false で publicUrl がある場合は署名なし URL を返し、それ以外は GET URL に署名します。バケットのアクセスポリシーは引き続き外部で管理されます。
例外 (Throws)
Section titled “例外 (Throws)”有効期間が無効(1–604800の整数秒の範囲外)な場合、またはエンドポイント設定が不正な場合に拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { R2StorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: R2StorageAdapter) { return storage.getUrl("reports/note.txt", { expiresIn: 300 });}---
### `FUNCTION` `storage.R2StorageAdapter.delete`
オブジェクトキーの削除を要求します。
```typescriptasync delete(key: string): Promise<boolean>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - 削除するオブジェクトキーです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<boolean> - Description: 削除が確認されたかどうかです。捕捉されたトランスポート障害の場合もfalseになります。
補足 (Remarks)
Section titled “補足 (Remarks)”バージョン管理されたストレージでは、保持されている特定のバージョンではなく、キーを削除します。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { R2StorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: R2StorageAdapter) { return storage.delete("reports/note.txt");}---
### `FUNCTION` `storage.R2StorageAdapter.exists`
オブジェクトのメタデータを取得できるかどうかを確認します。
```typescriptasync exists(key: string): Promise<boolean>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - 調べるオブジェクトキーです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<boolean> - Description: メタデータの検索でキーが見つかった場合はtrue、存在しない場合はfalseです。
例外 (Throws)
Section titled “例外 (Throws)”メソッドで false/null へのフォールバックが明記されていない限り、署名、ネットワーク、または成功を示さないバックエンドのレスポンスに対して拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { R2StorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: R2StorageAdapter) { return storage.exists("reports/note.txt");}---
### `FUNCTION` `storage.R2StorageAdapter.head`
オブジェクト本体をダウンロードせずにメタデータを取得します。
```typescriptasync head(key: string): Promise<StorageObject | null>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - 調べるオブジェクトキーです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<StorageObject | null> - Description: オブジェクトのメタデータです。キーが存在しない場合はnullです。
例外 (Throws)
Section titled “例外 (Throws)”メソッドで false/null へのフォールバックが明記されていない限り、署名、ネットワーク、または成功を示さないバックエンドのレスポンスに対して拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { R2StorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: R2StorageAdapter) { return storage.head("reports/note.txt");}---
### `FUNCTION` `storage.R2StorageAdapter.list`
オブジェクトキーと任意の共通プレフィックスを、プロバイダーの1ページ分取得します。
```typescriptasync list(options?: StorageListOptions): Promise<StorageListResult>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
options |
StorageListOptions | undefined |
任意 | - 任意のプレフィックス、区切り文字、ページ件数上限、継続トークンです。上限が未指定またはゼロの場合は1000を使用します。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<StorageListResult> - Description: プロバイダーの継続状態を含むオブジェクトとプレフィックスです。includeMetadataは無視されます。
例外 (Throws)
Section titled “例外 (Throws)”メソッドで false/null へのフォールバックが明記されていない限り、署名、ネットワーク、または成功を示さないバックエンドのレスポンスに対して拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { R2StorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: R2StorageAdapter) { return storage.list({ prefix: "reports/", limit: 100 });}---
### `FUNCTION` `storage.R2StorageAdapter.copy`
オブジェクトをコピー先キーにコピーします。
```typescriptasync copy(sourceKey: string, destinationKey: string): Promise<StorageObject>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
sourceKey |
string |
必須 | - 既存のコピー元オブジェクトキーです。 |
destinationKey |
string |
必須 | - 作成または上書きするコピー先キーです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<StorageObject> - Description: コピー先を確認するメタデータです。同じキーへのコピーの場合はコピー元のメタデータです。
例外 (Throws)
Section titled “例外 (Throws)”メソッドで false/null へのフォールバックが明記されていない限り、署名、ネットワーク、または成功を示さないバックエンドのレスポンスに対して拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { R2StorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: R2StorageAdapter) { return storage.copy("reports/note.txt", "archive/note.txt");}---
### `FUNCTION` `storage.R2StorageAdapter.move`
オブジェクトをコピーしてから、コピー元キーを削除します。
```typescriptasync move(sourceKey: string, destinationKey: string): Promise<StorageObject>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
sourceKey |
string |
必須 | - 既存のコピー元オブジェクトキーです。 |
destinationKey |
string |
必須 | - 作成または上書きするコピー先キーです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<StorageObject> - Description: 移動元の削除後の移動先メタデータです。同じキーへの移動の場合は既存のメタデータです。
補足 (Remarks)
Section titled “補足 (Remarks)”コピーと削除は別々の操作です。失敗すると、コピー元とコピー先の両方が残る場合があります。リモートでの削除は、バケットのバージョン管理と保持設定によって制御されます。
例外 (Throws)
Section titled “例外 (Throws)”コピーエラー、同一キーのコピー元の欠如、またはコピー後のコピー元削除の失敗に対して拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { R2StorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: R2StorageAdapter) { return storage.move("reports/note.txt", "archive/note.txt");}---
### `FUNCTION` `storage.OCIStorageAdapter.upload`
設定済みのストレージバックエンドにファイルデータを書き込みます。
```typescriptasync upload( key: string, data: Uint8Array | Blob | ReadableStream | string, options?: OCIUploadOptions, ): Promise<StorageObject>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - 設定済みストレージ名前空間からの相対パスで表す、保存先オブジェクトキーです。 |
data |
string | Uint8Array<ArrayBufferLike> | Blob | ReadableStream<any> |
必須 | - 保存するバイト列またはテキストです。文字列はUTF-8を使用し、ストリームはメモリ内にバッファリングします。 |
options |
OCIUploadOptions | undefined |
任意 | - 任意のMIMEタイプ、メタデータ、キャッシュ設定です。publicは無視されます。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<StorageObject> - Description: アップロードされたオブジェクトについて報告されたメタデータです。
補足 (Remarks)
Section titled “補足 (Remarks)”文字列とストリームはメモリ内に実体化します。MIME 検出はローカルのみです。リモートアップロードでそのヘッダーを送信するには contentType が必要です。ホストのアクセスポリシーは外部で管理されます。
例外 (Throws)
Section titled “例外 (Throws)”メソッドで false/null へのフォールバックが明記されていない限り、署名、ネットワーク、または成功を示さないバックエンドのレスポンスに対して拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { OCIStorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: OCIStorageAdapter) { return storage.upload("reports/note.txt", "hello", { contentType: "text/plain" });}---
### `FUNCTION` `storage.OCIStorageAdapter.download`
保存されたオブジェクト全体をメモリに読み込みます。
```typescriptasync download(key: string): Promise<Uint8Array | null>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - 取得するオブジェクトキーです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<Uint8Array<ArrayBufferLike> | null> - Description: ダウンロードされたバイト列です。オブジェクトが存在しない場合はnullです。
例外 (Throws)
Section titled “例外 (Throws)”メソッドで false/null へのフォールバックが明記されていない限り、署名、ネットワーク、または成功を示さないバックエンドのレスポンスに対して拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { OCIStorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: OCIStorageAdapter) { return storage.download("reports/note.txt");}---
### `FUNCTION` `storage.OCIStorageAdapter.getUploadUrl`
直接HTTP PUTでアップロードするためのURLに署名します。
```typescriptasync getUploadUrl(key: string, options?: Pick<StorageURLOptions, 'expiresIn'>): Promise<string>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - 保存先オブジェクトキーです。 |
options |
Pick<StorageURLOptions, "expiresIn"> | undefined |
任意 | - 任意の有効期間(秒)です。デフォルトは設定値または3600で、有効範囲は1–604800です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<string> - Description: 署名付きPUT URLです。この呼び出しではオブジェクトはアップロードされません。
例外 (Throws)
Section titled “例外 (Throws)”有効期間が無効(1–604800の整数秒の範囲外)な場合、またはエンドポイント設定が不正な場合に拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { OCIStorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: OCIStorageAdapter) { return storage.getUploadUrl("reports/note.txt", { expiresIn: 300 });}---
### `FUNCTION` `storage.OCIStorageAdapter.getDownloadUrl`
HTTP GETによるダウンロード用のURLに署名します。
```typescriptasync getDownloadUrl(key: string, options?: StorageURLOptions): Promise<string>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - 取得するオブジェクトキーです。 |
options |
StorageURLOptions | undefined |
任意 | - 省略可能な秒単位の有効期間(1–604800)とダウンロードファイル名です。署名は常に行います。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<string> - Description: 署名付き GET URL です。この呼び出しではオブジェクトを取得しません。
例外 (Throws)
Section titled “例外 (Throws)”有効期間が無効(1–604800の整数秒の範囲外)な場合、またはエンドポイント設定が不正な場合に拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { OCIStorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: OCIStorageAdapter) { return storage.getDownloadUrl("reports/note.txt", { expiresIn: 300 });}---
### `FUNCTION` `storage.OCIStorageAdapter.getUrl`
指定したオブジェクトキーを読み取るためのURLを構築します。
```typescriptasync getUrl(key: string, options?: StorageURLOptions): Promise<string>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - 対象とするオブジェクトキーです。 |
options |
StorageURLOptions | undefined |
任意 | - 省略可能な有効期間とダウンロードファイル名です。リモート署名はデフォルトで有効です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<string> - Description: URL 文字列です。生成時にオブジェクトの存在やアクセスポリシーは確認しません。
例外 (Throws)
Section titled “例外 (Throws)”有効期間が無効(1–604800の整数秒の範囲外)な場合、またはエンドポイント設定が不正な場合に拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { OCIStorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: OCIStorageAdapter) { return storage.getUrl("reports/note.txt", { expiresIn: 300 });}---
### `FUNCTION` `storage.OCIStorageAdapter.delete`
オブジェクトキーの削除を要求します。
```typescriptasync delete(key: string): Promise<boolean>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - 削除するオブジェクトキーです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<boolean> - Description: 削除が確認されたかどうかです。捕捉されたトランスポート障害の場合もfalseになります。
補足 (Remarks)
Section titled “補足 (Remarks)”バージョン管理されたストレージでは、保持されている特定のバージョンではなく、キーを削除します。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { OCIStorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: OCIStorageAdapter) { return storage.delete("reports/note.txt");}---
### `FUNCTION` `storage.OCIStorageAdapter.exists`
オブジェクトのメタデータを取得できるかどうかを確認します。
```typescriptasync exists(key: string): Promise<boolean>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - 調べるオブジェクトキーです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<boolean> - Description: メタデータの検索でキーが見つかった場合はtrue、存在しない場合はfalseです。
例外 (Throws)
Section titled “例外 (Throws)”メソッドで false/null へのフォールバックが明記されていない限り、署名、ネットワーク、または成功を示さないバックエンドのレスポンスに対して拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { OCIStorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: OCIStorageAdapter) { return storage.exists("reports/note.txt");}---
### `FUNCTION` `storage.OCIStorageAdapter.head`
オブジェクト本体をダウンロードせずにメタデータを取得します。
```typescriptasync head(key: string): Promise<StorageObject | null>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - 調べるオブジェクトキーです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<StorageObject | null> - Description: オブジェクトのメタデータです。キーが存在しない場合はnullです。
例外 (Throws)
Section titled “例外 (Throws)”メソッドで false/null へのフォールバックが明記されていない限り、署名、ネットワーク、または成功を示さないバックエンドのレスポンスに対して拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { OCIStorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: OCIStorageAdapter) { return storage.head("reports/note.txt");}---
### `FUNCTION` `storage.OCIStorageAdapter.list`
オブジェクトキーと任意の共通プレフィックスを、プロバイダーの1ページ分取得します。
```typescriptasync list(options?: StorageListOptions): Promise<StorageListResult>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
options |
StorageListOptions | undefined |
任意 | - 任意のプレフィックス、区切り文字、ページ件数上限、継続トークンです。上限が未指定またはゼロの場合は1000を使用します。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<StorageListResult> - Description: プロバイダーの継続状態を含むオブジェクトとプレフィックスです。includeMetadataは無視されます。
例外 (Throws)
Section titled “例外 (Throws)”メソッドで false/null へのフォールバックが明記されていない限り、署名、ネットワーク、または成功を示さないバックエンドのレスポンスに対して拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { OCIStorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: OCIStorageAdapter) { return storage.list({ prefix: "reports/", limit: 100 });}---
### `FUNCTION` `storage.OCIStorageAdapter.copy`
オブジェクトをコピー先キーにコピーします。
```typescriptasync copy(sourceKey: string, destinationKey: string): Promise<StorageObject>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
sourceKey |
string |
必須 | - 既存のコピー元オブジェクトキーです。 |
destinationKey |
string |
必須 | - 作成または上書きするコピー先キーです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<StorageObject> - Description: コピー先を確認するメタデータです。同じキーへのコピーの場合はコピー元のメタデータです。
例外 (Throws)
Section titled “例外 (Throws)”メソッドで false/null へのフォールバックが明記されていない限り、署名、ネットワーク、または成功を示さないバックエンドのレスポンスに対して拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { OCIStorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: OCIStorageAdapter) { return storage.copy("reports/note.txt", "archive/note.txt");}---
### `FUNCTION` `storage.OCIStorageAdapter.move`
オブジェクトをコピーしてから、コピー元キーを削除します。
```typescriptasync move(sourceKey: string, destinationKey: string): Promise<StorageObject>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
sourceKey |
string |
必須 | - 既存のコピー元オブジェクトキーです。 |
destinationKey |
string |
必須 | - 作成または上書きするコピー先キーです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<StorageObject> - Description: 移動元の削除後の移動先メタデータです。同じキーへの移動の場合は既存のメタデータです。
補足 (Remarks)
Section titled “補足 (Remarks)”コピーと削除は別々の操作です。失敗すると、コピー元とコピー先の両方が残る場合があります。リモートでの削除は、バケットのバージョン管理と保持設定によって制御されます。
例外 (Throws)
Section titled “例外 (Throws)”コピーエラー、同一キーのコピー元の欠如、またはコピー後のコピー元削除の失敗に対して拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { OCIStorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: OCIStorageAdapter) { return storage.move("reports/note.txt", "archive/note.txt");}---
### `CONST` `storage.OCIUploadOptions.hash`
事前計算済みのSHA-256ハッシュです。
```typescriptexport const storage.OCIUploadOptions.hash: string | undefinedCONST storage.OCIUploadOptions.retentionUntilDate
Section titled “CONST storage.OCIUploadOptions.retentionUntilDate”Object Lock(保持ルール)の保持期限日です。
export const storage.OCIUploadOptions.retentionUntilDate: Date | undefinedCONST storage.StorageObject.key
Section titled “CONST storage.StorageObject.key”一意のオブジェクトキー(パス)です。
export const storage.StorageObject.key: stringCONST storage.StorageObject.size
Section titled “CONST storage.StorageObject.size”バイト単位のファイルサイズです。
export const storage.StorageObject.size: number | undefinedCONST storage.StorageObject.contentType
Section titled “CONST storage.StorageObject.contentType”MIMEタイプです。
export const storage.StorageObject.contentType: string | undefinedCONST storage.StorageObject.lastModified
Section titled “CONST storage.StorageObject.lastModified”最終更新タイムスタンプです。
export const storage.StorageObject.lastModified: Date | undefinedCONST storage.StorageObject.etag
Section titled “CONST storage.StorageObject.etag”キャッシュとバージョン管理に使用するETagです。
export const storage.StorageObject.etag: string | undefinedCONST storage.StorageObject.metadata
Section titled “CONST storage.StorageObject.metadata”カスタムメタデータのキーと値のペアです。
export const storage.StorageObject.metadata: Record<string, string> | undefinedCONST storage.StorageUploadOptions.contentType
Section titled “CONST storage.StorageUploadOptions.contentType”送信するMIMEタイプです。省略時に拡張子から推測するのはLocalStorageAdapterのみです。
export const storage.StorageUploadOptions.contentType: string | undefinedCONST storage.StorageUploadOptions.metadata
Section titled “CONST storage.StorageUploadOptions.metadata”リモートアダプターが転送するカスタムメタデータです。LocalStorageAdapterでは無視されます。
export const storage.StorageUploadOptions.metadata: Record<string, string> | undefinedCONST storage.StorageUploadOptions.cacheControl
Section titled “CONST storage.StorageUploadOptions.cacheControl”リモートアダプターが転送するCache-Control値です。LocalStorageAdapterでは無視されます。
export const storage.StorageUploadOptions.cacheControl: string | undefinedCONST storage.StorageUploadOptions.public
Section titled “CONST storage.StorageUploadOptions.public”予約済みのアクセスヒントです。提供されるすべてのアダプターで無視され、trueでもfalseでもアクセスポリシーは変わりません。
export const storage.StorageUploadOptions.public: boolean | undefinedCONST storage.StorageURLOptions.expiresIn
Section titled “CONST storage.StorageURLOptions.expiresIn”署名付きURLの有効期間(秒)です。
export const storage.StorageURLOptions.expiresIn: number | undefinedCONST storage.StorageURLOptions.downloadFilename
Section titled “CONST storage.StorageURLOptions.downloadFilename”強制ダウンロード時の添付ファイル名です。
export const storage.StorageURLOptions.downloadFilename: string | undefinedCONST storage.StorageURLOptions.signed
Section titled “CONST storage.StorageURLOptions.signed”署名付きURLを生成するかどうかです(デフォルト: 非公開オブジェクトではtrueです)。
export const storage.StorageURLOptions.signed: boolean | undefinedCONST storage.StorageListOptions.prefix
Section titled “CONST storage.StorageListOptions.prefix”オブジェクトを絞り込むプレフィックスです。
export const storage.StorageListOptions.prefix: string | undefinedCONST storage.StorageListOptions.delimiter
Section titled “CONST storage.StorageListOptions.delimiter”区切り文字です(階層的なディレクトリ一覧では’/’など)。
export const storage.StorageListOptions.delimiter: string | undefinedCONST storage.StorageListOptions.limit
Section titled “CONST storage.StorageListOptions.limit”プロバイダーの一覧件数上限です。ローカルストレージではオブジェクトとプレフィックスを合算します(デフォルト1000)。
export const storage.StorageListOptions.limit: number | undefinedCONST storage.StorageListOptions.cursor
Section titled “CONST storage.StorageListOptions.cursor”プロバイダーの継続トークンです。LocalStorageAdapterでは無視されます。
export const storage.StorageListOptions.cursor: string | undefinedCONST storage.StorageListOptions.includeMetadata
Section titled “CONST storage.StorageListOptions.includeMetadata”プロバイダーへのメタデータ要求です。ローカルストレージではこれを無視し、常にファイルのメタデータを含めます。
export const storage.StorageListOptions.includeMetadata: boolean | undefinedCONST storage.StorageListResult.objects
Section titled “CONST storage.StorageListResult.objects”ストレージオブジェクトの配列です。
export const storage.StorageListResult.objects: StorageObject[]CONST storage.StorageListResult.prefixes
Section titled “CONST storage.StorageListResult.prefixes”共通プレフィックス(サブディレクトリ)の配列です。
export const storage.StorageListResult.prefixes: string[] | undefinedCONST storage.StorageListResult.nextCursor
Section titled “CONST storage.StorageListResult.nextCursor”サポートされ、返された場合のプロバイダーの継続トークンです。存在しないだけでは、全件取得済みとは保証されません。
export const storage.StorageListResult.nextCursor: string | undefinedCONST storage.StorageListResult.hasMore
Section titled “CONST storage.StorageListResult.hasMore”プロバイダーの継続有無の指標です。ローカルストレージでは、一覧件数上限に達したかどうかだけを報告します。
export const storage.StorageListResult.hasMore: booleanFUNCTION storage.StorageAdapter.upload
Section titled “FUNCTION storage.StorageAdapter.upload”ストレージにファイルをアップロードします。
upload( key: string, data: Uint8Array | Blob | ReadableStream | string, options?: StorageUploadOptions, ): Promise<StorageObject>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - オブジェクトキー(パス)です。 |
data |
string | Uint8Array<ArrayBufferLike> | Blob | ReadableStream<any> |
必須 | - ファイルデータです(Uint8Array、Blob、ReadableStream、または文字列)。 |
options |
StorageUploadOptions | undefined |
任意 | - アダプター固有の設定です。MIMEとアクセスポリシーの制限については{@link StorageUploadOptions}を参照してください。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<StorageObject> - Description: アップロードされたオブジェクトについて、選択したアダプターが報告するメタデータです。
補足 (Remarks)
Section titled “補足 (Remarks)”永続化とアクセス制御はホストが設定します。public オプションは、 付属のどのアダプターでもアクセスポリシーを変更しません。
例外 (Throws)
Section titled “例外 (Throws)”選択されたアダプターがアップロードを拒否した場合に拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { StorageAdapter } from '@alneas/appkit-core/storage';
export async function saveInvoice(storage: StorageAdapter, pdfBuffer: Uint8Array) { return storage.upload('invoices/2026/inv-001.pdf', pdfBuffer, { contentType: 'application/pdf', });}---
### `FUNCTION` `storage.StorageAdapter.download`
ストレージからファイルをダウンロードします。
```typescriptdownload(key: string): Promise<Uint8Array | null>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - オブジェクトキー(パス)です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<Uint8Array<ArrayBufferLike> | null> - Description: Uint8Array形式のファイルデータです。見つからない場合はnullです。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { StorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: StorageAdapter) { return storage.download("reports/note.txt");}---
### `FUNCTION` `storage.StorageAdapter.getUrl`
オブジェクトにアクセスするためのURLを取得します。
```typescriptgetUrl(key: string, options?: StorageURLOptions): Promise<string>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - オブジェクトキー(パス)です。 |
options |
StorageURLOptions | undefined |
任意 | - URL生成オプションです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<string> - Description: URL文字列です(オプションに応じて署名付きまたは公開URLになります)。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { StorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: StorageAdapter) { return storage.getUrl("reports/note.txt", { expiresIn: 300 });}---
### `FUNCTION` `storage.StorageAdapter.getUploadUrl`
直接HTTP PUTでアップロードするためのURLに署名します。
```typescriptgetUploadUrl?(key: string, options?: Pick<StorageURLOptions, 'expiresIn'>): Promise<string>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - 保存先オブジェクトキーです。 |
options |
Pick<StorageURLOptions, "expiresIn"> | undefined |
任意 | - 任意の有効期間(秒)です。デフォルトは設定値または3600で、有効範囲は1–604800です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<string> - Description: 署名付きPUT URLです。この呼び出しではオブジェクトはアップロードされません。
例外 (Throws)
Section titled “例外 (Throws)”指定されたアダプターが操作を拒否した場合に拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { StorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: StorageAdapter) { return storage.getUploadUrl?.("reports/note.txt", { expiresIn: 300 });}---
### `FUNCTION` `storage.StorageAdapter.getDownloadUrl`
HTTP GETによるダウンロード用のURLに署名します。
```typescriptgetDownloadUrl?(key: string, options?: StorageURLOptions): Promise<string>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - 取得するオブジェクトキーです。 |
options |
StorageURLOptions | undefined |
任意 | - 省略可能な秒単位の有効期間(1–604800)とダウンロードファイル名です。署名は常に行います。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<string> - Description: 署名付き GET URL です。この呼び出しではオブジェクトを取得しません。
例外 (Throws)
Section titled “例外 (Throws)”指定されたアダプターが操作を拒否した場合に拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { StorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: StorageAdapter) { return storage.getDownloadUrl?.("reports/note.txt", { expiresIn: 300 });}---
### `FUNCTION` `storage.StorageAdapter.delete`
ストレージからオブジェクトを削除します。
```typescriptdelete(key: string): Promise<boolean>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - オブジェクトキー(パス)です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<boolean> - Description: 削除に成功した場合はtrue、オブジェクトが存在しなかった場合はfalseです。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { StorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: StorageAdapter) { return storage.delete("reports/note.txt");}---
### `FUNCTION` `storage.StorageAdapter.exists`
ストレージにオブジェクトが存在するかどうかを確認します。
```typescriptexists(key: string): Promise<boolean>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - オブジェクトキー(パス)です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<boolean> - Description: オブジェクトが存在する場合はtrueです。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { StorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: StorageAdapter) { return storage.exists("reports/note.txt");}---
### `FUNCTION` `storage.StorageAdapter.head`
内容をダウンロードせずにオブジェクトのメタデータを取得します。
```typescripthead(key: string): Promise<StorageObject | null>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - オブジェクトキー(パス)です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<StorageObject | null> - Description: オブジェクトのメタデータです。見つからない場合はnullです。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { StorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: StorageAdapter) { return storage.head("reports/note.txt");}---
### `FUNCTION` `storage.StorageAdapter.list`
ストレージ内のオブジェクトを一覧表示します。
```typescriptlist(options?: StorageListOptions): Promise<StorageListResult>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
options |
StorageListOptions | undefined |
任意 | - プロバイダー固有のフィルターと上限です。オプションを省略すると、アダプターのデフォルトを使用します。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<StorageListResult> - Description: オブジェクト、任意のプレフィックス、プロバイダー固有の継続情報です。{@link StorageListResult}を参照してください。
補足 (Remarks)
Section titled “補足 (Remarks)”LocalStorageAdapter は cursor を無視し、nextCursor を返しません。 hasMore は上限に達したことを示すため、ページネーションループの継続判定には使用できません。
例外 (Throws)
Section titled “例外 (Throws)”選択されたアダプターが一覧取得リクエストを拒否した場合に拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { StorageAdapter } from '@alneas/appkit-core/storage';
export async function firstInvoicePage(storage: StorageAdapter) { return storage.list({ prefix: 'invoices/2026/', limit: 50 });}---
### `FUNCTION` `storage.StorageAdapter.copy`
オブジェクトを新しいキーにコピーします。
```typescriptcopy?(sourceKey: string, destinationKey: string): Promise<StorageObject>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
sourceKey |
string |
必須 | - コピー元オブジェクトキーです。 |
destinationKey |
string |
必須 | - コピー先オブジェクトキーです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<StorageObject> - Description: コピーされたオブジェクトのメタデータです。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { StorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: StorageAdapter) { return storage.copy?.("reports/note.txt", "archive/note.txt");}---
### `FUNCTION` `storage.StorageAdapter.move`
オブジェクトを新しいキーに移動します(コピーと削除)。
```typescriptmove?(sourceKey: string, destinationKey: string): Promise<StorageObject>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
sourceKey |
string |
必須 | - コピー元オブジェクトキーです。 |
destinationKey |
string |
必須 | - コピー先オブジェクトキーです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<StorageObject> - Description: 移動されたオブジェクトのメタデータです。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { StorageAdapter } from '@alneas/appkit-core/storage';
export async function example(storage: StorageAdapter) { return storage.move?.("reports/note.txt", "archive/note.txt");}---
### `CONST` `storage.LocalStorageConfig.baseDir`
ストレージのベースディレクトリです。
```typescriptexport const storage.LocalStorageConfig.baseDir: stringCONST storage.LocalStorageConfig.baseUrl
Section titled “CONST storage.LocalStorageConfig.baseUrl”公開URLを生成するためのベースURLです(任意)。
export const storage.LocalStorageConfig.baseUrl: string | undefinedCONST storage.R2StorageConfig.region
Section titled “CONST storage.R2StorageConfig.region”カスタムS3互換エンドポイントの署名リージョンです。デフォルトはR2のautoです。
export const storage.R2StorageConfig.region: string | undefinedCONST storage.R2StorageConfig.accountId
Section titled “CONST storage.R2StorageConfig.accountId”CloudflareアカウントIDです。
export const storage.R2StorageConfig.accountId: stringCONST storage.R2StorageConfig.bucket
Section titled “CONST storage.R2StorageConfig.bucket”R2バケット名です。
export const storage.R2StorageConfig.bucket: stringCONST storage.R2StorageConfig.accessKeyId
Section titled “CONST storage.R2StorageConfig.accessKeyId”署名付きリモートリクエストに含める、ホスト提供の認証情報識別子です。
export const storage.R2StorageConfig.accessKeyId: stringCONST storage.R2StorageConfig.secretAccessKey
Section titled “CONST storage.R2StorageConfig.secretAccessKey”ホストが提供する署名用シークレットです。信頼できないクライアントコードの外部で管理してください。
export const storage.R2StorageConfig.secretAccessKey: stringCONST storage.R2StorageConfig.endpoint
Section titled “CONST storage.R2StorageConfig.endpoint”カスタムエンドポイントURLです(任意。accountIdから自動的に導出します)。
export const storage.R2StorageConfig.endpoint: string | undefinedCONST storage.R2StorageConfig.publicUrl
Section titled “CONST storage.R2StorageConfig.publicUrl”署名なしのアクセス用の公開バケットURLです(任意)。
export const storage.R2StorageConfig.publicUrl: string | undefinedCONST storage.R2StorageConfig.defaultExpiresIn
Section titled “CONST storage.R2StorageConfig.defaultExpiresIn”署名付きURLのデフォルト有効期間(秒)です(デフォルト: 3600)。
export const storage.R2StorageConfig.defaultExpiresIn: number | undefinedCONST storage.S3StorageConfig.region
Section titled “CONST storage.S3StorageConfig.region”AWSリージョンです。
export const storage.S3StorageConfig.region: stringCONST storage.S3StorageConfig.bucket
Section titled “CONST storage.S3StorageConfig.bucket”S3バケット名です。
export const storage.S3StorageConfig.bucket: stringCONST storage.S3StorageConfig.accessKeyId
Section titled “CONST storage.S3StorageConfig.accessKeyId”署名付きリモートリクエストに含める、ホスト提供の認証情報識別子です。
export const storage.S3StorageConfig.accessKeyId: stringCONST storage.S3StorageConfig.secretAccessKey
Section titled “CONST storage.S3StorageConfig.secretAccessKey”ホストが提供する署名用シークレットです。信頼できないクライアントコードの外部で管理してください。
export const storage.S3StorageConfig.secretAccessKey: stringCONST storage.S3StorageConfig.endpoint
Section titled “CONST storage.S3StorageConfig.endpoint”カスタムエンドポイントURLです(任意。LocalStackなど)。
export const storage.S3StorageConfig.endpoint: string | undefinedCONST storage.S3StorageConfig.objectLockEnabled
Section titled “CONST storage.S3StorageConfig.objectLockEnabled”Object Lockを有効にするかどうかです(デフォルト: false)。
export const storage.S3StorageConfig.objectLockEnabled: boolean | undefinedCONST storage.S3StorageConfig.objectLockMode
Section titled “CONST storage.S3StorageConfig.objectLockMode”Object Lockの保持モードです(デフォルト: COMPLIANCE)。
export const storage.S3StorageConfig.objectLockMode: "GOVERNANCE" | "COMPLIANCE" | undefinedCONST storage.S3StorageConfig.defaultRetentionDays
Section titled “CONST storage.S3StorageConfig.defaultRetentionDays”デフォルトの保持期間(日)です(デフォルト: 2555日 = 7年)。
export const storage.S3StorageConfig.defaultRetentionDays: number | undefinedCONST storage.S3StorageConfig.defaultExpiresIn
Section titled “CONST storage.S3StorageConfig.defaultExpiresIn”署名付きURLのデフォルト有効期間(秒)です(デフォルト: 3600)。
export const storage.S3StorageConfig.defaultExpiresIn: number | undefinedCONST storage.OCIStorageConfig.namespace
Section titled “CONST storage.OCIStorageConfig.namespace”OCIテナントの名前空間です。
export const storage.OCIStorageConfig.namespace: stringCONST storage.OCIStorageConfig.region
Section titled “CONST storage.OCIStorageConfig.region”OCIリージョンです(ap-tokyo-1など)。
export const storage.OCIStorageConfig.region: stringCONST storage.OCIStorageConfig.bucket
Section titled “CONST storage.OCIStorageConfig.bucket”バケット名です。
export const storage.OCIStorageConfig.bucket: stringCONST storage.OCIStorageConfig.accessKeyId
Section titled “CONST storage.OCIStorageConfig.accessKeyId”署名付きリモートリクエストに含める、ホスト提供の認証情報識別子です。
export const storage.OCIStorageConfig.accessKeyId: stringCONST storage.OCIStorageConfig.secretAccessKey
Section titled “CONST storage.OCIStorageConfig.secretAccessKey”ホストが提供する署名用シークレットです。信頼できないクライアントコードの外部で管理してください。
export const storage.OCIStorageConfig.secretAccessKey: stringCONST storage.OCIStorageConfig.endpoint
Section titled “CONST storage.OCIStorageConfig.endpoint”カスタムエンドポイントURLです(任意)。
export const storage.OCIStorageConfig.endpoint: string | undefinedCONST storage.OCIStorageConfig.objectLockEnabled
Section titled “CONST storage.OCIStorageConfig.objectLockEnabled”Object Lockを有効にするかどうかです(デフォルト: false)。
export const storage.OCIStorageConfig.objectLockEnabled: boolean | undefinedCONST storage.OCIStorageConfig.objectLockMode
Section titled “CONST storage.OCIStorageConfig.objectLockMode”Object Lockの保持モード(デフォルト: GOVERNANCE)。
- COMPLIANCE: 保持期間中は、管理者を含むすべてのユーザーがオブジェクトを削除できません。解約後もデータが保持されるリスクがあります。
- GOVERNANCE: 管理権限を持つユーザーはオブジェクトを削除できます。法令遵守のために内部管理規則が必要です。
export const storage.OCIStorageConfig.objectLockMode: "GOVERNANCE" | "COMPLIANCE" | undefinedCONST storage.OCIStorageConfig.defaultRetentionDays
Section titled “CONST storage.OCIStorageConfig.defaultRetentionDays”デフォルトの保持期間(日)です(デフォルト: 2555日 = 7年)。
export const storage.OCIStorageConfig.defaultRetentionDays: number | undefinedCONST storage.OCIStorageConfig.defaultExpiresIn
Section titled “CONST storage.OCIStorageConfig.defaultExpiresIn”署名付きURLのデフォルト有効期間(秒)です(デフォルト: 3600)。
export const storage.OCIStorageConfig.defaultExpiresIn: number | undefinedCONST data.csv.CSVParseConfig.delimiter
Section titled “CONST data.csv.CSVParseConfig.delimiter”区切り文字(デフォルト: ,)
export const data.csv.CSVParseConfig.delimiter: stringCONST data.csv.CSVParseConfig.quoteChar
Section titled “CONST data.csv.CSVParseConfig.quoteChar”引用符(デフォルト: “)
export const data.csv.CSVParseConfig.quoteChar: stringCONST data.csv.CSVParseConfig.escapeChar
Section titled “CONST data.csv.CSVParseConfig.escapeChar”エスケープ文字(デフォルト: “)
export const data.csv.CSVParseConfig.escapeChar: stringCONST data.csv.CSVParseConfig.hasHeader
Section titled “CONST data.csv.CSVParseConfig.hasHeader”CSVにヘッダー行が含まれるかどうか(互換性のため、trueでも結果にはヘッダー行が含まれます)
export const data.csv.CSVParseConfig.hasHeader: booleanCONST data.csv.CSVParseConfig.skipEmptyLines
Section titled “CONST data.csv.CSVParseConfig.skipEmptyLines”空行をスキップするかどうか
export const data.csv.CSVParseConfig.skipEmptyLines: booleanCONST data.csv.CSVParseConfig.trimWhitespace
Section titled “CONST data.csv.CSVParseConfig.trimWhitespace”値の前後の空白を除去するかどうか
export const data.csv.CSVParseConfig.trimWhitespace: booleanFUNCTION data.csv.CSVParser.parse
Section titled “FUNCTION data.csv.CSVParser.parse”CSV文字列を解析し、各行の文字列値からなる2次元配列に変換します。
parse(csvContent: string): string[][]引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
csvContent |
string |
必須 | 解析するCSVテキストの内容 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string[][] - Description: 解析された行レコードのリスト(各行は文字列の配列です)
例外 (Throws)
Section titled “例外 (Throws)”引用符が閉じられていないなど、CSV形式が無効な場合
CONST data.csv.CSVConfig.delimiter
Section titled “CONST data.csv.CSVConfig.delimiter”区切り文字(デフォルト: ,)
export const data.csv.CSVConfig.delimiter: stringCONST data.csv.CSVConfig.quoteChar
Section titled “CONST data.csv.CSVConfig.quoteChar”引用符(1文字、デフォルト: “)
export const data.csv.CSVConfig.quoteChar: stringCONST data.csv.CSVConfig.escapeChar
Section titled “CONST data.csv.CSVConfig.escapeChar”引用符をエスケープするための文字(1文字、デフォルト: “)
export const data.csv.CSVConfig.escapeChar: stringCONST data.csv.CSVConfig.includeHeader
Section titled “CONST data.csv.CSVConfig.includeHeader”出力にヘッダー行を含めるかどうか
export const data.csv.CSVConfig.includeHeader: booleanCONST data.csv.CSVConfig.stringWrapping
Section titled “CONST data.csv.CSVConfig.stringWrapping”’never’では、引用符で囲む必要がある値に対して例外をスローします。数式の安全性を確保するための引用符付加が優先されます。
export const data.csv.CSVConfig.stringWrapping: "auto" | "always" | "never"CONST data.csv.CSVConfig.escapeFormulae
Section titled “CONST data.csv.CSVConfig.escapeFormulae”数式のような文字列(ヘッダーを含みます)の先頭にアポストロフィを付加します。デフォルトはfalseです。元の値を変更します。
export const data.csv.CSVConfig.escapeFormulae: boolean | undefinedCONST data.csv.CSVConfig.dateLocale
Section titled “CONST data.csv.CSVConfig.dateLocale”Dateセルのロケールです。undefinedの場合はホストのロケールを使用します。
export const data.csv.CSVConfig.dateLocale: string | undefinedCONST data.csv.CSVConfig.dateOptions
Section titled “CONST data.csv.CSVConfig.dateOptions”Intlの日付オプションです。再現性が重要な場合は、タイムゾーンの明示的な指定も含めます。
export const data.csv.CSVConfig.dateOptions: Intl.DateTimeFormatOptions | undefinedCONST data.csv.CSVConfig.dateFormatter
Section titled “CONST data.csv.CSVConfig.dateFormatter”Dateセルの書式設定を上書きします(例: システム間でのデータ交換用のISO文字列)。
export const data.csv.CSVConfig.dateFormatter: ((value: Date) => string) | undefinedCONST data.csv.ColumnMapping.columnId
Section titled “CONST data.csv.ColumnMapping.columnId”エクスポートされるシンボル data.csv.ColumnMapping.columnId
export const data.csv.ColumnMapping.columnId: stringCONST data.csv.ColumnMapping.columnLabel
Section titled “CONST data.csv.ColumnMapping.columnLabel”エクスポートされるシンボル data.csv.ColumnMapping.columnLabel
export const data.csv.ColumnMapping.columnLabel: stringCONST data.csv.ColumnMapping.include
Section titled “CONST data.csv.ColumnMapping.include”エクスポートされるシンボル data.csv.ColumnMapping.include
export const data.csv.ColumnMapping.include: booleanCONST data.csv.ColumnMapping.order
Section titled “CONST data.csv.ColumnMapping.order”エクスポートされるシンボル data.csv.ColumnMapping.order
export const data.csv.ColumnMapping.order: numberCONST data.csv.ColumnMapping.customLabel
Section titled “CONST data.csv.ColumnMapping.customLabel”エクスポートされるシンボル data.csv.ColumnMapping.customLabel
export const data.csv.ColumnMapping.customLabel: string | undefinedFUNCTION data.csv.CSVGenerator.generate
Section titled “FUNCTION data.csv.CSVGenerator.generate”関数 data.csv.CSVGenerator.generate
generate<TData>( data: TData[], columns: Array<Record<string, unknown>>, columnMappings: ColumnMapping[], ): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
data |
TData[] |
必須 | エクスポートするデータレコード |
columns |
Record<string, unknown>[] |
必須 | 列定義(id/accessorKey) |
columnMappings |
ColumnMapping[] |
必須 | エクスポート対象、ラベル、順序 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: CSV文字列です。互換性のため、改行はLFで、BOMは付加しません。
例外 (Throws)
Section titled “例外 (Throws)”引用符で囲むことが禁止されているにもかかわらず、フィールドを引用符で囲む必要がある場合
CONST data.pdf.DocumentPartyInfo.companyName
Section titled “CONST data.pdf.DocumentPartyInfo.companyName”エクスポートされるシンボル data.pdf.DocumentPartyInfo.companyName
export const data.pdf.DocumentPartyInfo.companyName: stringCONST data.pdf.DocumentPartyInfo.contactPerson
Section titled “CONST data.pdf.DocumentPartyInfo.contactPerson”エクスポートされるシンボル data.pdf.DocumentPartyInfo.contactPerson
export const data.pdf.DocumentPartyInfo.contactPerson: string | undefinedCONST data.pdf.DocumentPartyInfo.address
Section titled “CONST data.pdf.DocumentPartyInfo.address”エクスポートされるシンボル data.pdf.DocumentPartyInfo.address
export const data.pdf.DocumentPartyInfo.address: stringCONST data.pdf.DocumentPartyInfo.zip
Section titled “CONST data.pdf.DocumentPartyInfo.zip”エクスポートされるシンボル data.pdf.DocumentPartyInfo.zip
export const data.pdf.DocumentPartyInfo.zip: string | undefinedCONST data.pdf.DocumentPartyInfo.tel
Section titled “CONST data.pdf.DocumentPartyInfo.tel”エクスポートされるシンボル data.pdf.DocumentPartyInfo.tel
export const data.pdf.DocumentPartyInfo.tel: string | undefinedCONST data.pdf.DocumentPartyInfo.fax
Section titled “CONST data.pdf.DocumentPartyInfo.fax”エクスポートされるシンボル data.pdf.DocumentPartyInfo.fax
export const data.pdf.DocumentPartyInfo.fax: string | undefinedCONST data.pdf.DocumentPartyInfo.email
Section titled “CONST data.pdf.DocumentPartyInfo.email”エクスポートされるシンボル data.pdf.DocumentPartyInfo.email
export const data.pdf.DocumentPartyInfo.email: string | undefinedCONST data.pdf.DocumentLineItem.name
Section titled “CONST data.pdf.DocumentLineItem.name”エクスポートされるシンボル data.pdf.DocumentLineItem.name
export const data.pdf.DocumentLineItem.name: stringCONST data.pdf.DocumentLineItem.code
Section titled “CONST data.pdf.DocumentLineItem.code”エクスポートされるシンボル data.pdf.DocumentLineItem.code
export const data.pdf.DocumentLineItem.code: string | undefinedCONST data.pdf.DocumentLineItem.specification
Section titled “CONST data.pdf.DocumentLineItem.specification”エクスポートされるシンボル data.pdf.DocumentLineItem.specification
export const data.pdf.DocumentLineItem.specification: string | undefinedCONST data.pdf.DocumentLineItem.quantity
Section titled “CONST data.pdf.DocumentLineItem.quantity”エクスポートされるシンボル data.pdf.DocumentLineItem.quantity
export const data.pdf.DocumentLineItem.quantity: numberCONST data.pdf.DocumentLineItem.unitCode
Section titled “CONST data.pdf.DocumentLineItem.unitCode”エクスポートされるシンボル data.pdf.DocumentLineItem.unitCode
export const data.pdf.DocumentLineItem.unitCode: stringCONST data.pdf.DocumentLineItem.unitPrice
Section titled “CONST data.pdf.DocumentLineItem.unitPrice”エクスポートされるシンボル data.pdf.DocumentLineItem.unitPrice
export const data.pdf.DocumentLineItem.unitPrice: numberCONST data.pdf.DocumentLineItem.amount
Section titled “CONST data.pdf.DocumentLineItem.amount”エクスポートされるシンボル data.pdf.DocumentLineItem.amount
export const data.pdf.DocumentLineItem.amount: numberCONST data.pdf.DocumentLineItem.remarks
Section titled “CONST data.pdf.DocumentLineItem.remarks”エクスポートされるシンボル data.pdf.DocumentLineItem.remarks
export const data.pdf.DocumentLineItem.remarks: string | undefinedCONST data.pdf.BankAccountInfo.bankName
Section titled “CONST data.pdf.BankAccountInfo.bankName”エクスポートされるシンボル data.pdf.BankAccountInfo.bankName
export const data.pdf.BankAccountInfo.bankName: stringCONST data.pdf.BankAccountInfo.branchName
Section titled “CONST data.pdf.BankAccountInfo.branchName”エクスポートされるシンボル data.pdf.BankAccountInfo.branchName
export const data.pdf.BankAccountInfo.branchName: stringCONST data.pdf.BankAccountInfo.accountType
Section titled “CONST data.pdf.BankAccountInfo.accountType”エクスポートされるシンボル data.pdf.BankAccountInfo.accountType
export const data.pdf.BankAccountInfo.accountType: stringCONST data.pdf.BankAccountInfo.accountNumber
Section titled “CONST data.pdf.BankAccountInfo.accountNumber”エクスポートされるシンボル data.pdf.BankAccountInfo.accountNumber
export const data.pdf.BankAccountInfo.accountNumber: stringCONST data.pdf.BankAccountInfo.accountHolder
Section titled “CONST data.pdf.BankAccountInfo.accountHolder”エクスポートされるシンボル data.pdf.BankAccountInfo.accountHolder
export const data.pdf.BankAccountInfo.accountHolder: stringCONST data.pdf.DocumentTableColumn.key
Section titled “CONST data.pdf.DocumentTableColumn.key”エクスポートされるシンボル data.pdf.DocumentTableColumn.key
export const data.pdf.DocumentTableColumn.key: stringCONST data.pdf.DocumentTableColumn.header
Section titled “CONST data.pdf.DocumentTableColumn.header”エクスポートされるシンボル data.pdf.DocumentTableColumn.header
export const data.pdf.DocumentTableColumn.header: stringCONST data.pdf.DocumentTableColumn.width
Section titled “CONST data.pdf.DocumentTableColumn.width”エクスポートされるシンボル data.pdf.DocumentTableColumn.width
export const data.pdf.DocumentTableColumn.width: number | "auto" | "*"CONST data.pdf.DocumentTableColumn.alignment
Section titled “CONST data.pdf.DocumentTableColumn.alignment”エクスポートされるシンボル data.pdf.DocumentTableColumn.alignment
export const data.pdf.DocumentTableColumn.alignment: "center" | "left" | "right" | undefinedCONST data.pdf.BusinessDocumentTemplate.documentType
Section titled “CONST data.pdf.BusinessDocumentTemplate.documentType”エクスポートされるシンボル data.pdf.BusinessDocumentTemplate.documentType
export const data.pdf.BusinessDocumentTemplate.documentType: "quote" | "invoice" | "creditNote" | "order" | "delivery" | "orderConfirmation"CONST data.pdf.BusinessDocumentTemplate.title
Section titled “CONST data.pdf.BusinessDocumentTemplate.title”エクスポートされるシンボル data.pdf.BusinessDocumentTemplate.title
export const data.pdf.BusinessDocumentTemplate.title: stringCONST data.pdf.BusinessDocumentTemplate.leadText
Section titled “CONST data.pdf.BusinessDocumentTemplate.leadText”エクスポートされるシンボル data.pdf.BusinessDocumentTemplate.leadText
export const data.pdf.BusinessDocumentTemplate.leadText: stringCONST data.pdf.BusinessDocumentTemplate.documentNoLabel
Section titled “CONST data.pdf.BusinessDocumentTemplate.documentNoLabel”エクスポートされるシンボル data.pdf.BusinessDocumentTemplate.documentNoLabel
export const data.pdf.BusinessDocumentTemplate.documentNoLabel: stringCONST data.pdf.BusinessDocumentTemplate.dateLabel
Section titled “CONST data.pdf.BusinessDocumentTemplate.dateLabel”エクスポートされるシンボル data.pdf.BusinessDocumentTemplate.dateLabel
export const data.pdf.BusinessDocumentTemplate.dateLabel: stringCONST data.pdf.BusinessDocumentTemplate.dateValueKey
Section titled “CONST data.pdf.BusinessDocumentTemplate.dateValueKey”エクスポートされるシンボル data.pdf.BusinessDocumentTemplate.dateValueKey
export const data.pdf.BusinessDocumentTemplate.dateValueKey: stringCONST data.pdf.BusinessDocumentTemplate.dueLabel
Section titled “CONST data.pdf.BusinessDocumentTemplate.dueLabel”エクスポートされるシンボル data.pdf.BusinessDocumentTemplate.dueLabel
export const data.pdf.BusinessDocumentTemplate.dueLabel: string | undefinedCONST data.pdf.BusinessDocumentTemplate.dueValueKey
Section titled “CONST data.pdf.BusinessDocumentTemplate.dueValueKey”エクスポートされるシンボル data.pdf.BusinessDocumentTemplate.dueValueKey
export const data.pdf.BusinessDocumentTemplate.dueValueKey: string | undefinedCONST data.pdf.BusinessDocumentTemplate.partyRole
Section titled “CONST data.pdf.BusinessDocumentTemplate.partyRole”エクスポートされるシンボル data.pdf.BusinessDocumentTemplate.partyRole
export const data.pdf.BusinessDocumentTemplate.partyRole: "client" | "supplier"CONST data.pdf.BusinessDocumentTemplate.showStaffSeal
Section titled “CONST data.pdf.BusinessDocumentTemplate.showStaffSeal”エクスポートされるシンボル data.pdf.BusinessDocumentTemplate.showStaffSeal
export const data.pdf.BusinessDocumentTemplate.showStaffSeal: boolean | undefinedCONST data.pdf.BusinessDocumentTemplate.showApproverSeal
Section titled “CONST data.pdf.BusinessDocumentTemplate.showApproverSeal”エクスポートされるシンボル data.pdf.BusinessDocumentTemplate.showApproverSeal
export const data.pdf.BusinessDocumentTemplate.showApproverSeal: boolean | undefinedCONST data.pdf.BusinessDocumentTemplate.largeTotalLabel
Section titled “CONST data.pdf.BusinessDocumentTemplate.largeTotalLabel”エクスポートされるシンボル data.pdf.BusinessDocumentTemplate.largeTotalLabel
export const data.pdf.BusinessDocumentTemplate.largeTotalLabel: string | undefinedCONST data.pdf.BusinessDocumentTemplate.summaryFields
Section titled “CONST data.pdf.BusinessDocumentTemplate.summaryFields”エクスポートされるシンボル data.pdf.BusinessDocumentTemplate.summaryFields
export const data.pdf.BusinessDocumentTemplate.summaryFields: { label: string; valueKey: string; formatterType?: "date" | "string" | "paymentTerms" | "expirationDate"; }[] | undefinedCONST data.pdf.BusinessDocumentTemplate.useLegacyInvoiceSummaryTable
Section titled “CONST data.pdf.BusinessDocumentTemplate.useLegacyInvoiceSummaryTable”エクスポートされるシンボル data.pdf.BusinessDocumentTemplate.useLegacyInvoiceSummaryTable
export const data.pdf.BusinessDocumentTemplate.useLegacyInvoiceSummaryTable: boolean | undefinedCONST data.pdf.BusinessDocumentTemplate.tableConfig
Section titled “CONST data.pdf.BusinessDocumentTemplate.tableConfig”エクスポートされるシンボル data.pdf.BusinessDocumentTemplate.tableConfig
export const data.pdf.BusinessDocumentTemplate.tableConfig: { columns?: DocumentTableColumn[]; itemLabel: string; includeCodeInItem?: boolean; remarksHeader?: string; useLegacyInvoiceTableFormat?: boolean; }CONST data.pdf.BusinessDocumentTemplate.bankAccountsKey
Section titled “CONST data.pdf.BusinessDocumentTemplate.bankAccountsKey”エクスポートされるシンボル data.pdf.BusinessDocumentTemplate.bankAccountsKey
export const data.pdf.BusinessDocumentTemplate.bankAccountsKey: string | undefinedCONST data.pdf.BusinessDocumentTemplate.showPaymentMethod
Section titled “CONST data.pdf.BusinessDocumentTemplate.showPaymentMethod”エクスポートされるシンボル data.pdf.BusinessDocumentTemplate.showPaymentMethod
export const data.pdf.BusinessDocumentTemplate.showPaymentMethod: boolean | undefinedCONST data.pdf.BusinessDocumentTemplate.footerNote
Section titled “CONST data.pdf.BusinessDocumentTemplate.footerNote”エクスポートされるシンボル data.pdf.BusinessDocumentTemplate.footerNote
export const data.pdf.BusinessDocumentTemplate.footerNote: string | undefinedCONST data.pdf.BusinessDocumentTemplate.showFooterText
Section titled “CONST data.pdf.BusinessDocumentTemplate.showFooterText”エクスポートされるシンボル data.pdf.BusinessDocumentTemplate.showFooterText
export const data.pdf.BusinessDocumentTemplate.showFooterText: string | undefinedCONST data.pdf.BusinessDocumentConfig.companyInfo
Section titled “CONST data.pdf.BusinessDocumentConfig.companyInfo”エクスポートされるシンボル data.pdf.BusinessDocumentConfig.companyInfo
export const data.pdf.BusinessDocumentConfig.companyInfo: DocumentPartyInfo & { logo?: string; }CONST data.pdf.BusinessDocumentConfig.taxRate
Section titled “CONST data.pdf.BusinessDocumentConfig.taxRate”エクスポートされるシンボル data.pdf.BusinessDocumentConfig.taxRate
export const data.pdf.BusinessDocumentConfig.taxRate: number | undefinedCONST data.pdf.BusinessDocumentConfig.currencyFormatter
Section titled “CONST data.pdf.BusinessDocumentConfig.currencyFormatter”エクスポートされるシンボル data.pdf.BusinessDocumentConfig.currencyFormatter
export const data.pdf.BusinessDocumentConfig.currencyFormatter: ((amount: number) => string) | undefinedCONST data.pdf.BusinessDocumentConfig.dateFormatter
Section titled “CONST data.pdf.BusinessDocumentConfig.dateFormatter”エクスポートされるシンボル data.pdf.BusinessDocumentConfig.dateFormatter
export const data.pdf.BusinessDocumentConfig.dateFormatter: ((date: string, isKanji?: boolean) => string) | undefinedCONST data.pdf.BusinessDocumentConfig.defaultBankAccounts
Section titled “CONST data.pdf.BusinessDocumentConfig.defaultBankAccounts”エクスポートされるシンボル data.pdf.BusinessDocumentConfig.defaultBankAccounts
export const data.pdf.BusinessDocumentConfig.defaultBankAccounts: BankAccountInfo[] | undefinedCONST data.pdf.BusinessDocumentConfig.sealGenerator
Section titled “CONST data.pdf.BusinessDocumentConfig.sealGenerator”エクスポートされるシンボル data.pdf.BusinessDocumentConfig.sealGenerator
export const data.pdf.BusinessDocumentConfig.sealGenerator: ((name: string) => string | null) | undefinedCONST data.pdf.BusinessDocumentConfig.styling
Section titled “CONST data.pdf.BusinessDocumentConfig.styling”エクスポートされるシンボル data.pdf.BusinessDocumentConfig.styling
export const data.pdf.BusinessDocumentConfig.styling: { primaryColor?: string; pageMargins?: [number, number, number, number]; } | undefinedCONST data.pdf.EdiStampData.label
Section titled “CONST data.pdf.EdiStampData.label”エクスポートされるシンボル data.pdf.EdiStampData.label
export const data.pdf.EdiStampData.label: stringCONST data.pdf.EdiStampData.name
Section titled “CONST data.pdf.EdiStampData.name”エクスポートされるシンボル data.pdf.EdiStampData.name
export const data.pdf.EdiStampData.name: string | undefinedCONST data.pdf.BusinessDocumentData.items
Section titled “CONST data.pdf.BusinessDocumentData.items”エクスポートされるシンボル data.pdf.BusinessDocumentData.items
export const data.pdf.BusinessDocumentData.items: DocumentLineItem[]CONST data.pdf.BusinessDocumentData.client
Section titled “CONST data.pdf.BusinessDocumentData.client”エクスポートされるシンボル data.pdf.BusinessDocumentData.client
export const data.pdf.BusinessDocumentData.client: DocumentPartyInfo | undefinedCONST data.pdf.BusinessDocumentData.supplier
Section titled “CONST data.pdf.BusinessDocumentData.supplier”エクスポートされるシンボル data.pdf.BusinessDocumentData.supplier
export const data.pdf.BusinessDocumentData.supplier: DocumentPartyInfo | undefinedCONST data.pdf.BusinessDocumentData.bankAccount
Section titled “CONST data.pdf.BusinessDocumentData.bankAccount”エクスポートされるシンボル data.pdf.BusinessDocumentData.bankAccount
export const data.pdf.BusinessDocumentData.bankAccount: BankAccountInfo[] | undefinedCONST data.pdf.BusinessDocumentData.paymentMethod
Section titled “CONST data.pdf.BusinessDocumentData.paymentMethod”エクスポートされるシンボル data.pdf.BusinessDocumentData.paymentMethod
export const data.pdf.BusinessDocumentData.paymentMethod: string | undefinedCONST data.pdf.BusinessDocumentData.remarks
Section titled “CONST data.pdf.BusinessDocumentData.remarks”エクスポートされるシンボル data.pdf.BusinessDocumentData.remarks
export const data.pdf.BusinessDocumentData.remarks: string | undefinedCONST data.pdf.BusinessDocumentData.remark
Section titled “CONST data.pdf.BusinessDocumentData.remark”エクスポートされるシンボル data.pdf.BusinessDocumentData.remark
export const data.pdf.BusinessDocumentData.remark: string | undefinedCONST data.pdf.BusinessDocumentData.workDetail
Section titled “CONST data.pdf.BusinessDocumentData.workDetail”エクスポートされるシンボル data.pdf.BusinessDocumentData.workDetail
export const data.pdf.BusinessDocumentData.workDetail: string | undefinedCONST data.pdf.BusinessDocumentData.userName
Section titled “CONST data.pdf.BusinessDocumentData.userName”エクスポートされるシンボル data.pdf.BusinessDocumentData.userName
export const data.pdf.BusinessDocumentData.userName: string | undefinedCONST data.pdf.BusinessDocumentData.secondarySeal
Section titled “CONST data.pdf.BusinessDocumentData.secondarySeal”エクスポートされるシンボル data.pdf.BusinessDocumentData.secondarySeal
export const data.pdf.BusinessDocumentData.secondarySeal: string | undefinedCONST data.pdf.BusinessDocumentData.stamps
Section titled “CONST data.pdf.BusinessDocumentData.stamps”印影リスト(名前と役割)。showStaffSeal/showApproverSealより優先されます
export const data.pdf.BusinessDocumentData.stamps: EdiStampData[] | undefinedCONST data.pdf.PdfTheme.primaryColor
Section titled “CONST data.pdf.PdfTheme.primaryColor”エクスポートされるシンボル data.pdf.PdfTheme.primaryColor
export const data.pdf.PdfTheme.primaryColor: stringCONST data.pdf.PdfTheme.secondaryColor
Section titled “CONST data.pdf.PdfTheme.secondaryColor”エクスポートされるシンボル data.pdf.PdfTheme.secondaryColor
export const data.pdf.PdfTheme.secondaryColor: stringCONST data.pdf.PdfTheme.accentColor
Section titled “CONST data.pdf.PdfTheme.accentColor”エクスポートされるシンボル data.pdf.PdfTheme.accentColor
export const data.pdf.PdfTheme.accentColor: stringCONST data.pdf.PdfTheme.borderColor
Section titled “CONST data.pdf.PdfTheme.borderColor”エクスポートされるシンボル data.pdf.PdfTheme.borderColor
export const data.pdf.PdfTheme.borderColor: stringCONST data.pdf.PdfTheme.backgroundColor
Section titled “CONST data.pdf.PdfTheme.backgroundColor”エクスポートされるシンボル data.pdf.PdfTheme.backgroundColor
export const data.pdf.PdfTheme.backgroundColor: stringCONST data.pdf.PdfTheme.tableHeaderBg
Section titled “CONST data.pdf.PdfTheme.tableHeaderBg”エクスポートされるシンボル data.pdf.PdfTheme.tableHeaderBg
export const data.pdf.PdfTheme.tableHeaderBg: stringCONST data.pdf.PdfTheme.tableRowAltBg
Section titled “CONST data.pdf.PdfTheme.tableRowAltBg”エクスポートされるシンボル data.pdf.PdfTheme.tableRowAltBg
export const data.pdf.PdfTheme.tableRowAltBg: stringCONST data.pdf.PdfTheme.textColor
Section titled “CONST data.pdf.PdfTheme.textColor”エクスポートされるシンボル data.pdf.PdfTheme.textColor
export const data.pdf.PdfTheme.textColor: stringCONST data.pdf.PdfTheme.mutedTextColor
Section titled “CONST data.pdf.PdfTheme.mutedTextColor”エクスポートされるシンボル data.pdf.PdfTheme.mutedTextColor
export const data.pdf.PdfTheme.mutedTextColor: stringCONST data.pdf.PdfTheme.fontFamily
Section titled “CONST data.pdf.PdfTheme.fontFamily”エクスポートされるシンボル data.pdf.PdfTheme.fontFamily
export const data.pdf.PdfTheme.fontFamily: stringCONST data.pdf.PdfTheme.fontSize
Section titled “CONST data.pdf.PdfTheme.fontSize”エクスポートされるシンボル data.pdf.PdfTheme.fontSize
export const data.pdf.PdfTheme.fontSize: { xs: number; sm: number; base: number; md: number; lg: number; xl: number; title: number; }CONST data.pdf.PdfTheme.spacing
Section titled “CONST data.pdf.PdfTheme.spacing”エクスポートされるシンボル data.pdf.PdfTheme.spacing
export const data.pdf.PdfTheme.spacing: { pagePadding: number; sectionGap: number; itemGap: number; }CONST data.edi.InvoiceData.invoiceNumber
Section titled “CONST data.edi.InvoiceData.invoiceNumber”エクスポートされるシンボル data.edi.InvoiceData.invoiceNumber
export const data.edi.InvoiceData.invoiceNumber: stringCONST data.edi.InvoiceData.date
Section titled “CONST data.edi.InvoiceData.date”エクスポートされるシンボル data.edi.InvoiceData.date
export const data.edi.InvoiceData.date: stringCONST data.edi.InvoiceData.dueDate
Section titled “CONST data.edi.InvoiceData.dueDate”エクスポートされるシンボル data.edi.InvoiceData.dueDate
export const data.edi.InvoiceData.dueDate: stringCONST data.edi.InvoiceData.seller
Section titled “CONST data.edi.InvoiceData.seller”エクスポートされるシンボル data.edi.InvoiceData.seller
export const data.edi.InvoiceData.seller: { name: string; address: string; email: string; }CONST data.edi.InvoiceData.buyer
Section titled “CONST data.edi.InvoiceData.buyer”エクスポートされるシンボル data.edi.InvoiceData.buyer
export const data.edi.InvoiceData.buyer: { name: string; address: string; email: string; }CONST data.edi.InvoiceData.items
Section titled “CONST data.edi.InvoiceData.items”エクスポートされるシンボル data.edi.InvoiceData.items
export const data.edi.InvoiceData.items: { description: string; quantity: number; price: number; }[]CONST data.edi.QuoteData.quoteNumber
Section titled “CONST data.edi.QuoteData.quoteNumber”エクスポートされるシンボル data.edi.QuoteData.quoteNumber
export const data.edi.QuoteData.quoteNumber: stringCONST data.edi.QuoteData.quoteDate
Section titled “CONST data.edi.QuoteData.quoteDate”エクスポートされるシンボル data.edi.QuoteData.quoteDate
export const data.edi.QuoteData.quoteDate: stringCONST data.edi.QuoteData.quoteExpiryMonths
Section titled “CONST data.edi.QuoteData.quoteExpiryMonths”エクスポートされるシンボル data.edi.QuoteData.quoteExpiryMonths
export const data.edi.QuoteData.quoteExpiryMonths: numberCONST data.edi.QuoteData.subject
Section titled “CONST data.edi.QuoteData.subject”エクスポートされるシンボル data.edi.QuoteData.subject
export const data.edi.QuoteData.subject: stringCONST data.edi.QuoteData.place
Section titled “CONST data.edi.QuoteData.place”エクスポートされるシンボル data.edi.QuoteData.place
export const data.edi.QuoteData.place: stringCONST data.edi.QuoteData.constructionPeriod
Section titled “CONST data.edi.QuoteData.constructionPeriod”エクスポートされるシンボル data.edi.QuoteData.constructionPeriod
export const data.edi.QuoteData.constructionPeriod: stringCONST data.edi.QuoteData.paymentTerms
Section titled “CONST data.edi.QuoteData.paymentTerms”エクスポートされるシンボル data.edi.QuoteData.paymentTerms
export const data.edi.QuoteData.paymentTerms: stringCONST data.edi.QuoteData.workDetail
Section titled “CONST data.edi.QuoteData.workDetail”エクスポートされるシンボル data.edi.QuoteData.workDetail
export const data.edi.QuoteData.workDetail: stringCONST data.edi.QuoteData.remark
Section titled “CONST data.edi.QuoteData.remark”エクスポートされるシンボル data.edi.QuoteData.remark
export const data.edi.QuoteData.remark: string | undefinedCONST data.edi.QuoteData.client
Section titled “CONST data.edi.QuoteData.client”エクスポートされるシンボル data.edi.QuoteData.client
export const data.edi.QuoteData.client: { name: string; honorific?: string; }CONST data.edi.QuoteData.issuer
Section titled “CONST data.edi.QuoteData.issuer”エクスポートされるシンボル data.edi.QuoteData.issuer
export const data.edi.QuoteData.issuer: { companyName: string; address: string; tel: string; fax?: string; representative?: string; department?: string; inChargeName?: string; inChargeTel?: string; }CONST data.edi.QuoteData.items
Section titled “CONST data.edi.QuoteData.items”エクスポートされるシンボル data.edi.QuoteData.items
export const data.edi.QuoteData.items: QuoteItem[]CONST data.edi.QuoteData.adjustments
Section titled “CONST data.edi.QuoteData.adjustments”エクスポートされるシンボル data.edi.QuoteData.adjustments
export const data.edi.QuoteData.adjustments: { title: string; amount: number; }[] | undefinedCONST data.edi.QuoteData.taxRate
Section titled “CONST data.edi.QuoteData.taxRate”エクスポートされるシンボル data.edi.QuoteData.taxRate
export const data.edi.QuoteData.taxRate: number | undefinedCONST data.edi.QuoteItem.description
Section titled “CONST data.edi.QuoteItem.description”エクスポートされるシンボル data.edi.QuoteItem.description
export const data.edi.QuoteItem.description: stringCONST data.edi.QuoteItem.unitPrice
Section titled “CONST data.edi.QuoteItem.unitPrice”エクスポートされるシンボル data.edi.QuoteItem.unitPrice
export const data.edi.QuoteItem.unitPrice: numberCONST data.edi.QuoteItem.quantity
Section titled “CONST data.edi.QuoteItem.quantity”エクスポートされるシンボル data.edi.QuoteItem.quantity
export const data.edi.QuoteItem.quantity: numberCONST data.edi.QuoteItem.unit
Section titled “CONST data.edi.QuoteItem.unit”エクスポートされるシンボル data.edi.QuoteItem.unit
export const data.edi.QuoteItem.unit: stringCONST data.edi.EdiIdentifier.scheme
Section titled “CONST data.edi.EdiIdentifier.scheme”エクスポートされるシンボル data.edi.EdiIdentifier.scheme
export const data.edi.EdiIdentifier.scheme: stringCONST data.edi.EdiIdentifier.value
Section titled “CONST data.edi.EdiIdentifier.value”エクスポートされるシンボル data.edi.EdiIdentifier.value
export const data.edi.EdiIdentifier.value: stringCONST data.edi.EdiAmount.value
Section titled “CONST data.edi.EdiAmount.value”エクスポートされるシンボル data.edi.EdiAmount.value
export const data.edi.EdiAmount.value: numberCONST data.edi.EdiAmount.currency
Section titled “CONST data.edi.EdiAmount.currency”エクスポートされるシンボル data.edi.EdiAmount.currency
export const data.edi.EdiAmount.currency: stringCONST data.edi.EdiAddress.country
Section titled “CONST data.edi.EdiAddress.country”エクスポートされるシンボル data.edi.EdiAddress.country
export const data.edi.EdiAddress.country: stringCONST data.edi.EdiAddress.subdivision
Section titled “CONST data.edi.EdiAddress.subdivision”エクスポートされるシンボル data.edi.EdiAddress.subdivision
export const data.edi.EdiAddress.subdivision: string | undefinedCONST data.edi.EdiAddress.city
Section titled “CONST data.edi.EdiAddress.city”エクスポートされるシンボル data.edi.EdiAddress.city
export const data.edi.EdiAddress.city: string | undefinedCONST data.edi.EdiAddress.street_name
Section titled “CONST data.edi.EdiAddress.street_name”エクスポートされるシンボル data.edi.EdiAddress.street_name
export const data.edi.EdiAddress.street_name: string | undefinedCONST data.edi.EdiAddress.postal_zone
Section titled “CONST data.edi.EdiAddress.postal_zone”エクスポートされるシンボル data.edi.EdiAddress.postal_zone
export const data.edi.EdiAddress.postal_zone: string | undefinedCONST data.edi.EdiParty.id
Section titled “CONST data.edi.EdiParty.id”エクスポートされるシンボル data.edi.EdiParty.id
export const data.edi.EdiParty.id: EdiIdentifierCONST data.edi.EdiParty.name
Section titled “CONST data.edi.EdiParty.name”エクスポートされるシンボル data.edi.EdiParty.name
export const data.edi.EdiParty.name: stringCONST data.edi.EdiParty.tax_id
Section titled “CONST data.edi.EdiParty.tax_id”エクスポートされるシンボル data.edi.EdiParty.tax_id
export const data.edi.EdiParty.tax_id: EdiIdentifier | undefinedCONST data.edi.EdiParty.legal_registration
Section titled “CONST data.edi.EdiParty.legal_registration”エクスポートされるシンボル data.edi.EdiParty.legal_registration
export const data.edi.EdiParty.legal_registration: EdiIdentifier | undefinedCONST data.edi.EdiParty.endpoint_id
Section titled “CONST data.edi.EdiParty.endpoint_id”エクスポートされるシンボル data.edi.EdiParty.endpoint_id
export const data.edi.EdiParty.endpoint_id: EdiIdentifier | undefinedCONST data.edi.EdiParty.address
Section titled “CONST data.edi.EdiParty.address”エクスポートされるシンボル data.edi.EdiParty.address
export const data.edi.EdiParty.address: EdiAddress | undefinedCONST data.edi.EdiTaxCategory.id
Section titled “CONST data.edi.EdiTaxCategory.id”エクスポートされるシンボル data.edi.EdiTaxCategory.id
export const data.edi.EdiTaxCategory.id: VatexCategoryIdCONST data.edi.EdiTaxCategory.percent
Section titled “CONST data.edi.EdiTaxCategory.percent”エクスポートされるシンボル data.edi.EdiTaxCategory.percent
export const data.edi.EdiTaxCategory.percent: numberCONST data.edi.EdiTaxCategory.tax_scheme
Section titled “CONST data.edi.EdiTaxCategory.tax_scheme”エクスポートされるシンボル data.edi.EdiTaxCategory.tax_scheme
export const data.edi.EdiTaxCategory.tax_scheme: stringCONST data.edi.EdiTaxSubtotal.taxable_amount
Section titled “CONST data.edi.EdiTaxSubtotal.taxable_amount”エクスポートされるシンボル data.edi.EdiTaxSubtotal.taxable_amount
export const data.edi.EdiTaxSubtotal.taxable_amount: EdiAmountCONST data.edi.EdiTaxSubtotal.tax_amount
Section titled “CONST data.edi.EdiTaxSubtotal.tax_amount”エクスポートされるシンボル data.edi.EdiTaxSubtotal.tax_amount
export const data.edi.EdiTaxSubtotal.tax_amount: EdiAmountCONST data.edi.EdiTaxSubtotal.tax_category
Section titled “CONST data.edi.EdiTaxSubtotal.tax_category”エクスポートされるシンボル data.edi.EdiTaxSubtotal.tax_category
export const data.edi.EdiTaxSubtotal.tax_category: EdiTaxCategoryCONST data.edi.EdiTaxTotal.tax_amount
Section titled “CONST data.edi.EdiTaxTotal.tax_amount”エクスポートされるシンボル data.edi.EdiTaxTotal.tax_amount
export const data.edi.EdiTaxTotal.tax_amount: EdiAmountCONST data.edi.EdiTaxTotal.tax_subtotals
Section titled “CONST data.edi.EdiTaxTotal.tax_subtotals”エクスポートされるシンボル data.edi.EdiTaxTotal.tax_subtotals
export const data.edi.EdiTaxTotal.tax_subtotals: EdiTaxSubtotal[]CONST data.edi.EdiFinancials.tax_total
Section titled “CONST data.edi.EdiFinancials.tax_total”エクスポートされるシンボル data.edi.EdiFinancials.tax_total
export const data.edi.EdiFinancials.tax_total: EdiTaxTotalCONST data.edi.EdiFinancials.tax_inclusive_amount
Section titled “CONST data.edi.EdiFinancials.tax_inclusive_amount”エクスポートされるシンボル data.edi.EdiFinancials.tax_inclusive_amount
export const data.edi.EdiFinancials.tax_inclusive_amount: EdiAmountCONST data.edi.EdiFinancials.payable_amount
Section titled “CONST data.edi.EdiFinancials.payable_amount”エクスポートされるシンボル data.edi.EdiFinancials.payable_amount
export const data.edi.EdiFinancials.payable_amount: EdiAmountCONST data.edi.EdiFinancials.prepaid_amount
Section titled “CONST data.edi.EdiFinancials.prepaid_amount”エクスポートされるシンボル data.edi.EdiFinancials.prepaid_amount
export const data.edi.EdiFinancials.prepaid_amount: EdiAmount | undefinedCONST data.edi.EdiLine.line_id
Section titled “CONST data.edi.EdiLine.line_id”エクスポートされるシンボル data.edi.EdiLine.line_id
export const data.edi.EdiLine.line_id: stringCONST data.edi.EdiLine.product_code
Section titled “CONST data.edi.EdiLine.product_code”エクスポートされるシンボル data.edi.EdiLine.product_code
export const data.edi.EdiLine.product_code: string | undefinedCONST data.edi.EdiLine.description
Section titled “CONST data.edi.EdiLine.description”エクスポートされるシンボル data.edi.EdiLine.description
export const data.edi.EdiLine.description: stringCONST data.edi.EdiLine.quantity
Section titled “CONST data.edi.EdiLine.quantity”エクスポートされるシンボル data.edi.EdiLine.quantity
export const data.edi.EdiLine.quantity: numberCONST data.edi.EdiLine.unit_code
Section titled “CONST data.edi.EdiLine.unit_code”エクスポートされるシンボル data.edi.EdiLine.unit_code
export const data.edi.EdiLine.unit_code: stringCONST data.edi.EdiLine.unit_price
Section titled “CONST data.edi.EdiLine.unit_price”エクスポートされるシンボル data.edi.EdiLine.unit_price
export const data.edi.EdiLine.unit_price: numberCONST data.edi.EdiLine.net_amount
Section titled “CONST data.edi.EdiLine.net_amount”エクスポートされるシンボル data.edi.EdiLine.net_amount
export const data.edi.EdiLine.net_amount: numberCONST data.edi.EdiLine.po_line_ref
Section titled “CONST data.edi.EdiLine.po_line_ref”エクスポートされるシンボル data.edi.EdiLine.po_line_ref
export const data.edi.EdiLine.po_line_ref: string | undefinedCONST data.edi.EdiLine.tax_category
Section titled “CONST data.edi.EdiLine.tax_category”エクスポートされるシンボル data.edi.EdiLine.tax_category
export const data.edi.EdiLine.tax_category: EdiTaxCategory | undefinedCONST data.edi.EdiAllowanceCharge.indicator
Section titled “CONST data.edi.EdiAllowanceCharge.indicator”エクスポートされるシンボル data.edi.EdiAllowanceCharge.indicator
export const data.edi.EdiAllowanceCharge.indicator: booleanCONST data.edi.EdiAllowanceCharge.reason_code
Section titled “CONST data.edi.EdiAllowanceCharge.reason_code”エクスポートされるシンボル data.edi.EdiAllowanceCharge.reason_code
export const data.edi.EdiAllowanceCharge.reason_code: string | undefinedCONST data.edi.EdiAllowanceCharge.reason
Section titled “CONST data.edi.EdiAllowanceCharge.reason”エクスポートされるシンボル data.edi.EdiAllowanceCharge.reason
export const data.edi.EdiAllowanceCharge.reason: string | undefinedCONST data.edi.EdiAllowanceCharge.amount
Section titled “CONST data.edi.EdiAllowanceCharge.amount”エクスポートされるシンボル data.edi.EdiAllowanceCharge.amount
export const data.edi.EdiAllowanceCharge.amount: EdiAmountCONST data.edi.EdiReference.id
Section titled “CONST data.edi.EdiReference.id”エクスポートされるシンボル data.edi.EdiReference.id
export const data.edi.EdiReference.id: stringCONST data.edi.EdiReference.date
Section titled “CONST data.edi.EdiReference.date”エクスポートされるシンボル data.edi.EdiReference.date
export const data.edi.EdiReference.date: string | undefinedCONST data.edi.EdiReferences.order_reference
Section titled “CONST data.edi.EdiReferences.order_reference”エクスポートされるシンボル data.edi.EdiReferences.order_reference
export const data.edi.EdiReferences.order_reference: string | undefinedCONST data.edi.EdiReferences.despatch_document_reference
Section titled “CONST data.edi.EdiReferences.despatch_document_reference”エクスポートされるシンボル data.edi.EdiReferences.despatch_document_reference
export const data.edi.EdiReferences.despatch_document_reference: string | undefinedCONST data.edi.EdiReferences.billing_reference
Section titled “CONST data.edi.EdiReferences.billing_reference”エクスポートされるシンボル data.edi.EdiReferences.billing_reference
export const data.edi.EdiReferences.billing_reference: EdiReference | undefinedCONST data.edi.EdiReferences.quotation_reference
Section titled “CONST data.edi.EdiReferences.quotation_reference”エクスポートされるシンボル data.edi.EdiReferences.quotation_reference
export const data.edi.EdiReferences.quotation_reference: string | undefinedCONST data.edi.EdiPayment.means_code
Section titled “CONST data.edi.EdiPayment.means_code”エクスポートされるシンボル data.edi.EdiPayment.means_code
export const data.edi.EdiPayment.means_code: string | undefinedCONST data.edi.EdiPayment.payment_id
Section titled “CONST data.edi.EdiPayment.payment_id”エクスポートされるシンボル data.edi.EdiPayment.payment_id
export const data.edi.EdiPayment.payment_id: string | undefinedCONST data.edi.EdiPayment.due_date
Section titled “CONST data.edi.EdiPayment.due_date”エクスポートされるシンボル data.edi.EdiPayment.due_date
export const data.edi.EdiPayment.due_date: string | undefinedCONST data.edi.EdiPayment.bank_accounts
Section titled “CONST data.edi.EdiPayment.bank_accounts”エクスポートされるシンボル data.edi.EdiPayment.bank_accounts
export const data.edi.EdiPayment.bank_accounts: EdiBankAccount[] | undefinedCONST data.edi.EdiBankAccount.bank_name
Section titled “CONST data.edi.EdiBankAccount.bank_name”エクスポートされるシンボル data.edi.EdiBankAccount.bank_name
export const data.edi.EdiBankAccount.bank_name: stringCONST data.edi.EdiBankAccount.branch_name
Section titled “CONST data.edi.EdiBankAccount.branch_name”エクスポートされるシンボル data.edi.EdiBankAccount.branch_name
export const data.edi.EdiBankAccount.branch_name: stringCONST data.edi.EdiBankAccount.account_type
Section titled “CONST data.edi.EdiBankAccount.account_type”エクスポートされるシンボル data.edi.EdiBankAccount.account_type
export const data.edi.EdiBankAccount.account_type: stringCONST data.edi.EdiBankAccount.account_number
Section titled “CONST data.edi.EdiBankAccount.account_number”エクスポートされるシンボル data.edi.EdiBankAccount.account_number
export const data.edi.EdiBankAccount.account_number: stringCONST data.edi.EdiBankAccount.account_holder
Section titled “CONST data.edi.EdiBankAccount.account_holder”エクスポートされるシンボル data.edi.EdiBankAccount.account_holder
export const data.edi.EdiBankAccount.account_holder: stringCONST data.edi.EdiAllocation.invoice
Section titled “CONST data.edi.EdiAllocation.invoice”エクスポートされるシンボル data.edi.EdiAllocation.invoice
export const data.edi.EdiAllocation.invoice: { id: string; }CONST data.edi.EdiAllocation.allocated_amount
Section titled “CONST data.edi.EdiAllocation.allocated_amount”エクスポートされるシンボル data.edi.EdiAllocation.allocated_amount
export const data.edi.EdiAllocation.allocated_amount: EdiAmountCONST data.edi.EdiShipment.packages
Section titled “CONST data.edi.EdiShipment.packages”エクスポートされるシンボル data.edi.EdiShipment.packages
export const data.edi.EdiShipment.packages: EdiPackage[] | undefinedCONST data.edi.EdiPackage.id
Section titled “CONST data.edi.EdiPackage.id”エクスポートされるシンボル data.edi.EdiPackage.id
export const data.edi.EdiPackage.id: stringCONST data.edi.EdiPackage.level
Section titled “CONST data.edi.EdiPackage.level”エクスポートされるシンボル data.edi.EdiPackage.level
export const data.edi.EdiPackage.level: string | undefinedCONST data.edi.EdiPackage.sscc
Section titled “CONST data.edi.EdiPackage.sscc”エクスポートされるシンボル data.edi.EdiPackage.sscc
export const data.edi.EdiPackage.sscc: string | undefinedCONST data.edi.EdiPackage.gross_weight_kg
Section titled “CONST data.edi.EdiPackage.gross_weight_kg”エクスポートされるシンボル data.edi.EdiPackage.gross_weight_kg
export const data.edi.EdiPackage.gross_weight_kg: number | undefinedCONST data.edi.EdiPackage.children
Section titled “CONST data.edi.EdiPackage.children”エクスポートされるシンボル data.edi.EdiPackage.children
export const data.edi.EdiPackage.children: EdiPackage[] | undefinedCONST data.edi.EdiExtensionEnvelope.namespace
Section titled “CONST data.edi.EdiExtensionEnvelope.namespace”エクスポートされるシンボル data.edi.EdiExtensionEnvelope.namespace
export const data.edi.EdiExtensionEnvelope.namespace: stringCONST data.edi.EdiExtensionEnvelope.extension_id
Section titled “CONST data.edi.EdiExtensionEnvelope.extension_id”エクスポートされるシンボル data.edi.EdiExtensionEnvelope.extension_id
export const data.edi.EdiExtensionEnvelope.extension_id: stringCONST data.edi.EdiExtensionEnvelope.version
Section titled “CONST data.edi.EdiExtensionEnvelope.version”エクスポートされるシンボル data.edi.EdiExtensionEnvelope.version
export const data.edi.EdiExtensionEnvelope.version: stringCONST data.edi.EdiExtensionEnvelope.data
Section titled “CONST data.edi.EdiExtensionEnvelope.data”エクスポートされるシンボル data.edi.EdiExtensionEnvelope.data
export const data.edi.EdiExtensionEnvelope.data: Record<string, unknown>CONST data.edi.EdiStamp.label
Section titled “CONST data.edi.EdiStamp.label”エクスポートされるシンボル data.edi.EdiStamp.label
export const data.edi.EdiStamp.label: stringCONST data.edi.EdiStamp.name
Section titled “CONST data.edi.EdiStamp.name”エクスポートされるシンボル data.edi.EdiStamp.name
export const data.edi.EdiStamp.name: string | undefinedCONST data.edi.EdiStamp.sealImageDataUrl
Section titled “CONST data.edi.EdiStamp.sealImageDataUrl”エクスポートされるシンボル data.edi.EdiStamp.sealImageDataUrl
export const data.edi.EdiStamp.sealImageDataUrl: string | undefinedCONST data.edi.EdiDocumentCommon.customization_id
Section titled “CONST data.edi.EdiDocumentCommon.customization_id”エクスポートされるシンボル data.edi.EdiDocumentCommon.customization_id
export const data.edi.EdiDocumentCommon.customization_id: string | undefinedCONST data.edi.EdiDocumentCommon.profile_id
Section titled “CONST data.edi.EdiDocumentCommon.profile_id”エクスポートされるシンボル data.edi.EdiDocumentCommon.profile_id
export const data.edi.EdiDocumentCommon.profile_id: string | undefinedCONST data.edi.EdiDocumentCommon.schema_version
Section titled “CONST data.edi.EdiDocumentCommon.schema_version”エクスポートされるシンボル data.edi.EdiDocumentCommon.schema_version
export const data.edi.EdiDocumentCommon.schema_version: stringCONST data.edi.EdiDocumentCommon.profile
Section titled “CONST data.edi.EdiDocumentCommon.profile”エクスポートされるシンボル data.edi.EdiDocumentCommon.profile
export const data.edi.EdiDocumentCommon.profile: string | undefinedCONST data.edi.EdiDocumentCommon.doc_type
Section titled “CONST data.edi.EdiDocumentCommon.doc_type”エクスポートされるシンボル data.edi.EdiDocumentCommon.doc_type
export const data.edi.EdiDocumentCommon.doc_type: EdiDocTypeCONST data.edi.EdiDocumentCommon.doc_type_code
Section titled “CONST data.edi.EdiDocumentCommon.doc_type_code”エクスポートされるシンボル data.edi.EdiDocumentCommon.doc_type_code
export const data.edi.EdiDocumentCommon.doc_type_code: EdiDocTypeCodeCONST data.edi.EdiDocumentCommon.id
Section titled “CONST data.edi.EdiDocumentCommon.id”エクスポートされるシンボル data.edi.EdiDocumentCommon.id
export const data.edi.EdiDocumentCommon.id: stringCONST data.edi.EdiDocumentCommon.issue_date
Section titled “CONST data.edi.EdiDocumentCommon.issue_date”エクスポートされるシンボル data.edi.EdiDocumentCommon.issue_date
export const data.edi.EdiDocumentCommon.issue_date: stringCONST data.edi.EdiDocumentCommon.currency
Section titled “CONST data.edi.EdiDocumentCommon.currency”エクスポートされるシンボル data.edi.EdiDocumentCommon.currency
export const data.edi.EdiDocumentCommon.currency: stringCONST data.edi.EdiDocumentCommon.note
Section titled “CONST data.edi.EdiDocumentCommon.note”エクスポートされるシンボル data.edi.EdiDocumentCommon.note
export const data.edi.EdiDocumentCommon.note: string | undefinedCONST data.edi.EdiDocumentCommon.tax_point_date
Section titled “CONST data.edi.EdiDocumentCommon.tax_point_date”エクスポートされるシンボル data.edi.EdiDocumentCommon.tax_point_date
export const data.edi.EdiDocumentCommon.tax_point_date: string | undefinedCONST data.edi.EdiDocumentCommon.buyer_reference
Section titled “CONST data.edi.EdiDocumentCommon.buyer_reference”エクスポートされるシンボル data.edi.EdiDocumentCommon.buyer_reference
export const data.edi.EdiDocumentCommon.buyer_reference: string | undefinedCONST data.edi.EdiDocumentCommon.extensions
Section titled “CONST data.edi.EdiDocumentCommon.extensions”エクスポートされるシンボル data.edi.EdiDocumentCommon.extensions
export const data.edi.EdiDocumentCommon.extensions: EdiExtensionEnvelope[] | undefinedCONST data.edi.EdiDocumentCommon.stamps
Section titled “CONST data.edi.EdiDocumentCommon.stamps”印影リスト(名前と役割)。PDF描画に使用する、非標準のPeppol拡張です。
export const data.edi.EdiDocumentCommon.stamps: EdiStamp[] | undefinedCONST data.edi.EdiDocumentParties.supplier
Section titled “CONST data.edi.EdiDocumentParties.supplier”エクスポートされるシンボル data.edi.EdiDocumentParties.supplier
export const data.edi.EdiDocumentParties.supplier: EdiPartyCONST data.edi.EdiDocumentParties.buyer
Section titled “CONST data.edi.EdiDocumentParties.buyer”エクスポートされるシンボル data.edi.EdiDocumentParties.buyer
export const data.edi.EdiDocumentParties.buyer: EdiPartyCONST data.edi.EdiDocumentLines.lines
Section titled “CONST data.edi.EdiDocumentLines.lines”エクスポートされるシンボル data.edi.EdiDocumentLines.lines
export const data.edi.EdiDocumentLines.lines: EdiLine[]CONST data.edi.EdiInvoiceData.doc_type
Section titled “CONST data.edi.EdiInvoiceData.doc_type”エクスポートされるシンボル data.edi.EdiInvoiceData.doc_type
export const data.edi.EdiInvoiceData.doc_type: "Invoice"CONST data.edi.EdiInvoiceData.doc_type_code
Section titled “CONST data.edi.EdiInvoiceData.doc_type_code”エクスポートされるシンボル data.edi.EdiInvoiceData.doc_type_code
export const data.edi.EdiInvoiceData.doc_type_code: "380" | "384" | "389"CONST data.edi.EdiInvoiceData.references
Section titled “CONST data.edi.EdiInvoiceData.references”エクスポートされるシンボル data.edi.EdiInvoiceData.references
export const data.edi.EdiInvoiceData.references: EdiReferences | undefinedCONST data.edi.EdiInvoiceData.allowances_charges
Section titled “CONST data.edi.EdiInvoiceData.allowances_charges”エクスポートされるシンボル data.edi.EdiInvoiceData.allowances_charges
export const data.edi.EdiInvoiceData.allowances_charges: EdiAllowanceCharge[] | undefinedCONST data.edi.EdiInvoiceData.financials
Section titled “CONST data.edi.EdiInvoiceData.financials”エクスポートされるシンボル data.edi.EdiInvoiceData.financials
export const data.edi.EdiInvoiceData.financials: EdiFinancialsCONST data.edi.EdiInvoiceData.payment
Section titled “CONST data.edi.EdiInvoiceData.payment”エクスポートされるシンボル data.edi.EdiInvoiceData.payment
export const data.edi.EdiInvoiceData.payment: EdiPayment | undefinedCONST data.edi.EdiInvoiceData.shipment
Section titled “CONST data.edi.EdiInvoiceData.shipment”エクスポートされるシンボル data.edi.EdiInvoiceData.shipment
export const data.edi.EdiInvoiceData.shipment: EdiShipment | undefinedCONST data.edi.EdiCreditNoteData.doc_type
Section titled “CONST data.edi.EdiCreditNoteData.doc_type”エクスポートされるシンボル data.edi.EdiCreditNoteData.doc_type
export const data.edi.EdiCreditNoteData.doc_type: "CreditNote"CONST data.edi.EdiCreditNoteData.doc_type_code
Section titled “CONST data.edi.EdiCreditNoteData.doc_type_code”エクスポートされるシンボル data.edi.EdiCreditNoteData.doc_type_code
export const data.edi.EdiCreditNoteData.doc_type_code: "381"CONST data.edi.EdiCreditNoteData.references
Section titled “CONST data.edi.EdiCreditNoteData.references”エクスポートされるシンボル data.edi.EdiCreditNoteData.references
export const data.edi.EdiCreditNoteData.references: EdiReferences & { billing_reference: EdiReference; }CONST data.edi.EdiCreditNoteData.allowances_charges
Section titled “CONST data.edi.EdiCreditNoteData.allowances_charges”エクスポートされるシンボル data.edi.EdiCreditNoteData.allowances_charges
export const data.edi.EdiCreditNoteData.allowances_charges: EdiAllowanceCharge[] | undefinedCONST data.edi.EdiCreditNoteData.financials
Section titled “CONST data.edi.EdiCreditNoteData.financials”エクスポートされるシンボル data.edi.EdiCreditNoteData.financials
export const data.edi.EdiCreditNoteData.financials: EdiFinancialsCONST data.edi.EdiCreditNoteData.payment
Section titled “CONST data.edi.EdiCreditNoteData.payment”エクスポートされるシンボル data.edi.EdiCreditNoteData.payment
export const data.edi.EdiCreditNoteData.payment: EdiPayment | undefinedCONST data.edi.EdiPurchaseOrderData.doc_type
Section titled “CONST data.edi.EdiPurchaseOrderData.doc_type”エクスポートされるシンボル data.edi.EdiPurchaseOrderData.doc_type
export const data.edi.EdiPurchaseOrderData.doc_type: "PurchaseOrder"CONST data.edi.EdiPurchaseOrderData.doc_type_code
Section titled “CONST data.edi.EdiPurchaseOrderData.doc_type_code”エクスポートされるシンボル data.edi.EdiPurchaseOrderData.doc_type_code
export const data.edi.EdiPurchaseOrderData.doc_type_code: nullCONST data.edi.EdiPurchaseOrderData.references
Section titled “CONST data.edi.EdiPurchaseOrderData.references”エクスポートされるシンボル data.edi.EdiPurchaseOrderData.references
export const data.edi.EdiPurchaseOrderData.references: EdiReferences | undefinedCONST data.edi.EdiPurchaseOrderData.allowances_charges
Section titled “CONST data.edi.EdiPurchaseOrderData.allowances_charges”エクスポートされるシンボル data.edi.EdiPurchaseOrderData.allowances_charges
export const data.edi.EdiPurchaseOrderData.allowances_charges: EdiAllowanceCharge[] | undefinedCONST data.edi.EdiPurchaseOrderData.financials
Section titled “CONST data.edi.EdiPurchaseOrderData.financials”エクスポートされるシンボル data.edi.EdiPurchaseOrderData.financials
export const data.edi.EdiPurchaseOrderData.financials: EdiFinancials | undefinedCONST data.edi.EdiPurchaseOrderData.shipment
Section titled “CONST data.edi.EdiPurchaseOrderData.shipment”エクスポートされるシンボル data.edi.EdiPurchaseOrderData.shipment
export const data.edi.EdiPurchaseOrderData.shipment: EdiShipment | undefinedCONST data.edi.EdiPurchaseOrderData.quotation_reference
Section titled “CONST data.edi.EdiPurchaseOrderData.quotation_reference”エクスポートされるシンボル data.edi.EdiPurchaseOrderData.quotation_reference
export const data.edi.EdiPurchaseOrderData.quotation_reference: string | undefinedCONST data.edi.EdiDespatchAdviceData.doc_type
Section titled “CONST data.edi.EdiDespatchAdviceData.doc_type”エクスポートされるシンボル data.edi.EdiDespatchAdviceData.doc_type
export const data.edi.EdiDespatchAdviceData.doc_type: "DespatchAdvice"CONST data.edi.EdiDespatchAdviceData.doc_type_code
Section titled “CONST data.edi.EdiDespatchAdviceData.doc_type_code”エクスポートされるシンボル data.edi.EdiDespatchAdviceData.doc_type_code
export const data.edi.EdiDespatchAdviceData.doc_type_code: nullCONST data.edi.EdiDespatchAdviceData.references
Section titled “CONST data.edi.EdiDespatchAdviceData.references”エクスポートされるシンボル data.edi.EdiDespatchAdviceData.references
export const data.edi.EdiDespatchAdviceData.references: EdiReferences & { order_reference: string; }CONST data.edi.EdiDespatchAdviceData.shipment
Section titled “CONST data.edi.EdiDespatchAdviceData.shipment”エクスポートされるシンボル data.edi.EdiDespatchAdviceData.shipment
export const data.edi.EdiDespatchAdviceData.shipment: EdiShipment | undefinedCONST data.edi.EdiRemittanceAdviceData.doc_type
Section titled “CONST data.edi.EdiRemittanceAdviceData.doc_type”エクスポートされるシンボル data.edi.EdiRemittanceAdviceData.doc_type
export const data.edi.EdiRemittanceAdviceData.doc_type: "RemittanceAdvice"CONST data.edi.EdiRemittanceAdviceData.doc_type_code
Section titled “CONST data.edi.EdiRemittanceAdviceData.doc_type_code”エクスポートされるシンボル data.edi.EdiRemittanceAdviceData.doc_type_code
export const data.edi.EdiRemittanceAdviceData.doc_type_code: nullCONST data.edi.EdiRemittanceAdviceData.allocations
Section titled “CONST data.edi.EdiRemittanceAdviceData.allocations”エクスポートされるシンボル data.edi.EdiRemittanceAdviceData.allocations
export const data.edi.EdiRemittanceAdviceData.allocations: EdiAllocation[]CONST data.edi.EdiRemittanceAdviceData.payment
Section titled “CONST data.edi.EdiRemittanceAdviceData.payment”エクスポートされるシンボル data.edi.EdiRemittanceAdviceData.payment
export const data.edi.EdiRemittanceAdviceData.payment: EdiPaymentCONST data.edi.EdiRemittanceAdviceData.financials
Section titled “CONST data.edi.EdiRemittanceAdviceData.financials”エクスポートされるシンボル data.edi.EdiRemittanceAdviceData.financials
export const data.edi.EdiRemittanceAdviceData.financials: { paid_amount: EdiAmount; difference_amount?: EdiAmount; } | undefinedCONST data.edi.EdiQuotationData.doc_type
Section titled “CONST data.edi.EdiQuotationData.doc_type”エクスポートされるシンボル data.edi.EdiQuotationData.doc_type
export const data.edi.EdiQuotationData.doc_type: "Quotation"CONST data.edi.EdiQuotationData.doc_type_code
Section titled “CONST data.edi.EdiQuotationData.doc_type_code”エクスポートされるシンボル data.edi.EdiQuotationData.doc_type_code
export const data.edi.EdiQuotationData.doc_type_code: nullCONST data.edi.EdiQuotationData.references
Section titled “CONST data.edi.EdiQuotationData.references”エクスポートされるシンボル data.edi.EdiQuotationData.references
export const data.edi.EdiQuotationData.references: EdiReferences | undefinedCONST data.edi.EdiQuotationData.allowances_charges
Section titled “CONST data.edi.EdiQuotationData.allowances_charges”エクスポートされるシンボル data.edi.EdiQuotationData.allowances_charges
export const data.edi.EdiQuotationData.allowances_charges: EdiAllowanceCharge[] | undefinedCONST data.edi.EdiQuotationData.financials
Section titled “CONST data.edi.EdiQuotationData.financials”エクスポートされるシンボル data.edi.EdiQuotationData.financials
export const data.edi.EdiQuotationData.financials: EdiFinancials | undefinedCONST data.edi.EdiQuotationData.valid_from
Section titled “CONST data.edi.EdiQuotationData.valid_from”エクスポートされるシンボル data.edi.EdiQuotationData.valid_from
export const data.edi.EdiQuotationData.valid_from: string | undefinedCONST data.edi.EdiQuotationData.valid_until
Section titled “CONST data.edi.EdiQuotationData.valid_until”エクスポートされるシンボル data.edi.EdiQuotationData.valid_until
export const data.edi.EdiQuotationData.valid_until: string | undefinedCONST data.edi.EdiDocumentContext.currency
Section titled “CONST data.edi.EdiDocumentContext.currency”エクスポートされるシンボル data.edi.EdiDocumentContext.currency
export const data.edi.EdiDocumentContext.currency: stringCONST data.edi.EdiDocumentContext.schemaVersion
Section titled “CONST data.edi.EdiDocumentContext.schemaVersion”エクスポートされるシンボル data.edi.EdiDocumentContext.schemaVersion
export const data.edi.EdiDocumentContext.schemaVersion: string | undefinedCONST data.edi.EdiDocumentContext.customizationId
Section titled “CONST data.edi.EdiDocumentContext.customizationId”エクスポートされるシンボル data.edi.EdiDocumentContext.customizationId
export const data.edi.EdiDocumentContext.customizationId: string | undefinedCONST data.edi.EdiDocumentContext.profileId
Section titled “CONST data.edi.EdiDocumentContext.profileId”エクスポートされるシンボル data.edi.EdiDocumentContext.profileId
export const data.edi.EdiDocumentContext.profileId: string | undefinedCONST data.edi.EdiDocumentContext.profile
Section titled “CONST data.edi.EdiDocumentContext.profile”エクスポートされるシンボル data.edi.EdiDocumentContext.profile
export const data.edi.EdiDocumentContext.profile: string | undefinedCONST data.edi.UblFieldMap.documentType
Section titled “CONST data.edi.UblFieldMap.documentType”エクスポートされるシンボル data.edi.UblFieldMap.documentType
export const data.edi.UblFieldMap.documentType: stringCONST data.edi.UblFieldMap.documentTypeCode
Section titled “CONST data.edi.UblFieldMap.documentTypeCode”エクスポートされるシンボル data.edi.UblFieldMap.documentTypeCode
export const data.edi.UblFieldMap.documentTypeCode: string | nullCONST data.edi.UblFieldMap.id
Section titled “CONST data.edi.UblFieldMap.id”エクスポートされるシンボル data.edi.UblFieldMap.id
export const data.edi.UblFieldMap.id: stringCONST data.edi.UblFieldMap.issueDate
Section titled “CONST data.edi.UblFieldMap.issueDate”エクスポートされるシンボル data.edi.UblFieldMap.issueDate
export const data.edi.UblFieldMap.issueDate: stringCONST data.edi.UblFieldMap.note
Section titled “CONST data.edi.UblFieldMap.note”エクスポートされるシンボル data.edi.UblFieldMap.note
export const data.edi.UblFieldMap.note: string | undefinedCONST data.edi.UblFieldMap.taxPointDate
Section titled “CONST data.edi.UblFieldMap.taxPointDate”エクスポートされるシンボル data.edi.UblFieldMap.taxPointDate
export const data.edi.UblFieldMap.taxPointDate: string | undefinedCONST data.edi.UblFieldMap.orderReference
Section titled “CONST data.edi.UblFieldMap.orderReference”エクスポートされるシンボル data.edi.UblFieldMap.orderReference
export const data.edi.UblFieldMap.orderReference: string | undefinedCONST data.edi.UblFieldMap.despatchDocumentReference
Section titled “CONST data.edi.UblFieldMap.despatchDocumentReference”エクスポートされるシンボル data.edi.UblFieldMap.despatchDocumentReference
export const data.edi.UblFieldMap.despatchDocumentReference: string | undefinedCONST data.edi.UblFieldMap.billingReferenceId
Section titled “CONST data.edi.UblFieldMap.billingReferenceId”エクスポートされるシンボル data.edi.UblFieldMap.billingReferenceId
export const data.edi.UblFieldMap.billingReferenceId: string | undefinedCONST data.edi.UblFieldMap.billingReferenceDate
Section titled “CONST data.edi.UblFieldMap.billingReferenceDate”エクスポートされるシンボル data.edi.UblFieldMap.billingReferenceDate
export const data.edi.UblFieldMap.billingReferenceDate: string | undefinedCONST data.edi.UblFieldMap.currency
Section titled “CONST data.edi.UblFieldMap.currency”エクスポートされるシンボル data.edi.UblFieldMap.currency
export const data.edi.UblFieldMap.currency: stringCONST data.edi.UblFieldMap.supplier
Section titled “CONST data.edi.UblFieldMap.supplier”エクスポートされるシンボル data.edi.UblFieldMap.supplier
export const data.edi.UblFieldMap.supplier: UblPartyMapCONST data.edi.UblFieldMap.buyer
Section titled “CONST data.edi.UblFieldMap.buyer”エクスポートされるシンボル data.edi.UblFieldMap.buyer
export const data.edi.UblFieldMap.buyer: UblPartyMapCONST data.edi.UblFieldMap.lines
Section titled “CONST data.edi.UblFieldMap.lines”エクスポートされるシンボル data.edi.UblFieldMap.lines
export const data.edi.UblFieldMap.lines: UblLineMap[]CONST data.edi.UblFieldMap.taxSubtotals
Section titled “CONST data.edi.UblFieldMap.taxSubtotals”エクスポートされるシンボル data.edi.UblFieldMap.taxSubtotals
export const data.edi.UblFieldMap.taxSubtotals: UblTaxSubtotalMap[]CONST data.edi.UblFieldMap.taxTotalAmount
Section titled “CONST data.edi.UblFieldMap.taxTotalAmount”エクスポートされるシンボル data.edi.UblFieldMap.taxTotalAmount
export const data.edi.UblFieldMap.taxTotalAmount: numberCONST data.edi.UblFieldMap.taxInclusiveAmount
Section titled “CONST data.edi.UblFieldMap.taxInclusiveAmount”エクスポートされるシンボル data.edi.UblFieldMap.taxInclusiveAmount
export const data.edi.UblFieldMap.taxInclusiveAmount: numberCONST data.edi.UblFieldMap.payableAmount
Section titled “CONST data.edi.UblFieldMap.payableAmount”エクスポートされるシンボル data.edi.UblFieldMap.payableAmount
export const data.edi.UblFieldMap.payableAmount: numberCONST data.edi.UblFieldMap.prepaidAmount
Section titled “CONST data.edi.UblFieldMap.prepaidAmount”エクスポートされるシンボル data.edi.UblFieldMap.prepaidAmount
export const data.edi.UblFieldMap.prepaidAmount: number | undefinedCONST data.edi.UblFieldMap.allowancesCharges
Section titled “CONST data.edi.UblFieldMap.allowancesCharges”エクスポートされるシンボル data.edi.UblFieldMap.allowancesCharges
export const data.edi.UblFieldMap.allowancesCharges: UblAllowanceChargeMap[]CONST data.edi.UblFieldMap.paymentMeansCode
Section titled “CONST data.edi.UblFieldMap.paymentMeansCode”エクスポートされるシンボル data.edi.UblFieldMap.paymentMeansCode
export const data.edi.UblFieldMap.paymentMeansCode: string | undefinedCONST data.edi.UblFieldMap.paymentId
Section titled “CONST data.edi.UblFieldMap.paymentId”エクスポートされるシンボル data.edi.UblFieldMap.paymentId
export const data.edi.UblFieldMap.paymentId: string | undefinedCONST data.edi.UblPartyMap.endpointId
Section titled “CONST data.edi.UblPartyMap.endpointId”エクスポートされるシンボル data.edi.UblPartyMap.endpointId
export const data.edi.UblPartyMap.endpointId: string | undefinedCONST data.edi.UblPartyMap.endpointScheme
Section titled “CONST data.edi.UblPartyMap.endpointScheme”エクスポートされるシンボル data.edi.UblPartyMap.endpointScheme
export const data.edi.UblPartyMap.endpointScheme: string | undefinedCONST data.edi.UblPartyMap.id
Section titled “CONST data.edi.UblPartyMap.id”エクスポートされるシンボル data.edi.UblPartyMap.id
export const data.edi.UblPartyMap.id: string | undefinedCONST data.edi.UblPartyMap.idScheme
Section titled “CONST data.edi.UblPartyMap.idScheme”エクスポートされるシンボル data.edi.UblPartyMap.idScheme
export const data.edi.UblPartyMap.idScheme: string | undefinedCONST data.edi.UblPartyMap.name
Section titled “CONST data.edi.UblPartyMap.name”エクスポートされるシンボル data.edi.UblPartyMap.name
export const data.edi.UblPartyMap.name: stringCONST data.edi.UblPartyMap.taxId
Section titled “CONST data.edi.UblPartyMap.taxId”エクスポートされるシンボル data.edi.UblPartyMap.taxId
export const data.edi.UblPartyMap.taxId: string | undefinedCONST data.edi.UblPartyMap.taxIdScheme
Section titled “CONST data.edi.UblPartyMap.taxIdScheme”エクスポートされるシンボル data.edi.UblPartyMap.taxIdScheme
export const data.edi.UblPartyMap.taxIdScheme: string | undefinedCONST data.edi.UblPartyMap.legalRegistrationId
Section titled “CONST data.edi.UblPartyMap.legalRegistrationId”エクスポートされるシンボル data.edi.UblPartyMap.legalRegistrationId
export const data.edi.UblPartyMap.legalRegistrationId: string | undefinedCONST data.edi.UblPartyMap.legalRegistrationScheme
Section titled “CONST data.edi.UblPartyMap.legalRegistrationScheme”エクスポートされるシンボル data.edi.UblPartyMap.legalRegistrationScheme
export const data.edi.UblPartyMap.legalRegistrationScheme: string | undefinedCONST data.edi.UblPartyMap.addressCountry
Section titled “CONST data.edi.UblPartyMap.addressCountry”エクスポートされるシンボル data.edi.UblPartyMap.addressCountry
export const data.edi.UblPartyMap.addressCountry: string | undefinedCONST data.edi.UblPartyMap.addressSubdivision
Section titled “CONST data.edi.UblPartyMap.addressSubdivision”エクスポートされるシンボル data.edi.UblPartyMap.addressSubdivision
export const data.edi.UblPartyMap.addressSubdivision: string | undefinedCONST data.edi.UblPartyMap.addressCity
Section titled “CONST data.edi.UblPartyMap.addressCity”エクスポートされるシンボル data.edi.UblPartyMap.addressCity
export const data.edi.UblPartyMap.addressCity: string | undefinedCONST data.edi.UblPartyMap.addressStreet
Section titled “CONST data.edi.UblPartyMap.addressStreet”エクスポートされるシンボル data.edi.UblPartyMap.addressStreet
export const data.edi.UblPartyMap.addressStreet: string | undefinedCONST data.edi.UblPartyMap.addressPostalZone
Section titled “CONST data.edi.UblPartyMap.addressPostalZone”エクスポートされるシンボル data.edi.UblPartyMap.addressPostalZone
export const data.edi.UblPartyMap.addressPostalZone: string | undefinedCONST data.edi.UblLineMap.id
Section titled “CONST data.edi.UblLineMap.id”エクスポートされるシンボル data.edi.UblLineMap.id
export const data.edi.UblLineMap.id: stringCONST data.edi.UblLineMap.productCode
Section titled “CONST data.edi.UblLineMap.productCode”エクスポートされるシンボル data.edi.UblLineMap.productCode
export const data.edi.UblLineMap.productCode: string | undefinedCONST data.edi.UblLineMap.description
Section titled “CONST data.edi.UblLineMap.description”エクスポートされるシンボル data.edi.UblLineMap.description
export const data.edi.UblLineMap.description: stringCONST data.edi.UblLineMap.quantity
Section titled “CONST data.edi.UblLineMap.quantity”エクスポートされるシンボル data.edi.UblLineMap.quantity
export const data.edi.UblLineMap.quantity: numberCONST data.edi.UblLineMap.unitCode
Section titled “CONST data.edi.UblLineMap.unitCode”エクスポートされるシンボル data.edi.UblLineMap.unitCode
export const data.edi.UblLineMap.unitCode: stringCONST data.edi.UblLineMap.unitPrice
Section titled “CONST data.edi.UblLineMap.unitPrice”エクスポートされるシンボル data.edi.UblLineMap.unitPrice
export const data.edi.UblLineMap.unitPrice: numberCONST data.edi.UblLineMap.netAmount
Section titled “CONST data.edi.UblLineMap.netAmount”エクスポートされるシンボル data.edi.UblLineMap.netAmount
export const data.edi.UblLineMap.netAmount: numberCONST data.edi.UblLineMap.poLineRef
Section titled “CONST data.edi.UblLineMap.poLineRef”エクスポートされるシンボル data.edi.UblLineMap.poLineRef
export const data.edi.UblLineMap.poLineRef: string | undefinedCONST data.edi.UblLineMap.taxCategoryId
Section titled “CONST data.edi.UblLineMap.taxCategoryId”エクスポートされるシンボル data.edi.UblLineMap.taxCategoryId
export const data.edi.UblLineMap.taxCategoryId: string | undefinedCONST data.edi.UblLineMap.taxPercent
Section titled “CONST data.edi.UblLineMap.taxPercent”エクスポートされるシンボル data.edi.UblLineMap.taxPercent
export const data.edi.UblLineMap.taxPercent: number | undefinedCONST data.edi.UblLineMap.taxScheme
Section titled “CONST data.edi.UblLineMap.taxScheme”エクスポートされるシンボル data.edi.UblLineMap.taxScheme
export const data.edi.UblLineMap.taxScheme: string | undefinedCONST data.edi.UblTaxSubtotalMap.taxableAmount
Section titled “CONST data.edi.UblTaxSubtotalMap.taxableAmount”エクスポートされるシンボル data.edi.UblTaxSubtotalMap.taxableAmount
export const data.edi.UblTaxSubtotalMap.taxableAmount: numberCONST data.edi.UblTaxSubtotalMap.taxAmount
Section titled “CONST data.edi.UblTaxSubtotalMap.taxAmount”エクスポートされるシンボル data.edi.UblTaxSubtotalMap.taxAmount
export const data.edi.UblTaxSubtotalMap.taxAmount: numberCONST data.edi.UblTaxSubtotalMap.taxCategoryId
Section titled “CONST data.edi.UblTaxSubtotalMap.taxCategoryId”エクスポートされるシンボル data.edi.UblTaxSubtotalMap.taxCategoryId
export const data.edi.UblTaxSubtotalMap.taxCategoryId: stringCONST data.edi.UblTaxSubtotalMap.taxPercent
Section titled “CONST data.edi.UblTaxSubtotalMap.taxPercent”エクスポートされるシンボル data.edi.UblTaxSubtotalMap.taxPercent
export const data.edi.UblTaxSubtotalMap.taxPercent: numberCONST data.edi.UblTaxSubtotalMap.taxScheme
Section titled “CONST data.edi.UblTaxSubtotalMap.taxScheme”エクスポートされるシンボル data.edi.UblTaxSubtotalMap.taxScheme
export const data.edi.UblTaxSubtotalMap.taxScheme: stringCONST data.edi.UblAllowanceChargeMap.indicator
Section titled “CONST data.edi.UblAllowanceChargeMap.indicator”エクスポートされるシンボル data.edi.UblAllowanceChargeMap.indicator
export const data.edi.UblAllowanceChargeMap.indicator: booleanCONST data.edi.UblAllowanceChargeMap.reasonCode
Section titled “CONST data.edi.UblAllowanceChargeMap.reasonCode”エクスポートされるシンボル data.edi.UblAllowanceChargeMap.reasonCode
export const data.edi.UblAllowanceChargeMap.reasonCode: string | undefinedCONST data.edi.UblAllowanceChargeMap.reason
Section titled “CONST data.edi.UblAllowanceChargeMap.reason”エクスポートされるシンボル data.edi.UblAllowanceChargeMap.reason
export const data.edi.UblAllowanceChargeMap.reason: string | undefinedCONST data.edi.UblAllowanceChargeMap.amount
Section titled “CONST data.edi.UblAllowanceChargeMap.amount”エクスポートされるシンボル data.edi.UblAllowanceChargeMap.amount
export const data.edi.UblAllowanceChargeMap.amount: numberCONST data.edi.UblAllowanceChargeMap.currency
Section titled “CONST data.edi.UblAllowanceChargeMap.currency”エクスポートされるシンボル data.edi.UblAllowanceChargeMap.currency
export const data.edi.UblAllowanceChargeMap.currency: stringCONST data.googleCalendar.EventDateTime.dateTime
Section titled “CONST data.googleCalendar.EventDateTime.dateTime”時刻指定イベントのISO 8601形式の日時(例: “2024-12-26T09:00:00+09:00”)
export const data.googleCalendar.EventDateTime.dateTime: string | undefinedCONST data.googleCalendar.EventDateTime.date
Section titled “CONST data.googleCalendar.EventDateTime.date”終日イベントの日付文字列(例: “2024-12-26”)
export const data.googleCalendar.EventDateTime.date: string | undefinedCONST data.googleCalendar.EventDateTime.timeZone
Section titled “CONST data.googleCalendar.EventDateTime.timeZone”IANAタイムゾーン(例: “Asia/Tokyo”)
export const data.googleCalendar.EventDateTime.timeZone: string | undefinedCONST data.googleCalendar.EventAttendee.email
Section titled “CONST data.googleCalendar.EventAttendee.email”エクスポートされるシンボル data.googleCalendar.EventAttendee.email
export const data.googleCalendar.EventAttendee.email: stringCONST data.googleCalendar.EventAttendee.displayName
Section titled “CONST data.googleCalendar.EventAttendee.displayName”エクスポートされるシンボル data.googleCalendar.EventAttendee.displayName
export const data.googleCalendar.EventAttendee.displayName: string | undefinedCONST data.googleCalendar.EventAttendee.responseStatus
Section titled “CONST data.googleCalendar.EventAttendee.responseStatus”エクスポートされるシンボル data.googleCalendar.EventAttendee.responseStatus
export const data.googleCalendar.EventAttendee.responseStatus: "accepted" | "needsAction" | "declined" | "tentative" | undefinedCONST data.googleCalendar.EventAttendee.organizer
Section titled “CONST data.googleCalendar.EventAttendee.organizer”エクスポートされるシンボル data.googleCalendar.EventAttendee.organizer
export const data.googleCalendar.EventAttendee.organizer: boolean | undefinedCONST data.googleCalendar.EventAttendee.self
Section titled “CONST data.googleCalendar.EventAttendee.self”エクスポートされるシンボル data.googleCalendar.EventAttendee.self
export const data.googleCalendar.EventAttendee.self: boolean | undefinedCONST data.googleCalendar.EventAttendee.optional
Section titled “CONST data.googleCalendar.EventAttendee.optional”エクスポートされるシンボル data.googleCalendar.EventAttendee.optional
export const data.googleCalendar.EventAttendee.optional: boolean | undefinedCONST data.googleCalendar.EventReminder.useDefault
Section titled “CONST data.googleCalendar.EventReminder.useDefault”エクスポートされるシンボル data.googleCalendar.EventReminder.useDefault
export const data.googleCalendar.EventReminder.useDefault: booleanCONST data.googleCalendar.EventReminder.overrides
Section titled “CONST data.googleCalendar.EventReminder.overrides”エクスポートされるシンボル data.googleCalendar.EventReminder.overrides
export const data.googleCalendar.EventReminder.overrides: { method: "email" | "popup"; minutes: number; }[] | undefinedCONST data.googleCalendar.GoogleCalendarEvent.id
Section titled “CONST data.googleCalendar.GoogleCalendarEvent.id”ローカルイベントID(UUID)
export const data.googleCalendar.GoogleCalendarEvent.id: stringCONST data.googleCalendar.GoogleCalendarEvent.googleEventId
Section titled “CONST data.googleCalendar.GoogleCalendarEvent.googleEventId”Google CalendarのイベントID(Googleから同期された場合)
export const data.googleCalendar.GoogleCalendarEvent.googleEventId: string | undefinedCONST data.googleCalendar.GoogleCalendarEvent.calendarId
Section titled “CONST data.googleCalendar.GoogleCalendarEvent.calendarId”同期元のカレンダーID(例: “primary”、メールアドレス)
export const data.googleCalendar.GoogleCalendarEvent.calendarId: string | undefinedCONST data.googleCalendar.GoogleCalendarEvent.summary
Section titled “CONST data.googleCalendar.GoogleCalendarEvent.summary”イベントのタイトル
export const data.googleCalendar.GoogleCalendarEvent.summary: stringCONST data.googleCalendar.GoogleCalendarEvent.description
Section titled “CONST data.googleCalendar.GoogleCalendarEvent.description”イベントの説明(HTMLに対応)
export const data.googleCalendar.GoogleCalendarEvent.description: string | undefinedCONST data.googleCalendar.GoogleCalendarEvent.location
Section titled “CONST data.googleCalendar.GoogleCalendarEvent.location”場所を表す文字列
export const data.googleCalendar.GoogleCalendarEvent.location: string | undefinedCONST data.googleCalendar.GoogleCalendarEvent.start
Section titled “CONST data.googleCalendar.GoogleCalendarEvent.start”イベントの開始時刻
export const data.googleCalendar.GoogleCalendarEvent.start: EventDateTimeCONST data.googleCalendar.GoogleCalendarEvent.end
Section titled “CONST data.googleCalendar.GoogleCalendarEvent.end”イベントの終了時刻
export const data.googleCalendar.GoogleCalendarEvent.end: EventDateTimeCONST data.googleCalendar.GoogleCalendarEvent.allDay
Section titled “CONST data.googleCalendar.GoogleCalendarEvent.allDay”終日イベントかどうか
export const data.googleCalendar.GoogleCalendarEvent.allDay: boolean | undefinedCONST data.googleCalendar.GoogleCalendarEvent.status
Section titled “CONST data.googleCalendar.GoogleCalendarEvent.status”イベントのステータス
export const data.googleCalendar.GoogleCalendarEvent.status: "tentative" | "confirmed" | "cancelled" | undefinedCONST data.googleCalendar.GoogleCalendarEvent.visibility
Section titled “CONST data.googleCalendar.GoogleCalendarEvent.visibility”イベントの公開範囲
export const data.googleCalendar.GoogleCalendarEvent.visibility: "default" | "public" | "private" | "confidential" | undefinedCONST data.googleCalendar.GoogleCalendarEvent.recurrence
Section titled “CONST data.googleCalendar.GoogleCalendarEvent.recurrence”繰り返しイベントのRRULE文字列
export const data.googleCalendar.GoogleCalendarEvent.recurrence: string[] | undefinedCONST data.googleCalendar.GoogleCalendarEvent.recurringEventId
Section titled “CONST data.googleCalendar.GoogleCalendarEvent.recurringEventId”繰り返しイベントの各インスタンスの親イベントID
export const data.googleCalendar.GoogleCalendarEvent.recurringEventId: string | undefinedCONST data.googleCalendar.GoogleCalendarEvent.attendees
Section titled “CONST data.googleCalendar.GoogleCalendarEvent.attendees”イベントの参加者
export const data.googleCalendar.GoogleCalendarEvent.attendees: EventAttendee[] | undefinedCONST data.googleCalendar.GoogleCalendarEvent.organizer
Section titled “CONST data.googleCalendar.GoogleCalendarEvent.organizer”イベントの主催者
export const data.googleCalendar.GoogleCalendarEvent.organizer: { email: string; displayName?: string; self?: boolean; } | undefinedCONST data.googleCalendar.GoogleCalendarEvent.creator
Section titled “CONST data.googleCalendar.GoogleCalendarEvent.creator”イベントの作成者
export const data.googleCalendar.GoogleCalendarEvent.creator: { email: string; displayName?: string; self?: boolean; } | undefinedCONST data.googleCalendar.GoogleCalendarEvent.reminders
Section titled “CONST data.googleCalendar.GoogleCalendarEvent.reminders”リマインダー設定
export const data.googleCalendar.GoogleCalendarEvent.reminders: EventReminder | undefinedCONST data.googleCalendar.GoogleCalendarEvent.uid
Section titled “CONST data.googleCalendar.GoogleCalendarEvent.uid”ユーザーID - ローカルシステムでのこのイベントの所有者
export const data.googleCalendar.GoogleCalendarEvent.uid: string | undefinedCONST data.googleCalendar.GoogleCalendarEvent.resourceId
Section titled “CONST data.googleCalendar.GoogleCalendarEvent.resourceId”リソースカレンダー連携用のリソースID
export const data.googleCalendar.GoogleCalendarEvent.resourceId: string | undefinedCONST data.googleCalendar.GoogleCalendarEvent.color
Section titled “CONST data.googleCalendar.GoogleCalendarEvent.color”カスタム色による上書き(16進数または色キー)
export const data.googleCalendar.GoogleCalendarEvent.color: string | undefinedCONST data.googleCalendar.GoogleCalendarEvent.customFields
Section titled “CONST data.googleCalendar.GoogleCalendarEvent.customFields”プロジェクト固有のカスタムデータ
export const data.googleCalendar.GoogleCalendarEvent.customFields: Record<string, unknown> | undefinedCONST data.googleCalendar.GoogleCalendarEvent.syncedAt
Section titled “CONST data.googleCalendar.GoogleCalendarEvent.syncedAt”最終同期のタイムスタンプ(ISO 8601)
export const data.googleCalendar.GoogleCalendarEvent.syncedAt: string | undefinedCONST data.googleCalendar.GoogleCalendarEvent.source
Section titled “CONST data.googleCalendar.GoogleCalendarEvent.source”イベントの作成元
export const data.googleCalendar.GoogleCalendarEvent.source: "local" | "google" | undefinedCONST data.googleCalendar.GoogleCalendarEvent.etag
Section titled “CONST data.googleCalendar.GoogleCalendarEvent.etag”競合検出用のGoogleのバージョンタグ
export const data.googleCalendar.GoogleCalendarEvent.etag: string | undefinedCONST data.googleCalendar.GoogleCalendarEvent.created
Section titled “CONST data.googleCalendar.GoogleCalendarEvent.created”イベントの作成日時(ISO 8601)
export const data.googleCalendar.GoogleCalendarEvent.created: string | undefinedCONST data.googleCalendar.GoogleCalendarEvent.updated
Section titled “CONST data.googleCalendar.GoogleCalendarEvent.updated”イベントの最終更新日時(ISO 8601)
export const data.googleCalendar.GoogleCalendarEvent.updated: string | undefinedCONST data.googleCalendar.GoogleCalendarEvent.htmlLink
Section titled “CONST data.googleCalendar.GoogleCalendarEvent.htmlLink”Google Calendar上のイベントへのHTMLリンク
export const data.googleCalendar.GoogleCalendarEvent.htmlLink: string | undefinedCONST data.googleCalendar.CalendarListEntry.id
Section titled “CONST data.googleCalendar.CalendarListEntry.id”エクスポートされるシンボル data.googleCalendar.CalendarListEntry.id
export const data.googleCalendar.CalendarListEntry.id: stringCONST data.googleCalendar.CalendarListEntry.summary
Section titled “CONST data.googleCalendar.CalendarListEntry.summary”エクスポートされるシンボル data.googleCalendar.CalendarListEntry.summary
export const data.googleCalendar.CalendarListEntry.summary: stringCONST data.googleCalendar.CalendarListEntry.description
Section titled “CONST data.googleCalendar.CalendarListEntry.description”エクスポートされるシンボル data.googleCalendar.CalendarListEntry.description
export const data.googleCalendar.CalendarListEntry.description: string | undefinedCONST data.googleCalendar.CalendarListEntry.primary
Section titled “CONST data.googleCalendar.CalendarListEntry.primary”エクスポートされるシンボル data.googleCalendar.CalendarListEntry.primary
export const data.googleCalendar.CalendarListEntry.primary: boolean | undefinedCONST data.googleCalendar.CalendarListEntry.accessRole
Section titled “CONST data.googleCalendar.CalendarListEntry.accessRole”エクスポートされるシンボル data.googleCalendar.CalendarListEntry.accessRole
export const data.googleCalendar.CalendarListEntry.accessRole: "freeBusyReader" | "reader" | "writer" | "owner" | undefinedCONST data.googleCalendar.CalendarListEntry.backgroundColor
Section titled “CONST data.googleCalendar.CalendarListEntry.backgroundColor”エクスポートされるシンボル data.googleCalendar.CalendarListEntry.backgroundColor
export const data.googleCalendar.CalendarListEntry.backgroundColor: string | undefinedCONST data.googleCalendar.CalendarListEntry.foregroundColor
Section titled “CONST data.googleCalendar.CalendarListEntry.foregroundColor”エクスポートされるシンボル data.googleCalendar.CalendarListEntry.foregroundColor
export const data.googleCalendar.CalendarListEntry.foregroundColor: string | undefinedCONST data.googleCalendar.CalendarListEntry.selected
Section titled “CONST data.googleCalendar.CalendarListEntry.selected”エクスポートされるシンボル data.googleCalendar.CalendarListEntry.selected
export const data.googleCalendar.CalendarListEntry.selected: boolean | undefinedCONST data.googleCalendar.CalendarListEntry.timeZone
Section titled “CONST data.googleCalendar.CalendarListEntry.timeZone”エクスポートされるシンボル data.googleCalendar.CalendarListEntry.timeZone
export const data.googleCalendar.CalendarListEntry.timeZone: string | undefinedCONST data.googleCalendar.TokenResponse.access_token
Section titled “CONST data.googleCalendar.TokenResponse.access_token”エクスポートされるシンボル data.googleCalendar.TokenResponse.access_token
export const data.googleCalendar.TokenResponse.access_token: stringCONST data.googleCalendar.TokenResponse.expires_in
Section titled “CONST data.googleCalendar.TokenResponse.expires_in”エクスポートされるシンボル data.googleCalendar.TokenResponse.expires_in
export const data.googleCalendar.TokenResponse.expires_in: numberCONST data.googleCalendar.TokenResponse.token_type
Section titled “CONST data.googleCalendar.TokenResponse.token_type”エクスポートされるシンボル data.googleCalendar.TokenResponse.token_type
export const data.googleCalendar.TokenResponse.token_type: stringCONST data.googleCalendar.TokenResponse.scope
Section titled “CONST data.googleCalendar.TokenResponse.scope”エクスポートされるシンボル data.googleCalendar.TokenResponse.scope
export const data.googleCalendar.TokenResponse.scope: stringCONST data.googleCalendar.TokenResponse.error
Section titled “CONST data.googleCalendar.TokenResponse.error”エクスポートされるシンボル data.googleCalendar.TokenResponse.error
export const data.googleCalendar.TokenResponse.error: string | undefinedCONST data.googleCalendar.TokenResponse.error_description
Section titled “CONST data.googleCalendar.TokenResponse.error_description”エクスポートされるシンボル data.googleCalendar.TokenResponse.error_description
export const data.googleCalendar.TokenResponse.error_description: string | undefinedCONST data.googleCalendar.GoogleAuthState.isAuthenticated
Section titled “CONST data.googleCalendar.GoogleAuthState.isAuthenticated”エクスポートされるシンボル data.googleCalendar.GoogleAuthState.isAuthenticated
export const data.googleCalendar.GoogleAuthState.isAuthenticated: booleanCONST data.googleCalendar.GoogleAuthState.accessToken
Section titled “CONST data.googleCalendar.GoogleAuthState.accessToken”エクスポートされるシンボル data.googleCalendar.GoogleAuthState.accessToken
export const data.googleCalendar.GoogleAuthState.accessToken: string | nullCONST data.googleCalendar.GoogleAuthState.expiresAt
Section titled “CONST data.googleCalendar.GoogleAuthState.expiresAt”エクスポートされるシンボル data.googleCalendar.GoogleAuthState.expiresAt
export const data.googleCalendar.GoogleAuthState.expiresAt: number | nullCONST data.googleCalendar.GoogleAuthState.userEmail
Section titled “CONST data.googleCalendar.GoogleAuthState.userEmail”エクスポートされるシンボル data.googleCalendar.GoogleAuthState.userEmail
export const data.googleCalendar.GoogleAuthState.userEmail: string | undefinedCONST data.googleCalendar.GoogleAuthState.error
Section titled “CONST data.googleCalendar.GoogleAuthState.error”エクスポートされるシンボル data.googleCalendar.GoogleAuthState.error
export const data.googleCalendar.GoogleAuthState.error: string | undefinedCONST data.googleCalendar.GoogleAuthConfig.clientId
Section titled “CONST data.googleCalendar.GoogleAuthConfig.clientId”エクスポートされるシンボル data.googleCalendar.GoogleAuthConfig.clientId
export const data.googleCalendar.GoogleAuthConfig.clientId: stringCONST data.googleCalendar.GoogleAuthConfig.scopes
Section titled “CONST data.googleCalendar.GoogleAuthConfig.scopes”エクスポートされるシンボル data.googleCalendar.GoogleAuthConfig.scopes
export const data.googleCalendar.GoogleAuthConfig.scopes: string[] | undefinedCONST data.googleCalendar.GoogleAuthConfig.autoSelect
Section titled “CONST data.googleCalendar.GoogleAuthConfig.autoSelect”利用可能なアカウントが1つだけの場合に自動選択します
export const data.googleCalendar.GoogleAuthConfig.autoSelect: boolean | undefinedCONST data.googleCalendar.SyncOptions.calendarId
Section titled “CONST data.googleCalendar.SyncOptions.calendarId”同期するカレンダーID(デフォルト: “primary”)
export const data.googleCalendar.SyncOptions.calendarId: string | undefinedCONST data.googleCalendar.SyncOptions.timeMin
Section titled “CONST data.googleCalendar.SyncOptions.timeMin”イベントの時刻の下限
export const data.googleCalendar.SyncOptions.timeMin: Date | undefinedCONST data.googleCalendar.SyncOptions.timeMax
Section titled “CONST data.googleCalendar.SyncOptions.timeMax”イベントの時刻の上限
export const data.googleCalendar.SyncOptions.timeMax: Date | undefinedCONST data.googleCalendar.SyncOptions.maxResults
Section titled “CONST data.googleCalendar.SyncOptions.maxResults”取得するイベントの最大数
export const data.googleCalendar.SyncOptions.maxResults: number | undefinedCONST data.googleCalendar.SyncOptions.uid
Section titled “CONST data.googleCalendar.SyncOptions.uid”インポートしたイベントに関連付けるユーザーID
export const data.googleCalendar.SyncOptions.uid: string | undefinedCONST data.googleCalendar.SyncOptions.showDeleted
Section titled “CONST data.googleCalendar.SyncOptions.showDeleted”削除されたイベントを含めるかどうか
export const data.googleCalendar.SyncOptions.showDeleted: boolean | undefinedCONST data.googleCalendar.SyncResult.success
Section titled “CONST data.googleCalendar.SyncResult.success”エクスポートされるシンボル data.googleCalendar.SyncResult.success
export const data.googleCalendar.SyncResult.success: booleanCONST data.googleCalendar.SyncResult.eventsImported
Section titled “CONST data.googleCalendar.SyncResult.eventsImported”エクスポートされるシンボル data.googleCalendar.SyncResult.eventsImported
export const data.googleCalendar.SyncResult.eventsImported: number | undefinedCONST data.googleCalendar.SyncResult.eventsExported
Section titled “CONST data.googleCalendar.SyncResult.eventsExported”エクスポートされるシンボル data.googleCalendar.SyncResult.eventsExported
export const data.googleCalendar.SyncResult.eventsExported: number | undefinedCONST data.googleCalendar.SyncResult.eventsUpdated
Section titled “CONST data.googleCalendar.SyncResult.eventsUpdated”エクスポートされるシンボル data.googleCalendar.SyncResult.eventsUpdated
export const data.googleCalendar.SyncResult.eventsUpdated: number | undefinedCONST data.googleCalendar.SyncResult.eventsDeleted
Section titled “CONST data.googleCalendar.SyncResult.eventsDeleted”エクスポートされるシンボル data.googleCalendar.SyncResult.eventsDeleted
export const data.googleCalendar.SyncResult.eventsDeleted: number | undefinedCONST data.googleCalendar.SyncResult.errors
Section titled “CONST data.googleCalendar.SyncResult.errors”エクスポートされるシンボル data.googleCalendar.SyncResult.errors
export const data.googleCalendar.SyncResult.errors: string[] | undefinedCONST data.googleCalendar.SyncResult.syncToken
Section titled “CONST data.googleCalendar.SyncResult.syncToken”エクスポートされるシンボル data.googleCalendar.SyncResult.syncToken
export const data.googleCalendar.SyncResult.syncToken: string | undefinedCONST data.googleCalendar.EventsListResponse.kind
Section titled “CONST data.googleCalendar.EventsListResponse.kind”エクスポートされるシンボル data.googleCalendar.EventsListResponse.kind
export const data.googleCalendar.EventsListResponse.kind: stringCONST data.googleCalendar.EventsListResponse.etag
Section titled “CONST data.googleCalendar.EventsListResponse.etag”エクスポートされるシンボル data.googleCalendar.EventsListResponse.etag
export const data.googleCalendar.EventsListResponse.etag: stringCONST data.googleCalendar.EventsListResponse.summary
Section titled “CONST data.googleCalendar.EventsListResponse.summary”エクスポートされるシンボル data.googleCalendar.EventsListResponse.summary
export const data.googleCalendar.EventsListResponse.summary: stringCONST data.googleCalendar.EventsListResponse.updated
Section titled “CONST data.googleCalendar.EventsListResponse.updated”エクスポートされるシンボル data.googleCalendar.EventsListResponse.updated
export const data.googleCalendar.EventsListResponse.updated: stringCONST data.googleCalendar.EventsListResponse.timeZone
Section titled “CONST data.googleCalendar.EventsListResponse.timeZone”エクスポートされるシンボル data.googleCalendar.EventsListResponse.timeZone
export const data.googleCalendar.EventsListResponse.timeZone: stringCONST data.googleCalendar.EventsListResponse.accessRole
Section titled “CONST data.googleCalendar.EventsListResponse.accessRole”エクスポートされるシンボル data.googleCalendar.EventsListResponse.accessRole
export const data.googleCalendar.EventsListResponse.accessRole: stringCONST data.googleCalendar.EventsListResponse.nextPageToken
Section titled “CONST data.googleCalendar.EventsListResponse.nextPageToken”エクスポートされるシンボル data.googleCalendar.EventsListResponse.nextPageToken
export const data.googleCalendar.EventsListResponse.nextPageToken: string | undefinedCONST data.googleCalendar.EventsListResponse.nextSyncToken
Section titled “CONST data.googleCalendar.EventsListResponse.nextSyncToken”エクスポートされるシンボル data.googleCalendar.EventsListResponse.nextSyncToken
export const data.googleCalendar.EventsListResponse.nextSyncToken: string | undefinedCONST data.googleCalendar.EventsListResponse.items
Section titled “CONST data.googleCalendar.EventsListResponse.items”エクスポートされるシンボル data.googleCalendar.EventsListResponse.items
export const data.googleCalendar.EventsListResponse.items: GoogleCalendarEvent[]CONST data.googleCalendar.CalendarListResponse.kind
Section titled “CONST data.googleCalendar.CalendarListResponse.kind”エクスポートされるシンボル data.googleCalendar.CalendarListResponse.kind
export const data.googleCalendar.CalendarListResponse.kind: stringCONST data.googleCalendar.CalendarListResponse.etag
Section titled “CONST data.googleCalendar.CalendarListResponse.etag”エクスポートされるシンボル data.googleCalendar.CalendarListResponse.etag
export const data.googleCalendar.CalendarListResponse.etag: stringCONST data.googleCalendar.CalendarListResponse.nextPageToken
Section titled “CONST data.googleCalendar.CalendarListResponse.nextPageToken”エクスポートされるシンボル data.googleCalendar.CalendarListResponse.nextPageToken
export const data.googleCalendar.CalendarListResponse.nextPageToken: string | undefinedCONST data.googleCalendar.CalendarListResponse.nextSyncToken
Section titled “CONST data.googleCalendar.CalendarListResponse.nextSyncToken”エクスポートされるシンボル data.googleCalendar.CalendarListResponse.nextSyncToken
export const data.googleCalendar.CalendarListResponse.nextSyncToken: string | undefinedCONST data.googleCalendar.CalendarListResponse.items
Section titled “CONST data.googleCalendar.CalendarListResponse.items”エクスポートされるシンボル data.googleCalendar.CalendarListResponse.items
export const data.googleCalendar.CalendarListResponse.items: CalendarListEntry[]CONST data.googleCalendar.CalendarEvent.id
Section titled “CONST data.googleCalendar.CalendarEvent.id”一意の識別子
export const data.googleCalendar.CalendarEvent.id: stringCONST data.googleCalendar.CalendarEvent.resourceId
Section titled “CONST data.googleCalendar.CalendarEvent.resourceId”関連するリソースID
export const data.googleCalendar.CalendarEvent.resourceId: string | undefinedCONST data.googleCalendar.CalendarEvent.title
Section titled “CONST data.googleCalendar.CalendarEvent.title”イベントのタイトル
export const data.googleCalendar.CalendarEvent.title: stringCONST data.googleCalendar.CalendarEvent.start
Section titled “CONST data.googleCalendar.CalendarEvent.start”開始日時
export const data.googleCalendar.CalendarEvent.start: DateCONST data.googleCalendar.CalendarEvent.end
Section titled “CONST data.googleCalendar.CalendarEvent.end”終了日時(この日時は含みません)。開始日時より後である必要があります。
export const data.googleCalendar.CalendarEvent.end: DateCONST data.googleCalendar.CalendarEvent.description
Section titled “CONST data.googleCalendar.CalendarEvent.description”説明
export const data.googleCalendar.CalendarEvent.description: string | undefinedCONST data.googleCalendar.CalendarEvent.color
Section titled “CONST data.googleCalendar.CalendarEvent.color”色の上書き
export const data.googleCalendar.CalendarEvent.color: string | undefinedCONST data.googleCalendar.CalendarEvent.className
Section titled “CONST data.googleCalendar.CalendarEvent.className”カスタムCSSクラス
export const data.googleCalendar.CalendarEvent.className: string | undefinedCONST data.googleCalendar.CalendarEvent.allDay
Section titled “CONST data.googleCalendar.CalendarEvent.allDay”イベントが終日かどうか
export const data.googleCalendar.CalendarEvent.allDay: boolean | undefinedCONST data.googleCalendar.CalendarEvent.googleEvent
Section titled “CONST data.googleCalendar.CalendarEvent.googleEvent”関連するGoogle Calendarデータ
export const data.googleCalendar.CalendarEvent.googleEvent: GoogleCalendarEvent | undefinedFUNCTION data.googleCalendar.GoogleCalendarClient.listCalendars
Section titled “FUNCTION data.googleCalendar.GoogleCalendarClient.listCalendars”ユーザーがアクセスできるすべてのカレンダーを一覧表示します
async listCalendars(): Promise<CalendarListEntry[]>戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<CalendarListEntry[]>
FUNCTION data.googleCalendar.GoogleCalendarClient.getCalendar
Section titled “FUNCTION data.googleCalendar.GoogleCalendarClient.getCalendar”IDを指定して特定のカレンダーを取得します
async getCalendar(calendarId: string): Promise<CalendarListEntry>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
calendarId |
string |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<CalendarListEntry>
FUNCTION data.googleCalendar.GoogleCalendarClient.listEvents
Section titled “FUNCTION data.googleCalendar.GoogleCalendarClient.listEvents”カレンダーのイベントを一覧表示します
async listEvents( calendarId: string = 'primary', options?: { timeMin?: Date; timeMax?: Date; maxResults?: number; pageToken?: string; syncToken?: string; singleEvents?: boolean; orderBy?: 'startTime' | 'updated'; showDeleted?: boolean; q?: string; // Free text search }, ): Promise<EventsListResponse>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
calendarId |
string |
任意 | - カレンダーID(メインのカレンダーには“primary”を使用します) |
options |
{ timeMin?: Date; timeMax?: Date; maxResults?: number; pageToken?: string; syncToken?: string; singleEvents?: boolean; orderBy?: "startTime" | "updated"; showDeleted?: boolean; q?: string; } | undefined |
任意 | - クエリオプション |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<EventsListResponse>
FUNCTION data.googleCalendar.GoogleCalendarClient.listAllEvents
Section titled “FUNCTION data.googleCalendar.GoogleCalendarClient.listAllEvents”すべてのイベントを取得します(ページネーションを処理します)
async listAllEvents( calendarId: string = 'primary', options?: { timeMin?: Date; timeMax?: Date; maxResults?: number; singleEvents?: boolean; orderBy?: 'startTime' | 'updated'; }, ): Promise<GoogleCalendarEvent[]>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
calendarId |
string |
任意 | |
options |
{ timeMin?: Date; timeMax?: Date; maxResults?: number; singleEvents?: boolean; orderBy?: "startTime" | "updated"; } | undefined |
任意 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<GoogleCalendarEvent[]>
FUNCTION data.googleCalendar.GoogleCalendarClient.getEvent
Section titled “FUNCTION data.googleCalendar.GoogleCalendarClient.getEvent”IDを指定して1件のイベントを取得します
async getEvent(calendarId: string, eventId: string): Promise<GoogleCalendarEvent>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
calendarId |
string |
必須 | |
eventId |
string |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<GoogleCalendarEvent>
FUNCTION data.googleCalendar.GoogleCalendarClient.createEvent
Section titled “FUNCTION data.googleCalendar.GoogleCalendarClient.createEvent”新しいイベントを作成します
async createEvent( calendarId: string, event: Partial<GoogleCalendarEvent>, ): Promise<GoogleCalendarEvent>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
calendarId |
string |
必須 | |
event |
Partial<GoogleCalendarEvent> |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<GoogleCalendarEvent>
FUNCTION data.googleCalendar.GoogleCalendarClient.updateEvent
Section titled “FUNCTION data.googleCalendar.GoogleCalendarClient.updateEvent”既存のイベントを更新します
async updateEvent( calendarId: string, eventId: string, event: Partial<GoogleCalendarEvent>, ): Promise<GoogleCalendarEvent>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
calendarId |
string |
必須 | |
eventId |
string |
必須 | |
event |
Partial<GoogleCalendarEvent> |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<GoogleCalendarEvent>
FUNCTION data.googleCalendar.GoogleCalendarClient.patchEvent
Section titled “FUNCTION data.googleCalendar.GoogleCalendarClient.patchEvent”既存のイベントにパッチを適用します(部分更新)
async patchEvent( calendarId: string, eventId: string, event: Partial<GoogleCalendarEvent>, ): Promise<GoogleCalendarEvent>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
calendarId |
string |
必須 | |
eventId |
string |
必須 | |
event |
Partial<GoogleCalendarEvent> |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<GoogleCalendarEvent>
FUNCTION data.googleCalendar.GoogleCalendarClient.deleteEvent
Section titled “FUNCTION data.googleCalendar.GoogleCalendarClient.deleteEvent”イベントを削除します
async deleteEvent(calendarId: string, eventId: string): Promise<void>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
calendarId |
string |
必須 | |
eventId |
string |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<void>
FUNCTION data.googleCalendar.GoogleCalendarClient.moveEvent
Section titled “FUNCTION data.googleCalendar.GoogleCalendarClient.moveEvent”イベントを別のカレンダーに移動します
async moveEvent( sourceCalendarId: string, eventId: string, destinationCalendarId: string, ): Promise<GoogleCalendarEvent>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
sourceCalendarId |
string |
必須 | |
eventId |
string |
必須 | |
destinationCalendarId |
string |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<GoogleCalendarEvent>
FUNCTION data.googleCalendar.GoogleCalendarClient.quickAddEvent
Section titled “FUNCTION data.googleCalendar.GoogleCalendarClient.quickAddEvent”自然言語のテキストからイベントを簡単に追加します
async quickAddEvent(calendarId: string, text: string): Promise<GoogleCalendarEvent>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
calendarId |
string |
必須 | |
text |
string |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<GoogleCalendarEvent>
使用例 (Example)
Section titled “使用例 (Example)”```tsconst event = await client.quickAddEvent('primary', 'Meeting with Bob tomorrow at 3pm');---
### `CONST` `data.CalendarEvent.id`
一意の識別子
```typescriptexport const data.CalendarEvent.id: stringCONST data.CalendarEvent.resourceId
Section titled “CONST data.CalendarEvent.resourceId”関連するリソースID
export const data.CalendarEvent.resourceId: string | undefinedCONST data.CalendarEvent.title
Section titled “CONST data.CalendarEvent.title”イベントのタイトル
export const data.CalendarEvent.title: stringCONST data.CalendarEvent.start
Section titled “CONST data.CalendarEvent.start”開始日時
export const data.CalendarEvent.start: DateCONST data.CalendarEvent.end
Section titled “CONST data.CalendarEvent.end”終了日時(この日時は含みません)。開始日時より後である必要があります。
export const data.CalendarEvent.end: DateCONST data.CalendarEvent.description
Section titled “CONST data.CalendarEvent.description”説明
export const data.CalendarEvent.description: string | undefinedCONST data.CalendarEvent.color
Section titled “CONST data.CalendarEvent.color”色の上書き
export const data.CalendarEvent.color: string | undefinedCONST data.CalendarEvent.className
Section titled “CONST data.CalendarEvent.className”カスタムCSSクラス
export const data.CalendarEvent.className: string | undefinedCONST data.CalendarEvent.allDay
Section titled “CONST data.CalendarEvent.allDay”イベントが終日かどうか
export const data.CalendarEvent.allDay: boolean | undefinedCONST data.CalendarEvent.googleEvent
Section titled “CONST data.CalendarEvent.googleEvent”関連するGoogle Calendarデータ
export const data.CalendarEvent.googleEvent: GoogleCalendarEvent | undefinedCONST data.FieldDefinition.type
Section titled “CONST data.FieldDefinition.type”エクスポートされるシンボル data.FieldDefinition.type
export const data.FieldDefinition.type: FieldTypeCONST data.FieldDefinition.label
Section titled “CONST data.FieldDefinition.label”エクスポートされるシンボル data.FieldDefinition.label
export const data.FieldDefinition.label: string | undefinedCONST data.FieldDefinition.group
Section titled “CONST data.FieldDefinition.group”エクスポートされるシンボル data.FieldDefinition.group
export const data.FieldDefinition.group: string | undefinedCONST data.FieldDefinition.width
Section titled “CONST data.FieldDefinition.width”フィールド幅のヒント(レスポンシブグリッドで使用します)
export const data.FieldDefinition.width: FieldWidth | undefinedCONST data.FieldDefinition.advanced
Section titled “CONST data.FieldDefinition.advanced”詳細設定フィールドとしてマークします(折りたたみ可能なセクションに表示されます)
export const data.FieldDefinition.advanced: boolean | undefinedCONST data.FieldDefinition.step
Section titled “CONST data.FieldDefinition.step”複数ステップフォームのステップ番号(1始まり)
export const data.FieldDefinition.step: number | undefinedCONST data.FieldDefinition.required
Section titled “CONST data.FieldDefinition.required”エクスポートされるシンボル data.FieldDefinition.required
export const data.FieldDefinition.required: boolean | undefinedCONST data.FieldDefinition.min
Section titled “CONST data.FieldDefinition.min”エクスポートされるシンボル data.FieldDefinition.min
export const data.FieldDefinition.min: number | undefinedCONST data.FieldDefinition.max
Section titled “CONST data.FieldDefinition.max”エクスポートされるシンボル data.FieldDefinition.max
export const data.FieldDefinition.max: number | undefinedCONST data.FieldDefinition.minLength
Section titled “CONST data.FieldDefinition.minLength”エクスポートされるシンボル data.FieldDefinition.minLength
export const data.FieldDefinition.minLength: number | undefinedCONST data.FieldDefinition.maxLength
Section titled “CONST data.FieldDefinition.maxLength”エクスポートされるシンボル data.FieldDefinition.maxLength
export const data.FieldDefinition.maxLength: number | undefinedCONST data.FieldDefinition.pattern
Section titled “CONST data.FieldDefinition.pattern”エクスポートされるシンボル data.FieldDefinition.pattern
export const data.FieldDefinition.pattern: string | undefinedCONST data.FieldDefinition.options
Section titled “CONST data.FieldDefinition.options”エクスポートされるシンボル data.FieldDefinition.options
export const data.FieldDefinition.options: { label: string; value: string | number; }[] | undefinedCONST data.FieldDefinition.enum
Section titled “CONST data.FieldDefinition.enum”エクスポートされるシンボル data.FieldDefinition.enum
export const data.FieldDefinition.enum: (string | number)[] | undefinedCONST data.FieldDefinition.placeholder
Section titled “CONST data.FieldDefinition.placeholder”エクスポートされるシンボル data.FieldDefinition.placeholder
export const data.FieldDefinition.placeholder: string | undefinedCONST data.FieldDefinition.description
Section titled “CONST data.FieldDefinition.description”エクスポートされるシンボル data.FieldDefinition.description
export const data.FieldDefinition.description: string | undefinedCONST data.FieldDefinition.defaultValue
Section titled “CONST data.FieldDefinition.defaultValue”エクスポートされるシンボル data.FieldDefinition.defaultValue
export const data.FieldDefinition.defaultValue: unknownCONST data.FieldDefinition.unique
Section titled “CONST data.FieldDefinition.unique”エクスポートされるシンボル data.FieldDefinition.unique
export const data.FieldDefinition.unique: boolean | undefinedCONST data.FieldDefinition.primaryKey
Section titled “CONST data.FieldDefinition.primaryKey”エクスポートされるシンボル data.FieldDefinition.primaryKey
export const data.FieldDefinition.primaryKey: boolean | undefinedCONST data.FieldDefinition.references
Section titled “CONST data.FieldDefinition.references”エクスポートされるシンボル data.FieldDefinition.references
export const data.FieldDefinition.references: { table: string; column?: string; onDelete?: "cascade" | "restrict" | "set null" | "no action"; multiple?: boolean; ui?: FieldRelationDefinition; } | undefinedCONST data.FieldDefinition.disabled
Section titled “CONST data.FieldDefinition.disabled”UI状態: フィールドが無効または読み取り専用です
export const data.FieldDefinition.disabled: boolean | undefinedCONST data.FieldDefinition.hidden
Section titled “CONST data.FieldDefinition.hidden”UI状態: フィールドが非表示です
export const data.FieldDefinition.hidden: boolean | undefinedCONST data.FieldDefinition.enumRef
Section titled “CONST data.FieldDefinition.enumRef”enum定数名への参照(例: ‘role’、‘prefecture’)
export const data.FieldDefinition.enumRef: string | undefinedCONST data.FieldDefinition.span
Section titled “CONST data.FieldDefinition.span”グリッドの列占有数(1-12)
export const data.FieldDefinition.span: number | undefinedCONST data.FieldDefinition.items
Section titled “CONST data.FieldDefinition.items”’array’型の場合: 要素のスキーマを定義します
export const data.FieldDefinition.items: FieldDefinition | undefinedCONST data.FieldDefinition.properties
Section titled “CONST data.FieldDefinition.properties”’object’型の場合: ネストされたフィールドのスキーマを定義します
export const data.FieldDefinition.properties: Record<string, FieldDefinition> | undefinedCONST data.FieldRelationDefinition.displayField
Section titled “CONST data.FieldRelationDefinition.displayField”エクスポートされるシンボル data.FieldRelationDefinition.displayField
export const data.FieldRelationDefinition.displayField: stringCONST data.FieldRelationDefinition.inputDisplay
Section titled “CONST data.FieldRelationDefinition.inputDisplay”エクスポートされるシンボル data.FieldRelationDefinition.inputDisplay
export const data.FieldRelationDefinition.inputDisplay: RelationInputDisplay | undefinedCONST data.FieldRelationDefinition.validateKey
Section titled “CONST data.FieldRelationDefinition.validateKey”エクスポートされるシンボル data.FieldRelationDefinition.validateKey
export const data.FieldRelationDefinition.validateKey: boolean | undefinedCONST data.FieldRelationDefinition.searchMode
Section titled “CONST data.FieldRelationDefinition.searchMode”エクスポートされるシンボル data.FieldRelationDefinition.searchMode
export const data.FieldRelationDefinition.searchMode: RelationSearchMode | undefinedCONST data.FieldRelationDefinition.searchFields
Section titled “CONST data.FieldRelationDefinition.searchFields”エクスポートされるシンボル data.FieldRelationDefinition.searchFields
export const data.FieldRelationDefinition.searchFields: string[] | undefinedCONST data.FieldRelationDefinition.searchTitle
Section titled “CONST data.FieldRelationDefinition.searchTitle”エクスポートされるシンボル data.FieldRelationDefinition.searchTitle
export const data.FieldRelationDefinition.searchTitle: string | undefinedCONST data.SchemaDefinition.name
Section titled “CONST data.SchemaDefinition.name”エクスポートされるシンボル data.SchemaDefinition.name
export const data.SchemaDefinition.name: stringCONST data.SchemaDefinition.table
Section titled “CONST data.SchemaDefinition.table”エクスポートされるシンボル data.SchemaDefinition.table
export const data.SchemaDefinition.table: string | undefinedCONST data.SchemaDefinition.fields
Section titled “CONST data.SchemaDefinition.fields”エクスポートされるシンボル data.SchemaDefinition.fields
export const data.SchemaDefinition.fields: Record<string, FieldDefinition>CONST data.SchemaDefinition.steps
Section titled “CONST data.SchemaDefinition.steps”複数ステップフォームのステップ定義
export const data.SchemaDefinition.steps: SchemaStep[] | undefinedCONST data.XUISearchSourceOptions.collection
Section titled “CONST data.XUISearchSourceOptions.collection”対象のコレクション名またはテーブル名
export const data.XUISearchSourceOptions.collection: stringCONST data.XUISearchSourceOptions.idField
Section titled “CONST data.XUISearchSourceOptions.idField”IDフィールド名(デフォルト: id)
export const data.XUISearchSourceOptions.idField: string | undefinedCONST data.XUISearchSourceOptions.labelField
Section titled “CONST data.XUISearchSourceOptions.labelField”ラベルフィールド名(デフォルト: name)
export const data.XUISearchSourceOptions.labelField: string | undefinedCONST data.XUISearchSourceOptions.descriptionField
Section titled “CONST data.XUISearchSourceOptions.descriptionField”説明フィールド名(省略可能)
export const data.XUISearchSourceOptions.descriptionField: string | undefinedCONST data.XUISearchSourceOptions.baseFilter
Section titled “CONST data.XUISearchSourceOptions.baseFilter”追加フィルター(省略可能)
export const data.XUISearchSourceOptions.baseFilter: Record<string, unknown> | undefinedCONST data.XUISearchSourceOptions.limit
Section titled “CONST data.XUISearchSourceOptions.limit”取得する結果の件数(デフォルト: 20)
export const data.XUISearchSourceOptions.limit: number | undefinedCONST data.XUISearchSourceOptions.createEnabled
Section titled “CONST data.XUISearchSourceOptions.createEnabled”候補がゼロ件の場合に新規レコードの作成を許可します
export const data.XUISearchSourceOptions.createEnabled: boolean | undefinedCONST data.XUIOptions.widget
Section titled “CONST data.XUIOptions.widget”入力UIコンポーネント
export const data.XUIOptions.widget: "color" | "prefecture" | "password" | "select" | "textarea" | "radio" | "range" | "hidden" | "checkbox" | "country" | "subdivision" | "postalcode" | "state" | "province" | undefinedCONST data.XUIOptions.label
Section titled “CONST data.XUIOptions.label”表示ラベル
export const data.XUIOptions.label: string | undefinedCONST data.XUIOptions.placeholder
Section titled “CONST data.XUIOptions.placeholder”プレースホルダーテキスト
export const data.XUIOptions.placeholder: string | undefinedCONST data.XUIOptions.help
Section titled “CONST data.XUIOptions.help”補足のヘルプテキスト
export const data.XUIOptions.help: string | undefinedCONST data.XUIOptions.hidden
Section titled “CONST data.XUIOptions.hidden”非表示フラグ
export const data.XUIOptions.hidden: boolean | undefinedCONST data.XUIOptions.readOnly
Section titled “CONST data.XUIOptions.readOnly”読み取り専用
export const data.XUIOptions.readOnly: boolean | undefinedCONST data.XUIOptions.disabled
Section titled “CONST data.XUIOptions.disabled”無効
export const data.XUIOptions.disabled: boolean | undefinedCONST data.XUIOptions.autoFocus
Section titled “CONST data.XUIOptions.autoFocus”自動フォーカス
export const data.XUIOptions.autoFocus: boolean | undefinedCONST data.XUIOptions.prefix
Section titled “CONST data.XUIOptions.prefix”入力フィールドの先頭に表示するアイコンまたはテキスト
export const data.XUIOptions.prefix: string | undefinedCONST data.XUIOptions.suffix
Section titled “CONST data.XUIOptions.suffix”入力フィールドの末尾に表示するアイコンまたはテキスト
export const data.XUIOptions.suffix: string | undefinedCONST data.XUIOptions.options
Section titled “CONST data.XUIOptions.options”選択肢(enumとは別に明示するラベル)
export const data.XUIOptions.options: { label: string; value: string | number; }[] | undefinedCONST data.XUIOptions.allowCustom
Section titled “CONST data.XUIOptions.allowCustom”selectで候補にない任意のカスタム入力を許可します
export const data.XUIOptions.allowCustom: boolean | undefinedCONST data.XUIOptions.searchSource
Section titled “CONST data.XUIOptions.searchSource”DataAccessを使用する非同期検索の設定
export const data.XUIOptions.searchSource: XUISearchSourceOptions | undefinedCONST data.XUIOptions.searchDebounceMs
Section titled “CONST data.XUIOptions.searchDebounceMs”非同期検索のデバウンス時間(ms)
export const data.XUIOptions.searchDebounceMs: number | undefinedCONST data.XUIOptions.searchMinLength
Section titled “CONST data.XUIOptions.searchMinLength”非同期検索を開始する最小文字数
export const data.XUIOptions.searchMinLength: number | undefinedCONST data.XUIOptions.noOptionsMessage
Section titled “CONST data.XUIOptions.noOptionsMessage”一致する選択肢がない場合のメッセージ
export const data.XUIOptions.noOptionsMessage: string | undefinedCONST data.XUIOptions.createDialogTitle
Section titled “CONST data.XUIOptions.createDialogTitle”候補がゼロ件の場合に新規項目を作成するダイアログのタイトル
export const data.XUIOptions.createDialogTitle: string | undefinedCONST data.XUIOptions.createIdLabel
Section titled “CONST data.XUIOptions.createIdLabel”作成ダイアログのIDラベル
export const data.XUIOptions.createIdLabel: string | undefinedCONST data.XUIOptions.createNameLabel
Section titled “CONST data.XUIOptions.createNameLabel”作成ダイアログの名前ラベル
export const data.XUIOptions.createNameLabel: string | undefinedCONST data.XUIOptions.dependsOn
Section titled “CONST data.XUIOptions.dependsOn”依存先のフィールド名(行政区画フィールドが参照する国フィールド)
export const data.XUIOptions.dependsOn: string | undefinedCONST data.XUIOptions.countryField
Section titled “CONST data.XUIOptions.countryField”国フィールド名(郵便番号の検証用)
export const data.XUIOptions.countryField: string | undefinedCONST data.XUIOptions.useIsoCode
Section titled “CONST data.XUIOptions.useIsoCode”ISO形式を使用します(都道府県ウィジェット用)
export const data.XUIOptions.useIsoCode: boolean | undefinedCONST data.XUIOptions.autoFormat
Section titled “CONST data.XUIOptions.autoFormat”自動書式設定(郵便番号用)
export const data.XUIOptions.autoFormat: boolean | undefinedCONST data.XUIOptions.layout
Section titled “CONST data.XUIOptions.layout”レイアウト設定
export const data.XUIOptions.layout: { colSpan?: number | { xs?: number; sm?: number; md?: number; lg?: number; }; rowSpan?: number; order?: number; section?: string; breakBefore?: boolean; } | undefinedCONST data.XUIOptions.style
Section titled “CONST data.XUIOptions.style”スタイル設定
export const data.XUIOptions.style: { maxWidth?: string; minHeight?: string; className?: string; } | undefinedCONST data.XUIOptions.step
Section titled “CONST data.XUIOptions.step”複数ステップフォーム: ステップ番号(1始まり)
export const data.XUIOptions.step: number | undefinedCONST data.XUIOptions.advanced
Section titled “CONST data.XUIOptions.advanced”段階的な情報開示: 折りたたまれた「詳細設定」セクションに非表示で配置します
export const data.XUIOptions.advanced: boolean | undefinedCONST data.XUIOptions.group
Section titled “CONST data.XUIOptions.group”フィールドのグループ化ラベル(セクション見出しとして表示されます)
export const data.XUIOptions.group: string | undefinedCONST data.XUIOptions.width
Section titled “CONST data.XUIOptions.width”フォームレイアウト用のフィールド幅のヒント
export const data.XUIOptions.width: "long" | "short" | "medium" | "full" | undefinedCONST data.XCodelistOptions.id
Section titled “CONST data.XCodelistOptions.id”コードリスト識別子(例: unit-codes、tax-categories)
export const data.XCodelistOptions.id: stringCONST data.XCodelistOptions.version
Section titled “CONST data.XCodelistOptions.version”任意のバージョン(例: 1.0.0)
export const data.XCodelistOptions.version: string | undefinedCONST data.XCodelistOptions.labelField
Section titled “CONST data.XCodelistOptions.labelField”UIで使用するラベルフィールド
export const data.XCodelistOptions.labelField: "label_ja" | "label_en" | undefinedCONST data.XCodelistOptions.includeDeprecated
Section titled “CONST data.XCodelistOptions.includeDeprecated”非推奨のコードを含めます
export const data.XCodelistOptions.includeDeprecated: boolean | undefinedCONST data.XCodelistOptions.fallbackOrder
Section titled “CONST data.XCodelistOptions.fallbackOrder”ラベルのフォールバック順序
export const data.XCodelistOptions.fallbackOrder: ("label_ja" | "label_en" | "code")[] | undefinedCONST data.XDBOptions.tableName
Section titled “CONST data.XDBOptions.tableName”テーブル名またはコレクション名(ルートのみ)
export const data.XDBOptions.tableName: string | undefinedCONST data.XDBOptions.columnName
Section titled “CONST data.XDBOptions.columnName”列名の上書き
export const data.XDBOptions.columnName: string | undefinedCONST data.XDBOptions.column
Section titled “CONST data.XDBOptions.column”互換性: columnNameの別名
export const data.XDBOptions.column: string | undefinedCONST data.XDBOptions.primaryKey
Section titled “CONST data.XDBOptions.primaryKey”主キーフラグ
export const data.XDBOptions.primaryKey: boolean | undefinedCONST data.XDBOptions.nullable
Section titled “CONST data.XDBOptions.nullable”DBでnullを許容するかどうかです。主キーでは常にfalseです。省略した場合、型がnullを許容するか、必須でなければtrueになります(互換性ルール)。
export const data.XDBOptions.nullable: boolean | undefinedCONST data.XDBOptions.foreignKey
Section titled “CONST data.XDBOptions.foreignKey”外部キー設定
export const data.XDBOptions.foreignKey: { table: string; field?: string; onDelete?: "cascade" | "restrict" | "set null" | "no action"; } | undefinedCONST data.XDBOptions.references
Section titled “CONST data.XDBOptions.references”互換性: foreignKeyの別名
export const data.XDBOptions.references: { table: string; column?: string; onDelete?: "cascade" | "restrict" | "set null" | "no action"; } | undefinedCONST data.XDBOptions.index
Section titled “CONST data.XDBOptions.index”インデックスの作成
export const data.XDBOptions.index: boolean | undefinedCONST data.XDBOptions.unique
Section titled “CONST data.XDBOptions.unique”一意制約
export const data.XDBOptions.unique: boolean | undefinedCONST data.XDBOptions.default
Section titled “CONST data.XDBOptions.default”DBのデフォルト値(SQL式)
export const data.XDBOptions.default: string | undefinedCONST data.XDBOptions.type
Section titled “CONST data.XDBOptions.type”DB型の上書き
export const data.XDBOptions.type: string | undefinedCONST data.XDBOptions.convexType
Section titled “CONST data.XDBOptions.convexType”Convex固有の型
export const data.XDBOptions.convexType: string | undefinedCONST data.XDBOptions.check
Section titled “CONST data.XDBOptions.check”CHECK制約(SQL式、例: “status IN (‘draft’, ‘sent’)”)
export const data.XDBOptions.check: string | undefinedCONST data.XDBOptions.asTable
Section titled “CONST data.XDBOptions.asTable”$defs内の定義を別テーブルとして生成するフラグです。 親テーブル名と親IDの列名を指定します。
export const data.XDBOptions.asTable: { tableName: string; parentColumn?: string; onDeleteCascade?: boolean; } | undefinedCONST data.XDBOptions.skip
Section titled “CONST data.XDBOptions.skip”DB生成をスキップするフラグ
export const data.XDBOptions.skip: boolean | undefinedCONST data.XZodOptions.errorMessages
Section titled “CONST data.XZodOptions.errorMessages”カスタムエラーメッセージ
export const data.XZodOptions.errorMessages: { required_error?: string; invalid_type_error?: string; too_small?: string; too_big?: string; invalid_string?: string; } | undefinedCONST data.XZodOptions.coerce
Section titled “CONST data.XZodOptions.coerce”型強制変換フラグ
export const data.XZodOptions.coerce: boolean | undefinedCONST data.XZodOptions.transform
Section titled “CONST data.XZodOptions.transform”変換処理
export const data.XZodOptions.transform: "trim" | "toLowerCase" | "toUpperCase" | undefinedCONST data.XZodOptions.refine
Section titled “CONST data.XZodOptions.refine”カスタム検証関数名
export const data.XZodOptions.refine: string | undefinedCONST data.XGenOptions.tsType
Section titled “CONST data.XGenOptions.tsType”TypeScript型の上書き
export const data.XGenOptions.tsType: string | undefinedCONST data.XRLSPolicy.roles
Section titled “CONST data.XRLSPolicy.roles”許可するロール(authenticated、admin、service_roleなど)
export const data.XRLSPolicy.roles: string[] | undefinedCONST data.XRLSPolicy.check
Section titled “CONST data.XRLSPolicy.check”SQL条件式(USING句またはWITH CHECK句で使用します)
export const data.XRLSPolicy.check: string | undefined使用例 (Example)
Section titled “使用例 (Example)”"auth.uid() = user_id"使用例 (Example)
Section titled “使用例 (Example)”"auth.role() = 'admin'"CONST data.XRLSPolicy.using
Section titled “CONST data.XRLSPolicy.using”USING句(SELECT/UPDATE/DELETE用) 既存の行に対するアクセス制御に使用します
export const data.XRLSPolicy.using: string | undefinedCONST data.XRLSPolicy.withCheck
Section titled “CONST data.XRLSPolicy.withCheck”WITH CHECK句(INSERT/UPDATE用) 新しい行の挿入時または更新時の検証に使用します
export const data.XRLSPolicy.withCheck: string | undefinedCONST data.XRLSPolicy.policyName
Section titled “CONST data.XRLSPolicy.policyName”ポリシー名の接尾辞(自動生成時に使用します)
export const data.XRLSPolicy.policyName: string | undefinedCONST data.XRLSOptions.enabled
Section titled “CONST data.XRLSOptions.enabled”RLSを有効にします(デフォルト: true)
export const data.XRLSOptions.enabled: boolean | undefinedCONST data.XRLSOptions.force
Section titled “CONST data.XRLSOptions.force”強制モード(デフォルト: false)
export const data.XRLSOptions.force: boolean | undefinedCONST data.XRLSOptions.select
Section titled “CONST data.XRLSOptions.select”SELECTポリシー
export const data.XRLSOptions.select: XRLSPolicy | undefinedCONST data.XRLSOptions.insert
Section titled “CONST data.XRLSOptions.insert”INSERTポリシー
export const data.XRLSOptions.insert: XRLSPolicy | undefinedCONST data.XRLSOptions.update
Section titled “CONST data.XRLSOptions.update”UPDATEポリシー
export const data.XRLSOptions.update: XRLSPolicy | undefinedCONST data.XRLSOptions.delete
Section titled “CONST data.XRLSOptions.delete”DELETEポリシー
export const data.XRLSOptions.delete: XRLSPolicy | undefinedCONST data.XRLSOptions.all
Section titled “CONST data.XRLSOptions.all”すべての操作に共通のポリシー(個別の設定が優先されます)
export const data.XRLSOptions.all: XRLSPolicy | undefinedCONST data.XRLSOptions.policies
Section titled “CONST data.XRLSOptions.policies”互換性: policiesの配列形式
export const data.XRLSOptions.policies: XRLSLegacyPolicy[] | undefinedCONST data.XRLSLegacyPolicy.name
Section titled “CONST data.XRLSLegacyPolicy.name”エクスポートされるシンボル data.XRLSLegacyPolicy.name
export const data.XRLSLegacyPolicy.name: stringCONST data.XRLSLegacyPolicy.operation
Section titled “CONST data.XRLSLegacyPolicy.operation”エクスポートされるシンボル data.XRLSLegacyPolicy.operation
export const data.XRLSLegacyPolicy.operation: string | string[]CONST data.XRLSLegacyPolicy.roles
Section titled “CONST data.XRLSLegacyPolicy.roles”エクスポートされるシンボル data.XRLSLegacyPolicy.roles
export const data.XRLSLegacyPolicy.roles: string[] | undefinedCONST data.XRLSLegacyPolicy.using
Section titled “CONST data.XRLSLegacyPolicy.using”エクスポートされるシンボル data.XRLSLegacyPolicy.using
export const data.XRLSLegacyPolicy.using: string | undefinedCONST data.XRLSLegacyPolicy.withCheck
Section titled “CONST data.XRLSLegacyPolicy.withCheck”エクスポートされるシンボル data.XRLSLegacyPolicy.withCheck
export const data.XRLSLegacyPolicy.withCheck: string | undefinedCONST data.XRLSFieldHint.column
Section titled “CONST data.XRLSFieldHint.column”エクスポートされるシンボル data.XRLSFieldHint.column
export const data.XRLSFieldHint.column: string | undefinedCONST data.XRLSFieldHint.policy
Section titled “CONST data.XRLSFieldHint.policy”エクスポートされるシンボル data.XRLSFieldHint.policy
export const data.XRLSFieldHint.policy: string | undefinedCONST data.XRuleAssert.op
Section titled “CONST data.XRuleAssert.op”エクスポートされるシンボル data.XRuleAssert.op
export const data.XRuleAssert.op: XRuleOpCONST data.XRuleAssert.left
Section titled “CONST data.XRuleAssert.left”エクスポートされるシンボル data.XRuleAssert.left
export const data.XRuleAssert.left: XRuleOperandCONST data.XRuleAssert.right
Section titled “CONST data.XRuleAssert.right”エクスポートされるシンボル data.XRuleAssert.right
export const data.XRuleAssert.right: XRuleOperandCONST data.XRuleCondition.jsonpath
Section titled “CONST data.XRuleCondition.jsonpath”エクスポートされるシンボル data.XRuleCondition.jsonpath
export const data.XRuleCondition.jsonpath: stringCONST data.XRuleDefinition.id
Section titled “CONST data.XRuleDefinition.id”エクスポートされるシンボル data.XRuleDefinition.id
export const data.XRuleDefinition.id: stringCONST data.XRuleDefinition.severity
Section titled “CONST data.XRuleDefinition.severity”エクスポートされるシンボル data.XRuleDefinition.severity
export const data.XRuleDefinition.severity: "error" | "warning" | "info"CONST data.XRuleDefinition.scope
Section titled “CONST data.XRuleDefinition.scope”エクスポートされるシンボル data.XRuleDefinition.scope
export const data.XRuleDefinition.scope: stringCONST data.XRuleDefinition.target
Section titled “CONST data.XRuleDefinition.target”エクスポートされるシンボル data.XRuleDefinition.target
export const data.XRuleDefinition.target: string | undefinedCONST data.XRuleDefinition.when
Section titled “CONST data.XRuleDefinition.when”エクスポートされるシンボル data.XRuleDefinition.when
export const data.XRuleDefinition.when: XRuleCondition | undefinedCONST data.XRuleDefinition.assert
Section titled “CONST data.XRuleDefinition.assert”エクスポートされるシンボル data.XRuleDefinition.assert
export const data.XRuleDefinition.assert: XRuleAssertCONST data.XRuleDefinition.message
Section titled “CONST data.XRuleDefinition.message”エクスポートされるシンボル data.XRuleDefinition.message
export const data.XRuleDefinition.message: string | undefinedCONST data.XRuleDefinition.error_code
Section titled “CONST data.XRuleDefinition.error_code”エクスポートされるシンボル data.XRuleDefinition.error_code
export const data.XRuleDefinition.error_code: string | undefinedCONST data.XRuleDefinition.field_paths
Section titled “CONST data.XRuleDefinition.field_paths”エクスポートされるシンボル data.XRuleDefinition.field_paths
export const data.XRuleDefinition.field_paths: string[] | undefinedCONST data.JSONSchemaProperty.type
Section titled “CONST data.JSONSchemaProperty.type”エクスポートされるシンボル data.JSONSchemaProperty.type
export const data.JSONSchemaProperty.type: "string" | "number" | "boolean" | "object" | "array" | "integer" | "null" | ("string" | "number" | "boolean" | "object" | "array" | "integer" | "null")[] | undefinedCONST data.JSONSchemaProperty.format
Section titled “CONST data.JSONSchemaProperty.format”エクスポートされるシンボル data.JSONSchemaProperty.format
export const data.JSONSchemaProperty.format: string | undefinedCONST data.JSONSchemaProperty.title
Section titled “CONST data.JSONSchemaProperty.title”エクスポートされるシンボル data.JSONSchemaProperty.title
export const data.JSONSchemaProperty.title: string | undefinedCONST data.JSONSchemaProperty.description
Section titled “CONST data.JSONSchemaProperty.description”エクスポートされるシンボル data.JSONSchemaProperty.description
export const data.JSONSchemaProperty.description: string | undefinedCONST data.JSONSchemaProperty.default
Section titled “CONST data.JSONSchemaProperty.default”エクスポートされるシンボル data.JSONSchemaProperty.default
export const data.JSONSchemaProperty.default: unknownCONST data.JSONSchemaProperty.enum
Section titled “CONST data.JSONSchemaProperty.enum”エクスポートされるシンボル data.JSONSchemaProperty.enum
export const data.JSONSchemaProperty.enum: readonly (string | number | boolean | null)[] | undefinedCONST data.JSONSchemaProperty.const
Section titled “CONST data.JSONSchemaProperty.const”エクスポートされるシンボル data.JSONSchemaProperty.const
export const data.JSONSchemaProperty.const: unknownCONST data.JSONSchemaProperty.$ref
Section titled “CONST data.JSONSchemaProperty.$ref”エクスポートされるシンボル data.JSONSchemaProperty.$ref
export const data.JSONSchemaProperty.$ref: string | undefinedCONST data.JSONSchemaProperty.readOnly
Section titled “CONST data.JSONSchemaProperty.readOnly”エクスポートされるシンボル data.JSONSchemaProperty.readOnly
export const data.JSONSchemaProperty.readOnly: boolean | undefinedCONST data.JSONSchemaProperty.writeOnly
Section titled “CONST data.JSONSchemaProperty.writeOnly”エクスポートされるシンボル data.JSONSchemaProperty.writeOnly
export const data.JSONSchemaProperty.writeOnly: boolean | undefinedCONST data.JSONSchemaProperty.minLength
Section titled “CONST data.JSONSchemaProperty.minLength”エクスポートされるシンボル data.JSONSchemaProperty.minLength
export const data.JSONSchemaProperty.minLength: number | undefinedCONST data.JSONSchemaProperty.maxLength
Section titled “CONST data.JSONSchemaProperty.maxLength”エクスポートされるシンボル data.JSONSchemaProperty.maxLength
export const data.JSONSchemaProperty.maxLength: number | undefinedCONST data.JSONSchemaProperty.pattern
Section titled “CONST data.JSONSchemaProperty.pattern”エクスポートされるシンボル data.JSONSchemaProperty.pattern
export const data.JSONSchemaProperty.pattern: string | undefinedCONST data.JSONSchemaProperty.minimum
Section titled “CONST data.JSONSchemaProperty.minimum”エクスポートされるシンボル data.JSONSchemaProperty.minimum
export const data.JSONSchemaProperty.minimum: number | undefinedCONST data.JSONSchemaProperty.maximum
Section titled “CONST data.JSONSchemaProperty.maximum”エクスポートされるシンボル data.JSONSchemaProperty.maximum
export const data.JSONSchemaProperty.maximum: number | undefinedCONST data.JSONSchemaProperty.exclusiveMinimum
Section titled “CONST data.JSONSchemaProperty.exclusiveMinimum”エクスポートされるシンボル data.JSONSchemaProperty.exclusiveMinimum
export const data.JSONSchemaProperty.exclusiveMinimum: number | undefinedCONST data.JSONSchemaProperty.exclusiveMaximum
Section titled “CONST data.JSONSchemaProperty.exclusiveMaximum”エクスポートされるシンボル data.JSONSchemaProperty.exclusiveMaximum
export const data.JSONSchemaProperty.exclusiveMaximum: number | undefinedCONST data.JSONSchemaProperty.multipleOf
Section titled “CONST data.JSONSchemaProperty.multipleOf”エクスポートされるシンボル data.JSONSchemaProperty.multipleOf
export const data.JSONSchemaProperty.multipleOf: number | undefinedCONST data.JSONSchemaProperty.items
Section titled “CONST data.JSONSchemaProperty.items”エクスポートされるシンボル data.JSONSchemaProperty.items
export const data.JSONSchemaProperty.items: false | JSONSchemaProperty | undefinedCONST data.JSONSchemaProperty.prefixItems
Section titled “CONST data.JSONSchemaProperty.prefixItems”エクスポートされるシンボル data.JSONSchemaProperty.prefixItems
export const data.JSONSchemaProperty.prefixItems: JSONSchemaProperty[] | undefinedCONST data.JSONSchemaProperty.minItems
Section titled “CONST data.JSONSchemaProperty.minItems”エクスポートされるシンボル data.JSONSchemaProperty.minItems
export const data.JSONSchemaProperty.minItems: number | undefinedCONST data.JSONSchemaProperty.maxItems
Section titled “CONST data.JSONSchemaProperty.maxItems”エクスポートされるシンボル data.JSONSchemaProperty.maxItems
export const data.JSONSchemaProperty.maxItems: number | undefinedCONST data.JSONSchemaProperty.uniqueItems
Section titled “CONST data.JSONSchemaProperty.uniqueItems”エクスポートされるシンボル data.JSONSchemaProperty.uniqueItems
export const data.JSONSchemaProperty.uniqueItems: boolean | undefinedCONST data.JSONSchemaProperty.properties
Section titled “CONST data.JSONSchemaProperty.properties”エクスポートされるシンボル data.JSONSchemaProperty.properties
export const data.JSONSchemaProperty.properties: Record<string, JSONSchemaProperty> | undefinedCONST data.JSONSchemaProperty.required
Section titled “CONST data.JSONSchemaProperty.required”エクスポートされるシンボル data.JSONSchemaProperty.required
export const data.JSONSchemaProperty.required: string[] | undefinedCONST data.JSONSchemaProperty.additionalProperties
Section titled “CONST data.JSONSchemaProperty.additionalProperties”エクスポートされるシンボル data.JSONSchemaProperty.additionalProperties
export const data.JSONSchemaProperty.additionalProperties: boolean | JSONSchemaProperty | undefinedCONST data.JSONSchemaProperty.unevaluatedProperties
Section titled “CONST data.JSONSchemaProperty.unevaluatedProperties”エクスポートされるシンボル data.JSONSchemaProperty.unevaluatedProperties
export const data.JSONSchemaProperty.unevaluatedProperties: boolean | JSONSchemaProperty | undefinedCONST data.JSONSchemaProperty.dependentRequired
Section titled “CONST data.JSONSchemaProperty.dependentRequired”エクスポートされるシンボル data.JSONSchemaProperty.dependentRequired
export const data.JSONSchemaProperty.dependentRequired: Record<string, string[]> | undefinedCONST data.JSONSchemaProperty.dependentSchemas
Section titled “CONST data.JSONSchemaProperty.dependentSchemas”エクスポートされるシンボル data.JSONSchemaProperty.dependentSchemas
export const data.JSONSchemaProperty.dependentSchemas: Record<string, JSONSchemaProperty> | undefinedCONST data.JSONSchemaProperty.'x-ui'
Section titled “CONST data.JSONSchemaProperty.'x-ui'”エクスポートされるシンボル data.JSONSchemaProperty.'x-ui'
export const data.JSONSchemaProperty.'x-ui': XUIOptions | undefinedCONST data.JSONSchemaProperty.'x-db'
Section titled “CONST data.JSONSchemaProperty.'x-db'”エクスポートされるシンボル data.JSONSchemaProperty.'x-db'
export const data.JSONSchemaProperty.'x-db': XDBOptions | undefinedCONST data.JSONSchemaProperty.'x-zod'
Section titled “CONST data.JSONSchemaProperty.'x-zod'”エクスポートされるシンボル data.JSONSchemaProperty.'x-zod'
export const data.JSONSchemaProperty.'x-zod': XZodOptions | undefinedCONST data.JSONSchemaProperty.'x-gen'
Section titled “CONST data.JSONSchemaProperty.'x-gen'”エクスポートされるシンボル data.JSONSchemaProperty.'x-gen'
export const data.JSONSchemaProperty.'x-gen': XGenOptions | undefinedCONST data.JSONSchemaProperty.'x-rules'
Section titled “CONST data.JSONSchemaProperty.'x-rules'”エクスポートされるシンボル data.JSONSchemaProperty.'x-rules'
export const data.JSONSchemaProperty.'x-rules': XRuleDefinition[] | undefinedCONST data.JSONSchemaProperty.'x-codelist'
Section titled “CONST data.JSONSchemaProperty.'x-codelist'”エクスポートされるシンボル data.JSONSchemaProperty.'x-codelist'
export const data.JSONSchemaProperty.'x-codelist': XCodelistOptions | undefinedCONST data.JSONSchema.$schema
Section titled “CONST data.JSONSchema.$schema”エクスポートされるシンボル data.JSONSchema.$schema
export const data.JSONSchema.$schema: string | undefinedCONST data.JSONSchema.$id
Section titled “CONST data.JSONSchema.$id”エクスポートされるシンボル data.JSONSchema.$id
export const data.JSONSchema.$id: string | undefinedCONST data.JSONSchema.$defs
Section titled “CONST data.JSONSchema.$defs”エクスポートされるシンボル data.JSONSchema.$defs
export const data.JSONSchema.$defs: Record<string, JSONSchemaProperty> | undefinedCONST data.JSONSchema.$anchor
Section titled “CONST data.JSONSchema.$anchor”エクスポートされるシンボル data.JSONSchema.$anchor
export const data.JSONSchema.$anchor: string | undefinedCONST data.JSONSchema.'x-db'
Section titled “CONST data.JSONSchema.'x-db'”エクスポートされるシンボル data.JSONSchema.'x-db'
export const data.JSONSchema.'x-db': (XDBOptions & { tableName: string; }) | undefinedCONST data.JSONSchema.'x-rls'
Section titled “CONST data.JSONSchema.'x-rls'”エクスポートされるシンボル data.JSONSchema.'x-rls'
export const data.JSONSchema.'x-rls': XRLSOptions | XRLSFieldHint | undefinedCONST data.JSONSchema.'x-steps'
Section titled “CONST data.JSONSchema.'x-steps'”複数ステップフォームのステップ定義(従来のSchemaDefinition.stepsから移行)
export const data.JSONSchema.'x-steps': { name: string; title: string; description?: string; }[] | undefinedCONST data.RegistryExtensionExample.namespace
Section titled “CONST data.RegistryExtensionExample.namespace”エクスポートされるシンボル data.RegistryExtensionExample.namespace
export const data.RegistryExtensionExample.namespace: stringCONST data.RegistryExtensionExample.extension_id
Section titled “CONST data.RegistryExtensionExample.extension_id”エクスポートされるシンボル data.RegistryExtensionExample.extension_id
export const data.RegistryExtensionExample.extension_id: stringCONST data.RegistryExtensionExample.version
Section titled “CONST data.RegistryExtensionExample.version”エクスポートされるシンボル data.RegistryExtensionExample.version
export const data.RegistryExtensionExample.version: stringCONST data.RegistryExtensionExample.data
Section titled “CONST data.RegistryExtensionExample.data”エクスポートされるシンボル data.RegistryExtensionExample.data
export const data.RegistryExtensionExample.data: Record<string, unknown>CONST data.RegistryExtensionEntry.namespace
Section titled “CONST data.RegistryExtensionEntry.namespace”エクスポートされるシンボル data.RegistryExtensionEntry.namespace
export const data.RegistryExtensionEntry.namespace: stringCONST data.RegistryExtensionEntry.extension_id
Section titled “CONST data.RegistryExtensionEntry.extension_id”エクスポートされるシンボル data.RegistryExtensionEntry.extension_id
export const data.RegistryExtensionEntry.extension_id: stringCONST data.RegistryExtensionEntry.version_range
Section titled “CONST data.RegistryExtensionEntry.version_range”エクスポートされるシンボル data.RegistryExtensionEntry.version_range
export const data.RegistryExtensionEntry.version_range: stringCONST data.RegistryExtensionEntry.status
Section titled “CONST data.RegistryExtensionEntry.status”エクスポートされるシンボル data.RegistryExtensionEntry.status
export const data.RegistryExtensionEntry.status: stringCONST data.RegistryExtensionEntry.title
Section titled “CONST data.RegistryExtensionEntry.title”エクスポートされるシンボル data.RegistryExtensionEntry.title
export const data.RegistryExtensionEntry.title: stringCONST data.RegistryExtensionEntry.description
Section titled “CONST data.RegistryExtensionEntry.description”エクスポートされるシンボル data.RegistryExtensionEntry.description
export const data.RegistryExtensionEntry.description: string | undefinedCONST data.RegistryExtensionEntry.applies_to
Section titled “CONST data.RegistryExtensionEntry.applies_to”エクスポートされるシンボル data.RegistryExtensionEntry.applies_to
export const data.RegistryExtensionEntry.applies_to: string[] | undefinedCONST data.RegistryExtensionEntry.core_touchpoints
Section titled “CONST data.RegistryExtensionEntry.core_touchpoints”エクスポートされるシンボル data.RegistryExtensionEntry.core_touchpoints
export const data.RegistryExtensionEntry.core_touchpoints: string[] | undefinedCONST data.RegistryExtensionEntry.validation
Section titled “CONST data.RegistryExtensionEntry.validation”エクスポートされるシンボル data.RegistryExtensionEntry.validation
export const data.RegistryExtensionEntry.validation: string[] | undefinedCONST data.RegistryExtensionEntry.examples
Section titled “CONST data.RegistryExtensionEntry.examples”エクスポートされるシンボル data.RegistryExtensionEntry.examples
export const data.RegistryExtensionEntry.examples: RegistryExtensionExample[] | undefinedCONST data.RegistryFile.registry_version
Section titled “CONST data.RegistryFile.registry_version”エクスポートされるシンボル data.RegistryFile.registry_version
export const data.RegistryFile.registry_version: stringCONST data.RegistryFile.updated_at
Section titled “CONST data.RegistryFile.updated_at”エクスポートされるシンボル data.RegistryFile.updated_at
export const data.RegistryFile.updated_at: string | undefinedCONST data.RegistryFile.extensions
Section titled “CONST data.RegistryFile.extensions”エクスポートされるシンボル data.RegistryFile.extensions
export const data.RegistryFile.extensions: RegistryExtensionEntry[]CONST data.ExtensionEnvelope.namespace
Section titled “CONST data.ExtensionEnvelope.namespace”エクスポートされるシンボル data.ExtensionEnvelope.namespace
export const data.ExtensionEnvelope.namespace: stringCONST data.ExtensionEnvelope.extension_id
Section titled “CONST data.ExtensionEnvelope.extension_id”エクスポートされるシンボル data.ExtensionEnvelope.extension_id
export const data.ExtensionEnvelope.extension_id: stringCONST data.ExtensionEnvelope.version
Section titled “CONST data.ExtensionEnvelope.version”エクスポートされるシンボル data.ExtensionEnvelope.version
export const data.ExtensionEnvelope.version: stringCONST data.ExtensionEnvelope.data
Section titled “CONST data.ExtensionEnvelope.data”エクスポートされるシンボル data.ExtensionEnvelope.data
export const data.ExtensionEnvelope.data: Record<string, unknown>CONST data.ExtensionsContainer.extensions
Section titled “CONST data.ExtensionsContainer.extensions”エクスポートされるシンボル data.ExtensionsContainer.extensions
export const data.ExtensionsContainer.extensions: ExtensionEnvelope[] | undefinedCONST data.DocumentHeader.schema_version
Section titled “CONST data.DocumentHeader.schema_version”エクスポートされるシンボル data.DocumentHeader.schema_version
export const data.DocumentHeader.schema_version: stringCONST data.DocumentHeader.profile
Section titled “CONST data.DocumentHeader.profile”エクスポートされるシンボル data.DocumentHeader.profile
export const data.DocumentHeader.profile: stringCONST data.DocumentHeader.profile_version
Section titled “CONST data.DocumentHeader.profile_version”エクスポートされるシンボル data.DocumentHeader.profile_version
export const data.DocumentHeader.profile_version: string | undefinedCONST data.DocumentHeader.doc_type
Section titled “CONST data.DocumentHeader.doc_type”エクスポートされるシンボル data.DocumentHeader.doc_type
export const data.DocumentHeader.doc_type: stringCONST data.DocumentHeader.id
Section titled “CONST data.DocumentHeader.id”エクスポートされるシンボル data.DocumentHeader.id
export const data.DocumentHeader.id: stringCONST data.DocumentHeader.issue_date
Section titled “CONST data.DocumentHeader.issue_date”エクスポートされるシンボル data.DocumentHeader.issue_date
export const data.DocumentHeader.issue_date: stringCONST data.DocumentHeader.extensions
Section titled “CONST data.DocumentHeader.extensions”エクスポートされるシンボル data.DocumentHeader.extensions
export const data.DocumentHeader.extensions: ExtensionEnvelope[] | undefinedCONST data.DirectoryCapabilities.enabled_profiles
Section titled “CONST data.DirectoryCapabilities.enabled_profiles”エクスポートされるシンボル data.DirectoryCapabilities.enabled_profiles
export const data.DirectoryCapabilities.enabled_profiles: string[]CONST data.DirectoryCapabilities.enabled_extensions
Section titled “CONST data.DirectoryCapabilities.enabled_extensions”エクスポートされるシンボル data.DirectoryCapabilities.enabled_extensions
export const data.DirectoryCapabilities.enabled_extensions: string[]CONST data.FlatIssue.level
Section titled “CONST data.FlatIssue.level”エクスポートされるシンボル data.FlatIssue.level
export const data.FlatIssue.level: "error" | "warning" | "info"CONST data.FlatIssue.code
Section titled “CONST data.FlatIssue.code”エクスポートされるシンボル data.FlatIssue.code
export const data.FlatIssue.code: stringCONST data.FlatIssue.path
Section titled “CONST data.FlatIssue.path”エクスポートされるシンボル data.FlatIssue.path
export const data.FlatIssue.path: stringCONST data.FlatIssue.message
Section titled “CONST data.FlatIssue.message”エクスポートされるシンボル data.FlatIssue.message
export const data.FlatIssue.message: stringCONST data.ValidationReport.header
Section titled “CONST data.ValidationReport.header”エクスポートされるシンボル data.ValidationReport.header
export const data.ValidationReport.header: import("./registry").HeaderValidationResultCONST data.ValidationReport.registry
Section titled “CONST data.ValidationReport.registry”エクスポートされるシンボル data.ValidationReport.registry
export const data.ValidationReport.registry: import("./registry").ExtensionsValidationResultCONST data.ValidationReport.rules
Section titled “CONST data.ValidationReport.rules”エクスポートされるシンボル data.ValidationReport.rules
export const data.ValidationReport.rules: import("./json-schema").XRuleViolation[]CONST data.ValidationReport.registryExamples
Section titled “CONST data.ValidationReport.registryExamples”エクスポートされるシンボル data.ValidationReport.registryExamples
export const data.ValidationReport.registryExamples: import("./registry").RegistryExampleValidationResult[] | undefinedCONST data.FormatValidationReportResult.report
Section titled “CONST data.FormatValidationReportResult.report”エクスポートされるシンボル data.FormatValidationReportResult.report
export const data.FormatValidationReportResult.report: ValidationReportCONST data.FormatValidationReportResult.flat
Section titled “CONST data.FormatValidationReportResult.flat”エクスポートされるシンボル data.FormatValidationReportResult.flat
export const data.FormatValidationReportResult.flat: FlatIssue[]CONST data.ExtensionEnvelopeSchemaOptions.dataRef
Section titled “CONST data.ExtensionEnvelopeSchemaOptions.dataRef”データの$refを指定する場合に使用します
export const data.ExtensionEnvelopeSchemaOptions.dataRef: string | undefinedCONST data.ExtensionEnvelopeSchemaOptions.dataSchema
Section titled “CONST data.ExtensionEnvelopeSchemaOptions.dataSchema”データスキーマを直接埋め込む場合に使用します
export const data.ExtensionEnvelopeSchemaOptions.dataSchema: JSONSchemaProperty | undefinedCONST data.ExtensionDataRefOptions.baseUrl
Section titled “CONST data.ExtensionDataRefOptions.baseUrl”拡張データスキーマのベースURL
export const data.ExtensionDataRefOptions.baseUrl: string | undefinedCONST data.HeaderSchemaOptions.docTypes
Section titled “CONST data.HeaderSchemaOptions.docTypes”doc_typeのenum制限
export const data.HeaderSchemaOptions.docTypes: string[] | undefinedCONST data.HeaderSchemaOptions.profiles
Section titled “CONST data.HeaderSchemaOptions.profiles”profileのenum制限
export const data.HeaderSchemaOptions.profiles: string[] | undefinedCONST data.HeaderSchemaOptions.profileVersions
Section titled “CONST data.HeaderSchemaOptions.profileVersions”profile_versionのenum制限
export const data.HeaderSchemaOptions.profileVersions: string[] | undefinedCONST data.HeaderSchemaOptions.versions
Section titled “CONST data.HeaderSchemaOptions.versions”schema_versionのenum制限
export const data.HeaderSchemaOptions.versions: string[] | undefinedCONST data.XRuleViolation.ruleId
Section titled “CONST data.XRuleViolation.ruleId”エクスポートされるシンボル data.XRuleViolation.ruleId
export const data.XRuleViolation.ruleId: stringCONST data.XRuleViolation.severity
Section titled “CONST data.XRuleViolation.severity”エクスポートされるシンボル data.XRuleViolation.severity
export const data.XRuleViolation.severity: "error" | "warning" | "info"CONST data.XRuleViolation.message
Section titled “CONST data.XRuleViolation.message”エクスポートされるシンボル data.XRuleViolation.message
export const data.XRuleViolation.message: string | undefinedCONST data.XRuleViolation.errorCode
Section titled “CONST data.XRuleViolation.errorCode”エクスポートされるシンボル data.XRuleViolation.errorCode
export const data.XRuleViolation.errorCode: string | undefinedCONST data.XRuleViolation.fieldPaths
Section titled “CONST data.XRuleViolation.fieldPaths”エクスポートされるシンボル data.XRuleViolation.fieldPaths
export const data.XRuleViolation.fieldPaths: string[] | undefinedCONST data.XRuleViolation.target
Section titled “CONST data.XRuleViolation.target”エクスポートされるシンボル data.XRuleViolation.target
export const data.XRuleViolation.target: string | undefinedCONST data.XRuleViolation.rule
Section titled “CONST data.XRuleViolation.rule”エクスポートされるシンボル data.XRuleViolation.rule
export const data.XRuleViolation.rule: XRuleDefinitionCONST data.AjvValidatorOptions.draft
Section titled “CONST data.AjvValidatorOptions.draft”$schemaが未指定の場合に使用するJSON Schemaのドラフトです。デフォルトはdraft-07です。明示的に指定した場合、競合する$schema値は拒否されます。
export const data.AjvValidatorOptions.draft: "draft-07" | "2020-12" | undefinedCONST data.AjvValidatorOptions.ajvOptions
Section titled “CONST data.AjvValidatorOptions.ajvOptions”Ajvオプション
export const data.AjvValidatorOptions.ajvOptions: Record<string, any> | undefinedCONST data.AjvValidatorOptions.locale
Section titled “CONST data.AjvValidatorOptions.locale”ロケール設定です。省略した場合、Ajvのデフォルトメッセージを使用します。
export const data.AjvValidatorOptions.locale: "ja" | "en" | undefinedCONST data.SchemaStep.name
Section titled “CONST data.SchemaStep.name”ステップ識別子
export const data.SchemaStep.name: stringCONST data.SchemaStep.title
Section titled “CONST data.SchemaStep.title”ステップの表示タイトル
export const data.SchemaStep.title: stringCONST data.SchemaStep.description
Section titled “CONST data.SchemaStep.description”ステップの説明(省略可能)
export const data.SchemaStep.description: string | undefinedCONST data.MongoFieldDefinition.type
Section titled “CONST data.MongoFieldDefinition.type”エクスポートされるシンボル data.MongoFieldDefinition.type
export const data.MongoFieldDefinition.type: MongoFieldTypeCONST data.MongoFieldDefinition.required
Section titled “CONST data.MongoFieldDefinition.required”エクスポートされるシンボル data.MongoFieldDefinition.required
export const data.MongoFieldDefinition.required: boolean | undefinedCONST data.MongoFieldDefinition.enum
Section titled “CONST data.MongoFieldDefinition.enum”エクスポートされるシンボル data.MongoFieldDefinition.enum
export const data.MongoFieldDefinition.enum: (string | number)[] | undefinedCONST data.MongoFieldDefinition.default
Section titled “CONST data.MongoFieldDefinition.default”エクスポートされるシンボル data.MongoFieldDefinition.default
export const data.MongoFieldDefinition.default: unknownCONST data.MongoFieldDefinition.unique
Section titled “CONST data.MongoFieldDefinition.unique”エクスポートされるシンボル data.MongoFieldDefinition.unique
export const data.MongoFieldDefinition.unique: boolean | undefinedCONST data.MigrationOptions.existingTable
Section titled “CONST data.MigrationOptions.existingTable”既存のテーブル名(指定した場合はALTER TABLEを生成します)
export const data.MigrationOptions.existingTable: string | undefinedCONST data.MigrationOptions.includeIndexes
Section titled “CONST data.MigrationOptions.includeIndexes”インデックスの生成を含めます
export const data.MigrationOptions.includeIndexes: boolean | undefinedCONST data.MigrationOptions.includeRLS
Section titled “CONST data.MigrationOptions.includeRLS”RLSポリシーの生成を含めます
export const data.MigrationOptions.includeRLS: boolean | undefinedCONST data.MigrationOptions.includeUpdatedAtTrigger
Section titled “CONST data.MigrationOptions.includeUpdatedAtTrigger”updated_atトリガーの生成を含めます
export const data.MigrationOptions.includeUpdatedAtTrigger: boolean | undefinedCONST data.MigrationOptions.includeComments
Section titled “CONST data.MigrationOptions.includeComments”テーブルコメントの生成を含めます
export const data.MigrationOptions.includeComments: boolean | undefinedCONST data.PhysicalColumn.name
Section titled “CONST data.PhysicalColumn.name”列名
export const data.PhysicalColumn.name: stringCONST data.PhysicalColumn.type
Section titled “CONST data.PhysicalColumn.type”データ型(例: udt_name)
export const data.PhysicalColumn.type: stringCONST data.PhysicalColumn.isNullable
Section titled “CONST data.PhysicalColumn.isNullable”null許容フラグ
export const data.PhysicalColumn.isNullable: booleanCONST data.PhysicalColumn.isPrimaryKey
Section titled “CONST data.PhysicalColumn.isPrimaryKey”主キーフラグ
export const data.PhysicalColumn.isPrimaryKey: booleanCONST data.PhysicalColumn.isUnique
Section titled “CONST data.PhysicalColumn.isUnique”一意制約フラグ
export const data.PhysicalColumn.isUnique: booleanCONST data.PhysicalColumn.defaultValue
Section titled “CONST data.PhysicalColumn.defaultValue”デフォルト値
export const data.PhysicalColumn.defaultValue: string | null | undefinedCONST data.PhysicalTable.name
Section titled “CONST data.PhysicalTable.name”テーブル名
export const data.PhysicalTable.name: stringCONST data.PhysicalTable.columns
Section titled “CONST data.PhysicalTable.columns”列定義の配列
export const data.PhysicalTable.columns: PhysicalColumn[]CONST data.VerificationIssue.type
Section titled “CONST data.VerificationIssue.type”問題の種類
export const data.VerificationIssue.type: "missing_table" | "missing_column" | "type_mismatch" | "constraint_mismatch"CONST data.VerificationIssue.path
Section titled “CONST data.VerificationIssue.path”問題が発生したパス
export const data.VerificationIssue.path: stringCONST data.VerificationIssue.expected
Section titled “CONST data.VerificationIssue.expected”期待される値または状態
export const data.VerificationIssue.expected: stringCONST data.VerificationIssue.actual
Section titled “CONST data.VerificationIssue.actual”実際の値または状態
export const data.VerificationIssue.actual: stringCONST data.VerificationIssue.severity
Section titled “CONST data.VerificationIssue.severity”重大度
export const data.VerificationIssue.severity: "error" | "warning"CONST data.VerificationIssue.message
Section titled “CONST data.VerificationIssue.message”人が理解しやすいエラーメッセージ
export const data.VerificationIssue.message: stringCONST data.VerificationResult.isValid
Section titled “CONST data.VerificationResult.isValid”エラーがなく有効かどうか(重大度がerrorの問題がゼロ件)
export const data.VerificationResult.isValid: booleanCONST data.VerificationResult.issues
Section titled “CONST data.VerificationResult.issues”検出された問題のリスト
export const data.VerificationResult.issues: VerificationIssue[]CONST data.TypegenOptions.camelCase
Section titled “CONST data.TypegenOptions.camelCase”プロパティ名をcamelCaseに変換するかどうか(デフォルト: false)
export const data.TypegenOptions.camelCase: boolean | undefinedCONST data.TypegenOptions.singularize
Section titled “CONST data.TypegenOptions.singularize”インターフェース名を単数形にするかどうか(デフォルト: true)
export const data.TypegenOptions.singularize: boolean | undefinedCONST data.TypegenOptions.conflictSuffix
Section titled “CONST data.TypegenOptions.conflictSuffix”’file’などの組み込み名との衝突を避けるための接尾辞(デフォルト: ‘Record’)
export const data.TypegenOptions.conflictSuffix: string | undefinedCONST data.TypegenOptions.banner
Section titled “CONST data.TypegenOptions.banner”ヘッダーのバナーコメント
export const data.TypegenOptions.banner: string | undefinedCONST data.TypegenOptions.respectXGen
Section titled “CONST data.TypegenOptions.respectXGen”x-gen.tsTypeによる上書きを反映するかどうか(デフォルト: true)
export const data.TypegenOptions.respectXGen: boolean | undefinedCONST data.TypegenOptions.reservedNames
Section titled “CONST data.TypegenOptions.reservedNames”ブラウザーの組み込み名との衝突を避けるための予約名の集合
export const data.TypegenOptions.reservedNames: Set<string> | undefinedCONST data.SchemaInput.filename
Section titled “CONST data.SchemaInput.filename”ファイル名(例: ‘clients.schema.json’)
export const data.SchemaInput.filename: stringCONST data.SchemaInput.schema
Section titled “CONST data.SchemaInput.schema”解析済みのJSON Schema
export const data.SchemaInput.schema: JSONSchemaCONST data.RegistryEntry.id
Section titled “CONST data.RegistryEntry.id”エクスポートされるシンボル data.RegistryEntry.id
export const data.RegistryEntry.id: stringCONST data.RegistryEntry.doc_type
Section titled “CONST data.RegistryEntry.doc_type”エクスポートされるシンボル data.RegistryEntry.doc_type
export const data.RegistryEntry.doc_type: string | undefinedCONST data.RegistryEntry.version
Section titled “CONST data.RegistryEntry.version”エクスポートされるシンボル data.RegistryEntry.version
export const data.RegistryEntry.version: stringCONST data.RegistryEntry.edi_version
Section titled “CONST data.RegistryEntry.edi_version”エクスポートされるシンボル data.RegistryEntry.edi_version
export const data.RegistryEntry.edi_version: string | undefinedCONST data.RegistryEntry.path
Section titled “CONST data.RegistryEntry.path”エクスポートされるシンボル data.RegistryEntry.path
export const data.RegistryEntry.path: stringCONST data.RegistryEntry.title
Section titled “CONST data.RegistryEntry.title”エクスポートされるシンボル data.RegistryEntry.title
export const data.RegistryEntry.title: stringCONST data.SchemaRegistry.registry_version
Section titled “CONST data.SchemaRegistry.registry_version”エクスポートされるシンボル data.SchemaRegistry.registry_version
export const data.SchemaRegistry.registry_version: stringCONST data.SchemaRegistry.updated_at
Section titled “CONST data.SchemaRegistry.updated_at”エクスポートされるシンボル data.SchemaRegistry.updated_at
export const data.SchemaRegistry.updated_at: stringCONST data.SchemaRegistry.profile
Section titled “CONST data.SchemaRegistry.profile”エクスポートされるシンボル data.SchemaRegistry.profile
export const data.SchemaRegistry.profile: stringCONST data.SchemaRegistry.schemas
Section titled “CONST data.SchemaRegistry.schemas”エクスポートされるシンボル data.SchemaRegistry.schemas
export const data.SchemaRegistry.schemas: RegistryEntry[]CONST data.CountryOption.value
Section titled “CONST data.CountryOption.value”ISO 3166-1 alpha-2コード
export const data.CountryOption.value: stringCONST data.CountryOption.label
Section titled “CONST data.CountryOption.label”日本語ラベル
export const data.CountryOption.label: stringCONST data.CountryOption.labelEn
Section titled “CONST data.CountryOption.labelEn”英語ラベル
export const data.CountryOption.labelEn: stringCONST data.SubdivisionOption.value
Section titled “CONST data.SubdivisionOption.value”ISO 3166-2コード(例: JP-13、US-CA)
export const data.SubdivisionOption.value: stringCONST data.SubdivisionOption.label
Section titled “CONST data.SubdivisionOption.label”現地語のラベル
export const data.SubdivisionOption.label: stringCONST data.SubdivisionOption.labelEn
Section titled “CONST data.SubdivisionOption.labelEn”英語ラベル(省略可能)
export const data.SubdivisionOption.labelEn: string | undefinedCONST data.PostalPattern.pattern
Section titled “CONST data.PostalPattern.pattern”検証用の正規表現
export const data.PostalPattern.pattern: RegExpCONST data.PostalPattern.format
Section titled “CONST data.PostalPattern.format”形式の説明
export const data.PostalPattern.format: stringCONST data.PostalPattern.example
Section titled “CONST data.PostalPattern.example”値の例
export const data.PostalPattern.example: stringCONST data.CodelistCode.code
Section titled “CONST data.CodelistCode.code”エクスポートされるシンボル data.CodelistCode.code
export const data.CodelistCode.code: stringCONST data.CodelistCode.label_ja
Section titled “CONST data.CodelistCode.label_ja”エクスポートされるシンボル data.CodelistCode.label_ja
export const data.CodelistCode.label_ja: string | undefinedCONST data.CodelistCode.label_en
Section titled “CONST data.CodelistCode.label_en”エクスポートされるシンボル data.CodelistCode.label_en
export const data.CodelistCode.label_en: string | undefinedCONST data.CodelistCode.status
Section titled “CONST data.CodelistCode.status”エクスポートされるシンボル data.CodelistCode.status
export const data.CodelistCode.status: string | undefinedCONST data.Codelist.codelist_id
Section titled “CONST data.Codelist.codelist_id”エクスポートされるシンボル data.Codelist.codelist_id
export const data.Codelist.codelist_id: stringCONST data.Codelist.version
Section titled “CONST data.Codelist.version”エクスポートされるシンボル data.Codelist.version
export const data.Codelist.version: stringCONST data.Codelist.title
Section titled “CONST data.Codelist.title”エクスポートされるシンボル data.Codelist.title
export const data.Codelist.title: string | undefinedCONST data.Codelist.codes
Section titled “CONST data.Codelist.codes”エクスポートされるシンボル data.Codelist.codes
export const data.Codelist.codes: CodelistCode[]CONST data.CodelistOption.label
Section titled “CONST data.CodelistOption.label”エクスポートされるシンボル data.CodelistOption.label
export const data.CodelistOption.label: stringCONST data.CodelistOption.value
Section titled “CONST data.CodelistOption.value”エクスポートされるシンボル data.CodelistOption.value
export const data.CodelistOption.value: stringCONST data.CodelistResolveOptions.labelField
Section titled “CONST data.CodelistResolveOptions.labelField”エクスポートされるシンボル data.CodelistResolveOptions.labelField
export const data.CodelistResolveOptions.labelField: "label_ja" | "label_en" | undefinedCONST data.CodelistResolveOptions.includeDeprecated
Section titled “CONST data.CodelistResolveOptions.includeDeprecated”エクスポートされるシンボル data.CodelistResolveOptions.includeDeprecated
export const data.CodelistResolveOptions.includeDeprecated: boolean | undefinedCONST data.CodelistResolveOptions.fallbackOrder
Section titled “CONST data.CodelistResolveOptions.fallbackOrder”ラベル解決のフォールバック順序
export const data.CodelistResolveOptions.fallbackOrder: ("label_ja" | "label_en" | "code")[] | undefinedFUNCTION data.SchemaDataConverter.fromDB
Section titled “FUNCTION data.SchemaDataConverter.fromDB”DB(snake_case)のデータをJS(camelCase)オブジェクトに変換します。
fromDB(dbData: unknown): T引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
dbData |
unknown |
必須 | - DBから取得した生データ |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
T - Description: camelCaseのプロパティを持つJSオブジェクト
FUNCTION data.SchemaDataConverter.toDB
Section titled “FUNCTION data.SchemaDataConverter.toDB”JS(camelCase)オブジェクトをDB(snake_case)のデータに変換します。
toDB(jsData: unknown): Record<string, unknown>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
jsData |
unknown |
必須 | - camelCaseのプロパティを持つJSデータ |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Record<string, unknown> - Description: DB用に整形されたsnake_caseのデータ
FUNCTION data.SchemaDataConverter.resolveColumnName
Section titled “FUNCTION data.SchemaDataConverter.resolveColumnName”camelCaseまたはsnake_caseのフィールド名をDBの列名に解決します。
resolveColumnName(field: string): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
field |
string |
必須 | - JSでのフィールド名 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: DBの列名
CONST data.VirtualColumnDefinition.name
Section titled “CONST data.VirtualColumnDefinition.name”エクスポートされるシンボル data.VirtualColumnDefinition.name
export const data.VirtualColumnDefinition.name: stringCONST data.VirtualColumnDefinition.jsonPath
Section titled “CONST data.VirtualColumnDefinition.jsonPath”JSON列から値を抽出する式(例: “$.plugins.hotel.roomId”)
export const data.VirtualColumnDefinition.jsonPath: stringCONST data.VirtualColumnDefinition.type
Section titled “CONST data.VirtualColumnDefinition.type”各ダイアレクトの物理的な対象データ型
export const data.VirtualColumnDefinition.type: Partial<Record<SchemaDialect, string>> & { default: string; }CONST data.VirtualColumnDefinition.description
Section titled “CONST data.VirtualColumnDefinition.description”任意のドキュメント
export const data.VirtualColumnDefinition.description: string | undefinedCONST data.VirtualColumnDefinition.references
Section titled “CONST data.VirtualColumnDefinition.references”任意の外部キー参照(テナントのスコープ内に限定する必要があります)
export const data.VirtualColumnDefinition.references: { table: string; columns: [string, string]; } | undefinedCONST data.VirtualColumnDefinition.unique
Section titled “CONST data.VirtualColumnDefinition.unique”一意制約または部分一意インデックスを作成するかどうか
export const data.VirtualColumnDefinition.unique: boolean | undefinedCONST data.JsonSchemaValidationDefinition.name
Section titled “CONST data.JsonSchemaValidationDefinition.name”エクスポートされるシンボル data.JsonSchemaValidationDefinition.name
export const data.JsonSchemaValidationDefinition.name: stringCONST data.JsonSchemaValidationDefinition.jsonPath
Section titled “CONST data.JsonSchemaValidationDefinition.jsonPath”検証するドキュメント内のJSONパス(例: “$.plugins.hotel”)
export const data.JsonSchemaValidationDefinition.jsonPath: string | undefinedCONST data.JsonSchemaValidationDefinition.schema
Section titled “CONST data.JsonSchemaValidationDefinition.schema”JSON Schema(Draft 2020-12互換のオブジェクト)
export const data.JsonSchemaValidationDefinition.schema: Record<string, unknown>CONST data.JsonSchemaValidationDefinition.description
Section titled “CONST data.JsonSchemaValidationDefinition.description”エクスポートされるシンボル data.JsonSchemaValidationDefinition.description
export const data.JsonSchemaValidationDefinition.description: string | undefinedCONST data.TableJsonExtensions.jsonColumn
Section titled “CONST data.TableJsonExtensions.jsonColumn”JSONドキュメントを格納する列名です。デフォルトは“payload”です
export const data.TableJsonExtensions.jsonColumn: string | undefinedCONST data.TableJsonExtensions.virtualColumns
Section titled “CONST data.TableJsonExtensions.virtualColumns”仮想列または生成列の定義
export const data.TableJsonExtensions.virtualColumns: VirtualColumnDefinition[] | undefinedCONST data.TableJsonExtensions.validations
Section titled “CONST data.TableJsonExtensions.validations”JSON Schemaの検証制約
export const data.TableJsonExtensions.validations: JsonSchemaValidationDefinition[] | undefinedCONST data.JsonMergeQuery.valueExpression
Section titled “CONST data.JsonMergeQuery.valueExpression”マージ後の新しいJSON値を表すSQL式
export const data.JsonMergeQuery.valueExpression: stringCONST data.JsonMergeQuery.paramValue
Section titled “CONST data.JsonMergeQuery.paramValue”パラメーター化されたプレースホルダーまたはシリアライズ済みの値
export const data.JsonMergeQuery.paramValue: unknownCONST data.SchemaCastOptions.numericMode
Section titled “CONST data.SchemaCastOptions.numericMode”互換性のためのデフォルト動作では、parseInt/parseFloatで先頭部分を解析します。strictでは、完全な有限のJSON数値を受け付け、整数の結果をNumber.isIntegerで検査します。
export const data.SchemaCastOptions.numericMode: "strict" | "legacy" | undefinedFUNCTION data.MinHeap.peek
Section titled “FUNCTION data.MinHeap.peek”ヒープを変更せずに、比較関数による順序で先頭の値を確認します。
peek(): T | undefined戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
T | undefined - Description: 格納された値を参照のまま返します。ヒープが空の場合は undefined です。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { MinHeap } from '@alneas/appkit-core/data/min-heap';const queue = new MinHeap<number>((a, b) => a - b);console.log(queue.peek()); // undefinedqueue.push(4);console.log(queue.peek()); // 4---
### `FUNCTION` `data.MinHeap.push`
値を挿入し、O(log n)回の比較でヒープの順序を復元します。
```typescriptpush(value: T)引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
value |
T |
必須 | - 削除されるまで参照として保持する値です。ヒープ内にある間は、 順序付けに使用するフィールドを変更しないでください。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
void - Description: 戻り値はありません。このヒープを変更します。
例外 (Throws)
Section titled “例外 (Throws)”比較関数の例外を伝播します。挿入が中断されると、 一部が変更された状態が残る場合があります。トランザクションによるロールバックはありません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { MinHeap } from '@alneas/appkit-core/data/min-heap';const queue = new MinHeap<number>((a, b) => a - b);queue.push(9);queue.push(2);console.log(queue.pop()); // 2---
### `FUNCTION` `data.MinHeap.pop`
比較関数による順序で先頭の値を、O(log n)回の比較で削除します。
```typescriptpop(): T | undefined戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
T | undefined - Description: 削除された値を参照のまま返します。ヒープが空の場合は undefined です。
例外 (Throws)
Section titled “例外 (Throws)”比較関数の例外を伝播します。比較の実行時には 削除がすでに始まっているため、例外が発生しても以前のヒープ状態には戻りません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { MinHeap } from '@alneas/appkit-core/data/min-heap';const queue = new MinHeap<number>((a, b) => a - b);queue.push(7);console.log(queue.pop()); // 7console.log(queue.pop()); // undefined---
### `CONST` `data.CSVParseConfig.delimiter`
区切り文字(デフォルト: ,)
```typescriptexport const data.CSVParseConfig.delimiter: stringCONST data.CSVParseConfig.quoteChar
Section titled “CONST data.CSVParseConfig.quoteChar”引用符(デフォルト: “)
export const data.CSVParseConfig.quoteChar: stringCONST data.CSVParseConfig.escapeChar
Section titled “CONST data.CSVParseConfig.escapeChar”エスケープ文字(デフォルト: “)
export const data.CSVParseConfig.escapeChar: stringCONST data.CSVParseConfig.hasHeader
Section titled “CONST data.CSVParseConfig.hasHeader”CSVにヘッダー行が含まれるかどうか(互換性のため、trueでも結果にはヘッダー行が含まれます)
export const data.CSVParseConfig.hasHeader: booleanCONST data.CSVParseConfig.skipEmptyLines
Section titled “CONST data.CSVParseConfig.skipEmptyLines”空行をスキップするかどうか
export const data.CSVParseConfig.skipEmptyLines: booleanCONST data.CSVParseConfig.trimWhitespace
Section titled “CONST data.CSVParseConfig.trimWhitespace”値の前後の空白を除去するかどうか
export const data.CSVParseConfig.trimWhitespace: booleanFUNCTION data.CSVParser.parse
Section titled “FUNCTION data.CSVParser.parse”CSV文字列を解析し、各行の文字列値からなる2次元配列に変換します。
parse(csvContent: string): string[][]引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
csvContent |
string |
必須 | 解析するCSVテキストの内容 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string[][] - Description: 解析された行レコードのリスト(各行は文字列の配列です)
例外 (Throws)
Section titled “例外 (Throws)”引用符が閉じられていないなど、CSV形式が無効な場合
CONST data.CSVConfig.delimiter
Section titled “CONST data.CSVConfig.delimiter”区切り文字(デフォルト: ,)
export const data.CSVConfig.delimiter: stringCONST data.CSVConfig.quoteChar
Section titled “CONST data.CSVConfig.quoteChar”引用符(1文字、デフォルト: “)
export const data.CSVConfig.quoteChar: stringCONST data.CSVConfig.escapeChar
Section titled “CONST data.CSVConfig.escapeChar”引用符をエスケープするための文字(1文字、デフォルト: “)
export const data.CSVConfig.escapeChar: stringCONST data.CSVConfig.includeHeader
Section titled “CONST data.CSVConfig.includeHeader”出力にヘッダー行を含めるかどうか
export const data.CSVConfig.includeHeader: booleanCONST data.CSVConfig.stringWrapping
Section titled “CONST data.CSVConfig.stringWrapping”’never’では、引用符で囲む必要がある値に対して例外をスローします。数式の安全性を確保するための引用符付加が優先されます。
export const data.CSVConfig.stringWrapping: "auto" | "always" | "never"CONST data.CSVConfig.escapeFormulae
Section titled “CONST data.CSVConfig.escapeFormulae”数式のような文字列(ヘッダーを含みます)の先頭にアポストロフィを付加します。デフォルトはfalseです。元の値を変更します。
export const data.CSVConfig.escapeFormulae: boolean | undefinedCONST data.CSVConfig.dateLocale
Section titled “CONST data.CSVConfig.dateLocale”Dateセルのロケールです。undefinedの場合はホストのロケールを使用します。
export const data.CSVConfig.dateLocale: string | undefinedCONST data.CSVConfig.dateOptions
Section titled “CONST data.CSVConfig.dateOptions”Intlの日付オプションです。再現性が重要な場合は、タイムゾーンの明示的な指定も含めます。
export const data.CSVConfig.dateOptions: Intl.DateTimeFormatOptions | undefinedCONST data.CSVConfig.dateFormatter
Section titled “CONST data.CSVConfig.dateFormatter”Dateセルの書式設定を上書きします(例: システム間でのデータ交換用のISO文字列)。
export const data.CSVConfig.dateFormatter: ((value: Date) => string) | undefinedCONST data.ColumnMapping.columnId
Section titled “CONST data.ColumnMapping.columnId”エクスポートされるシンボル data.ColumnMapping.columnId
export const data.ColumnMapping.columnId: stringCONST data.ColumnMapping.columnLabel
Section titled “CONST data.ColumnMapping.columnLabel”エクスポートされるシンボル data.ColumnMapping.columnLabel
export const data.ColumnMapping.columnLabel: stringCONST data.ColumnMapping.include
Section titled “CONST data.ColumnMapping.include”エクスポートされるシンボル data.ColumnMapping.include
export const data.ColumnMapping.include: booleanCONST data.ColumnMapping.order
Section titled “CONST data.ColumnMapping.order”エクスポートされるシンボル data.ColumnMapping.order
export const data.ColumnMapping.order: numberCONST data.ColumnMapping.customLabel
Section titled “CONST data.ColumnMapping.customLabel”エクスポートされるシンボル data.ColumnMapping.customLabel
export const data.ColumnMapping.customLabel: string | undefinedFUNCTION data.CSVGenerator.generate
Section titled “FUNCTION data.CSVGenerator.generate”関数 data.CSVGenerator.generate
generate<TData>( data: TData[], columns: Array<Record<string, unknown>>, columnMappings: ColumnMapping[], ): string引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
data |
TData[] |
必須 | エクスポートするデータレコード |
columns |
Record<string, unknown>[] |
必須 | 列定義(id/accessorKey) |
columnMappings |
ColumnMapping[] |
必須 | エクスポート対象、ラベル、順序 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string - Description: CSV文字列です。互換性のため、改行はLFで、BOMは付加しません。
例外 (Throws)
Section titled “例外 (Throws)”引用符で囲むことが禁止されているにもかかわらず、フィールドを引用符で囲む必要がある場合
CONST data.ExcelCellStyle.bold
Section titled “CONST data.ExcelCellStyle.bold”太字
export const data.ExcelCellStyle.bold: boolean | undefinedCONST data.ExcelCellStyle.italic
Section titled “CONST data.ExcelCellStyle.italic”斜体
export const data.ExcelCellStyle.italic: boolean | undefinedCONST data.ExcelCellStyle.underline
Section titled “CONST data.ExcelCellStyle.underline”下線
export const data.ExcelCellStyle.underline: boolean | undefinedCONST data.ExcelCellStyle.fontSize
Section titled “CONST data.ExcelCellStyle.fontSize”フォントサイズ(pt)
export const data.ExcelCellStyle.fontSize: number | undefinedCONST data.ExcelCellStyle.fontColor
Section titled “CONST data.ExcelCellStyle.fontColor”フォントの色(例: “#1E3A8A”)
export const data.ExcelCellStyle.fontColor: string | undefinedCONST data.ExcelCellStyle.backgroundColor
Section titled “CONST data.ExcelCellStyle.backgroundColor”背景色(例: “#F1F5F9”)
export const data.ExcelCellStyle.backgroundColor: string | undefinedCONST data.ExcelCellStyle.horizontalAlign
Section titled “CONST data.ExcelCellStyle.horizontalAlign”水平方向の配置
export const data.ExcelCellStyle.horizontalAlign: "center" | "left" | "right" | undefinedCONST data.ExcelCellStyle.verticalAlign
Section titled “CONST data.ExcelCellStyle.verticalAlign”垂直方向の配置
export const data.ExcelCellStyle.verticalAlign: "center" | "top" | "bottom" | undefinedCONST data.ExcelCellStyle.wrapText
Section titled “CONST data.ExcelCellStyle.wrapText”テキストの折り返し
export const data.ExcelCellStyle.wrapText: boolean | undefinedCONST data.ExcelCellStyle.border
Section titled “CONST data.ExcelCellStyle.border”罫線のスタイル(thin、thick、double、none、all、top、bottom)
export const data.ExcelCellStyle.border: "top" | "bottom" | "thin" | "thick" | "double" | "none" | "all" | undefinedCONST data.ExcelCellStyle.borderColor
Section titled “CONST data.ExcelCellStyle.borderColor”罫線の色(例: “#CBD5E1”)
export const data.ExcelCellStyle.borderColor: string | undefinedCONST data.ExcelCellStyle.numberFormat
Section titled “CONST data.ExcelCellStyle.numberFormat”数値または日付の書式文字列(例: “#,##0”、“¥#,##0”、“yyyy-mm-dd”、“0.0%”)
export const data.ExcelCellStyle.numberFormat: string | undefinedCONST data.ExcelCellData.cell
Section titled “CONST data.ExcelCellData.cell”セル座標(例: “A1”、“C5”)
export const data.ExcelCellData.cell: stringCONST data.ExcelCellData.value
Section titled “CONST data.ExcelCellData.value”セルの値(文字列、数値、真偽値など)
export const data.ExcelCellData.value: unknownCONST data.ExcelCellData.formula
Section titled “CONST data.ExcelCellData.formula”数式(例: “=SUM(D5:D10)”)
export const data.ExcelCellData.formula: string | undefinedCONST data.ExcelCellData.style
Section titled “CONST data.ExcelCellData.style”カスタムセルスタイル
export const data.ExcelCellData.style: ExcelCellStyle | undefinedCONST data.ExcelColumnDefinition.header
Section titled “CONST data.ExcelColumnDefinition.header”ヘッダーの表示名
export const data.ExcelColumnDefinition.header: stringCONST data.ExcelColumnDefinition.key
Section titled “CONST data.ExcelColumnDefinition.key”行データオブジェクト内のキー名
export const data.ExcelColumnDefinition.key: stringCONST data.ExcelColumnDefinition.width
Section titled “CONST data.ExcelColumnDefinition.width”文字数単位の列幅(省略時はアダプターのデフォルト値を使用します。Excelizeは幅を自動調整しません)
export const data.ExcelColumnDefinition.width: number | undefinedCONST data.ExcelColumnDefinition.type
Section titled “CONST data.ExcelColumnDefinition.type”データ型のヒント
export const data.ExcelColumnDefinition.type: ExcelCellType | undefinedCONST data.ExcelColumnDefinition.format
Section titled “CONST data.ExcelColumnDefinition.format”数値または日付のカスタム書式文字列
export const data.ExcelColumnDefinition.format: string | undefinedCONST data.ExcelColumnDefinition.style
Section titled “CONST data.ExcelColumnDefinition.style”列ヘッダーのカスタムスタイル
export const data.ExcelColumnDefinition.style: ExcelCellStyle | undefinedCONST data.ExcelSheetData.name
Section titled “CONST data.ExcelSheetData.name”シート名
export const data.ExcelSheetData.name: stringCONST data.ExcelSheetData.columns
Section titled “CONST data.ExcelSheetData.columns”表形式の列定義リスト(表形式のデータを出力する場合に指定します)
export const data.ExcelSheetData.columns: ExcelColumnDefinition[] | undefinedCONST data.ExcelSheetData.rows
Section titled “CONST data.ExcelSheetData.rows”表形式の行データリスト
export const data.ExcelSheetData.rows: Record<string, unknown>[] | undefinedCONST data.ExcelSheetData.cells
Section titled “CONST data.ExcelSheetData.cells”直接配置するセルのリスト(自由レイアウト、タイトル、注記、集計行用)
export const data.ExcelSheetData.cells: ExcelCellData[] | undefinedCONST data.ExcelSheetData.merges
Section titled “CONST data.ExcelSheetData.merges”セル結合の指定(例: [“A1:D1”, “B3:C3”])
export const data.ExcelSheetData.merges: string[] | undefinedCONST data.ExcelSheetData.colWidths
Section titled “CONST data.ExcelSheetData.colWidths”列ごとの幅の指定(例: { A: 12, B: 30 })
export const data.ExcelSheetData.colWidths: Record<string, number> | undefinedCONST data.ExcelSheetData.rowHeights
Section titled “CONST data.ExcelSheetData.rowHeights”行ごとの高さの指定(例: { 1: 35, 2: 20 })
export const data.ExcelSheetData.rowHeights: Record<number, number> | undefinedCONST data.ExcelSheetData.startRow
Section titled “CONST data.ExcelSheetData.startRow”表形式データの開始行番号(デフォルト: 1または配置済みセルの後)
export const data.ExcelSheetData.startRow: number | undefinedCONST data.ExcelSheetData.hideGridlines
Section titled “CONST data.ExcelSheetData.hideGridlines”グリッド線を非表示にするかどうか
export const data.ExcelSheetData.hideGridlines: boolean | undefinedCONST data.ExcelWorkbookMetadata.title
Section titled “CONST data.ExcelWorkbookMetadata.title”ドキュメントのタイトル
export const data.ExcelWorkbookMetadata.title: string | undefinedCONST data.ExcelWorkbookMetadata.subject
Section titled “CONST data.ExcelWorkbookMetadata.subject”件名
export const data.ExcelWorkbookMetadata.subject: string | undefinedCONST data.ExcelWorkbookMetadata.creator
Section titled “CONST data.ExcelWorkbookMetadata.creator”作成者 / 著者
export const data.ExcelWorkbookMetadata.creator: string | undefinedCONST data.ExcelWorkbookMetadata.description
Section titled “CONST data.ExcelWorkbookMetadata.description”説明
export const data.ExcelWorkbookMetadata.description: string | undefinedCONST data.ExcelWorkbookData.metadata
Section titled “CONST data.ExcelWorkbookData.metadata”メタデータ
export const data.ExcelWorkbookData.metadata: ExcelWorkbookMetadata | undefinedCONST data.ExcelWorkbookData.sheets
Section titled “CONST data.ExcelWorkbookData.sheets”ワークシートの配列
export const data.ExcelWorkbookData.sheets: ExcelSheetData[]CONST data.ExcelGenerateOptions.format
Section titled “CONST data.ExcelGenerateOptions.format”出力形式(‘xlsx’ | ‘csv’)
export const data.ExcelGenerateOptions.format: "xlsx" | "csv" | undefinedCONST data.ExcelGenerateOptions.timeoutMs
Section titled “CONST data.ExcelGenerateOptions.timeoutMs”タイムアウト(ミリ秒)
export const data.ExcelGenerateOptions.timeoutMs: number | undefinedCONST data.ExcelGenerateOptions.filename
Section titled “CONST data.ExcelGenerateOptions.filename”ダウンロード時のデフォルトのファイル名
export const data.ExcelGenerateOptions.filename: string | undefinedCONST data.ExcelGenerateOptions.headers
Section titled “CONST data.ExcelGenerateOptions.headers”追加のヘッダーまたは設定パラメーター
export const data.ExcelGenerateOptions.headers: Record<string, string> | undefinedCONST data.ExcelAdapter.name
Section titled “CONST data.ExcelAdapter.name”アダプターの識別名
export const data.ExcelAdapter.name: stringFUNCTION data.ExcelAdapter.generate
Section titled “FUNCTION data.ExcelAdapter.generate”ExcelまたはCSVのバイナリデータ(Uint8Array)を生成します。
generate(data: ExcelWorkbookData, options?: ExcelGenerateOptions): Promise<Uint8Array>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
data |
ExcelWorkbookData |
必須 | ワークブックのデータ定義 |
options |
ExcelGenerateOptions | undefined |
任意 | オプション |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<Uint8Array<ArrayBufferLike>>
FUNCTION data.ExcelAdapter.download
Section titled “FUNCTION data.ExcelAdapter.download”ファイルを生成し、ブラウザーで直接ダウンロードを開始します。
download( data: ExcelWorkbookData, filename?: string, options?: ExcelGenerateOptions ): Promise<void>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
data |
ExcelWorkbookData |
必須 | ワークブックのデータ定義 |
filename |
string | undefined |
任意 | 保存するファイル名 |
options |
ExcelGenerateOptions | undefined |
任意 | オプション |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<void>
CONST data.HttpServerExcelAdapterConfig.endpointUrl
Section titled “CONST data.HttpServerExcelAdapterConfig.endpointUrl”APIエンドポイントのURL(例: “http://localhost:8080/api/export-excel")
export const data.HttpServerExcelAdapterConfig.endpointUrl: stringCONST data.HttpServerExcelAdapterConfig.headers
Section titled “CONST data.HttpServerExcelAdapterConfig.headers”デフォルトのリクエストヘッダー(例: 認証トークン)
export const data.HttpServerExcelAdapterConfig.headers: Record<string, string> | undefinedCONST data.HttpServerExcelAdapterConfig.customFetch
Section titled “CONST data.HttpServerExcelAdapterConfig.customFetch”カスタムfetch関数(テストまたはSSR用)
export const data.HttpServerExcelAdapterConfig.customFetch: typeof fetch | undefinedCONST data.HttpServerExcelAdapter.name
Section titled “CONST data.HttpServerExcelAdapter.name”エクスポートされるシンボル data.HttpServerExcelAdapter.name
export const data.HttpServerExcelAdapter.name: "http-server"FUNCTION data.HttpServerExcelAdapter.generate
Section titled “FUNCTION data.HttpServerExcelAdapter.generate”サーバーAPIにリクエストを送信し、生成されたExcelのバイナリを返します。
async generate(data: ExcelWorkbookData, options?: ExcelGenerateOptions): Promise<Uint8Array>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
data |
ExcelWorkbookData |
必須 | |
options |
ExcelGenerateOptions | undefined |
任意 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<Uint8Array<ArrayBufferLike>>
FUNCTION data.HttpServerExcelAdapter.download
Section titled “FUNCTION data.HttpServerExcelAdapter.download”Excelを生成し、ブラウザーで直接ダウンロードを開始します。
async download( data: ExcelWorkbookData, filename?: string, options?: ExcelGenerateOptions, ): Promise<void>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
data |
ExcelWorkbookData |
必須 | |
filename |
string | undefined |
任意 | |
options |
ExcelGenerateOptions | undefined |
任意 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<void>
CONST data.WasmExcelAdapterConfig.wasmUrl
Section titled “CONST data.WasmExcelAdapterConfig.wasmUrl”WASMファイルのURL(例: “/wasm/excel.wasm”)
export const data.WasmExcelAdapterConfig.wasmUrl: string | undefinedCONST data.WasmExcelAdapterConfig.customExecutor
Section titled “CONST data.WasmExcelAdapterConfig.customExecutor”初期化済みのカスタムWASM実行関数
export const data.WasmExcelAdapterConfig.customExecutor: ((dataJson: string) => Promise<Uint8Array> | Uint8Array) | undefinedCONST data.WasmExcelAdapter.name
Section titled “CONST data.WasmExcelAdapter.name”エクスポートされるシンボル data.WasmExcelAdapter.name
export const data.WasmExcelAdapter.name: "wasm"FUNCTION data.WasmExcelAdapter.load
Section titled “FUNCTION data.WasmExcelAdapter.load”WASMランタイムを読み込み、初期化します。
async load(): Promise<void>戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<void>
FUNCTION data.WasmExcelAdapter.generate
Section titled “FUNCTION data.WasmExcelAdapter.generate”WASMを実行してExcelのバイナリを生成します。
async generate(data: ExcelWorkbookData, _options?: ExcelGenerateOptions): Promise<Uint8Array>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
data |
ExcelWorkbookData |
必須 | |
_options |
ExcelGenerateOptions | undefined |
任意 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<Uint8Array<ArrayBufferLike>>
FUNCTION data.WasmExcelAdapter.download
Section titled “FUNCTION data.WasmExcelAdapter.download”Excelを生成し、ブラウザーで直接ダウンロードを開始します。
async download( data: ExcelWorkbookData, filename?: string, options?: ExcelGenerateOptions, ): Promise<void>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
data |
ExcelWorkbookData |
必須 | |
filename |
string | undefined |
任意 | |
options |
ExcelGenerateOptions | undefined |
任意 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<void>
CONST data.MockExcelAdapterConfig.delayMs
Section titled “CONST data.MockExcelAdapterConfig.delayMs”シミュレーションする処理遅延(ミリ秒、デフォルト: 300)
export const data.MockExcelAdapterConfig.delayMs: number | undefinedCONST data.MockExcelAdapterConfig.shouldFail
Section titled “CONST data.MockExcelAdapterConfig.shouldFail”エラーをシミュレーションするフラグ
export const data.MockExcelAdapterConfig.shouldFail: boolean | undefinedCONST data.MockExcelAdapterConfig.onDownload
Section titled “CONST data.MockExcelAdapterConfig.onDownload”ダウンロード関数が呼び出されたときに実行するフック
export const data.MockExcelAdapterConfig.onDownload: ((data: ExcelWorkbookData, filename: string) => void) | undefinedCONST data.MockExcelAdapter.name
Section titled “CONST data.MockExcelAdapter.name”エクスポートされるシンボル data.MockExcelAdapter.name
export const data.MockExcelAdapter.name: "mock"FUNCTION data.MockExcelAdapter.generate
Section titled “FUNCTION data.MockExcelAdapter.generate”ZIPヘッダーと入力JSONを含むテスト用バイト配列を返します。有効なXLSXファイルではありません。
async generate(data: ExcelWorkbookData, _options?: ExcelGenerateOptions): Promise<Uint8Array>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
data |
ExcelWorkbookData |
必須 | |
_options |
ExcelGenerateOptions | undefined |
任意 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<Uint8Array<ArrayBufferLike>>
FUNCTION data.MockExcelAdapter.download
Section titled “FUNCTION data.MockExcelAdapter.download”モックデータを生成し、通知フックを呼び出して、ブラウザーでのダウンロードを開始します。
async download( data: ExcelWorkbookData, filename?: string, options?: ExcelGenerateOptions, ): Promise<void>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
data |
ExcelWorkbookData |
必須 | |
filename |
string | undefined |
任意 | |
options |
ExcelGenerateOptions | undefined |
任意 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<void>
CONST data.CsvExcelAdapterConfig.delimiter
Section titled “CONST data.CsvExcelAdapterConfig.delimiter”区切り文字(デフォルト: ‘,’)
export const data.CsvExcelAdapterConfig.delimiter: string | undefinedCONST data.CsvExcelAdapterConfig.sheetIndex
Section titled “CONST data.CsvExcelAdapterConfig.sheetIndex”対象シートのインデックス(デフォルト: 0)
export const data.CsvExcelAdapterConfig.sheetIndex: number | undefinedCONST data.CsvExcelAdapterConfig.includeBom
Section titled “CONST data.CsvExcelAdapterConfig.includeBom”BOMを含めるかどうか(Excelでの文字化けを防ぐため、デフォルト: true)
export const data.CsvExcelAdapterConfig.includeBom: boolean | undefinedCONST data.CsvExcelAdapter.name
Section titled “CONST data.CsvExcelAdapter.name”エクスポートされるシンボル data.CsvExcelAdapter.name
export const data.CsvExcelAdapter.name: "csv"FUNCTION data.CsvExcelAdapter.generate
Section titled “FUNCTION data.CsvExcelAdapter.generate”ワークブック内の指定シートからCSVのUint8Arrayを生成します。
async generate(data: ExcelWorkbookData, _options?: ExcelGenerateOptions): Promise<Uint8Array>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
data |
ExcelWorkbookData |
必須 | |
_options |
ExcelGenerateOptions | undefined |
任意 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<Uint8Array<ArrayBufferLike>>
FUNCTION data.CsvExcelAdapter.download
Section titled “FUNCTION data.CsvExcelAdapter.download”CSVを生成し、ブラウザーで直接ダウンロードを開始します。
async download( data: ExcelWorkbookData, filename?: string, options?: ExcelGenerateOptions, ): Promise<void>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
data |
ExcelWorkbookData |
必須 | |
filename |
string | undefined |
任意 | |
options |
ExcelGenerateOptions | undefined |
任意 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<void>
CONST data.InvoiceAmountsInput.subtotal
Section titled “CONST data.InvoiceAmountsInput.subtotal”エクスポートされるシンボル data.InvoiceAmountsInput.subtotal
export const data.InvoiceAmountsInput.subtotal: numberCONST data.InvoiceAmountsInput.taxRate
Section titled “CONST data.InvoiceAmountsInput.taxRate”パーセント単位の値です。例えば、20は20%を意味します。地域ごとの税率は推定しません。
export const data.InvoiceAmountsInput.taxRate: string | number | null | undefinedCONST data.InvoiceAmountsInput.taxAmount
Section titled “CONST data.InvoiceAmountsInput.taxAmount”エクスポートされるシンボル data.InvoiceAmountsInput.taxAmount
export const data.InvoiceAmountsInput.taxAmount: string | number | null | undefinedCONST data.InvoiceAmountsInput.totalAmount
Section titled “CONST data.InvoiceAmountsInput.totalAmount”エクスポートされるシンボル data.InvoiceAmountsInput.totalAmount
export const data.InvoiceAmountsInput.totalAmount: string | number | null | undefinedCONST data.InvoiceAmountsResult.subtotal
Section titled “CONST data.InvoiceAmountsResult.subtotal”エクスポートされるシンボル data.InvoiceAmountsResult.subtotal
export const data.InvoiceAmountsResult.subtotal: numberCONST data.InvoiceAmountsResult.taxRate
Section titled “CONST data.InvoiceAmountsResult.taxRate”エクスポートされるシンボル data.InvoiceAmountsResult.taxRate
export const data.InvoiceAmountsResult.taxRate: numberCONST data.InvoiceAmountsResult.taxAmount
Section titled “CONST data.InvoiceAmountsResult.taxAmount”エクスポートされるシンボル data.InvoiceAmountsResult.taxAmount
export const data.InvoiceAmountsResult.taxAmount: numberCONST data.InvoiceAmountsResult.totalAmount
Section titled “CONST data.InvoiceAmountsResult.totalAmount”エクスポートされるシンボル data.InvoiceAmountsResult.totalAmount
export const data.InvoiceAmountsResult.totalAmount: numberCONST data.InvoiceCalculationOptions.defaultTaxRate
Section titled “CONST data.InvoiceCalculationOptions.defaultTaxRate”エクスポートされるシンボル data.InvoiceCalculationOptions.defaultTaxRate
export const data.InvoiceCalculationOptions.defaultTaxRate: numberCONST data.InvoiceCalculationOptions.roundTax
Section titled “CONST data.InvoiceCalculationOptions.roundTax”計算した税額を丸めます。例えば、Math.floor、Math.round、または小数や通貨の最小単位に対応するアダプターを使用します。
export const data.InvoiceCalculationOptions.roundTax: (amount: number) => numberCONST data.CostCalculationResult.unitCost
Section titled “CONST data.CostCalculationResult.unitCost”計算された単価
export const data.CostCalculationResult.unitCost: numberCONST data.CostCalculationResult.totalCost
Section titled “CONST data.CostCalculationResult.totalCost”計算された総原価
export const data.CostCalculationResult.totalCost: numberCONST data.CostCalculationResult.method
Section titled “CONST data.CostCalculationResult.method”使用した原価評価方法
export const data.CostCalculationResult.method: CostMethodCONST data.CostCalculationResult.source
Section titled “CONST data.CostCalculationResult.source”原価計算の参照元(‘project’: 在庫レイヤー、‘standard’: 標準原価)
export const data.CostCalculationResult.source: "project" | "standard"CONST data.CostCalculationResult.layers
Section titled “CONST data.CostCalculationResult.layers”計算に使用した在庫レイヤーの詳細リスト
export const data.CostCalculationResult.layers: { id: string; quantity: number; unitCost: number; totalCost: number; }[] | undefinedCONST data.InventoryLayer.id
Section titled “CONST data.InventoryLayer.id”レイヤーの一意の識別子(ID)
export const data.InventoryLayer.id: stringCONST data.InventoryLayer.quantity
Section titled “CONST data.InventoryLayer.quantity”入庫数量の合計
export const data.InventoryLayer.quantity: numberCONST data.InventoryLayer.quantityReceived
Section titled “CONST data.InventoryLayer.quantityReceived”入庫数量(DBの生の値との互換性のため、文字列または数値)
export const data.InventoryLayer.quantityReceived: string | number | undefinedCONST data.InventoryLayer.unitCost
Section titled “CONST data.InventoryLayer.unitCost”入庫時のこのレイヤーの単価
export const data.InventoryLayer.unitCost: numberCONST data.InventoryLayer.totalCost
Section titled “CONST data.InventoryLayer.totalCost”このレイヤーの総原価
export const data.InventoryLayer.totalCost: numberCONST data.InventoryLayer.remainingQuantity
Section titled “CONST data.InventoryLayer.remainingQuantity”引き当て可能な残数量
export const data.InventoryLayer.remainingQuantity: numberCONST data.InventoryLayer.quantityRemaining
Section titled “CONST data.InventoryLayer.quantityRemaining”残数量(DBの生の値との互換性のため、文字列または数値)
export const data.InventoryLayer.quantityRemaining: string | number | undefinedCONST data.InventoryLayer.receiptDate
Section titled “CONST data.InventoryLayer.receiptDate”入庫日(ミリ秒単位のタイムスタンプまたはnull)
export const data.InventoryLayer.receiptDate: number | nullCONST data.InventoryLayer.orderId
Section titled “CONST data.InventoryLayer.orderId”関連する発注ID(存在する場合)
export const data.InventoryLayer.orderId: string | nullCONST data.QueryOptions.signal
Section titled “CONST data.QueryOptions.signal”通信のキャンセル要求です。アダプターが無視する場合があります。キャンセルはバックエンドのロールバックではありません。
export const data.QueryOptions.signal: AbortSignal | undefinedCONST data.QueryOptions.sort
Section titled “CONST data.QueryOptions.sort”並べ替え順序: 1 = 昇順、-1 = 降順
export const data.QueryOptions.sort: Record<string, number> | undefinedCONST data.QueryOptions.limit
Section titled “CONST data.QueryOptions.limit”取得するレコード数の上限
export const data.QueryOptions.limit: number | undefinedCONST data.QueryOptions.skip
Section titled “CONST data.QueryOptions.skip”スキップするレコード数(ページネーション用)
export const data.QueryOptions.skip: number | undefinedCONST data.QueryOptions.populate
Section titled “CONST data.QueryOptions.populate”関連コレクションを結合するための設定(populate)
export const data.QueryOptions.populate: PopulateOptions[] | undefinedCONST data.QueryOptions.projection
Section titled “CONST data.QueryOptions.projection”取得するフィールドを制限するためのフィールド射影
export const data.QueryOptions.projection: string[] | Record<string, unknown> | undefinedCONST data.QueryOptions.docType
Section titled “CONST data.QueryOptions.docType”regional-ediのドキュメント種別で絞り込みます
export const data.QueryOptions.docType: string | undefinedCONST data.QueryOptions.paginateAll
Section titled “CONST data.QueryOptions.paginateAll”limit/skipが明示されていない場合に自動ページネーションを要求します。このオプションの対応を文書化しているアダプターのみが実装しています。
export const data.QueryOptions.paginateAll: boolean | undefinedCONST data.PopulateOptions.collection
Section titled “CONST data.PopulateOptions.collection”結合対象のコレクション名またはテーブル名
export const data.PopulateOptions.collection: stringCONST data.PopulateOptions.localRef
Section titled “CONST data.PopulateOptions.localRef”ローカル側の参照フィールド(例: ‘user_id’、‘order_reference’)。 regional-ediの参照用語に基づきます。
export const data.PopulateOptions.localRef: string | undefinedCONST data.PopulateOptions.foreignRef
Section titled “CONST data.PopulateOptions.foreignRef”リモート側の参照フィールドです。normalizePopulateOptionsは、値が未指定または空の場合にデフォルトの’_id’を設定します。
export const data.PopulateOptions.foreignRef: string | undefinedCONST data.PopulateOptions.as
Section titled “CONST data.PopulateOptions.as”結合したデータの別名(例: ‘user’、‘order’)
export const data.PopulateOptions.as: string | undefinedCONST data.PopulateOptions.unwind
Section titled “CONST data.PopulateOptions.unwind”関連する結果をフラット化するかどうかです。このフィールドが明示的にfalseでない限り、正規化ではtrueを返します。
export const data.PopulateOptions.unwind: boolean | undefinedCONST data.PopulateOptions.populate
Section titled “CONST data.PopulateOptions.populate”ネストされたpopulate設定
export const data.PopulateOptions.populate: PopulateOptions[] | undefinedCONST data.PopulateOptions.field
Section titled “CONST data.PopulateOptions.field”従来のローカル側参照名です。localRefが未指定または空の場合のみ使用します。
export const data.PopulateOptions.field: string | undefined非推奨 (Deprecated)
Section titled “非推奨 (Deprecated)”互換性のための別名に依存しないよう、localRefを使用してください。
CONST data.PopulateOptions.foreignField
Section titled “CONST data.PopulateOptions.foreignField”従来のリモート側参照名です。foreignRefが未指定または空の場合のみ使用します。
export const data.PopulateOptions.foreignField: string | undefined非推奨 (Deprecated)
Section titled “非推奨 (Deprecated)”互換性のための別名に依存しないよう、foreignRefを使用してください。
CONST data.DataAccessAdapter.cacheScope
Section titled “CONST data.DataAccessAdapter.cacheScope”テナントまたはバックエンド用の、機密情報を含まない任意のキャッシュ名前空間です。デフォルトではアダプターインスタンスの識別情報を使用します。 同じスコープを明示的に指定すると、意図的にキャッシュ結果を共有するため、同等のアクセス権限がある場合にのみ使用してください。 トークンや未検証のプロフィールデータは絶対に使用しないでください。テナントまたはアクセス権限の境界が変わる場合は、スコープを変更してください。
export const data.DataAccessAdapter.cacheScope: string | undefinedFUNCTION data.DataAccessAdapter.find
Section titled “FUNCTION data.DataAccessAdapter.find”アダプターが対応するフィルターに一致するレコードを取得します。
find<T = unknown>(collection: string, filter?: Filter, options?: QueryOptions): Promise<T[]>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - バックエンドのコレクション名またはリソース名。 |
filter |
Filter | undefined |
任意 | - アダプター固有のフィルター構文による任意の条件です。未指定の場合は、そのアダプターのフィルターなしの動作を要求します。 |
options |
QueryOptions | undefined |
任意 | - 任意の並べ替え、ページネーション、射影、および通信に関する要求。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T[]> - Description: バックエンドが返すレコードです。一致する行がない場合は空の配列を含みます。
補足 (Remarks)
Section titled “補足 (Remarks)”バックエンド、トランスポート、認可の失敗により Promise が拒否される場合があります。 アダプターに記載された再試行やキャンセルのポリシーに従ってください。この契約はロールバックを提供しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport type { DataAccessAdapter } from '@alneas/appkit-core/data';export async function findExample(adapter: DataAccessAdapter) { return adapter.find<{ id: string }>('requests', { status: 'open' }, { limit: 20 });}---
### `FUNCTION` `data.DataAccessAdapter.findOne`
バックエンドの識別子検索を使用してレコードを取得します。
```typescriptfindOne<T = unknown>(collection: string, id: string, options?: QueryOptions): Promise<T | null>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - バックエンドのコレクション名またはリソース名。 |
id |
string |
必須 | - 選択したアダプターが受け付ける形式の識別子です。 |
options |
QueryOptions | undefined |
任意 | - 任意のプロジェクション、populate、トランスポートの要求です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T | null> - Description: アダプターの未検出時の動作に応じて、レコードまたは null を返します。一部のバックエンドは null を返さずに拒否します。
補足 (Remarks)
Section titled “補足 (Remarks)”バックエンド、トランスポート、認可の失敗により Promise が拒否される場合があります。 アダプターに記載された再試行やキャンセルのポリシーに従ってください。この契約はロールバックを提供しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport type { DataAccessAdapter } from '@alneas/appkit-core/data';export async function findOneExample(adapter: DataAccessAdapter) { return adapter.findOne<{ id: string }>('requests', 'request-1');}---
### `FUNCTION` `data.DataAccessAdapter.create`
レコードの作成を要求します。
```typescriptcreate<T = unknown>( collection: string, data: Record<string, unknown>, options?: QueryOptions, ): Promise<T>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - バックエンドのコレクション名またはリソース名。 |
data |
Record<string, unknown> |
必須 | - 挿入するフィールドです。サーバー生成フィールドと検証はバックエンドが管理します。 |
options |
QueryOptions | undefined |
任意 | - 任意のアダプター固有の書き込み/トランスポート設定です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T> - Description: アダプターによるレコード作成結果です。data と同じオブジェクトである必要はありません。
補足 (Remarks)
Section titled “補足 (Remarks)”バックエンド、トランスポート、認可の失敗により Promise が拒否される場合があります。 アダプターに記載された再試行やキャンセルのポリシーに従ってください。この契約はロールバックを提供しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport type { DataAccessAdapter } from '@alneas/appkit-core/data';export async function createExample(adapter: DataAccessAdapter) { return adapter.create<{ id: string; title: string }>('requests', { title: 'Review' });}---
### `FUNCTION` `data.DataAccessAdapter.update`
識別子を指定してレコードの部分更新を要求します。
```typescriptupdate<T = unknown>( collection: string, id: string, data: Record<string, unknown>, options?: QueryOptions, ): Promise<T>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - バックエンドのコレクション名またはリソース名。 |
id |
string |
必須 | - 選択したアダプターが受け付ける識別子です。 |
data |
Record<string, unknown> |
必須 | - そのアダプターがサポートするフィールドまたは更新演算子です。 |
options |
QueryOptions | undefined |
任意 | - 任意のアダプター固有の書き込み/トランスポート設定です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T> - Description: T として返す、アダプターの更新結果です。省略フィールドと返却ドキュメントの扱いはバックエンドに依存します。
補足 (Remarks)
Section titled “補足 (Remarks)”バックエンド、トランスポート、認可の失敗により Promise が拒否される場合があります。 アダプターに記載された再試行やキャンセルのポリシーに従ってください。この契約はロールバックを提供しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport type { DataAccessAdapter } from '@alneas/appkit-core/data';export async function updateExample(adapter: DataAccessAdapter) { return adapter.update<{ id: string }>('requests', 'request-1', { status: 'review' });}---
### `FUNCTION` `data.DataAccessAdapter.replace`
アダプターがサポートしている場合に、レコードの置換を要求します。
```typescriptreplace?<T = unknown>( collection: string, id: string, data: Record<string, unknown>, options?: QueryOptions, ): Promise<T>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - バックエンドのコレクション名またはリソース名。 |
id |
string |
必須 | - 選択したアダプターが受け付ける識別子です。 |
data |
Record<string, unknown> |
必須 | - 要求する新しいレコード内容です。省略されたフィールドの扱いは、アダプターの仕様を確認してください。 |
options |
QueryOptions | undefined |
任意 | - 任意のアダプター固有の書き込み/トランスポート設定です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T> - Description: T として返す、アダプターの置換結果です。このインターフェースだけでは、レコード全体を消去する動作は規定されません。
補足 (Remarks)
Section titled “補足 (Remarks)”バックエンド、トランスポート、認可の失敗により Promise が拒否される場合があります。 アダプターに記載された再試行やキャンセルのポリシーに従ってください。この契約はロールバックを提供しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport type { DataAccessAdapter } from '@alneas/appkit-core/data';export async function replaceExample(adapter: DataAccessAdapter) { if (!adapter.replace) throw new Error('Replacement is unavailable');return adapter.replace<{ id: string }>('requests', 'request-1', { title: 'Revised' });}---
### `FUNCTION` `data.DataAccessAdapter.delete`
識別子を指定してレコードの削除を要求します。
```typescriptdelete<T = unknown>(collection: string, id: string, options?: QueryOptions): Promise<T>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - バックエンドのコレクション名またはリソース名。 |
id |
string |
必須 | - 選択したアダプターが受け付ける識別子です。 |
options |
QueryOptions | undefined |
任意 | - 任意のアダプター固有の書き込み/トランスポート設定です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T> - Description: 真偽値、件数、削除済みレコードの値など、アダプターが定義する削除結果を T として返します。
補足 (Remarks)
Section titled “補足 (Remarks)”バックエンド、トランスポート、認可の失敗により Promise が拒否される場合があります。 アダプターに記載された再試行やキャンセルのポリシーに従ってください。この契約はロールバックを提供しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport type { DataAccessAdapter } from '@alneas/appkit-core/data';export async function deleteExample(adapter: DataAccessAdapter) { return adapter.delete<unknown>('requests', 'request-1');}---
### `FUNCTION` `data.DataAccessAdapter.aggregate`
集計機能をサポートするアダプターで集計パイプラインを実行します。
```typescriptaggregate?<T = unknown>( collection: string, pipeline: unknown[], options?: QueryOptions, ): Promise<T[]>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - バックエンドのコレクション名またはリソース名。 |
pipeline |
unknown[] |
必須 | - 選択したバックエンドがサポートするパイプライン構文で記述した、順序付きのステージです。 |
options |
QueryOptions | undefined |
任意 | - 任意のアダプター固有の集計/トランスポート設定です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T[]> - Description: 集計結果の行です。このインターフェースはステージの検証や実行制限の設定を行いません。
補足 (Remarks)
Section titled “補足 (Remarks)”バックエンド、トランスポート、認可の失敗により Promise が拒否される場合があります。 アダプターに記載された再試行やキャンセルのポリシーに従ってください。この契約はロールバックを提供しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport type { DataAccessAdapter } from '@alneas/appkit-core/data';export async function aggregateExample(adapter: DataAccessAdapter) { if (!adapter.aggregate) throw new Error('Aggregation is unavailable');return adapter.aggregate<{ count: number }>('requests', [{ $count: 'count' }]);}---
### `FUNCTION` `data.DataAccessAdapter.count`
アダプターがサポートするフィルターに一致するレコードを数えます。
```typescriptcount(collection: string, filter?: Filter, options?: QueryOptions): Promise<number>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - バックエンドのコレクション名またはリソース名。 |
filter |
Filter | undefined |
任意 | - アダプターがサポートするフィルター構文で記述した任意の条件です。 |
options |
QueryOptions | undefined |
任意 | - 任意のアダプター固有のクエリ/トランスポート設定です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<number> - Description: バックエンドが報告する一致レコード数です。
補足 (Remarks)
Section titled “補足 (Remarks)”バックエンド、トランスポート、認可の失敗により Promise が拒否される場合があります。 アダプターに記載された再試行やキャンセルのポリシーに従ってください。この契約はロールバックを提供しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport type { DataAccessAdapter } from '@alneas/appkit-core/data';export async function countExample(adapter: DataAccessAdapter) { return adapter.count('requests', { status: 'open' });}---
### `FUNCTION` `data.DataAccessAdapter.createMany`
複数レコードの挿入に対応するアダプターに、その挿入を要求します。
```typescriptcreateMany?<T = unknown>( collection: string, data: Record<string, unknown>[], options?: QueryOptions, ): Promise<T[]>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - バックエンドのコレクション名またはリソース名。 |
data |
Record<string, unknown>[] |
必須 | - 挿入するレコードです。バッチ処理とトランザクションの動作はバックエンドに依存します。 |
options |
QueryOptions | undefined |
任意 | - 任意のアダプター固有の一括書き込み/トランスポート設定です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T[]> - Description: アダプターが提供する挿入済みレコードの結果です。順序と部分的な失敗の動作は実装固有です。
補足 (Remarks)
Section titled “補足 (Remarks)”バックエンド、トランスポート、認可の失敗により Promise が拒否される場合があります。 アダプターに記載された再試行やキャンセルのポリシーに従ってください。この契約はロールバックを提供しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport type { DataAccessAdapter } from '@alneas/appkit-core/data';export async function createManyExample(adapter: DataAccessAdapter) { if (!adapter.createMany) throw new Error('Bulk creation is unavailable');return adapter.createMany<{ id: string }>('requests', [{ title: 'First' }]);}---
### `FUNCTION` `data.DataAccessAdapter.updateMany`
フィルターで選択されたレコードの更新を要求します。
```typescriptupdateMany?<T = unknown>( collection: string, filter: Filter, data: Record<string, unknown>, options?: QueryOptions, ): Promise<T[]>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - バックエンドのコレクション名またはリソース名。 |
filter |
Filter |
必須 | - 更新対象の集合を指定する条件です。 |
data |
Record<string, unknown> |
必須 | - バックエンドが受け付けるフィールドまたは更新演算子です。 |
options |
QueryOptions | undefined |
任意 | - 任意のアダプター固有の一括書き込み/トランスポート設定です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T[]> - Description: アダプターが提供する更新結果です。原子性と部分的な結果は、このインターフェースでは標準化されていません。
補足 (Remarks)
Section titled “補足 (Remarks)”バックエンド、トランスポート、認可の失敗により Promise が拒否される場合があります。 アダプターに記載された再試行やキャンセルのポリシーに従ってください。この契約はロールバックを提供しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport type { DataAccessAdapter } from '@alneas/appkit-core/data';export async function updateManyExample(adapter: DataAccessAdapter) { if (!adapter.updateMany) throw new Error('Bulk update is unavailable');return adapter.updateMany<{ id: string }>('requests', { status: 'open' }, { status: 'review' });}---
### `FUNCTION` `data.DataAccessAdapter.deleteMany`
フィルターで選択されたレコードの削除を要求します。
```typescriptdeleteMany?<T = unknown>( collection: string, filter: Filter, options?: QueryOptions, ): Promise<T[]>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - バックエンドのコレクション名またはリソース名。 |
filter |
Filter |
必須 | - 削除対象の集合を指定する条件です。 |
options |
QueryOptions | undefined |
任意 | - 任意のアダプター固有の一括書き込み/トランスポート設定です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T[]> - Description: アダプターが定義する削除結果の配列です。削除済みレコードであると想定しないでください。
補足 (Remarks)
Section titled “補足 (Remarks)”バックエンド、トランスポート、認可の失敗により Promise が拒否される場合があります。 アダプターに記載された再試行やキャンセルのポリシーに従ってください。この契約はロールバックを提供しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport type { DataAccessAdapter } from '@alneas/appkit-core/data';export async function deleteManyExample(adapter: DataAccessAdapter) { if (!adapter.deleteMany) throw new Error('Bulk deletion is unavailable');return adapter.deleteMany<unknown>('requests', { archived: true });}---
### `FUNCTION` `data.DataAccessAdapter.insertOne`
1 件のレコードを挿入し、サポートされている場合は操作メタデータを返します。
```typescriptinsertOne?( collection: string, data: Record<string, unknown>, options?: QueryOptions, ): Promise<OperationResult>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - バックエンドのコレクション名またはリソース名。 |
data |
Record<string, unknown> |
必須 | - 挿入するフィールドです。選択されたアダプターが解釈します。 |
options |
QueryOptions | undefined |
任意 | - 任意のアダプター固有の書き込み/トランスポート設定です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<OperationResult> - Description: 確認応答と、取得可能な操作件数や識別子です。省略されたメタデータは不明のままです。
補足 (Remarks)
Section titled “補足 (Remarks)”バックエンド、トランスポート、認可の失敗により Promise が拒否される場合があります。 アダプターに記載された再試行やキャンセルのポリシーに従ってください。この契約はロールバックを提供しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport type { DataAccessAdapter } from '@alneas/appkit-core/data';export async function insertOneExample(adapter: DataAccessAdapter) { if (!adapter.insertOne) throw new Error('Operation metadata is unavailable');return adapter.insertOne('requests', { title: 'Review' });}---
### `FUNCTION` `data.DataAccessAdapter.updateOne`
選択された 1 件のレコードを更新し、操作メタデータを返します。
```typescriptupdateOne?( collection: string, filter: Filter, data: Record<string, unknown>, options?: QueryOptions, ): Promise<OperationResult>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - バックエンドのコレクション名またはリソース名。 |
filter |
Filter |
必須 | - バックエンドがサポートする選択条件です。 |
data |
Record<string, unknown> |
必須 | - バックエンドが受け付けるフィールドまたは更新演算子です。 |
options |
QueryOptions | undefined |
任意 | - 任意のアダプター固有の書き込み/トランスポート設定です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<OperationResult> - Description: 確認応答と、報告された一致件数や変更件数です。
補足 (Remarks)
Section titled “補足 (Remarks)”バックエンド、トランスポート、認可の失敗により Promise が拒否される場合があります。 アダプターに記載された再試行やキャンセルのポリシーに従ってください。この契約はロールバックを提供しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport type { DataAccessAdapter } from '@alneas/appkit-core/data';export async function updateOneExample(adapter: DataAccessAdapter) { if (!adapter.updateOne) throw new Error('updateOne is unavailable');return adapter.updateOne('requests', { id: 'request-1' }, { status: 'review' });}---
### `FUNCTION` `data.DataAccessAdapter.replaceOne`
選択された 1 件のレコードの置換を要求し、メタデータを返します。
```typescriptreplaceOne?( collection: string, filter: Filter, data: Record<string, unknown>, options?: QueryOptions, ): Promise<OperationResult>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - バックエンドのコレクション名またはリソース名。 |
filter |
Filter |
必須 | - バックエンドがサポートする選択条件です。 |
data |
Record<string, unknown> |
必須 | - 要求する置換内容です。バックエンド固有の省略フィールドの扱いを確認してください。 |
options |
QueryOptions | undefined |
任意 | - 任意のアダプター固有の書き込み/トランスポート設定です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<OperationResult> - Description: 確認応答と、報告された操作件数です。一部のアダプターは、部分更新との互換動作を実装します。
補足 (Remarks)
Section titled “補足 (Remarks)”バックエンド、トランスポート、認可の失敗により Promise が拒否される場合があります。 アダプターに記載された再試行やキャンセルのポリシーに従ってください。この契約はロールバックを提供しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport type { DataAccessAdapter } from '@alneas/appkit-core/data';export async function replaceOneExample(adapter: DataAccessAdapter) { if (!adapter.replaceOne) throw new Error('replaceOne is unavailable');return adapter.replaceOne('requests', { id: 'request-1' }, { title: 'Revised' });}---
### `FUNCTION` `data.DataAccessAdapter.deleteOne`
選択された 1 件のレコードを削除し、操作メタデータを返します。
```typescriptdeleteOne?(collection: string, filter: Filter, options?: QueryOptions): Promise<OperationResult>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - バックエンドのコレクション名またはリソース名。 |
filter |
Filter |
必須 | - バックエンドがサポートする選択条件です。 |
options |
QueryOptions | undefined |
任意 | - 任意のアダプター固有の書き込み/トランスポート設定です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<OperationResult> - Description: 確認応答と、バックエンドが報告した削除件数です。
補足 (Remarks)
Section titled “補足 (Remarks)”バックエンド、トランスポート、認可の失敗により Promise が拒否される場合があります。 アダプターに記載された再試行やキャンセルのポリシーに従ってください。この契約はロールバックを提供しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport type { DataAccessAdapter } from '@alneas/appkit-core/data';export async function deleteOneExample(adapter: DataAccessAdapter) { if (!adapter.deleteOne) throw new Error('deleteOne is unavailable');return adapter.deleteOne('requests', { id: 'request-1' });}---
### `FUNCTION` `data.DataAccessAdapter.findOneAndUpdate`
一致する 1 件のレコードの更新と、結果としてのドキュメントの取得を要求します。
```typescriptfindOneAndUpdate?<T = unknown>( collection: string, filter: Filter, data: Record<string, unknown>, options?: QueryOptions, ): Promise<T | null>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - バックエンドのコレクション名またはリソース名。 |
filter |
Filter |
必須 | - バックエンドがサポートする選択条件です。 |
data |
Record<string, unknown> |
必須 | - バックエンドが受け付けるフィールドまたは更新演算子です。 |
options |
QueryOptions | undefined |
任意 | - 任意のアダプター固有の書き込み/トランスポート設定です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T | null> - Description: アダプターが提供するドキュメントまたは null です。更新前と更新後のどちらのドキュメントを返すか、およびレコードが存在しない場合の扱いを確認してください。
補足 (Remarks)
Section titled “補足 (Remarks)”バックエンド、トランスポート、認可の失敗により Promise が拒否される場合があります。 アダプターに記載された再試行やキャンセルのポリシーに従ってください。この契約はロールバックを提供しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport type { DataAccessAdapter } from '@alneas/appkit-core/data';export async function findOneAndUpdateExample(adapter: DataAccessAdapter) { if (!adapter.findOneAndUpdate) throw new Error('findOneAndUpdate is unavailable');return adapter.findOneAndUpdate<{ id: string }>('requests', { id: 'request-1' }, { status: 'review' });}---
### `FUNCTION` `data.DataAccessAdapter.findOneAndReplace`
一致する 1 件のレコードの置換と、結果としてのドキュメントの取得を要求します。
```typescriptfindOneAndReplace?<T = unknown>( collection: string, filter: Filter, data: Record<string, unknown>, options?: QueryOptions, ): Promise<T | null>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - バックエンドのコレクション名またはリソース名。 |
filter |
Filter |
必須 | - バックエンドがサポートする選択条件です。 |
data |
Record<string, unknown> |
必須 | - 要求する新しい内容です。選択されたアダプターが実際に置換するのか、部分更新するのかを確認してください。 |
options |
QueryOptions | undefined |
任意 | - 任意のアダプター固有の書き込み/トランスポート設定です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T | null> - Description: アダプターが提供するドキュメントまたは null です。このインターフェースは、レコード全体の置換や、複数の呼び出しにまたがるトランザクションを保証しません。
補足 (Remarks)
Section titled “補足 (Remarks)”バックエンド、トランスポート、認可の失敗により Promise が拒否される場合があります。 アダプターに記載された再試行やキャンセルのポリシーに従ってください。この契約はロールバックを提供しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport type { DataAccessAdapter } from '@alneas/appkit-core/data';export async function findOneAndReplaceExample(adapter: DataAccessAdapter) { if (!adapter.findOneAndReplace) throw new Error('findOneAndReplace is unavailable');return adapter.findOneAndReplace<{ id: string }>('requests', { id: 'request-1' }, { title: 'Revised' });}---
### `FUNCTION` `data.DataAccessAdapter.findOneAndDelete`
一致する 1 件のレコードの削除と、結果としてのドキュメントの取得を要求します。
```typescriptfindOneAndDelete?<T = unknown>( collection: string, filter: Filter, options?: QueryOptions, ): Promise<T | null>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - バックエンドのコレクション名またはリソース名。 |
filter |
Filter |
必須 | - バックエンドがサポートする選択条件です。 |
options |
QueryOptions | undefined |
任意 | - 任意のアダプター固有の書き込み/トランスポート設定です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T | null> - Description: アダプターの削除済みドキュメントの結果、または null です。バックエンドでレコード不在のエラーが発生すると、代わりに拒否される場合があります。
補足 (Remarks)
Section titled “補足 (Remarks)”バックエンド、トランスポート、認可の失敗により Promise が拒否される場合があります。 アダプターに記載された再試行やキャンセルのポリシーに従ってください。この契約はロールバックを提供しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport type { DataAccessAdapter } from '@alneas/appkit-core/data';export async function findOneAndDeleteExample(adapter: DataAccessAdapter) { if (!adapter.findOneAndDelete) throw new Error('findOneAndDelete is unavailable');return adapter.findOneAndDelete<{ id: string }>('requests', { id: 'request-1' });}---
### `CONST` `data.OperationResult.acknowledged`
操作の受領が確認されたかどうかです。
```typescriptexport const data.OperationResult.acknowledged: booleanCONST data.OperationResult.matchedCount
Section titled “CONST data.OperationResult.matchedCount”条件に一致したレコード数です。
export const data.OperationResult.matchedCount: number | undefinedCONST data.OperationResult.modifiedCount
Section titled “CONST data.OperationResult.modifiedCount”実際に変更されたレコード数です。
export const data.OperationResult.modifiedCount: number | undefinedCONST data.OperationResult.deletedCount
Section titled “CONST data.OperationResult.deletedCount”削除されたレコード数です。
export const data.OperationResult.deletedCount: number | undefinedCONST data.OperationResult.insertedId
Section titled “CONST data.OperationResult.insertedId”挿入されたレコードの ID です。
export const data.OperationResult.insertedId: string | undefinedCONST data.OperationResult.upsertedId
Section titled “CONST data.OperationResult.upsertedId”アップサートされたレコードの ID です。
export const data.OperationResult.upsertedId: string | undefinedCONST data.SearchableSelectOption.value
Section titled “CONST data.SearchableSelectOption.value”保存する値です(例:ID)。
export const data.SearchableSelectOption.value: string | numberCONST data.SearchableSelectOption.label
Section titled “CONST data.SearchableSelectOption.label”表示ラベルです(例:名前)。
export const data.SearchableSelectOption.label: stringCONST data.SearchableSelectOption.description
Section titled “CONST data.SearchableSelectOption.description”任意の補足説明です。
export const data.SearchableSelectOption.description: string | undefinedCONST data.SearchableSelectOption.name
Section titled “CONST data.SearchableSelectOption.name”任意の、人が読みやすい名前です。
export const data.SearchableSelectOption.name: string | undefinedCONST data.SearchableSelectOption.code
Section titled “CONST data.SearchableSelectOption.code”任意の、人が読みやすいコードです。
export const data.SearchableSelectOption.code: string | undefinedCONST data.HeaderMapping.csvColumn
Section titled “CONST data.HeaderMapping.csvColumn”CSV の列名です。
export const data.HeaderMapping.csvColumn: stringCONST data.HeaderMapping.dbField
Section titled “CONST data.HeaderMapping.dbField”データベースのフィールド名です。
export const data.HeaderMapping.dbField: stringCONST data.HeaderMapping.required
Section titled “CONST data.HeaderMapping.required”フィールドが必須かどうかです。
export const data.HeaderMapping.required: booleanCONST data.HeaderMapping.dataType
Section titled “CONST data.HeaderMapping.dataType”string など、ホストが定義する変換識別子です。このインターフェースは、使用する識別子の集合を規定しません。
export const data.HeaderMapping.dataType: stringCONST data.UploadProgress.total
Section titled “CONST data.UploadProgress.total”レコードの総数です。
export const data.UploadProgress.total: numberCONST data.UploadProgress.processed
Section titled “CONST data.UploadProgress.processed”処理済みのレコード数です。
export const data.UploadProgress.processed: numberCONST data.UploadProgress.successful
Section titled “CONST data.UploadProgress.successful”処理に成功したレコード数です。
export const data.UploadProgress.successful: numberCONST data.UploadProgress.failed
Section titled “CONST data.UploadProgress.failed”処理に失敗したレコード数です。
export const data.UploadProgress.failed: numberCONST data.UploadProgress.errors
Section titled “CONST data.UploadProgress.errors”エラーメッセージの一覧です。
export const data.UploadProgress.errors: string[]CONST data.UploadFileMetadata.fileType
Section titled “CONST data.UploadFileMetadata.fileType”ファイル種別です(DRAWING、PHOTO など)。
export const data.UploadFileMetadata.fileType: string | undefinedCONST data.UploadFileMetadata.category
Section titled “CONST data.UploadFileMetadata.category”大分類です。
export const data.UploadFileMetadata.category: string | undefinedCONST data.UploadFileMetadata.subcategory
Section titled “CONST data.UploadFileMetadata.subcategory”小分類です。
export const data.UploadFileMetadata.subcategory: string | undefinedCONST data.UploadFileMetadata.description
Section titled “CONST data.UploadFileMetadata.description”ファイルの説明です。
export const data.UploadFileMetadata.description: string | undefinedCONST data.UploadFileMetadata.tags
Section titled “CONST data.UploadFileMetadata.tags”カスタムタグです。
export const data.UploadFileMetadata.tags: string[] | undefinedCONST data.ResourceService.find
Section titled “CONST data.ResourceService.find”defaultQueryOptions と呼び出しオプションを浅くマージし、一致するレコードを返します。
export const data.ResourceService.find: (filters?: Filter, options?: QueryOptions) => Promise<T[]>CONST data.ResourceService.findOne
Section titled “CONST data.ResourceService.findOne”find のデフォルト設定を適用せずに、識別子で 1 件のレコードを検索します。
export const data.ResourceService.findOne: (id: string, options?: QueryOptions) => Promise<T | null>CONST data.ResourceService.create
Section titled “CONST data.ResourceService.create”find のデフォルト設定を適用せずに、1 件のレコードを作成します。
export const data.ResourceService.create: (data: Partial<T>, options?: QueryOptions) => Promise<T>CONST data.ResourceService.update
Section titled “CONST data.ResourceService.update”アダプターの更新仕様に従い、識別子で 1 件のレコードを更新します。
export const data.ResourceService.update: (id: string, data: Partial<T>, options?: QueryOptions) => Promise<T>CONST data.ResourceService.delete
Section titled “CONST data.ResourceService.delete”アダプターの物理削除または論理削除ポリシーに従い、1 件のレコードを削除します。
export const data.ResourceService.delete: (id: string, options?: QueryOptions) => Promise<unknown>CONST data.ResourceService.bulkCreate
Section titled “CONST data.ResourceService.bulkCreate”任意の機能である adapter.createMany に、複数のレコードの処理を委譲します。
export const data.ResourceService.bulkCreate: (data: Partial<T>[], options?: QueryOptions) => Promise<T[]>CONST data.ResourceService.bulkUpdate
Section titled “CONST data.ResourceService.bulkUpdate”任意の機能である adapter.updateMany に、フィルターによる部分更新を委譲します。
export const data.ResourceService.bulkUpdate: (filter: Filter, data: Partial<T>, options?: QueryOptions) => Promise<T[]>CONST data.ResourceService.ingest
Section titled “CONST data.ResourceService.ingest”ホストが提供する CSV 取り込みルーチンが指定されていれば実行します。ファクトリーが取り込みハンドラーを受け取らなかった場合、この機能は存在しません。
export const data.ResourceService.ingest: ((data: CsvRow[], mapping: HeaderMapping[], options?: { onProgress?: (processed: number, total: number) => void; batchSize?: number; stopOnError?: boolean; }) => Promise<UploadProgress>) | undefinedCONST data.ResourceService.attachFile
Section titled “CONST data.ResourceService.attachFile”設定されている場合にホストの添付ハンドラーを呼び出します。汎用サービスは、ストレージ、検証、関連付けのロジックを追加しません。
export const data.ResourceService.attachFile: ((file: File, entityId: string, metadata?: TMetadata) => Promise<unknown>) | undefinedCONST data.ResourceServiceOptions.defaultQueryOptions
Section titled “CONST data.ResourceServiceOptions.defaultQueryOptions”find のみが適用する、浅くマージされるデフォルト設定です。呼び出しごとのプロパティは、明示的に undefined が指定された場合でもデフォルト値を上書きします。他の操作ではこれらのオプションをマージしません。
export const data.ResourceServiceOptions.defaultQueryOptions: QueryOptions | undefinedCONST data.ResourceServiceOptions.ingest
Section titled “CONST data.ResourceServiceOptions.ingest”返されるサービスに直接コピーされる任意のハンドラーです。ラップやデフォルト処理は行いません。
export const data.ResourceServiceOptions.ingest: ((data: CsvRow[], mapping: HeaderMapping[], options?: { onProgress?: (processed: number, total: number) => void; batchSize?: number; stopOnError?: boolean; }) => Promise<UploadProgress>) | undefinedCONST data.ResourceServiceOptions.attachFile
Section titled “CONST data.ResourceServiceOptions.attachFile”返されるサービスに直接コピーされる任意のハンドラーです。ハンドラーがなければファイル機能もありません。
export const data.ResourceServiceOptions.attachFile: ((file: File, entityId: string, metadata?: TMetadata) => Promise<unknown>) | undefinedCONST data.SearchHandlerOptions.table
Section titled “CONST data.SearchHandlerOptions.table”対象のデータベーステーブル/コレクション名です。
export const data.SearchHandlerOptions.table: stringCONST data.SearchHandlerOptions.select
Section titled “CONST data.SearchHandlerOptions.select”レコード検索時に取得対象とする列名をカンマで区切った一覧です(例:‘id, name, code’)。
export const data.SearchHandlerOptions.select: stringCONST data.SearchHandlerOptions.fields
Section titled “CONST data.SearchHandlerOptions.fields”%query% を使用し、$or と $ilike で組み合わせるフィールドです。サポートされる演算子とワイルドカードの解釈は、指定されたアダプターに依存します。ID/コードによる代替条件を追加しない限り、空の配列でも空の $or が生成されます。
export const data.SearchHandlerOptions.fields: string[]CONST data.SearchHandlerOptions.max
Section titled “CONST data.SearchHandlerOptions.max”要求する取得件数の上限です。null または undefined の場合は 100 になります。このファクトリーは、上限値が正の値かどうかや範囲を検証せず、ページネーションも行いません。
export const data.SearchHandlerOptions.max: number | undefinedCONST data.SearchHandlerOptions.includeNumericCode
Section titled “CONST data.SearchHandlerOptions.includeNumericCode”true の場合、ASCII 数字のみで構成されるクエリに、元の文字列によるコードの完全一致条件を追加します。先頭のゼロは保持されます。
export const data.SearchHandlerOptions.includeNumericCode: boolean | undefinedCONST data.BigNumberLike.decimalPlaces
Section titled “CONST data.BigNumberLike.decimalPlaces”書き込み用のシリアライズ前に、指定の小数桁数に丸めます。
export const data.BigNumberLike.decimalPlaces: (decimalPlaces: number, roundingMode?: DecimalRoundingMode) => BigNumberLikeCONST data.BigNumberLike.isFinite
Section titled “CONST data.BigNumberLike.isFinite”新しく構築した十進数値を変換前に検査します。
export const data.BigNumberLike.isFinite: () => booleanCONST data.BigNumberLike.toFixed
Section titled “CONST data.BigNumberLike.toFixed”十進数値を固定小数点形式のテキストにシリアライズします。
export const data.BigNumberLike.toFixed: (decimalPlaces?: number) => stringCONST data.BigNumberConstructorLike.isBigNumber
Section titled “CONST data.BigNumberConstructorLike.isBigNumber”既存の十進数インスタンスを認識します。
export const data.BigNumberConstructorLike.isBigNumber: (value: unknown) => value is BigNumberLikeCONST data.BigNumberConstructorLike.ROUND_HALF_UP
Section titled “CONST data.BigNumberConstructorLike.ROUND_HALF_UP”任意の四捨五入モード定数です。指定されていない場合、ラッパーは数値モード 4 にフォールバックします。
export const data.BigNumberConstructorLike.ROUND_HALF_UP: DecimalRoundingMode | undefinedCONST data.DecimalFieldConfig.scale
Section titled “CONST data.DecimalFieldConfig.scale”DB へのシリアライズで使用する小数桁数です。
設定されている場合、toFixed(scale) によって値を丸め、ゼロ埋めします。
export const data.DecimalFieldConfig.scale: number | undefinedCONST data.DecimalFieldConfig.roundingMode
Section titled “CONST data.DecimalFieldConfig.roundingMode”書き込み時の丸め設定の上書きです。指定されていない場合はアダプターの設定を使用します。読み取り側で小数桁数を指定して文字列に変換するときは、この上書きを適用せずに toFixed(scale) を呼び出し、指定されたライブラリのデフォルトを使用します。
export const data.DecimalFieldConfig.roundingMode: DecimalRoundingMode | undefinedCONST data.DecimalFieldConfig.decodeMode
Section titled “CONST data.DecimalFieldConfig.decodeMode”読み取り側の値をデコードした後の表現です。
デフォルトはアダプターレベルの decodeMode です。
export const data.DecimalFieldConfig.decodeMode: DecimalDecodeMode | undefinedCONST data.BigNumberDataAccessAdapterConfig.base
Section titled “CONST data.BigNumberDataAccessAdapterConfig.base”ラップ対象のアダプターです(Supabase/Mongo/Convex/Oracle ORDS など)。
export const data.BigNumberDataAccessAdapterConfig.base: DataAccessAdapterCONST data.BigNumberDataAccessAdapterConfig.BigNumber
Section titled “CONST data.BigNumberDataAccessAdapterConfig.BigNumber”bignumber.js の BigNumber コンストラクターです。
export const data.BigNumberDataAccessAdapterConfig.BigNumber: BigNumberConstructorLikeCONST data.BigNumberDataAccessAdapterConfig.fields
Section titled “CONST data.BigNumberDataAccessAdapterConfig.fields”ドット区切りのパスごとの十進数フィールド規則です。
例:
amountprice.net_amountlines[].unit_price(配列のワイルドカード)
export const data.BigNumberDataAccessAdapterConfig.fields: Record<string, DecimalFieldConfig>CONST data.BigNumberDataAccessAdapterConfig.decodeMode
Section titled “CONST data.BigNumberDataAccessAdapterConfig.decodeMode”読み取り側の変換で使用するデフォルトのデコードモードです。
export const data.BigNumberDataAccessAdapterConfig.decodeMode: DecimalDecodeMode | undefinedCONST data.BigNumberDataAccessAdapterConfig.roundingMode
Section titled “CONST data.BigNumberDataAccessAdapterConfig.roundingMode”書き込み時のデフォルトの丸めモードです。BigNumber.ROUND_HALF_UP、次に 4 の順でフォールバックします。読み取り側の文字列への丸めには、ライブラリのデフォルトを使用します。
export const data.BigNumberDataAccessAdapterConfig.roundingMode: DecimalRoundingMode | undefinedCONST data.BigNumberDataAccessAdapterConfig.strict
Section titled “CONST data.BigNumberDataAccessAdapterConfig.strict”デフォルトは true です。設定対象の null 以外の入力が、認識済みのインスタンスでも、文字列/数値から有限値に変換できる値でもない場合は拒否します。false の場合、新たに解析された未サポートの入力や非有限値の入力を保持します。ただし、指定されたライブラリがスローした例外はそのまま伝播します。既存の認識済みインスタンスについては、有限値かどうかを検査しません。
export const data.BigNumberDataAccessAdapterConfig.strict: boolean | undefinedFUNCTION data.BigNumberDataAccessAdapter.find
Section titled “FUNCTION data.BigNumberDataAccessAdapter.find”条件に一致するドキュメントの一覧を取得し、十進数フィールドをデコードします。
async find<T = unknown>( collection: string, filter?: Filter, options?: QueryOptions, ): Promise<T[]>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | コレクション名です。 |
filter |
Filter | undefined |
任意 | フィルター条件です。 |
options |
QueryOptions | undefined |
任意 | クエリオプションです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T[]> - Description: デコード済みのドキュメント配列です。
例外 (Throws)
Section titled “例外 (Throws)”設定された10進数変換やライブラリのエラー、ベース操作の拒否、またはベースの省略可能な機能が利用できない場合に拒否されます。書き込み後のデコード失敗は、書き込みを取り消しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { BigNumberDataAccessAdapter } from '@alneas/appkit-core/data/bignumber-adapter';export async function findInvoices(adapter: BigNumberDataAccessAdapter) { return adapter.find('invoices', { amount: { $gte: '10.00' } });}---
### `FUNCTION` `data.BigNumberDataAccessAdapter.findOne`
指定された ID に対応するドキュメントを取得し、十進数フィールドをデコードします。
```typescriptasync findOne<T = unknown>( collection: string, id: string, options?: QueryOptions, ): Promise<T | null>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | コレクション名です。 |
id |
string |
必須 | ドキュメント ID です。 |
options |
QueryOptions | undefined |
任意 | クエリオプションです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T | null> - Description: デコード済みのドキュメントです。見つからない場合は null です。
例外 (Throws)
Section titled “例外 (Throws)”設定された10進数変換やライブラリのエラー、ベース操作の拒否、またはベースの省略可能な機能が利用できない場合に拒否されます。書き込み後のデコード失敗は、書き込みを取り消しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { BigNumberDataAccessAdapter } from '@alneas/appkit-core/data/bignumber-adapter';export async function findOneInvoices(adapter: BigNumberDataAccessAdapter) { return adapter.findOne('invoices', 'invoice-1');}---
### `FUNCTION` `data.BigNumberDataAccessAdapter.create`
新しいドキュメントを作成します。入力の十進数フィールドは保存前にエンコードします。
```typescriptasync create<T = unknown>( collection: string, data: Record<string, unknown>, options?: QueryOptions, ): Promise<T>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | コレクション名です。 |
data |
Record<string, unknown> |
必須 | 作成するデータです。 |
options |
QueryOptions | undefined |
任意 | クエリオプションです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T> - Description: 作成された、デコード済みのドキュメントです。
例外 (Throws)
Section titled “例外 (Throws)”設定された10進数変換やライブラリのエラー、ベース操作の拒否、またはベースの省略可能な機能が利用できない場合に拒否されます。書き込み後のデコード失敗は、書き込みを取り消しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { BigNumberDataAccessAdapter } from '@alneas/appkit-core/data/bignumber-adapter';export async function createInvoices(adapter: BigNumberDataAccessAdapter) { return adapter.create('invoices', { amount: '12.50' });}---
### `FUNCTION` `data.BigNumberDataAccessAdapter.update`
ドキュメントを更新します。指定された十進数フィールドは更新前にエンコードします。
```typescriptasync update<T = unknown>( collection: string, id: string, data: Record<string, unknown>, options?: QueryOptions, ): Promise<T>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | コレクション名です。 |
id |
string |
必須 | 更新するドキュメントの ID です。 |
data |
Record<string, unknown> |
必須 | 更新するデータです。 |
options |
QueryOptions | undefined |
任意 | クエリオプションです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T> - Description: 更新された、デコード済みのドキュメントです。
例外 (Throws)
Section titled “例外 (Throws)”設定された10進数変換やライブラリのエラー、ベース操作の拒否、またはベースの省略可能な機能が利用できない場合に拒否されます。書き込み後のデコード失敗は、書き込みを取り消しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { BigNumberDataAccessAdapter } from '@alneas/appkit-core/data/bignumber-adapter';export async function updateInvoices(adapter: BigNumberDataAccessAdapter) { return adapter.update('invoices', 'invoice-1', { amount: '12.50' });}---
### `FUNCTION` `data.BigNumberDataAccessAdapter.delete`
指定された ID のドキュメントを削除します。
```typescriptasync delete<T = unknown>(collection: string, id: string, options?: QueryOptions): Promise<T>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | コレクション名です。 |
id |
string |
必須 | 削除するドキュメントの ID です。 |
options |
QueryOptions | undefined |
任意 | クエリオプションです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T> - Description: 削除された、デコード済みのドキュメントです。
例外 (Throws)
Section titled “例外 (Throws)”設定された10進数変換やライブラリのエラー、ベース操作の拒否、またはベースの省略可能な機能が利用できない場合に拒否されます。書き込み後のデコード失敗は、書き込みを取り消しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { BigNumberDataAccessAdapter } from '@alneas/appkit-core/data/bignumber-adapter';export async function deleteInvoices(adapter: BigNumberDataAccessAdapter) { return adapter.delete('invoices', 'invoice-1');}---
### `FUNCTION` `data.BigNumberDataAccessAdapter.count`
条件に一致するドキュメントの数を数えます。
```typescriptasync count(collection: string, filter?: Filter, options?: QueryOptions): Promise<number>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | コレクション名です。 |
filter |
Filter | undefined |
任意 | フィルター条件です。 |
options |
QueryOptions | undefined |
任意 | クエリオプションです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<number> - Description: 一致するドキュメント数です。
例外 (Throws)
Section titled “例外 (Throws)”設定された10進数変換やライブラリのエラー、ベース操作の拒否、またはベースの省略可能な機能が利用できない場合に拒否されます。書き込み後のデコード失敗は、書き込みを取り消しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { BigNumberDataAccessAdapter } from '@alneas/appkit-core/data/bignumber-adapter';export async function countInvoices(adapter: BigNumberDataAccessAdapter) { return adapter.count('invoices', { amount: { $gte: '10.00' } });}---
### `FUNCTION` `data.BigNumberDataAccessAdapter.replace`
十進数フィールドをエンコードした後、base.replace に置換を委譲します。レコード全体の置換になるか部分更新になるかは、そのベースアダプターに依存します。
```typescriptasync replace<T = unknown>( collection: string, id: string, data: Record<string, unknown>, options?: QueryOptions, ): Promise<T>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | コレクション名です。 |
id |
string |
必須 | 置換するドキュメントの ID です。 |
data |
Record<string, unknown> |
必須 | 置換後のデータ内容です。 |
options |
QueryOptions | undefined |
任意 | クエリオプションです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T> - Description: 置換された、デコード済みのドキュメントです。
例外 (Throws)
Section titled “例外 (Throws)”設定された10進数変換やライブラリのエラー、ベース操作の拒否、またはベースの省略可能な機能が利用できない場合に拒否されます。書き込み後のデコード失敗は、書き込みを取り消しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { BigNumberDataAccessAdapter } from '@alneas/appkit-core/data/bignumber-adapter';export async function replaceInvoices(adapter: BigNumberDataAccessAdapter) { return adapter.replace('invoices', 'invoice-1', { amount: '12.50' });}---
### `FUNCTION` `data.BigNumberDataAccessAdapter.aggregate`
集計パイプラインを実行します。パイプライン内の対応する十進数フィールドをエンコードし、結果をデコードします。
```typescriptasync aggregate<T = unknown>( collection: string, pipeline: unknown[], options?: QueryOptions, ): Promise<T[]>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | コレクション名です。 |
pipeline |
unknown[] |
必須 | 集計パイプラインの定義です。 |
options |
QueryOptions | undefined |
任意 | クエリオプションです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T[]> - Description: デコード済みの集計結果配列です。
補足 (Remarks)
Section titled “補足 (Remarks)”認識される $match、$set/$addFields、ネストされた $facet パイプライン、および $lookup.pipeline ステージのみをエンコードします。他のステージはそのまま転送します。結果のデコードには引き続き元の設定済みパスを使用するため、名前変更やプロジェクション後のパスは推定しません。
例外 (Throws)
Section titled “例外 (Throws)”設定された10進数変換やライブラリのエラー、ベース操作の拒否、またはベースの省略可能な機能が利用できない場合に拒否されます。書き込み後のデコード失敗は、書き込みを取り消しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { BigNumberDataAccessAdapter } from '@alneas/appkit-core/data/bignumber-adapter';export async function aggregateInvoices(adapter: BigNumberDataAccessAdapter) { return adapter.aggregate('invoices', [{ $match: { amount: { $gte: '10.00' } } }]);}---
### `FUNCTION` `data.BigNumberDataAccessAdapter.createMany`
複数のドキュメントを一括作成します。
```typescriptasync createMany<T = unknown>( collection: string, data: Record<string, unknown>[], options?: QueryOptions, ): Promise<T[]>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | コレクション名です。 |
data |
Record<string, unknown>[] |
必須 | 作成するデータオブジェクトの配列です。 |
options |
QueryOptions | undefined |
任意 | クエリオプションです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T[]> - Description: 作成されたドキュメントの、デコード済み配列です。
例外 (Throws)
Section titled “例外 (Throws)”設定された10進数変換やライブラリのエラー、ベース操作の拒否、またはベースの省略可能な機能が利用できない場合に拒否されます。書き込み後のデコード失敗は、書き込みを取り消しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { BigNumberDataAccessAdapter } from '@alneas/appkit-core/data/bignumber-adapter';export async function createManyInvoices(adapter: BigNumberDataAccessAdapter) { return adapter.createMany('invoices', [{ amount: '12.50' }]);}---
### `FUNCTION` `data.BigNumberDataAccessAdapter.updateMany`
条件に一致する複数のドキュメントを更新します。
```typescriptasync updateMany<T = unknown>( collection: string, filter: Filter, data: Record<string, unknown>, options?: QueryOptions, ): Promise<T[]>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | コレクション名です。 |
filter |
Filter |
必須 | フィルター条件です。 |
data |
Record<string, unknown> |
必須 | 更新するデータです。 |
options |
QueryOptions | undefined |
任意 | クエリオプションです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T[]> - Description: 更新されたドキュメントの、デコード済み配列です。
例外 (Throws)
Section titled “例外 (Throws)”設定された10進数変換やライブラリのエラー、ベース操作の拒否、またはベースの省略可能な機能が利用できない場合に拒否されます。書き込み後のデコード失敗は、書き込みを取り消しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { BigNumberDataAccessAdapter } from '@alneas/appkit-core/data/bignumber-adapter';export async function updateManyInvoices(adapter: BigNumberDataAccessAdapter) { return adapter.updateMany('invoices', { status: 'open' }, { amount: '12.50' });}---
### `FUNCTION` `data.BigNumberDataAccessAdapter.deleteMany`
条件に一致する複数のドキュメントを削除します。
```typescriptasync deleteMany<T = unknown>( collection: string, filter: Filter, options?: QueryOptions, ): Promise<T[]>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | コレクション名です。 |
filter |
Filter |
必須 | フィルター条件です。 |
options |
QueryOptions | undefined |
任意 | クエリオプションです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T[]> - Description: 削除されたドキュメントの、デコード済み配列です。
例外 (Throws)
Section titled “例外 (Throws)”設定された10進数変換やライブラリのエラー、ベース操作の拒否、またはベースの省略可能な機能が利用できない場合に拒否されます。書き込み後のデコード失敗は、書き込みを取り消しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { BigNumberDataAccessAdapter } from '@alneas/appkit-core/data/bignumber-adapter';export async function deleteManyInvoices(adapter: BigNumberDataAccessAdapter) { return adapter.deleteMany('invoices', { status: 'archived' });}---
### `FUNCTION` `data.BigNumberDataAccessAdapter.insertOne`
1 件のドキュメントを挿入し、操作結果を返します。
```typescriptasync insertOne( collection: string, data: Record<string, unknown>, options?: QueryOptions, ): Promise<OperationResult>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | コレクション名です。 |
data |
Record<string, unknown> |
必須 | 挿入するデータです。 |
options |
QueryOptions | undefined |
任意 | クエリオプションです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<OperationResult> - Description: 操作結果です。
例外 (Throws)
Section titled “例外 (Throws)”設定された10進数変換やライブラリのエラー、ベース操作の拒否、またはベースの省略可能な機能が利用できない場合に拒否されます。書き込み後のデコード失敗は、書き込みを取り消しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { BigNumberDataAccessAdapter } from '@alneas/appkit-core/data/bignumber-adapter';export async function insertOneInvoices(adapter: BigNumberDataAccessAdapter) { return adapter.insertOne('invoices', { amount: '12.50' });}---
### `FUNCTION` `data.BigNumberDataAccessAdapter.updateOne`
条件に一致する 1 件のドキュメントを更新し、操作結果を返します。
```typescriptasync updateOne( collection: string, filter: Filter, data: Record<string, unknown>, options?: QueryOptions, ): Promise<OperationResult>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | コレクション名です。 |
filter |
Filter |
必須 | フィルター条件です。 |
data |
Record<string, unknown> |
必須 | 更新するデータです。 |
options |
QueryOptions | undefined |
任意 | クエリオプションです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<OperationResult> - Description: 操作結果です。
例外 (Throws)
Section titled “例外 (Throws)”設定された10進数変換やライブラリのエラー、ベース操作の拒否、またはベースの省略可能な機能が利用できない場合に拒否されます。書き込み後のデコード失敗は、書き込みを取り消しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { BigNumberDataAccessAdapter } from '@alneas/appkit-core/data/bignumber-adapter';export async function updateOneInvoices(adapter: BigNumberDataAccessAdapter) { return adapter.updateOne('invoices', { id: 'invoice-1' }, { amount: '12.50' });}---
### `FUNCTION` `data.BigNumberDataAccessAdapter.replaceOne`
条件に一致する 1 件のドキュメントを置換し、操作結果を返します。
```typescriptasync replaceOne( collection: string, filter: Filter, data: Record<string, unknown>, options?: QueryOptions, ): Promise<OperationResult>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | コレクション名です。 |
filter |
Filter |
必須 | フィルター条件です。 |
data |
Record<string, unknown> |
必須 | 置換後のデータ内容です。 |
options |
QueryOptions | undefined |
任意 | クエリオプションです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<OperationResult> - Description: 操作結果です。
例外 (Throws)
Section titled “例外 (Throws)”設定された10進数変換やライブラリのエラー、ベース操作の拒否、またはベースの省略可能な機能が利用できない場合に拒否されます。書き込み後のデコード失敗は、書き込みを取り消しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { BigNumberDataAccessAdapter } from '@alneas/appkit-core/data/bignumber-adapter';export async function replaceOneInvoices(adapter: BigNumberDataAccessAdapter) { return adapter.replaceOne('invoices', { id: 'invoice-1' }, { amount: '12.50' });}---
### `FUNCTION` `data.BigNumberDataAccessAdapter.deleteOne`
条件に一致する 1 件のドキュメントを削除し、操作結果を返します。
```typescriptasync deleteOne( collection: string, filter: Filter, options?: QueryOptions, ): Promise<OperationResult>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | コレクション名です。 |
filter |
Filter |
必須 | フィルター条件です。 |
options |
QueryOptions | undefined |
任意 | クエリオプションです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<OperationResult> - Description: 操作結果です。
例外 (Throws)
Section titled “例外 (Throws)”設定された10進数変換やライブラリのエラー、ベース操作の拒否、またはベースの省略可能な機能が利用できない場合に拒否されます。書き込み後のデコード失敗は、書き込みを取り消しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { BigNumberDataAccessAdapter } from '@alneas/appkit-core/data/bignumber-adapter';export async function deleteOneInvoices(adapter: BigNumberDataAccessAdapter) { return adapter.deleteOne('invoices', { id: 'invoice-1' });}---
### `FUNCTION` `data.BigNumberDataAccessAdapter.findOneAndUpdate`
条件に一致する 1 件のドキュメントを更新し、更新前または更新後のデータを返します。
```typescriptasync findOneAndUpdate<T = unknown>( collection: string, filter: Filter, data: Record<string, unknown>, options?: QueryOptions, ): Promise<T | null>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | コレクション名です。 |
filter |
Filter |
必須 | フィルター条件です。 |
data |
Record<string, unknown> |
必須 | 更新データです。 |
options |
QueryOptions | undefined |
任意 | クエリオプションです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T | null> - Description: ドキュメントデータです。見つからない場合は null です。
例外 (Throws)
Section titled “例外 (Throws)”設定された10進数変換やライブラリのエラー、ベース操作の拒否、またはベースの省略可能な機能が利用できない場合に拒否されます。書き込み後のデコード失敗は、書き込みを取り消しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { BigNumberDataAccessAdapter } from '@alneas/appkit-core/data/bignumber-adapter';export async function findOneAndUpdateInvoices(adapter: BigNumberDataAccessAdapter) { return adapter.findOneAndUpdate('invoices', { id: 'invoice-1' }, { amount: '12.50' });}---
### `FUNCTION` `data.BigNumberDataAccessAdapter.findOneAndReplace`
条件に一致する 1 件のドキュメントを置換し、置換前または置換後のデータを返します。
```typescriptasync findOneAndReplace<T = unknown>( collection: string, filter: Filter, data: Record<string, unknown>, options?: QueryOptions, ): Promise<T | null>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | コレクション名です。 |
filter |
Filter |
必須 | フィルター条件です。 |
data |
Record<string, unknown> |
必須 | 置換後のデータ内容です。 |
options |
QueryOptions | undefined |
任意 | クエリオプションです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T | null> - Description: ドキュメントデータです。見つからない場合は null です。
例外 (Throws)
Section titled “例外 (Throws)”設定された10進数変換やライブラリのエラー、ベース操作の拒否、またはベースの省略可能な機能が利用できない場合に拒否されます。書き込み後のデコード失敗は、書き込みを取り消しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { BigNumberDataAccessAdapter } from '@alneas/appkit-core/data/bignumber-adapter';export async function findOneAndReplaceInvoices(adapter: BigNumberDataAccessAdapter) { return adapter.findOneAndReplace('invoices', { id: 'invoice-1' }, { amount: '12.50' });}---
### `FUNCTION` `data.BigNumberDataAccessAdapter.findOneAndDelete`
条件に一致する 1 件のドキュメントを削除し、削除されたドキュメントデータを返します。
```typescriptasync findOneAndDelete<T = unknown>( collection: string, filter: Filter, options?: QueryOptions, ): Promise<T | null>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | コレクション名です。 |
filter |
Filter |
必須 | フィルター条件です。 |
options |
QueryOptions | undefined |
任意 | クエリオプションです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T | null> - Description: 削除されたドキュメントデータです。見つからない場合は null です。
例外 (Throws)
Section titled “例外 (Throws)”設定された10進数変換やライブラリのエラー、ベース操作の拒否、またはベースの省略可能な機能が利用できない場合に拒否されます。書き込み後のデコード失敗は、書き込みを取り消しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { BigNumberDataAccessAdapter } from '@alneas/appkit-core/data/bignumber-adapter';export async function findOneAndDeleteInvoices(adapter: BigNumberDataAccessAdapter) { return adapter.findOneAndDelete('invoices', { id: 'invoice-1' });}---
### `CONST` `data.MongoApiConfig.baseUrl`
["mongo/client", operation] 形式の JSON タプルを POST で受け取る HTTP エンドポイントです。ホストはこのプロトコルを実装し、認可を強制する必要があります。
```typescriptexport const data.MongoApiConfig.baseUrl: stringCONST data.MongoApiConfig.getToken
Section titled “CONST data.MongoApiConfig.getToken”各リクエストの前に呼び出される、任意のトークン供給関数です。
export const data.MongoApiConfig.getToken: (() => Promise<string>) | undefinedCONST data.MongoApiConfig.fetch
Section titled “CONST data.MongoApiConfig.fetch”任意のホスト側トランスポートです。偽と評価される値の場合は、グローバルの fetch を使用します。キャンセルシグナルや再試行ポリシーは追加しません。
export const data.MongoApiConfig.fetch: FetchLike | undefinedFUNCTION data.MongoApiAdapter.find
Section titled “FUNCTION data.MongoApiAdapter.find”レコードの一覧を取得します。populate が空でない場合は、生成した集計パイプラインを使用します。
async find<T = unknown>( collection: string, filter?: Filter, options?: QueryOptions, ): Promise<T[]>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - ホスト API にそのまま送信するコレクション名です。 |
filter |
Filter | undefined |
任意 | - JSON としてシリアライズする Mongo 形式のフィルターです。空のフィルターはすべてのレコードを選択する場合があります。 |
options |
QueryOptions | undefined |
任意 | - 操作のボディにシリアライズするオプションです。ただし、find は対応するオプションのサブセットを独自に構成します。signal は HTTP リクエストをキャンセルしません。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T[]> - Description: サーバーの JSON を T[] にキャストしたものです。通常の find は sort、真と評価される limit/skip、および projection を転送します。Populate はトップレベルのフィルターキーを結合エイリアスで分割し、lookup/unwind/sort/ページネーション/プロジェクションの各ステージを追加します。汎用的にフィルターを再帰的に書き換えるものではありません。
例外 (Throws)
Section titled “例外 (Throws)”トークン、トランスポート、JSON の失敗、または OK でない HTTP レスポンスに対して拒否されます。成功した HTTP レスポンスの JSON は、アプリケーションエラーを表していても信頼します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { MongoApiAdapter } from '@alneas/appkit-core/data/mongodb';export async function findTasks(adapter: MongoApiAdapter) { return adapter.find('tasks', { status: 'open' }, { limit: 20 });}---
### `FUNCTION` `data.MongoApiAdapter.findOne`
_id の等価フィルターを指定して findOne を要求します。
```typescriptasync findOne<T = unknown>( collection: string, id: string, options?: QueryOptions, ): Promise<T | null>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - ホスト API にそのまま送信するコレクション名です。 |
id |
string |
必須 | - _id と照合する文字列です。変換はエンドポイントが担います。 |
options |
QueryOptions | undefined |
任意 | - 操作のボディにシリアライズするオプションです。ただし、find は対応するオプションのサブセットを独自に構成します。signal は HTTP リクエストをキャンセルしません。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T | null> - Description: サーバーの JSON をレコードまたは null にキャストしたものです。id は ObjectId に変換せず、文字列として送信します。
例外 (Throws)
Section titled “例外 (Throws)”トークン、トランスポート、JSON の失敗、または OK でない HTTP レスポンスに対して拒否されます。成功した HTTP レスポンスの JSON は、アプリケーションエラーを表していても信頼します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { MongoApiAdapter } from '@alneas/appkit-core/data/mongodb';export async function findOneTasks(adapter: MongoApiAdapter) { return adapter.findOne('tasks', 'task-1');}---
### `FUNCTION` `data.MongoApiAdapter.create`
入力ドキュメントを変更せずに insertOne を送信します。
```typescriptasync create<T = unknown>( collection: string, data: Record<string, unknown>, options?: QueryOptions, ): Promise<T>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - ホスト API にそのまま送信するコレクション名です。 |
data |
Record<string, unknown> |
必須 | - JSON としてシリアライズするドキュメントです。検証と永続化はエンドポイントが担います。 |
options |
QueryOptions | undefined |
任意 | - 操作のボディにシリアライズするオプションです。ただし、find は対応するオプションのサブセットを独自に構成します。signal は HTTP リクエストをキャンセルしません。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T> - Description: サーバーの JSON を T にキャストしたものです。同じ通信上の操作に対して insertOne は操作メタデータを期待しますが、create に対してはエンドポイントがレコードを返す必要があります。
例外 (Throws)
Section titled “例外 (Throws)”トークン、トランスポート、JSON の失敗、または OK でない HTTP レスポンスに対して拒否されます。成功した HTTP レスポンスの JSON は、アプリケーションエラーを表していても信頼します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { MongoApiAdapter } from '@alneas/appkit-core/data/mongodb';export async function createTasks(adapter: MongoApiAdapter) { return adapter.create('tasks', { title: 'Draft' });}---
### `FUNCTION` `data.MongoApiAdapter.update`
文字列の _id に対して findOneAndUpdate を送信します。
```typescriptasync update<T = unknown>( collection: string, id: string, data: Record<string, unknown>, options?: QueryOptions, ): Promise<T>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - ホスト API にそのまま送信するコレクション名です。 |
id |
string |
必須 | - _id と照合する文字列です。変換はエンドポイントが担います。 |
data |
Record<string, unknown> |
必須 | - JSON としてシリアライズするドキュメントです。検証と永続化はエンドポイントが担います。 |
options |
QueryOptions | undefined |
任意 | - 操作のボディにシリアライズするオプションです。ただし、find は対応するオプションのサブセットを独自に構成します。signal は HTTP リクエストをキャンセルしません。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T> - Description: サーバーの JSON を T にキャストしたものです。returnDocument のデフォルトは after ですが、options で上書きできます。$ で始まるキーが1つもないデータは $set で包み、それ以外は演算子ドキュメントとしてそのまま転送します。
例外 (Throws)
Section titled “例外 (Throws)”トークン、トランスポート、JSON の失敗、または OK でない HTTP レスポンスに対して拒否されます。成功した HTTP レスポンスの JSON は、アプリケーションエラーを表していても信頼します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { MongoApiAdapter } from '@alneas/appkit-core/data/mongodb';export async function updateTasks(adapter: MongoApiAdapter) { return adapter.update('tasks', 'task-1', { title: 'Reviewed' });}---
### `FUNCTION` `data.MongoApiAdapter.replace`
データを $set でラップせずに、文字列の _id に対して replaceOne を送信します。
```typescriptasync replace<T = unknown>( collection: string, id: string, data: Record<string, unknown>, options?: QueryOptions, ): Promise<T>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - ホスト API にそのまま送信するコレクション名です。 |
id |
string |
必須 | - _id と照合する文字列です。変換はエンドポイントが担います。 |
data |
Record<string, unknown> |
必須 | - JSON としてシリアライズするドキュメントです。検証と永続化はエンドポイントが担います。 |
options |
QueryOptions | undefined |
任意 | - 操作のボディにシリアライズするオプションです。ただし、find は対応するオプションのサブセットを独自に構成します。signal は HTTP リクエストをキャンセルしません。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T> - Description: サーバーの JSON を T にキャストしたものです。このラッパーは置換結果の再読み取りや Mongo の結果メタデータの正規化を行いません。
例外 (Throws)
Section titled “例外 (Throws)”トークン、トランスポート、JSON の失敗、または OK でない HTTP レスポンスに対して拒否されます。成功した HTTP レスポンスの JSON は、アプリケーションエラーを表していても信頼します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { MongoApiAdapter } from '@alneas/appkit-core/data/mongodb';export async function replaceTasks(adapter: MongoApiAdapter) { return adapter.replace('tasks', 'task-1', { title: 'Reviewed' });}---
### `FUNCTION` `data.MongoApiAdapter.delete`
文字列の _id に対して findOneAndDelete を送信します。
```typescriptasync delete<T = unknown>(collection: string, id: string, options?: QueryOptions): Promise<T>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - ホスト API にそのまま送信するコレクション名です。 |
id |
string |
必須 | - _id と照合する文字列です。変換はエンドポイントが担います。 |
options |
QueryOptions | undefined |
任意 | - 操作のボディにシリアライズするオプションです。ただし、find は対応するオプションのサブセットを独自に構成します。signal は HTTP リクエストをキャンセルしません。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T> - Description: サーバーの JSON を T にキャストしたものです。行が存在しない場合と返却ドキュメントの動作は、エンドポイントが担います。
例外 (Throws)
Section titled “例外 (Throws)”トークン、トランスポート、JSON の失敗、または OK でない HTTP レスポンスに対して拒否されます。成功した HTTP レスポンスの JSON は、アプリケーションエラーを表していても信頼します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { MongoApiAdapter } from '@alneas/appkit-core/data/mongodb';export async function deleteTasks(adapter: MongoApiAdapter) { return adapter.delete('tasks', 'task-1');}---
### `FUNCTION` `data.MongoApiAdapter.count`
指定されたフィルターまたは空のフィルターを使用して countDocuments を要求します。
```typescriptasync count(collection: string, filter?: Filter, options?: QueryOptions): Promise<number>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - ホスト API にそのまま送信するコレクション名です。 |
filter |
Filter | undefined |
任意 | - JSON としてシリアライズする Mongo 形式のフィルターです。空のフィルターはすべてのレコードを選択する場合があります。 |
options |
QueryOptions | undefined |
任意 | - 操作のボディにシリアライズするオプションです。ただし、find は対応するオプションのサブセットを独自に構成します。signal は HTTP リクエストをキャンセルしません。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<number> - Description: サーバーの JSON の count プロパティです。数値の検証は行いません。
例外 (Throws)
Section titled “例外 (Throws)”トークン、トランスポート、JSON の失敗、または OK でない HTTP レスポンスに対して拒否されます。成功した HTTP レスポンスの JSON は、アプリケーションエラーを表していても信頼します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { MongoApiAdapter } from '@alneas/appkit-core/data/mongodb';export async function countTasks(adapter: MongoApiAdapter) { return adapter.count('tasks', { status: 'open' });}---
### `FUNCTION` `data.MongoApiAdapter.createMany`
すべての入力ドキュメントを 1 回の insertMany 操作で送信します。
```typescriptasync createMany<T = unknown>( collection: string, data: Record<string, unknown>[], options?: QueryOptions, ): Promise<T[]>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - ホスト API にそのまま送信するコレクション名です。 |
data |
Record<string, unknown>[] |
必須 | - JSON としてシリアライズするドキュメントです。検証と永続化はエンドポイントが担います。 |
options |
QueryOptions | undefined |
任意 | - 操作のボディにシリアライズするオプションです。ただし、find は対応するオプションのサブセットを独自に構成します。signal は HTTP リクエストをキャンセルしません。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T[]> - Description: サーバーの JSON を T[] にキャストしたものです。トランザクション、順序付け、ドキュメントの再読み取りは追加しません。
例外 (Throws)
Section titled “例外 (Throws)”トークン、トランスポート、JSON の失敗、または OK でない HTTP レスポンスに対して拒否されます。成功した HTTP レスポンスの JSON は、アプリケーションエラーを表していても信頼します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { MongoApiAdapter } from '@alneas/appkit-core/data/mongodb';export async function createManyTasks(adapter: MongoApiAdapter) { return adapter.createMany('tasks', [{ title: 'Draft' }]);}---
### `FUNCTION` `data.MongoApiAdapter.updateMany`
演算子ドキュメント、または自動的に $set でラップしたデータを指定して updateMany を送信します。
```typescriptasync updateMany<T = unknown>( collection: string, filter: Filter, data: Record<string, unknown>, options?: QueryOptions, ): Promise<T[]>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - ホスト API にそのまま送信するコレクション名です。 |
filter |
Filter |
必須 | - JSON としてシリアライズする Mongo 形式のフィルターです。空のフィルターはすべてのレコードを選択する場合があります。 |
data |
Record<string, unknown> |
必須 | - JSON としてシリアライズするドキュメントです。検証と永続化はエンドポイントが担います。 |
options |
QueryOptions | undefined |
任意 | - 操作のボディにシリアライズするオプションです。ただし、find は対応するオプションのサブセットを独自に構成します。signal は HTTP リクエストをキャンセルしません。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T[]> - Description: サーバーの JSON を T[] にキャストしたものです。このアダプターは、標準の Mongo 更新結果メタデータを行に変換しません。
例外 (Throws)
Section titled “例外 (Throws)”トークン、トランスポート、JSON の失敗、または OK でない HTTP レスポンスに対して拒否されます。成功した HTTP レスポンスの JSON は、アプリケーションエラーを表していても信頼します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { MongoApiAdapter } from '@alneas/appkit-core/data/mongodb';export async function updateManyTasks(adapter: MongoApiAdapter) { return adapter.updateMany('tasks', { status: 'open' }, { status: 'closed' });}---
### `FUNCTION` `data.MongoApiAdapter.deleteMany`
指定されたフィルターで deleteMany を送信します。
```typescriptasync deleteMany<T = unknown>( collection: string, filter: Filter, options?: QueryOptions, ): Promise<T[]>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - ホスト API にそのまま送信するコレクション名です。 |
filter |
Filter |
必須 | - JSON としてシリアライズする Mongo 形式のフィルターです。空のフィルターはすべてのレコードを選択する場合があります。 |
options |
QueryOptions | undefined |
任意 | - 操作のボディにシリアライズするオプションです。ただし、find は対応するオプションのサブセットを独自に構成します。signal は HTTP リクエストをキャンセルしません。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T[]> - Description: サーバーの JSON を T[] にキャストしたものです。このアダプターは、標準の Mongo 削除結果メタデータを行に変換しません。
例外 (Throws)
Section titled “例外 (Throws)”トークン、トランスポート、JSON の失敗、または OK でない HTTP レスポンスに対して拒否されます。成功した HTTP レスポンスの JSON は、アプリケーションエラーを表していても信頼します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { MongoApiAdapter } from '@alneas/appkit-core/data/mongodb';export async function deleteManyTasks(adapter: MongoApiAdapter) { return adapter.deleteMany('tasks', { status: 'archived' });}---
### `FUNCTION` `data.MongoApiAdapter.insertOne`
create が使用するものと同じ insertOne 通信操作を送信します。
```typescriptasync insertOne( collection: string, data: Record<string, unknown>, options?: QueryOptions, ): Promise<OperationResult>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - ホスト API にそのまま送信するコレクション名です。 |
data |
Record<string, unknown> |
必須 | - JSON としてシリアライズするドキュメントです。検証と永続化はエンドポイントが担います。 |
options |
QueryOptions | undefined |
任意 | - 操作のボディにシリアライズするオプションです。ただし、find は対応するオプションのサブセットを独自に構成します。signal は HTTP リクエストをキャンセルしません。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<OperationResult> - Description: サーバーの JSON を、正規化せずに OperationResult にキャストしたものです。ホストは期待されるメタデータを提供する必要があります。
例外 (Throws)
Section titled “例外 (Throws)”トークン、トランスポート、JSON の失敗、または OK でない HTTP レスポンスに対して拒否されます。成功した HTTP レスポンスの JSON は、アプリケーションエラーを表していても信頼します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { MongoApiAdapter } from '@alneas/appkit-core/data/mongodb';export async function insertOneTasks(adapter: MongoApiAdapter) { return adapter.insertOne('tasks', { title: 'Draft' });}---
### `FUNCTION` `data.MongoApiAdapter.updateOne`
updateOne を送信します。トップレベルに $ キーが存在しない場合にのみ、データを $set でラップします。
```typescriptasync updateOne( collection: string, filter: Filter, data: Record<string, unknown>, options?: QueryOptions, ): Promise<OperationResult>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - ホスト API にそのまま送信するコレクション名です。 |
filter |
Filter |
必須 | - JSON としてシリアライズする Mongo 形式のフィルターです。空のフィルターはすべてのレコードを選択する場合があります。 |
data |
Record<string, unknown> |
必須 | - JSON としてシリアライズするドキュメントです。検証と永続化はエンドポイントが担います。 |
options |
QueryOptions | undefined |
任意 | - 操作のボディにシリアライズするオプションです。ただし、find は対応するオプションのサブセットを独自に構成します。signal は HTTP リクエストをキャンセルしません。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<OperationResult> - Description: サーバーの JSON を、正規化せずに OperationResult にキャストしたものです。
例外 (Throws)
Section titled “例外 (Throws)”トークン、トランスポート、JSON の失敗、または OK でない HTTP レスポンスに対して拒否されます。成功した HTTP レスポンスの JSON は、アプリケーションエラーを表していても信頼します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { MongoApiAdapter } from '@alneas/appkit-core/data/mongodb';export async function updateOneTasks(adapter: MongoApiAdapter) { return adapter.updateOne('tasks', { _id: 'task-1' }, { title: 'Reviewed' });}---
### `FUNCTION` `data.MongoApiAdapter.replaceOne`
データを置換内容として使用し、フィルター付きの replaceOne 操作を送信します。
```typescriptasync replaceOne( collection: string, filter: Filter, data: Record<string, unknown>, options?: QueryOptions, ): Promise<OperationResult>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - ホスト API にそのまま送信するコレクション名です。 |
filter |
Filter |
必須 | - JSON としてシリアライズする Mongo 形式のフィルターです。空のフィルターはすべてのレコードを選択する場合があります。 |
data |
Record<string, unknown> |
必須 | - JSON としてシリアライズするドキュメントです。検証と永続化はエンドポイントが担います。 |
options |
QueryOptions | undefined |
任意 | - 操作のボディにシリアライズするオプションです。ただし、find は対応するオプションのサブセットを独自に構成します。signal は HTTP リクエストをキャンセルしません。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<OperationResult> - Description: サーバーの JSON を、正規化せずに OperationResult にキャストしたものです。
例外 (Throws)
Section titled “例外 (Throws)”トークン、トランスポート、JSON の失敗、または OK でない HTTP レスポンスに対して拒否されます。成功した HTTP レスポンスの JSON は、アプリケーションエラーを表していても信頼します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { MongoApiAdapter } from '@alneas/appkit-core/data/mongodb';export async function replaceOneTasks(adapter: MongoApiAdapter) { return adapter.replaceOne('tasks', { _id: 'task-1' }, { title: 'Reviewed' });}---
### `FUNCTION` `data.MongoApiAdapter.deleteOne`
フィルター付きの deleteOne 操作を送信します。
```typescriptasync deleteOne( collection: string, filter: Filter, options?: QueryOptions, ): Promise<OperationResult>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - ホスト API にそのまま送信するコレクション名です。 |
filter |
Filter |
必須 | - JSON としてシリアライズする Mongo 形式のフィルターです。空のフィルターはすべてのレコードを選択する場合があります。 |
options |
QueryOptions | undefined |
任意 | - 操作のボディにシリアライズするオプションです。ただし、find は対応するオプションのサブセットを独自に構成します。signal は HTTP リクエストをキャンセルしません。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<OperationResult> - Description: サーバーの JSON を、正規化せずに OperationResult にキャストしたものです。
例外 (Throws)
Section titled “例外 (Throws)”トークン、トランスポート、JSON の失敗、または OK でない HTTP レスポンスに対して拒否されます。成功した HTTP レスポンスの JSON は、アプリケーションエラーを表していても信頼します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { MongoApiAdapter } from '@alneas/appkit-core/data/mongodb';export async function deleteOneTasks(adapter: MongoApiAdapter) { return adapter.deleteOne('tasks', { _id: 'task-1' });}---
### `FUNCTION` `data.MongoApiAdapter.findOneAndUpdate`
フィルター付きの findOneAndUpdate を要求します。通常のデータには自動的に $set を適用します。
```typescriptasync findOneAndUpdate<T = unknown>( collection: string, filter: Filter, data: Record<string, unknown>, options?: QueryOptions, ): Promise<T | null>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - ホスト API にそのまま送信するコレクション名です。 |
filter |
Filter |
必須 | - JSON としてシリアライズする Mongo 形式のフィルターです。空のフィルターはすべてのレコードを選択する場合があります。 |
data |
Record<string, unknown> |
必須 | - JSON としてシリアライズするドキュメントです。検証と永続化はエンドポイントが担います。 |
options |
QueryOptions | undefined |
任意 | - 操作のボディにシリアライズするオプションです。ただし、find は対応するオプションのサブセットを独自に構成します。signal は HTTP リクエストをキャンセルしません。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T | null> - Description: サーバーの JSON を T または null にキャストしたものです。returnDocument のデフォルトは after で、呼び出し元のオプションがそれを上書きします。原子性はサーバーが担います。
例外 (Throws)
Section titled “例外 (Throws)”トークン、トランスポート、JSON の失敗、または OK でない HTTP レスポンスに対して拒否されます。成功した HTTP レスポンスの JSON は、アプリケーションエラーを表していても信頼します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { MongoApiAdapter } from '@alneas/appkit-core/data/mongodb';export async function findOneAndUpdateTasks(adapter: MongoApiAdapter) { return adapter.findOneAndUpdate('tasks', { _id: 'task-1' }, { title: 'Reviewed' });}---
### `FUNCTION` `data.MongoApiAdapter.findOneAndReplace`
置換ドキュメント全体を使用し、フィルター付きの findOneAndReplace を要求します。
```typescriptasync findOneAndReplace<T = unknown>( collection: string, filter: Filter, data: Record<string, unknown>, options?: QueryOptions, ): Promise<T | null>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - ホスト API にそのまま送信するコレクション名です。 |
filter |
Filter |
必須 | - JSON としてシリアライズする Mongo 形式のフィルターです。空のフィルターはすべてのレコードを選択する場合があります。 |
data |
Record<string, unknown> |
必須 | - JSON としてシリアライズするドキュメントです。検証と永続化はエンドポイントが担います。 |
options |
QueryOptions | undefined |
任意 | - 操作のボディにシリアライズするオプションです。ただし、find は対応するオプションのサブセットを独自に構成します。signal は HTTP リクエストをキャンセルしません。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T | null> - Description: サーバーの JSON を T または null にキャストしたものです。returnDocument のデフォルトは after で、呼び出し元のオプションがそれを上書きします。原子性はサーバーが担います。
例外 (Throws)
Section titled “例外 (Throws)”トークン、トランスポート、JSON の失敗、または OK でない HTTP レスポンスに対して拒否されます。成功した HTTP レスポンスの JSON は、アプリケーションエラーを表していても信頼します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { MongoApiAdapter } from '@alneas/appkit-core/data/mongodb';export async function findOneAndReplaceTasks(adapter: MongoApiAdapter) { return adapter.findOneAndReplace('tasks', { _id: 'task-1' }, { title: 'Reviewed' });}---
### `FUNCTION` `data.MongoApiAdapter.findOneAndDelete`
フィルター付きの findOneAndDelete 操作を要求します。
```typescriptasync findOneAndDelete<T = unknown>( collection: string, filter: Filter, options?: QueryOptions, ): Promise<T | null>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - ホスト API にそのまま送信するコレクション名です。 |
filter |
Filter |
必須 | - JSON としてシリアライズする Mongo 形式のフィルターです。空のフィルターはすべてのレコードを選択する場合があります。 |
options |
QueryOptions | undefined |
任意 | - 操作のボディにシリアライズするオプションです。ただし、find は対応するオプションのサブセットを独自に構成します。signal は HTTP リクエストをキャンセルしません。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T | null> - Description: サーバーの JSON を T または null にキャストしたものです。原子性と、行が存在しない場合の処理はサーバーが担います。
例外 (Throws)
Section titled “例外 (Throws)”トークン、トランスポート、JSON の失敗、または OK でない HTTP レスポンスに対して拒否されます。成功した HTTP レスポンスの JSON は、アプリケーションエラーを表していても信頼します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { MongoApiAdapter } from '@alneas/appkit-core/data/mongodb';export async function findOneAndDeleteTasks(adapter: MongoApiAdapter) { return adapter.findOneAndDelete('tasks', { _id: 'task-1' });}---
### `FUNCTION` `data.MongoApiAdapter.aggregate`
ステージを検査したり書き換えたりせずに、集計パイプラインを転送します。
```typescriptasync aggregate<T = unknown>( collection: string, pipeline: unknown[], options?: QueryOptions, ): Promise<T[]>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - ホスト API にそのまま送信するコレクション名です。 |
pipeline |
unknown[] |
必須 | - 変更せずにシリアライズする Mongo の集計ステージです。 |
options |
QueryOptions | undefined |
任意 | - 操作のボディにシリアライズするオプションです。ただし、find は対応するオプションのサブセットを独自に構成します。signal は HTTP リクエストをキャンセルしません。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T[]> - Description: サーバーの JSON を T[] にキャストしたものです。ステージのサポートと実行ポリシーはエンドポイントが担います。
例外 (Throws)
Section titled “例外 (Throws)”トークン、トランスポート、JSON の失敗、または OK でない HTTP レスポンスに対して拒否されます。成功した HTTP レスポンスの JSON は、アプリケーションエラーを表していても信頼します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { MongoApiAdapter } from '@alneas/appkit-core/data/mongodb';export async function aggregateTasks(adapter: MongoApiAdapter) { return adapter.aggregate('tasks', [{ $match: { status: 'open' } }]);}---
### `CONST` `data.ConvexQueryRefs.list`
{ filter, ...options } を受け取り、レコード配列を返すクエリです。アダプターはフィルター演算子を変換しません。
```typescriptexport const data.ConvexQueryRefs.list: unknownCONST data.ConvexQueryRefs.get
Section titled “CONST data.ConvexQueryRefs.get”{ id } を受け取り、1 件のレコードまたは null を返すクエリです。
export const data.ConvexQueryRefs.get: unknownCONST data.ConvexQueryRefs.count
Section titled “CONST data.ConvexQueryRefs.count”{ filter } を受け取り、数値を返す任意のクエリです。存在しない場合、count は拒否されます。
export const data.ConvexQueryRefs.count: unknownCONST data.ConvexMutationRefs.create
Section titled “CONST data.ConvexMutationRefs.create”{ data } を受け取り、作成されたレコードを返すミューテーションです。
export const data.ConvexMutationRefs.create: unknownCONST data.ConvexMutationRefs.update
Section titled “CONST data.ConvexMutationRefs.update”{ id, data } を受け取り、更新されたレコードを返すミューテーションです。
export const data.ConvexMutationRefs.update: unknownCONST data.ConvexMutationRefs.delete
Section titled “CONST data.ConvexMutationRefs.delete”{ id } を受け取り、ホストが定義する削除結果を返すミューテーションです。
export const data.ConvexMutationRefs.delete: unknownCONST data.ConvexMutationRefs.createMany
Section titled “CONST data.ConvexMutationRefs.createMany”{ items } を受け取り、配列を返す任意のミューテーションです。存在しない場合は、共有トランザクションを使用せずに create を順次呼び出します。
export const data.ConvexMutationRefs.createMany: unknownCONST data.ConvexMutationRefs.updateMany
Section titled “CONST data.ConvexMutationRefs.updateMany”{ filter, data } を受け取り、配列を返す任意のミューテーションです。存在しない場合、updateMany は拒否されます。
export const data.ConvexMutationRefs.updateMany: unknownCONST data.ConvexMutationRefs.deleteMany
Section titled “CONST data.ConvexMutationRefs.deleteMany”{ filter } を受け取り、配列を返す任意のミューテーションです。存在しない場合、deleteMany は拒否されます。
export const data.ConvexMutationRefs.deleteMany: unknownCONST data.ConvexAdapterConfig.client
Section titled “CONST data.ConvexAdapterConfig.client”ConvexReactClient インスタンスです。
export const data.ConvexAdapterConfig.client: ConvexReactClientCONST data.ConvexAdapterConfig.queries
Section titled “CONST data.ConvexAdapterConfig.queries”コレクション名を、ホストの list/get および任意の count の参照に対応付けます。
export const data.ConvexAdapterConfig.queries: Record<string, ConvexQueryRefs>CONST data.ConvexAdapterConfig.mutations
Section titled “CONST data.ConvexAdapterConfig.mutations”コレクション名を、ホストの CRUD および任意の一括操作の参照に対応付けます。
export const data.ConvexAdapterConfig.mutations: Record<string, ConvexMutationRefs>CONST data.ConvexAdapter.isConvex
Section titled “CONST data.ConvexAdapter.isConvex”このアダプターが Convex アダプターであることを示すフラグです。
export const data.ConvexAdapter.isConvex: booleanFUNCTION data.ConvexAdapter.getClient
Section titled “FUNCTION data.ConvexAdapter.getClient”連携する統合機能向けに、設定されたクライアントそのものを返します。
getClient(): ConvexReactClient戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
ConvexReactClient - Description: ホストの共有クライアントです。アダプターは所有権を移転せず、破棄もしません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { ConvexAdapter } from '@alneas/appkit-core/data/convex';export function convexClient(adapter: ConvexAdapter) { return adapter.getClient(); }---
### `FUNCTION` `data.ConvexAdapter.getQueryRefs`
コレクションの存在を要求せずに、設定されたクエリ参照を読み取ります。
```typescriptgetQueryRefs(collection: string): ConvexQueryRefs | undefined引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - コレクションマップのキーです。完全一致で指定します。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
ConvexQueryRefs | undefined - Description: 保存されている参照オブジェクト、または undefined です。そのオブジェクトを変更すると、以後のアダプター操作に影響します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { ConvexAdapter } from '@alneas/appkit-core/data/convex';export function taskQueries(adapter: ConvexAdapter) { return adapter.getQueryRefs('tasks'); }---
### `FUNCTION` `data.ConvexAdapter.getMutationRefs`
コレクションの存在を要求せずに、設定されたミューテーション参照を読み取ります。
```typescriptgetMutationRefs(collection: string): ConvexMutationRefs | undefined引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - コレクションマップのキーです。完全一致で指定します。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
ConvexMutationRefs | undefined - Description: 保存されている参照オブジェクト、または undefined です。そのオブジェクトを変更すると、以後のアダプター操作に影響します。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { ConvexAdapter } from '@alneas/appkit-core/data/convex';export function taskMutations(adapter: ConvexAdapter) { return adapter.getMutationRefs('tasks'); }---
### `FUNCTION` `data.ConvexAdapter.find`
list クエリの引数を { filter, ...options } として転送します。これは単発のクエリです。
```typescriptasync find<T = unknown>( collection: string, filter?: Filter, options?: QueryOptions, ): Promise<T[]>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - 設定されたコレクションマップのキーと完全に一致する値です。 |
filter |
Filter | undefined |
任意 | - 変更せずに渡されるフィルターです。サポートする操作はホストのクエリ/ミューテーションが定義します。 |
options |
QueryOptions | undefined |
任意 | - list クエリの引数内で filter の後に展開するフィールドです。サポート範囲はホストのクエリが定義します。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T[]> - Description: T[] にキャストしたホストの結果です。フィルター、プロジェクション、ページネーションの仕様はホストのクエリに委ねられます。
例外 (Throws)
Section titled “例外 (Throws)”コレクション参照が存在しない場合、必要な任意機能が欠けている場合、またはホストクライアントが拒否した場合に拒否されます。再試行、ロールバック、キャンセルは追加しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { ConvexAdapter } from '@alneas/appkit-core/data/convex';export async function findTasks(adapter: ConvexAdapter) { return adapter.find('tasks', { status: 'open' }, { limit: 20 });}---
### `FUNCTION` `data.ConvexAdapter.findOne`
設定された get クエリを { id } で呼び出します。
```typescriptasync findOne<T = unknown>( collection: string, id: string, _options?: QueryOptions, ): Promise<T | null>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - 設定されたコレクションマップのキーと完全に一致する値です。 |
id |
string |
必須 | - ホスト関数に変更せずに渡される識別子です。 |
_options |
QueryOptions | undefined |
任意 | - 互換性のために受け付けますが、無視されます。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T | null> - Description: ホストのレコードまたは null です。
例外 (Throws)
Section titled “例外 (Throws)”コレクション参照が存在しない場合、必要な任意機能が欠けている場合、またはホストクライアントが拒否した場合に拒否されます。再試行、ロールバック、キャンセルは追加しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { ConvexAdapter } from '@alneas/appkit-core/data/convex';export async function findOneTasks(adapter: ConvexAdapter) { return adapter.findOne('tasks', 'task-1');}---
### `FUNCTION` `data.ConvexAdapter.create`
create を { data } で呼び出します。
```typescriptasync create<T = unknown>( collection: string, data: Record<string, unknown>, _options?: QueryOptions, ): Promise<T>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - 設定されたコレクションマップのキーと完全に一致する値です。 |
data |
Record<string, unknown> |
必須 | - ホスト関数に変更せずに渡されるレコードデータ、またはバッチレコードです。 |
_options |
QueryOptions | undefined |
任意 | - 互換性のために受け付けますが、無視されます。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T> - Description: ホストが作成したレコードです。
例外 (Throws)
Section titled “例外 (Throws)”コレクション参照が存在しない場合、必要な任意機能が欠けている場合、またはホストクライアントが拒否した場合に拒否されます。再試行、ロールバック、キャンセルは追加しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { ConvexAdapter } from '@alneas/appkit-core/data/convex';export async function createTasks(adapter: ConvexAdapter) { return adapter.create('tasks', { title: 'Draft' });}---
### `FUNCTION` `data.ConvexAdapter.update`
update を { id, data } で呼び出します。
```typescriptasync update<T = unknown>( collection: string, id: string, data: Record<string, unknown>, _options?: QueryOptions, ): Promise<T>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - 設定されたコレクションマップのキーと完全に一致する値です。 |
id |
string |
必須 | - ホスト関数に変更せずに渡される識別子です。 |
data |
Record<string, unknown> |
必須 | - ホスト関数に変更せずに渡されるレコードデータ、またはバッチレコードです。 |
_options |
QueryOptions | undefined |
任意 | - 互換性のために受け付けますが、無視されます。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T> - Description: ホストが更新したレコードです。部分更新/置換の仕様はその関数に委ねられます。
例外 (Throws)
Section titled “例外 (Throws)”コレクション参照が存在しない場合、必要な任意機能が欠けている場合、またはホストクライアントが拒否した場合に拒否されます。再試行、ロールバック、キャンセルは追加しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { ConvexAdapter } from '@alneas/appkit-core/data/convex';export async function updateTasks(adapter: ConvexAdapter) { return adapter.update('tasks', 'task-1', { title: 'Reviewed' });}---
### `FUNCTION` `data.ConvexAdapter.delete`
delete を { id } で呼び出します。
```typescriptasync delete<T = unknown>(collection: string, id: string, _options?: QueryOptions): Promise<T>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - 設定されたコレクションマップのキーと完全に一致する値です。 |
id |
string |
必須 | - ホスト関数に変更せずに渡される識別子です。 |
_options |
QueryOptions | undefined |
任意 | - 互換性のために受け付けますが、無視されます。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T> - Description: T にキャストしたホストの削除結果です。再読み取りや結果の正規化は追加しません。
例外 (Throws)
Section titled “例外 (Throws)”コレクション参照が存在しない場合、必要な任意機能が欠けている場合、またはホストクライアントが拒否した場合に拒否されます。再試行、ロールバック、キャンセルは追加しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { ConvexAdapter } from '@alneas/appkit-core/data/convex';export async function deleteTasks(adapter: ConvexAdapter) { return adapter.delete('tasks', 'task-1');}---
### `FUNCTION` `data.ConvexAdapter.count`
任意の count クエリを { filter } で呼び出します。
```typescriptasync count(collection: string, filter?: Filter, _options?: QueryOptions): Promise<number>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - 設定されたコレクションマップのキーと完全に一致する値です。 |
filter |
Filter | undefined |
任意 | - 変更せずに渡されるフィルターです。サポートする操作はホストのクエリ/ミューテーションが定義します。 |
_options |
QueryOptions | undefined |
任意 | - 互換性のために受け付けますが、無視されます。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<number> - Description: ホストの件数です。数値の検証を行わずに信頼します。
例外 (Throws)
Section titled “例外 (Throws)”コレクション参照が存在しない場合、必要な任意機能が欠けている場合、またはホストクライアントが拒否した場合に拒否されます。再試行、ロールバック、キャンセルは追加しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { ConvexAdapter } from '@alneas/appkit-core/data/convex';export async function countTasks(adapter: ConvexAdapter) { return adapter.count('tasks', { status: 'open' });}---
### `FUNCTION` `data.ConvexAdapter.createMany`
任意の createMany を { items } で呼び出します。存在しない場合は create を順次呼び出します。
```typescriptasync createMany<T = unknown>( collection: string, data: Record<string, unknown>[], _options?: QueryOptions, ): Promise<T[]>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - 設定されたコレクションマップのキーと完全に一致する値です。 |
data |
Record<string, unknown>[] |
必須 | - ホスト関数に変更せずに渡されるレコードデータ、またはバッチレコードです。 |
_options |
QueryOptions | undefined |
任意 | - 互換性のために受け付けますが、無視されます。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T[]> - Description: ホストの結果配列、または入力順に並んだフォールバックの結果です。フォールバックの途中で失敗すると、それ以前のレコードは作成されたままになる可能性があります。入力が空でも、コレクションの設定が必要です。
例外 (Throws)
Section titled “例外 (Throws)”コレクション参照が存在しない場合、必要な任意機能が欠けている場合、またはホストクライアントが拒否した場合に拒否されます。再試行、ロールバック、キャンセルは追加しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { ConvexAdapter } from '@alneas/appkit-core/data/convex';export async function createManyTasks(adapter: ConvexAdapter) { return adapter.createMany('tasks', [{ title: 'Draft' }]);}---
### `FUNCTION` `data.ConvexAdapter.updateMany`
この呼び出しでは必須となる updateMany を { filter, data } で呼び出します。
```typescriptasync updateMany<T = unknown>( collection: string, filter: Filter, data: Record<string, unknown>, _options?: QueryOptions, ): Promise<T[]>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - 設定されたコレクションマップのキーと完全に一致する値です。 |
filter |
Filter |
必須 | - 変更せずに渡されるフィルターです。サポートする操作はホストのクエリ/ミューテーションが定義します。 |
data |
Record<string, unknown> |
必須 | - ホスト関数に変更せずに渡されるレコードデータ、またはバッチレコードです。 |
_options |
QueryOptions | undefined |
任意 | - 互換性のために受け付けますが、無視されます。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T[]> - Description: ホストが更新したレコードの配列です。クライアント側のフォールバックは提供しません。
例外 (Throws)
Section titled “例外 (Throws)”コレクション参照が存在しない場合、必要な任意機能が欠けている場合、またはホストクライアントが拒否した場合に拒否されます。再試行、ロールバック、キャンセルは追加しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { ConvexAdapter } from '@alneas/appkit-core/data/convex';export async function updateManyTasks(adapter: ConvexAdapter) { return adapter.updateMany('tasks', { status: 'open' }, { status: 'closed' });}---
### `FUNCTION` `data.ConvexAdapter.deleteMany`
この呼び出しでは必須となる deleteMany を { filter } で呼び出します。
```typescriptasync deleteMany<T = unknown>( collection: string, filter: Filter, _options?: QueryOptions, ): Promise<T[]>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - 設定されたコレクションマップのキーと完全に一致する値です。 |
filter |
Filter |
必須 | - 変更せずに渡されるフィルターです。サポートする操作はホストのクエリ/ミューテーションが定義します。 |
_options |
QueryOptions | undefined |
任意 | - 互換性のために受け付けますが、無視されます。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T[]> - Description: ホストが削除したレコードの配列です。クライアント側のフォールバックは提供しません。
例外 (Throws)
Section titled “例外 (Throws)”コレクション参照が存在しない場合、必要な任意機能が欠けている場合、またはホストクライアントが拒否した場合に拒否されます。再試行、ロールバック、キャンセルは追加しません。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { ConvexAdapter } from '@alneas/appkit-core/data/convex';export async function deleteManyTasks(adapter: ConvexAdapter) { return adapter.deleteMany('tasks', { status: 'archived' });}---
### `CONST` `data.SqliteRunResult.changes`
変更された行数です。ドライバーが返さない場合は undefined です。
```typescriptexport const data.SqliteRunResult.changes: number | undefinedCONST data.SqliteRunResult.lastInsertRowid
Section titled “CONST data.SqliteRunResult.lastInsertRowid”挿入された行の rowid です。ドライバーが返さない場合は undefined です。
export const data.SqliteRunResult.lastInsertRowid: string | number | bigint | undefinedFUNCTION data.SqliteDriver.all
Section titled “FUNCTION data.SqliteDriver.all”SQL を実行し、すべての行を返します。
all<T = Record<string, unknown>>( sql: string, params: readonly SqliteValue[], ): Promise<readonly T[]>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
sql |
string |
必須 | - プリペアして実行する SQL テキストです。 |
params |
readonly SqliteValue[] |
必須 | - プレースホルダー順の位置指定スカラー値です。互換性は選択されたドライバーが担います。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<readonly T[]> - Description: ドライバーの行配列を返す Promise です。
FUNCTION data.SqliteDriver.get
Section titled “FUNCTION data.SqliteDriver.get”SQL を実行し、最初の行または null を返します。
get<T = Record<string, unknown>>(sql: string, params: readonly SqliteValue[]): Promise<T | null>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
sql |
string |
必須 | - プリペアして実行する SQL テキストです。 |
params |
readonly SqliteValue[] |
必須 | - プレースホルダー順の位置指定スカラー値です。互換性は選択されたドライバーが担います。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T | null> - Description: 最初の行または null を返す Promise です。
FUNCTION data.SqliteDriver.run
Section titled “FUNCTION data.SqliteDriver.run”書き込みを実行し、ドライバーのメタデータを返します。
run(sql: string, params: readonly SqliteValue[]): Promise<SqliteRunResult>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
sql |
string |
必須 | - プリペアして実行する SQL テキストです。 |
params |
readonly SqliteValue[] |
必須 | - プレースホルダー順の位置指定スカラー値です。互換性は選択されたドライバーが担います。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<SqliteRunResult> - Description: 書き込みメタデータを返す Promise です。changes と lastInsertRowid は存在しない場合があります。
FUNCTION data.SqlitePreparedStatementLike.all
Section titled “FUNCTION data.SqlitePreparedStatementLike.all”SQL を実行し、すべての行を返します。
all<T = Record<string, unknown>>(...params: SqliteValue[]): readonly T[];引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
params |
SqliteValue[] |
任意 | - プレースホルダー順の位置指定スカラー値です。互換性は選択されたドライバーが担います。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
readonly T[] - Description: ドライバーの行配列です。
FUNCTION data.SqlitePreparedStatementLike.get
Section titled “FUNCTION data.SqlitePreparedStatementLike.get”SQL を実行し、最初の行または null を返します。
get<T = Record<string, unknown>>(...params: SqliteValue[]): T | null;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
params |
SqliteValue[] |
任意 | - プレースホルダー順の位置指定スカラー値です。互換性は選択されたドライバーが担います。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
T | null - Description: 最初の行または null です。
FUNCTION data.SqlitePreparedStatementLike.run
Section titled “FUNCTION data.SqlitePreparedStatementLike.run”書き込みを実行し、ドライバーのメタデータを返します。
run(...params: SqliteValue[]): SqliteRunResult;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
params |
SqliteValue[] |
任意 | - プレースホルダー順の位置指定スカラー値です。互換性は選択されたドライバーが担います。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
SqliteRunResult - Description: 書き込みメタデータです。changes と lastInsertRowid は存在しない場合があります。
FUNCTION data.SqliteDatabaseLike.prepare
Section titled “FUNCTION data.SqliteDatabaseLike.prepare”ホストのデータベースを通じて実行するために SQL を準備します。
prepare(sql: string): SqlitePreparedStatementLike;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
sql |
string |
必須 | - 位置指定のバインドプレースホルダーを含む SQL テキストです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
SqlitePreparedStatementLike - Description: 同期的なステートメントです。エラーはドライバーラッパーを通じて伝播します。
CONST data.SqliteDataAccessAdapterConfig.driver
Section titled “CONST data.SqliteDataAccessAdapterConfig.driver”SQL を実行し、接続/認可のライフサイクルを管理する、ホストが作成したドライバーです。
export const data.SqliteDataAccessAdapterConfig.driver: SqliteDriverCONST data.SqliteDataAccessAdapterConfig.idColumn
Section titled “CONST data.SqliteDataAccessAdapterConfig.idColumn”主識別子の列です。null または undefined の場合は id を使用します。制限された SQL 識別子構文に適合する必要があります。
export const data.SqliteDataAccessAdapterConfig.idColumn: string | undefinedCONST data.SqliteDataAccessAdapterConfig.readOnly
Section titled “CONST data.SqliteDataAccessAdapterConfig.readOnly”true の場合、書き込みに到達するミューテーション操作は拒否されます。デフォルトは false です。このアダプターフラグは、データベースの権限を変更しません。
export const data.SqliteDataAccessAdapterConfig.readOnly: boolean | undefinedCONST data.SqliteDataAccessAdapterConfig.cacheScope
Section titled “CONST data.SqliteDataAccessAdapterConfig.cacheScope”変更せずに公開される、任意の共有キャッシュ名前空間です。認証情報や認可ポリシーではありません。
export const data.SqliteDataAccessAdapterConfig.cacheScope: string | undefinedCONST data.SQLiteDataAccessAdapter.cacheScope
Section titled “CONST data.SQLiteDataAccessAdapter.cacheScope”DataAccessProvider のキャッシュ境界として使用する任意の名前空間です。
export const data.SQLiteDataAccessAdapter.cacheScope: string | undefinedFUNCTION data.SQLiteDataAccessAdapter.find
Section titled “FUNCTION data.SQLiteDataAccessAdapter.find”制限されたフィルター、プロジェクション、sort、limit、skip を使用して行を選択します。
async find<T = unknown>( collection: string, filter?: Filter, options?: QueryOptions, ): Promise<T[]>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - 検証済みのテーブル識別子です。スキーマの作成は行いません。 |
filter |
Filter | undefined |
任意 | - 制限されたフィールドフィルターです。指定がない場合、または空のオブジェクトの場合は、すべての行を選択します。 |
options |
QueryOptions | undefined |
任意 | - 任意のプロジェクション、sort、limit、skip です。signal や populate を含む、その他の QueryOptions は実装されていません。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T[]> - Description: 変更可能な配列にコピーされた一致行です。デフォルトの順序は指定しません。
例外 (Throws)
Section titled “例外 (Throws)”無効な識別子、未対応のフィルター、バインド、ページネーション、ドライバーの失敗、および書き込み処理に到達した際に readOnly によってブロックされる変更試行に対して拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { SQLiteDataAccessAdapter } from '@alneas/appkit-core/data/sqlite';export async function findTasks(adapter: SQLiteDataAccessAdapter) { return adapter.find('tasks', { status: 'open' }, { limit: 20 });}---
### `FUNCTION` `data.SQLiteDataAccessAdapter.findOne`
設定された識別子列を使用して読み取ります。limit は強制的に 1 に設定します。
```typescriptasync findOne<T = unknown>( collection: string, id: string, options?: QueryOptions, ): Promise<T | null>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - 検証済みのテーブル識別子です。スキーマの作成は行いません。 |
id |
string |
必須 | - 設定された idColumn に対してバインドする識別子です。 |
options |
QueryOptions | undefined |
任意 | - 任意のプロジェクション、sort、limit、skip です。signal や populate を含む、その他の QueryOptions は実装されていません。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T | null> - Description: 最初の行または null です。projection と skip は引き続き適用されます。
例外 (Throws)
Section titled “例外 (Throws)”無効な識別子、未対応のフィルター、バインド、ページネーション、ドライバーの失敗、および書き込み処理に到達した際に readOnly によってブロックされる変更試行に対して拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { SQLiteDataAccessAdapter } from '@alneas/appkit-core/data/sqlite';export async function findOneTasks(adapter: SQLiteDataAccessAdapter) { return adapter.findOne('tasks', 'task-1');}---
### `FUNCTION` `data.SQLiteDataAccessAdapter.create`
スカラーフィールドを挿入した後、作成された行の読み取りを試みます。
```typescriptasync create<T = unknown>(collection: string, data: Record<string, unknown>): Promise<T>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - 検証済みのテーブル識別子です。スキーマの作成は行いません。 |
data |
Record<string, unknown> |
必須 | - スカラーのフィールド値です。オブジェクト、配列、undefined の値は拒否します。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T> - Description: 明示的な id または lastInsertRowid によって読み取った行です。それ以外は、入力の浅いコピーです。書き込みが成功した後でも、明示的な id による検索が失敗する場合があります。
例外 (Throws)
Section titled “例外 (Throws)”無効な識別子、未対応のフィルター、バインド、ページネーション、ドライバーの失敗、および書き込み処理に到達した際に readOnly によってブロックされる変更試行に対して拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { SQLiteDataAccessAdapter } from '@alneas/appkit-core/data/sqlite';export async function createTasks(adapter: SQLiteDataAccessAdapter) { return adapter.create('tasks', { id: 'task-1', title: 'Draft' });}---
### `FUNCTION` `data.SQLiteDataAccessAdapter.update`
指定されたフィールドを部分更新した後、元の識別子で行を読み取ります。
```typescriptasync update<T = unknown>( collection: string, id: string, data: Record<string, unknown>, ): Promise<T>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - 検証済みのテーブル識別子です。スキーマの作成は行いません。 |
id |
string |
必須 | - 設定された idColumn に対してバインドする識別子です。 |
data |
Record<string, unknown> |
必須 | - スカラーのフィールド値です。オブジェクト、配列、undefined の値は拒否します。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T> - Description: 再読み取りした行、または id と入力フィールドを含むフォールバックオブジェクトです。データが空の場合は読み取りのみを行います。行が存在しなくても、専用の未検出エラーは発生しません。
例外 (Throws)
Section titled “例外 (Throws)”無効な識別子、未対応のフィルター、バインド、ページネーション、ドライバーの失敗、および書き込み処理に到達した際に readOnly によってブロックされる変更試行に対して拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { SQLiteDataAccessAdapter } from '@alneas/appkit-core/data/sqlite';export async function updateTasks(adapter: SQLiteDataAccessAdapter) { return adapter.update('tasks', 'task-1', { title: 'Reviewed' });}---
### `FUNCTION` `data.SQLiteDataAccessAdapter.replace`
部分更新に委譲します。省略された列は保存されたままになります。
```typescriptasync replace<T = unknown>( collection: string, id: string, data: Record<string, unknown>, ): Promise<T>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - 検証済みのテーブル識別子です。スキーマの作成は行いません。 |
id |
string |
必須 | - 設定された idColumn に対してバインドする識別子です。 |
data |
Record<string, unknown> |
必須 | - スカラーのフィールド値です。オブジェクト、配列、undefined の値は拒否します。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T> - Description: update の読み取り結果またはフォールバック結果とまったく同じです。レコード全体の置換は実装しません。
例外 (Throws)
Section titled “例外 (Throws)”無効な識別子、未対応のフィルター、バインド、ページネーション、ドライバーの失敗、および書き込み処理に到達した際に readOnly によってブロックされる変更試行に対して拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { SQLiteDataAccessAdapter } from '@alneas/appkit-core/data/sqlite';export async function replaceTasks(adapter: SQLiteDataAccessAdapter) { return adapter.replace('tasks', 'task-1', { title: 'Reviewed' });}---
### `FUNCTION` `data.SQLiteDataAccessAdapter.delete`
1 行を読み取った後、設定された識別子に一致する行を削除します。
```typescriptasync delete<T = unknown>(collection: string, id: string): Promise<T>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - 検証済みのテーブル識別子です。スキーマの作成は行いません。 |
id |
string |
必須 | - 設定された idColumn に対してバインドする識別子です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T> - Description: 事前に読み取った行です。存在しない場合は id のみのオブジェクトです。読み取りと削除はアトミックではありません。
例外 (Throws)
Section titled “例外 (Throws)”無効な識別子、未対応のフィルター、バインド、ページネーション、ドライバーの失敗、および書き込み処理に到達した際に readOnly によってブロックされる変更試行に対して拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { SQLiteDataAccessAdapter } from '@alneas/appkit-core/data/sqlite';export async function deleteTasks(adapter: SQLiteDataAccessAdapter) { return adapter.delete('tasks', 'task-1');}---
### `FUNCTION` `data.SQLiteDataAccessAdapter.count`
制限されたフィルターに一致する行を数えます。
```typescriptasync count(collection: string, filter?: Filter): Promise<number>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - 検証済みのテーブル識別子です。スキーマの作成は行いません。 |
filter |
Filter | undefined |
任意 | - 制限されたフィールドフィルターです。指定がない場合、または空のオブジェクトの場合は、すべての行を選択します。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<number> - Description: Number(row.count) です。行や count が存在しない場合のデフォルトはゼロです。それ以外の結果の範囲検証は行いません。
例外 (Throws)
Section titled “例外 (Throws)”無効な識別子、未対応のフィルター、バインド、ページネーション、ドライバーの失敗、および書き込み処理に到達した際に readOnly によってブロックされる変更試行に対して拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { SQLiteDataAccessAdapter } from '@alneas/appkit-core/data/sqlite';export async function countTasks(adapter: SQLiteDataAccessAdapter) { return adapter.count('tasks', { status: 'open' });}---
### `FUNCTION` `data.SQLiteDataAccessAdapter.createMany`
各行について create を呼び出し、入力を順次挿入します。
```typescriptasync createMany<T = unknown>(collection: string, data: Record<string, unknown>[]): Promise<T[]>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - 検証済みのテーブル識別子です。スキーマの作成は行いません。 |
data |
Record<string, unknown>[] |
必須 | - スカラー値からなる行です。順次挿入します。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T[]> - Description: 入力順の結果です。入力が空の場合は、readOnly モードでも空の配列に解決します。失敗しても、ドライバーが外部のトランザクション制御を提供していない限り、それ以前に成功した書き込みはコミットされたままです。
例外 (Throws)
Section titled “例外 (Throws)”無効な識別子、未対応のフィルター、バインド、ページネーション、ドライバーの失敗、および書き込み処理に到達した際に readOnly によってブロックされる変更試行に対して拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { SQLiteDataAccessAdapter } from '@alneas/appkit-core/data/sqlite';export async function createManyTasks(adapter: SQLiteDataAccessAdapter) { return adapter.createMany('tasks', [{ id: 'task-1', title: 'Draft' }]);}---
### `FUNCTION` `data.SQLiteDataAccessAdapter.updateMany`
一致する識別子を選択した後、各識別子について update を並行して呼び出します。
```typescriptasync updateMany<T = unknown>( collection: string, filter: Filter, data: Record<string, unknown>, ): Promise<T[]>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - 検証済みのテーブル識別子です。スキーマの作成は行いません。 |
filter |
Filter |
必須 | - 制限されたフィールドフィルターです。指定がない場合、または空のオブジェクトの場合は、すべての行を選択します。 |
data |
Record<string, unknown> |
必須 | - スカラーのフィールド値です。オブジェクト、配列、undefined の値は拒否します。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T[]> - Description: 選択順の結果です。個別の読み取りの後に書き込みを行い、共通のトランザクションはありません。一致する行がない場合は、readOnly モードも含めて空の配列になります。
例外 (Throws)
Section titled “例外 (Throws)”無効な識別子、未対応のフィルター、バインド、ページネーション、ドライバーの失敗、および書き込み処理に到達した際に readOnly によってブロックされる変更試行に対して拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { SQLiteDataAccessAdapter } from '@alneas/appkit-core/data/sqlite';export async function updateManyTasks(adapter: SQLiteDataAccessAdapter) { return adapter.updateMany('tasks', { status: 'open' }, { status: 'closed' });}---
### `FUNCTION` `data.SQLiteDataAccessAdapter.deleteMany`
一致する行を読み取った後、フィルター付きの DELETE を 1 回実行します。
```typescriptasync deleteMany<T = unknown>(collection: string, filter: Filter): Promise<T[]>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
collection |
string |
必須 | - 検証済みのテーブル識別子です。スキーマの作成は行いません。 |
filter |
Filter |
必須 | - 制限されたフィールドフィルターです。指定がない場合、または空のオブジェクトの場合は、すべての行を選択します。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T[]> - Description: 削除前に取得した行です。同時実行による変更で、実際に削除された行と異なる場合があります。空のフィルターはすべての行を削除します。
例外 (Throws)
Section titled “例外 (Throws)”無効な識別子、未対応のフィルター、バインド、ページネーション、ドライバーの失敗、および書き込み処理に到達した際に readOnly によってブロックされる変更試行に対して拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```tsimport { SQLiteDataAccessAdapter } from '@alneas/appkit-core/data/sqlite';export async function deleteManyTasks(adapter: SQLiteDataAccessAdapter) { return adapter.deleteMany('tasks', { status: 'archived' });}---
### `FUNCTION` `data.D1PreparedStatementLike.bind`
実行前に位置指定の値をバインドします。
```typescriptbind(...values: import('./sqlite').SqliteValue[]): D1PreparedStatementLike;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
values |
import("./sqlite").SqliteValue[] |
任意 | - プレースホルダー順の SQLite スカラー値です。実際の互換性はバインディングに従います。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
D1PreparedStatementLike - Description: 実行に使用する、バインド済みステートメントです。
FUNCTION data.D1PreparedStatementLike.all
Section titled “FUNCTION data.D1PreparedStatementLike.all”すべての行を取得するクエリを実行します。
all<T = Record<string, unknown>>(): Promise<{ /** * Rows returned by the D1 binding, forwarded without row conversion. */ results: T[] }>;戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<{ results: T[]; }> - Description: results を含むオブジェクトを返す Promise です。ドライバーブリッジは results を直接取り出します。
FUNCTION data.D1PreparedStatementLike.first
Section titled “FUNCTION data.D1PreparedStatementLike.first”最初の行を取得するクエリを実行します。
first<T = Record<string, unknown>>(): Promise<T | null>;戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<T | null> - Description: 最初の行、または null です。
FUNCTION data.D1PreparedStatementLike.run
Section titled “FUNCTION data.D1PreparedStatementLike.run”ホストのバインディングを通じて書き込みを実行します。
run(): Promise<{ /** * Optional D1 status flag; the bridge does not independently inspect it. */ success?: boolean; /** * Optional write metadata forwarded to SQLite result fields. */ meta?: { /** * Affected-row count, exposed as changes when provided. */ changes?: number; /** * Inserted row identifier, exposed as lastInsertRowid when provided. */ last_row_id?: number | string } }>;戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<{ success?: boolean; meta?: { changes?: number; last_row_id?: number | string; }; }> - Description: 省略可能なステータスとメタデータです。アダプターブリッジは meta のみを読み取り、success は確認しません。
FUNCTION data.D1DatabaseLike.prepare
Section titled “FUNCTION data.D1DatabaseLike.prepare”バインディング上で 1 つの SQL 文を準備します。
prepare(sql: string): D1PreparedStatementLike;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
sql |
string |
必須 | - SQLite アダプターが生成した SQL テキストです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
D1PreparedStatementLike - Description: ブリッジがバインドメソッドと実行メソッドを使用するステートメントです。
CONST data.D1DataAccessAdapterConfig.db
Section titled “CONST data.D1DataAccessAdapterConfig.db”Cloudflare Workers から注入される D1 バインディングです。
export const data.D1DataAccessAdapterConfig.db: D1DatabaseLikeCONST data.WorkflowTransition.from
Section titled “CONST data.WorkflowTransition.from”エクスポートされるシンボル data.WorkflowTransition.from
export const data.WorkflowTransition.from: stringCONST data.WorkflowTransition.to
Section titled “CONST data.WorkflowTransition.to”エクスポートされるシンボル data.WorkflowTransition.to
export const data.WorkflowTransition.to: stringCONST data.WorkflowTransition.requiresApproval
Section titled “CONST data.WorkflowTransition.requiresApproval”エクスポートされるシンボル data.WorkflowTransition.requiresApproval
export const data.WorkflowTransition.requiresApproval: boolean | undefinedCONST data.WorkflowTransition.requiredFields
Section titled “CONST data.WorkflowTransition.requiredFields”エクスポートされるシンボル data.WorkflowTransition.requiredFields
export const data.WorkflowTransition.requiredFields: string[] | undefinedCONST data.WorkflowAction.action
Section titled “CONST data.WorkflowAction.action”エクスポートされるシンボル data.WorkflowAction.action
export const data.WorkflowAction.action: stringCONST data.WorkflowAction.enabledStatuses
Section titled “CONST data.WorkflowAction.enabledStatuses”エクスポートされるシンボル data.WorkflowAction.enabledStatuses
export const data.WorkflowAction.enabledStatuses: string[]CONST data.WorkflowAction.required
Section titled “CONST data.WorkflowAction.required”エクスポートされるシンボル data.WorkflowAction.required
export const data.WorkflowAction.required: boolean | undefinedCONST data.WorkflowDefinition.id
Section titled “CONST data.WorkflowDefinition.id”エクスポートされるシンボル data.WorkflowDefinition.id
export const data.WorkflowDefinition.id: stringCONST data.WorkflowDefinition.label
Section titled “CONST data.WorkflowDefinition.label”エクスポートされるシンボル data.WorkflowDefinition.label
export const data.WorkflowDefinition.label: stringCONST data.WorkflowDefinition.statusOrder
Section titled “CONST data.WorkflowDefinition.statusOrder”エクスポートされるシンボル data.WorkflowDefinition.statusOrder
export const data.WorkflowDefinition.statusOrder: string[]CONST data.WorkflowDefinition.transitions
Section titled “CONST data.WorkflowDefinition.transitions”エクスポートされるシンボル data.WorkflowDefinition.transitions
export const data.WorkflowDefinition.transitions: TTransition[]CONST data.WorkflowDefinition.actions
Section titled “CONST data.WorkflowDefinition.actions”エクスポートされるシンボル data.WorkflowDefinition.actions
export const data.WorkflowDefinition.actions: TAction[] | undefinedCONST data.WorkflowDefinition.statusInfo
Section titled “CONST data.WorkflowDefinition.statusInfo”エクスポートされるシンボル data.WorkflowDefinition.statusInfo
export const data.WorkflowDefinition.statusInfo: Record<string, TInfo>CONST data.WorkflowDefinition.defaultStatusInfo
Section titled “CONST data.WorkflowDefinition.defaultStatusInfo”エクスポートされるシンボル data.WorkflowDefinition.defaultStatusInfo
export const data.WorkflowDefinition.defaultStatusInfo: TInfoFUNCTION data.WorkflowEngine.getStatusOrder
Section titled “FUNCTION data.WorkflowEngine.getStatusOrder”関数 data.WorkflowEngine.getStatusOrder
getStatusOrder(): string[]戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string[]
FUNCTION data.WorkflowEngine.getTransitions
Section titled “FUNCTION data.WorkflowEngine.getTransitions”関数 data.WorkflowEngine.getTransitions
getTransitions(status: string): TTransition[]引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
status |
string |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
TTransition[]
FUNCTION data.WorkflowEngine.getActions
Section titled “FUNCTION data.WorkflowEngine.getActions”関数 data.WorkflowEngine.getActions
getActions(status: string): TAction[]引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
status |
string |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
TAction[]
FUNCTION data.WorkflowEngine.getStatusInfo
Section titled “FUNCTION data.WorkflowEngine.getStatusInfo”関数 data.WorkflowEngine.getStatusInfo
getStatusInfo(status: string): TInfo引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
status |
string |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
TInfo
FUNCTION data.WorkflowEngine.getProgress
Section titled “FUNCTION data.WorkflowEngine.getProgress”位置に基づく進捗です。最初の既知のステータスは 1/N、不明なステータスは 0 です。
getProgress(status: string): number引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
status |
string |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
number
FUNCTION data.WorkflowEngine.getLabel
Section titled “FUNCTION data.WorkflowEngine.getLabel”関数 data.WorkflowEngine.getLabel
getLabel(): string戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string
CONST data.TransitionValidationResult.allowed
Section titled “CONST data.TransitionValidationResult.allowed”エクスポートされるシンボル data.TransitionValidationResult.allowed
export const data.TransitionValidationResult.allowed: booleanCONST data.TransitionValidationResult.reason
Section titled “CONST data.TransitionValidationResult.reason”エクスポートされるシンボル data.TransitionValidationResult.reason
export const data.TransitionValidationResult.reason: string | undefinedFUNCTION data.WorkflowPolicy.validateTransition
Section titled “FUNCTION data.WorkflowPolicy.validateTransition”関数 data.WorkflowPolicy.validateTransition
validateTransition(context: TContext): TransitionValidationResult;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
context |
TContext |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
TransitionValidationResult
FUNCTION data.WorkflowPolicy.requiresApproval
Section titled “FUNCTION data.WorkflowPolicy.requiresApproval”関数 data.WorkflowPolicy.requiresApproval
requiresApproval(context: TContext): boolean;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
context |
TContext |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
boolean
FUNCTION data.WorkflowPolicy.getRequiredFields
Section titled “FUNCTION data.WorkflowPolicy.getRequiredFields”関数 data.WorkflowPolicy.getRequiredFields
getRequiredFields(context: TContext): string[];引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
context |
TContext |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string[]
FUNCTION data.WorkflowPolicyEngine.validateTransition
Section titled “FUNCTION data.WorkflowPolicyEngine.validateTransition”関数 data.WorkflowPolicyEngine.validateTransition
validateTransition(context: TContext): TransitionValidationResult引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
context |
TContext |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
TransitionValidationResult
FUNCTION data.WorkflowPolicyEngine.requiresApproval
Section titled “FUNCTION data.WorkflowPolicyEngine.requiresApproval”関数 data.WorkflowPolicyEngine.requiresApproval
requiresApproval(context: TContext): boolean引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
context |
TContext |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
boolean
FUNCTION data.WorkflowPolicyEngine.getRequiredFields
Section titled “FUNCTION data.WorkflowPolicyEngine.getRequiredFields”関数 data.WorkflowPolicyEngine.getRequiredFields
getRequiredFields(context: TContext): string[]引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
context |
TContext |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
string[]
CONST data.FileNode.id
Section titled “CONST data.FileNode.id”エクスポートされるシンボル data.FileNode.id
export const data.FileNode.id: stringCONST data.FileNode.physicalKey
Section titled “CONST data.FileNode.physicalKey”エクスポートされるシンボル data.FileNode.physicalKey
export const data.FileNode.physicalKey: string | undefinedCONST data.FileNode.name
Section titled “CONST data.FileNode.name”エクスポートされるシンボル data.FileNode.name
export const data.FileNode.name: stringCONST data.FileNode.kind
Section titled “CONST data.FileNode.kind”エクスポートされるシンボル data.FileNode.kind
export const data.FileNode.kind: "file" | "folder"CONST data.FileNode.size
Section titled “CONST data.FileNode.size”エクスポートされるシンボル data.FileNode.size
export const data.FileNode.size: number | undefinedCONST data.FileNode.contentType
Section titled “CONST data.FileNode.contentType”エクスポートされるシンボル data.FileNode.contentType
export const data.FileNode.contentType: string | undefinedCONST data.FileNode.lastModified
Section titled “CONST data.FileNode.lastModified”エクスポートされるシンボル data.FileNode.lastModified
export const data.FileNode.lastModified: Date | undefinedCONST data.FileNode.original
Section titled “CONST data.FileNode.original”エクスポートされるシンボル data.FileNode.original
export const data.FileNode.original: StorageObject | undefinedCONST data.FileNode.metadata
Section titled “CONST data.FileNode.metadata”エクスポートされるシンボル data.FileNode.metadata
export const data.FileNode.metadata: Record<string, string> | undefinedCONST data.FileNode.isVirtual
Section titled “CONST data.FileNode.isVirtual”エクスポートされるシンボル data.FileNode.isVirtual
export const data.FileNode.isVirtual: boolean | undefinedFUNCTION data.FileProvider.listNodes
Section titled “FUNCTION data.FileProvider.listNodes”関数 data.FileProvider.listNodes
listNodes(path: string): Promise<{ nodes: FileNode[]; hasMore: boolean }>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
path |
string |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<{ nodes: FileNode[]; hasMore: boolean; }>
FUNCTION data.FileProvider.searchNodes
Section titled “FUNCTION data.FileProvider.searchNodes”関数 data.FileProvider.searchNodes
searchNodes(criteria: FileSearchCriteria): Promise<FileNode[]>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
criteria |
FileSearchCriteria |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<FileNode[]>
FUNCTION data.FileProvider.uploadFile
Section titled “FUNCTION data.FileProvider.uploadFile”関数 data.FileProvider.uploadFile
uploadFile(path: string, file: File | Blob, name: string): Promise<FileNode>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
path |
string |
必須 | |
file |
Blob | File |
必須 | |
name |
string |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<FileNode>
FUNCTION data.FileProvider.createFolder
Section titled “FUNCTION data.FileProvider.createFolder”関数 data.FileProvider.createFolder
createFolder(path: string, name: string): Promise<FileNode>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
path |
string |
必須 | |
name |
string |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<FileNode>
FUNCTION data.FileProvider.getUrl
Section titled “FUNCTION data.FileProvider.getUrl”関数 data.FileProvider.getUrl
getUrl(node: FileNode, options?: StorageURLOptions): Promise<string>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
node |
FileNode |
必須 | |
options |
StorageURLOptions | undefined |
任意 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<string>
FUNCTION data.FileProvider.deleteNodes
Section titled “FUNCTION data.FileProvider.deleteNodes”関数 data.FileProvider.deleteNodes
deleteNodes(ids: string[]): Promise<void>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
ids |
string[] |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<void>
FUNCTION data.FileProvider.renameNode
Section titled “FUNCTION data.FileProvider.renameNode”関数 data.FileProvider.renameNode
renameNode(id: string, newName: string): Promise<FileNode>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
id |
string |
必須 | |
newName |
string |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<FileNode>
FUNCTION data.FileProvider.moveNode
Section titled “FUNCTION data.FileProvider.moveNode”関数 data.FileProvider.moveNode
moveNode(id: string, newPath: string): Promise<FileNode>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
id |
string |
必須 | |
newPath |
string |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<FileNode>
FUNCTION data.FileProvider.updateMetadata
Section titled “FUNCTION data.FileProvider.updateMetadata”関数 data.FileProvider.updateMetadata
updateMetadata(id: string, metadata: Record<string, string>): Promise<FileNode>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
id |
string |
必須 | |
metadata |
Record<string, string> |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<FileNode>
FUNCTION data.FileProvider.verifyIntegrity
Section titled “FUNCTION data.FileProvider.verifyIntegrity”関数 data.FileProvider.verifyIntegrity
verifyIntegrity?(id: string): Promise<{ valid: boolean; error?: string }>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
id |
string |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<{ valid: boolean; error?: string; }>
CONST data.FileSearchCriteria.query
Section titled “CONST data.FileSearchCriteria.query”エクスポートされるシンボル data.FileSearchCriteria.query
export const data.FileSearchCriteria.query: string | undefinedCONST data.FileSearchCriteria.tags
Section titled “CONST data.FileSearchCriteria.tags”エクスポートされるシンボル data.FileSearchCriteria.tags
export const data.FileSearchCriteria.tags: string[] | undefinedCONST data.FileRecord.id
Section titled “CONST data.FileRecord.id”エクスポートされるシンボル data.FileRecord.id
export const data.FileRecord.id: stringCONST data.FileRecord.folder
Section titled “CONST data.FileRecord.folder”エクスポートされるシンボル data.FileRecord.folder
export const data.FileRecord.folder: stringCONST data.FileRecord.filename
Section titled “CONST data.FileRecord.filename”エクスポートされるシンボル data.FileRecord.filename
export const data.FileRecord.filename: stringCONST data.FileRecord.physical_key
Section titled “CONST data.FileRecord.physical_key”エクスポートされるシンボル data.FileRecord.physical_key
export const data.FileRecord.physical_key: stringCONST data.FileRecord.size
Section titled “CONST data.FileRecord.size”エクスポートされるシンボル data.FileRecord.size
export const data.FileRecord.size: numberCONST data.FileRecord.content_type
Section titled “CONST data.FileRecord.content_type”エクスポートされるシンボル data.FileRecord.content_type
export const data.FileRecord.content_type: stringCONST data.FileRecord.tags
Section titled “CONST data.FileRecord.tags”カンマ区切りのタグです。引用符による囲みや、カンマのエスケープには対応しません。
export const data.FileRecord.tags: string | undefinedCONST data.FileRecord.updated_at
Section titled “CONST data.FileRecord.updated_at”エクスポートされるシンボル data.FileRecord.updated_at
export const data.FileRecord.updated_at: stringCONST data.FileRecord.kind
Section titled “CONST data.FileRecord.kind”エクスポートされるシンボル data.FileRecord.kind
export const data.FileRecord.kind: "file" | "folder"CONST data.UploadCompensationContext.cause
Section titled “CONST data.UploadCompensationContext.cause”エクスポートされるシンボル data.UploadCompensationContext.cause
export const data.UploadCompensationContext.cause: unknownCONST data.UploadCompensationContext.record
Section titled “CONST data.UploadCompensationContext.record”エクスポートされるシンボル data.UploadCompensationContext.record
export const data.UploadCompensationContext.record: Readonly<FileRecordInput>CONST data.UploadCompensationContext.object
Section titled “CONST data.UploadCompensationContext.object”エクスポートされるシンボル data.UploadCompensationContext.object
export const data.UploadCompensationContext.object: Readonly<StorageObject>CONST data.DataAccessFileProviderOptions.dataAccess
Section titled “CONST data.DataAccessFileProviderOptions.dataAccess”エクスポートされるシンボル data.DataAccessFileProviderOptions.dataAccess
export const data.DataAccessFileProviderOptions.dataAccess: DataAccessAdapterCONST data.DataAccessFileProviderOptions.storage
Section titled “CONST data.DataAccessFileProviderOptions.storage”エクスポートされるシンボル data.DataAccessFileProviderOptions.storage
export const data.DataAccessFileProviderOptions.storage: StorageAdapterCONST data.DataAccessFileProviderOptions.collection
Section titled “CONST data.DataAccessFileProviderOptions.collection”エクスポートされるシンボル data.DataAccessFileProviderOptions.collection
export const data.DataAccessFileProviderOptions.collection: string | undefinedCONST data.DataAccessFileProviderOptions.physicalPrefix
Section titled “CONST data.DataAccessFileProviderOptions.physicalPrefix”エクスポートされるシンボル data.DataAccessFileProviderOptions.physicalPrefix
export const data.DataAccessFileProviderOptions.physicalPrefix: string | undefinedCONST data.DataAccessFileProviderOptions.deleteMode
Section titled “CONST data.DataAccessFileProviderOptions.deleteMode”デフォルトは metadata-only です。storage-and-metadata は、可視のオブジェクトキーを先に削除し、その後にレコードを削除します。
export const data.DataAccessFileProviderOptions.deleteMode: "metadata-only" | "storage-and-metadata" | undefinedCONST data.DataAccessFileProviderOptions.searchMode
Section titled “CONST data.DataAccessFileProviderOptions.searchMode”デフォルトは portable です。ファイル名はリテラル文字列として大文字・小文字を区別せずに部分一致で検索し、タグは大文字・小文字を区別する完全一致の AND 条件で照合します。
export const data.DataAccessFileProviderOptions.searchMode: "portable" | "legacy-adapter" | undefinedCONST data.DataAccessFileProviderOptions.maxSearchRecords
Section titled “CONST data.DataAccessFileProviderOptions.maxSearchRecords”デフォルトは 10,000 です。アダプターがレコードを返した後のローカル検索処理を制限するもので、ネットワーク経由の取得は制限しません。
export const data.DataAccessFileProviderOptions.maxSearchRecords: number | undefinedCONST data.DataAccessFileProviderOptions.searchRecords
Section titled “CONST data.DataAccessFileProviderOptions.searchRecords”インデックス検索/バックエンド検索向けの、認可された候補を網羅的に検索する任意の機能です。portable の判定条件も引き続き適用されます。
export const data.DataAccessFileProviderOptions.searchRecords: ((criteria: Readonly<FileSearchCriteria>) => Promise<FileRecord[]>) | undefinedCONST data.DataAccessFileProviderOptions.uploadFailurePolicy
Section titled “CONST data.DataAccessFileProviderOptions.uploadFailurePolicy”デフォルトは retain です。拒否された create が実際にはコミット済みである可能性があるため、補償処理は明示的に有効化する方式です。
export const data.DataAccessFileProviderOptions.uploadFailurePolicy: "retain" | "compensate" | undefinedCONST data.DataAccessFileProviderOptions.canCompensateUpload
Section titled “CONST data.DataAccessFileProviderOptions.canCompensateUpload”compensate では必須です。確実にコミットされていないことと、アップロードされたキーを排他的に所有していることの両方を確認します。再読み取りで見つからないことだけでは不十分です。
export const data.DataAccessFileProviderOptions.canCompensateUpload: ((context: UploadCompensationContext) => boolean | Promise<boolean>) | undefinedCONST data.DataAccessFileProviderOptions.createId
Section titled “CONST data.DataAccessFileProviderOptions.createId”アプリケーションの名前空間内に、新しい一意の ID を生成します。デフォルトは Web Crypto の randomUUID です。
export const data.DataAccessFileProviderOptions.createId: (() => string) | undefinedCONST data.FileProviderOperationError.nodeId
Section titled “CONST data.FileProviderOperationError.nodeId”エクスポートされるシンボル data.FileProviderOperationError.nodeId
export const data.FileProviderOperationError.nodeId: stringCONST data.FileProviderOperationError.physicalKey
Section titled “CONST data.FileProviderOperationError.physicalKey”エクスポートされるシンボル data.FileProviderOperationError.physicalKey
export const data.FileProviderOperationError.physicalKey: string | undefinedCONST data.FileProviderOperationError.completedIds
Section titled “CONST data.FileProviderOperationError.completedIds”エクスポートされるシンボル data.FileProviderOperationError.completedIds
export const data.FileProviderOperationError.completedIds: readonly string[]CONST data.FileProviderOperationError.compensation
Section titled “CONST data.FileProviderOperationError.compensation”エクスポートされるシンボル data.FileProviderOperationError.compensation
export const data.FileProviderOperationError.compensation: FileCompensationStatusCONST data.FileProviderOperationError.compensationError
Section titled “CONST data.FileProviderOperationError.compensationError”エクスポートされるシンボル data.FileProviderOperationError.compensationError
export const data.FileProviderOperationError.compensationError: unknownCONST data.FileProviderOperationError.storageDeleted
Section titled “CONST data.FileProviderOperationError.storageDeleted”エクスポートされるシンボル data.FileProviderOperationError.storageDeleted
export const data.FileProviderOperationError.storageDeleted: booleanFUNCTION data.DataAccessFileProvider.listNodes
Section titled “FUNCTION data.DataAccessFileProvider.listNodes”既存のアダプターの並び順は、kind の昇順、filename の昇順です。暗黙のページネーションカーソルはありません。
async listNodes(path: string): Promise<{ nodes: FileNode[]; hasMore: boolean }>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
path |
string |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<{ nodes: FileNode[]; hasMore: boolean; }>
FUNCTION data.DataAccessFileProvider.searchNodes
Section titled “FUNCTION data.DataAccessFileProvider.searchNodes”すべての論理フォルダーを検索します。アダプター/候補コールバックは、認可された候補の集合全体を返す必要があります。
async searchNodes(criteria: FileSearchCriteria): Promise<FileNode[]>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
criteria |
FileSearchCriteria |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<FileNode[]>
FUNCTION data.DataAccessFileProvider.uploadFile
Section titled “FUNCTION data.DataAccessFileProvider.uploadFile”UUID キーの下に保存してから、対応する論理レコードを作成します。create が拒否された場合は、エラーの詳細を通じて結果の整合性を確認します。
async uploadFile(path: string, file: File | Blob, name: string): Promise<FileNode>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
path |
string |
必須 | |
file |
Blob | File |
必須 | |
name |
string |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<FileNode>
FUNCTION data.DataAccessFileProvider.createFolder
Section titled “FUNCTION data.DataAccessFileProvider.createFolder”フォルダーのメタデータのみを対象とし、省略された既存の size/content_type 列を保持します。
async createFolder(path: string, name: string): Promise<FileNode>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
path |
string |
必須 | |
name |
string |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<FileNode>
FUNCTION data.DataAccessFileProvider.getUrl
Section titled “FUNCTION data.DataAccessFileProvider.getUrl”関数 data.DataAccessFileProvider.getUrl
async getUrl(node: FileNode, options?: StorageURLOptions): Promise<string>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
node |
FileNode |
必須 | |
options |
StorageURLOptions | undefined |
任意 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<string>
FUNCTION data.DataAccessFileProvider.deleteNodes
Section titled “FUNCTION data.DataAccessFileProvider.deleteNodes”順次実行し、最初の失敗で停止します。物理モードは、存在しないレコード/可視キーに対して冪等ですが、アトミックではありません。
async deleteNodes(ids: string[]): Promise<void>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
ids |
string[] |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<void>
FUNCTION data.DataAccessFileProvider.renameNode
Section titled “FUNCTION data.DataAccessFileProvider.renameNode”関数 data.DataAccessFileProvider.renameNode
async renameNode(id: string, newName: string): Promise<FileNode>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
id |
string |
必須 | |
newName |
string |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<FileNode>
FUNCTION data.DataAccessFileProvider.moveNode
Section titled “FUNCTION data.DataAccessFileProvider.moveNode”関数 data.DataAccessFileProvider.moveNode
async moveNode(id: string, newPath: string): Promise<FileNode>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
id |
string |
必須 | |
newPath |
string |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<FileNode>
FUNCTION data.DataAccessFileProvider.updateMetadata
Section titled “FUNCTION data.DataAccessFileProvider.updateMetadata”永続化されるのはタグのみです。このインターフェースは、任意の DB メタデータ列への対応を保証しません。
async updateMetadata(id: string, metadata: Record<string, string>): Promise<FileNode>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
id |
string |
必須 | |
metadata |
Record<string, string> |
必須 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<FileNode>
CONST japan.legalDocument.PartyInfo.role
Section titled “CONST japan.legalDocument.PartyInfo.role”署名欄に印字する当事者の役割ラベルです。
export const japan.legalDocument.PartyInfo.role: stringCONST japan.legalDocument.PartyInfo.type
Section titled “CONST japan.legalDocument.PartyInfo.type”当事者またはコンテンツブロックのバリアントを選択する判別子です。
export const japan.legalDocument.PartyInfo.type: PartyTypeCONST japan.legalDocument.PartyInfo.name
Section titled “CONST japan.legalDocument.PartyInfo.name”当事者の表示名です。本人確認は行いません。
export const japan.legalDocument.PartyInfo.name: stringCONST japan.legalDocument.PartyInfo.address
Section titled “CONST japan.legalDocument.PartyInfo.address”そのまま印字する当事者の住所テキストです。
export const japan.legalDocument.PartyInfo.address: stringCONST japan.legalDocument.PartyInfo.representative
Section titled “CONST japan.legalDocument.PartyInfo.representative”任意の法人代表者のテキストです。
export const japan.legalDocument.PartyInfo.representative: string | undefinedCONST japan.legalDocument.PartyInfo.seal
Section titled “CONST japan.legalDocument.PartyInfo.seal”署名欄に押印用のプレースホルダーを含めるかどうかです。
export const japan.legalDocument.PartyInfo.seal: booleanCONST japan.legalDocument.PartyInfo.additionalInfo
Section titled “CONST japan.legalDocument.PartyInfo.additionalInfo”ホストが管理する任意の文字列メタデータです。組み込みの pdfmake ビルダーでは描画しません。
export const japan.legalDocument.PartyInfo.additionalInfo: Record<string, string> | undefinedCONST japan.legalDocument.LegalDocumentMetadata.title
Section titled “CONST japan.legalDocument.LegalDocumentMetadata.title”文書または条文の見出しテキストです。
export const japan.legalDocument.LegalDocumentMetadata.title: stringCONST japan.legalDocument.LegalDocumentMetadata.documentType
Section titled “CONST japan.legalDocument.LegalDocumentMetadata.documentType”アプリケーションの文書種別キーです。解析した frontmatter に指定がない場合は contract になります。
export const japan.legalDocument.LegalDocumentMetadata.documentType: stringCONST japan.legalDocument.LegalDocumentMetadata.date
Section titled “CONST japan.legalDocument.LegalDocumentMetadata.date”任意の文書日付テキストです。暦に基づく日付の解析は行いません。
export const japan.legalDocument.LegalDocumentMetadata.date: string | undefinedCONST japan.legalDocument.LegalDocumentMetadata.era
Section titled “CONST japan.legalDocument.LegalDocumentMetadata.era”frontmatter から保持する任意の元号メタデータです。pdfmake ビルダーでは使用しません。
export const japan.legalDocument.LegalDocumentMetadata.era: string | undefinedCONST japan.legalDocument.LegalDocumentMetadata.referenceNumber
Section titled “CONST japan.legalDocument.LegalDocumentMetadata.referenceNumber”タイトルとともに印字する任意の参照テキストです。
export const japan.legalDocument.LegalDocumentMetadata.referenceNumber: string | undefinedCONST japan.legalDocument.LegalDocumentMetadata.parties
Section titled “CONST japan.legalDocument.LegalDocumentMetadata.parties”表示順に並んだ署名当事者です。
export const japan.legalDocument.LegalDocumentMetadata.parties: PartyInfo[]CONST japan.legalDocument.ArticleItem.type
Section titled “CONST japan.legalDocument.ArticleItem.type”当事者またはコンテンツブロックのバリアントを選択する判別子です。
export const japan.legalDocument.ArticleItem.type: "paragraph" | "numbered-item"CONST japan.legalDocument.ArticleItem.number
Section titled “CONST japan.legalDocument.ArticleItem.number”表示テキストとしての条/項番号です。
export const japan.legalDocument.ArticleItem.number: string | undefinedCONST japan.legalDocument.ArticleItem.text
Section titled “CONST japan.legalDocument.ArticleItem.text”このブロックまたは条文項目の表示テキストです。レンダラーが対応している箇所では改行を保持します。
export const japan.legalDocument.ArticleItem.text: stringCONST japan.legalDocument.ParsedDocument.metadata
Section titled “CONST japan.legalDocument.ParsedDocument.metadata”パーサーのデフォルト値を適用した、解析済みの frontmatter の値です。
export const japan.legalDocument.ParsedDocument.metadata: LegalDocumentMetadataCONST japan.legalDocument.ParsedDocument.blocks
Section titled “CONST japan.legalDocument.ParsedDocument.blocks”描画順に並んだタイトル、本文、条文、および任意の日付/署名ブロックです。
export const japan.legalDocument.ParsedDocument.blocks: DocumentBlock[]CONST japan.notifications.JapanesePaymentReminder.partnerName
Section titled “CONST japan.notifications.JapanesePaymentReminder.partnerName”支払先の表示名です。
export const japan.notifications.JapanesePaymentReminder.partnerName: stringCONST japan.notifications.JapanesePaymentReminder.amount
Section titled “CONST japan.notifications.JapanesePaymentReminder.amount”円記号の接頭辞を付けて表示する支払額です。変換や検証は行いません。
export const japan.notifications.JapanesePaymentReminder.amount: numberCONST japan.notifications.JapanesePaymentReminder.dueDate
Section titled “CONST japan.notifications.JapanesePaymentReminder.dueDate”そのまま埋め込む支払期限のテキストです。
export const japan.notifications.JapanesePaymentReminder.dueDate: stringCONST japan.notifications.JapanesePaymentReminder.invoiceId
Section titled “CONST japan.notifications.JapanesePaymentReminder.invoiceId”任意のホスト側の請求書参照です。組み込みのテキストフォーマッターでは使用しません。
export const japan.notifications.JapanesePaymentReminder.invoiceId: string | undefinedCONST japan.notifications.JapaneseInventoryReminder.productName
Section titled “CONST japan.notifications.JapaneseInventoryReminder.productName”商品の表示名です。
export const japan.notifications.JapaneseInventoryReminder.productName: stringCONST japan.notifications.JapaneseInventoryReminder.currentStock
Section titled “CONST japan.notifications.JapaneseInventoryReminder.currentStock”そのまま表示する現在の残り在庫数です。
export const japan.notifications.JapaneseInventoryReminder.currentStock: numberCONST japan.notifications.JapaneseInventoryReminder.threshold
Section titled “CONST japan.notifications.JapaneseInventoryReminder.threshold”そのまま表示する在庫不足のしきい値です。
export const japan.notifications.JapaneseInventoryReminder.threshold: numberCONST japan.notifications.JapaneseInventoryReminder.productId
Section titled “CONST japan.notifications.JapaneseInventoryReminder.productId”任意のホスト側の商品参照です。組み込みのテキストフォーマッターでは使用しません。
export const japan.notifications.JapaneseInventoryReminder.productId: string | undefinedCONST japan.SealLabelOptions.sealLabel
Section titled “CONST japan.SealLabelOptions.sealLabel”印面に使用する明示的なテキストです。 指定した場合は、名前の解析よりも優先されます。
export const japan.SealLabelOptions.sealLabel: string | undefinedCONST japan.SealLabelOptions.familyName
Section titled “CONST japan.SealLabelOptions.familyName”明示的な姓です。
sealLabel が指定されていない場合に使用します。
export const japan.SealLabelOptions.familyName: string | undefinedCONST japan.SealLabelOptions.nameOrder
Section titled “CONST japan.SealLabelOptions.nameOrder”fullName から姓を推定する際の並び順の規則です。
デフォルトは auto です。
export const japan.SealLabelOptions.nameOrder: SealNameOrder | undefinedCONST japan.SealLabelOptions.maxChars
Section titled “CONST japan.SealLabelOptions.maxChars”印面テキストの最大文字数です。
デフォルトは 3 です。
export const japan.SealLabelOptions.maxChars: number | undefinedCONST japan.FallbackSealOptions.size
Section titled “CONST japan.FallbackSealOptions.size”全体の寸法です(正方形)。
width / height が指定されていない場合に適用します。
デフォルトは 256 です。
export const japan.FallbackSealOptions.size: number | undefinedCONST japan.FallbackSealOptions.width
Section titled “CONST japan.FallbackSealOptions.width”SVG の幅です。
export const japan.FallbackSealOptions.width: number | undefinedCONST japan.FallbackSealOptions.height
Section titled “CONST japan.FallbackSealOptions.height”SVG の高さです。
export const japan.FallbackSealOptions.height: number | undefinedCONST japan.FallbackSealOptions.circleColor
Section titled “CONST japan.FallbackSealOptions.circleColor”円の線の色です。
デフォルトは #c62828 です。
export const japan.FallbackSealOptions.circleColor: string | undefinedCONST japan.FallbackSealOptions.textColor
Section titled “CONST japan.FallbackSealOptions.textColor”文字色です。
デフォルトは #c62828 です。
export const japan.FallbackSealOptions.textColor: string | undefinedCONST japan.FallbackSealOptions.strokeWidth
Section titled “CONST japan.FallbackSealOptions.strokeWidth”円の線の幅です。
デフォルトは 8 です。
export const japan.FallbackSealOptions.strokeWidth: number | undefinedCONST japan.FallbackSealOptions.fontFamily
Section titled “CONST japan.FallbackSealOptions.fontFamily”文字のフォントファミリーです。
デフォルトは sans-serif です。
export const japan.FallbackSealOptions.fontFamily: string | undefinedCONST japan.FallbackSealOptions.fontWeight
Section titled “CONST japan.FallbackSealOptions.fontWeight”文字のフォントウェイトです。
デフォルトは 700 です。
export const japan.FallbackSealOptions.fontWeight: string | number | undefinedCONST japan.FallbackSealOptions.backgroundColor
Section titled “CONST japan.FallbackSealOptions.backgroundColor”使用する背景色です。 省略した場合は透明になります。
export const japan.FallbackSealOptions.backgroundColor: string | undefinedCONST japan.FallbackSealOptions.outputFormat
Section titled “CONST japan.FallbackSealOptions.outputFormat”出力画像形式です。
auto:Canvas が利用可能な場合は PNG、それ以外は SVG ですpng:PNG を優先します(Canvas が利用できない場合はnull)svg:SVG に固定します
デフォルトは auto です。
export const japan.FallbackSealOptions.outputFormat: "auto" | "png" | "svg" | undefinedCONST japan.PartyInfo.role
Section titled “CONST japan.PartyInfo.role”署名欄に印字する当事者の役割ラベルです。
export const japan.PartyInfo.role: stringCONST japan.PartyInfo.type
Section titled “CONST japan.PartyInfo.type”当事者またはコンテンツブロックのバリアントを選択する判別子です。
export const japan.PartyInfo.type: PartyTypeCONST japan.PartyInfo.name
Section titled “CONST japan.PartyInfo.name”当事者の表示名です。本人確認は行いません。
export const japan.PartyInfo.name: stringCONST japan.PartyInfo.address
Section titled “CONST japan.PartyInfo.address”そのまま印字する当事者の住所テキストです。
export const japan.PartyInfo.address: stringCONST japan.PartyInfo.representative
Section titled “CONST japan.PartyInfo.representative”任意の法人代表者のテキストです。
export const japan.PartyInfo.representative: string | undefinedCONST japan.PartyInfo.seal
Section titled “CONST japan.PartyInfo.seal”署名欄に押印用のプレースホルダーを含めるかどうかです。
export const japan.PartyInfo.seal: booleanCONST japan.PartyInfo.additionalInfo
Section titled “CONST japan.PartyInfo.additionalInfo”ホストが管理する任意の文字列メタデータです。組み込みの pdfmake ビルダーでは描画しません。
export const japan.PartyInfo.additionalInfo: Record<string, string> | undefinedCONST japan.LegalDocumentMetadata.title
Section titled “CONST japan.LegalDocumentMetadata.title”文書または条文の見出しテキストです。
export const japan.LegalDocumentMetadata.title: stringCONST japan.LegalDocumentMetadata.documentType
Section titled “CONST japan.LegalDocumentMetadata.documentType”アプリケーションの文書種別キーです。解析した frontmatter に指定がない場合は contract になります。
export const japan.LegalDocumentMetadata.documentType: stringCONST japan.LegalDocumentMetadata.date
Section titled “CONST japan.LegalDocumentMetadata.date”任意の文書日付テキストです。暦に基づく日付の解析は行いません。
export const japan.LegalDocumentMetadata.date: string | undefinedCONST japan.LegalDocumentMetadata.era
Section titled “CONST japan.LegalDocumentMetadata.era”frontmatter から保持する任意の元号メタデータです。pdfmake ビルダーでは使用しません。
export const japan.LegalDocumentMetadata.era: string | undefinedCONST japan.LegalDocumentMetadata.referenceNumber
Section titled “CONST japan.LegalDocumentMetadata.referenceNumber”タイトルとともに印字する任意の参照テキストです。
export const japan.LegalDocumentMetadata.referenceNumber: string | undefinedCONST japan.LegalDocumentMetadata.parties
Section titled “CONST japan.LegalDocumentMetadata.parties”表示順に並んだ署名当事者です。
export const japan.LegalDocumentMetadata.parties: PartyInfo[]CONST japan.ArticleItem.type
Section titled “CONST japan.ArticleItem.type”当事者またはコンテンツブロックのバリアントを選択する判別子です。
export const japan.ArticleItem.type: "paragraph" | "numbered-item"CONST japan.ArticleItem.number
Section titled “CONST japan.ArticleItem.number”表示テキストとしての条/項番号です。
export const japan.ArticleItem.number: string | undefinedCONST japan.ArticleItem.text
Section titled “CONST japan.ArticleItem.text”このブロックまたは条文項目の表示テキストです。レンダラーが対応している箇所では改行を保持します。
export const japan.ArticleItem.text: stringCONST japan.ParsedDocument.metadata
Section titled “CONST japan.ParsedDocument.metadata”パーサーのデフォルト値を適用した、解析済みの frontmatter の値です。
export const japan.ParsedDocument.metadata: LegalDocumentMetadataCONST japan.ParsedDocument.blocks
Section titled “CONST japan.ParsedDocument.blocks”描画順に並んだタイトル、本文、条文、および任意の日付/署名ブロックです。
export const japan.ParsedDocument.blocks: DocumentBlock[]CONST japan.JapanesePaymentReminder.partnerName
Section titled “CONST japan.JapanesePaymentReminder.partnerName”支払先の表示名です。
export const japan.JapanesePaymentReminder.partnerName: stringCONST japan.JapanesePaymentReminder.amount
Section titled “CONST japan.JapanesePaymentReminder.amount”円記号の接頭辞を付けて表示する支払額です。変換や検証は行いません。
export const japan.JapanesePaymentReminder.amount: numberCONST japan.JapanesePaymentReminder.dueDate
Section titled “CONST japan.JapanesePaymentReminder.dueDate”そのまま埋め込む支払期限のテキストです。
export const japan.JapanesePaymentReminder.dueDate: stringCONST japan.JapanesePaymentReminder.invoiceId
Section titled “CONST japan.JapanesePaymentReminder.invoiceId”任意のホスト側の請求書参照です。組み込みのテキストフォーマッターでは使用しません。
export const japan.JapanesePaymentReminder.invoiceId: string | undefinedCONST japan.JapaneseInventoryReminder.productName
Section titled “CONST japan.JapaneseInventoryReminder.productName”商品の表示名です。
export const japan.JapaneseInventoryReminder.productName: stringCONST japan.JapaneseInventoryReminder.currentStock
Section titled “CONST japan.JapaneseInventoryReminder.currentStock”そのまま表示する現在の残り在庫数です。
export const japan.JapaneseInventoryReminder.currentStock: numberCONST japan.JapaneseInventoryReminder.threshold
Section titled “CONST japan.JapaneseInventoryReminder.threshold”そのまま表示する在庫不足のしきい値です。
export const japan.JapaneseInventoryReminder.threshold: numberCONST japan.JapaneseInventoryReminder.productId
Section titled “CONST japan.JapaneseInventoryReminder.productId”任意のホスト側の商品参照です。組み込みのテキストフォーマッターでは使用しません。
export const japan.JapaneseInventoryReminder.productId: string | undefinedCONST japan.JapaneseCalendarDate.year
Section titled “CONST japan.JapaneseCalendarDate.year”グレゴリオ暦の年です。計算モードでは 2022–2099 を受け付けます。
export const japan.JapaneseCalendarDate.year: numberCONST japan.JapaneseCalendarDate.month
Section titled “CONST japan.JapaneseCalendarDate.month”0 始まりの暦月です(1 月は 0、12 月は 11)。
export const japan.JapaneseCalendarDate.month: numberCONST japan.JapaneseCalendarDate.day
Section titled “CONST japan.JapaneseCalendarDate.day”選択した暦月内の、1 始まりの日です。
export const japan.JapaneseCalendarDate.day: numberCONST japan.JapaneseHolidayCalendarOptions.source
Section titled “CONST japan.JapaneseHolidayCalendarOptions.source”祝日の情報源です。デフォルトは holiday-jp です。計算モードは 2022–2099 に限定され、春分日・秋分日のデフォルト値は概算です。
export const japan.JapaneseHolidayCalendarOptions.source: "holiday-jp" | "calculated" | undefinedCONST japan.JapaneseHolidayCalendarOptions.equinoxDays
Section titled “CONST japan.JapaneseHolidayCalendarOptions.equinoxDays”計算モードのみで使用します。必要に応じて、公表された春分日・秋分日を指定してください。
export const japan.JapaneseHolidayCalendarOptions.equinoxDays: ((year: number) => JapaneseEquinoxDays) | undefined使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { JapaneseHolidayCalendarOptions } from '@alneas/appkit-core/japan/holidays';
export function calculatedOptions(equinoxDays: NonNullable<JapaneseHolidayCalendarOptions['equinoxDays']>) { return { source: 'calculated', equinoxDays } satisfies JapaneseHolidayCalendarOptions;}---
### `CONST` `japan.JapaneseHolidayCalendarOptions.additionalHolidays`
YYYY-MM-DD で厳密に指定する休業日です。上書き指定には、振替休日/国民の休日の自動計算を適用しません。
```typescriptexport const japan.JapaneseHolidayCalendarOptions.additionalHolidays: readonly string[] | undefinedCONST japan.JapaneseHolidayCalendarOptions.excludedDates
Section titled “CONST japan.JapaneseHolidayCalendarOptions.excludedDates”追加後に除外する、厳密に指定された日付です。除外は常に優先されます。
export const japan.JapaneseHolidayCalendarOptions.excludedDates: readonly string[] | undefinedCONST graph.TaskNode.id
Section titled “CONST graph.TaskNode.id”タスクの一意の識別子です。
export const graph.TaskNode.id: stringCONST graph.TaskNode.title
Section titled “CONST graph.TaskNode.title”人が読みやすいタスクのタイトルです。
export const graph.TaskNode.title: stringCONST graph.TaskNode.durationHours
Section titled “CONST graph.TaskNode.durationHours”時間単位の見積もり所要時間です(デフォルトは 1)。
export const graph.TaskNode.durationHours: number | undefinedCONST graph.TaskNode.status
Section titled “CONST graph.TaskNode.status”実行ステータスです(‘TODO’ | ‘IN_PROGRESS’ | ‘DONE’ | string)。
export const graph.TaskNode.status: stringCONST graph.TaskNode.dueDate
Section titled “CONST graph.TaskNode.dueDate”期日です。
export const graph.TaskNode.dueDate: string | Date | null | undefinedCONST graph.TaskNode.assignee
Section titled “CONST graph.TaskNode.assignee”割り当てられたユーザーまたはエージェントの識別子です。
export const graph.TaskNode.assignee: string | undefinedCONST graph.TaskNode.priority
Section titled “CONST graph.TaskNode.priority”重要度または優先度のレベルです(‘low’ | ‘medium’ | ‘high’ | ‘urgent’ など)。
export const graph.TaskNode.priority: string | undefinedCONST graph.TaskEdge.predecessorId
Section titled “CONST graph.TaskEdge.predecessorId”先行タスクの ID です(先に完了する必要があります)。
export const graph.TaskEdge.predecessorId: stringCONST graph.TaskEdge.successorId
Section titled “CONST graph.TaskEdge.successorId”後続タスクの ID です(先行タスクが完了するまでブロックされます)。
export const graph.TaskEdge.successorId: stringCONST graph.TaskEdge.dependencyType
Section titled “CONST graph.TaskEdge.dependencyType”依存関係の種類です(デフォルト:‘FINISH_TO_START’)。
export const graph.TaskEdge.dependencyType: string | undefinedCONST graph.TaskEdge.lagHours
Section titled “CONST graph.TaskEdge.lagHours”時間単位のラグまたはリードタイムです(デフォルト:0)。
export const graph.TaskEdge.lagHours: number | undefinedCONST graph.BlockerAnalysis.taskId
Section titled “CONST graph.BlockerAnalysis.taskId”タスク識別子です。
export const graph.BlockerAnalysis.taskId: stringCONST graph.BlockerAnalysis.title
Section titled “CONST graph.BlockerAnalysis.title”タスクのタイトルです。
export const graph.BlockerAnalysis.title: stringCONST graph.BlockerAnalysis.status
Section titled “CONST graph.BlockerAnalysis.status”現在の実行ステータスです。
export const graph.BlockerAnalysis.status: stringCONST graph.BlockerAnalysis.directBlockedIds
Section titled “CONST graph.BlockerAnalysis.directBlockedIds”このタスクによって直接ブロックされるタスクの ID です。
export const graph.BlockerAnalysis.directBlockedIds: string[]CONST graph.BlockerAnalysis.allBlockedIds
Section titled “CONST graph.BlockerAnalysis.allBlockedIds”このタスクによって再帰的にブロックされる、すべての下流タスクの ID です。
export const graph.BlockerAnalysis.allBlockedIds: string[]CONST graph.BlockerAnalysis.blockedCount
Section titled “CONST graph.BlockerAnalysis.blockedCount”ブロックされている下流タスクの総数です。
export const graph.BlockerAnalysis.blockedCount: numberCONST graph.BlockerAnalysis.isCritical
Section titled “CONST graph.BlockerAnalysis.isCritical”このタスクがクリティカルパス上にあるかどうかです。
export const graph.BlockerAnalysis.isCritical: booleanCONST graph.BlockerAnalysis.unblockPriorityScore
Section titled “CONST graph.BlockerAnalysis.unblockPriorityScore”ブロック数、所要時間、クリティカル度から算出する、ブロック解除の優先度スコアです。
export const graph.BlockerAnalysis.unblockPriorityScore: numberCONST graph.CriticalPathResult.totalDurationHours
Section titled “CONST graph.CriticalPathResult.totalDurationHours”プロジェクトの完了に必要な最短の総所要時間です。単位は時間です。
export const graph.CriticalPathResult.totalDurationHours: numberCONST graph.CriticalPathResult.criticalPathTaskIds
Section titled “CONST graph.CriticalPathResult.criticalPathTaskIds”余裕時間を丸めるとゼロになるすべてのタスクを、トポロジカル順に並べたものです。単一の連結した経路ではなく、複数の分岐を含む場合があります。
export const graph.CriticalPathResult.criticalPathTaskIds: string[]CONST graph.CriticalPathResult.taskSchedules
Section titled “CONST graph.CriticalPathResult.taskSchedules”タスクごとの時間単位のスケジュール指標です。余裕時間は非負で、小数点以下 2 桁に丸められます。
export const graph.CriticalPathResult.taskSchedules: Record<string, { earlyStart: number; earlyFinish: number; lateStart: number; lateFinish: number; slack: number; isCritical: boolean; }>CONST graph.DelayImpact.sourceTaskId
Section titled “CONST graph.DelayImpact.sourceTaskId”遅延をシミュレーションした発生元タスクの ID です。
export const graph.DelayImpact.sourceTaskId: stringCONST graph.DelayImpact.delayHours
Section titled “CONST graph.DelayImpact.delayHours”シミュレーションした遅延時間です。単位は時間です。
export const graph.DelayImpact.delayHours: numberCONST graph.DelayImpact.affectedTaskIds
Section titled “CONST graph.DelayImpact.affectedTaskIds”最早開始時刻が後ろにずれる下流タスクの ID です。
export const graph.DelayImpact.affectedTaskIds: string[]CONST graph.DelayImpact.projectDelayHours
Section titled “CONST graph.DelayImpact.projectDelayHours”プロジェクト全体の完了に及ぼす正味の遅延時間です。単位は時間です。
export const graph.DelayImpact.projectDelayHours: numberCONST graph.DelayImpact.newCriticalPathTaskIds
Section titled “CONST graph.DelayImpact.newCriticalPathTaskIds”更新後の余裕時間がゼロのすべてのタスク ID を、トポロジカル順に並べたものです。これらが単一の連結した経路を形成するとは限りません。
export const graph.DelayImpact.newCriticalPathTaskIds: string[]FUNCTION graph.TaskGraphAdapter.loadGraph
Section titled “FUNCTION graph.TaskGraphAdapter.loadGraph”すべてのタスクと依存関係エッジを読み込みます。
loadGraph(): Promise<{ /** Current task nodes supplied by the adapter. */ tasks: TaskNode[]; /** Current directed dependencies supplied by the adapter. */ edges: TaskEdge[] }>;戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<{ tasks: TaskNode[]; edges: TaskEdge[]; }> - Description: 現在のグラフ配列です。所有権と更新動作はアダプターが管理します。
例外 (Throws)
Section titled “例外 (Throws)”実装またはそのグラフローダーが拒否した場合に拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { TaskGraphAdapter } from '@alneas/appkit-core/graph';
export async function example(adapter: TaskGraphAdapter) { return adapter.loadGraph();}---
### `FUNCTION` `graph.TaskGraphAdapter.getTopBlockers`
ブロック解除の優先度スコア順に、ブロックの原因となる上位タスクを取得します。
```typescriptgetTopBlockers(): Promise<BlockerAnalysis[]>;戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<BlockerAnalysis[]> - Description: タスクのブロッカーランキングです。グラフが空の場合は空の配列になります。
例外 (Throws)
Section titled “例外 (Throws)”実装またはそのグラフローダーが拒否した場合に拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { TaskGraphAdapter } from '@alneas/appkit-core/graph';
export async function example(adapter: TaskGraphAdapter) { return adapter.getTopBlockers();}---
### `FUNCTION` `graph.TaskGraphAdapter.getCriticalPath`
クリティカルパスとタスクごとのスケジュール指標を計算します。
```typescriptgetCriticalPath(): Promise<CriticalPathResult>;戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<CriticalPathResult> - Description: 依存関係に基づくスケジュールと、すべてのクリティカルタスク ID です。複数の分岐が同順位になる場合があります。
例外 (Throws)
Section titled “例外 (Throws)”実装またはそのグラフローダーが拒否した場合に拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { TaskGraphAdapter } from '@alneas/appkit-core/graph';
export async function example(adapter: TaskGraphAdapter) { return adapter.getCriticalPath();}---
### `FUNCTION` `graph.TaskGraphAdapter.simulateDelay`
特定のタスクの遅延がプロジェクト全体に及ぼす波及効果をシミュレーションします。
```typescriptsimulateDelay(taskId: string, delayHours: number): Promise<DelayImpact>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
taskId |
string |
必須 | - 期間を延長する既存のタスクです。 |
delayHours |
number |
必須 | - 有限かつ非負の期間の増分です。単位は時間です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<DelayImpact> - Description: 1 つのタスクの所要時間を時間単位で増やした後に再計算した影響です。
例外 (Throws)
Section titled “例外 (Throws)”実装またはそのグラフローダーが拒否した場合に拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { TaskGraphAdapter } from '@alneas/appkit-core/graph';
export async function example(adapter: TaskGraphAdapter) { return adapter.simulateDelay('a', 1);}---
### `FUNCTION` `graph.TaskGraphAdapter.validateAcyclic`
依存関係グラフに循環がないことを検証します。
```typescriptvalidateAcyclic(): Promise<{ /** True when depth-first cycle detection found no cycle. */ isValid: boolean; /** Detected DFS cycle paths with repeated starting ID; empty for an acyclic graph. */ cycles: string[][] }>;戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<{ isValid: boolean; cycles: string[][]; }> - Description: 循環検出フラグと、検出された循環経路です。
例外 (Throws)
Section titled “例外 (Throws)”実装またはそのグラフローダーが拒否した場合に拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { TaskGraphAdapter } from '@alneas/appkit-core/graph';
export async function example(adapter: TaskGraphAdapter) { return adapter.validateAcyclic();}---
### `CONST` `graph.InMemoryTaskGraphAdapterOptions.tasks`
初期タスク配列です。
```typescriptexport const graph.InMemoryTaskGraphAdapterOptions.tasks: TaskNode[] | undefinedCONST graph.InMemoryTaskGraphAdapterOptions.edges
Section titled “CONST graph.InMemoryTaskGraphAdapterOptions.edges”初期依存関係エッジ配列です。
export const graph.InMemoryTaskGraphAdapterOptions.edges: TaskEdge[] | undefinedCONST graph.InMemoryTaskGraphAdapterOptions.loadData
Section titled “CONST graph.InMemoryTaskGraphAdapterOptions.loadData”グラフデータを取得する任意の動的ローダー関数です。
export const graph.InMemoryTaskGraphAdapterOptions.loadData: (() => Promise<{ tasks: TaskNode[]; edges: TaskEdge[]; }>) | undefined補足 (Remarks)
Section titled “補足 (Remarks)”loadGraph/解析の呼び出しごとに、引数なしで呼び出されます。I/O、認可、永続化はホストが管理します。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { InMemoryTaskGraphAdapterOptions } from '@alneas/appkit-core/graph';
export function withLoader(loadData: NonNullable<InMemoryTaskGraphAdapterOptions['loadData']>) { return { loadData } satisfies InMemoryTaskGraphAdapterOptions;}---
### `FUNCTION` `graph.InMemoryTaskGraphAdapter.setData`
グラフデータを直接設定します。
```typescriptsetData(tasks: TaskNode[], edges: TaskEdge[]): void引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
tasks |
TaskNode[] |
必須 | - タスクノードの配列です。 |
edges |
TaskEdge[] |
必須 | - 依存関係エッジの配列です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
void - Description: 戻り値はありません。保存済みの配列を、指定された配列の浅いコピーで置き換えます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { InMemoryTaskGraphAdapter } from '@alneas/appkit-core/graph';
export async function example(adapter: InMemoryTaskGraphAdapter) { return adapter.setData([{ id: 'a', title: 'Draft', status: 'TODO' }], []);}---
### `FUNCTION` `graph.InMemoryTaskGraphAdapter.loadGraph`
グラフデータ(タスクと依存関係エッジ)を読み込みます。
```typescriptasync loadGraph(): Promise<{ /** Task nodes supplied by the loader or current graph state; not deep-cloned. */ tasks: TaskNode[]; /** Directed dependencies supplied with the graph; not deep-cloned. */ edges: TaskEdge[] }>戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<{ tasks: TaskNode[]; edges: TaskEdge[]; }> - Description: タスクとエッジを含むオブジェクトです。
補足 (Remarks)
Section titled “補足 (Remarks)”設定されたローダーは毎回実行されます。返される配列は現在保存されている配列への参照であり、スナップショットではありません。
例外 (Throws)
Section titled “例外 (Throws)”指定されたローダーが拒否した場合に拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { InMemoryTaskGraphAdapter } from '@alneas/appkit-core/graph';
export async function example(adapter: InMemoryTaskGraphAdapter) { return adapter.loadGraph();}---
### `FUNCTION` `graph.InMemoryTaskGraphAdapter.getTopBlockers`
ブロック解除の優先度スコア順に、ブロックの原因となる上位タスクを取得します。
```typescriptasync getTopBlockers(): Promise<BlockerAnalysis[]>戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<BlockerAnalysis[]> - Description: ブロック要因の分析結果の配列です。
例外 (Throws)
Section titled “例外 (Throws)”指定されたローダーが拒否した場合に拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { InMemoryTaskGraphAdapter } from '@alneas/appkit-core/graph';
export async function example(adapter: InMemoryTaskGraphAdapter) { return adapter.getTopBlockers();}---
### `FUNCTION` `graph.InMemoryTaskGraphAdapter.getCriticalPath`
クリティカルパス(最長経路と余裕時間を含むスケジュール)を計算します。
```typescriptasync getCriticalPath(): Promise<CriticalPathResult>戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<CriticalPathResult> - Description: クリティカルパスのスケジュール分析結果です。
補足 (Remarks)
Section titled “補足 (Remarks)”クリティカル ID には、丸め後の余裕時間がゼロになるすべてのタスクが含まれ、複数の分岐にまたがる場合があります。
例外 (Throws)
Section titled “例外 (Throws)”ローダーの失敗または無効な CPM 入力により拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { InMemoryTaskGraphAdapter } from '@alneas/appkit-core/graph';
export async function example(adapter: InMemoryTaskGraphAdapter) { return adapter.getCriticalPath();}---
### `FUNCTION` `graph.InMemoryTaskGraphAdapter.simulateDelay`
特定のタスクの遅延がプロジェクト全体に及ぼす波及効果をシミュレーションします。
```typescriptasync simulateDelay(taskId: string, delayHours: number): Promise<DelayImpact>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
taskId |
string |
必須 | - 遅延が発生する発生元タスクの ID です。 |
delayHours |
number |
必須 | - シミュレーションする遅延時間です。単位は時間です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<DelayImpact> - Description: 遅延影響のシミュレーション結果です。
例外 (Throws)
Section titled “例外 (Throws)”ローダーの失敗、無効な遅延、存在しないタスク ID、または無効な CPM 入力により拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { InMemoryTaskGraphAdapter } from '@alneas/appkit-core/graph';
export async function example(adapter: InMemoryTaskGraphAdapter) { return adapter.simulateDelay('a', 1);}---
### `FUNCTION` `graph.InMemoryTaskGraphAdapter.validateAcyclic`
依存関係グラフに循環参照(サイクル)がないことを検証します。
```typescriptasync validateAcyclic(): Promise<{ /** True when depth-first cycle detection found no cycle. */ isValid: boolean; /** Detected DFS cycle paths with repeated starting ID; empty for an acyclic graph. */ cycles: string[][] }>戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<{ isValid: boolean; cycles: string[][]; }> - Description: フラグと、検出された循環経路を含む検証結果です。
例外 (Throws)
Section titled “例外 (Throws)”指定されたローダーが拒否した場合に拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { InMemoryTaskGraphAdapter } from '@alneas/appkit-core/graph';
export async function example(adapter: InMemoryTaskGraphAdapter) { return adapter.validateAcyclic();}---
### `CONST` `graph.GanttPlanningTask.id`
依存関係から参照される一意のタスク識別子です。
```typescriptexport const graph.GanttPlanningTask.id: stringCONST graph.GanttPlanningTask.created_at
Section titled “CONST graph.GanttPlanningTask.created_at”start_date がない場合に使用する、代替の開始可能日/開始日です。
export const graph.GanttPlanningTask.created_at: string | DateCONST graph.GanttPlanningTask.start_date
Section titled “CONST graph.GanttPlanningTask.start_date”任意の開始可能日です。プランナーがこの日付より前にタスクを前倒しすることはありません。
export const graph.GanttPlanningTask.start_date: string | Date | null | undefinedCONST graph.GanttPlanningTask.due_date
Section titled “CONST graph.GanttPlanningTask.due_date”任意の、終了日自体を含まない終了日です。省略した場合は、カレンダー変換前に 1 暦日の期間と推定します。
export const graph.GanttPlanningTask.due_date: string | Date | null | undefinedCONST graph.GanttPlanningTask.parent_id
Section titled “CONST graph.GanttPlanningTask.parent_id”任意の親タスク ID です。親として参照される行はサマリーとして扱われ、リーフタスクの計画対象から除外されます。
export const graph.GanttPlanningTask.parent_id: string | null | undefinedCONST graph.GanttPlanningTask.assignee_id
Section titled “CONST graph.GanttPlanningTask.assignee_id”明示的なリソース割り当てがない場合に使用する、任意のリソース識別子です。
export const graph.GanttPlanningTask.assignee_id: string | null | undefinedCONST graph.GanttPlanningTask.durationDays
Section titled “CONST graph.GanttPlanningTask.durationDays”稼働日単位の任意の非負整数の所要日数です。日付から算出した所要日数よりも優先され、0 日のマイルストーンも含みます。
export const graph.GanttPlanningTask.durationDays: number | undefinedCONST graph.GanttPlanningTask.resourceAssignments
Section titled “CONST graph.GanttPlanningTask.resourceAssignments”占有する各稼働日における、任意の同時リソース需要です。同じリソース ID が重複している場合は合算します。
export const graph.GanttPlanningTask.resourceAssignments: GanttResourceAssignment[] | undefinedCONST graph.GanttDependency.id
Section titled “CONST graph.GanttDependency.id”一意の依存関係 ID です。
export const graph.GanttDependency.id: stringCONST graph.GanttDependency.sourceId
Section titled “CONST graph.GanttDependency.sourceId”先行タスクの ID です。サマリータスクはサポートされていません。
export const graph.GanttDependency.sourceId: stringCONST graph.GanttDependency.targetId
Section titled “CONST graph.GanttDependency.targetId”後続タスクの ID です。
export const graph.GanttDependency.targetId: stringCONST graph.GanttDependency.type
Section titled “CONST graph.GanttDependency.type”終了/開始の端点の組み合わせです。FS、SS、FF、SF のいずれかです。
export const graph.GanttDependency.type: "FS" | "SS" | "FF" | "SF"CONST graph.GanttDependency.lagDays
Section titled “CONST graph.GanttDependency.lagDays”整数のラグです。従来のスケジューリングでは暦日、スケジューリングオプションを使用する場合は稼働日で指定します。負の値を指定すると前倒しできます。
export const graph.GanttDependency.lagDays: number | undefinedCONST graph.GanttWorkingCalendar.workingWeekdays
Section titled “CONST graph.GanttWorkingCalendar.workingWeekdays”稼働する曜日です。日曜日=0です。デフォルトは月曜日~金曜日です。workingDatesを指定する場合は空にできます。
export const graph.GanttWorkingCalendar.workingWeekdays: number[] | undefinedCONST graph.GanttWorkingCalendar.holidays
Section titled “CONST graph.GanttWorkingCalendar.holidays”非稼働日となるローカル日付です。厳密なYYYY-MM-DD形式で指定します。
export const graph.GanttWorkingCalendar.holidays: string[] | undefinedCONST graph.GanttWorkingCalendar.workingDates
Section titled “CONST graph.GanttWorkingCalendar.workingDates”稼働日を明示的に上書きする指定です。休日や曜日の設定より優先されます。
export const graph.GanttWorkingCalendar.workingDates: string[] | undefinedCONST graph.GanttResource.id
Section titled “CONST graph.GanttResource.id”一意のリソース識別子です。
export const graph.GanttResource.id: stringCONST graph.GanttResource.capacity
Section titled “CONST graph.GanttResource.capacity”正の有限値で指定する容量です。デフォルトは1です。
export const graph.GanttResource.capacity: number | undefinedCONST graph.GanttResourceAssignment.resourceId
Section titled “CONST graph.GanttResourceAssignment.resourceId”リソースリストを明示的に指定した場合は、設定済みのリソースと一致する必要があります。
export const graph.GanttResourceAssignment.resourceId: stringCONST graph.GanttResourceAssignment.units
Section titled “CONST graph.GanttResourceAssignment.units”正の有限値で指定する需要量です。デフォルトは1です。重複する割り当ては合算されます。
export const graph.GanttResourceAssignment.units: number | undefinedCONST graph.GanttResourceLeveling.enabled
Section titled “CONST graph.GanttResourceLeveling.enabled”容量制約付きスケジューリングを有効にします。デフォルトはfalseです。
export const graph.GanttResourceLeveling.enabled: boolean | undefinedCONST graph.GanttResourceLeveling.resources
Section titled “CONST graph.GanttResourceLeveling.resources”省略すると、assignments/assignee_idからリソースを推定し、それぞれの容量を1とします。
export const graph.GanttResourceLeveling.resources: GanttResource[] | undefinedCONST graph.GanttSchedulingOptions.calendar
Section titled “CONST graph.GanttSchedulingOptions.calendar”省略すると週7日を稼働日とします。空のカレンダーオブジェクトを指定すると、月曜日~金曜日を稼働日とします。
export const graph.GanttSchedulingOptions.calendar: GanttWorkingCalendar | undefinedCONST graph.GanttSchedulingOptions.resourceLeveling
Section titled “CONST graph.GanttSchedulingOptions.resourceLeveling”任意の容量平準化設定です。暗黙的に有効になることはありません。
export const graph.GanttSchedulingOptions.resourceLeveling: GanttResourceLeveling | undefinedCONST graph.GanttSchedulingOptions.maxCalendarDays
Section titled “CONST graph.GanttSchedulingOptions.maxCalendarDays”最も早いリーフタスクの開始日からの、上限付き探索期間です。デフォルトは3660暦日、最大は36600暦日です。
export const graph.GanttSchedulingOptions.maxCalendarDays: number | undefinedCONST graph.GanttCriticalTask.taskId
Section titled “CONST graph.GanttCriticalTask.taskId”リーフタスクの識別子です。
export const graph.GanttCriticalTask.taskId: stringCONST graph.GanttCriticalTask.earlyStart
Section titled “CONST graph.GanttCriticalTask.earlyStart”開始可能日と依存関係を満たす、実行可能な最早開始日/終了日です。
export const graph.GanttCriticalTask.earlyStart: DateCONST graph.GanttCriticalTask.earlyFinish
Section titled “CONST graph.GanttCriticalTask.earlyFinish”共通の稼働日カレンダーにおける、境界自体を含まない最早終了境界です。
export const graph.GanttCriticalTask.earlyFinish: DateCONST graph.GanttCriticalTask.lateStart
Section titled “CONST graph.GanttCriticalTask.lateStart”依存関係のみで決まるプロジェクト終了日を遅らせない、最遅開始日/終了日です。
export const graph.GanttCriticalTask.lateStart: DateCONST graph.GanttCriticalTask.lateFinish
Section titled “CONST graph.GanttCriticalTask.lateFinish”依存関係のみで決まるプロジェクト完了日を維持する、境界自体を含まない最遅終了境界です。
export const graph.GanttCriticalTask.lateFinish: DateCONST graph.GanttCriticalTask.totalFloatDays
Section titled “CONST graph.GanttCriticalTask.totalFloatDays”稼働日単位の総余裕です。リソースの競合は考慮しません。
export const graph.GanttCriticalTask.totalFloatDays: numberCONST graph.GanttCriticalTask.critical
Section titled “CONST graph.GanttCriticalTask.critical”総余裕がゼロの場合にtrueになります。
export const graph.GanttCriticalTask.critical: booleanCONST graph.GanttCriticalPath.tasks
Section titled “CONST graph.GanttCriticalPath.tasks”入力順に並ぶタスクごとの日程情報です。サマリータスクは除外されます。
export const graph.GanttCriticalPath.tasks: GanttCriticalTask[]CONST graph.GanttCriticalPath.taskIds
Section titled “CONST graph.GanttCriticalPath.taskIds”余裕がゼロのタスクIDです。クリティカルな分岐が複数存在する場合があります。
export const graph.GanttCriticalPath.taskIds: string[]CONST graph.GanttCriticalPath.dependencyIds
Section titled “CONST graph.GanttCriticalPath.dependencyIds”余裕がゼロのタスク同士を結ぶ、時間的な余裕のないリンクです。
export const graph.GanttCriticalPath.dependencyIds: string[]CONST graph.GanttCriticalPath.projectFinish
Section titled “CONST graph.GanttCriticalPath.projectFinish”依存関係のみで決まる終了日です。リーフタスクがない場合はnullです。
export const graph.GanttCriticalPath.projectFinish: Date | nullCONST graph.GanttScheduleResult.tasks
Section titled “CONST graph.GanttScheduleResult.tasks”元の順序に並ぶスケジュール済みタスクです。サマリータスクは階層のロールアップ用に変更せず残します。
export const graph.GanttScheduleResult.tasks: GanttScheduledTask<T>[]CONST graph.GanttScheduleResult.criticalPath
Section titled “CONST graph.GanttScheduleResult.criticalPath”平準化前の、依存関係のみを考慮したCPMです。リソース制約を考慮したクリティカルチェーンではありません。
export const graph.GanttScheduleResult.criticalPath: GanttCriticalPathCONST graph.GanttScheduleResult.resourceDelays
Section titled “CONST graph.GanttScheduleResult.resourceDelays”容量による直接的な遅延と、先行タスクから伝播した遅延です。稼働日単位で表します。
export const graph.GanttScheduleResult.resourceDelays: { taskId: string; directDays: number; propagatedDays: number; }[]CONST graph.GanttScheduleResult.projectFinish
Section titled “CONST graph.GanttScheduleResult.projectFinish”任意の平準化を行った後の終了日です。空の場合はnullです。
export const graph.GanttScheduleResult.projectFinish: Date | nullCONST ai.AIChatError.code
Section titled “CONST ai.AIChatError.code”表示テキストを調べずにプログラムで処理するための失敗カテゴリです。
export const ai.AIChatError.code: "AI_INVALID_CONFIGURATION" | "AI_HTTP_FAILURE" | "AI_INVALID_STREAM" | "AI_INCOMPLETE_STREAM" | "AI_INVALID_TOOL_CALL" | "AI_RESPONSE_LIMIT" | "AI_FILE_UPLOAD_FAILURE"CONST ai.AIChatError.docsUrl
Section titled “CONST ai.AIChatError.docsUrl”このチャット失敗コードに対応する公開ガイドの絶対URLです。
export const ai.AIChatError.docsUrl: stringCONST ai.AIChatError.recovery
Section titled “CONST ai.AIChatError.recovery”このチャット失敗に対する固定の復旧ガイダンスです。このエラーによって再試行が行われることはありません。
export const ai.AIChatError.recovery: stringCONST ai.AIErrorInfo.docsUrl
Section titled “CONST ai.AIErrorInfo.docsUrl”カタログに登録された失敗を説明する公開ガイドの絶対URLです。
export const ai.AIErrorInfo.docsUrl: stringCONST ai.AIErrorInfo.guide
Section titled “CONST ai.AIErrorInfo.guide”このエラーコードに対応する、パッケージからの相対パスで指定したドキュメントファイルとアンカーです。
export const ai.AIErrorInfo.guide: stringCONST ai.AIErrorInfo.recovery
Section titled “CONST ai.AIErrorInfo.recovery”この失敗に対する固定の復旧ガイダンスです。自動再試行は行われません。
export const ai.AIErrorInfo.recovery: stringCONST ai.ActionDefinition.id
Section titled “CONST ai.ActionDefinition.id”一意のアクション識別子です(例:‘table.filter’、‘record.update’)。
export const ai.ActionDefinition.id: stringCONST ai.ActionDefinition.description
Section titled “CONST ai.ActionDefinition.description”このアクションの動作を人とエージェントが理解できる説明です。
export const ai.ActionDefinition.description: stringCONST ai.ActionDefinition.validate
Section titled “CONST ai.ActionDefinition.validate”入力引数の実行時バリデーターです。 入力引数を持たないアクションでは、入力がundefinedまたはnullであることを検証する必要があります。
export const ai.ActionDefinition.validate: ActionValidator<TInput>使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { ActionDefinition } from '@alneas/appkit-core/ai/action';
export function check(action: ActionDefinition<string, string>, input: unknown) { return action.validate(input);}---
### `CONST` `ai.ActionDefinition.handler`
アクションのハンドラー関数です。検証済みデータと、任意の協調的キャンセル/進捗コンテキストを受け取ります。中止要求の後に成功を返した場合も、ハンドラーが完了したことを意味します。ロールバックが行われることを示すものではありません。
```typescriptexport const ai.ActionDefinition.handler: (input: TInput, context?: ExecutionContext) => Promise<TOutput> | TOutput使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { ActionDefinition } from '@alneas/appkit-core/ai/action';
export async function run(action: ActionDefinition<string, string>) { return action.handler('hello');}---
### `CONST` `ai.ActionDefinition.metadata`
アクションに関連付ける任意のメタデータです。
```typescriptexport const ai.ActionDefinition.metadata: Record<string, unknown> | undefinedCONST ai.ActionDescriptor.id
Section titled “CONST ai.ActionDescriptor.id”このオブジェクトを、その所有元のアプリケーション/セッションと関連付けるための空でない識別子です。
export const ai.ActionDescriptor.id: stringCONST ai.ActionDescriptor.description
Section titled “CONST ai.ActionDescriptor.description”アプリケーションが明示的に提供する、人とモデルが理解できる説明です。
export const ai.ActionDescriptor.description: stringCONST ai.ActionDescriptor.metadata
Section titled “CONST ai.ActionDescriptor.metadata”記述子に参照としてコピーされる任意のメタデータです。開示にはホストの承認が必要です。
export const ai.ActionDescriptor.metadata: Record<string, unknown> | undefinedCONST ai.ContextDefinition.key
Section titled “CONST ai.ContextDefinition.key”一意のコンテキストキーです(例:‘selectedRecord’、‘tableState’)。
export const ai.ContextDefinition.key: stringCONST ai.ContextDefinition.description
Section titled “CONST ai.ContextDefinition.description”このコンテキストが何を表すかを人とエージェントが理解できる説明です。
export const ai.ContextDefinition.description: string | undefinedCONST ai.ContextDefinition.getter
Section titled “CONST ai.ContextDefinition.getter”最新のコンテキスト値を返すゲッター関数です。
export const ai.ContextDefinition.getter: ContextGetter<T>使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { ContextDefinition } from '@alneas/appkit-core/ai/action';
export async function read(context: ContextDefinition<string>) { return context.getter();}---
### `CONST` `ai.ContextDescriptor.key`
検索に使用するアプリケーションコンテキストの登録キーです。
```typescriptexport const ai.ContextDescriptor.key: stringCONST ai.ContextDescriptor.description
Section titled “CONST ai.ContextDescriptor.description”アプリケーションが明示的に提供する、人とモデルが理解できる説明です。
export const ai.ContextDescriptor.description: string | undefinedFUNCTION ai.ActionRegistry.registerAction
Section titled “FUNCTION ai.ActionRegistry.registerAction”アクションを登録します。この登録だけを対象とする登録解除関数を返します。 同じIDのアクションがすでに登録されている場合は、Errorをスローします。
registerAction<TInput, TOutput>( action: ActionDefinition<TInput, TOutput> ): () => void引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
action |
ActionDefinition<TInput, TOutput> |
必須 | - 空白のみではない一意の ID と、必須のバリデーターおよびハンドラーです。定義は登録時に浅く凍結されます。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
() => void - Description: この登録トークンの範囲内で機能する、冪等な登録解除コールバックです。
例外 (Throws)
Section titled “例外 (Throws)”アクション ID が無効または重複している場合や、バリデーターまたはハンドラーがない場合に例外をスローします。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { ActionRegistry, type ActionDefinition } from '@alneas/appkit-core/ai/action';
export function register(registry: ActionRegistry, action: ActionDefinition<string, string>) { const unregister = registry.registerAction(action); return unregister; // The host calls this when the registration is disposed.}---
### `FUNCTION` `ai.ActionRegistry.hasAction`
アクションが現在登録されているかを確認します。
```typescripthasAction(id: string): boolean引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
id |
string |
必須 | - 登録済みアクションの正確な識別子です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
boolean - Description: その ID が現在登録されているかどうかです。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { ActionRegistry } from '@alneas/appkit-core/ai/action';
export async function example(registry: ActionRegistry) { return registry.hasAction('echo');}---
### `FUNCTION` `ai.ActionRegistry.getAction`
登録されている場合にアクション定義を返します。
```typescriptgetAction(id: string): ActionDefinition<any, any> | undefined引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
id |
string |
必須 | - 確認するアクションの正確な識別子です。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
ActionDefinition<any, any> | undefined - Description: 登録済みの浅く凍結された定義です。存在しない場合は undefined です。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { ActionRegistry } from '@alneas/appkit-core/ai/action';
export async function example(registry: ActionRegistry) { return registry.getAction('echo');}---
### `FUNCTION` `ai.ActionRegistry.listActions`
公開アクション記述子の安定したスナップショットを返します。登録内容が変わらない限り、返される配列の参照は変わりません。
```typescriptlistActions(): readonly ActionDescriptor[]戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
readonly ActionDescriptor[] - Description: 安定した凍結済みの記述子スナップショットです。初期状態では空です。ネストされたメタデータは引き続きホストが管理します。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { ActionRegistry } from '@alneas/appkit-core/ai/action';
export async function example(registry: ActionRegistry) { return registry.listActions();}---
### `FUNCTION` `ai.ActionRegistry.executeAction`
検証を行い、IDで指定したアクションを実行します。データまたは型付きの失敗コードを含むActionResultを返します。
```typescriptasync executeAction( id: string, input: unknown, context?: ExecutionContext, ): Promise<ActionResult<unknown>>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
id |
string |
必須 | - 呼び出し時に検索されるアクション識別子です。 |
input |
unknown |
必須 | - 必須の同期的バリデーターに渡される、信頼できない入力です。 |
context |
ExecutionContext | undefined |
任意 | - ハンドラーに渡される、省略可能な協調的キャンセルと進捗のコンテキストです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<ActionResult<unknown>> - Description: 成功データ、または未登録、無効な入力、キャンセル、ハンドラーエラーに対する失敗結果です。捕捉された原因はローカルにとどまります。
補足 (Remarks)
Section titled “補足 (Remarks)”これはメモリ内のディスパッチ境界です。サーバーの認可・冪等性とロールバックは、引き続きホストが管理します。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { ActionRegistry } from '@alneas/appkit-core/ai/action';
export async function example(registry: ActionRegistry) { return registry.executeAction('echo', { text: 'hello' });}---
### `FUNCTION` `ai.ActionRegistry.registerContext`
画面コンテキストプロバイダーを登録します。この登録だけを対象とする登録解除関数を返します。同じキーのコンテキストがすでに登録されている場合は、Errorをスローします。
```typescriptregisterContext<T>(definition: ContextDefinition<T>): () => void引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
definition |
ContextDefinition<T> |
必須 | - 空白のみではない一意のコンテキストキーと、必要時に実行されるゲッターです。定義は浅く凍結されます。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
() => void - Description: この登録の範囲内で機能する、冪等な登録解除コールバックです。
例外 (Throws)
Section titled “例外 (Throws)”キーが無効または重複している場合や、ゲッターが関数でない場合に例外をスローします。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport { ActionRegistry, type ContextDefinition } from '@alneas/appkit-core/ai/action';
export function register(registry: ActionRegistry, context: ContextDefinition<string>) { return registry.registerContext(context);}---
### `FUNCTION` `ai.ActionRegistry.hasContext`
コンテキストプロバイダーが現在登録されているかを確認します。
```typescripthasContext(key: string): boolean引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - アプリケーションコンテキストの正確なキーです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
boolean - Description: そのキーが現在登録されているかどうかです。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { ActionRegistry } from '@alneas/appkit-core/ai/action';
export async function example(registry: ActionRegistry) { return registry.hasContext('selection');}---
### `FUNCTION` `ai.ActionRegistry.listContexts`
公開コンテキスト記述子の安定したスナップショットを返します。登録内容が変わらない限り、返される配列の参照は変わりません。
```typescriptlistContexts(): readonly ContextDescriptor[]戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
readonly ContextDescriptor[] - Description: 安定した凍結済みのコンテキスト記述子スナップショットです。初期状態では空です。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { ActionRegistry } from '@alneas/appkit-core/ai/action';
export async function example(registry: ActionRegistry) { return registry.listContexts();}---
### `FUNCTION` `ai.ActionRegistry.getContext`
必要に応じてコンテキストの現在値を取得します。エラーを安全に捕捉し、ゲッターの実行中に登録が削除または置換されていないことを確認します。
```typescriptasync getContext(key: string): Promise<ContextValueResult<unknown>>引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
key |
string |
必須 | - この呼び出しでゲッターが 1 回実行されるコンテキストの正確なキーです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<ContextValueResult<unknown>> - Description: 現在のゲッター値、または NOT_FOUND/UNREGISTERED/GETTER_FAILED の結果です。ゲッターはキャッシュされません。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { ActionRegistry } from '@alneas/appkit-core/ai/action';
export async function example(registry: ActionRegistry) { return registry.getContext('selection');}---
### `FUNCTION` `ai.ActionRegistry.getAllContext`
必要に応じて、登録済みのすべてのコンテキストを、結果のキーと値からなるレコードとして取得します。
```typescriptasync getAllContext(): Promise<Record<string, ContextValueResult<unknown>>>戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<Record<string, ContextValueResult<unknown>>> - Description: 呼び出し開始時に登録されていたキーから順番に読み取った、キーごとの結果を格納する null プロトタイプのレコードです。各ゲッターは独立して失敗する可能性があります。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { ActionRegistry } from '@alneas/appkit-core/ai/action';
export async function example(registry: ActionRegistry) { return registry.getAllContext();}---
### `FUNCTION` `ai.ActionRegistry.subscribe`
登録内容の変更を監視するリスナーを登録します。購読解除関数を返します。
```typescriptsubscribe(listener: () => void): () => void引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
listener |
() => void |
必須 | - 登録の変更時に呼び出される、引数なしの同期的コールバックです。戻り値は無視され、オブザーバーのエラーは捕捉されます。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
() => void - Description: 購読解除コールバックです。実行やコンテキスト値の変更では通知されません。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { ActionRegistry } from '@alneas/appkit-core/ai/action';
export async function example(registry: ActionRegistry) { return registry.subscribe(() => console.log(registry.listActions()));}---
### `CONST` `ai.ActionToolDescriptor.name`
1~64文字のASCII英字、数字、アンダースコア、ハイフンで構成されるツール名です。
```typescriptexport const ai.ActionToolDescriptor.name: stringCONST ai.ActionToolDescriptor.description
Section titled “CONST ai.ActionToolDescriptor.description”アプリケーションが明示的に提供する、人とモデルが理解できる説明です。
export const ai.ActionToolDescriptor.description: stringCONST ai.ActionToolDescriptor.inputSchema
Section titled “CONST ai.ActionToolDescriptor.inputSchema”ルートがオブジェクトである、同期的なdraft-07(デフォルト)または2020-12スキーマです。
export const ai.ActionToolDescriptor.inputSchema: Readonly<import("ajv").SchemaObject> & { readonly type: "object"; readonly $async?: never; }CONST ai.ActionToolCall.callId
Section titled “CONST ai.ActionToolCall.callId”アプリケーション/プロバイダーの呼び出し識別子です。ブリッジの存続期間中は重複が拒否されます。
export const ai.ActionToolCall.callId: stringCONST ai.ActionToolCall.name
Section titled “CONST ai.ActionToolCall.name”アプリケーションが選択する公開ツール/コンポーネント名です。実行可能コードから推定されるものではありません。
export const ai.ActionToolCall.name: stringCONST ai.ActionToolCall.arguments
Section titled “CONST ai.ActionToolCall.arguments”解析済みの信頼できない入力です。実行前には引き続きスキーマ検証が行われます。
export const ai.ActionToolCall.arguments: unknownCONST ai.ActionToolBridgeOptions.tools
Section titled “CONST ai.ActionToolBridgeOptions.tools”このブリッジで利用できる明示的なツールバインディングです。登録済みの対象のみが列挙されます。
export const ai.ActionToolBridgeOptions.tools: readonly ActionToolBinding[]CONST ai.ActionToolBridgeOptions.maxCalls
Section titled “CONST ai.ActionToolBridgeOptions.maxCalls”重複を拒否するために保持する、一意で有効な呼び出しエンベロープの最大数です。デフォルトは1000です。追い出しは行いません。
export const ai.ActionToolBridgeOptions.maxCalls: number | undefinedFUNCTION ai.ActionToolBridge.listTools
Section titled “FUNCTION ai.ActionToolBridge.listTools”対応するアクション/コンテキストが現在登録されている、明示的に公開されたツールを列挙します。
listTools(): readonly ActionToolDescriptor[];戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
readonly ActionToolDescriptor[] - Description: 現在登録されている公開対象の凍結済み記述子です。クローズ後は空になります。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { ActionToolBridge } from '@alneas/appkit-core/ai/action';
export async function example(bridge: ActionToolBridge) { return bridge.listTools();}---
### `FUNCTION` `ai.ActionToolBridge.execute`
スキーマと登録済みアクションを検証した後、このセッション内でcallIdごとに1回実行します。
```typescriptexecute(call: ActionToolCall, context?: ExecutionContext): Promise<ActionToolResult>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
call |
ActionToolCall |
必須 | - 一意の callId と解析済みの引数を持つ、組み立て済みの呼び出しエンベロープです。 |
context |
ExecutionContext | undefined |
任意 | - アクション実行用の、省略可能な協調的キャンセル/進捗コンテキストです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<ActionToolResult> - Description: 凍結済みの JSON 結果、または機密情報を除去した固定の失敗結果です。自動再試行や永続的な重複排除はありません。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { ActionToolBridge } from '@alneas/appkit-core/ai/action';
export async function example(bridge: ActionToolBridge) { return bridge.execute({ callId: 'call-1', name: 'echo_text', arguments: { text: 'hello' } });}---
### `FUNCTION` `ai.ActionToolBridge.close`
以降の呼び出しを拒否し、実行中の結果を抑制します。開始済みの副作用は元に戻しません。
```typescriptclose(): void;戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
void - Description: 戻り値はありません。以後の呼び出しを拒否し、進行中の結果を抑制しますが、副作用は取り消しません。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { ActionToolBridge } from '@alneas/appkit-core/ai/action';
export async function example(bridge: ActionToolBridge) { return bridge.close();}---
### `CONST` `ai.ActionToolDefinition.id`
このオブジェクトを、その所有元のアプリケーション/セッションと関連付けるための空でない識別子です。
```typescriptexport const ai.ActionToolDefinition.id: stringCONST ai.ActionToolDefinition.parseInput
Section titled “CONST ai.ActionToolDefinition.parseInput”スキーマ検証の後に実行されます。実行時チェックまたは同期的なパーサーを使用してTInputを確定してください。
export const ai.ActionToolDefinition.parseInput: (input: ActionToolObject) => ActionValidationResult<TInput>使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { ActionToolDefinition } from '@alneas/appkit-core/ai/action';
export function parse(definition: ActionToolDefinition<string, string>) { return definition.parseInput({ text: 'hello' });}---
### `CONST` `ai.ActionToolDefinition.handler`
明示的に指定された型付きアクション実装を実行します。
```typescriptexport const ai.ActionToolDefinition.handler: (input: TInput, context?: import("./execution").ExecutionContext) => TOutput | Promise<TOutput>使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { ActionToolDefinition } from '@alneas/appkit-core/ai/action';
export async function run(definition: ActionToolDefinition<string, string>) { return definition.handler('hello');}---
### `CONST` `ai.ActionToolDefinition.mapOutput`
レジストリが同じIDのアクションを置換できるため、出力の型はunknownのままです。検証し、必要な形に射影してください。
```typescriptexport const ai.ActionToolDefinition.mapOutput: (value: unknown) => unknown使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { ActionToolDefinition } from '@alneas/appkit-core/ai/action';
export function project(definition: ActionToolDefinition<string, string>, value: unknown) { return definition.mapOutput(value);}---
### `CONST` `ai.DefinedActionTool.action`
ローカル実行の前に明示的に登録する型付きアクション定義です。
```typescriptexport const ai.DefinedActionTool.action: ActionDefinition<TInput, TOutput>CONST ai.DefinedActionTool.tool
Section titled “CONST ai.DefinedActionTool.tool”ブリッジに渡す明示的なツールバインディングです。作成してもアクションが公開または登録されることはありません。
export const ai.DefinedActionTool.tool: ActionToolDescriptor & { readonly mapOutput: (value: unknown) => unknown; } & { readonly kind: "action"; readonly actionId: string; readonly mapInput?: (args: ActionToolObject) => unknown; }CONST ai.ExecutionProgress.completed
Section titled “CONST ai.ExecutionProgress.completed”完了した作業量を表す、有限かつ非負の単位数です。無効な進捗報告は無視されます。
export const ai.ExecutionProgress.completed: numberCONST ai.ExecutionProgress.total
Section titled “CONST ai.ExecutionProgress.total”任意の総作業単位数です。有限値で、完了済みの単位数以上である必要があります。省略すると合計は不明のままです。
export const ai.ExecutionProgress.total: number | undefinedCONST ai.ExecutionProgress.message
Section titled “CONST ai.ExecutionProgress.message”最大500文字の任意の公開進捗テキストです。秘密情報や入力をそのまま含めないでください。
export const ai.ExecutionProgress.message: string | undefinedCONST ai.ExecutionContext.signal
Section titled “CONST ai.ExecutionContext.signal”協調的キャンセル用の中止シグナルです。キャンセルしても、完了済みの副作用はロールバックされません。
export const ai.ExecutionContext.signal: AbortSignalCONST ai.ExecutionContext.reportProgress
Section titled “CONST ai.ExecutionContext.reportProgress”この操作がアクティブな間、検証済みの進捗スナップショットを公開します。
export const ai.ExecutionContext.reportProgress: (progress: ExecutionProgress) => void使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { ExecutionContext } from '@alneas/appkit-core/ai/action';
export function report(context: ExecutionContext) { context.reportProgress({ completed: 1, total: 2 });}---
### `CONST` `ai.ExecutionRecord.id`
単調増加するメモリ内の実行IDです。このセッション内で再利用されることはありません。
```typescriptexport const ai.ExecutionRecord.id: numberCONST ai.ExecutionRecord.label
Section titled “CONST ai.ExecutionRecord.label”一時的な履歴に保存する、最大200文字の空白のみではない実行ラベルです。
export const ai.ExecutionRecord.label: stringCONST ai.ExecutionRecord.status
Section titled “CONST ai.ExecutionRecord.status”実行ライフサイクルの状態です。キャンセルは、ハンドラーの処理が確定するまで保留状態のままになる場合があります。
export const ai.ExecutionRecord.status: "cancelled" | "failed" | "running" | "cancelling" | "succeeded"CONST ai.ExecutionRecord.startedAt
Section titled “CONST ai.ExecutionRecord.startedAt”Unixエポックからのミリ秒数で表す実行開始タイムスタンプです。
export const ai.ExecutionRecord.startedAt: numberCONST ai.ExecutionRecord.finishedAt
Section titled “CONST ai.ExecutionRecord.finishedAt”Unixエポックからのミリ秒数で表す、任意の完了タイムスタンプです。
export const ai.ExecutionRecord.finishedAt: number | undefinedCONST ai.ExecutionRecord.cancelRequested
Section titled “CONST ai.ExecutionRecord.cancelRequested”最終的にハンドラーが成功した場合も含め、キャンセルが要求されたかどうかを示します。
export const ai.ExecutionRecord.cancelRequested: booleanCONST ai.ExecutionRecord.progress
Section titled “CONST ai.ExecutionRecord.progress”最後に受理された進捗スナップショットです。最初の有効な報告があるまでは存在しません。
export const ai.ExecutionRecord.progress: ExecutionProgress | undefinedFUNCTION ai.ExecutionSession.getSnapshot
Section titled “FUNCTION ai.ExecutionSession.getSnapshot”現在の安定した不変の実行履歴スナップショットを読み取ります。
getSnapshot(): readonly ExecutionRecord[];戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
readonly ExecutionRecord[] - Description: セッション状態が変わるまで同じ凍結済み配列です。初期状態では空です。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { ExecutionSession } from '@alneas/appkit-core/ai/action';
export async function example(session: ExecutionSession) { return session.getSnapshot();}---
### `FUNCTION` `ai.ExecutionSession.subscribe`
実行履歴の変更を購読します。
```typescriptsubscribe(listener: () => void): () => void;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
listener |
() => void |
必須 | - 引数なしの同期的通知コールバックです。戻り値は無視され、オブザーバーのエラーは捕捉されます。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
() => void - Description: 購読解除コールバックです。オブザーバーを破棄するときに呼び出してください。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { ExecutionSession } from '@alneas/appkit-core/ai/action';
export async function example(session: ExecutionSession) { return session.subscribe(() => console.log(session.getSnapshot()));}---
### `FUNCTION` `ai.ExecutionSession.run`
処理が確定するまで同時実行を防ぐロックを保持し、1つの操作を実行します。
```typescriptrun<T>(label: string, work: (context: ExecutionContext) => T | Promise<T>): Promise<ExecutionOutcome<T>>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
label |
string |
必須 | - 空白のみではない、最大 200 文字の公開ラベルです。 |
work |
(context: ExecutionContext) => T | Promise<T> |
必須 | - signal/進捗コンテキストを伴って 1 回呼び出され、T または T の Promise を返します。スローまたは拒否は、失敗/キャンセルの結果になります。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
Promise<ExecutionOutcome<T>> - Description: 操作の結果です。キャンセル後に処理が成功した場合でも succeeded になります。
例外 (Throws)
Section titled “例外 (Throws)”セッションがクローズ済みまたは使用中の場合、ラベルが無効な場合、または処理コールバックがない場合に拒否されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { ExecutionSession } from '@alneas/appkit-core/ai/action';
export async function example(session: ExecutionSession) { return session.run('Sum values', () => 1 + 2);}---
### `FUNCTION` `ai.ExecutionSession.cancel`
アクティブな操作の協調的キャンセルを要求します。
```typescriptcancel(): void;戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
void - Description: 戻り値はありません。アクティブな操作をキャンセル中としてマークし、その signal を中断します。ロックの解放や作用のロールバックは行いません。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { ExecutionSession } from '@alneas/appkit-core/ai/action';
export async function example(session: ExecutionSession) { return session.cancel();}---
### `FUNCTION` `ai.ExecutionSession.clearHistory`
アクティブな実行レコードを保持したまま、完了済みの履歴を消去します。
```typescriptclearHistory(): void;戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
void - Description: 戻り値はありません。ID を再利用せず、フィルター処理した履歴スナップショットを公開します。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { ExecutionSession } from '@alneas/appkit-core/ai/action';
export async function example(session: ExecutionSession) { return session.clearHistory();}---
### `FUNCTION` `ai.ExecutionSession.close`
新しい作業を禁止し、アクティブな作業のキャンセルを要求します。
```typescriptclose(): void;戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
void - Description: 戻り値はありません。以後の run 呼び出しは拒否されますが、アクティブな処理は成功または失敗が確定するまでロックを保持します。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { ExecutionSession } from '@alneas/appkit-core/ai/action';
export async function example(session: ExecutionSession) { return session.close();}---
### `CONST` `ai.RecordProposal.id`
このオブジェクトを、その所有元のアプリケーション/セッションと関連付けるための空でない識別子です。
```typescriptexport const ai.RecordProposal.id: stringCONST ai.RecordProposal.targetId
Section titled “CONST ai.RecordProposal.targetId”更新するレコードのアプリケーション上の識別子です。データベース検索は行われません。
export const ai.RecordProposal.targetId: stringCONST ai.RecordProposal.targetName
Section titled “CONST ai.RecordProposal.targetName”提案の検証時に保持される、任意のレコード表示名です。
export const ai.RecordProposal.targetName: string | undefinedCONST ai.RecordProposal.baseVersion
Section titled “CONST ai.RecordProposal.baseVersion”厳密な等価比較の基準となる、文字列または有限数のバージョンです。型変換は行われません。
export const ai.RecordProposal.baseVersion: string | numberCONST ai.RecordProposal.changes
Section titled “CONST ai.RecordProposal.changes”検証後の提案順に並ぶ、プリミティブ値の変更です。変更の集合は空ではなく、フィールドは重複しません。
export const ai.RecordProposal.changes: readonly FieldChange<TRecord, Extract<keyof TRecord, string>>[]CONST ai.RecordProposal.createdAt
Section titled “CONST ai.RecordProposal.createdAt”作成タイムスタンプのテキストです。未指定または文字列以外の場合は、検証時に現在のISOタイムスタンプが設定されます。
export const ai.RecordProposal.createdAt: stringCONST ai.RecordProposal.metadata
Section titled “CONST ai.RecordProposal.metadata”アプリケーションが所有する任意のメタデータです。開示の判断はホストが行います。
export const ai.RecordProposal.metadata: Readonly<Record<string, SupportedPrimitive>> | undefinedCONST ai.CandidateValidationResult.valid
Section titled “CONST ai.CandidateValidationResult.valid”検証に合格したかどうかを示します。falseの場合は、診断の詳細をerrorsで確認してください。
export const ai.CandidateValidationResult.valid: booleanCONST ai.CandidateValidationResult.errors
Section titled “CONST ai.CandidateValidationResult.errors”レコード全体のバリデーターが提供する、フィールドをキーとした任意のエラーメッセージです。
export const ai.CandidateValidationResult.errors: Readonly<Record<string, string>> | undefinedCONST ai.ApplyProposalPayload.proposalId
Section titled “CONST ai.ApplyProposalPayload.proposalId”ペイロードまたは事前チェックの問題を関連付けるための提案識別子です。
export const ai.ApplyProposalPayload.proposalId: stringCONST ai.ApplyProposalPayload.targetId
Section titled “CONST ai.ApplyProposalPayload.targetId”更新するレコードのアプリケーション上の識別子です。データベース検索は行われません。
export const ai.ApplyProposalPayload.targetId: stringCONST ai.ApplyProposalPayload.baseVersion
Section titled “CONST ai.ApplyProposalPayload.baseVersion”厳密な等価比較の基準となる、文字列または有限数のバージョンです。型変換は行われません。
export const ai.ApplyProposalPayload.baseVersion: string | numberCONST ai.ApplyProposalPayload.acceptedFields
Section titled “CONST ai.ApplyProposalPayload.acceptedFields”提案順に並ぶ承認済みフィールド名です。配列は凍結されています。
export const ai.ApplyProposalPayload.acceptedFields: readonly Extract<keyof TRecord, string>[]CONST ai.ApplyProposalPayload.acceptedChanges
Section titled “CONST ai.ApplyProposalPayload.acceptedChanges”提案順に並ぶ承認済みフィールド変更オブジェクトです。配列は凍結されています。
export const ai.ApplyProposalPayload.acceptedChanges: readonly FieldChange<TRecord, Extract<keyof TRecord, string>>[]CONST ai.ApplyProposalPayload.candidateRecord
Section titled “CONST ai.ApplyProposalPayload.candidateRecord”承認済みのフィールド変更を適用した、元データの浅いコピーです。永続化はホストが担います。
export const ai.ApplyProposalPayload.candidateRecord: Readonly<TRecord>CONST ai.ProposalValidationError.path
Section titled “CONST ai.ProposalValidationError.path”検証診断に関連するフィールド/入力パスです。
export const ai.ProposalValidationError.path: stringCONST ai.ProposalValidationError.message
Section titled “CONST ai.ProposalValidationError.message”拒否された提案のフィールドまたは値を説明する診断テキストです。
export const ai.ProposalValidationError.message: stringCONST ai.ValidateProposalOptions.fields
Section titled “CONST ai.ValidateProposalOptions.fields”変更を許可するフィールドの定義マップです(必須)。 未登録のフィールドは変更不可として拒否されます。
export const ai.ValidateProposalOptions.fields: { readonly [K in FieldKey<TRecord>]?: FieldTypeValidator<TRecord[K] & SupportedPrimitive> | undefined; }CONST ai.ProposalBatchItem.proposal
Section titled “CONST ai.ProposalBatchItem.proposal”レビュー対象となる、検証済みで不変のフィールド変更提案です。
export const ai.ProposalBatchItem.proposal: RecordProposal<TRecord>CONST ai.ProposalBatchItem.currentRecord
Section titled “CONST ai.ProposalBatchItem.currentRecord”候補の構成と変更前の値のチェックに使用する、アプリケーション所有の最新の元レコードです。
export const ai.ProposalBatchItem.currentRecord: TRecordCONST ai.ProposalBatchItem.currentVersion
Section titled “CONST ai.ProposalBatchItem.currentVersion”提案のベースバージョンと厳密に比較する、ホストレコードの現在のバージョンです。
export const ai.ProposalBatchItem.currentVersion: string | numberCONST ai.ProposalBatchEntry.selected
Section titled “CONST ai.ProposalBatchEntry.selected”このエントリーを一括事前チェックの対象にするかどうかを示します。除外されたエントリーは、提案IDの重複を除き、事前チェックを妨げません。
export const ai.ProposalBatchEntry.selected: booleanCONST ai.ProposalBatchEntry.decisions
Section titled “CONST ai.ProposalBatchEntry.decisions”フィールドごとの承認/拒否/保留の選択です。判断が未指定の場合は保留になります。
export const ai.ProposalBatchEntry.decisions: Readonly<Partial<Record<Extract<keyof TRecord, string>, import("./types").FieldDecision>>>CONST ai.ProposalBatchIssue.proposalId
Section titled “CONST ai.ProposalBatchIssue.proposalId”ペイロードまたは事前チェックの問題を関連付けるための提案識別子です。
export const ai.ProposalBatchIssue.proposalId: stringCONST ai.ProposalBatchIssue.code
Section titled “CONST ai.ProposalBatchIssue.code”表示テキストを調べずにプログラムで処理するための失敗カテゴリです。
export const ai.ProposalBatchIssue.code: "pending" | "duplicate_proposal" | "duplicate_target" | "no_changes" | "conflict" | "invalid_candidate"CONST ai.PreparedProposalBatch.canApply
Section titled “CONST ai.PreparedProposalBatch.canApply”少なくとも1つのエントリーが選択され、必須の事前チェックがすべて合格した場合にtrueになります。
export const ai.PreparedProposalBatch.canApply: booleanCONST ai.PreparedProposalBatch.selectedCount
Section titled “CONST ai.PreparedProposalBatch.selectedCount”事前チェックで問題のあるものも含めた、選択済みエントリーの数です。
export const ai.PreparedProposalBatch.selectedCount: numberCONST ai.PreparedProposalBatch.issues
Section titled “CONST ai.PreparedProposalBatch.issues”レコード単位の事前チェックの失敗です。失敗が見つからなかった場合は空です。
export const ai.PreparedProposalBatch.issues: readonly ProposalBatchIssue[]CONST ai.PreparedProposalBatch.payloads
Section titled “CONST ai.PreparedProposalBatch.payloads”浅い不変性を持つ適用用ペイロードです。事前チェックの問題が1つでもある場合は空です。
export const ai.PreparedProposalBatch.payloads: readonly ApplyProposalPayload<TRecord>[]CONST ai.GenerativeUIBlock.id
Section titled “CONST ai.GenerativeUIBlock.id”このドキュメント内で一意のブロック識別子です。空白のみではなく、最大128文字です。
export const ai.GenerativeUIBlock.id: stringCONST ai.GenerativeUIBlock.type
Section titled “CONST ai.GenerativeUIBlock.type”明示的に登録されたコンポーネント名です。先頭はASCII英字で、その後に最大63文字の英字/数字/アンダースコア/ドット/ハイフンを指定できます。
export const ai.GenerativeUIBlock.type: stringCONST ai.GenerativeUIBlock.data
Section titled “CONST ai.GenerativeUIBlock.data”成功バリアントに含まれる、検証済みまたは射影済みの結果データです。
export const ai.GenerativeUIBlock.data: GenerativeUIObjectCONST ai.GenerativeUIDocument.version
Section titled “CONST ai.GenerativeUIDocument.version”UIドキュメントのエンベロープバージョンです。リテラル値1のみをサポートします。
export const ai.GenerativeUIDocument.version: 1CONST ai.GenerativeUIDocument.id
Section titled “CONST ai.GenerativeUIDocument.id”最大128文字の、空白のみではないドキュメント識別子です。
export const ai.GenerativeUIDocument.id: stringCONST ai.GenerativeUIDocument.blocks
Section titled “CONST ai.GenerativeUIDocument.blocks”最大32個のフラットなUIブロックです。IDは一意で空白のみではない必要があります。実行可能なレイアウトは受け付けません。
export const ai.GenerativeUIDocument.blocks: readonly GenerativeUIBlock[]CONST ai.GenerativeUIComponentSchema.type
Section titled “CONST ai.GenerativeUIComponentSchema.type”明示的に登録されたコンポーネント名です。先頭はASCII英字で、その後に最大63文字の英字/数字/アンダースコア/ドット/ハイフンを指定できます。
export const ai.GenerativeUIComponentSchema.type: stringCONST ai.GenerativeUIComponentSchema.dataSchema
Section titled “CONST ai.GenerativeUIComponentSchema.dataSchema”ルートがオブジェクトである、インラインの同期的なdraft-07スキーマです。参照/方言のキーは拒否されます。
export const ai.GenerativeUIComponentSchema.dataSchema: GenerativeUIObjectCONST ai.GenerativeUIContract.schema
Section titled “CONST ai.GenerativeUIContract.schema”合成され、凍結されたレスポンススキーマです。実行時検証では、IDの一意性とJSONが制限内に収まることも確認します。
export const ai.GenerativeUIContract.schema: GenerativeUIObjectCONST ai.GenerativeUIContract.components
Section titled “CONST ai.GenerativeUIContract.components”この契約の合成に使用した、凍結済みのコンポーネントスキーマ登録情報です。
export const ai.GenerativeUIContract.components: readonly GenerativeUIComponentSchema[]FUNCTION ai.GenerativeUIContract.validate
Section titled “FUNCTION ai.GenerativeUIContract.validate”スキーマだけでは表現できないエンベロープの制限とブロックIDの一意性も強制します。
validate(input: unknown): GenerativeUIDocumentResult;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
input |
unknown |
必須 | - エンベロープの制限と登録済みスキーマに照らして検証する、完全に組み立てられた信頼できないドキュメントです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
GenerativeUIDocumentResult - Description: 凍結済みの有効なドキュメントスナップショット、または INVALID_DOCUMENT の結果です。エンベロープの検証失敗はデータとして返されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { GenerativeUIContract } from '@alneas/appkit-core/ai/generative-ui';
export async function example(contract: GenerativeUIContract) { return contract.validate({ version: 1, id: 'response-1', blocks: [] });}---
### `FUNCTION` `ai.GenerativeUIContract.validateData`
未登録の型、または無効もしくは制限を超えるJSONデータに対してfalseを返します。
```typescriptvalidateData(type: string, input: unknown): boolean;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
type |
string |
必須 | - 検索する明示的なコンポーネント型です。 |
input |
unknown |
必須 | - 変更せずにスナップショットを作成して検証する、信頼できないコンポーネントデータです。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
boolean - Description: 不明な型、この境界での無効なスキーマ/データ、または JSON スナップショットの制約違反の場合は false です。一致するデータの場合は true です。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { GenerativeUIContract } from '@alneas/appkit-core/ai/generative-ui';
export async function example(contract: GenerativeUIContract) { return contract.validateData('summary', { text: 'hello' });}---
### `CONST` `ai.AIChatMessage.id`
このオブジェクトを、その所有元のアプリケーション/セッションと関連付けるための空でない識別子です。
```typescriptexport const ai.AIChatMessage.id: stringCONST ai.AIChatMessage.role
Section titled “CONST ai.AIChatMessage.role”会話のロールです。toolロールのメッセージには、ツール結果のパートのみを含めることができます。
export const ai.AIChatMessage.role: "tool" | "system" | "user" | "assistant"CONST ai.AIChatMessage.parts
Section titled “CONST ai.AIChatMessage.parts”このメッセージの、順序付けられた不変のテキスト/ファイル/ツール/データのパートです。
export const ai.AIChatMessage.parts: readonly AIChatPart[]CONST ai.AIChatMessage.metadata
Section titled “CONST ai.AIChatMessage.metadata”アプリケーションが所有する任意のメタデータです。開示の判断はホストが行います。
export const ai.AIChatMessage.metadata: ActionToolValue | undefinedCONST ai.AIChatRequest.messages
Section titled “CONST ai.AIChatRequest.messages”アプリケーションの会話履歴です。スナップショットは切り詰めずに順序を保持します。
export const ai.AIChatRequest.messages: readonly AIChatMessage[]CONST ai.AIChatRequest.tools
Section titled “CONST ai.AIChatRequest.tools”エンドポイントに送信する、明示的に開示された任意の公開ツール記述子です。ハンドラーはシリアライズされません。
export const ai.AIChatRequest.tools: readonly ActionToolDescriptor[] | undefinedCONST ai.AIChatRequest.parameters
Section titled “CONST ai.AIChatRequest.parameters”ホストが所有する任意のプロバイダーパラメーターです。モデル出力を設定として信頼しないでください。
export const ai.AIChatRequest.parameters: ActionToolObject | undefinedCONST ai.AIChatRequest.conversationId
Section titled “CONST ai.AIChatRequest.conversationId”トランスポートがサポートしている場合に転送される、任意のアプリケーション会話識別子です。
export const ai.AIChatRequest.conversationId: string | undefinedCONST ai.AIChatRequest.trigger
Section titled “CONST ai.AIChatRequest.trigger”AI SDKエンドポイントのトリガーです。リクエストで省略された場合はsubmit-messageになります。
export const ai.AIChatRequest.trigger: "submit-message" | "regenerate-message" | undefinedCONST ai.AIChatRequest.messageId
Section titled “CONST ai.AIChatRequest.messageId”任意のメッセージ識別子です。AI SDKアダプターでは、デフォルトで最後のメッセージIDを使用します。
export const ai.AIChatRequest.messageId: string | undefinedCONST ai.AIChatRequest.signal
Section titled “CONST ai.AIChatRequest.signal”協調的キャンセル用の中止シグナルです。キャンセルしても、完了済みの副作用はロールバックされません。
export const ai.AIChatRequest.signal: AbortSignal | undefinedCONST ai.AIChatCapabilities.tools
Section titled “CONST ai.AIChatCapabilities.tools”トランスポートがツールの説明/呼び出し/結果を伝送するかどうかを示します。ツールの認可や実行は行いません。
export const ai.AIChatCapabilities.tools: booleanCONST ai.AIChatCapabilities.structuredData
Section titled “CONST ai.AIChatCapabilities.structuredData”トランスポートが構造化データイベントを伝送できるかどうかを示します。すべてのモデルでの対応を保証するものではありません。
export const ai.AIChatCapabilities.structuredData: booleanCONST ai.AIChatCapabilities.files
Section titled “CONST ai.AIChatCapabilities.files”トランスポートがファイルを表現できるかどうかを示します。プロバイダー/アップロードの要件は引き続き適用されます。
export const ai.AIChatCapabilities.files: booleanCONST ai.AIChatAdapter.id
Section titled “CONST ai.AIChatAdapter.id”ai-sdk-ui-streamなどの、安定したアダプター実装識別子です。
export const ai.AIChatAdapter.id: stringCONST ai.AIChatAdapter.capabilities
Section titled “CONST ai.AIChatAdapter.capabilities”トランスポートレベルの機能フラグです。上流モデルの対応機能の選択は、引き続きホストが行います。
export const ai.AIChatAdapter.capabilities: AIChatCapabilitiesFUNCTION ai.AIChatAdapter.stream
Section titled “FUNCTION ai.AIChatAdapter.stream”中止時またはイテレーターの早期return時には、ネットワークリソースを解放する必要があります。ツールの自動実行/再試行は行いません。
stream(request: AIChatRequest): AsyncIterable<AIChatEvent>;引数 (Parameters)
Section titled “引数 (Parameters)”| 引数 | 型 | 必須 | 説明 |
|---|---|---|---|
request |
AIChatRequest |
必須 | - ホストが管理するメッセージ/ツール/パラメーターと、省略可能な signal です。アダプターは中断時や早期リターン時に I/O を解放する必要があります。 |
戻り値 (Returns)
Section titled “戻り値 (Returns)”- Type:
AsyncIterable<AIChatEvent> - Description: 明示的な終了を含む、正規化されたイベントの非同期イテラブルです。トランスポートはツールの実行や再試行を行いません。
例外 (Throws)
Section titled “例外 (Throws)”反復処理では、トランスポート、解析、検証、キャンセルの失敗が伝播します。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { AIChatAdapter } from '@alneas/appkit-core/ai/ai-chat';
export async function example(adapter: AIChatAdapter) { return adapter.stream({ messages: [{ id: 'message-1', role: 'user', parts: [{ type: 'text', text: 'hello' }] }] });}---
### `CONST` `ai.AIChatHTTPOptions.api`
アプリケーションが選択するHTTPエンドポイント/プロキシURLです。認証情報とアクセスポリシーは引き続きホストが管理します。
```typescriptexport const ai.AIChatHTTPOptions.api: stringCONST ai.AIChatHTTPOptions.headers
Section titled “CONST ai.AIChatHTTPOptions.headers”アダプター構築時にスナップショットが作成される、任意のリクエストヘッダーです。
export const ai.AIChatHTTPOptions.headers: Readonly<Record<string, string>> | undefinedCONST ai.AIChatHTTPOptions.fetch
Section titled “CONST ai.AIChatHTTPOptions.fetch”任意のホストHTTP実装です。省略するとglobalThis.fetchを使用します。
export const ai.AIChatHTTPOptions.fetch: ((input: RequestInfo | URL, init?: RequestInit) => Promise<Response>) | undefined補足 (Remarks)
Section titled “補足 (Remarks)”省略すると globalThis.fetch を使用します。ホストの実装が I/O を管理し、AbortSignal に従うことが推奨されます。
使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { AIChatHTTPOptions } from '@alneas/appkit-core/ai/ai-chat';
export function endpoint(api: string, fetch: NonNullable<AIChatHTTPOptions['fetch']>) { return { api, fetch } satisfies AIChatHTTPOptions;}---
### `CONST` `ai.AIChatHTTPOptions.maxResponseChars`
デコード後の文字数によるストリームサイズの上限です。デフォルトは1,000,000、最大は10,000,000です。
```typescriptexport const ai.AIChatHTTPOptions.maxResponseChars: number | undefinedCONST ai.OpenAICompatibleChatOptions.model
Section titled “CONST ai.OpenAICompatibleChatOptions.model”設定済みエンドポイント用にホストが選択する、空白のみではないモデル識別子です。
export const ai.OpenAICompatibleChatOptions.model: stringCONST ai.OpenAICompatibleChatOptions.uploadFile
Section titled “CONST ai.OpenAICompatibleChatOptions.uploadFile”明示的なアプリケーションのファイルアップロード連携です。画像はimage_urlとして直接送信されます。
export const ai.OpenAICompatibleChatOptions.uploadFile: ((file: Extract<AIChatPart, { type: "file"; }>, signal?: AbortSignal) => Promise<{ id: string; type: string; }>) | undefined使用例 (Example)
Section titled “使用例 (Example)”```typescriptimport type { OpenAICompatibleChatOptions } from '@alneas/appkit-core/ai/ai-chat';
export function withUpload(uploadFile: NonNullable<OpenAICompatibleChatOptions['uploadFile']>) { return uploadFile; // Supply the host actual file integration, including cleanup policy.}---
### `CONST` `ai.OpenAICompatibleChatOptions.acceptAISDKStream`
AI SDK UI Message Streamsで応答する従来のエンドポイントを維持します。デフォルトはfalseです。
```typescriptexport const ai.OpenAICompatibleChatOptions.acceptAISDKStream: boolean | undefinedCONST ai.AIChatStreamOptions.maxResponseChars
Section titled “CONST ai.AIChatStreamOptions.maxResponseChars”シリアライズされた正規化済みイベントの合計文字数です。バイト数ではありません。デフォルトは1,000,000、最大は10,000,000です。
export const ai.AIChatStreamOptions.maxResponseChars: number | undefinedCONST ai.AgentMessageEvent.type
Section titled “CONST ai.AgentMessageEvent.type”item.completedバリアントを選択する判別子です。
export const ai.AgentMessageEvent.type: "item.completed"CONST ai.AgentMessageEvent.item
Section titled “CONST ai.AgentMessageEvent.item”任意の完了イベントペイロードです。textが文字列であるagent_message項目のみが抽出されます。
export const ai.AgentMessageEvent.item: { readonly type?: string; readonly text?: unknown; } | undefinedCONST ai.AjvValidatorOptions.draft
Section titled “CONST ai.AjvValidatorOptions.draft”$schemaが指定されていない場合のドラフトです。デフォルトはdraft-07です。明示的に指定した場合、異なる$schema宣言は拒否されます。
export const ai.AjvValidatorOptions.draft: "draft-07" | "2020-12" | undefinedCONST ai.AjvValidatorOptions.ajvOptions
Section titled “CONST ai.AjvValidatorOptions.ajvOptions”Ajvの設定オプションです。
export const ai.AjvValidatorOptions.ajvOptions: Record<string, any> | undefinedCONST ai.AjvValidatorOptions.locale
Section titled “CONST ai.AjvValidatorOptions.locale”言語設定です。省略するとAjvのデフォルトメッセージを使用します。
export const ai.AjvValidatorOptions.locale: "ja" | "en" | undefinedCONST us.USCalendarDate.year
Section titled “CONST us.USCalendarDate.year”グレゴリオ暦の年です。カレンダープロバイダーにより2021~2099に制限されます。
export const us.USCalendarDate.year: numberCONST us.USCalendarDate.month
Section titled “CONST us.USCalendarDate.month”0始まりの月です。1月が0、12月が11です。
export const us.USCalendarDate.month: numberCONST us.USCalendarDate.day
Section titled “CONST us.USCalendarDate.day”選択した月内の有効な日です。1から始まります。
export const us.USCalendarDate.day: numberCONST us.USFederalHoliday.name
Section titled “CONST us.USFederalHoliday.name”連邦の祝日またはホストが指定した休業日の表示名です。
export const us.USFederalHoliday.name: stringCONST us.USFederalHoliday.date
Section titled “CONST us.USFederalHoliday.date”要求されたカレンダーモードで選択された日付です。要求された年に含まれます。
export const us.USFederalHoliday.date: stringCONST us.USFederalHoliday.actualDate
Section titled “CONST us.USFederalHoliday.actualDate”法定の祝日の日付です。振替日モードでは翌年に属する場合があります。
export const us.USFederalHoliday.actualDate: stringCONST us.USHolidayAddition.name
Section titled “CONST us.USHolidayAddition.name”この明示的な休業日に必須の、空白のみではない表示名です。
export const us.USHolidayAddition.name: stringCONST us.USHolidayAddition.date
Section titled “CONST us.USHolidayAddition.date”2021~2099の厳密なYYYY-MM-DD形式の休業日です。振替日の調整は適用しません。
export const us.USHolidayAddition.date: stringCONST us.USFederalHolidayOptions.observed
Section titled “CONST us.USFederalHolidayOptions.observed”true(デフォルト)の場合、月曜日~金曜日の稼働に合わせた標準的な祝日の振替調整を適用します。falseの場合は法定の日付を使用します。
export const us.USFederalHolidayOptions.observed: boolean | undefinedCONST us.USFederalHolidayOptions.additionalHolidays
Section titled “CONST us.USFederalHolidayOptions.additionalHolidays”臨時の告知や会社の休日など、追加のYYYY-MM-DD形式の休業日です。
export const us.USFederalHolidayOptions.additionalHolidays: readonly USHolidayAddition[] | undefinedCONST us.USFederalHolidayOptions.excludedDates
Section titled “CONST us.USFederalHolidayOptions.excludedDates”削除対象として選択したYYYY-MM-DD形式の日付です。実際の祝日の日付ではなく、振替日も対象に含まれます。
export const us.USFederalHolidayOptions.excludedDates: readonly string[] | undefined