@tstdl/base 0.92.119 → 0.92.121
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/api/index.d.ts +0 -2
- package/api/index.js +0 -2
- package/authentication/authentication.api.d.ts +3 -3
- package/authentication/client/api.client.d.ts +1 -1
- package/authentication/server/authentication-ancillary.service.d.ts +1 -1
- package/authentication/server/authentication.service.d.ts +1 -1
- package/document-management/api/document-management.api.d.ts +1 -1
- package/document-management/api/document-management.api.js +2 -1
- package/formats.js +2 -2
- package/package.json +3 -1
package/api/index.d.ts
CHANGED
package/api/index.js
CHANGED
|
@@ -5,9 +5,9 @@ import type { Record } from '../types.js';
|
|
|
5
5
|
import type { TokenPayload } from './index.js';
|
|
6
6
|
import { SecretCheckResult } from './models/secret-check-result.model.js';
|
|
7
7
|
export declare const dontWaitForValidToken: unique symbol;
|
|
8
|
-
type GetAuthenticationApiEndpointsDefinition<AdditionalTokenPayload extends Record = Record<never>, AuthenticationData = void, AdditionalInitSecretResetData
|
|
9
|
-
type AuthenticationApiEndpointsDefinition<AdditionalTokenPayload extends Record = Record<never>, AuthenticationData = void, AdditionalInitSecretResetData
|
|
10
|
-
export type AuthenticationApiDefinition<AdditionalTokenPayload extends Record = Record<never>, AuthenticationData = void, AdditionalInitSecretResetData
|
|
8
|
+
type GetAuthenticationApiEndpointsDefinition<AdditionalTokenPayload extends Record = Record<never>, AuthenticationData = void, AdditionalInitSecretResetData = void> = typeof getAuthenticationApiEndpointsDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>;
|
|
9
|
+
type AuthenticationApiEndpointsDefinition<AdditionalTokenPayload extends Record = Record<never>, AuthenticationData = void, AdditionalInitSecretResetData = void> = ReturnType<GetAuthenticationApiEndpointsDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>>;
|
|
10
|
+
export type AuthenticationApiDefinition<AdditionalTokenPayload extends Record = Record<never>, AuthenticationData = void, AdditionalInitSecretResetData = void> = ApiDefinition<string, AuthenticationApiEndpointsDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>>;
|
|
11
11
|
export declare const authenticationApiDefinition: {
|
|
12
12
|
resource: string;
|
|
13
13
|
endpoints: {
|
|
@@ -2,7 +2,7 @@ import { type ApiClient } from '../../api/client/index.js';
|
|
|
2
2
|
import { type ObjectSchemaOrType, type SchemaTestable } from '../../schema/index.js';
|
|
3
3
|
import type { Record } from '../../types.js';
|
|
4
4
|
import { type AuthenticationApiDefinition } from '../authentication.api.js';
|
|
5
|
-
export declare function getAuthenticationApiClient<AdditionalTokenPayload extends Record, AuthenticationData, AdditionalInitSecretResetData
|
|
5
|
+
export declare function getAuthenticationApiClient<AdditionalTokenPayload extends Record, AuthenticationData, AdditionalInitSecretResetData>(additionalTokenPayloadSchema: ObjectSchemaOrType<AdditionalTokenPayload>, authenticationDataSchema: SchemaTestable<AuthenticationData>, additionalInitSecretResetData: SchemaTestable<AdditionalInitSecretResetData>): ApiClient<AuthenticationApiDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>>;
|
|
6
6
|
declare const defaultAuthenticationApiClient: ApiClient<AuthenticationApiDefinition<import("type-fest").EmptyObject, unknown, import("type-fest").EmptyObject>>;
|
|
7
7
|
export declare class AuthenticationApiClient extends defaultAuthenticationApiClient {
|
|
8
8
|
}
|
|
@@ -10,7 +10,7 @@ export type GetTokenPayloadContextAction = EnumType<typeof GetTokenPayloadContex
|
|
|
10
10
|
export type GetTokenPayloadContext = {
|
|
11
11
|
action: GetTokenPayloadContextAction;
|
|
12
12
|
};
|
|
13
|
-
export declare abstract class AuthenticationAncillaryService<AdditionalTokenPayload extends Record = Record<never>, AuthenticationData = void, AdditionalInitSecretResetData
|
|
13
|
+
export declare abstract class AuthenticationAncillaryService<AdditionalTokenPayload extends Record = Record<never>, AuthenticationData = void, AdditionalInitSecretResetData = void> {
|
|
14
14
|
/**
|
|
15
15
|
* Resolve a provided subject to the actual subject used for authentication.
|
|
16
16
|
* Useful for example if you want to be able to login via mail but actual subject is the user id.
|
|
@@ -62,7 +62,7 @@ type CreateRefreshTokenResult = {
|
|
|
62
62
|
salt: Uint8Array;
|
|
63
63
|
hash: Uint8Array;
|
|
64
64
|
};
|
|
65
|
-
export declare class AuthenticationService<AdditionalTokenPayload extends Record = Record<never>, AuthenticationData = void, AdditionalInitSecretResetData
|
|
65
|
+
export declare class AuthenticationService<AdditionalTokenPayload extends Record = Record<never>, AuthenticationData = void, AdditionalInitSecretResetData = void> implements AfterResolve {
|
|
66
66
|
private readonly credentialsRepository;
|
|
67
67
|
private readonly sessionRepository;
|
|
68
68
|
private readonly authenticationSecretRequirementsValidator;
|
|
@@ -392,7 +392,7 @@ export declare const documentManagementApiDefinition: {
|
|
|
392
392
|
};
|
|
393
393
|
};
|
|
394
394
|
};
|
|
395
|
-
declare const _DocumentManagementApi: import("../../api/index.js").ApiClient<{
|
|
395
|
+
declare const _DocumentManagementApi: import("../../api/client/index.js").ApiClient<{
|
|
396
396
|
resource: string;
|
|
397
397
|
endpoints: {
|
|
398
398
|
loadData: {
|
|
@@ -4,7 +4,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { compileClient
|
|
7
|
+
import { compileClient } from '../../api/client/index.js';
|
|
8
|
+
import { defineApi } from '../../api/index.js';
|
|
8
9
|
import { ReplaceClass } from '../../injector/decorators.js';
|
|
9
10
|
import { boolean, literal, nullable, object, optional, string } from '../../schema/index.js';
|
|
10
11
|
import { megabyte } from '../../utils/units.js';
|
package/formats.js
CHANGED
|
@@ -120,9 +120,9 @@ export function formatEuro(value) {
|
|
|
120
120
|
export function formatPercent(value) {
|
|
121
121
|
return percentFormatter(locale).format(value);
|
|
122
122
|
}
|
|
123
|
-
export function formatPersonName(person, { lastNameFirst = false, fallback
|
|
123
|
+
export function formatPersonName(person, { lastNameFirst = false, fallback } = {}) {
|
|
124
124
|
if (isNullOrUndefined(person?.firstName) || isNullOrUndefined(person.lastName)) {
|
|
125
|
-
return person?.firstName ?? person?.lastName ?? fallback;
|
|
125
|
+
return person?.firstName ?? person?.lastName ?? fallback ?? '-';
|
|
126
126
|
}
|
|
127
127
|
if (lastNameFirst) {
|
|
128
128
|
return `${person.lastName}, ${person.firstName}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tstdl/base",
|
|
3
|
-
"version": "0.92.
|
|
3
|
+
"version": "0.92.121",
|
|
4
4
|
"author": "Patrick Hein",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -43,6 +43,8 @@
|
|
|
43
43
|
"./web-types": "./web-types.js",
|
|
44
44
|
"./ai": "./ai/index.js",
|
|
45
45
|
"./api": "./api/index.js",
|
|
46
|
+
"./api/client": "./api/client/index.js",
|
|
47
|
+
"./api/server": "./api/server/index.js",
|
|
46
48
|
"./application": "./application/index.js",
|
|
47
49
|
"./authentication": "./authentication/index.js",
|
|
48
50
|
"./authentication/server": "./authentication/server/index.js",
|