@etsoo/appscript 1.2.73 → 1.2.74
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/__tests__/app/CoreApp.ts +7 -1
- package/lib/cjs/app/CoreApp.d.ts +14 -8
- package/lib/cjs/app/CoreApp.js +24 -4
- package/lib/cjs/business/BusinessUtils.d.ts +1 -1
- package/lib/cjs/dto/IdLabelDto.d.ts +2 -3
- package/lib/cjs/index.d.ts +0 -1
- package/lib/cjs/index.js +0 -1
- package/lib/mjs/app/CoreApp.d.ts +14 -8
- package/lib/mjs/app/CoreApp.js +25 -5
- package/lib/mjs/business/BusinessUtils.d.ts +1 -1
- package/lib/mjs/dto/IdLabelDto.d.ts +2 -3
- package/lib/mjs/index.d.ts +0 -1
- package/lib/mjs/index.js +0 -1
- package/package.json +4 -4
- package/src/app/CoreApp.ts +34 -10
- package/src/dto/IdLabelDto.ts +8 -8
- package/src/index.ts +0 -1
- package/lib/cjs/dto/IdDto.d.ts +0 -10
- package/lib/cjs/dto/IdDto.js +0 -2
- package/lib/mjs/dto/IdDto.d.ts +0 -10
- package/lib/mjs/dto/IdDto.js +0 -1
- package/src/dto/IdDto.ts +0 -11
package/__tests__/app/CoreApp.ts
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from '@etsoo/notificationbase';
|
|
9
9
|
import { ApiAuthorizationScheme, createClient } from '@etsoo/restclient';
|
|
10
10
|
import { DataTypes, DomUtils, Utils, WindowStorage } from '@etsoo/shared';
|
|
11
|
-
import { BusinessUtils, IUser } from '../../src';
|
|
11
|
+
import { BusinessUtils, IUser, UserRole } from '../../src';
|
|
12
12
|
import { AddressUtils } from '../../src/address/AddressUtils';
|
|
13
13
|
import { IAppSettings } from '../../src/app/AppSettings';
|
|
14
14
|
import { CoreApp } from '../../src/app/CoreApp';
|
|
@@ -161,6 +161,12 @@ test('Tests for initCallUpdateLocal', () => {
|
|
|
161
161
|
expect(passphrase).not.toBeNull();
|
|
162
162
|
});
|
|
163
163
|
|
|
164
|
+
test('Tests for getRoles', () => {
|
|
165
|
+
var roles = app.getRoles(UserRole.User | UserRole.Manager | UserRole.Admin);
|
|
166
|
+
expect(roles.length).toBe(3);
|
|
167
|
+
expect(roles.map((r) => r.id)).toEqual([8, 128, 8192]);
|
|
168
|
+
});
|
|
169
|
+
|
|
164
170
|
test('Tests for getUnitLabel', () => {
|
|
165
171
|
expect(app.getUnitLabel(12, true)).toBe('每年');
|
|
166
172
|
});
|
package/lib/cjs/app/CoreApp.d.ts
CHANGED
|
@@ -262,16 +262,19 @@ export interface ICoreApp<U extends IUser, S extends IAppSettings, N, C extends
|
|
|
262
262
|
getCacheToken(): string | undefined;
|
|
263
263
|
/**
|
|
264
264
|
* Get entity status label
|
|
265
|
-
* @param
|
|
265
|
+
* @param status Status value
|
|
266
266
|
*/
|
|
267
|
-
getEntityStatusLabel
|
|
268
|
-
entityStatus?: number;
|
|
269
|
-
}>(data?: D): string;
|
|
267
|
+
getEntityStatusLabel(status: number | null | undefined): string;
|
|
270
268
|
/**
|
|
271
269
|
* Get all regions
|
|
272
270
|
* @returns Regions
|
|
273
271
|
*/
|
|
274
272
|
getRegions(): AddressRegion[];
|
|
273
|
+
/**
|
|
274
|
+
* Get roles
|
|
275
|
+
* @param role Combination role value
|
|
276
|
+
*/
|
|
277
|
+
getRoles(role: number): IdLabelDto[];
|
|
275
278
|
/**
|
|
276
279
|
* Get refresh token from response headers
|
|
277
280
|
* @param rawResponse Raw response from API call
|
|
@@ -707,13 +710,16 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
|
|
|
707
710
|
* @returns Regions
|
|
708
711
|
*/
|
|
709
712
|
getRegions(): AddressRegion[];
|
|
713
|
+
/**
|
|
714
|
+
* Get roles
|
|
715
|
+
* @param role Combination role value
|
|
716
|
+
*/
|
|
717
|
+
getRoles(role: number): IdLabelDto<number>[];
|
|
710
718
|
/**
|
|
711
719
|
* Get entity status label
|
|
712
|
-
* @param
|
|
720
|
+
* @param status Status value
|
|
713
721
|
*/
|
|
714
|
-
getEntityStatusLabel
|
|
715
|
-
entityStatus?: number;
|
|
716
|
-
}>(data?: D): string;
|
|
722
|
+
getEntityStatusLabel(status: number | null | undefined): string;
|
|
717
723
|
/**
|
|
718
724
|
* Get refresh token from response headers
|
|
719
725
|
* @param rawResponse Raw response from API call
|
package/lib/cjs/app/CoreApp.js
CHANGED
|
@@ -10,6 +10,7 @@ const AddressUtils_1 = require("../address/AddressUtils");
|
|
|
10
10
|
const BridgeUtils_1 = require("../bridges/BridgeUtils");
|
|
11
11
|
const BusinessUtils_1 = require("../business/BusinessUtils");
|
|
12
12
|
const ActionResultError_1 = require("../result/ActionResultError");
|
|
13
|
+
const UserRole_1 = require("./UserRole");
|
|
13
14
|
/**
|
|
14
15
|
* App fields
|
|
15
16
|
*/
|
|
@@ -837,14 +838,33 @@ class CoreApp {
|
|
|
837
838
|
return AddressRegion_1.AddressRegion.getById(id);
|
|
838
839
|
});
|
|
839
840
|
}
|
|
841
|
+
/**
|
|
842
|
+
* Get roles
|
|
843
|
+
* @param role Combination role value
|
|
844
|
+
*/
|
|
845
|
+
getRoles(role) {
|
|
846
|
+
var _a;
|
|
847
|
+
var roles = [];
|
|
848
|
+
var keys = shared_1.DataTypes.getEnumKeys(UserRole_1.UserRole);
|
|
849
|
+
for (var key of keys) {
|
|
850
|
+
var id = UserRole_1.UserRole[key];
|
|
851
|
+
if ((id & role) > 0) {
|
|
852
|
+
roles.push({
|
|
853
|
+
id,
|
|
854
|
+
label: (_a = this.get(`role${key}`)) !== null && _a !== void 0 ? _a : key
|
|
855
|
+
});
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
return roles;
|
|
859
|
+
}
|
|
840
860
|
/**
|
|
841
861
|
* Get entity status label
|
|
842
|
-
* @param
|
|
862
|
+
* @param status Status value
|
|
843
863
|
*/
|
|
844
|
-
getEntityStatusLabel(
|
|
845
|
-
if (
|
|
864
|
+
getEntityStatusLabel(status) {
|
|
865
|
+
if (status == null)
|
|
846
866
|
return '';
|
|
847
|
-
return BusinessUtils_1.BusinessUtils.getEntityStatusLabel(
|
|
867
|
+
return BusinessUtils_1.BusinessUtils.getEntityStatusLabel(status, this.labelDelegate);
|
|
848
868
|
}
|
|
849
869
|
/**
|
|
850
870
|
* Get refresh token from response headers
|
|
@@ -38,7 +38,7 @@ export declare namespace BusinessUtils {
|
|
|
38
38
|
* @param startMonth Start month, 0 as Jan.
|
|
39
39
|
* @returns 12 months
|
|
40
40
|
*/
|
|
41
|
-
function getMonths(monthLabels: string[], startMonth?: number): DataTypes.IdLabelItem[];
|
|
41
|
+
function getMonths(monthLabels: string[], startMonth?: number): DataTypes.IdLabelItem<number>[];
|
|
42
42
|
/**
|
|
43
43
|
* Get product unit's label
|
|
44
44
|
* Please define the label in culture with key 'unitPC' for ProductUnit.PC like that
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { DataTypes } from '@etsoo/shared';
|
|
2
|
-
import { IdDto } from './IdDto';
|
|
3
2
|
/**
|
|
4
3
|
* Dto with id and label field
|
|
5
4
|
*/
|
|
6
|
-
export declare type IdLabelDto<T extends DataTypes.IdType = number> =
|
|
5
|
+
export declare type IdLabelDto<T extends DataTypes.IdType = number> = DataTypes.IdItem<T> & {
|
|
7
6
|
/**
|
|
8
7
|
* Label
|
|
9
8
|
*/
|
|
@@ -12,4 +11,4 @@ export declare type IdLabelDto<T extends DataTypes.IdType = number> = IdDto<T> &
|
|
|
12
11
|
/**
|
|
13
12
|
* Conditional IdLabel type
|
|
14
13
|
*/
|
|
15
|
-
export declare type IdLabelConditional<T extends boolean> = T extends true ? IdLabelDto[] : IdLabelDto<string>[];
|
|
14
|
+
export declare type IdLabelConditional<T extends boolean> = T extends true ? IdLabelDto<number>[] : IdLabelDto<string>[];
|
package/lib/cjs/index.d.ts
CHANGED
|
@@ -13,7 +13,6 @@ export * from './business/EntityStatus';
|
|
|
13
13
|
export * from './business/ProductUnit';
|
|
14
14
|
export * from './business/RepeatOption';
|
|
15
15
|
export * from './def/ListItem';
|
|
16
|
-
export * from './dto/IdDto';
|
|
17
16
|
export * from './dto/IdLabelDto';
|
|
18
17
|
export * from './dto/IdLabelPrimaryDto';
|
|
19
18
|
export * from './dto/InitCallDto';
|
package/lib/cjs/index.js
CHANGED
|
@@ -36,7 +36,6 @@ __exportStar(require("./business/RepeatOption"), exports);
|
|
|
36
36
|
// def
|
|
37
37
|
__exportStar(require("./def/ListItem"), exports);
|
|
38
38
|
// dto
|
|
39
|
-
__exportStar(require("./dto/IdDto"), exports);
|
|
40
39
|
__exportStar(require("./dto/IdLabelDto"), exports);
|
|
41
40
|
__exportStar(require("./dto/IdLabelPrimaryDto"), exports);
|
|
42
41
|
__exportStar(require("./dto/InitCallDto"), exports);
|
package/lib/mjs/app/CoreApp.d.ts
CHANGED
|
@@ -262,16 +262,19 @@ export interface ICoreApp<U extends IUser, S extends IAppSettings, N, C extends
|
|
|
262
262
|
getCacheToken(): string | undefined;
|
|
263
263
|
/**
|
|
264
264
|
* Get entity status label
|
|
265
|
-
* @param
|
|
265
|
+
* @param status Status value
|
|
266
266
|
*/
|
|
267
|
-
getEntityStatusLabel
|
|
268
|
-
entityStatus?: number;
|
|
269
|
-
}>(data?: D): string;
|
|
267
|
+
getEntityStatusLabel(status: number | null | undefined): string;
|
|
270
268
|
/**
|
|
271
269
|
* Get all regions
|
|
272
270
|
* @returns Regions
|
|
273
271
|
*/
|
|
274
272
|
getRegions(): AddressRegion[];
|
|
273
|
+
/**
|
|
274
|
+
* Get roles
|
|
275
|
+
* @param role Combination role value
|
|
276
|
+
*/
|
|
277
|
+
getRoles(role: number): IdLabelDto[];
|
|
275
278
|
/**
|
|
276
279
|
* Get refresh token from response headers
|
|
277
280
|
* @param rawResponse Raw response from API call
|
|
@@ -707,13 +710,16 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
|
|
|
707
710
|
* @returns Regions
|
|
708
711
|
*/
|
|
709
712
|
getRegions(): AddressRegion[];
|
|
713
|
+
/**
|
|
714
|
+
* Get roles
|
|
715
|
+
* @param role Combination role value
|
|
716
|
+
*/
|
|
717
|
+
getRoles(role: number): IdLabelDto<number>[];
|
|
710
718
|
/**
|
|
711
719
|
* Get entity status label
|
|
712
|
-
* @param
|
|
720
|
+
* @param status Status value
|
|
713
721
|
*/
|
|
714
|
-
getEntityStatusLabel
|
|
715
|
-
entityStatus?: number;
|
|
716
|
-
}>(data?: D): string;
|
|
722
|
+
getEntityStatusLabel(status: number | null | undefined): string;
|
|
717
723
|
/**
|
|
718
724
|
* Get refresh token from response headers
|
|
719
725
|
* @param rawResponse Raw response from API call
|
package/lib/mjs/app/CoreApp.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { NotificationAlign, NotificationMessageType } from '@etsoo/notificationbase';
|
|
2
2
|
import { ApiDataError } from '@etsoo/restclient';
|
|
3
|
-
import { DateUtils, DomUtils, NumberUtils, Utils } from '@etsoo/shared';
|
|
3
|
+
import { DataTypes, DateUtils, DomUtils, NumberUtils, Utils } from '@etsoo/shared';
|
|
4
4
|
import { AES, algo, enc, HmacSHA512, lib, mode, pad, PBKDF2, SHA3 } from 'crypto-js';
|
|
5
5
|
import { AddressRegion } from '../address/AddressRegion';
|
|
6
6
|
import { AddressUtils } from '../address/AddressUtils';
|
|
7
7
|
import { BridgeUtils } from '../bridges/BridgeUtils';
|
|
8
8
|
import { BusinessUtils } from '../business/BusinessUtils';
|
|
9
9
|
import { ActionResultError } from '../result/ActionResultError';
|
|
10
|
+
import { UserRole } from './UserRole';
|
|
10
11
|
/**
|
|
11
12
|
* App fields
|
|
12
13
|
*/
|
|
@@ -834,14 +835,33 @@ export class CoreApp {
|
|
|
834
835
|
return AddressRegion.getById(id);
|
|
835
836
|
});
|
|
836
837
|
}
|
|
838
|
+
/**
|
|
839
|
+
* Get roles
|
|
840
|
+
* @param role Combination role value
|
|
841
|
+
*/
|
|
842
|
+
getRoles(role) {
|
|
843
|
+
var _a;
|
|
844
|
+
var roles = [];
|
|
845
|
+
var keys = DataTypes.getEnumKeys(UserRole);
|
|
846
|
+
for (var key of keys) {
|
|
847
|
+
var id = UserRole[key];
|
|
848
|
+
if ((id & role) > 0) {
|
|
849
|
+
roles.push({
|
|
850
|
+
id,
|
|
851
|
+
label: (_a = this.get(`role${key}`)) !== null && _a !== void 0 ? _a : key
|
|
852
|
+
});
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
return roles;
|
|
856
|
+
}
|
|
837
857
|
/**
|
|
838
858
|
* Get entity status label
|
|
839
|
-
* @param
|
|
859
|
+
* @param status Status value
|
|
840
860
|
*/
|
|
841
|
-
getEntityStatusLabel(
|
|
842
|
-
if (
|
|
861
|
+
getEntityStatusLabel(status) {
|
|
862
|
+
if (status == null)
|
|
843
863
|
return '';
|
|
844
|
-
return BusinessUtils.getEntityStatusLabel(
|
|
864
|
+
return BusinessUtils.getEntityStatusLabel(status, this.labelDelegate);
|
|
845
865
|
}
|
|
846
866
|
/**
|
|
847
867
|
* Get refresh token from response headers
|
|
@@ -38,7 +38,7 @@ export declare namespace BusinessUtils {
|
|
|
38
38
|
* @param startMonth Start month, 0 as Jan.
|
|
39
39
|
* @returns 12 months
|
|
40
40
|
*/
|
|
41
|
-
function getMonths(monthLabels: string[], startMonth?: number): DataTypes.IdLabelItem[];
|
|
41
|
+
function getMonths(monthLabels: string[], startMonth?: number): DataTypes.IdLabelItem<number>[];
|
|
42
42
|
/**
|
|
43
43
|
* Get product unit's label
|
|
44
44
|
* Please define the label in culture with key 'unitPC' for ProductUnit.PC like that
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { DataTypes } from '@etsoo/shared';
|
|
2
|
-
import { IdDto } from './IdDto';
|
|
3
2
|
/**
|
|
4
3
|
* Dto with id and label field
|
|
5
4
|
*/
|
|
6
|
-
export declare type IdLabelDto<T extends DataTypes.IdType = number> =
|
|
5
|
+
export declare type IdLabelDto<T extends DataTypes.IdType = number> = DataTypes.IdItem<T> & {
|
|
7
6
|
/**
|
|
8
7
|
* Label
|
|
9
8
|
*/
|
|
@@ -12,4 +11,4 @@ export declare type IdLabelDto<T extends DataTypes.IdType = number> = IdDto<T> &
|
|
|
12
11
|
/**
|
|
13
12
|
* Conditional IdLabel type
|
|
14
13
|
*/
|
|
15
|
-
export declare type IdLabelConditional<T extends boolean> = T extends true ? IdLabelDto[] : IdLabelDto<string>[];
|
|
14
|
+
export declare type IdLabelConditional<T extends boolean> = T extends true ? IdLabelDto<number>[] : IdLabelDto<string>[];
|
package/lib/mjs/index.d.ts
CHANGED
|
@@ -13,7 +13,6 @@ export * from './business/EntityStatus';
|
|
|
13
13
|
export * from './business/ProductUnit';
|
|
14
14
|
export * from './business/RepeatOption';
|
|
15
15
|
export * from './def/ListItem';
|
|
16
|
-
export * from './dto/IdDto';
|
|
17
16
|
export * from './dto/IdLabelDto';
|
|
18
17
|
export * from './dto/IdLabelPrimaryDto';
|
|
19
18
|
export * from './dto/InitCallDto';
|
package/lib/mjs/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/appscript",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.74",
|
|
4
4
|
"description": "Applications shared TypeScript framework",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@etsoo/notificationbase": "^1.1.5",
|
|
56
56
|
"@etsoo/restclient": "^1.0.70",
|
|
57
|
-
"@etsoo/shared": "^1.1.
|
|
57
|
+
"@etsoo/shared": "^1.1.42",
|
|
58
58
|
"@types/crypto-js": "^4.1.1",
|
|
59
59
|
"crypto-js": "^4.1.1"
|
|
60
60
|
},
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"@babel/preset-env": "^7.18.10",
|
|
66
66
|
"@babel/runtime-corejs3": "^7.18.9",
|
|
67
67
|
"@types/jest": "^28.1.6",
|
|
68
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
69
|
-
"@typescript-eslint/parser": "^5.
|
|
68
|
+
"@typescript-eslint/eslint-plugin": "^5.33.0",
|
|
69
|
+
"@typescript-eslint/parser": "^5.33.0",
|
|
70
70
|
"eslint": "^8.21.0",
|
|
71
71
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
72
72
|
"eslint-plugin-import": "^2.26.0",
|
package/src/app/CoreApp.ts
CHANGED
|
@@ -37,7 +37,7 @@ import { InitCallDto } from '../dto/InitCallDto';
|
|
|
37
37
|
import { ActionResultError } from '../result/ActionResultError';
|
|
38
38
|
import { IActionResult } from '../result/IActionResult';
|
|
39
39
|
import { InitCallResult, InitCallResultData } from '../result/InitCallResult';
|
|
40
|
-
import { IUser
|
|
40
|
+
import { IUser } from '../state/User';
|
|
41
41
|
import { IAppSettings } from './AppSettings';
|
|
42
42
|
import { UserRole } from './UserRole';
|
|
43
43
|
|
|
@@ -376,9 +376,9 @@ export interface ICoreApp<
|
|
|
376
376
|
|
|
377
377
|
/**
|
|
378
378
|
* Get entity status label
|
|
379
|
-
* @param
|
|
379
|
+
* @param status Status value
|
|
380
380
|
*/
|
|
381
|
-
getEntityStatusLabel
|
|
381
|
+
getEntityStatusLabel(status: number | null | undefined): string;
|
|
382
382
|
|
|
383
383
|
/**
|
|
384
384
|
* Get all regions
|
|
@@ -386,6 +386,12 @@ export interface ICoreApp<
|
|
|
386
386
|
*/
|
|
387
387
|
getRegions(): AddressRegion[];
|
|
388
388
|
|
|
389
|
+
/**
|
|
390
|
+
* Get roles
|
|
391
|
+
* @param role Combination role value
|
|
392
|
+
*/
|
|
393
|
+
getRoles(role: number): IdLabelDto[];
|
|
394
|
+
|
|
389
395
|
/**
|
|
390
396
|
* Get refresh token from response headers
|
|
391
397
|
* @param rawResponse Raw response from API call
|
|
@@ -1602,16 +1608,34 @@ export abstract class CoreApp<
|
|
|
1602
1608
|
});
|
|
1603
1609
|
}
|
|
1604
1610
|
|
|
1611
|
+
/**
|
|
1612
|
+
* Get roles
|
|
1613
|
+
* @param role Combination role value
|
|
1614
|
+
*/
|
|
1615
|
+
getRoles(role: number) {
|
|
1616
|
+
var roles: IdLabelDto[] = [];
|
|
1617
|
+
|
|
1618
|
+
var keys = DataTypes.getEnumKeys(UserRole);
|
|
1619
|
+
for (var key of keys) {
|
|
1620
|
+
var id = UserRole[key as keyof typeof UserRole];
|
|
1621
|
+
if ((id & role) > 0) {
|
|
1622
|
+
roles.push({
|
|
1623
|
+
id,
|
|
1624
|
+
label: this.get<string>(`role${key}`) ?? key
|
|
1625
|
+
});
|
|
1626
|
+
}
|
|
1627
|
+
}
|
|
1628
|
+
|
|
1629
|
+
return roles;
|
|
1630
|
+
}
|
|
1631
|
+
|
|
1605
1632
|
/**
|
|
1606
1633
|
* Get entity status label
|
|
1607
|
-
* @param
|
|
1634
|
+
* @param status Status value
|
|
1608
1635
|
*/
|
|
1609
|
-
getEntityStatusLabel
|
|
1610
|
-
if (
|
|
1611
|
-
return BusinessUtils.getEntityStatusLabel(
|
|
1612
|
-
data.entityStatus,
|
|
1613
|
-
this.labelDelegate
|
|
1614
|
-
);
|
|
1636
|
+
getEntityStatusLabel(status: number | null | undefined) {
|
|
1637
|
+
if (status == null) return '';
|
|
1638
|
+
return BusinessUtils.getEntityStatusLabel(status, this.labelDelegate);
|
|
1615
1639
|
}
|
|
1616
1640
|
|
|
1617
1641
|
/**
|
package/src/dto/IdLabelDto.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { DataTypes } from '@etsoo/shared';
|
|
2
|
-
import { IdDto } from './IdDto';
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* Dto with id and label field
|
|
6
5
|
*/
|
|
7
|
-
export type IdLabelDto<T extends DataTypes.IdType = number> =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
export type IdLabelDto<T extends DataTypes.IdType = number> =
|
|
7
|
+
DataTypes.IdItem<T> & {
|
|
8
|
+
/**
|
|
9
|
+
* Label
|
|
10
|
+
*/
|
|
11
|
+
label: string;
|
|
12
|
+
};
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Conditional IdLabel type
|
|
16
16
|
*/
|
|
17
17
|
export type IdLabelConditional<T extends boolean> = T extends true
|
|
18
|
-
? IdLabelDto[]
|
|
18
|
+
? IdLabelDto<number>[]
|
|
19
19
|
: IdLabelDto<string>[];
|
package/src/index.ts
CHANGED
package/lib/cjs/dto/IdDto.d.ts
DELETED
package/lib/cjs/dto/IdDto.js
DELETED
package/lib/mjs/dto/IdDto.d.ts
DELETED
package/lib/mjs/dto/IdDto.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|