// @ts-nocheck /** * This is an auto generate file from fireback project. * You can use this in order to communicate in backend, it gives you available actions, * and their types * Module: passports */ import * as workspaces from "../workspaces"; import * as passports from "./index"; import { execApiFn, RemoteRequestOption, IDeleteResponse, IResponse, core, ExecApi, IResponseList, } from "../../core/http-tools"; export class PassportActions { private _itemsPerPage?: number = undefined; private _startIndex?: number = undefined; private _sort?: number = undefined; private _query?: string = undefined; private _withPreloads?: string = undefined; private _uniqueId?: string = undefined; private _deep?: boolean = undefined; constructor(private apiFn: ExecApi) { this.apiFn = apiFn; } static isPassportEntityEqual( a: passports.PassportEntity, b: passports.PassportEntity ): boolean { // Change if the primary key is different, or is combined with few fields return a.uniqueId === b.uniqueId; } static getPassportEntityPrimaryKey(a: passports.PassportEntity): string { // Change if the primary key is different, or is combined with few fields return a.uniqueId; } static isWorkspaceInviteEntityEqual( a: workspaces.WorkspaceInviteEntity, b: workspaces.WorkspaceInviteEntity ): boolean { // Change if the primary key is different, or is combined with few fields return a.uniqueId === b.uniqueId; } static getWorkspaceInviteEntityPrimaryKey( a: workspaces.WorkspaceInviteEntity ): string { // Change if the primary key is different, or is combined with few fields return a.uniqueId; } query(complexSqlAlike: string): PassportActions { this._query = complexSqlAlike; return this; } static fn(options: RemoteRequestOption): PassportActions { return new PassportActions(execApiFn(options)); } static fnExec(fn: ExecApi): PassportActions { return new PassportActions(fn); } uniqueId(id: string): PassportActions { this._uniqueId = id; return this; } deep(deep = true): PassportActions { this._deep = deep; return this; } withPreloads(withPreloads: string): PassportActions { this._withPreloads = withPreloads; return this; } sort(sortFields: string | string[]): PassportActions { this._sort = sortFields; return this; } startIndex(offset: number): PassportActions { this._startIndex = offset; return this; } itemsPerPage(limit: number): PassportActions { this._itemsPerPage = limit; return this; } get paramsAsString(): string { const q: any = { startIndex: this._startIndex, itemsPerPage: this._itemsPerPage, query: this._query, deep: this._deep, withPreloads: this._withPreloads, uniqueId: this._uniqueId, sort: this._sort, }; const searchParams = new URLSearchParams(); Object.keys(q).forEach((key) => { if (q[key]) { searchParams.append(key, q[key]); } }); return searchParams.toString(); } async getPassports(): Promise> { return this.apiFn("GET", `passports?${this.paramsAsString}`); } async getPassportByUniqueId( uniqueId: string ): Promise> { return this.apiFn( "GET", `passport/:uniqueId?${this.paramsAsString}`.replace(":uniqueId", uniqueId) ); } async postPassport( entity: passports.PassportEntity ): Promise> { return this.apiFn("POST", `passport?${this.paramsAsString}`, entity); } async patchPassportByUniqueId( uniqueId: string, entity: passports.PassportEntity ): Promise> { return this.apiFn( "PATCH", `passport/:uniqueId?${this.paramsAsString}`.replace( ":uniqueId", uniqueId ), entity ); } async deletePassport(entity: core.DeleteRequest): Promise { return this.apiFn("DELETE", `passport?${this.paramsAsString}`, entity); } async postPassportSignupEmail( entity: passports.EmailAccountSignupDto ): Promise> { return this.apiFn( "POST", `passport/signup/email?${this.paramsAsString}`, entity ); } async getWorkspacePublicjoinkeys(): Promise< IResponseList > { return this.apiFn("GET", `workspace/publicjoinkeys?${this.paramsAsString}`); } async postWorkspacePublicjoinkey( entity: passports.PublicJoinKey ): Promise> { return this.apiFn( "POST", `workspace/publicjoinkey?${this.paramsAsString}`, entity ); } async getWorkspacePublicjoinkeyByUniqueId( uniqueId: string ): Promise> { return this.apiFn( "GET", `workspace/publicjoinkey/:uniqueId?${this.paramsAsString}`.replace( ":uniqueId", uniqueId ) ); } async getWorkspacePublicJoinKeyInfoByUniqueId( uniqueId: string ): Promise> { return this.apiFn( "GET", `workspace/publicJoinKeyInfo/:uniqueId?${this.paramsAsString}`.replace( ":uniqueId", uniqueId ) ); } async deleteWorkspacePublicjoinkey( entity: core.DeleteRequest ): Promise { return this.apiFn( "DELETE", `workspace/publicjoinkey?${this.paramsAsString}`, entity ); } async patchWorkspacePublicjoinkey( entity: passports.PublicJoinKey ): Promise> { return this.apiFn( "PATCH", `workspace/publicjoinkey?${this.paramsAsString}`, entity ); } async postPassportSigninEmail( entity: passports.EmailAccountSigninDto ): Promise> { return this.apiFn( "POST", `passport/signin/email?${this.paramsAsString}`, entity ); } async postPassportAuthorizeOs( entity: passports.EmailAccountSigninDto ): Promise> { return this.apiFn( "POST", `passport/authorizeOs?action=PassportActionAuthorizeOs&${this.paramsAsString}`, entity ); } async getWorkspacesInviteByUniqueId( uniqueId: string ): Promise> { return this.apiFn( "GET", `workspaces/invite/:uniqueId?${this.paramsAsString}`.replace( ":uniqueId", uniqueId ) ); } async postPassportSignupPhoneNumber( entity: passports.PhoneNumberAccountCreationDto ): Promise> { return this.apiFn( "POST", `passport/signup/phoneNumber?${this.paramsAsString}`, entity ); } async postPassportSignupPhoneNumberConfirm( entity: passports.PhoneNumberAccountCreationDto ): Promise> { return this.apiFn( "POST", `passport/signup/phoneNumberConfirm?${this.paramsAsString}`, entity ); } async postPassportSigninPhoneNumber( entity: passports.PhoneNumberAccountCreationDto ): Promise> { return this.apiFn( "POST", `passport/signin/phoneNumber?${this.paramsAsString}`, entity ); } async postConfirmEmailByUniqueId( uniqueId: string, entity: core.EmptyRequest ): Promise> { return this.apiFn( "POST", `confirm/email/:uniqueId?${this.paramsAsString}`.replace( ":uniqueId", uniqueId ), entity ); } async postPassportRequestResetMailPassword( entity: passports.OtpAuthenticateDto ): Promise> { return this.apiFn( "POST", `passport/request-reset-mail-password?${this.paramsAsString}`, entity ); } async postPassportAuthorize2( entity: passports.OtpAuthenticateDto ): Promise> { return this.apiFn( "POST", `passport/authorize2?${this.paramsAsString}`, entity ); } async postPassportResetMailPasswordByUniqueId( uniqueId: string, entity: passports.ResetEmailDto ): Promise> { return this.apiFn( "POST", `passport/reset-mail-password/:uniqueId?${this.paramsAsString}`.replace( ":uniqueId", uniqueId ), entity ); } async getPassportRequestResetMailPassword(): Promise< IResponse > { return this.apiFn( "GET", `passport/request-reset-mail-password?${this.paramsAsString}` ); } async getPassportResetMailPasswordInfoByUniqueId( uniqueId: string ): Promise> { return this.apiFn( "GET", `passport/reset-mail-password-info/:uniqueId?${this.paramsAsString}`.replace( ":uniqueId", uniqueId ) ); } }