Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@laboratoria/sdk-js
Advanced tools
:warning: This tool is still in draft stage and is likely to change without notice.
npm i --save @laboratoria/sdk-js
import { createApp } from '@laboratoria/sdk-js';
const app = createApp();
With options:
const app = createApp({
firebaseApiKey: '',
firebaseProject: '',
coreApiUrl: '',
});
app.auth.onChange(({ authUser, user }) => {
// `authUser` is the Firebase Auth user
// `user` is the user profile stored in Laboratoria Core
});
app.auth.signIn(email, password);
app.auth.signOut();
The app
object exposes data models used to access data. Each model represents
a type of object, which is stored in a database table.
All models have the following methods and properties.
create
delete
findById
findMany
update
upsert
parse
stats
validate
validateAttr
relations
schema
Each model has a schema (model.schema
) that describes the shape of the
data, what properties (columns) it has, what data types these columns are,
whether they are required or not, etc.
The model.schema
is an object with the following properties:
inputProps
: An array listing properties to be taken into account when
building input UI or sending data (via model.create
, model.update
, etc).primaryKey
: Primary key in the underlying table.properties
: An object with the model properties. Each property is described
by an object having the following keys:
type
: It can be: boolean
, integer
, string
, date
o una referncia a
un modelo, en cuyo caso el string será el nombre del modelo de prisma.default
enum
format
: date-time
$ref
anyOf
items
inputType
isRequired
isScalar
isRef
type
: The schema for the whole model will always be of type object
.app.user.findMany({
where: { name: { contains: 'foo' } },
include: { students: true },
take: 10,
skip: 0,
});
app.user.findById('some-firebase-uid', {
include: { gigs: true },
});
app.user.update({
where: { uid: 'some-firebase-uid' },
data: {
name: 'OMG',
},
});
app.user.delete('some-firebase-uid');
app.user.create({
data: {
name: 'OMG',
email: 'omg@omg.omg',
password: 'secret',
},
});
app.cohort.findMany({
where: {
end: { gt: new Date() },
stage: { name: 'bootcamp' },
},
include: {
program: true,
stage: true,
students: true,
dropouts: true,
},
})
WIP
WIP
app.project.findMany();
app.project.findMany({ tag: 'v6.5.0' });
app.project.findMany({
track: 'web-dev',
});
app.project.findById('cipher');
app.project.findById('cipher', { tag: 'v6.5.0' });
app.topic.findMany();
app.topic.findMany({ tag: 'v6.5.0' });
app.topic.findMany({
track: 'web-dev',
});
app.topic.findById('javascript');
app.topic.findById('javascript', { tag: 'v6.5.0' });
app.learningObjective.findMany();
app.learningObjective.findMany({ tag: 'v6.5.0' });
FAQs
Laboratoria JavaScript (browser) SDK
The npm package @laboratoria/sdk-js receives a total of 20 weekly downloads. As such, @laboratoria/sdk-js popularity was classified as not popular.
We found that @laboratoria/sdk-js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.