@chevre/domain 23.0.0-alpha.5 → 23.0.0-alpha.7
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.
|
@@ -15,7 +15,11 @@ async function main() {
|
|
|
15
15
|
chevre.factory.creativeWork.noteDigitalDocument.INoteAboutProduct,
|
|
16
16
|
'about' | 'creator' | 'identifier' | 'project' | 'provider' | 'text' | 'version' | 'hasDigitalDocumentPermission'
|
|
17
17
|
> = {
|
|
18
|
-
about: {
|
|
18
|
+
about: {
|
|
19
|
+
id: '656038908b1cd5ce629f5992',
|
|
20
|
+
identifier: 'xxx',
|
|
21
|
+
typeOf: chevre.factory.product.ProductType.EventService
|
|
22
|
+
},
|
|
19
23
|
creator: { id: 'xxx', typeOf: chevre.factory.personType.Person },
|
|
20
24
|
identifier: 'abcdefgh',
|
|
21
25
|
project: { id: project.id, typeOf: chevre.factory.organizationType.Project },
|
|
@@ -2,7 +2,7 @@ import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from '
|
|
|
2
2
|
import * as factory from '../../../factory';
|
|
3
3
|
export type IDocTypeAsProduct = Omit<factory.product.IProduct, 'id'>;
|
|
4
4
|
export interface IDocTypeAsProductOffer {
|
|
5
|
-
offers?:
|
|
5
|
+
offers?: [];
|
|
6
6
|
}
|
|
7
7
|
type IDocType = IDocTypeAsProduct & IDocTypeAsProductOffer;
|
|
8
8
|
type IModel = Model<IDocType>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { BulkWriteResult, DeleteResult } from 'mongodb';
|
|
2
2
|
import type { Connection, FilterQuery } from 'mongoose';
|
|
3
3
|
import * as factory from '../factory';
|
|
4
|
+
import { IDocType } from './mongoose/schemas/note';
|
|
4
5
|
type INoteDigitalDocument = factory.creativeWork.noteDigitalDocument.INoteDigitalDocument;
|
|
5
6
|
type IKeyOfProjection = keyof INoteDigitalDocument;
|
|
6
7
|
/**
|
|
@@ -47,5 +48,16 @@ export declare class NoteRepo {
|
|
|
47
48
|
filter: any;
|
|
48
49
|
$unset: any;
|
|
49
50
|
}): Promise<import("mongoose").UpdateWriteOpResult>;
|
|
51
|
+
getCursor(conditions: FilterQuery<factory.creativeWork.noteDigitalDocument.INoteDigitalDocument>, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, IDocType> & Pick<import("@chevre/factory/lib/creativeWork/noteDigitalDocument").INoteDigitalDocument, "identifier" | "project" | "typeOf" | "text" | "version" | "dateCreated" | "dateModified" | "creator" | "editor" | "hasDigitalDocumentPermission"> & {
|
|
52
|
+
about: factory.creativeWork.noteDigitalDocument.IAbout;
|
|
53
|
+
provider: factory.creativeWork.noteDigitalDocument.IProviderAsProject | factory.creativeWork.noteDigitalDocument.IProviderAsSeller;
|
|
54
|
+
} & {
|
|
55
|
+
_id: import("mongoose").Types.ObjectId;
|
|
56
|
+
}, import("mongoose").QueryOptions<import("mongoose").Document<unknown, {}, IDocType> & Pick<import("@chevre/factory/lib/creativeWork/noteDigitalDocument").INoteDigitalDocument, "identifier" | "project" | "typeOf" | "text" | "version" | "dateCreated" | "dateModified" | "creator" | "editor" | "hasDigitalDocumentPermission"> & {
|
|
57
|
+
about: factory.creativeWork.noteDigitalDocument.IAbout;
|
|
58
|
+
provider: factory.creativeWork.noteDigitalDocument.IProviderAsProject | factory.creativeWork.noteDigitalDocument.IProviderAsSeller;
|
|
59
|
+
} & {
|
|
60
|
+
_id: import("mongoose").Types.ObjectId;
|
|
61
|
+
}>>;
|
|
50
62
|
}
|
|
51
63
|
export {};
|
package/lib/chevre/repo/note.js
CHANGED
|
@@ -35,7 +35,7 @@ class NoteRepo {
|
|
|
35
35
|
this.noteModel = connection.model(note_1.modelName, (0, note_1.createSchema)());
|
|
36
36
|
}
|
|
37
37
|
static CREATE_MONGO_CONDITIONS(params) {
|
|
38
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
38
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
39
39
|
const andConditions = [];
|
|
40
40
|
const idIn = (_a = params.id) === null || _a === void 0 ? void 0 : _a.$in;
|
|
41
41
|
if (Array.isArray(idIn)) {
|
|
@@ -57,27 +57,31 @@ class NoteRepo {
|
|
|
57
57
|
if (Array.isArray(aboutIdIn)) {
|
|
58
58
|
andConditions.push({ 'about.id': { $in: aboutIdIn } });
|
|
59
59
|
}
|
|
60
|
-
const
|
|
60
|
+
const aboutIdentifierIn = (_l = (_k = params.about) === null || _k === void 0 ? void 0 : _k.identifier) === null || _l === void 0 ? void 0 : _l.$in;
|
|
61
|
+
if (Array.isArray(aboutIdentifierIn)) {
|
|
62
|
+
andConditions.push({ 'about.identifier': { $in: aboutIdentifierIn } });
|
|
63
|
+
}
|
|
64
|
+
const aboutOrderNumberEq = (_o = (_m = params.about) === null || _m === void 0 ? void 0 : _m.orderNumber) === null || _o === void 0 ? void 0 : _o.$eq;
|
|
61
65
|
if (typeof aboutOrderNumberEq === 'string') {
|
|
62
66
|
andConditions.push({ 'about.orderNumber': { $exists: true, $eq: aboutOrderNumberEq } });
|
|
63
67
|
}
|
|
64
|
-
const aboutOrderNumberIn = (
|
|
68
|
+
const aboutOrderNumberIn = (_q = (_p = params.about) === null || _p === void 0 ? void 0 : _p.orderNumber) === null || _q === void 0 ? void 0 : _q.$in;
|
|
65
69
|
if (Array.isArray(aboutOrderNumberIn)) {
|
|
66
70
|
andConditions.push({ 'about.orderNumber': { $exists: true, $in: aboutOrderNumberIn } });
|
|
67
71
|
}
|
|
68
|
-
const aboutTypeOfEq = (
|
|
72
|
+
const aboutTypeOfEq = (_s = (_r = params.about) === null || _r === void 0 ? void 0 : _r.typeOf) === null || _s === void 0 ? void 0 : _s.$eq;
|
|
69
73
|
if (typeof aboutTypeOfEq === 'string') {
|
|
70
74
|
andConditions.push({ 'about.typeOf': { $eq: aboutTypeOfEq } });
|
|
71
75
|
}
|
|
72
|
-
const identifierEq = (
|
|
76
|
+
const identifierEq = (_t = params.identifier) === null || _t === void 0 ? void 0 : _t.$eq;
|
|
73
77
|
if (typeof identifierEq === 'string') {
|
|
74
78
|
andConditions.push({ identifier: { $eq: identifierEq } });
|
|
75
79
|
}
|
|
76
|
-
const identifierIn = (
|
|
80
|
+
const identifierIn = (_u = params.identifier) === null || _u === void 0 ? void 0 : _u.$in;
|
|
77
81
|
if (Array.isArray(identifierIn)) {
|
|
78
82
|
andConditions.push({ identifier: { $in: identifierIn } });
|
|
79
83
|
}
|
|
80
|
-
const audienceTypeEq = (
|
|
84
|
+
const audienceTypeEq = (_x = (_w = (_v = params.hasDigitalDocumentPermission) === null || _v === void 0 ? void 0 : _v.grantee) === null || _w === void 0 ? void 0 : _w.audienceType) === null || _x === void 0 ? void 0 : _x.$eq;
|
|
81
85
|
if (typeof audienceTypeEq === 'string') {
|
|
82
86
|
andConditions.push({ 'hasDigitalDocumentPermission.grantee.audienceType': { $exists: true, $eq: audienceTypeEq } });
|
|
83
87
|
}
|
|
@@ -128,6 +132,10 @@ class NoteRepo {
|
|
|
128
132
|
if (typeof about.id !== 'string' || about.id === '') {
|
|
129
133
|
throw new factory.errors.ArgumentNull('about.id');
|
|
130
134
|
}
|
|
135
|
+
// about.identifier必須化(2025-10-14~)
|
|
136
|
+
if (typeof about.identifier !== 'string' || about.identifier === '') {
|
|
137
|
+
throw new factory.errors.ArgumentNull('about.identifier');
|
|
138
|
+
}
|
|
131
139
|
if (typeof identifier !== 'string' || identifier === '') {
|
|
132
140
|
throw new factory.errors.ArgumentNull('identifier');
|
|
133
141
|
}
|
|
@@ -246,5 +254,10 @@ class NoteRepo {
|
|
|
246
254
|
.exec();
|
|
247
255
|
});
|
|
248
256
|
}
|
|
257
|
+
getCursor(conditions, projection) {
|
|
258
|
+
return this.noteModel.find(conditions, projection)
|
|
259
|
+
.sort({ dateCreated: factory.sortType.Ascending })
|
|
260
|
+
.cursor();
|
|
261
|
+
}
|
|
249
262
|
}
|
|
250
263
|
exports.NoteRepo = NoteRepo;
|
|
@@ -48,7 +48,7 @@ class ProductRepo {
|
|
|
48
48
|
}
|
|
49
49
|
// tslint:disable-next-line:max-func-body-length
|
|
50
50
|
static CREATE_MONGO_CONDITIONS(params) {
|
|
51
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v
|
|
51
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
52
52
|
// MongoDB検索条件
|
|
53
53
|
const andConditions = [];
|
|
54
54
|
const projectIdEq = (_b = (_a = params.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
|
|
@@ -111,15 +111,16 @@ class ProductRepo {
|
|
|
111
111
|
productID: { $regex: new RegExp(productIDRegex) }
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
|
|
114
|
+
// discontinue product.offers
|
|
115
|
+
// const offersElemMatch = params.offers?.$elemMatch;
|
|
116
|
+
// if (offersElemMatch !== undefined && offersElemMatch !== null) {
|
|
117
|
+
// andConditions.push({
|
|
118
|
+
// offers: {
|
|
119
|
+
// $elemMatch: offersElemMatch
|
|
120
|
+
// }
|
|
121
|
+
// });
|
|
122
|
+
// }
|
|
123
|
+
const serviceOutputTypeOfEq = (_o = (_m = params.serviceOutput) === null || _m === void 0 ? void 0 : _m.typeOf) === null || _o === void 0 ? void 0 : _o.$eq;
|
|
123
124
|
if (typeof serviceOutputTypeOfEq === 'string') {
|
|
124
125
|
andConditions.push({
|
|
125
126
|
'serviceOutput.typeOf': {
|
|
@@ -128,7 +129,7 @@ class ProductRepo {
|
|
|
128
129
|
}
|
|
129
130
|
});
|
|
130
131
|
}
|
|
131
|
-
const serviceOutputAmountCurrencyEq = (
|
|
132
|
+
const serviceOutputAmountCurrencyEq = (_r = (_q = (_p = params.serviceOutput) === null || _p === void 0 ? void 0 : _p.amount) === null || _q === void 0 ? void 0 : _q.currency) === null || _r === void 0 ? void 0 : _r.$eq;
|
|
132
133
|
if (typeof serviceOutputAmountCurrencyEq === 'string') {
|
|
133
134
|
andConditions.push({
|
|
134
135
|
'serviceOutput.amount.currency': {
|
|
@@ -137,7 +138,7 @@ class ProductRepo {
|
|
|
137
138
|
}
|
|
138
139
|
});
|
|
139
140
|
}
|
|
140
|
-
const serviceTypeCodeValueEq = (
|
|
141
|
+
const serviceTypeCodeValueEq = (_t = (_s = params.serviceType) === null || _s === void 0 ? void 0 : _s.codeValue) === null || _t === void 0 ? void 0 : _t.$eq;
|
|
141
142
|
if (typeof serviceTypeCodeValueEq === 'string') {
|
|
142
143
|
andConditions.push({
|
|
143
144
|
'serviceType.codeValue': {
|
|
@@ -146,7 +147,7 @@ class ProductRepo {
|
|
|
146
147
|
}
|
|
147
148
|
});
|
|
148
149
|
}
|
|
149
|
-
const nameRegex = (
|
|
150
|
+
const nameRegex = (_u = params.name) === null || _u === void 0 ? void 0 : _u.$regex;
|
|
150
151
|
if (typeof nameRegex === 'string' && nameRegex.length > 0) {
|
|
151
152
|
const nameRegexExp = new RegExp(nameRegex);
|
|
152
153
|
andConditions.push({
|
|
@@ -156,7 +157,7 @@ class ProductRepo {
|
|
|
156
157
|
]
|
|
157
158
|
});
|
|
158
159
|
}
|
|
159
|
-
const additionalPropertyElemMatchNameEq = (
|
|
160
|
+
const additionalPropertyElemMatchNameEq = (_v = params.additionalPropertyMatch) === null || _v === void 0 ? void 0 : _v.nameEq;
|
|
160
161
|
if (typeof additionalPropertyElemMatchNameEq === 'string') {
|
|
161
162
|
andConditions.push({
|
|
162
163
|
additionalProperty: {
|
package/package.json
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@aws-sdk/client-cognito-identity-provider": "3.600.0",
|
|
13
13
|
"@aws-sdk/credential-providers": "3.600.0",
|
|
14
|
-
"@chevre/factory": "5.1.0-alpha.
|
|
15
|
-
"@cinerino/sdk": "12.5.0-alpha.
|
|
14
|
+
"@chevre/factory": "5.1.0-alpha.2",
|
|
15
|
+
"@cinerino/sdk": "12.5.0-alpha.8",
|
|
16
16
|
"@motionpicture/coa-service": "9.6.0",
|
|
17
17
|
"@motionpicture/gmo-service": "5.4.0-alpha.1",
|
|
18
18
|
"@sendgrid/client": "8.1.4",
|
|
@@ -115,5 +115,5 @@
|
|
|
115
115
|
"postversion": "git push origin --tags",
|
|
116
116
|
"prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
|
|
117
117
|
},
|
|
118
|
-
"version": "23.0.0-alpha.
|
|
118
|
+
"version": "23.0.0-alpha.7"
|
|
119
119
|
}
|