@spytecgps/nova-orm 1.0.53 → 1.0.55
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/entities/customerAttribute.d.ts +7 -0
- package/dist/entities/customerAttribute.js +28 -0
- package/dist/entities/customerAttribute.js.map +1 -1
- package/dist/entities/index.d.ts +2 -2
- package/dist/entities/index.js +2 -2
- package/dist/entities/index.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/repositories/clients/createCustomerAttribute.js +6 -1
- package/dist/repositories/clients/createCustomerAttribute.js.map +1 -1
- package/dist/repositories/clients/updateCustomerAttribute.js +6 -7
- package/dist/repositories/clients/updateCustomerAttribute.js.map +1 -1
- package/dist/repositories/users/getUsersInfoWithDevicesInfo.d.ts +4 -0
- package/dist/repositories/users/getUsersInfoWithDevicesInfo.js +54 -0
- package/dist/repositories/users/getUsersInfoWithDevicesInfo.js.map +1 -0
- package/dist/repositories/users/index.d.ts +8 -1
- package/dist/repositories/users/index.js +14 -0
- package/dist/repositories/users/index.js.map +1 -1
- package/dist/types/clients.d.ts +9 -0
- package/dist/types/clients.js +14 -1
- package/dist/types/clients.js.map +1 -1
- package/dist/types/user.d.ts +17 -0
- package/package.json +1 -1
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { CustomerAttribute } from '../../entities/customerAttribute';
|
|
2
|
+
import { oneRequiredCreateCustomerAttributeParamsAttributes, requiredCreateCustomerAttributeParamsAttributes, } from '../../types/clients';
|
|
3
|
+
import { allAttributesAreNull, anyAttributeIsNull } from '../../utils/paramsValidators';
|
|
2
4
|
export const createCustomerAttribute = async (novaDataSource, params, logger) => {
|
|
3
|
-
if (
|
|
5
|
+
if (anyAttributeIsNull(params, requiredCreateCustomerAttributeParamsAttributes) ||
|
|
6
|
+
allAttributesAreNull(params, oneRequiredCreateCustomerAttributeParamsAttributes)) {
|
|
4
7
|
logger.warn({ params }, 'ClientsRepository::createCustomerAttribute - missing required parameters');
|
|
5
8
|
return null;
|
|
6
9
|
}
|
|
@@ -10,6 +13,8 @@ export const createCustomerAttribute = async (novaDataSource, params, logger) =>
|
|
|
10
13
|
clientId: params.clientId,
|
|
11
14
|
enterprise: params.enterprise,
|
|
12
15
|
maintenanceModule: params.maintenanceModule,
|
|
16
|
+
billingMethod: params.billingMethod,
|
|
17
|
+
customerSegment: params.customerSegment,
|
|
13
18
|
};
|
|
14
19
|
return await clientConfigurationRepository.save(newCustomerAttribute);
|
|
15
20
|
}, 'ClientsRepository::createCustomerAttribute');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createCustomerAttribute.js","sourceRoot":"","sources":["../../../src/repositories/clients/createCustomerAttribute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;
|
|
1
|
+
{"version":3,"file":"createCustomerAttribute.js","sourceRoot":"","sources":["../../../src/repositories/clients/createCustomerAttribute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AAEpE,OAAO,EAEL,kDAAkD,EAClD,+CAA+C,GAChD,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAEvF,MAAM,CAAC,MAAM,uBAAuB,GAAG,KAAK,EAC1C,cAA8B,EAC9B,MAAqC,EACrC,MAAc,EACc,EAAE;IAC9B,IACE,kBAAkB,CAChB,MAAM,EACN,+CAA+C,CAChD;QACD,oBAAoB,CAClB,MAAM,EACN,kDAAkD,CACnD,EACD;QACA,MAAM,CAAC,IAAI,CACT,EAAE,MAAM,EAAE,EACV,0EAA0E,CAC3E,CAAA;QACD,OAAO,IAAI,CAAA;KACZ;IAED,OAAO,cAAc,CAAC,SAAS,CAAC,KAAK,EAAE,UAA0B,EAE/D,EAAE;QACF,MAAM,6BAA6B,GAAG,UAAU,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAA;QAEjF,MAAM,oBAAoB,GAAG;YAC3B,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,UAAU,EAAE,MAAM,CAAC,UAAU;YAC7B,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;YAC3C,aAAa,EAAE,MAAM,CAAC,aAAa;YACnC,eAAe,EAAE,MAAM,CAAC,eAAe;SACxC,CAAA;QAED,OAAO,MAAM,6BAA6B,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAA;IACvE,CAAC,EAAE,4CAA4C,CAAC,CAAA;AAClD,CAAC,CAAA"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { ClientConfiguration } from '../../entities';
|
|
2
2
|
import { CustomerAttribute } from '../../entities/customerAttribute';
|
|
3
|
+
import { oneRequiredUpdateCustomerAttributeParamsAttributes, requiredUpdateCustomerAttributeParamsAttributes, } from '../../types/clients';
|
|
4
|
+
import { allAttributesAreNull, anyAttributeIsNull } from '../../utils/paramsValidators';
|
|
3
5
|
export const updateCustomerAttribute = async (novaDataSource, params, logger) => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
logger.warn({ params }, 'ClientsRepository::updateClientConfiguration - missing required parameters');
|
|
7
|
-
return false;
|
|
8
|
-
}
|
|
9
|
-
// at least one field to update is required
|
|
10
|
-
if (params?.values?.enterprise == null && params?.values?.maintenanceModule == null) {
|
|
6
|
+
if (anyAttributeIsNull(params, requiredUpdateCustomerAttributeParamsAttributes) ||
|
|
7
|
+
allAttributesAreNull(params, oneRequiredUpdateCustomerAttributeParamsAttributes)) {
|
|
11
8
|
logger.warn({ params }, 'ClientsRepository::updateClientConfiguration - missing required parameters');
|
|
12
9
|
return false;
|
|
13
10
|
}
|
|
@@ -19,6 +16,8 @@ export const updateCustomerAttribute = async (novaDataSource, params, logger) =>
|
|
|
19
16
|
.set({
|
|
20
17
|
enterprise: params.values.enterprise,
|
|
21
18
|
maintenanceModule: params.values.maintenanceModule,
|
|
19
|
+
billingMethod: params.values.billingMethod,
|
|
20
|
+
customerSegment: params.values.customerSegment,
|
|
22
21
|
})
|
|
23
22
|
.where('clientId = :clientId', { clientId: params.filters.clientId })
|
|
24
23
|
.execute();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateCustomerAttribute.js","sourceRoot":"","sources":["../../../src/repositories/clients/updateCustomerAttribute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;
|
|
1
|
+
{"version":3,"file":"updateCustomerAttribute.js","sourceRoot":"","sources":["../../../src/repositories/clients/updateCustomerAttribute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AAEpE,OAAO,EACL,kDAAkD,EAClD,+CAA+C,GAEhD,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAEvF,MAAM,CAAC,MAAM,uBAAuB,GAAG,KAAK,EAC1C,cAA8B,EAC9B,MAAqC,EACrC,MAAc,EACI,EAAE;IACpB,IACE,kBAAkB,CAChB,MAAM,EACN,+CAA+C,CAChD;QACD,oBAAoB,CAClB,MAAM,EACN,kDAAkD,CACnD,EACD;QACA,MAAM,CAAC,IAAI,CACT,EAAE,MAAM,EAAE,EACV,4EAA4E,CAC7E,CAAA;QACD,OAAO,KAAK,CAAA;KACb;IAED,OAAO,cAAc,CAAC,SAAS,CAAC,KAAK,EAAE,UAA0B,EAAoB,EAAE;QACrF,MAAM,6BAA6B,GAAG,UAAU,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAA;QAEnF,MAAM,MAAM,GAAG,MAAM,6BAA6B;aAC/C,kBAAkB,EAAE;aACpB,MAAM,CAAC,iBAAiB,CAAC;aACzB,GAAG,CAAC;YACH,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU;YACpC,iBAAiB,EAAE,MAAM,CAAC,MAAM,CAAC,iBAAiB;YAClD,aAAa,EAAE,MAAM,CAAC,MAAM,CAAC,aAAa;YAC1C,eAAe,EAAE,MAAM,CAAC,MAAM,CAAC,eAAe;SAC/C,CAAC;aACD,KAAK,CAAC,sBAAsB,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;aACpE,OAAO,EAAE,CAAA;QAEZ,OAAO,MAAM,CAAC,QAAQ,GAAG,CAAC,CAAA;IAC5B,CAAC,EAAE,4CAA4C,CAAC,CAAA;AAClD,CAAC,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { NovaDataSource } from '../../novaDataSource';
|
|
2
|
+
import { Logger } from '../../types/logger';
|
|
3
|
+
import { GetUsersInfoWithDevicesInfoParams, UserInfoWithDevicesInfo } from '../../types/user';
|
|
4
|
+
export declare const getUsersInfoWithDevicesInfo: (novaDataSource: NovaDataSource, params: GetUsersInfoWithDevicesInfoParams, logger: Logger) => Promise<UserInfoWithDevicesInfo[]>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Device, User } from '../../entities';
|
|
2
|
+
import { Enums } from '../../types';
|
|
3
|
+
import { binaryBufferToUuidString } from '../../utils/uuidHelpers';
|
|
4
|
+
export const getUsersInfoWithDevicesInfo = async (novaDataSource, params, logger) => {
|
|
5
|
+
if (!params?.filters?.userName) {
|
|
6
|
+
logger.warn({ params }, 'UsersRepository::getUsersInfoWithDevicesInfo - missing required parameters');
|
|
7
|
+
return [];
|
|
8
|
+
}
|
|
9
|
+
return novaDataSource.safeQuery(async (dataSource) => {
|
|
10
|
+
const usersRepository = dataSource.getRepository(User);
|
|
11
|
+
const queryBuilder = usersRepository
|
|
12
|
+
.createQueryBuilder('user')
|
|
13
|
+
.innerJoin(Device, 'device', 'device.clientId = user.clientId and device.status = :status', {
|
|
14
|
+
status: Enums.DeviceStatus.Active,
|
|
15
|
+
})
|
|
16
|
+
.where('LOWER(user.userName) = LOWER(:userName)', {
|
|
17
|
+
userName: params.filters.userName.trim(),
|
|
18
|
+
})
|
|
19
|
+
.orderBy('user.email', 'ASC')
|
|
20
|
+
.select([
|
|
21
|
+
'user.id as userId',
|
|
22
|
+
'user.firstName as firstName',
|
|
23
|
+
'user.lastName as lastName',
|
|
24
|
+
'user.email as email',
|
|
25
|
+
'user.userName as userName',
|
|
26
|
+
'device.imei as imei',
|
|
27
|
+
'device.name as deviceName',
|
|
28
|
+
]);
|
|
29
|
+
const queryResult = await queryBuilder.getRawMany();
|
|
30
|
+
const result = [];
|
|
31
|
+
const userIds = [];
|
|
32
|
+
queryResult.forEach(row => {
|
|
33
|
+
const userId = binaryBufferToUuidString(row.userId);
|
|
34
|
+
if (!userIds.includes(userId)) {
|
|
35
|
+
userIds.push(userId);
|
|
36
|
+
result.push({
|
|
37
|
+
userId,
|
|
38
|
+
firstName: row.firstName,
|
|
39
|
+
lastName: row.lastName,
|
|
40
|
+
email: row.email,
|
|
41
|
+
userName: row.userName,
|
|
42
|
+
devices: [],
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
const userIndex = result.findIndex(user => user.userId === userId);
|
|
46
|
+
result[userIndex].devices.push({
|
|
47
|
+
imei: row.imei,
|
|
48
|
+
name: row.deviceName,
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
return result;
|
|
52
|
+
}, 'UsersRepository::getUsersInfoWithDevicesInfo');
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=getUsersInfoWithDevicesInfo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getUsersInfoWithDevicesInfo.js","sourceRoot":"","sources":["../../../src/repositories/users/getUsersInfoWithDevicesInfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAE7C,OAAO,EAAE,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AAC,QAAQ,CAAC,MAAM,CAAC,EAAE;gBAC7B,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;gBAEpB,MAAM,CAAC,IAAI,CAAC;oBACV,MAAM;oBACN,SAAS,EAAE,GAAG,CAAC,SAAS;oBACxB,QAAQ,EAAE,GAAG,CAAC,QAAQ;oBACtB,KAAK,EAAE,GAAG,CAAC,KAAK;oBAChB,QAAQ,EAAE,GAAG,CAAC,QAAQ;oBACtB,OAAO,EAAE,EAAE;iBACZ,CAAC,CAAA;aACH;YAED,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,MAAM,CAAC,CAAA;YAElE,MAAM,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;gBAC7B,IAAI,EAAE,GAAG,CAAC,IAAI;gBACd,IAAI,EAAE,GAAG,CAAC,UAAU;aACrB,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;QACF,OAAO,MAAM,CAAA;IACf,CAAC,EAAE,8CAA8C,CAAC,CAAA;AACpD,CAAC,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { User } from '../../entities/user';
|
|
2
|
-
import { CreateUserParams, DeleteAccountParams, DeleteUserParams, GetUserByIdParams, GetUserClientRelatedEntitiesCountParams, GetUsersConfigurationByImeiParams, GetUsersDataParams, GetUsersIdsByPhoneAndCountryCodeParams, GetUsersParams, GetUsersWithRolesParams, UpdateUserParams, UserClientRelatedEntitiesCountResult, UserData, UserWithRole } from '../../types/user';
|
|
2
|
+
import { CreateUserParams, DeleteAccountParams, DeleteUserParams, GetUserByIdParams, GetUserClientRelatedEntitiesCountParams, GetUsersConfigurationByImeiParams, GetUsersDataParams, GetUsersIdsByPhoneAndCountryCodeParams, GetUsersInfoWithDevicesInfoParams, GetUsersParams, GetUsersWithRolesParams, UpdateUserParams, UserClientRelatedEntitiesCountResult, UserData, UserInfoWithDevicesInfo, UserWithRole } from '../../types/user';
|
|
3
3
|
import { BaseRepository } from '../baseRepository';
|
|
4
4
|
export declare class UsersRepository extends BaseRepository {
|
|
5
5
|
/**
|
|
@@ -130,4 +130,11 @@ export declare class UsersRepository extends BaseRepository {
|
|
|
130
130
|
* @returns The user client related entities count
|
|
131
131
|
*/
|
|
132
132
|
getUserClientRelatedEntitiesCount(params: GetUserClientRelatedEntitiesCountParams): Promise<UserClientRelatedEntitiesCountResult>;
|
|
133
|
+
/**
|
|
134
|
+
* Get users info with devices info
|
|
135
|
+
* @param {GetUsersInfoWithDevicesInfoParams} params containing information to get users info with devices info
|
|
136
|
+
* - filters.userName: The user name to obtain all users with that user name (lower case and trimmed comparison)
|
|
137
|
+
* @returns The user information with the devices info
|
|
138
|
+
*/
|
|
139
|
+
getUsersInfoWithDevicesInfo(params: GetUsersInfoWithDevicesInfoParams): Promise<UserInfoWithDevicesInfo[]>;
|
|
133
140
|
}
|
|
@@ -9,6 +9,7 @@ import { getUsersData } from './getUserData';
|
|
|
9
9
|
import { getUsers } from './getUsers';
|
|
10
10
|
import { getUsersConfigurationByImei } from './getUsersConfigurationByImei';
|
|
11
11
|
import { getUsersIdsByPhoneAndCountryCode } from './getUsersIdByPhoneAndCountryCode';
|
|
12
|
+
import { getUsersInfoWithDevicesInfo } from './getUsersInfoWithDevicesInfo';
|
|
12
13
|
import { getUsersWithRoles } from './getUsersWithRoles';
|
|
13
14
|
import { updateUser } from './updateUser';
|
|
14
15
|
export class UsersRepository extends BaseRepository {
|
|
@@ -206,5 +207,18 @@ export class UsersRepository extends BaseRepository {
|
|
|
206
207
|
this.logger.trace({ result }, 'UsersRepository::getUserClientRelatedEntitiesCount result');
|
|
207
208
|
return result;
|
|
208
209
|
}
|
|
210
|
+
/**
|
|
211
|
+
* Get users info with devices info
|
|
212
|
+
* @param {GetUsersInfoWithDevicesInfoParams} params containing information to get users info with devices info
|
|
213
|
+
* - filters.userName: The user name to obtain all users with that user name (lower case and trimmed comparison)
|
|
214
|
+
* @returns The user information with the devices info
|
|
215
|
+
*/
|
|
216
|
+
async getUsersInfoWithDevicesInfo(params) {
|
|
217
|
+
this.logger.trace(params, 'UsersRepository::getUsersInfoWithDevicesInfo started with params');
|
|
218
|
+
const novaDataSource = new NovaDataSource(this.novaDataSourceConfig, this.logger);
|
|
219
|
+
const result = await getUsersInfoWithDevicesInfo(novaDataSource, params, this.logger);
|
|
220
|
+
this.logger.trace({ result }, 'UsersRepository::getUsersInfoWithDevicesInfo result');
|
|
221
|
+
return result;
|
|
222
|
+
}
|
|
209
223
|
}
|
|
210
224
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/repositories/users/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/repositories/users/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAmBrD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,iCAAiC,EAAE,MAAM,qCAAqC,CAAA;AACvF,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAA;AAC3E,OAAO,EAAE,gCAAgC,EAAE,MAAM,mCAAmC,CAAA;AACpF,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAA;AAC3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AAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;QAE3F,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,EAAE,2DAA2D,CAAC,CAAA;QAE1F,OAAO,MAAM,CAAA;IACf,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,2BAA2B,CAC/B,MAAyC;QAEzC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,kEAAkE,CAAC,CAAA;QAE7F,MAAM,cAAc,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,oBAAoB,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;QAEjF,MAAM,MAAM,GAAG,MAAM,2BAA2B,CAAC,cAAc,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;QAErF,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,EAAE,qDAAqD,CAAC,CAAA;QAEpF,OAAO,MAAM,CAAA;IACf,CAAC;CACF"}
|
package/dist/types/clients.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BillingMethod, CustomerSegment } from '../entities/customerAttribute';
|
|
1
2
|
import { HapnClientType } from './enums';
|
|
2
3
|
export interface GetClientParams {
|
|
3
4
|
filters: {
|
|
@@ -84,11 +85,17 @@ export interface UpdateClientConfigurationParams {
|
|
|
84
85
|
maxUsersAllowed?: number;
|
|
85
86
|
};
|
|
86
87
|
}
|
|
88
|
+
export declare const requiredCreateCustomerAttributeParamsAttributes: string[];
|
|
89
|
+
export declare const oneRequiredCreateCustomerAttributeParamsAttributes: string[];
|
|
87
90
|
export interface CreateCustomerAttributeParams {
|
|
88
91
|
clientId: number;
|
|
89
92
|
enterprise?: boolean;
|
|
90
93
|
maintenanceModule?: boolean;
|
|
94
|
+
billingMethod?: BillingMethod;
|
|
95
|
+
customerSegment?: CustomerSegment;
|
|
91
96
|
}
|
|
97
|
+
export declare const requiredUpdateCustomerAttributeParamsAttributes: string[];
|
|
98
|
+
export declare const oneRequiredUpdateCustomerAttributeParamsAttributes: string[];
|
|
92
99
|
export interface UpdateCustomerAttributeParams {
|
|
93
100
|
filters: {
|
|
94
101
|
clientId: number;
|
|
@@ -96,6 +103,8 @@ export interface UpdateCustomerAttributeParams {
|
|
|
96
103
|
values: {
|
|
97
104
|
enterprise?: boolean;
|
|
98
105
|
maintenanceModule?: boolean;
|
|
106
|
+
billingMethod?: BillingMethod;
|
|
107
|
+
customerSegment?: CustomerSegment;
|
|
99
108
|
};
|
|
100
109
|
}
|
|
101
110
|
export interface GetCustomerAttributeParams {
|
package/dist/types/clients.js
CHANGED
|
@@ -1,2 +1,15 @@
|
|
|
1
|
-
export
|
|
1
|
+
export const requiredCreateCustomerAttributeParamsAttributes = ['clientId'];
|
|
2
|
+
export const oneRequiredCreateCustomerAttributeParamsAttributes = [
|
|
3
|
+
'enterprise',
|
|
4
|
+
'maintenanceModule',
|
|
5
|
+
'billingMethod',
|
|
6
|
+
'customerSegment',
|
|
7
|
+
];
|
|
8
|
+
export const requiredUpdateCustomerAttributeParamsAttributes = ['filters.clientId'];
|
|
9
|
+
export const oneRequiredUpdateCustomerAttributeParamsAttributes = [
|
|
10
|
+
'values.enterprise',
|
|
11
|
+
'values.maintenanceModule',
|
|
12
|
+
'values.billingMethod',
|
|
13
|
+
'values.customerSegment',
|
|
14
|
+
];
|
|
2
15
|
//# sourceMappingURL=clients.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clients.js","sourceRoot":"","sources":["../../src/types/clients.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"clients.js","sourceRoot":"","sources":["../../src/types/clients.ts"],"names":[],"mappings":"AAgGA,MAAM,CAAC,MAAM,+CAA+C,GAAG,CAAC,UAAU,CAAC,CAAA;AAC3E,MAAM,CAAC,MAAM,kDAAkD,GAAG;IAChE,YAAY;IACZ,mBAAmB;IACnB,eAAe;IACf,iBAAiB;CAClB,CAAA;AASD,MAAM,CAAC,MAAM,+CAA+C,GAAG,CAAC,kBAAkB,CAAC,CAAA;AACnF,MAAM,CAAC,MAAM,kDAAkD,GAAG;IAChE,mBAAmB;IACnB,0BAA0B;IAC1B,sBAAsB;IACtB,wBAAwB;CACzB,CAAA"}
|
package/dist/types/user.d.ts
CHANGED
|
@@ -124,6 +124,23 @@ export interface UserData {
|
|
|
124
124
|
filter?: any;
|
|
125
125
|
enabled?: boolean;
|
|
126
126
|
}
|
|
127
|
+
export interface DeviceInfo {
|
|
128
|
+
imei: string;
|
|
129
|
+
name: string;
|
|
130
|
+
}
|
|
131
|
+
export interface UserInfoWithDevicesInfo {
|
|
132
|
+
userId: string;
|
|
133
|
+
firstName: string;
|
|
134
|
+
lastName: string;
|
|
135
|
+
email: string;
|
|
136
|
+
userName: string;
|
|
137
|
+
devices: DeviceInfo[];
|
|
138
|
+
}
|
|
139
|
+
export interface GetUsersInfoWithDevicesInfoParams {
|
|
140
|
+
filters: {
|
|
141
|
+
userName: string;
|
|
142
|
+
};
|
|
143
|
+
}
|
|
127
144
|
export interface DeleteAccountParams {
|
|
128
145
|
filters: {
|
|
129
146
|
userId?: string;
|