@lemoncloud/ssocio-tenants-api 0.25.424 → 0.25.620
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/service/backend-model.d.ts +7 -2
- package/dist/service/backend-types.d.ts +6 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/view/types.d.ts +9 -1
- package/package.json +1 -1
- package/dist/cores/abstract-controllers.d.ts +0 -185
- package/dist/cores/abstract-rest-apis.d.ts +0 -111
- package/dist/cores/abstract-services.d.ts +0 -244
- package/dist/cores/commons.d.ts +0 -32
- package/dist/cores/index.d.ts +0 -14
- package/dist/view/index.d.ts +0 -11
- package/dist/view/transformer.d.ts +0 -332
|
@@ -1,332 +0,0 @@
|
|
|
1
|
-
import { TestView, TestBody, TenantView, TenantBody, AssetView, AssetBody, ContractView, ContractBody, InstallView, InstallBody, SiteAddress, InviteView, InviteBody, MemoView, MemoBody, TenantExcelView, RequestInfo, TenantRole, RequestStatus, RentalView, RentalBody, RentalStatusType, AirfobInfo, AirfobInfoView, UserLevelsBody, PushNotificationView, PushNotificationBody, HistoryView, HistoryBody } from './types';
|
|
2
|
-
import { TenantModel, TestModel, AssetModel, ContractModel, InstallModel, Resident, Owner, Manager, Car, Rent, InstallCodeBody, InviteMemberBody, InviteModel, InviteModelHead, MemoModel, InstallHead, RentalModel, RentalHead, PushNotificationModel, HistoryModel } from '../service/backend-model';
|
|
3
|
-
import * as $sites from '@lemoncloud/ssocio-sites-api';
|
|
4
|
-
import * as $backend from '@lemoncloud/ssocio2-backend-api';
|
|
5
|
-
import * as $airfob from '@lemoncloud/moca-airfob-api';
|
|
6
|
-
import * as $push from '@lemoncloud/lemon-pushes-api';
|
|
7
|
-
import { AbstractTransformer } from '../cores/abstract-controllers';
|
|
8
|
-
/**
|
|
9
|
-
* internal data transformer.
|
|
10
|
-
*/
|
|
11
|
-
export declare const $X: {
|
|
12
|
-
/** cleanup if in undefined */
|
|
13
|
-
clear: <T extends object>(N: T) => T;
|
|
14
|
-
/**
|
|
15
|
-
* find key in LUT table.
|
|
16
|
-
*/
|
|
17
|
-
asLut: <T_1 extends object>(key: string, $map: T_1, name?: string) => keyof T_1;
|
|
18
|
-
asLutVal: <T_2 extends object>(key: string, $map: T_2, def?: string) => string;
|
|
19
|
-
asMapWithMultipleEntries: <T_3>(list: T_3[], id?: string) => {
|
|
20
|
-
[key: string]: T_3[];
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* transform helper
|
|
24
|
-
*/
|
|
25
|
-
$T: {
|
|
26
|
-
address: {
|
|
27
|
-
asView: (N: SiteAddress) => SiteAddress;
|
|
28
|
-
asModel: (N: SiteAddress) => SiteAddress;
|
|
29
|
-
asHouseToAddress: (H: $sites.HouseView) => SiteAddress;
|
|
30
|
-
asRequestToAddress: (R: RequestInfo) => SiteAddress;
|
|
31
|
-
};
|
|
32
|
-
resident: {
|
|
33
|
-
asView: (N: Resident) => Resident;
|
|
34
|
-
asModel: (N: Resident) => Resident;
|
|
35
|
-
calcRentalStatus: (N?: Resident, current?: number) => RentalStatusType;
|
|
36
|
-
};
|
|
37
|
-
owner: {
|
|
38
|
-
asView: (N: Owner) => Owner;
|
|
39
|
-
asModel: (N: Owner) => Owner;
|
|
40
|
-
};
|
|
41
|
-
manager: {
|
|
42
|
-
asView: (N: Manager) => Manager;
|
|
43
|
-
asModel: (N: Manager) => Manager;
|
|
44
|
-
};
|
|
45
|
-
car: {
|
|
46
|
-
asView: (N: Car) => Car;
|
|
47
|
-
asModel: (N: Car) => Car;
|
|
48
|
-
};
|
|
49
|
-
rent: {
|
|
50
|
-
asView: (N: Rent) => Rent;
|
|
51
|
-
asModel: (N: Rent) => Rent;
|
|
52
|
-
};
|
|
53
|
-
install: {
|
|
54
|
-
asModel: (N: InstallCodeBody) => {
|
|
55
|
-
$install: InstallModel;
|
|
56
|
-
$tenant: TenantModel;
|
|
57
|
-
};
|
|
58
|
-
/** 세대원에게 코드를 전송하기 위함.
|
|
59
|
-
* 세대원 정보를 Install Model로 transform
|
|
60
|
-
*/
|
|
61
|
-
asInvite: (N: TenantModel) => InstallModel;
|
|
62
|
-
};
|
|
63
|
-
/** 세대원 (member) 등록을 위한 transform */
|
|
64
|
-
invite: {
|
|
65
|
-
/** 세대원 정보로 Tenant model을 생성하기 위한 trans */
|
|
66
|
-
asTenant: (N: InviteMemberBody) => TenantModel;
|
|
67
|
-
/** InviteModel to InviteModelHead */
|
|
68
|
-
asHead: (N: InviteModel) => InviteModelHead;
|
|
69
|
-
};
|
|
70
|
-
excel: {
|
|
71
|
-
/** 회원목록 출력을 위한 transformer */
|
|
72
|
-
asTenantView: (N: TenantView) => TenantExcelView;
|
|
73
|
-
};
|
|
74
|
-
/** * 전화번호 양식 체크 및 변환 */
|
|
75
|
-
phone: {
|
|
76
|
-
/** 전화번호 포멧 체크 */
|
|
77
|
-
isPhone: (phone: string) => boolean;
|
|
78
|
-
/** 전화번호에 대한 modelToView
|
|
79
|
-
* ex) 010XXXXXXXX -> 010-XXXX-XXXX
|
|
80
|
-
*/
|
|
81
|
-
asView: (phone: string) => string;
|
|
82
|
-
/** 전화번호에 대한 bodyToModel
|
|
83
|
-
* ex) 010-XXXX-XXXX -> 010XXXXXXXX
|
|
84
|
-
*/
|
|
85
|
-
asModel: (phone: string, name?: string) => string;
|
|
86
|
-
};
|
|
87
|
-
/** 날짜 양식 체크 및 변환 */
|
|
88
|
-
date: {
|
|
89
|
-
/** 날짜에 대한 modelToView
|
|
90
|
-
* ex) YYYYMMDD -> YYYY-MM-DD
|
|
91
|
-
*/
|
|
92
|
-
asView: (date: string) => string;
|
|
93
|
-
/** 날짜에 대한 viewToModel
|
|
94
|
-
* ex) YYYY-MM-DD -> YYYYMMDD
|
|
95
|
-
*/
|
|
96
|
-
asModel: (date: string, name?: string) => string;
|
|
97
|
-
/** 날짜를 타임스탬프로 변환
|
|
98
|
-
* - ex) "2023-03-01" => 1677628800000
|
|
99
|
-
* - ex) "2023-03-01 12:30" => 1677665400000
|
|
100
|
-
* - ex) "2023-03-01 12:30:45" => 1677665445000
|
|
101
|
-
*/
|
|
102
|
-
asTime: (inputDate: string, defaultTime?: string, name?: string) => number;
|
|
103
|
-
/** 해당 timestamp를 날짜와 시간으로 분리 */
|
|
104
|
-
asTimeView: (target: number) => {
|
|
105
|
-
date: string;
|
|
106
|
-
time: string;
|
|
107
|
-
};
|
|
108
|
-
/** 두 날짜(timestamp)의 차이를 일자로 계산 */
|
|
109
|
-
calcDateDiff: (t1: number, t2: number) => number;
|
|
110
|
-
calcYearMonth: (days: number) => {
|
|
111
|
-
year: number;
|
|
112
|
-
month: number;
|
|
113
|
-
};
|
|
114
|
-
};
|
|
115
|
-
/** 문자열 변환을 위한 도우미 함수 */
|
|
116
|
-
string: {
|
|
117
|
-
asNumber: (N: string) => number;
|
|
118
|
-
};
|
|
119
|
-
/** transform `request$` */
|
|
120
|
-
request: {
|
|
121
|
-
asModel: (body: RequestInfo) => RequestInfo;
|
|
122
|
-
asView: (request$: RequestInfo) => RequestInfo;
|
|
123
|
-
asCalcStatus: (request$: RequestInfo) => RequestStatus;
|
|
124
|
-
};
|
|
125
|
-
/** transform `tenant` */
|
|
126
|
-
tenant: {
|
|
127
|
-
asRequestTenant: (N: TenantModel, request: RequestInfo, role: TenantRole, addr?: SiteAddress, holderId?: string) => TenantModel;
|
|
128
|
-
};
|
|
129
|
-
/** transform `airfob` */
|
|
130
|
-
airfob: {
|
|
131
|
-
asUserKey: (id: string) => string;
|
|
132
|
-
asModel: (N: AirfobInfoView) => AirfobInfo;
|
|
133
|
-
asView: (N: AirfobInfo) => AirfobInfoView;
|
|
134
|
-
asLevels: (N: AirfobInfo) => {
|
|
135
|
-
access: string[];
|
|
136
|
-
floors: string[];
|
|
137
|
-
};
|
|
138
|
-
asInfo: (N: AirfobInfo) => {
|
|
139
|
-
name: string;
|
|
140
|
-
startDate: string;
|
|
141
|
-
endDate: string;
|
|
142
|
-
};
|
|
143
|
-
asUserLevels: (N: UserLevelsBody) => AirfobInfoView;
|
|
144
|
-
asTokenToInfo: (T: $backend.AirfobToken, L?: $airfob.AirfobUserLevelsBody) => AirfobInfo;
|
|
145
|
-
asLevelsToView: (N: string[]) => string[];
|
|
146
|
-
};
|
|
147
|
-
/** transform `push` */
|
|
148
|
-
push: {
|
|
149
|
-
asSendLeavingMessage: (T: TenantModel, leaveAlert?: number, siteName?: string) => $push.SendPushBody;
|
|
150
|
-
asSendBanMessage: () => $push.SendPushBody;
|
|
151
|
-
asSendBody: (N: PushNotificationBody, T: TenantModel[]) => $push.SendPushBatchBody;
|
|
152
|
-
asUserList: (N: TenantModel[]) => $push.User[];
|
|
153
|
-
};
|
|
154
|
-
};
|
|
155
|
-
};
|
|
156
|
-
/**
|
|
157
|
-
* class: `TenantTransformer`
|
|
158
|
-
* - transform between TenantModel and TenantView.
|
|
159
|
-
*/
|
|
160
|
-
export declare class TenantTransformer extends AbstractTransformer<TenantModel, TenantView, TenantBody> {
|
|
161
|
-
/**
|
|
162
|
-
* TenantModel -> TenantView
|
|
163
|
-
* @param model : Tenant Model
|
|
164
|
-
*/
|
|
165
|
-
toTenantBaseView(model: TenantModel, hasCores?: boolean): TenantView;
|
|
166
|
-
/**
|
|
167
|
-
* @override
|
|
168
|
-
*/
|
|
169
|
-
bodyToModel(body: TenantBody, isCreate?: boolean): TenantModel;
|
|
170
|
-
/**
|
|
171
|
-
* @override
|
|
172
|
-
*/
|
|
173
|
-
modelAsView(model: TenantModel, hasCores?: boolean): TenantView;
|
|
174
|
-
/**
|
|
175
|
-
* InviteMemberBody | any => InviteMemberBody
|
|
176
|
-
* */
|
|
177
|
-
asInviteMemberBody(body: InviteMemberBody): InviteMemberBody;
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* class: `AssetTransformer`
|
|
181
|
-
* - transform between AssetModel and AssetView.
|
|
182
|
-
*/
|
|
183
|
-
export declare class AssetTransformer extends AbstractTransformer<AssetModel, AssetView, AssetBody> {
|
|
184
|
-
/**
|
|
185
|
-
* AssetModel -> AssetView
|
|
186
|
-
* @param model : Asset Model
|
|
187
|
-
*/
|
|
188
|
-
toAssetBaseView(model: AssetModel, hasCores?: boolean): AssetView;
|
|
189
|
-
/**
|
|
190
|
-
* @override
|
|
191
|
-
*/
|
|
192
|
-
bodyToModel(body: AssetBody, isCreate?: boolean): AssetModel;
|
|
193
|
-
modelAsView(model: AssetModel, hasCores?: boolean): AssetView;
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* class: `ContractTransformer`
|
|
197
|
-
* - transform between ContractModel and ContractView.
|
|
198
|
-
*/
|
|
199
|
-
export declare class ContractTransformer extends AbstractTransformer<ContractModel, ContractView, ContractBody> {
|
|
200
|
-
/**
|
|
201
|
-
* ContractModel -> ContractView
|
|
202
|
-
* @param model : ContractModel
|
|
203
|
-
*/
|
|
204
|
-
toContractBaseView(model: ContractModel, hasCores?: boolean): ContractView;
|
|
205
|
-
/**
|
|
206
|
-
* @override
|
|
207
|
-
*/
|
|
208
|
-
bodyToModel(body: ContractBody, isCreate?: boolean): ContractModel;
|
|
209
|
-
/**
|
|
210
|
-
* @override
|
|
211
|
-
*/
|
|
212
|
-
modelAsView(model: ContractModel, hasCores?: boolean): ContractView;
|
|
213
|
-
}
|
|
214
|
-
/**
|
|
215
|
-
* class: `InstallTransformer`
|
|
216
|
-
* - transform between InstallModel and InstallView.
|
|
217
|
-
*/
|
|
218
|
-
export declare class InstallTransformer extends AbstractTransformer<InstallModel, InstallView, InstallBody> {
|
|
219
|
-
/**
|
|
220
|
-
* @override
|
|
221
|
-
*/
|
|
222
|
-
bodyToModel(body: InstallBody, isCreate?: boolean): InstallModel;
|
|
223
|
-
/**
|
|
224
|
-
* @override
|
|
225
|
-
*/
|
|
226
|
-
modelAsView(model: InstallModel, hasCores?: boolean): InstallView;
|
|
227
|
-
/**
|
|
228
|
-
* InstallCodeBody | any => InstallCodeBody
|
|
229
|
-
*/
|
|
230
|
-
asInstallCodeBody(body: InstallCodeBody | any, isCreate?: boolean): InstallCodeBody;
|
|
231
|
-
/**
|
|
232
|
-
* extract only for head
|
|
233
|
-
*/
|
|
234
|
-
asHead: (model: InstallModel) => InstallHead;
|
|
235
|
-
}
|
|
236
|
-
/**
|
|
237
|
-
* class: `InviteTransformer`
|
|
238
|
-
*/
|
|
239
|
-
export declare class InviteTransformer extends AbstractTransformer<InviteModel, InviteView, InviteBody> {
|
|
240
|
-
/**
|
|
241
|
-
* @override
|
|
242
|
-
*/
|
|
243
|
-
modelAsView(model: InviteModel, hasCores?: boolean): InviteView;
|
|
244
|
-
/**
|
|
245
|
-
* @override
|
|
246
|
-
*/
|
|
247
|
-
bodyToModel(body: InviteBody, isCreate?: boolean): InviteModel;
|
|
248
|
-
}
|
|
249
|
-
/**
|
|
250
|
-
* class: `MemoTransformer`
|
|
251
|
-
*/
|
|
252
|
-
export declare class MemoTransformer extends AbstractTransformer<MemoModel, MemoView, MemoBody> {
|
|
253
|
-
/**
|
|
254
|
-
* @override
|
|
255
|
-
*/
|
|
256
|
-
modelAsView(model: MemoModel, hasCores?: boolean): MemoView;
|
|
257
|
-
/**
|
|
258
|
-
* @override
|
|
259
|
-
*/
|
|
260
|
-
bodyToModel(body: MemoBody, isCreate?: boolean): MemoModel;
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
* class: `RentalTransformer`
|
|
264
|
-
*/
|
|
265
|
-
export declare class RentalTransformer extends AbstractTransformer<RentalModel, RentalView, RentalBody> {
|
|
266
|
-
/**
|
|
267
|
-
* @override
|
|
268
|
-
*/
|
|
269
|
-
modelAsView(model: RentalModel, hasCores?: boolean): RentalView;
|
|
270
|
-
/**
|
|
271
|
-
* @override
|
|
272
|
-
*/
|
|
273
|
-
bodyToModel(body: RentalBody, isCreate?: boolean): RentalModel;
|
|
274
|
-
/**
|
|
275
|
-
* extract only for head
|
|
276
|
-
*/
|
|
277
|
-
asHead: (model: RentalModel) => RentalHead;
|
|
278
|
-
}
|
|
279
|
-
/**
|
|
280
|
-
* class: `PushNotificationTransformer`
|
|
281
|
-
*/
|
|
282
|
-
export declare class PushNotificationTransformer extends AbstractTransformer<PushNotificationModel, PushNotificationView, PushNotificationBody> {
|
|
283
|
-
/**
|
|
284
|
-
* @override
|
|
285
|
-
*/
|
|
286
|
-
modelAsView(model: PushNotificationModel, hasCores?: boolean): PushNotificationView;
|
|
287
|
-
/**
|
|
288
|
-
* @override
|
|
289
|
-
*/
|
|
290
|
-
bodyToModel(body: PushNotificationBody, isCreate?: boolean): PushNotificationModel;
|
|
291
|
-
}
|
|
292
|
-
/**
|
|
293
|
-
* class: `HistoryTransformer`
|
|
294
|
-
*/
|
|
295
|
-
export declare class HistoryTransformer extends AbstractTransformer<HistoryModel, HistoryView, HistoryBody> {
|
|
296
|
-
/**
|
|
297
|
-
* @override
|
|
298
|
-
*/
|
|
299
|
-
modelAsView(model: HistoryModel, hasCores?: boolean): HistoryView;
|
|
300
|
-
/**
|
|
301
|
-
* @override
|
|
302
|
-
*/
|
|
303
|
-
bodyToModel(body: HistoryBody, isCreate?: boolean): HistoryModel;
|
|
304
|
-
}
|
|
305
|
-
/**
|
|
306
|
-
* class: `TestTransformer`
|
|
307
|
-
*/
|
|
308
|
-
export declare class TestTransformer extends AbstractTransformer<TestModel, TestView, TestBody> {
|
|
309
|
-
/**
|
|
310
|
-
* @override
|
|
311
|
-
*/
|
|
312
|
-
modelAsView(model: TestModel, hasCores?: boolean): TestView;
|
|
313
|
-
/**
|
|
314
|
-
* @override
|
|
315
|
-
*/
|
|
316
|
-
bodyToModel(body: TestBody, isCreate?: boolean): TestModel;
|
|
317
|
-
}
|
|
318
|
-
/**
|
|
319
|
-
* export of default instance
|
|
320
|
-
*/
|
|
321
|
-
export declare const $trans: {
|
|
322
|
-
tenant: TenantTransformer;
|
|
323
|
-
asset: AssetTransformer;
|
|
324
|
-
contract: ContractTransformer;
|
|
325
|
-
install: InstallTransformer;
|
|
326
|
-
invite: InviteTransformer;
|
|
327
|
-
rental: RentalTransformer;
|
|
328
|
-
memo: MemoTransformer;
|
|
329
|
-
push: PushNotificationTransformer;
|
|
330
|
-
history: HistoryTransformer;
|
|
331
|
-
test: TestTransformer;
|
|
332
|
-
};
|