@thunderid/javascript 1.11.0 → 1.13.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/ThunderIDJavaScriptClient.d.ts +86 -1
- package/dist/ThunderIDJavaScriptClient.d.ts.map +1 -1
- package/dist/api/account/getAccessibleOrganizationUnits.d.ts +38 -0
- package/dist/api/account/getAccessibleOrganizationUnits.d.ts.map +1 -0
- package/dist/api/auth/executeEmbeddedDeviceGrantFlow.d.ts +11 -2
- package/dist/api/auth/executeEmbeddedDeviceGrantFlow.d.ts.map +1 -1
- package/dist/api/auth/executeEmbeddedSelfFlow.d.ts +57 -0
- package/dist/api/auth/executeEmbeddedSelfFlow.d.ts.map +1 -0
- package/dist/api/auth/executeEmbeddedSignInFlow.d.ts.map +1 -1
- package/dist/api/auth/getSupportedAuthorizationDetailsType.d.ts +29 -0
- package/dist/api/auth/getSupportedAuthorizationDetailsType.d.ts.map +1 -0
- package/dist/api/auth/getSupportedAuthorizationDetailsTypes.d.ts +24 -0
- package/dist/api/auth/getSupportedAuthorizationDetailsTypes.d.ts.map +1 -0
- package/dist/api/management/agents/getAgents.d.ts +8 -2
- package/dist/api/management/agents/getAgents.d.ts.map +1 -1
- package/dist/api/management/applications/getApplications.d.ts +8 -2
- package/dist/api/management/applications/getApplications.d.ts.map +1 -1
- package/dist/api/management/authorization-detail-types/createAuthorizationDetailType.d.ts +28 -0
- package/dist/api/management/authorization-detail-types/createAuthorizationDetailType.d.ts.map +1 -0
- package/dist/api/management/authorization-detail-types/deleteAuthorizationDetailType.d.ts +24 -0
- package/dist/api/management/authorization-detail-types/deleteAuthorizationDetailType.d.ts.map +1 -0
- package/dist/api/management/authorization-detail-types/getAuthorizationDetailType.d.ts +25 -0
- package/dist/api/management/authorization-detail-types/getAuthorizationDetailType.d.ts.map +1 -0
- package/dist/api/management/authorization-detail-types/getAuthorizationDetailTypes.d.ts +20 -0
- package/dist/api/management/authorization-detail-types/getAuthorizationDetailTypes.d.ts.map +1 -0
- package/dist/api/management/authorization-detail-types/updateAuthorizationDetailType.d.ts +33 -0
- package/dist/api/management/authorization-detail-types/updateAuthorizationDetailType.d.ts.map +1 -0
- package/dist/api/management/client-registrations/deleteClientRegistration.d.ts +24 -0
- package/dist/api/management/client-registrations/deleteClientRegistration.d.ts.map +1 -0
- package/dist/api/management/client-registrations/getClientRegistration.d.ts +26 -0
- package/dist/api/management/client-registrations/getClientRegistration.d.ts.map +1 -0
- package/dist/api/management/client-registrations/mapClientRegistration.d.ts +11 -0
- package/dist/api/management/client-registrations/mapClientRegistration.d.ts.map +1 -0
- package/dist/api/management/client-registrations/registerClient.d.ts +31 -0
- package/dist/api/management/client-registrations/registerClient.d.ts.map +1 -0
- package/dist/api/management/client-registrations/updateClientRegistration.d.ts +34 -0
- package/dist/api/management/client-registrations/updateClientRegistration.d.ts.map +1 -0
- package/dist/api/management/credential-configurations/createCredentialConfiguration.d.ts +25 -0
- package/dist/api/management/credential-configurations/createCredentialConfiguration.d.ts.map +1 -0
- package/dist/api/management/credential-configurations/deleteCredentialConfiguration.d.ts +24 -0
- package/dist/api/management/credential-configurations/deleteCredentialConfiguration.d.ts.map +1 -0
- package/dist/api/management/credential-configurations/getCredentialConfiguration.d.ts +25 -0
- package/dist/api/management/credential-configurations/getCredentialConfiguration.d.ts.map +1 -0
- package/dist/api/management/credential-configurations/getCredentialConfigurations.d.ts +20 -0
- package/dist/api/management/credential-configurations/getCredentialConfigurations.d.ts.map +1 -0
- package/dist/api/management/credential-configurations/updateCredentialConfiguration.d.ts +29 -0
- package/dist/api/management/credential-configurations/updateCredentialConfiguration.d.ts.map +1 -0
- package/dist/api/management/flows/createFlowSharingPolicy.d.ts +33 -0
- package/dist/api/management/flows/createFlowSharingPolicy.d.ts.map +1 -0
- package/dist/api/management/flows/deleteFlowSharingPolicy.d.ts +28 -0
- package/dist/api/management/flows/deleteFlowSharingPolicy.d.ts.map +1 -0
- package/dist/api/management/flows/getFlowOverlayRules.d.ts +31 -0
- package/dist/api/management/flows/getFlowOverlayRules.d.ts.map +1 -0
- package/dist/api/management/flows/getFlowSharingPolicies.d.ts +25 -0
- package/dist/api/management/flows/getFlowSharingPolicies.d.ts.map +1 -0
- package/dist/api/management/flows/getFlowSharingPolicy.d.ts +29 -0
- package/dist/api/management/flows/getFlowSharingPolicy.d.ts.map +1 -0
- package/dist/api/management/flows/getFlowVariables.d.ts +31 -0
- package/dist/api/management/flows/getFlowVariables.d.ts.map +1 -0
- package/dist/api/management/flows/updateFlowSharingPolicy.d.ts +39 -0
- package/dist/api/management/flows/updateFlowSharingPolicy.d.ts.map +1 -0
- package/dist/api/management/flows/updateFlowVariables.d.ts +41 -0
- package/dist/api/management/flows/updateFlowVariables.d.ts.map +1 -0
- package/dist/api/management/gateways/getGatewayMaster.d.ts +25 -0
- package/dist/api/management/gateways/getGatewayMaster.d.ts.map +1 -0
- package/dist/api/management/gateways/getGatewayMasterHistory.d.ts +26 -0
- package/dist/api/management/gateways/getGatewayMasterHistory.d.ts.map +1 -0
- package/dist/api/management/gateways/getGatewayMasterResource.d.ts +39 -0
- package/dist/api/management/gateways/getGatewayMasterResource.d.ts.map +1 -0
- package/dist/api/management/groups/createGroupByPath.d.ts +34 -0
- package/dist/api/management/groups/createGroupByPath.d.ts.map +1 -0
- package/dist/api/management/groups/getGroupsByPath.d.ts +26 -0
- package/dist/api/management/groups/getGroupsByPath.d.ts.map +1 -0
- package/dist/api/management/presentation-definitions/createPresentationDefinition.d.ts +25 -0
- package/dist/api/management/presentation-definitions/createPresentationDefinition.d.ts.map +1 -0
- package/dist/api/management/presentation-definitions/deletePresentationDefinition.d.ts +24 -0
- package/dist/api/management/presentation-definitions/deletePresentationDefinition.d.ts.map +1 -0
- package/dist/api/management/presentation-definitions/getPresentationDefinition.d.ts +25 -0
- package/dist/api/management/presentation-definitions/getPresentationDefinition.d.ts.map +1 -0
- package/dist/api/management/presentation-definitions/getPresentationDefinitions.d.ts +20 -0
- package/dist/api/management/presentation-definitions/getPresentationDefinitions.d.ts.map +1 -0
- package/dist/api/management/presentation-definitions/updatePresentationDefinition.d.ts +29 -0
- package/dist/api/management/presentation-definitions/updatePresentationDefinition.d.ts.map +1 -0
- package/dist/api/management/projects/createProject.d.ts +28 -0
- package/dist/api/management/projects/createProject.d.ts.map +1 -0
- package/dist/api/management/projects/deleteProject.d.ts +24 -0
- package/dist/api/management/projects/deleteProject.d.ts.map +1 -0
- package/dist/api/management/projects/getProject.d.ts +25 -0
- package/dist/api/management/projects/getProject.d.ts.map +1 -0
- package/dist/api/management/projects/getProjects.d.ts +20 -0
- package/dist/api/management/projects/getProjects.d.ts.map +1 -0
- package/dist/api/management/projects/updateProject.d.ts +33 -0
- package/dist/api/management/projects/updateProject.d.ts.map +1 -0
- package/dist/api/management/resource-servers/getResourceServerPermissions.d.ts +32 -0
- package/dist/api/management/resource-servers/getResourceServerPermissions.d.ts.map +1 -0
- package/dist/api/management/roles/createRoleSharingPolicy.d.ts +33 -0
- package/dist/api/management/roles/createRoleSharingPolicy.d.ts.map +1 -0
- package/dist/api/management/roles/deleteRoleSharingPolicy.d.ts +28 -0
- package/dist/api/management/roles/deleteRoleSharingPolicy.d.ts.map +1 -0
- package/dist/api/management/roles/getRoleOverlayRules.d.ts +30 -0
- package/dist/api/management/roles/getRoleOverlayRules.d.ts.map +1 -0
- package/dist/api/management/roles/getRoleSharingPolicies.d.ts +25 -0
- package/dist/api/management/roles/getRoleSharingPolicies.d.ts.map +1 -0
- package/dist/api/management/roles/getRoleSharingPolicy.d.ts +29 -0
- package/dist/api/management/roles/getRoleSharingPolicy.d.ts.map +1 -0
- package/dist/api/management/roles/updateRoleSharingPolicy.d.ts +39 -0
- package/dist/api/management/roles/updateRoleSharingPolicy.d.ts.map +1 -0
- package/dist/cjs/index.cjs +4787 -1135
- package/dist/constants/AttributeVerificationConstants.d.ts +13 -0
- package/dist/constants/AttributeVerificationConstants.d.ts.map +1 -0
- package/dist/constants/ManagementErrorKeys.d.ts +17 -0
- package/dist/constants/ManagementErrorKeys.d.ts.map +1 -0
- package/dist/constants/OrganizationUnitQueryKeys.d.ts +14 -0
- package/dist/constants/OrganizationUnitQueryKeys.d.ts.map +1 -0
- package/dist/constants/ProjectQueryKeys.d.ts +10 -0
- package/dist/constants/ProjectQueryKeys.d.ts.map +1 -0
- package/dist/constants/RoleQueryKeys.d.ts +1 -0
- package/dist/constants/RoleQueryKeys.d.ts.map +1 -1
- package/dist/constants/SharingPolicyQueryKeys.d.ts +11 -0
- package/dist/constants/SharingPolicyQueryKeys.d.ts.map +1 -0
- package/dist/edge/index.js +4716 -1136
- package/dist/i18n/models/i18n.d.ts +158 -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 +130 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4716 -1136
- package/dist/models/accessible-organization-unit.d.ts +93 -0
- package/dist/models/accessible-organization-unit.d.ts.map +1 -0
- package/dist/models/agent-resource.d.ts +8 -1
- package/dist/models/agent-resource.d.ts.map +1 -1
- package/dist/models/application.d.ts +8 -2
- package/dist/models/application.d.ts.map +1 -1
- package/dist/models/authorization-detail-type.d.ts +101 -0
- package/dist/models/authorization-detail-type.d.ts.map +1 -0
- package/dist/models/client-registration.d.ts +71 -0
- package/dist/models/client-registration.d.ts.map +1 -0
- package/dist/models/client.d.ts +14 -0
- package/dist/models/client.d.ts.map +1 -1
- package/dist/models/config.d.ts +49 -1
- package/dist/models/config.d.ts.map +1 -1
- package/dist/models/credential-configuration.d.ts +56 -0
- package/dist/models/credential-configuration.d.ts.map +1 -0
- package/dist/models/device-authorization.d.ts +56 -0
- package/dist/models/device-authorization.d.ts.map +1 -0
- package/dist/models/embedded-flow.d.ts +3 -0
- package/dist/models/embedded-flow.d.ts.map +1 -1
- package/dist/models/embedded-self-flow.d.ts +75 -0
- package/dist/models/embedded-self-flow.d.ts.map +1 -0
- package/dist/models/embedded-signin-flow.d.ts +10 -0
- package/dist/models/embedded-signin-flow.d.ts.map +1 -1
- package/dist/models/extensions/components.d.ts +1 -1
- package/dist/models/extensions/components.d.ts.map +1 -1
- package/dist/models/gateway.d.ts +70 -0
- package/dist/models/gateway.d.ts.map +1 -1
- package/dist/models/group.d.ts +5 -0
- package/dist/models/group.d.ts.map +1 -1
- package/dist/models/managed-flow.d.ts +11 -0
- package/dist/models/managed-flow.d.ts.map +1 -1
- package/dist/models/oauth-request.d.ts +5 -0
- package/dist/models/oauth-request.d.ts.map +1 -1
- package/dist/models/oidc-discovery.d.ts +13 -0
- package/dist/models/oidc-discovery.d.ts.map +1 -1
- package/dist/models/presentation-definition.d.ts +48 -0
- package/dist/models/presentation-definition.d.ts.map +1 -0
- package/dist/models/project.d.ts +50 -0
- package/dist/models/project.d.ts.map +1 -0
- package/dist/models/resource-server.d.ts +14 -0
- package/dist/models/resource-server.d.ts.map +1 -1
- package/dist/models/session.d.ts +16 -0
- package/dist/models/session.d.ts.map +1 -1
- package/dist/models/sharing-policy.d.ts +39 -2
- package/dist/models/sharing-policy.d.ts.map +1 -1
- package/dist/models/token.d.ts +12 -0
- package/dist/models/token.d.ts.map +1 -1
- package/dist/models/user.d.ts +9 -0
- package/dist/models/user.d.ts.map +1 -1
- package/dist/utils/AuthenticationHelper.d.ts +4 -1
- package/dist/utils/AuthenticationHelper.d.ts.map +1 -1
- package/dist/utils/getCurrentOrganizationUnitFromClaims.d.ts +14 -0
- package/dist/utils/getCurrentOrganizationUnitFromClaims.d.ts.map +1 -0
- package/dist/utils/getFlowStepComponents.d.ts +26 -0
- package/dist/utils/getFlowStepComponents.d.ts.map +1 -0
- package/dist/utils/getVerifiedAttributes.d.ts +14 -0
- package/dist/utils/getVerifiedAttributes.d.ts.map +1 -0
- package/dist/utils/isVerifiableAttribute.d.ts +22 -0
- package/dist/utils/isVerifiableAttribute.d.ts.map +1 -0
- package/dist/utils/parseSelfFlowRequest.d.ts +24 -0
- package/dist/utils/parseSelfFlowRequest.d.ts.map +1 -0
- package/dist/utils/requestManagementResource.d.ts +2 -1
- package/dist/utils/requestManagementResource.d.ts.map +1 -1
- package/dist/utils/resolveOrganizationUnitEndpoint.d.ts +20 -0
- package/dist/utils/resolveOrganizationUnitEndpoint.d.ts.map +1 -0
- package/dist/utils/resolveResourceEndpoint.d.ts +1 -1
- package/dist/utils/resolveResourceEndpoint.d.ts.map +1 -1
- package/dist/utils/sharingPolicies.d.ts +126 -0
- package/dist/utils/sharingPolicies.d.ts.map +1 -0
- package/dist/utils/toManagementErrorMessage.d.ts +5 -3
- package/dist/utils/toManagementErrorMessage.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -5,6 +5,11 @@ import { ApiPaginationLink } from './api';
|
|
|
5
5
|
*/
|
|
6
6
|
export interface SharingPolicyAllUnits {
|
|
7
7
|
excludedOuIds?: string[];
|
|
8
|
+
/**
|
|
9
|
+
* The terms the organization units reached hold the resource on, keyed by field: `roles` for a user,
|
|
10
|
+
* `assignments` for a role, `variables.<identifier>` for a flow.
|
|
11
|
+
*/
|
|
12
|
+
overlayRules?: Record<string, OverlayRule>;
|
|
8
13
|
}
|
|
9
14
|
/**
|
|
10
15
|
* Everything beneath the issuing organization unit, including units created later.
|
|
@@ -15,12 +20,22 @@ export interface SharingPolicyChildUnitsAll {
|
|
|
15
20
|
*/
|
|
16
21
|
excludedOuIds?: string[];
|
|
17
22
|
mode: 'all';
|
|
23
|
+
/**
|
|
24
|
+
* The terms the organization units reached hold the resource on, keyed by field: `roles` for a user,
|
|
25
|
+
* `assignments` for a role, `variables.<identifier>` for a flow.
|
|
26
|
+
*/
|
|
27
|
+
overlayRules?: Record<string, OverlayRule>;
|
|
18
28
|
}
|
|
19
29
|
/**
|
|
20
30
|
* A named organization unit directly beneath the issuer.
|
|
21
31
|
*/
|
|
22
32
|
export interface SharingPolicyChildUnit {
|
|
23
33
|
ouId: string;
|
|
34
|
+
/**
|
|
35
|
+
* The terms the organization units reached hold the resource on, keyed by field: `roles` for a user,
|
|
36
|
+
* `assignments` for a role, `variables.<identifier>` for a flow.
|
|
37
|
+
*/
|
|
38
|
+
overlayRules?: Record<string, OverlayRule>;
|
|
24
39
|
/**
|
|
25
40
|
* `unit` reaches the named organization unit only; `subtree` reaches it and everything below it.
|
|
26
41
|
*/
|
|
@@ -44,6 +59,7 @@ export interface SharingPolicyOtherTreeRootsSelected {
|
|
|
44
59
|
mode: 'selected';
|
|
45
60
|
units: {
|
|
46
61
|
ouId: string;
|
|
62
|
+
overlayRules?: Record<string, OverlayRule>;
|
|
47
63
|
}[];
|
|
48
64
|
}
|
|
49
65
|
/**
|
|
@@ -53,14 +69,19 @@ export interface SharingPolicyOtherTreeRootsSelected {
|
|
|
53
69
|
export interface SharingPolicyOtherTreeRootsAll {
|
|
54
70
|
excludedOuIds?: string[];
|
|
55
71
|
mode: 'all';
|
|
72
|
+
/**
|
|
73
|
+
* The terms the organization units reached hold the resource on, keyed by field: `roles` for a user,
|
|
74
|
+
* `assignments` for a role, `variables.<identifier>` for a flow.
|
|
75
|
+
*/
|
|
76
|
+
overlayRules?: Record<string, OverlayRule>;
|
|
56
77
|
}
|
|
57
78
|
/**
|
|
58
79
|
* The roots of other trees that a policy reaches.
|
|
59
80
|
*/
|
|
60
81
|
export type SharingPolicyOtherTreeRoots = SharingPolicyOtherTreeRootsSelected | SharingPolicyOtherTreeRootsAll;
|
|
61
82
|
/**
|
|
62
|
-
* A sharing policy: one organization unit's decision about which other organization units a user
|
|
63
|
-
* application reaches.
|
|
83
|
+
* A sharing policy: one organization unit's decision about which other organization units a user, an
|
|
84
|
+
* application, a role or a flow reaches.
|
|
64
85
|
*/
|
|
65
86
|
export interface SharingPolicy {
|
|
66
87
|
allUnits?: SharingPolicyAllUnits;
|
|
@@ -120,10 +141,26 @@ export interface OverlayRule {
|
|
|
120
141
|
* The overlay rules that apply to a user or an application in one organization unit.
|
|
121
142
|
*/
|
|
122
143
|
export interface ResolvedOverlay {
|
|
144
|
+
/**
|
|
145
|
+
* Whether the organization unit owns the resource. The server spells this flag `isOwned`,
|
|
146
|
+
* `isOwnedByOU` (roles, users) or `owned` (flows) depending on the resource; read whichever is set.
|
|
147
|
+
*/
|
|
123
148
|
isOwned?: boolean;
|
|
149
|
+
isOwnedByOU?: boolean;
|
|
150
|
+
owned?: boolean;
|
|
124
151
|
ouId?: string;
|
|
125
152
|
policyIds?: string[];
|
|
126
153
|
rules?: Record<string, OverlayRule>;
|
|
127
154
|
visible?: boolean;
|
|
128
155
|
}
|
|
156
|
+
/**
|
|
157
|
+
* What one organization unit may do with a role: whether it owns it, which policies reached it, and the
|
|
158
|
+
* effective rule for `assignments`, which says whether it may assign the role.
|
|
159
|
+
*/
|
|
160
|
+
export type RoleResolvedOverlay = ResolvedOverlay;
|
|
161
|
+
/**
|
|
162
|
+
* What one organization unit may do with a flow: whether it owns or can see it, which policies reached it,
|
|
163
|
+
* and the effective rule for each variable a policy named, keyed `variables.<identifier>`.
|
|
164
|
+
*/
|
|
165
|
+
export type FlowResolvedOverlay = ResolvedOverlay;
|
|
129
166
|
//# sourceMappingURL=sharing-policy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sharing-policy.d.ts","sourceRoot":"","sources":["../../src/models/sharing-policy.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,iBAAiB,EAAC,MAAM,OAAO,CAAC;AAExC;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{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EAAE,MAAM,EAAE,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACpC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,eAAe,CAAC;AAElD;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,eAAe,CAAC"}
|
package/dist/models/token.d.ts
CHANGED
|
@@ -82,6 +82,10 @@ export interface AccessTokenApiResponse {
|
|
|
82
82
|
* and calculate absolute expiration time.
|
|
83
83
|
*/
|
|
84
84
|
created_at: number;
|
|
85
|
+
/**
|
|
86
|
+
* The device secret, returned by a code exchange whose sign-in asked for the `device_sso` scope.
|
|
87
|
+
*/
|
|
88
|
+
device_secret?: string;
|
|
85
89
|
/**
|
|
86
90
|
* Raw expiration time in seconds.
|
|
87
91
|
* Indicates how long the access token will be valid
|
|
@@ -113,6 +117,14 @@ export interface AccessTokenApiResponse {
|
|
|
113
117
|
*/
|
|
114
118
|
token_type: string;
|
|
115
119
|
}
|
|
120
|
+
/**
|
|
121
|
+
* The outcome of a device secret exchange: the new tokens, or the OAuth error the server answered with.
|
|
122
|
+
*/
|
|
123
|
+
export type DeviceSecretSwitchResult = {
|
|
124
|
+
error: string;
|
|
125
|
+
} | {
|
|
126
|
+
tokenResponse: TokenResponse;
|
|
127
|
+
};
|
|
116
128
|
/**
|
|
117
129
|
* Interface for the standard (required) claims of an ID Token payload.
|
|
118
130
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../src/models/token.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,iBAAiB,CAAC;AAEzD;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAE7C;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAE9C;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAEvB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;I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ACtB;AAED,MAAM,WAAW,0BAA0B;IACzC,WAAW,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,GAAG,CAAC;IACV,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,OAAO,CAAC;IACxB,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB"}
|
package/dist/models/user.d.ts
CHANGED
|
@@ -12,4 +12,13 @@ export interface UserProfile {
|
|
|
12
12
|
flattenedProfile: User;
|
|
13
13
|
profile: User;
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Verification record of one of the user's attributes, as returned in `/users/me`.
|
|
17
|
+
*/
|
|
18
|
+
export interface VerifiedAttribute {
|
|
19
|
+
/**
|
|
20
|
+
* When the attribute's current value was verified, as an RFC 3339 timestamp.
|
|
21
|
+
*/
|
|
22
|
+
verifiedAt: string;
|
|
23
|
+
}
|
|
15
24
|
//# sourceMappingURL=user.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/models/user.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,SAAS;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,IAAK,SAAQ,SAAS;IACrC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,gBAAgB,EAAE,IAAI,CAAC;IACvB,OAAO,EAAE,IAAI,CAAC;CACf"}
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/models/user.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,SAAS;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,IAAK,SAAQ,SAAS;IACrC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,gBAAgB,EAAE,IAAI,CAAC;IACvB,OAAO,EAAE,IAAI,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -124,10 +124,13 @@ declare class AuthenticationHelper<T> {
|
|
|
124
124
|
*
|
|
125
125
|
* @param response - The raw HTTP response from the token endpoint.
|
|
126
126
|
* @param userId - Optional user ID scoping the session.
|
|
127
|
+
* @param replaceSession - Replace the whole session instead of merging into it, keeping only its device
|
|
128
|
+
* secret and SSO session handles, so no token of the previous session survives.
|
|
127
129
|
* @returns A normalized `TokenResponse` object.
|
|
128
130
|
* @throws {ThunderIDAuthException} When the response status is not 200.
|
|
129
131
|
*/
|
|
130
|
-
handleTokenResponse(response: Response, userId?: string): Promise<TokenResponse>;
|
|
132
|
+
handleTokenResponse(response: Response, userId?: string, replaceSession?: boolean): Promise<TokenResponse>;
|
|
133
|
+
private storeTokenResponse;
|
|
131
134
|
}
|
|
132
135
|
export default AuthenticationHelper;
|
|
133
136
|
//# sourceMappingURL=AuthenticationHelper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthenticationHelper.d.ts","sourceRoot":"","sources":["../../src/utils/AuthenticationHelper.ts"],"names":[],"mappings":"AAYA,OAAO,EAAC,gBAAgB,EAAC,MAAM,qBAAqB,CAAC;AAGrD,OAAO,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;AACzD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C;IAkCpF;;;;;;OAMG;IACU,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAiB/D;;;;;;;;OAQG;IACU,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IA2CjF;;;;;OAKG;YACW,YAAY;IAiC1B;;OAEG;IACH,OAAO,CAAC,aAAa;IAiBrB;;;;OAIG;YACW,SAAS;IA0CvB;;;;;OAKG;IACI,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAetD;;;;;;;OAOG;IACU,8BAA8B,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IA8C3F;;;;OAIG;IACU,YAAY,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKzD;;;;;;;;;;OAUG;IACU,mBAAmB,CAC9B,QAAQ,EAAE,QAAQ,EAClB,MAAM,CAAC,EAAE,MAAM,EACf,cAAc,UAAQ,GACrB,OAAO,CAAC,aAAa,CAAC;YA8CX,kBAAkB;CA4BjC;AAED,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CurrentOrganizationUnit } from '../models/accessible-organization-unit';
|
|
2
|
+
/**
|
|
3
|
+
* Reads the organization unit a session was issued for from its token claims: `ouId`, `ouHandle` and
|
|
4
|
+
* `ouName`, which name the unit the sign-in decided.
|
|
5
|
+
*
|
|
6
|
+
* The claims are read without verifying the token, so the result is for display only and MUST NOT be
|
|
7
|
+
* used for an authorization decision.
|
|
8
|
+
*
|
|
9
|
+
* @param claims - The decoded ID token (or sign-in assertion) payload.
|
|
10
|
+
* @returns The current organization unit, or `null` when the claims carry no `ouId`.
|
|
11
|
+
*/
|
|
12
|
+
declare const getCurrentOrganizationUnitFromClaims: (claims: Record<string, unknown> | null | undefined) => CurrentOrganizationUnit | null;
|
|
13
|
+
export default getCurrentOrganizationUnitFromClaims;
|
|
14
|
+
//# sourceMappingURL=getCurrentOrganizationUnitFromClaims.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCurrentOrganizationUnitFromClaims.d.ts","sourceRoot":"","sources":["../../src/utils/getCurrentOrganizationUnitFromClaims.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAQ/E;;;;;;;;;GASG;AACH,QAAA,MAAM,oCAAoC,GACxC,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,KACjD,uBAAuB,GAAG,IAe5B,CAAC;AAEF,eAAe,oCAAoC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { EmbeddedFlowComponent } from '../models/embedded-flow';
|
|
2
|
+
/**
|
|
3
|
+
* The components of a flow step that collect a value or submit the step.
|
|
4
|
+
*/
|
|
5
|
+
export interface FlowStepComponents {
|
|
6
|
+
/** Components that submit the step, the resend action included. */
|
|
7
|
+
actions: EmbeddedFlowComponent[];
|
|
8
|
+
/** Components that collect a value. */
|
|
9
|
+
inputs: EmbeddedFlowComponent[];
|
|
10
|
+
/** The step's resend action, if it has one. */
|
|
11
|
+
resend?: EmbeddedFlowComponent;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Collects the inputs and actions of a flow step, nested components included, in document order.
|
|
15
|
+
*
|
|
16
|
+
* @param components - The step's components.
|
|
17
|
+
* @returns The step's inputs, actions and resend action.
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* const {actions, inputs} = getFlowStepComponents(response.data.components);
|
|
21
|
+
* const isAwaitingLink = inputs.length === 0 && actions.length === 0;
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
declare const getFlowStepComponents: (components: EmbeddedFlowComponent[], step?: FlowStepComponents) => FlowStepComponents;
|
|
25
|
+
export default getFlowStepComponents;
|
|
26
|
+
//# sourceMappingURL=getFlowStepComponents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getFlowStepComponents.d.ts","sourceRoot":"","sources":["../../src/utils/getFlowStepComponents.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,qBAAqB,EAA4B,MAAM,yBAAyB,CAAC;AAgBzF;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,mEAAmE;IACnE,OAAO,EAAE,qBAAqB,EAAE,CAAC;IACjC,uCAAuC;IACvC,MAAM,EAAE,qBAAqB,EAAE,CAAC;IAChC,+CAA+C;IAC/C,MAAM,CAAC,EAAE,qBAAqB,CAAC;CAChC;AAED;;;;;;;;;;GAUG;AACH,QAAA,MAAM,qBAAqB,GACzB,YAAY,qBAAqB,EAAE,EACnC,OAAM,kBAA8C,KACnD,kBAQF,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { User, VerifiedAttribute } from '../models/user';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the verified attributes of a `/users/me` profile, keyed by attribute name.
|
|
4
|
+
*
|
|
5
|
+
* A profile without the field, from a server that does not report verification, leaves every status
|
|
6
|
+
* unknown, so the result is `undefined` rather than an empty record that would read as unverified.
|
|
7
|
+
*
|
|
8
|
+
* @param user - The profile to read.
|
|
9
|
+
* @returns The verified attributes, an empty object when none is verified, or `undefined` when the
|
|
10
|
+
* profile does not report them.
|
|
11
|
+
*/
|
|
12
|
+
declare const getVerifiedAttributes: (user?: User | null) => Record<string, VerifiedAttribute> | undefined;
|
|
13
|
+
export default getVerifiedAttributes;
|
|
14
|
+
//# sourceMappingURL=getVerifiedAttributes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getVerifiedAttributes.d.ts","sourceRoot":"","sources":["../../src/utils/getVerifiedAttributes.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,IAAI,EAAE,iBAAiB,EAAC,MAAM,gBAAgB,CAAC;AAEvD;;;;;;;;;GASG;AACH,QAAA,MAAM,qBAAqB,GAAI,OAAO,IAAI,GAAG,IAAI,KAAG,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,GAAG,SAMvF,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AttributeSchema } from '../api/account/getUsersMeMeta';
|
|
2
|
+
/**
|
|
3
|
+
* Whether the signed-in user can verify the given attribute: a top-level, single-valued property of
|
|
4
|
+
* type `email` or `mobile` in the user type schema from `GET /users/me/meta`.
|
|
5
|
+
*
|
|
6
|
+
* Schema keys are top-level properties, and a multi-valued property has type `array`, so both are
|
|
7
|
+
* settled by the property's own type. An absent schema, or one without the attribute, leaves the
|
|
8
|
+
* type unknown and resolves to `false`, so no verification is started on missing information.
|
|
9
|
+
*
|
|
10
|
+
* @param userSchema - The user type schema resolved by the provider, keyed by attribute.
|
|
11
|
+
* @param attribute - The attribute to check (e.g. `email`).
|
|
12
|
+
* @returns `true` only when the schema declares `attribute` with a verifiable type.
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* if (!isVerifiableAttribute(userSchema, 'given_name')) {
|
|
16
|
+
* return null;
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
declare const isVerifiableAttribute: (userSchema: Record<string, AttributeSchema> | null | undefined, attribute: string) => boolean;
|
|
21
|
+
export default isVerifiableAttribute;
|
|
22
|
+
//# sourceMappingURL=isVerifiableAttribute.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isVerifiableAttribute.d.ts","sourceRoot":"","sources":["../../src/utils/isVerifiableAttribute.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,eAAe,EAAC,MAAM,+BAA+B,CAAC;AAG9D;;;;;;;;;;;;;;;;;GAiBG;AACH,QAAA,MAAM,qBAAqB,GACzB,YAAY,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,IAAI,GAAG,SAAS,EAC9D,WAAW,MAAM,KAChB,OAUF,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { EmbeddedSelfFlowRequest } from '../models/embedded-self-flow';
|
|
2
|
+
/**
|
|
3
|
+
* Result of {@link parseSelfFlowRequest}: the request to send, or the field that made it invalid.
|
|
4
|
+
*/
|
|
5
|
+
export type SelfFlowRequestParseResult = {
|
|
6
|
+
invalid: string;
|
|
7
|
+
} | {
|
|
8
|
+
request: EmbeddedSelfFlowRequest;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Checks a `SELF` flow step that a browser sent to a server-side SDK, which attaches the
|
|
12
|
+
* session's access token before forwarding it. Such an endpoint is public, so its types protect
|
|
13
|
+
* nothing.
|
|
14
|
+
*
|
|
15
|
+
* Only the fields of a step are kept, so a caller cannot add a user or application identifier. A
|
|
16
|
+
* request without an `executionId` starts a flow, and must name a `SELF` flow by its handle,
|
|
17
|
+
* so the endpoint cannot start a flow of another type with the user's token.
|
|
18
|
+
*
|
|
19
|
+
* @param raw - The request body as received.
|
|
20
|
+
* @returns The request to send, or the name of the first invalid field.
|
|
21
|
+
*/
|
|
22
|
+
declare const parseSelfFlowRequest: (raw: unknown) => SelfFlowRequestParseResult;
|
|
23
|
+
export default parseSelfFlowRequest;
|
|
24
|
+
//# sourceMappingURL=parseSelfFlowRequest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseSelfFlowRequest.d.ts","sourceRoot":"","sources":["../../src/utils/parseSelfFlowRequest.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,uBAAuB,EAAC,MAAM,8BAA8B,CAAC;AAErE;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAAG;IAAC,OAAO,EAAE,MAAM,CAAA;CAAC,GAAG;IAAC,OAAO,EAAE,uBAAuB,CAAA;CAAC,CAAC;AAUhG;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,oBAAoB,GAAI,KAAK,OAAO,KAAG,0BA8B5C,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -37,7 +37,8 @@ export interface ManagementResourceRequest {
|
|
|
37
37
|
/**
|
|
38
38
|
* Performs a request against a management API resource and maps failures onto
|
|
39
39
|
* {@link ThunderIDAPIError}. HTTP 403 and 404 get their own codes so a caller can tell a missing
|
|
40
|
-
* permission from a missing resource.
|
|
40
|
+
* permission from a missing resource. An OAuth 2.0 error body is carried the same way as the server's
|
|
41
|
+
* error envelope.
|
|
41
42
|
*
|
|
42
43
|
* @returns The parsed JSON body, or `undefined` when the server returns no content.
|
|
43
44
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestManagementResource.d.ts","sourceRoot":"","sources":["../../src/utils/requestManagementResource.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,uBAAuB,EAAC,MAAM,eAAe,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;IAC1C;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAAC;IACpD;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;
|
|
1
|
+
{"version":3,"file":"requestManagementResource.d.ts","sourceRoot":"","sources":["../../src/utils/requestManagementResource.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,uBAAuB,EAAC,MAAM,eAAe,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;IAC1C;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAAC;IACpD;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AA8BD;;;;;;;GAOG;AACH,QAAA,MAAM,yBAAyB,GAAU,CAAC,EACxC,6CAA2C,uBAAuB,EAClE,6EAA2E,yBAAyB,KACnG,OAAO,CAAC,CAAC,CA2FX,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds the organization-unit-qualified form of an OAuth 2.0 endpoint, such as
|
|
3
|
+
* `{baseUrl}/ou/{ouId}/oauth2/authorize` for `{baseUrl}/oauth2/authorize`. A sign-in started there is
|
|
4
|
+
* bounded to the unit, and an authorization code from it is redeemed at the unit's token endpoint.
|
|
5
|
+
*
|
|
6
|
+
* The unit identifier is one path segment, so it is percent-encoded. The `/ou/{ouId}` prefix goes in
|
|
7
|
+
* front of the endpoint's `/oauth2/` segment, so an endpoint discovered under a path prefix keeps it.
|
|
8
|
+
* When the endpoint has no `/oauth2/` segment, the path is built from `baseUrl` and the endpoint's
|
|
9
|
+
* last segment instead.
|
|
10
|
+
*
|
|
11
|
+
* @param endpoint - The unqualified endpoint, from discovery or derived from `baseUrl`.
|
|
12
|
+
* @param ouId - Identifier of the organization unit.
|
|
13
|
+
* @param baseUrl - The server's base URL, used when the endpoint cannot be qualified in place.
|
|
14
|
+
* @returns The qualified endpoint URL.
|
|
15
|
+
* @throws {ThunderIDRuntimeError} `JS-AUTH_CORE-OUEP-IV01` when `ouId` is empty, and
|
|
16
|
+
* `JS-AUTH_CORE-OUEP-IV02` when the endpoint cannot be qualified.
|
|
17
|
+
*/
|
|
18
|
+
declare const resolveOrganizationUnitEndpoint: (endpoint: string, ouId: string, baseUrl?: string) => string;
|
|
19
|
+
export default resolveOrganizationUnitEndpoint;
|
|
20
|
+
//# sourceMappingURL=resolveOrganizationUnitEndpoint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveOrganizationUnitEndpoint.d.ts","sourceRoot":"","sources":["../../src/utils/resolveOrganizationUnitEndpoint.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;GAgBG;AACH,QAAA,MAAM,+BAA+B,GAAI,UAAU,MAAM,EAAE,MAAM,MAAM,EAAE,UAAU,MAAM,KAAG,MA8B3F,CAAC;AAEF,eAAe,+BAA+B,CAAC"}
|
|
@@ -8,7 +8,7 @@ import { BaseConfig } from '../models/config';
|
|
|
8
8
|
* issuers), these overrides let the SDK send flow and user-management requests to the resource
|
|
9
9
|
* server while OAuth requests continue to target the authorization server.
|
|
10
10
|
*/
|
|
11
|
-
export type ResourceEndpointKey = 'agents' | 'agentTypes' | 'applications' | 'configurationVersions' | 'connections' | 'design' | 'export' | 'flowExecute' | 'flowMeta' | 'flows' | 'gateways' | 'groups' | 'i18n' | 'import' | 'notificationTemplates' | 'organizationUnits' | 'resourceServers' | 'roles' | 'secrets' | 'serverConfig' | 'users' | 'usersMe' | 'usersMeCredentials' | 'usersMeMeta' | 'userTypes' | 'variables';
|
|
11
|
+
export type ResourceEndpointKey = 'agents' | 'agentTypes' | 'applications' | 'authorizationDetailTypes' | 'clientRegistrations' | 'configurationVersions' | 'connections' | 'credentialConfigurations' | 'design' | 'export' | 'flowExecute' | 'flowMeta' | 'flows' | 'gateways' | 'groups' | 'i18n' | 'import' | 'notificationTemplates' | 'organizationUnits' | 'presentationDefinitions' | 'projects' | 'resourceServers' | 'roles' | 'secrets' | 'serverConfig' | 'users' | 'usersMe' | 'usersMeCredentials' | 'usersMeMeta' | 'usersMeOrganizationUnits' | 'userTypes' | 'variables';
|
|
12
12
|
/**
|
|
13
13
|
* The `config.endpoints` keys that address resource-server endpoints rather than OIDC/OAuth
|
|
14
14
|
* endpoints. Used to keep these overrides out of the resolved OIDC provider metadata.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveResourceEndpoint.d.ts","sourceRoot":"","sources":["../../src/utils/resolveResourceEndpoint.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAE5C;;;;;;;;GAQG;AACH,MAAM,MAAM,mBAAmB,GAC3B,QAAQ,GACR,YAAY,GACZ,cAAc,GACd,uBAAuB,GACvB,aAAa,GACb,QAAQ,GACR,QAAQ,GACR,aAAa,GACb,UAAU,GACV,OAAO,GACP,UAAU,GACV,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,uBAAuB,GACvB,mBAAmB,GACnB,iBAAiB,GACjB,OAAO,GACP,SAAS,GACT,cAAc,GACd,OAAO,GACP,SAAS,GACT,oBAAoB,GACpB,aAAa,GACb,WAAW,GACX,WAAW,CAAC;AAEhB;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,SAAS,mBAAmB,
|
|
1
|
+
{"version":3,"file":"resolveResourceEndpoint.d.ts","sourceRoot":"","sources":["../../src/utils/resolveResourceEndpoint.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAE5C;;;;;;;;GAQG;AACH,MAAM,MAAM,mBAAmB,GAC3B,QAAQ,GACR,YAAY,GACZ,cAAc,GACd,0BAA0B,GAC1B,qBAAqB,GACrB,uBAAuB,GACvB,aAAa,GACb,0BAA0B,GAC1B,QAAQ,GACR,QAAQ,GACR,aAAa,GACb,UAAU,GACV,OAAO,GACP,UAAU,GACV,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,uBAAuB,GACvB,mBAAmB,GACnB,yBAAyB,GACzB,UAAU,GACV,iBAAiB,GACjB,OAAO,GACP,SAAS,GACT,cAAc,GACd,OAAO,GACP,SAAS,GACT,oBAAoB,GACpB,aAAa,GACb,0BAA0B,GAC1B,WAAW,GACX,WAAW,CAAC;AAEhB;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,SAAS,mBAAmB,EAiChE,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,SAAS,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;CACrC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,QAAA,MAAM,uBAAuB,GAC3B,KAAK,mBAAmB,EACxB,QAAQ,sBAAsB,GAAG,SAAS,EAC1C,cAAc,MAAM,KACnB,MAAM,GAAG,SAAiE,CAAC;AAE9E,eAAe,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { ManagementRequestConfig } from '../models/api';
|
|
2
|
+
import { ResolvedOverlay, SharingPolicy, SharingPolicyListResponse, SharingPolicyRequest, SharingPolicyUpdateRequest } from '../models/sharing-policy';
|
|
3
|
+
/**
|
|
4
|
+
* The kinds of resource that carry sharing policies.
|
|
5
|
+
*/
|
|
6
|
+
export type SharingResourceType = 'user' | 'application' | 'role' | 'flow';
|
|
7
|
+
/**
|
|
8
|
+
* The management collection that holds each kind of shared resource.
|
|
9
|
+
*/
|
|
10
|
+
export declare const SHARING_RESOURCE_COLLECTIONS: Record<SharingResourceType, 'users' | 'applications' | 'roles' | 'flows'>;
|
|
11
|
+
/**
|
|
12
|
+
* The sharing operations of one kind of resource, addressed by the resource's identifier.
|
|
13
|
+
*/
|
|
14
|
+
export interface SharingPolicyOperations {
|
|
15
|
+
create: (config: ManagementRequestConfig & {
|
|
16
|
+
payload: SharingPolicyRequest;
|
|
17
|
+
resourceId: string;
|
|
18
|
+
}) => Promise<SharingPolicy>;
|
|
19
|
+
delete: (config: ManagementRequestConfig & {
|
|
20
|
+
policyId: string;
|
|
21
|
+
resourceId: string;
|
|
22
|
+
}) => Promise<void>;
|
|
23
|
+
getOverlayRules: (config: ManagementRequestConfig & {
|
|
24
|
+
ouId: string;
|
|
25
|
+
resourceId: string;
|
|
26
|
+
}) => Promise<ResolvedOverlay>;
|
|
27
|
+
list: (config: ManagementRequestConfig & {
|
|
28
|
+
limit?: number;
|
|
29
|
+
offset?: number;
|
|
30
|
+
resourceId: string;
|
|
31
|
+
}) => Promise<SharingPolicyListResponse>;
|
|
32
|
+
update: (config: ManagementRequestConfig & {
|
|
33
|
+
payload: SharingPolicyUpdateRequest;
|
|
34
|
+
policyId: string;
|
|
35
|
+
resourceId: string;
|
|
36
|
+
}) => Promise<SharingPolicy>;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Returns the existing sharing operations for a kind of resource, so a component can manage the
|
|
40
|
+
* policies of a user, an application, a role or a flow the same way.
|
|
41
|
+
*
|
|
42
|
+
* @param resourceType - The kind of resource.
|
|
43
|
+
* @returns The operations, each taking the resource's identifier as `resourceId`.
|
|
44
|
+
*/
|
|
45
|
+
export declare const getSharingPolicyOperations: (resourceType: SharingResourceType) => SharingPolicyOperations;
|
|
46
|
+
/**
|
|
47
|
+
* The translation function the helpers below take.
|
|
48
|
+
*/
|
|
49
|
+
type Translate = (key: string, params?: Record<string, string | number>) => string;
|
|
50
|
+
/**
|
|
51
|
+
* Describes, in translated words, which organization units a sharing policy reaches: one line per
|
|
52
|
+
* section the server returned (every unit, the units beneath the owner, the roots of other trees).
|
|
53
|
+
*
|
|
54
|
+
* @param t - The translation function.
|
|
55
|
+
* @param policy - The policy.
|
|
56
|
+
* @returns The lines, never empty.
|
|
57
|
+
*/
|
|
58
|
+
export declare const describeSharingPolicyScope: (t: Translate, policy: SharingPolicy) => string[];
|
|
59
|
+
/**
|
|
60
|
+
* The values of the sharing policy form. Lists of organization unit identifiers are kept as the text
|
|
61
|
+
* the user types, separated by commas.
|
|
62
|
+
*/
|
|
63
|
+
export interface SharingPolicyFormValues {
|
|
64
|
+
/**
|
|
65
|
+
* Which units beneath the owner the policy reaches: none, all of them, or the ones listed.
|
|
66
|
+
*/
|
|
67
|
+
childUnitsMode: 'none' | 'all' | 'selected';
|
|
68
|
+
/**
|
|
69
|
+
* With `all`, the units beneath the owner to withhold.
|
|
70
|
+
*/
|
|
71
|
+
excludedOuIds: string;
|
|
72
|
+
/**
|
|
73
|
+
* The root units of other trees the policy reaches.
|
|
74
|
+
*/
|
|
75
|
+
otherTreeRootOuIds: string;
|
|
76
|
+
/**
|
|
77
|
+
* With `selected`, whether each listed unit is reached alone or with everything below it.
|
|
78
|
+
*/
|
|
79
|
+
reach: 'unit' | 'subtree';
|
|
80
|
+
/**
|
|
81
|
+
* With `selected`, the units beneath the owner the policy reaches.
|
|
82
|
+
*/
|
|
83
|
+
selectedOuIds: string;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Splits text of comma or whitespace separated identifiers, dropping empty and repeated entries.
|
|
87
|
+
*
|
|
88
|
+
* @param value - The text.
|
|
89
|
+
* @returns The identifiers.
|
|
90
|
+
*/
|
|
91
|
+
export declare const parseOrganizationUnitIds: (value: string) => string[];
|
|
92
|
+
/**
|
|
93
|
+
* The form values for a new policy, or for editing an existing one.
|
|
94
|
+
*
|
|
95
|
+
* @param policy - The policy being edited, if any.
|
|
96
|
+
* @returns The values.
|
|
97
|
+
*/
|
|
98
|
+
export declare const toSharingPolicyFormValues: (policy?: SharingPolicy) => SharingPolicyFormValues;
|
|
99
|
+
/**
|
|
100
|
+
* Whether the form describes a policy the server can accept: it must reach some unit, and a policy of
|
|
101
|
+
* selected units must name at least one. A policy that already reaches every unit or every other tree
|
|
102
|
+
* keeps that section, so it is valid without either.
|
|
103
|
+
*
|
|
104
|
+
* @param values - The form values.
|
|
105
|
+
* @param policy - The policy being edited, if any.
|
|
106
|
+
* @returns Whether the values can be submitted.
|
|
107
|
+
*/
|
|
108
|
+
export declare const isSharingPolicyFormValid: (values: SharingPolicyFormValues, policy?: SharingPolicy) => boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Builds the payload that creates a policy from the form.
|
|
111
|
+
*
|
|
112
|
+
* @param values - The form values.
|
|
113
|
+
* @returns The payload.
|
|
114
|
+
*/
|
|
115
|
+
export declare const toSharingPolicyRequest: (values: SharingPolicyFormValues) => SharingPolicyRequest;
|
|
116
|
+
/**
|
|
117
|
+
* Builds the payload that replaces a policy's sections from the form. Sections the form cannot edit
|
|
118
|
+
* (every unit, every other tree) and the overlay rules of units that stay are kept as they were.
|
|
119
|
+
*
|
|
120
|
+
* @param values - The form values.
|
|
121
|
+
* @param policy - The policy being edited.
|
|
122
|
+
* @returns The payload, carrying the version being edited.
|
|
123
|
+
*/
|
|
124
|
+
export declare const toSharingPolicyUpdateRequest: (values: SharingPolicyFormValues, policy: SharingPolicy) => SharingPolicyUpdateRequest;
|
|
125
|
+
export {};
|
|
126
|
+
//# sourceMappingURL=sharingPolicies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sharingPolicies.d.ts","sourceRoot":"","sources":["../../src/utils/sharingPolicies.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAC,uBAAuB,EAAC,MAAM,eAAe,CAAC;AACtD,OAAO,EACL,eAAe,EACf,aAAa,EAGb,yBAAyB,EAEzB,oBAAoB,EACpB,0BAA0B,EAC3B,MAAM,0BAA0B,CAAC;AAElC;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,aAAa,GAAG,MAAM,GAAG,MAAM,CAAC;AAE3E;;GAEG;AACH,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,mBAAmB,EAAE,OAAO,GAAG,cAAc,GAAG,OAAO,GAAG,OAA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AAM,EAwCtF,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,cAAc,EAAE,MAAM,GAAG,KAAK,GAAG,UAAU,CAAC;IAC5C;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,GAAI,OAAO,MAAM,KAAG,MAAM,EAQ5D,CAAC;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,GAAI,SAAS,aAAa,KAAG,uBAoBlE,CAAC;AAwDF;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,GAAI,QAAQ,uBAAuB,EAAE,SAAS,aAAa,KAAG,OAWlG,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GAAI,QAAQ,uBAAuB,KAAG,oBAKxE,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,GACvC,QAAQ,uBAAuB,EAC/B,QAAQ,aAAa,KACpB,0BAWF,CAAC"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Turns a failed management request into a message for admin UI. A missing permission and a
|
|
3
|
-
* missing resource get their own messages;
|
|
4
|
-
* server's own error text is never shown.
|
|
3
|
+
* missing resource get their own messages; a refusal the caller names in `specificKeys` gets that
|
|
4
|
+
* message; anything else gets the operation's fallback. The server's own error text is never shown.
|
|
5
5
|
*
|
|
6
6
|
* @param t - The translation function.
|
|
7
7
|
* @param error - The error a management operation reported, if any.
|
|
8
8
|
* @param fallbackKey - Translation key of the message for any other failure.
|
|
9
|
+
* @param specificKeys - Translation keys for specific refusals, keyed by the server's error code
|
|
10
|
+
* (such as `OU-1006`) or by HTTP status (such as `409`). A code wins over a status.
|
|
9
11
|
* @returns The translated message, or `null` when there is no error.
|
|
10
12
|
*/
|
|
11
|
-
declare const toManagementErrorMessage: (t: (key: string) => string, error: Error | null | undefined, fallbackKey: string) => string | null;
|
|
13
|
+
declare const toManagementErrorMessage: (t: (key: string) => string, error: Error | null | undefined, fallbackKey: string, specificKeys?: Readonly<Record<string, string>>) => string | null;
|
|
12
14
|
export default toManagementErrorMessage;
|
|
13
15
|
//# sourceMappingURL=toManagementErrorMessage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toManagementErrorMessage.d.ts","sourceRoot":"","sources":["../../src/utils/toManagementErrorMessage.ts"],"names":[],"mappings":"AAKA
|
|
1
|
+
{"version":3,"file":"toManagementErrorMessage.d.ts","sourceRoot":"","sources":["../../src/utils/toManagementErrorMessage.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,wBAAwB,GAC5B,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,EAC1B,OAAO,KAAK,GAAG,IAAI,GAAG,SAAS,EAC/B,aAAa,MAAM,EACnB,eAAe,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,KAC9C,MAAM,GAAG,IA6BX,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
|