@diia-inhouse/utils 4.13.0 → 5.3.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/LICENCE.md +59 -59
- package/dist/address.js +41 -0
- package/dist/address.js.map +1 -0
- package/dist/applicationUtils.js +260 -21
- package/dist/applicationUtils.js.map +1 -1
- package/dist/dictionaries/phoneCodes.js +487 -488
- package/dist/dictionaries/phoneCodes.js.map +1 -1
- package/dist/guards.js +25 -0
- package/dist/guards.js.map +1 -1
- package/dist/index.js +41 -15
- package/dist/index.js.map +1 -1
- package/dist/interfaces/applicationUtils.js +3 -0
- package/dist/interfaces/applicationUtils.js.map +1 -0
- package/dist/interfaces/error.js +3 -0
- package/dist/interfaces/error.js.map +1 -0
- package/dist/interfaces/slack.js +3 -0
- package/dist/interfaces/slack.js.map +1 -0
- package/dist/phoneticChecker/index.js +6 -4
- package/dist/phoneticChecker/index.js.map +1 -1
- package/dist/phoneticChecker/metaphone.js +0 -1
- package/dist/phoneticChecker/metaphone.js.map +1 -1
- package/dist/publicService.js +60 -17
- package/dist/publicService.js.map +1 -1
- package/dist/slackFormatting.js +24 -0
- package/dist/slackFormatting.js.map +1 -0
- package/dist/types/address.d.ts +4 -0
- package/dist/types/applicationUtils.d.ts +100 -3
- package/dist/types/dictionaries/phoneCodes.d.ts +1 -1
- package/dist/types/guards.d.ts +4 -1
- package/dist/types/index.d.ts +59 -1
- package/dist/types/interfaces/applicationUtils.d.ts +1 -0
- package/dist/types/interfaces/error.d.ts +7 -0
- package/dist/types/interfaces/publicService.d.ts +1 -0
- package/dist/types/interfaces/slack.d.ts +3 -0
- package/dist/types/phoneticChecker/index.d.ts +3 -2
- package/dist/types/publicService.d.ts +46 -3
- package/dist/types/slackFormatting.d.ts +7 -0
- package/package.json +33 -49
|
@@ -19,7 +19,20 @@ export declare class ApplicationUtils {
|
|
|
19
19
|
static lowerFirstLetter(str: string): string;
|
|
20
20
|
static mapCyrillic(value: string): string;
|
|
21
21
|
static mapLatin(value: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* Validates the Ukrainian IBAN number by format and checksum.
|
|
24
|
+
*/
|
|
22
25
|
static isIbanNumberValid(iban: string): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Extracts the bank code (МФО) from Ukrainian IBAN (4-10 digits). Does not validate the IBAN.
|
|
28
|
+
*
|
|
29
|
+
* @link https://en.wikipedia.org/wiki/International_Bank_Account_Number#IBAN_formats_by_country
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* const bankCode = extractBankCodeFromIban('UA833052991234567890123456789') // '305299'
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
static extractBankCodeFromIban(iban: string): string;
|
|
23
36
|
static getStreetName(street: string, streetType: string): string;
|
|
24
37
|
static toHashedFilesWithSignatures(hashedFiles: HashedFile[], signedItems: SignedItem[]): [HashedFileWithSignature[], string[]];
|
|
25
38
|
static handleError<T = never>(err: unknown, cb: (err: ApiError) => T): T;
|
|
@@ -30,13 +43,19 @@ export declare class ApplicationUtils {
|
|
|
30
43
|
* Get age from birth date. Powered by {@link https://moment.github.io/luxon/#/ luxon}
|
|
31
44
|
*
|
|
32
45
|
* @param birthDay Input birth date.
|
|
33
|
-
* @param
|
|
34
|
-
* @param
|
|
46
|
+
* @param params Additional parameters. Default: `{ format: 'dd.MM.yyyy', unitOfTime: 'years' }`
|
|
47
|
+
* @param params.format Input date format (https://moment.github.io/luxon/#/formatting?id=table-of-tokens). Default - 'dd.MM.yyyy'
|
|
48
|
+
* @param params.unitOfTime Unit of time to get the difference in. Default - 'years'
|
|
49
|
+
* @param params.relativeTo Date to compare the input date to. Default - current date
|
|
35
50
|
*
|
|
36
51
|
* @returns Age in years if other `unitOfTime` is not specified
|
|
37
52
|
* @throws If input date is invalid
|
|
38
53
|
*/
|
|
39
|
-
static getAge(birthDay: string,
|
|
54
|
+
static getAge(birthDay: string, params?: {
|
|
55
|
+
format?: string;
|
|
56
|
+
unitOfTime?: ToRelativeUnit;
|
|
57
|
+
relativeTo?: string;
|
|
58
|
+
}): number;
|
|
40
59
|
static getFullName(lastName: string, firstName: string, middleName?: string, separator?: string): string;
|
|
41
60
|
static getShortName(lastName: string, firstName: string, middleName?: string): string;
|
|
42
61
|
static getUserFullName(user: UserTokenData): string;
|
|
@@ -110,6 +129,84 @@ export declare class ApplicationUtils {
|
|
|
110
129
|
* getPluralForm(0, 'яблуко', 'яблука', 'яблук'); // 'яблук' (uses 'many' as default fallback)
|
|
111
130
|
*/
|
|
112
131
|
static pluralizeString(value: number, one: string, few: string, many: string, other?: string, locale?: string): string;
|
|
132
|
+
/**
|
|
133
|
+
* Returns the name of a service from a package.json in the current working directory (process.cwd()) converted to PascalCase.
|
|
134
|
+
* If the name is scoped, it will be returned without the scope.
|
|
135
|
+
* If the name is not found, an empty string is returned. Also, all whitespace characters are removed.
|
|
136
|
+
*
|
|
137
|
+
* @returns The name of the service in PascalCase.
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* getServiceName() // 'my-service' -> 'MyService'
|
|
141
|
+
* getServiceName() // '@scope/my-service' -> 'MyService'
|
|
142
|
+
*/
|
|
143
|
+
static getServiceName(): string;
|
|
144
|
+
/**
|
|
145
|
+
* Returns the version of a service from a package.json in the current working directory (process.cwd()).
|
|
146
|
+
* If the version is not found, an empty string is returned.
|
|
147
|
+
*
|
|
148
|
+
* @returns The version of the service.
|
|
149
|
+
*
|
|
150
|
+
* @example
|
|
151
|
+
* getServiceVersion() // '1.143.0-rc.2'
|
|
152
|
+
*/
|
|
153
|
+
static getServiceVersion(): string;
|
|
154
|
+
/**
|
|
155
|
+
* Format string according to mask pattern
|
|
156
|
+
*
|
|
157
|
+
* Basic Examples:
|
|
158
|
+
* '12345' with '##-###' -> '12-345'
|
|
159
|
+
* 'AB345' with '##-###' -> 'AB-345'
|
|
160
|
+
* '123456' with '##.####' -> '12.3456'
|
|
161
|
+
* '12345' with '### ##' -> '123 45'
|
|
162
|
+
* 'ABCDEF' with '##-##-##' -> 'AB-CD-EF'
|
|
163
|
+
*/
|
|
164
|
+
static formatMask(rawData: string, mask: string): string;
|
|
165
|
+
/**
|
|
166
|
+
* Memoize a function.
|
|
167
|
+
* The function is memoized by the arguments (`JSON.stringify(args)`) and the result is cached for the specified time to live in milliseconds.
|
|
168
|
+
* If the function is called with the same arguments again, the cached result is returned.
|
|
169
|
+
* If the function is called with the same arguments again after the time to live has expired, the function is called again and the result is cached again.
|
|
170
|
+
*
|
|
171
|
+
* @param fn - The function to memoize.
|
|
172
|
+
* @param ttl - The time to live for the cached value in milliseconds.
|
|
173
|
+
* @returns The memoized function.
|
|
174
|
+
*/
|
|
175
|
+
static memoize<T extends (...args: Parameters<T>) => ReturnType<T>>(fn: T, ttl?: number): T;
|
|
176
|
+
/**
|
|
177
|
+
* Recursively encodes all string values in an object or string using encodeURIComponent.
|
|
178
|
+
* For objects, it creates a deep clone and processes all string values.
|
|
179
|
+
* For strings, it directly applies the encoding.
|
|
180
|
+
*
|
|
181
|
+
* @param data Input data to encode - can be an object or string
|
|
182
|
+
* @returns Deep cloned object with encoded string values, or encoded string if input was string
|
|
183
|
+
* @example
|
|
184
|
+
* ```typescript
|
|
185
|
+
* const data = { name: 'John Doe', email: 'john@example.com' }
|
|
186
|
+
* const encoded = ApplicationUtils.encodeValuesWithIterator(data)
|
|
187
|
+
* // Result: { name: 'John%20Doe', email: 'john%40example.com' }
|
|
188
|
+
* ```
|
|
189
|
+
*/
|
|
190
|
+
static encodeValuesWithIterator(data: object | string): object | string;
|
|
191
|
+
/**
|
|
192
|
+
* Recursively decodes all string values in an object or string using decodeURIComponent.
|
|
193
|
+
* For objects, it creates a deep clone and processes all string values.
|
|
194
|
+
* For strings, it directly applies the decoding.
|
|
195
|
+
*
|
|
196
|
+
* @param data Input data to decode - can be an object or string
|
|
197
|
+
* @returns Deep cloned object with decoded string values, or decoded string if input was string
|
|
198
|
+
* @example
|
|
199
|
+
* ```typescript
|
|
200
|
+
* const data = { name: 'John%20Doe', email: 'john%40example.com' }
|
|
201
|
+
* const decoded = ApplicationUtils.decodeValuesWithIterator(data)
|
|
202
|
+
* // Result: { name: 'John Doe', email: 'john@example.com' }
|
|
203
|
+
* ```
|
|
204
|
+
*/
|
|
205
|
+
static decodeValuesWithIterator(data: object | string): object | string;
|
|
206
|
+
static removeUnderscoreFields<T>(value: T): T;
|
|
113
207
|
private static mod97;
|
|
114
208
|
private static toApiError;
|
|
209
|
+
private static getPackageJson;
|
|
210
|
+
private static processObject;
|
|
211
|
+
private static processValues;
|
|
115
212
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { InputPhoneCodeItem } from '@diia-inhouse/
|
|
1
|
+
import { InputPhoneCodeItem } from '@diia-inhouse/design-system';
|
|
2
2
|
export declare const phoneCodes: InputPhoneCodeItem[];
|
package/dist/types/guards.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { ApiError } from '@diia-inhouse/errors';
|
|
2
|
-
import { AcquirerSession, ActionSession, OnBeforeApplicationShutdown, OnDestroy, OnHealthCheck, OnInit, OnRegistrationsFinished, ServiceEntranceSession, UserSession } from '@diia-inhouse/types';
|
|
2
|
+
import { AcquirerSession, ActionSession, AppUser, EResidentSession, EResidentTokenData, OnBeforeApplicationShutdown, OnDestroy, OnHealthCheck, OnInit, OnRegistrationsFinished, ServiceEntranceSession, UserSession, UserTokenData } from '@diia-inhouse/types';
|
|
3
3
|
export declare const Guards: {
|
|
4
4
|
isError(value: unknown): value is Error;
|
|
5
5
|
apiError(err: Error): err is ApiError;
|
|
6
6
|
isUserSession(session: ActionSession | undefined): session is UserSession;
|
|
7
|
+
isUser(user: AppUser | undefined): user is UserTokenData;
|
|
8
|
+
isEResidentSession(session: ActionSession | undefined): session is EResidentSession;
|
|
9
|
+
isEResident(user: AppUser | undefined): user is EResidentTokenData;
|
|
7
10
|
isAcquirerSession(session: ActionSession | undefined): session is AcquirerSession;
|
|
8
11
|
isServiceEntranceSession(session: ActionSession | undefined): session is ServiceEntranceSession;
|
|
9
12
|
hasOnInitHook(instance: unknown): instance is OnInit;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
|
+
import { AddressUtils } from './address';
|
|
1
2
|
import { ApplicationUtils } from './applicationUtils';
|
|
3
|
+
import { NetworkUtils } from './network';
|
|
4
|
+
import { PaymentUtils } from './payment';
|
|
5
|
+
import { SlackFormattingUtils } from './slackFormatting';
|
|
2
6
|
declare const asserts: import("./interfaces/asserts").AssertsContainer;
|
|
3
7
|
declare const guards: {
|
|
4
8
|
isError(value: unknown): value is Error;
|
|
5
9
|
apiError(err: Error): err is import("@diia-inhouse/errors").ApiError;
|
|
6
10
|
isUserSession(session: import("@diia-inhouse/types").ActionSession | undefined): session is import("@diia-inhouse/types").UserSession;
|
|
11
|
+
isUser(user: import("@diia-inhouse/types").AppUser | undefined): user is import("@diia-inhouse/types").UserTokenData;
|
|
12
|
+
isEResidentSession(session: import("@diia-inhouse/types").ActionSession | undefined): session is import("@diia-inhouse/types").EResidentSession;
|
|
13
|
+
isEResident(user: import("@diia-inhouse/types").AppUser | undefined): user is import("@diia-inhouse/types").EResidentTokenData;
|
|
7
14
|
isAcquirerSession(session: import("@diia-inhouse/types").ActionSession | undefined): session is import("@diia-inhouse/types").AcquirerSession;
|
|
8
15
|
isServiceEntranceSession(session: import("@diia-inhouse/types").ActionSession | undefined): session is import("@diia-inhouse/types").ServiceEntranceSession;
|
|
9
16
|
hasOnInitHook(instance: unknown): instance is import("@diia-inhouse/types").OnInit;
|
|
@@ -21,8 +28,59 @@ export { asserts, guards, utils, pdfUtils };
|
|
|
21
28
|
export { TypeUtils } from './typeUtils';
|
|
22
29
|
export { PaymentUtils } from './payment';
|
|
23
30
|
export { PublicServiceUtils } from './publicService';
|
|
24
|
-
export { phoneticChecker } from './phoneticChecker
|
|
31
|
+
export { phoneticChecker } from './phoneticChecker';
|
|
25
32
|
export { NetworkUtils } from './network';
|
|
26
33
|
export { IntegrationUtils } from './integration';
|
|
27
34
|
export { RandomUtils } from './random';
|
|
35
|
+
export { AddressUtils } from './address';
|
|
28
36
|
export * from './session';
|
|
37
|
+
export * from './slackFormatting';
|
|
38
|
+
export declare class Utils {
|
|
39
|
+
address: typeof AddressUtils;
|
|
40
|
+
application: typeof ApplicationUtils;
|
|
41
|
+
network: typeof NetworkUtils;
|
|
42
|
+
payment: typeof PaymentUtils;
|
|
43
|
+
slackFormatting: typeof SlackFormattingUtils;
|
|
44
|
+
asserts: import("./interfaces/asserts").AssertsContainer;
|
|
45
|
+
guards: {
|
|
46
|
+
isError(value: unknown): value is Error;
|
|
47
|
+
apiError(err: Error): err is import("@diia-inhouse/errors").ApiError;
|
|
48
|
+
isUserSession(session: import("@diia-inhouse/types").ActionSession | undefined): session is import("@diia-inhouse/types").UserSession;
|
|
49
|
+
isUser(user: import("@diia-inhouse/types").AppUser | undefined): user is import("@diia-inhouse/types").UserTokenData;
|
|
50
|
+
isEResidentSession(session: import("@diia-inhouse/types").ActionSession | undefined): session is import("@diia-inhouse/types").EResidentSession;
|
|
51
|
+
isEResident(user: import("@diia-inhouse/types").AppUser | undefined): user is import("@diia-inhouse/types").EResidentTokenData;
|
|
52
|
+
isAcquirerSession(session: import("@diia-inhouse/types").ActionSession | undefined): session is import("@diia-inhouse/types").AcquirerSession;
|
|
53
|
+
isServiceEntranceSession(session: import("@diia-inhouse/types").ActionSession | undefined): session is import("@diia-inhouse/types").ServiceEntranceSession;
|
|
54
|
+
hasOnInitHook(instance: unknown): instance is import("@diia-inhouse/types").OnInit;
|
|
55
|
+
hasOnHealthCheckHook(instance: unknown): instance is import("@diia-inhouse/types").OnHealthCheck;
|
|
56
|
+
hasOnDestroyHook(instance: unknown): instance is import("@diia-inhouse/types").OnDestroy;
|
|
57
|
+
hasOnRegistrationsFinishedHook(instance: unknown): instance is import("@diia-inhouse/types").OnRegistrationsFinished;
|
|
58
|
+
hasOnBeforeApplicationShutdownHook(instance: unknown): instance is import("@diia-inhouse/types").OnBeforeApplicationShutdown;
|
|
59
|
+
isSettledError(value: PromiseSettledResult<unknown>): value is PromiseRejectedResult;
|
|
60
|
+
};
|
|
61
|
+
integration: {
|
|
62
|
+
getRetryDelay(retry: number, timeLeft: number, initDelay: number, maxDelay: number, multiplier: number): number;
|
|
63
|
+
};
|
|
64
|
+
pdf: {
|
|
65
|
+
getPdfFileName(name: string, id: string, requestDateTime?: string): string;
|
|
66
|
+
};
|
|
67
|
+
publicService: {
|
|
68
|
+
getContacts(user: import("@diia-inhouse/types").UserTokenData): import("@diia-inhouse/design-system").ContactsResponse;
|
|
69
|
+
getContactsText(user: import("@diia-inhouse/types").UserTokenData): string;
|
|
70
|
+
getContactsComponent(user: import("@diia-inhouse/types").UserTokenData, inputCode?: string): import("@diia-inhouse/design-system").DSBodyItem;
|
|
71
|
+
getInputPhoneCodeOrg(params: import("./interfaces/publicService").InputPhoneCodeOrgParams): import("@diia-inhouse/design-system").InputPhoneCodeOrg;
|
|
72
|
+
getInputPhoneCodeItems(filter?: string[]): import("@diia-inhouse/design-system").InputPhoneCodeItem[];
|
|
73
|
+
getEmailInputTextMlc(emailValue: string, inputCode?: string): import("@diia-inhouse/design-system").InputTextMlc;
|
|
74
|
+
getContactsComponentTextLabel(user: import("@diia-inhouse/types").UserTokenData, phoneNumber: string): import("@diia-inhouse/design-system").TextLabelMlc | undefined;
|
|
75
|
+
extractPhoneNumber(phoneNumber: string, phoneCodeValue: string): string | never;
|
|
76
|
+
};
|
|
77
|
+
random: {
|
|
78
|
+
generateUUID: typeof import("node:crypto").randomUUID;
|
|
79
|
+
getRandomIntsString(length?: number): string;
|
|
80
|
+
};
|
|
81
|
+
type: {
|
|
82
|
+
isObject(value: any): boolean;
|
|
83
|
+
isArray(value: any): boolean;
|
|
84
|
+
isBuffer(value: any): boolean;
|
|
85
|
+
};
|
|
86
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ProcessObjectCallback = (value: string) => string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
declare class PhoneticChecker {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
private equalityCoefficientThreshold;
|
|
3
|
+
arePhoneticallySimilar(etalonValue: string, slaveValue: string, threshold?: number): boolean;
|
|
4
|
+
private getEqualityCoefficient;
|
|
4
5
|
}
|
|
5
6
|
export declare const phoneticChecker: PhoneticChecker;
|
|
6
7
|
export {};
|
|
@@ -1,12 +1,55 @@
|
|
|
1
|
-
import { ContactsResponse, DSBodyItem, InputPhoneCodeOrg, InputTextMlc,
|
|
1
|
+
import { ContactsResponse, DSBodyItem, InputPhoneCodeItem, InputPhoneCodeOrg, InputTextMlc, TextLabelMlc } from '@diia-inhouse/design-system';
|
|
2
|
+
import { UserTokenData } from '@diia-inhouse/types';
|
|
2
3
|
import { InputPhoneCodeOrgParams } from './interfaces/publicService';
|
|
3
4
|
export declare const PublicServiceUtils: {
|
|
4
5
|
getContacts(user: UserTokenData): ContactsResponse;
|
|
5
6
|
getContactsText(user: UserTokenData): string;
|
|
6
7
|
getContactsComponent(user: UserTokenData, inputCode?: string): DSBodyItem;
|
|
8
|
+
/**
|
|
9
|
+
* Creates an InputPhoneCodeOrg with specified parameters
|
|
10
|
+
* @param params.codeIds - Optional array of allowed country code IDs
|
|
11
|
+
* @returns InputPhoneCodeOrg
|
|
12
|
+
* @example
|
|
13
|
+
* // Create a phone input with Ukrainian code
|
|
14
|
+
* const phoneInput = getInputPhoneCodeOrg({
|
|
15
|
+
* inputCode: 'phone',
|
|
16
|
+
* phoneValue: '501234567',
|
|
17
|
+
* codeValueId: 'ua',
|
|
18
|
+
* codeIds: ['ua', 'pl'],
|
|
19
|
+
* hint: 'Enter your phone number'
|
|
20
|
+
* });
|
|
21
|
+
*/
|
|
7
22
|
getInputPhoneCodeOrg(params: InputPhoneCodeOrgParams): InputPhoneCodeOrg;
|
|
23
|
+
/**
|
|
24
|
+
* Returns an array of phone code items, optionally filtered by provided code IDs
|
|
25
|
+
* @param filter - Optional array of phone code IDs to filter by
|
|
26
|
+
* @returns Array of phone code items matching the filter criteria, or all phone codes if no filter is provided
|
|
27
|
+
* @example
|
|
28
|
+
* // Get all phone codes
|
|
29
|
+
* const allCodes = getInputPhoneCodeItems();
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* // Get only Ukrainian and Polish phone codes
|
|
33
|
+
* const filteredCodes = getInputPhoneCodeItems(['ua', 'pl']);
|
|
34
|
+
*/
|
|
35
|
+
getInputPhoneCodeItems(filter?: string[]): InputPhoneCodeItem[];
|
|
8
36
|
getEmailInputTextMlc(emailValue: string, inputCode?: string): InputTextMlc;
|
|
9
37
|
getContactsComponentTextLabel(user: UserTokenData, phoneNumber: string): TextLabelMlc | undefined;
|
|
10
|
-
|
|
11
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Extracts the phone number from the phone number string
|
|
40
|
+
*
|
|
41
|
+
* @param phoneNumber - Phone number to extract the number from
|
|
42
|
+
* @param phoneCodeValue - Phone country code in ISO 3166-1 alpha-2 format
|
|
43
|
+
* @returns Extracted phone number (without country code)
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* extractPhoneNumber('+380123456789', 'ua') // 123456789
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* extractPhoneNumber('123456789', 'ua') // throws Error(`Phone number must start with country code 380`)
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* extractPhoneNumber('380123456789', 'invalid') // throws Error(`Invalid country code`)
|
|
53
|
+
*/
|
|
54
|
+
extractPhoneNumber(phoneNumber: string, phoneCodeValue: string): string | never;
|
|
12
55
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RichTextElement, RichTextEmoji } from '@slack/types';
|
|
2
|
+
import { GetListValueOptions } from './interfaces/slack';
|
|
3
|
+
export declare class SlackFormattingUtils {
|
|
4
|
+
readonly greenCircleEmoji: RichTextEmoji;
|
|
5
|
+
readonly redCircleEmoji: RichTextEmoji;
|
|
6
|
+
getValue(name: string, value: string | number | undefined, { isError }?: GetListValueOptions): RichTextElement[];
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@diia-inhouse/utils",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.3.0",
|
|
4
4
|
"description": "Generic utils",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -11,28 +11,32 @@
|
|
|
11
11
|
"dist"
|
|
12
12
|
],
|
|
13
13
|
"engines": {
|
|
14
|
-
"node": ">=
|
|
14
|
+
"node": ">=22"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
17
|
"prebuild": "rimraf dist",
|
|
18
18
|
"build": "tsc",
|
|
19
19
|
"semantic-release": "semantic-release",
|
|
20
|
-
"lint": "eslint
|
|
21
|
-
"lint-fix": "eslint
|
|
20
|
+
"lint": "eslint . && prettier --check .",
|
|
21
|
+
"lint-fix": "eslint --fix . && prettier --write .",
|
|
22
22
|
"lint:lockfile": "lockfile-lint --path package-lock.json --allowed-hosts registry.npmjs.org --validate-https",
|
|
23
23
|
"prepare": "npm run build",
|
|
24
|
-
"test": "vitest run",
|
|
24
|
+
"test": "tsc --project tests/tsconfig.json --noEmit && vitest run",
|
|
25
25
|
"test:watch": "vitest watch",
|
|
26
26
|
"find-circulars": "madge --circular --extensions ts ./"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@
|
|
30
|
-
"
|
|
29
|
+
"@diia-inhouse/design-system": "3.0.2",
|
|
30
|
+
"@types/luxon": "3.7.1",
|
|
31
|
+
"bson": "7.2.0",
|
|
31
32
|
"compare-versions": "6.1.1",
|
|
33
|
+
"design-system": "2.5.0",
|
|
32
34
|
"fast-levenshtein": "3.0.0",
|
|
33
|
-
"lodash": "4.17.
|
|
34
|
-
"luxon": "3.
|
|
35
|
-
"
|
|
35
|
+
"lodash": "4.17.23",
|
|
36
|
+
"luxon": "3.7.2",
|
|
37
|
+
"map-age-cleaner": "0.2.0",
|
|
38
|
+
"moment": "2.30.1",
|
|
39
|
+
"type-fest": "4.41.0"
|
|
36
40
|
},
|
|
37
41
|
"peerDependencies": {
|
|
38
42
|
"@diia-inhouse/errors": ">=1.4.1",
|
|
@@ -40,53 +44,33 @@
|
|
|
40
44
|
"@diia-inhouse/validators": ">=1.5.0"
|
|
41
45
|
},
|
|
42
46
|
"devDependencies": {
|
|
43
|
-
"@diia-inhouse/configs": "
|
|
44
|
-
"@diia-inhouse/errors": "1.
|
|
45
|
-
"@diia-inhouse/eslint-config": "
|
|
46
|
-
"@diia-inhouse/test": "
|
|
47
|
-
"@diia-inhouse/types": "
|
|
48
|
-
"@diia-inhouse/validators": "1.
|
|
47
|
+
"@diia-inhouse/configs": "6.1.1",
|
|
48
|
+
"@diia-inhouse/errors": "1.17.0",
|
|
49
|
+
"@diia-inhouse/eslint-config": "8.2.4",
|
|
50
|
+
"@diia-inhouse/test": "7.2.0",
|
|
51
|
+
"@diia-inhouse/types": "11.3.0",
|
|
52
|
+
"@diia-inhouse/validators": "1.28.0",
|
|
53
|
+
"@slack/types": "2.20.0",
|
|
49
54
|
"@types/fast-levenshtein": "0.0.4",
|
|
50
|
-
"@types/lodash": "4.17.
|
|
51
|
-
"@types/node": "
|
|
52
|
-
"@
|
|
53
|
-
"@vitest/
|
|
54
|
-
"
|
|
55
|
-
"lockfile-lint": "4.14.
|
|
55
|
+
"@types/lodash": "4.17.24",
|
|
56
|
+
"@types/node": "25.3.3",
|
|
57
|
+
"@vitest/coverage-v8": "4.0.18",
|
|
58
|
+
"@vitest/ui": "4.0.18",
|
|
59
|
+
"eslint": "9.39.3",
|
|
60
|
+
"lockfile-lint": "4.14.1",
|
|
56
61
|
"madge": "8.0.0",
|
|
57
|
-
"protobufjs": "7.4
|
|
58
|
-
"rimraf": "6.
|
|
59
|
-
"
|
|
60
|
-
"
|
|
62
|
+
"protobufjs": "7.5.4",
|
|
63
|
+
"rimraf": "6.1.3",
|
|
64
|
+
"typescript": "5.9.3",
|
|
65
|
+
"vite-tsconfig-paths": "6.1.1",
|
|
66
|
+
"vitest": "4.0.18"
|
|
61
67
|
},
|
|
62
68
|
"release": {
|
|
63
|
-
"extends": "@diia-inhouse/configs/dist/semantic-release/package"
|
|
64
|
-
"branches": [
|
|
65
|
-
"main"
|
|
66
|
-
]
|
|
69
|
+
"extends": "@diia-inhouse/configs/dist/semantic-release/package"
|
|
67
70
|
},
|
|
68
71
|
"commitlint": {
|
|
69
72
|
"extends": "@diia-inhouse/configs/dist/commitlint"
|
|
70
73
|
},
|
|
71
|
-
"eslintConfig": {
|
|
72
|
-
"extends": "@diia-inhouse/eslint-config",
|
|
73
|
-
"rules": {
|
|
74
|
-
"@typescript-eslint/no-explicit-any": "warn"
|
|
75
|
-
},
|
|
76
|
-
"overrides": [
|
|
77
|
-
{
|
|
78
|
-
"files": [
|
|
79
|
-
"*.ts"
|
|
80
|
-
],
|
|
81
|
-
"parserOptions": {
|
|
82
|
-
"project": [
|
|
83
|
-
"./tsconfig.json",
|
|
84
|
-
"./tests/tsconfig.json"
|
|
85
|
-
]
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
]
|
|
89
|
-
},
|
|
90
74
|
"prettier": "@diia-inhouse/eslint-config/prettier",
|
|
91
75
|
"madge": {
|
|
92
76
|
"tsConfig": "./tsconfig.json"
|