@thunderid/javascript 1.13.1 → 1.15.0
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/dist/api/auth/flows/getFlows.d.ts +7 -1
- package/dist/api/auth/flows/getFlows.d.ts.map +1 -1
- package/dist/api/management/connections/getConnections.d.ts +7 -1
- package/dist/api/management/connections/getConnections.d.ts.map +1 -1
- package/dist/api/management/flows/getFlow.d.ts +6 -1
- package/dist/api/management/flows/getFlow.d.ts.map +1 -1
- package/dist/cjs/index.cjs +476 -12
- package/dist/constants/FlowQueryKeys.d.ts +9 -0
- package/dist/constants/FlowQueryKeys.d.ts.map +1 -0
- package/dist/constants/FlowVariableQueryKeys.d.ts +10 -0
- package/dist/constants/FlowVariableQueryKeys.d.ts.map +1 -0
- package/dist/edge/index.js +471 -13
- package/dist/i18n/models/i18n.d.ts +35 -0
- package/dist/i18n/models/i18n.d.ts.map +1 -1
- package/dist/i18n/translations/en-US.d.ts.map +1 -1
- package/dist/i18n/translations/fr-FR.d.ts.map +1 -1
- package/dist/i18n/translations/hi-IN.d.ts.map +1 -1
- package/dist/i18n/translations/ja-JP.d.ts.map +1 -1
- package/dist/i18n/translations/pt-BR.d.ts.map +1 -1
- package/dist/i18n/translations/pt-PT.d.ts.map +1 -1
- package/dist/i18n/translations/si-LK.d.ts.map +1 -1
- package/dist/i18n/translations/ta-IN.d.ts.map +1 -1
- package/dist/i18n/translations/te-IN.d.ts.map +1 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +471 -13
- package/dist/models/agent-resource.d.ts +22 -3
- package/dist/models/agent-resource.d.ts.map +1 -1
- package/dist/models/flow-variable.d.ts +66 -0
- package/dist/models/flow-variable.d.ts.map +1 -0
- package/dist/models/managed-flow.d.ts +23 -0
- package/dist/models/managed-flow.d.ts.map +1 -1
- package/dist/utils/getFlowVariableDefinitions.d.ts +12 -0
- package/dist/utils/getFlowVariableDefinitions.d.ts.map +1 -0
- package/dist/utils/getFlowVariableOptions.d.ts +28 -0
- package/dist/utils/getFlowVariableOptions.d.ts.map +1 -0
- package/dist/utils/resolveFlowVariableRule.d.ts +36 -0
- package/dist/utils/resolveFlowVariableRule.d.ts.map +1 -0
- package/dist/utils/validateFlowVariableValue.d.ts +19 -0
- package/dist/utils/validateFlowVariableValue.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -13,6 +13,25 @@ export interface AgentInboundAuthConfig {
|
|
|
13
13
|
export interface AgentLoginConsentConfig {
|
|
14
14
|
validityPeriod?: number;
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* What an agent owner's `id` holds.
|
|
18
|
+
*/
|
|
19
|
+
export type AgentOwnerIdType = 'uuid' | 'email' | 'mobile';
|
|
20
|
+
/**
|
|
21
|
+
* The person accountable for an agent. A local owner is an entity of the same deployment and is
|
|
22
|
+
* named by its entity ID. An owner managed in another identity system is not looked up.
|
|
23
|
+
*/
|
|
24
|
+
export interface AgentOwner {
|
|
25
|
+
id: string;
|
|
26
|
+
/**
|
|
27
|
+
* Defaults to `uuid`. A local owner must be a `uuid`.
|
|
28
|
+
*/
|
|
29
|
+
idType?: AgentOwnerIdType;
|
|
30
|
+
/**
|
|
31
|
+
* Whether the owner is an entity of this deployment. Defaults to `true`.
|
|
32
|
+
*/
|
|
33
|
+
isLocal?: boolean;
|
|
34
|
+
}
|
|
16
35
|
/**
|
|
17
36
|
* An agent registered in ThunderID.
|
|
18
37
|
*/
|
|
@@ -43,7 +62,7 @@ export interface Agent {
|
|
|
43
62
|
logoUrl?: string;
|
|
44
63
|
ouHandle?: string;
|
|
45
64
|
ouId: string;
|
|
46
|
-
owner?:
|
|
65
|
+
owner?: AgentOwner;
|
|
47
66
|
registrationFlowId?: string;
|
|
48
67
|
/**
|
|
49
68
|
* The effective access status, set by the server on a read.
|
|
@@ -97,7 +116,7 @@ export interface CreateAgentRequest {
|
|
|
97
116
|
* The organization unit the agent is created in. Required unless `projectId` is given.
|
|
98
117
|
*/
|
|
99
118
|
ouId?: string;
|
|
100
|
-
owner?:
|
|
119
|
+
owner?: AgentOwner;
|
|
101
120
|
/**
|
|
102
121
|
* Creates the agent in the project's root organization unit. Served by the control plane.
|
|
103
122
|
*/
|
|
@@ -125,7 +144,7 @@ export interface UpdateAgentRequest {
|
|
|
125
144
|
isRegistrationFlowEnabled?: boolean;
|
|
126
145
|
logoUrl?: string;
|
|
127
146
|
ouId?: string;
|
|
128
|
-
owner?:
|
|
147
|
+
owner?: AgentOwner;
|
|
129
148
|
registrationFlowId?: string;
|
|
130
149
|
type?: string;
|
|
131
150
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-resource.d.ts","sourceRoot":"","sources":["../../src/models/agent-resource.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAC,eAAe,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,M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AAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,SAAS,EAAE,CAAC;CACpB"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { FlowVariableValue, FlowVariables } from './managed-flow';
|
|
2
|
+
/**
|
|
3
|
+
* The input a flow variable is edited with.
|
|
4
|
+
*/
|
|
5
|
+
export type FlowVariableType = 'TEXT_INPUT' | 'EMAIL_INPUT' | 'PHONE_INPUT' | 'NUMBER_INPUT' | 'DATE_INPUT' | 'BOOLEAN_INPUT' | 'SELECT' | 'CONNECTION_SELECT';
|
|
6
|
+
/**
|
|
7
|
+
* A rule a text value has to meet.
|
|
8
|
+
*/
|
|
9
|
+
export interface FlowVariableValidationRule {
|
|
10
|
+
/**
|
|
11
|
+
* The message shown when the rule fails. An i18n key or a literal string.
|
|
12
|
+
*/
|
|
13
|
+
message?: string;
|
|
14
|
+
type: 'regex' | 'minLength' | 'maxLength';
|
|
15
|
+
value: string | number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A variable a flow declares on its `VARIABLES` node.
|
|
19
|
+
*/
|
|
20
|
+
export interface FlowVariableDefinition {
|
|
21
|
+
/**
|
|
22
|
+
* For a `CONNECTION_SELECT`: the kind of connection it takes, such as `IDENTITY_PROVIDER`.
|
|
23
|
+
*/
|
|
24
|
+
category?: string;
|
|
25
|
+
/**
|
|
26
|
+
* For a `CONNECTION_SELECT`: limits it to these vendors, such as `google`.
|
|
27
|
+
*/
|
|
28
|
+
connectionTypes?: string[];
|
|
29
|
+
/**
|
|
30
|
+
* The value the variable has until another is set.
|
|
31
|
+
*/
|
|
32
|
+
defaultValue?: FlowVariableValue;
|
|
33
|
+
description?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Name of the variable, which a `{{var(name)}}` placeholder uses.
|
|
36
|
+
*/
|
|
37
|
+
identifier: string;
|
|
38
|
+
label?: string;
|
|
39
|
+
/**
|
|
40
|
+
* For a `NUMBER_INPUT`: the highest value.
|
|
41
|
+
*/
|
|
42
|
+
max?: number;
|
|
43
|
+
/**
|
|
44
|
+
* For a `NUMBER_INPUT`: the lowest value.
|
|
45
|
+
*/
|
|
46
|
+
min?: number;
|
|
47
|
+
/**
|
|
48
|
+
* For a `SELECT`: the values it can take.
|
|
49
|
+
*/
|
|
50
|
+
options?: FlowVariableValue[];
|
|
51
|
+
type: FlowVariableType;
|
|
52
|
+
validation?: FlowVariableValidationRule[];
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The values an organization unit has set for a flow's variables, keyed by identifier. A variable it has
|
|
56
|
+
* not set is absent.
|
|
57
|
+
*/
|
|
58
|
+
export type FlowVariableValues = FlowVariables['values'];
|
|
59
|
+
/**
|
|
60
|
+
* Why a value does not fit its variable. `message` is set when the variable's own rule supplies the text.
|
|
61
|
+
*/
|
|
62
|
+
export interface FlowVariableValidationError {
|
|
63
|
+
code: 'invalid' | 'max' | 'max_length' | 'min' | 'min_length' | 'not_option' | 'pattern' | 'required';
|
|
64
|
+
message?: string;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=flow-variable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-variable.d.ts","sourceRoot":"","sources":["../../src/models/flow-variable.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,iBAAiB,EAAE,aAAa,EAAC,MAAM,gBAAgB,CAAC;AAEhE;;GAEG;AACH,MAAM,MAAM,gBAAgB,GACxB,YAAY,GACZ,aAAa,GACb,aAAa,GACb,cAAc,GACd,YAAY,GACZ,eAAe,GACf,QAAQ,GACR,mBAAmB,CAAC;AAExB;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,OAAO,GAAG,WAAW,GAAG,WAAW,CAAC;IAC1C,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B;;OAEG;IACH,YAAY,CAAC,EAAE,iBAAiB,CAAC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,OAAO,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC9B,IAAI,EAAE,gBAAgB,CAAC;IACvB,UAAU,CAAC,EAAE,0BAA0B,EAAE,CAAC;CAC3C;AAED;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,SAAS,GAAG,KAAK,GAAG,YAAY,GAAG,KAAK,GAAG,YAAY,GAAG,YAAY,GAAG,SAAS,GAAG,UAAU,CAAC;IACtG,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ApiPaginationLink } from './api';
|
|
2
|
+
import { FlowVariableDefinition } from './flow-variable';
|
|
2
3
|
/**
|
|
3
4
|
* A flow definition as listed by the ThunderID management API.
|
|
4
5
|
*/
|
|
@@ -8,6 +9,11 @@ export interface ManagedFlow {
|
|
|
8
9
|
flowType: string;
|
|
9
10
|
handle: string;
|
|
10
11
|
id: string;
|
|
12
|
+
/**
|
|
13
|
+
* In a list requested for an organization unit: whether it owns the flow. `false` means the flow was shared
|
|
14
|
+
* with it.
|
|
15
|
+
*/
|
|
16
|
+
isOwnedByOU?: boolean;
|
|
11
17
|
isReadOnly?: boolean;
|
|
12
18
|
name: string;
|
|
13
19
|
updatedAt?: string;
|
|
@@ -40,6 +46,10 @@ export interface ManagedFlowNode {
|
|
|
40
46
|
ref: string;
|
|
41
47
|
};
|
|
42
48
|
id: string;
|
|
49
|
+
/**
|
|
50
|
+
* On a `VARIABLES` node: the variables the flow declares.
|
|
51
|
+
*/
|
|
52
|
+
inputs?: Record<string, unknown>[];
|
|
43
53
|
layout?: {
|
|
44
54
|
position?: {
|
|
45
55
|
x: number;
|
|
@@ -68,7 +78,20 @@ export interface ManagedFlowNode {
|
|
|
68
78
|
* A flow with its graph.
|
|
69
79
|
*/
|
|
70
80
|
export interface ManagedFlowDefinition extends ManagedFlow {
|
|
81
|
+
/**
|
|
82
|
+
* Whether the organization unit the flow was requested for owns it.
|
|
83
|
+
*/
|
|
84
|
+
isOwnedByOU?: boolean;
|
|
71
85
|
nodes: ManagedFlowNode[];
|
|
86
|
+
/**
|
|
87
|
+
* The organization unit the flow was requested for.
|
|
88
|
+
*/
|
|
89
|
+
ouId?: string;
|
|
90
|
+
/**
|
|
91
|
+
* Set on a flow shared with the requested organization unit, which comes back as its variables only. A
|
|
92
|
+
* flow the unit owns declares them on its `VARIABLES` node instead.
|
|
93
|
+
*/
|
|
94
|
+
variables?: FlowVariableDefinition[];
|
|
72
95
|
}
|
|
73
96
|
/**
|
|
74
97
|
* The payload used to create or update a flow.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"managed-flow.d.ts","sourceRoot":"","sources":["../../src/models/managed-flow.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,iBAAiB,EAAC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"managed-flow.d.ts","sourceR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,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,sBAAsB,EAAE,CAAC;CACrC;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAE1D;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;CAC3C"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FlowVariableDefinition } from '../models/flow-variable';
|
|
2
|
+
import { ManagedFlowDefinition } from '../models/managed-flow';
|
|
3
|
+
/**
|
|
4
|
+
* Reads the variables a flow declares. A flow shared with an organization unit lists them in `variables`; a
|
|
5
|
+
* flow the unit owns declares them on its `VARIABLES` node.
|
|
6
|
+
*
|
|
7
|
+
* @param flow - The flow, as `getFlow` returns it.
|
|
8
|
+
* @returns The declared variables, empty when the flow declares none.
|
|
9
|
+
*/
|
|
10
|
+
declare const getFlowVariableDefinitions: (flow: Pick<ManagedFlowDefinition, "nodes" | "variables"> | undefined) => FlowVariableDefinition[];
|
|
11
|
+
export default getFlowVariableDefinitions;
|
|
12
|
+
//# sourceMappingURL=getFlowVariableDefinitions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getFlowVariableDefinitions.d.ts","sourceRoot":"","sources":["../../src/utils/getFlowVariableDefinitions.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,sBAAsB,EAAC,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAC,qBAAqB,EAAC,MAAM,wBAAwB,CAAC;AAI7D;;;;;;GAMG;AACH,QAAA,MAAM,0BAA0B,GAC9B,MAAM,IAAI,CAAC,qBAAqB,EAAE,OAAO,GAAG,WAAW,CAAC,GAAG,SAAS,KACnE,sBAAsB,EAcxB,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ConnectionInstance } from '../models/connection';
|
|
2
|
+
import { FlowVariableDefinition } from '../models/flow-variable';
|
|
3
|
+
/**
|
|
4
|
+
* A choice of a `SELECT` or `CONNECTION_SELECT` variable.
|
|
5
|
+
*/
|
|
6
|
+
export interface FlowVariableOption {
|
|
7
|
+
label: string;
|
|
8
|
+
value: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Narrows what a unit may choose from, as a sharing policy decides.
|
|
12
|
+
*/
|
|
13
|
+
export interface FlowVariableOptionRestriction {
|
|
14
|
+
allowedValues?: string[];
|
|
15
|
+
excludedValues?: string[];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Lists what a select variable can take. A `SELECT` takes the values it declares; a `CONNECTION_SELECT` takes the
|
|
19
|
+
* connections of its `category` and `connectionTypes`.
|
|
20
|
+
*
|
|
21
|
+
* @param definition - The variable.
|
|
22
|
+
* @param connections - The connections available to the organization unit.
|
|
23
|
+
* @param restriction - The values a sharing policy lets the unit choose from, or takes away.
|
|
24
|
+
* @returns The choices, each with the value to store.
|
|
25
|
+
*/
|
|
26
|
+
declare const getFlowVariableOptions: (definition: FlowVariableDefinition, connections?: Pick<ConnectionInstance, "categories" | "id" | "name" | "type">[], restriction?: FlowVariableOptionRestriction) => FlowVariableOption[];
|
|
27
|
+
export default getFlowVariableOptions;
|
|
28
|
+
//# sourceMappingURL=getFlowVariableOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getFlowVariableOptions.d.ts","sourceRoot":"","sources":["../../src/utils/getFlowVariableOptions.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAC,sBAAsB,EAAC,MAAM,yBAAyB,CAAC;AAG/D;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAID;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED;;;;;;;;GAQG;AACH,QAAA,MAAM,sBAAsB,GAC1B,YAAY,sBAAsB,EAClC,cAAa,IAAI,CAAC,kBAAkB,EAAE,YAAY,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC,EAAO,EACnF,cAAa,6BAAkC,KAC9C,kBAAkB,EA6BpB,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { FlowVariableDefinition } from '../models/flow-variable';
|
|
2
|
+
import { FlowVariableValue } from '../models/managed-flow';
|
|
3
|
+
import { ResolvedOverlay } from '../models/sharing-policy';
|
|
4
|
+
/**
|
|
5
|
+
* What an organization unit may do with one variable, after the sharing policies that reach it are applied.
|
|
6
|
+
*/
|
|
7
|
+
export interface ResolvedFlowVariableRule {
|
|
8
|
+
/**
|
|
9
|
+
* The values the unit may choose from. Absent means anything the variable accepts.
|
|
10
|
+
*/
|
|
11
|
+
allowedValues?: string[];
|
|
12
|
+
/**
|
|
13
|
+
* The value the variable has until the unit sets its own, or the value it is pinned to when it cannot set one.
|
|
14
|
+
*/
|
|
15
|
+
defaultValue: FlowVariableValue | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the unit may set its own value.
|
|
18
|
+
*/
|
|
19
|
+
editable: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Values taken out of what the unit may choose.
|
|
22
|
+
*/
|
|
23
|
+
excludedValues?: string[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Works out what an organization unit may do with a variable. A unit that owns the flow may set everything. For a
|
|
27
|
+
* flow shared with it, a variable no policy names cannot be edited and keeps the owner's default. Without an
|
|
28
|
+
* overlay, such as in a preview, every variable is editable.
|
|
29
|
+
*
|
|
30
|
+
* @param definition - The variable.
|
|
31
|
+
* @param overlay - What the unit may do with the flow, as `getFlowOverlayRules` returns it.
|
|
32
|
+
* @returns The rule that applies to the variable.
|
|
33
|
+
*/
|
|
34
|
+
declare const resolveFlowVariableRule: (definition: FlowVariableDefinition, overlay?: ResolvedOverlay) => ResolvedFlowVariableRule;
|
|
35
|
+
export default resolveFlowVariableRule;
|
|
36
|
+
//# sourceMappingURL=resolveFlowVariableRule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveFlowVariableRule.d.ts","sourceRoot":"","sources":["../../src/utils/resolveFlowVariableRule.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,sBAAsB,EAAC,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAc,eAAe,EAAC,MAAM,0BAA0B,CAAC;AAEtE;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB;;OAEG;IACH,YAAY,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAC5C;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AA0BD;;;;;;;;GAQG;AACH,QAAA,MAAM,uBAAuB,GAC3B,YAAY,sBAAsB,EAClC,UAAU,eAAe,KACxB,wBAeF,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FlowVariableDefinition, FlowVariableValidationError } from '../models/flow-variable';
|
|
2
|
+
import { FlowVariableValue } from '../models/managed-flow';
|
|
3
|
+
/**
|
|
4
|
+
* Checks a value against a variable's type, options and rules, so a form can report what is wrong before the
|
|
5
|
+
* server does. The server validates again on save.
|
|
6
|
+
*
|
|
7
|
+
* @param definition - The variable the value is for.
|
|
8
|
+
* @param value - The value to check.
|
|
9
|
+
* @returns What is wrong with the value, or `undefined` when it is valid.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const error = validateFlowVariableValue({identifier: 'email', type: 'EMAIL_INPUT'}, 'nope');
|
|
14
|
+
* // {code: 'invalid'}
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
declare const validateFlowVariableValue: (definition: FlowVariableDefinition, value: FlowVariableValue | undefined) => FlowVariableValidationError | undefined;
|
|
18
|
+
export default validateFlowVariableValue;
|
|
19
|
+
//# sourceMappingURL=validateFlowVariableValue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateFlowVariableValue.d.ts","sourceRoot":"","sources":["../../src/utils/validateFlowVariableValue.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,sBAAsB,EAAE,2BAA2B,EAAC,MAAM,yBAAyB,CAAC;AAC5F,OAAO,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;AAiBzD;;;;;;;;;;;;;GAaG;AACH,QAAA,MAAM,yBAAyB,GAC7B,YAAY,sBAAsB,EAClC,OAAO,iBAAiB,GAAG,SAAS,KACnC,2BAA2B,GAAG,SAuDhC,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
|