Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

waterline

Package Overview
Dependencies
Maintainers
4
Versions
165
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

waterline - npm Package Compare versions

Comparing version 0.13.1-9 to 0.13.1

16

lib/waterline/methods/find-or-create.js

@@ -215,3 +215,2 @@ /**

// ╔═╗═╗ ╦╔═╗╔═╗╦ ╦╔╦╗╔═╗ ┌─┐┬┌┐┌┌┬┐ ┌─┐┌┐┌┌─┐ ┌─┐ ┬ ┬┌─┐┬─┐┬ ┬

@@ -246,5 +245,12 @@ // ║╣ ╔╩╦╝║╣ ║ ║ ║ ║ ║╣ ├┤ ││││ ││ │ ││││├┤ │─┼┐│ │├┤ ├┬┘└┬┘

// Build a modified shallow clone of the originally-provided `meta`
// that also has `fetch: true`.
var modifiedMeta = _.extend({}, query.meta || {}, { fetch: true });
// Build a modified shallow clone of the originally-provided `meta` from
// userland, but that also has `fetch: true` and the private/experimental
// flag, `skipEncryption: true`. For context on the bit about encryption,
// see: https://github.com/balderdashy/sails/issues/4302#issuecomment-363883885
// > PLEASE DO NOT RELY ON `skipEncryption` IN YOUR OWN CODE- IT COULD CHANGE
// > AT ANY TIME AND BREAK YOUR APP OR PLUGIN!
var modifiedMetaForCreate = _.extend({}, query.meta || {}, {
fetch: true,
skipEncryption: true
});

@@ -269,3 +275,3 @@ // ╔═╗═╗ ╦╔═╗╔═╗╦ ╦╔╦╗╔═╗ ┌─┐┬─┐┌─┐┌─┐┌┬┐┌─┐ ┌─┐ ┬ ┬┌─┐┬─┐┬ ┬

}, modifiedMeta);//</.create()>
}, modifiedMetaForCreate);//</.create()>
}, query.meta);//</.findOne()>

@@ -272,0 +278,0 @@ },

@@ -28,4 +28,6 @@ /**

*
* @required {Dictionary} stageTwoQuery
* TODO: document the rest of the options
* @param {Dictionary} stageTwoQuery
* @param {String} identity
* @param {Ref} transformer
* @param {Dictionary} originalModels
*

@@ -39,18 +41,17 @@ * @return {Dictionary} [the stage 3 query]

if (!_.has(options, 'stageTwoQuery') || !_.isPlainObject(options.stageTwoQuery)) {
throw new Error('Invalid options passed to `.buildStageThreeQuery()`. Missing or invalud `stageTwoQuery` option.');
throw new Error('Invalid options passed to `.buildStageThreeQuery()`. Missing or invalid `stageTwoQuery` option.');
}
if (!_.has(options, 'identity') || !_.isString(options.identity)) {
throw new Error('Invalid options passed to `.buildStageThreeQuery()`. Missing or invalud `identity` option.');
throw new Error('Invalid options passed to `.buildStageThreeQuery()`. Missing or invalid `identity` option.');
}
if (!_.has(options, 'transformer') || !_.isObject(options.transformer)) {
throw new Error('Invalid options passed to `.buildStageThreeQuery()`. Missing or invalud `transformer` option.');
throw new Error('Invalid options passed to `.buildStageThreeQuery()`. Missing or invalid `transformer` option.');
}
if (!_.has(options, 'originalModels') || !_.isPlainObject(options.originalModels)) {
throw new Error('Invalid options passed to `.buildStageThreeQuery()`. Missing or invalud `originalModels` option.');
throw new Error('Invalid options passed to `.buildStageThreeQuery()`. Missing or invalid `originalModels` option.');
}
// Store the options to prevent typing so much

@@ -67,10 +68,7 @@ var s3Q = options.stageTwoQuery;

// Grab the current model definition. It will be used in all sorts of ways.
var model;
try {
model = originalModels[identity];
} catch (e) {
var model = originalModels[identity];
if (!model) {
throw new Error('A model with the identity ' + identity + ' could not be found in the schema. Perhaps the wrong schema was used?');
}
// ╔═╗╦╔╗╔╔╦╗ ┌─┐┬─┐┬┌┬┐┌─┐┬─┐┬ ┬ ┬┌─┌─┐┬ ┬

@@ -77,0 +75,0 @@ // ╠╣ ║║║║ ║║ ├─┘├┬┘││││├─┤├┬┘└┬┘ ├┴┐├┤ └┬┘

@@ -326,7 +326,5 @@ /**

'```\n'+
'Boat.find().sort(\'wetness DESC\')\n'+
'var first30Boats = await Boat.find()\n'+
'.sort(\'wetness DESC\')\n'+
'.paginate(0, 30)\n'+
'.exec(function (err, first30Boats){\n'+
' \n'+
'});\n'+
'```\n'+

@@ -333,0 +331,0 @@ '(In the mean time, assuming the first page (#0)...)'

@@ -662,2 +662,11 @@ /**

}
// Never encrypt if the (private/experimental) `skipEncryption` meta key is
// set truthy. PLEASE DO NOT RELY ON THIS IN YOUR OWN CODE- IT COULD CHANGE
// AT ANY TIME AND BREAK YOUR APP OR PLUGIN!
// > (Useful for internal method calls-- e.g. the internal "create()" that
// > Waterline uses to implement `findOrCreate()`. For more info on that,
// > see https://github.com/balderdashy/sails/issues/4302#issuecomment-363883885)
else if (meta && meta.skipEncryption) {
// Don't encrypt.
}
else {

@@ -664,0 +673,0 @@ // First, JSON-encode value, to allow for differentiating between strings/numbers/booleans/null.

@@ -538,2 +538,3 @@ /**

Object.defineProperty(record, 'toJSON', {
writable: true,
value: WLModel.customToJSON

@@ -540,0 +541,0 @@ });

The MIT License (MIT)
--
Copyright © 2012-2017 Mike McNeil, Balderdash Design Co., & The Sails Company
Copyright © 2012-2018 Mike McNeil, Balderdash Design Co., & The Sails Company

@@ -6,0 +6,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

{
"name": "waterline",
"description": "An ORM for Node.js and the Sails framework",
"version": "0.13.1-9",
"version": "0.13.1",
"homepage": "http://waterlinejs.org",

@@ -14,8 +14,8 @@ "contributors": [

"@sailshq/lodash": "^3.10.2",
"anchor": "^1.1.0",
"anchor": "^1.2.0",
"async": "2.0.1",
"encrypted-attr": "1.0.6",
"flaverr": "^1.2.1",
"flaverr": "^1.8.3",
"lodash.issafeinteger": "4.0.4",
"parley": "^3.0.0-0",
"parley": "^3.3.2",
"rttc": "^10.0.0-1",

@@ -26,3 +26,3 @@ "waterline-schema": "^1.0.0-20",

"devDependencies": {
"eslint": "3.19.0",
"eslint": "4.11.0",
"mocha": "3.0.2"

@@ -29,0 +29,0 @@ },

@@ -8,8 +8,21 @@ # [<img title="waterline-logo" src="http://i.imgur.com/3Xqh6Mz.png" width="610px" alt="Waterline logo"/>](http://waterlinejs.org)

Waterline is a next-generation storage and retrieval engine, and the default ORM used in the [Sails framework](http://sailsjs.com).
Waterline is a next-generation storage and retrieval engine, and the default ORM used in the [Sails framework](https://sailsjs.com).
It provides a uniform API for accessing stuff from different kinds of databases, protocols, and 3rd party APIs. That means you write the same code to get and store things like users, whether they live in Redis, MySQL, MongoDB, or Postgres.
It provides a uniform API for accessing stuff from different kinds of [databases and protocols](https://sailsjs.com/documentation/concepts/extending-sails/adapters/available-adapters). That means you write the same code to get and store things like users, whether they live in MySQL, MongoDB, neDB, or Postgres.
Waterline strives to inherit the best parts of ORMs like ActiveRecord, Hibernate, and Mongoose, but with a fresh perspective and emphasis on modularity, testability, and consistency across adapters.
## No more callbacks
Starting with v0.13, Waterline takes full advantage of ECMAScript & Node 8's `await` keyword.
**In other words, [no more callbacks](https://gist.github.com/mikermcneil/c1028d000cc0cc8bce995a2a82b29245).**
```js
var newOrg = await Organization.create({
slug: 'foo'
})
.fetch();
```
> Looking for the version of Waterline used in Sails v0.12? See the [0.11.x branch](https://github.com/balderdashy/waterline/tree/0.11.x) of this repo. If you're upgrading to v0.13 from a previous release of Waterline _standalone_, take a look at the [upgrading guide](http://sailsjs.com/documentation/upgrading/to-v-1-0).

@@ -21,3 +34,3 @@

```bash
$ npm install waterline --save
$ npm install waterline
```

@@ -24,0 +37,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc