livelists-node-js
Version:
node.js server sdk for livelists
300 lines (299 loc) • 12.9 kB
TypeScript
import _m0 from "protobufjs/minimal";
export declare const protobufPackage = "participant";
export declare enum ParticipantStatus {
Active = 0,
Banned = 1,
UNRECOGNIZED = -1
}
export declare function participantStatusFromJSON(object: any): ParticipantStatus;
export declare function participantStatusToJSON(object: ParticipantStatus): string;
export declare enum AddParticipantToChannelErrors {
Unauthorized = 0,
IsAlreadyExist = 1,
IdentifierNotValid = 2,
ChannelNotFound = 3,
UNRECOGNIZED = -1
}
export declare function addParticipantToChannelErrorsFromJSON(object: any): AddParticipantToChannelErrors;
export declare function addParticipantToChannelErrorsToJSON(object: AddParticipantToChannelErrors): string;
export declare enum GetParticipantAccessTokenErrors {
RootUnauthorized = 0,
NotFound = 1,
UNRECOGNIZED = -1
}
export declare function getParticipantAccessTokenErrorsFromJSON(object: any): GetParticipantAccessTokenErrors;
export declare function getParticipantAccessTokenErrorsToJSON(object: GetParticipantAccessTokenErrors): string;
export interface AddParticipantToChannelRes {
errors: AddParticipantToChannelErrors[];
participant?: Participant;
accessToken: string;
grants?: ChannelParticipantGrants;
}
export interface ChannelParticipantGrants {
sendMessage?: boolean | undefined;
readMessages?: boolean | undefined;
admin?: boolean | undefined;
}
export interface Participant {
identifier: string;
createdAt?: Date;
status: ParticipantStatus;
channelId: string;
customData?: CustomData | undefined;
}
export interface AddParticipantToChannelReq {
identifier: string;
channelId: string;
grants?: ChannelParticipantGrants;
customData?: CustomData | undefined;
}
export interface GetParticipantAccessTokenReq {
identifier: string;
channelId: string;
}
export interface GetParticipantAccessTokenRes {
errors: GetParticipantAccessTokenErrors[];
identifier: string;
channelId: string;
accessToken: string;
}
export interface CustomData {
data: {
[key: string]: string;
};
}
export interface CustomData_DataEntry {
key: string;
value: string;
}
export declare const AddParticipantToChannelRes: {
encode(message: AddParticipantToChannelRes, writer?: _m0.Writer): _m0.Writer;
decode(input: _m0.Reader | Uint8Array, length?: number): AddParticipantToChannelRes;
fromJSON(object: any): AddParticipantToChannelRes;
toJSON(message: AddParticipantToChannelRes): unknown;
fromPartial<I extends {
errors?: AddParticipantToChannelErrors[] | undefined;
participant?: {
identifier?: string | undefined;
createdAt?: Date | undefined;
status?: ParticipantStatus | undefined;
channelId?: string | undefined;
customData?: {
data?: {
[x: string]: string | undefined;
} | undefined;
} | undefined;
} | undefined;
accessToken?: string | undefined;
grants?: {
sendMessage?: boolean | undefined;
readMessages?: boolean | undefined;
admin?: boolean | undefined;
} | undefined;
} & {
errors?: (AddParticipantToChannelErrors[] & AddParticipantToChannelErrors[] & { [K in Exclude<keyof I["errors"], keyof AddParticipantToChannelErrors[]>]: never; }) | undefined;
participant?: ({
identifier?: string | undefined;
createdAt?: Date | undefined;
status?: ParticipantStatus | undefined;
channelId?: string | undefined;
customData?: {
data?: {
[x: string]: string | undefined;
} | undefined;
} | undefined;
} & {
identifier?: string | undefined;
createdAt?: Date | undefined;
status?: ParticipantStatus | undefined;
channelId?: string | undefined;
customData?: ({
data?: {
[x: string]: string | undefined;
} | undefined;
} & {
data?: ({
[x: string]: string | undefined;
} & {
[x: string]: string | undefined;
} & { [K_1 in Exclude<keyof I["participant"]["customData"]["data"], string | number>]: never; }) | undefined;
} & { [K_2 in Exclude<keyof I["participant"]["customData"], "data">]: never; }) | undefined;
} & { [K_3 in Exclude<keyof I["participant"], keyof Participant>]: never; }) | undefined;
accessToken?: string | undefined;
grants?: ({
sendMessage?: boolean | undefined;
readMessages?: boolean | undefined;
admin?: boolean | undefined;
} & {
sendMessage?: boolean | undefined;
readMessages?: boolean | undefined;
admin?: boolean | undefined;
} & { [K_4 in Exclude<keyof I["grants"], keyof ChannelParticipantGrants>]: never; }) | undefined;
} & { [K_5 in Exclude<keyof I, keyof AddParticipantToChannelRes>]: never; }>(object: I): AddParticipantToChannelRes;
};
export declare const ChannelParticipantGrants: {
encode(message: ChannelParticipantGrants, writer?: _m0.Writer): _m0.Writer;
decode(input: _m0.Reader | Uint8Array, length?: number): ChannelParticipantGrants;
fromJSON(object: any): ChannelParticipantGrants;
toJSON(message: ChannelParticipantGrants): unknown;
fromPartial<I extends {
sendMessage?: boolean | undefined;
readMessages?: boolean | undefined;
admin?: boolean | undefined;
} & {
sendMessage?: boolean | undefined;
readMessages?: boolean | undefined;
admin?: boolean | undefined;
} & { [K in Exclude<keyof I, keyof ChannelParticipantGrants>]: never; }>(object: I): ChannelParticipantGrants;
};
export declare const Participant: {
encode(message: Participant, writer?: _m0.Writer): _m0.Writer;
decode(input: _m0.Reader | Uint8Array, length?: number): Participant;
fromJSON(object: any): Participant;
toJSON(message: Participant): unknown;
fromPartial<I extends {
identifier?: string | undefined;
createdAt?: Date | undefined;
status?: ParticipantStatus | undefined;
channelId?: string | undefined;
customData?: {
data?: {
[x: string]: string | undefined;
} | undefined;
} | undefined;
} & {
identifier?: string | undefined;
createdAt?: Date | undefined;
status?: ParticipantStatus | undefined;
channelId?: string | undefined;
customData?: ({
data?: {
[x: string]: string | undefined;
} | undefined;
} & {
data?: ({
[x: string]: string | undefined;
} & {
[x: string]: string | undefined;
} & { [K in Exclude<keyof I["customData"]["data"], string | number>]: never; }) | undefined;
} & { [K_1 in Exclude<keyof I["customData"], "data">]: never; }) | undefined;
} & { [K_2 in Exclude<keyof I, keyof Participant>]: never; }>(object: I): Participant;
};
export declare const AddParticipantToChannelReq: {
encode(message: AddParticipantToChannelReq, writer?: _m0.Writer): _m0.Writer;
decode(input: _m0.Reader | Uint8Array, length?: number): AddParticipantToChannelReq;
fromJSON(object: any): AddParticipantToChannelReq;
toJSON(message: AddParticipantToChannelReq): unknown;
fromPartial<I extends {
identifier?: string | undefined;
channelId?: string | undefined;
grants?: {
sendMessage?: boolean | undefined;
readMessages?: boolean | undefined;
admin?: boolean | undefined;
} | undefined;
customData?: {
data?: {
[x: string]: string | undefined;
} | undefined;
} | undefined;
} & {
identifier?: string | undefined;
channelId?: string | undefined;
grants?: ({
sendMessage?: boolean | undefined;
readMessages?: boolean | undefined;
admin?: boolean | undefined;
} & {
sendMessage?: boolean | undefined;
readMessages?: boolean | undefined;
admin?: boolean | undefined;
} & { [K in Exclude<keyof I["grants"], keyof ChannelParticipantGrants>]: never; }) | undefined;
customData?: ({
data?: {
[x: string]: string | undefined;
} | undefined;
} & {
data?: ({
[x: string]: string | undefined;
} & {
[x: string]: string | undefined;
} & { [K_1 in Exclude<keyof I["customData"]["data"], string | number>]: never; }) | undefined;
} & { [K_2 in Exclude<keyof I["customData"], "data">]: never; }) | undefined;
} & { [K_3 in Exclude<keyof I, keyof AddParticipantToChannelReq>]: never; }>(object: I): AddParticipantToChannelReq;
};
export declare const GetParticipantAccessTokenReq: {
encode(message: GetParticipantAccessTokenReq, writer?: _m0.Writer): _m0.Writer;
decode(input: _m0.Reader | Uint8Array, length?: number): GetParticipantAccessTokenReq;
fromJSON(object: any): GetParticipantAccessTokenReq;
toJSON(message: GetParticipantAccessTokenReq): unknown;
fromPartial<I extends {
identifier?: string | undefined;
channelId?: string | undefined;
} & {
identifier?: string | undefined;
channelId?: string | undefined;
} & { [K in Exclude<keyof I, keyof GetParticipantAccessTokenReq>]: never; }>(object: I): GetParticipantAccessTokenReq;
};
export declare const GetParticipantAccessTokenRes: {
encode(message: GetParticipantAccessTokenRes, writer?: _m0.Writer): _m0.Writer;
decode(input: _m0.Reader | Uint8Array, length?: number): GetParticipantAccessTokenRes;
fromJSON(object: any): GetParticipantAccessTokenRes;
toJSON(message: GetParticipantAccessTokenRes): unknown;
fromPartial<I extends {
errors?: GetParticipantAccessTokenErrors[] | undefined;
identifier?: string | undefined;
channelId?: string | undefined;
accessToken?: string | undefined;
} & {
errors?: (GetParticipantAccessTokenErrors[] & GetParticipantAccessTokenErrors[] & { [K in Exclude<keyof I["errors"], keyof GetParticipantAccessTokenErrors[]>]: never; }) | undefined;
identifier?: string | undefined;
channelId?: string | undefined;
accessToken?: string | undefined;
} & { [K_1 in Exclude<keyof I, keyof GetParticipantAccessTokenRes>]: never; }>(object: I): GetParticipantAccessTokenRes;
};
export declare const CustomData: {
encode(message: CustomData, writer?: _m0.Writer): _m0.Writer;
decode(input: _m0.Reader | Uint8Array, length?: number): CustomData;
fromJSON(object: any): CustomData;
toJSON(message: CustomData): unknown;
fromPartial<I extends {
data?: {
[x: string]: string | undefined;
} | undefined;
} & {
data?: ({
[x: string]: string | undefined;
} & {
[x: string]: string | undefined;
} & { [K in Exclude<keyof I["data"], string | number>]: never; }) | undefined;
} & { [K_1 in Exclude<keyof I, "data">]: never; }>(object: I): CustomData;
};
export declare const CustomData_DataEntry: {
encode(message: CustomData_DataEntry, writer?: _m0.Writer): _m0.Writer;
decode(input: _m0.Reader | Uint8Array, length?: number): CustomData_DataEntry;
fromJSON(object: any): CustomData_DataEntry;
toJSON(message: CustomData_DataEntry): unknown;
fromPartial<I extends {
key?: string | undefined;
value?: string | undefined;
} & {
key?: string | undefined;
value?: string | undefined;
} & { [K in Exclude<keyof I, keyof CustomData_DataEntry>]: never; }>(object: I): CustomData_DataEntry;
};
export interface ParticipantService {
AddParticipantToChannel(request: AddParticipantToChannelReq): Promise<AddParticipantToChannelRes>;
GetParticipantAccessToken(request: GetParticipantAccessTokenReq): Promise<GetParticipantAccessTokenRes>;
}
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
[K in keyof T]?: DeepPartial<T[K]>;
} : Partial<T>;
type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
[K in keyof P]: Exact<P[K], I[K]>;
} & {
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
};
export {};