(ctx: RequestContext, administratorId: ID, upload: Promise<StoredMediaUpload> | StoredMediaUpload | null) => Promise<Administrator>(ctx: RequestContext, options?: ListQueryOptions<Administrator>, relations?: RelationPaths<Administrator>) => Promise<PaginatedList<Administrator>>Get a paginated list of Administrators.
(ctx: RequestContext, administratorId: ID, relations?: RelationPaths<Administrator>) => Promise<Administrator | undefined>Get an Administrator by id.
Resolves to undefined if the Administrator is not visible to the active user, so that a
caller cannot confirm the existence of an Administrator they are not allowed to see.
(ctx: RequestContext, userId: ID, relations?: RelationPaths<Administrator>) => Promise<Administrator | undefined>Get an Administrator based on the User id.
(ctx: RequestContext, relations?: RelationPaths<Administrator>) => Promise<Administrator | undefined>v3.6.4Resolves the Administrator to be credited as the actor of the current request when
recording an audit trail, e.g. the administrator of a HistoryEntry.
For a regular session this is the Administrator of the active User, exactly as returned by
AdministratorService.findOneByUserId.
An API-Key session authenticates as the synthetic "API-Key user" created alongside the key,
which has no Administrator of its own. For those sessions we fall back to the Administrator
of the ApiKey's owner, so that actions performed with the key are attributed to the
Administrator who created it. The owner is not required to be an Administrator — it may be a
Customer's User — in which case undefined is returned and the entry stays unattributed.
This is deliberately kept separate from AdministratorService.findOneByUserId, which
answers the literal question "which Administrator belongs to this User id?".
Never use this method to make authorization decisions. The Administrator it returns is not the authenticated principal of the request, and their permissions do not apply to it.
(ctx: RequestContext, input: CreateAdministratorInput) => Promise<Administrator>Create a new Administrator.
(ctx: RequestContext, input: UpdateAdministratorInput) => Promise<Administrator>Update an existing Administrator.
Publishes a new AdministratorPasswordResetEvent for the Administrator with the given
email address. The event contains a token which can then be used in the resetPassword()
method. If no Administrator exists with the given email address, no action is taken.
(ctx: RequestContext, passwordResetToken: string, password: string) => Promise< User | PasswordResetTokenExpiredError | PasswordResetTokenInvalidError | PasswordValidationError >v3.8.0Given a valid password reset token created by a call to the requestPasswordReset() method,
this method will change the Administrator's password to that given as the password argument.
(ctx: RequestContext, administratorId: ID, roleId: ID) => Promise<Administrator>Assigns a Role to the Administrator's User entity.
(ctx: RequestContext, id: ID) => Soft deletes an Administrator (sets the deletedAt field).
Architecture reviews, custom plugin work, migrations, ongoing support. Get a hand from the team that builds Vendure.
Talk to the team