@lemoncloud/clipbiz-backend-api 0.25.1019
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/README.md +4 -0
- package/dist/cores/types.d.ts +217 -0
- package/dist/modules/auth/model.d.ts +285 -0
- package/dist/modules/auth/oauth2/oauth2-model.d.ts +350 -0
- package/dist/modules/auth/oauth2/oauth2-types.d.ts +421 -0
- package/dist/modules/auth/types.d.ts +318 -0
- package/dist/modules/auth/views.d.ts +266 -0
- package/dist/modules/mock/model.d.ts +100 -0
- package/dist/modules/mock/types.d.ts +42 -0
- package/dist/modules/mock/views.d.ts +49 -0
- package/dist/modules/request/model.d.ts +88 -0
- package/dist/modules/request/types.d.ts +96 -0
- package/dist/modules/request/views.d.ts +34 -0
- package/dist/modules/terms/model.d.ts +81 -0
- package/dist/modules/terms/types.d.ts +44 -0
- package/dist/modules/terms/views.d.ts +30 -0
- package/dist/service/backend-types.d.ts +189 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/view/types.d.ts +205 -0
- package/package.json +24 -0
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `oauth2-model.ts`
|
|
3
|
+
* - common model definitions for `oauth2`
|
|
4
|
+
*
|
|
5
|
+
* @author Steve <steve@lemoncloud.io>
|
|
6
|
+
* @date 2022-03-04 refactoring for activity service.
|
|
7
|
+
*
|
|
8
|
+
* Copyright (C) 2020 LemonCloud Co Ltd. - All Rights Reserved.
|
|
9
|
+
*/
|
|
10
|
+
import { CoreModel, SimpleSet } from 'lemon-model';
|
|
11
|
+
import { AccountKey, AccountStereo, SiteStereo, HostStereo, UserStereo, GroupStereo, RoleStereo, AuthStereo } from './oauth2-types';
|
|
12
|
+
export { SimpleSet, AccountStereo, SiteStereo, HostStereo, UserStereo, GroupStereo, RoleStereo, AuthStereo };
|
|
13
|
+
/**
|
|
14
|
+
* type: `AccountModel`
|
|
15
|
+
* - 가입(또는 인증/무인증) 처리된 회원 정보를 담음.
|
|
16
|
+
* - `AWS:cognito:identity-id` 1개당 매핑되는 정보를 여기에 저장.
|
|
17
|
+
* - 각 인증방법(소셜,디바이스,기타등등)에 따라 1개 디바이스에서 여러개의 계정(인증)이 존재 가능함.
|
|
18
|
+
*/
|
|
19
|
+
export interface AccountModel<T extends string = any, S extends string = any> extends CoreModel<T> {
|
|
20
|
+
/** account-id (= _id of `AccountKey`) */
|
|
21
|
+
id?: string;
|
|
22
|
+
/** stereo type (just as reference) */
|
|
23
|
+
stereo?: S;
|
|
24
|
+
/** detailed key components */
|
|
25
|
+
key$?: AccountKey;
|
|
26
|
+
/**
|
|
27
|
+
* (optional) other account-id which is aliased
|
|
28
|
+
*/
|
|
29
|
+
aliasId?: string;
|
|
30
|
+
/**
|
|
31
|
+
* user-id of `user` to be linked
|
|
32
|
+
*
|
|
33
|
+
* @see UserModel
|
|
34
|
+
*/
|
|
35
|
+
userId?: string;
|
|
36
|
+
/**
|
|
37
|
+
* (optional) open-id to make `access-token`
|
|
38
|
+
* - 로그인 처리(cognito인증) 할때 이용되는 ID (.identityId와 매칭됨)
|
|
39
|
+
* - 비어있는 경우, 이걸로 로그인 연동 안되어 있음
|
|
40
|
+
* - 소셜 로그인시 `open-id := social:<provider>:<social-id>`
|
|
41
|
+
*/
|
|
42
|
+
openId?: string;
|
|
43
|
+
/**
|
|
44
|
+
* (optional) identity-id from context.
|
|
45
|
+
* - initialized when creation.
|
|
46
|
+
*
|
|
47
|
+
* @see NextIdentityCognito.identityId
|
|
48
|
+
*/
|
|
49
|
+
identityId?: string;
|
|
50
|
+
/**
|
|
51
|
+
* (optional) identity-pool-id from context.
|
|
52
|
+
* - initialized when creation.
|
|
53
|
+
*
|
|
54
|
+
* @see NextIdentityCognito.identityPoolId
|
|
55
|
+
*/
|
|
56
|
+
identityPoolId?: string;
|
|
57
|
+
/**
|
|
58
|
+
* account-id to login
|
|
59
|
+
*
|
|
60
|
+
* @see NextIdentityAccess.Account?.id
|
|
61
|
+
*/
|
|
62
|
+
accountId?: string;
|
|
63
|
+
/**
|
|
64
|
+
* account-no: mobile # if stereo is 'mobile', otherwise social id
|
|
65
|
+
*
|
|
66
|
+
* @see NextIdentityAccess.Account?.socialId
|
|
67
|
+
*/
|
|
68
|
+
accountNo?: string;
|
|
69
|
+
/**
|
|
70
|
+
* profile's nick-name
|
|
71
|
+
* ex) mike
|
|
72
|
+
*/
|
|
73
|
+
nick?: string;
|
|
74
|
+
/**
|
|
75
|
+
* (optional) profile's real-name
|
|
76
|
+
* ex) 김실명
|
|
77
|
+
*/
|
|
78
|
+
name?: string;
|
|
79
|
+
/**
|
|
80
|
+
* (optional) profile's phone
|
|
81
|
+
* ex) 01012345678
|
|
82
|
+
*/
|
|
83
|
+
phone?: string;
|
|
84
|
+
/**
|
|
85
|
+
* profile's photo in url
|
|
86
|
+
* ex) //abc.com/~/a.png
|
|
87
|
+
*/
|
|
88
|
+
photo?: string;
|
|
89
|
+
/**
|
|
90
|
+
* (optional) email aliases
|
|
91
|
+
*/
|
|
92
|
+
email?: string;
|
|
93
|
+
/**
|
|
94
|
+
* group name as reference
|
|
95
|
+
*/
|
|
96
|
+
group?: string;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* 사이트(아파트) 모델
|
|
100
|
+
* - 외부 사이트ID (target 저장)를 기준으로 내부ID 생성됨.
|
|
101
|
+
*/
|
|
102
|
+
export interface SiteModel<T extends string = any, S extends string = any> extends CoreModel<T> {
|
|
103
|
+
/**
|
|
104
|
+
* site-id (auto-seq, or custom generated)
|
|
105
|
+
* - case.1 auto-sequence which is generated locally.
|
|
106
|
+
* - case.2 external linked id ([A-Z]+[0-9]+). must be started with upper-letter.
|
|
107
|
+
*/
|
|
108
|
+
id?: string;
|
|
109
|
+
/** stereo type (just as reference) */
|
|
110
|
+
stereo?: S;
|
|
111
|
+
/** (internal) aliased id */
|
|
112
|
+
aliasId?: string;
|
|
113
|
+
/** (optional) alias name as reference */
|
|
114
|
+
alias?: string;
|
|
115
|
+
/** target host of domain */
|
|
116
|
+
host?: string;
|
|
117
|
+
/** (optional) base of domain */
|
|
118
|
+
base?: string;
|
|
119
|
+
/** site-name (or nickname) */
|
|
120
|
+
name?: string;
|
|
121
|
+
/**
|
|
122
|
+
* target domain (or full host-name)
|
|
123
|
+
* - use `HostModel` to route multi-hosts to single site.
|
|
124
|
+
*/
|
|
125
|
+
domain?: string;
|
|
126
|
+
/** (optional) internal code as reference */
|
|
127
|
+
code?: string;
|
|
128
|
+
/** flag of linked status with remote `sites-api` */
|
|
129
|
+
linked?: number;
|
|
130
|
+
/** flag of site(or domain) is in public scope (limited to invite) */
|
|
131
|
+
isPublic?: number;
|
|
132
|
+
/**
|
|
133
|
+
* business-area type CODE(Alphabet).
|
|
134
|
+
* - ex) A
|
|
135
|
+
*/
|
|
136
|
+
typeCode?: string;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* 호스트(도메인) 모델
|
|
140
|
+
* - 호스트(도메인)으로부터 라우팅되는 타겟 사이트를 찾기 위함.
|
|
141
|
+
* - 호스트:사이트 = N:1
|
|
142
|
+
*/
|
|
143
|
+
export interface HostModel<T extends string = any, S extends string = any> extends CoreModel<T> {
|
|
144
|
+
/** target host (or domain) */
|
|
145
|
+
id?: string;
|
|
146
|
+
/** stereo type */
|
|
147
|
+
stereo?: S;
|
|
148
|
+
/** (linked) domain when linked */
|
|
149
|
+
domain?: string;
|
|
150
|
+
/** (linked) id of site-model */
|
|
151
|
+
siteId?: string;
|
|
152
|
+
/** flag of invalid */
|
|
153
|
+
invalid?: number;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* 유저 모델
|
|
157
|
+
* - `identityId`별 매핑되는 유저모델 있음.
|
|
158
|
+
* - `Account`는 로그인 방식에 따라서 여러개 있으며, `User`는 실제 유저 정보.
|
|
159
|
+
*/
|
|
160
|
+
export interface UserModel<T extends string = any, S extends string = any> extends CoreModel<T> {
|
|
161
|
+
/**
|
|
162
|
+
* user-id (:= <auto-seq>)
|
|
163
|
+
* - use `findUser()`
|
|
164
|
+
*/
|
|
165
|
+
id?: string;
|
|
166
|
+
/** stereo type (just as reference) */
|
|
167
|
+
stereo?: S;
|
|
168
|
+
/** (internal) aliased id */
|
|
169
|
+
aliasId?: string;
|
|
170
|
+
/** (optional) alias name as reference */
|
|
171
|
+
alias?: string;
|
|
172
|
+
/**
|
|
173
|
+
* main account-id which was initialized.
|
|
174
|
+
* - 기본 로그인용 계정 정보를 담음. (여러 게정으로 동일 User로 로그인할 수 있음)
|
|
175
|
+
*/
|
|
176
|
+
accountId?: string;
|
|
177
|
+
/**
|
|
178
|
+
* (optional) login-id used to login
|
|
179
|
+
*/
|
|
180
|
+
loginId?: string;
|
|
181
|
+
/**
|
|
182
|
+
* (optional) login-pw used to login
|
|
183
|
+
*/
|
|
184
|
+
loginPw?: string;
|
|
185
|
+
/**
|
|
186
|
+
* (optiona) email of user
|
|
187
|
+
*/
|
|
188
|
+
email?: string;
|
|
189
|
+
/**
|
|
190
|
+
* name of user
|
|
191
|
+
*/
|
|
192
|
+
name?: string;
|
|
193
|
+
/**
|
|
194
|
+
* nick of user
|
|
195
|
+
*/
|
|
196
|
+
nick?: string;
|
|
197
|
+
/** (optional) the expected role to be requested (or common role in global) */
|
|
198
|
+
role?: string;
|
|
199
|
+
/**
|
|
200
|
+
* (optional) the roles in array.
|
|
201
|
+
* (주의! 전체 사이트에 공통 적용됨)
|
|
202
|
+
*/
|
|
203
|
+
roles?: string[];
|
|
204
|
+
/** (optional) main site to login */
|
|
205
|
+
siteId?: string;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* 그룹 모델
|
|
209
|
+
* - CRUD (추가 생성) 가능한 모델임
|
|
210
|
+
*/
|
|
211
|
+
export interface GroupModel<T extends string = any, S extends string = any> extends CoreModel<T> {
|
|
212
|
+
/** user-id (auto-seq) */
|
|
213
|
+
id?: string;
|
|
214
|
+
/** stereo type */
|
|
215
|
+
stereo?: S;
|
|
216
|
+
/** 이 그룹이 구성된 사이트의 ID */
|
|
217
|
+
siteId?: string;
|
|
218
|
+
/** 그룹 이름 (관리용 이름으로 변경가능함 ) */
|
|
219
|
+
name?: string;
|
|
220
|
+
/** (optional) internal code as reference */
|
|
221
|
+
code?: string;
|
|
222
|
+
/** 이 그룹에 할당된 역할 목록 (포함된 유저는 이 값을 함께 포함함) */
|
|
223
|
+
roles?: string[];
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* 역할 관리
|
|
227
|
+
* - 각 `User`와 `Site`별 설정된 권한/그룹 정보를 가짐
|
|
228
|
+
* - `*` 는 전체 사이트를 의미
|
|
229
|
+
*/
|
|
230
|
+
export interface RoleModel<T extends string = any, S extends string = any> extends CoreModel<T> {
|
|
231
|
+
/**
|
|
232
|
+
* role-name (must be lower-cased alphabets)
|
|
233
|
+
* or
|
|
234
|
+
* role-id := <userId>@<siteId>
|
|
235
|
+
*/
|
|
236
|
+
id?: string;
|
|
237
|
+
/** stereo type (just as referece) */
|
|
238
|
+
stereo?: S;
|
|
239
|
+
/** 역할 이름 (역할 이름으로 이거로 사용가능한 권한을 검색하여 이용할 수 있음) */
|
|
240
|
+
name?: string;
|
|
241
|
+
/** site-id to link */
|
|
242
|
+
siteId?: string;
|
|
243
|
+
/** user-id to link */
|
|
244
|
+
userId?: string;
|
|
245
|
+
/** 이 유저가 포함된 그룹 ID */
|
|
246
|
+
groupId?: string;
|
|
247
|
+
/**
|
|
248
|
+
* main role definition.
|
|
249
|
+
* 주의! 타입 정의할때 model에는 string 을 추가해주고, body/view 에서 string를 빼주자!!
|
|
250
|
+
*
|
|
251
|
+
* WARN - if empty. then it will throw error of `403`.
|
|
252
|
+
*/
|
|
253
|
+
role?: string;
|
|
254
|
+
/** 이 유저에게 할당된 역할 목록 */
|
|
255
|
+
roles?: string[];
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* type: `AuthModel`
|
|
259
|
+
* - 핸드폰이나 이메일등 인증 관련 정보를 가짐
|
|
260
|
+
* - TODO: ID/PW 로그인 지원시 인증 관리 방법 관리 필요!
|
|
261
|
+
*
|
|
262
|
+
*/
|
|
263
|
+
export interface AuthModel<T extends string = any, S extends string = any> extends CoreModel<T> {
|
|
264
|
+
/**
|
|
265
|
+
* id = <stereo>:md5(md5(<phone|email|...>), stereo)
|
|
266
|
+
*/
|
|
267
|
+
id?: string;
|
|
268
|
+
/** stereo type */
|
|
269
|
+
stereo?: S;
|
|
270
|
+
/** (internal) parent-id if issued for target site */
|
|
271
|
+
parentId?: string;
|
|
272
|
+
/** (internal) delegate-id if issued by remote session */
|
|
273
|
+
delegateId?: string;
|
|
274
|
+
/**
|
|
275
|
+
* 참여자 정보. (최종 사용자ID)
|
|
276
|
+
*/
|
|
277
|
+
identityId?: string;
|
|
278
|
+
/**
|
|
279
|
+
* 인증 Pool 정보. (최종 사용자ID)
|
|
280
|
+
*/
|
|
281
|
+
identityPoolId?: string;
|
|
282
|
+
/**
|
|
283
|
+
* (internal) identityToken from cognito.
|
|
284
|
+
*/
|
|
285
|
+
_identityToken?: string;
|
|
286
|
+
/**
|
|
287
|
+
* 인증 번호 발급여부.
|
|
288
|
+
*/
|
|
289
|
+
issued?: number;
|
|
290
|
+
/** 인증 발급 시간 */
|
|
291
|
+
issuedAt?: number;
|
|
292
|
+
/**
|
|
293
|
+
* 인증 확인 여부.
|
|
294
|
+
*/
|
|
295
|
+
verified?: number;
|
|
296
|
+
/** 인증 확인 시간 */
|
|
297
|
+
verifiedAt?: number;
|
|
298
|
+
/** 사용 여부 */
|
|
299
|
+
consumed?: number;
|
|
300
|
+
/** 처리 완료 시간 */
|
|
301
|
+
consumedAt?: number;
|
|
302
|
+
/** 인증 유효 기간 (약 6개월) */
|
|
303
|
+
expiredAt?: number;
|
|
304
|
+
/** (oauth2) aliased auth-id */
|
|
305
|
+
aliasId?: string;
|
|
306
|
+
/** (optional) alias name as reference */
|
|
307
|
+
alias?: string;
|
|
308
|
+
/** (oauth2) account-id when authed */
|
|
309
|
+
accountId?: string;
|
|
310
|
+
/** (oauth2) client-ip when authed */
|
|
311
|
+
clientIp?: string;
|
|
312
|
+
/** (oauth2) user-agent when authed */
|
|
313
|
+
userAgent?: string;
|
|
314
|
+
/** (oauth2) user-id when authed */
|
|
315
|
+
userId?: string;
|
|
316
|
+
/** (oauth2) site-id when authed */
|
|
317
|
+
siteId?: string;
|
|
318
|
+
/** refreshed last time */
|
|
319
|
+
refreshedAt?: number;
|
|
320
|
+
/** refreshed count number */
|
|
321
|
+
refreshedNo?: number;
|
|
322
|
+
/**
|
|
323
|
+
* WARN! updatable fields from core.
|
|
324
|
+
*/
|
|
325
|
+
error?: string;
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* type: `InviteModel`
|
|
329
|
+
* - 초대시 생성됨.
|
|
330
|
+
*/
|
|
331
|
+
export interface InviteModel<T extends string = any, S extends string = any> extends CoreModel<T> {
|
|
332
|
+
/**
|
|
333
|
+
* id := uuid
|
|
334
|
+
*/
|
|
335
|
+
id?: string;
|
|
336
|
+
/** stereo type */
|
|
337
|
+
stereo?: S;
|
|
338
|
+
/** the requested role */
|
|
339
|
+
role?: string;
|
|
340
|
+
/** user email (as account) to invite */
|
|
341
|
+
email?: string;
|
|
342
|
+
/** the initial invited time */
|
|
343
|
+
invitedAt?: number;
|
|
344
|
+
/** expires timeout (max 30min) */
|
|
345
|
+
expiredAt?: number;
|
|
346
|
+
/** checked time */
|
|
347
|
+
checkedAt?: number;
|
|
348
|
+
/** (internal) error */
|
|
349
|
+
error?: string;
|
|
350
|
+
}
|