Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
byob-cms is a react component for client only CMS There are three basic concepts in byob-cms:
config
"config" is an javascript object that contains all the info needed
for byob-cms to build the cms.
You should pass config into byob-cms component as a prop.
resource
"resource" is a RESTful concept.
You can do CRUD on the records in resources.
You can think of a resource as a class and a record as an instance,
or a resource as a model and a record as a document.
schema
We use https://github.com/mozilla-services/react-jsonschema-form package
to render forms in the cms. There for you can provide
jsonSchema and uiSchema to define the structure of the form.
We let you configure schemas for CRUD pages. "defaultSchema" is used
when you do not provide a schema for that CRUD type.
You can import this package as a component and give it a config prop.
import React from 'react';
import ReactDOM from 'react-dom';
import CMS from 'byob-cms'
ReactDOM.render(
<CMS config={config}/>,
document.getElementById('root')
);
const config = {
graphqlUrl: 'http://localhost:4000',
resources: [
{
name: 'drop',
uniqKey: '_id',
crudMapping: {
create: 'createDrop',
readMany: 'drops',
readOne: 'drop',
update: 'updateDrop',
// delete: 'deleteDrop',
},
readManySchema: {
jsonSchema: {
type: 'object',
properties: {
_id: 'string',
title: 'string',
}
}
},
defaultSchema: {
jsonSchema: {
title: 'Drop',
type: 'object',
required: [
'title',
'content',
'tagIds',
],
properties: {
title: {
type: 'string',
},
content: {
type: 'string',
},
lifeEventIds: {
type: 'array',
default: [],
items: {
type: 'string'
}
},
tagIds: {
type: 'array',
default: [],
items: {
type: 'string'
}
}
},
},
uiSchema: {
lifeEventIds: {
'ui:field': 'hasManyField'
},
tagIds: {
'ui:field': 'hasManyField'
},
},
}
},
{
name: 'tag',
uniqKey: '_id',
crudMapping: {
readMany: 'tags',
readOne: 'tag',
create: 'createTag',
update: 'updateTag',
delete: 'deleteTag',
},
readManySchema: {
jsonSchema: {
type: 'object',
properties: {
_id: 'string',
title: 'string',
}
}
},
defaultSchema: {
jsonSchema: {
title: 'Tag',
type: 'object',
required: [
'title',
'tagQuestionId',
],
properties: {
title: {
type: 'string'
},
tagQuestionId: {
type: 'string',
},
}
},
uiSchema: {
tagQuestionId: {
'ui:widget': 'hasOneWidget',
}
},
},
},
{
name: 'tagQuestion',
uniqKey: '_id',
crudMapping: {
readMany: 'tagQuestions',
readOne: 'tagQuestion',
create: 'createTagQuestion',
update: 'updateTagQuestion',
delete: 'deleteTagQuestion',
},
readManySchema: {
jsonSchema: {
type: 'object',
properties: {
_id: 'string',
title: 'string',
}
}
},
defaultSchema: {
jsonSchema: {
title: 'Tag Question',
type: 'object',
required: [
'title',
],
properties: {
title: {
type: 'string'
},
}
},
uiSchema: { },
},
},
]
}
mutation ${crudMapping.create}($input: ${upperFirst(resource.name + 'Input')}!) {
${crudMapping.create}(${resource.name} : $input)
}
mutation ${crudMapping.update}($input: ${upperFirst(resource.name + 'Input')}!) {
${crudMapping.update}(${resource.name} : $input, ${uniqKey}: "${uniqKeyValue}")
}
mutation ${crudMapping.delete}($${uniqKey}: String!) {
${crudMapping.delete}(${uniqKey}: $${uniqKey})
}
query ${crudMapping.readOne}($${uniqKey}: String!) {
${crudMapping.readOne}(${uniqKey}: $${uniqKey}) ${jsonSchemaToGqlQuery(readOneSchema.jsonSchema)}
}
query ${crudMapping.readMany} {
${crudMapping.readMany} ${jsonSchemaToGqlQuery(readManySchema.jsonSchema)}
}
function defaultCellFormatter (value) {
return <pre>
{JSON.stringify(value, null, 2)}
</pre>
}
import { CodeLogin } from 'byob-cms';
'ui:options': {
props: {
decimalScale: 0, // Blocks floats
allowNegative: false,
},
},
// by default gqlOptionsName is `${fieldName}Options`
query ${upperFirst(gqlOptionsName)}Query {
${gqlOptionsName} {
value
label
}
}
props:
blockType: 'unordered-list-item'
will begin your wysiwyg with an unordered list element.FAQs
Bring your own backend! A client side only cms that speaks graphQL.
We found that byob-cms demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.