@lemoncloud/chatic-sockets-lib 0.2.0 → 0.3.0
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.
- package/dist/client-socket-v2/create-client-socket-v2.js +5 -0
- package/dist/client-socket-v2/gateways/auth-gateway.d.ts +6 -0
- package/dist/client-socket-v2/gateways/auth-gateway.js +11 -0
- package/dist/client-socket-v2/gateways/channel-gateway.d.ts +38 -0
- package/dist/client-socket-v2/gateways/channel-gateway.js +24 -0
- package/dist/client-socket-v2/gateways/chat-gateway.d.ts +22 -0
- package/dist/client-socket-v2/gateways/chat-gateway.js +16 -0
- package/dist/client-socket-v2/gateways/cloud-gateway.d.ts +18 -0
- package/dist/client-socket-v2/gateways/cloud-gateway.js +14 -0
- package/dist/client-socket-v2/gateways/place-gateway.d.ts +18 -0
- package/dist/client-socket-v2/gateways/place-gateway.js +14 -0
- package/dist/client-socket-v2/gateways/profile-gateway.d.ts +18 -0
- package/dist/client-socket-v2/gateways/profile-gateway.js +14 -0
- package/dist/client-socket-v2/gateways/user-gateway.d.ts +38 -0
- package/dist/client-socket-v2/gateways/user-gateway.js +18 -0
- package/dist/client-socket-v2/index.d.ts +13 -0
- package/dist/client-socket-v2/index.js +12 -0
- package/dist/client-socket-v2/plans/channel-sync-plan.d.ts +33 -0
- package/dist/client-socket-v2/plans/channel-sync-plan.js +66 -0
- package/dist/client-socket-v2/plans/device-sync-plan.d.ts +5 -1
- package/dist/client-socket-v2/plans/device-sync-plan.js +6 -3
- package/dist/client-socket-v2/plans/place-sync-plan.d.ts +33 -0
- package/dist/client-socket-v2/plans/place-sync-plan.js +67 -0
- package/dist/client-socket-v2/plans/profile-sync-plan.d.ts +33 -0
- package/dist/client-socket-v2/plans/profile-sync-plan.js +67 -0
- package/dist/client-socket-v2/socket-runtime.d.ts +5 -1
- package/dist/client-socket-v2/socket-runtime.js +5 -1
- package/dist/client-socket-v2/socket-transport.d.ts +14 -4
- package/dist/client-socket-v2/socket-transport.js +58 -60
- package/dist/client-socket-v2/sync-scheduler.d.ts +15 -1
- package/dist/client-socket-v2/sync-scheduler.js +89 -12
- package/dist/client-socket-v2/types.d.ts +38 -7
- package/dist/lib/channel/types.d.ts +191 -0
- package/dist/lib/channel/types.js +2 -0
- package/dist/lib/chat/types.d.ts +79 -0
- package/dist/lib/chat/types.js +2 -0
- package/dist/lib/cloud/types.d.ts +54 -0
- package/dist/lib/cloud/types.js +2 -0
- package/dist/lib/device/contracts.d.ts +2 -0
- package/dist/lib/device/types.d.ts +1 -0
- package/dist/lib/place/types.d.ts +53 -0
- package/dist/lib/place/types.js +2 -0
- package/dist/lib/profile/types.d.ts +55 -0
- package/dist/lib/profile/types.js +2 -0
- package/dist/lib/socket-actions.d.ts +291 -0
- package/dist/lib/socket-actions.js +209 -0
- package/dist/lib/socket-inputs.d.ts +15 -0
- package/dist/lib/socket-inputs.js +8 -0
- package/dist/lib/sockets/types.d.ts +27 -0
- package/dist/lib/sockets/types.js +17 -0
- package/dist/lib/types.d.ts +2 -0
- package/dist/lib/user/types.d.ts +102 -0
- package/dist/lib/user/types.js +2 -0
- package/dist/modules/chat/model.d.ts +107 -0
- package/dist/modules/chat/model.js +28 -0
- package/dist/modules/chat/types.d.ts +65 -0
- package/dist/modules/chat/types.js +55 -0
- package/dist/modules/chat/views.d.ts +50 -0
- package/dist/modules/chat/views.js +23 -0
- package/dist/modules/sockets/model.d.ts +204 -0
- package/dist/modules/sockets/model.js +28 -0
- package/dist/modules/sockets/types.d.ts +88 -0
- package/dist/modules/sockets/types.js +78 -0
- package/dist/modules/sockets/views.d.ts +67 -0
- package/dist/modules/sockets/views.js +23 -0
- package/package.json +4 -2
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `socket-actions.ts`
|
|
3
|
+
* - supported wsv2 socket domain/action lookup table.
|
|
4
|
+
*
|
|
5
|
+
* Keep this file client-safe. It is used as a public type contract and must not
|
|
6
|
+
* import server-side modules.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* lookup table
|
|
10
|
+
* - wsv2에서 공개/지원하는 socket action 목록
|
|
11
|
+
*/
|
|
12
|
+
export declare const SocketActionTypeLUT: {
|
|
13
|
+
/**
|
|
14
|
+
* DomainType
|
|
15
|
+
* - message domain
|
|
16
|
+
*/
|
|
17
|
+
readonly DomainType: {
|
|
18
|
+
readonly '': "";
|
|
19
|
+
/** system - builtin/system messages */
|
|
20
|
+
readonly system: "system";
|
|
21
|
+
/** sockets - socket connection helpers */
|
|
22
|
+
readonly sockets: "sockets";
|
|
23
|
+
/** device - client device state */
|
|
24
|
+
readonly device: "device";
|
|
25
|
+
/** auth - connection authentication */
|
|
26
|
+
readonly auth: "auth";
|
|
27
|
+
/** channel - chat channel operations */
|
|
28
|
+
readonly channel: "channel";
|
|
29
|
+
/** chat - chat message operations */
|
|
30
|
+
readonly chat: "chat";
|
|
31
|
+
/** user - user/site profile operations */
|
|
32
|
+
readonly user: "user";
|
|
33
|
+
/** place - place(site) CRUD operations */
|
|
34
|
+
readonly place: "place";
|
|
35
|
+
/** profile - site profile operations */
|
|
36
|
+
readonly profile: "profile";
|
|
37
|
+
/** cloud - cloud profile operations */
|
|
38
|
+
readonly cloud: "cloud";
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* SystemActionType
|
|
42
|
+
* - system 도메인 액션
|
|
43
|
+
*/
|
|
44
|
+
readonly SystemActionType: {
|
|
45
|
+
readonly '': "";
|
|
46
|
+
/** ping - keep-alive request */
|
|
47
|
+
readonly ping: "ping";
|
|
48
|
+
/** pong - keep-alive response/event */
|
|
49
|
+
readonly pong: "pong";
|
|
50
|
+
/** info - connection/server information */
|
|
51
|
+
readonly info: "info";
|
|
52
|
+
/** message - generic system message */
|
|
53
|
+
readonly message: "message";
|
|
54
|
+
/** error - generic system error */
|
|
55
|
+
readonly error: "error";
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* SocketsActionType
|
|
59
|
+
* - sockets 도메인 액션
|
|
60
|
+
*/
|
|
61
|
+
readonly SocketsActionType: {
|
|
62
|
+
readonly '': "";
|
|
63
|
+
/** find-connection - find or create current connection model */
|
|
64
|
+
readonly 'find-connection': "find-connection";
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* DeviceActionType
|
|
68
|
+
* - device 도메인 액션
|
|
69
|
+
*/
|
|
70
|
+
readonly DeviceActionType: {
|
|
71
|
+
readonly '': "";
|
|
72
|
+
/** save - create or update linked device */
|
|
73
|
+
readonly save: "save";
|
|
74
|
+
/** read - read linked or requested device */
|
|
75
|
+
readonly read: "read";
|
|
76
|
+
/** sync - client device state sync hint */
|
|
77
|
+
readonly sync: "sync";
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* AuthActionType
|
|
81
|
+
* - auth 도메인 액션
|
|
82
|
+
*/
|
|
83
|
+
readonly AuthActionType: {
|
|
84
|
+
readonly '': "";
|
|
85
|
+
/** update - update authentication state for current connection */
|
|
86
|
+
readonly update: "update";
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* ChannelActionType
|
|
90
|
+
* - channel 도메인 액션
|
|
91
|
+
*/
|
|
92
|
+
readonly ChannelActionType: {
|
|
93
|
+
readonly '': "";
|
|
94
|
+
/** create - create a channel */
|
|
95
|
+
readonly create: "create";
|
|
96
|
+
/** join - join a channel */
|
|
97
|
+
readonly join: "join";
|
|
98
|
+
/** leave - leave or kick from a channel */
|
|
99
|
+
readonly leave: "leave";
|
|
100
|
+
/** get-self - get or create personal channel */
|
|
101
|
+
readonly 'get-self': "get-self";
|
|
102
|
+
/** mine - list my channels */
|
|
103
|
+
readonly mine: "mine";
|
|
104
|
+
/** list-user - list channel members */
|
|
105
|
+
readonly 'list-user': "list-user";
|
|
106
|
+
/** invite - invite users to a channel */
|
|
107
|
+
readonly invite: "invite";
|
|
108
|
+
/** update - update channel information */
|
|
109
|
+
readonly update: "update";
|
|
110
|
+
/** update-join - update channel participation settings */
|
|
111
|
+
readonly 'update-join': "update-join";
|
|
112
|
+
/** delete - delete a channel */
|
|
113
|
+
readonly delete: "delete";
|
|
114
|
+
/** sync - synchronize channel list/state */
|
|
115
|
+
readonly sync: "sync";
|
|
116
|
+
/** read - pull authoritative single-channel item */
|
|
117
|
+
readonly read: "read";
|
|
118
|
+
/** sync-users - synchronize channel users */
|
|
119
|
+
readonly 'sync-users': "sync-users";
|
|
120
|
+
/** @deprecated use `profile.sync`. synchronize related site profile (하위호환) */
|
|
121
|
+
readonly 'sync-site-profile': "sync-site-profile";
|
|
122
|
+
/** unreads - get unread message summary */
|
|
123
|
+
readonly unreads: "unreads";
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* ChatActionType
|
|
127
|
+
* - chat 도메인 액션
|
|
128
|
+
*/
|
|
129
|
+
readonly ChatActionType: {
|
|
130
|
+
readonly '': "";
|
|
131
|
+
/** send - send chat message */
|
|
132
|
+
readonly send: "send";
|
|
133
|
+
/** read - mark chat message/channel as read */
|
|
134
|
+
readonly read: "read";
|
|
135
|
+
/** feed - get chat feed */
|
|
136
|
+
readonly feed: "feed";
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* UserActionType
|
|
140
|
+
* - user 도메인 액션
|
|
141
|
+
*/
|
|
142
|
+
readonly UserActionType: {
|
|
143
|
+
readonly '': "";
|
|
144
|
+
/** invite - invite a user */
|
|
145
|
+
readonly invite: "invite";
|
|
146
|
+
/** invite-batch - invite multiple users */
|
|
147
|
+
readonly 'invite-batch': "invite-batch";
|
|
148
|
+
/** my-site - list accessible sites */
|
|
149
|
+
readonly 'my-site': "my-site";
|
|
150
|
+
/** make-site - create a site */
|
|
151
|
+
readonly 'make-site': "make-site";
|
|
152
|
+
/** update-profile - update user profile */
|
|
153
|
+
readonly 'update-profile': "update-profile";
|
|
154
|
+
/** update-site - update site profile */
|
|
155
|
+
readonly 'update-site': "update-site";
|
|
156
|
+
/** get-site-profile - get site profile */
|
|
157
|
+
readonly 'get-site-profile': "get-site-profile";
|
|
158
|
+
/** set-site-profile - set site profile */
|
|
159
|
+
readonly 'set-site-profile': "set-site-profile";
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* PlaceActionType
|
|
163
|
+
* - place(site) 도메인 액션
|
|
164
|
+
*/
|
|
165
|
+
readonly PlaceActionType: {
|
|
166
|
+
readonly '': "";
|
|
167
|
+
/** create - create a place(site) */
|
|
168
|
+
readonly create: "create";
|
|
169
|
+
/** get - get a place(site) */
|
|
170
|
+
readonly get: "get";
|
|
171
|
+
/** update - update a place(site) */
|
|
172
|
+
readonly update: "update";
|
|
173
|
+
/** delete - delete a place(site) */
|
|
174
|
+
readonly delete: "delete";
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* ProfileActionType
|
|
178
|
+
* - profile(site-profile) 도메인 액션
|
|
179
|
+
*/
|
|
180
|
+
readonly ProfileActionType: {
|
|
181
|
+
readonly '': "";
|
|
182
|
+
/** get - get site profile by id */
|
|
183
|
+
readonly get: "get";
|
|
184
|
+
/** get-mine - get current session's site profile */
|
|
185
|
+
readonly 'get-mine': "get-mine";
|
|
186
|
+
/** set - set site profile */
|
|
187
|
+
readonly set: "set";
|
|
188
|
+
/** sync - synchronize site multi-profiles (delta since cursor) */
|
|
189
|
+
readonly sync: "sync";
|
|
190
|
+
};
|
|
191
|
+
/**
|
|
192
|
+
* CloudActionType
|
|
193
|
+
* - cloud 도메인 액션
|
|
194
|
+
*/
|
|
195
|
+
readonly CloudActionType: {
|
|
196
|
+
readonly '': "";
|
|
197
|
+
/** create - create a cloud (미구현/500) */
|
|
198
|
+
readonly create: "create";
|
|
199
|
+
/** get - get a cloud */
|
|
200
|
+
readonly get: "get";
|
|
201
|
+
/** update - update a cloud */
|
|
202
|
+
readonly update: "update";
|
|
203
|
+
/** delete - delete a cloud */
|
|
204
|
+
readonly delete: "delete";
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
declare type SocketActionKeyOf<T> = Extract<keyof T, string>;
|
|
208
|
+
declare type NonEmptySocketAction<T extends string> = Exclude<T, ''>;
|
|
209
|
+
/**
|
|
210
|
+
* type: `SocketDomainType`
|
|
211
|
+
*/
|
|
212
|
+
export declare type SocketDomainType = SocketActionKeyOf<typeof SocketActionTypeLUT.DomainType>;
|
|
213
|
+
/**
|
|
214
|
+
* type: `SocketSystemActionType`
|
|
215
|
+
*/
|
|
216
|
+
export declare type SocketSystemActionType = SocketActionKeyOf<typeof SocketActionTypeLUT.SystemActionType>;
|
|
217
|
+
/**
|
|
218
|
+
* type: `SocketSocketsActionType`
|
|
219
|
+
*/
|
|
220
|
+
export declare type SocketSocketsActionType = SocketActionKeyOf<typeof SocketActionTypeLUT.SocketsActionType>;
|
|
221
|
+
/**
|
|
222
|
+
* type: `SocketDeviceActionType`
|
|
223
|
+
*/
|
|
224
|
+
export declare type SocketDeviceActionType = SocketActionKeyOf<typeof SocketActionTypeLUT.DeviceActionType>;
|
|
225
|
+
/**
|
|
226
|
+
* type: `SocketAuthActionType`
|
|
227
|
+
*/
|
|
228
|
+
export declare type SocketAuthActionType = SocketActionKeyOf<typeof SocketActionTypeLUT.AuthActionType>;
|
|
229
|
+
/**
|
|
230
|
+
* type: `SocketChannelActionType`
|
|
231
|
+
*/
|
|
232
|
+
export declare type SocketChannelActionType = SocketActionKeyOf<typeof SocketActionTypeLUT.ChannelActionType>;
|
|
233
|
+
/**
|
|
234
|
+
* type: `SocketChatActionType`
|
|
235
|
+
*/
|
|
236
|
+
export declare type SocketChatActionType = SocketActionKeyOf<typeof SocketActionTypeLUT.ChatActionType>;
|
|
237
|
+
/**
|
|
238
|
+
* type: `SocketUserActionType`
|
|
239
|
+
*/
|
|
240
|
+
export declare type SocketUserActionType = SocketActionKeyOf<typeof SocketActionTypeLUT.UserActionType>;
|
|
241
|
+
/**
|
|
242
|
+
* type: `SocketPlaceActionType`
|
|
243
|
+
*/
|
|
244
|
+
export declare type SocketPlaceActionType = SocketActionKeyOf<typeof SocketActionTypeLUT.PlaceActionType>;
|
|
245
|
+
/**
|
|
246
|
+
* type: `SocketProfileActionType`
|
|
247
|
+
*/
|
|
248
|
+
export declare type SocketProfileActionType = SocketActionKeyOf<typeof SocketActionTypeLUT.ProfileActionType>;
|
|
249
|
+
/**
|
|
250
|
+
* type: `SocketCloudActionType`
|
|
251
|
+
*/
|
|
252
|
+
export declare type SocketCloudActionType = SocketActionKeyOf<typeof SocketActionTypeLUT.CloudActionType>;
|
|
253
|
+
/**
|
|
254
|
+
* type: `SocketActionType`
|
|
255
|
+
*/
|
|
256
|
+
export declare type SocketActionType = SocketSystemActionType | SocketSocketsActionType | SocketDeviceActionType | SocketAuthActionType | SocketChannelActionType | SocketChatActionType | SocketUserActionType | SocketPlaceActionType | SocketProfileActionType | SocketCloudActionType;
|
|
257
|
+
/**
|
|
258
|
+
* interface: `SocketActionTypeMap`
|
|
259
|
+
* - domain to action type map
|
|
260
|
+
*/
|
|
261
|
+
export interface SocketActionTypeMap {
|
|
262
|
+
system: SocketSystemActionType;
|
|
263
|
+
sockets: SocketSocketsActionType;
|
|
264
|
+
device: SocketDeviceActionType;
|
|
265
|
+
auth: SocketAuthActionType;
|
|
266
|
+
channel: SocketChannelActionType;
|
|
267
|
+
chat: SocketChatActionType;
|
|
268
|
+
user: SocketUserActionType;
|
|
269
|
+
place: SocketPlaceActionType;
|
|
270
|
+
profile: SocketProfileActionType;
|
|
271
|
+
cloud: SocketCloudActionType;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* type: `SocketSupportedDomainType`
|
|
275
|
+
*/
|
|
276
|
+
export declare type SocketSupportedDomainType = keyof SocketActionTypeMap;
|
|
277
|
+
/**
|
|
278
|
+
* type: `SocketSupportedActionType`
|
|
279
|
+
*/
|
|
280
|
+
export declare type SocketSupportedActionType = NonEmptySocketAction<SocketActionType>;
|
|
281
|
+
/**
|
|
282
|
+
* type: `SocketActionTypeOf`
|
|
283
|
+
*/
|
|
284
|
+
export declare type SocketActionTypeOf<TDomain extends SocketSupportedDomainType> = SocketActionTypeMap[TDomain];
|
|
285
|
+
/**
|
|
286
|
+
* type: `SocketPacketActionType`
|
|
287
|
+
*/
|
|
288
|
+
export declare type SocketPacketActionType = {
|
|
289
|
+
[TDomain in SocketSupportedDomainType]: `${TDomain}.${NonEmptySocketAction<SocketActionTypeMap[TDomain]>}`;
|
|
290
|
+
}[SocketSupportedDomainType];
|
|
291
|
+
export {};
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* `socket-actions.ts`
|
|
4
|
+
* - supported wsv2 socket domain/action lookup table.
|
|
5
|
+
*
|
|
6
|
+
* Keep this file client-safe. It is used as a public type contract and must not
|
|
7
|
+
* import server-side modules.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.SocketActionTypeLUT = void 0;
|
|
11
|
+
/**
|
|
12
|
+
* lookup table
|
|
13
|
+
* - wsv2에서 공개/지원하는 socket action 목록
|
|
14
|
+
*/
|
|
15
|
+
exports.SocketActionTypeLUT = {
|
|
16
|
+
/**
|
|
17
|
+
* DomainType
|
|
18
|
+
* - message domain
|
|
19
|
+
*/
|
|
20
|
+
DomainType: {
|
|
21
|
+
'': '',
|
|
22
|
+
/** system - builtin/system messages */
|
|
23
|
+
system: 'system',
|
|
24
|
+
/** sockets - socket connection helpers */
|
|
25
|
+
sockets: 'sockets',
|
|
26
|
+
/** device - client device state */
|
|
27
|
+
device: 'device',
|
|
28
|
+
/** auth - connection authentication */
|
|
29
|
+
auth: 'auth',
|
|
30
|
+
/** channel - chat channel operations */
|
|
31
|
+
channel: 'channel',
|
|
32
|
+
/** chat - chat message operations */
|
|
33
|
+
chat: 'chat',
|
|
34
|
+
/** user - user/site profile operations */
|
|
35
|
+
user: 'user',
|
|
36
|
+
/** place - place(site) CRUD operations */
|
|
37
|
+
place: 'place',
|
|
38
|
+
/** profile - site profile operations */
|
|
39
|
+
profile: 'profile',
|
|
40
|
+
/** cloud - cloud profile operations */
|
|
41
|
+
cloud: 'cloud',
|
|
42
|
+
},
|
|
43
|
+
/**
|
|
44
|
+
* SystemActionType
|
|
45
|
+
* - system 도메인 액션
|
|
46
|
+
*/
|
|
47
|
+
SystemActionType: {
|
|
48
|
+
'': '',
|
|
49
|
+
/** ping - keep-alive request */
|
|
50
|
+
ping: 'ping',
|
|
51
|
+
/** pong - keep-alive response/event */
|
|
52
|
+
pong: 'pong',
|
|
53
|
+
/** info - connection/server information */
|
|
54
|
+
info: 'info',
|
|
55
|
+
/** message - generic system message */
|
|
56
|
+
message: 'message',
|
|
57
|
+
/** error - generic system error */
|
|
58
|
+
error: 'error',
|
|
59
|
+
},
|
|
60
|
+
/**
|
|
61
|
+
* SocketsActionType
|
|
62
|
+
* - sockets 도메인 액션
|
|
63
|
+
*/
|
|
64
|
+
SocketsActionType: {
|
|
65
|
+
'': '',
|
|
66
|
+
/** find-connection - find or create current connection model */
|
|
67
|
+
'find-connection': 'find-connection',
|
|
68
|
+
},
|
|
69
|
+
/**
|
|
70
|
+
* DeviceActionType
|
|
71
|
+
* - device 도메인 액션
|
|
72
|
+
*/
|
|
73
|
+
DeviceActionType: {
|
|
74
|
+
'': '',
|
|
75
|
+
/** save - create or update linked device */
|
|
76
|
+
save: 'save',
|
|
77
|
+
/** read - read linked or requested device */
|
|
78
|
+
read: 'read',
|
|
79
|
+
/** sync - client device state sync hint */
|
|
80
|
+
sync: 'sync',
|
|
81
|
+
},
|
|
82
|
+
/**
|
|
83
|
+
* AuthActionType
|
|
84
|
+
* - auth 도메인 액션
|
|
85
|
+
*/
|
|
86
|
+
AuthActionType: {
|
|
87
|
+
'': '',
|
|
88
|
+
/** update - update authentication state for current connection */
|
|
89
|
+
update: 'update',
|
|
90
|
+
},
|
|
91
|
+
/**
|
|
92
|
+
* ChannelActionType
|
|
93
|
+
* - channel 도메인 액션
|
|
94
|
+
*/
|
|
95
|
+
ChannelActionType: {
|
|
96
|
+
'': '',
|
|
97
|
+
/** create - create a channel */
|
|
98
|
+
create: 'create',
|
|
99
|
+
/** join - join a channel */
|
|
100
|
+
join: 'join',
|
|
101
|
+
/** leave - leave or kick from a channel */
|
|
102
|
+
leave: 'leave',
|
|
103
|
+
/** get-self - get or create personal channel */
|
|
104
|
+
'get-self': 'get-self',
|
|
105
|
+
/** mine - list my channels */
|
|
106
|
+
mine: 'mine',
|
|
107
|
+
/** list-user - list channel members */
|
|
108
|
+
'list-user': 'list-user',
|
|
109
|
+
/** invite - invite users to a channel */
|
|
110
|
+
invite: 'invite',
|
|
111
|
+
/** update - update channel information */
|
|
112
|
+
update: 'update',
|
|
113
|
+
/** update-join - update channel participation settings */
|
|
114
|
+
'update-join': 'update-join',
|
|
115
|
+
/** delete - delete a channel */
|
|
116
|
+
delete: 'delete',
|
|
117
|
+
/** sync - synchronize channel list/state */
|
|
118
|
+
sync: 'sync',
|
|
119
|
+
/** read - pull authoritative single-channel item */
|
|
120
|
+
read: 'read',
|
|
121
|
+
/** sync-users - synchronize channel users */
|
|
122
|
+
'sync-users': 'sync-users',
|
|
123
|
+
/** @deprecated use `profile.sync`. synchronize related site profile (하위호환) */
|
|
124
|
+
'sync-site-profile': 'sync-site-profile',
|
|
125
|
+
/** unreads - get unread message summary */
|
|
126
|
+
unreads: 'unreads',
|
|
127
|
+
},
|
|
128
|
+
/**
|
|
129
|
+
* ChatActionType
|
|
130
|
+
* - chat 도메인 액션
|
|
131
|
+
*/
|
|
132
|
+
ChatActionType: {
|
|
133
|
+
'': '',
|
|
134
|
+
/** send - send chat message */
|
|
135
|
+
send: 'send',
|
|
136
|
+
/** read - mark chat message/channel as read */
|
|
137
|
+
read: 'read',
|
|
138
|
+
/** feed - get chat feed */
|
|
139
|
+
feed: 'feed',
|
|
140
|
+
},
|
|
141
|
+
/**
|
|
142
|
+
* UserActionType
|
|
143
|
+
* - user 도메인 액션
|
|
144
|
+
*/
|
|
145
|
+
UserActionType: {
|
|
146
|
+
'': '',
|
|
147
|
+
/** invite - invite a user */
|
|
148
|
+
invite: 'invite',
|
|
149
|
+
/** invite-batch - invite multiple users */
|
|
150
|
+
'invite-batch': 'invite-batch',
|
|
151
|
+
/** my-site - list accessible sites */
|
|
152
|
+
'my-site': 'my-site',
|
|
153
|
+
/** make-site - create a site */
|
|
154
|
+
'make-site': 'make-site',
|
|
155
|
+
/** update-profile - update user profile */
|
|
156
|
+
'update-profile': 'update-profile',
|
|
157
|
+
/** update-site - update site profile */
|
|
158
|
+
'update-site': 'update-site',
|
|
159
|
+
/** get-site-profile - get site profile */
|
|
160
|
+
'get-site-profile': 'get-site-profile',
|
|
161
|
+
/** set-site-profile - set site profile */
|
|
162
|
+
'set-site-profile': 'set-site-profile',
|
|
163
|
+
},
|
|
164
|
+
/**
|
|
165
|
+
* PlaceActionType
|
|
166
|
+
* - place(site) 도메인 액션
|
|
167
|
+
*/
|
|
168
|
+
PlaceActionType: {
|
|
169
|
+
'': '',
|
|
170
|
+
/** create - create a place(site) */
|
|
171
|
+
create: 'create',
|
|
172
|
+
/** get - get a place(site) */
|
|
173
|
+
get: 'get',
|
|
174
|
+
/** update - update a place(site) */
|
|
175
|
+
update: 'update',
|
|
176
|
+
/** delete - delete a place(site) */
|
|
177
|
+
delete: 'delete',
|
|
178
|
+
},
|
|
179
|
+
/**
|
|
180
|
+
* ProfileActionType
|
|
181
|
+
* - profile(site-profile) 도메인 액션
|
|
182
|
+
*/
|
|
183
|
+
ProfileActionType: {
|
|
184
|
+
'': '',
|
|
185
|
+
/** get - get site profile by id */
|
|
186
|
+
get: 'get',
|
|
187
|
+
/** get-mine - get current session's site profile */
|
|
188
|
+
'get-mine': 'get-mine',
|
|
189
|
+
/** set - set site profile */
|
|
190
|
+
set: 'set',
|
|
191
|
+
/** sync - synchronize site multi-profiles (delta since cursor) */
|
|
192
|
+
sync: 'sync',
|
|
193
|
+
},
|
|
194
|
+
/**
|
|
195
|
+
* CloudActionType
|
|
196
|
+
* - cloud 도메인 액션
|
|
197
|
+
*/
|
|
198
|
+
CloudActionType: {
|
|
199
|
+
'': '',
|
|
200
|
+
/** create - create a cloud (미구현/500) */
|
|
201
|
+
create: 'create',
|
|
202
|
+
/** get - get a cloud */
|
|
203
|
+
get: 'get',
|
|
204
|
+
/** update - update a cloud */
|
|
205
|
+
update: 'update',
|
|
206
|
+
/** delete - delete a cloud */
|
|
207
|
+
delete: 'delete',
|
|
208
|
+
},
|
|
209
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `socket-inputs.ts`
|
|
3
|
+
* - public socket message.data input type barrel.
|
|
4
|
+
*
|
|
5
|
+
* Keep this file type-only and client-safe.
|
|
6
|
+
*/
|
|
7
|
+
export type { AuthUpdateInput } from './auth/types';
|
|
8
|
+
export type { DeviceGetInput, DeviceReadInput, DeviceSaveInput, DeviceSyncInput } from './device/types';
|
|
9
|
+
export type { FindConnectionModelInput, SocketsFindConnectionInput } from './sockets/types';
|
|
10
|
+
export type { ChatFeedInput, ChatReadInput, ChatSendInput } from './chat/types';
|
|
11
|
+
export type { ChannelCreateInput, ChannelDeleteInput, ChannelGetSelfInput, ChannelInviteInput, ChannelJoinInput, ChannelLeaveInput, ChannelListMyInput, ChannelListUserInput, ChannelMineInput, ChannelSyncInput, ChannelSyncProfileInput, ChannelSyncSiteProfileInput, ChannelSyncUsersInput, ChannelUnreadsInput, ChannelUpdateInput, ChannelUpdateJoinInput, ChatDeleteChannelInput, ChatInviteInput, ChatLeaveInput, ChatMineInput, ChatStartInput, ChatUpdateChannelInput, ChatUpdateJoinInput, ChatUsersInput, JoinUpdateInput, } from './channel/types';
|
|
12
|
+
export type { PlaceCreateInput, PlaceDeleteInput, PlaceGetInput, PlaceUpdateInput } from './place/types';
|
|
13
|
+
export type { ProfileGetInput, ProfileGetMineInput, ProfileSetInput, ProfileSyncInput } from './profile/types';
|
|
14
|
+
export type { CloudCreateInput, CloudDeleteInput, CloudGetInput, CloudUpdateInput, UpdateCloudInput, } from './cloud/types';
|
|
15
|
+
export type { UserGetSiteProfileInput, UserInviteBatchInput, UserInviteInput, UserMakeSiteInput, UserMySiteInput, UserSetSiteProfileInput, UserUpdateProfileInput, UserUpdateSiteInput, } from './user/types';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export * from './packets';
|
|
2
|
+
export interface FindConnectionModelEvent {
|
|
3
|
+
id?: string;
|
|
4
|
+
stage?: string;
|
|
5
|
+
domain?: string;
|
|
6
|
+
apiId?: string;
|
|
7
|
+
connectionId?: string;
|
|
8
|
+
connectedAt?: number;
|
|
9
|
+
origin?: string;
|
|
10
|
+
remote?: string;
|
|
11
|
+
reason?: string;
|
|
12
|
+
agent?: string;
|
|
13
|
+
route?: string;
|
|
14
|
+
param?: {
|
|
15
|
+
[key: string]: string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface FindConnectionModelInput {
|
|
19
|
+
event: FindConnectionModelEvent;
|
|
20
|
+
}
|
|
21
|
+
export declare type SocketsFindConnectionInput = FindConnectionModelInput;
|
|
22
|
+
export interface FindConnectionModelOptions {
|
|
23
|
+
useSession?: boolean;
|
|
24
|
+
errScope?: string;
|
|
25
|
+
validate?: boolean;
|
|
26
|
+
current?: number;
|
|
27
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./packets"), exports);
|
package/dist/lib/types.d.ts
CHANGED
|
@@ -30,6 +30,8 @@ export interface SocketMessage<T = any, TType extends string = string> {
|
|
|
30
30
|
meta?: SocketMessageMeta;
|
|
31
31
|
/** optional error message */
|
|
32
32
|
error?: string;
|
|
33
|
+
/** optional error code (HTTP status base); omitted when unclassified */
|
|
34
|
+
errorCode?: number;
|
|
33
35
|
}
|
|
34
36
|
/**
|
|
35
37
|
* shared packet registry extension point.
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import type { InferSocketRequest, SocketRequestMessage } from '../types';
|
|
2
|
+
export interface UserMakeSiteRequestData {
|
|
3
|
+
name: string;
|
|
4
|
+
}
|
|
5
|
+
export interface UserInviteRequestData {
|
|
6
|
+
channelId?: string;
|
|
7
|
+
name: string;
|
|
8
|
+
phone: string;
|
|
9
|
+
}
|
|
10
|
+
export interface UserInviteBatchRequestData {
|
|
11
|
+
to: string[];
|
|
12
|
+
channelId?: string;
|
|
13
|
+
cloudId?: string;
|
|
14
|
+
cloudName?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface UserUpdateProfileRequestData {
|
|
17
|
+
name?: string;
|
|
18
|
+
nick?: string;
|
|
19
|
+
thumbnail?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface UserUpdateSiteRequestData {
|
|
22
|
+
sid?: string;
|
|
23
|
+
name?: string;
|
|
24
|
+
thumbnail?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface UserSetSiteProfileRequestData {
|
|
27
|
+
id?: string;
|
|
28
|
+
userId?: string;
|
|
29
|
+
siteId?: string;
|
|
30
|
+
nick?: string;
|
|
31
|
+
thumbnail?: string;
|
|
32
|
+
active?: boolean;
|
|
33
|
+
[key: string]: unknown;
|
|
34
|
+
}
|
|
35
|
+
declare module '../types' {
|
|
36
|
+
interface SocketPacketRegistry {
|
|
37
|
+
'user.get-site-profile': {
|
|
38
|
+
request: Record<string, never>;
|
|
39
|
+
response: unknown;
|
|
40
|
+
error: null;
|
|
41
|
+
};
|
|
42
|
+
'user.my-site': {
|
|
43
|
+
request: Record<string, never>;
|
|
44
|
+
response: unknown;
|
|
45
|
+
error: null;
|
|
46
|
+
};
|
|
47
|
+
'user.make-site': {
|
|
48
|
+
request: UserMakeSiteRequestData;
|
|
49
|
+
response: unknown;
|
|
50
|
+
error: null;
|
|
51
|
+
};
|
|
52
|
+
'user.invite': {
|
|
53
|
+
request: UserInviteRequestData;
|
|
54
|
+
response: unknown;
|
|
55
|
+
error: null;
|
|
56
|
+
};
|
|
57
|
+
'user.invite-batch': {
|
|
58
|
+
request: UserInviteBatchRequestData;
|
|
59
|
+
response: unknown;
|
|
60
|
+
error: null;
|
|
61
|
+
};
|
|
62
|
+
'user.update-profile': {
|
|
63
|
+
request: UserUpdateProfileRequestData;
|
|
64
|
+
response: unknown;
|
|
65
|
+
error: null;
|
|
66
|
+
};
|
|
67
|
+
'user.update-site': {
|
|
68
|
+
request: UserUpdateSiteRequestData;
|
|
69
|
+
response: unknown;
|
|
70
|
+
error: null;
|
|
71
|
+
};
|
|
72
|
+
'user.set-site-profile': {
|
|
73
|
+
request: UserSetSiteProfileRequestData;
|
|
74
|
+
response: unknown;
|
|
75
|
+
error: null;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
export declare type UserGetSiteProfileType = 'user.get-site-profile';
|
|
80
|
+
export declare type UserGetSiteProfileInput = InferSocketRequest<UserGetSiteProfileType>;
|
|
81
|
+
export declare type UserGetSiteProfileRequestMessage = SocketRequestMessage<UserGetSiteProfileType>;
|
|
82
|
+
export declare type UserMySiteType = 'user.my-site';
|
|
83
|
+
export declare type UserMySiteInput = InferSocketRequest<UserMySiteType>;
|
|
84
|
+
export declare type UserMySiteRequestMessage = SocketRequestMessage<UserMySiteType>;
|
|
85
|
+
export declare type UserMakeSiteType = 'user.make-site';
|
|
86
|
+
export declare type UserMakeSiteInput = InferSocketRequest<UserMakeSiteType>;
|
|
87
|
+
export declare type UserMakeSiteRequestMessage = SocketRequestMessage<UserMakeSiteType>;
|
|
88
|
+
export declare type UserInviteType = 'user.invite';
|
|
89
|
+
export declare type UserInviteInput = InferSocketRequest<UserInviteType>;
|
|
90
|
+
export declare type UserInviteRequestMessage = SocketRequestMessage<UserInviteType>;
|
|
91
|
+
export declare type UserInviteBatchType = 'user.invite-batch';
|
|
92
|
+
export declare type UserInviteBatchInput = InferSocketRequest<UserInviteBatchType>;
|
|
93
|
+
export declare type UserInviteBatchRequestMessage = SocketRequestMessage<UserInviteBatchType>;
|
|
94
|
+
export declare type UserUpdateProfileType = 'user.update-profile';
|
|
95
|
+
export declare type UserUpdateProfileInput = InferSocketRequest<UserUpdateProfileType>;
|
|
96
|
+
export declare type UserUpdateProfileRequestMessage = SocketRequestMessage<UserUpdateProfileType>;
|
|
97
|
+
export declare type UserUpdateSiteType = 'user.update-site';
|
|
98
|
+
export declare type UserUpdateSiteInput = InferSocketRequest<UserUpdateSiteType>;
|
|
99
|
+
export declare type UserUpdateSiteRequestMessage = SocketRequestMessage<UserUpdateSiteType>;
|
|
100
|
+
export declare type UserSetSiteProfileType = 'user.set-site-profile';
|
|
101
|
+
export declare type UserSetSiteProfileInput = InferSocketRequest<UserSetSiteProfileType>;
|
|
102
|
+
export declare type UserSetSiteProfileRequestMessage = SocketRequestMessage<UserSetSiteProfileType>;
|