@tstdl/base 0.93.2 → 0.93.4
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/ai/ai.service.d.ts +2 -1
- package/ai/ai.service.js +11 -3
- package/ai/types.d.ts +3 -1
- package/api/server/api-request-token.provider.d.ts +5 -3
- package/api/server/api-request-token.provider.js +12 -4
- package/api/server/gateway.d.ts +1 -9
- package/api/server/gateway.js +67 -36
- package/api/types.d.ts +5 -1
- package/application/application.d.ts +2 -0
- package/application/application.js +3 -1
- package/application/providers.d.ts +1 -1
- package/application/providers.js +1 -1
- package/audit/audit.model.d.ts +14 -9
- package/audit/audit.model.js +36 -27
- package/audit/auditor.d.ts +32 -23
- package/audit/auditor.js +84 -21
- package/audit/drizzle/{0000_tiny_the_captain.sql → 0000_bored_stick.sql} +5 -4
- package/audit/drizzle/meta/0000_snapshot.json +22 -15
- package/audit/drizzle/meta/_journal.json +2 -2
- package/audit/index.d.ts +3 -1
- package/audit/index.js +3 -1
- package/audit/module.d.ts +1 -1
- package/audit/module.js +1 -2
- package/audit/schemas.d.ts +2 -2
- package/audit/schemas.js +1 -1
- package/audit/types.d.ts +2 -1
- package/audit/types.js +2 -1
- package/authentication/models/authentication-credentials.model.js +1 -2
- package/authentication/models/authentication-session.model.d.ts +2 -2
- package/authentication/models/authentication-session.model.js +3 -5
- package/authentication/server/authentication-api-request-token.provider.d.ts +2 -2
- package/authentication/server/authentication-api-request-token.provider.js +8 -5
- package/authentication/server/authentication.api-controller.d.ts +8 -8
- package/authentication/server/authentication.api-controller.js +16 -16
- package/authentication/server/authentication.audit.d.ts +34 -0
- package/authentication/server/authentication.audit.js +1 -0
- package/authentication/server/authentication.service.d.ts +19 -10
- package/authentication/server/authentication.service.js +158 -43
- package/authentication/server/module.d.ts +1 -1
- package/authentication/server/schemas.d.ts +2 -3
- package/authentication/server/schemas.js +2 -3
- package/constants.d.ts +1 -0
- package/constants.js +1 -0
- package/document-management/api/document-management.api.d.ts +74 -74
- package/document-management/models/document-assignment-scope.model.d.ts +1 -2
- package/document-management/models/document-assignment-scope.model.js +4 -6
- package/document-management/models/document-assignment-task.model.d.ts +1 -2
- package/document-management/models/document-assignment-task.model.js +3 -5
- package/document-management/models/document-category.model.d.ts +1 -2
- package/document-management/models/document-category.model.js +3 -4
- package/document-management/models/document-collection-assignment.model.d.ts +1 -2
- package/document-management/models/document-collection-assignment.model.js +5 -7
- package/document-management/models/document-collection.model.d.ts +1 -2
- package/document-management/models/document-collection.model.js +3 -4
- package/document-management/models/document-management-table.d.ts +1 -1
- package/document-management/models/document-management-table.js +1 -1
- package/document-management/models/document-property-value.model.d.ts +1 -2
- package/document-management/models/document-property-value.model.js +5 -8
- package/document-management/models/document-property.model.d.ts +1 -2
- package/document-management/models/document-property.model.js +2 -3
- package/document-management/models/document-request-collection-assignment.model.d.ts +1 -2
- package/document-management/models/document-request-collection-assignment.model.js +4 -6
- package/document-management/models/document-request-template.d.ts +1 -2
- package/document-management/models/document-request-template.js +4 -6
- package/document-management/models/document-request.model.d.ts +1 -1
- package/document-management/models/document-request.model.js +4 -5
- package/document-management/models/document-requests-template.d.ts +1 -1
- package/document-management/models/document-requests-template.js +2 -3
- package/document-management/models/document-tag-assignment.model.d.ts +1 -2
- package/document-management/models/document-tag-assignment.model.js +4 -6
- package/document-management/models/document-tag.model.d.ts +1 -1
- package/document-management/models/document-tag.model.js +2 -3
- package/document-management/models/document-type-property.model.d.ts +1 -2
- package/document-management/models/document-type-property.model.js +4 -6
- package/document-management/models/document-type-validation.model.d.ts +1 -2
- package/document-management/models/document-type-validation.model.js +4 -6
- package/document-management/models/document-type.model.d.ts +1 -2
- package/document-management/models/document-type.model.js +3 -5
- package/document-management/models/document-validation-definition.model.d.ts +1 -2
- package/document-management/models/document-validation-definition.model.js +3 -4
- package/document-management/models/document-validation-execution-related-document.model.d.ts +1 -2
- package/document-management/models/document-validation-execution-related-document.model.js +4 -6
- package/document-management/models/document-validation-execution.model.d.ts +1 -2
- package/document-management/models/document-validation-execution.model.js +8 -9
- package/document-management/models/document-workflow.model.d.ts +1 -2
- package/document-management/models/document-workflow.model.js +5 -7
- package/document-management/models/document.model.d.ts +1 -2
- package/document-management/models/document.model.js +5 -7
- package/document-management/server/api/document-management.api.js +1 -1
- package/document-management/server/module.d.ts +1 -1
- package/document-management/server/module.js +1 -1
- package/document-management/server/schemas.d.ts +1 -1
- package/document-management/server/schemas.js +1 -1
- package/document-management/server/services/document-category-type.service.d.ts +2 -2
- package/document-management/server/services/document-category-type.service.js +1 -2
- package/document-management/server/services/document-collection.service.d.ts +1 -1
- package/document-management/server/services/document-collection.service.js +1 -2
- package/document-management/server/services/document-management-ai.service.js +3 -3
- package/document-management/server/services/document-management.service.js +6 -6
- package/document-management/server/services/document-property.service.d.ts +1 -1
- package/document-management/server/services/document-property.service.js +1 -2
- package/document-management/server/services/document-validation.service.js +2 -2
- package/document-management/server/services/document-workflow.service.d.ts +2 -2
- package/document-management/server/services/document-workflow.service.js +1 -2
- package/document-management/server/services/document.service.d.ts +1 -1
- package/document-management/server/services/document.service.js +1 -2
- package/document-management/server/services/singleton.js +1 -1
- package/document-management/server/validators/ai-validation-executor.d.ts +2 -2
- package/document-management/server/validators/ai-validation-executor.js +6 -6
- package/document-management/server/validators/single-document-validation-executor.d.ts +2 -1
- package/document-management/server/validators/single-document-validation-executor.js +3 -2
- package/document-management/service-models/document.service-model.d.ts +62 -62
- package/document-management/service-models/document.service-model.js +1 -1
- package/document-management/service-models/enriched/enriched-document-management-data.view.js +1 -1
- package/document-management/service-models/enriched/enriched-document.view.d.ts +1 -1
- package/examples/api/authentication.js +2 -2
- package/examples/api/basic-overview.js +2 -2
- package/examples/api/custom-authentication.js +2 -2
- package/examples/api/streaming.js +2 -2
- package/examples/browser/basic.js +2 -2
- package/examples/document-management/main.js +4 -2
- package/examples/http/client.js +2 -2
- package/examples/mail/basic.js +2 -2
- package/examples/pdf/basic.js +2 -2
- package/examples/template/basic.js +2 -2
- package/http/server/http-server-request.d.ts +3 -3
- package/key-value-store/postgres/key-value-store.service.js +1 -2
- package/key-value-store/postgres/models/key-value.model.d.ts +1 -2
- package/key-value-store/postgres/models/key-value.model.js +2 -4
- package/key-value-store/postgres/models/schemas.d.ts +1 -1
- package/key-value-store/postgres/models/schemas.js +1 -1
- package/lock/postgres/lock.js +1 -1
- package/lock/postgres/models/lock.model.d.ts +1 -2
- package/lock/postgres/models/lock.model.js +3 -5
- package/lock/postgres/models/schemas.d.ts +1 -1
- package/lock/postgres/models/schemas.js +1 -1
- package/lock/postgres/provider.js +1 -2
- package/mail/models/mail-log.model.d.ts +1 -1
- package/mail/models/mail-log.model.js +4 -5
- package/mail/models/schemas.d.ts +1 -1
- package/mail/models/schemas.js +1 -1
- package/openid-connect/oidc-state.model.d.ts +1 -1
- package/openid-connect/oidc-state.model.js +2 -3
- package/openid-connect/oidc.service.js +1 -1
- package/orm/data-types/bytea.js +1 -1
- package/orm/data-types/numeric-date.js +1 -1
- package/orm/decorators.d.ts +65 -72
- package/orm/decorators.js +42 -40
- package/orm/entity.d.ts +1 -1
- package/orm/entity.js +13 -13
- package/orm/index.d.ts +2 -1
- package/orm/index.js +2 -1
- package/orm/schemas/json.d.ts +1 -1
- package/orm/schemas/json.js +1 -1
- package/orm/schemas/numeric-date.d.ts +1 -1
- package/orm/schemas/numeric-date.js +1 -1
- package/orm/schemas/timestamp.d.ts +1 -1
- package/orm/schemas/timestamp.js +1 -1
- package/orm/schemas/uuid.d.ts +2 -2
- package/orm/schemas/uuid.js +1 -1
- package/orm/server/drizzle/index.js +1 -0
- package/orm/server/drizzle/schema-converter.d.ts +15 -0
- package/orm/server/drizzle/schema-converter.js +300 -0
- package/orm/server/repository.d.ts +1 -1
- package/orm/server/repository.js +12 -9
- package/orm/sqls.d.ts +1 -1
- package/orm/sqls.js +1 -1
- package/orm/types.d.ts +2 -6
- package/orm/types.js +1 -4
- package/package.json +12 -10
- package/queue/postgres/job.model.d.ts +3 -3
- package/queue/postgres/job.model.js +5 -6
- package/queue/postgres/queue.js +2 -2
- package/queue/postgres/schemas.d.ts +1 -1
- package/queue/postgres/schemas.js +1 -1
- package/supports.d.ts +1 -0
- package/supports.js +2 -1
- package/types/types.d.ts +12 -1
- package/utils/object/object.d.ts +3 -1
- package/utils/object/object.js +7 -1
- package/orm/server/drizzle/schema-converter.ts +0 -408
- /package/orm/server/drizzle/{index.ts → index.d.ts} +0 -0
package/audit/auditor.d.ts
CHANGED
|
@@ -1,9 +1,30 @@
|
|
|
1
|
+
import type { IsEqual } from 'type-fest';
|
|
1
2
|
import { type Resolvable, type resolveArgumentType } from '../injector/index.js';
|
|
2
3
|
import type { TypedOmit, UndefinableJsonObject } from '../types/index.js';
|
|
3
4
|
import { AuditEvent } from './audit.model.js';
|
|
4
|
-
export type AuditPayload = Partial<TypedOmit<AuditEvent, 'id' | 'timestamp' | 'module' | 'action' | 'details'
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
export type AuditPayload<Details extends UndefinableJsonObject = never> = Partial<TypedOmit<AuditEvent, 'id' | 'timestamp' | 'module' | 'action' | 'tenantId' | 'correlationId' | 'targetId' | 'network' | 'changes' | 'details'>> & {
|
|
6
|
+
tenantId?: string | null;
|
|
7
|
+
correlationId?: string | null;
|
|
8
|
+
targetId?: string;
|
|
9
|
+
network?: {
|
|
10
|
+
path?: string | null;
|
|
11
|
+
ipAddress?: string | null;
|
|
12
|
+
userAgent?: string | null;
|
|
13
|
+
sessionId?: string | null;
|
|
14
|
+
};
|
|
15
|
+
changes?: {
|
|
16
|
+
before?: unknown;
|
|
17
|
+
after?: unknown;
|
|
18
|
+
};
|
|
19
|
+
} & ([
|
|
20
|
+
Details
|
|
21
|
+
] extends [never] ? {
|
|
22
|
+
details?: UndefinableJsonObject;
|
|
23
|
+
} : IsEqual<Details, {}> extends true ? {
|
|
24
|
+
details?: UndefinableJsonObject;
|
|
25
|
+
} : {
|
|
26
|
+
details: Details;
|
|
27
|
+
});
|
|
7
28
|
export type AuditorArgument = string | string[] | {
|
|
8
29
|
/**
|
|
9
30
|
* The module or path of modules for the auditor.
|
|
@@ -22,7 +43,7 @@ type AuditEvents = Record<string, UndefinableJsonObject>;
|
|
|
22
43
|
*
|
|
23
44
|
* @template Events A record mapping event action names to their specific `details` payload types.
|
|
24
45
|
*/
|
|
25
|
-
export declare class Auditor<Events extends AuditEvents =
|
|
46
|
+
export declare class Auditor<Events extends AuditEvents = Record<never, never>> implements Resolvable<AuditorArgument> {
|
|
26
47
|
#private;
|
|
27
48
|
/**
|
|
28
49
|
* The module path for this auditor instance.
|
|
@@ -31,9 +52,7 @@ export declare class Auditor<Events extends AuditEvents = AuditEvents> implement
|
|
|
31
52
|
/**
|
|
32
53
|
* The context that is automatically merged into every event logged by this auditor.
|
|
33
54
|
*/
|
|
34
|
-
readonly context: Partial<
|
|
35
|
-
details: UndefinableJsonObject;
|
|
36
|
-
}>>;
|
|
55
|
+
readonly context: Partial<AuditPayload<never>>;
|
|
37
56
|
/**
|
|
38
57
|
* A dot-separated string representation of the module path.
|
|
39
58
|
* @example ['user', 'authentication'] becomes 'user.authentication'
|
|
@@ -48,7 +67,7 @@ export declare class Auditor<Events extends AuditEvents = AuditEvents> implement
|
|
|
48
67
|
* @returns A new `Auditor` instance for the specified submodule.
|
|
49
68
|
* @template T The event map of the new Auditor instance.
|
|
50
69
|
*/
|
|
51
|
-
fork<T extends AuditEvents =
|
|
70
|
+
fork<T extends AuditEvents = Record<string, never>>(subModule: string | string[]): Auditor<T>;
|
|
52
71
|
/**
|
|
53
72
|
* Creates a new `Auditor` instance with additional context.
|
|
54
73
|
* The new context is merged with the existing context.
|
|
@@ -71,9 +90,7 @@ export declare class Auditor<Events extends AuditEvents = AuditEvents> implement
|
|
|
71
90
|
* @param action The name of the action being logged. Must be a key of the `Events` type.
|
|
72
91
|
* @param data The payload containing details about the event.
|
|
73
92
|
*/
|
|
74
|
-
log<E extends Extract<keyof Events, string>>(action: E, data?: AuditPayload
|
|
75
|
-
details: Events[E];
|
|
76
|
-
}): Promise<void>;
|
|
93
|
+
log<const E extends Extract<keyof Events, string>>(action: E, data?: AuditPayload<Events[E]>): Promise<void>;
|
|
77
94
|
/**
|
|
78
95
|
* Logs an informational event.
|
|
79
96
|
* Automatically sets severity to `Info` and defaults outcome to `Success`.
|
|
@@ -81,9 +98,7 @@ export declare class Auditor<Events extends AuditEvents = AuditEvents> implement
|
|
|
81
98
|
* @param action The name of the action being logged.
|
|
82
99
|
* @param data The payload containing details about the event.
|
|
83
100
|
*/
|
|
84
|
-
info<E extends Extract<keyof Events, string>>(action: E, data: AuditPayload
|
|
85
|
-
details: Events[E];
|
|
86
|
-
}): Promise<void>;
|
|
101
|
+
info<const E extends Extract<keyof Events, string>>(action: E, data: AuditPayload<Events[E]>): Promise<void>;
|
|
87
102
|
/**
|
|
88
103
|
* Logs a warning event.
|
|
89
104
|
* Automatically sets severity to `Warn` and defaults outcome to `Failure`.
|
|
@@ -91,9 +106,7 @@ export declare class Auditor<Events extends AuditEvents = AuditEvents> implement
|
|
|
91
106
|
* @param action The name of the action being logged.
|
|
92
107
|
* @param data The payload containing details about the event.
|
|
93
108
|
*/
|
|
94
|
-
warn<E extends Extract<keyof Events, string>>(action: E, data: AuditPayload
|
|
95
|
-
details: Events[E];
|
|
96
|
-
}): Promise<void>;
|
|
109
|
+
warn<const E extends Extract<keyof Events, string>>(action: E, data: AuditPayload<Events[E]>): Promise<void>;
|
|
97
110
|
/**
|
|
98
111
|
* Logs an error event.
|
|
99
112
|
* Automatically sets severity to `Error` and defaults outcome to `Failure`.
|
|
@@ -101,9 +114,7 @@ export declare class Auditor<Events extends AuditEvents = AuditEvents> implement
|
|
|
101
114
|
* @param action The name of the action being logged.
|
|
102
115
|
* @param data The payload containing details about the event.
|
|
103
116
|
*/
|
|
104
|
-
error<E extends Extract<keyof Events, string>>(action: E, data: AuditPayload
|
|
105
|
-
details: Events[E];
|
|
106
|
-
}): Promise<void>;
|
|
117
|
+
error<const E extends Extract<keyof Events, string>>(action: E, data: AuditPayload<Events[E]>): Promise<void>;
|
|
107
118
|
/**
|
|
108
119
|
* Logs a critical event.
|
|
109
120
|
* Automatically sets severity to `Critical` and defaults outcome to `Failure`.
|
|
@@ -111,8 +122,6 @@ export declare class Auditor<Events extends AuditEvents = AuditEvents> implement
|
|
|
111
122
|
* @param action The name of the action being logged.
|
|
112
123
|
* @param data The payload containing details about the event.
|
|
113
124
|
*/
|
|
114
|
-
critical<E extends Extract<keyof Events, string>>(action: E, data: AuditPayload
|
|
115
|
-
details: Events[E];
|
|
116
|
-
}): Promise<void>;
|
|
125
|
+
critical<const E extends Extract<keyof Events, string>>(action: E, data: AuditPayload<Events[E]>): Promise<void>;
|
|
117
126
|
}
|
|
118
127
|
export {};
|
package/audit/auditor.js
CHANGED
|
@@ -9,16 +9,24 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
};
|
|
10
10
|
var Auditor_1;
|
|
11
11
|
import { createContextProvider } from '../context/index.js';
|
|
12
|
-
import { Injectable, injectArgument } from '../injector/index.js';
|
|
13
|
-
import {
|
|
14
|
-
import { TRANSACTION_TIMESTAMP } from '../orm/
|
|
12
|
+
import { inject, Injectable, injectArgument, provide } from '../injector/index.js';
|
|
13
|
+
import { Logger, LogLevel } from '../logger/index.js';
|
|
14
|
+
import { TRANSACTION_TIMESTAMP } from '../orm/index.js';
|
|
15
|
+
import { DatabaseConfig, EntityRepositoryConfig, injectRepository, isInTransactionalContext } from '../orm/server/index.js';
|
|
15
16
|
import { toArray } from '../utils/array/index.js';
|
|
16
17
|
import { Memoize } from '../utils/function/memoize.js';
|
|
17
|
-
import { filterUndefinedFromRecord, objectKeys } from '../utils/object/object.js';
|
|
18
|
+
import { filterNullishFromRecord, filterUndefinedFromRecord, objectKeys } from '../utils/object/object.js';
|
|
18
19
|
import { assertDefinedPass, isArray, isNotArray, isObject, isString } from '../utils/type-guards.js';
|
|
19
20
|
import { AuditEvent } from './audit.model.js';
|
|
21
|
+
import { AuditModuleConfig } from './module.js';
|
|
20
22
|
import { AuditOutcome, AuditSeverity } from './types.js';
|
|
21
23
|
const { runInAuditorCreationContext, getCurrentAuditorCreationContext, isInAuditorCreationContext } = createContextProvider('AuditorCreation');
|
|
24
|
+
const severityLogLevelMap = {
|
|
25
|
+
[AuditSeverity.Info]: 'info',
|
|
26
|
+
[AuditSeverity.Warn]: 'warn',
|
|
27
|
+
[AuditSeverity.Error]: 'error',
|
|
28
|
+
[AuditSeverity.Critical]: 'error',
|
|
29
|
+
};
|
|
22
30
|
/**
|
|
23
31
|
* A service for logging audit events.
|
|
24
32
|
* It provides a structured way to record activities within the system.
|
|
@@ -27,17 +35,17 @@ const { runInAuditorCreationContext, getCurrentAuditorCreationContext, isInAudit
|
|
|
27
35
|
* @template Events A record mapping event action names to their specific `details` payload types.
|
|
28
36
|
*/
|
|
29
37
|
let Auditor = Auditor_1 = class Auditor {
|
|
30
|
-
#repository = injectRepository(AuditEvent);
|
|
31
|
-
#
|
|
32
|
-
#
|
|
38
|
+
#repository = getCurrentAuditorCreationContext()?.repository ?? injectRepository(AuditEvent);
|
|
39
|
+
#logger = getCurrentAuditorCreationContext()?.logger ?? inject(Logger, 'Audit');
|
|
40
|
+
#argument = (isInAuditorCreationContext() || isInTransactionalContext()) ? undefined : injectArgument(this, { optional: true });
|
|
33
41
|
/**
|
|
34
42
|
* The module path for this auditor instance.
|
|
35
43
|
*/
|
|
36
|
-
module =
|
|
44
|
+
module = getCurrentAuditorCreationContext()?.module ?? moduleFromArgument(this.#argument);
|
|
37
45
|
/**
|
|
38
46
|
* The context that is automatically merged into every event logged by this auditor.
|
|
39
47
|
*/
|
|
40
|
-
context =
|
|
48
|
+
context = getCurrentAuditorCreationContext()?.context ?? ((isObject(this.#argument) && isNotArray(this.#argument)) ? (this.#argument.context ?? {}) : {});
|
|
41
49
|
/**
|
|
42
50
|
* A dot-separated string representation of the module path.
|
|
43
51
|
* @example ['user', 'authentication'] becomes 'user.authentication'
|
|
@@ -55,8 +63,10 @@ let Auditor = Auditor_1 = class Auditor {
|
|
|
55
63
|
*/
|
|
56
64
|
fork(subModule) {
|
|
57
65
|
return runInAuditorCreationContext({
|
|
66
|
+
repository: this.#repository,
|
|
58
67
|
module: [...this.module, ...toArray(subModule)],
|
|
59
68
|
context: this.context,
|
|
69
|
+
logger: this.#logger,
|
|
60
70
|
}, () => new Auditor_1());
|
|
61
71
|
}
|
|
62
72
|
/**
|
|
@@ -69,8 +79,16 @@ let Auditor = Auditor_1 = class Auditor {
|
|
|
69
79
|
*/
|
|
70
80
|
with(context) {
|
|
71
81
|
return runInAuditorCreationContext({
|
|
82
|
+
repository: this.#repository,
|
|
72
83
|
module: this.module,
|
|
73
|
-
context: {
|
|
84
|
+
context: {
|
|
85
|
+
...this.context,
|
|
86
|
+
...context,
|
|
87
|
+
network: { ...this.context.network, ...context.network },
|
|
88
|
+
changes: { ...this.context.changes, ...context.changes },
|
|
89
|
+
details: { ...this.context.details, ...context.details },
|
|
90
|
+
},
|
|
91
|
+
logger: this.#logger,
|
|
74
92
|
}, () => new Auditor_1());
|
|
75
93
|
}
|
|
76
94
|
/**
|
|
@@ -89,24 +107,64 @@ let Auditor = Auditor_1 = class Auditor {
|
|
|
89
107
|
* @param data The payload containing details about the event.
|
|
90
108
|
*/
|
|
91
109
|
async log(action, data) {
|
|
92
|
-
const mergedData = {
|
|
110
|
+
const mergedData = {
|
|
111
|
+
...this.context,
|
|
112
|
+
...data,
|
|
113
|
+
network: { ...this.context.network, ...data?.network },
|
|
114
|
+
changes: { ...this.context.changes, ...data?.changes },
|
|
115
|
+
details: filterUndefinedFromRecord({ ...this.context.details, ...data?.details }),
|
|
116
|
+
};
|
|
117
|
+
const outcome = assertDefinedPass(mergedData.outcome, 'Audit outcome is required');
|
|
118
|
+
const severity = assertDefinedPass(mergedData.severity, 'Audit severity is required');
|
|
119
|
+
const logMessage = `<${this.moduleString}> ${action} - ${outcome}`;
|
|
120
|
+
const details = (objectKeys(mergedData.details).length > 0) ? mergedData.details : undefined;
|
|
121
|
+
const network = filterNullishFromRecord({
|
|
122
|
+
ipAddress: mergedData.network.ipAddress,
|
|
123
|
+
userAgent: mergedData.network.userAgent,
|
|
124
|
+
sessionId: mergedData.network.sessionId,
|
|
125
|
+
});
|
|
126
|
+
const changes = filterUndefinedFromRecord({
|
|
127
|
+
before: mergedData.changes.before,
|
|
128
|
+
after: mergedData.changes.after,
|
|
129
|
+
});
|
|
130
|
+
const logContext = filterNullishFromRecord({
|
|
131
|
+
correlationId: mergedData.correlationId,
|
|
132
|
+
actorType: mergedData.actorType,
|
|
133
|
+
actor: mergedData.actor,
|
|
134
|
+
targetType: mergedData.targetType,
|
|
135
|
+
targetId: mergedData.targetId,
|
|
136
|
+
impersonatorType: mergedData.impersonatorType,
|
|
137
|
+
impersonator: mergedData.impersonator,
|
|
138
|
+
network: (objectKeys(network).length > 0) ? network : undefined,
|
|
139
|
+
changes: (objectKeys(changes).length > 0) ? changes : undefined,
|
|
140
|
+
details,
|
|
141
|
+
});
|
|
142
|
+
this.#logger[severityLogLevelMap[severity]](logMessage, logContext);
|
|
93
143
|
await this.#repository.insert({
|
|
94
144
|
timestamp: TRANSACTION_TIMESTAMP,
|
|
95
145
|
tenantId: mergedData.tenantId ?? null,
|
|
96
146
|
correlationId: mergedData.correlationId ?? null,
|
|
97
147
|
module: this.moduleString,
|
|
98
|
-
action
|
|
99
|
-
outcome
|
|
100
|
-
severity
|
|
101
|
-
actorId: assertDefinedPass(mergedData.actorId, 'Audit actorId is required'),
|
|
148
|
+
action,
|
|
149
|
+
outcome,
|
|
150
|
+
severity,
|
|
102
151
|
actorType: assertDefinedPass(mergedData.actorType, 'Audit actorType is required'),
|
|
103
|
-
|
|
152
|
+
actor: assertDefinedPass(mergedData.actor, 'Audit actor is required'),
|
|
104
153
|
impersonatorType: mergedData.impersonatorType ?? null,
|
|
105
|
-
|
|
154
|
+
impersonator: mergedData.impersonator ?? null,
|
|
106
155
|
targetType: assertDefinedPass(mergedData.targetType, 'Audit targetType is required'),
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
156
|
+
targetId: assertDefinedPass(mergedData.targetId, 'Audit targetId is required'),
|
|
157
|
+
network: {
|
|
158
|
+
path: mergedData.network.path ?? null,
|
|
159
|
+
ipAddress: mergedData.network.ipAddress ?? null,
|
|
160
|
+
userAgent: mergedData.network.userAgent ?? null,
|
|
161
|
+
sessionId: mergedData.network.sessionId ?? null,
|
|
162
|
+
},
|
|
163
|
+
changes: {
|
|
164
|
+
before: mergedData.changes.before ?? null,
|
|
165
|
+
after: mergedData.changes.after ?? null,
|
|
166
|
+
},
|
|
167
|
+
details: details ?? null,
|
|
110
168
|
});
|
|
111
169
|
}
|
|
112
170
|
/**
|
|
@@ -172,7 +230,12 @@ __decorate([
|
|
|
172
230
|
__metadata("design:paramtypes", [])
|
|
173
231
|
], Auditor.prototype, "moduleString", null);
|
|
174
232
|
Auditor = Auditor_1 = __decorate([
|
|
175
|
-
Injectable(
|
|
233
|
+
Injectable({
|
|
234
|
+
providers: [
|
|
235
|
+
provide(EntityRepositoryConfig, { useValue: { schema: 'audit' } }),
|
|
236
|
+
{ provide: DatabaseConfig, useFactory: (_, context) => context.resolve(AuditModuleConfig).database ?? context.resolve(DatabaseConfig, undefined, { skipSelf: true }) },
|
|
237
|
+
],
|
|
238
|
+
})
|
|
176
239
|
], Auditor);
|
|
177
240
|
export { Auditor };
|
|
178
241
|
function moduleFromArgument(argument) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
CREATE TYPE "audit"."actor_type" AS ENUM('
|
|
1
|
+
CREATE TYPE "audit"."actor_type" AS ENUM('anonymous', 'system', 'api-key', 'user');--> statement-breakpoint
|
|
2
2
|
CREATE TYPE "audit"."audit_outcome" AS ENUM('pending', 'success', 'cancelled', 'failure', 'denied');--> statement-breakpoint
|
|
3
3
|
CREATE TYPE "audit"."audit_severity" AS ENUM('info', 'warn', 'error', 'critical');--> statement-breakpoint
|
|
4
4
|
CREATE TABLE "audit"."event" (
|
|
@@ -10,12 +10,13 @@ CREATE TABLE "audit"."event" (
|
|
|
10
10
|
"action" text NOT NULL,
|
|
11
11
|
"outcome" "audit"."audit_outcome" NOT NULL,
|
|
12
12
|
"severity" "audit"."audit_severity" NOT NULL,
|
|
13
|
-
"actor_id" uuid NOT NULL,
|
|
14
13
|
"actor_type" "audit"."actor_type" NOT NULL,
|
|
15
|
-
"
|
|
14
|
+
"actor" text NOT NULL,
|
|
16
15
|
"impersonator_type" "audit"."actor_type",
|
|
17
|
-
"
|
|
16
|
+
"impersonator" text,
|
|
18
17
|
"target_type" text NOT NULL,
|
|
18
|
+
"target_id" uuid NOT NULL,
|
|
19
|
+
"network_path" text NOT NULL,
|
|
19
20
|
"network_ip_address" text,
|
|
20
21
|
"network_user_agent" text,
|
|
21
22
|
"network_session_id" uuid,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"id": "
|
|
2
|
+
"id": "8f6c87f8-1692-49bd-9bd4-09dc9d0bdcd4",
|
|
3
3
|
"prevId": "00000000-0000-0000-0000-000000000000",
|
|
4
4
|
"version": "7",
|
|
5
5
|
"dialect": "postgresql",
|
|
@@ -59,12 +59,6 @@
|
|
|
59
59
|
"primaryKey": false,
|
|
60
60
|
"notNull": true
|
|
61
61
|
},
|
|
62
|
-
"actor_id": {
|
|
63
|
-
"name": "actor_id",
|
|
64
|
-
"type": "uuid",
|
|
65
|
-
"primaryKey": false,
|
|
66
|
-
"notNull": true
|
|
67
|
-
},
|
|
68
62
|
"actor_type": {
|
|
69
63
|
"name": "actor_type",
|
|
70
64
|
"type": "actor_type",
|
|
@@ -72,11 +66,11 @@
|
|
|
72
66
|
"primaryKey": false,
|
|
73
67
|
"notNull": true
|
|
74
68
|
},
|
|
75
|
-
"
|
|
76
|
-
"name": "
|
|
77
|
-
"type": "
|
|
69
|
+
"actor": {
|
|
70
|
+
"name": "actor",
|
|
71
|
+
"type": "text",
|
|
78
72
|
"primaryKey": false,
|
|
79
|
-
"notNull":
|
|
73
|
+
"notNull": true
|
|
80
74
|
},
|
|
81
75
|
"impersonator_type": {
|
|
82
76
|
"name": "impersonator_type",
|
|
@@ -85,14 +79,26 @@
|
|
|
85
79
|
"primaryKey": false,
|
|
86
80
|
"notNull": false
|
|
87
81
|
},
|
|
82
|
+
"impersonator": {
|
|
83
|
+
"name": "impersonator",
|
|
84
|
+
"type": "text",
|
|
85
|
+
"primaryKey": false,
|
|
86
|
+
"notNull": false
|
|
87
|
+
},
|
|
88
|
+
"target_type": {
|
|
89
|
+
"name": "target_type",
|
|
90
|
+
"type": "text",
|
|
91
|
+
"primaryKey": false,
|
|
92
|
+
"notNull": true
|
|
93
|
+
},
|
|
88
94
|
"target_id": {
|
|
89
95
|
"name": "target_id",
|
|
90
96
|
"type": "uuid",
|
|
91
97
|
"primaryKey": false,
|
|
92
98
|
"notNull": true
|
|
93
99
|
},
|
|
94
|
-
"
|
|
95
|
-
"name": "
|
|
100
|
+
"network_path": {
|
|
101
|
+
"name": "network_path",
|
|
96
102
|
"type": "text",
|
|
97
103
|
"primaryKey": false,
|
|
98
104
|
"notNull": true
|
|
@@ -148,9 +154,10 @@
|
|
|
148
154
|
"name": "actor_type",
|
|
149
155
|
"schema": "audit",
|
|
150
156
|
"values": [
|
|
151
|
-
"
|
|
157
|
+
"anonymous",
|
|
152
158
|
"system",
|
|
153
|
-
"api-key"
|
|
159
|
+
"api-key",
|
|
160
|
+
"user"
|
|
154
161
|
]
|
|
155
162
|
},
|
|
156
163
|
"audit.audit_outcome": {
|
package/audit/index.d.ts
CHANGED
package/audit/index.js
CHANGED
package/audit/module.d.ts
CHANGED
package/audit/module.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { inject } from '../injector/index.js';
|
|
2
|
-
import { Injector } from '../injector/injector.js';
|
|
1
|
+
import { inject, Injector } from '../injector/index.js';
|
|
3
2
|
import { Database, migrate } from '../orm/server/index.js';
|
|
4
3
|
/**
|
|
5
4
|
* Configuration for {@link configureAuditServer}.
|
package/audit/schemas.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AuditEvent } from './audit.model.js';
|
|
2
|
-
export declare const auditSchema: import("../orm/server/
|
|
2
|
+
export declare const auditSchema: import("../orm/server/index.js").DatabaseSchema<"audit">;
|
|
3
3
|
export declare const auditOutcome: import("drizzle-orm/pg-core").PgEnum<["pending", "success", "cancelled", "failure", "denied"]>;
|
|
4
4
|
export declare const auditSeverity: import("drizzle-orm/pg-core").PgEnum<["error", "warn", "info", "critical"]>;
|
|
5
|
-
export declare const actorType: import("drizzle-orm/pg-core").PgEnum<["user", "system", "api-key"]>;
|
|
5
|
+
export declare const actorType: import("drizzle-orm/pg-core").PgEnum<["user", "anonymous", "system", "api-key"]>;
|
|
6
6
|
export declare const auditEvent: import("../orm/server/types.js").PgTableFromType<typeof AuditEvent, "audit">;
|
package/audit/schemas.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { databaseSchema } from '../orm/server/
|
|
1
|
+
import { databaseSchema } from '../orm/server/index.js';
|
|
2
2
|
import { AuditEvent } from './audit.model.js';
|
|
3
3
|
import { ActorType, AuditOutcome, AuditSeverity } from './types.js';
|
|
4
4
|
export const auditSchema = databaseSchema('audit');
|
package/audit/types.d.ts
CHANGED
|
@@ -15,8 +15,9 @@ export declare const AuditOutcome: {
|
|
|
15
15
|
};
|
|
16
16
|
export type AuditOutcome = EnumType<typeof AuditOutcome>;
|
|
17
17
|
export declare const ActorType: {
|
|
18
|
-
readonly
|
|
18
|
+
readonly Anonymous: "anonymous";
|
|
19
19
|
readonly System: "system";
|
|
20
20
|
readonly ApiKey: "api-key";
|
|
21
|
+
readonly User: "user";
|
|
21
22
|
};
|
|
22
23
|
export type ActorType = EnumType<typeof ActorType>;
|
package/audit/types.js
CHANGED
|
@@ -7,8 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import { Table } from '../../orm/
|
|
11
|
-
import { Entity, Unique } from '../../orm/index.js';
|
|
10
|
+
import { Entity, Table, Unique } from '../../orm/index.js';
|
|
12
11
|
import { Integer, StringProperty, Uint8ArrayProperty } from '../../schema/index.js';
|
|
13
12
|
let AuthenticationCredentials = class AuthenticationCredentials extends Entity {
|
|
14
13
|
subject;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Timestamp } from '../../orm/index.js';
|
|
2
|
+
import { Entity } from '../../orm/index.js';
|
|
3
3
|
export declare class AuthenticationSession extends Entity {
|
|
4
4
|
subject: string;
|
|
5
5
|
begin: Timestamp;
|
|
@@ -7,9 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import { Table } from '../../orm/
|
|
11
|
-
import { Entity } from '../../orm/entity.js';
|
|
12
|
-
import { Timestamp } from '../../orm/types.js';
|
|
10
|
+
import { Entity, Table, TimestampProperty } from '../../orm/index.js';
|
|
13
11
|
import { Integer, StringProperty, Uint8ArrayProperty } from '../../schema/index.js';
|
|
14
12
|
let AuthenticationSession = class AuthenticationSession extends Entity {
|
|
15
13
|
subject;
|
|
@@ -30,11 +28,11 @@ __decorate([
|
|
|
30
28
|
__metadata("design:type", String)
|
|
31
29
|
], AuthenticationSession.prototype, "subject", void 0);
|
|
32
30
|
__decorate([
|
|
33
|
-
|
|
31
|
+
TimestampProperty(),
|
|
34
32
|
__metadata("design:type", Number)
|
|
35
33
|
], AuthenticationSession.prototype, "begin", void 0);
|
|
36
34
|
__decorate([
|
|
37
|
-
|
|
35
|
+
TimestampProperty(),
|
|
38
36
|
__metadata("design:type", Number)
|
|
39
37
|
], AuthenticationSession.prototype, "end", void 0);
|
|
40
38
|
__decorate([
|
|
@@ -2,10 +2,10 @@ import type { ApiRequestData } from '../../api/index.js';
|
|
|
2
2
|
import { ApiRequestTokenProvider } from '../../api/server/api-request-token.provider.js';
|
|
3
3
|
import { AuthenticationService } from './authentication.service.js';
|
|
4
4
|
/**
|
|
5
|
-
* Provides the
|
|
5
|
+
* Provides the info for an API request from the authorization header.
|
|
6
6
|
*/
|
|
7
7
|
export declare class AuthenticationApiRequestTokenProvider extends ApiRequestTokenProvider {
|
|
8
8
|
private readonly authenticationService;
|
|
9
9
|
constructor(authenticationService: AuthenticationService);
|
|
10
|
-
|
|
10
|
+
tryGetToken<T>(data: ApiRequestData): Promise<T | null>;
|
|
11
11
|
}
|
|
@@ -9,10 +9,11 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
};
|
|
10
10
|
import { ApiRequestTokenProvider } from '../../api/server/api-request-token.provider.js';
|
|
11
11
|
import { Singleton } from '../../injector/decorators.js';
|
|
12
|
+
import { isUndefined } from '../../utils/type-guards.js';
|
|
12
13
|
import { AuthenticationService } from './authentication.service.js';
|
|
13
14
|
import { tryGetAuthorizationTokenStringFromRequest } from './helper.js';
|
|
14
15
|
/**
|
|
15
|
-
* Provides the
|
|
16
|
+
* Provides the info for an API request from the authorization header.
|
|
16
17
|
*/
|
|
17
18
|
let AuthenticationApiRequestTokenProvider = class AuthenticationApiRequestTokenProvider extends ApiRequestTokenProvider {
|
|
18
19
|
authenticationService;
|
|
@@ -20,10 +21,12 @@ let AuthenticationApiRequestTokenProvider = class AuthenticationApiRequestTokenP
|
|
|
20
21
|
super();
|
|
21
22
|
this.authenticationService = authenticationService;
|
|
22
23
|
}
|
|
23
|
-
async
|
|
24
|
-
const tokenString = tryGetAuthorizationTokenStringFromRequest(data.request)
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
async tryGetToken(data) {
|
|
25
|
+
const tokenString = tryGetAuthorizationTokenStringFromRequest(data.request);
|
|
26
|
+
if (isUndefined(tokenString)) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
return await this.authenticationService.validateToken(tokenString);
|
|
27
30
|
}
|
|
28
31
|
};
|
|
29
32
|
AuthenticationApiRequestTokenProvider = __decorate([
|
|
@@ -20,47 +20,47 @@ export declare class AuthenticationApiController<AdditionalTokenPayload extends
|
|
|
20
20
|
* @param parameters The parameters for the request.
|
|
21
21
|
* @returns The token result.
|
|
22
22
|
*/
|
|
23
|
-
login({ parameters }: ApiRequestContext<AuthenticationApiDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>, 'login'>): Promise<ApiServerResult<AuthenticationApiDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>, 'login'>>;
|
|
23
|
+
login({ parameters, getAuditor }: ApiRequestContext<AuthenticationApiDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>, 'login'>): Promise<ApiServerResult<AuthenticationApiDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>, 'login'>>;
|
|
24
24
|
/**
|
|
25
25
|
* Refresh a token.
|
|
26
26
|
* @param request The request context.
|
|
27
27
|
* @param parameters The parameters for the request.
|
|
28
28
|
* @returns The token result.
|
|
29
29
|
*/
|
|
30
|
-
refresh({ request, parameters }: ApiRequestContext<AuthenticationApiDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>, 'refresh'>): Promise<ApiServerResult<AuthenticationApiDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>, 'refresh'>>;
|
|
30
|
+
refresh({ request, parameters, getAuditor }: ApiRequestContext<AuthenticationApiDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>, 'refresh'>): Promise<ApiServerResult<AuthenticationApiDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>, 'refresh'>>;
|
|
31
31
|
/**
|
|
32
32
|
* Impersonate a subject.
|
|
33
33
|
* @param request The request context.
|
|
34
34
|
* @param parameters The parameters for the request.
|
|
35
35
|
* @returns The token result.
|
|
36
36
|
*/
|
|
37
|
-
impersonate({ request, parameters }: ApiRequestContext<AuthenticationApiDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>, 'impersonate'>): Promise<ApiServerResult<AuthenticationApiDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>, 'impersonate'>>;
|
|
37
|
+
impersonate({ request, parameters, getAuditor }: ApiRequestContext<AuthenticationApiDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>, 'impersonate'>): Promise<ApiServerResult<AuthenticationApiDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>, 'impersonate'>>;
|
|
38
38
|
/**
|
|
39
39
|
* Unimpersonate a subject.
|
|
40
40
|
* @param request The request context.
|
|
41
41
|
* @param parameters The parameters for the request.
|
|
42
42
|
* @returns The token result.
|
|
43
43
|
*/
|
|
44
|
-
unimpersonate({ request, parameters }: ApiRequestContext<AuthenticationApiDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>, 'unimpersonate'>): Promise<ApiServerResult<AuthenticationApiDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>, 'unimpersonate'>>;
|
|
44
|
+
unimpersonate({ request, parameters, getAuditor }: ApiRequestContext<AuthenticationApiDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>, 'unimpersonate'>): Promise<ApiServerResult<AuthenticationApiDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>, 'unimpersonate'>>;
|
|
45
45
|
/**
|
|
46
46
|
* End a session.
|
|
47
47
|
* @param request The request context.
|
|
48
48
|
* @returns 'ok' if the session was ended.
|
|
49
49
|
*/
|
|
50
|
-
endSession({ request }: ApiRequestContext<AuthenticationApiDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>, 'endSession'>): Promise<ApiServerResult<AuthenticationApiDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>, 'endSession'>>;
|
|
51
|
-
changeSecret({ parameters }: ApiRequestContext<AuthenticationApiDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>, 'changeSecret'>): Promise<ApiServerResult<AuthenticationApiDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>, 'changeSecret'>>;
|
|
50
|
+
endSession({ request, getAuditor }: ApiRequestContext<AuthenticationApiDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>, 'endSession'>): Promise<ApiServerResult<AuthenticationApiDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>, 'endSession'>>;
|
|
51
|
+
changeSecret({ parameters, getAuditor }: ApiRequestContext<AuthenticationApiDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>, 'changeSecret'>): Promise<ApiServerResult<AuthenticationApiDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>, 'changeSecret'>>;
|
|
52
52
|
/**
|
|
53
53
|
* Initialize a secret reset.
|
|
54
54
|
* @param parameters The parameters for the request.
|
|
55
55
|
* @returns 'ok' if the secret reset was initialized.
|
|
56
56
|
*/
|
|
57
|
-
initSecretReset({ parameters }: ApiRequestContext<AuthenticationApiDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>, 'initSecretReset'>): Promise<ApiServerResult<AuthenticationApiDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>, 'initSecretReset'>>;
|
|
57
|
+
initSecretReset({ parameters, getAuditor }: ApiRequestContext<AuthenticationApiDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>, 'initSecretReset'>): Promise<ApiServerResult<AuthenticationApiDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>, 'initSecretReset'>>;
|
|
58
58
|
/**
|
|
59
59
|
* Reset a secret.
|
|
60
60
|
* @param parameters The parameters for the request.
|
|
61
61
|
* @returns 'ok' if the secret was reset.
|
|
62
62
|
*/
|
|
63
|
-
resetSecret({ parameters }: ApiRequestContext<AuthenticationApiDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>, 'resetSecret'>): Promise<ApiServerResult<AuthenticationApiDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>, 'resetSecret'>>;
|
|
63
|
+
resetSecret({ parameters, getAuditor }: ApiRequestContext<AuthenticationApiDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>, 'resetSecret'>): Promise<ApiServerResult<AuthenticationApiDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>, 'resetSecret'>>;
|
|
64
64
|
/**
|
|
65
65
|
* Check a secret.
|
|
66
66
|
* @param parameters The parameters for the request.
|