@lemoncloud/chatic-sockets-api 0.26.402 → 0.26.404
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/generated/field-registry.d.ts +36 -0
- package/dist/lib/types.d.ts +122 -0
- package/dist/libs/sockets.d.ts +104 -0
- package/dist/modules/sockets/model.d.ts +12 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/view/types.d.ts +1 -1
- package/package.json +1 -1
- package/dist/libs/wss/wss-types.d.ts +0 -696
- package/dist/modules/auth/model.d.ts +0 -127
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `model.ts`
|
|
3
|
-
* - model definitions for auth module
|
|
4
|
-
*
|
|
5
|
-
* @author Aiden <aiden@lemoncloud.io>
|
|
6
|
-
* @date 2025-01-22 initial version
|
|
7
|
-
*
|
|
8
|
-
* Copyright (C) 2025 LemonCloud Co Ltd. - All Rights Reserved.
|
|
9
|
-
*/
|
|
10
|
-
import { CoreModel } from 'lemon-model';
|
|
11
|
-
import $LUT, { AuthStereo, AuthState, AuthStateSet, UserRole, UserStereo } from './types';
|
|
12
|
-
import { DeviceHead } from '../sockets/model';
|
|
13
|
-
/**
|
|
14
|
-
* type: `ModelType`
|
|
15
|
-
*/
|
|
16
|
-
export declare type ModelType = keyof typeof $LUT.ModelType;
|
|
17
|
-
/**
|
|
18
|
-
* type: `Model`: common model
|
|
19
|
-
*/
|
|
20
|
-
export declare type Model = CoreModel<ModelType>;
|
|
21
|
-
/**
|
|
22
|
-
* type: boolean style number.
|
|
23
|
-
*/
|
|
24
|
-
export declare type BoolFlag = 0 | 1;
|
|
25
|
-
/**
|
|
26
|
-
* interface: `UserHead`
|
|
27
|
-
*/
|
|
28
|
-
export interface UserHead {
|
|
29
|
-
/** id of user */
|
|
30
|
-
id?: string;
|
|
31
|
-
/** name of user */
|
|
32
|
-
name?: string;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* interface: `UserModel`
|
|
36
|
-
* - 유저 정보 관리 모델
|
|
37
|
-
*/
|
|
38
|
-
export interface UserModel extends Model, UserHead {
|
|
39
|
-
/** stereo */
|
|
40
|
-
stereo?: UserStereo;
|
|
41
|
-
/** (linked) origin-id of user */
|
|
42
|
-
userId?: string;
|
|
43
|
-
/** nick of model */
|
|
44
|
-
nick?: string;
|
|
45
|
-
/** (optional) photo URL */
|
|
46
|
-
photo?: string;
|
|
47
|
-
/** user role */
|
|
48
|
-
role?: UserRole;
|
|
49
|
-
/** timestamp when linked */
|
|
50
|
-
linkedAt?: number;
|
|
51
|
-
/** timestamp of last activity */
|
|
52
|
-
lastActiveAt?: number;
|
|
53
|
-
/** (internal) active connection ids (stereo=#conn) */
|
|
54
|
-
connIds?: string[];
|
|
55
|
-
/** (internal) aliased user-id if stereo=alias */
|
|
56
|
-
aliasId?: string;
|
|
57
|
-
/** (internal) the linked user */
|
|
58
|
-
alias$?: UserHead;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* interface: `AuthHead`
|
|
62
|
-
*/
|
|
63
|
-
export interface AuthHead {
|
|
64
|
-
/** id of auth */
|
|
65
|
-
id?: string;
|
|
66
|
-
/** stereo of auth */
|
|
67
|
-
stereo?: AuthStereo;
|
|
68
|
-
/** current auth state */
|
|
69
|
-
auth?: AuthState;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* interface: `AuthModel`
|
|
73
|
-
* - WebSocket auth session (Member-Device hub)
|
|
74
|
-
* - Auth:Device = 1:1 (deviceId UNIQUE)
|
|
75
|
-
*/
|
|
76
|
-
export interface AuthModel extends Model, AuthHead {
|
|
77
|
-
/**
|
|
78
|
-
* id = `${stereo}:${md5(deviceId)}`
|
|
79
|
-
* - deviceId 기반으로 생성 (memberId 불필요)
|
|
80
|
-
* - memberId는 인증 성공 시 설정 (nullable)
|
|
81
|
-
*/
|
|
82
|
-
id?: string;
|
|
83
|
-
/** stereo type */
|
|
84
|
-
stereo?: AuthStereo;
|
|
85
|
-
/** (linked) member-id when authed */
|
|
86
|
-
memberId?: string;
|
|
87
|
-
/** (linked) member-info */
|
|
88
|
-
member$?: UserHead;
|
|
89
|
-
/** (linked) device-id when authed */
|
|
90
|
-
deviceId?: string;
|
|
91
|
-
/** (linked) device-info */
|
|
92
|
-
device$?: DeviceHead;
|
|
93
|
-
/** auth state */
|
|
94
|
-
auth?: AuthState;
|
|
95
|
-
/** auth transition timestamps */
|
|
96
|
-
auth$?: AuthStateSet;
|
|
97
|
-
/** (internal) last error */
|
|
98
|
-
error?: string;
|
|
99
|
-
/** (internal) last authenticated connection-id */
|
|
100
|
-
connId?: string;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* extract field names from models
|
|
104
|
-
* - only fields start with lowercase, or all upper.
|
|
105
|
-
*/
|
|
106
|
-
export declare const filterFields: (fields: string[], base?: string[]) => string[];
|
|
107
|
-
/** field names from head */
|
|
108
|
-
export declare const $HEAD: {
|
|
109
|
-
user: string[];
|
|
110
|
-
auth: string[];
|
|
111
|
-
};
|
|
112
|
-
export declare const $FIELD: {
|
|
113
|
-
user: string[];
|
|
114
|
-
auth: string[];
|
|
115
|
-
};
|
|
116
|
-
/** must export default as below */
|
|
117
|
-
declare const _default: {
|
|
118
|
-
$HEAD: {
|
|
119
|
-
user: string[];
|
|
120
|
-
auth: string[];
|
|
121
|
-
};
|
|
122
|
-
$FIELD: {
|
|
123
|
-
user: string[];
|
|
124
|
-
auth: string[];
|
|
125
|
-
};
|
|
126
|
-
};
|
|
127
|
-
export default _default;
|