@h-ai/audit 1.0.0-beta.17 → 1.0.0-beta.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.en.md CHANGED
@@ -54,7 +54,13 @@ await audit.log({
54
54
 
55
55
  // 4. 使用便捷方法
56
56
  await audit.helper.login('user_1', '127.0.0.1')
57
- await audit.helper.crud({ userId: 'user_1', action: 'create', resource: 'users', resourceId: 'user_2', details: { name: '张三' } })
57
+ await audit.helper.crud({
58
+ userId: 'user_1',
59
+ action: 'create',
60
+ resource: 'users',
61
+ resourceId: 'user_2',
62
+ details: { name: '张三' }
63
+ })
58
64
 
59
65
  // 5. 查询日志
60
66
  const logs = await audit.list({ pageSize: 20, action: 'login' })
@@ -165,7 +171,10 @@ Version1 contains a header, `{type:'entry',record}` lines and a footer. Entries
165
171
  ```ts
166
172
  const plan = audit.schedulerPlan
167
173
  if (plan) {
168
- const initialized = await scheduler.init({ ...schedulerSettings, ...plan })
174
+ const initialized = await scheduler.init({
175
+ ...schedulerSettings,
176
+ ...plan
177
+ })
169
178
  if (!initialized.success)
170
179
  throw new Error(initialized.error.message)
171
180
  const started = scheduler.start()
package/README.ja.md CHANGED
@@ -54,7 +54,13 @@ await audit.log({
54
54
 
55
55
  // 4. 使用便捷方法
56
56
  await audit.helper.login('user_1', '127.0.0.1')
57
- await audit.helper.crud({ userId: 'user_1', action: 'create', resource: 'users', resourceId: 'user_2', details: { name: '张三' } })
57
+ await audit.helper.crud({
58
+ userId: 'user_1',
59
+ action: 'create',
60
+ resource: 'users',
61
+ resourceId: 'user_2',
62
+ details: { name: '张三' }
63
+ })
58
64
 
59
65
  // 5. 查询日志
60
66
  const logs = await audit.list({ pageSize: 20, action: 'login' })
@@ -165,7 +171,10 @@ backup.schedule は enabled、5項目 cron(既定 `0 2 * * *`)、IANA timezo
165
171
  ```ts
166
172
  const plan = audit.schedulerPlan
167
173
  if (plan) {
168
- const initialized = await scheduler.init({ ...schedulerSettings, ...plan })
174
+ const initialized = await scheduler.init({
175
+ ...schedulerSettings,
176
+ ...plan
177
+ })
169
178
  if (!initialized.success)
170
179
  throw new Error(initialized.error.message)
171
180
  const started = scheduler.start()
package/README.md CHANGED
@@ -54,7 +54,13 @@ await audit.log({
54
54
 
55
55
  // 4. 使用便捷方法
56
56
  await audit.helper.login('user_1', '127.0.0.1')
57
- await audit.helper.crud({ userId: 'user_1', action: 'create', resource: 'users', resourceId: 'user_2', details: { name: '张三' } })
57
+ await audit.helper.crud({
58
+ userId: 'user_1',
59
+ action: 'create',
60
+ resource: 'users',
61
+ resourceId: 'user_2',
62
+ details: { name: '张三' }
63
+ })
58
64
 
59
65
  // 5. 查询日志
60
66
  const logs = await audit.list({ pageSize: 20, action: 'login' })
@@ -165,7 +171,10 @@ await audit.init({
165
171
  ```ts
166
172
  const plan = audit.schedulerPlan
167
173
  if (plan) {
168
- const initialized = await scheduler.init({ ...schedulerSettings, ...plan })
174
+ const initialized = await scheduler.init({
175
+ ...schedulerSettings,
176
+ ...plan
177
+ })
169
178
  if (!initialized.success)
170
179
  throw new Error(initialized.error.message)
171
180
  const started = scheduler.start()
package/dist/index.d.ts CHANGED
@@ -645,4 +645,5 @@ declare function migrateAudit(options?: {
645
645
  dryRun?: boolean;
646
646
  }): Promise<HaiResult<_h_ai_reldb.SchemaMigrationPlan>>;
647
647
 
648
- export { AUDIT_BACKUP_PREFIX, type AuditActorSnapshot, type AuditAlertReport, type AuditBackupInfo, type AuditBackupOperations, type AuditBackupOptions, type AuditContext, type AuditEventFields, type AuditFunctions, type AuditHelper, type AuditInitConfig, type AuditInitConfigInput, AuditInitConfigSchema, type AuditLog, type AuditLogWithUser, type AuditStatItem, type CreateAuditLogInput, type CrudAuditInput, HaiAuditError, type ListAuditLogsOptions, audit, migrateAudit };
648
+ export { AUDIT_BACKUP_PREFIX, AuditInitConfigSchema, HaiAuditError, audit, migrateAudit };
649
+ export type { AuditActorSnapshot, AuditAlertReport, AuditBackupInfo, AuditBackupOperations, AuditBackupOptions, AuditContext, AuditEventFields, AuditFunctions, AuditHelper, AuditInitConfig, AuditInitConfigInput, AuditLog, AuditLogWithUser, AuditStatItem, CreateAuditLogInput, CrudAuditInput, ListAuditLogsOptions };