chore(api): remove unused code and endpoints (#41332)

This commit is contained in:
Mrugesh Mohapatra
2021-03-05 02:30:11 +05:30
committed by GitHub
parent fa6b11f359
commit cd40d47363
42 changed files with 21682 additions and 8167 deletions

View File

@@ -1,9 +0,0 @@
import { Observable } from 'rx';
module.exports = function(Article) {
Article.on('dataSourceAttached', () => {
Article.findOne$ = Observable.fromNodeCallback(Article.findOne, Article);
Article.findById$ = Observable.fromNodeCallback(Article.findById, Article);
Article.find$ = Observable.fromNodeCallback(Article.find, Article);
});
};

View File

@@ -1,102 +0,0 @@
{
"name": "article",
"plural": "articles",
"base": "PersistedModel",
"idInjection": true,
"options": {
"validateUpsert": true
},
"properties": {
"shortId": {
"type": "string",
"required": true
},
"slugPart": {
"type": "string",
"required": true,
"description": "A kebab-case-string created from the title, will have the shortId appended to it"
},
"meta": {
"type": "object",
"default": {},
"description": "A place to keep the referral link and read time"
},
"title": {
"type": "string",
"required": true
},
"author": {
"type": "object",
"required": true
},
"subtitle": {
"type": "string"
},
"featureImage": {
"type": "object"
},
"draft": {
"type": "string",
"required": true
},
"renderableContent": {
"type": "string"
},
"youtubeId": {
"type": "string",
"description": "A youtube video id eg: 'EErY9zXGLNU'"
},
"published": {
"type": "boolean",
"required": true,
"default": false
},
"featured": {
"type": "boolean",
"required": true,
"default": false
},
"underReview": {
"type": "boolean",
"required": true,
"default": false
},
"viewCount": {
"type": "number",
"required": true,
"default": 1
},
"firstPublishedDate": {
"type": "date"
},
"createdDate": {
"type": "date",
"required": true
},
"lastEditedDate": {
"type": "date",
"required": true
},
"history": {
"type": [
"object"
],
"required": true
}
},
"validations": [],
"relations": {
"user": {
"type": "belongsTo",
"model": "user",
"foreignKey": "externalId"
},
"popularity": {
"type": "hasOne",
"model": "popularity",
"foreignKey": "popularityId"
}
},
"acls": [],
"methods": {}
}

View File

@@ -1,68 +0,0 @@
{
"name": "nonprofit",
"base": "PersistedModel",
"idInjection": true,
"trackChanges": false,
"properties": {
"id": {
"type": "string",
"id": true
},
"name": {
"type": "string",
"index": {
"mongodb": {
"unique": true,
"background": true
}
}
},
"whatDoesNonprofitDo": {
"type": "string"
},
"websiteLink": {
"type": "string"
},
"endUser": {
"type": "string"
},
"approvedDeliverables": {
"type": "array"
},
"projectDescription": {
"type": "string"
},
"logoUrl": {
"type": "string"
},
"imageUrl": {
"type": "string"
},
"estimatedHours": {
"type": "number"
},
"moneySaved": {
"type": "number"
},
"currentStatus": {
"type": "string"
}
},
"validations": [],
"relations": {},
"acls": [
{
"accessType": "*",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "DENY"
},
{
"accessType": "READ",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW"
}
],
"methods": {}
}

View File

@@ -1,55 +0,0 @@
{
"name": "pledge",
"base": "PersistedModel",
"idInjection": true,
"trackChanges": false,
"properties": {
"nonprofit": {
"type": "string",
"index": true
},
"amount": {
"type": "number"
},
"dateStarted": {
"type": "date",
"defaultFn": "now"
},
"dateEnded": {
"type": "date"
},
"formerUserId": {
"type": "string"
},
"isOrphaned": {
"type": "boolean"
},
"isCompleted": {
"type": "boolean",
"default": "false"
}
},
"validations": [],
"relations": {
"user": {
"type": "hasMany",
"model": "user",
"foreignKey": "userId"
}
},
"acls": [
{
"accessType": "*",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "DENY"
},
{
"accessType": "READ",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW"
}
],
"methods": {}
}

View File

@@ -1,15 +0,0 @@
import { Observable } from 'rx';
module.exports = function(Popularity) {
Popularity.on('dataSourceAttached', () => {
Popularity.findOne$ = Observable.fromNodeCallback(
Popularity.findOne,
Popularity
);
Popularity.findById$ = Observable.fromNodeCallback(
Popularity.findById,
Popularity
);
Popularity.find$ = Observable.fromNodeCallback(Popularity.find, Popularity);
});
};

View File

@@ -1,28 +0,0 @@
{
"name": "popularity",
"plural": "popularities",
"base": "PersistedModel",
"idInjection": true,
"options": {
"validateUpsert": true
},
"properties": {
"events": {
"type": [
"object"
],
"required": true,
"default": []
}
},
"validations": [],
"relations": {
"article": {
"type": "belongsTo",
"model": "article",
"foreignKey": "articleId"
}
},
"acls": [],
"methods": {}
}