gpii-universal
Version:
Cross platform, core components of the GPII personalization infrastructure.
29 lines (28 loc) • 1.61 kB
JSON
[
{
"_id": "_design/views",
"views": {
"findPrefsSafeByGpiiKey": {
"map": "function(doc) {\n if (doc.type === 'gpiiKey') {\nvar record = { gpiiKey: doc};\nif (doc.prefsSafeId) { record._id = doc.prefsSafeId; };\nemit(doc._id, record);\n}\n}"
},
"findClientByOauth2ClientId": {
"map": "function(doc) {\n if (doc.type === 'clientCredential' && doc.revoked === false) {\n var record = { clientCredential: doc };\n if (doc.clientId) {\n record._id = doc.clientId;\n }\n emit(doc.oauth2ClientId, record);\n} \n}"
},
"findInfoByAccessToken": {
"map": "function(doc) {\n if (doc.type === 'gpiiAppInstallationAuthorization' && doc.revoked === false) {\n var record = { authorization: doc };\n if (doc.clientCredentialId) {\n record._id = doc.clientCredentialId;\n } \n emit(doc.accessToken, record);\n }\n }"
},
"findSnapsetPrefsSafes": {
"map": "function(doc) {if (doc.type === 'prefsSafe' && doc.prefsSafeType === 'snapset') { emit(doc._id, doc); }}"
},
"findAllGpiiKeys": {
"map": "function(doc) {if (doc.type === 'gpiiKey') { emit(doc._id, doc); }}"
},
"findAccessTokenByExpires": {
"map": "function(doc) {if (doc.type === 'gpiiAppInstallationAuthorization') emit(Date.parse(doc.timestampExpires), doc); }"
},
"findDocsBySchemaVersion": {
"map": "function(doc) {emit(doc.schemaVersion, doc); }"
}
}
}
]