@positivegrid/pg-mongoose-schema 26.7.1 → 27.1.0
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/oauth.js +14 -4
- package/models/preset.js +3 -0
- package/package.json +1 -1
package/models/oauth.js
CHANGED
|
@@ -16,7 +16,12 @@ module.exports = function (mongoose) {
|
|
|
16
16
|
code: { type: String, required: true },
|
|
17
17
|
clientId: { type: ObjectId, ref: 'OathClient', required: true },
|
|
18
18
|
redirectURI: { type: String, required: true },
|
|
19
|
-
userId: { type:
|
|
19
|
+
userId: { type: ObjectId, ref: 'User', required: true },
|
|
20
|
+
scopes: [{ type: String, required: true }],
|
|
21
|
+
expiresAt: { type: Date, required: true },
|
|
22
|
+
codeChallenge: { type: String },
|
|
23
|
+
codeChallengeMethod: { type: String, default: 'S256' },
|
|
24
|
+
date: { type: Date, default: Date.now }
|
|
20
25
|
}, { collection: 'auth_authorizationCodes', toJSON: { virtuals: true }, toObject: { virtuals: true } })
|
|
21
26
|
AuthorizationCodeSchema.plugin(deepPopulate, {})
|
|
22
27
|
|
|
@@ -24,15 +29,20 @@ module.exports = function (mongoose) {
|
|
|
24
29
|
const AccessTokenSchema = new Schema({
|
|
25
30
|
token: { type: String, required: true },
|
|
26
31
|
expirationDate: { type: Date, required: true },
|
|
27
|
-
userId: { type:
|
|
28
|
-
clientId: { type: ObjectId, ref: 'OathClient', required: true }
|
|
32
|
+
userId: { type: ObjectId, ref: 'User', required: true },
|
|
33
|
+
clientId: { type: ObjectId, ref: 'OathClient', required: true },
|
|
34
|
+
scopes: [{ type: String, required: true }],
|
|
35
|
+
date: { type: Date, default: Date.now }
|
|
29
36
|
}, { collection: 'auth_accessTokens', toJSON: { virtuals: true }, toObject: { virtuals: true } })
|
|
30
37
|
|
|
31
38
|
// refreshTokens
|
|
32
39
|
const RefreshTokenSchema = new Schema({
|
|
33
40
|
refreshToken: { type: String, required: true },
|
|
34
41
|
clientId: { type: ObjectId, ref: 'OathClient', required: true },
|
|
35
|
-
|
|
42
|
+
expirationDate: { type: Date, required: true },
|
|
43
|
+
userId: { type: ObjectId, ref: 'User', required: true },
|
|
44
|
+
scopes: [{ type: String, required: true }],
|
|
45
|
+
date: { type: Date, default: Date.now }
|
|
36
46
|
}, { collection: 'auth_refreshTokens', toJSON: { virtuals: true }, toObject: { virtuals: true } })
|
|
37
47
|
|
|
38
48
|
mongoose.model('OauthClient', clientSchema)
|
package/models/preset.js
CHANGED
|
@@ -522,6 +522,9 @@ module.exports = function (mongoose) {
|
|
|
522
522
|
if (_.has(req.query, 'signal_chain_type')) {
|
|
523
523
|
searchCondition.signal_chain_type = req.query.signal_chain_type
|
|
524
524
|
}
|
|
525
|
+
if (_.has(req.query, 'no_dspid')) {
|
|
526
|
+
searchCondition['preset_meta.dspId'] = { $nin: String(req.query.no_dspid).split(',') }
|
|
527
|
+
}
|
|
525
528
|
}
|
|
526
529
|
|
|
527
530
|
searchCondition = _handlePresetVersion(searchCondition, req)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@positivegrid/pg-mongoose-schema",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "27.1.0",
|
|
4
4
|
"description": "Positive Grid mongoose schema",
|
|
5
5
|
"author": "Ferrari Lee <shiyung@positivegrid.com>",
|
|
6
6
|
"homepage": "https://git.positivegrid.com:8443/backend/pg-mongoose-schema",
|