web: mass update API calls

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-05-16 18:24:15 +02:00
parent 7152d7ee01
commit ba5374f6e1
64 changed files with 136 additions and 183 deletions

View File

@ -118,7 +118,7 @@ class EventViewSet(ReadOnlyModelViewSet):
) )
], ],
) )
@action(detail=False, methods=["GET"]) @action(detail=False, methods=["GET"], pagination_class=None)
def top_per_user(self, request: Request): def top_per_user(self, request: Request):
"""Get the top_n events grouped by user count""" """Get the top_n events grouped by user count"""
filtered_action = request.query_params.get("action", EventAction.LOGIN) filtered_action = request.query_params.get("action", EventAction.LOGIN)

View File

@ -2338,18 +2338,6 @@ paths:
description: Which field to use when ordering the results. description: Which field to use when ordering the results.
schema: schema:
type: string type: string
- name: page
required: false
in: query
description: A page number within the paginated result set.
schema:
type: integer
- name: page_size
required: false
in: query
description: Number of results to return per page.
schema:
type: integer
- name: search - name: search
required: false required: false
in: query in: query
@ -2375,7 +2363,9 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/PaginatedEventTopPerUserList' type: array
items:
$ref: '#/components/schemas/EventTopPerUser'
description: '' description: ''
/api/v2beta/events/notifications/: /api/v2beta/events/notifications/:
get: get:
@ -16760,41 +16750,6 @@ components:
required: required:
- pagination - pagination
- results - results
PaginatedEventTopPerUserList:
type: object
properties:
pagination:
type: object
properties:
next:
type: number
previous:
type: number
count:
type: number
current:
type: number
total_pages:
type: number
start_index:
type: number
end_index:
type: number
required:
- next
- previous
- count
- current
- total_pages
- start_index
- end_index
results:
type: array
items:
$ref: '#/components/schemas/EventTopPerUser'
required:
- pagination
- results
PaginatedExpiringBaseGrantModelList: PaginatedExpiringBaseGrantModelList:
type: object type: object
properties: properties:

View File

@ -18,7 +18,7 @@ export class TopApplicationsTable extends LitElement {
} }
firstUpdated(): void { firstUpdated(): void {
new EventsApi(DEFAULT_CONFIG).eventsEventsTopPerUser({ new EventsApi(DEFAULT_CONFIG).eventsEventsTopPerUserList({
action: "authorize_application", action: "authorize_application",
topN: 11, topN: 11,
}).then((events) => { }).then((events) => {

View File

@ -115,7 +115,7 @@ export class ApplicationForm extends ModelForm<Application, string> {
<i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i> <i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i>
</button> </button>
<ul class="pf-c-dropdown__menu" hidden> <ul class="pf-c-dropdown__menu" hidden>
${until(new ProvidersApi(DEFAULT_CONFIG).providersAllTypes().then((types) => { ${until(new ProvidersApi(DEFAULT_CONFIG).providersAllTypesList().then((types) => {
return types.map((type) => { return types.map((type) => {
return html`<li> return html`<li>
<ak-forms-modal> <ak-forms-modal>

View File

@ -1,4 +1,4 @@
import { CertificateGeneration, CryptoApi } from "authentik-api"; import { CertificateGenerationRequest, CryptoApi } from "authentik-api";
import { CertificateKeyPair } from "authentik-api/src"; import { CertificateKeyPair } from "authentik-api/src";
import { t } from "@lingui/macro"; import { t } from "@lingui/macro";
import { customElement } from "lit-element"; import { customElement } from "lit-element";
@ -8,15 +8,15 @@ import { Form } from "../../elements/forms/Form";
import "../../elements/forms/HorizontalFormElement"; import "../../elements/forms/HorizontalFormElement";
@customElement("ak-crypto-certificate-generate-form") @customElement("ak-crypto-certificate-generate-form")
export class CertificateKeyPairForm extends Form<CertificateGeneration> { export class CertificateKeyPairForm extends Form<CertificateGenerationRequest> {
getSuccessMessage(): string { getSuccessMessage(): string {
return t`Successfully generated certificate-key pair.`; return t`Successfully generated certificate-key pair.`;
} }
send = (data: CertificateGeneration): Promise<CertificateKeyPair> => { send = (data: CertificateGenerationRequest): Promise<CertificateKeyPair> => {
return new CryptoApi(DEFAULT_CONFIG).cryptoCertificatekeypairsGenerate({ return new CryptoApi(DEFAULT_CONFIG).cryptoCertificatekeypairsGenerateCreate({
data: data certificateGenerationRequest: data
}); });
}; };

View File

@ -1,4 +1,4 @@
import { CertificateKeyPair, CryptoApi } from "authentik-api"; import { CertificateKeyPair, CertificateKeyPairRequest, CryptoApi } from "authentik-api";
import { t } from "@lingui/macro"; import { t } from "@lingui/macro";
import { customElement } from "lit-element"; import { customElement } from "lit-element";
import { html, TemplateResult } from "lit-html"; import { html, TemplateResult } from "lit-html";
@ -29,11 +29,11 @@ export class CertificateKeyPairForm extends ModelForm<CertificateKeyPair, string
if (this.instance) { if (this.instance) {
return new CryptoApi(DEFAULT_CONFIG).cryptoCertificatekeypairsPartialUpdate({ return new CryptoApi(DEFAULT_CONFIG).cryptoCertificatekeypairsPartialUpdate({
kpUuid: this.instance.pk || "", kpUuid: this.instance.pk || "",
data: data patchedCertificateKeyPairRequest: data
}); });
} else { } else {
return new CryptoApi(DEFAULT_CONFIG).cryptoCertificatekeypairsCreate({ return new CryptoApi(DEFAULT_CONFIG).cryptoCertificatekeypairsCreate({
data: data certificateKeyPairRequest: data as unknown as CertificateKeyPairRequest
}); });
} }
}; };
@ -51,14 +51,14 @@ export class CertificateKeyPairForm extends ModelForm<CertificateKeyPair, string
name="certificateData" name="certificateData"
?writeOnly=${this.instance !== undefined} ?writeOnly=${this.instance !== undefined}
?required=${true}> ?required=${true}>
<textarea class="pf-c-form-control" required>${ifDefined(this.instance?.certificateData)}</textarea> <textarea class="pf-c-form-control" required></textarea>
<p class="pf-c-form__helper-text">${t`PEM-encoded Certificate data.`}</p> <p class="pf-c-form__helper-text">${t`PEM-encoded Certificate data.`}</p>
</ak-form-element-horizontal> </ak-form-element-horizontal>
<ak-form-element-horizontal <ak-form-element-horizontal
name="keyData" name="keyData"
?writeOnly=${this.instance !== undefined} ?writeOnly=${this.instance !== undefined}
label=${t`Private Key`}> label=${t`Private Key`}>
<textarea class="pf-c-form-control" >${ifDefined(this.instance?.keyData)}</textarea> <textarea class="pf-c-form-control" ></textarea>
<p class="pf-c-form__helper-text">${t`Optional Private Key. If this is set, you can use this keypair for encryption.`}</p> <p class="pf-c-form__helper-text">${t`Optional Private Key. If this is set, you can use this keypair for encryption.`}</p>
</ak-form-element-horizontal> </ak-form-element-horizontal>
</form>`; </form>`;

View File

@ -29,11 +29,11 @@ export class RuleForm extends ModelForm<NotificationRule, string> {
if (this.instance) { if (this.instance) {
return new EventsApi(DEFAULT_CONFIG).eventsRulesUpdate({ return new EventsApi(DEFAULT_CONFIG).eventsRulesUpdate({
pbmUuid: this.instance.pk || "", pbmUuid: this.instance.pk || "",
data: data notificationRuleRequest: data
}); });
} else { } else {
return new EventsApi(DEFAULT_CONFIG).eventsRulesCreate({ return new EventsApi(DEFAULT_CONFIG).eventsRulesCreate({
data: data notificationRuleRequest: data
}); });
} }
}; };

View File

@ -32,11 +32,11 @@ export class TransportForm extends ModelForm<NotificationTransport, string> {
if (this.instance) { if (this.instance) {
return new EventsApi(DEFAULT_CONFIG).eventsTransportsUpdate({ return new EventsApi(DEFAULT_CONFIG).eventsTransportsUpdate({
uuid: this.instance.pk || "", uuid: this.instance.pk || "",
data: data notificationTransportRequest: data
}); });
} else { } else {
return new EventsApi(DEFAULT_CONFIG).eventsTransportsCreate({ return new EventsApi(DEFAULT_CONFIG).eventsTransportsCreate({
data: data notificationTransportRequest: data
}); });
} }
}; };

View File

@ -141,7 +141,7 @@ export class BoundStagesList extends Table<FlowStageBinding> {
<i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i> <i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i>
</button> </button>
<ul class="pf-c-dropdown__menu" hidden> <ul class="pf-c-dropdown__menu" hidden>
${until(new StagesApi(DEFAULT_CONFIG).stagesAllTypes().then((types) => { ${until(new StagesApi(DEFAULT_CONFIG).stagesAllTypesList().then((types) => {
return types.map((type) => { return types.map((type) => {
return html`<li> return html`<li>
<ak-forms-modal> <ak-forms-modal>

View File

@ -29,17 +29,17 @@ export class FlowForm extends ModelForm<Flow, string> {
if (this.instance) { if (this.instance) {
writeOp = new FlowsApi(DEFAULT_CONFIG).flowsInstancesUpdate({ writeOp = new FlowsApi(DEFAULT_CONFIG).flowsInstancesUpdate({
slug: this.instance.slug, slug: this.instance.slug,
data: data flowRequest: data
}); });
} else { } else {
writeOp = new FlowsApi(DEFAULT_CONFIG).flowsInstancesCreate({ writeOp = new FlowsApi(DEFAULT_CONFIG).flowsInstancesCreate({
data: data flowRequest: data
}); });
} }
const background = this.getFormFile(); const background = this.getFormFile();
if (background) { if (background) {
return writeOp.then(flow => { return writeOp.then(flow => {
return new FlowsApi(DEFAULT_CONFIG).flowsInstancesSetBackground({ return new FlowsApi(DEFAULT_CONFIG).flowsInstancesSetBackgroundCreate({
slug: flow.slug, slug: flow.slug,
file: background file: background
}); });

View File

@ -33,11 +33,11 @@ export class StageBindingForm extends ModelForm<FlowStageBinding, string> {
if (this.instance) { if (this.instance) {
return new FlowsApi(DEFAULT_CONFIG).flowsBindingsUpdate({ return new FlowsApi(DEFAULT_CONFIG).flowsBindingsUpdate({
fsbUuid: this.instance.pk || "", fsbUuid: this.instance.pk || "",
data: data flowStageBindingRequest: data
}); });
} else { } else {
return new FlowsApi(DEFAULT_CONFIG).flowsBindingsCreate({ return new FlowsApi(DEFAULT_CONFIG).flowsBindingsCreate({
data: data flowStageBindingRequest: data
}); });
} }
}; };

View File

@ -35,12 +35,12 @@ export class GroupForm extends ModelForm<Group, string> {
if (this.instance?.pk) { if (this.instance?.pk) {
return new CoreApi(DEFAULT_CONFIG).coreGroupsUpdate({ return new CoreApi(DEFAULT_CONFIG).coreGroupsUpdate({
groupUuid: this.instance.pk || "", groupUuid: this.instance.pk || "",
data: data groupRequest: data
}); });
} else { } else {
data.users = Array.from(this.instance?.users || []) as unknown as Set<number>; data.users = Array.from(this.instance?.users || []) as unknown as Set<number>;
return new CoreApi(DEFAULT_CONFIG).coreGroupsCreate({ return new CoreApi(DEFAULT_CONFIG).coreGroupsCreate({
data: data groupRequest: data
}); });
} }
}; };

View File

@ -31,11 +31,11 @@ export class OutpostForm extends ModelForm<Outpost, string> {
if (this.instance) { if (this.instance) {
return new OutpostsApi(DEFAULT_CONFIG).outpostsOutpostsUpdate({ return new OutpostsApi(DEFAULT_CONFIG).outpostsOutpostsUpdate({
uuid: this.instance.pk || "", uuid: this.instance.pk || "",
data: data outpostRequest: data
}); });
} else { } else {
return new OutpostsApi(DEFAULT_CONFIG).outpostsOutpostsCreate({ return new OutpostsApi(DEFAULT_CONFIG).outpostsOutpostsCreate({
data: data outpostRequest: data
}); });
} }
}; };

View File

@ -30,11 +30,11 @@ export class ServiceConnectionDockerForm extends ModelForm<DockerServiceConnecti
if (this.instance) { if (this.instance) {
return new OutpostsApi(DEFAULT_CONFIG).outpostsServiceConnectionsDockerUpdate({ return new OutpostsApi(DEFAULT_CONFIG).outpostsServiceConnectionsDockerUpdate({
uuid: this.instance.pk || "", uuid: this.instance.pk || "",
data: data dockerServiceConnectionRequest: data
}); });
} else { } else {
return new OutpostsApi(DEFAULT_CONFIG).outpostsServiceConnectionsDockerCreate({ return new OutpostsApi(DEFAULT_CONFIG).outpostsServiceConnectionsDockerCreate({
data: data dockerServiceConnectionRequest: data
}); });
} }
}; };

View File

@ -31,11 +31,11 @@ export class ServiceConnectionKubernetesForm extends ModelForm<KubernetesService
if (this.instance) { if (this.instance) {
return new OutpostsApi(DEFAULT_CONFIG).outpostsServiceConnectionsKubernetesUpdate({ return new OutpostsApi(DEFAULT_CONFIG).outpostsServiceConnectionsKubernetesUpdate({
uuid: this.instance.pk || "", uuid: this.instance.pk || "",
data: data kubernetesServiceConnectionRequest: data
}); });
} else { } else {
return new OutpostsApi(DEFAULT_CONFIG).outpostsServiceConnectionsKubernetesCreate({ return new OutpostsApi(DEFAULT_CONFIG).outpostsServiceConnectionsKubernetesCreate({
data: data kubernetesServiceConnectionRequest: data
}); });
} }
}; };

View File

@ -180,7 +180,7 @@ export class BoundPoliciesList extends Table<PolicyBinding> {
<i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i> <i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i>
</button> </button>
<ul class="pf-c-dropdown__menu" hidden> <ul class="pf-c-dropdown__menu" hidden>
${until(new PoliciesApi(DEFAULT_CONFIG).policiesAllTypes().then((types) => { ${until(new PoliciesApi(DEFAULT_CONFIG).policiesAllTypesList().then((types) => {
return types.map((type) => { return types.map((type) => {
return html`<li> return html`<li>
<ak-forms-modal> <ak-forms-modal>

View File

@ -64,11 +64,11 @@ export class PolicyBindingForm extends ModelForm<PolicyBinding, string> {
if (this.instance) { if (this.instance) {
return new PoliciesApi(DEFAULT_CONFIG).policiesBindingsUpdate({ return new PoliciesApi(DEFAULT_CONFIG).policiesBindingsUpdate({
policyBindingUuid: this.instance.pk || "", policyBindingUuid: this.instance.pk || "",
data: data policyBindingRequest: data
}); });
} else { } else {
return new PoliciesApi(DEFAULT_CONFIG).policiesBindingsCreate({ return new PoliciesApi(DEFAULT_CONFIG).policiesBindingsCreate({
data: data policyBindingRequest: data
}); });
} }
}; };

View File

@ -126,7 +126,7 @@ export class PolicyListPage extends TablePage<Policy> {
<i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i> <i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i>
</button> </button>
<ul class="pf-c-dropdown__menu" hidden> <ul class="pf-c-dropdown__menu" hidden>
${until(new PoliciesApi(DEFAULT_CONFIG).policiesAllTypes().then((types) => { ${until(new PoliciesApi(DEFAULT_CONFIG).policiesAllTypesList().then((types) => {
return types.map((type) => { return types.map((type) => {
return html`<li> return html`<li>
<ak-forms-modal> <ak-forms-modal>

View File

@ -1,4 +1,4 @@
import { CoreApi, PoliciesApi, Policy, PolicyTestResult } from "authentik-api"; import { CoreApi, PoliciesApi, Policy, PolicyTestRequest, PolicyTestResult } from "authentik-api";
import { t } from "@lingui/macro"; import { t } from "@lingui/macro";
import { customElement, property } from "lit-element"; import { customElement, property } from "lit-element";
import { html, TemplateResult } from "lit-html"; import { html, TemplateResult } from "lit-html";
@ -8,11 +8,10 @@ import { until } from "lit-html/directives/until";
import { ifDefined } from "lit-html/directives/if-defined"; import { ifDefined } from "lit-html/directives/if-defined";
import "../../elements/forms/HorizontalFormElement"; import "../../elements/forms/HorizontalFormElement";
import "../../elements/CodeMirror"; import "../../elements/CodeMirror";
import { PolicyTest } from "authentik-api/src";
import YAML from "yaml"; import YAML from "yaml";
@customElement("ak-policy-test-form") @customElement("ak-policy-test-form")
export class PolicyTestForm extends Form<PolicyTest> { export class PolicyTestForm extends Form<PolicyTestRequest> {
@property({attribute: false}) @property({attribute: false})
policy?: Policy; policy?: Policy;
@ -24,10 +23,10 @@ export class PolicyTestForm extends Form<PolicyTest> {
return t`Successfully sent test-request.`; return t`Successfully sent test-request.`;
} }
send = (data: PolicyTest): Promise<PolicyTestResult> => { send = (data: PolicyTestRequest): Promise<PolicyTestResult> => {
return new PoliciesApi(DEFAULT_CONFIG).policiesAllTest({ return new PoliciesApi(DEFAULT_CONFIG).policiesAllTestCreate({
policyUuid: this.policy?.pk || "", policyUuid: this.policy?.pk || "",
data: data policyTestRequest: data
}).then(result => this.result = result); }).then(result => this.result = result);
}; };

View File

@ -30,11 +30,11 @@ export class DummyPolicyForm extends ModelForm<DummyPolicy, string> {
if (this.instance) { if (this.instance) {
return new PoliciesApi(DEFAULT_CONFIG).policiesDummyUpdate({ return new PoliciesApi(DEFAULT_CONFIG).policiesDummyUpdate({
policyUuid: this.instance.pk || "", policyUuid: this.instance.pk || "",
data: data dummyPolicyRequest: data
}); });
} else { } else {
return new PoliciesApi(DEFAULT_CONFIG).policiesDummyCreate({ return new PoliciesApi(DEFAULT_CONFIG).policiesDummyCreate({
data: data dummyPolicyRequest: data
}); });
} }
}; };

View File

@ -31,11 +31,11 @@ export class EventMatcherPolicyForm extends ModelForm<EventMatcherPolicy, string
if (this.instance) { if (this.instance) {
return new PoliciesApi(DEFAULT_CONFIG).policiesEventMatcherUpdate({ return new PoliciesApi(DEFAULT_CONFIG).policiesEventMatcherUpdate({
policyUuid: this.instance.pk || "", policyUuid: this.instance.pk || "",
data: data eventMatcherPolicyRequest: data
}); });
} else { } else {
return new PoliciesApi(DEFAULT_CONFIG).policiesEventMatcherCreate({ return new PoliciesApi(DEFAULT_CONFIG).policiesEventMatcherCreate({
data: data eventMatcherPolicyRequest: data
}); });
} }
}; };

View File

@ -30,11 +30,11 @@ export class PasswordExpiryPolicyForm extends ModelForm<PasswordExpiryPolicy, st
if (this.instance) { if (this.instance) {
return new PoliciesApi(DEFAULT_CONFIG).policiesPasswordExpiryUpdate({ return new PoliciesApi(DEFAULT_CONFIG).policiesPasswordExpiryUpdate({
policyUuid: this.instance.pk || "", policyUuid: this.instance.pk || "",
data: data passwordExpiryPolicyRequest: data
}); });
} else { } else {
return new PoliciesApi(DEFAULT_CONFIG).policiesPasswordExpiryCreate({ return new PoliciesApi(DEFAULT_CONFIG).policiesPasswordExpiryCreate({
data: data passwordExpiryPolicyRequest: data
}); });
} }
}; };

View File

@ -31,11 +31,11 @@ export class ExpressionPolicyForm extends ModelForm<ExpressionPolicy, string> {
if (this.instance) { if (this.instance) {
return new PoliciesApi(DEFAULT_CONFIG).policiesExpressionUpdate({ return new PoliciesApi(DEFAULT_CONFIG).policiesExpressionUpdate({
policyUuid: this.instance.pk || "", policyUuid: this.instance.pk || "",
data: data expressionPolicyRequest: data
}); });
} else { } else {
return new PoliciesApi(DEFAULT_CONFIG).policiesExpressionCreate({ return new PoliciesApi(DEFAULT_CONFIG).policiesExpressionCreate({
data: data expressionPolicyRequest: data
}); });
} }
}; };

View File

@ -30,11 +30,11 @@ export class HaveIBeenPwnedPolicyForm extends ModelForm<HaveIBeenPwendPolicy, st
if (this.instance) { if (this.instance) {
return new PoliciesApi(DEFAULT_CONFIG).policiesHaveibeenpwnedUpdate({ return new PoliciesApi(DEFAULT_CONFIG).policiesHaveibeenpwnedUpdate({
policyUuid: this.instance.pk || "", policyUuid: this.instance.pk || "",
data: data haveIBeenPwendPolicyRequest: data
}); });
} else { } else {
return new PoliciesApi(DEFAULT_CONFIG).policiesHaveibeenpwnedCreate({ return new PoliciesApi(DEFAULT_CONFIG).policiesHaveibeenpwnedCreate({
data: data haveIBeenPwendPolicyRequest: data
}); });
} }
}; };

View File

@ -30,11 +30,11 @@ export class PasswordPolicyForm extends ModelForm<PasswordPolicy, string> {
if (this.instance) { if (this.instance) {
return new PoliciesApi(DEFAULT_CONFIG).policiesPasswordUpdate({ return new PoliciesApi(DEFAULT_CONFIG).policiesPasswordUpdate({
policyUuid: this.instance.pk || "", policyUuid: this.instance.pk || "",
data: data passwordPolicyRequest: data
}); });
} else { } else {
return new PoliciesApi(DEFAULT_CONFIG).policiesPasswordCreate({ return new PoliciesApi(DEFAULT_CONFIG).policiesPasswordCreate({
data: data passwordPolicyRequest: data
}); });
} }
}; };

View File

@ -30,11 +30,11 @@ export class ReputationPolicyForm extends ModelForm<ReputationPolicy, string> {
if (this.instance) { if (this.instance) {
return new PoliciesApi(DEFAULT_CONFIG).policiesReputationUpdate({ return new PoliciesApi(DEFAULT_CONFIG).policiesReputationUpdate({
policyUuid: this.instance.pk || "", policyUuid: this.instance.pk || "",
data: data reputationPolicyRequest: data
}); });
} else { } else {
return new PoliciesApi(DEFAULT_CONFIG).policiesReputationCreate({ return new PoliciesApi(DEFAULT_CONFIG).policiesReputationCreate({
data: data reputationPolicyRequest: data
}); });
} }
}; };

View File

@ -29,11 +29,11 @@ export class PropertyMappingLDAPForm extends ModelForm<LDAPPropertyMapping, stri
if (this.instance) { if (this.instance) {
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsLdapUpdate({ return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsLdapUpdate({
pmUuid: this.instance.pk || "", pmUuid: this.instance.pk || "",
data: data lDAPPropertyMappingRequest: data
}); });
} else { } else {
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsLdapCreate({ return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsLdapCreate({
data: data lDAPPropertyMappingRequest: data
}); });
} }
}; };

View File

@ -28,11 +28,11 @@ export class PropertyMappingLDAPForm extends ModelForm<SAMLPropertyMapping, stri
if (this.instance) { if (this.instance) {
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsSamlUpdate({ return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsSamlUpdate({
pmUuid: this.instance.pk || "", pmUuid: this.instance.pk || "",
data: data sAMLPropertyMappingRequest: data
}); });
} else { } else {
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsSamlCreate({ return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsSamlCreate({
data: data sAMLPropertyMappingRequest: data
}); });
} }
}; };

View File

@ -29,11 +29,11 @@ export class PropertyMappingScopeForm extends ModelForm<ScopeMapping, string> {
if (this.instance) { if (this.instance) {
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsScopeUpdate({ return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsScopeUpdate({
pmUuid: this.instance.pk || "", pmUuid: this.instance.pk || "",
data: data scopeMappingRequest: data
}); });
} else { } else {
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsScopeCreate({ return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsScopeCreate({
data: data scopeMappingRequest: data
}); });
} }
}; };

View File

@ -1,4 +1,4 @@
import { CoreApi, PropertyMapping, PropertymappingsApi, PropertyMappingTestResult } from "authentik-api"; import { CoreApi, PolicyTestRequest, PropertyMapping, PropertymappingsApi, PropertyMappingTestResult } from "authentik-api";
import { t } from "@lingui/macro"; import { t } from "@lingui/macro";
import { customElement, property } from "lit-element"; import { customElement, property } from "lit-element";
import { html, TemplateResult } from "lit-html"; import { html, TemplateResult } from "lit-html";
@ -8,11 +8,10 @@ import { until } from "lit-html/directives/until";
import { ifDefined } from "lit-html/directives/if-defined"; import { ifDefined } from "lit-html/directives/if-defined";
import "../../elements/forms/HorizontalFormElement"; import "../../elements/forms/HorizontalFormElement";
import "../../elements/CodeMirror"; import "../../elements/CodeMirror";
import { PolicyTest } from "authentik-api/src";
import YAML from "yaml"; import YAML from "yaml";
@customElement("ak-property-mapping-test-form") @customElement("ak-property-mapping-test-form")
export class PolicyTestForm extends Form<PolicyTest> { export class PolicyTestForm extends Form<PolicyTestRequest> {
@property({attribute: false}) @property({attribute: false})
mapping?: PropertyMapping; mapping?: PropertyMapping;
@ -24,10 +23,10 @@ export class PolicyTestForm extends Form<PolicyTest> {
return t`Successfully sent test-request.`; return t`Successfully sent test-request.`;
} }
send = (data: PolicyTest): Promise<PropertyMappingTestResult> => { send = (data: PolicyTestRequest): Promise<PropertyMappingTestResult> => {
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsAllTest({ return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsAllTestCreate({
pmUuid: this.mapping?.pk || "", pmUuid: this.mapping?.pk || "",
data: data, policyTestRequest: data,
formatResult: true, formatResult: true,
}).then(result => this.result = result); }).then(result => this.result = result);
}; };

View File

@ -110,7 +110,7 @@ export class ProviderListPage extends TablePage<Provider> {
<i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i> <i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i>
</button> </button>
<ul class="pf-c-dropdown__menu" hidden> <ul class="pf-c-dropdown__menu" hidden>
${until(new ProvidersApi(DEFAULT_CONFIG).providersAllTypes().then((types) => { ${until(new ProvidersApi(DEFAULT_CONFIG).providersAllTypesList().then((types) => {
return types.map((type) => { return types.map((type) => {
return html`<li> return html`<li>
<ak-forms-modal> <ak-forms-modal>

View File

@ -31,11 +31,11 @@ export class LDAPProviderFormPage extends ModelForm<LDAPProvider, number> {
if (this.instance) { if (this.instance) {
return new ProvidersApi(DEFAULT_CONFIG).providersLdapUpdate({ return new ProvidersApi(DEFAULT_CONFIG).providersLdapUpdate({
id: this.instance.pk || 0, id: this.instance.pk || 0,
data: data lDAPProviderRequest: data
}); });
} else { } else {
return new ProvidersApi(DEFAULT_CONFIG).providersLdapCreate({ return new ProvidersApi(DEFAULT_CONFIG).providersLdapCreate({
data: data lDAPProviderRequest: data
}); });
} }
}; };

View File

@ -37,11 +37,11 @@ export class OAuth2ProviderFormPage extends ModelForm<OAuth2Provider, number> {
if (this.instance) { if (this.instance) {
return new ProvidersApi(DEFAULT_CONFIG).providersOauth2Update({ return new ProvidersApi(DEFAULT_CONFIG).providersOauth2Update({
id: this.instance.pk || 0, id: this.instance.pk || 0,
data: data oAuth2ProviderRequest: data
}); });
} else { } else {
return new ProvidersApi(DEFAULT_CONFIG).providersOauth2Create({ return new ProvidersApi(DEFAULT_CONFIG).providersOauth2Create({
data: data oAuth2ProviderRequest: data
}); });
} }
}; };

View File

@ -41,11 +41,11 @@ export class ProxyProviderFormPage extends ModelForm<ProxyProvider, number> {
if (this.instance) { if (this.instance) {
return new ProvidersApi(DEFAULT_CONFIG).providersProxyUpdate({ return new ProvidersApi(DEFAULT_CONFIG).providersProxyUpdate({
id: this.instance.pk || 0, id: this.instance.pk || 0,
data: data proxyProviderRequest: data
}); });
} else { } else {
return new ProvidersApi(DEFAULT_CONFIG).providersProxyCreate({ return new ProvidersApi(DEFAULT_CONFIG).providersProxyCreate({
data: data proxyProviderRequest: data
}); });
} }
}; };

View File

@ -31,11 +31,11 @@ export class SAMLProviderFormPage extends ModelForm<SAMLProvider, number> {
if (this.instance) { if (this.instance) {
return new ProvidersApi(DEFAULT_CONFIG).providersSamlUpdate({ return new ProvidersApi(DEFAULT_CONFIG).providersSamlUpdate({
id: this.instance.pk || 0, id: this.instance.pk || 0,
data: data sAMLProviderRequest: data
}); });
} else { } else {
return new ProvidersApi(DEFAULT_CONFIG).providersSamlCreate({ return new ProvidersApi(DEFAULT_CONFIG).providersSamlCreate({
data: data sAMLProviderRequest: data
}); });
} }
}; };

View File

@ -1,4 +1,4 @@
import { LDAPSource, SourcesApi, PropertymappingsApi } from "authentik-api"; import { LDAPSource, SourcesApi, PropertymappingsApi, LDAPSourceRequest } from "authentik-api";
import { t } from "@lingui/macro"; import { t } from "@lingui/macro";
import { customElement } from "lit-element"; import { customElement } from "lit-element";
import { html, TemplateResult } from "lit-html"; import { html, TemplateResult } from "lit-html";
@ -31,11 +31,11 @@ export class LDAPSourceForm extends ModelForm<LDAPSource, string> {
if (this.instance) { if (this.instance) {
return new SourcesApi(DEFAULT_CONFIG).sourcesLdapPartialUpdate({ return new SourcesApi(DEFAULT_CONFIG).sourcesLdapPartialUpdate({
slug: this.instance.slug, slug: this.instance.slug,
data: data patchedLDAPSourceRequest: data
}); });
} else { } else {
return new SourcesApi(DEFAULT_CONFIG).sourcesLdapCreate({ return new SourcesApi(DEFAULT_CONFIG).sourcesLdapCreate({
data: data lDAPSourceRequest: data as unknown as LDAPSourceRequest
}); });
} }
}; };
@ -117,7 +117,7 @@ export class LDAPSourceForm extends ModelForm<LDAPSource, string> {
?required=${true} ?required=${true}
?writeOnly=${this.instance !== undefined} ?writeOnly=${this.instance !== undefined}
name="bindPassword"> name="bindPassword">
<input type="text" value="${ifDefined(this.instance?.bindPassword)}" class="pf-c-form-control" required> <input type="text" value="" class="pf-c-form-control" required>
</ak-form-element-horizontal> </ak-form-element-horizontal>
<ak-form-element-horizontal <ak-form-element-horizontal
label=${t`Base DN`} label=${t`Base DN`}

View File

@ -161,7 +161,7 @@ export class LDAPSourceViewPage extends LitElement {
.apiRequest=${() => { .apiRequest=${() => {
return new SourcesApi(DEFAULT_CONFIG).sourcesLdapPartialUpdate({ return new SourcesApi(DEFAULT_CONFIG).sourcesLdapPartialUpdate({
slug: this.source?.slug || "", slug: this.source?.slug || "",
data: this.source, patchedLDAPSourceRequest: this.source,
}); });
}}> }}>
${t`Retry Task`} ${t`Retry Task`}

View File

@ -1,4 +1,4 @@
import { OAuthSource, SourcesApi, FlowsApi, FlowDesignationEnum, UserMatchingModeEnum } from "authentik-api"; import { OAuthSource, SourcesApi, FlowsApi, FlowDesignationEnum, UserMatchingModeEnum, OAuthSourceRequest } from "authentik-api";
import { t } from "@lingui/macro"; import { t } from "@lingui/macro";
import { customElement, property } from "lit-element"; import { customElement, property } from "lit-element";
import { html, TemplateResult } from "lit-html"; import { html, TemplateResult } from "lit-html";
@ -44,11 +44,11 @@ export class OAuthSourceForm extends ModelForm<OAuthSource, string> {
if (this.instance) { if (this.instance) {
return new SourcesApi(DEFAULT_CONFIG).sourcesOauthPartialUpdate({ return new SourcesApi(DEFAULT_CONFIG).sourcesOauthPartialUpdate({
slug: this.instance.slug, slug: this.instance.slug,
data: data patchedOAuthSourceRequest: data
}); });
} else { } else {
return new SourcesApi(DEFAULT_CONFIG).sourcesOauthCreate({ return new SourcesApi(DEFAULT_CONFIG).sourcesOauthCreate({
data: data oAuthSourceRequest: data as unknown as OAuthSourceRequest
}); });
} }
}; };
@ -173,7 +173,7 @@ export class OAuthSourceForm extends ModelForm<OAuthSource, string> {
?required=${true} ?required=${true}
?writeOnly=${this.instance !== undefined} ?writeOnly=${this.instance !== undefined}
name="consumerSecret"> name="consumerSecret">
<input type="text" value="${ifDefined(this.instance?.consumerSecret)}" class="pf-c-form-control" required> <input type="text" value="" class="pf-c-form-control" required>
</ak-form-element-horizontal> </ak-form-element-horizontal>
<ak-form-element-horizontal <ak-form-element-horizontal
label=${t`Provider type`} label=${t`Provider type`}

View File

@ -50,11 +50,11 @@ export class PlexSourceForm extends ModelForm<PlexSource, string> {
if (this.instance?.slug) { if (this.instance?.slug) {
return new SourcesApi(DEFAULT_CONFIG).sourcesPlexUpdate({ return new SourcesApi(DEFAULT_CONFIG).sourcesPlexUpdate({
slug: this.instance.slug, slug: this.instance.slug,
data: data plexSourceRequest: data
}); });
} else { } else {
return new SourcesApi(DEFAULT_CONFIG).sourcesPlexCreate({ return new SourcesApi(DEFAULT_CONFIG).sourcesPlexCreate({
data: data plexSourceRequest: data
}); });
} }
}; };

View File

@ -31,11 +31,11 @@ export class SAMLSourceForm extends ModelForm<SAMLSource, string> {
if (this.instance) { if (this.instance) {
return new SourcesApi(DEFAULT_CONFIG).sourcesSamlUpdate({ return new SourcesApi(DEFAULT_CONFIG).sourcesSamlUpdate({
slug: this.instance.slug, slug: this.instance.slug,
data: data sAMLSourceRequest: data
}); });
} else { } else {
return new SourcesApi(DEFAULT_CONFIG).sourcesSamlCreate({ return new SourcesApi(DEFAULT_CONFIG).sourcesSamlCreate({
data: data sAMLSourceRequest: data
}); });
} }
}; };

View File

@ -121,7 +121,7 @@ export class StageListPage extends TablePage<Stage> {
<i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i> <i class="fas fa-caret-down pf-c-dropdown__toggle-icon" aria-hidden="true"></i>
</button> </button>
<ul class="pf-c-dropdown__menu" hidden> <ul class="pf-c-dropdown__menu" hidden>
${until(new StagesApi(DEFAULT_CONFIG).stagesAllTypes().then((types) => { ${until(new StagesApi(DEFAULT_CONFIG).stagesAllTypesList().then((types) => {
return types.map((type) => { return types.map((type) => {
return html`<li> return html`<li>
<ak-forms-modal> <ak-forms-modal>

View File

@ -31,11 +31,11 @@ export class AuthenticatorStaticStageForm extends ModelForm<AuthenticatorStaticS
if (this.instance) { if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorStaticUpdate({ return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorStaticUpdate({
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
data: data authenticatorStaticStageRequest: data
}); });
} else { } else {
return new StagesApi(DEFAULT_CONFIG).stagesUserWriteCreate({ return new StagesApi(DEFAULT_CONFIG).stagesUserWriteCreate({
data: data authenticatorStaticStageRequest: data
}); });
} }
}; };

View File

@ -30,11 +30,11 @@ export class AuthenticatorTOTPStageForm extends ModelForm<AuthenticatorTOTPStage
if (this.instance) { if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorTotpUpdate({ return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorTotpUpdate({
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
data: data authenticatorTOTPStageRequest: data
}); });
} else { } else {
return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorTotpCreate({ return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorTotpCreate({
data: data authenticatorTOTPStageRequest: data
}); });
} }
}; };

View File

@ -36,11 +36,11 @@ export class AuthenticatorValidateStageForm extends ModelForm<AuthenticatorValid
if (this.instance) { if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorValidateUpdate({ return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorValidateUpdate({
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
data: data authenticatorValidateStageRequest: data
}); });
} else { } else {
return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorValidateCreate({ return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorValidateCreate({
data: data authenticatorValidateStageRequest: data
}); });
} }
}; };

View File

@ -28,11 +28,11 @@ export class AuthenticateWebAuthnStageForm extends ModelForm<AuthenticateWebAuth
if (this.instance) { if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorWebauthnUpdate({ return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorWebauthnUpdate({
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
data: data authenticateWebAuthnStageRequest: data
}); });
} else { } else {
return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorWebauthnCreate({ return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorWebauthnCreate({
data: data authenticateWebAuthnStageRequest: data
}); });
} }
}; };

View File

@ -1,4 +1,4 @@
import { CaptchaStage, StagesApi } from "authentik-api"; import { CaptchaStage, CaptchaStageRequest, StagesApi } from "authentik-api";
import { t } from "@lingui/macro"; import { t } from "@lingui/macro";
import { customElement } from "lit-element"; import { customElement } from "lit-element";
import { html, TemplateResult } from "lit-html"; import { html, TemplateResult } from "lit-html";
@ -29,11 +29,11 @@ export class CaptchaStageForm extends ModelForm<CaptchaStage, string> {
if (this.instance) { if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesCaptchaPartialUpdate({ return new StagesApi(DEFAULT_CONFIG).stagesCaptchaPartialUpdate({
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
data: data patchedCaptchaStageRequest: data
}); });
} else { } else {
return new StagesApi(DEFAULT_CONFIG).stagesCaptchaCreate({ return new StagesApi(DEFAULT_CONFIG).stagesCaptchaCreate({
data: data captchaStageRequest: data as unknown as CaptchaStageRequest
}); });
} }
}; };

View File

@ -35,11 +35,11 @@ export class ConsentStageForm extends ModelForm<ConsentStage, string> {
if (this.instance) { if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesConsentUpdate({ return new StagesApi(DEFAULT_CONFIG).stagesConsentUpdate({
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
data: data consentStageRequest: data
}); });
} else { } else {
return new StagesApi(DEFAULT_CONFIG).stagesConsentCreate({ return new StagesApi(DEFAULT_CONFIG).stagesConsentCreate({
data: data consentStageRequest: data
}); });
} }
}; };

View File

@ -28,11 +28,11 @@ export class DenyStageForm extends ModelForm<DenyStage, string> {
if (this.instance) { if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesDenyUpdate({ return new StagesApi(DEFAULT_CONFIG).stagesDenyUpdate({
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
data: data denyStageRequest: data
}); });
} else { } else {
return new StagesApi(DEFAULT_CONFIG).stagesDenyCreate({ return new StagesApi(DEFAULT_CONFIG).stagesDenyCreate({
data: data denyStageRequest: data
}); });
} }
}; };

View File

@ -28,11 +28,11 @@ export class DummyStageForm extends ModelForm<DummyStage, string> {
if (this.instance) { if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesDummyUpdate({ return new StagesApi(DEFAULT_CONFIG).stagesDummyUpdate({
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
data: data dummyStageRequest: data
}); });
} else { } else {
return new StagesApi(DEFAULT_CONFIG).stagesDummyCreate({ return new StagesApi(DEFAULT_CONFIG).stagesDummyCreate({
data: data dummyStageRequest: data
}); });
} }
}; };

View File

@ -37,11 +37,11 @@ export class EmailStageForm extends ModelForm<EmailStage, string> {
if (this.instance) { if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesEmailPartialUpdate({ return new StagesApi(DEFAULT_CONFIG).stagesEmailPartialUpdate({
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
data: data patchedEmailStageRequest: data
}); });
} else { } else {
return new StagesApi(DEFAULT_CONFIG).stagesEmailCreate({ return new StagesApi(DEFAULT_CONFIG).stagesEmailCreate({
data: data emailStageRequest: data
}); });
} }
}; };

View File

@ -31,11 +31,11 @@ export class IdentificationStageForm extends ModelForm<IdentificationStage, stri
if (this.instance) { if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesIdentificationUpdate({ return new StagesApi(DEFAULT_CONFIG).stagesIdentificationUpdate({
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
data: data identificationStageRequest: data
}); });
} else { } else {
return new StagesApi(DEFAULT_CONFIG).stagesIdentificationCreate({ return new StagesApi(DEFAULT_CONFIG).stagesIdentificationCreate({
data: data identificationStageRequest: data
}); });
} }
}; };

View File

@ -30,11 +30,11 @@ export class InvitationForm extends ModelForm<Invitation, string> {
if (this.instance) { if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesInvitationInvitationsUpdate({ return new StagesApi(DEFAULT_CONFIG).stagesInvitationInvitationsUpdate({
inviteUuid: this.instance.pk || "", inviteUuid: this.instance.pk || "",
data: data invitationRequest: data
}); });
} else { } else {
return new StagesApi(DEFAULT_CONFIG).stagesInvitationInvitationsCreate({ return new StagesApi(DEFAULT_CONFIG).stagesInvitationInvitationsCreate({
data: data invitationRequest: data
}); });
} }
}; };

View File

@ -30,11 +30,11 @@ export class InvitationStageForm extends ModelForm<InvitationStage, string> {
if (this.instance) { if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesInvitationStagesUpdate({ return new StagesApi(DEFAULT_CONFIG).stagesInvitationStagesUpdate({
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
data: data invitationStageRequest: data
}); });
} else { } else {
return new StagesApi(DEFAULT_CONFIG).stagesInvitationStagesCreate({ return new StagesApi(DEFAULT_CONFIG).stagesInvitationStagesCreate({
data: data invitationStageRequest: data
}); });
} }
}; };

View File

@ -31,11 +31,11 @@ export class PasswordStageForm extends ModelForm<PasswordStage, string> {
if (this.instance) { if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesPasswordUpdate({ return new StagesApi(DEFAULT_CONFIG).stagesPasswordUpdate({
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
data: data passwordStageRequest: data
}); });
} else { } else {
return new StagesApi(DEFAULT_CONFIG).stagesPasswordCreate({ return new StagesApi(DEFAULT_CONFIG).stagesPasswordCreate({
data: data passwordStageRequest: data
}); });
} }
}; };

View File

@ -29,11 +29,11 @@ export class PromptForm extends ModelForm<Prompt, string> {
if (this.instance) { if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesPromptPromptsUpdate({ return new StagesApi(DEFAULT_CONFIG).stagesPromptPromptsUpdate({
promptUuid: this.instance.pk || "", promptUuid: this.instance.pk || "",
data: data promptRequest: data
}); });
} else { } else {
return new StagesApi(DEFAULT_CONFIG).stagesPromptPromptsCreate({ return new StagesApi(DEFAULT_CONFIG).stagesPromptPromptsCreate({
data: data promptRequest: data
}); });
} }
}; };

View File

@ -32,11 +32,11 @@ export class PromptStageForm extends ModelForm<PromptStage, string> {
if (this.instance) { if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesPromptStagesUpdate({ return new StagesApi(DEFAULT_CONFIG).stagesPromptStagesUpdate({
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
data: data promptStageRequest: data
}); });
} else { } else {
return new StagesApi(DEFAULT_CONFIG).stagesPromptStagesCreate({ return new StagesApi(DEFAULT_CONFIG).stagesPromptStagesCreate({
data: data promptStageRequest: data
}); });
} }
}; };

View File

@ -28,11 +28,11 @@ export class UserDeleteStageForm extends ModelForm<UserDeleteStage, string> {
if (this.instance) { if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesUserDeleteUpdate({ return new StagesApi(DEFAULT_CONFIG).stagesUserDeleteUpdate({
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
data: data userDeleteStageRequest: data
}); });
} else { } else {
return new StagesApi(DEFAULT_CONFIG).stagesUserDeleteCreate({ return new StagesApi(DEFAULT_CONFIG).stagesUserDeleteCreate({
data: data userDeleteStageRequest: data
}); });
} }
}; };

View File

@ -29,11 +29,11 @@ export class UserLoginStageForm extends ModelForm<UserLoginStage, string> {
if (this.instance) { if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesUserLoginUpdate({ return new StagesApi(DEFAULT_CONFIG).stagesUserLoginUpdate({
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
data: data userLoginStageRequest: data
}); });
} else { } else {
return new StagesApi(DEFAULT_CONFIG).stagesUserLoginCreate({ return new StagesApi(DEFAULT_CONFIG).stagesUserLoginCreate({
data: data userLoginStageRequest: data
}); });
} }
}; };

View File

@ -28,11 +28,11 @@ export class UserLogoutStageForm extends ModelForm<UserLogoutStage, string> {
if (this.instance) { if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesUserLogoutUpdate({ return new StagesApi(DEFAULT_CONFIG).stagesUserLogoutUpdate({
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
data: data userLogoutStageRequest: data
}); });
} else { } else {
return new StagesApi(DEFAULT_CONFIG).stagesUserLogoutCreate({ return new StagesApi(DEFAULT_CONFIG).stagesUserLogoutCreate({
data: data userLogoutStageRequest: data
}); });
} }
}; };

View File

@ -28,11 +28,11 @@ export class UserWriteStageForm extends ModelForm<UserWriteStage, string> {
if (this.instance) { if (this.instance) {
return new StagesApi(DEFAULT_CONFIG).stagesUserWriteUpdate({ return new StagesApi(DEFAULT_CONFIG).stagesUserWriteUpdate({
stageUuid: this.instance.pk || "", stageUuid: this.instance.pk || "",
data: data userWriteStageRequest: data
}); });
} else { } else {
return new StagesApi(DEFAULT_CONFIG).stagesUserWriteCreate({ return new StagesApi(DEFAULT_CONFIG).stagesUserWriteCreate({
data: data userWriteStageRequest: data
}); });
} }
}; };

View File

@ -49,7 +49,7 @@ export class UserDetailsPage extends LitElement {
.send=${(data: unknown) => { .send=${(data: unknown) => {
return new CoreApi(DEFAULT_CONFIG).coreUsersUpdate({ return new CoreApi(DEFAULT_CONFIG).coreUsersUpdate({
id: this.user?.pk || 0, id: this.user?.pk || 0,
data: data as User userRequest: data as User
}); });
}}> }}>
<form class="pf-c-form pf-m-horizontal"> <form class="pf-c-form pf-m-horizontal">

View File

@ -78,14 +78,14 @@ export class UserSettingsPage extends LitElement {
<section slot="page-tokens" data-tab-title="${t`Tokens`}" class="pf-c-page__main-section pf-m-no-padding-mobile"> <section slot="page-tokens" data-tab-title="${t`Tokens`}" class="pf-c-page__main-section pf-m-no-padding-mobile">
<ak-user-token-list></ak-user-token-list> <ak-user-token-list></ak-user-token-list>
</section> </section>
${until(new StagesApi(DEFAULT_CONFIG).stagesAllUserSettings().then((stages) => { ${until(new StagesApi(DEFAULT_CONFIG).stagesAllUserSettingsList().then((stages) => {
return stages.map((stage) => { return stages.map((stage) => {
return html`<section slot="page-${stage.objectUid}" data-tab-title="${ifDefined(stage.title)}" class="pf-c-page__main-section pf-m-no-padding-mobile"> return html`<section slot="page-${stage.objectUid}" data-tab-title="${ifDefined(stage.title)}" class="pf-c-page__main-section pf-m-no-padding-mobile">
${this.renderStageSettings(stage)} ${this.renderStageSettings(stage)}
</section>`; </section>`;
}); });
}))} }))}
${until(new SourcesApi(DEFAULT_CONFIG).sourcesAllUserSettings().then((source) => { ${until(new SourcesApi(DEFAULT_CONFIG).sourcesAllUserSettingsList().then((source) => {
return source.map((stage) => { return source.map((stage) => {
return html`<section slot="page-${stage.objectUid}" data-tab-title="${ifDefined(stage.title)}" class="pf-c-page__main-section pf-m-no-padding-mobile"> return html`<section slot="page-${stage.objectUid}" data-tab-title="${ifDefined(stage.title)}" class="pf-c-page__main-section pf-m-no-padding-mobile">
${this.renderSourceSettings(stage)} ${this.renderSourceSettings(stage)}

View File

@ -53,7 +53,7 @@ export class UserSettingsAuthenticatorWebAuthn extends BaseUserSettings {
.send=${(data: unknown) => { .send=${(data: unknown) => {
return new AuthenticatorsApi(DEFAULT_CONFIG).authenticatorsWebauthnUpdate({ return new AuthenticatorsApi(DEFAULT_CONFIG).authenticatorsWebauthnUpdate({
id: device.pk || 0, id: device.pk || 0,
data: data as WebAuthnDevice webAuthnDeviceRequest: data as WebAuthnDevice
}); });
}}> }}>
<form class="pf-c-form pf-m-horizontal"> <form class="pf-c-form pf-m-horizontal">

View File

@ -28,11 +28,11 @@ export class UserTokenForm extends ModelForm<Token, string> {
if (this.instance) { if (this.instance) {
return new CoreApi(DEFAULT_CONFIG).coreTokensUpdate({ return new CoreApi(DEFAULT_CONFIG).coreTokensUpdate({
identifier: this.instance.identifier, identifier: this.instance.identifier,
data: data tokenRequest: data
}); });
} else { } else {
return new CoreApi(DEFAULT_CONFIG).coreTokensCreate({ return new CoreApi(DEFAULT_CONFIG).coreTokensCreate({
data: data tokenRequest: data
}); });
} }
}; };