@lemoncloud/chatic-sockets-lib 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,6 +5,7 @@
5
5
  */
6
6
  export declare type DeviceStatus = '' | 'green' | 'red' | 'yellow';
7
7
  export declare type DevicePlatform = '' | 'ios' | 'android' | 'web' | 'macos' | 'windows' | 'linux';
8
+ export declare type ViewingType = '' | 'channel';
8
9
  /**
9
10
  * common device shape shared across websocket client/server contracts.
10
11
  */
@@ -20,7 +21,8 @@ export interface DeviceView {
20
21
  connectedAt?: number;
21
22
  disconnectedAt?: number;
22
23
  connId?: string;
23
- currChannelId?: string;
24
+ viewingType?: ViewingType;
25
+ viewingId?: string;
24
26
  viewingSince?: number;
25
27
  }
26
28
  /**
@@ -1,5 +1,5 @@
1
1
  import type { InferSocketError, InferSocketRequest, InferSocketResponse, SocketErrorMessage, SocketRequestMessage, SocketResponseMessage } from '../types';
2
- import type { DeviceBody, DeviceSeed, DeviceView } from './contracts';
2
+ import type { DeviceBody, DeviceSeed, DeviceView, ViewingType } from './contracts';
3
3
  /**
4
4
  * request payload for `device.read`
5
5
  * - omit `id` to read the device linked to the current connection.
@@ -10,6 +10,8 @@ export interface DeviceGetRequestData {
10
10
  export interface DeviceSyncRequestData {
11
11
  id?: string;
12
12
  tick?: number;
13
+ viewingType?: ViewingType;
14
+ viewingId?: string;
13
15
  }
14
16
  declare module '../types' {
15
17
  interface SocketPacketRegistry {
@@ -10,7 +10,7 @@
10
10
  * Copyright (C) 2022 LemonCloud Co Ltd. - All Rights Reserved.
11
11
  */
12
12
  import { CoreModel } from 'lemon-model';
13
- import $LUT, { DevicePlatform, DeviceStatus } from './types';
13
+ import $LUT, { DevicePlatform, DeviceStatus, ViewingType } from './types';
14
14
  import type { ChannelHead } from '../chat/model';
15
15
  /**
16
16
  * type: `ModelType`
@@ -156,9 +156,11 @@ export interface DeviceModel extends Model, DeviceHead {
156
156
  posX?: number;
157
157
  /** y position (for sync) */
158
158
  posY?: number;
159
- /** (후속 channel 선택용) 현재 보고 있는 채널 id */
160
- currChannelId?: string;
161
- /** (후속 channel 선택용) 현재 채널 진입 시각(ms) */
159
+ /** 현재 보고 있는 대상 종류 (예: 'channel') */
160
+ viewingType?: ViewingType;
161
+ /** 현재 보고 있는 대상 id */
162
+ viewingId?: string;
163
+ /** 현재 대상 진입 시각(ms) */
162
164
  viewingSince?: number;
163
165
  /** last activity timestamp */
164
166
  lastActiveAt?: number;
@@ -53,6 +53,14 @@ declare const $LUT: {
53
53
  /** status - status change */
54
54
  status: string;
55
55
  };
56
+ /**
57
+ * ViewingType — 현재 보고 있는 대상 종류
58
+ */
59
+ ViewingType: {
60
+ '': string;
61
+ /** channel */
62
+ channel: string;
63
+ };
56
64
  /**
57
65
  * DevicePlatform
58
66
  */
@@ -80,6 +88,10 @@ export declare type DeviceStatus = keyof typeof $LUT.DeviceStatus;
80
88
  * type: `DeviceEventType`
81
89
  */
82
90
  export declare type DeviceEventType = keyof typeof $LUT.DeviceEventType;
91
+ /**
92
+ * type: `ViewingType`
93
+ */
94
+ export declare type ViewingType = keyof typeof $LUT.ViewingType;
83
95
  /**
84
96
  * type: `DevicePlatform`
85
97
  */
@@ -55,6 +55,14 @@ const $LUT = {
55
55
  /** status - status change */
56
56
  status: 'status',
57
57
  },
58
+ /**
59
+ * ViewingType — 현재 보고 있는 대상 종류
60
+ */
61
+ ViewingType: {
62
+ '': '',
63
+ /** channel */
64
+ channel: 'channel',
65
+ },
58
66
  /**
59
67
  * DevicePlatform
60
68
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lemoncloud/chatic-sockets-lib",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Client websocket transport and sync runtime for chatic sockets v2",
5
5
  "main": "dist/client-socket-v2/index.js",
6
6
  "types": "dist/client-socket-v2/index.d.ts",