@candlerip/shared 0.0.140 → 0.0.141
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/database/model/person/configs/index.d.ts +19 -1
- package/database/model/person/configs/index.js +1 -1
- package/database/page-data/person-candles/utils/compose-person-candles-page-data-db/index.js +11 -4
- package/database/page-data/person-candles/utils/compose-person-candles-page-data-db/type.d.ts +3 -4
- package/package.json +1 -1
|
@@ -5,10 +5,13 @@ export declare const PersonDbSchema: mongoose.Schema<any, mongoose.Model<any, an
|
|
|
5
5
|
name?: string | null | undefined;
|
|
6
6
|
createdAt?: NativeDate | null | undefined;
|
|
7
7
|
images?: mongoose.Types.DocumentArray<{
|
|
8
|
+
_id?: unknown;
|
|
8
9
|
fileName?: string | null | undefined;
|
|
9
10
|
}, mongoose.Types.Subdocument<mongoose.mongo.BSON.ObjectId, unknown, {
|
|
11
|
+
_id?: unknown;
|
|
10
12
|
fileName?: string | null | undefined;
|
|
11
13
|
}> & {
|
|
14
|
+
_id?: unknown;
|
|
12
15
|
fileName?: string | null | undefined;
|
|
13
16
|
}> | null | undefined;
|
|
14
17
|
description?: string | null | undefined;
|
|
@@ -27,10 +30,13 @@ export declare const PersonDbSchema: mongoose.Schema<any, mongoose.Model<any, an
|
|
|
27
30
|
name?: string | null | undefined;
|
|
28
31
|
createdAt?: NativeDate | null | undefined;
|
|
29
32
|
images?: mongoose.Types.DocumentArray<{
|
|
33
|
+
_id?: unknown;
|
|
30
34
|
fileName?: string | null | undefined;
|
|
31
35
|
}, mongoose.Types.Subdocument<mongoose.mongo.BSON.ObjectId, unknown, {
|
|
36
|
+
_id?: unknown;
|
|
32
37
|
fileName?: string | null | undefined;
|
|
33
38
|
}> & {
|
|
39
|
+
_id?: unknown;
|
|
34
40
|
fileName?: string | null | undefined;
|
|
35
41
|
}> | null | undefined;
|
|
36
42
|
description?: string | null | undefined;
|
|
@@ -53,10 +59,13 @@ export declare const PersonDbSchema: mongoose.Schema<any, mongoose.Model<any, an
|
|
|
53
59
|
name?: string | null | undefined;
|
|
54
60
|
createdAt?: NativeDate | null | undefined;
|
|
55
61
|
images?: mongoose.Types.DocumentArray<{
|
|
62
|
+
_id?: unknown;
|
|
56
63
|
fileName?: string | null | undefined;
|
|
57
64
|
}, mongoose.Types.Subdocument<mongoose.mongo.BSON.ObjectId, unknown, {
|
|
65
|
+
_id?: unknown;
|
|
58
66
|
fileName?: string | null | undefined;
|
|
59
67
|
}> & {
|
|
68
|
+
_id?: unknown;
|
|
60
69
|
fileName?: string | null | undefined;
|
|
61
70
|
}> | null | undefined;
|
|
62
71
|
description?: string | null | undefined;
|
|
@@ -82,10 +91,13 @@ export declare const PersonDbSchema: mongoose.Schema<any, mongoose.Model<any, an
|
|
|
82
91
|
name?: string | null | undefined;
|
|
83
92
|
createdAt?: NativeDate | null | undefined;
|
|
84
93
|
images?: mongoose.Types.DocumentArray<{
|
|
94
|
+
_id?: unknown;
|
|
85
95
|
fileName?: string | null | undefined;
|
|
86
96
|
}, mongoose.Types.Subdocument<mongoose.mongo.BSON.ObjectId, unknown, {
|
|
97
|
+
_id?: unknown;
|
|
87
98
|
fileName?: string | null | undefined;
|
|
88
99
|
}> & {
|
|
100
|
+
_id?: unknown;
|
|
89
101
|
fileName?: string | null | undefined;
|
|
90
102
|
}> | null | undefined;
|
|
91
103
|
description?: string | null | undefined;
|
|
@@ -108,10 +120,13 @@ export declare const PersonDbSchema: mongoose.Schema<any, mongoose.Model<any, an
|
|
|
108
120
|
name?: string | null | undefined;
|
|
109
121
|
createdAt?: NativeDate | null | undefined;
|
|
110
122
|
images?: mongoose.Types.DocumentArray<{
|
|
123
|
+
_id?: unknown;
|
|
111
124
|
fileName?: string | null | undefined;
|
|
112
125
|
}, mongoose.Types.Subdocument<mongoose.mongo.BSON.ObjectId, unknown, {
|
|
126
|
+
_id?: unknown;
|
|
113
127
|
fileName?: string | null | undefined;
|
|
114
128
|
}> & {
|
|
129
|
+
_id?: unknown;
|
|
115
130
|
fileName?: string | null | undefined;
|
|
116
131
|
}> | null | undefined;
|
|
117
132
|
description?: string | null | undefined;
|
|
@@ -135,10 +150,13 @@ export declare const PersonDbSchema: mongoose.Schema<any, mongoose.Model<any, an
|
|
|
135
150
|
name?: string | null | undefined;
|
|
136
151
|
createdAt?: NativeDate | null | undefined;
|
|
137
152
|
images?: mongoose.Types.DocumentArray<{
|
|
153
|
+
_id?: {} | undefined;
|
|
138
154
|
fileName?: string | null | undefined;
|
|
139
|
-
}, mongoose.Types.Subdocument<
|
|
155
|
+
}, mongoose.Types.Subdocument<{}, unknown, {
|
|
156
|
+
_id?: {} | undefined;
|
|
140
157
|
fileName?: string | null | undefined;
|
|
141
158
|
}> & {
|
|
159
|
+
_id?: {} | undefined;
|
|
142
160
|
fileName?: string | null | undefined;
|
|
143
161
|
}> | null | undefined;
|
|
144
162
|
description?: string | null | undefined;
|
package/database/page-data/person-candles/utils/compose-person-candles-page-data-db/index.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import { CustomErrorWorker } from '../../../../../common/index.js';
|
|
1
|
+
import { CustomErrorWorker, DEFAULT_CANDLE_FILTER_SORT } from '../../../../../common/index.js';
|
|
2
2
|
import { getCandlesDb, getPersonDb } from '../../../../mutation/index.js';
|
|
3
|
-
export const composePersonCandlesPageDataDb = async (personId,
|
|
3
|
+
export const composePersonCandlesPageDataDb = async (personId, initFilterSort) => {
|
|
4
|
+
const filterSort = {
|
|
5
|
+
...DEFAULT_CANDLE_FILTER_SORT,
|
|
6
|
+
...initFilterSort,
|
|
7
|
+
};
|
|
4
8
|
const { composeCustomError } = CustomErrorWorker({ info: { filterSort } });
|
|
5
9
|
let resp;
|
|
6
10
|
resp = await getPersonDb(personId);
|
|
@@ -9,7 +13,11 @@ export const composePersonCandlesPageDataDb = async (personId, { filterSort }) =
|
|
|
9
13
|
}
|
|
10
14
|
const { data: person } = resp;
|
|
11
15
|
if (!person) {
|
|
12
|
-
return {
|
|
16
|
+
return {
|
|
17
|
+
personNotFoundError: composeCustomError('Person not found'),
|
|
18
|
+
// TODO
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20
|
+
};
|
|
13
21
|
}
|
|
14
22
|
const { burningStates, count, skipCount, sortName, sortOrder, userId } = filterSort;
|
|
15
23
|
resp = await getCandlesDb({
|
|
@@ -25,7 +33,6 @@ export const composePersonCandlesPageDataDb = async (personId, { filterSort }) =
|
|
|
25
33
|
userId,
|
|
26
34
|
});
|
|
27
35
|
if ('customError' in resp) {
|
|
28
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
29
36
|
return resp;
|
|
30
37
|
}
|
|
31
38
|
const { candles, candlesCount } = resp.data;
|
package/database/page-data/person-candles/utils/compose-person-candles-page-data-db/type.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { CandleFilterSort, CustomError, PersonCandlesPageData } from '../../../../../common/index.js';
|
|
2
|
-
export type ComposePersonCandlesPageDataDb = (personId: string,
|
|
3
|
-
filterSort: CandleFilterSort;
|
|
4
|
-
}) => Promise<{
|
|
2
|
+
export type ComposePersonCandlesPageDataDb = (personId: string, filterSort?: Partial<CandleFilterSort>) => Promise<{
|
|
5
3
|
data: PersonCandlesPageData;
|
|
6
4
|
} | {
|
|
7
|
-
personNotFoundError
|
|
5
|
+
personNotFoundError: CustomError;
|
|
6
|
+
} | {
|
|
8
7
|
customError: CustomError;
|
|
9
8
|
}>;
|