nicot-simple-user 1.1.1 → 2.0.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.
- package/AGENTS.md +216 -0
- package/dist/simple-user/i18n/i18n-dict.d.ts +2 -0
- package/dist/simple-user/i18n/i18n-dict.js +157 -0
- package/dist/simple-user/i18n/i18n-dict.js.map +1 -0
- package/dist/simple-user/i18n/i18n-init.d.ts +8 -0
- package/dist/simple-user/i18n/i18n-init.js +14 -0
- package/dist/simple-user/i18n/i18n-init.js.map +1 -0
- package/dist/simple-user/i18n/i18n-middleware.d.ts +1 -0
- package/dist/simple-user/i18n/i18n-middleware.js +8 -0
- package/dist/simple-user/i18n/i18n-middleware.js.map +1 -0
- package/dist/simple-user/i18n/i18n-setup.service.d.ts +4 -0
- package/dist/simple-user/i18n/i18n-setup.service.js +26 -0
- package/dist/simple-user/i18n/i18n-setup.service.js.map +1 -0
- package/dist/simple-user/i18n/index.d.ts +3 -0
- package/dist/simple-user/i18n/index.js +20 -0
- package/dist/simple-user/i18n/index.js.map +1 -0
- package/dist/simple-user/index.d.ts +1 -0
- package/dist/simple-user/index.js +3 -0
- package/dist/simple-user/index.js.map +1 -1
- package/dist/simple-user/login/login.controller.d.ts +3 -3
- package/dist/simple-user/login/login.controller.js +10 -8
- package/dist/simple-user/login/login.controller.js.map +1 -1
- package/dist/simple-user/options.d.ts +4 -2
- package/dist/simple-user/send-code/decorators.d.ts +1 -0
- package/dist/simple-user/send-code/decorators.js +4 -2
- package/dist/simple-user/send-code/decorators.js.map +1 -1
- package/dist/simple-user/send-code/send-code.controller.js +3 -0
- package/dist/simple-user/send-code/send-code.controller.js.map +1 -1
- package/dist/simple-user/send-code/send-code.dto.d.ts +10 -1
- package/dist/simple-user/send-code/send-code.dto.js +38 -3
- package/dist/simple-user/send-code/send-code.dto.js.map +1 -1
- package/dist/simple-user/send-code/send-code.service.js +33 -13
- package/dist/simple-user/send-code/send-code.service.js.map +1 -1
- package/dist/simple-user/simple-user/change-mobile.dto.d.ts +3 -0
- package/dist/simple-user/simple-user/change-mobile.dto.js +12 -0
- package/dist/simple-user/simple-user/change-mobile.dto.js.map +1 -0
- package/dist/simple-user/simple-user/contact.dto.d.ts +16 -0
- package/dist/simple-user/simple-user/contact.dto.js +88 -0
- package/dist/simple-user/simple-user/contact.dto.js.map +1 -0
- package/dist/simple-user/simple-user/login.dto.d.ts +2 -2
- package/dist/simple-user/simple-user/login.dto.js +3 -3
- package/dist/simple-user/simple-user/login.dto.js.map +1 -1
- package/dist/simple-user/simple-user/mobile.dto.d.ts +6 -0
- package/dist/simple-user/simple-user/mobile.dto.js +47 -0
- package/dist/simple-user/simple-user/mobile.dto.js.map +1 -0
- package/dist/simple-user/simple-user/reset-password.dto.d.ts +2 -2
- package/dist/simple-user/simple-user/reset-password.dto.js +2 -2
- package/dist/simple-user/simple-user/reset-password.dto.js.map +1 -1
- package/dist/simple-user/simple-user/simple-user.service.d.ts +9 -4
- package/dist/simple-user/simple-user/simple-user.service.js +107 -65
- package/dist/simple-user/simple-user/simple-user.service.js.map +1 -1
- package/dist/simple-user/simple-user.entity.d.ts +3 -1
- package/dist/simple-user/simple-user.entity.js +19 -4
- package/dist/simple-user/simple-user.entity.js.map +1 -1
- package/dist/simple-user/simple-user.module.js +13 -2
- package/dist/simple-user/simple-user.module.js.map +1 -1
- package/dist/simple-user/user-center/user-center.controller.d.ts +2 -0
- package/dist/simple-user/user-center/user-center.controller.js +20 -0
- package/dist/simple-user/user-center/user-center.controller.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +3 -2
- package/test/app-e2e-v2.spec.ts +621 -0
- package/test/app-e2e.spec.ts +3 -0
- package/test/docker-compose.yml +14 -0
- package/test/i18n.spec.ts +287 -0
package/AGENTS.md
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
# 注意事项(AGENTS.md)
|
|
2
|
+
|
|
3
|
+
本文件定义 nesties / nicot 后端项目中的通用工程规范与红线规则。
|
|
4
|
+
所有规则均为强制性规范,不得以“方便”“省代码”“习惯不同”为由绕过。
|
|
5
|
+
|
|
6
|
+
本规范适用于所有基于 NestJS + nicot + nesties 构建的后端项目。
|
|
7
|
+
|
|
8
|
+
## 项目定位与基本原则
|
|
9
|
+
|
|
10
|
+
- 本项目为标准后端 API 服务
|
|
11
|
+
- 对外接口以 DTO 作为唯一契约形式
|
|
12
|
+
- 明确区分:
|
|
13
|
+
- 接口契约(DTO)
|
|
14
|
+
- Controller(参数接收与返回)
|
|
15
|
+
- Service(业务编排)
|
|
16
|
+
- 基础设施(外部系统、数据库、缓存等)
|
|
17
|
+
|
|
18
|
+
核心原则:
|
|
19
|
+
|
|
20
|
+
- 显式优于隐式
|
|
21
|
+
- 稳定性优于省代码
|
|
22
|
+
- 契约优于实现细节
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## Controller 层规范
|
|
26
|
+
|
|
27
|
+
- Controller 层只负责:
|
|
28
|
+
- 接收参数(通过 DTO)
|
|
29
|
+
- 返回标准返回结构(通过 DTO)
|
|
30
|
+
- Controller 层禁止:
|
|
31
|
+
- 编写业务逻辑
|
|
32
|
+
- 自行解析、转换输入参数
|
|
33
|
+
- 返回未定义的结构或裸对象
|
|
34
|
+
- 将外部系统 / 数据库实体的原始结构直接暴露给前端
|
|
35
|
+
|
|
36
|
+
Controller 必须保持“薄”,所有流程与判断应下沉到 Service。
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
## DTO 与接口规范(必须遵守)
|
|
40
|
+
|
|
41
|
+
DTO 是后端接口的对外契约,而非简单的类型工具。
|
|
42
|
+
所有 DTO 相关规则均为强制性规范。
|
|
43
|
+
|
|
44
|
+
### 输入 DTO(Query / Body 通用规则)
|
|
45
|
+
|
|
46
|
+
- 所有接口的 Query 和 Body:
|
|
47
|
+
- 必须定义为 DTO 类
|
|
48
|
+
- 必须放在对应模块的 `*.dto.ts` 文件中
|
|
49
|
+
- 必须携带:
|
|
50
|
+
- class-validator 装饰器
|
|
51
|
+
- ApiProperty(或变体)装饰器
|
|
52
|
+
- DTO 作为接口输入时:
|
|
53
|
+
- Query 使用 `@DataQuery()`
|
|
54
|
+
- Body 使用 `@DataBody()`
|
|
55
|
+
|
|
56
|
+
禁止事项:
|
|
57
|
+
|
|
58
|
+
- 禁止使用 `@Query()` / `@Body()` 直接接收原始对象
|
|
59
|
+
- 禁止使用 `any` 作为接口输入类型
|
|
60
|
+
- 禁止在 Controller 中自行解析、转换输入字段
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
### Query DTO 额外约束(重要)
|
|
64
|
+
|
|
65
|
+
#### 数据结构约束
|
|
66
|
+
|
|
67
|
+
- Query DTO 只能是一层扁平结构
|
|
68
|
+
- 不允许出现任何嵌套结构
|
|
69
|
+
|
|
70
|
+
禁止使用:
|
|
71
|
+
|
|
72
|
+
- 对象字段
|
|
73
|
+
- 数组字段
|
|
74
|
+
- Map / Record
|
|
75
|
+
- 任意嵌套 DTO
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
#### 字段类型约束
|
|
79
|
+
|
|
80
|
+
Query DTO 中的字段类型仅允许:
|
|
81
|
+
|
|
82
|
+
- string
|
|
83
|
+
- number
|
|
84
|
+
- Date
|
|
85
|
+
- enum(见 enum 使用规范)
|
|
86
|
+
|
|
87
|
+
禁止使用:
|
|
88
|
+
|
|
89
|
+
- boolean
|
|
90
|
+
- object
|
|
91
|
+
- array
|
|
92
|
+
- union / intersection
|
|
93
|
+
- 任意自定义复杂类型
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
#### Query 中的布尔语义(强制规则)
|
|
97
|
+
|
|
98
|
+
- Query 中不允许出现 boolean 类型字段
|
|
99
|
+
- 所有布尔语义必须使用 number 类型的 0 / 1 表示
|
|
100
|
+
- 布尔字段必须通过 ApiProperty 声明 enum 为 [0, 1]
|
|
101
|
+
- 在 Service 层解析时:
|
|
102
|
+
- 必须使用 nesties(如果项目含有 nicot 则用 nicot)提供的 `parseBool(v: any): boolean`
|
|
103
|
+
- 禁止自行判断布尔语义(例如强转、比较字符串等)
|
|
104
|
+
|
|
105
|
+
该规则用于保证 Swagger 行为一致、URL 参数可预测、自动化调用稳定。
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
### enum 使用规范(强制)
|
|
109
|
+
|
|
110
|
+
该规则适用于 Query / Body / Response。
|
|
111
|
+
|
|
112
|
+
#### enum 的定义位置
|
|
113
|
+
|
|
114
|
+
- enum 仅在一个 DTO 文件中使用:
|
|
115
|
+
- 允许定义在该 DTO 文件中
|
|
116
|
+
- enum 横跨多个 DTO 或多个文件使用:
|
|
117
|
+
- 必须定义在独立的 `*.enum.ts` 文件中
|
|
118
|
+
- 由 DTO 显式引用
|
|
119
|
+
|
|
120
|
+
禁止事项:
|
|
121
|
+
|
|
122
|
+
- 禁止跨文件复制 enum 定义
|
|
123
|
+
- 禁止在多个 DTO 文件中各自定义同名 enum
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
#### enum 的定义形式(严格约束)
|
|
127
|
+
|
|
128
|
+
- enum 必须使用字符串 enum
|
|
129
|
+
- enum 的 key 与 value 必须完全一致
|
|
130
|
+
- 命名使用 UpperCamelCase
|
|
131
|
+
|
|
132
|
+
允许形式示例(语义说明):
|
|
133
|
+
|
|
134
|
+
- Foo = 'Foo'
|
|
135
|
+
- PendingReview = 'PendingReview'
|
|
136
|
+
|
|
137
|
+
禁止事项:
|
|
138
|
+
|
|
139
|
+
- 禁止使用数字 enum
|
|
140
|
+
- 禁止使用数字或字符串充当“伪 enum”
|
|
141
|
+
- 禁止 key 与 value 不一致
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
### 返回 DTO 规范
|
|
145
|
+
|
|
146
|
+
- 所有接口返回值必须定义 DTO 类
|
|
147
|
+
- 禁止直接返回外部系统、数据库实体或内部模型的原始结构
|
|
148
|
+
- 即使字段同名,也必须显式映射后返回
|
|
149
|
+
- 返回值必须通过标准返回结构封装,不允许随意返回裸对象
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
### DTO 复用规则
|
|
153
|
+
|
|
154
|
+
- DTO 的复用只允许发生在“结构层”,不得发生在“接口契约层”
|
|
155
|
+
- 允许定义公共基础 DTO 用于字段复用
|
|
156
|
+
- 接口使用的 DTO 必须定义在各自模块内
|
|
157
|
+
|
|
158
|
+
强制约束:
|
|
159
|
+
|
|
160
|
+
- Controller 禁止直接引用公共 DTO 作为 Query / Body / Response 类型
|
|
161
|
+
- 公共 DTO 不代表接口契约
|
|
162
|
+
- 不允许通过“字段看起来一样”隐式耦合不同接口或模块
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
### DTO 禁用项(重要)
|
|
166
|
+
|
|
167
|
+
- 禁止使用 `@nestjs/mapped-types`
|
|
168
|
+
- 包括但不限于:PartialType、PickType、OmitType、IntersectionType
|
|
169
|
+
|
|
170
|
+
原因包括但不限于:
|
|
171
|
+
|
|
172
|
+
- Swagger 行为不稳定
|
|
173
|
+
- 校验规则与运行时行为不一致
|
|
174
|
+
- 容易引入隐式接口契约继承
|
|
175
|
+
|
|
176
|
+
如需字段复用:
|
|
177
|
+
|
|
178
|
+
- 必须显式定义 DTO 类
|
|
179
|
+
- 使用组合或显式继承完成
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
## HTTP 与 Swagger 规范
|
|
183
|
+
|
|
184
|
+
- 所有非 GET 接口必须显式指定 `@HttpCode(200)`
|
|
185
|
+
- 所有接口必须包含 `@ApiOperation`
|
|
186
|
+
- summary:接口作用(必填)
|
|
187
|
+
- description:注意事项(可选)
|
|
188
|
+
- 不需要在 Controller 中重复写 `@ApiQuery` 或 `@ApiBody`
|
|
189
|
+
- 参数相关 Swagger 信息应由 DTO 与参数装饰器提供
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
## 分层与依赖约束
|
|
193
|
+
|
|
194
|
+
- Controller 层:
|
|
195
|
+
- 只处理接口输入输出
|
|
196
|
+
- Service 层:
|
|
197
|
+
- 负责业务编排与流程控制
|
|
198
|
+
- 基础设施层:
|
|
199
|
+
- 负责外部系统与底层能力(数据库、缓存、消息等)
|
|
200
|
+
|
|
201
|
+
禁止出现跨层污染或职责混用,例如:
|
|
202
|
+
|
|
203
|
+
- Controller 直接访问基础设施
|
|
204
|
+
- Controller / Service 将内部实体原样作为响应返回
|
|
205
|
+
- 将输入解析逻辑散落在 Controller 中
|
|
206
|
+
|
|
207
|
+
## 关于 lint
|
|
208
|
+
|
|
209
|
+
- 完成每次任务之后,无论 lint 结果如何,不要尝试手动修复 lint 错误,而是先运行一次 npm run lint 来自动修复大部分问题。
|
|
210
|
+
|
|
211
|
+
## 参考(只读)
|
|
212
|
+
|
|
213
|
+
以下项目用于理解 nesties 的行为,不得直接修改或复制实现:
|
|
214
|
+
|
|
215
|
+
- nesties: /home/nanahira/test/nesties
|
|
216
|
+
- nicot: /home/nanahira/test/nicot
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SIMPLE_USER_LOCALES = exports.SIMPLE_USER_I18N_DICT = void 0;
|
|
4
|
+
exports.SIMPLE_USER_I18N_DICT = {
|
|
5
|
+
en: {
|
|
6
|
+
user_not_found: 'User not found.',
|
|
7
|
+
too_many_password_attempts: 'Too many failed password attempts. Please wait before retrying.',
|
|
8
|
+
invalid_password: 'Invalid password.',
|
|
9
|
+
user_not_exist_provide_code: 'User does not exist. Please provide code to create new user.',
|
|
10
|
+
current_password_incorrect: 'Current password is incorrect.',
|
|
11
|
+
send_code_cooldown: 'Please wait before requesting another code',
|
|
12
|
+
too_many_code_attempts: 'Too many invalid code attempts, please try again later',
|
|
13
|
+
invalid_code: 'Invalid verification code',
|
|
14
|
+
},
|
|
15
|
+
zh: {
|
|
16
|
+
user_not_found: '用户不存在。',
|
|
17
|
+
too_many_password_attempts: '密码尝试次数过多,请稍后再试。',
|
|
18
|
+
invalid_password: '密码错误。',
|
|
19
|
+
user_not_exist_provide_code: '用户不存在,请提供验证码以创建新用户。',
|
|
20
|
+
current_password_incorrect: '当前密码不正确。',
|
|
21
|
+
send_code_cooldown: '请稍后再请求新的验证码',
|
|
22
|
+
too_many_code_attempts: '验证码尝试次数过多,请稍后再试',
|
|
23
|
+
invalid_code: '验证码无效',
|
|
24
|
+
},
|
|
25
|
+
'zh-Hant': {
|
|
26
|
+
user_not_found: '使用者不存在。',
|
|
27
|
+
too_many_password_attempts: '密碼嘗試次數過多,請稍後再試。',
|
|
28
|
+
invalid_password: '密碼錯誤。',
|
|
29
|
+
user_not_exist_provide_code: '使用者不存在,請提供驗證碼以建立新使用者。',
|
|
30
|
+
current_password_incorrect: '目前密碼不正確。',
|
|
31
|
+
send_code_cooldown: '請稍後再請求新的驗證碼',
|
|
32
|
+
too_many_code_attempts: '驗證碼嘗試次數過多,請稍後再試',
|
|
33
|
+
invalid_code: '驗證碼無效',
|
|
34
|
+
},
|
|
35
|
+
ja: {
|
|
36
|
+
user_not_found: 'ユーザーが見つかりません。',
|
|
37
|
+
too_many_password_attempts: 'パスワードの試行回数が多すぎます。しばらくしてからやり直してください。',
|
|
38
|
+
invalid_password: 'パスワードが正しくありません。',
|
|
39
|
+
user_not_exist_provide_code: 'ユーザーが存在しません。新規ユーザーを作成するにはコードを入力してください。',
|
|
40
|
+
current_password_incorrect: '現在のパスワードが正しくありません。',
|
|
41
|
+
send_code_cooldown: '新しいコードを要求する前にお待ちください',
|
|
42
|
+
too_many_code_attempts: 'コードの試行回数が多すぎます。しばらくしてからやり直してください',
|
|
43
|
+
invalid_code: '無効な認証コード',
|
|
44
|
+
},
|
|
45
|
+
ko: {
|
|
46
|
+
user_not_found: '사용자를 찾을 수 없습니다.',
|
|
47
|
+
too_many_password_attempts: '비밀번호 시도 횟수가 너무 많습니다. 잠시 후 다시 시도해주세요.',
|
|
48
|
+
invalid_password: '잘못된 비밀번호입니다.',
|
|
49
|
+
user_not_exist_provide_code: '사용자가 존재하지 않습니다. 새 사용자를 만들려면 인증 코드를 입력해주세요.',
|
|
50
|
+
current_password_incorrect: '현재 비밀번호가 올바르지 않습니다.',
|
|
51
|
+
send_code_cooldown: '새 인증 코드를 요청하기 전에 잠시 기다려주세요',
|
|
52
|
+
too_many_code_attempts: '인증 코드 시도 횟수가 너무 많습니다. 잠시 후 다시 시도해주세요',
|
|
53
|
+
invalid_code: '유효하지 않은 인증 코드',
|
|
54
|
+
},
|
|
55
|
+
fr: {
|
|
56
|
+
user_not_found: 'Utilisateur introuvable.',
|
|
57
|
+
too_many_password_attempts: 'Trop de tentatives de mot de passe échouées. Veuillez patienter avant de réessayer.',
|
|
58
|
+
invalid_password: 'Mot de passe invalide.',
|
|
59
|
+
user_not_exist_provide_code: "L'utilisateur n'existe pas. Veuillez fournir un code pour créer un nouvel utilisateur.",
|
|
60
|
+
current_password_incorrect: 'Le mot de passe actuel est incorrect.',
|
|
61
|
+
send_code_cooldown: 'Veuillez patienter avant de demander un nouveau code',
|
|
62
|
+
too_many_code_attempts: 'Trop de tentatives de code invalides, veuillez réessayer plus tard',
|
|
63
|
+
invalid_code: 'Code de vérification invalide',
|
|
64
|
+
},
|
|
65
|
+
de: {
|
|
66
|
+
user_not_found: 'Benutzer nicht gefunden.',
|
|
67
|
+
too_many_password_attempts: 'Zu viele fehlgeschlagene Passwortversuche. Bitte warten Sie, bevor Sie es erneut versuchen.',
|
|
68
|
+
invalid_password: 'Ungültiges Passwort.',
|
|
69
|
+
user_not_exist_provide_code: 'Benutzer existiert nicht. Bitte geben Sie einen Code ein, um einen neuen Benutzer zu erstellen.',
|
|
70
|
+
current_password_incorrect: 'Das aktuelle Passwort ist falsch.',
|
|
71
|
+
send_code_cooldown: 'Bitte warten Sie, bevor Sie einen neuen Code anfordern',
|
|
72
|
+
too_many_code_attempts: 'Zu viele ungültige Code-Versuche, bitte versuchen Sie es später erneut',
|
|
73
|
+
invalid_code: 'Ungültiger Bestätigungscode',
|
|
74
|
+
},
|
|
75
|
+
es: {
|
|
76
|
+
user_not_found: 'Usuario no encontrado.',
|
|
77
|
+
too_many_password_attempts: 'Demasiados intentos fallidos de contraseña. Por favor, espere antes de reintentar.',
|
|
78
|
+
invalid_password: 'Contraseña no válida.',
|
|
79
|
+
user_not_exist_provide_code: 'El usuario no existe. Por favor, proporcione un código para crear un nuevo usuario.',
|
|
80
|
+
current_password_incorrect: 'La contraseña actual es incorrecta.',
|
|
81
|
+
send_code_cooldown: 'Por favor, espere antes de solicitar otro código',
|
|
82
|
+
too_many_code_attempts: 'Demasiados intentos de código no válidos, por favor intente más tarde',
|
|
83
|
+
invalid_code: 'Código de verificación no válido',
|
|
84
|
+
},
|
|
85
|
+
pt: {
|
|
86
|
+
user_not_found: 'Usuário não encontrado.',
|
|
87
|
+
too_many_password_attempts: 'Muitas tentativas de senha falharam. Por favor, aguarde antes de tentar novamente.',
|
|
88
|
+
invalid_password: 'Senha inválida.',
|
|
89
|
+
user_not_exist_provide_code: 'O usuário não existe. Por favor, forneça um código para criar um novo usuário.',
|
|
90
|
+
current_password_incorrect: 'A senha atual está incorreta.',
|
|
91
|
+
send_code_cooldown: 'Por favor, aguarde antes de solicitar outro código',
|
|
92
|
+
too_many_code_attempts: 'Muitas tentativas de código inválidas, por favor tente novamente mais tarde',
|
|
93
|
+
invalid_code: 'Código de verificação inválido',
|
|
94
|
+
},
|
|
95
|
+
ru: {
|
|
96
|
+
user_not_found: 'Пользователь не найден.',
|
|
97
|
+
too_many_password_attempts: 'Слишком много неудачных попыток ввода пароля. Пожалуйста, подождите перед повторной попыткой.',
|
|
98
|
+
invalid_password: 'Неверный пароль.',
|
|
99
|
+
user_not_exist_provide_code: 'Пользователь не существует. Пожалуйста, введите код для создания нового пользователя.',
|
|
100
|
+
current_password_incorrect: 'Текущий пароль неверен.',
|
|
101
|
+
send_code_cooldown: 'Пожалуйста, подождите перед запросом нового кода',
|
|
102
|
+
too_many_code_attempts: 'Слишком много неудачных попыток ввода кода, пожалуйста, попробуйте позже',
|
|
103
|
+
invalid_code: 'Недействительный код подтверждения',
|
|
104
|
+
},
|
|
105
|
+
ar: {
|
|
106
|
+
user_not_found: 'المستخدم غير موجود.',
|
|
107
|
+
too_many_password_attempts: 'محاولات كلمة المرور الفاشلة كثيرة جداً. يرجى الانتظار قبل المحاولة مرة أخرى.',
|
|
108
|
+
invalid_password: 'كلمة المرور غير صحيحة.',
|
|
109
|
+
user_not_exist_provide_code: 'المستخدم غير موجود. يرجى تقديم رمز التحقق لإنشاء مستخدم جديد.',
|
|
110
|
+
current_password_incorrect: 'كلمة المرور الحالية غير صحيحة.',
|
|
111
|
+
send_code_cooldown: 'يرجى الانتظار قبل طلب رمز جديد',
|
|
112
|
+
too_many_code_attempts: 'محاولات الرمز غير الصالحة كثيرة جداً، يرجى المحاولة لاحقاً',
|
|
113
|
+
invalid_code: 'رمز التحقق غير صالح',
|
|
114
|
+
},
|
|
115
|
+
it: {
|
|
116
|
+
user_not_found: 'Utente non trovato.',
|
|
117
|
+
too_many_password_attempts: 'Troppi tentativi di password falliti. Si prega di attendere prima di riprovare.',
|
|
118
|
+
invalid_password: 'Password non valida.',
|
|
119
|
+
user_not_exist_provide_code: "L'utente non esiste. Si prega di fornire un codice per creare un nuovo utente.",
|
|
120
|
+
current_password_incorrect: 'La password attuale non è corretta.',
|
|
121
|
+
send_code_cooldown: 'Si prega di attendere prima di richiedere un nuovo codice',
|
|
122
|
+
too_many_code_attempts: 'Troppi tentativi di codice non validi, si prega di riprovare più tardi',
|
|
123
|
+
invalid_code: 'Codice di verifica non valido',
|
|
124
|
+
},
|
|
125
|
+
th: {
|
|
126
|
+
user_not_found: 'ไม่พบผู้ใช้',
|
|
127
|
+
too_many_password_attempts: 'พยายามใส่รหัสผ่านผิดมากเกินไป กรุณารอสักครู่แล้วลองใหม่',
|
|
128
|
+
invalid_password: 'รหัสผ่านไม่ถูกต้อง',
|
|
129
|
+
user_not_exist_provide_code: 'ผู้ใช้ไม่มีอยู่ กรุณาใส่รหัสยืนยันเพื่อสร้างผู้ใช้ใหม่',
|
|
130
|
+
current_password_incorrect: 'รหัสผ่านปัจจุบันไม่ถูกต้อง',
|
|
131
|
+
send_code_cooldown: 'กรุณารอสักครู่ก่อนขอรหัสยืนยันใหม่',
|
|
132
|
+
too_many_code_attempts: 'พยายามใส่รหัสยืนยันผิดมากเกินไป กรุณาลองใหม่ภายหลัง',
|
|
133
|
+
invalid_code: 'รหัสยืนยันไม่ถูกต้อง',
|
|
134
|
+
},
|
|
135
|
+
vi: {
|
|
136
|
+
user_not_found: 'Không tìm thấy người dùng.',
|
|
137
|
+
too_many_password_attempts: 'Quá nhiều lần nhập mật khẩu sai. Vui lòng đợi trước khi thử lại.',
|
|
138
|
+
invalid_password: 'Mật khẩu không đúng.',
|
|
139
|
+
user_not_exist_provide_code: 'Người dùng không tồn tại. Vui lòng cung cấp mã xác minh để tạo người dùng mới.',
|
|
140
|
+
current_password_incorrect: 'Mật khẩu hiện tại không đúng.',
|
|
141
|
+
send_code_cooldown: 'Vui lòng đợi trước khi yêu cầu mã mới',
|
|
142
|
+
too_many_code_attempts: 'Quá nhiều lần nhập mã không hợp lệ, vui lòng thử lại sau',
|
|
143
|
+
invalid_code: 'Mã xác minh không hợp lệ',
|
|
144
|
+
},
|
|
145
|
+
tr: {
|
|
146
|
+
user_not_found: 'Kullanıcı bulunamadı.',
|
|
147
|
+
too_many_password_attempts: 'Çok fazla başarısız şifre denemesi. Lütfen tekrar denemeden önce bekleyin.',
|
|
148
|
+
invalid_password: 'Geçersiz şifre.',
|
|
149
|
+
user_not_exist_provide_code: 'Kullanıcı mevcut değil. Yeni kullanıcı oluşturmak için lütfen bir kod girin.',
|
|
150
|
+
current_password_incorrect: 'Mevcut şifre yanlış.',
|
|
151
|
+
send_code_cooldown: 'Yeni bir kod istemeden önce lütfen bekleyin',
|
|
152
|
+
too_many_code_attempts: 'Çok fazla geçersiz kod denemesi, lütfen daha sonra tekrar deneyin',
|
|
153
|
+
invalid_code: 'Geçersiz doğrulama kodu',
|
|
154
|
+
},
|
|
155
|
+
};
|
|
156
|
+
exports.SIMPLE_USER_LOCALES = Object.keys(exports.SIMPLE_USER_I18N_DICT);
|
|
157
|
+
//# sourceMappingURL=i18n-dict.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n-dict.js","sourceRoot":"","sources":["../../../src/simple-user/i18n/i18n-dict.ts"],"names":[],"mappings":";;;AAAa,QAAA,qBAAqB,GAA2C;IAC3E,EAAE,EAAE;QACF,cAAc,EAAE,iBAAiB;QACjC,0BAA0B,EACxB,iEAAiE;QACnE,gBAAgB,EAAE,mBAAmB;QACrC,2BAA2B,EACzB,8DAA8D;QAChE,0BAA0B,EAAE,gCAAgC;QAC5D,kBAAkB,EAAE,4CAA4C;QAChE,sBAAsB,EACpB,wDAAwD;QAC1D,YAAY,EAAE,2BAA2B;KAC1C;IACD,EAAE,EAAE;QACF,cAAc,EAAE,QAAQ;QACxB,0BAA0B,EAAE,iBAAiB;QAC7C,gBAAgB,EAAE,OAAO;QACzB,2BAA2B,EAAE,qBAAqB;QAClD,0BAA0B,EAAE,UAAU;QACtC,kBAAkB,EAAE,aAAa;QACjC,sBAAsB,EAAE,iBAAiB;QACzC,YAAY,EAAE,OAAO;KACtB;IACD,SAAS,EAAE;QACT,cAAc,EAAE,SAAS;QACzB,0BAA0B,EAAE,iBAAiB;QAC7C,gBAAgB,EAAE,OAAO;QACzB,2BAA2B,EAAE,uBAAuB;QACpD,0BAA0B,EAAE,UAAU;QACtC,kBAAkB,EAAE,aAAa;QACjC,sBAAsB,EAAE,iBAAiB;QACzC,YAAY,EAAE,OAAO;KACtB;IACD,EAAE,EAAE;QACF,cAAc,EAAE,eAAe;QAC/B,0BAA0B,EACxB,qCAAqC;QACvC,gBAAgB,EAAE,iBAAiB;QACnC,2BAA2B,EACzB,wCAAwC;QAC1C,0BAA0B,EAAE,oBAAoB;QAChD,kBAAkB,EAAE,sBAAsB;QAC1C,sBAAsB,EACpB,kCAAkC;QACp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AuC;QAC3D,sBAAsB,EACpB,0DAA0D;QAC5D,YAAY,EAAE,0BAA0B;KACzC;IACD,EAAE,EAAE;QACF,cAAc,EAAE,uBAAuB;QACvC,0BAA0B,EACxB,4EAA4E;QAC9E,gBAAgB,EAAE,iBAAiB;QACnC,2BAA2B,EACzB,8EAA8E;QAChF,0BAA0B,EAAE,sBAAsB;QAClD,kBAAkB,EAAE,6CAA6C;QACjE,sBAAsB,EACpB,mEAAmE;QACrE,YAAY,EAAE,yBAAyB;KACxC;CACF,CAAC;AAEW,QAAA,mBAAmB,GAAG,MAAM,CAAC,IAAI,CAAC,6BAAqB,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const SimpleUserI18nModule: import("@nestjs/common").DynamicModule;
|
|
2
|
+
export declare const UseI18n: () => ClassDecorator & MethodDecorator;
|
|
3
|
+
export declare const SimpleUserI18nParamResolver: import("nesties").ParamResolverBase<string, import("nesties").AnyReq>;
|
|
4
|
+
export declare const SimpleUserI18nParamResolverProvider: {
|
|
5
|
+
token: string;
|
|
6
|
+
provider: import("nesties").TypedFactoryProvider<["REQUEST", typeof import("@nestjs/core").ModuleRef], string>;
|
|
7
|
+
inject: () => ParameterDecorator & PropertyDecorator;
|
|
8
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SimpleUserI18nParamResolverProvider = exports.SimpleUserI18nParamResolver = exports.UseI18n = exports.SimpleUserI18nModule = void 0;
|
|
4
|
+
const nesties_1 = require("nesties");
|
|
5
|
+
const i18n_dict_1 = require("./i18n-dict");
|
|
6
|
+
const i18n = (0, nesties_1.createI18n)({
|
|
7
|
+
locales: i18n_dict_1.SIMPLE_USER_LOCALES,
|
|
8
|
+
defaultLocale: 'en',
|
|
9
|
+
});
|
|
10
|
+
exports.SimpleUserI18nModule = i18n.I18nModule;
|
|
11
|
+
exports.UseI18n = i18n.UseI18n;
|
|
12
|
+
exports.SimpleUserI18nParamResolver = i18n.I18nParamResolver;
|
|
13
|
+
exports.SimpleUserI18nParamResolverProvider = i18n.I18nParamResolverProvider;
|
|
14
|
+
//# sourceMappingURL=i18n-init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n-init.js","sourceRoot":"","sources":["../../../src/simple-user/i18n/i18n-init.ts"],"names":[],"mappings":";;;AAAA,qCAAqC;AACrC,2CAAkD;AAElD,MAAM,IAAI,GAAG,IAAA,oBAAU,EAAC;IACtB,OAAO,EAAE,+BAAmB;IAC5B,aAAa,EAAE,IAAI;CACpB,CAAC,CAAC;AAEU,QAAA,oBAAoB,GAAG,IAAI,CAAC,UAAU,CAAC;AACvC,QAAA,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;AACvB,QAAA,2BAA2B,GAAG,IAAI,CAAC,iBAAiB,CAAC;AACrD,QAAA,mCAAmC,GAC9C,IAAI,CAAC,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SimpleUserI18nMiddleware: () => import("nfkit").I18nMiddleware<import("nesties/dist/src/i18n-module/i18n.types").I18nNesties.Ex>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SimpleUserI18nMiddleware = void 0;
|
|
4
|
+
const nesties_1 = require("nesties");
|
|
5
|
+
const i18n_dict_1 = require("./i18n-dict");
|
|
6
|
+
const SimpleUserI18nMiddleware = () => (0, nesties_1.I18nLookupMiddleware)(i18n_dict_1.SIMPLE_USER_I18N_DICT, { matchType: 'hierarchy' });
|
|
7
|
+
exports.SimpleUserI18nMiddleware = SimpleUserI18nMiddleware;
|
|
8
|
+
//# sourceMappingURL=i18n-middleware.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n-middleware.js","sourceRoot":"","sources":["../../../src/simple-user/i18n/i18n-middleware.ts"],"names":[],"mappings":";;;AAAA,qCAA+C;AAC/C,2CAAoD;AAE7C,MAAM,wBAAwB,GAAG,GAAG,EAAE,CAC3C,IAAA,8BAAoB,EAAC,iCAAqB,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC,CAAC;AAD7D,QAAA,wBAAwB,4BACqC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SimpleUserI18nSetupService = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const nesties_1 = require("nesties");
|
|
15
|
+
const i18n_middleware_1 = require("./i18n-middleware");
|
|
16
|
+
let SimpleUserI18nSetupService = class SimpleUserI18nSetupService {
|
|
17
|
+
constructor(i18nService) {
|
|
18
|
+
i18nService.middleware((0, i18n_middleware_1.SimpleUserI18nMiddleware)());
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
exports.SimpleUserI18nSetupService = SimpleUserI18nSetupService;
|
|
22
|
+
exports.SimpleUserI18nSetupService = SimpleUserI18nSetupService = __decorate([
|
|
23
|
+
(0, common_1.Injectable)(),
|
|
24
|
+
__metadata("design:paramtypes", [nesties_1.I18nService])
|
|
25
|
+
], SimpleUserI18nSetupService);
|
|
26
|
+
//# sourceMappingURL=i18n-setup.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n-setup.service.js","sourceRoot":"","sources":["../../../src/simple-user/i18n/i18n-setup.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,qCAAsC;AACtC,uDAA6D;AAGtD,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IACrC,YAAY,WAAwB;QAClC,WAAW,CAAC,UAAU,CAAC,IAAA,0CAAwB,GAAE,CAAC,CAAC;IACrD,CAAC;CACF,CAAA;AAJY,gEAA0B;qCAA1B,0BAA0B;IADtC,IAAA,mBAAU,GAAE;qCAEc,qBAAW;GADzB,0BAA0B,CAItC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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("./i18n-dict"), exports);
|
|
18
|
+
__exportStar(require("./i18n-init"), exports);
|
|
19
|
+
__exportStar(require("./i18n-setup.service"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/simple-user/i18n/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,8CAA4B;AAC5B,uDAAqC"}
|
|
@@ -3,5 +3,6 @@ export * from './simple-user.module';
|
|
|
3
3
|
export * from './simple-user/simple-user.service';
|
|
4
4
|
export * from './resolver';
|
|
5
5
|
export * from './simple-user.entity';
|
|
6
|
+
export { SimpleUserI18nMiddleware } from './i18n/i18n-middleware';
|
|
6
7
|
export * from 'aragami';
|
|
7
8
|
export * from 'nestjs-aragami';
|
|
@@ -14,11 +14,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.SimpleUserI18nMiddleware = void 0;
|
|
17
18
|
__exportStar(require("./options"), exports);
|
|
18
19
|
__exportStar(require("./simple-user.module"), exports);
|
|
19
20
|
__exportStar(require("./simple-user/simple-user.service"), exports);
|
|
20
21
|
__exportStar(require("./resolver"), exports);
|
|
21
22
|
__exportStar(require("./simple-user.entity"), exports);
|
|
23
|
+
var i18n_middleware_1 = require("./i18n/i18n-middleware");
|
|
24
|
+
Object.defineProperty(exports, "SimpleUserI18nMiddleware", { enumerable: true, get: function () { return i18n_middleware_1.SimpleUserI18nMiddleware; } });
|
|
22
25
|
__exportStar(require("aragami"), exports);
|
|
23
26
|
__exportStar(require("nestjs-aragami"), exports);
|
|
24
27
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/simple-user/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/simple-user/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,uDAAqC;AACrC,oEAAkD;AAClD,6CAA2B;AAC3B,uDAAqC;AACrC,0DAAkE;AAAzD,2HAAA,wBAAwB,OAAA;AACjC,0CAAwB;AACxB,iDAA+B"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { SimpleUserService } from '../simple-user/simple-user.service';
|
|
2
|
-
import {
|
|
2
|
+
import { ContactDto, ContactAndCodeDto } from '../simple-user/contact.dto';
|
|
3
3
|
import { LoginDto, LoginResponseDto } from '../simple-user/login.dto';
|
|
4
4
|
import { UserRiskControlContext } from '../resolver';
|
|
5
5
|
import { ResetPasswordDto } from '../simple-user/reset-password.dto';
|
|
6
6
|
export declare class LoginController {
|
|
7
7
|
private userService;
|
|
8
8
|
constructor(userService: SimpleUserService);
|
|
9
|
-
checkUserExists(dto:
|
|
9
|
+
checkUserExists(dto: ContactDto): Promise<import("nicot").GenericReturnMessageDto<{
|
|
10
10
|
exists: boolean;
|
|
11
11
|
}>>;
|
|
12
12
|
login(dto: LoginDto, rcContext: UserRiskControlContext): Promise<import("nicot").GenericReturnMessageDto<LoginResponseDto>>;
|
|
13
13
|
resetPassword(dto: ResetPasswordDto): Promise<import("nicot").BlankReturnMessageDto>;
|
|
14
|
-
unregisterWithCode(dto:
|
|
14
|
+
unregisterWithCode(dto: ContactAndCodeDto): Promise<import("nicot").BlankReturnMessageDto>;
|
|
15
15
|
}
|
|
@@ -19,17 +19,18 @@ const swagger_1 = require("@nestjs/swagger");
|
|
|
19
19
|
const simple_user_service_1 = require("../simple-user/simple-user.service");
|
|
20
20
|
const nicot_1 = require("nicot");
|
|
21
21
|
const user_exists_dto_1 = require("../simple-user/user-exists.dto");
|
|
22
|
-
const
|
|
22
|
+
const contact_dto_1 = require("../simple-user/contact.dto");
|
|
23
23
|
const login_dto_1 = require("../simple-user/login.dto");
|
|
24
24
|
const resolver_1 = require("../resolver");
|
|
25
25
|
const decorators_1 = require("../send-code/decorators");
|
|
26
26
|
const reset_password_dto_1 = require("../simple-user/reset-password.dto");
|
|
27
|
+
const i18n_init_1 = require("../i18n/i18n-init");
|
|
27
28
|
let LoginController = class LoginController {
|
|
28
29
|
constructor(userService) {
|
|
29
30
|
this.userService = userService;
|
|
30
31
|
}
|
|
31
32
|
async checkUserExists(dto) {
|
|
32
|
-
return this.userService.checkUserExists(dto
|
|
33
|
+
return this.userService.checkUserExists(dto);
|
|
33
34
|
}
|
|
34
35
|
async login(dto, rcContext) {
|
|
35
36
|
return this.userService.login(dto, rcContext);
|
|
@@ -38,20 +39,20 @@ let LoginController = class LoginController {
|
|
|
38
39
|
return this.userService.resetPassword(dto);
|
|
39
40
|
}
|
|
40
41
|
async unregisterWithCode(dto) {
|
|
41
|
-
return this.userService.
|
|
42
|
+
return this.userService.unregisterWithCode(dto);
|
|
42
43
|
}
|
|
43
44
|
};
|
|
44
45
|
exports.LoginController = LoginController;
|
|
45
46
|
__decorate([
|
|
46
47
|
(0, common_1.Get)('user-exists'),
|
|
47
48
|
(0, swagger_1.ApiOperation)({
|
|
48
|
-
summary: 'Check if a user exists by email',
|
|
49
|
+
summary: 'Check if a user exists by email or mobile',
|
|
49
50
|
}),
|
|
50
51
|
(0, nicot_1.ApiTypeResponse)(user_exists_dto_1.UserExistsDto),
|
|
51
52
|
openapi.ApiResponse({ status: 200 }),
|
|
52
53
|
__param(0, (0, nicot_1.DataQuery)()),
|
|
53
54
|
__metadata("design:type", Function),
|
|
54
|
-
__metadata("design:paramtypes", [
|
|
55
|
+
__metadata("design:paramtypes", [contact_dto_1.ContactDto]),
|
|
55
56
|
__metadata("design:returntype", Promise)
|
|
56
57
|
], LoginController.prototype, "checkUserExists", null);
|
|
57
58
|
__decorate([
|
|
@@ -75,7 +76,7 @@ __decorate([
|
|
|
75
76
|
(0, common_1.Post)('reset-password'),
|
|
76
77
|
(0, common_1.HttpCode)(200),
|
|
77
78
|
(0, swagger_1.ApiOperation)({
|
|
78
|
-
summary: 'Reset user password using email code.',
|
|
79
|
+
summary: 'Reset user password using email or mobile code.',
|
|
79
80
|
}),
|
|
80
81
|
(0, nicot_1.ApiBlankResponse)(),
|
|
81
82
|
(0, decorators_1.ApiInvalidCode)(),
|
|
@@ -89,19 +90,20 @@ __decorate([
|
|
|
89
90
|
(0, common_1.Post)('unregister-with-code'),
|
|
90
91
|
(0, common_1.HttpCode)(200),
|
|
91
92
|
(0, swagger_1.ApiOperation)({
|
|
92
|
-
summary: 'Unregister user using email code.',
|
|
93
|
+
summary: 'Unregister user using email or mobile code.',
|
|
93
94
|
}),
|
|
94
95
|
(0, nicot_1.ApiBlankResponse)(),
|
|
95
96
|
(0, decorators_1.ApiInvalidCode)(),
|
|
96
97
|
openapi.ApiResponse({ status: 200 }),
|
|
97
98
|
__param(0, (0, nicot_1.DataBody)()),
|
|
98
99
|
__metadata("design:type", Function),
|
|
99
|
-
__metadata("design:paramtypes", [
|
|
100
|
+
__metadata("design:paramtypes", [contact_dto_1.ContactAndCodeDto]),
|
|
100
101
|
__metadata("design:returntype", Promise)
|
|
101
102
|
], LoginController.prototype, "unregisterWithCode", null);
|
|
102
103
|
exports.LoginController = LoginController = __decorate([
|
|
103
104
|
(0, common_1.Controller)('login'),
|
|
104
105
|
(0, swagger_1.ApiTags)('login'),
|
|
106
|
+
(0, i18n_init_1.UseI18n)(),
|
|
105
107
|
__metadata("design:paramtypes", [simple_user_service_1.SimpleUserService])
|
|
106
108
|
], LoginController);
|
|
107
109
|
//# sourceMappingURL=login.controller.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.controller.js","sourceRoot":"","sources":["../../../src/simple-user/login/login.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAiE;AACjE,6CAAwD;AACxD,4EAAuE;AACvE,iCAMe;AACf,oEAA+D;AAC/D,
|
|
1
|
+
{"version":3,"file":"login.controller.js","sourceRoot":"","sources":["../../../src/simple-user/login/login.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAiE;AACjE,6CAAwD;AACxD,4EAAuE;AACvE,iCAMe;AACf,oEAA+D;AAC/D,4DAA2E;AAC3E,wDAAsE;AACtE,0CAIqB;AACrB,wDAAyD;AACzD,0EAAqE;AACrE,iDAA4C;AAKrC,IAAM,eAAe,GAArB,MAAM,eAAe;IAC1B,YAAoB,WAA8B;QAA9B,gBAAW,GAAX,WAAW,CAAmB;IAAG,CAAC;IAOhD,AAAN,KAAK,CAAC,eAAe,CAAc,GAAe;QAChD,OAAO,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;IAC/C,CAAC;IAYK,AAAN,KAAK,CAAC,KAAK,CACG,GAAa,EACA,SAAiC;QAE1D,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;IAChD,CAAC;IASK,AAAN,KAAK,CAAC,aAAa,CAAa,GAAqB;QACnD,OAAO,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAC7C,CAAC;IASK,AAAN,KAAK,CAAC,kBAAkB,CAAa,GAAsB;QACzD,OAAO,IAAI,CAAC,WAAW,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAClD,CAAC;CACF,CAAA;AAlDY,0CAAe;AAQpB;IALL,IAAA,YAAG,EAAC,aAAa,CAAC;IAClB,IAAA,sBAAY,EAAC;QACZ,OAAO,EAAE,2CAA2C;KACrD,CAAC;IACD,IAAA,uBAAe,EAAC,+BAAa,CAAC;;IACR,WAAA,IAAA,iBAAS,GAAE,CAAA;;qCAAM,wBAAU;;sDAEjD;AAYK;IAVL,IAAA,aAAI,GAAE;IACN,IAAA,iBAAQ,EAAC,GAAG,CAAC;IACb,IAAA,sBAAY,EAAC;QACZ,OAAO,EACL,yEAAyE;KAC5E,CAAC;IAC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