@chevre/domain 23.0.0-alpha.6 → 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: { id: '656038908b1cd5ce629f5992', typeOf: chevre.factory.product.ProductType.EventService },
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 },
@@ -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 {};
@@ -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 aboutOrderNumberEq = (_l = (_k = params.about) === null || _k === void 0 ? void 0 : _k.orderNumber) === null || _l === void 0 ? void 0 : _l.$eq;
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 = (_o = (_m = params.about) === null || _m === void 0 ? void 0 : _m.orderNumber) === null || _o === void 0 ? void 0 : _o.$in;
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 = (_q = (_p = params.about) === null || _p === void 0 ? void 0 : _p.typeOf) === null || _q === void 0 ? void 0 : _q.$eq;
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 = (_r = params.identifier) === null || _r === void 0 ? void 0 : _r.$eq;
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 = (_s = params.identifier) === null || _s === void 0 ? void 0 : _s.$in;
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 = (_v = (_u = (_t = params.hasDigitalDocumentPermission) === null || _t === void 0 ? void 0 : _t.grantee) === null || _u === void 0 ? void 0 : _u.audienceType) === null || _v === void 0 ? void 0 : _v.$eq;
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;
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.1",
15
- "@cinerino/sdk": "12.5.0-alpha.7",
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.6"
118
+ "version": "23.0.0-alpha.7"
119
119
  }