chore: Remove unused files
This commit is contained in:
committed by
mrugesh mohapatra
parent
ec7df15c5f
commit
3f25ed051d
@ -1,32 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "flyer",
|
|
||||||
"base": "PersistedModel",
|
|
||||||
"idInjection": true,
|
|
||||||
"trackChanges": false,
|
|
||||||
"properties": {
|
|
||||||
"message": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"isActive": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"validations": [],
|
|
||||||
"relations": {},
|
|
||||||
"acls": [
|
|
||||||
{
|
|
||||||
"accessType": "*",
|
|
||||||
"principalType": "ROLE",
|
|
||||||
"principalId": "$everyone",
|
|
||||||
"permission": "DENY"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"accessType": "READ",
|
|
||||||
"principalType": "ROLE",
|
|
||||||
"principalId": "$everyone",
|
|
||||||
"permission": "ALLOW"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"methods": {}
|
|
||||||
}
|
|
@ -1,119 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "job",
|
|
||||||
"base": "PersistedModel",
|
|
||||||
"strict": true,
|
|
||||||
"idInjection": true,
|
|
||||||
"trackChanges": false,
|
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"type": "string",
|
|
||||||
"id": true
|
|
||||||
},
|
|
||||||
"position": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"company": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"logo": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"city": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"email": {
|
|
||||||
"type": "string",
|
|
||||||
"required": true
|
|
||||||
},
|
|
||||||
"phone": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"state": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"url": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"country": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"locale": {
|
|
||||||
"type": "string",
|
|
||||||
"required": true,
|
|
||||||
"description": "format: city, state"
|
|
||||||
},
|
|
||||||
"location": {
|
|
||||||
"type": "geopoint",
|
|
||||||
"description": "location in lat, long"
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"isApproved": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": false
|
|
||||||
},
|
|
||||||
"isHighlighted": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": false
|
|
||||||
},
|
|
||||||
"isPaid": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": false
|
|
||||||
},
|
|
||||||
"isFilled": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": false
|
|
||||||
},
|
|
||||||
"postedOn": {
|
|
||||||
"type": "date",
|
|
||||||
"defaultFn": "now"
|
|
||||||
},
|
|
||||||
"isFrontEndCert": {
|
|
||||||
"type": "boolean",
|
|
||||||
"description": "Camper must be front end certified to apply",
|
|
||||||
"defaut": false
|
|
||||||
},
|
|
||||||
"isBackEndCert": {
|
|
||||||
"type": "boolean",
|
|
||||||
"description": "Camper must be back end certified to apply",
|
|
||||||
"default": false
|
|
||||||
},
|
|
||||||
"isFullStackCert": {
|
|
||||||
"type": "boolean",
|
|
||||||
"description": "Camper must be full stack certified to apply",
|
|
||||||
"default": false
|
|
||||||
},
|
|
||||||
"isRemoteOk": {
|
|
||||||
"type": "boolean",
|
|
||||||
"description": "Camper may work remotely",
|
|
||||||
"default": false
|
|
||||||
},
|
|
||||||
"howToApply": {
|
|
||||||
"type": "string",
|
|
||||||
"required": true,
|
|
||||||
"description": "How campers apply to a job"
|
|
||||||
},
|
|
||||||
"promoCodeUsed": {
|
|
||||||
"type": "string",
|
|
||||||
"description": "The promocode, if any, that the job uses"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"validations": [],
|
|
||||||
"relations": {},
|
|
||||||
"acls": [
|
|
||||||
{
|
|
||||||
"accessType": "*",
|
|
||||||
"principalType": "ROLE",
|
|
||||||
"principalId": "$everyone",
|
|
||||||
"permission": "DENY"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"accessType": "READ",
|
|
||||||
"principalType": "ROLE",
|
|
||||||
"principalId": "$everyone",
|
|
||||||
"permission": "ALLOW"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"methods": {}
|
|
||||||
}
|
|
@ -1,84 +0,0 @@
|
|||||||
import { isAlphanumeric, isMongoId } from 'validator';
|
|
||||||
import debug from 'debug';
|
|
||||||
|
|
||||||
const log = debug('fcc:models:promo');
|
|
||||||
|
|
||||||
export default function promo(Promo) {
|
|
||||||
Promo.getButton = function getButton(id, code, type = 'isNot') {
|
|
||||||
const Job = Promo.app.models.Job;
|
|
||||||
if (!id || !isMongoId('' + id)) {
|
|
||||||
return Promise.reject(new Error(
|
|
||||||
'Must include job id'
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
|
||||||
!isAlphanumeric('' + code) &&
|
|
||||||
type &&
|
|
||||||
!isAlphanumeric('' + type)
|
|
||||||
) {
|
|
||||||
return Promise.reject(new Error(
|
|
||||||
'Code or Type should be an alphanumeric'
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
const query = {
|
|
||||||
where: {
|
|
||||||
and: [{
|
|
||||||
code: type === 'isNot' ? type : 'isHighlighted'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: type.replace(/^\$/g, '')
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return Promo.findOne(query)
|
|
||||||
.then(function(promo) {
|
|
||||||
// turn promo model to plain js object;
|
|
||||||
promo = promo.toJSON();
|
|
||||||
return Job.updateAll({ id: id }, { promoCodeUsed: code })
|
|
||||||
.then(function({ count = 0 } = {}) {
|
|
||||||
log('job', count);
|
|
||||||
if (count) {
|
|
||||||
return {
|
|
||||||
...promo,
|
|
||||||
name: `${code} Discount`
|
|
||||||
};
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(
|
|
||||||
`Job ${id} not found`
|
|
||||||
));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
Promo.remoteMethod(
|
|
||||||
'getButton',
|
|
||||||
{
|
|
||||||
description: 'Get button id for promocode',
|
|
||||||
accepts: [
|
|
||||||
{
|
|
||||||
arg: 'id',
|
|
||||||
type: 'string',
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
arg: 'code',
|
|
||||||
type: 'string',
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
arg: 'type',
|
|
||||||
type: 'string'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
returns: [
|
|
||||||
{
|
|
||||||
arg: 'promo',
|
|
||||||
type: 'object'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,59 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "promo",
|
|
||||||
"base": "PersistedModel",
|
|
||||||
"strict": true,
|
|
||||||
"idInjection": true,
|
|
||||||
"trackChanges": false,
|
|
||||||
"properties": {
|
|
||||||
"code": {
|
|
||||||
"type": "string",
|
|
||||||
"required": true,
|
|
||||||
"description": "The code to unlock the promotional discount"
|
|
||||||
},
|
|
||||||
"name": {
|
|
||||||
"type": "string",
|
|
||||||
"required": true,
|
|
||||||
"description": "The name of the discount"
|
|
||||||
},
|
|
||||||
"buttonId": {
|
|
||||||
"type": "string",
|
|
||||||
"required": true,
|
|
||||||
"description": "The ID of the paypal button"
|
|
||||||
},
|
|
||||||
"type": {
|
|
||||||
"type": "string",
|
|
||||||
"description": "A selector of different types of buttons for the same discount"
|
|
||||||
},
|
|
||||||
"fullPrice": {
|
|
||||||
"type": "number",
|
|
||||||
"required": true,
|
|
||||||
"description": "The original amount"
|
|
||||||
},
|
|
||||||
"discountAmount": {
|
|
||||||
"type": "number",
|
|
||||||
"description": "The amount of the discount if applicable"
|
|
||||||
},
|
|
||||||
"discountPercent": {
|
|
||||||
"type": "number",
|
|
||||||
"description": "The amount of the discount as a percentage if applicable"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"validations": [],
|
|
||||||
"relations": {},
|
|
||||||
"acls": [
|
|
||||||
{
|
|
||||||
"accessType": "*",
|
|
||||||
"principalType": "ROLE",
|
|
||||||
"principalId": "$everyone",
|
|
||||||
"permission": "DENY"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"accessType": "EXECUTE",
|
|
||||||
"principalType": "ROLE",
|
|
||||||
"principalId": "$everyone",
|
|
||||||
"permission": "ALLOW",
|
|
||||||
"property": "getButton"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"methods": {}
|
|
||||||
}
|
|
@ -1,81 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "story",
|
|
||||||
"base": "PersistedModel",
|
|
||||||
"idInjection": true,
|
|
||||||
"trackChanges": false,
|
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"type": "string",
|
|
||||||
"id": true
|
|
||||||
},
|
|
||||||
"name": {
|
|
||||||
"type": "string",
|
|
||||||
"index": {
|
|
||||||
"mongodb": {
|
|
||||||
"unique": true,
|
|
||||||
"background": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"headline": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"timePosted": {
|
|
||||||
"type": "number",
|
|
||||||
"default": 0
|
|
||||||
},
|
|
||||||
"link": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"metaDescription": {
|
|
||||||
"type": "string",
|
|
||||||
"default": ""
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"rank": {
|
|
||||||
"type": "number",
|
|
||||||
"default": 0
|
|
||||||
},
|
|
||||||
"upVotes": {
|
|
||||||
"type": "array",
|
|
||||||
"default": []
|
|
||||||
},
|
|
||||||
"author": {
|
|
||||||
"type": {}
|
|
||||||
},
|
|
||||||
"image": {
|
|
||||||
"type": "string",
|
|
||||||
"default": ""
|
|
||||||
},
|
|
||||||
"storyLink": {
|
|
||||||
"type": "string",
|
|
||||||
"default": ""
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"validations": [],
|
|
||||||
"relations": {},
|
|
||||||
"acls": [
|
|
||||||
{
|
|
||||||
"accessType": "*",
|
|
||||||
"principalType": "ROLE",
|
|
||||||
"principalId": "$everyone",
|
|
||||||
"permission": "DENY"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"accessType": "READ",
|
|
||||||
"principalType": "ROLE",
|
|
||||||
"principalId": "$everyone",
|
|
||||||
"permission": "ALLOW"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"accessType": "EXECUTE",
|
|
||||||
"principalType": "ROLE",
|
|
||||||
"principalId": "$authenticated",
|
|
||||||
"permission": "ALLOW",
|
|
||||||
"property": "create"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"methods": {}
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
const policy = [
|
|
||||||
'Before you can claim a verified certification, you must accept the ' +
|
|
||||||
'Academic Honesty Policy below.',
|
|
||||||
'I understand that plagiarism means copying someone else’s work and ' +
|
|
||||||
'presenting the work as if it were my own, without clearly attributing ' +
|
|
||||||
'the original author.',
|
|
||||||
'I understand that plagiarism is an act of intellectual dishonesty, and ' +
|
|
||||||
'that people usually get kicked out of university or fired from their ' +
|
|
||||||
'jobs if they get caught plagiarizing.',
|
|
||||||
'Aside from using open source libraries such as jQuery and Bootstrap, ' +
|
|
||||||
'and short snippets of code which are clearly attributed to their ' +
|
|
||||||
'original author, 100% of the code in my projects was written by me, or ' +
|
|
||||||
'along with another camper with whom I was pair programming in real time.',
|
|
||||||
'I pledge that I did not plagiarize any of my freeCodeCamp work. ' +
|
|
||||||
'I understand that freeCodeCamp’s team will audit my projects ' +
|
|
||||||
'to confirm this.',
|
|
||||||
'In the situations where we discover instances of unambiguous plagiarism, ' +
|
|
||||||
'we will replace the camper in question’s certification with a message ' +
|
|
||||||
'that "Upon review, this account has been flagged for academic dishonesty."',
|
|
||||||
'As an academic institution that grants achievement-based certifications, ' +
|
|
||||||
'we take academic honesty very seriously. If you have any questions about ' +
|
|
||||||
'this policy, or suspect that someone has violated it, you can email ' +
|
|
||||||
'<a href="mailto:team@freecodecamp.org">team@freecodecamp.org</a> and we ' +
|
|
||||||
'will investigate.'
|
|
||||||
];
|
|
||||||
|
|
||||||
export default policy;
|
|
@ -1,74 +0,0 @@
|
|||||||
import { AnonymousObservable, Disposable } from 'rx';
|
|
||||||
|
|
||||||
const root = typeof window !== 'undefined' ? window : {};
|
|
||||||
const trash = 'document' in root && root.document.createElement('div');
|
|
||||||
|
|
||||||
function destroy(element) {
|
|
||||||
trash.appendChild(element);
|
|
||||||
trash.innerHTML = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
export function jsonp$(options) {
|
|
||||||
let id = 0;
|
|
||||||
if (typeof options === 'string') {
|
|
||||||
options = { url: options };
|
|
||||||
}
|
|
||||||
|
|
||||||
return new AnonymousObservable(function(o) {
|
|
||||||
const settings = {
|
|
||||||
jsonp: 'JSONPCallback',
|
|
||||||
async: true,
|
|
||||||
jsonpCallback: 'rxjsjsonpCallbackscallback_' + (id++).toString(36),
|
|
||||||
...options
|
|
||||||
};
|
|
||||||
|
|
||||||
let script = root.document.createElement('script');
|
|
||||||
script.type = 'text/javascript';
|
|
||||||
script.async = settings.async;
|
|
||||||
script.src = settings.url.replace(settings.jsonp, settings.jsonpCallback);
|
|
||||||
|
|
||||||
root[settings.jsonpCallback] = function(data) {
|
|
||||||
root[settings.jsonpCallback].called = true;
|
|
||||||
root[settings.jsonpCallback].data = data;
|
|
||||||
};
|
|
||||||
|
|
||||||
const handler = function(e) {
|
|
||||||
if (e.type === 'load' && !root[settings.jsonpCallback].called) {
|
|
||||||
e = { type: 'error' };
|
|
||||||
}
|
|
||||||
const status = e.type === 'error' ? 400 : 200;
|
|
||||||
const data = root[settings.jsonpCallback].data;
|
|
||||||
|
|
||||||
if (status === 200) {
|
|
||||||
o.onNext({
|
|
||||||
status: status,
|
|
||||||
responseType: 'jsonp',
|
|
||||||
response: data,
|
|
||||||
originalEvent: e
|
|
||||||
});
|
|
||||||
|
|
||||||
o.onCompleted();
|
|
||||||
} else {
|
|
||||||
o.onError({
|
|
||||||
type: 'error',
|
|
||||||
status: status,
|
|
||||||
originalEvent: e
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
script.onload = script.onreadystatechanged = script.onerror = handler;
|
|
||||||
|
|
||||||
const head = root.document.getElementsByTagName('head')[0] ||
|
|
||||||
root.document.documentElement;
|
|
||||||
|
|
||||||
head.insertBefore(script, head.firstChild);
|
|
||||||
|
|
||||||
return Disposable.create(() => {
|
|
||||||
script.onload = script.onreadystatechanged = script.onerror = null;
|
|
||||||
|
|
||||||
destroy(script);
|
|
||||||
script = null;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
import { Observable } from 'rx';
|
|
||||||
import debug from 'debug';
|
|
||||||
|
|
||||||
const log = debug('redux-epic:waitForEpics');
|
|
||||||
|
|
||||||
// waitForEpics(epicMiddleware: EpicMiddleware) => Observable[Void]
|
|
||||||
export default function waitForEpics(epicMiddleware) {
|
|
||||||
return Observable.defer(() => {
|
|
||||||
log('calling actions onCompleted');
|
|
||||||
epicMiddleware.end();
|
|
||||||
return Observable.merge(epicMiddleware);
|
|
||||||
})
|
|
||||||
.last({ defaultValue: null })
|
|
||||||
.map(() => epicMiddleware.restart());
|
|
||||||
}
|
|
@ -1,61 +0,0 @@
|
|||||||
import moment from 'moment';
|
|
||||||
import { Scheduler, Observable } from 'rx';
|
|
||||||
import { timeCache, observeQuery } from '../utils/rx';
|
|
||||||
import { dasherize } from '../utils';
|
|
||||||
|
|
||||||
const cacheTimeout = [ 24, 'hours' ];
|
|
||||||
const appUrl = 'https://www.freecodecamp.org';
|
|
||||||
|
|
||||||
// getCachedObservable(
|
|
||||||
// app: ExpressApp,
|
|
||||||
// modelName: String,
|
|
||||||
// nameProp: String,
|
|
||||||
// blockProp: String,
|
|
||||||
// map: (nameProp: String) => String
|
|
||||||
// ) => Observable[models]
|
|
||||||
function getCachedObservable(app, modelName, nameProp, blockProp, map) {
|
|
||||||
return observeQuery(
|
|
||||||
app.models[modelName],
|
|
||||||
'find',
|
|
||||||
{ fields: { [nameProp]: true, [blockProp]: true } }
|
|
||||||
)
|
|
||||||
.flatMap(models => {
|
|
||||||
return Observable.from(models, null, null, Scheduler.default);
|
|
||||||
})
|
|
||||||
.filter(model => !!model[nameProp] && !!model[blockProp])
|
|
||||||
.map(map ? map : (x) => x)
|
|
||||||
.toArray()
|
|
||||||
::timeCache(cacheTimeout[0], cacheTimeout[1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function sitemapRouter(app) {
|
|
||||||
const router = app.loopback.Router();
|
|
||||||
const challengeProps = ['dashedName', 'block'];
|
|
||||||
const challenges$ = getCachedObservable(app, 'Challenge', ...challengeProps);
|
|
||||||
const stories$ = getCachedObservable(app, 'Story', 'storyLink', dasherize);
|
|
||||||
function sitemap(req, res, next) {
|
|
||||||
const now = moment(new Date()).format('YYYY-MM-DD');
|
|
||||||
return Observable.combineLatest(
|
|
||||||
challenges$,
|
|
||||||
stories$,
|
|
||||||
(
|
|
||||||
challenges,
|
|
||||||
stories,
|
|
||||||
) => ({ challenges, stories })
|
|
||||||
)
|
|
||||||
.subscribe(
|
|
||||||
({ challenges, stories }) => {
|
|
||||||
res.header('Content-Type', 'application/xml');
|
|
||||||
res.render('resources/sitemap', {
|
|
||||||
appUrl,
|
|
||||||
now,
|
|
||||||
challenges,
|
|
||||||
stories
|
|
||||||
});
|
|
||||||
},
|
|
||||||
next
|
|
||||||
);
|
|
||||||
}
|
|
||||||
router.get('/sitemap.xml', sitemap);
|
|
||||||
app.use(router);
|
|
||||||
}
|
|
Reference in New Issue
Block a user