@alfresco/adf-core 8.4.0-17403623640 → 8.4.0-17407900008
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/lib/adf-http-client.service.d.ts +8 -12
- package/fesm2022/adf-core.mjs +7 -10
- package/fesm2022/adf-core.mjs.map +1 -1
- package/fesm2022/alfresco-adf-core-api.mjs +22 -34
- package/fesm2022/alfresco-adf-core-api.mjs.map +1 -1
- package/lib/auth/interfaces/authentication-service.interface.d.ts +5 -7
- package/lib/auth/services/authentication.service.d.ts +6 -8
- package/lib/auth/services/base-authentication.service.d.ts +6 -8
- package/lib/form/components/widgets/core/form-field-validator.d.ts +0 -4
- package/package.json +3 -3
|
@@ -1,26 +1,23 @@
|
|
|
1
1
|
import { Emitters as JsApiEmitters, HttpClient as JsApiHttpClient } from '@alfresco/js-api';
|
|
2
2
|
import { HttpClient } from '@angular/common/http';
|
|
3
3
|
import { RequestOptions, SecurityOptions } from './interfaces';
|
|
4
|
-
import {
|
|
4
|
+
import ee, { Emitter } from 'event-emitter';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
|
-
type EventEmitterInstance = InstanceType<typeof EventEmitter>;
|
|
7
|
-
type EventEmitterEvents = 'progress' | 'success' | 'error' | 'forbidden' | 'abort' | 'unauthorized' | string;
|
|
8
6
|
export interface Emitters {
|
|
9
|
-
readonly eventEmitter:
|
|
10
|
-
readonly apiClientEmitter:
|
|
7
|
+
readonly eventEmitter: Emitter;
|
|
8
|
+
readonly apiClientEmitter: Emitter;
|
|
11
9
|
}
|
|
12
|
-
export declare class AdfHttpClient implements JsApiHttpClient {
|
|
10
|
+
export declare class AdfHttpClient implements ee.Emitter, JsApiHttpClient {
|
|
13
11
|
private httpClient;
|
|
14
|
-
|
|
12
|
+
on: ee.EmitterMethod;
|
|
13
|
+
off: ee.EmitterMethod;
|
|
14
|
+
once: ee.EmitterMethod;
|
|
15
15
|
_disableCsrf: boolean;
|
|
16
|
+
emit: (type: string, ...args: any[]) => void;
|
|
16
17
|
get disableCsrf(): boolean;
|
|
17
18
|
set disableCsrf(disableCsrf: boolean);
|
|
18
19
|
private defaultSecurityOptions;
|
|
19
20
|
constructor(httpClient: HttpClient);
|
|
20
|
-
on(event: EventEmitterEvents, fn: (...args: any[]) => void, context?: any): this;
|
|
21
|
-
off(event: EventEmitterEvents, fn?: (...args: any[]) => void, context?: any): this;
|
|
22
|
-
once(event: EventEmitterEvents, fn: (...args: any[]) => void, context?: any): this;
|
|
23
|
-
emit(event: EventEmitterEvents, ...args: any[]): boolean;
|
|
24
21
|
setDefaultSecurityOption(options: any): void;
|
|
25
22
|
merge(...objects: any[]): any;
|
|
26
23
|
request<T = any>(url: string, options?: RequestOptions, sc?: SecurityOptions, emitters?: JsApiEmitters): Promise<T>;
|
|
@@ -69,4 +66,3 @@ export declare class AdfHttpClient implements JsApiHttpClient {
|
|
|
69
66
|
static ɵfac: i0.ɵɵFactoryDeclaration<AdfHttpClient, never>;
|
|
70
67
|
static ɵprov: i0.ɵɵInjectableDeclaration<AdfHttpClient>;
|
|
71
68
|
}
|
|
72
|
-
export {};
|
package/fesm2022/adf-core.mjs
CHANGED
|
@@ -62,6 +62,7 @@ import * as i2$6 from '@angular/material/checkbox';
|
|
|
62
62
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
63
63
|
import * as i1$a from 'angular-oauth2-oidc';
|
|
64
64
|
import { OAuthStorage, AuthConfig, OAuthService, OAuthErrorEvent, OAuthLogger, OAuthSuccessEvent, AUTH_CONFIG, provideOAuthClient } from 'angular-oauth2-oidc';
|
|
65
|
+
import ee from 'event-emitter';
|
|
65
66
|
import { Minimatch } from 'minimatch';
|
|
66
67
|
import { JwksValidationHandler } from 'angular-oauth2-oidc-jwks';
|
|
67
68
|
import { AuthenticationInterceptor, Authentication } from '@alfresco/adf-core/auth';
|
|
@@ -7230,6 +7231,7 @@ class BaseAuthenticationService {
|
|
|
7230
7231
|
this.onError = new ReplaySubject(1);
|
|
7231
7232
|
this.onLogin = new ReplaySubject(1);
|
|
7232
7233
|
this.onLogout = new ReplaySubject(1);
|
|
7234
|
+
ee(this);
|
|
7233
7235
|
}
|
|
7234
7236
|
/**
|
|
7235
7237
|
* Adds the auth token to an HTTP header using the 'bearer' scheme.
|
|
@@ -21184,27 +21186,23 @@ class MinLengthFieldValidator {
|
|
|
21184
21186
|
}
|
|
21185
21187
|
}
|
|
21186
21188
|
class MaxLengthFieldValidator {
|
|
21187
|
-
constructor(
|
|
21188
|
-
this.supportedTypes =
|
|
21189
|
-
this.maxLength = maxLength;
|
|
21189
|
+
constructor() {
|
|
21190
|
+
this.supportedTypes = [FormFieldTypes.TEXT, FormFieldTypes.MULTILINE_TEXT];
|
|
21190
21191
|
}
|
|
21191
21192
|
isSupported(field) {
|
|
21192
|
-
return field && this.supportedTypes.indexOf(field.type) > -1 &&
|
|
21193
|
+
return field && this.supportedTypes.indexOf(field.type) > -1 && field.maxLength > 0;
|
|
21193
21194
|
}
|
|
21194
21195
|
validate(field) {
|
|
21195
21196
|
if (this.isSupported(field) && field.value && field.isVisible) {
|
|
21196
|
-
if (field.value.
|
|
21197
|
+
if (field.value.length <= field.maxLength) {
|
|
21197
21198
|
return true;
|
|
21198
21199
|
}
|
|
21199
21200
|
field.validationSummary.message = `FORM.FIELD.VALIDATOR.NO_LONGER_THAN`;
|
|
21200
|
-
field.validationSummary.attributes.set('maxLength',
|
|
21201
|
+
field.validationSummary.attributes.set('maxLength', field.maxLength.toLocaleString());
|
|
21201
21202
|
return false;
|
|
21202
21203
|
}
|
|
21203
21204
|
return true;
|
|
21204
21205
|
}
|
|
21205
|
-
getMaxLength(field) {
|
|
21206
|
-
return this.maxLength ?? field.maxLength;
|
|
21207
|
-
}
|
|
21208
21206
|
}
|
|
21209
21207
|
class MinValueFieldValidator {
|
|
21210
21208
|
constructor() {
|
|
@@ -21335,7 +21333,6 @@ const FORM_FIELD_VALIDATORS = [
|
|
|
21335
21333
|
new NumberFieldValidator(),
|
|
21336
21334
|
new MinLengthFieldValidator(),
|
|
21337
21335
|
new MaxLengthFieldValidator(),
|
|
21338
|
-
new MaxLengthFieldValidator([FormFieldTypes.NUMBER], 10),
|
|
21339
21336
|
new MinValueFieldValidator(),
|
|
21340
21337
|
new MaxValueFieldValidator(),
|
|
21341
21338
|
new RegExFieldValidator(),
|