sqlite-web 0.7.2
gitea.db
package_version
Create
Query
access
access_token
action
action_artifact
action_run
action_run_index
action_run_job
action_runner
action_runner_token
action_schedule
action_schedule_spec
action_task
action_task_output
action_task_step
action_tasks_version
action_variable
app_state
attachment
auth_token
badge
branch
collaboration
comment
commit_status
commit_status_index
commit_status_summary
commit_sync_log
commit_sync_status
dbfs_data
dbfs_meta
deploy_key
email_address
email_hash
external_login_user
follow
gpg_key
gpg_key_import
hook_task
issue
issue_assignees
issue_content_history
issue_dependency
issue_index
issue_label
issue_pin
issue_user
issue_watch
label
language_stat
lfs_lock
lfs_meta_object
login_source
milestone
mirror
notice
notification
oauth2_application
oauth2_authorization_code
oauth2_grant
org_user
package
package_blob
package_blob_upload
package_cleanup_rule
package_file
package_property
package_version
project
project_board
project_issue
protected_branch
protected_tag
public_key
pull_auto_merge
pull_request
push_mirror
reaction
release
renamed_branch
repo_archiver
repo_hidden_file
repo_indexer_status
repo_license
repo_redirect
repo_topic
repo_transfer
repo_unit
repository
review
review_state
secret
session
sqlite_sequence
star
stopwatch
system_setting
task
team
team_invite
team_repo
team_unit
team_user
topic
tracked_time
two_factor
upload
user
user_badge
user_blocking
user_open_id
user_redirect
user_setting
version
watch
webauthn_credential
webhook
Toggle helper tables
Structure
Content
Query
Insert
Drop
Import
Export
Delete row 33 from package_version
id
33
package_id
8
creator_id
5
version
1.0.0-rc.7
lower_version
1.0.0-rc.7
created_unix
1791622747
is_internal
0
metadata_json
{"scope":"@juhai","name":&
{"scope":"@juhai","name":"client-audit","description":"审计接收远程客户端:把内核 AuditSinkPort 实现为对基础设施 audit-append.v1(POST /v1/audit/events,批量)的调用;同步模式审计失败即写链失败,缓冲模式本地缓冲 + 稳定 event_id 至少一次投递(基础设施开发设计方案 §9 client-*;开发计划 §3A CL-6;能力表 C10.02)","license":"UNLICENSED","development_dependencies":{"@juhai/kernel":"0.24.0","@types/node":"22.19.20","typescript":"5.9.3","vitest":"2.1.9"},"peer_dependencies":{"@juhai/kernel":"0.24.0"},"readme":"# @juhai/client-audit\n\n内核 `AuditSinkPort`(`@juhai/kernel@0.24.0`,peer exact)的远程实现:调用基础设施 M6 契约\n`audit-append.v1`(`POST \u003cbaseUrl\u003e/v1/audit/events`,批量)。设计:基础设施开发设计方案 §9 / §8 M6;能力表 C10.02;工作项:开发计划 §3A CL-6。\n契约 OpenAPI 随 CHG-004 登记,本包先内联映射(开发计划 §6 偏差 #17);线上事件字段与 M6 `audit-event-preflight` 的 `AuditEventCandidate` 同名(snake_case)。\n\n```ts\nimport { createRemoteAuditSinkPort } from \"@juhai/client-audit\";\n\n// 同步(缺省):审计失败即写链失败(内核 fail-closed 语义)\nconst audit = createRemoteAuditSinkPort({ baseUrl: \"https://platform.example/api\", clientId: \"hr-api\", token: () =\u003e serviceToken() });\n\n// 缓冲:append 在记录进入宿主持久缓冲后返回;宿主把缓冲与业务事务绑定(C10.02 appendLocal),relay 至少一次投递\nconst buffered = createRemoteAuditSinkPort({ baseUrl, clientId, token, delivery: \"buffered\", buffer: outboxBackedBuffer, flushIntervalMs: 1000 });\nregistry.replace({ ...registry.current(), audit });\n```\n\n| 情形 | 行为 |\n|---|---|\n| 未配置(无 `baseUrl` / `clientId`) | 返回内核 fail-closed 端口对象本身(`isFailClosedPort` 为真) |\n| 内核 `auditRecordSchema` 不通过 | 抛 `RemoteAuditError` `INVALID_REQUEST`,不打远端 |\n| 无租户上下文 | `NO_TENANT_CONTEXT`,不打远端 |\n| `details` 含 `password` / `secret` / `token` / `authorization` / `content`(大小写不敏感) | `SENSITIVE_DETAIL_FORBIDDEN`,不打远端(敏感值永不出网;与 M6 preflight 同集合) |\n| 同步:网络错误 / 超时(缺省 3 s)/ 5xx | `REMOTE_UNAVAILABLE`(写链回滚) |\n| 同步:401 / 403 / 409 / 其它 4xx | `REMOTE_REJECTED` |\n| 同步:200 但不是响���形状,或缺本批回执 | `INVALID_RESPONSE` |\n| 同步:服务端逐条拒绝(preflight / planner reasons) | `EVENT_REJECTED`,`reasons` = `\u003cevent_id\u003e:\u003creason\u003e` |\n| 缓冲:缓冲满 / 宿主 enqueue 失败 | `BUFFER_FULL`(背压,永不丢弃) |\n| 缓冲:没有显式注入持久缓冲 | 装配时报 `AUDIT_DURABLE_BUFFER_REQUIRED`;进程内存队列不能作为业务写入的持久回执 |\n| 缓冲:`flush()` 失败 | 抛同上错误,缓冲保留;下次 flush 以同 `event_id` + `digest` 重试(M6 按 ID + digest 去重) |\n| `close()` 后 | `CLOSED` |\n\n所有错误都是 `RemoteAuditError`:`code = AUDIT_APPEND_FAILED`、`port = \"audit\"`、`operation = \"append\"`、`reasonCode` 稳定,装配点按 reasonCode 映射(本地即拒 → 400,其余 → 503)。\n\n映射约定:`event_id = audit_evt_\u003csha256 前 32 hex\u003e`,`digest = sha256`,二者只由记录内容(租户、主体、请求、动作、资源、结果、生效时间、details、causation)决定,\n重试携带同值;`trace_id` 无合法 traceId 时生成、`recorded_at = now()` 且不早于 `effective_at`(M6 `AUDIT_TIME_INVALID`),二者不参与摘要;\n`reason` 缺省取 `details.reason`,否则 `kernel:\u003coutcome\u003e`,可用 `reason` 回调覆盖;每批 `Idempotency-Key = audit-batch:\u003csha256(事件 id 集)\u003e`。\n\n端口一致性:`runtime/test/port/client-audit.test.ts` 用 S-6 共用夹具对 stub server(真实落点 / 逐条拒绝 / 不可用 / 不可达)跑本包同步与缓冲两种投递。\n","repository":{"type":"git","url":"git@gitea.g-hi.com:luoanwu/enterprise-platform.git"}}
...
download_count
3
Delete
Cancel