@candlerip/shared3 0.0.96 → 0.0.98
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/src/filter-sort/filter-sort/candle-filter-sort/domains/index.d.ts +12 -0
- package/src/filter-sort/filter-sort/candle-filter-sort/domains/index.js +1 -0
- package/src/filter-sort/filter-sort/candle-filter-sort/index.d.ts +1 -0
- package/src/filter-sort/filter-sort/candle-filter-sort/index.js +1 -0
- package/src/filter-sort/filter-sort/index.d.ts +2 -0
- package/src/filter-sort/filter-sort/index.js +2 -0
- package/src/filter-sort/filter-sort/person-filter-sort/domains/index.d.ts +14 -0
- package/src/filter-sort/filter-sort/person-filter-sort/domains/index.js +1 -0
- package/src/filter-sort/filter-sort/person-filter-sort/index.d.ts +1 -0
- package/src/filter-sort/filter-sort/person-filter-sort/index.js +1 -0
- package/src/filter-sort/index.d.ts +4 -0
- package/src/filter-sort/index.js +4 -0
- package/src/filter-sort/sort/domains/index.d.ts +5 -0
- package/src/filter-sort/sort/domains/index.js +1 -0
- package/src/filter-sort/sort/index.d.ts +1 -0
- package/src/filter-sort/sort/index.js +1 -0
- package/src/filter-sort/sort-name/candle-sort-name/configs/index.d.ts +1 -0
- package/src/filter-sort/sort-name/candle-sort-name/configs/index.js +1 -0
- package/src/filter-sort/sort-name/candle-sort-name/domains/index.d.ts +2 -0
- package/src/filter-sort/sort-name/candle-sort-name/domains/index.js +1 -0
- package/src/filter-sort/sort-name/candle-sort-name/index.d.ts +3 -0
- package/src/filter-sort/sort-name/candle-sort-name/index.js +3 -0
- package/src/filter-sort/sort-name/candle-sort-name/type-guards/index.d.ts +1 -0
- package/src/filter-sort/sort-name/candle-sort-name/type-guards/index.js +1 -0
- package/src/filter-sort/sort-name/candle-sort-name/type-guards/is-candle-sort-name/index.d.ts +2 -0
- package/src/filter-sort/sort-name/candle-sort-name/type-guards/is-candle-sort-name/index.js +4 -0
- package/src/filter-sort/sort-name/index.d.ts +2 -0
- package/src/filter-sort/sort-name/index.js +2 -0
- package/src/filter-sort/sort-name/person-sort-name/configs/index.d.ts +1 -0
- package/src/filter-sort/sort-name/person-sort-name/configs/index.js +1 -0
- package/src/filter-sort/sort-name/person-sort-name/domains/index.d.ts +2 -0
- package/src/filter-sort/sort-name/person-sort-name/domains/index.js +1 -0
- package/src/filter-sort/sort-name/person-sort-name/index.d.ts +3 -0
- package/src/filter-sort/sort-name/person-sort-name/index.js +3 -0
- package/src/filter-sort/sort-name/person-sort-name/type-guards/index.d.ts +1 -0
- package/src/filter-sort/sort-name/person-sort-name/type-guards/index.js +1 -0
- package/src/filter-sort/sort-name/person-sort-name/type-guards/is-person-sort-name/index.d.ts +2 -0
- package/src/filter-sort/sort-name/person-sort-name/type-guards/is-person-sort-name/index.js +4 -0
- package/src/filter-sort/sort-order/configs/index.d.ts +1 -0
- package/src/filter-sort/sort-order/configs/index.js +1 -0
- package/src/filter-sort/sort-order/domains/index.d.ts +2 -0
- package/src/filter-sort/sort-order/domains/index.js +1 -0
- package/src/filter-sort/sort-order/index.d.ts +3 -0
- package/src/filter-sort/sort-order/index.js +3 -0
- package/src/filter-sort/sort-order/type-guards/index.d.ts +1 -0
- package/src/filter-sort/sort-order/type-guards/index.js +1 -0
- package/src/filter-sort/sort-order/type-guards/is-sort-order/index.d.ts +2 -0
- package/src/filter-sort/sort-order/type-guards/is-sort-order/index.js +4 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/src/type/array/index.d.ts +1 -0
- package/src/type/array/index.js +1 -0
- package/src/type/array/validate.d.ts +6 -0
- package/src/type/array/validate.js +16 -0
- package/src/type/string/index.d.ts +1 -0
- package/src/type/string/index.js +1 -0
- package/src/type/string/validate-comma-separated-string/index.d.ts +2 -0
- package/src/type/string/validate-comma-separated-string/index.js +17 -0
- package/src/type/string/validate-comma-separated-string/types.d.ts +6 -0
- package/src/type/string/validate-comma-separated-string/types.js +1 -0
package/package.json
CHANGED
@@ -0,0 +1,12 @@
|
|
1
|
+
import { BurningCandleState } from '../../../../candle/index.js';
|
2
|
+
import { CandleSortName } from '../../../sort-name/index.js';
|
3
|
+
import { SortOrder } from '../../../sort-order/index.js';
|
4
|
+
export interface CandleFilterSort {
|
5
|
+
count: number;
|
6
|
+
burning_states?: BurningCandleState[];
|
7
|
+
person_id?: string;
|
8
|
+
skip_count?: number;
|
9
|
+
sort_name: CandleSortName;
|
10
|
+
sort_order: SortOrder;
|
11
|
+
user_id?: string;
|
12
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './domains/index.js';
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './domains/index.js';
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { CountryCode } from '../../../../geographical/index.js';
|
2
|
+
import { PersonSortName } from '../../../sort-name/index.js';
|
3
|
+
import { SortOrder } from '../../../sort-order/index.js';
|
4
|
+
export interface PersonFilterSort {
|
5
|
+
count: number;
|
6
|
+
name?: string;
|
7
|
+
name_case_sensitive?: boolean;
|
8
|
+
place_of_births?: CountryCode[];
|
9
|
+
skip_count?: number;
|
10
|
+
sort_name: PersonSortName;
|
11
|
+
sort_order: SortOrder;
|
12
|
+
user_id?: string;
|
13
|
+
with_photo?: boolean;
|
14
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './domains/index.js';
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './domains/index.js';
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './domains/index.js';
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './domains/index.js';
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const CANDLE_SORT_NAMES: readonly ["burningEndsAt", "createdAt", "litAt", "litName"];
|
@@ -0,0 +1 @@
|
|
1
|
+
export const CANDLE_SORT_NAMES = ['burningEndsAt', 'createdAt', 'litAt', 'litName'];
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './is-candle-sort-name/index.js';
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './is-candle-sort-name/index.js';
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const PERSON_SORT_NAMES: readonly ["createdAt", "name"];
|
@@ -0,0 +1 @@
|
|
1
|
+
export const PERSON_SORT_NAMES = ['createdAt', 'name'];
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './is-person-sort-name/index.js';
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './is-person-sort-name/index.js';
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const SORT_ORDERS: readonly ["asc", "desc"];
|
@@ -0,0 +1 @@
|
|
1
|
+
export const SORT_ORDERS = ['asc', 'desc'];
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './is-sort-order/index.js';
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './is-sort-order/index.js';
|
package/src/index.d.ts
CHANGED
@@ -6,6 +6,7 @@ export * from './database/index.js';
|
|
6
6
|
export * from './date/index.js';
|
7
7
|
export * from './environment/index.js';
|
8
8
|
export * from './error/index.js';
|
9
|
+
export * from './filter-sort/index.js';
|
9
10
|
export * from './geographical/index.js';
|
10
11
|
export * from './helper/index.js';
|
11
12
|
export * from './image/index.js';
|
package/src/index.js
CHANGED
@@ -6,6 +6,7 @@ export * from './database/index.js';
|
|
6
6
|
export * from './date/index.js';
|
7
7
|
export * from './environment/index.js';
|
8
8
|
export * from './error/index.js';
|
9
|
+
export * from './filter-sort/index.js';
|
9
10
|
export * from './geographical/index.js';
|
10
11
|
export * from './helper/index.js';
|
11
12
|
export * from './image/index.js';
|
package/src/type/array/index.js
CHANGED
@@ -0,0 +1,16 @@
|
|
1
|
+
import { customErrorWorker } from '../../error/index.js';
|
2
|
+
export const validateArray = (data, name, valid) => {
|
3
|
+
const { composeCustomError } = customErrorWorker({ data, name, valid });
|
4
|
+
if (!data) {
|
5
|
+
return composeCustomError(`Missing ${name}`);
|
6
|
+
}
|
7
|
+
if (!Array.isArray(data)) {
|
8
|
+
return composeCustomError(`Invalid ${name}`);
|
9
|
+
}
|
10
|
+
if (!data.every((it) => valid.includes(it))) {
|
11
|
+
return composeCustomError(`Invalid ${name}`);
|
12
|
+
}
|
13
|
+
return {
|
14
|
+
data,
|
15
|
+
};
|
16
|
+
};
|
package/src/type/string/index.js
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
import { customErrorWorker } from '../../../error/index.js';
|
2
|
+
import { validateArray } from '../../array/index.js';
|
3
|
+
import { isString } from '../type-guard.js';
|
4
|
+
export const validateCommaSeparatedString = (data, name, valid) => {
|
5
|
+
const { composeCustomError } = customErrorWorker({ data, name, valid });
|
6
|
+
if (!data) {
|
7
|
+
return composeCustomError(`Missing ${name}`);
|
8
|
+
}
|
9
|
+
if (!isString(data)) {
|
10
|
+
return composeCustomError(`${name} not string`);
|
11
|
+
}
|
12
|
+
const parsedArr = data.split(',');
|
13
|
+
if (parsedArr.length === 0) {
|
14
|
+
return composeCustomError(`Invalid ${name}`);
|
15
|
+
}
|
16
|
+
return validateArray(parsedArr, name, valid);
|
17
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|