@yrpri/api 9.0.114 → 9.0.116
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/models/index.cjs
CHANGED
|
@@ -5,6 +5,9 @@ const env = process.env.NODE_ENV || "development";
|
|
|
5
5
|
const _ = require("lodash");
|
|
6
6
|
const { Sequelize, DataTypes } = require("sequelize");
|
|
7
7
|
let sequelize;
|
|
8
|
+
// -----------------------------------------------------------------------------
|
|
9
|
+
// DB bootstrap
|
|
10
|
+
// -----------------------------------------------------------------------------
|
|
8
11
|
const Op = Sequelize.Op;
|
|
9
12
|
const operatorsAliases = {
|
|
10
13
|
$gt: Op.gt,
|
|
@@ -30,25 +33,20 @@ if (process.env.NODE_ENV === "production") {
|
|
|
30
33
|
dialect: "postgres",
|
|
31
34
|
minifyAliases: true,
|
|
32
35
|
logging: false,
|
|
33
|
-
operatorsAliases
|
|
36
|
+
operatorsAliases,
|
|
34
37
|
});
|
|
35
38
|
}
|
|
36
39
|
else {
|
|
37
40
|
sequelize = new Sequelize(process.env.DATABASE_URL, {
|
|
38
41
|
dialect: "postgres",
|
|
39
|
-
dialectOptions: {
|
|
40
|
-
ssl: {
|
|
41
|
-
rejectUnauthorized: false,
|
|
42
|
-
},
|
|
43
|
-
},
|
|
42
|
+
dialectOptions: { ssl: { rejectUnauthorized: false } },
|
|
44
43
|
minifyAliases: true,
|
|
45
44
|
logging: false,
|
|
46
|
-
operatorsAliases
|
|
45
|
+
operatorsAliases,
|
|
47
46
|
});
|
|
48
47
|
}
|
|
49
48
|
}
|
|
50
49
|
else {
|
|
51
|
-
let config;
|
|
52
50
|
try {
|
|
53
51
|
sequelize = new Sequelize(process.env.YP_DEV_DATABASE_NAME, process.env.YP_DEV_DATABASE_USERNAME, process.env.YP_DEV_DATABASE_PASSWORD, {
|
|
54
52
|
dialect: "postgres",
|
|
@@ -56,19 +54,19 @@ else {
|
|
|
56
54
|
host: process.env.YP_DEV_DATABASE_HOST,
|
|
57
55
|
port: process.env.YP_DEV_DATABASE_PORT,
|
|
58
56
|
minifyAliases: true,
|
|
59
|
-
dialectOptions: {
|
|
60
|
-
ssl: false,
|
|
61
|
-
rejectUnauthorized: false,
|
|
62
|
-
},
|
|
57
|
+
dialectOptions: { ssl: false, rejectUnauthorized: false },
|
|
63
58
|
logging: false,
|
|
64
|
-
operatorsAliases
|
|
59
|
+
operatorsAliases,
|
|
65
60
|
});
|
|
66
61
|
}
|
|
67
62
|
catch (error) {
|
|
68
|
-
console.error("Error
|
|
63
|
+
console.error("Error configuring Sequelize:", error);
|
|
69
64
|
process.exit(1);
|
|
70
65
|
}
|
|
71
66
|
}
|
|
67
|
+
// -----------------------------------------------------------------------------
|
|
68
|
+
// Model loading
|
|
69
|
+
// -----------------------------------------------------------------------------
|
|
72
70
|
const db = {};
|
|
73
71
|
async function createCompoundIndexes(indexCommands) {
|
|
74
72
|
for (const command of indexCommands) {
|
|
@@ -77,8 +75,8 @@ async function createCompoundIndexes(indexCommands) {
|
|
|
77
75
|
console.log(`Successfully created index with command: ${command}`);
|
|
78
76
|
}
|
|
79
77
|
catch (error) {
|
|
80
|
-
if (error.message.
|
|
81
|
-
|
|
78
|
+
if (error.message.includes("already exists")) {
|
|
79
|
+
/* ignore duplicate index */
|
|
82
80
|
}
|
|
83
81
|
else {
|
|
84
82
|
console.error(`Error creating index with command: ${command}`);
|
|
@@ -148,30 +146,35 @@ const compoundIndexCommands = [
|
|
|
148
146
|
`CREATE INDEX posts_idx2_counter_sum_group_id_deleted ON posts ((counter_endorsements_up-counter_endorsements_down),group_id,deleted)`,
|
|
149
147
|
`CREATE INDEX posts_idx2_counter_sum_group_id_category_id_deleted ON posts ((counter_endorsements_up-counter_endorsements_down),group_id,category_id,deleted)`,
|
|
150
148
|
];
|
|
151
|
-
//
|
|
149
|
+
// Load local models (.cjs only)
|
|
152
150
|
fs.readdirSync(__dirname)
|
|
153
|
-
.filter((file) =>
|
|
154
|
-
|
|
155
|
-
|
|
151
|
+
.filter((file) => file.indexOf(".") !== 0 &&
|
|
152
|
+
file.endsWith(".cjs") &&
|
|
153
|
+
!file.endsWith(".d.cjs") &&
|
|
154
|
+
!file.endsWith(".d.cts") &&
|
|
155
|
+
file !== "index.cjs")
|
|
156
156
|
.forEach((file) => {
|
|
157
157
|
const model = require(path.join(__dirname, file))(sequelize, DataTypes);
|
|
158
158
|
db[model.name] = model;
|
|
159
159
|
});
|
|
160
|
-
//
|
|
161
|
-
const acDirname = __dirname
|
|
160
|
+
// Load from ActiveCitizen services/models (.cjs only)
|
|
161
|
+
const acDirname = path.join(__dirname, "..", "services", "models");
|
|
162
162
|
fs.readdirSync(acDirname)
|
|
163
|
-
.filter((file) =>
|
|
164
|
-
|
|
165
|
-
|
|
163
|
+
.filter((file) => file.indexOf(".") !== 0 &&
|
|
164
|
+
file.endsWith(".cjs") &&
|
|
165
|
+
!file.endsWith(".d.cjs") &&
|
|
166
|
+
!file.endsWith(".d.cts"))
|
|
166
167
|
.forEach((file) => {
|
|
167
168
|
const model = require(path.join(acDirname, file))(sequelize, DataTypes);
|
|
168
169
|
db[model.name] = model;
|
|
169
170
|
});
|
|
171
|
+
// Wire up associations
|
|
170
172
|
Object.keys(db).forEach((modelName) => {
|
|
171
173
|
if ("associate" in db[modelName]) {
|
|
172
174
|
db[modelName].associate(db);
|
|
173
175
|
}
|
|
174
176
|
});
|
|
177
|
+
// Sync & index creation
|
|
175
178
|
if (process.env.FORCE_DB_SYNC || process.env.NODE_ENV === "development") {
|
|
176
179
|
sequelize.sync().then(async () => {
|
|
177
180
|
await createCompoundIndexes(compoundIndexCommands);
|
|
@@ -181,6 +184,7 @@ if (process.env.FORCE_DB_SYNC || process.env.NODE_ENV === "development") {
|
|
|
181
184
|
else if (process.env.FORCE_DB_INDEX_SYNC) {
|
|
182
185
|
createCompoundIndexes(compoundIndexCommands);
|
|
183
186
|
}
|
|
187
|
+
// Expose
|
|
184
188
|
db.sequelize = sequelize;
|
|
185
189
|
db.Sequelize = Sequelize;
|
|
186
190
|
module.exports = db;
|
package/models/index.d.cts
CHANGED
|
@@ -1,2 +1,46 @@
|
|
|
1
|
+
import type { Sequelize as SequelizeBaseType, Model, ModelStatic } from "sequelize";
|
|
2
|
+
type ModelInstance<T extends object> = Model<T, Partial<T>> & T;
|
|
3
|
+
type AudioInstance = ModelInstance<YpAudioData>;
|
|
4
|
+
type CategoryInstance = ModelInstance<YpCategoryData>;
|
|
5
|
+
type CommunityInstance = ModelInstance<YpCommunityData>;
|
|
6
|
+
type DomainInstance = ModelInstance<YpDomainData>;
|
|
7
|
+
type EndorsementInstance = ModelInstance<YpEndorsement>;
|
|
8
|
+
type GroupInstance = ModelInstance<YpGroupData>;
|
|
9
|
+
type ImageInstance = ModelInstance<YpImageData>;
|
|
10
|
+
type PageInstance = ModelInstance<YpHelpPageData>;
|
|
11
|
+
type PointInstance = ModelInstance<YpPointData>;
|
|
12
|
+
type PointQualityInstance = ModelInstance<YpPointQuality>;
|
|
13
|
+
type PointRevisionInstance = ModelInstance<YpPointRevision>;
|
|
14
|
+
type PostInstance = ModelInstance<YpPostData>;
|
|
15
|
+
type PostStatusChangeInstance = ModelInstance<YpPostStatusChange>;
|
|
16
|
+
type OrganizationInstance = ModelInstance<YpOrganizationData>;
|
|
17
|
+
type RatingInstance = ModelInstance<YpRatingData>;
|
|
18
|
+
type UserInstance = ModelInstance<YpUserData>;
|
|
19
|
+
type VideoInstance = ModelInstance<YpVideoData>;
|
|
20
|
+
type AcActivityInstance = ModelInstance<AcActivityData>;
|
|
21
|
+
type AcNotificationInstance = ModelInstance<AcNotificationData>;
|
|
22
|
+
interface DeclaredYpModels {
|
|
23
|
+
sequelize: SequelizeBaseType;
|
|
24
|
+
Sequelize: typeof SequelizeBaseType;
|
|
25
|
+
Audio: ModelStatic<AudioInstance>;
|
|
26
|
+
Category: ModelStatic<CategoryInstance>;
|
|
27
|
+
Community: ModelStatic<CommunityInstance>;
|
|
28
|
+
Domain: ModelStatic<DomainInstance>;
|
|
29
|
+
Endorsement: ModelStatic<EndorsementInstance>;
|
|
30
|
+
Group: ModelStatic<GroupInstance>;
|
|
31
|
+
Image: ModelStatic<ImageInstance>;
|
|
32
|
+
Page: ModelStatic<PageInstance>;
|
|
33
|
+
Point: ModelStatic<PointInstance>;
|
|
34
|
+
PointQuality: ModelStatic<PointQualityInstance>;
|
|
35
|
+
PointRevision: ModelStatic<PointRevisionInstance>;
|
|
36
|
+
Post: ModelStatic<PostInstance>;
|
|
37
|
+
PostStatusChange: ModelStatic<PostStatusChangeInstance>;
|
|
38
|
+
Organization: ModelStatic<OrganizationInstance>;
|
|
39
|
+
Rating: ModelStatic<RatingInstance>;
|
|
40
|
+
User: ModelStatic<UserInstance>;
|
|
41
|
+
Video: ModelStatic<VideoInstance>;
|
|
42
|
+
AcActivity: ModelStatic<AcActivityInstance>;
|
|
43
|
+
AcNotification: ModelStatic<AcNotificationInstance>;
|
|
44
|
+
}
|
|
45
|
+
declare const db: DeclaredYpModels;
|
|
1
46
|
export = db;
|
|
2
|
-
declare const db: typeof import("models/index.cjs");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yrpri/api",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.116",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Robert Bjarnason & Citizens Foundation",
|
|
6
6
|
"repository": {
|
|
@@ -134,7 +134,8 @@
|
|
|
134
134
|
},
|
|
135
135
|
"scripts": {
|
|
136
136
|
"copyInLocalAgents": "cp -R ../../policy-synth/agents/ts-out/* ./node_modules/@policysynth/agents/;cp ../../policy-synth/agents/src/*.d.ts ./node_modules/@policysynth/agents/;",
|
|
137
|
-
"
|
|
137
|
+
"publish_live_with_copy": "npm run build:dev;copyfiles './src/utils/**/*.d.ts' './src/controllers/**/*.d.ts' './src/agents/**/*.d.ts' './src/models/**/*.d.ts' './src/services/controllers/**/*.d.ts' './src/services/models/**/*.d.ts' 'ts-out/';npm pack && node repack && node publish.js https://registry.npmjs.org/",
|
|
138
|
+
"publish_live": "npm run build:dev;npm pack && node repack && node publish.js https://registry.npmjs.org/",
|
|
138
139
|
"publish_local": "npm run build;npm pack && node repack && node publish.js http://localhost:4873",
|
|
139
140
|
"start": "nodemon -e ts ts-out/server.js",
|
|
140
141
|
"watch-start": "DEBUG=router:* tsc --project ./src --outDir ./ts-out -w & nodemon -q ./ts-out/server.js",
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
export function getPointDomainIncludes(id: any): {
|
|
2
|
-
model:
|
|
2
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpPostData, Partial<YpPostData>> & YpPostData>;
|
|
3
3
|
required: boolean;
|
|
4
4
|
attributes: never[];
|
|
5
5
|
include: {
|
|
6
|
-
model:
|
|
6
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpGroupData, Partial<YpGroupData>> & YpGroupData>;
|
|
7
7
|
required: boolean;
|
|
8
8
|
attributes: never[];
|
|
9
9
|
include: {
|
|
10
|
-
model:
|
|
10
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpCommunityData, Partial<YpCommunityData>> & YpCommunityData>;
|
|
11
11
|
required: boolean;
|
|
12
12
|
attributes: never[];
|
|
13
13
|
include: {
|
|
14
|
-
model:
|
|
14
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpDomainData, Partial<YpDomainData>> & YpDomainData>;
|
|
15
15
|
where: {
|
|
16
16
|
id: any;
|
|
17
17
|
};
|
|
@@ -22,15 +22,15 @@ export function getPointDomainIncludes(id: any): {
|
|
|
22
22
|
}[];
|
|
23
23
|
}[];
|
|
24
24
|
export function getDomainIncludes(id: any): {
|
|
25
|
-
model:
|
|
25
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpGroupData, Partial<YpGroupData>> & YpGroupData>;
|
|
26
26
|
required: boolean;
|
|
27
27
|
attributes: never[];
|
|
28
28
|
include: {
|
|
29
|
-
model:
|
|
29
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpCommunityData, Partial<YpCommunityData>> & YpCommunityData>;
|
|
30
30
|
required: boolean;
|
|
31
31
|
attributes: never[];
|
|
32
32
|
include: {
|
|
33
|
-
model:
|
|
33
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpDomainData, Partial<YpDomainData>> & YpDomainData>;
|
|
34
34
|
where: {
|
|
35
35
|
id: any;
|
|
36
36
|
};
|
|
@@ -40,15 +40,15 @@ export function getDomainIncludes(id: any): {
|
|
|
40
40
|
}[];
|
|
41
41
|
}[];
|
|
42
42
|
export function getPointCommunityIncludes(id: any): {
|
|
43
|
-
model:
|
|
43
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpPostData, Partial<YpPostData>> & YpPostData>;
|
|
44
44
|
required: boolean;
|
|
45
45
|
attributes: never[];
|
|
46
46
|
include: {
|
|
47
|
-
model:
|
|
47
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpGroupData, Partial<YpGroupData>> & YpGroupData>;
|
|
48
48
|
required: boolean;
|
|
49
49
|
attributes: never[];
|
|
50
50
|
include: {
|
|
51
|
-
model:
|
|
51
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpCommunityData, Partial<YpCommunityData>> & YpCommunityData>;
|
|
52
52
|
where: {
|
|
53
53
|
id: any;
|
|
54
54
|
};
|
|
@@ -58,11 +58,11 @@ export function getPointCommunityIncludes(id: any): {
|
|
|
58
58
|
}[];
|
|
59
59
|
}[];
|
|
60
60
|
export function getCommunityIncludes(id: any): {
|
|
61
|
-
model:
|
|
61
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpGroupData, Partial<YpGroupData>> & YpGroupData>;
|
|
62
62
|
required: boolean;
|
|
63
63
|
attributes: never[];
|
|
64
64
|
include: {
|
|
65
|
-
model:
|
|
65
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpCommunityData, Partial<YpCommunityData>> & YpCommunityData>;
|
|
66
66
|
where: {
|
|
67
67
|
id: any;
|
|
68
68
|
};
|
|
@@ -71,11 +71,11 @@ export function getCommunityIncludes(id: any): {
|
|
|
71
71
|
}[];
|
|
72
72
|
}[];
|
|
73
73
|
export function getPointGroupIncludes(id: any): {
|
|
74
|
-
model:
|
|
74
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpPostData, Partial<YpPostData>> & YpPostData>;
|
|
75
75
|
required: boolean;
|
|
76
76
|
attributes: never[];
|
|
77
77
|
include: {
|
|
78
|
-
model:
|
|
78
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpGroupData, Partial<YpGroupData>> & YpGroupData>;
|
|
79
79
|
required: boolean;
|
|
80
80
|
where: {
|
|
81
81
|
id: any;
|
|
@@ -84,7 +84,7 @@ export function getPointGroupIncludes(id: any): {
|
|
|
84
84
|
}[];
|
|
85
85
|
}[];
|
|
86
86
|
export function getGroupIncludes(id: any): {
|
|
87
|
-
model:
|
|
87
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpGroupData, Partial<YpGroupData>> & YpGroupData>;
|
|
88
88
|
required: boolean;
|
|
89
89
|
where: {
|
|
90
90
|
id: any;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export function domainIncludes(domainId: any): {
|
|
2
|
-
model:
|
|
2
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpGroupData, Partial<YpGroupData>> & YpGroupData>;
|
|
3
3
|
required: boolean;
|
|
4
4
|
attributes: string[];
|
|
5
5
|
include: {
|
|
6
|
-
model:
|
|
6
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpCommunityData, Partial<YpCommunityData>> & YpCommunityData>;
|
|
7
7
|
required: boolean;
|
|
8
8
|
attributes: string[];
|
|
9
9
|
include: {
|
|
10
|
-
model:
|
|
10
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpDomainData, Partial<YpDomainData>> & YpDomainData>;
|
|
11
11
|
attributes: string[];
|
|
12
12
|
where: {
|
|
13
13
|
id: any;
|
|
@@ -17,11 +17,11 @@ export function domainIncludes(domainId: any): {
|
|
|
17
17
|
}[];
|
|
18
18
|
}[];
|
|
19
19
|
export function communityIncludes(communityId: any): {
|
|
20
|
-
model:
|
|
20
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpGroupData, Partial<YpGroupData>> & YpGroupData>;
|
|
21
21
|
required: boolean;
|
|
22
22
|
attributes: string[];
|
|
23
23
|
include: {
|
|
24
|
-
model:
|
|
24
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpCommunityData, Partial<YpCommunityData>> & YpCommunityData>;
|
|
25
25
|
required: boolean;
|
|
26
26
|
attributes: string[];
|
|
27
27
|
where: {
|
|
@@ -30,7 +30,7 @@ export function communityIncludes(communityId: any): {
|
|
|
30
30
|
}[];
|
|
31
31
|
}[];
|
|
32
32
|
export function groupIncludes(groupId: any): {
|
|
33
|
-
model:
|
|
33
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpGroupData, Partial<YpGroupData>> & YpGroupData>;
|
|
34
34
|
required: boolean;
|
|
35
35
|
attributes: string[];
|
|
36
36
|
where: {
|
|
@@ -38,7 +38,7 @@ export function groupIncludes(groupId: any): {
|
|
|
38
38
|
};
|
|
39
39
|
}[];
|
|
40
40
|
export function userIncludes(userId: any): {
|
|
41
|
-
model:
|
|
41
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpUserData, Partial<YpUserData>> & YpUserData>;
|
|
42
42
|
attributes: any;
|
|
43
43
|
required: boolean;
|
|
44
44
|
where: {
|
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
export function activitiesDefaultIncludes(options: any): ({
|
|
2
|
-
model:
|
|
2
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpUserData, Partial<YpUserData>> & YpUserData>;
|
|
3
3
|
required: boolean;
|
|
4
4
|
attributes: any;
|
|
5
|
+
include: {
|
|
6
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpImageData, Partial<YpImageData>> & YpImageData>;
|
|
7
|
+
as: string;
|
|
8
|
+
attributes: any;
|
|
9
|
+
required: boolean;
|
|
10
|
+
}[];
|
|
5
11
|
where?: undefined;
|
|
12
|
+
} | {
|
|
13
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpDomainData, Partial<YpDomainData>> & YpDomainData>;
|
|
14
|
+
required: boolean;
|
|
15
|
+
attributes: any;
|
|
6
16
|
include?: undefined;
|
|
17
|
+
where?: undefined;
|
|
7
18
|
} | {
|
|
8
|
-
model:
|
|
19
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpCommunityData, Partial<YpCommunityData>> & YpCommunityData>;
|
|
9
20
|
required: boolean;
|
|
10
21
|
attributes: any;
|
|
11
22
|
where: {
|
|
@@ -14,7 +25,13 @@ export function activitiesDefaultIncludes(options: any): ({
|
|
|
14
25
|
};
|
|
15
26
|
include?: undefined;
|
|
16
27
|
} | {
|
|
17
|
-
model:
|
|
28
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpCommunityData, Partial<YpCommunityData>> & YpCommunityData>;
|
|
29
|
+
attributes: any;
|
|
30
|
+
required: boolean;
|
|
31
|
+
include?: undefined;
|
|
32
|
+
where?: undefined;
|
|
33
|
+
} | {
|
|
34
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpGroupData, Partial<YpGroupData>> & YpGroupData>;
|
|
18
35
|
required: boolean;
|
|
19
36
|
attributes: any;
|
|
20
37
|
where: {
|
|
@@ -24,32 +41,55 @@ export function activitiesDefaultIncludes(options: any): ({
|
|
|
24
41
|
access?: undefined;
|
|
25
42
|
};
|
|
26
43
|
include: {
|
|
27
|
-
model:
|
|
44
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpImageData, Partial<YpImageData>> & YpImageData>;
|
|
28
45
|
as: string;
|
|
29
46
|
attributes: any;
|
|
30
47
|
required: boolean;
|
|
31
48
|
}[];
|
|
32
49
|
} | {
|
|
33
|
-
model:
|
|
50
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpGroupData, Partial<YpGroupData>> & YpGroupData>;
|
|
51
|
+
required: boolean;
|
|
52
|
+
attributes: any;
|
|
53
|
+
include: {
|
|
54
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpImageData, Partial<YpImageData>> & YpImageData>;
|
|
55
|
+
as: string;
|
|
56
|
+
attributes: any;
|
|
57
|
+
required: boolean;
|
|
58
|
+
}[];
|
|
59
|
+
where?: undefined;
|
|
60
|
+
} | {
|
|
61
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpPostData, Partial<YpPostData>> & YpPostData>;
|
|
34
62
|
required: boolean;
|
|
35
63
|
attributes: any;
|
|
36
64
|
include: ({
|
|
37
|
-
model:
|
|
65
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpGroupData, Partial<YpGroupData>> & YpGroupData>;
|
|
38
66
|
required: boolean;
|
|
39
67
|
attributes: string[];
|
|
40
68
|
as?: undefined;
|
|
41
69
|
include?: undefined;
|
|
42
70
|
} | {
|
|
43
|
-
model:
|
|
71
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpUserData, Partial<YpUserData>> & YpUserData>;
|
|
72
|
+
attributes: string[];
|
|
73
|
+
required: boolean;
|
|
74
|
+
as?: undefined;
|
|
75
|
+
include?: undefined;
|
|
76
|
+
} | {
|
|
77
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpImageData, Partial<YpImageData>> & YpImageData>;
|
|
44
78
|
as: string;
|
|
45
79
|
attributes: any;
|
|
46
80
|
required: boolean;
|
|
47
81
|
include?: undefined;
|
|
48
82
|
} | {
|
|
49
|
-
model:
|
|
83
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpAudioData, Partial<YpAudioData>> & YpAudioData>;
|
|
84
|
+
required: boolean;
|
|
85
|
+
attributes: string[];
|
|
86
|
+
as: string;
|
|
87
|
+
include?: undefined;
|
|
88
|
+
} | {
|
|
89
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpCategoryData, Partial<YpCategoryData>> & YpCategoryData>;
|
|
50
90
|
required: boolean;
|
|
51
91
|
include: {
|
|
52
|
-
model:
|
|
92
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpImageData, Partial<YpImageData>> & YpImageData>;
|
|
53
93
|
attributes: any;
|
|
54
94
|
required: boolean;
|
|
55
95
|
as: string;
|
|
@@ -59,33 +99,45 @@ export function activitiesDefaultIncludes(options: any): ({
|
|
|
59
99
|
})[];
|
|
60
100
|
where?: undefined;
|
|
61
101
|
} | {
|
|
62
|
-
model:
|
|
102
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpPointData, Partial<YpPointData>> & YpPointData>;
|
|
63
103
|
required: boolean;
|
|
64
104
|
attributes: any[];
|
|
65
105
|
include: ({
|
|
66
|
-
model:
|
|
106
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpPointRevision, Partial<YpPointRevision>> & YpPointRevision>;
|
|
67
107
|
attributes: any;
|
|
68
108
|
include: {
|
|
69
|
-
model:
|
|
109
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpUserData, Partial<YpUserData>> & YpUserData>;
|
|
70
110
|
attributes: any;
|
|
71
111
|
required: boolean;
|
|
72
112
|
}[];
|
|
73
113
|
required: boolean;
|
|
74
114
|
as?: undefined;
|
|
75
115
|
} | {
|
|
76
|
-
model:
|
|
116
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpAudioData, Partial<YpAudioData>> & YpAudioData>;
|
|
77
117
|
required: boolean;
|
|
78
118
|
attributes: string[];
|
|
79
119
|
as: string;
|
|
80
120
|
include?: undefined;
|
|
81
121
|
} | {
|
|
82
|
-
model:
|
|
122
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpPostData, Partial<YpPostData>> & YpPostData>;
|
|
123
|
+
attributes: string[];
|
|
124
|
+
required: boolean;
|
|
125
|
+
include?: undefined;
|
|
126
|
+
as?: undefined;
|
|
127
|
+
} | {
|
|
128
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpUserData, Partial<YpUserData>> & YpUserData>;
|
|
83
129
|
attributes: string[];
|
|
84
130
|
required: boolean;
|
|
85
131
|
include?: undefined;
|
|
86
132
|
as?: undefined;
|
|
87
133
|
})[];
|
|
88
134
|
where?: undefined;
|
|
135
|
+
} | {
|
|
136
|
+
model: import("sequelize").ModelStatic<import("sequelize").Model<YpPostStatusChange, Partial<YpPostStatusChange>> & YpPostStatusChange>;
|
|
137
|
+
attributes: any;
|
|
138
|
+
required: boolean;
|
|
139
|
+
include?: undefined;
|
|
140
|
+
where?: undefined;
|
|
89
141
|
})[];
|
|
90
142
|
export function getCommonWhereOptions(options: any): {
|
|
91
143
|
status: string;
|