sources/plex: add property mappings (#10772)
This commit is contained in:
committed by
GitHub
parent
82017fac8c
commit
68af5b0572
@ -3,6 +3,7 @@ import "@goauthentik/admin/property-mappings/PropertyMappingLDAPSourceForm";
|
||||
import "@goauthentik/admin/property-mappings/PropertyMappingMicrosoftEntraForm";
|
||||
import "@goauthentik/admin/property-mappings/PropertyMappingNotification";
|
||||
import "@goauthentik/admin/property-mappings/PropertyMappingOAuthSourceForm";
|
||||
import "@goauthentik/admin/property-mappings/PropertyMappingPlexSourceForm";
|
||||
import "@goauthentik/admin/property-mappings/PropertyMappingRACForm";
|
||||
import "@goauthentik/admin/property-mappings/PropertyMappingRadiusForm";
|
||||
import "@goauthentik/admin/property-mappings/PropertyMappingSAMLForm";
|
||||
|
||||
@ -0,0 +1,40 @@
|
||||
import { BasePropertyMappingForm } from "@goauthentik/admin/property-mappings/BasePropertyMappingForm";
|
||||
import { DEFAULT_CONFIG } from "@goauthentik/common/api/config";
|
||||
import "@goauthentik/elements/CodeMirror";
|
||||
import "@goauthentik/elements/forms/HorizontalFormElement";
|
||||
|
||||
import { customElement } from "lit/decorators.js";
|
||||
|
||||
import { PlexSourcePropertyMapping, PropertymappingsApi } from "@goauthentik/api";
|
||||
|
||||
@customElement("ak-property-mapping-plex-source-form")
|
||||
export class PropertyMappingPlexSourceForm extends BasePropertyMappingForm<PlexSourcePropertyMapping> {
|
||||
docLink(): string {
|
||||
return "/docs/sources/property-mappings/expression?utm_source=authentik";
|
||||
}
|
||||
|
||||
loadInstance(pk: string): Promise<PlexSourcePropertyMapping> {
|
||||
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsSourcePlexRetrieve({
|
||||
pmUuid: pk,
|
||||
});
|
||||
}
|
||||
|
||||
async send(data: PlexSourcePropertyMapping): Promise<PlexSourcePropertyMapping> {
|
||||
if (this.instance) {
|
||||
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsSourcePlexUpdate({
|
||||
pmUuid: this.instance.pk,
|
||||
plexSourcePropertyMappingRequest: data,
|
||||
});
|
||||
} else {
|
||||
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsSourcePlexCreate({
|
||||
plexSourcePropertyMappingRequest: data,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
"ak-property-mapping-plex-source-form": PropertyMappingPlexSourceForm;
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,7 @@
|
||||
import "@goauthentik/admin/property-mappings/PropertyMappingLDAPSourceForm";
|
||||
import "@goauthentik/admin/property-mappings/PropertyMappingNotification";
|
||||
import "@goauthentik/admin/property-mappings/PropertyMappingOAuthSourceForm";
|
||||
import "@goauthentik/admin/property-mappings/PropertyMappingPlexSourceForm";
|
||||
import "@goauthentik/admin/property-mappings/PropertyMappingRACForm";
|
||||
import "@goauthentik/admin/property-mappings/PropertyMappingSAMLForm";
|
||||
import "@goauthentik/admin/property-mappings/PropertyMappingSAMLSourceForm";
|
||||
|
||||
Reference in New Issue
Block a user