@chevre/domain 22.11.0-alpha.0 → 22.11.0-alpha.1
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.
|
@@ -11,7 +11,7 @@ mongoose.Model.on('index', (...args) => {
|
|
|
11
11
|
async function main() {
|
|
12
12
|
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
13
13
|
|
|
14
|
-
await chevre.repository.
|
|
14
|
+
await chevre.repository.Member.createInstance(mongoose.connection);
|
|
15
15
|
console.log('success!');
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -5,6 +5,6 @@ type IModel = Model<IDocType>;
|
|
|
5
5
|
type ISchemaDefinition = SchemaDefinition<IDocType>;
|
|
6
6
|
type ISchema = Schema<IDocType, IModel, {}, {}, {}, {}, ISchemaDefinition, IDocType>;
|
|
7
7
|
declare const modelName = "Member";
|
|
8
|
-
declare function createSchema(): ISchema;
|
|
9
8
|
declare const indexes: [d: IndexDefinition, o: IndexOptions][];
|
|
9
|
+
declare function createSchema(): ISchema;
|
|
10
10
|
export { createSchema, IModel, indexes, modelName };
|
|
@@ -4,6 +4,7 @@ exports.modelName = exports.indexes = void 0;
|
|
|
4
4
|
exports.createSchema = createSchema;
|
|
5
5
|
const mongoose_1 = require("mongoose");
|
|
6
6
|
const writeConcern_1 = require("../writeConcern");
|
|
7
|
+
const factory = require("../../../factory");
|
|
7
8
|
const settings_1 = require("../../../settings");
|
|
8
9
|
const modelName = 'Member';
|
|
9
10
|
exports.modelName = modelName;
|
|
@@ -45,21 +46,21 @@ const schemaOptions = {
|
|
|
45
46
|
versionKey: false
|
|
46
47
|
}
|
|
47
48
|
};
|
|
48
|
-
/**
|
|
49
|
-
* IAMメンバースキーマ
|
|
50
|
-
*/
|
|
51
|
-
let schema;
|
|
52
|
-
function createSchema() {
|
|
53
|
-
if (schema === undefined) {
|
|
54
|
-
schema = new mongoose_1.Schema(schemaDefinition, schemaOptions);
|
|
55
|
-
}
|
|
56
|
-
return schema;
|
|
57
|
-
}
|
|
58
49
|
const indexes = [
|
|
59
50
|
[
|
|
60
51
|
{ 'member.id': 1 },
|
|
61
52
|
{ name: 'searchByMemberId' }
|
|
62
53
|
],
|
|
54
|
+
[
|
|
55
|
+
{ 'project.id': 1, 'member.id': 1 },
|
|
56
|
+
{
|
|
57
|
+
name: 'uniqueByMemberId', // プロジェクトメンバーは販売者メンバーになれない
|
|
58
|
+
unique: true,
|
|
59
|
+
partialFilterExpression: {
|
|
60
|
+
'member.memberOf.typeOf': { $eq: factory.organizationType.Project }
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
],
|
|
63
64
|
[
|
|
64
65
|
{ 'project.id': 1, 'member.id': 1, 'member.memberOf.id': 1 },
|
|
65
66
|
{
|
|
@@ -95,3 +96,18 @@ const indexes = [
|
|
|
95
96
|
]
|
|
96
97
|
];
|
|
97
98
|
exports.indexes = indexes;
|
|
99
|
+
/**
|
|
100
|
+
* IAMメンバースキーマ
|
|
101
|
+
*/
|
|
102
|
+
let schema;
|
|
103
|
+
function createSchema() {
|
|
104
|
+
if (schema === undefined) {
|
|
105
|
+
schema = new mongoose_1.Schema(schemaDefinition, schemaOptions);
|
|
106
|
+
if (settings_1.MONGO_AUTO_INDEX) {
|
|
107
|
+
indexes.forEach((indexParams) => {
|
|
108
|
+
schema === null || schema === void 0 ? void 0 : schema.index(...indexParams);
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return schema;
|
|
113
|
+
}
|
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"@aws-sdk/client-cognito-identity-provider": "3.600.0",
|
|
13
13
|
"@aws-sdk/credential-providers": "3.600.0",
|
|
14
14
|
"@chevre/factory": "4.395.0-alpha.1",
|
|
15
|
-
"@cinerino/sdk": "11.0.0-alpha.
|
|
15
|
+
"@cinerino/sdk": "11.0.0-alpha.2",
|
|
16
16
|
"@motionpicture/coa-service": "9.6.0",
|
|
17
17
|
"@motionpicture/gmo-service": "5.3.0",
|
|
18
18
|
"@sendgrid/client": "8.1.4",
|
|
@@ -113,5 +113,5 @@
|
|
|
113
113
|
"postversion": "git push origin --tags",
|
|
114
114
|
"prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
|
|
115
115
|
},
|
|
116
|
-
"version": "22.11.0-alpha.
|
|
116
|
+
"version": "22.11.0-alpha.1"
|
|
117
117
|
}
|