/
interfaces.ts
95 lines (86 loc) · 1.79 KB
/
interfaces.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*
* @forgerock/javascript-sdk
*
* interfaces.ts
*
* Copyright (c) 2020 ForgeRock. All rights reserved.
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
import type { CallbackType } from './enums';
/**
* Represents the authentication tree API payload schema.
*/
interface Step {
authId?: string;
callbacks?: Callback[];
code?: number;
description?: string;
detail?: StepDetail;
header?: string;
message?: string;
ok?: string;
realm?: string;
reason?: string;
stage?: string;
status?: number;
successUrl?: string;
tokenId?: string;
}
/**
* Represents details of a failure in an authentication step.
*/
interface StepDetail {
failedPolicyRequirements?: FailedPolicyRequirement[];
failureUrl?: string;
result?: boolean;
}
/**
* Represents failed policies for a matching property.
*/
interface FailedPolicyRequirement {
policyRequirements: PolicyRequirement[];
property: string;
}
/**
* Represents a failed policy policy and failed policy params.
*/
interface PolicyRequirement {
params?: Partial<PolicyParams>;
policyRequirement: string;
}
interface PolicyParams {
[key: string]: unknown;
disallowedFields: string;
duplicateValue: string;
forbiddenChars: string;
maxLength: number;
minLength: number;
numCaps: number;
numNums: number;
}
/**
* Represents the authentication tree API callback schema.
*/
interface Callback {
_id?: number;
input?: NameValue[];
output: NameValue[];
type: CallbackType;
}
/**
* Represents a name/value pair found in an authentication tree callback.
*/
interface NameValue {
name: string;
value: unknown;
}
export type {
Callback,
FailedPolicyRequirement,
NameValue,
PolicyParams,
PolicyRequirement,
Step,
StepDetail,
};