auth-mn 0.1.9 → 1.0.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/find.d.ts DELETED
@@ -1,193 +0,0 @@
1
- type UserT = {
2
- _id?: string;
3
- user_id?: number;
4
- user_name?: string;
5
- nick_name?: string;
6
- exp?: number;
7
- primary_email?: string;
8
- primary_phone?: string;
9
- emails?: Array<{
10
- email: string;
11
- verified: boolean;
12
- primary: boolean;
13
- }>;
14
- phone_numbers?: Array<{
15
- number: string;
16
- verified: boolean;
17
- primary: boolean;
18
- }>;
19
- auth_profiles?: {
20
- facebook_id?: string;
21
- google_id?: string;
22
- steam_id?: string;
23
- apple_id?: string;
24
- twitter_id?: string;
25
- monpay_id?: string;
26
- toki_id?: string;
27
- social_id?: string;
28
- hipay_id?: string;
29
- digi_id?: string;
30
- };
31
- profile_image_url?: string;
32
- date_of_birth?: Date;
33
- gender?: "MEN" | "WOMEN";
34
- sign_up_date?: Date;
35
- last_login?: Date;
36
- wallet_id?: string;
37
- wallet_key?: string;
38
- preferences?: {
39
- language?: string;
40
- notifications?: boolean;
41
- };
42
- status?: {
43
- is_active?: boolean;
44
- is_banned?: boolean;
45
- verified?: boolean;
46
- };
47
- security?: {
48
- password_hash?: string;
49
- two_factor_enabled?: boolean;
50
- last_password_change?: Date;
51
- };
52
- verify_info?: {
53
- first_name?: string;
54
- last_name?: string;
55
- born_date?: Date;
56
- national_id?: string;
57
- };
58
- dynamic_info?: {
59
- [key: string]: any;
60
- };
61
- apps?: {
62
- app_name: string;
63
- app_id: string;
64
- device_id: string;
65
- }[];
66
- createdAt?: Date;
67
- updatedAt?: Date;
68
- };
69
- type MerchantT = {
70
- _id?: string;
71
- user_id: number;
72
- user_name?: string;
73
- phone_number?: string;
74
- user_role?: "merchant" | "sub-merchant";
75
- avatar?: string;
76
- authority?: string[];
77
- user_email?: string;
78
- password?: string;
79
- show_router?: string[];
80
- show_id?: string[];
81
- merchant: {
82
- toki_id: string;
83
- hipay: string;
84
- };
85
- wallet_id?: string;
86
- wallet_key?: string;
87
- delFlg?: boolean;
88
- createdAt?: Date;
89
- updatedAt?: Date;
90
- };
91
- type AdminT = {
92
- _id?: string;
93
- user_id?: number;
94
- user_name?: string;
95
- phone_number?: number;
96
- user_role?: "admin" | "sub-admin" | "super-admin";
97
- avatar?: string;
98
- authority?: string[];
99
- user_email?: string;
100
- password?: string;
101
- show_router?: string[];
102
- show_id?: string[];
103
- delFlg?: boolean;
104
- createdAt?: Date;
105
- updatedAt?: Date;
106
- };
107
- type ClientT = {
108
- _id?: string;
109
- user_id?: number;
110
- user_name?: string;
111
- phone_number?: number;
112
- user_role?: "crm" | "sub-crm";
113
- avatar?: string;
114
- authority?: string[];
115
- user_email?: string;
116
- password?: string;
117
- show_router?: string[];
118
- show_id?: string[];
119
- RefundFun?: boolean;
120
- delFlg?: boolean;
121
- createdAt?: Date;
122
- updatedAt?: Date;
123
- };
124
- type CrmT = {
125
- _id?: string;
126
- user_id?: number;
127
- user_name?: string;
128
- phone_number?: number;
129
- user_role?: "crm" | "sub-crm";
130
- avatar?: string;
131
- authority?: string[];
132
- user_email?: string;
133
- password?: string;
134
- show_router?: string[];
135
- show_id?: string[];
136
- RefundFun?: boolean;
137
- delFlg?: boolean;
138
- createdAt?: Date;
139
- updatedAt?: Date;
140
- };
141
- export declare const USER: (body: UserT) => Promise<{
142
- success: boolean;
143
- data: UserT[];
144
- message: string;
145
- }>;
146
- export declare const MERCHANT: (body: MerchantT) => Promise<{
147
- success: boolean;
148
- data: MerchantT[];
149
- message: string;
150
- }>;
151
- export declare const ADMIN: (body: AdminT) => Promise<{
152
- success: boolean;
153
- data: AdminT[];
154
- message: string;
155
- }>;
156
- export declare const CLIENT: (body: ClientT) => Promise<{
157
- success: boolean;
158
- data: ClientT[];
159
- message: string;
160
- }>;
161
- export declare const CRM: (body: CrmT) => Promise<{
162
- success: boolean;
163
- data: CrmT[];
164
- message: string;
165
- }>;
166
- declare const _default: {
167
- USER: (body: UserT) => Promise<{
168
- success: boolean;
169
- data: UserT[];
170
- message: string;
171
- }>;
172
- MERCHANT: (body: MerchantT) => Promise<{
173
- success: boolean;
174
- data: MerchantT[];
175
- message: string;
176
- }>;
177
- ADMIN: (body: AdminT) => Promise<{
178
- success: boolean;
179
- data: AdminT[];
180
- message: string;
181
- }>;
182
- CLIENT: (body: ClientT) => Promise<{
183
- success: boolean;
184
- data: ClientT[];
185
- message: string;
186
- }>;
187
- CRM: (body: CrmT) => Promise<{
188
- success: boolean;
189
- data: CrmT[];
190
- message: string;
191
- }>;
192
- };
193
- export default _default;
package/dist/find.js DELETED
@@ -1,252 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CRM = exports.CLIENT = exports.ADMIN = exports.MERCHANT = exports.USER = void 0;
4
- const _1 = require(".");
5
- const auth_1 = require("./auth");
6
- const axios_master_1 = require("axios-master");
7
- const USER = async (body) => {
8
- var _a;
9
- try {
10
- const result = await (0, axios_master_1.axiosMasterLogger)({
11
- method: "POST",
12
- maxBodyLength: Infinity,
13
- url: `${_1.config.hosts.MAIN}/main/v1/auth/support/find/user`,
14
- headers: {
15
- Accept: "application/json",
16
- "Content-Type": "application/json",
17
- Authorization: `Bearer ${_1.config.token}`
18
- },
19
- data: body
20
- }, {
21
- name: "support/find/user",
22
- timeout: 20000,
23
- retryFunction: auth_1.getToken,
24
- shouldRetry: true,
25
- shouldRetryStatus: [401, 400],
26
- logger(data) {
27
- if (_1.config.logger) {
28
- console.log({
29
- time: data.json.time,
30
- request: data.json.request,
31
- response: `${data.json.response}`,
32
- responseBody: data.json.responseBody,
33
- statusCode: data.json.statusCode
34
- });
35
- }
36
- }
37
- });
38
- return { success: true, data: result.data, message: result.message };
39
- }
40
- catch (error) {
41
- const axiosError = error;
42
- if (axiosError.data) {
43
- console.log(axiosError.data);
44
- }
45
- else {
46
- console.error("Request Failed:", axiosError);
47
- }
48
- return {
49
- success: false,
50
- data: null,
51
- message: ((_a = axiosError.data) === null || _a === void 0 ? void 0 : _a.message) || ""
52
- };
53
- }
54
- };
55
- exports.USER = USER;
56
- const MERCHANT = async (body) => {
57
- var _a;
58
- try {
59
- const result = await (0, axios_master_1.axiosMasterLogger)({
60
- method: "POST",
61
- maxBodyLength: Infinity,
62
- url: `${_1.config.hosts.MAIN}/main/v1/auth/support/find/merchant`,
63
- headers: {
64
- Accept: "application/json",
65
- "Content-Type": "application/json",
66
- Authorization: `Bearer ${_1.config.token}`
67
- },
68
- data: body
69
- }, {
70
- name: "support/find/merchant",
71
- timeout: 20000,
72
- retryFunction: auth_1.getToken,
73
- shouldRetry: true,
74
- shouldRetryStatus: [401, 400],
75
- logger(data) {
76
- if (_1.config.logger) {
77
- console.log({
78
- time: data.json.time,
79
- request: data.json.request,
80
- response: `${data.json.response}`,
81
- responseBody: data.json.responseBody,
82
- statusCode: data.json.statusCode
83
- });
84
- }
85
- }
86
- });
87
- return { success: true, data: result.data, message: result.message };
88
- }
89
- catch (error) {
90
- const axiosError = error;
91
- if (axiosError.data) {
92
- console.log(axiosError.data);
93
- }
94
- else {
95
- console.error("Request Failed:", axiosError);
96
- }
97
- return {
98
- success: false,
99
- data: null,
100
- message: ((_a = axiosError.data) === null || _a === void 0 ? void 0 : _a.message) || ""
101
- };
102
- }
103
- };
104
- exports.MERCHANT = MERCHANT;
105
- const ADMIN = async (body) => {
106
- var _a;
107
- try {
108
- const result = await (0, axios_master_1.axiosMasterLogger)({
109
- method: "POST",
110
- maxBodyLength: Infinity,
111
- url: `${_1.config.hosts.MAIN}/main/v1/auth/support/find/admin`,
112
- headers: {
113
- Accept: "application/json",
114
- "Content-Type": "application/json",
115
- Authorization: `Bearer ${_1.config.token}`
116
- },
117
- data: body
118
- }, {
119
- name: "support/find/admin",
120
- timeout: 20000,
121
- retryFunction: auth_1.getToken,
122
- shouldRetry: true,
123
- shouldRetryStatus: [401, 400],
124
- logger(data) {
125
- if (_1.config.logger) {
126
- console.log({
127
- time: data.json.time,
128
- request: data.json.request,
129
- response: `${data.json.response}`,
130
- responseBody: data.json.responseBody,
131
- statusCode: data.json.statusCode
132
- });
133
- }
134
- }
135
- });
136
- return { success: true, data: result.data, message: result.message };
137
- }
138
- catch (error) {
139
- const axiosError = error;
140
- if (axiosError.data) {
141
- console.log(axiosError.data);
142
- }
143
- else {
144
- console.error("Request Failed:", axiosError);
145
- }
146
- return {
147
- success: false,
148
- data: null,
149
- message: ((_a = axiosError.data) === null || _a === void 0 ? void 0 : _a.message) || ""
150
- };
151
- }
152
- };
153
- exports.ADMIN = ADMIN;
154
- const CLIENT = async (body) => {
155
- var _a;
156
- try {
157
- const result = await (0, axios_master_1.axiosMasterLogger)({
158
- method: "POST",
159
- maxBodyLength: Infinity,
160
- url: `${_1.config.hosts.MAIN}/main/v1/auth/support/find/client`,
161
- headers: {
162
- Accept: "application/json",
163
- "Content-Type": "application/json",
164
- Authorization: `Bearer ${_1.config.token}`
165
- },
166
- data: body
167
- }, {
168
- name: "support/find/client",
169
- timeout: 20000,
170
- retryFunction: auth_1.getToken,
171
- shouldRetry: true,
172
- shouldRetryStatus: [401, 400],
173
- logger(data) {
174
- if (_1.config.logger) {
175
- console.log({
176
- time: data.json.time,
177
- request: data.json.request,
178
- response: `${data.json.response}`,
179
- responseBody: data.json.responseBody,
180
- statusCode: data.json.statusCode
181
- });
182
- }
183
- }
184
- });
185
- return { success: true, data: result.data, message: result.message };
186
- }
187
- catch (error) {
188
- const axiosError = error;
189
- if (axiosError.data) {
190
- console.log(axiosError.data);
191
- }
192
- else {
193
- console.error("Request Failed:", axiosError);
194
- }
195
- return {
196
- success: false,
197
- data: null,
198
- message: ((_a = axiosError.data) === null || _a === void 0 ? void 0 : _a.message) || ""
199
- };
200
- }
201
- };
202
- exports.CLIENT = CLIENT;
203
- const CRM = async (body) => {
204
- var _a;
205
- try {
206
- const result = await (0, axios_master_1.axiosMasterLogger)({
207
- method: "POST",
208
- maxBodyLength: Infinity,
209
- url: `${_1.config.hosts.MAIN}/main/v1/auth/support/find/crm`,
210
- headers: {
211
- Accept: "application/json",
212
- "Content-Type": "application/json",
213
- Authorization: `Bearer ${_1.config.token}`
214
- },
215
- data: body
216
- }, {
217
- name: "support/find/crm",
218
- timeout: 20000,
219
- retryFunction: auth_1.getToken,
220
- shouldRetry: true,
221
- shouldRetryStatus: [401, 400],
222
- logger(data) {
223
- if (_1.config.logger) {
224
- console.log({
225
- time: data.json.time,
226
- request: data.json.request,
227
- response: `${data.json.response}`,
228
- responseBody: data.json.responseBody,
229
- statusCode: data.json.statusCode
230
- });
231
- }
232
- }
233
- });
234
- return { success: true, data: result.data, message: result.message };
235
- }
236
- catch (error) {
237
- const axiosError = error;
238
- if (axiosError.data) {
239
- console.log(axiosError.data);
240
- }
241
- else {
242
- console.error("Request Failed:", axiosError);
243
- }
244
- return {
245
- success: false,
246
- data: null,
247
- message: ((_a = axiosError.data) === null || _a === void 0 ? void 0 : _a.message) || ""
248
- };
249
- }
250
- };
251
- exports.CRM = CRM;
252
- exports.default = { USER: exports.USER, MERCHANT: exports.MERCHANT, ADMIN: exports.ADMIN, CLIENT: exports.CLIENT, CRM: exports.CRM };