@candlerip/shared3 0.0.142 → 0.0.144
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +3 -2
- package/src/backend/cache/cache/config.d.ts +34 -0
- package/src/backend/cache/cache/config.js +34 -0
- package/src/backend/cache/cache/index.d.ts +1 -0
- package/src/backend/cache/cache/index.js +1 -0
- package/src/backend/cache/cache/singleton.js +1 -1
- package/src/backend/cache/cache/type.d.ts +8 -2
- package/src/backend/cache/cache-key/config.d.ts +2 -1
- package/src/backend/cache/cache-key/config.js +2 -32
- package/src/backend/database/aggregate/candle-person/config.d.ts +2 -0
- package/src/backend/database/aggregate/candle-person/config.js +16 -0
- package/src/backend/database/aggregate/candle-person/index.d.ts +1 -0
- package/src/backend/database/aggregate/candle-person/index.js +1 -0
- package/src/backend/database/aggregate/index.d.ts +1 -0
- package/src/backend/database/aggregate/index.js +1 -0
- package/src/backend/database/index.d.ts +1 -0
- package/src/backend/database/index.js +1 -0
- package/src/backend/database/model/candle/candle-db-model.d.ts +2 -0
- package/src/backend/database/model/candle/candle-db-model.js +3 -0
- package/src/backend/database/model/candle/candle-db-schema.d.ts +39 -0
- package/src/backend/database/model/candle/candle-db-schema.js +9 -0
- package/src/backend/database/model/candle/index.d.ts +2 -0
- package/src/backend/database/model/candle/index.js +2 -0
- package/src/backend/database/model/index.d.ts +1 -0
- package/src/backend/database/model/index.js +1 -0
- package/src/backend/database/mutation/candle/get-candles/index.d.ts +2 -0
- package/src/backend/database/mutation/candle/get-candles/index.js +94 -0
- package/src/backend/database/mutation/candle/get-candles/type.d.ts +17 -0
- package/src/backend/database/mutation/candle/get-candles/type.js +1 -0
- package/src/backend/database/mutation/candle/index.d.ts +1 -0
- package/src/backend/database/mutation/candle/index.js +1 -0
- package/src/backend/database/mutation/index.d.ts +1 -0
- package/src/backend/database/mutation/index.js +1 -0
- package/src/backend/page/index.d.ts +1 -0
- package/src/backend/page/index.js +1 -0
- package/src/backend/page/page-data/candles/compose-candles-page-data/index.d.ts +2 -0
- package/src/backend/page/page-data/candles/compose-candles-page-data/index.js +30 -0
- package/src/backend/page/page-data/candles/compose-candles-page-data/type.d.ts +12 -0
- package/src/backend/page/page-data/candles/compose-candles-page-data/type.js +1 -0
- package/src/backend/page/page-data/candles/index.d.ts +2 -0
- package/src/backend/page/page-data/candles/index.js +2 -0
- package/src/backend/page/page-data/candles/type.d.ts +14 -0
- package/src/backend/page/page-data/candles/type.js +1 -0
- package/src/backend/page/page-data/index.d.ts +1 -0
- package/src/backend/page/page-data/index.js +1 -0
- package/src/candle/burning-candle-state/config.d.ts +1 -0
- package/src/candle/burning-candle-state/config.js +1 -0
- package/src/candle/burning-candle-state/index.d.ts +3 -0
- package/src/candle/burning-candle-state/index.js +3 -0
- package/src/candle/burning-candle-state/type-guard.d.ts +2 -0
- package/src/candle/burning-candle-state/type-guard.js +4 -0
- package/src/candle/burning-candle-state/type.d.ts +2 -0
- package/src/candle/burning-candle-state/type.js +1 -0
- package/src/candle/index.d.ts +2 -0
- package/src/candle/index.js +2 -0
- package/src/candle/type.d.ts +11 -0
- package/src/candle/type.js +1 -0
- package/src/filter-sort/candle-filter-sort/default.d.ts +2 -0
- package/src/filter-sort/candle-filter-sort/default.js +5 -0
- package/src/filter-sort/candle-filter-sort/index.d.ts +2 -0
- package/src/filter-sort/candle-filter-sort/index.js +2 -0
- package/src/filter-sort/candle-filter-sort/type.d.ts +12 -0
- package/src/filter-sort/candle-filter-sort/type.js +1 -0
- package/src/filter-sort/index.d.ts +1 -0
- package/src/filter-sort/index.js +1 -0
- package/src/filter-sort/sort-name/candle-sort-name/config.d.ts +1 -0
- package/src/filter-sort/sort-name/candle-sort-name/config.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-guard.d.ts +2 -0
- package/src/filter-sort/sort-name/candle-sort-name/type-guard.js +4 -0
- package/src/filter-sort/sort-name/candle-sort-name/type.d.ts +2 -0
- package/src/filter-sort/sort-name/candle-sort-name/type.js +1 -0
- package/src/filter-sort/sort-name/index.d.ts +1 -0
- package/src/filter-sort/sort-name/index.js +1 -0
- package/src/filter-sort/sort-order/config.d.ts +1 -0
- package/src/filter-sort/sort-order/config.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-guard.d.ts +2 -0
- package/src/filter-sort/sort-order/type-guard.js +4 -0
- package/src/filter-sort/sort-order/type.d.ts +2 -0
- package/src/filter-sort/sort-order/type.js +1 -0
- package/src/geographical/county-code/config.d.ts +1 -0
- package/src/geographical/county-code/config.js +248 -0
- package/src/geographical/county-code/index.d.ts +3 -0
- package/src/geographical/county-code/index.js +3 -0
- package/src/geographical/county-code/type-guard.d.ts +2 -0
- package/src/geographical/county-code/type-guard.js +4 -0
- package/src/geographical/county-code/type.d.ts +2 -0
- package/src/geographical/county-code/type.js +1 -0
- package/src/geographical/index.d.ts +1 -0
- package/src/geographical/index.js +1 -0
- package/src/index.d.ts +3 -0
- package/src/index.js +3 -0
- package/src/person/index.d.ts +1 -0
- package/src/person/index.js +1 -0
- package/src/person/type.d.ts +21 -0
- package/src/person/type.js +1 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@candlerip/shared3",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.144",
|
4
4
|
"type": "module",
|
5
5
|
"exports": {
|
6
6
|
".": "./src/index.js",
|
@@ -11,7 +11,8 @@
|
|
11
11
|
"./backend/dictionary": "./src/backend/dictionary/index.js",
|
12
12
|
"./backend/environment": "./src/backend/environment/index.js",
|
13
13
|
"./backend/express": "./src/backend/express/index.js",
|
14
|
-
"./backend/message-broker": "./src/backend/message-broker/index.js"
|
14
|
+
"./backend/message-broker": "./src/backend/message-broker/index.js",
|
15
|
+
"./backend/page": "./src/backend/page/index.js"
|
15
16
|
},
|
16
17
|
"bin": {
|
17
18
|
"crs-cdk-deploy": "./_devops/cdk/cdk-deploy.sh",
|
@@ -0,0 +1,34 @@
|
|
1
|
+
export declare const CACHE: {
|
2
|
+
readonly 'add-person-page-dictionary-en': "Dictionary";
|
3
|
+
readonly 'add-person-page-dictionary-hu': "Dictionary";
|
4
|
+
readonly 'candle-details-page-dictionary-en': "Dictionary";
|
5
|
+
readonly 'candle-details-page-dictionary-hu': "Dictionary";
|
6
|
+
readonly 'candles-page-data-en': "CandlesPageData";
|
7
|
+
readonly 'candles-page-data-hu': "CandlesPageData";
|
8
|
+
readonly 'candles-page-dictionary-en': "Dictionary";
|
9
|
+
readonly 'candles-page-dictionary-hu': "Dictionary";
|
10
|
+
readonly 'contact-page-dictionary-en': "Dictionary";
|
11
|
+
readonly 'contact-page-dictionary-hu': "Dictionary";
|
12
|
+
readonly 'cookie-policy-page-dictionary-en': "Dictionary";
|
13
|
+
readonly 'cookie-policy-page-dictionary-hu': "Dictionary";
|
14
|
+
readonly 'edit-candle-page-dictionary-en': "Dictionary";
|
15
|
+
readonly 'edit-candle-page-dictionary-hu': "Dictionary";
|
16
|
+
readonly 'edit-person-page-dictionary-en': "Dictionary";
|
17
|
+
readonly 'edit-person-page-dictionary-hu': "Dictionary";
|
18
|
+
readonly 'light-candle-page-dictionary-en': "Dictionary";
|
19
|
+
readonly 'light-candle-page-dictionary-hu': "Dictionary";
|
20
|
+
readonly 'help-page-dictionary-en': "Dictionary";
|
21
|
+
readonly 'help-page-dictionary-hu': "Dictionary";
|
22
|
+
readonly 'home-page-dictionary-en': "Dictionary";
|
23
|
+
readonly 'home-page-dictionary-hu': "Dictionary";
|
24
|
+
readonly 'person-candles-page-dictionary-en': "Dictionary";
|
25
|
+
readonly 'person-candles-page-dictionary-hu': "Dictionary";
|
26
|
+
readonly 'person-details-page-dictionary-en': "Dictionary";
|
27
|
+
readonly 'person-details-page-dictionary-hu': "Dictionary";
|
28
|
+
readonly 'persons-page-dictionary-en': "Dictionary";
|
29
|
+
readonly 'persons-page-dictionary-hu': "Dictionary";
|
30
|
+
readonly 'persons-map-page-dictionary-en': "Dictionary";
|
31
|
+
readonly 'persons-map-page-dictionary-hu': "Dictionary";
|
32
|
+
readonly 'terms-and-conditions-page-dictionary-en': "Dictionary";
|
33
|
+
readonly 'terms-and-conditions-page-dictionary-hu': "Dictionary";
|
34
|
+
};
|
@@ -0,0 +1,34 @@
|
|
1
|
+
export const CACHE = {
|
2
|
+
'add-person-page-dictionary-en': 'Dictionary',
|
3
|
+
'add-person-page-dictionary-hu': 'Dictionary',
|
4
|
+
'candle-details-page-dictionary-en': 'Dictionary',
|
5
|
+
'candle-details-page-dictionary-hu': 'Dictionary',
|
6
|
+
'candles-page-data-en': 'CandlesPageData',
|
7
|
+
'candles-page-data-hu': 'CandlesPageData',
|
8
|
+
'candles-page-dictionary-en': 'Dictionary',
|
9
|
+
'candles-page-dictionary-hu': 'Dictionary',
|
10
|
+
'contact-page-dictionary-en': 'Dictionary',
|
11
|
+
'contact-page-dictionary-hu': 'Dictionary',
|
12
|
+
'cookie-policy-page-dictionary-en': 'Dictionary',
|
13
|
+
'cookie-policy-page-dictionary-hu': 'Dictionary',
|
14
|
+
'edit-candle-page-dictionary-en': 'Dictionary',
|
15
|
+
'edit-candle-page-dictionary-hu': 'Dictionary',
|
16
|
+
'edit-person-page-dictionary-en': 'Dictionary',
|
17
|
+
'edit-person-page-dictionary-hu': 'Dictionary',
|
18
|
+
'light-candle-page-dictionary-en': 'Dictionary',
|
19
|
+
'light-candle-page-dictionary-hu': 'Dictionary',
|
20
|
+
'help-page-dictionary-en': 'Dictionary',
|
21
|
+
'help-page-dictionary-hu': 'Dictionary',
|
22
|
+
'home-page-dictionary-en': 'Dictionary',
|
23
|
+
'home-page-dictionary-hu': 'Dictionary',
|
24
|
+
'person-candles-page-dictionary-en': 'Dictionary',
|
25
|
+
'person-candles-page-dictionary-hu': 'Dictionary',
|
26
|
+
'person-details-page-dictionary-en': 'Dictionary',
|
27
|
+
'person-details-page-dictionary-hu': 'Dictionary',
|
28
|
+
'persons-page-dictionary-en': 'Dictionary',
|
29
|
+
'persons-page-dictionary-hu': 'Dictionary',
|
30
|
+
'persons-map-page-dictionary-en': 'Dictionary',
|
31
|
+
'persons-map-page-dictionary-hu': 'Dictionary',
|
32
|
+
'terms-and-conditions-page-dictionary-en': 'Dictionary',
|
33
|
+
'terms-and-conditions-page-dictionary-hu': 'Dictionary',
|
34
|
+
};
|
@@ -1,5 +1,11 @@
|
|
1
1
|
import { Dictionary } from '../../../dictionary/index.js';
|
2
|
-
import {
|
2
|
+
import { CandlesPageData } from '../../page/index.js';
|
3
|
+
import { CACHE } from './config.js';
|
3
4
|
export type Cache = {
|
4
|
-
[key in
|
5
|
+
[key in keyof typeof CACHE]: TypeMap[(typeof CACHE)[key]];
|
5
6
|
};
|
7
|
+
interface TypeMap {
|
8
|
+
CandlesPageData: CandlesPageData;
|
9
|
+
Dictionary: Dictionary;
|
10
|
+
}
|
11
|
+
export {};
|
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
import { CACHE } from '../cache/config.js';
|
2
|
+
export declare const CACHE_KEYS: Array<keyof typeof CACHE>;
|
@@ -1,32 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
'add-person-page-dictionary-hu',
|
4
|
-
'candle-details-page-dictionary-en',
|
5
|
-
'candle-details-page-dictionary-hu',
|
6
|
-
'candles-page-dictionary-en',
|
7
|
-
'candles-page-dictionary-hu',
|
8
|
-
'contact-page-dictionary-en',
|
9
|
-
'contact-page-dictionary-hu',
|
10
|
-
'cookie-policy-page-dictionary-en',
|
11
|
-
'cookie-policy-page-dictionary-hu',
|
12
|
-
'edit-candle-page-dictionary-en',
|
13
|
-
'edit-candle-page-dictionary-hu',
|
14
|
-
'edit-person-page-dictionary-en',
|
15
|
-
'edit-person-page-dictionary-hu',
|
16
|
-
'light-candle-page-dictionary-en',
|
17
|
-
'light-candle-page-dictionary-hu',
|
18
|
-
'help-page-dictionary-en',
|
19
|
-
'help-page-dictionary-hu',
|
20
|
-
'home-page-dictionary-en',
|
21
|
-
'home-page-dictionary-hu',
|
22
|
-
'person-candles-page-dictionary-en',
|
23
|
-
'person-candles-page-dictionary-hu',
|
24
|
-
'person-details-page-dictionary-en',
|
25
|
-
'person-details-page-dictionary-hu',
|
26
|
-
'persons-page-dictionary-en',
|
27
|
-
'persons-page-dictionary-hu',
|
28
|
-
'persons-map-page-dictionary-en',
|
29
|
-
'persons-map-page-dictionary-hu',
|
30
|
-
'terms-and-conditions-page-dictionary-en',
|
31
|
-
'terms-and-conditions-page-dictionary-hu',
|
32
|
-
];
|
1
|
+
import { CACHE } from '../cache/config.js';
|
2
|
+
export const CACHE_KEYS = Object.keys(CACHE);
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './config.js';
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './config.js';
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './candle-person/index.js';
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './candle-person/index.js';
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import * as mongoose from 'mongoose';
|
2
|
+
export declare const CandleDbSchema: mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
3
|
+
timestamps: true;
|
4
|
+
versionKey: false;
|
5
|
+
}, {
|
6
|
+
createdAt: NativeDate;
|
7
|
+
updatedAt: NativeDate;
|
8
|
+
} & {
|
9
|
+
litName?: string | null | undefined;
|
10
|
+
burningEndsAt?: NativeDate | null | undefined;
|
11
|
+
personId?: mongoose.Types.ObjectId | null | undefined;
|
12
|
+
burningMinutes?: number | null | undefined;
|
13
|
+
description?: string | null | undefined;
|
14
|
+
userId?: string | null | undefined;
|
15
|
+
}, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
|
16
|
+
createdAt: NativeDate;
|
17
|
+
updatedAt: NativeDate;
|
18
|
+
} & {
|
19
|
+
litName?: string | null | undefined;
|
20
|
+
burningEndsAt?: NativeDate | null | undefined;
|
21
|
+
personId?: mongoose.Types.ObjectId | null | undefined;
|
22
|
+
burningMinutes?: number | null | undefined;
|
23
|
+
description?: string | null | undefined;
|
24
|
+
userId?: string | null | undefined;
|
25
|
+
}>> & mongoose.FlatRecord<{
|
26
|
+
createdAt: NativeDate;
|
27
|
+
updatedAt: NativeDate;
|
28
|
+
} & {
|
29
|
+
litName?: string | null | undefined;
|
30
|
+
burningEndsAt?: NativeDate | null | undefined;
|
31
|
+
personId?: mongoose.Types.ObjectId | null | undefined;
|
32
|
+
burningMinutes?: number | null | undefined;
|
33
|
+
description?: string | null | undefined;
|
34
|
+
userId?: string | null | undefined;
|
35
|
+
}> & {
|
36
|
+
_id: mongoose.Types.ObjectId;
|
37
|
+
} & {
|
38
|
+
__v: number;
|
39
|
+
}>;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import * as mongoose from 'mongoose';
|
2
|
+
export const CandleDbSchema = new mongoose.Schema({
|
3
|
+
burningEndsAt: { type: Date },
|
4
|
+
burningMinutes: { type: Number },
|
5
|
+
description: { type: String },
|
6
|
+
litName: { type: String },
|
7
|
+
personId: { type: mongoose.Schema.ObjectId },
|
8
|
+
userId: { type: String },
|
9
|
+
}, { timestamps: true, versionKey: false });
|
@@ -0,0 +1,94 @@
|
|
1
|
+
import { Types } from 'mongoose';
|
2
|
+
import { customErrorWorker } from '@candlerip/shared3';
|
3
|
+
import { CANDLE_PERSON_AGGREGATE } from '../../../aggregate/index.js';
|
4
|
+
import { CandleDbModel } from '../../../model/index.js';
|
5
|
+
export const getCandles = async (props) => {
|
6
|
+
const { filterSort, withPerson } = props;
|
7
|
+
const { composeCustomError } = customErrorWorker(props);
|
8
|
+
const { burning_states: burningStates, count, person_id: personId, skip_count: skipCount, sort_name: sortName, sort_order: sortOrder, user_id: userId, } = filterSort;
|
9
|
+
const aggregates = [];
|
10
|
+
if (personId) {
|
11
|
+
aggregates.push({ $match: { personId: new Types.ObjectId(personId) } });
|
12
|
+
}
|
13
|
+
if (userId) {
|
14
|
+
aggregates.push({ $match: { userId } });
|
15
|
+
}
|
16
|
+
if (burningStates) {
|
17
|
+
aggregates.push({
|
18
|
+
$match: {
|
19
|
+
$or: burningStates.map((it) => ({
|
20
|
+
burningEndsAt: it === 'burning'
|
21
|
+
? {
|
22
|
+
$gte: new Date(),
|
23
|
+
}
|
24
|
+
: { $lte: new Date() },
|
25
|
+
})),
|
26
|
+
},
|
27
|
+
});
|
28
|
+
}
|
29
|
+
if (withPerson) {
|
30
|
+
aggregates.push(...CANDLE_PERSON_AGGREGATE);
|
31
|
+
}
|
32
|
+
if (sortName === 'litAt') {
|
33
|
+
aggregates.push({
|
34
|
+
$addFields: {
|
35
|
+
sortField: {
|
36
|
+
$dateSubtract: {
|
37
|
+
startDate: '$burningEndsAt',
|
38
|
+
unit: 'minute',
|
39
|
+
amount: '$burningMinutes',
|
40
|
+
},
|
41
|
+
},
|
42
|
+
},
|
43
|
+
});
|
44
|
+
aggregates.push({
|
45
|
+
$sort: {
|
46
|
+
sortField: sortOrder === 'asc' ? 1 : -1,
|
47
|
+
},
|
48
|
+
});
|
49
|
+
aggregates.push({
|
50
|
+
$unset: 'sortField',
|
51
|
+
});
|
52
|
+
}
|
53
|
+
else {
|
54
|
+
aggregates.push({
|
55
|
+
$sort: {
|
56
|
+
[sortName]: sortOrder === 'asc' ? 1 : -1,
|
57
|
+
},
|
58
|
+
});
|
59
|
+
}
|
60
|
+
const dataAggregates = [...aggregates];
|
61
|
+
if (skipCount) {
|
62
|
+
dataAggregates.push({
|
63
|
+
$skip: skipCount,
|
64
|
+
});
|
65
|
+
}
|
66
|
+
const facetAggregates = [
|
67
|
+
{
|
68
|
+
$facet: {
|
69
|
+
data: [
|
70
|
+
...dataAggregates,
|
71
|
+
{
|
72
|
+
$limit: count,
|
73
|
+
},
|
74
|
+
],
|
75
|
+
total: [...aggregates, { $count: 'totalCount' }],
|
76
|
+
},
|
77
|
+
},
|
78
|
+
];
|
79
|
+
let data;
|
80
|
+
try {
|
81
|
+
data = await CandleDbModel.aggregate(facetAggregates);
|
82
|
+
}
|
83
|
+
catch (err) {
|
84
|
+
return {
|
85
|
+
customError: composeCustomError('Get candles failed', { err }),
|
86
|
+
};
|
87
|
+
}
|
88
|
+
return {
|
89
|
+
data: {
|
90
|
+
candles: data[0].data,
|
91
|
+
candlesCount: data[0].total.length > 0 ? data[0].total[0].totalCount : 0,
|
92
|
+
},
|
93
|
+
};
|
94
|
+
};
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { Candle } from '../../../../../candle/index.js';
|
2
|
+
import { CustomError } from '../../../../../error/index.js';
|
3
|
+
import { CandleFilterSort } from '../../../../../filter-sort/index.js';
|
4
|
+
import { Person } from '../../../../../person/index.js';
|
5
|
+
export type GetCandles = <T extends Candle | (Candle & {
|
6
|
+
person?: Person;
|
7
|
+
}) = never>(props: {
|
8
|
+
filterSort: CandleFilterSort;
|
9
|
+
withPerson?: boolean;
|
10
|
+
}) => Promise<{
|
11
|
+
data: {
|
12
|
+
candles: T[];
|
13
|
+
candlesCount: number;
|
14
|
+
};
|
15
|
+
} | {
|
16
|
+
customError: CustomError;
|
17
|
+
}>;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './get-candles/index.js';
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './get-candles/index.js';
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './page-data/index.js';
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './page-data/index.js';
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import { DICTIONARY_CONFIG } from '../../../../../dictionary/index.js';
|
2
|
+
import { DEFAULT_CANDLE_FILTER_SORT } from '../../../../../filter-sort/index.js';
|
3
|
+
import { getCandles, getTranslationsAsDictionary } from '../../../../database/index.js';
|
4
|
+
export const composeCandlesPageData = async ({ filterSort: initFilterSort, language }) => {
|
5
|
+
const filterSort = {
|
6
|
+
...DEFAULT_CANDLE_FILTER_SORT,
|
7
|
+
...initFilterSort,
|
8
|
+
};
|
9
|
+
let resp;
|
10
|
+
resp = await getTranslationsAsDictionary(language, DICTIONARY_CONFIG['candles-page'].translationIds);
|
11
|
+
if ('customError' in resp) {
|
12
|
+
return resp;
|
13
|
+
}
|
14
|
+
const dictionary = resp.data;
|
15
|
+
resp = await getCandles({ filterSort, withPerson: true });
|
16
|
+
if ('customError' in resp) {
|
17
|
+
return resp;
|
18
|
+
}
|
19
|
+
const { candles, candlesCount } = resp.data;
|
20
|
+
return {
|
21
|
+
data: {
|
22
|
+
candlesList: {
|
23
|
+
candles,
|
24
|
+
candlesCount,
|
25
|
+
},
|
26
|
+
dictionary,
|
27
|
+
filterSort,
|
28
|
+
},
|
29
|
+
};
|
30
|
+
};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { Language } from '../../../../../dictionary/index.js';
|
2
|
+
import { CustomError } from '../../../../../error/index.js';
|
3
|
+
import { CandleFilterSort } from '../../../../../filter-sort/index.js';
|
4
|
+
import { CandlesPageData } from '../type.js';
|
5
|
+
export type ComposeCandlesPageData = (props: {
|
6
|
+
filterSort: CandleFilterSort;
|
7
|
+
language: Language;
|
8
|
+
}) => Promise<{
|
9
|
+
data: CandlesPageData;
|
10
|
+
} | {
|
11
|
+
customError: CustomError;
|
12
|
+
}>;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { Candle } from '../../../../candle/index.js';
|
2
|
+
import { Dictionary } from '../../../../dictionary/index.js';
|
3
|
+
import { CandleFilterSort } from '../../../../filter-sort/index.js';
|
4
|
+
import { Person } from '../../../../person/index.js';
|
5
|
+
export interface CandlesPageData {
|
6
|
+
candlesList: {
|
7
|
+
candles: Array<Candle & {
|
8
|
+
person?: Person;
|
9
|
+
}>;
|
10
|
+
candlesCount: number;
|
11
|
+
};
|
12
|
+
dictionary: Dictionary;
|
13
|
+
filterSort: CandleFilterSort;
|
14
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './candles/index.js';
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './candles/index.js';
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const BURNING_CANDLE_STATES: readonly ["burning", "burned"];
|
@@ -0,0 +1 @@
|
|
1
|
+
export const BURNING_CANDLE_STATES = ['burning', 'burned'];
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -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
|
+
burning_states?: BurningCandleState[];
|
6
|
+
count: number;
|
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 './candle-filter-sort/index.js';
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './candle-filter-sort/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 './candle-sort-name/index.js';
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './candle-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 declare const COUNTRY_CODES: readonly ["AD", "AE", "AF", "AG", "AI", "AL", "AM", "AN", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BM", "BN", "BO", "BR", "BQ", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "GZ", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "ST", "SV", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "XK", "YE", "YT", "ZA", "ZM", "ZW"];
|
@@ -0,0 +1,248 @@
|
|
1
|
+
export const COUNTRY_CODES = [
|
2
|
+
'AD',
|
3
|
+
'AE',
|
4
|
+
'AF',
|
5
|
+
'AG',
|
6
|
+
'AI',
|
7
|
+
'AL',
|
8
|
+
'AM',
|
9
|
+
'AN',
|
10
|
+
'AO',
|
11
|
+
'AQ',
|
12
|
+
'AR',
|
13
|
+
'AS',
|
14
|
+
'AT',
|
15
|
+
'AU',
|
16
|
+
'AW',
|
17
|
+
'AX',
|
18
|
+
'AZ',
|
19
|
+
'BA',
|
20
|
+
'BB',
|
21
|
+
'BD',
|
22
|
+
'BE',
|
23
|
+
'BF',
|
24
|
+
'BG',
|
25
|
+
'BH',
|
26
|
+
'BI',
|
27
|
+
'BJ',
|
28
|
+
'BM',
|
29
|
+
'BN',
|
30
|
+
'BO',
|
31
|
+
'BR',
|
32
|
+
'BQ',
|
33
|
+
'BS',
|
34
|
+
'BT',
|
35
|
+
'BV',
|
36
|
+
'BW',
|
37
|
+
'BY',
|
38
|
+
'BZ',
|
39
|
+
'CA',
|
40
|
+
'CC',
|
41
|
+
'CD',
|
42
|
+
'CF',
|
43
|
+
'CG',
|
44
|
+
'CH',
|
45
|
+
'CI',
|
46
|
+
'CK',
|
47
|
+
'CL',
|
48
|
+
'CM',
|
49
|
+
'CN',
|
50
|
+
'CO',
|
51
|
+
'CR',
|
52
|
+
'CU',
|
53
|
+
'CV',
|
54
|
+
'CX',
|
55
|
+
'CY',
|
56
|
+
'CZ',
|
57
|
+
'DE',
|
58
|
+
'DJ',
|
59
|
+
'DK',
|
60
|
+
'DM',
|
61
|
+
'DO',
|
62
|
+
'DZ',
|
63
|
+
'EC',
|
64
|
+
'EE',
|
65
|
+
'EG',
|
66
|
+
'EH',
|
67
|
+
'ER',
|
68
|
+
'ES',
|
69
|
+
'ET',
|
70
|
+
'FI',
|
71
|
+
'FJ',
|
72
|
+
'FK',
|
73
|
+
'FM',
|
74
|
+
'FO',
|
75
|
+
'FR',
|
76
|
+
'GA',
|
77
|
+
'GB',
|
78
|
+
'GD',
|
79
|
+
'GE',
|
80
|
+
'GF',
|
81
|
+
'GG',
|
82
|
+
'GH',
|
83
|
+
'GI',
|
84
|
+
'GL',
|
85
|
+
'GM',
|
86
|
+
'GN',
|
87
|
+
'GP',
|
88
|
+
'GQ',
|
89
|
+
'GR',
|
90
|
+
'GS',
|
91
|
+
'GT',
|
92
|
+
'GU',
|
93
|
+
'GW',
|
94
|
+
'GY',
|
95
|
+
'GZ',
|
96
|
+
'HK',
|
97
|
+
'HM',
|
98
|
+
'HN',
|
99
|
+
'HR',
|
100
|
+
'HT',
|
101
|
+
'HU',
|
102
|
+
'ID',
|
103
|
+
'IE',
|
104
|
+
'IL',
|
105
|
+
'IM',
|
106
|
+
'IN',
|
107
|
+
'IO',
|
108
|
+
'IQ',
|
109
|
+
'IR',
|
110
|
+
'IS',
|
111
|
+
'IT',
|
112
|
+
'JE',
|
113
|
+
'JM',
|
114
|
+
'JO',
|
115
|
+
'JP',
|
116
|
+
'KE',
|
117
|
+
'KG',
|
118
|
+
'KH',
|
119
|
+
'KI',
|
120
|
+
'KM',
|
121
|
+
'KN',
|
122
|
+
'KP',
|
123
|
+
'KR',
|
124
|
+
'KW',
|
125
|
+
'KY',
|
126
|
+
'KZ',
|
127
|
+
'LA',
|
128
|
+
'LB',
|
129
|
+
'LC',
|
130
|
+
'LI',
|
131
|
+
'LK',
|
132
|
+
'LR',
|
133
|
+
'LS',
|
134
|
+
'LT',
|
135
|
+
'LU',
|
136
|
+
'LV',
|
137
|
+
'LY',
|
138
|
+
'MA',
|
139
|
+
'MC',
|
140
|
+
'MD',
|
141
|
+
'ME',
|
142
|
+
'MG',
|
143
|
+
'MH',
|
144
|
+
'MK',
|
145
|
+
'ML',
|
146
|
+
'MM',
|
147
|
+
'MN',
|
148
|
+
'MO',
|
149
|
+
'MP',
|
150
|
+
'MQ',
|
151
|
+
'MR',
|
152
|
+
'MS',
|
153
|
+
'MT',
|
154
|
+
'MU',
|
155
|
+
'MV',
|
156
|
+
'MW',
|
157
|
+
'MX',
|
158
|
+
'MY',
|
159
|
+
'MZ',
|
160
|
+
'NA',
|
161
|
+
'NC',
|
162
|
+
'NE',
|
163
|
+
'NF',
|
164
|
+
'NG',
|
165
|
+
'NI',
|
166
|
+
'NL',
|
167
|
+
'NO',
|
168
|
+
'NP',
|
169
|
+
'NR',
|
170
|
+
'NU',
|
171
|
+
'NZ',
|
172
|
+
'OM',
|
173
|
+
'PA',
|
174
|
+
'PE',
|
175
|
+
'PF',
|
176
|
+
'PG',
|
177
|
+
'PH',
|
178
|
+
'PK',
|
179
|
+
'PL',
|
180
|
+
'PM',
|
181
|
+
'PN',
|
182
|
+
'PR',
|
183
|
+
'PS',
|
184
|
+
'PT',
|
185
|
+
'PW',
|
186
|
+
'PY',
|
187
|
+
'QA',
|
188
|
+
'RE',
|
189
|
+
'RO',
|
190
|
+
'RS',
|
191
|
+
'RU',
|
192
|
+
'RW',
|
193
|
+
'SA',
|
194
|
+
'SB',
|
195
|
+
'SC',
|
196
|
+
'SD',
|
197
|
+
'SE',
|
198
|
+
'SG',
|
199
|
+
'SH',
|
200
|
+
'SI',
|
201
|
+
'SJ',
|
202
|
+
'SK',
|
203
|
+
'SL',
|
204
|
+
'SM',
|
205
|
+
'SN',
|
206
|
+
'SO',
|
207
|
+
'SR',
|
208
|
+
'ST',
|
209
|
+
'SV',
|
210
|
+
'SY',
|
211
|
+
'SZ',
|
212
|
+
'TC',
|
213
|
+
'TD',
|
214
|
+
'TF',
|
215
|
+
'TG',
|
216
|
+
'TH',
|
217
|
+
'TJ',
|
218
|
+
'TK',
|
219
|
+
'TL',
|
220
|
+
'TM',
|
221
|
+
'TN',
|
222
|
+
'TO',
|
223
|
+
'TR',
|
224
|
+
'TT',
|
225
|
+
'TV',
|
226
|
+
'TW',
|
227
|
+
'TZ',
|
228
|
+
'UA',
|
229
|
+
'UG',
|
230
|
+
'US',
|
231
|
+
'UY',
|
232
|
+
'UZ',
|
233
|
+
'VA',
|
234
|
+
'VC',
|
235
|
+
'VE',
|
236
|
+
'VG',
|
237
|
+
'VI',
|
238
|
+
'VN',
|
239
|
+
'VU',
|
240
|
+
'WF',
|
241
|
+
'WS',
|
242
|
+
'XK',
|
243
|
+
'YE',
|
244
|
+
'YT',
|
245
|
+
'ZA',
|
246
|
+
'ZM',
|
247
|
+
'ZW',
|
248
|
+
];
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './county-code/index.js';
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './county-code/index.js';
|
package/src/index.d.ts
CHANGED
@@ -1,6 +1,9 @@
|
|
1
|
+
export * from './candle/index.js';
|
1
2
|
export * from './dictionary/index.js';
|
2
3
|
export * from './environment/index.js';
|
3
4
|
export * from './error/index.js';
|
5
|
+
export * from './filter-sort/index.js';
|
6
|
+
export * from './geographical/index.js';
|
4
7
|
export * from './helper/index.js';
|
5
8
|
export * from './page/index.js';
|
6
9
|
export * from './person/index.js';
|
package/src/index.js
CHANGED
@@ -1,6 +1,9 @@
|
|
1
|
+
export * from './candle/index.js';
|
1
2
|
export * from './dictionary/index.js';
|
2
3
|
export * from './environment/index.js';
|
3
4
|
export * from './error/index.js';
|
5
|
+
export * from './filter-sort/index.js';
|
6
|
+
export * from './geographical/index.js';
|
4
7
|
export * from './helper/index.js';
|
5
8
|
export * from './page/index.js';
|
6
9
|
export * from './person/index.js';
|
package/src/person/index.d.ts
CHANGED
package/src/person/index.js
CHANGED
@@ -0,0 +1,21 @@
|
|
1
|
+
import { CountryCode } from '../geographical/index.js';
|
2
|
+
import { PersonImage } from './person-image/index.js';
|
3
|
+
export interface Person {
|
4
|
+
_id: string;
|
5
|
+
birth?: {
|
6
|
+
date?: string | null;
|
7
|
+
place?: {
|
8
|
+
countryCode?: CountryCode | null;
|
9
|
+
};
|
10
|
+
};
|
11
|
+
death?: {
|
12
|
+
date?: string | null;
|
13
|
+
};
|
14
|
+
description?: string | null;
|
15
|
+
images?: PersonImage[] | null;
|
16
|
+
isProposable?: boolean;
|
17
|
+
name: string;
|
18
|
+
userId?: string;
|
19
|
+
createdAt: Date;
|
20
|
+
updatedAt: Date;
|
21
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|