Skip to content

Commit

Permalink
feat: share deviceType with local peers (#461)
Browse files Browse the repository at this point in the history
* feat: share deviceType with local peers

fixes #451 and #452. Does not store deviceType in project deviceInfo
records, which will be done in a follow up PR (see #455) which also
requires changes to @mapeo/schema. `deviceType` is optional, and must be
set in the constructor of MapeoManager. Ideally this should not be
possible to change, but not sure how to enforce that.

* Incorporate review comments

* fix bug in teardown
  • Loading branch information
gmaclennan authored Feb 8, 2024
1 parent c5a7fd3 commit 4a2cb3c
Show file tree
Hide file tree
Showing 11 changed files with 508 additions and 324 deletions.
6 changes: 6 additions & 0 deletions proto/rpc.proto
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,11 @@ message InviteResponse {
}

message DeviceInfo {
enum DeviceType {
mobile = 0;
tablet = 1;
desktop = 2;
}
string name = 1;
optional DeviceType deviceType = 2;
}
18 changes: 16 additions & 2 deletions src/generated/rpc.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,17 @@ export declare function inviteResponse_DecisionFromJSON(object: any): InviteResp
export declare function inviteResponse_DecisionToNumber(object: InviteResponse_Decision): number;
export interface DeviceInfo {
name: string;
deviceType?: DeviceInfo_DeviceType | undefined;
}
export declare const DeviceInfo_DeviceType: {
readonly mobile: "mobile";
readonly tablet: "tablet";
readonly desktop: "desktop";
readonly UNRECOGNIZED: "UNRECOGNIZED";
};
export type DeviceInfo_DeviceType = typeof DeviceInfo_DeviceType[keyof typeof DeviceInfo_DeviceType];
export declare function deviceInfo_DeviceTypeFromJSON(object: any): DeviceInfo_DeviceType;
export declare function deviceInfo_DeviceTypeToNumber(object: DeviceInfo_DeviceType): number;
export declare const Invite: {
encode(message: Invite, writer?: _m0.Writer): _m0.Writer;
decode(input: _m0.Reader | Uint8Array, length?: number): Invite;
Expand Down Expand Up @@ -148,12 +158,16 @@ export declare const DeviceInfo: {
decode(input: _m0.Reader | Uint8Array, length?: number): DeviceInfo;
create<I extends {
name?: string;
deviceType?: DeviceInfo_DeviceType | undefined;
} & {
name?: string;
} & { [K in Exclude<keyof I, "name">]: never; }>(base?: I): DeviceInfo;
deviceType?: DeviceInfo_DeviceType | undefined;
} & { [K in Exclude<keyof I, keyof DeviceInfo>]: never; }>(base?: I): DeviceInfo;
fromPartial<I_1 extends {
name?: string;
deviceType?: DeviceInfo_DeviceType | undefined;
} & {
name?: string;
} & { [K_1 in Exclude<keyof I_1, "name">]: never; }>(object: I_1): DeviceInfo;
deviceType?: DeviceInfo_DeviceType | undefined;
} & { [K_1 in Exclude<keyof I_1, keyof DeviceInfo>]: never; }>(object: I_1): DeviceInfo;
};
Loading

0 comments on commit 4a2cb3c

Please sign in to comment.