Compare commits

..

No commits in common. "master" and "v3.9.1" have entirely different histories.

176 changed files with 8326 additions and 29458 deletions

View File

@ -1,2 +1 @@
coverage
dist

29
.github/ISSUE_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1,29 @@
<!--
Questions:
https://groups.google.com/forum/#!forum/loopbackjs
https://gitter.im/strongloop/loopback
Immediate support:
https://strongloop.com/api-connect-faqs/
https://strongloop.com/node-js/subscription-plans/
-->
# Description/Steps to reproduce
<!--
If feature: A description of the feature
If bug: Steps to reproduce + link to sample repo
-->
# Expected result
<!--
Also include actual results if bug
-->
# Additional information
<!--
Copy+paste the output of these two commands:
node -e 'console.log(process.platform, process.arch, process.versions.node)'
npm ls --prod --depth 0 | grep loopback
-->

View File

@ -1,53 +0,0 @@
---
name: Bug report
about: Create a report to help us improve
labels: bug
---
<!-- 🚨 STOP 🚨 STOP 🚨 STOP 🚨
Are you using LoopBack version 4? Please report the bug here:
https://github.com/strongloop/loopback-next/issues/new
HELP US HELP YOU, PLEASE
- Do a quick search to avoid duplicate issues
- Provide as much information as possible (reproduction sandbox, use case for features, etc.)
- Consider using a more suitable venue for questions such as Stack Overflow, Gitter, etc.
Please fill in the *entire* template below.
-->
## Steps to reproduce
<!-- Describe how to reproduce the issue -->
## Current Behavior
<!-- Describe the observed result -->
## Expected Behavior
<!-- Describe what did you expect instead, what is the desired outcome? -->
## Link to reproduction sandbox
<!--
See https://loopback.io/doc/en/contrib/Reporting-issues.html#loopback-3x-bugs
Note: Failure to provide a sandbox application for reproduction purposes will result in the issue being closed.
-->
## Additional information
<!--
Copy+paste the output of these two commands:
node -e 'console.log(process.platform, process.arch, process.versions.node)'
npm ls --prod --depth 0 | grep loopback
-->
## Related Issues
<!-- Did you find other bugs that looked similar? -->
_See [Reporting Issues](http://loopback.io/doc/en/contrib/Reporting-issues.html) for more tips on writing good issues_

View File

@ -1,34 +0,0 @@
---
name: Feature request
about: Suggest an idea for this project
labels: feature
---
<!-- 🚨 STOP 🚨 STOP 🚨 STOP 🚨
LoopBack version 3 is in LTS mode, we are not accepting new features.
We are actively developing version 4, you can find the new GitHub
repository here: https://github.com/strongloop/loopback-next
-->
## Suggestion
<!-- A summary of what you'd like to see added or changed -->
## Use Cases
<!--
What do you want to use this for?
What shortcomings exist with current approaches?
-->
## Examples
<!-- Show how this would be used and what the behavior would be -->
## Acceptance criteria
TBD - will be filled by the team.

View File

@ -1,27 +0,0 @@
---
name: Question
about: The issue tracker is not for questions. Please use Stack Overflow or other resources for help.
labels: question
---
<!-- 🚨 STOP 🚨 STOP 🚨 STOP 🚨
THE ISSUE TRACKER IS NOT FOR QUESTIONS.
DO NOT CREATE A NEW ISSUE TO ASK A QUESTION.
Please use one of the following resources for help:
**Questions**
- https://stackoverflow.com/tags/loopbackjs
- https://groups.google.com/forum/#!forum/loopbackjs
- https://gitter.im/strongloop/loopback
**Immediate support**
- https://strongloop.com/api-connect-faqs/
- https://strongloop.com/node-js/subscription-plans/
-->

View File

@ -1,11 +0,0 @@
blank_issues_enabled: false
contact_links:
- name: Report a security vulnerability
url: https://loopback.io/doc/en/contrib/Reporting-issues.html#security-issues
about: Do not report security vulnerabilities using GitHub issues. Please send an email to `security@loopback.io` instead.
- name: Get help on StackOverflow
url: https://stackoverflow.com/tags/loopbackjs
about: Please ask and answer questions on StackOverflow.
- name: Join our mailing list
url: https://groups.google.com/forum/#!forum/loopbackjs
about: You can also post your question to our mailing list.

View File

@ -1,17 +1,24 @@
### Description
#### Related issues
<!--
Please provide a high-level description of the changes made by your pull request.
Please use the following link syntaxes:
Include references to all related GitHub issues and other pull requests, for example:
Fixes #123
Implements #254
See also #23
- #49 (to reference issues in the current repository)
- strongloop/loopback#49 (to reference issues in another repository)
-->
## Checklist
- None
### Checklist
<!--
Please mark your choice with an "x" (i.e. [x], see
https://github.com/blog/1375-task-lists-in-gfm-issues-pulls-comments)
-->
- [ ] [Sign off your commits](https://loopback.io/doc/en/contrib/code-contrib.html) with DCO (Developer Certificate of Origin)
- [ ] `npm test` passes on your machine
- [ ] New tests added or existing tests modified to cover all changes
- [ ] Code conforms with the [style guide](https://loopback.io/doc/en/contrib/style-guide-es6.html)
- [ ] Commit messages are following our [guidelines](https://loopback.io/doc/en/contrib/git-commit-messages.html)
- [ ] Code conforms with the [style
guide](http://loopback.io/doc/en/contrib/style-guide.html)

View File

@ -1 +0,0 @@
paths-ignore: [test]

24
.github/stale.yml vendored
View File

@ -1,24 +0,0 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 14
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
- critical
- p1
- major
- "good first issue"
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: >
This issue has been closed due to continued inactivity. Thank you for your understanding.
If you believe this to be in error, please contact one of the code owners,
listed in the `CODEOWNERS` file at the top-level of this repository.

View File

@ -1,127 +0,0 @@
name: CI
on:
push:
branches: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
schedule:
- cron: '0 2 * * 1' # At 02:00 on Monday
permissions: {}
jobs:
test:
name: Test
timeout-minutes: 15
strategy:
matrix:
os: [ubuntu-latest]
node-version: [18, 20]
include:
- os: macos-latest
node-version: 18
- os: windows-latest
node-version: 18
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Update NPM (Node.js v10)
if: matrix.node-version == 10
run: npm install --global npm@7
- name: Update NPM
if: matrix.node-version != 10
run: npm install --global npm@8
- name: Bootstrap project
run: npm ci --ignore-scripts
- name: Build project
run: npm run build
- name: Run tests
run: npm test --ignore-scripts
- name: Generate coverage report
run: npx --no-install nyc report --reporter=lcov
- name: Publish coverage report to Coveralls
uses: coverallsapp/github-action@master
with:
flag-name: run-${{ matrix.os }}-node@${{ matrix.node-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true
posttest:
name: Post-Test
needs: test
runs-on: ubuntu-latest
steps:
- name: Coveralls finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
code-lint:
name: Code Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
fetch-depth: 0
- name: Use Node.js 18
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 18
- name: Update NPM
run: npm install --global npm
- name: Bootstrap project
run: npm ci --ignore-scripts
- name: Build project
run: npm run build
- name: Verify code linting
run: npm run lint
commit-lint:
name: Commit Lint
runs-on: ubuntu-latest
if: ${{ github.event.pull_request }}
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
fetch-depth: 0
- name: Use Node.js 18
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 18
- name: Update NPM
run: npm install --global npm
- name: Bootstrap project
run: npm ci --ignore-scripts
- name: Verify commit linting
run: npx --no-install commitlint --from origin/master --to HEAD --verbose
codeql:
name: CodeQL
runs-on: ubuntu-latest
permissions:
# See: https://github.com/github/codeql-action/blob/008b2cc71c4cf3401f45919d8eede44a65b4a322/README.md#usage
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: 'javascript'
config-file: ./.github/codeql/codeql-config.yaml
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3

6
.gitignore vendored
View File

@ -5,8 +5,6 @@ coverage
v8.log
.idea
.DS_Store
.git
.vscode
benchmark.js
analyse.r
docs/html
@ -14,5 +12,5 @@ docs/man
npm-debug.log
.project
test/memory.json
.nyc_output
dist

View File

@ -1 +0,0 @@
reporter: dot

View File

@ -3,13 +3,10 @@ doc
coverage.html
coverage
v8.log
.git
.DS_Store
benchmark.js
analyse.r
docs/html
npm-debug.log
.travis.yml
.nyc_output
dist
types/__test__.ts

2
.npmrc
View File

@ -1,2 +0,0 @@
package-lock=true
scripts-prepend-node-path=true

9
.nycrc
View File

@ -1,9 +0,0 @@
{
"exclude": [
"test/**/*.js"
],
"reporter": [
"html"
],
"cache": true
}

View File

@ -1,2 +0,0 @@
*.json
*.md

View File

@ -1,6 +0,0 @@
{
"bracketSpacing": false,
"singleQuote": true,
"printWidth": 80,
"trailingComma": "all"
}

View File

@ -1,26 +1,5 @@
branches:
only:
- master
arch:
- arm64
- ppc64le
- s390x
dist: bionic
sudo: false
language: node_js
before_install: |
NODEJS_VERSION=$(node --version)
if [ 'v10' = ${NODEJS_VERSION%%.*} ]
then
npm install --global npm@7
else
npm install --global npm@8
fi
script:
- npm run --ignore-scripts build
- npm test --ignore-scripts
node_js:
- 10.24.1
- 12.22.12
- 14.21.3
- 16.20.2
- 17.9.1
- "4"
- "6"

1289
CHANGES.md

File diff suppressed because it is too large Load Diff

View File

@ -1,10 +0,0 @@
# Lines starting with '#' are comments.
# Each line is a file pattern followed by one or more owners,
# the last matching pattern has the most precedence.
# Current maintainers
* @jannyHou @dhmlau @zbarbuto @nitro404 @emonddr
# Alumni
#
# @lehni @kjdelisle @loay @ssh24 @virkt25 @shimks @b-admike

View File

@ -1,178 +0,0 @@
# Code of Conduct
LoopBack, as member project of the OpenJS Foundation, use
[Contributor Covenant v2.0](https://contributor-covenant.org/version/2/0/code_of_conduct)
as their code of conduct. The full text is included
[below](#contributor-covenant-code-of-conduct-v2.0) in English, and translations
are available from the Contributor Covenant organisation:
- [contributor-covenant.org/translations](https://www.contributor-covenant.org/translations)
- [github.com/ContributorCovenant](https://github.com/ContributorCovenant/contributor_covenant/tree/release/content/version/2/0)
Refer to the sections on reporting and escalation in this document for the
specific emails that can be used to report and escalate issues.
## Reporting
### Project Spaces
For reporting issues in spaces related to LoopBack, please use the email
`tsc@loopback.io`. The LoopBack Technical Steering Committee (TSC) handles CoC issues related to the spaces that it
maintains. The project TSC commits to:
- maintain the confidentiality with regard to the reporter of an incident
- to participate in the path for escalation as outlined in the section on
Escalation when required.
### Foundation Spaces
For reporting issues in spaces managed by the OpenJS Foundation, for example,
repositories within the OpenJS organization, use the email
`report@lists.openjsf.org`. The Cross Project Council (CPC) is responsible for
managing these reports and commits to:
- maintain the confidentiality with regard to the reporter of an incident
- to participate in the path for escalation as outlined in the section on
Escalation when required.
## Escalation
The OpenJS Foundation maintains a Code of Conduct Panel (CoCP). This is a
foundation-wide team established to manage escalation when a reporter believes
that a report to a member project or the CPC has not been properly handled. In
order to escalate to the CoCP send an email to
`coc-escalation@lists.openjsf.org`.
For more information, refer to the full
[Code of Conduct governance document](https://github.com/openjs-foundation/cross-project-council/blob/HEAD/CODE_OF_CONDUCT.md).
---
## Contributor Covenant Code of Conduct v2.0
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity and
orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
- Focusing on what is best not just for us as individuals, but for the overall
community
Examples of unacceptable behavior include:
- The use of sexualized language or imagery, and sexual attention or advances of
any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email address,
without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[tsc@loopback.io](mailto:tsc@loopback.io). All complaints will be reviewed and
investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series of
actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within the
community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.

View File

@ -1,4 +1,4 @@
Copyright (c) IBM Corp. 2011,2017. All Rights Reserved.
Copyright (c) IBM Corp. 2011,2016. All Rights Reserved.
Node module: loopback-datasource-juggler
This project is licensed under the MIT License, full text below.

View File

@ -4,15 +4,11 @@ An ORM/ODM that provides a common set of interfaces for interacting with databas
## Supported versions
This module adopts the [Module Long Term Support (LTS)](http://github.com/CloudNativeJS/ModuleLTS) policy, with the following End Of Life (EOL) dates:
Current|Long Term Support
:-:|:-:
3.x|2.x
| Version | Status | Published | EOL |
| ---------- | --------------- | --------- | -------------------- |
| 4.x | Current | Oct 2018 | Apr 2023 _(minimum)_ |
| 3.x | End-of-Life | Dec 2016 | Dec 2020 |
| 2.x | End-of-Life | Jul 2014 | Apr 2019 |
Learn more about our LTS plan in the [LoopBack documentation](http://loopback.io/doc/en/contrib/Long-term-support.html).
Learn more about our LTS plan in the [LoopBack documenation](http://loopback.io/doc/en/contrib/Long-term-support.html).
## Usage
@ -33,18 +29,3 @@ npm install loopback-connector-mongodb // in this case, the mongodb connector
See the [LoopBack documentation](http://loopback.io/doc/en/lb3/index.html).
For information on data source connectors, see [Connecting models to data sources](https://loopback.io/doc/en/lb3/Connecting-models-to-data-sources.html).
## Contributing
This project uses [DCO](https://developercertificate.org/). Be sure to sign off
your commits using the `-s` flag or adding `Signed-off-By: Name<Email>` in the
commit message.
**Example**
```
git commit -s -m "feat: my commit message"
```
Also see the [Contributing to LoopBack](https://loopback.io/doc/en/contrib/code-contrib.html) to get you started.

View File

@ -1,19 +0,0 @@
# Security Policy
## Security advisories
Security advisories can be found on the
[LoopBack website](https://loopback.io/doc/en/sec/index.html).
## Reporting a vulnerability
If you think you have discovered a new security issue with any LoopBack package,
**please do not report it on GitHub**. Instead, send an email to
[security@loopback.io](mailto:security@loopback.io) with the following details:
- Full description of the vulnerability.
- Steps to reproduce the issue.
- Possible solutions.
If you are sending us any logs as part of the report, then make sure to redact
any sensitive data from them.

View File

@ -1,21 +0,0 @@
// Copyright IBM Corp. 2017,2021. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const isCI = process.env.CI;
module.exports = {
extends: [
'@commitlint/config-conventional',
],
rules: {
'header-max-length': [2, 'always', 100],
'body-leading-blank': [2, 'always'],
'footer-leading-blank': [0, 'always'],
// Only enforce the rule if CI flag is not set. This is useful for release
// commits to skip DCO
'signed-off-by': [isCI ? 0 : 2, 'always', 'Signed-off-by:'],
},
};

View File

@ -1,12 +1,7 @@
{
"content": [
"lib/dao.js",
"lib/scope.js",
"lib/relation-definition.js",
"lib/datasource.js",
"lib/model.js",
"lib/model-definition.js",
"lib/mixins.js",
"lib/date-string.js",
"lib/geo.js",
"lib/hooks.js",

View File

@ -350,7 +350,7 @@ source.
* static and prototype methods to be mixed into the model constructor. The property can be defined
* on the prototype.
*/
connector.DataAccessObject = function() {};
connector.DataAccessObject = function {};
/**
* Connector instance can have an optional function to be called to handle data model definitions.

View File

@ -178,11 +178,11 @@ There are a set of options to control the model definition.
- strict:
- true: Only properties defined in the model are accepted. Use this
mode if you want to make sure only predefined properties are accepted. Relational databases only support this setting.
mode if you want to make sure only predefined properties are accepted.
- false: The model will be an open model. All properties are accepted,
including the ones that not predefined with the model. This mode is useful
if the mobile application just wants to store free form JSON data to
a schema-less database such as MongoDB. For relational databases, the value will be converted back to true.
a schema-less database such as MongoDB.
- undefined: Default to false unless the data source is backed by a
relational database such as Oracle or MySQL.

View File

@ -1,20 +1,20 @@
// Copyright IBM Corp. 2013,2019. All Rights Reserved.
// Copyright IBM Corp. 2013,2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const DataSource = require('../../loopback-datasource-juggler').DataSource;
const ModelBuilder = require('../../loopback-datasource-juggler').ModelBuilder;
const introspectType = require('../lib/introspection')(ModelBuilder);
var DataSource = require('../../loopback-datasource-juggler').DataSource;
var ModelBuilder = require('../../loopback-datasource-juggler').ModelBuilder;
var introspectType = require('../lib/introspection')(ModelBuilder);
const ds = new DataSource('memory');
var ds = new DataSource('memory');
// Create a open model that doesn't require a schema
const Application = ds.createModel('Schemaless', {}, {strict: false});
var Application = ds.createModel('Schemaless', {}, {strict: false});
const application = {
var application = {
owner: 'rfeng',
name: 'MyApp1',
description: 'My first app',
@ -47,7 +47,7 @@ Application.create(application, function(err, app1) {
});
// Instance JSON document
const user = {
var user = {
name: 'Joe',
age: 30,
birthday: new Date(),
@ -68,13 +68,13 @@ const user = {
};
// Introspect the JSON document to generate a schema
const schema = introspectType(user);
var schema = introspectType(user);
// Create a model for the generated schema
const User = ds.createModel('User', schema, {idInjection: true});
var User = ds.createModel('User', schema, {idInjection: true});
// Use the model for CRUD
const obj = new User(user);
var obj = new User(user);
console.log(obj.toObject());

View File

@ -1,14 +1,14 @@
// Copyright IBM Corp. 2013,2019. All Rights Reserved.
// Copyright IBM Corp. 2013,2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const ModelBuilder = require('../../loopback-datasource-juggler').ModelBuilder;
const modelBuilder = new ModelBuilder();
var ModelBuilder = require('../../loopback-datasource-juggler').ModelBuilder;
var modelBuilder = new ModelBuilder();
// define models
const Post = modelBuilder.define('Post', {
var Post = modelBuilder.define('Post', {
title: {type: String, length: 255},
content: {type: ModelBuilder.Text},
date: {type: Date, default: function() {
@ -19,7 +19,7 @@ const Post = modelBuilder.define('Post', {
});
// simpler way to describe model
const User = modelBuilder.define('User', {
var User = modelBuilder.define('User', {
name: String,
bio: ModelBuilder.Text,
approved: Boolean,
@ -27,14 +27,14 @@ const User = modelBuilder.define('User', {
age: Number,
});
const Group = modelBuilder.define('Group', {group: String});
var Group = modelBuilder.define('Group', {group: String});
// define any custom method
User.prototype.getNameAndAge = function() {
return this.name + ', ' + this.age;
};
let user = new User({name: 'Joe'});
var user = new User({name: 'Joe'});
console.log(user);
console.log(modelBuilder.models);

View File

@ -1,16 +1,16 @@
// Copyright IBM Corp. 2013,2019. All Rights Reserved.
// Copyright IBM Corp. 2013,2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const DataSource = require('../../loopback-datasource-juggler').DataSource;
const ModelBuilder = require('../../loopback-datasource-juggler').ModelBuilder;
const ds = new DataSource('memory');
var DataSource = require('../../loopback-datasource-juggler').DataSource;
var ModelBuilder = require('../../loopback-datasource-juggler').ModelBuilder;
var ds = new DataSource('memory');
// define models
const Post = ds.define('Post', {
var Post = ds.define('Post', {
title: {type: String, length: 255},
content: {type: DataSource.Text},
date: {type: Date, default: function() {
@ -21,7 +21,7 @@ const Post = ds.define('Post', {
});
// simplier way to describe model
const User = ds.define('User', {
var User = ds.define('User', {
name: String,
bio: DataSource.Text,
approved: Boolean,
@ -29,14 +29,14 @@ const User = ds.define('User', {
age: Number,
});
const Group = ds.define('Group', {name: String});
var Group = ds.define('Group', {name: String});
// define any custom method
User.prototype.getNameAndAge = function() {
return this.name + ', ' + this.age;
};
const user = new User({name: 'Joe'});
var user = new User({name: 'Joe'});
console.log(user);
// console.log(ds.models);
@ -58,10 +58,10 @@ Post.belongsTo(User, {as: 'author', foreignKey: 'userId'});
User.hasAndBelongsToMany('groups');
const user2 = new User({name: 'Smith', age: 14});
var user2 = new User({name: 'Smith', age: 14});
user2.save(function(err) {
console.log(user2);
const post = user2.posts.build({title: 'Hello world'});
var post = user2.posts.build({title: 'Hello world'});
post.save(function(err, data) {
console.log(err ? err : data);
});
@ -77,7 +77,7 @@ User.create({name: 'Jeff', age: 12}, function(err, data) {
return;
}
console.log(data);
const post = data.posts.build({title: 'My Post'});
var post = data.posts.build({title: 'My Post'});
console.log(post);
});
@ -90,8 +90,8 @@ User.minors(function(err, kids) {
console.log('Kids: ', kids);
});
const Article = ds.define('Article', {title: String});
const Tag = ds.define('Tag', {name: String});
var Article = ds.define('Article', {title: String});
var Tag = ds.define('Tag', {name: String});
Article.hasAndBelongsToMany('tags');
Article.create(function(e, article) {
@ -105,7 +105,7 @@ Article.create(function(e, article) {
});
// should be able to attach a data source to an existing model
const modelBuilder = new ModelBuilder();
var modelBuilder = new ModelBuilder();
const Color = modelBuilder.define('Color', {
name: String,

View File

@ -1,14 +1,14 @@
// Copyright IBM Corp. 2014,2019. All Rights Reserved.
// Copyright IBM Corp. 2014,2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const jdb = require('../index');
var jdb = require('../index');
let User, Post, Passport, City, Street, Building;
const nbSchemaRequests = 0;
var User, Post, Passport, City, Street, Building;
var nbSchemaRequests = 0;
setup(function() {
Passport.find({include: 'owner'}, function(err, passports) {
@ -35,7 +35,7 @@ setup(function() {
});
function setup(done) {
const db = new jdb.DataSource({connector: 'memory'});
var db = new jdb.DataSource({connector: 'memory'});
City = db.define('City');
Street = db.define('Street');
Building = db.define('Building');
@ -56,9 +56,9 @@ function setup(done) {
Post.belongsTo('author', {model: User, foreignKey: 'userId'});
db.automigrate(function() {
let createdUsers = [];
let createdPassports = [];
let createdPosts = [];
var createdUsers = [];
var createdPassports = [];
var createdPosts = [];
createUsers();
function createUsers() {
clearAndCreate(
@ -73,7 +73,7 @@ function setup(done) {
function(items) {
createdUsers = items;
createPassports();
},
}
);
}
@ -88,7 +88,7 @@ function setup(done) {
function(items) {
createdPassports = items;
createPosts();
},
}
);
}
@ -105,19 +105,19 @@ function setup(done) {
function(items) {
createdPosts = items;
done();
},
}
);
}
});
}
function clearAndCreate(model, data, callback) {
const createdItems = [];
var createdItems = [];
model.destroyAll(function() {
nextItem(null, null);
});
let itemIndex = 0;
var itemIndex = 0;
function nextItem(err, lastItem) {
if (lastItem !== null) {

View File

@ -1,11 +1,11 @@
// Copyright IBM Corp. 2013,2019. All Rights Reserved.
// Copyright IBM Corp. 2013,2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const path = require('path'),
var path = require('path'),
fs = require('fs'),
DataSource = require('../lib/datasource').DataSource;
@ -21,12 +21,12 @@ function loadSchemasSync(schemaFile, dataSource) {
}
// Read the dataSource JSON file
const schemas = JSON.parse(fs.readFileSync(schemaFile));
var schemas = JSON.parse(fs.readFileSync(schemaFile));
return dataSource.buildModels(schemas);
}
let models = loadSchemasSync(path.join(__dirname, 'jdb-schemas.json'));
var models = loadSchemasSync(path.join(__dirname, 'jdb-schemas.json'));
for (const s in models) {
const m = models[s];

View File

@ -1,15 +1,15 @@
// Copyright IBM Corp. 2013,2019. All Rights Reserved.
// Copyright IBM Corp. 2013,2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const ModelBuilder = require('../../loopback-datasource-juggler').ModelBuilder;
const modelBuilder = new ModelBuilder();
var ModelBuilder = require('../../loopback-datasource-juggler').ModelBuilder;
var modelBuilder = new ModelBuilder();
// simplier way to describe model
const User = modelBuilder.define('User', {
var User = modelBuilder.define('User', {
name: String,
bio: ModelBuilder.Text,
approved: Boolean,
@ -31,7 +31,7 @@ const User = modelBuilder.define('User', {
friends: [String],
});
const user = new User({
var user = new User({
name: 'Joe',
age: 20,
address: {street: '123 Main St', 'city': 'San Jose', state: 'CA'},

View File

@ -1,26 +1,26 @@
// Copyright IBM Corp. 2013,2019. All Rights Reserved.
// Copyright IBM Corp. 2013,2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const DataSource = require('../index').DataSource;
const ds = new DataSource('memory');
var DataSource = require('../index').DataSource;
var ds = new DataSource('memory');
const Order = ds.createModel('Order', {
var Order = ds.createModel('Order', {
items: [String],
orderDate: Date,
qty: Number,
});
const Customer = ds.createModel('Customer', {
var Customer = ds.createModel('Customer', {
name: String,
});
Order.belongsTo(Customer);
let order1, order2, order3;
var order1, order2, order3;
Customer.create({name: 'John'}, function(err, customer) {
Order.create({customerId: customer.id, orderDate: new Date(), items: ['Book']}, function(err, order) {
@ -42,7 +42,7 @@ Customer.create({name: 'John'}, function(err, customer) {
});
});
const customer3 = order.customer.build({name: 'Tom'});
var customer3 = order.customer.build({name: 'Tom'});
console.log('Customer 3', customer3);
});
});
@ -67,15 +67,15 @@ Customer.create({name: 'Ray'}, function(err, customer) {
});
});
const Physician = ds.createModel('Physician', {
var Physician = ds.createModel('Physician', {
name: String,
});
const Patient = ds.createModel('Patient', {
var Patient = ds.createModel('Patient', {
name: String,
});
const Appointment = ds.createModel('Appointment', {
var Appointment = ds.createModel('Appointment', {
physicianId: Number,
patientId: Number,
appointmentDate: Date,
@ -102,27 +102,25 @@ Physician.create({name: 'Dr John'}, function(err, physician1) {
patient1.physicians(console.log);
// Build an appointment?
const patient3 = patient1.physicians.build({name: 'Dr X'});
var patient3 = patient1.physicians.build({name: 'Dr X'});
console.log('Physician 3: ', patient3, patient3.constructor.modelName);
// Create a physician?
patient1.physicians.create({name: 'Dr X'}, function(err, patient4) {
console.log('Physician 4: ', patient4, patient4.constructor.modelName);
});
},
);
},
);
});
});
});
});
});
});
const Assembly = ds.createModel('Assembly', {
var Assembly = ds.createModel('Assembly', {
name: String,
});
const Part = ds.createModel('Part', {
var Part = ds.createModel('Part', {
partNumber: String,
});
@ -137,7 +135,7 @@ Assembly.create({name: 'car'}, function(err, assembly) {
});
// Build an part?
const part3 = assembly.parts.build({partNumber: 'door'});
var part3 = assembly.parts.build({partNumber: 'door'});
console.log('Part3: ', part3, part3.constructor.modelName);
// Create a part?

36
index.d.ts vendored
View File

@ -1,36 +0,0 @@
// Copyright IBM Corp. 2018. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
// Type definitions for loopback-datasource-juggler 3.x
// Project: https://github.com/strongloop/loopback-datasource-juggler
// Definitions by: Raymond Feng <https://github.com/raymondfeng>
// TypeScript Version: 2.8
/**
* Experimental TypeScript definitions to capture types of the key artifacts
* from `loopback-datasource-juggler` module. One of the main purposes is to
* leverage such types in `LoopBack 4`'s bridge to juggler.
*
* Please note some of the classes, properties, methods, and functions are
* intentionally not included in the definitions because of one of the following
* factors:
*
* - They are internal
* - They are to be deprecated
*/
export * from './types/common';
export * from './types/model';
export * from './types/relation';
export * from './types/query';
export * from './types/datasource';
export * from './types/kv-model';
export * from './types/persisted-model';
export * from './types/scope';
export * from './types/transaction-mixin';
export * from './types/relation-mixin';
export * from './types/observer-mixin';
export * from './types/validation-mixin';
export * from './types/inclusion-mixin';
export * from './types/connector';

View File

@ -1,11 +1,10 @@
// Copyright IBM Corp. 2011,2019. All Rights Reserved.
// Copyright IBM Corp. 2011,2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const SG = require('strong-globalize');
var SG = require('strong-globalize');
SG.SetRootDir(__dirname);
exports.ModelBuilder = exports.LDL = require('./lib/model-builder.js').ModelBuilder;
@ -18,7 +17,7 @@ Object.defineProperty(exports, 'version', {
get: function() { return require('./package.json').version; },
});
const commonTest = './test/common_test';
var commonTest = './test/common_test';
Object.defineProperty(exports, 'test', {
get: function() { return require(commonTest); },
});

View File

@ -1,97 +0,0 @@
{
"0483a77cf77741504204e5c066597487": "Vztah {{polymorphic}} {0}: {1} neočekává parametr `polymorphic.as` při definování vlastního parametru `foreignKey`/`discriminator` ",
"09483e03b91c8bd58732a74b3ef1ec13": "Neplatné datum: {0}",
"0a5aa17f7866a85e3aee37ef5369403c": "LinkManyToMany přijal cíl, který neobsahuje povinný \"{0}\"",
"0b16d3ffc42f91b4b9a4b3b50c41c838": "Pořadí {0} není platné",
"0bd753a8944ad0af85a939bb25273887": "Nelze ukončit platnost neznámého klíče {0}",
"0c0b867aca0973ba26e887d3337cc4ec": "Model {{Polymorphic}} nebyl nalezen: `{0}` nenastaven",
"0c4eb8b6c2ff6e51d7e195eee346ced9": "Tabulka '{0}' neexistuje.",
"0ff31abb394afb555df162e74ff1a0a0": "{{id}} nelze aktualizovat z {0} na {1}, když je {{forceId}} nastaveno na true",
"1ae7d3e0be381efb32bfd1ba652f5172": "VAROVÁNÍ: Vztah {{polymorphic}} {0}: {1} používá klíčové slovo `polymorphic.as`, které bude ZAMÍTNUTO v LoopBack.next, vit tato dokumentace s řešeními nahrazení (https://loopback.io/doc/en/lb3/Polymorphic-relations.html#deprecated-polymorphic-as)",
"1daef4e937fe52136597ba8fd2060f55": "Vnoření transakcí není podporováno",
"21095484501dbff31af6556fa6039182": "Parametr {{offset/skip}} {0} není platný",
"280f4550f90e133118955ec6f6f72830": "Byl zadán typ diskriminátoru {0}, ale neexistuje žádný model s tímto názvem",
"28697ec15968a7969211f6d035ba9260": "Vztah {{polymorphic}} {0}: {1} neočekává parametr `model`",
"2c4904377a87fdab502118719cc0d266": "{{Transaction}} není podporována",
"2c5c8519721f749aab13c2f04f41d611": "Vlastnost {0} má neplatnou klauzuli {1}: Očekávaly se přesně 2 hodnoty, přijaty {2}",
"2f4af31c144bbfab1bbf479866acd820": "\nVAROVÁNÍ: Konektor {{LoopBack}} \"{0}\" není nainstalován jako žádný z následujících modulů:\n\n {1}\n\nChcete-li provést opravu, spusťte:\n\n {{npm install {2} --save}}\n",
"3864f9be10f27723074566d2b3893514": "Varování: Model {0}, {{strict mode: `throw`}} byl odebrán, místo toho použijte {{`strict: true`}}, což vrací {{`Validation Error`}} pro neznámé vlastnosti,",
"38dbf42c29a4645238cc3d632e88ebc9": "{{Relation.modelTo}} není definován pro vztah {0} a není {{polymorphic}}",
"3cde8cc9bca22c67278b202ab0720106": "Žádná instance s ID {0} nebyla nalezena pro {1}",
"416dfbb7b823f51c9f3800be81060b41": "Žádná instance s {{id}} {0} nebyla nalezena pro {1}",
"49b5afd8c6a19ad9c8abeffb2f8114eb": "Metoda BelongsTo \"getAsync()\" je zamítnuta, místo toho použijte \"get()\".",
"4c78325cedbb826db3a05bf5df0e8546": "Musíte zadat {{id}} při nahrazení!",
"4e31b1edd10dadb724d83387de0b5062": "Parametr {{limit}} {0} není platný",
"514985b2327f061ffb1c932f6b909979": "Model {0} není definován.",
"525c856e65daab43be247e7b5410febd": "Vztah {{polymorphic}} {0}: {1} neočekává parametr `polymorphic.selector` při definování vlastního parametru `foreignKey`/`discriminator` ",
"5c18ee111dd87540cdb19a2a93b33be9": "Transakce je odvolána v důsledku vypršení časového limitu",
"5ec7e6664256f7ea78f4f06dafc7d974": "Transakce není připravena, počkejte na vyřešení vráceného závazku",
"5ec8efeb715a2c34b440f2d76e2cf87d": " {0}",
"6111399276924ffa3bc9a410cdfcb2e5": "Žádný název {{id}} {0}",
"614e3355647e4127c96256102dc63376": "Vlastnost {0} má neplatnou klauzuli {1}: Byl očekáván řetězec nebo RegExp",
"62a2d80c405b7fec5f547c448ab1b6ff": "{{order}} {0} má neplatný směr",
"6502a117987610380b9068ef98b1b0ee": "Nebyl nalezen žádný záznam v {0} pro ({1}. {2}, {3}. {4})",
"67c2bf43b5281ab929617423ea8a6f3e": "Konektor {0} nepodporuje operaci {{replaceById}}. Nejde o chybu ve zpětné smyčce. Obraťte se na autory konektoru, pokud možno přes problémy GitHub.",
"6c3234937d69763fc7f6bcafccc59bbc": "{{Model::deleteById}} vyžaduje argument {{id}}",
"6eb6fd4fbd73394000bc25f5776fd20c": "{{Model::exists}} vyžaduje argument {{id}}",
"6fcc2ff0db7a4f490f5e0ce9e24691f3": "Vztah {{HasOne}} nemůže vytvořit více než jednu instanci {0}",
"728232e473bf80272c042df2b7e002f4": "Vztah {{polymorphic}} {0}: {1} vyžaduje parametr `polymorphic.discriminator`, je-li dodán parametr `polymorphic.foreignKey`",
"791ab3031a73ede03f7d6299a85e8289": "Časový limit připojení po {0} ms",
"7b277018e43d41bc445731092b91547d": "Nepřipojeno",
"7bbbdece4eea90e42aa5c0bce295e503": "{{Model::findById}} vyžaduje argument {{id}}",
"7e9530c0399289be0ee601a604be71ff": "Vztah {{BelongsTo}} {0} je prázdný",
"7faa840eb6ce11250a141deb42a6c489": "Neznámý vztah {{scope}}: {0}",
"8091838319a5cc7d6a34af2f2a616ce9": "Název vlastnosti by neměl být \"{{constructor}}\" v modelu: {0}",
"881e4b0cb86ed59549248ee540a9fd10": "Název vlastnosti \"{{constructor}}\" není povolen v datech {0}",
"89afd3a9249f5a8d3edda07d84ca049d": "Model {{Polymorphic}} nebyl nalezen: `{0}`",
"89bf6d92731fe7bd2146ce8d0bec205c": "Neplatný argument, musí být řetězec, {{regex}} nebo {{RegExp}}",
"8a39126103a157f501affa070367a1b0": "Instance {0} není platná. Podrobnosti: {1}.",
"8c5ab01638c1ac1d58168c6346a8481a": "Neplatné příznaky {{regex}}: {0}",
"938401ea4ce48159efa9be1d4a5e8bab": "Položkami musí být pole: {0}",
"9e1f143ee02946324d34da92f71bf74e": "Vztah {0}: {1} vyžaduje parametr `model`",
"a004f310d315e592843776fab964eaeb": "Vztahy {{Polymorphic}} vyžadují model typu through",
"a0cf0e09c26df14283223e84e6a10f00": "Nelze aktualizovat atributy. {{Object}} s {{id}} {0} neexistuje!",
"a2487abefef4259c2131d96cdb8543b1": "Připojení se nezdařilo: {0} \nBude zopakováno pro další požadavek.",
"a25e41a39c60c4702e55d0c3936576a1": "Neshoda klíče: {0}. {1}: {2}, {3}. {4}: {5}",
"a327355560d495454fba2c1aad6bdf09": "Neznámá metoda rozsahu: {0}",
"a6c18a7f4390cd3d59a2a7a047ae2aab": "Spustit příkaz \"{{npm install loopback-datasource-juggler}} {0}\" ",
"a829dee089c912e68c18920ba015400c": "VAROVÁNÍ: Vlastnost {{id}} nelze změnit z {0} na {1} pro model: {2} v háčku operace {{'loaded'}}",
"a984a076c59e451948b2bcf7a393d860": "VAROVÁNÍ: Vlastnost {{id}} nelze změnit z {0} na {1} pro model: {2} v háčku operace {{'before save'}}",
"ac04cf275b71c1eb89a41cf6bbad7a64": "Metoda HasOne \"getAsync()\" je zamítnuta, místo toho použijte \"get()\".",
"b138294f132edfe1eb2a8211150c7238": "Neočekávaný parametr `undefined` v dotazu",
"b15b20280211ad258d92947f05b6e4a5": "Konektor nebyl inicializován.",
"b278876ec93ef9760f00e83f38ba313d": "Metoda Scope \"getAsync()\" je zamítnuta, místo toho použijte \"find()\".",
"ba0fd8106eb54de4d003a844206431fd": "Háček modelu \"{0}\" je zamítnut, místo toho použijte háčky operace. {{http://docs.strongloop.com/display/LB/Operation+hooks}}",
"baf2c8b0c5a574b8a894e9b6304fece1": "Klauzule where {0} není {{object}}",
"bdb11cc1c780c9ccac33c316cfdc9d82": "Není definován typ vlastnosti {0}.{1}",
"bdfb951c8ff7ce0cbc08c06f548fd927": "Hodnota je prázdný {{object}}",
"bec226891a505828bfc76c5cfd73b336": "Nelze získat TTL pro neznámý klíč {0}",
"cd930369e86cdd222f7bd117c6f9fa94": "Neznámý poskytovatel výchozí hodnoty {0}",
"cfee4d8149316d9a647c0885cf3cafaf": "Názvy vlastnosti obsahující tečku(y) nejsou podporovány. Model: {0}, dynamická vlastnost: {1}",
"d40328eabd8756d795bcdd49d782d4e9": "Zdroj dat nepodporuje transakce",
"da02dd6c53d4148320eeb31718a7aebe": "Neplatný typ pro vlastnost {0}",
"da751a8a748adbde5b55fa83b707b4e2": "Názvy vlastnosti obsahující tečku(y) nejsou podporovány. Model: {0}, vlastnost: {1}",
"db03083e9a768388fdbee865249ac67a": "Ignorují se chyby ověření platnosti v {{updateOrCreate()}}:",
"dd63416d9b7d9fa4181e89efd619dfd8": "Hodnota není {{array}} nebo {{object}} se sekvenčními číselnými indexy",
"ddf0aa14803f1c84f4a97f3803f7471c": "Je vyžadován název třídy",
"e08ab0e1ab55f26c357061447b635905": "Nebyl nalezen žádný vztah v {0} pro ({1}. {2}, {3}. {4})",
"e0e9504e137a3c3339144b51ed76fef2": "Konektor není definován správně: měl by vytvořit člen `{{connector}}` zdroje dat",
"e2f282cbe3efba001d6d3a09f7f6ca8c": "Vztah {{polymorphic}} {0}: {1} vyžaduje parametr `polymorphic.foreignKey`, když je dodán parametr `polymorphic.discriminator`",
"e39e0f5d52bfbf511e645d19ecadd2fa": "Vlastnost {0} má neplatnou klauzuli {1}: {2}",
"e4434de4bb8f5a3cd1d416e4d80d7e0b": "Neznámé \"{0}\" {{id}} \"{1}\".",
"e54d944c2a2c85a23caa86027ae307cf": "Nelze migrovat modely, které nejsou připojeny k tomuto zdroji dat: {0}",
"e54f118a75e15e132f16b985274eb46d": "Filtr dotazu {0} není {{object}}",
"e55937649d8d7a11706b8cec22d02eae": "Vztah {{HasOne}} {0} je prázdný",
"e6161ae8459c79d810e2aa9d21282a39": "Při aktualizaci atributů musíte poskytnout {{id}}!",
"eb56c2b0c30cf006e2df00a549ec9c2c": "Vztah \"{0}\" není definován pro model {1}",
"ec42dca074f1818c447f7ad16e2d01af": "{0} není poskytnut připojeným konektorem",
"ecb7aa804bf54c682999d20d6436104c": "{{transaction}} není aktivní: {0}",
"f30809cb932b72a66416a709c8531530": "Konektor nepodporuje {{method}} v rámci transakce",
"f41bd91dc0f000a79c0bf842f1b7fdf9": "nelze vytvořit seznam z řetězce JSON: {0}",
"f6e8c96c93b9c7687d6c172b3695e898": "Vlastnost {{id}} ({0}) nelze aktualizovat z {1} na {2}",
"fa9ae17e8e008d0eb0f0421a2972308c": "Vztah {{polymorphic}} {0}: {1} vyžaduje parametr `model`",
"fca4d12faff1035d9d0438d73432571b": "Duplicitní položka pro {0}.{1}",
"fd3cc89dc67e2d604eaae21bdf41d403": "Nelze najít vztah {0} pro model {1}",
"fec8ebda24db46a9d040bf863765cc44": "Operátor {0} má neplatné klauzule {1}: {2}"
}

View File

@ -1,97 +1,80 @@
{
"0483a77cf77741504204e5c066597487": "{{polymorphic}} {0} Beziehung: {1} erwartet keinen Parameter 'polymorphic.as' beim Definieren eines angepassten 'foreignKey'/'discriminator' ",
"09483e03b91c8bd58732a74b3ef1ec13": "Ungültiges Datum: {0}",
"0a5aa17f7866a85e3aee37ef5369403c": "LinkManyToMany hat ein Ziel empfangen, dass das erforderliche \"{0}\" nicht enthält",
"0b16d3ffc42f91b4b9a4b3b50c41c838": "Die Reihenfolge {0} ist nicht gültig",
"0bd753a8944ad0af85a939bb25273887": "Unbekannter Schlüssel {0} darf nicht ablaufen",
"0c0b867aca0973ba26e887d3337cc4ec": "{{Polymorphic}}-Modell nicht gefunden: '{0}' nicht festgelegt",
"0c4eb8b6c2ff6e51d7e195eee346ced9": "Tabelle '{0}' ist nicht vorhanden.",
"0ff31abb394afb555df162e74ff1a0a0": "{{id}} kann nicht von {0} auf {1} aktualisiert werden, wenn für {{forceId}} true festgelegt ist",
"1ae7d3e0be381efb32bfd1ba652f5172": "WARNUNG: {{polymorphic}} {0} Beziehung: {1} verwendet Schlüsselwort 'polymorphic.as', das in LoopBack.next VERALTET sein wird. Lesen Sie diese Dokumentation zu Ersatzlösungen (https://loopback.io/doc/en/lb3/Polymorphic-relations.html#deprecated-polymorphic-as)",
"1daef4e937fe52136597ba8fd2060f55": "Verschachtelungstransaktionen werden nicht unterstützt",
"21095484501dbff31af6556fa6039182": "Der {{offset/skip}}-Parameter {0} ist nicht gültig",
"280f4550f90e133118955ec6f6f72830": "Diskriminatortyp {0} angegeben, aber es ist kein Modell mit diesem Namen vorhanden",
"28697ec15968a7969211f6d035ba9260": "{{polymorphic}} {0} Beziehung: {1} erwartet keinen Parameter 'model'",
"2c4904377a87fdab502118719cc0d266": "{{Transaction}} wird nicht unterstützt",
"2c5c8519721f749aab13c2f04f41d611": "Die Eigenschaft {0} weist die ungültige Klausel {1} auf: Es wurden genau 2 Werte erwartet, aber {2} empfangen",
"2f4af31c144bbfab1bbf479866acd820": "\nWARNUNG: {{LoopBack}}-Konnektor \"{0}\" ist als keines der folgenden Module installiert:\n\n {1}\n\nFühren Sie zur Behebung Folgendes aus:\n\n {{npm install {2} --save}}\n",
"3864f9be10f27723074566d2b3893514": "Warnung: Modell {0}, {{strict mode: `throw`}} wurde entfernt. Verwenden Sie stattdessen {{`strict: true`}}, wodurch {{`Validation Error`}} für unbekannte Eigenschaften zurückgegeben wird.",
"38dbf42c29a4645238cc3d632e88ebc9": "{{Relation.modelTo}} ist für Beziehung {0} nicht definiert und ist keine {{polymorphic}}",
"3cde8cc9bca22c67278b202ab0720106": "Keine Instanz mit ID {0} für {1} gefunden",
"416dfbb7b823f51c9f3800be81060b41": "Keine Instanz mit {{id}} {0} für {1} gefunden",
"49b5afd8c6a19ad9c8abeffb2f8114eb": "BelongsTo-Methode \"getAsync()\" ist veraltet, verwenden Sie stattdessen \"get()\".",
"bec226891a505828bfc76c5cfd73b336": "TTL für unbekannten Schlüssel {0} kann nicht abgerufen werden",
"4c78325cedbb826db3a05bf5df0e8546": "Sie müssen beim Ersetzen eine {{id}} angeben!",
"a0cf0e09c26df14283223e84e6a10f00": "Attribute konnten nicht aktualisiert werden. {{Object}} mit {{id}} {0} ist nicht vorhanden!",
"e54d944c2a2c85a23caa86027ae307cf": "Modelle, die nicht an diese Datenquelle angehängt sind, können nicht migriert werden: {0}",
"e6161ae8459c79d810e2aa9d21282a39": "Sie müssen beim Aktualisieren von Attributen eine {{id}} angeben!",
"fca4d12faff1035d9d0438d73432571b": "Doppelter Eintrag für {0}.{1}",
"09483e03b91c8bd58732a74b3ef1ec13": "Ungültiges Datum: {0}",
"0b16d3ffc42f91b4b9a4b3b50c41c838": "Die Reihenfolge {0} ist nicht gültig",
"0ff31abb394afb555df162e74ff1a0a0": "{{id}} kann nicht von {0} auf {1} aktualisiert werden, wenn für {{forceId}} true festgelegt ist",
"21095484501dbff31af6556fa6039182": "Der {{offset/skip}}-Parameter {0} ist nicht gültig",
"2c5c8519721f749aab13c2f04f41d611": "Die Eigenschaft {0} weist die ungültige Klausel {1} auf: Es wurden genau 2 Werte erwartet, aber {2} empfangen",
"416dfbb7b823f51c9f3800be81060b41": "Keine Instanz mit {{id}} {0} für {1} gefunden",
"4e31b1edd10dadb724d83387de0b5062": "Der {{limit}}-Parameter {0} ist nicht gültig",
"514985b2327f061ffb1c932f6b909979": "Modell {0} ist nicht definiert.",
"525c856e65daab43be247e7b5410febd": "{{polymorphic}} {0} Beziehung: {1} erwartet keinen Parameter 'polymorphic.selector' beim Definieren eines angepassten 'foreignKey'/'discriminator' ",
"5c18ee111dd87540cdb19a2a93b33be9": "Transaktion wurde aufgrund eines Zeitlimits rückgängig gemacht",
"5ec7e6664256f7ea78f4f06dafc7d974": "Transaktion ist nicht bereit, auf die Auflösung des zurückgegebenen Promise warten",
"5ec8efeb715a2c34b440f2d76e2cf87d": " {0}",
"6111399276924ffa3bc9a410cdfcb2e5": "Kein {{id}}-Name {0}",
"614e3355647e4127c96256102dc63376": "Die Eigenschaft {0} weist die ungültige Klausel {1} auf: Es wurde eine Zeichenfolge oder RegExp erwartet",
"62a2d80c405b7fec5f547c448ab1b6ff": "Die {{order}} {0} hat eine ungültige Richtung",
"6502a117987610380b9068ef98b1b0ee": "Kein Datensatz gefunden in {0} für ({1}.{2} ,{3}.{4})",
"67c2bf43b5281ab929617423ea8a6f3e": "Der Konnektor {0} unterstützt die Operation {{replaceById}} nicht. Hierbei handelt es sich nicht um einen Fehler in LoopBack. Wenden Sie sich an die Ersteller des Konnektors, vorzugsweise über GitHub-Probleme.",
"6c3234937d69763fc7f6bcafccc59bbc": "{{Model::deleteById}} erfordert das Argument {{id}}",
"6eb6fd4fbd73394000bc25f5776fd20c": "{{Model::exists}} erfordert das Argument {{id}}",
"6fcc2ff0db7a4f490f5e0ce9e24691f3": "{{HasOne}}-Beziehung kann nicht mehr als eine Instanz von {0} erstellen",
"728232e473bf80272c042df2b7e002f4": "{{polymorphic}} {0} Beziehung: {1} erfordert den Parameter 'polymorphic.discriminator', wenn der Parameter 'polymorphic.foreignKey' angegeben ist",
"791ab3031a73ede03f7d6299a85e8289": "Zeitlimitüberschreitung bei Verbindungsherstellung nach {0} ms",
"7b277018e43d41bc445731092b91547d": "Nicht verbunden",
"7bbbdece4eea90e42aa5c0bce295e503": "{{Model::findById}} erfordert das Argument {{id}}",
"7e9530c0399289be0ee601a604be71ff": "{{BelongsTo}}-Beziehung {0} ist leer",
"7faa840eb6ce11250a141deb42a6c489": "Unbekannter {{scope}} für Beziehung: {0}",
"8091838319a5cc7d6a34af2f2a616ce9": "Eigenschaftsname sollte nicht \"{{constructor}}\" sein in Modell: {0}",
"881e4b0cb86ed59549248ee540a9fd10": "Eigenschaftsname \"{{constructor}}\" ist in {0}-Daten nicht zulässig",
"89afd3a9249f5a8d3edda07d84ca049d": "{{Polymorphic}}-Modell nicht gefunden: '{0}'",
"89bf6d92731fe7bd2146ce8d0bec205c": "Ungültiges Argument, muss eine Zeichenfolge, ein {{regex}}-Literalwert oder ein {{RegExp}}-Objekt sein",
"8a39126103a157f501affa070367a1b0": "Die Instanz {0} ist nicht gültig. Details: {1}.",
"8c5ab01638c1ac1d58168c6346a8481a": "Ungültige {{regex}}-Flags: {0}",
"938401ea4ce48159efa9be1d4a5e8bab": "Elemente müssen ein Array sein: {0}",
"9e1f143ee02946324d34da92f71bf74e": "{0} Beziehung: {1} erfordert den Parameter 'model'",
"a004f310d315e592843776fab964eaeb": "{{Polymorphic}}-Beziehungen erfordern ein through-Modell",
"a0cf0e09c26df14283223e84e6a10f00": "Attribute konnten nicht aktualisiert werden. {{Object}} mit {{id}} {0} ist nicht vorhanden!",
"a2487abefef4259c2131d96cdb8543b1": "Verbindungsfehler: {0}\nNach der nächsten Anforderung findet ein Neuversuch statt.",
"a25e41a39c60c4702e55d0c3936576a1": "Schlüssel stimmen nicht überein: {0}.{1}: {2}, {3}.{4}: {5}",
"a327355560d495454fba2c1aad6bdf09": "Unbekannte Bereichsmethode: {0}",
"a6c18a7f4390cd3d59a2a7a047ae2aab": "Führen Sie den Befehl \"{{npm install loopback-datasource-juggler}} {0}\" aus ",
"a829dee089c912e68c18920ba015400c": "WARNUNG: Eigenschaft {{id}} darf für Modell {2} in Operationshook {{'loaded'}} nicht von {0} in {1} geändert werden",
"a984a076c59e451948b2bcf7a393d860": "WARNUNG: Eigenschaft {{id}} darf für Modell {2} in Operationshook {{'before save'}} nicht von {0} in {1} geändert werden",
"ac04cf275b71c1eb89a41cf6bbad7a64": "HasOne-Methode \"getAsync()\" ist veraltet, verwenden Sie stattdessen \"get()\".",
"b138294f132edfe1eb2a8211150c7238": "Unerwartetes 'nicht definiert' in Abfrage",
"b15b20280211ad258d92947f05b6e4a5": "Der Konnektor wurde nicht initialisiert.",
"b278876ec93ef9760f00e83f38ba313d": "Scope-Methode \"getAsync()\" ist veraltet, verwenden Sie stattdessen \"get()\".",
"ba0fd8106eb54de4d003a844206431fd": "Modellhook \"{0}\" ist veraltet, verwenden Sie stattdessen Operationshooks. {{http://docs.strongloop.com/display/LB/Operation+hooks}}",
"baf2c8b0c5a574b8a894e9b6304fece1": "Bei der where-Klausel {0} handelt es sich nicht um ein {{object}}",
"bdb11cc1c780c9ccac33c316cfdc9d82": "Typ nicht definiert für Eigenschaft {0}.{1}",
"bdfb951c8ff7ce0cbc08c06f548fd927": "Wert ist ein leeres {{object}}",
"bec226891a505828bfc76c5cfd73b336": "TTL für unbekannten Schlüssel {0} kann nicht abgerufen werden",
"cd930369e86cdd222f7bd117c6f9fa94": "Unbekannter Standardwertprovider {0}",
"cfee4d8149316d9a647c0885cf3cafaf": "Eigenschaftsnamen, die Punkt(e) enthalten, werden nicht unterstützt. Modell: {0}, dynamische Eigenschaft: {1}",
"d40328eabd8756d795bcdd49d782d4e9": "DataSource unterstützt keine Transaktionen",
"da02dd6c53d4148320eeb31718a7aebe": "Ungültiger Typ für Eigenschaft {0}",
"da751a8a748adbde5b55fa83b707b4e2": "Eigenschaftsnamen, die Punkt(e) enthalten, werden nicht unterstützt. Modell: {0}, Eigenschaft: {1}",
"db03083e9a768388fdbee865249ac67a": "Validierungsfehler in {{updateOrCreate()}} werden ignoriert:",
"dd63416d9b7d9fa4181e89efd619dfd8": "Der Wert ist kein {{array}} oder {{object}} mit sequenziellen numerischen Indizes",
"ddf0aa14803f1c84f4a97f3803f7471c": "Klassenname erforderlich",
"e08ab0e1ab55f26c357061447b635905": "Keine Beziehung gefunden in {0} für ({1}.{2} ,{3}.{4})",
"e0e9504e137a3c3339144b51ed76fef2": "Konnektor ist nicht ordnungsgemäß definiert: Er sollte ein {{connector}}-Member von dataSource erstellen",
"e2f282cbe3efba001d6d3a09f7f6ca8c": "{{polymorphic}} {0} Beziehung: {1} erfordert den Parameter 'polymorphic.foreignKey', wenn der Parameter 'polymorphic.discriminator' angegeben ist",
"e39e0f5d52bfbf511e645d19ecadd2fa": "Die Eigenschaft {0} weist die ungültige Klausel {1} auf: {2}",
"e4434de4bb8f5a3cd1d416e4d80d7e0b": "Unbekannte \"{0}\" {{id}} \"{1}\".",
"e54d944c2a2c85a23caa86027ae307cf": "Modelle, die nicht an diese Datenquelle angehängt sind, können nicht migriert werden: {0}",
"e4434de4bb8f5a3cd1d416e4d80d7e0b": "Unbekannte \"{0}\"-{{id}} \"{1}\".",
"e54f118a75e15e132f16b985274eb46d": "Beim Abfragefilter {0} handelt es sich nicht um ein {{object}}",
"e55937649d8d7a11706b8cec22d02eae": "{{HasOne}}-Beziehung {0} ist leer",
"e6161ae8459c79d810e2aa9d21282a39": "Sie müssen beim Aktualisieren von Attributen eine {{id}} angeben!",
"eb56c2b0c30cf006e2df00a549ec9c2c": "Beziehung \"{0}\" ist nicht definiert für {1} modell",
"ec42dca074f1818c447f7ad16e2d01af": "{0} wird vom zugeordneten Konnektor nicht angegeben",
"ecb7aa804bf54c682999d20d6436104c": "Die {{transaction}} ist nicht aktiv: {0}",
"f30809cb932b72a66416a709c8531530": "Der Konnektor unterstützt {{method}} innerhalb einer Transaktion nicht",
"f41bd91dc0f000a79c0bf842f1b7fdf9": "konnte Liste nicht aus JSON-Zeichenfolge erstellen: {0}",
"f6e8c96c93b9c7687d6c172b3695e898": "{{id}}-Eigenschaft ({0}) kann nicht von {1} in {2} aktualisiert werden",
"fa9ae17e8e008d0eb0f0421a2972308c": "{{polymorphic}} {0} Beziehung: {1} erfordert den Parameter 'model'",
"fca4d12faff1035d9d0438d73432571b": "Doppelter Eintrag für {0}.{1}",
"fd3cc89dc67e2d604eaae21bdf41d403": "Beziehung {0} für Modell {1} konnte nicht gefunden werden",
"fec8ebda24db46a9d040bf863765cc44": "Der Operator {0} weist ungültige Klauseln {1} auf: {2}"
"fec8ebda24db46a9d040bf863765cc44": "Der Operator {0} weist ungültige Klauseln {1} auf: {2}",
"0be2d39d225b1d8b2a0f92ad5c65c9ac": "Kein Modell für {{polymorphic}} {0} angegeben: {1}",
"0c4eb8b6c2ff6e51d7e195eee346ced9": "Tabelle '{0}' ist nicht vorhanden.",
"2f4af31c144bbfab1bbf479866acd820": "\nWARNUNG: {{LoopBack}}-Konnektor \"{0}\" ist als keines der folgenden Module installiert:\n\n {1}\n\nFühren Sie zur Behebung Folgendes aus:\n\n {{npm install {2} --save}}\n",
"6111399276924ffa3bc9a410cdfcb2e5": "Kein {{id}}-Name {0}",
"791ab3031a73ede03f7d6299a85e8289": "Zeitlimitüberschreitung bei Verbindungsherstellung nach {0} ms",
"7b277018e43d41bc445731092b91547d": "Nicht verbunden",
"a2487abefef4259c2131d96cdb8543b1": "Verbindungsfehler: {0}\nNach der nächsten Anforderung findet ein Neuversuch statt.",
"b15b20280211ad258d92947f05b6e4a5": "Der Konnektor wurde nicht initialisiert.",
"ddf0aa14803f1c84f4a97f3803f7471c": "Klassenname erforderlich",
"e0e9504e137a3c3339144b51ed76fef2": "Konnektor ist nicht ordnungsgemäß definiert: Er sollte ein {{connector}}-Member von dataSource erstellen",
"ec42dca074f1818c447f7ad16e2d01af": "{0} wird vom zugeordneten Konnektor nicht angegeben",
"ba0fd8106eb54de4d003a844206431fd": "Modellhook \"{0}\" ist veraltet, verwenden Sie stattdessen Operationshooks. {{http://docs.strongloop.com/display/LB/Operation+hooks}}",
"280f4550f90e133118955ec6f6f72830": "Diskriminatortyp {0} angegeben, aber es ist kein Modell mit diesem Namen vorhanden",
"38dbf42c29a4645238cc3d632e88ebc9": "{{Relation.modelTo}} ist für Beziehung {0} nicht definiert und ist keine {{polymorphic}}",
"eb56c2b0c30cf006e2df00a549ec9c2c": "Beziehung \"{0}\" ist nicht definiert für {1} modell",
"938401ea4ce48159efa9be1d4a5e8bab": "Elemente müssen ein Array sein: {0}",
"f41bd91dc0f000a79c0bf842f1b7fdf9": "konnte Liste nicht aus JSON-Zeichenfolge erstellen: {0}",
"514985b2327f061ffb1c932f6b909979": "Modell {0} ist nicht definiert.",
"8091838319a5cc7d6a34af2f2a616ce9": "Eigenschaftsname sollte nicht \"{{constructor}}\" sein in Modell: {0}",
"da02dd6c53d4148320eeb31718a7aebe": "Ungültiger Typ für Eigenschaft {0}",
"da751a8a748adbde5b55fa83b707b4e2": "Eigenschaftsnamen, die Punkt(e) enthalten, werden nicht unterstützt. Modell: {0}, Eigenschaft: {1}",
"3864f9be10f27723074566d2b3893514": "Warnung: Modell {0}, {{strict mode: `throw`}} wurde entfernt. Verwenden Sie stattdessen {{`strict: true`}}, wodurch {{`Validation Error`}} für unbekannte Eigenschaften zurückgegeben wird.",
"881e4b0cb86ed59549248ee540a9fd10": "Eigenschaftsname \"{{constructor}}\" ist in {0}-Daten nicht zulässig",
"bdb11cc1c780c9ccac33c316cfdc9d82": "Typ nicht definiert für Eigenschaft {0}.{1}",
"cd930369e86cdd222f7bd117c6f9fa94": "Unbekannter Standardwertprovider {0}",
"cfee4d8149316d9a647c0885cf3cafaf": "Eigenschaftsnamen, die Punkt(e) enthalten, werden nicht unterstützt. Modell: {0}, dynamische Eigenschaft: {1}",
"0c0b867aca0973ba26e887d3337cc4ec": "{{Polymorphic}}-Modell nicht gefunden: '{0}' nicht festgelegt",
"2f062cbecdf24245731bddc77714c814": "\"{0}\"-Beziehung für {1} konnte nicht gefunden werden",
"3cde8cc9bca22c67278b202ab0720106": "Keine Instanz mit ID {0} für {1} gefunden",
"6502a117987610380b9068ef98b1b0ee": "Kein Datensatz gefunden in {0} für ({1}.{2} ,{3}.{4})",
"6fcc2ff0db7a4f490f5e0ce9e24691f3": "{{HasOne}}-Beziehung kann nicht mehr als eine Instanz von {0} erstellen",
"7e9530c0399289be0ee601a604be71ff": "{{BelongsTo}}-Beziehung {0} ist leer",
"7faa840eb6ce11250a141deb42a6c489": "Unbekannter {{scope}} für Beziehung: {0}",
"89afd3a9249f5a8d3edda07d84ca049d": "{{Polymorphic}}-Modell nicht gefunden: '{0}'",
"a004f310d315e592843776fab964eaeb": "{{Polymorphic}}-Beziehungen erfordern ein through-Modell",
"a25e41a39c60c4702e55d0c3936576a1": "Schlüssel stimmen nicht überein: {0}.{1}: {2}, {3}.{4}: {5}",
"a327355560d495454fba2c1aad6bdf09": "Unbekannte Bereichsmethode: {0}",
"e08ab0e1ab55f26c357061447b635905": "Keine Beziehung gefunden in {0} für ({1}.{2} ,{3}.{4})",
"e55937649d8d7a11706b8cec22d02eae": "{{HasOne}}-Beziehung {0} ist leer",
"2c4904377a87fdab502118719cc0d266": "{{Transaction}} wird nicht unterstützt",
"ecb7aa804bf54c682999d20d6436104c": "Die {{transaction}} ist nicht aktiv: {0}",
"89bf6d92731fe7bd2146ce8d0bec205c": "Ungültiges Argument, muss eine Zeichenfolge, ein {{regex}}-Literalwert oder ein {{RegExp}}-Objekt sein",
"8c5ab01638c1ac1d58168c6346a8481a": "Ungültige {{regex}}-Flags: {0}",
"a6c18a7f4390cd3d59a2a7a047ae2aab": "Führen Sie den Befehl \"{{npm install loopback-datasource-juggler}} {0}\" aus ",
"b138294f132edfe1eb2a8211150c7238": "Unerwartetes 'nicht definiert' in Abfrage",
"8a39126103a157f501affa070367a1b0": "Die Instanz {0} ist nicht gültig. Details: {1}."
}

View File

@ -1,96 +1,79 @@
{
"0483a77cf77741504204e5c066597487": "{{polymorphic}} {0} relation: {1} does not expect param `polymorphic.as` when defing custom `foreignKey`/`discriminator` ",
"09483e03b91c8bd58732a74b3ef1ec13": "Invalid date: {0}",
"0a5aa17f7866a85e3aee37ef5369403c": "LinkManyToMany received target that doesn't contain required \"{0}\"",
"0b16d3ffc42f91b4b9a4b3b50c41c838": "The order {0} is not valid",
"0bd753a8944ad0af85a939bb25273887": "Cannot expire unknown key {0}",
"0c0b867aca0973ba26e887d3337cc4ec": "{{Polymorphic}} model not found: `{0}` not set",
"0c4eb8b6c2ff6e51d7e195eee346ced9": "Table '{0}' does not exist.",
"0ff31abb394afb555df162e74ff1a0a0": "{{id}} cannot be updated from {0} to {1} when {{forceId}} is set to true",
"1ae7d3e0be381efb32bfd1ba652f5172": "WARNING: {{polymorphic}} {0} relation: {1} uses keyword `polymorphic.as` which will be DEPRECATED in LoopBack.next, refer to this doc for replacement solutions (https://loopback.io/doc/en/lb3/Polymorphic-relations.html#deprecated-polymorphic-as)",
"1daef4e937fe52136597ba8fd2060f55": "Nesting transactions is not supported",
"21095484501dbff31af6556fa6039182": "The {{offset/skip}} parameter {0} is not valid",
"280f4550f90e133118955ec6f6f72830": "Discriminator type {0} specified but no model exists with such name",
"28697ec15968a7969211f6d035ba9260": "{{polymorphic}} {0} relation: {1} does not expect param `model`",
"2c4904377a87fdab502118719cc0d266": "{{Transaction}} is not supported",
"2c5c8519721f749aab13c2f04f41d611": "The {0} property has invalid clause {1}: Expected precisely 2 values, received {2}",
"2f4af31c144bbfab1bbf479866acd820": "\nWARNING: {{LoopBack}} connector \"{0}\" is not installed as any of the following modules:\n\n {1}\n\nTo fix, run:\n\n {{npm install {2} --save}}\n",
"3864f9be10f27723074566d2b3893514": "Warning: Model {0}, {{strict mode: `throw`}} has been removed, please use {{`strict: true`}} instead, which returns{{`Validation Error`}} for unknown properties,",
"38dbf42c29a4645238cc3d632e88ebc9": "{{Relation.modelTo}} is not defined for relation {0} and is no {{polymorphic}}",
"3cde8cc9bca22c67278b202ab0720106": "No instance with id {0} found for {1}",
"416dfbb7b823f51c9f3800be81060b41": "No instance with {{id}} {0} found for {1}",
"49b5afd8c6a19ad9c8abeffb2f8114eb": "BelongsTo method \"getAsync()\" is deprecated, use \"get()\" instead.",
"bec226891a505828bfc76c5cfd73b336": "Cannot get TTL for unknown key {0}",
"4c78325cedbb826db3a05bf5df0e8546": "You must provide an {{id}} when replacing!",
"a0cf0e09c26df14283223e84e6a10f00": "Could not update attributes. {{Object}} with {{id}} {0} does not exist!",
"e54d944c2a2c85a23caa86027ae307cf": "Cannot migrate models not attached to this datasource: {0}",
"e6161ae8459c79d810e2aa9d21282a39": "You must provide an {{id}} when updating attributes!",
"fca4d12faff1035d9d0438d73432571b": "Duplicate entry for {0}.{1}",
"09483e03b91c8bd58732a74b3ef1ec13": "Invalid date: {0}",
"0b16d3ffc42f91b4b9a4b3b50c41c838": "The order {0} is not valid",
"0ff31abb394afb555df162e74ff1a0a0": "{{id}} cannot be updated from {0} to {1} when {{forceId}} is set to true",
"21095484501dbff31af6556fa6039182": "The {{offset/skip}} parameter {0} is not valid",
"2c5c8519721f749aab13c2f04f41d611": "The {0} property has invalid clause {1}: Expected precisely 2 values, received {2}",
"416dfbb7b823f51c9f3800be81060b41": "No instance with {{id}} {0} found for {1}",
"4e31b1edd10dadb724d83387de0b5062": "The {{limit}} parameter {0} is not valid",
"514985b2327f061ffb1c932f6b909979": "Model {0} is not defined.",
"525c856e65daab43be247e7b5410febd": "{{polymorphic}} {0} relation: {1} does not expect param `polymorphic.selector` when defing custom `foreignKey`/`discriminator` ",
"5c18ee111dd87540cdb19a2a93b33be9": "Transaction is rolled back due to timeout",
"5ec7e6664256f7ea78f4f06dafc7d974": "Transaction is not ready, wait for the returned promise to resolve",
"5ec8efeb715a2c34b440f2d76e2cf87d": " {0}",
"6111399276924ffa3bc9a410cdfcb2e5": "No {{id}} name {0}",
"614e3355647e4127c96256102dc63376": "The {0} property has invalid clause {1}: Expected a string or RegExp",
"62a2d80c405b7fec5f547c448ab1b6ff": "The {{order}} {0} has invalid direction",
"6502a117987610380b9068ef98b1b0ee": "No record found in {0} for ({1}.{2} ,{3}.{4})",
"67c2bf43b5281ab929617423ea8a6f3e": "The connector {0} does not support {{replaceById}} operation. This is not a bug in LoopBack. Please contact the authors of the connector, preferably via GitHub issues.",
"6c3234937d69763fc7f6bcafccc59bbc": "{{Model::deleteById}} requires the {{id}} argument",
"6eb6fd4fbd73394000bc25f5776fd20c": "{{Model::exists}} requires the {{id}} argument",
"6fcc2ff0db7a4f490f5e0ce9e24691f3": "{{HasOne}} relation cannot create more than one instance of {0}",
"728232e473bf80272c042df2b7e002f4": "{{polymorphic}} {0} relation: {1} requires param `polymorphic.discriminator` when param `polymorphic.foreignKey` is provided",
"791ab3031a73ede03f7d6299a85e8289": "Timeout in connecting after {0} ms",
"7b277018e43d41bc445731092b91547d": "Not connected",
"7bbbdece4eea90e42aa5c0bce295e503": "{{Model::findById}} requires the {{id}} argument",
"7e9530c0399289be0ee601a604be71ff": "{{BelongsTo}} relation {0} is empty",
"7faa840eb6ce11250a141deb42a6c489": "Unknown relation {{scope}}: {0}",
"8091838319a5cc7d6a34af2f2a616ce9": "Property name should not be \"{{constructor}}\" in Model: {0}",
"881e4b0cb86ed59549248ee540a9fd10": "Property name \"{{constructor}}\" is not allowed in {0} data",
"89afd3a9249f5a8d3edda07d84ca049d": "{{Polymorphic}} model not found: `{0}`",
"89bf6d92731fe7bd2146ce8d0bec205c": "Invalid argument, must be a string, {{regex}} literal, or {{RegExp}} object",
"8a39126103a157f501affa070367a1b0": "The {0} instance is not valid. Details: {1}.",
"8c5ab01638c1ac1d58168c6346a8481a": "Invalid {{regex}} flags: {0}",
"938401ea4ce48159efa9be1d4a5e8bab": "Items must be an array: {0}",
"9e1f143ee02946324d34da92f71bf74e": "{0} relation: {1} requires param `model`",
"a004f310d315e592843776fab964eaeb": "{{Polymorphic}} relations need a through model",
"a0cf0e09c26df14283223e84e6a10f00": "Could not update attributes. {{Object}} with {{id}} {0} does not exist!",
"a2487abefef4259c2131d96cdb8543b1": "Connection fails: {0}\nIt will be retried for the next request.",
"a25e41a39c60c4702e55d0c3936576a1": "Key mismatch: {0}.{1}: {2}, {3}.{4}: {5}",
"a327355560d495454fba2c1aad6bdf09": "Unknown scope method: {0}",
"a6c18a7f4390cd3d59a2a7a047ae2aab": "Run \"{{npm install loopback-datasource-juggler}} {0}\" command ",
"a829dee089c912e68c18920ba015400c": "WARNING: {{id}} property cannot be changed from {0} to {1} for model:{2} in {{'loaded'}} operation hook",
"a984a076c59e451948b2bcf7a393d860": "WARNING: {{id}} property cannot be changed from {0} to {1} for model:{2} in {{'before save'}} operation hook",
"ac04cf275b71c1eb89a41cf6bbad7a64": "HasOne method \"getAsync()\" is deprecated, use \"get()\" instead.",
"b138294f132edfe1eb2a8211150c7238": "Unexpected `undefined` in query",
"b15b20280211ad258d92947f05b6e4a5": "The connector has not been initialized.",
"b278876ec93ef9760f00e83f38ba313d": "Scope method \"getAsync()\" is deprecated, use \"find()\" instead.",
"ba0fd8106eb54de4d003a844206431fd": "Model hook \"{0}\" is deprecated, use Operation hooks instead. {{http://docs.strongloop.com/display/LB/Operation+hooks}}",
"baf2c8b0c5a574b8a894e9b6304fece1": "The where clause {0} is not an {{object}}",
"bdb11cc1c780c9ccac33c316cfdc9d82": "Type not defined for property {0}.{1}",
"bdfb951c8ff7ce0cbc08c06f548fd927": "Value is an empty {{object}}",
"bec226891a505828bfc76c5cfd73b336": "Cannot get TTL for unknown key {0}",
"cd930369e86cdd222f7bd117c6f9fa94": "Unknown default value provider {0}",
"cfee4d8149316d9a647c0885cf3cafaf": "Property names containing dot(s) are not supported. Model: {0}, dynamic property: {1}",
"d40328eabd8756d795bcdd49d782d4e9": "DataSource does not support transactions",
"da02dd6c53d4148320eeb31718a7aebe": "Invalid type for property {0}",
"da751a8a748adbde5b55fa83b707b4e2": "Property names containing dot(s) are not supported. Model: {0}, property: {1}",
"db03083e9a768388fdbee865249ac67a": "Ignoring validation errors in {{updateOrCreate()}}:",
"dd63416d9b7d9fa4181e89efd619dfd8": "Value is not an {{array}} or {{object}} with sequential numeric indices",
"ddf0aa14803f1c84f4a97f3803f7471c": "Class name required",
"e08ab0e1ab55f26c357061447b635905": "No relation found in {0} for ({1}.{2},{3}.{4})",
"e0e9504e137a3c3339144b51ed76fef2": "Connector is not defined correctly: it should create `{{connector}}` member of dataSource",
"e2f282cbe3efba001d6d3a09f7f6ca8c": "{{polymorphic}} {0} relation: {1} requires param `polymorphic.foreignKey` when param `polymorphic.discriminator` is provided",
"e39e0f5d52bfbf511e645d19ecadd2fa": "The {0} property has invalid clause {1}: {2}",
"e4434de4bb8f5a3cd1d416e4d80d7e0b": "Unknown \"{0}\" {{id}} \"{1}\".",
"e54d944c2a2c85a23caa86027ae307cf": "Cannot migrate models not attached to this datasource: {0}",
"e54f118a75e15e132f16b985274eb46d": "The query filter {0} is not an {{object}}",
"e55937649d8d7a11706b8cec22d02eae": "{{HasOne}} relation {0} is empty",
"e6161ae8459c79d810e2aa9d21282a39": "You must provide an {{id}} when updating attributes!",
"eb56c2b0c30cf006e2df00a549ec9c2c": "Relation \"{0}\" is not defined for {1} model",
"ec42dca074f1818c447f7ad16e2d01af": "{0} is not provided by the attached connector",
"ecb7aa804bf54c682999d20d6436104c": "The {{transaction}} is not active: {0}",
"f30809cb932b72a66416a709c8531530": "The connector does not support {{method}} within a transaction",
"f41bd91dc0f000a79c0bf842f1b7fdf9": "could not create List from JSON string: {0}",
"f6e8c96c93b9c7687d6c172b3695e898": "{{id}} property ({0}) cannot be updated from {1} to {2}",
"fa9ae17e8e008d0eb0f0421a2972308c": "{{polymorphic}} {0} relation: {1} requires param `model`",
"fca4d12faff1035d9d0438d73432571b": "Duplicate entry for {0}.{1}",
"fd3cc89dc67e2d604eaae21bdf41d403": "Could not find relation {0} for model {1}",
"fec8ebda24db46a9d040bf863765cc44": "The {0} operator has invalid clauses {1}: {2}"
"fec8ebda24db46a9d040bf863765cc44": "The {0} operator has invalid clauses {1}: {2}",
"0be2d39d225b1d8b2a0f92ad5c65c9ac": "No model specified for {{polymorphic}} {0}: {1}",
"0c4eb8b6c2ff6e51d7e195eee346ced9": "Table '{0}' does not exist.",
"2f4af31c144bbfab1bbf479866acd820": "\nWARNING: {{LoopBack}} connector \"{0}\" is not installed as any of the following modules:\n\n {1}\n\nTo fix, run:\n\n {{npm install {2} --save}}\n",
"6111399276924ffa3bc9a410cdfcb2e5": "No {{id}} name {0}",
"791ab3031a73ede03f7d6299a85e8289": "Timeout in connecting after {0} ms",
"7b277018e43d41bc445731092b91547d": "Not connected",
"a2487abefef4259c2131d96cdb8543b1": "Connection fails: {0}\nIt will be retried for the next request.",
"b15b20280211ad258d92947f05b6e4a5": "The connector has not been initialized.",
"ddf0aa14803f1c84f4a97f3803f7471c": "Class name required",
"e0e9504e137a3c3339144b51ed76fef2": "Connector is not defined correctly: it should create `{{connector}}` member of dataSource",
"ec42dca074f1818c447f7ad16e2d01af": "{0} is not provided by the attached connector",
"ba0fd8106eb54de4d003a844206431fd": "Model hook \"{0}\" is deprecated, use Operation hooks instead. {{http://docs.strongloop.com/display/LB/Operation+hooks}}",
"280f4550f90e133118955ec6f6f72830": "Discriminator type {0} specified but no model exists with such name",
"38dbf42c29a4645238cc3d632e88ebc9": "{{Relation.modelTo}} is not defined for relation {0} and is no {{polymorphic}}",
"eb56c2b0c30cf006e2df00a549ec9c2c": "Relation \"{0}\" is not defined for {1} model",
"938401ea4ce48159efa9be1d4a5e8bab": "Items must be an array: {0}",
"f41bd91dc0f000a79c0bf842f1b7fdf9": "could not create List from JSON string: {0}",
"514985b2327f061ffb1c932f6b909979": "Model {0} is not defined.",
"8091838319a5cc7d6a34af2f2a616ce9": "Property name should not be \"{{constructor}}\" in Model: {0}",
"da02dd6c53d4148320eeb31718a7aebe": "Invalid type for property {0}",
"da751a8a748adbde5b55fa83b707b4e2": "Property names containing dot(s) are not supported. Model: {0}, property: {1}",
"3864f9be10f27723074566d2b3893514": "Warning: Model {0}, {{strict mode: `throw`}} has been removed, please use {{`strict: true`}} instead, which returns{{`Validation Error`}} for unknown properties,",
"881e4b0cb86ed59549248ee540a9fd10": "Property name \"{{constructor}}\" is not allowed in {0} data",
"bdb11cc1c780c9ccac33c316cfdc9d82": "Type not defined for property {0}.{1}",
"cd930369e86cdd222f7bd117c6f9fa94": "Unknown default value provider {0}",
"cfee4d8149316d9a647c0885cf3cafaf": "Property names containing dot(s) are not supported. Model: {0}, dynamic property: {1}",
"0c0b867aca0973ba26e887d3337cc4ec": "{{Polymorphic}} model not found: `{0}` not set",
"2f062cbecdf24245731bddc77714c814": "Could not find \"{0}\" relation for {1}",
"3cde8cc9bca22c67278b202ab0720106": "No instance with id {0} found for {1}",
"6502a117987610380b9068ef98b1b0ee": "No record found in {0} for ({1}.{2} ,{3}.{4})",
"6fcc2ff0db7a4f490f5e0ce9e24691f3": "{{HasOne}} relation cannot create more than one instance of {0}",
"7e9530c0399289be0ee601a604be71ff": "{{BelongsTo}} relation {0} is empty",
"7faa840eb6ce11250a141deb42a6c489": "Unknown relation {{scope}}: {0}",
"89afd3a9249f5a8d3edda07d84ca049d": "{{Polymorphic}} model not found: `{0}`",
"a004f310d315e592843776fab964eaeb": "{{Polymorphic}} relations need a through model",
"a25e41a39c60c4702e55d0c3936576a1": "Key mismatch: {0}.{1}: {2}, {3}.{4}: {5}",
"a327355560d495454fba2c1aad6bdf09": "Unknown scope method: {0}",
"e08ab0e1ab55f26c357061447b635905": "No relation found in {0} for ({1}.{2},{3}.{4})",
"e55937649d8d7a11706b8cec22d02eae": "{{HasOne}} relation {0} is empty",
"2c4904377a87fdab502118719cc0d266": "{{Transaction}} is not supported",
"ecb7aa804bf54c682999d20d6436104c": "The {{transaction}} is not active: {0}",
"89bf6d92731fe7bd2146ce8d0bec205c": "Invalid argument, must be a string, {{regex}} literal, or {{RegExp}} object",
"8c5ab01638c1ac1d58168c6346a8481a": "Invalid {{regex}} flags: {0}",
"a6c18a7f4390cd3d59a2a7a047ae2aab": "Run \"{{npm install loopback-datasource-juggler}} {0}\" command ",
"b138294f132edfe1eb2a8211150c7238": "Unexpected `undefined` in query",
"8a39126103a157f501affa070367a1b0": "The {0} instance is not valid. Details: {1}."
}

View File

@ -1,97 +1,80 @@
{
"0483a77cf77741504204e5c066597487": "Relación {0} {{polymorphic}}: {1} no espera el parámetro `polymorphic.as` al definir `foreignKey`/`discriminator` personalizado ",
"09483e03b91c8bd58732a74b3ef1ec13": "Fecha no válida: {0}",
"0a5aa17f7866a85e3aee37ef5369403c": "LinkManyToMany ha recibido un destino que no contiene el \"{0}\" obligatorio",
"0b16d3ffc42f91b4b9a4b3b50c41c838": "El orden {0} no es válido",
"0bd753a8944ad0af85a939bb25273887": "La clave desconocida {0} no puede caducar",
"0c0b867aca0973ba26e887d3337cc4ec": "Modelo {{Polymorphic}} no encontrado: `{0}` no establecido",
"0c4eb8b6c2ff6e51d7e195eee346ced9": "La tabla '{0}' no existe.",
"0ff31abb394afb555df162e74ff1a0a0": "{{id}} no puede actualizarse de {0} a {1} cuando {{forceId}} está establecido en true",
"1ae7d3e0be381efb32bfd1ba652f5172": "AVISO: Relación {0} {{polymorphic}}: {1} utiliza la c¡palabra clave `polymorphic.as` que estará EN DESUSO en LoopBack.next, reconsulte este documento para conocer las posibles sustituciones (https://loopback.io/doc/en/lb3/Polymorphic-relations.html#deprecated-polymorphic-as)",
"1daef4e937fe52136597ba8fd2060f55": "Las transacciones anidadas no están soportadas",
"21095484501dbff31af6556fa6039182": "El parámetro de {{offset/skip}} {0} no es válido",
"280f4550f90e133118955ec6f6f72830": "Se ha especificado el tipo de discriminador {0}, pero no existe ningún modelo con ese nombre",
"28697ec15968a7969211f6d035ba9260": "Relación {0} {{polymorphic}}: {1} no espera el parámetro `model`",
"2c4904377a87fdab502118719cc0d266": "{{Transaction}} no está soportada.",
"2c5c8519721f749aab13c2f04f41d611": "La propiedad {0} tiene una cláusula {1} no válida: se esperaban exactamente 2 valores, se han recibido {2}",
"2f4af31c144bbfab1bbf479866acd820": "\nAVISO: el conector {{LoopBack}} \"{0}\" no está instalado como ninguno de los módulos siguientes:\n\n {1}\n\nPara solucionarlo, ejecute:\n\n {{npm install {2} --save}}\n",
"3864f9be10f27723074566d2b3893514": "Aviso: el modelo {0}, {{strict mode: `throw`}} se ha eliminado; utilice {{`strict: true`}} en su lugar, que devuelve {{`Validation Error`}} para propiedades desconocidas.",
"38dbf42c29a4645238cc3d632e88ebc9": "{{Relation.modelTo}} no se ha definido para la relación {0} y no es {{polymorphic}}",
"3cde8cc9bca22c67278b202ab0720106": "No se ha encontrado ninguna instancia con el ID {0} para {1}",
"416dfbb7b823f51c9f3800be81060b41": "No se ha encontrado ninguna instancia con el {{id}} {0} para {1}",
"49b5afd8c6a19ad9c8abeffb2f8114eb": "El método BelongsTo \"getAsync()\" está en desuso, utilice \"get()\" en su lugar.",
"bec226891a505828bfc76c5cfd73b336": "No se puede obtener TTL para la clave desconocida {0}",
"4c78325cedbb826db3a05bf5df0e8546": "Debe proporcionar un {{id}} al sustituir.",
"a0cf0e09c26df14283223e84e6a10f00": "No se han podido actualizar atributos. {{Object}} con {{id}} {0} no existe.",
"e54d944c2a2c85a23caa86027ae307cf": "No se pueden migrar modelos no conectados a este origen de datos: {0}",
"e6161ae8459c79d810e2aa9d21282a39": "Debe proporcionar un {{id}} al actualizar atributos.",
"fca4d12faff1035d9d0438d73432571b": "Entrada duplicada para {0}.{1}",
"09483e03b91c8bd58732a74b3ef1ec13": "Fecha no válida: {0}",
"0b16d3ffc42f91b4b9a4b3b50c41c838": "El orden {0} no es válido",
"0ff31abb394afb555df162e74ff1a0a0": "{{id}} no puede actualizarse de {0} a {1} cuando {{forceId}} está establecido en true",
"21095484501dbff31af6556fa6039182": "El parámetro de {{offset/skip}} {0} no es válido",
"2c5c8519721f749aab13c2f04f41d611": "La propiedad {0} tiene una cláusula {1} no válida: se esperaban exactamente 2 valores, se han recibido {2}",
"416dfbb7b823f51c9f3800be81060b41": "No se ha encontrado ninguna instancia con el {{id}} {0} para {1}",
"4e31b1edd10dadb724d83387de0b5062": "El parámetro de {{limit}} {0} no es válido",
"514985b2327f061ffb1c932f6b909979": "El modelo {0} no se ha definido.",
"525c856e65daab43be247e7b5410febd": "Relación {0} {{polymorphic}}: {1} no espera el parámetro `polymorphic.selector` al definir `foreignKey`/`discriminator` personalizado ",
"5c18ee111dd87540cdb19a2a93b33be9": "La transacción se ha retrotraído debido a tiempo de espera excedido",
"5ec7e6664256f7ea78f4f06dafc7d974": "La transacción no está lista, espere la promesa devuelta para resolver",
"5ec8efeb715a2c34b440f2d76e2cf87d": " {0}",
"6111399276924ffa3bc9a410cdfcb2e5": "Ningún {{id}} de nombre {0}",
"614e3355647e4127c96256102dc63376": "La propiedad {0} tiene una cláusula {1} no válida: se esperaba una serie o expresión regular",
"62a2d80c405b7fec5f547c448ab1b6ff": "El {{order}} {0} tiene una dirección no válida",
"6502a117987610380b9068ef98b1b0ee": "No se ha encontrado ningún registro en {0} para ({1}.{2} ,{3}.{4})",
"67c2bf43b5281ab929617423ea8a6f3e": "El conector {0} no admite la operación {{replaceById}}. Esto no es un error en LoopBack. Póngase en contacto con los autores del conector, preferiblemente a través de cuestiones GitHub.",
"6c3234937d69763fc7f6bcafccc59bbc": "{{Model::deleteById}} requiere el argumento {{id}}",
"6eb6fd4fbd73394000bc25f5776fd20c": "{{Model::exists}} requiere el argumento {{id}}",
"6fcc2ff0db7a4f490f5e0ce9e24691f3": "La relación {{HasOne}} no puede crear más de una instancia de {0}",
"728232e473bf80272c042df2b7e002f4": "Relación {0} {{polymorphic}}: {1} requiere el parámetro `polymorphic.discriminator` cuando se proporciona el parámetro `polymorphic.foreignKey`",
"791ab3031a73ede03f7d6299a85e8289": "Tiempo de espera agotado al conectarse después de {0} ms",
"7b277018e43d41bc445731092b91547d": "No conectado",
"7bbbdece4eea90e42aa5c0bce295e503": "{{Model::findById}} requiere el argumento {{id}}",
"7e9530c0399289be0ee601a604be71ff": "La relación {{BelongsTo}} {0} está vacía",
"7faa840eb6ce11250a141deb42a6c489": "Relación desconocida {{scope}}: {0}",
"8091838319a5cc7d6a34af2f2a616ce9": "El nombre de propiedad no debe ser \"{{constructor}}\" en el modelo: {0}",
"881e4b0cb86ed59549248ee540a9fd10": "El nombre de propiedad \"{{constructor}}\" no está permitido en datos de {0}",
"89afd3a9249f5a8d3edda07d84ca049d": "Modelo {{Polymorphic}} no encontrado: `{0}`",
"89bf6d92731fe7bd2146ce8d0bec205c": "Argumento no válido, debe ser una serie, literal de {{regex}} u objeto {{RegExp}}",
"8a39126103a157f501affa070367a1b0": "La instancia {0} no es válida. Detalles: {1}.",
"8c5ab01638c1ac1d58168c6346a8481a": "Distintivos de {{regex}} no válidos: {0}",
"938401ea4ce48159efa9be1d4a5e8bab": "Items debe ser una matriz: {0}",
"9e1f143ee02946324d34da92f71bf74e": "Relación {0}: {1} requiere el parámetro `model`",
"a004f310d315e592843776fab964eaeb": "Las relaciones {{Polymorphic}} necesitan un modelo definido",
"a0cf0e09c26df14283223e84e6a10f00": "No se han podido actualizar atributos. {{Object}} con {{id}} {0} no existe.",
"a2487abefef4259c2131d96cdb8543b1": "La conexión falla: {0}\nSe reintentará en la siguiente solicitud.",
"a25e41a39c60c4702e55d0c3936576a1": "Discrepancia de claves: {0}.{1}: {2}, {3}.{4}: {5}",
"a327355560d495454fba2c1aad6bdf09": "Método de ámbito desconocido: {0}",
"a6c18a7f4390cd3d59a2a7a047ae2aab": "Ejecute el mandato \"{{npm install loopback-datasource-juggler}} {0}\" ",
"a829dee089c912e68c18920ba015400c": "AVISO: la propiedad {{id}} no puede cambiarse de {0} a {1} para el modelo:{2} en el gancho de operación {{'loaded'}}",
"a984a076c59e451948b2bcf7a393d860": "AVISO: la propiedad {{id}} no puede cambiarse de {0} a {1} para el modelo:{2} en el gancho de operación {{'before save'}}",
"ac04cf275b71c1eb89a41cf6bbad7a64": "El método HasOne \"getAsync()\" está en desuso, utilice \"get()\" en su lugar.",
"b138294f132edfe1eb2a8211150c7238": "`undefined` inesperado en la consulta",
"b15b20280211ad258d92947f05b6e4a5": "El conector no se ha inicializado.",
"b278876ec93ef9760f00e83f38ba313d": "El método Scope \"getAsync()\" está en desuso, utilice \"find()\" en su lugar.",
"ba0fd8106eb54de4d003a844206431fd": "El gancho de modelo \"{0}\" está en desuso, utilice ganchos de operación en su lugar. {{http://docs.strongloop.com/display/LB/Operation+hooks}}",
"baf2c8b0c5a574b8a894e9b6304fece1": "La cláusula where {0} no es un {{object}}",
"bdb11cc1c780c9ccac33c316cfdc9d82": "Tipo no definido para la propiedad {0}.{1}",
"bdfb951c8ff7ce0cbc08c06f548fd927": "El valor es un {{object}} vacío",
"bec226891a505828bfc76c5cfd73b336": "No se puede obtener TTL para la clave desconocida {0}",
"cd930369e86cdd222f7bd117c6f9fa94": "Proveedor de valor predeterminado desconocido {0}",
"cfee4d8149316d9a647c0885cf3cafaf": "Los nombres de propiedad que contienen puntos no están soportados. Modelo: {0}, propiedad dinámica: {1}",
"d40328eabd8756d795bcdd49d782d4e9": "DataSource no da soporte a las transacciones",
"da02dd6c53d4148320eeb31718a7aebe": "Tipo no válido para la propiedad {0}",
"da751a8a748adbde5b55fa83b707b4e2": "Los nombres de propiedad que contienen puntos no están soportados. Modelo: {0}, propiedad: {1}",
"db03083e9a768388fdbee865249ac67a": "Se ignoran los errores de validación en {{updateOrCreate()}}:",
"dd63416d9b7d9fa4181e89efd619dfd8": "El valor no es una {{array}} u {{object}} con índices numéricos secuenciales",
"ddf0aa14803f1c84f4a97f3803f7471c": "Nombre de clase obligatorio",
"e08ab0e1ab55f26c357061447b635905": "No se ha encontrado ninguna relación en {0} para ({1}.{2},{3}.{4})",
"e0e9504e137a3c3339144b51ed76fef2": "El conector no está definido correctamente: debe crear el miembro `{{connector}}` de dataSource",
"e2f282cbe3efba001d6d3a09f7f6ca8c": "Relación {0} {{polymorphic}}: {1} requiere el parámetro `polymorphic.foreignKey` cuando se proporciona el parámetro `polymorphic.discriminator`",
"e39e0f5d52bfbf511e645d19ecadd2fa": "La propiedad {0} tiene una cláusula {1} no válida: {2}",
"e4434de4bb8f5a3cd1d416e4d80d7e0b": "{{id}} de \"{0}\" desconocido \"{1}\".",
"e54d944c2a2c85a23caa86027ae307cf": "No se pueden migrar modelos no conectados a este origen de datos: {0}",
"e54f118a75e15e132f16b985274eb46d": "El filtro de consultas {0} no es un {{object}}",
"e55937649d8d7a11706b8cec22d02eae": "la relación {{HasOne}} {0} está vacía",
"e6161ae8459c79d810e2aa9d21282a39": "Debe proporcionar un {{id}} al actualizar atributos.",
"eb56c2b0c30cf006e2df00a549ec9c2c": "La relación \"{0}\" no está definida para el modelo {1}",
"ec42dca074f1818c447f7ad16e2d01af": "El conector asociado no ha proporcionado {0}",
"ecb7aa804bf54c682999d20d6436104c": "La {{transaction}} no está activa: {0}",
"f30809cb932b72a66416a709c8531530": "El conector no admite {{method}} dentro de una transacción",
"f41bd91dc0f000a79c0bf842f1b7fdf9": "no se ha podido crear la lista a partir de la serie JSON: {0}",
"f6e8c96c93b9c7687d6c172b3695e898": "La propiedad de {{id}} ({0}) no puede actualizarse de {1} a {2}",
"fa9ae17e8e008d0eb0f0421a2972308c": "Relación {0}:{{polymorphic}}: {1} requiere el parámetro `model`",
"fca4d12faff1035d9d0438d73432571b": "Entrada duplicada para {0}.{1}",
"fd3cc89dc67e2d604eaae21bdf41d403": "No se ha podido encontrar la relación {0} para el modelo {1}",
"fec8ebda24db46a9d040bf863765cc44": "El operador {0} tiene cláusulas no válidas {1}: {2}"
"fec8ebda24db46a9d040bf863765cc44": "El operador {0} tiene cláusulas no válidas {1}: {2}",
"0be2d39d225b1d8b2a0f92ad5c65c9ac": "No se ha especificado ningún modelo para {{polymorphic}} {0}: {1}",
"0c4eb8b6c2ff6e51d7e195eee346ced9": "La tabla '{0}' no existe.",
"2f4af31c144bbfab1bbf479866acd820": "\nAVISO: el conector {{LoopBack}} \"{0}\" no está instalado como ninguno de los módulos siguientes:\n\n {1}\n\nPara solucionarlo, ejecute:\n\n {{npm install {2} --save}}\n",
"6111399276924ffa3bc9a410cdfcb2e5": "No hay ningún nombre de {{id}} {0}",
"791ab3031a73ede03f7d6299a85e8289": "Tiempo de espera agotado al conectarse después de {0} ms",
"7b277018e43d41bc445731092b91547d": "No conectado",
"a2487abefef4259c2131d96cdb8543b1": "La conexión falla: {0}\nSe reintentará en la siguiente solicitud.",
"b15b20280211ad258d92947f05b6e4a5": "El conector no se ha inicializado.",
"ddf0aa14803f1c84f4a97f3803f7471c": "Nombre de clase necesario",
"e0e9504e137a3c3339144b51ed76fef2": "El conector no está definido correctamente: debe crear el miembro `{{connector}}` de dataSource",
"ec42dca074f1818c447f7ad16e2d01af": "El conector asociado no ha proporcionado {0}",
"ba0fd8106eb54de4d003a844206431fd": "El gancho de modelo \"{0}\" está en desuso, utilice ganchos de operación en su lugar. {{http://docs.strongloop.com/display/LB/Operation+hooks}}",
"280f4550f90e133118955ec6f6f72830": "Se ha especificado el tipo de discriminador {0}, pero no existe ningún modelo con ese nombre",
"38dbf42c29a4645238cc3d632e88ebc9": "{{Relation.modelTo}} no se ha definido para la relación {0} y no es {{polymorphic}}",
"eb56c2b0c30cf006e2df00a549ec9c2c": "La relación \"{0}\" no está definida para el modelo {1}",
"938401ea4ce48159efa9be1d4a5e8bab": "Items debe ser una matriz: {0}",
"f41bd91dc0f000a79c0bf842f1b7fdf9": "no se ha podido crear la lista a partir de la serie JSON: {0}",
"514985b2327f061ffb1c932f6b909979": "El modelo {0} no se ha definido.",
"8091838319a5cc7d6a34af2f2a616ce9": "El nombre de propiedad no debe ser \"{{constructor}}\" en el modelo: {0}",
"da02dd6c53d4148320eeb31718a7aebe": "Tipo no válido para la propiedad {0}",
"da751a8a748adbde5b55fa83b707b4e2": "Los nombres de propiedad que contienen puntos no están soportados. Modelo: {0}, propiedad: {1}",
"3864f9be10f27723074566d2b3893514": "Aviso: el modelo {0}, {{strict mode: `throw`}} se ha eliminado; utilice {{`strict: true`}} en su lugar, que devuelve {{`Validation Error`}} para propiedades desconocidas.",
"881e4b0cb86ed59549248ee540a9fd10": "El nombre de propiedad \"{{constructor}}\" no está permitido en datos de {0}",
"bdb11cc1c780c9ccac33c316cfdc9d82": "Tipo no definido para la propiedad {0}.{1}",
"cd930369e86cdd222f7bd117c6f9fa94": "Proveedor de valor predeterminado desconocido {0}",
"cfee4d8149316d9a647c0885cf3cafaf": "Los nombres de propiedad que contienen puntos no están soportados. Modelo: {0}, propiedad dinámica: {1}",
"0c0b867aca0973ba26e887d3337cc4ec": "Modelo {{Polymorphic}} no encontrado: `{0}` no establecido",
"2f062cbecdf24245731bddc77714c814": "No se ha encontrado la relación \"{0}\" para {1}",
"3cde8cc9bca22c67278b202ab0720106": "No se ha encontrado ninguna instancia con el ID {0} para {1}",
"6502a117987610380b9068ef98b1b0ee": "No se ha encontrado ningún registro en {0} para ({1}.{2} ,{3}.{4})",
"6fcc2ff0db7a4f490f5e0ce9e24691f3": "La relación {{HasOne}} no puede crear más de una instancia de {0}",
"7e9530c0399289be0ee601a604be71ff": "La relación {{BelongsTo}} {0} está vacía",
"7faa840eb6ce11250a141deb42a6c489": "Relación desconocida {{scope}}: {0}",
"89afd3a9249f5a8d3edda07d84ca049d": "Modelo {{Polymorphic}} no encontrado: `{0}`",
"a004f310d315e592843776fab964eaeb": "Las relaciones {{Polymorphic}} necesitan un modelo definido",
"a25e41a39c60c4702e55d0c3936576a1": "Discrepancia de claves: {0}.{1}: {2}, {3}.{4}: {5}",
"a327355560d495454fba2c1aad6bdf09": "Método de ámbito desconocido: {0}",
"e08ab0e1ab55f26c357061447b635905": "No se ha encontrado ninguna relación en {0} para ({1}.{2},{3}.{4})",
"e55937649d8d7a11706b8cec22d02eae": "la relación {{HasOne}} {0} está vacía",
"2c4904377a87fdab502118719cc0d266": "{{Transaction}} no está soportada.",
"ecb7aa804bf54c682999d20d6436104c": "La {{transaction}} no está activa: {0}",
"89bf6d92731fe7bd2146ce8d0bec205c": "Argumento no válido, debe ser una serie, literal de {{regex}} u objeto {{RegExp}}",
"8c5ab01638c1ac1d58168c6346a8481a": "Distintivos de {{regex}} no válidos: {0}",
"a6c18a7f4390cd3d59a2a7a047ae2aab": "Ejecute el mandato \"{{npm install loopback-datasource-juggler}} {0}\" ",
"b138294f132edfe1eb2a8211150c7238": "`undefined` inesperado en la consulta",
"8a39126103a157f501affa070367a1b0": "La instancia {0} no es válida. Detalles: {1}."
}

View File

@ -1,97 +1,80 @@
{
"0483a77cf77741504204e5c066597487": "Relation {{polymorphic}} {0} : {1} n'attend pas le paramètre `polymorphic.as` lors de la définition de `foreignKey`/`discriminator` personnalisé ",
"09483e03b91c8bd58732a74b3ef1ec13": "Date non valide : {0}",
"0a5aa17f7866a85e3aee37ef5369403c": "LinkManyToMany a reçu une cible qui ne contient pas \"{0}\" (requis)",
"0b16d3ffc42f91b4b9a4b3b50c41c838": "L'ordre {0} n'est pas valide",
"0bd753a8944ad0af85a939bb25273887": "Impossible de faire expirer la clé inconnue {0}",
"0c0b867aca0973ba26e887d3337cc4ec": "Modèle {{Polymorphic}} non trouvé : `{0}` non défini",
"0c4eb8b6c2ff6e51d7e195eee346ced9": "La table '{0}' n'existe pas.",
"0ff31abb394afb555df162e74ff1a0a0": "{{id}} ne peut pas être mis à jour depuis {0} vers {1} lorsque {{forceId}} n'a pas la valeur true",
"1ae7d3e0be381efb32bfd1ba652f5172": "AVERTISSEMENT : relation {{polymorphic}} {0} : {1} utilise le mot clé `polymorphic.as` qui sera OBSOLETE dans LoopBack.next. Reportez-vous à cette documentation pour découvrir les solutions de remplacement (https://loopback.io/doc/en/lb3/Polymorphic-relations.html#deprecated-polymorphic-as)",
"1daef4e937fe52136597ba8fd2060f55": "L'imbrication des transactions n'est pas prise en charge ",
"21095484501dbff31af6556fa6039182": "Le paramètre {{offset/skip}} {0} n'est pas valide",
"280f4550f90e133118955ec6f6f72830": "Le type de discriminateur {0} est indiqué mais il n'existe pas de modèle de ce nom",
"28697ec15968a7969211f6d035ba9260": "Relation {{polymorphic}} {0} : {1} n'attend pas le paramètre `model`",
"2c4904377a87fdab502118719cc0d266": "{{Transaction}} n'est pas pris en charge",
"2c5c8519721f749aab13c2f04f41d611": "La propriété {0} comporte une clause non valide {1} : 2 valeurs étaient attendues, {2} reçue",
"2f4af31c144bbfab1bbf479866acd820": "\nAVERTISSEMENT : Le connecteur {{LoopBack}} \"{0}\" n'est pas installé, tout comme les modules suivants :\n\n {1}\n\nPour corriger le problème, exécutez :\n\n {{npm install {2} --save}}\n",
"3864f9be10f27723074566d2b3893514": "Avertissement : le modèle {0}, {{strict mode: `throw`}} a été retiré, utilisez {{`strict: true`}} à la place, ce qui renvoie {{`Validation Error`}} pour les propriétés inconnues,",
"38dbf42c29a4645238cc3d632e88ebc9": "{{Relation.modelTo}} n'est pas défini pour la relation {0} et il n'est pas {{polymorphic}}",
"3cde8cc9bca22c67278b202ab0720106": "Aucune instance avec l'id {0} trouvée pour {1}",
"416dfbb7b823f51c9f3800be81060b41": "Aucune instance avec {{id}} {0} trouvée pour {1}",
"49b5afd8c6a19ad9c8abeffb2f8114eb": "La méthode BelongsTo \"getAsync()\" est obsolète ; utilisez \"get()\" à la place.",
"bec226891a505828bfc76c5cfd73b336": "Impossible d'obtenir TTL pour la clé inconnue {0}",
"4c78325cedbb826db3a05bf5df0e8546": "Vous devez fournir un {{id}} lors du remplacement !",
"a0cf0e09c26df14283223e84e6a10f00": "Impossible de mettre à jour les attributs. {{Object}} avec {{id}} {0} n'existe pas !",
"e54d944c2a2c85a23caa86027ae307cf": "Impossible de migrer les modèles non associés à cette source de données : {0}",
"e6161ae8459c79d810e2aa9d21282a39": "Vous devez fournir un {{id}} lors de la mise à jour des attributs !",
"fca4d12faff1035d9d0438d73432571b": "Entrée en double pour {0}.{1}",
"09483e03b91c8bd58732a74b3ef1ec13": "Date non valide : {0}",
"0b16d3ffc42f91b4b9a4b3b50c41c838": "L'ordre {0} n'est pas valide",
"0ff31abb394afb555df162e74ff1a0a0": "{{id}} ne peut pas être mis à jour depuis {0} vers {1} lorsque {{forceId}} n'a pas la valeur true",
"21095484501dbff31af6556fa6039182": "Le paramètre {{offset/skip}} {0} n'est pas valide",
"2c5c8519721f749aab13c2f04f41d611": "La propriété {0} comporte une clause non valide {1} : 2 valeurs étaient attendues, {2} reçue",
"416dfbb7b823f51c9f3800be81060b41": "Aucune instance avec {{id}} {0} trouvée pour {1}",
"4e31b1edd10dadb724d83387de0b5062": "Le paramètre {{limit}} {0} n'est pas valide",
"514985b2327f061ffb1c932f6b909979": "Le modèle {0} n'est pas défini.",
"525c856e65daab43be247e7b5410febd": "Relation {{polymorphic}} {0} : {1} n'attend pas le paramètre `polymorphic.selector` lors de la définition de `foreignKey`/`discriminator` personnalisé ",
"5c18ee111dd87540cdb19a2a93b33be9": "La transaction est annulée car le délai d'attente a été dépassé ",
"5ec7e6664256f7ea78f4f06dafc7d974": "La transaction n'est pas prête ; attendez que la promesse renvoyée soit résolue ",
"5ec8efeb715a2c34b440f2d76e2cf87d": " {0}",
"6111399276924ffa3bc9a410cdfcb2e5": "Aucun nom {{id}} {0}",
"614e3355647e4127c96256102dc63376": "La propriété {0} comporte une clause non valide {1} : chaîne ou RegExp attendu",
"62a2d80c405b7fec5f547c448ab1b6ff": "{{order}} {0} a une direction non valide",
"6502a117987610380b9068ef98b1b0ee": "Aucun enregistrement trouvé dans {0} pour ({1}.{2},{3}.{4})",
"67c2bf43b5281ab929617423ea8a6f3e": "Le connecteur {0} ne prend pas en charge l'opération {{replaceById}}. IL ne s'agit pas d'un bogue dans LoopBack. Prenez contact avec les auteurs du connecteur, de préférence via les incidents GitHub.",
"6c3234937d69763fc7f6bcafccc59bbc": "{{Model::deleteById}} requiert l'argument {{id}}",
"6eb6fd4fbd73394000bc25f5776fd20c": "{{Model::exists}} requiert l'argument {{id}}",
"6fcc2ff0db7a4f490f5e0ce9e24691f3": "La relation {{HasOne}} ne peut pas créer plus d'une instance de {0}",
"728232e473bf80272c042df2b7e002f4": "Relation {{polymorphic}} {0} : {1} requiert le paramètre `polymorphic.discriminator` si le paramètre `polymorphic.foreignKey` est fourni",
"791ab3031a73ede03f7d6299a85e8289": "Expiration du délai de connexion après {0} ms",
"7b277018e43d41bc445731092b91547d": "Non connecté",
"7bbbdece4eea90e42aa5c0bce295e503": "{{Model::findById}} requiert l'argument {{id}}",
"7e9530c0399289be0ee601a604be71ff": "La relation {{BelongsTo}} {0} est vide",
"7faa840eb6ce11250a141deb42a6c489": "Relation inconnue {{scope}} : {0}",
"8091838319a5cc7d6a34af2f2a616ce9": "Le nom de propriété ne doit pas être \"{{constructor}}\" dans le modèle : {0}",
"881e4b0cb86ed59549248ee540a9fd10": "Le nom de propriété \"{{constructor}}\" n'est pas autorisé dans les données {0}",
"89afd3a9249f5a8d3edda07d84ca049d": "Modèle {{Polymorphic}} introuvable : `{0}`",
"89bf6d92731fe7bd2146ce8d0bec205c": "Argument non valide ; doit être une chaîne, un littéral {{regex}} ou un objet {{RegExp}}",
"8a39126103a157f501affa070367a1b0": "L'instance {0} n'est pas valide. Détails : {1}.",
"8c5ab01638c1ac1d58168c6346a8481a": "Indicateurs {{regex}} non valides : {0}",
"938401ea4ce48159efa9be1d4a5e8bab": "Les éléments doivent être un tableau : {0}",
"9e1f143ee02946324d34da92f71bf74e": "Relation {0} : {1} requiert le paramètre 'model'",
"a004f310d315e592843776fab964eaeb": "Les relations {{Polymorphic}} ont besoin d'un modèle exhaustif",
"a0cf0e09c26df14283223e84e6a10f00": "Impossible de mettre à jour les attributs. {{Object}} avec {{id}} {0} n'existe pas !",
"a2487abefef4259c2131d96cdb8543b1": "Echec de la connexion : {0}\nUn nouvel essai sera effectué pour la demande suivante.",
"a25e41a39c60c4702e55d0c3936576a1": "Non-concordance des clés : {0}.{1} : {2}, {3}.{4} : {5}",
"a327355560d495454fba2c1aad6bdf09": "Méthode scope inconnue : {0}",
"a6c18a7f4390cd3d59a2a7a047ae2aab": "Exécuter la commande \"{{npm install loopback-datasource-juggler}} {0}\" ",
"a829dee089c912e68c18920ba015400c": "AVERTISSEMENT : la propriété {{id}} ne peut pas être modifiée de {0} en {1} pour le modèle :{2} dans le point d'ancrage d'opération {{'loaded'}}",
"a984a076c59e451948b2bcf7a393d860": "AVERTISSEMENT : la propriété {{id}} ne peut pas être modifiée de {0} en {1} pour le modèle :{2} dans le point d'ancrage d'opération {{'before save'}}",
"ac04cf275b71c1eb89a41cf6bbad7a64": "La méthode HasOne \"getAsync()\" est obsolète ; utilisez \"get()\" à la place.",
"b138294f132edfe1eb2a8211150c7238": "`undefined` inattendu dans la requête",
"b15b20280211ad258d92947f05b6e4a5": "Le connecteur n'a pas été initialisé.",
"b278876ec93ef9760f00e83f38ba313d": "La méthode de portée \"getAsync()\" est obsolète ; utilisez \"find()\" à la place.",
"ba0fd8106eb54de4d003a844206431fd": "Le point d'ancrage de modèle \"{0}\" est obsolète ; utilisez à la place les points d'ancrage d'opération. {{http://docs.strongloop.com/display/LB/Operation+hooks}}",
"baf2c8b0c5a574b8a894e9b6304fece1": "La clause where {0} n'est pas un {{object}}",
"bdb11cc1c780c9ccac33c316cfdc9d82": "Type non défini pour la propriété {0}.{1}",
"bdfb951c8ff7ce0cbc08c06f548fd927": "La valeur est un {{object}} vide",
"bec226891a505828bfc76c5cfd73b336": "Impossible d'obtenir TTL pour la clé inconnue {0}",
"cd930369e86cdd222f7bd117c6f9fa94": "Fournisseur de valeur par défaut inconnu {0}",
"cfee4d8149316d9a647c0885cf3cafaf": "Les noms de propriété contenant un ou plusieurs points ne sont pas pris en charge. Modèle : {0}, propriété dynamique : {1}",
"d40328eabd8756d795bcdd49d782d4e9": "La source de données ne prend pas en charge les transactions ",
"da02dd6c53d4148320eeb31718a7aebe": "Type non valide pour la propriété {0}",
"da751a8a748adbde5b55fa83b707b4e2": "Les noms de propriété contenant un ou plusieurs points ne sont pas pris en charge. Modèle : {0}, propriété : {1}",
"db03083e9a768388fdbee865249ac67a": "Erreurs de validation ignorées dans {{updateOrCreate()}} :",
"dd63416d9b7d9fa4181e89efd619dfd8": "La valeur n'est pas {{array}} ou {{object}} avec des indices numériques séquentiels",
"ddf0aa14803f1c84f4a97f3803f7471c": "Nom de classe obligatoire",
"e08ab0e1ab55f26c357061447b635905": "Aucune relation trouvée dans {0} pour ({1}.{2},{3}.{4})",
"e0e9504e137a3c3339144b51ed76fef2": "Le connecteur n'est pas défini correctement ; il devrait créer le membre `{{connector}}` de la source de données",
"e2f282cbe3efba001d6d3a09f7f6ca8c": "Relation {{polymorphic}} {0} : {1} requiert le paramètre `polymorphic.foreignKey` si le paramètre `polymorphic.discriminator` est fourni",
"e39e0f5d52bfbf511e645d19ecadd2fa": "La propriété {0} comporte une clause non valide {1} : {2}",
"e39e0f5d52bfbf511e645d19ecadd2fa": "La propriét {0} comporte une clause non valide {1} : {2}",
"e4434de4bb8f5a3cd1d416e4d80d7e0b": "\"{0}\" {{id}} \"{1}\" inconnu.",
"e54d944c2a2c85a23caa86027ae307cf": "Impossible de migrer les modèles non associés à cette source de données : {0}",
"e54f118a75e15e132f16b985274eb46d": "Le filtre de requête {0} n'est pas un {{object}}",
"e55937649d8d7a11706b8cec22d02eae": "La relation {{HasOne}} {0} est vide",
"e6161ae8459c79d810e2aa9d21282a39": "Vous devez fournir un {{id}} lors de la mise à jour des attributs !",
"eb56c2b0c30cf006e2df00a549ec9c2c": "La relation \"{0}\" n'est pas définie pour le modèle {1}",
"ec42dca074f1818c447f7ad16e2d01af": "{0} n'est pas fourni par le connecteur associé",
"ecb7aa804bf54c682999d20d6436104c": "{{transaction}} n'est pas actif : {0}",
"f30809cb932b72a66416a709c8531530": "Le connecteur ne prend pas en charge {{method}} dans une transaction",
"f41bd91dc0f000a79c0bf842f1b7fdf9": "impossible de créer la liste à partir de la chaîne JSON : {0}",
"f6e8c96c93b9c7687d6c172b3695e898": "La propriété {{id}} ({0}) ne peut pas être mise à jour à partir de {1} vers {2}",
"fa9ae17e8e008d0eb0f0421a2972308c": "Relation {{polymorphic}} {0} : {1} requiert le paramètre `model`",
"fca4d12faff1035d9d0438d73432571b": "Entrée en double pour {0}.{1}",
"fd3cc89dc67e2d604eaae21bdf41d403": "Relation {0} introuvable pour le modèle {1}",
"fec8ebda24db46a9d040bf863765cc44": "L'opérateur {0} comporte des clauses non valides {1} : {2}"
"fec8ebda24db46a9d040bf863765cc44": "L'opérateur {0} comporte des clauses non valides {1} : {2}",
"0be2d39d225b1d8b2a0f92ad5c65c9ac": "Aucun modèle spécifié pour {{polymorphic}} {0} : {1}",
"0c4eb8b6c2ff6e51d7e195eee346ced9": "La table '{0}' n'existe pas.",
"2f4af31c144bbfab1bbf479866acd820": "\nAVERTISSEMENT : Le connecteur {{LoopBack}} \"{0}\" n'est pas installé, tout comme les modules suivants :\n\n {1}\n\nPour corriger le problème, exécutez :\n\n {{npm install {2} --save}}\n",
"6111399276924ffa3bc9a410cdfcb2e5": "Aucun nom {{id}} {0}",
"791ab3031a73ede03f7d6299a85e8289": "Expiration du délai de connexion après {0} ms",
"7b277018e43d41bc445731092b91547d": "Non connecté",
"a2487abefef4259c2131d96cdb8543b1": "Echec de la connexion : {0}\nUn nouvel essai sera effectué pour la demande suivante.",
"b15b20280211ad258d92947f05b6e4a5": "Le connecteur n'a pas été initialisé.",
"ddf0aa14803f1c84f4a97f3803f7471c": "Nom de classe obligatoire",
"e0e9504e137a3c3339144b51ed76fef2": "Le connecteur n'est pas défini correctement ; il devrait créer le membre `{{connector}}` de la source de données",
"ec42dca074f1818c447f7ad16e2d01af": "{0} n'est pas fourni par le connecteur associé",
"ba0fd8106eb54de4d003a844206431fd": "Le point d'ancrage de modèle \"{0}\" est obsolète ; utilisez à la place les points d'ancrage d'opération. {{http://docs.strongloop.com/display/LB/Operation+hooks}}",
"280f4550f90e133118955ec6f6f72830": "Le type de discriminateur {0} est indiqué mais il n'existe pas de modèle de ce nom",
"38dbf42c29a4645238cc3d632e88ebc9": "{{Relation.modelTo}} n'est pas défini pour la relation {0} et il n'est pas {{polymorphic}}",
"eb56c2b0c30cf006e2df00a549ec9c2c": "La relation \"{0}\" n'est pas définie pour le modèle {1}",
"938401ea4ce48159efa9be1d4a5e8bab": "Les éléments doivent être un tableau : {0}",
"f41bd91dc0f000a79c0bf842f1b7fdf9": "impossible de créer la liste à partir de la chaîne JSON : {0}",
"514985b2327f061ffb1c932f6b909979": "Le modèle {0} n'est pas défini.",
"8091838319a5cc7d6a34af2f2a616ce9": "Le nom de propriété ne doit pas être \"{{constructor}}\" dans le modèle : {0}",
"da02dd6c53d4148320eeb31718a7aebe": "Type non valide pour la propriété {0}",
"da751a8a748adbde5b55fa83b707b4e2": "Les noms de propriété contenant un ou plusieurs points ne sont pas pris en charge. Modèle : {0}, propriété : {1}",
"3864f9be10f27723074566d2b3893514": "Avertissement : le modèle {0}, {{strict mode: `throw`}} a été retiré, utilisez {{`strict: true`}} à la place, ce qui renvoie {{`Validation Error`}} pour les propriétés inconnues,",
"881e4b0cb86ed59549248ee540a9fd10": "Le nom de propriété \"{{constructor}}\" n'est pas autorisé dans les données {0}",
"bdb11cc1c780c9ccac33c316cfdc9d82": "Type non défini pour la propriété {0}.{1}",
"cd930369e86cdd222f7bd117c6f9fa94": "Fournisseur de valeur par défaut inconnu {0}",
"cfee4d8149316d9a647c0885cf3cafaf": "Les noms de propriété contenant un ou plusieurs points ne sont pas pris en charge. Modèle : {0}, propriété dynamique : {1}",
"0c0b867aca0973ba26e887d3337cc4ec": "Modèle {{Polymorphic}} non trouvé : `{0}` non défini",
"2f062cbecdf24245731bddc77714c814": "Relation \"{0}\" introuvable pour {1}",
"3cde8cc9bca22c67278b202ab0720106": "Aucune instance avec l'id {0} trouvée pour {1}",
"6502a117987610380b9068ef98b1b0ee": "Aucun enregistrement trouvé dans {0} pour ({1}.{2} ,{3}.{4})",
"6fcc2ff0db7a4f490f5e0ce9e24691f3": "La relation {{HasOne}} ne peut pas créer plus d'une instance de {0}",
"7e9530c0399289be0ee601a604be71ff": "La relation {{BelongsTo}} {0} est vide",
"7faa840eb6ce11250a141deb42a6c489": "Relation inconnue {{scope}} : {0}",
"89afd3a9249f5a8d3edda07d84ca049d": "Modèle {{Polymorphic}} introuvable : `{0}`",
"a004f310d315e592843776fab964eaeb": "Les relations {{Polymorphic}} ont besoin d'un modèle exhaustif",
"a25e41a39c60c4702e55d0c3936576a1": "Non-concordance de clé : {0}.{1}: {2}, {3}.{4}: {5}",
"a327355560d495454fba2c1aad6bdf09": "Méthode scope inconnue : {0}",
"e08ab0e1ab55f26c357061447b635905": "Aucune relation trouvée dans {0} pour ({1}.{2},{3}.{4})",
"e55937649d8d7a11706b8cec22d02eae": "La relation {{HasOne}} {0} est vide",
"2c4904377a87fdab502118719cc0d266": "{{Transaction}} n'est pas pris en charge",
"ecb7aa804bf54c682999d20d6436104c": "{{transaction}} n'est pas actif : {0}",
"89bf6d92731fe7bd2146ce8d0bec205c": "Argument non valide ; doit être une chaîne, un littéral {{regex}} ou un objet {{RegExp}}",
"8c5ab01638c1ac1d58168c6346a8481a": "Indicateurs {{regex}} non valides : {0}",
"a6c18a7f4390cd3d59a2a7a047ae2aab": "Exécuter la commande \"{{npm install loopback-datasource-juggler}} {0}\" ",
"b138294f132edfe1eb2a8211150c7238": "`undefined` inattendu dans la requête",
"8a39126103a157f501affa070367a1b0": "L'instance {0} n'est pas valide. Détails : {1}."
}

View File

@ -1,97 +1,80 @@
{
"0483a77cf77741504204e5c066597487": "{{polymorphic}} Relazione {0}: {1} non prevedere il parametro `polymorphic.as` durante la definizione di `foreignKey`/`discriminator` personalizzato ",
"09483e03b91c8bd58732a74b3ef1ec13": "Data non valida: {0}",
"0a5aa17f7866a85e3aee37ef5369403c": "LinkManyToMany ha ricevuto una destinazione che non contiene il valore \"{0}\" richiesto",
"0b16d3ffc42f91b4b9a4b3b50c41c838": "L'ordine {0} non è valido",
"0bd753a8944ad0af85a939bb25273887": "Impossibile fare scadere la chiave sconosciuta {0}",
"0c0b867aca0973ba26e887d3337cc4ec": "Modello {{Polymorphic}} non trovato: `{0}` non impostato",
"0c4eb8b6c2ff6e51d7e195eee346ced9": "La tabella '{0}' non esiste.",
"0ff31abb394afb555df162e74ff1a0a0": "Impossibile aggiornare {{id}} da {0} a {1} quando {{forceId}} è impostato su true",
"1ae7d3e0be381efb32bfd1ba652f5172": "AVVERTENZA: {{polymorphic}} La relazione {0}: {1} utilizza la parola chiave `polymorphic.as` che sarà OBSOLETA in LoopBack.next, fare riferimento a questa documentazione per le soluzioni di sostituzione (https://loopback.io/doc/en/lb3/Polymorphic-relations.html#deprecated-polymorphic-as)",
"1daef4e937fe52136597ba8fd2060f55": "La nidificazione delle transazioni non è supportata",
"21095484501dbff31af6556fa6039182": "Il parametro {{offset/skip}} {0} non è valido",
"280f4550f90e133118955ec6f6f72830": "È stato specificato il tipo di discriminatore {0} ma non esiste alcun modello con tale nome",
"28697ec15968a7969211f6d035ba9260": "{{polymorphic}} La relazione {0}: {1} non prevede il parametro `model`",
"2c4904377a87fdab502118719cc0d266": "{{Transaction}} non supportata",
"2c5c8519721f749aab13c2f04f41d611": "La proprietà {0} ha la clausola non valida {1}: Previsti esattamente 2 valori, ricevuti {2}",
"2f4af31c144bbfab1bbf479866acd820": "\nAVVERTENZA: il connettore {{LoopBack}} \"{0}\" non è installato come nessuno dei seguenti moduli:\n\n {1}\n\nPer correggere, eseguire:\n\n {{npm install {2} --save}}\n",
"3864f9be10f27723074566d2b3893514": "Avvertenza: il modello {0}, {{strict mode: `throw`}} è stato rimosso, utilizzare {{`strict: true`}}, che restituisce {{`Validation Error`}} per le proprietà sconosciute,",
"38dbf42c29a4645238cc3d632e88ebc9": "{{Relation.modelTo}} non è definito per la relazione {0} e non è {{polymorphic}}",
"3cde8cc9bca22c67278b202ab0720106": "Nessuna istanza con ID {0} trovata per {1}",
"416dfbb7b823f51c9f3800be81060b41": "Nessuna istanza con {{id}} {0} trovata per {1}",
"49b5afd8c6a19ad9c8abeffb2f8114eb": "Il metodo BelongsTo \"getAsync()\" è obsoleto, utilizzare \"get()\".",
"bec226891a505828bfc76c5cfd73b336": "Impossibile acquisire TTL per la chiave sconosciuta {0}",
"4c78325cedbb826db3a05bf5df0e8546": "È necessario fornire un {{id}} durante la sostituzione.",
"a0cf0e09c26df14283223e84e6a10f00": "Impossibile aggiornare gli attributi. {{Object}} con {{id}} {0} non esiste.",
"e54d944c2a2c85a23caa86027ae307cf": "Impossibile migrare i modelli non allegati a questa origine dati: {0}",
"e6161ae8459c79d810e2aa9d21282a39": "È necessario fornire un {{id}} durante l'aggiornamento degli attributi.",
"fca4d12faff1035d9d0438d73432571b": "Voce duplicata per {0}.{1}",
"09483e03b91c8bd58732a74b3ef1ec13": "Data non valida: {0}",
"0b16d3ffc42f91b4b9a4b3b50c41c838": "L'ordine {0} non è valido",
"0ff31abb394afb555df162e74ff1a0a0": "Impossibile aggiornare {{id}} da {0} a {1} quando {{forceId}} è impostato su true",
"21095484501dbff31af6556fa6039182": "Il parametro {{offset/skip}} {0} non è valido",
"2c5c8519721f749aab13c2f04f41d611": "La proprietà {0} ha la clausola non valida {1}: Previsti esattamente 2 valori, ricevuti {2}",
"416dfbb7b823f51c9f3800be81060b41": "Nessuna istanza con {{id}} {0} trovata per {1}",
"4e31b1edd10dadb724d83387de0b5062": "Il parametro {{limit}} {0} non è valido",
"514985b2327f061ffb1c932f6b909979": "Il modello {0} non è definito.",
"525c856e65daab43be247e7b5410febd": "{{polymorphic}} La relazione {0}: {1} non prevede il parametro `polymorphic.selector` durante la definizione di `foreignKey`/`discriminator` personalizzato ",
"5c18ee111dd87540cdb19a2a93b33be9": "Viene effettuato il rollback della transazione a causa del timeout",
"5ec7e6664256f7ea78f4f06dafc7d974": "La transazione non è pronta, attendere la promessa di risolvere restituita",
"5ec8efeb715a2c34b440f2d76e2cf87d": " {0}",
"6111399276924ffa3bc9a410cdfcb2e5": "Nessun nome {{id}} {0}",
"614e3355647e4127c96256102dc63376": "La proprietà {0} ha una clausola non valida {1}: Prevista una stringa o RegExp",
"62a2d80c405b7fec5f547c448ab1b6ff": "{{order}} {0} ha una direzione non valida",
"6502a117987610380b9068ef98b1b0ee": "Nessun record trovato in {0} per ({1}.{2} ,{3}.{4})",
"67c2bf43b5281ab929617423ea8a6f3e": "Il connettore {0} non supporta l'operazione {{replaceById}}. Questo non è un bug in LoopBack. Contattare gli autori del connettore, preferibilmente mediante GitHub.",
"6c3234937d69763fc7f6bcafccc59bbc": "{{Model::deleteById}} richiede l'argomento {{id}}",
"6eb6fd4fbd73394000bc25f5776fd20c": "{{Model::exists}} richiede l'argomento {{id}}",
"6fcc2ff0db7a4f490f5e0ce9e24691f3": "La relazione {{HasOne}} non può creare più di una istanza di {0}",
"728232e473bf80272c042df2b7e002f4": "{{polymorphic}} La relazione {0}: {1} richiede il parametro `polymorphic.discriminator` quando viene fornito il parametro `polymorphic.foreignKey`",
"791ab3031a73ede03f7d6299a85e8289": "Timeout nella connessione dopo {0} ms",
"7b277018e43d41bc445731092b91547d": "Non connesso",
"7bbbdece4eea90e42aa5c0bce295e503": "{{Model::findById}} richiede l'argomento {{id}}",
"7e9530c0399289be0ee601a604be71ff": "La relazione {{BelongsTo}} {0} è vuota",
"7faa840eb6ce11250a141deb42a6c489": "Relazione sconosciuta {{scope}}: {0}",
"8091838319a5cc7d6a34af2f2a616ce9": "Il nome della proprietà non deve essere \"{{constructor}}\" nel modello: {0}",
"881e4b0cb86ed59549248ee540a9fd10": "Nome della proprietà \"{{constructor}}\" non consentito nei dati {0}",
"89afd3a9249f5a8d3edda07d84ca049d": "Modello {{Polymorphic}} non trovato: `{0}`",
"89bf6d92731fe7bd2146ce8d0bec205c": "Argomento non valido, deve essere una stringa, un valore letterale {{regex}} o un oggetto {{RegExp}}",
"8a39126103a157f501affa070367a1b0": "L'istanza {0} non è valida. Dettagli: {1}.",
"8c5ab01638c1ac1d58168c6346a8481a": "Indicatori {{regex}} non validi: {0}",
"938401ea4ce48159efa9be1d4a5e8bab": "Gli elementi devono essere un array: {0}",
"9e1f143ee02946324d34da92f71bf74e": "La relazione {0}: {1} richiede il parametro `model`",
"a004f310d315e592843776fab964eaeb": "Le relazioni {{Polymorphic}} richiedono un modello di passaggio",
"a0cf0e09c26df14283223e84e6a10f00": "Impossibile aggiornare gli attributi. {{Object}} con {{id}} {0} non esiste.",
"a2487abefef4259c2131d96cdb8543b1": "Errore della connessione: {0}\nVerrà eseguito un nuovo tentativo per la richiesta successiva.",
"a25e41a39c60c4702e55d0c3936576a1": "Mancata corrispondenza della chiave: {0}.{1}: {2}, {3}.{4}: {5}",
"a327355560d495454fba2c1aad6bdf09": "Metodo dell'ambito sconosciuto: {0}",
"a6c18a7f4390cd3d59a2a7a047ae2aab": "Eseguire il comando \"{{npm install loopback-datasource-juggler}} {0}\" ",
"a829dee089c912e68c18920ba015400c": "AVVERTENZA: impossibile modificare la proprietà {{id}} da {0} a {1} per il modello:{2} nell'hook operazione {{'loaded'}}",
"a984a076c59e451948b2bcf7a393d860": "AVVERTENZA: impossibile modificare la proprietà {{id}} da {0} a {1} per il modello:{2} nell'hook operazione {{'before save'}}",
"ac04cf275b71c1eb89a41cf6bbad7a64": "Il metodo HasOne \"getAsync()\" è obsoleto, utilizzare \"get()\".",
"b138294f132edfe1eb2a8211150c7238": "Elemento `undefined` non previsto nella query",
"b15b20280211ad258d92947f05b6e4a5": "Il connettore non è stato inizializzato.",
"b278876ec93ef9760f00e83f38ba313d": "Il metodo dell'ambito \"getAsync()\" è obsoleto, utilizzare \"find()\" invece.",
"ba0fd8106eb54de4d003a844206431fd": "L'hook del modello \"{0}\" è obsoleto, utilizzare gli hook dell'operazione. {{http://docs.strongloop.com/display/LB/Operation+hooks}}",
"baf2c8b0c5a574b8a894e9b6304fece1": "La clausola where {0} non è un {{object}}",
"bdb11cc1c780c9ccac33c316cfdc9d82": "Tipo non definito per la proprietà {0}.{1}",
"bdfb951c8ff7ce0cbc08c06f548fd927": "Il valore è un {{object}} vuoto",
"bec226891a505828bfc76c5cfd73b336": "Impossibile acquisire TTL per la chiave sconosciuta {0}",
"cd930369e86cdd222f7bd117c6f9fa94": "Provider del valore predefinito sconosciuto {0}",
"cfee4d8149316d9a647c0885cf3cafaf": "I nomi delle proprietà che contengono punti non sono supportati. Modello: {0}, proprietà dinamica: {1}",
"d40328eabd8756d795bcdd49d782d4e9": "DataSource non supporta le transazioni",
"da02dd6c53d4148320eeb31718a7aebe": "Tipo non valido per la proprietà {0}",
"da751a8a748adbde5b55fa83b707b4e2": "I nomi delle proprietà che contengono punti non sono supportati. Modello: {0}, proprietà: {1}",
"db03083e9a768388fdbee865249ac67a": "Errore di convalida in {{updateOrCreate()}} ignorati:",
"dd63416d9b7d9fa4181e89efd619dfd8": "Il valore non è un {{array}} o {{object}} con indici numerici sequenziali",
"ddf0aa14803f1c84f4a97f3803f7471c": "Nome della classe obbligatorio",
"e08ab0e1ab55f26c357061447b635905": "Nessuna relazione trovata in {0} per ({1}.{2},{3}.{4})",
"e0e9504e137a3c3339144b51ed76fef2": "Il connettore non è definito correttamente: deve creare il membro `{{connector}}` di dataSource",
"e2f282cbe3efba001d6d3a09f7f6ca8c": "{{polymorphic}} La relazione {0}: {1} richiede il parametro `polymorphic.foreignKey` quando viene fornito il parametro `polymorphic.discriminator`",
"e39e0f5d52bfbf511e645d19ecadd2fa": "La proprietà {0} ha una clausola non valida {1}: {2}",
"e4434de4bb8f5a3cd1d416e4d80d7e0b": "{{id}} \"{0}\" sconosciuto \"{1}\".",
"e54d944c2a2c85a23caa86027ae307cf": "Impossibile migrare i modelli non allegati a questa origine dati: {0}",
"e54f118a75e15e132f16b985274eb46d": "Il filtro della query {0} non è un {{object}}",
"e55937649d8d7a11706b8cec22d02eae": "La relazione {{HasOne}} {0} è vuota",
"e6161ae8459c79d810e2aa9d21282a39": "È necessario fornire un {{id}} durante l'aggiornamento degli attributi.",
"eb56c2b0c30cf006e2df00a549ec9c2c": "Relazione \"{0}\" non definita per il modello {1}",
"ec42dca074f1818c447f7ad16e2d01af": "{0} non fornito dal connettore collegato",
"ecb7aa804bf54c682999d20d6436104c": "La {{transaction}} non è attiva: {0}",
"f30809cb932b72a66416a709c8531530": "Il connettore non supporta {{method}} all'interno di una transazione",
"f41bd91dc0f000a79c0bf842f1b7fdf9": "impossibile creare un elenco dalla stringa JSON: {0}",
"f6e8c96c93b9c7687d6c172b3695e898": "Impossibile aggiornare la proprietà {{id}} ({0}) da {1} a {2}",
"fa9ae17e8e008d0eb0f0421a2972308c": "{{polymorphic}} La relazione {0}: {1} richiede il parametro `model`",
"fca4d12faff1035d9d0438d73432571b": "Voce duplicata per {0}.{1}",
"fd3cc89dc67e2d604eaae21bdf41d403": "Impossibile trovare la relazione {0} per il modello {1}",
"fec8ebda24db46a9d040bf863765cc44": "L'operatore {0} ha delle clausole non valide {1}: {2}"
"fec8ebda24db46a9d040bf863765cc44": "L'operatore {0} ha delle clausole non valide {1}: {2}",
"0be2d39d225b1d8b2a0f92ad5c65c9ac": "Nessun modello specificato per {{polymorphic}} {0}: {1}",
"0c4eb8b6c2ff6e51d7e195eee346ced9": "La tabella '{0}' non esiste.",
"2f4af31c144bbfab1bbf479866acd820": "\nAVVERTENZA: il connettore {{LoopBack}} \"{0}\" non è installato come nessuno dei seguenti moduli:\n\n {1}\n\nPer correggere, eseguire:\n\n {{npm install {2} --save}}\n",
"6111399276924ffa3bc9a410cdfcb2e5": "Nessun nome {{id}} {0}",
"791ab3031a73ede03f7d6299a85e8289": "Timeout nella connessione dopo {0} ms",
"7b277018e43d41bc445731092b91547d": "Non connesso",
"a2487abefef4259c2131d96cdb8543b1": "Errore della connessione: {0}\nVerrà eseguito un nuovo tentativo per la richiesta successiva.",
"b15b20280211ad258d92947f05b6e4a5": "Il connettore non è stato inizializzato.",
"ddf0aa14803f1c84f4a97f3803f7471c": "Nome della classe obbligatorio",
"e0e9504e137a3c3339144b51ed76fef2": "Il connettore non è definito correttamente: deve creare il membro `{{connector}}` di dataSource",
"ec42dca074f1818c447f7ad16e2d01af": "{0} non fornito dal connettore collegato",
"ba0fd8106eb54de4d003a844206431fd": "L'hook del modello \"{0}\" è obsoleto, utilizzare gli hook dell'operazione. {{http://docs.strongloop.com/display/LB/Operation+hooks}}",
"280f4550f90e133118955ec6f6f72830": "È stato specificato il tipo di discriminatore {0} ma non esiste alcun modello con tale nome",
"38dbf42c29a4645238cc3d632e88ebc9": "{{Relation.modelTo}} non è definito per la relazione {0} e non è {{polymorphic}}",
"eb56c2b0c30cf006e2df00a549ec9c2c": "Relazione \"{0}\" non definita per il modello {1}",
"938401ea4ce48159efa9be1d4a5e8bab": "Gli elementi devono essere un array: {0}",
"f41bd91dc0f000a79c0bf842f1b7fdf9": "impossibile creare un elenco dalla stringa JSON: {0}",
"514985b2327f061ffb1c932f6b909979": "Il modello {0} non è definito.",
"8091838319a5cc7d6a34af2f2a616ce9": "Il nome della proprietà non deve essere \"{{constructor}}\" nel modello: {0}",
"da02dd6c53d4148320eeb31718a7aebe": "Tipo non valido per la proprietà {0}",
"da751a8a748adbde5b55fa83b707b4e2": "I nomi delle proprietà che contengono punti non sono supportati. Modello: {0}, proprietà: {1}",
"3864f9be10f27723074566d2b3893514": "Avvertenza: il modello {0}, {{strict mode: `throw`}} è stato rimosso, utilizzare {{`strict: true`}}, che restituisce {{`Validation Error`}} per le proprietà sconosciute,",
"881e4b0cb86ed59549248ee540a9fd10": "Nome della proprietà \"{{constructor}}\" non consentito nei dati {0}",
"bdb11cc1c780c9ccac33c316cfdc9d82": "Tipo non definito per la proprietà {0}.{1}",
"cd930369e86cdd222f7bd117c6f9fa94": "Provider del valore predefinito sconosciuto {0}",
"cfee4d8149316d9a647c0885cf3cafaf": "I nomi delle proprietà che contengono punti non sono supportati. Modello: {0}, proprietà dinamica: {1}",
"0c0b867aca0973ba26e887d3337cc4ec": "Modello {{Polymorphic}} non trovato: `{0}` non impostato",
"2f062cbecdf24245731bddc77714c814": "Impossibile trovare la relazione \"{0}\" per {1}",
"3cde8cc9bca22c67278b202ab0720106": "Nessuna istanza con ID {0} trovata per {1}",
"6502a117987610380b9068ef98b1b0ee": "Nessun record trovato in {0} per ({1}.{2} ,{3}.{4})",
"6fcc2ff0db7a4f490f5e0ce9e24691f3": "La relazione {{HasOne}} non può creare più di una istanza di {0}",
"7e9530c0399289be0ee601a604be71ff": "La relazione {{BelongsTo}} {0} è vuota",
"7faa840eb6ce11250a141deb42a6c489": "Relazione sconosciuta {{scope}}: {0}",
"89afd3a9249f5a8d3edda07d84ca049d": "Modello {{Polymorphic}} non trovato: `{0}`",
"a004f310d315e592843776fab964eaeb": "Le relazioni {{Polymorphic}} richiedono un modello di passaggio",
"a25e41a39c60c4702e55d0c3936576a1": "Mancata corrispondenza della chiave: {0}.{1}: {2}, {3}.{4}: {5}",
"a327355560d495454fba2c1aad6bdf09": "Metodo dell'ambito sconosciuto: {0}",
"e08ab0e1ab55f26c357061447b635905": "Nessuna relazione trovata in {0} per ({1}.{2},{3}.{4})",
"e55937649d8d7a11706b8cec22d02eae": "La relazione {{HasOne}} {0} è vuota",
"2c4904377a87fdab502118719cc0d266": "{{Transaction}} non supportata",
"ecb7aa804bf54c682999d20d6436104c": "La {{transaction}} non è attiva: {0}",
"89bf6d92731fe7bd2146ce8d0bec205c": "Argomento non valido, deve essere una stringa, un valore letterale {{regex}} o un oggetto {{RegExp}}",
"8c5ab01638c1ac1d58168c6346a8481a": "Indicatori {{regex}} non validi: {0}",
"a6c18a7f4390cd3d59a2a7a047ae2aab": "Eseguire il comando \"{{npm install loopback-datasource-juggler}} {0}\" ",
"b138294f132edfe1eb2a8211150c7238": "Elemento `undefined` non previsto nella query",
"8a39126103a157f501affa070367a1b0": "L'istanza {0} non è valida. Dettagli: {1}."
}

View File

@ -1,97 +1,80 @@
{
"0483a77cf77741504204e5c066597487": "{{polymorphic}} {0} 関係: {1} は、カスタムの foreignKey/discriminator`を定義する際は、パラメーター polymorphic.as`を予期していません ",
"09483e03b91c8bd58732a74b3ef1ec13": "無効な日付: {0}",
"0a5aa17f7866a85e3aee37ef5369403c": "LinkManyToMany は、必須の \"{0}\" が含まれていないターゲットを受信しました",
"0b16d3ffc42f91b4b9a4b3b50c41c838": "順序 {0} が無効です",
"0bd753a8944ad0af85a939bb25273887": "不明のキー {0} を期限切れにすることができません",
"0c0b867aca0973ba26e887d3337cc4ec": "{{Polymorphic}} モデルが見つかりません: `{0}` が設定されていません",
"0c4eb8b6c2ff6e51d7e195eee346ced9": "テーブル '{0}' が存在しません。",
"0ff31abb394afb555df162e74ff1a0a0": "{{forceId}} が true に設定されている場合、{{id}} を {0} から {1} に更新することはできません",
"1ae7d3e0be381efb32bfd1ba652f5172": "警告: {{polymorphic}} {0} 関係: {1} でキーワード`polymorphic.as`が使用されていますが、これは LoopBack.next で非推奨になる予定です。代替解決策について次の文書を参照してください (https://loopback.io/doc/en/lb3/Polymorphic-relations.html#deprecated-polymorphic-as)",
"1daef4e937fe52136597ba8fd2060f55": "トランザクションのネストはサポートされていません",
"21095484501dbff31af6556fa6039182": "{{offset/skip}} パラメーター {0} は無効です",
"280f4550f90e133118955ec6f6f72830": "判別プログラム・タイプ {0} が指定されていますが、このような名前のモデルは存在しません",
"28697ec15968a7969211f6d035ba9260": "{{polymorphic}} {0} 関係: {1} はパラメーター`model を予期していません`",
"2c4904377a87fdab502118719cc0d266": "{{Transaction}} はサポートされていません",
"2c5c8519721f749aab13c2f04f41d611": "{0} プロパティーには無効な節 {1} があります。正確に 2 つの値が必要ですが、{2} を受け取りました",
"2f4af31c144bbfab1bbf479866acd820": "\n警告: {{LoopBack}} コネクター \"{0}\" は次のいずれのモジュールとしてもインストールされていません:\n\n {1}\n\n修正するには、以下を実行します。\n\n {{npm install {2} --save}}\n",
"3864f9be10f27723074566d2b3893514": "警告: モデル {0}、{{strict mode: `throw`}} は削除されました。代わりに {{`strict: true`}} を使用してください。これにより、不明なプロパティーの {{`Validation Error`}} が返されます",
"38dbf42c29a4645238cc3d632e88ebc9": "{{Relation.modelTo}} は関係 {0} に定義されておらず、{{polymorphic}} ではありません",
"3cde8cc9bca22c67278b202ab0720106": "{1} に関する ID {0} のインスタンスが見つかりません",
"416dfbb7b823f51c9f3800be81060b41": "{1} に関する {{id}} {0} のインスタンスが見つかりません",
"49b5afd8c6a19ad9c8abeffb2f8114eb": "BelongsTo のメソッド \"getAsync()\" は非推奨です。代わりに \"get()\" を使用してください。",
"bec226891a505828bfc76c5cfd73b336": "不明のキー {0} の TTL を取得できません",
"4c78325cedbb826db3a05bf5df0e8546": "置換するときは {{id}} を指定する必要があります。",
"a0cf0e09c26df14283223e84e6a10f00": "属性を更新できませんでした。 {{id}} {0} の {{Object}} は存在しません。",
"e54d944c2a2c85a23caa86027ae307cf": "このデータ・ソースに付加されていないモデルはマイグレーションできません: {0}",
"e6161ae8459c79d810e2aa9d21282a39": "属性を更新するときは {{id}} を指定する必要があります。",
"fca4d12faff1035d9d0438d73432571b": "{0}.{1} のエントリーが重複しています",
"09483e03b91c8bd58732a74b3ef1ec13": "無効な日付: {0}",
"0b16d3ffc42f91b4b9a4b3b50c41c838": "順序 {0} が無効です",
"0ff31abb394afb555df162e74ff1a0a0": "{{forceId}} が true に設定されている場合、{{id}} を {0} から {1} に更新することはできません",
"21095484501dbff31af6556fa6039182": "{{offset/skip}} パラメーター {0} は無効です",
"2c5c8519721f749aab13c2f04f41d611": "{0} プロパティーには無効な節 {1} があります。正確に 2 つの値が必要ですが、{2} を受け取りました",
"416dfbb7b823f51c9f3800be81060b41": "{1} に関する {{id}} {0} のインスタンスが見つかりません",
"4e31b1edd10dadb724d83387de0b5062": "{{limit}} パラメーター {0} は無効です",
"514985b2327f061ffb1c932f6b909979": "モデル {0} が定義されていません。",
"525c856e65daab43be247e7b5410febd": "{{polymorphic}} {0} 関係: {1} は、カスタムの foreignKey/discriminator`を定義する際は、パラメーター polymorphic.selector`を予期していません ",
"5c18ee111dd87540cdb19a2a93b33be9": "タイムアウトのため、トランザクションがロールバックされます",
"5ec7e6664256f7ea78f4f06dafc7d974": "トランザクションの準備ができていません。返された Promise の解決をお待ちください",
"5ec8efeb715a2c34b440f2d76e2cf87d": " {0}",
"6111399276924ffa3bc9a410cdfcb2e5": "{{id}} 名 {0} がありません",
"614e3355647e4127c96256102dc63376": "{0} プロパティーには無効な節 {1} があります。ストリングまたは正規表現を指定する必要があります",
"62a2d80c405b7fec5f547c448ab1b6ff": "{{order}} {0} の方向が無効です",
"6502a117987610380b9068ef98b1b0ee": "({1}.{2}、{3}.{4}) に関して {0} でレコードが見つかりません",
"67c2bf43b5281ab929617423ea8a6f3e": "コネクター {0} では {{replaceById}} 操作はサポートされません。 これは LoopBack のバグではありません。 コネクターの作成者に (なるべく GitHub Issue を通して) 問い合わせてください。",
"6c3234937d69763fc7f6bcafccc59bbc": "{{Model::deleteById}} には {{id}} 引数が必要です",
"6eb6fd4fbd73394000bc25f5776fd20c": "{{Model::exists}} には {{id}} 引数が必要です",
"6fcc2ff0db7a4f490f5e0ce9e24691f3": "{{HasOne}} 関係では {0} のインスタンスを複数作成することはできません",
"728232e473bf80272c042df2b7e002f4": "{{polymorphic}} {0} 関係: {1} では、パラメーター polymorphic.foreignKey`を指定したときは、パラメーター polymorphic.discriminator`は必須です",
"791ab3031a73ede03f7d6299a85e8289": "接続は {0} ミリ秒後にタイムアウトになります",
"7b277018e43d41bc445731092b91547d": "未接続",
"7bbbdece4eea90e42aa5c0bce295e503": "{{Model::findById}} には {{id}} 引数が必要です",
"7e9530c0399289be0ee601a604be71ff": "{{BelongsTo}} 関係 {0} が空です",
"7faa840eb6ce11250a141deb42a6c489": "不明な関係 {{scope}}: {0}",
"8091838319a5cc7d6a34af2f2a616ce9": "モデル {0} のプロパティー名を \"{{constructor}}\" にすることはできません",
"881e4b0cb86ed59549248ee540a9fd10": "{0} データではプロパティー名 \"{{constructor}}\" は許可されません",
"89afd3a9249f5a8d3edda07d84ca049d": "{{Polymorphic}} モデルが見つかりません: `{0}`",
"89bf6d92731fe7bd2146ce8d0bec205c": "引数が無効です。ストリング、{{regex}} リテラル、または {{RegExp}} オブジェクトでなければなりません",
"8a39126103a157f501affa070367a1b0": "{0} インスタンスは無効です。 詳細: {1}。",
"8c5ab01638c1ac1d58168c6346a8481a": "無効な {{regex}} フラグ: {0}",
"938401ea4ce48159efa9be1d4a5e8bab": "項目は配列でなければなりません: {0}",
"9e1f143ee02946324d34da92f71bf74e": "{0} 関係: {1} ではパラメーター`model は必須です`",
"a004f310d315e592843776fab964eaeb": "{{Polymorphic}} 関係にはスルー・モデルが必要です",
"a0cf0e09c26df14283223e84e6a10f00": "属性を更新できませんでした。 {{id}} {0} の {{Object}} は存在しません。",
"a2487abefef4259c2131d96cdb8543b1": "接続失敗: {0}\n次の要求で再試行されます。",
"a25e41a39c60c4702e55d0c3936576a1": "キーの不一致: {0}.{1}: {2}、{3}.{4}: {5}",
"a327355560d495454fba2c1aad6bdf09": "不明なスコープ・メソッド: {0}",
"a6c18a7f4390cd3d59a2a7a047ae2aab": "\"{{npm install loopback-datasource-juggler}} {0}\" コマンドを実行します ",
"a829dee089c912e68c18920ba015400c": "警告: {{'loaded'}} 操作フックでモデル {2} の {{id}} プロパティーを {0} から {1} に変更することはできません",
"a984a076c59e451948b2bcf7a393d860": "警告: {{'before save'}} 操作フックでモデル {2} の {{id}} プロパティーを {0} から {1} に変更することはできません",
"ac04cf275b71c1eb89a41cf6bbad7a64": "HasOne のメソッド \"getAsync()\" は非推奨です。代わりに \"get()\" を使用してください。",
"b138294f132edfe1eb2a8211150c7238": "照会内に予期しない `undefined` があります",
"b15b20280211ad258d92947f05b6e4a5": "コネクターが初期化されていません。",
"b278876ec93ef9760f00e83f38ba313d": "Scope のメソッド \"getAsync()\" は非推奨です。代わりに \"find()\" を使用してください。",
"ba0fd8106eb54de4d003a844206431fd": "モデル・フック \"{0}\" は非推奨です。代わりに操作フックを使用してください。 {{http://docs.strongloop.com/display/LB/Operation+hooks}}",
"baf2c8b0c5a574b8a894e9b6304fece1": "where 節 {0} が {{object}} ではありません",
"bdb11cc1c780c9ccac33c316cfdc9d82": "プロパティー {0}.{1} にタイプが定義されていません",
"bdfb951c8ff7ce0cbc08c06f548fd927": "値は空の {{object}} です",
"bec226891a505828bfc76c5cfd73b336": "不明のキー {0} の TTL を取得できません",
"cd930369e86cdd222f7bd117c6f9fa94": "不明なデフォルト値プロバイダー {0}",
"cfee4d8149316d9a647c0885cf3cafaf": "ドットが含まれたプロパティー名はサポートされていません。 モデル: {0}、動的プロパティー: {1}",
"d40328eabd8756d795bcdd49d782d4e9": "データ・ソースがトランザクションをサポートしていません",
"da02dd6c53d4148320eeb31718a7aebe": "プロパティー {0} のタイプが無効です",
"da751a8a748adbde5b55fa83b707b4e2": "ドットが含まれたプロパティー名はサポートされていません。 モデル: {0}、プロパティー: {1}",
"db03083e9a768388fdbee865249ac67a": "{{updateOrCreate()}} での妥当性検査エラーを無視します:",
"dd63416d9b7d9fa4181e89efd619dfd8": "値は、連続した数字の索引が含まれた {{array}} または {{object}} ではありません",
"ddf0aa14803f1c84f4a97f3803f7471c": "クラス名は必須です",
"e08ab0e1ab55f26c357061447b635905": "({1}.{2}、{3}.{4}) に関して {0} で関係が見つかりません",
"e0e9504e137a3c3339144b51ed76fef2": "コネクターが正しく定義されていません: dataSource の `{{connector}}` メンバーを作成する必要があります",
"e2f282cbe3efba001d6d3a09f7f6ca8c": "{{polymorphic}} {0} 関係: {1} では、パラメーター polymorphic.discriminator`を指定したときは、パラメーター polymorphic.foreignKey`は必須です",
"e39e0f5d52bfbf511e645d19ecadd2fa": "{0} プロパティーには無効な節 {1} があります: {2}",
"e4434de4bb8f5a3cd1d416e4d80d7e0b": "\"{0}\" {{id}} \"{1}\" が不明です。",
"e54d944c2a2c85a23caa86027ae307cf": "このデータ・ソースに付加されていないモデルはマイグレーションできません: {0}",
"e54f118a75e15e132f16b985274eb46d": "照会フィルター {0} が {{object}} ではありません",
"e55937649d8d7a11706b8cec22d02eae": "{{HasOne}} 関係 {0} が空です",
"e6161ae8459c79d810e2aa9d21282a39": "属性を更新するときは {{id}} を指定する必要があります。",
"eb56c2b0c30cf006e2df00a549ec9c2c": "関係 \"{0}\" は {1} モデルに定義されていません",
"ec42dca074f1818c447f7ad16e2d01af": "{0} は付加されたコネクターによって提供されません",
"ecb7aa804bf54c682999d20d6436104c": "{{transaction}} がアクティブではありません: {0}",
"f30809cb932b72a66416a709c8531530": "コネクターがトランザクション内の {{method}} をサポートしていません",
"f41bd91dc0f000a79c0bf842f1b7fdf9": "JSON ストリングからリストを作成できませんでした: {0}",
"f6e8c96c93b9c7687d6c172b3695e898": "{{id}} プロパティー ({0}) を {1} から {2} に更新できません",
"fa9ae17e8e008d0eb0f0421a2972308c": "{{polymorphic}} {0} 関係: {1} ではパラメーター`model は必須です`",
"fca4d12faff1035d9d0438d73432571b": "{0}.{1} のエントリーが重複しています",
"fd3cc89dc67e2d604eaae21bdf41d403": "モデル {1} の関係 {0} が見つかりませんでした",
"fec8ebda24db46a9d040bf863765cc44": "{0} 演算子には無効な節 {1} があります: {2}"
"fec8ebda24db46a9d040bf863765cc44": "{0} 演算子には無効な節 {1} があります: {2}",
"0be2d39d225b1d8b2a0f92ad5c65c9ac": "{{polymorphic}} {0}: {1} にモデルが指定されていません",
"0c4eb8b6c2ff6e51d7e195eee346ced9": "テーブル '{0}' が存在しません。",
"2f4af31c144bbfab1bbf479866acd820": "\n警告: {{LoopBack}} コネクター \"{0}\" は次のいずれのモジュールとしてもインストールされていません:\n\n {1}\n\n修正するには、以下を実行します。\n\n {{npm install {2} --save}}\n",
"6111399276924ffa3bc9a410cdfcb2e5": "{{id}} 名 {0} がありません",
"791ab3031a73ede03f7d6299a85e8289": "接続は {0} ミリ秒後にタイムアウトになります",
"7b277018e43d41bc445731092b91547d": "未接続",
"a2487abefef4259c2131d96cdb8543b1": "接続失敗: {0}\n次の要求で再試行されます。",
"b15b20280211ad258d92947f05b6e4a5": "コネクターが初期化されていません。",
"ddf0aa14803f1c84f4a97f3803f7471c": "クラス名は必須です",
"e0e9504e137a3c3339144b51ed76fef2": "コネクターが正しく定義されていません: dataSource の `{{connector}}` メンバーを作成する必要があります",
"ec42dca074f1818c447f7ad16e2d01af": "{0} は付加されたコネクターによって提供されません",
"ba0fd8106eb54de4d003a844206431fd": "モデル・フック \"{0}\" は非推奨です。代わりに操作フックを使用してください。 {{http://docs.strongloop.com/display/LB/Operation+hooks}}",
"280f4550f90e133118955ec6f6f72830": "判別プログラム・タイプ {0} が指定されていますが、このような名前のモデルは存在しません",
"38dbf42c29a4645238cc3d632e88ebc9": "{{Relation.modelTo}} は関係 {0} に定義されておらず、{{polymorphic}} ではありません",
"eb56c2b0c30cf006e2df00a549ec9c2c": "関係 \"{0}\" は {1} モデルに定義されていません",
"938401ea4ce48159efa9be1d4a5e8bab": "項目は配列でなければなりません: {0}",
"f41bd91dc0f000a79c0bf842f1b7fdf9": "JSON ストリングからリストを作成できませんでした: {0}",
"514985b2327f061ffb1c932f6b909979": "モデル {0} が定義されていません。",
"8091838319a5cc7d6a34af2f2a616ce9": "モデル {0} のプロパティー名を \"{{constructor}}\" にすることはできません",
"da02dd6c53d4148320eeb31718a7aebe": "プロパティー {0} のタイプが無効です",
"da751a8a748adbde5b55fa83b707b4e2": "ドットが含まれたプロパティー名はサポートされていません。 モデル: {0}、プロパティー: {1}",
"3864f9be10f27723074566d2b3893514": "警告: モデル {0}、{{strict mode: `throw`}} は削除されました。代わりに {{`strict: true`}} を使用してください。これにより、不明なプロパティーの {{`Validation Error`}} が返されます",
"881e4b0cb86ed59549248ee540a9fd10": "{0} データではプロパティー名 \"{{constructor}}\" は許可されません",
"bdb11cc1c780c9ccac33c316cfdc9d82": "プロパティー {0}.{1} にタイプが定義されていません",
"cd930369e86cdd222f7bd117c6f9fa94": "不明なデフォルト値プロバイダー {0}",
"cfee4d8149316d9a647c0885cf3cafaf": "ドットが含まれたプロパティー名はサポートされていません。 モデル: {0}、動的プロパティー: {1}",
"0c0b867aca0973ba26e887d3337cc4ec": "{{Polymorphic}} モデルが見つかりません: `{0}` が設定されていません",
"2f062cbecdf24245731bddc77714c814": "{1} の \"{0}\" 関係が見つかりませんでした",
"3cde8cc9bca22c67278b202ab0720106": "{1} に関する ID {0} のインスタンスが見つかりません",
"6502a117987610380b9068ef98b1b0ee": "({1}.{2}、{3}.{4}) に関して {0} でレコードが見つかりません",
"6fcc2ff0db7a4f490f5e0ce9e24691f3": "{{HasOne}} 関係では {0} のインスタンスを複数作成することはできません",
"7e9530c0399289be0ee601a604be71ff": "{{BelongsTo}} 関係 {0} が空です",
"7faa840eb6ce11250a141deb42a6c489": "不明な関係 {{scope}}: {0}",
"89afd3a9249f5a8d3edda07d84ca049d": "{{Polymorphic}} モデルが見つかりません: `{0}`",
"a004f310d315e592843776fab964eaeb": "{{Polymorphic}} 関係にはスルー・モデルが必要です",
"a25e41a39c60c4702e55d0c3936576a1": "キーの不一致: {0}.{1}: {2}、{3}.{4}: {5}",
"a327355560d495454fba2c1aad6bdf09": "不明なスコープ・メソッド: {0}",
"e08ab0e1ab55f26c357061447b635905": "({1}.{2}、{3}.{4}) に関して {0} で関係が見つかりません",
"e55937649d8d7a11706b8cec22d02eae": "{{HasOne}} 関係 {0} が空です",
"2c4904377a87fdab502118719cc0d266": "{{Transaction}} はサポートされていません",
"ecb7aa804bf54c682999d20d6436104c": "{{transaction}} がアクティブではありません: {0}",
"89bf6d92731fe7bd2146ce8d0bec205c": "引数が無効です。ストリング、{{regex}} リテラル、または {{RegExp}} オブジェクトでなければなりません",
"8c5ab01638c1ac1d58168c6346a8481a": "無効な {{regex}} フラグ: {0}",
"a6c18a7f4390cd3d59a2a7a047ae2aab": "\"{{npm install loopback-datasource-juggler}} {0}\" コマンドを実行します ",
"b138294f132edfe1eb2a8211150c7238": "照会内に予期しない `undefined` があります",
"8a39126103a157f501affa070367a1b0": "{0} インスタンスは無効です。 詳細: {1}。"
}

View File

@ -1,97 +1,80 @@
{
"0483a77cf77741504204e5c066597487": "{{polymorphic}} {0} 관계: 사용자 정의 `foreignKey`/`discriminator` 정의 중에는 {1}에 `polymorphic.as` 매개변수가 필요하지 않음 ",
"09483e03b91c8bd58732a74b3ef1ec13": "올바르지 않은 날짜: {0}",
"0a5aa17f7866a85e3aee37ef5369403c": "LinkManyToMany에 필수 \"{0}\"이(가) 포함되지 않은 대상이 수신됨",
"0b16d3ffc42f91b4b9a4b3b50c41c838": "{0} 순서가 올바르지 않음",
"0bd753a8944ad0af85a939bb25273887": "알 수 없는 키 {0}을(를) 만료할 수 없음",
"0c0b867aca0973ba26e887d3337cc4ec": "{{Polymorphic}} 모델을 찾을 수 없음: `{0}`이(가) 설정되지 않음",
"0c4eb8b6c2ff6e51d7e195eee346ced9": "'{0}' 테이블이 없습니다.",
"0ff31abb394afb555df162e74ff1a0a0": "{{forceId}}이(가) true로 설정된 경우 {{id}}을(를) {0}에서 {1}(으)로 업데이트할 수 없음",
"1ae7d3e0be381efb32bfd1ba652f5172": "경고: {{polymorphic}} {0} 관계: {1}이(가) LoopBack에서 더 이상 사용되지 않을 `polymorphic.as` 키워드를 사용합니다. 대체 솔루션에 대해서는 다음 문서를 참조하십시오(https://loopback.io/doc/en/lb3/Polymorphic-relations.html#deprecated-polymorphic-as).",
"1daef4e937fe52136597ba8fd2060f55": "중첩 트랜잭션은 지원되지 않음",
"21095484501dbff31af6556fa6039182": "{{offset/skip}} 매개변수 {0}이(가) 올바르지 않음",
"280f4550f90e133118955ec6f6f72830": "식별자 유형 {0}이(가) 지정되었지만 해당 이름의 모델이 없습니다.",
"28697ec15968a7969211f6d035ba9260": "{{polymorphic}} {0} 관계: {1}에는 `model` 매개변수가 필요하지 않음",
"2c4904377a87fdab502118719cc0d266": "{{Transaction}}이(가) 지원되지 않음",
"2c5c8519721f749aab13c2f04f41d611": "{0} 특성에 올바르지 않은 절 {1}이(가) 있음: 정확하게 2개의 값을 예상했지만 {2}개를 수신함",
"2f4af31c144bbfab1bbf479866acd820": "\n경고: {{LoopBack}} 커넥터 \"{0}\"이(가) 다음 모듈로 설치되어 있지 않음:\n\n {1}\n\n이를 수정하려면 다음을 실행하십시오. \n\n {{npm install {2} --save}}\n",
"3864f9be10f27723074566d2b3893514": "경고: 모델 {0}, {{strict mode: `throw`}}이(가) 제거되었습니다. 알 수 없는 특성에 대해 {{`Validation Error`}}을(를) 리턴하는 {{`strict: true`}}을(를) 대신 사용하십시오.",
"38dbf42c29a4645238cc3d632e88ebc9": "관계 {0}에 대해 {{Relation.modelTo}}이(가) 정의되지 않았으며 {{polymorphic}}이(가) 아닙니다.",
"3cde8cc9bca22c67278b202ab0720106": "{1}에 대해 ID {0}의 인스턴스를 찾을 수 없음",
"416dfbb7b823f51c9f3800be81060b41": "{1}에 대해 {{id}} {0}의 인스턴스를 찾을 수 없음",
"49b5afd8c6a19ad9c8abeffb2f8114eb": "BelongsTo 메소드 \"getAsync()\"는 더 이상 사용되지 않습니다. 대신 \"get()\"을 사용하십시오.",
"bec226891a505828bfc76c5cfd73b336": "알 수 없는 키 {0}에 대한 TTL을 가져올 수 없음",
"4c78325cedbb826db3a05bf5df0e8546": "바꾸는 경우 {{id}}을(를) 제공해야 합니다!",
"a0cf0e09c26df14283223e84e6a10f00": "속성을 업데이트할 수 없습니다. {{id}} {0}의 {{Object}}이(가) 없습니다!",
"e54d944c2a2c85a23caa86027ae307cf": "이 데이터 소스에 첨부되지 않은 모델은 마이그레이션할 수 없음: {0}",
"e6161ae8459c79d810e2aa9d21282a39": "속성을 업데이트하는 경우 {{id}}을(를) 제공해야 합니다!",
"fca4d12faff1035d9d0438d73432571b": "{0}.{1}의 중복 항목",
"09483e03b91c8bd58732a74b3ef1ec13": "올바르지 않은 날짜: {0}",
"0b16d3ffc42f91b4b9a4b3b50c41c838": "{0} 순서가 올바르지 않음",
"0ff31abb394afb555df162e74ff1a0a0": "{{forceId}}이(가) true로 설정된 경우 {{id}}을(를) {0}에서 {1}(으)로 업데이트할 수 없음",
"21095484501dbff31af6556fa6039182": "{{offset/skip}} 매개변수 {0}이(가) 올바르지 않음",
"2c5c8519721f749aab13c2f04f41d611": "{0} 특성에 올바르지 않은 절 {1}이(가) 있음: 정확하게 2개의 값을 예상했지만 {2}개를 수신함",
"416dfbb7b823f51c9f3800be81060b41": "{1}에 대해 {{id}} {0}의 인스턴스를 찾을 수 없음",
"4e31b1edd10dadb724d83387de0b5062": "{{limit}} 매개변수 {0}이(가) 올바르지 않음",
"514985b2327f061ffb1c932f6b909979": "{0} 모델이 정의되지 않았습니다.",
"525c856e65daab43be247e7b5410febd": "{{polymorphic}} {0} 관계: 사용자 정의 `foreignKey`/`discriminator` 정의 중에는 {1}에 `polymorphic.selector` 매개변수가 필요하지 않음 ",
"5c18ee111dd87540cdb19a2a93b33be9": "제한시간 초과로 인해 트랜잭션이 롤백됨",
"5ec7e6664256f7ea78f4f06dafc7d974": "트랜잭션이 준비되지 않았으니 리턴된 일정이 해결될 때까지 기다려 주십시오.",
"5ec8efeb715a2c34b440f2d76e2cf87d": " {0}",
"6111399276924ffa3bc9a410cdfcb2e5": "{{id}} 이름 {0}이(가) 아님",
"614e3355647e4127c96256102dc63376": "{0} 특성에 올바르지 않은 절 {1}이(가) 있음: 문자열 또는 RegExp를 예상함",
"62a2d80c405b7fec5f547c448ab1b6ff": "{{order}} {0}에 올바르지 않은 방향이 있음",
"6502a117987610380b9068ef98b1b0ee": "{0}에서 ({1}.{2} ,{3}.{4})에 대한 레코드를 찾을 수 없음",
"67c2bf43b5281ab929617423ea8a6f3e": "커넥터 {0}에서 {{replaceById}} 오퍼레이션을 지원하지 않습니다. 이는 LoopBack의 버그가 아닙니다. 커넥터 작성자에게 문의하십시오. GitHub 발행을 사용하는 것이 좋습니다.",
"67c2bf43b5281ab929617423ea8a6f3e": "커넥터 {0}에서 {{replaceById}} 오퍼레이션을 지원하지 않습니다. 이는 LoopBack의 버그가 아닙니다. 커넥터 작성자에게 문의하십시오. GitHub 발행을 사용하는 것이 좋습니다. ",
"6c3234937d69763fc7f6bcafccc59bbc": "{{Model::deleteById}}에 {{id}} 인수가 필요함",
"6eb6fd4fbd73394000bc25f5776fd20c": "{{Model::exists}}에 {{id}} 인수가 필요함",
"6fcc2ff0db7a4f490f5e0ce9e24691f3": "{{HasOne}} 관계에서 둘 이상의 {0} 인스턴스를 작성할 수 없음",
"728232e473bf80272c042df2b7e002f4": "{{polymorphic}} {0} 관계: `polymorphic.foreignKey` 매개변수가 제공된 경우 {1}에는 `polymorphic.discriminator` 매개변수가 필요함",
"791ab3031a73ede03f7d6299a85e8289": "{0}밀리초 후 연결 제한시간 초과",
"7b277018e43d41bc445731092b91547d": "연결되지 않음",
"7bbbdece4eea90e42aa5c0bce295e503": "{{Model::findById}}에 {{id}} 인수가 필요함",
"7e9530c0399289be0ee601a604be71ff": "{{BelongsTo}} 관계 {0}이(가) 비어 있음",
"7faa840eb6ce11250a141deb42a6c489": "알 수 없는 관계 {{scope}}: {0}",
"8091838319a5cc7d6a34af2f2a616ce9": "모델에서 특성 이름이 \"{{constructor}}\"이어서는 안됨: {0}",
"881e4b0cb86ed59549248ee540a9fd10": "{0} 데이터에서는 특성 이름 \"{{constructor}}\"이(가) 허용되지 않음",
"89afd3a9249f5a8d3edda07d84ca049d": "{{Polymorphic}} 모델을 찾을 수 없음: `{0}`",
"89bf6d92731fe7bd2146ce8d0bec205c": "올바르지 않은 인수가 문자열, {{regex}} 리터럴 또는 {{RegExp}} 오브젝트여야 합니다.",
"8a39126103a157f501affa070367a1b0": "{0} 인스턴스가 올바르지 않습니다. 세부사항: {1}.",
"8c5ab01638c1ac1d58168c6346a8481a": "올바르지 않은 {{regex}} 플래그: {0}",
"938401ea4ce48159efa9be1d4a5e8bab": "항목이 배열이어야 함: {0}",
"9e1f143ee02946324d34da92f71bf74e": "{0} 관계: {1}에 `model` 매개변수가 필요함",
"a004f310d315e592843776fab964eaeb": "{{Polymorphic}} 관계에는 through 모델이 필요함",
"a0cf0e09c26df14283223e84e6a10f00": "속성을 업데이트할 수 없습니다. {{id}} {0}의 {{Object}}이(가) 없습니다!",
"a2487abefef4259c2131d96cdb8543b1": "연결 실패: {0}\n다음 요청에서 재시도됩니다.",
"a25e41a39c60c4702e55d0c3936576a1": "키 불일치: {0}.{1}: {2}, {3}.{4}: {5}",
"a327355560d495454fba2c1aad6bdf09": "알 수 없는 범위 메소드: {0}",
"a6c18a7f4390cd3d59a2a7a047ae2aab": "\"{{npm install loopback-datasource-juggler}} {0}\" 명령 실행 ",
"a829dee089c912e68c18920ba015400c": "경고: {{'loaded'}} 오퍼레이션 후크에서 모델:{2}에 대해 {{id}} 특성을 {0}에서 {1}(으)로 변경할 수 없습니다.",
"a984a076c59e451948b2bcf7a393d860": "경고: {{'before save'}} 오퍼레이션 후크에서 모델:{2}에 대해 {{id}} 특성을 {0}에서 {1}(으)로 변경할 수 없습니다.",
"ac04cf275b71c1eb89a41cf6bbad7a64": "HasOne 메소드 \"getAsync()\"는 더 이상 사용되지 않습니다. 대신 \"get()\"을 사용하십시오.",
"b138294f132edfe1eb2a8211150c7238": "조회에서 예상치 못한 `undefined` 항목",
"b15b20280211ad258d92947f05b6e4a5": "커넥터가 초기화되지 않았습니다.",
"b278876ec93ef9760f00e83f38ba313d": "Scope 메소드 \"getAsync()\"는 더 이상 사용되지 않습니다. 대신 \"find()\"를 사용하십시오.",
"ba0fd8106eb54de4d003a844206431fd": "모델 후크 \"{0}\"이(가) 더 이상 사용되지 않습니다. 오퍼레이션 후크가 대신 사용됩니다. {{http://docs.strongloop.com/display/LB/Operation+hooks}}",
"a829dee089c912e68c18920ba015400c": "경고: {{'loaded'}} 오퍼레이션 후크에서 모델:{2}에 대해 {{id}} 특성을 {0}에서 {1}(으)로 변경할 수 없습니다. ",
"a984a076c59e451948b2bcf7a393d860": "경고: {{'before save'}} 오퍼레이션 후크에서 모델:{2}에 대해 {{id}} 특성을 {0}에서 {1}(으)로 변경할 수 없습니다. ",
"baf2c8b0c5a574b8a894e9b6304fece1": "where 절 {0}이(가) {{object}}이(가) 아님",
"bdb11cc1c780c9ccac33c316cfdc9d82": "특성 {0}.{1}에 유형이 정의되지 않음",
"bdfb951c8ff7ce0cbc08c06f548fd927": "값이 빈 {{object}}임",
"bec226891a505828bfc76c5cfd73b336": "알 수 없는 키 {0}에 대한 TTL을 가져올 수 없음",
"cd930369e86cdd222f7bd117c6f9fa94": "알 수 없는 기본값 제공자 {0}",
"cfee4d8149316d9a647c0885cf3cafaf": "점이 포함된 특성 이름은 지원되지 않습니다. 모델: {0}, 동적 특성: {1}",
"d40328eabd8756d795bcdd49d782d4e9": "데이터 소스에서 트랜잭션을 지원하지 않음",
"da02dd6c53d4148320eeb31718a7aebe": "특성 {0}에 대한 올바르지 않은 유형",
"da751a8a748adbde5b55fa83b707b4e2": "점이 포함된 특성 이름은 지원되지 않습니다. 모델: {0}, 특성: {1}",
"db03083e9a768388fdbee865249ac67a": "{{updateOrCreate()}}에서 유효성 검증 오류 무시:",
"dd63416d9b7d9fa4181e89efd619dfd8": "값이 순차 숫자 색인을 가진 {{array}} 또는 {{object}}이(가) 아님",
"ddf0aa14803f1c84f4a97f3803f7471c": "클래스 이름 필수",
"e08ab0e1ab55f26c357061447b635905": "{0}에서 ({1}.{2} ,{3}.{4})에 대한 관계를 찾을 수 없음",
"e0e9504e137a3c3339144b51ed76fef2": "커넥터가 제대로 정의되지 않음: 데이터 소스의 `{{connector}}` 멤버를 작성해야 합니다.",
"e2f282cbe3efba001d6d3a09f7f6ca8c": "{{polymorphic}} {0} 관계: `polymorphic.discriminator` 매개변수가 제공된 경우 {1}에는 `polymorphic.foreignKey` 매개변수가 필요함",
"e39e0f5d52bfbf511e645d19ecadd2fa": "{0} 특성에 올바르지 않은 절 {1}이(가) 있음: {2}",
"e4434de4bb8f5a3cd1d416e4d80d7e0b": "알 수 없는 \"{0}\" {{id}} \"{1}\".",
"e54d944c2a2c85a23caa86027ae307cf": "이 데이터 소스에 첨부되지 않은 모델은 마이그레이션할 수 없음: {0}",
"e54f118a75e15e132f16b985274eb46d": "조회 필터 {0}이(가) {{object}}가 아님",
"e55937649d8d7a11706b8cec22d02eae": "{{HasOne}} 관계 {0}이(가) 비어 있음",
"e6161ae8459c79d810e2aa9d21282a39": "속성을 업데이트하는 경우 {{id}}을(를) 제공해야 합니다!",
"eb56c2b0c30cf006e2df00a549ec9c2c": "{1} 모델에 대해 관계 \"{0}\"이(가) 정의되지 않음",
"ec42dca074f1818c447f7ad16e2d01af": "첨부된 커넥터에서 {0}을(를) 제공하지 않음",
"ecb7aa804bf54c682999d20d6436104c": "{{transaction}}이(가) 활성 상태가 아님: {0}",
"f30809cb932b72a66416a709c8531530": "커넥터가 트랜잭션 내에서 {{method}}을(를) 지원하지 않음",
"f41bd91dc0f000a79c0bf842f1b7fdf9": "JSON 문자열에서 목록을 작성할 수 없음: {0}",
"f6e8c96c93b9c7687d6c172b3695e898": "{{id}} 특성({0})을 {1}에서 {2}(으)로 업데이트할 수 없음",
"fa9ae17e8e008d0eb0f0421a2972308c": "{{polymorphic}} {0} 관계: {1}에 `model` 매개변수가 필요함",
"fca4d12faff1035d9d0438d73432571b": "{0}.{1}의 중복 항목",
"fd3cc89dc67e2d604eaae21bdf41d403": "{1} 모델에 대해 {0} 관계를 찾을 수 없음",
"fec8ebda24db46a9d040bf863765cc44": "{0} 연산자에 올바르지 않은 절 {1}이(가) 있음: {2}"
"fec8ebda24db46a9d040bf863765cc44": "{0} 연산자에 올바르지 않은 절 {1}이(가) 있음: {2}",
"0be2d39d225b1d8b2a0f92ad5c65c9ac": "{{polymorphic}} {0}에 지정된 모델이 없음: {1}",
"0c4eb8b6c2ff6e51d7e195eee346ced9": "'{0}' 테이블이 없습니다.",
"2f4af31c144bbfab1bbf479866acd820": "\n경고: {{LoopBack}} 커넥터 \"{0}\"이(가) 다음 모듈로 설치되어 있지 않음:\n\n {1}\n\n이를 수정하려면 다음을 실행하십시오. \n\n {{npm install {2} --save}}\n",
"6111399276924ffa3bc9a410cdfcb2e5": "{{id}} 이름 {0}이(가) 아님",
"791ab3031a73ede03f7d6299a85e8289": "{0}밀리초 후 연결 제한시간 초과",
"7b277018e43d41bc445731092b91547d": "연결되지 않음",
"a2487abefef4259c2131d96cdb8543b1": "연결 실패: {0}\n다음 요청에서 재시도됩니다.",
"b15b20280211ad258d92947f05b6e4a5": "커넥터가 초기화되지 않았습니다.",
"ddf0aa14803f1c84f4a97f3803f7471c": "클래스 이름 필수",
"e0e9504e137a3c3339144b51ed76fef2": "커넥터가 제대로 정의되지 않음: 데이터 소스의 `{{connector}}` 멤버를 작성해야 합니다. ",
"ec42dca074f1818c447f7ad16e2d01af": "첨부된 커넥터에서 {0}을(를) 제공하지 않음",
"ba0fd8106eb54de4d003a844206431fd": "모델 후크 \"{0}\"이(가) 더 이상 사용되지 않습니다. 오퍼레이션 후크가 대신 사용됩니다. {{http://docs.strongloop.com/display/LB/Operation+hooks}}",
"280f4550f90e133118955ec6f6f72830": "식별자 유형 {0}이(가) 지정되었지만 해당 이름의 모델이 없습니다.",
"38dbf42c29a4645238cc3d632e88ebc9": "관계 {0}에 대해 {{Relation.modelTo}}이(가) 정의되지 않았으며 {{polymorphic}}이(가) 아닙니다. ",
"eb56c2b0c30cf006e2df00a549ec9c2c": "{1} 모델에 대해 관계 \"{0}\"이(가) 정의되지 않음",
"938401ea4ce48159efa9be1d4a5e8bab": "항목이 배열이어야 함: {0}",
"f41bd91dc0f000a79c0bf842f1b7fdf9": "JSON 문자열에서 목록을 작성할 수 없음: {0}",
"514985b2327f061ffb1c932f6b909979": "{0} 모델이 정의되지 않았습니다.",
"8091838319a5cc7d6a34af2f2a616ce9": "모델에서 특성 이름이 \"{{constructor}}\"이어서는 안됨: {0}",
"da02dd6c53d4148320eeb31718a7aebe": "특성 {0}에 대한 올바르지 않은 유형",
"da751a8a748adbde5b55fa83b707b4e2": "점이 포함된 특성 이름은 지원되지 않습니다. 모델: {0}, 특성: {1}",
"3864f9be10f27723074566d2b3893514": "경고: 모델 {0}, {{strict mode: `throw`}}이(가) 제거되었습니다. 알 수 없는 특성에 대해 {{`Validation Error`}}을(를) 리턴하는 {{`strict: true`}}을(를) 대신 사용하십시오. ",
"881e4b0cb86ed59549248ee540a9fd10": "{0} 데이터에서는 특성 이름 \"{{constructor}}\"이(가) 허용되지 않음",
"bdb11cc1c780c9ccac33c316cfdc9d82": "특성 {0}.{1}에 유형이 정의되지 않음",
"cd930369e86cdd222f7bd117c6f9fa94": "알 수 없는 기본값 제공자 {0}",
"cfee4d8149316d9a647c0885cf3cafaf": "점이 포함된 특성 이름은 지원되지 않습니다. 모델: {0}, 동적 특성: {1}",
"0c0b867aca0973ba26e887d3337cc4ec": "{{Polymorphic}} 모델을 찾을 수 없음: `{0}`이(가) 설정되지 않음",
"2f062cbecdf24245731bddc77714c814": "{1}에 대한 \"{0}\" 관계를 찾을 수 없음",
"3cde8cc9bca22c67278b202ab0720106": "{1}에 대해 ID {0}의 인스턴스를 찾을 수 없음",
"6502a117987610380b9068ef98b1b0ee": "{0}에서 ({1}.{2} ,{3}.{4})에 대한 레코드를 찾을 수 없음",
"6fcc2ff0db7a4f490f5e0ce9e24691f3": "{{HasOne}} 관계에서 둘 이상의 {0} 인스턴스를 작성할 수 없음",
"7e9530c0399289be0ee601a604be71ff": "{{BelongsTo}} 관계 {0}이(가) 비어 있음",
"7faa840eb6ce11250a141deb42a6c489": "알 수 없는 관계 {{scope}}: {0}",
"89afd3a9249f5a8d3edda07d84ca049d": "{{Polymorphic}} 모델을 찾을 수 없음: `{0}`",
"a004f310d315e592843776fab964eaeb": "{{Polymorphic}} 관계에는 through 모델이 필요함",
"a25e41a39c60c4702e55d0c3936576a1": "키 불일치: {0}.{1}: {2}, {3}.{4}: {5}",
"a327355560d495454fba2c1aad6bdf09": "알 수 없는 범위 메소드: {0}",
"e08ab0e1ab55f26c357061447b635905": "{0}에서 ({1}.{2} ,{3}.{4})에 대한 관계를 찾을 수 없음",
"e55937649d8d7a11706b8cec22d02eae": "{{HasOne}} 관계 {0}이(가) 비어 있음",
"2c4904377a87fdab502118719cc0d266": "{{Transaction}}이(가) 지원되지 않음",
"ecb7aa804bf54c682999d20d6436104c": "{{transaction}}이(가) 활성 상태가 아님: {0}",
"89bf6d92731fe7bd2146ce8d0bec205c": "올바르지 않은 인수가 문자열, {{regex}} 리터럴 또는 {{RegExp}} 오브젝트여야 합니다.",
"8c5ab01638c1ac1d58168c6346a8481a": "올바르지 않은 {{regex}} 플래그: {0}",
"a6c18a7f4390cd3d59a2a7a047ae2aab": "\"{{npm install loopback-datasource-juggler}} {0}\" 명령 실행",
"b138294f132edfe1eb2a8211150c7238": "조회에서 예상치 못한 `undefined` 항목",
"8a39126103a157f501affa070367a1b0": "{0} 인스턴스가 올바르지 않습니다. 세부사항: {1}."
}

133
intl/nl/messages.json Executable file → Normal file
View File

@ -1,97 +1,80 @@
{
"0483a77cf77741504204e5c066597487": "{{polymorphic}} {0} relatie: {1} verwacht niet dat de parameter `polymorphic.as` wordt gebruikt bij het definiëren van een aangepaste `foreignKey`/`discriminator` ",
"09483e03b91c8bd58732a74b3ef1ec13": "Ongeldige datum: {0}",
"0a5aa17f7866a85e3aee37ef5369403c": "LinkManyToMany heeft een doel ontvangen dat niet de vereiste \"{0}\" bevat",
"0b16d3ffc42f91b4b9a4b3b50c41c838": "De volgorde {0} is niet geldig",
"0bd753a8944ad0af85a939bb25273887": "Onbekende sleutel {0} kan niet vervallen",
"0c0b867aca0973ba26e887d3337cc4ec": "Model {{Polymorphic}} is niet gevonden: '{0}' niet ingesteld",
"0c4eb8b6c2ff6e51d7e195eee346ced9": "Tabel '{0}' bestaat niet.",
"0ff31abb394afb555df162e74ff1a0a0": "{{id}} kan niet worden bijgewerkt van {0} naar {1} zolang {{forceId}} is ingesteld op true",
"1ae7d3e0be381efb32bfd1ba652f5172": "WAARSCHUWING: {{polymorphic}} {0} relatie: {1} gebruikt trefwoord `polymorphic.as`. Dit wordt in LoopBack.next gedeprecieerd. Raadpleeg dit document voor vervangende oplossingen: (https://loopback.io/doc/en/lb3/Polymorphic-relations.html#deprecated-polymorphic-as)",
"1daef4e937fe52136597ba8fd2060f55": "Het nesten van transacties wordt niet ondersteund",
"21095484501dbff31af6556fa6039182": "De {{offset/skip}}-parameter {0} is niet geldig",
"280f4550f90e133118955ec6f6f72830": "Discriminatortype {0} opgegeven, maar er bestaat geen model met deze naam",
"28697ec15968a7969211f6d035ba9260": "{{polymorphic}} {0} relatie: {1} verwacht niet dat de parameter `model` wordt gebruikt",
"2c4904377a87fdab502118719cc0d266": "{{Transaction}} wordt niet ondersteund",
"2c5c8519721f749aab13c2f04f41d611": "De eigenschap {0} heeft een ongeldige clausule {1}: Er werden precies twee waarden verwacht. Ontvangen: {2}",
"2f4af31c144bbfab1bbf479866acd820": "\nWaarschuwing: {{LoopBack}}-connector \"{0}\" is niet geïnstalleerd als een van de volgende modules:\n\n {1}\n\nU lost dit op door het uitvoeren van:\n\n {{npm install {2} --save}}\n",
"3864f9be10f27723074566d2b3893514": "Waarschuwing: Model {0}, {{strict mode: `throw`}} is verwijderd. Gebruik in plaats hiervan {{`strict: true`}}; hiermee wordt {{`Validation Error`}} gemeld voor onbekende eigenschappen.",
"38dbf42c29a4645238cc3d632e88ebc9": "{{Relation.modelTo}} is niet gedefinieerd voor relatie {0} en is geen {{polymorphic}}",
"3cde8cc9bca22c67278b202ab0720106": "Geen instance met ID {0} gevonden voor {1}",
"416dfbb7b823f51c9f3800be81060b41": "Geen instance met {{id}} {0} gevonden voor {1}",
"49b5afd8c6a19ad9c8abeffb2f8114eb": "BelongsTo-methode \"getAsync()\" is gedeprecieerd. In plaats daarvan moet u \"get()\" gebruiken.",
"bec226891a505828bfc76c5cfd73b336": "TTL voor onbekende sleutel {0} kan niet worden opgehaald",
"4c78325cedbb826db3a05bf5df0e8546": "U moet een {{id}} opgeven bij een vervanging.",
"a0cf0e09c26df14283223e84e6a10f00": "De kenmerken kunnen niet worden bijgewerkt. {{Object}} met {{id}} {0} bestaat niet!",
"e54d944c2a2c85a23caa86027ae307cf": "Kan geen modellen migreren die niet zijn gekoppeld aan deze gegevensbron: {0}",
"e6161ae8459c79d810e2aa9d21282a39": "U moet een {{id}} opgeven bij het bijwerken van kenmerken.",
"fca4d12faff1035d9d0438d73432571b": "Dubbel item voor {0}.{1}",
"09483e03b91c8bd58732a74b3ef1ec13": "Ongeldige datum: {0}",
"0b16d3ffc42f91b4b9a4b3b50c41c838": "De volgorde {0} is niet geldig",
"0ff31abb394afb555df162e74ff1a0a0": "{{id}} kan niet worden bijgewerkt van {0} naar {1} zo lang {{forceId}} is ingesteld op true",
"21095484501dbff31af6556fa6039182": "De {{offset/skip}}-parameter {0} is niet geldig",
"2c5c8519721f749aab13c2f04f41d611": "De eigenschap {0} heeft een ongeldige clausule {1}: Er werden precies twee waarden verwacht. Ontvangen: {2}",
"416dfbb7b823f51c9f3800be81060b41": "Geen instance met {{id}} {0} gevonden voor {1}",
"4e31b1edd10dadb724d83387de0b5062": "De {{limit}}-parameter {0} is niet geldig",
"514985b2327f061ffb1c932f6b909979": "Model {0} is niet gedefinieerd.",
"525c856e65daab43be247e7b5410febd": "{{polymorphic}} {0} relatie: {1} verwacht niet dat de parameter `polymorphic.selector` wordt gebruikt bij het definiëren van een aangepaste `foreignKey`/`discriminator` ",
"5c18ee111dd87540cdb19a2a93b33be9": "De transactie is teruggedraaid vanwege een timeout",
"5ec7e6664256f7ea78f4f06dafc7d974": "De transactie is niet gereed, wacht tot de geretourneerde promise omgezet is",
"5ec8efeb715a2c34b440f2d76e2cf87d": " {0}",
"6111399276924ffa3bc9a410cdfcb2e5": "Geen {{id}}-naam {0}",
"614e3355647e4127c96256102dc63376": "De eigenschap {0} heeft een ongeldige clausule {1}: Er werd een tekenreeks of expressie verwacht",
"62a2d80c405b7fec5f547c448ab1b6ff": "De {{order}} {0} heeft een ongeldige richting",
"6502a117987610380b9068ef98b1b0ee": "Geen record gevonden in {0} voor ({1}.{2} ,{3}.{4})",
"67c2bf43b5281ab929617423ea8a6f3e": "De connector {0} biedt geen ondersteuning voor de bewerking {{replaceById}}. Dit is geen programmafout in LoopBack. Neem contact op met de auteurs van de connector, bij voorkeur via GitHub-problemen.",
"6c3234937d69763fc7f6bcafccc59bbc": "Voor {{Model::deleteById}} is het argument {{id}} vereist",
"6eb6fd4fbd73394000bc25f5776fd20c": "Voor {{Model::exists}} is het argument {{id}} vereist",
"6fcc2ff0db7a4f490f5e0ce9e24691f3": "{{HasOne}}-relatie kan niet resulteren in meer dan één instance van {0}",
"728232e473bf80272c042df2b7e002f4": "{{polymorphic}} {0} relatie: als de parameter `polymorphic.foreignKey` wordt opgegeven, vereist {1} de parameter `polymorphic.discriminator`",
"791ab3031a73ede03f7d6299a85e8289": "Timeout voor het maken van verbinding na {0} ms",
"7b277018e43d41bc445731092b91547d": "Geen verbinding",
"7bbbdece4eea90e42aa5c0bce295e503": "Voor {{Model::findById}} is het argument {{id}} vereist",
"7e9530c0399289be0ee601a604be71ff": "{{BelongsTo}}-relatie {0} is leeg",
"7faa840eb6ce11250a141deb42a6c489": "Onbekende relatie {{scope}}: {0}",
"8091838319a5cc7d6a34af2f2a616ce9": "Eigenschapnaam mag niet \"{{constructor}}\" zijn in model: {0}",
"881e4b0cb86ed59549248ee540a9fd10": "Eigenschapnaam \"{{constructor}}\" is niet toegestaan in {0}-gegevens",
"89afd3a9249f5a8d3edda07d84ca049d": "{{Polymorphic}}-model is niet gevonden: '{0}'",
"89bf6d92731fe7bd2146ce8d0bec205c": "Ongeldig argument, moet een tekenreeks, {{regex}}-literaal of {{RegExp}}-object zijn",
"8a39126103a157f501affa070367a1b0": "De instance {0} is niet geldig. Details: {1}.",
"8c5ab01638c1ac1d58168c6346a8481a": "Ongeldige {{regex}}-vlaggen: {0}",
"938401ea4ce48159efa9be1d4a5e8bab": "Items moeten een array zijn: {0}",
"9e1f143ee02946324d34da92f71bf74e": "{0} relatie: {1} vereist de parameter `model`",
"a004f310d315e592843776fab964eaeb": "{{Polymorphic}}-relaties hebben een doorvoermodel nodig",
"a0cf0e09c26df14283223e84e6a10f00": "De kenmerken kunnen niet worden bijgewerkt. {{Object}} met {{id}} {0} bestaat niet!",
"a2487abefef4259c2131d96cdb8543b1": "Verbinding mislukt: {0}\nVerbindingspoging wordt herhaald bij volgende opdracht.",
"a25e41a39c60c4702e55d0c3936576a1": "Niet-overeenkomende sleutels: {0}.{1}: {2}, {3}.{4}: {5}",
"a327355560d495454fba2c1aad6bdf09": "Onbekende methode voor bereik: {0}",
"a6c18a7f4390cd3d59a2a7a047ae2aab": "Voer de opdracht \"{{npm install loopback-datasource-juggler}} {0}\" uit",
"a829dee089c912e68c18920ba015400c": "Waarschuwing: Eigenschap {{id}} kan niet worden gewijzigd van {0} in {1} voor model:{2} in operation hook {{'loaded'}}",
"a984a076c59e451948b2bcf7a393d860": "Waarschuwing: Eigenschap {{id}} kan niet worden gewijzigd van {0} in {1} voor model:{2} in operation hook {{'before save'}}",
"ac04cf275b71c1eb89a41cf6bbad7a64": "HasOne-methode \"getAsync()\" is gedeprecieerd. In plaats daarvan moet u \"get()\" gebruiken.",
"b138294f132edfe1eb2a8211150c7238": "Onverwacht item 'undefined' in query",
"b15b20280211ad258d92947f05b6e4a5": "De connector is niet geïnitialiseerd.",
"b278876ec93ef9760f00e83f38ba313d": "Scope-methode \"getAsync()\" is gedeprecieerd. In plaats daarvan moet u \"find()\" gebruiken.",
"ba0fd8106eb54de4d003a844206431fd": "Model hook \"{0}\" is gedeprecieerd; gebruik in plaats daarvan operation hooks. {{http://docs.strongloop.com/display/LB/Operation+hooks}}",
"baf2c8b0c5a574b8a894e9b6304fece1": "De WHERE-clausule {0} is geen {{object}}",
"bdb11cc1c780c9ccac33c316cfdc9d82": "Type niet gedefinieerd voor eigenschap {0}.{1}",
"bdfb951c8ff7ce0cbc08c06f548fd927": "Waarde is een leeg {{object}}",
"bec226891a505828bfc76c5cfd73b336": "TTL voor onbekende sleutel {0} kan niet worden opgehaald",
"cd930369e86cdd222f7bd117c6f9fa94": "Onbekende standaardwaarde voor provider {0}",
"cfee4d8149316d9a647c0885cf3cafaf": "Eigenschapnamen met punt(en) worden niet ondersteund. Model: {0}, dynamische eigenschap: {1}",
"d40328eabd8756d795bcdd49d782d4e9": "DataSource ondersteunt geen transacties",
"da02dd6c53d4148320eeb31718a7aebe": "Ongeldig type voor eigenschap {0}",
"da751a8a748adbde5b55fa83b707b4e2": "Eigenschapnamen met punt(en) worden niet ondersteund. Model: {0}, eigenschap: {1}",
"db03083e9a768388fdbee865249ac67a": "Validatiefouten in {{updateOrCreate()}} worden genegeerd:",
"dd63416d9b7d9fa4181e89efd619dfd8": "Waarde is geen {{array}} of {{object}} met sequentiële numerieke indices",
"ddf0aa14803f1c84f4a97f3803f7471c": "Klassennaam vereist",
"e08ab0e1ab55f26c357061447b635905": "Geen relatie gevonden in in {0} voor ({1}.{2},{3}.{4})",
"e0e9504e137a3c3339144b51ed76fef2": "Connector is niet juist gedefinieerd: moet '{{connector}}'-lid van gegevensbron maken",
"e2f282cbe3efba001d6d3a09f7f6ca8c": "{{polymorphic}} {0} relatie: als de parameter `polymorphic.discriminator` wordt opgegeven, vereist {1} de parameter `polymorphic.foreignKey`",
"e39e0f5d52bfbf511e645d19ecadd2fa": "De eigenschap {0} heeft een ongeldige clausule {1}: {2}",
"e4434de4bb8f5a3cd1d416e4d80d7e0b": "Onbekend \"{0}\" {{id}} \"{1}\".",
"e54d944c2a2c85a23caa86027ae307cf": "Kan geen modellen migreren die niet zijn gekoppeld aan deze gegevensbron: {0}",
"e54f118a75e15e132f16b985274eb46d": "Het queryfilter {0} is geen {{object}}",
"e55937649d8d7a11706b8cec22d02eae": "{{HasOne}}-relatie {0} is leeg",
"e6161ae8459c79d810e2aa9d21282a39": "U moet een {{id}} opgeven bij het bijwerken van kenmerken.",
"eb56c2b0c30cf006e2df00a549ec9c2c": "Relatie \"{0}\" is niet gedefinieerd voor model {1}",
"ec42dca074f1818c447f7ad16e2d01af": "{0} is niet opgegeven door gekoppelde connector",
"ecb7aa804bf54c682999d20d6436104c": "De {{transaction}} is niet actief: {0}",
"f30809cb932b72a66416a709c8531530": "De connector ondersteunt {{method}} niet binnen een transactie",
"f41bd91dc0f000a79c0bf842f1b7fdf9": "kan geen lijst maken op basis van JSON-reeks: {0}",
"f6e8c96c93b9c7687d6c172b3695e898": "{{id}}-eigenschap ({0}) kan niet worden bijgewerkt van {1} in {2}",
"fa9ae17e8e008d0eb0f0421a2972308c": "{{polymorphic}} {0} relatie: {1} vereist de parameter `model`",
"fca4d12faff1035d9d0438d73432571b": "Dubbel item voor {0}.{1}",
"fd3cc89dc67e2d604eaae21bdf41d403": "Relatie {0} voor model {1} is niet gevonden",
"fec8ebda24db46a9d040bf863765cc44": "De operator {0} heeft ongeldige clausules {1}: {2}"
"fec8ebda24db46a9d040bf863765cc44": "De operator {0} heeft ongeldige clausules {1}: {2}",
"0be2d39d225b1d8b2a0f92ad5c65c9ac": "Geen model opgegeven voor {{polymorphic}} {0}: {1}",
"0c4eb8b6c2ff6e51d7e195eee346ced9": "Tabel '{0}' bestaat niet.",
"2f4af31c144bbfab1bbf479866acd820": "\nWaarschuwing: {{LoopBack}}-connector \"{0}\" is niet geïnstalleerd als een van de volgende modules:\n\n {1}\n\nU lost dit op door het uitvoeren van:\n\n {{npm install {2} --save}}\n",
"6111399276924ffa3bc9a410cdfcb2e5": "Geen {{id}}-naam {0}",
"791ab3031a73ede03f7d6299a85e8289": "Timeout voor het maken van verbinding na {0} ms",
"7b277018e43d41bc445731092b91547d": "Geen verbinding",
"a2487abefef4259c2131d96cdb8543b1": "Verbinding mislukt: {0}\nVerbindingspoging wordt herhaald bij volgende opdracht.",
"b15b20280211ad258d92947f05b6e4a5": "De connector is niet geïnitialiseerd.",
"ddf0aa14803f1c84f4a97f3803f7471c": "Klassennaam vereist",
"e0e9504e137a3c3339144b51ed76fef2": "Connector is niet juist gedefinieerd: moet '{{connector}}'-lid van gegevensbron maken",
"ec42dca074f1818c447f7ad16e2d01af": "{0} is niet opgegeven door gekoppelde connector",
"ba0fd8106eb54de4d003a844206431fd": "Model hook \"{0}\" is gedeprecieerd; gebruik in plaats daarvan operation hooks. {{http://docs.strongloop.com/display/LB/Operation+hooks}}",
"280f4550f90e133118955ec6f6f72830": "Discriminatortype {0} opgegeven, maar er bestaat geen model met deze naam",
"38dbf42c29a4645238cc3d632e88ebc9": "{{Relation.modelTo}} is niet gedefinieerd voor relatie {0} en is geen {{polymorphic}}",
"eb56c2b0c30cf006e2df00a549ec9c2c": "Relatie \"{0}\" is niet gedefinieerd voor model {1}",
"938401ea4ce48159efa9be1d4a5e8bab": "Items moeten een array zijn: {0}",
"f41bd91dc0f000a79c0bf842f1b7fdf9": "kan geen lijst maken op basis van JSON-reeks: {0}",
"514985b2327f061ffb1c932f6b909979": "Model {0} is niet gedefinieerd.",
"8091838319a5cc7d6a34af2f2a616ce9": "Eigenschapnaam mag niet \"{{constructor}}\" zijn in model: {0}",
"da02dd6c53d4148320eeb31718a7aebe": "Ongeldig type voor eigenschap {0}",
"da751a8a748adbde5b55fa83b707b4e2": "Eigenschapnamen met punt(en) worden niet ondersteund. Model: {0}, eigenschap: {1}",
"3864f9be10f27723074566d2b3893514": "Waarschuwing: Model {0}, {{strict mode: `throw`}} is verwijderd. Gebruik in plaats hiervan {{`strict: true`}}; hiermee wordt {{`Validation Error`}} gemeld voor onbekende eigenschappen.",
"881e4b0cb86ed59549248ee540a9fd10": "Eigenschapnaam \"{{constructor}}\" is niet toegestaan in {0}-gegevens",
"bdb11cc1c780c9ccac33c316cfdc9d82": "Type niet gedefinieerd voor eigenschap {0}.{1}",
"cd930369e86cdd222f7bd117c6f9fa94": "Onbekende standaardwaarde voor provider {0}",
"cfee4d8149316d9a647c0885cf3cafaf": "Eigenschapnamen met punt(en) worden niet ondersteund. Model: {0}, dynamische eigenschap: {1}",
"0c0b867aca0973ba26e887d3337cc4ec": "Model {{Polymorphic}} is niet gevonden: '{0}' niet ingesteld",
"2f062cbecdf24245731bddc77714c814": "Kan \"{0}\"-relatie voor {1} niet vinden",
"3cde8cc9bca22c67278b202ab0720106": "Geen instance met ID {0} gevonden voor {1}",
"6502a117987610380b9068ef98b1b0ee": "Geen record gevonden in {0} voor ({1}.{2} ,{3}.{4})",
"6fcc2ff0db7a4f490f5e0ce9e24691f3": "{{HasOne}}-relatie kan niet resulteren in meer dan één instance van {0}",
"7e9530c0399289be0ee601a604be71ff": "{{BelongsTo}}-relatie {0} is leeg",
"7faa840eb6ce11250a141deb42a6c489": "Onbekende relatie {{scope}}: {0}",
"89afd3a9249f5a8d3edda07d84ca049d": "{{Polymorphic}}-model is niet gevonden: '{0}'",
"a004f310d315e592843776fab964eaeb": "{{Polymorphic}}-relaties hebben een doorvoermodel nodig",
"a25e41a39c60c4702e55d0c3936576a1": "Niet-overeenkomende sleutels: {0}.{1}: {2}, {3}.{4}: {5}",
"a327355560d495454fba2c1aad6bdf09": "Onbekende methode voor bereik: {0}",
"e08ab0e1ab55f26c357061447b635905": "Geen relatie gevonden in {0} voor ({1}.{2},{3}.{4})",
"e55937649d8d7a11706b8cec22d02eae": "{{HasOne}}-relatie {0} is leeg",
"2c4904377a87fdab502118719cc0d266": "{{Transaction}} wordt niet ondersteund",
"ecb7aa804bf54c682999d20d6436104c": "De {{transaction}} is niet actief: {0}",
"89bf6d92731fe7bd2146ce8d0bec205c": "Ongeldig argument, moet een tekenreeks, {{regex}}-literaal of {{RegExp}}-object zijn",
"8c5ab01638c1ac1d58168c6346a8481a": "Ongeldige {{regex}}-vlaggen: {0}",
"a6c18a7f4390cd3d59a2a7a047ae2aab": "Voer de opdracht \"{{npm install loopback-datasource-juggler}} {0}\" uit ",
"b138294f132edfe1eb2a8211150c7238": "Onverwacht item 'undefined' in query",
"8a39126103a157f501affa070367a1b0": "De instance {0} is niet geldig. Details: {1}."
}

View File

@ -1,97 +0,0 @@
{
"0483a77cf77741504204e5c066597487": "Relacja {{polymorphic}} {0}: {1} nie oczekuje parametru `polymorphic.as` podczas definiowania niestandardowego obiektu `foreignKey`/`discriminator` ",
"09483e03b91c8bd58732a74b3ef1ec13": "Niepoprawna data: {0}",
"0a5aa17f7866a85e3aee37ef5369403c": "Funkcja LinkManyToMany otrzymała element docelowy, który nie zawiera wymaganej wartości \"{0}\"",
"0b16d3ffc42f91b4b9a4b3b50c41c838": "Kolejność {0} jest niepoprawna",
"0bd753a8944ad0af85a939bb25273887": "Nie można unieważnić nieznanego klucza {0}",
"0c0b867aca0973ba26e887d3337cc4ec": "Model {{Polymorphic}} nie został znaleziony: nie ustawiono właściwości `{0}`",
"0c4eb8b6c2ff6e51d7e195eee346ced9": "Tabela '{0}' nie istnieje.",
"0ff31abb394afb555df162e74ff1a0a0": "{{id}} nie może być zaktualizowany z {0} na {1}, gdy właściwość {{forceId}} ma wartość true",
"1ae7d3e0be381efb32bfd1ba652f5172": "OSTRZEŻENIE: Relacja {{polymorphic}} {0}: {1} używa słowa kluczowego `polymorphic.as`, które będzie NIEAKTUALNE w aplikacji LoopBack.next; aby uzyskać informacje o rozwiązaniach zastępczych, zapoznaj się z tym dokumentem (https://loopback.io/doc/en/lb3/Polymorphic-relations.html#deprecated-polymorphic-as)",
"1daef4e937fe52136597ba8fd2060f55": "Zagnieżdżanie transakcji nie jest obsługiwane",
"21095484501dbff31af6556fa6039182": "Parametr {{offset/skip}} {0} jest niepoprawny",
"280f4550f90e133118955ec6f6f72830": "Określono typ wyróżnika {0}, ale nie istnieje model o takiej nazwie",
"28697ec15968a7969211f6d035ba9260": "Relacja {{polymorphic}} {0}: {1} nie oczekuje parametru `model`",
"2c4904377a87fdab502118719cc0d266": "{{Transaction}} nie jest obsługiwana",
"2c5c8519721f749aab13c2f04f41d611": "Właściwość {0} ma niepoprawną klauzulę {1}: oczekiwano dokładnie 2 wartości, otrzymano {2}",
"2f4af31c144bbfab1bbf479866acd820": "\nOSTRZEŻENIE: Konektor {{LoopBack}} \"{0}\" nie jest zainstalowany jako żaden z następujących modułów:\n\n {1}\n\nAby to naprawić, uruchom komendę:\n\n {{npm install {2} --save}}\n",
"3864f9be10f27723074566d2b3893514": "Ostrzeżenie: model {0}, {{strict mode: `throw`}}, został usunięty, zamiast niego użyj modelu {{`strict: true`}}, który zwraca {{`Validation Error`}} dla nieznanych właściwości,",
"38dbf42c29a4645238cc3d632e88ebc9": "Model {{Relation.modelTo}} nie został zdefiniowany dla relacji {0} i nie jest {{polymorphic}}",
"3cde8cc9bca22c67278b202ab0720106": "Nie znaleziono instancji o identyfikatorze {0} dla {1}",
"416dfbb7b823f51c9f3800be81060b41": "Nie znaleziono instancji o identyfikatorze {{id}} {0} dla {1}",
"49b5afd8c6a19ad9c8abeffb2f8114eb": "Metoda BelongsTo \"getAsync()\" jest nieaktualna, zamiast niej użyj metody \"get()\".",
"4c78325cedbb826db3a05bf5df0e8546": "Podczas zastępowania należy podać {{id}}!",
"4e31b1edd10dadb724d83387de0b5062": "Parametr {{limit}} {0} jest niepoprawny",
"514985b2327f061ffb1c932f6b909979": "Model {0} nie jest zdefiniowany.",
"525c856e65daab43be247e7b5410febd": "Relacja {{polymorphic}} {0}: {1} nie oczekuje parametru `polymorphic.selector` podczas definiowania niestandardowego obiektu `foreignKey`/`discriminator` ",
"5c18ee111dd87540cdb19a2a93b33be9": "Transakcja została wycofana z powodu przekroczenia limitu czasu",
"5ec7e6664256f7ea78f4f06dafc7d974": "Transakcja nie jest gotowa, poczekaj na rozstrzygnięcie zwróconej obietnicy",
"5ec8efeb715a2c34b440f2d76e2cf87d": " {0}",
"6111399276924ffa3bc9a410cdfcb2e5": "Brak nazwy {{id}} {0}",
"614e3355647e4127c96256102dc63376": "Właściwość {0} ma niepoprawną klauzulę {1}: oczekiwano łańcucha lub wyrażenia regularnego",
"62a2d80c405b7fec5f547c448ab1b6ff": "{{order}} {0} ma niepoprawny kierunek",
"6502a117987610380b9068ef98b1b0ee": "Nie znaleziono rekordu w {0} dla ({1}.{2}, {3}.{4})",
"67c2bf43b5281ab929617423ea8a6f3e": "Konektor {0} nie obsługuje operacji {{replaceById}}. To nie jest błąd aplikacji LoopBack. Skontaktuj się z autorami konektora, najlepiej za pośrednictwem sekcji serwisu GitHub poświęconej problemom.",
"6c3234937d69763fc7f6bcafccc59bbc": "{{Model::deleteById}} wymaga argumentu {{id}}",
"6eb6fd4fbd73394000bc25f5776fd20c": "{{Model::exists}} wymaga argumentu {{id}}",
"6fcc2ff0db7a4f490f5e0ce9e24691f3": "Relacja {{HasOne}} nie może tworzyć więcej niż jednej instancji elementu {0}",
"728232e473bf80272c042df2b7e002f4": "Relacja {{polymorphic}} {0}: {1} wymaga parametru `polymorphic.discriminator`, jeśli określono parametr `polymorphic.foreignKey`",
"791ab3031a73ede03f7d6299a85e8289": "Przekroczono limit czasu połączenia po {0} ms",
"7b277018e43d41bc445731092b91547d": "Nie połączono",
"7bbbdece4eea90e42aa5c0bce295e503": "{{Model::findById}} wymaga argumentu {{id}}",
"7e9530c0399289be0ee601a604be71ff": "Relacja {{BelongsTo}} {0} jest pusta",
"7faa840eb6ce11250a141deb42a6c489": "Nieznana relacja {{scope}}: {0}",
"8091838319a5cc7d6a34af2f2a616ce9": "Nazwą właściwości nie może być \"{{constructor}}\" w modelu: {0}",
"881e4b0cb86ed59549248ee540a9fd10": "Nazwa właściwości \"{{constructor}}\" nie jest dozwolona w danych {0}",
"89afd3a9249f5a8d3edda07d84ca049d": "Model {{Polymorphic}} nie został znaleziony: `{0}`",
"89bf6d92731fe7bd2146ce8d0bec205c": "Niepoprawny argument; musi to być łańcuch, literał {{regex}} lub obiekt {{RegExp}}",
"8a39126103a157f501affa070367a1b0": "Instancja {0} nie jest poprawna. Szczegóły: {1}.",
"8c5ab01638c1ac1d58168c6346a8481a": "Niepoprawne flagi {{regex}}: {0}",
"938401ea4ce48159efa9be1d4a5e8bab": "Elementy muszą być tablicą: {0}",
"9e1f143ee02946324d34da92f71bf74e": "Relacja {0}: {1} wymaga parametru `model`",
"a004f310d315e592843776fab964eaeb": "Relacje {{Polymorphic}} wymagają modelu pośredniego",
"a0cf0e09c26df14283223e84e6a10f00": "Nie można zaktualizować atrybutów. Obiekt {{Object}} o identyfikatorze {{id}} {0} nie istnieje!",
"a2487abefef4259c2131d96cdb8543b1": "Nawiązanie połączenia nie powiodło się: {0}\nZostanie podjęta ponowna próba wykonania następnego żądania.",
"a25e41a39c60c4702e55d0c3936576a1": "Niezgodność klucza: {0}.{1}: {2}, {3}.{4}: {5}",
"a327355560d495454fba2c1aad6bdf09": "Nieznana metoda zasięgu: {0}",
"a6c18a7f4390cd3d59a2a7a047ae2aab": "Uruchom komendę \"{{npm install loopback-datasource-juggler}} {0}\"",
"a829dee089c912e68c18920ba015400c": "OSTRZEŻENIE: właściwość {{id}} nie może zostać zmieniona z {0} na {1} dla modelu: {2} w haku operacji {{'loaded'}}",
"a984a076c59e451948b2bcf7a393d860": "OSTRZEŻENIE: właściwość {{id}} nie może zostać zmieniona z {0} na {1} dla modelu: {2} w haku operacji {{'before save'}}",
"ac04cf275b71c1eb89a41cf6bbad7a64": "Metoda HasOne \"getAsync()\" jest nieaktualna, zamiast niej użyj metody \"get()\".",
"b138294f132edfe1eb2a8211150c7238": "Nieoczekiwany element `undefined` w zapytaniu",
"b15b20280211ad258d92947f05b6e4a5": "Konektor nie został zainicjowany.",
"b278876ec93ef9760f00e83f38ba313d": "Metoda Scope \"getAsync()\" jest nieaktualna, zamiast niej użyj metody \"find()\".",
"ba0fd8106eb54de4d003a844206431fd": "Hak modelu \"{0}\" jest nieaktualny, zamiast niego użyj haków operacji. {{http://docs.strongloop.com/display/LB/Operation+hooks}}",
"baf2c8b0c5a574b8a894e9b6304fece1": "Klauzula where {0} nie jest obiektem {{object}}",
"bdb11cc1c780c9ccac33c316cfdc9d82": "Nie zdefiniowano typu dla właściwości {0}.{1}",
"bdfb951c8ff7ce0cbc08c06f548fd927": "Wartość jest pustym elementem {{object}}",
"bec226891a505828bfc76c5cfd73b336": "Nie można uzyskać wartości TTL dla nieznanego klucza {0}",
"cd930369e86cdd222f7bd117c6f9fa94": "Nieznany dostawca wartości domyślnych {0}",
"cfee4d8149316d9a647c0885cf3cafaf": "Nazwy właściwości zawierające kropki nie są obsługiwane. Model: {0}, właściwość dynamiczna: {1}",
"d40328eabd8756d795bcdd49d782d4e9": "Źródło danych nie obsługuje transakcji",
"da02dd6c53d4148320eeb31718a7aebe": "Niepoprawny typ właściwości {0}",
"da751a8a748adbde5b55fa83b707b4e2": "Nazwy właściwości zawierające kropki nie są obsługiwane. Model: {0}, właściwość: {1}",
"db03083e9a768388fdbee865249ac67a": "Ignorowanie błędów sprawdzania poprawności w metodzie {{updateOrCreate()}}:",
"dd63416d9b7d9fa4181e89efd619dfd8": "Wartość nie jestem elementem {{array}} lub {{object}} z sekwencyjnymi indeksami liczbowymi",
"ddf0aa14803f1c84f4a97f3803f7471c": "Nazwa klasy jest wymagana",
"e08ab0e1ab55f26c357061447b635905": "Nie znaleziono relacji w {0} dla ({1}.{2}.{3}.{4})",
"e0e9504e137a3c3339144b51ed76fef2": "Konektor nie został poprawnie zdefiniowany: powinien utworzyć element '{{connector}}' źródła danych",
"e2f282cbe3efba001d6d3a09f7f6ca8c": "Relacja {{polymorphic}} {0}: {1} wymaga parametru `polymorphic.foreignKey`, jeśli określono parametr `polymorphic.discriminator`",
"e39e0f5d52bfbf511e645d19ecadd2fa": "Właściwość {0} ma niepoprawną klauzulę {1}: {2}",
"e4434de4bb8f5a3cd1d416e4d80d7e0b": "Nieznany identyfikator {{id}} \"{0}\" \"{1}\".",
"e54d944c2a2c85a23caa86027ae307cf": "Nie można migrować modeli, które nie są przyłączone do tego źródła danych: {0}",
"e54f118a75e15e132f16b985274eb46d": "Filtr zapytania {0} nie jest obiektem {{object}}",
"e55937649d8d7a11706b8cec22d02eae": "Relacja {{HasOne}} {0} jest pusta",
"e6161ae8459c79d810e2aa9d21282a39": "Podczas aktualizowania atrybutów należy podać identyfikator {{id}}!",
"eb56c2b0c30cf006e2df00a549ec9c2c": "Relacja \"{0}\" nie została zdefiniowana dla modelu {1}",
"ec42dca074f1818c447f7ad16e2d01af": "Element {0} nie został udostępniony przez przyłączony konektor",
"ecb7aa804bf54c682999d20d6436104c": "Transakcja {{transaction}} nie jest aktywna: {0}",
"f30809cb932b72a66416a709c8531530": "Metoda {{method}} w transakcji nie jest obsługiwana przez konektor",
"f41bd91dc0f000a79c0bf842f1b7fdf9": "nie można utworzyć listy z łańcucha JSON: {0}",
"f6e8c96c93b9c7687d6c172b3695e898": "Właściwość {{id}} ({0}) nie może zostać zaktualizowana z {1} na {2}",
"fa9ae17e8e008d0eb0f0421a2972308c": "Relacja {{polymorphic}} {0}: {1} wymaga parametru `model`",
"fca4d12faff1035d9d0438d73432571b": "Zduplikowany wpis dla {0}.{1}",
"fd3cc89dc67e2d604eaae21bdf41d403": "Nie można znaleźć relacji {0} dla modelu {1}",
"fec8ebda24db46a9d040bf863765cc44": "Operator {0} zawiera niepoprawne klauzule {1}: {2}"
}

View File

@ -1,97 +1,80 @@
{
"0483a77cf77741504204e5c066597487": "Relação {{polymorphic}} de {0}: {1} não espera o parâmetro 'polymorphic.as' ao definir 'foreignKey'/'discriminator' customizado ",
"09483e03b91c8bd58732a74b3ef1ec13": "Data inválida: {0}",
"0a5aa17f7866a85e3aee37ef5369403c": "LinkManyToMany recebeu destino que não contém \"{0}\" necessário",
"0b16d3ffc42f91b4b9a4b3b50c41c838": "A ordem {0} não é válida",
"0bd753a8944ad0af85a939bb25273887": "Não é possível expirar chave desconhecida {0}",
"0c0b867aca0973ba26e887d3337cc4ec": "Modelo de {{Polymorphic}} não localizado: `{0}` não configurado",
"0c4eb8b6c2ff6e51d7e195eee346ced9": "A tabela '{0}' não existe.",
"0ff31abb394afb555df162e74ff1a0a0": "{{id}} não pode ser atualizado de {0} para {1} quando {{forceId}} é configurado como true",
"1ae7d3e0be381efb32bfd1ba652f5172": "AVISO: relação {{polymorphic}} de {0}: {1} usa a palavra-chave 'polymorphic.as', que será DESCONTINUADA em LoopBack.next; consulte este doc para obter soluções de substituição (https://loopback.io/doc/en/lb3/Polymorphic-relations.html#deprecated-polymorphic-as)",
"1daef4e937fe52136597ba8fd2060f55": "Transações aninhadas não são suportadas",
"21095484501dbff31af6556fa6039182": "O parâmetro {{offset/skip}} {0} não é válido",
"280f4550f90e133118955ec6f6f72830": "Tipo de discriminador {0} especificado, mas não existe nenhum modelo com esse nome",
"28697ec15968a7969211f6d035ba9260": "Relação {{polymorphic}} de {0}: {1} não espera o parâmetro 'model'",
"2c4904377a87fdab502118719cc0d266": "{{Transaction}} não é suportada",
"2c5c8519721f749aab13c2f04f41d611": "A propriedade {0} possui cláusula inválida {1}: esperado exatamente 2 valores, recebidos {2}",
"2f4af31c144bbfab1bbf479866acd820": "\nAVISO: conector {{LoopBack}} \"{0}\" não foi instalado como qualquer um dos módulos a seguir:\n\n {1}\n\nPara corrigir, execute:\n\n {{npm install {2} --save}}\n",
"3864f9be10f27723074566d2b3893514": "Aviso: o modelo {0}, {{strict mode: `throw`}} foi removido, use {{`strict: true`}} no lugar, que retorna {{`Validation Error`}} para as propriedades desconhecidas,",
"38dbf42c29a4645238cc3d632e88ebc9": "{{Relation.modelTo}} não foi definido para a relação {0} e não é {{polymorphic}}",
"3cde8cc9bca22c67278b202ab0720106": "Nenhuma instância com ID {0} localizada para {1}",
"416dfbb7b823f51c9f3800be81060b41": "Nenhuma instância com {{id}} {0} localizada para {1}",
"49b5afd8c6a19ad9c8abeffb2f8114eb": "O método BelongsTo \"getAsync()\" está descontinuado, use \"get()\" em vez disso.",
"bec226891a505828bfc76c5cfd73b336": "Não é possível obter TTL para chave desconhecida {0}",
"4c78325cedbb826db3a05bf5df0e8546": "Deve-se fornecer um {{id}} ao substituir!",
"a0cf0e09c26df14283223e84e6a10f00": "Não foi possível atualizar atributos. {{Object}} com {{id}} {0} não existe!",
"e54d944c2a2c85a23caa86027ae307cf": "Não é possível migrar modelos não conectados a esta origem de dados: {0}",
"e6161ae8459c79d810e2aa9d21282a39": "Deve-se fornecer um {{id}} ao atualizar atributos!",
"fca4d12faff1035d9d0438d73432571b": "Entrada duplicada para {0}.{1}",
"09483e03b91c8bd58732a74b3ef1ec13": "Data inválida: {0}",
"0b16d3ffc42f91b4b9a4b3b50c41c838": "A ordem {0} não é válida",
"0ff31abb394afb555df162e74ff1a0a0": "{{id}} não pode ser atualizado de {0} para {1} quando {{forceId}} é configurado como true",
"21095484501dbff31af6556fa6039182": "O parâmetro {{offset/skip}} {0} não é válido",
"2c5c8519721f749aab13c2f04f41d611": "A propriedade {0} possui cláusula inválida {1}: esperado exatamente 2 valores, recebidos {2}",
"416dfbb7b823f51c9f3800be81060b41": "Nenhuma instância com {{id}} {0} localizada para {1}",
"4e31b1edd10dadb724d83387de0b5062": "O parâmetro {0} de {{limit}} não é válido",
"514985b2327f061ffb1c932f6b909979": "O modelo {0} não está definido.",
"525c856e65daab43be247e7b5410febd": "Relação {{polymorphic}} de {0}: {1} não espera o parâmetro 'polymorphic.selector' ao definir 'foreignKey'/'discriminator' customizado ",
"5c18ee111dd87540cdb19a2a93b33be9": "A transação é recuperada devido à transcorrência do tempo limite",
"5ec7e6664256f7ea78f4f06dafc7d974": "A transação não está pronta, aguarde a promessa retornada para resolver",
"5ec8efeb715a2c34b440f2d76e2cf87d": " {0}",
"6111399276924ffa3bc9a410cdfcb2e5": "Nenhum nome de {{id}} {0}",
"614e3355647e4127c96256102dc63376": "A propriedade {0} possui cláusula inválida {1}: esperada uma sequência ou um RegExp",
"62a2d80c405b7fec5f547c448ab1b6ff": "A {{order}} {0} possui direção inválida",
"6502a117987610380b9068ef98b1b0ee": "Nenhum registro encontrado em {0} para ({1}.{2} ,{3}.{4})",
"67c2bf43b5281ab929617423ea8a6f3e": "O conector {0} não suporta operação {{replaceById}}. Este não é um erro no LoopBack. Entre em contato com os autores do conector, de preferência via problemas do GitHub.",
"6c3234937d69763fc7f6bcafccc59bbc": "{{Model::deleteById}} requer o argumento {{id}}",
"6eb6fd4fbd73394000bc25f5776fd20c": "{{Model::exists}} requer o argumento {{id}}",
"6fcc2ff0db7a4f490f5e0ce9e24691f3": "A relação {{HasOne}} não pode criar mais de uma instância de {0}",
"728232e473bf80272c042df2b7e002f4": "Relação {{polymorphic}} de {0}: {1} requer o parâmetro 'polymorphic.discriminator' quando o parâmetro 'polymorphic.foreignKey' é fornecido",
"791ab3031a73ede03f7d6299a85e8289": "Tempo limite na conexão após {0} ms",
"7b277018e43d41bc445731092b91547d": "Não está conectado",
"7bbbdece4eea90e42aa5c0bce295e503": "{{Model::findById}} requer o argumento {{id}}",
"7e9530c0399289be0ee601a604be71ff": "Relação {{BelongsTo}} {0} está vazia",
"7faa840eb6ce11250a141deb42a6c489": "{{scope}} da relação desconhecido: {0}",
"8091838319a5cc7d6a34af2f2a616ce9": "O nome da propriedade não deve ser \"{{constructor}}\" no Modelo: {0}",
"881e4b0cb86ed59549248ee540a9fd10": "O nome da propriedade \"{{constructor}}\" não é permitido nos dados de {0}",
"89afd3a9249f5a8d3edda07d84ca049d": "Modelo de {{Polymorphic}} não localizado: `{0}`",
"89bf6d92731fe7bd2146ce8d0bec205c": "Argumento inválido, deve ser uma sequência, literal {{regex}} ou objeto {{RegExp}}",
"8a39126103a157f501affa070367a1b0": "A instância de {0} não é válida. Detalhes: {1}.",
"8c5ab01638c1ac1d58168c6346a8481a": "Sinalizações de {{regex}} inválidas: {0}",
"938401ea4ce48159efa9be1d4a5e8bab": "Itens devem ser uma matriz: {0}",
"9e1f143ee02946324d34da92f71bf74e": "Relação de {0}: {1} requer o parâmetro 'model'",
"a004f310d315e592843776fab964eaeb": "Relações de {{Polymorphic}} precisam de um modelo completo",
"a0cf0e09c26df14283223e84e6a10f00": "Não foi possível atualizar atributos. {{Object}} com {{id}} {0} não existe!",
"a2487abefef4259c2131d96cdb8543b1": "Falha de conexão: {0}\nEla será tentada novamente para a próxima solicitação.",
"a25e41a39c60c4702e55d0c3936576a1": "Incompatibilidade de chaves: {0}.{1}: {2}, {3}.{4}: {5}",
"a327355560d495454fba2c1aad6bdf09": "Método de escopo desconhecido: {0}",
"a6c18a7f4390cd3d59a2a7a047ae2aab": "Execute o comando \"{{npm install loopback-datasource-juggler}} {0}\" ",
"a829dee089c912e68c18920ba015400c": "AVISO: a propriedade {{id}} não pode ser mudada de {0} para {1} para o modelo:{2} no gancho de operação {{'loaded'}}",
"a984a076c59e451948b2bcf7a393d860": "AVISO: a propriedade {{id}} não pode ser mudada de {0} para {1} para o modelo:{2} no gancho de operação {{'before save'}}",
"ac04cf275b71c1eb89a41cf6bbad7a64": "O método HasOne \"getAsync()\" está descontinuado, use \"get()\" em vez disso.",
"b138294f132edfe1eb2a8211150c7238": "`Indefinido` inesperado na consulta",
"b15b20280211ad258d92947f05b6e4a5": "O conector não foi inicializado.",
"b278876ec93ef9760f00e83f38ba313d": "O método Scope \"getAsync()\" está descontinuado, use \"find()\" em vez disso.",
"ba0fd8106eb54de4d003a844206431fd": "O gancho de modelo \"{0}\" está descontinuado, use ganchos de Operação no lugar. {{http://docs.strongloop.com/display/LB/Operation+hooks}}",
"baf2c8b0c5a574b8a894e9b6304fece1": "A cláusula where {0} não é um {{object}}",
"bdb11cc1c780c9ccac33c316cfdc9d82": "Tipo não definido para a propriedade {0}.{1}",
"bdfb951c8ff7ce0cbc08c06f548fd927": "O valor é um {{object}} vazio",
"bec226891a505828bfc76c5cfd73b336": "Não é possível obter TTL para chave desconhecida {0}",
"cd930369e86cdd222f7bd117c6f9fa94": "Provedor do valor padrão {0} desconhecido",
"cfee4d8149316d9a647c0885cf3cafaf": "Nomes da propriedade contendo pontos não são suportados. Modelo: {0}, propriedade dinâmica: {1}",
"d40328eabd8756d795bcdd49d782d4e9": "A Origem de Dados não suporta transações",
"da02dd6c53d4148320eeb31718a7aebe": "Tipo inválido para a propriedade {0}",
"da751a8a748adbde5b55fa83b707b4e2": "Nomes da propriedade contendo pontos não são suportados. Modelo: {0}, propriedade: {1}",
"db03083e9a768388fdbee865249ac67a": "Ignorando erros de validação em {{updateOrCreate()}}:",
"dd63416d9b7d9fa4181e89efd619dfd8": "O valor não é um {{array}} ou {{object}} com índices numéricos sequenciais",
"ddf0aa14803f1c84f4a97f3803f7471c": "Nome de classe necessário",
"e08ab0e1ab55f26c357061447b635905": "Nenhuma relação encontrada em {0} para ({1}.{2},{3}.{4})",
"e0e9504e137a3c3339144b51ed76fef2": "O conector não foi definido corretamente: ele deve criar um membro de `{{connector}}` igual a dataSource",
"e2f282cbe3efba001d6d3a09f7f6ca8c": "Relação {{polymorphic}} de {0}: {1} requer o parâmetro 'polymorphic.foreignKey' quando o parâmetro 'polymorphic.discriminator' é fornecido",
"e39e0f5d52bfbf511e645d19ecadd2fa": "A propriedade {0} possui cláusula inválida {1}: {2}",
"e4434de4bb8f5a3cd1d416e4d80d7e0b": "\"{0}\" {{id}} \"{1}\" desconhecido.",
"e54d944c2a2c85a23caa86027ae307cf": "Não é possível migrar modelos não conectados a esta origem de dados: {0}",
"e54f118a75e15e132f16b985274eb46d": "O filtro de consulta {0} não é um {{object}}",
"e55937649d8d7a11706b8cec22d02eae": "Relação {{HasOne}} {0} está vazia",
"e6161ae8459c79d810e2aa9d21282a39": "Deve-se fornecer um {{id}} ao atualizar atributos!",
"eb56c2b0c30cf006e2df00a549ec9c2c": "A relação \"{0}\" não foi definida para o modelo {1}",
"ec42dca074f1818c447f7ad16e2d01af": "{0} não é fornecido pelo conector conectado",
"ecb7aa804bf54c682999d20d6436104c": "A {{transaction}} não está ativa: {0}",
"f30809cb932b72a66416a709c8531530": "O conector não suporta {{method}} dentro de uma transação",
"f41bd91dc0f000a79c0bf842f1b7fdf9": "não foi possível criar Lista a partir da sequência JSON: {0}",
"f6e8c96c93b9c7687d6c172b3695e898": "A propriedade de {{id}} ({0}) não pode ser atualizada de {1} para {2}",
"fa9ae17e8e008d0eb0f0421a2972308c": "Relação {{polymorphic}} de {0}: {1} requer o parâmetro 'model'",
"fca4d12faff1035d9d0438d73432571b": "Entrada suplicada para {0}.{1}",
"fd3cc89dc67e2d604eaae21bdf41d403": "Não foi possível localizar a relação {0} para o modelo {1}",
"fec8ebda24db46a9d040bf863765cc44": "O operador {0} possui cláusulas inválidas {1}: {2}"
"fec8ebda24db46a9d040bf863765cc44": "O operador {0} possui cláusulas inválidas {1}: {2}",
"0be2d39d225b1d8b2a0f92ad5c65c9ac": "Nenhum modelo especificado para {{polymorphic}} {0}: {1}",
"0c4eb8b6c2ff6e51d7e195eee346ced9": "A tabela '{0}' não existe.",
"2f4af31c144bbfab1bbf479866acd820": "\nAVISO: conector {{LoopBack}} \"{0}\" não foi instalado como qualquer um dos módulos a seguir:\n\n {1}\n\nPara corrigir, execute:\n\n {{npm install {2} --save}}\n",
"6111399276924ffa3bc9a410cdfcb2e5": "Nenhum nome de {{id}} {0}",
"791ab3031a73ede03f7d6299a85e8289": "Tempo limite na conexão após {0} ms",
"7b277018e43d41bc445731092b91547d": "Não está conectado",
"a2487abefef4259c2131d96cdb8543b1": "Falha de conexão: {0}\nEla será tentada novamente para a próxima solicitação.",
"b15b20280211ad258d92947f05b6e4a5": "O conector não foi inicializado.",
"ddf0aa14803f1c84f4a97f3803f7471c": "Nome de classe necessário",
"e0e9504e137a3c3339144b51ed76fef2": "O conector não foi definido corretamente: ele deve criar um membro de `{{connector}}` igual a dataSource",
"ec42dca074f1818c447f7ad16e2d01af": "{0} não é fornecido pelo conector conectado",
"ba0fd8106eb54de4d003a844206431fd": "O gancho de modelo \"{0}\" está descontinuado, use ganchos de Operação no lugar. {{http://docs.strongloop.com/display/LB/Operation+hooks}}",
"280f4550f90e133118955ec6f6f72830": "Tipo de discriminador {0} especificado, mas não existe nenhum modelo com esse nome",
"38dbf42c29a4645238cc3d632e88ebc9": "{{Relation.modelTo}} não foi definido para a relação {0} e não é {{polymorphic}}",
"eb56c2b0c30cf006e2df00a549ec9c2c": "A relação \"{0}\" não foi definida para o modelo {1}",
"938401ea4ce48159efa9be1d4a5e8bab": "Itens devem ser uma matriz: {0}",
"f41bd91dc0f000a79c0bf842f1b7fdf9": "não foi possível criar Lista a partir da sequência JSON: {0}",
"514985b2327f061ffb1c932f6b909979": "O modelo {0} não está definido.",
"8091838319a5cc7d6a34af2f2a616ce9": "O nome da propriedade não deve ser \"{{constructor}}\" no Modelo: {0}",
"da02dd6c53d4148320eeb31718a7aebe": "Tipo inválido para a propriedade {0}",
"da751a8a748adbde5b55fa83b707b4e2": "Nomes da propriedade contendo pontos não são suportados. Modelo: {0}, propriedade: {1}",
"3864f9be10f27723074566d2b3893514": "Aviso: o modelo {0}, {{strict mode: `throw`}} foi removido, use {{`strict: true`}} no lugar, que retorna {{`Validation Error`}} para as propriedades desconhecidas,",
"881e4b0cb86ed59549248ee540a9fd10": "O nome da propriedade \"{{constructor}}\" não é permitido nos dados de {0}",
"bdb11cc1c780c9ccac33c316cfdc9d82": "Tipo não definido para a propriedade {0}.{1}",
"cd930369e86cdd222f7bd117c6f9fa94": "Provedor do valor padrão {0} desconhecido",
"cfee4d8149316d9a647c0885cf3cafaf": "Nomes da propriedade contendo pontos não são suportados. Modelo: {0}, propriedade dinâmica: {1}",
"0c0b867aca0973ba26e887d3337cc4ec": "Modelo de {{Polymorphic}} não localizado: `{0}` não configurado",
"2f062cbecdf24245731bddc77714c814": "Não foi possível localizar relação de \"{0}\" para {1}",
"3cde8cc9bca22c67278b202ab0720106": "Nenhuma instância com ID {0} localizada para {1}",
"6502a117987610380b9068ef98b1b0ee": "Nenhum registro localizado em {0} para ({1}.{2} ,{3}.{4})",
"6fcc2ff0db7a4f490f5e0ce9e24691f3": "A relação {{HasOne}} não pode criar mais de uma instância de {0}",
"7e9530c0399289be0ee601a604be71ff": "Relação {{BelongsTo}} {0} está vazia",
"7faa840eb6ce11250a141deb42a6c489": "{{scope}} da relação desconhecido: {0}",
"89afd3a9249f5a8d3edda07d84ca049d": "Modelo de {{Polymorphic}} não localizado: `{0}`",
"a004f310d315e592843776fab964eaeb": "Relações de {{Polymorphic}} precisam de um modelo completo",
"a25e41a39c60c4702e55d0c3936576a1": "Incompatibilidade de chave: {0}.{1}: {2}, {3}.{4}: {5}",
"a327355560d495454fba2c1aad6bdf09": "Método de escopo desconhecido: {0}",
"e08ab0e1ab55f26c357061447b635905": "Nenhuma relação localizada em {0} para ({1}.{2},{3}.{4})",
"e55937649d8d7a11706b8cec22d02eae": "Relação {{HasOne}} {0} está vazia",
"2c4904377a87fdab502118719cc0d266": "{{Transaction}} não é suportada",
"ecb7aa804bf54c682999d20d6436104c": "A {{transaction}} não está ativa: {0}",
"89bf6d92731fe7bd2146ce8d0bec205c": "Argumento inválido, deve ser uma sequência, literal {{regex}} ou objeto {{RegExp}}",
"8c5ab01638c1ac1d58168c6346a8481a": "Sinalizações de {{regex}} inválidas: {0}",
"a6c18a7f4390cd3d59a2a7a047ae2aab": "Execute o comando \"{{npm install loopback-datasource-juggler}} {0}\" ",
"b138294f132edfe1eb2a8211150c7238": "`Indefinido` inesperado na consulta",
"8a39126103a157f501affa070367a1b0": "A instância de {0} não é válida. Detalhes: {1}."
}

View File

@ -1,97 +0,0 @@
{
"0483a77cf77741504204e5c066597487": "Связь {0} {{polymorphic}}: {1} не предполагает параметр `polymorphic.as` при определении пользовательского атрибута `foreignKey`/`discriminator` ",
"09483e03b91c8bd58732a74b3ef1ec13": "Недопустимая дата: {0}",
"0a5aa17f7866a85e3aee37ef5369403c": "LinkManyToMany полученный целевой объект не содержит обязательный параметр \"{0}\"",
"0b16d3ffc42f91b4b9a4b3b50c41c838": "Недопустимый порядок {0}",
"0bd753a8944ad0af85a939bb25273887": "Не удалось преобразовать неизвестный ключ {0} в устаревший",
"0c0b867aca0973ba26e887d3337cc4ec": "Модель {{Polymorphic}} не найдена: не задан параметр `{0}`",
"0c4eb8b6c2ff6e51d7e195eee346ced9": "Таблица '{0}' не существует.",
"0ff31abb394afb555df162e74ff1a0a0": "Для {{id}} не удается изменить значение {0} на {1}, если параметру {{forceId}} присвоено значение true",
"1ae7d3e0be381efb32bfd1ba652f5172": "ПРЕДУПРЕЖДЕНИЕ: связь {0} {{polymorphic}}: {1} использует ключевое слово `polymorphic.as`, которое УСТАРЕЕТ в LoopBack.next. Решение по замене приведены в следующем документе: (https://loopback.io/doc/en/lb3/Polymorphic-relations.html#deprecated-polymorphic-as)",
"1daef4e937fe52136597ba8fd2060f55": "Вложенные транзакции не поддерживаются",
"21095484501dbff31af6556fa6039182": "Параметр {{offset/skip}} {0} недопустим",
"280f4550f90e133118955ec6f6f72830": "Указан тип дискриминатора {0}, но модель с таким именем не существует",
"28697ec15968a7969211f6d035ba9260": "Связь {0} {{polymorphic}}: в {1} не используется параметр `model`",
"2c4904377a87fdab502118719cc0d266": "{{Transaction}} не поддерживается",
"2c5c8519721f749aab13c2f04f41d611": "Свойство {0} содержит недопустимый оператор {1}: требуется ровно 2 значения, но получено {2}",
"2f4af31c144bbfab1bbf479866acd820": "\nПРЕДУПРЕЖДЕНИЕ: Коннектор {{LoopBack}} \"{0}\" не установлен как один из следующих модулей:\n\n {1}\n\nДля исправления этой ошибки выполните следующую команду:\n\n {{npm install {2} --save}}\n",
"3864f9be10f27723074566d2b3893514": "Предупреждение: Модель {0} {{strict mode: `throw`}} была удалена, используйте вместо нее {{`strict: true`}}, возвращающий для неизвестных свойств значение {{`Validation Error`}},",
"38dbf42c29a4645238cc3d632e88ebc9": "Параметр {{Relation.modelTo}} не определен для связи {0} и не является {{polymorphic}}",
"3cde8cc9bca22c67278b202ab0720106": "Не найден экземпляр с ИД {0} для {1}",
"416dfbb7b823f51c9f3800be81060b41": "Не найден экземпляр с {{id}} {0} для {1}",
"49b5afd8c6a19ad9c8abeffb2f8114eb": "Метод BelongsTo \"getAsync()\" устарел, используйте вместо него \"get()\".",
"4c78325cedbb826db3a05bf5df0e8546": "При замене необходимо указать {{id}}!",
"4e31b1edd10dadb724d83387de0b5062": "Параметр {{limit}} {0} недопустим",
"514985b2327f061ffb1c932f6b909979": "Модель {0} не определена.",
"525c856e65daab43be247e7b5410febd": "Связь {0} {{polymorphic}}: {1} не предполагает параметр `polymorphic.selector` при определении пользовательского атрибута `foreignKey`/`discriminator` ",
"5c18ee111dd87540cdb19a2a93b33be9": "Выполнен откат транзакции из-за тайм-аута",
"5ec7e6664256f7ea78f4f06dafc7d974": "Транзакция не готова, дождитесь возвращенного обязательства устранить неполадку",
"5ec8efeb715a2c34b440f2d76e2cf87d": " {0}",
"6111399276924ffa3bc9a410cdfcb2e5": "Отсутствует имя {{id}} {0}",
"614e3355647e4127c96256102dc63376": "Свойство {0} содержит недопустимый оператор {1}: ожидается строка или регулярное выражение",
"62a2d80c405b7fec5f547c448ab1b6ff": "Недопустимое направление {{order}} {0}",
"6502a117987610380b9068ef98b1b0ee": "В {0} не обнаружены записи для ({1}.{2} ,{3}.{4})",
"67c2bf43b5281ab929617423ea8a6f3e": "Коннектор {0} не поддерживает операцию {{replaceById}}. Это не является ошибкой LoopBack. Обратитесь к авторам коннектора, желательно через раздел ошибок на GitHub.",
"6c3234937d69763fc7f6bcafccc59bbc": "Для {{Model::deleteById}} требуется аргумент {{id}}",
"6eb6fd4fbd73394000bc25f5776fd20c": "Для {{Model::exists}} требуется аргумент {{id}}",
"6fcc2ff0db7a4f490f5e0ce9e24691f3": "Связи {{HasOne}} не удается создать больше одного экземпляра {0}",
"728232e473bf80272c042df2b7e002f4": "Связь {0} {{polymorphic}}: для {1} требуется параметр `polymorphic.discriminator`, если задан параметр `polymorphic.foreignKey`",
"791ab3031a73ede03f7d6299a85e8289": "Тайм-аут соединения наступает через {0} мс",
"7b277018e43d41bc445731092b91547d": "Не подключено",
"7bbbdece4eea90e42aa5c0bce295e503": "Для {{Model::findById}} требуется аргумент {{id}}",
"7e9530c0399289be0ee601a604be71ff": "Пустая связь {{BelongsTo}} {0}",
"7faa840eb6ce11250a141deb42a6c489": "Неизвестная связь {{scope}}: {0}",
"8091838319a5cc7d6a34af2f2a616ce9": "Имя свойства не должно быть \"{{constructor}}\" в модели: {0}",
"881e4b0cb86ed59549248ee540a9fd10": "Имя свойства \"{{constructor}}\" не разрешено в данных {0}",
"89afd3a9249f5a8d3edda07d84ca049d": "Модель {{Polymorphic}} не найдена: `{0}`",
"89bf6d92731fe7bd2146ce8d0bec205c": "Недопустимый аргумент, требуется строка, литерал {{regex}} или объект {{RegExp}}",
"8a39126103a157f501affa070367a1b0": "Недопустимый экземпляр {0}. Сведения: {1}.",
"8c5ab01638c1ac1d58168c6346a8481a": "Недопустимые флаги {{regex}}: {0}",
"938401ea4ce48159efa9be1d4a5e8bab": "Элементы должны быть массивом: {0}",
"9e1f143ee02946324d34da92f71bf74e": "Связь {0}: для {1} требуется параметр `model`",
"a004f310d315e592843776fab964eaeb": "Связи {{Polymorphic}} требуется промежуточная модель",
"a0cf0e09c26df14283223e84e6a10f00": "Не удалось обновить атрибуты. {{Object}} с {{id}} {0} не существует",
"a2487abefef4259c2131d96cdb8543b1": "Соединение не выполнено: {0}\nПопытка соединения будет выполнена повторно при следующем запросе.",
"a25e41a39c60c4702e55d0c3936576a1": "Несоответствие ключей: {0}.{1}: {2}, {3}.{4}: {5}",
"a327355560d495454fba2c1aad6bdf09": "Неизвестный метод области: {0}",
"a6c18a7f4390cd3d59a2a7a047ae2aab": "Выполните команду \"{{npm install loopback-datasource-juggler}} {0}\" ",
"a829dee089c912e68c18920ba015400c": "Предупреждение: значение свойства {{id}} {0} не может быть изменено на {1} для модели {2} в перехватчике операции {{'loaded'}}",
"a984a076c59e451948b2bcf7a393d860": "Предупреждение: значение свойства {{id}} {0} не может быть изменено на {1} для модели {2} в перехватчике операции {{'before save'}}",
"ac04cf275b71c1eb89a41cf6bbad7a64": "Метод HasOne \"getAsync()\" устарел, используйте вместо него \"get()\".",
"b138294f132edfe1eb2a8211150c7238": "Непредвиденный параметр `undefined` в запросе",
"b15b20280211ad258d92947f05b6e4a5": "Коннектор не инициализирован.",
"b278876ec93ef9760f00e83f38ba313d": "Метод Scope \"getAsync()\" устарел, используйте вместо него \"find()\".",
"ba0fd8106eb54de4d003a844206431fd": "Перехватчик Model \"{0}\" устарел, используйте вместо него перехватчики Operation. {{http://docs.strongloop.com/display/LB/Operation+hooks}}",
"baf2c8b0c5a574b8a894e9b6304fece1": "Оператор where {0} не является объектом {{object}}",
"bdb11cc1c780c9ccac33c316cfdc9d82": "Не определен тип для свойства {0}.{1}",
"bdfb951c8ff7ce0cbc08c06f548fd927": "Значение - пустой объект {{object}}",
"bec226891a505828bfc76c5cfd73b336": "Не удалось получить TTL для неизвестного ключа {0}",
"cd930369e86cdd222f7bd117c6f9fa94": "Неизвестный поставщик значений по умолчанию {0}",
"cfee4d8149316d9a647c0885cf3cafaf": "Не поддерживаются имена свойств, содержащие точку. Модель: {0}, динамическое свойство: {1}",
"d40328eabd8756d795bcdd49d782d4e9": "DataSource не поддерживает транзакции",
"da02dd6c53d4148320eeb31718a7aebe": "Недопустимый тип для свойства {0}",
"da751a8a748adbde5b55fa83b707b4e2": "Не поддерживаются имена свойств, содержащие точку. Модель: {0}, свойство: {1}",
"db03083e9a768388fdbee865249ac67a": "Ошибки проверки в {{updateOrCreate()}} игнорируются:",
"dd63416d9b7d9fa4181e89efd619dfd8": "Значение не является {{array}} или {{object}} с последовательными числовыми индексами",
"ddf0aa14803f1c84f4a97f3803f7471c": "Необходимо указать имя класса",
"e08ab0e1ab55f26c357061447b635905": "В {0} не найдена связь для ({1}.{2},{3}.{4})",
"e0e9504e137a3c3339144b51ed76fef2": "Неправильно определен коннектор: он должен создавать элемент `{{connector}}` в dataSource",
"e2f282cbe3efba001d6d3a09f7f6ca8c": "Связь {0} {{polymorphic}}: для {1} требуется параметр `polymorphic.foreignKey`, если указан параметр `polymorphic.discriminator`",
"e39e0f5d52bfbf511e645d19ecadd2fa": "Свойство {0} содержит недопустимый оператор {1}: {2}",
"e4434de4bb8f5a3cd1d416e4d80d7e0b": "Неизвестный {{id}} \"{0}\" \"{1}\".",
"e54d944c2a2c85a23caa86027ae307cf": "Не удается перенести модели, которые не подключены к этому источнику данных: {0}",
"e54f118a75e15e132f16b985274eb46d": "Фильтр запроса {0} не является объектом {{object}}",
"e55937649d8d7a11706b8cec22d02eae": "Пустая связь {{HasOne}} {0}",
"e6161ae8459c79d810e2aa9d21282a39": "При обновлении атрибутов необходимо указать {{id}}",
"eb56c2b0c30cf006e2df00a549ec9c2c": "Связь \"{0}\" не определена для модели {1}",
"ec42dca074f1818c447f7ad16e2d01af": "Подключенный коннектор не указал {0}",
"ecb7aa804bf54c682999d20d6436104c": "Неактивная транзакция {{transaction}}: {0}",
"f30809cb932b72a66416a709c8531530": "Коннектор не поддерживает {{method}} в транзакции",
"f41bd91dc0f000a79c0bf842f1b7fdf9": "Не удалось создать атрибут List из строки JSON: {0}",
"f6e8c96c93b9c7687d6c172b3695e898": "Для свойства {{id}} ({0}) не удалось изменить значение {1} на {2}",
"fa9ae17e8e008d0eb0f0421a2972308c": "Связь {0} {{polymorphic}}: для {1} требуется параметр `model`",
"fca4d12faff1035d9d0438d73432571b": "Создать копию для {0}.{1}",
"fd3cc89dc67e2d604eaae21bdf41d403": "Не удалось найти связь {0} для модели {1}",
"fec8ebda24db46a9d040bf863765cc44": "Оператор {0} содержит недопустимые операторы {1}: {2}"
}

View File

@ -1,97 +1,80 @@
{
"0483a77cf77741504204e5c066597487": "{{polymorphic}} {0} ilişkisi: {1}, özel `foreignKey`/`discriminator` tanımlarken `polymorphic.as` parametresini beklemiyor ",
"09483e03b91c8bd58732a74b3ef1ec13": "Geçersiz tarih: {0}",
"0a5aa17f7866a85e3aee37ef5369403c": "LinkManyToMany, gerekli \"{0}\" öğesini içermeyen hedef aldı",
"0b16d3ffc42f91b4b9a4b3b50c41c838": "{0} sırası geçerli değil",
"0bd753a8944ad0af85a939bb25273887": "Bilinmeyen {0} anahtarı süre bitimine uğratılamaz",
"0c0b867aca0973ba26e887d3337cc4ec": "{{Polymorphic}} model bulunamadı: `{0}` ayarlı değil",
"0c4eb8b6c2ff6e51d7e195eee346ced9": "'{0}' tablosu yok",
"0ff31abb394afb555df162e74ff1a0a0": "{{id}}, {{forceId}} true olarak ayarlandığında {0} durumundan {1} durumuna güncellenemiyor",
"1ae7d3e0be381efb32bfd1ba652f5172": "UYARI: {{polymorphic}} {0} ilişkisi: {1}, LoopBack.next içinde KULLANIMDAN KALDIRILACAK `polymorphic.as` anahtar sözcüğünü kullanıyor; değiştirme çözümleri için bu belgeye bakın (https://loopback.io/doc/en/lb3/Polymorphic-relations.html#deprecated-polymorphic-as)",
"1daef4e937fe52136597ba8fd2060f55": "İç içe geçmiş işlemler desteklenmiyor",
"21095484501dbff31af6556fa6039182": "{{offset/skip}} parametresi {0} geçerli değil",
"280f4550f90e133118955ec6f6f72830": "{0} ayrımsayıcı tipi belirtildi, ancak bu adı taşıyan bir model yok",
"28697ec15968a7969211f6d035ba9260": "{{polymorphic}} {0} ilişkisi: {1}, `model` parametresini beklemiyor",
"2c4904377a87fdab502118719cc0d266": "{{Transaction}} desteklenmiyor",
"2c5c8519721f749aab13c2f04f41d611": "{0} özelliği geçersiz {1} yantümcesi içeriyor: Tam olarak 2 değer bekleniyor, {2} alındı",
"2f4af31c144bbfab1bbf479866acd820": "\nUYARI: {{LoopBack}} bağlayıcısı \"{0}\" şu modüllerden biri olarak kurulmadı:\n\n {1}\n\nDüzeltmek için şu komutu çalıştırın:\n\n {{npm install {2} --save}}\n",
"3864f9be10f27723074566d2b3893514": "Uyarı: {0} modeli, {{strict mode: `throw`}} kaldırıldı, lütfen bunun yerine bilinmeyen özellikler için {{`Validation Error`}} döndüren {{`strict: true`}} kullanın",
"38dbf42c29a4645238cc3d632e88ebc9": "{{Relation.modelTo}}, {0} ilişkisi için tanımlanmadı ve {{polymorphic}} değil",
"3cde8cc9bca22c67278b202ab0720106": "{1} için {0} tanıtıcılı bir eşgörünüm bulunamadı",
"416dfbb7b823f51c9f3800be81060b41": "{1} için {{id}} {0} tanıtıcılı bir eşgörünüm bulunamadı",
"49b5afd8c6a19ad9c8abeffb2f8114eb": "\"getAsync()\" BelongsTo yöntemi kullanımdan kaldırıldı, bunun yerine \"get()\" kullanın.",
"bec226891a505828bfc76c5cfd73b336": "Bilinmeyen {0} anahtarı için TTL alınamıyor",
"4c78325cedbb826db3a05bf5df0e8546": "Değiştirirken bir {{id}} belirtmelisiniz!",
"a0cf0e09c26df14283223e84e6a10f00": "Öznitelikler güncellenemedi. Tanıtıcısı {{id}} olan {0} {{Object}} nesnesi yok!",
"e54d944c2a2c85a23caa86027ae307cf": "Bu veri kaynağına eklenmemiş modeller geçirilemez: {0}",
"e6161ae8459c79d810e2aa9d21282a39": "Öznitelikleri güncellerken bir {{id}} belirtmelisiniz!",
"fca4d12faff1035d9d0438d73432571b": "Bu öğeyle ilgili yinelenen giriş: {0}.{1}",
"09483e03b91c8bd58732a74b3ef1ec13": "Geçersiz tarih: {0}",
"0b16d3ffc42f91b4b9a4b3b50c41c838": "{0} sırası geçerli değil",
"0ff31abb394afb555df162e74ff1a0a0": "{{id}}, {{forceId}} true olarak ayarlandığında {0} durumundan {1} durumuna güncellenemiyor",
"21095484501dbff31af6556fa6039182": "{{offset/skip}} parametresi {0} geçerli değil",
"2c5c8519721f749aab13c2f04f41d611": "{0} özelliği geçersiz {1} yantümcesi içeriyor: Tam olarak 2 değer bekleniyor, {2} alındı",
"416dfbb7b823f51c9f3800be81060b41": "{1} için {{id}} {0} tanıtıcılı bir eşgörünüm bulunamadı",
"4e31b1edd10dadb724d83387de0b5062": "{{limit}} parametresi {0} geçerli değil",
"514985b2327f061ffb1c932f6b909979": "{0} modeli tanımlanmadı",
"525c856e65daab43be247e7b5410febd": "{{polymorphic}} {0} ilişkisi: {1}, özel `foreignKey`/`discriminator` öğesini tanımlarken `polymorphic.selector` parametresini beklemiyor ",
"5c18ee111dd87540cdb19a2a93b33be9": "Zaman aşımı nedeniyle işlem geri alındı",
"5ec7e6664256f7ea78f4f06dafc7d974": "İşlem hazır değil, çözüm için döndürülen durumu bekleyin. ",
"5ec8efeb715a2c34b440f2d76e2cf87d": " {0}",
"6111399276924ffa3bc9a410cdfcb2e5": "{{id}} adı {0} yok",
"614e3355647e4127c96256102dc63376": "{0} özelliğinde geçersiz {1} yantümcesi var: Bir dizgi ya da RegExp bekleniyor",
"62a2d80c405b7fec5f547c448ab1b6ff": "{{order}} {0} sırasının yönü geçersiz",
"6502a117987610380b9068ef98b1b0ee": "({1}.{2} ,{3}.{4}) için {0} içinde kayıt bulunamadı. ",
"67c2bf43b5281ab929617423ea8a6f3e": "{0} bağlayıcısı {{replaceById}} işlemini desteklemiyor. Bu LoopBack'deki bir hata değil. Lütfen, mümkünse GitHub sorunlarıyla birlikte, bağlayıcının yazarlarına başvurun.",
"6c3234937d69763fc7f6bcafccc59bbc": "{{Model::deleteById}}, {{id}} bağımsız değişkenini gerektirir",
"6eb6fd4fbd73394000bc25f5776fd20c": "{{Model::exists}}, {{id}} bağımsız değişkenini gerektirir",
"6fcc2ff0db7a4f490f5e0ce9e24691f3": "{{HasOne}} ilişkisi birden çok {0} eşgörünümü yaratamaz",
"728232e473bf80272c042df2b7e002f4": "{{polymorphic}} {0} ilişkisi: `polymorphic.foreignKey` parametresi sağlandığında {1} için `polymorphic.discriminator` parametresi gerekir",
"791ab3031a73ede03f7d6299a85e8289": "{0} milisaniyeden sonra bağlantıda zaman aşımı oluştu",
"7b277018e43d41bc445731092b91547d": "Bağlı değil",
"7bbbdece4eea90e42aa5c0bce295e503": "{{Model::findById}}, {{id}} bağımsız değişkenini gerektirir",
"7e9530c0399289be0ee601a604be71ff": "{{BelongsTo}} ilişkisi {0} boş",
"7faa840eb6ce11250a141deb42a6c489": "Bilinmeyen ilişki {{scope}}: {0}",
"8091838319a5cc7d6a34af2f2a616ce9": "Şu modelde özellik adı \"{{constructor}}\" olmamalıdır: {0}",
"881e4b0cb86ed59549248ee540a9fd10": "{0} verilerinde \"{{constructor}}\" özellik adına izin verilmez",
"89afd3a9249f5a8d3edda07d84ca049d": "{{Polymorphic}} model bulunamadı: `{0}`",
"89bf6d92731fe7bd2146ce8d0bec205c": "Bağımsız değişken geçersiz; bir dizgi, {{regex}} hazır bilgisi ya da {{RegExp}} nesnesi olmalıdır",
"8a39126103a157f501affa070367a1b0": "{0} eşgörünümü geçerli değil. Ayrıntılar: {1}.",
"8c5ab01638c1ac1d58168c6346a8481a": "Geçersiz {{regex}} işaretleri: {0}",
"938401ea4ce48159efa9be1d4a5e8bab": "Öğeler bir dizi olmalıdır: {0}",
"9e1f143ee02946324d34da92f71bf74e": "{0} ilişkisi: {1} için `model` parametresi gerekir",
"a004f310d315e592843776fab964eaeb": "{{Polymorphic}} ilişkileri için aracı model gerekir",
"a0cf0e09c26df14283223e84e6a10f00": "Öznitelikler güncellenemedi. Tanıtıcısı {{id}} olan {0} {{Object}} nesnesi yok!",
"a2487abefef4259c2131d96cdb8543b1": "Bağlantı başarısız oldu: {0}\nSonraki istek için yeniden denenecek.",
"a25e41a39c60c4702e55d0c3936576a1": "Anahtar uyuşmazlığı: {0}.{1}: {2}, {3}.{4}: {5}",
"a327355560d495454fba2c1aad6bdf09": "Bilinmeyen kapsam yöntemi: {0}",
"a6c18a7f4390cd3d59a2a7a047ae2aab": "\"{{npm install loopback-datasource-juggler}} {0}\" komutunu çalıştırın ",
"a829dee089c912e68c18920ba015400c": "UYARI: {{id}} özelliği, {{'loaded'}} işlem çengelinde {2} modeli için {0} değerinden {1} değerine çevrilemiyor",
"a984a076c59e451948b2bcf7a393d860": "UYARI: {{id}} özelliği, {{'before save'}} işlem çengelinde {2} modeli için {0} değerinden {1} değerine çevrilemiyor",
"ac04cf275b71c1eb89a41cf6bbad7a64": "\"getAsync()\" HasOne yöntemi kullanımdan kaldırıldı, bunun yerine \"get()\" kullanın",
"b138294f132edfe1eb2a8211150c7238": "Sorguda beklenmeyen `undefined`",
"b15b20280211ad258d92947f05b6e4a5": "Bağlayıcı başlatılmamış.",
"b278876ec93ef9760f00e83f38ba313d": "\"getAsync()\" kapsam yöntemi kullanımdan kaldırıldı, bunun yerine \"find()\" kullanın.",
"ba0fd8106eb54de4d003a844206431fd": "\"{0}\" model çengeli kullanımdan kaldırıldı, onun yerine işlem çengellerini kullanın. {{http://docs.strongloop.com/display/LB/Operation+hooks}}",
"baf2c8b0c5a574b8a894e9b6304fece1": "Where yantümcesi {0} bir {{object}} değil",
"bdb11cc1c780c9ccac33c316cfdc9d82": "{0}.{1} özelliği için tip tanımlanmadı",
"bdfb951c8ff7ce0cbc08c06f548fd927": "Değer boş bir {{object}}",
"bec226891a505828bfc76c5cfd73b336": "Bilinmeyen {0} anahtarı için TTL alınamıyor",
"cd930369e86cdd222f7bd117c6f9fa94": "Bilinmeyen varsayılan değer sağlayıcısı {0}",
"cfee4d8149316d9a647c0885cf3cafaf": "Nokta içeren özellik adları desteklenmez. Model: {0}, dinamik özellik: {1}",
"d40328eabd8756d795bcdd49d782d4e9": "DataSource işlemleri desteklemiyor",
"da02dd6c53d4148320eeb31718a7aebe": "{0} özelliği için geçersiz tip",
"da751a8a748adbde5b55fa83b707b4e2": "Nokta içeren özellik adları desteklenmez. Model: {0}, özellik: {1}",
"db03083e9a768388fdbee865249ac67a": "{{updateOrCreate()}} işlemindeki doğrulama hataları yoksayılıyor:",
"dd63416d9b7d9fa4181e89efd619dfd8": "Değer, sıralı sayısal dizeler içeren bir {{array}} ya da {{object}} değil",
"ddf0aa14803f1c84f4a97f3803f7471c": "Sınıf adı zorunludur",
"e08ab0e1ab55f26c357061447b635905": "({1}.{2} ,{3}.{4}) için {0} içinde ilişki bulunamadı.",
"e0e9504e137a3c3339144b51ed76fef2": "Bağlayıcı doğru tanımlanmadı: Veri kaynağının `{{connector}}` üyesini yaratmalıdır",
"e2f282cbe3efba001d6d3a09f7f6ca8c": "{{polymorphic}} {0} ilişkisi: `polymorphic.discriminator` parametresi sağlandığında {1} için `polymorphic.foreignKey` parametresi gerekir",
"e39e0f5d52bfbf511e645d19ecadd2fa": "{0} özelliğinde geçersiz {1} yantümcesi var: {2}",
"e4434de4bb8f5a3cd1d416e4d80d7e0b": "Bilinmeyen \"{0}\" {{id}} \"{1}\".",
"e54d944c2a2c85a23caa86027ae307cf": "Bu veri kaynağına eklenmemiş modeller geçirilemez: {0}",
"e54f118a75e15e132f16b985274eb46d": "Sorgu süzgeci {0} bir {{object}} değil",
"e55937649d8d7a11706b8cec22d02eae": "{{HasOne}} ilişkisi {0} boş",
"e6161ae8459c79d810e2aa9d21282a39": "Öznitelikleri güncellerken bir {{id}} belirtmelisiniz!",
"eb56c2b0c30cf006e2df00a549ec9c2c": "{1} modeli için \"{0}\" ilişkisi tanımlanmadı",
"ec42dca074f1818c447f7ad16e2d01af": "Eklenen bağlayıcı tarafından {0} sağlanmadı",
"ecb7aa804bf54c682999d20d6436104c": "{{transaction}} etkin değil: {0}",
"f30809cb932b72a66416a709c8531530": "Bağlayıcısı bir işlem içinde {{method}} yöntemini desteklemiyor.",
"f41bd91dc0f000a79c0bf842f1b7fdf9": "JSON dizgisinden liste yaratılamadı: {0}",
"f6e8c96c93b9c7687d6c172b3695e898": "{{id}} özelliği ({0}), {1} değerinden {2} değerine güncellenemiyor",
"fa9ae17e8e008d0eb0f0421a2972308c": "{{polymorphic}} {0} ilişkisi: {1} için `model` parametresi gerekir",
"fca4d12faff1035d9d0438d73432571b": "{0}.{1} için yinelenen giriş",
"fd3cc89dc67e2d604eaae21bdf41d403": "{1} modeli için {0} ilişkisi bulunamadı",
"fec8ebda24db46a9d040bf863765cc44": "{0} işlecinde geçersiz {1} yantümceleri var: {2}"
"fec8ebda24db46a9d040bf863765cc44": "{0} işlecinde geçersiz {1} yantümceleri var: {2}",
"0be2d39d225b1d8b2a0f92ad5c65c9ac": "{{polymorphic}} {0} için model belirtilmedi: {1}",
"0c4eb8b6c2ff6e51d7e195eee346ced9": "'{0}' tablosu yok",
"2f4af31c144bbfab1bbf479866acd820": "\nUYARI: {{LoopBack}} bağlayıcısı \"{0}\" şu modüllerden biri olarak kurulmadı:\n\n {1}\n\nDüzeltmek için şu komutu çalıştırın:\n\n {{npm install {2} --save}}\n",
"6111399276924ffa3bc9a410cdfcb2e5": "{{id}} adı {0} yok",
"791ab3031a73ede03f7d6299a85e8289": "{0} milisaniyeden sonra bağlantıda zaman aşımı oluştu",
"7b277018e43d41bc445731092b91547d": "Bağlı değil",
"a2487abefef4259c2131d96cdb8543b1": "Bağlantı başarısız oldu: {0}\nSonraki istek için yeniden denenecek.",
"b15b20280211ad258d92947f05b6e4a5": "Bağlayıcı başlatılmamış.",
"ddf0aa14803f1c84f4a97f3803f7471c": "Sınıf adı zorunludur",
"e0e9504e137a3c3339144b51ed76fef2": "Bağlayıcı doğru tanımlanmadı: Veri kaynağının `{{connector}}` üyesini yaratmalıdır",
"ec42dca074f1818c447f7ad16e2d01af": "Eklenen bağlayıcı tarafından {0} sağlanmadı",
"ba0fd8106eb54de4d003a844206431fd": "\"{0}\" model çengeli kullanımdan kaldırıldı, onun yerine işlem çengellerini kullanın. {{http://docs.strongloop.com/display/LB/Operation+hooks}}",
"280f4550f90e133118955ec6f6f72830": "{0} ayrımsayıcı tipi belirtildi, ancak bu adı taşıyan bir model yok",
"38dbf42c29a4645238cc3d632e88ebc9": "{{Relation.modelTo}}, {0} ilişkisi için tanımlanmadı ve {{polymorphic}} değil",
"eb56c2b0c30cf006e2df00a549ec9c2c": "{1} modeli için \"{0}\" ilişkisi tanımlanmadı",
"938401ea4ce48159efa9be1d4a5e8bab": "Öğeler bir dizi olmalıdır: {0}",
"f41bd91dc0f000a79c0bf842f1b7fdf9": "JSON dizgisinden liste yaratılamadı: {0}",
"514985b2327f061ffb1c932f6b909979": "{0} modeli tanımlanmadı",
"8091838319a5cc7d6a34af2f2a616ce9": "Şu modelde özellik adı \"{{constructor}}\" olmamalıdır: {0}",
"da02dd6c53d4148320eeb31718a7aebe": "{0} özelliği için geçersiz tip",
"da751a8a748adbde5b55fa83b707b4e2": "Nokta içeren özellik adları desteklenmez. Model: {0}, özellik: {1}",
"3864f9be10f27723074566d2b3893514": "Uyarı: {0} modeli, {{strict mode: `throw`}} kaldırıldı, lütfen bunun yerine bilinmeyen özellikler için {{`Validation Error`}} döndüren {{`strict: true`}} kullanın",
"881e4b0cb86ed59549248ee540a9fd10": "{0} verilerinde \"{{constructor}}\" özellik adına izin verilmez",
"bdb11cc1c780c9ccac33c316cfdc9d82": "Bu özellik için tip tanımlanmadı: {0}.{1}",
"cd930369e86cdd222f7bd117c6f9fa94": "Bilinmeyen varsayılan değer sağlayıcısı {0}",
"cfee4d8149316d9a647c0885cf3cafaf": "Nokta içeren özellik adları desteklenmez. Model: {0}, dinamik özellik: {1}",
"0c0b867aca0973ba26e887d3337cc4ec": "{{Polymorphic}} model bulunamadı: `{0}` ayarlı değil",
"2f062cbecdf24245731bddc77714c814": "{1} için \"{0}\" bulunamadı",
"3cde8cc9bca22c67278b202ab0720106": "{1} için {0} tanıtıcılı bir eşgörünüm bulunamadı",
"6502a117987610380b9068ef98b1b0ee": "{0} içinde şu öğe için kayıt bulunamadı: ({1}.{2} ,{3}.{4})",
"6fcc2ff0db7a4f490f5e0ce9e24691f3": "{{HasOne}} ilişkisi birden çok {0} eşgörünümü yaratamaz",
"7e9530c0399289be0ee601a604be71ff": "{{BelongsTo}} ilişkisi {0} boş",
"7faa840eb6ce11250a141deb42a6c489": "Bilinmeyen ilişki {{scope}}: {0}",
"89afd3a9249f5a8d3edda07d84ca049d": "{{Polymorphic}} model bulunamadı: `{0}`",
"a004f310d315e592843776fab964eaeb": "{{Polymorphic}} ilişkileri için aracı model gerekir",
"a25e41a39c60c4702e55d0c3936576a1": "Anahtar uyuşmazlığı: {0}.{1}: {2}, {3}.{4}: {5}",
"a327355560d495454fba2c1aad6bdf09": "Bilinmeyen kapsam yöntemi: {0}",
"e08ab0e1ab55f26c357061447b635905": "{0} içinde şu öğe için ilişki bulunamadı: ({1}.{2},{3}.{4})",
"e55937649d8d7a11706b8cec22d02eae": "{{HasOne}} ilişkisi {0} boş",
"2c4904377a87fdab502118719cc0d266": "{{Transaction}} desteklenmiyor",
"ecb7aa804bf54c682999d20d6436104c": "{{transaction}} etkin değil: {0}",
"89bf6d92731fe7bd2146ce8d0bec205c": "Bağımsız değişken geçersiz; bir dizgi, {{regex}} hazır bilgisi ya da {{RegExp}} nesnesi olmalıdır",
"8c5ab01638c1ac1d58168c6346a8481a": "Geçersiz {{regex}} işaretleri: {0}",
"a6c18a7f4390cd3d59a2a7a047ae2aab": "\"{{npm install loopback-datasource-juggler}} {0}\" komutunu çalıştırın ",
"b138294f132edfe1eb2a8211150c7238": "Sorguda beklenmeyen `undefined`",
"8a39126103a157f501affa070367a1b0": "{0} eşgörünümü geçerli değil. Ayrıntılar: {1}."
}

View File

@ -1,97 +1,80 @@
{
"0483a77cf77741504204e5c066597487": "{{polymorphic}} {0} 关系:定义定制 `foreignKey`/`discriminator` 时,{1} 不期望参数 `polymorphic.as`",
"09483e03b91c8bd58732a74b3ef1ec13": "无效日期:{0}",
"0a5aa17f7866a85e3aee37ef5369403c": "LinkManyToMany 收到的目标不包含必需的“{0}”",
"0b16d3ffc42f91b4b9a4b3b50c41c838": "顺序 {0} 无效",
"0bd753a8944ad0af85a939bb25273887": "无法使未知键 {0} 到期",
"0c0b867aca0973ba26e887d3337cc4ec": "找不到 {{Polymorphic}} 模型:未设置“{0}”",
"0c4eb8b6c2ff6e51d7e195eee346ced9": "表“{0}”不存在。",
"0ff31abb394afb555df162e74ff1a0a0": "将 {{forceId}} 设置为 true 时,{{id}} 无法从 {0} 更新为 {1}",
"1ae7d3e0be381efb32bfd1ba652f5172": "警告:{{polymorphic}} {0} 关系:{1} 使用关键字 `polymorphic.as`,在 LoopBack.next 中不推荐使用此关键字,请参阅以下文档以了解替代解决方案 (https://loopback.io/doc/en/lb3/Polymorphic-relations.html#deprecated-polymorphic-as)",
"1daef4e937fe52136597ba8fd2060f55": "不支持嵌套事务",
"21095484501dbff31af6556fa6039182": "{{offset/skip}} 参数 {0} 无效",
"280f4550f90e133118955ec6f6f72830": "已指定鉴别器类型 {0},但是不存在具有此类名称的模型",
"28697ec15968a7969211f6d035ba9260": "{{polymorphic}} {0} 关系:{1} 不期望参数 `model`",
"2c4904377a87fdab502118719cc0d266": "不支持 {{Transaction}}",
"2c5c8519721f749aab13c2f04f41d611": "{0} 属性具有无效子句 {1}:预期精确为 2 个值,接收 {2}",
"2f4af31c144bbfab1bbf479866acd820": "\n警告未作为以下任何模块安装 {{LoopBack}} 连接器“{0}”\n\n {1}\n\n要修正请运行\n\n {{npm install {2} --save}}\n",
"3864f9be10f27723074566d2b3893514": "警告:模型 {0} {{strict mode: `throw`}} 已移除,请使用 {{`strict: true`}} 代替,其将返回未知属性的 {{`Validation Error`}}。",
"38dbf42c29a4645238cc3d632e88ebc9": "未针对关系 {0} 定义 {{Relation.modelTo}},并且不是 {{polymorphic}}",
"3cde8cc9bca22c67278b202ab0720106": "对于 {1},找不到具有标识 {0} 的实例",
"416dfbb7b823f51c9f3800be81060b41": "对于 {1},找不到具有 {{id}} {0} 的实例",
"49b5afd8c6a19ad9c8abeffb2f8114eb": "不推荐使用 BelongsTo 方法“getAsync()”请改为使用“get()”。",
"bec226891a505828bfc76c5cfd73b336": "无法获取未知键 {0} 的 TTL",
"4c78325cedbb826db3a05bf5df0e8546": "在替换时必须提供 {{id}}",
"a0cf0e09c26df14283223e84e6a10f00": "无法更新属性。包含 {{id}} {0} 的 {{Object}} 不存在!",
"e54d944c2a2c85a23caa86027ae307cf": "无法迁移未附加到此数据源的模型:{0}",
"e6161ae8459c79d810e2aa9d21282a39": "在更新属性时必须提供 {{id}}",
"fca4d12faff1035d9d0438d73432571b": "{0} 的重复条目。{1}",
"09483e03b91c8bd58732a74b3ef1ec13": "无效日期:{0}",
"0b16d3ffc42f91b4b9a4b3b50c41c838": "顺序 {0} 无效",
"0ff31abb394afb555df162e74ff1a0a0": "将 {{forceId}} 设置为 true 时,{{id}} 无法从 {0} 更新为 {1}",
"21095484501dbff31af6556fa6039182": "{{offset/skip}} 参数 {0} 无效",
"2c5c8519721f749aab13c2f04f41d611": "{0} 属性具有无效子句 {1}:预期精确为 2 个值,接收 {2}",
"416dfbb7b823f51c9f3800be81060b41": "对于 {1},找不到具有 {{id}} {0} 的实例",
"4e31b1edd10dadb724d83387de0b5062": "{{limit}} 参数 {0} 无效",
"514985b2327f061ffb1c932f6b909979": "未定义模型 {0}。",
"525c856e65daab43be247e7b5410febd": "{{polymorphic}} {0} 关系:定义定制 `foreignKey`/`discriminator` 时,{1} 不期望参数 `polymorphic.selector`",
"5c18ee111dd87540cdb19a2a93b33be9": "事务因超时而回滚",
"5ec7e6664256f7ea78f4f06dafc7d974": "事务未就绪,请等待返回的约定解决",
"5ec8efeb715a2c34b440f2d76e2cf87d": " {0}",
"6111399276924ffa3bc9a410cdfcb2e5": "无 {{id}} 名称 {0}",
"614e3355647e4127c96256102dc63376": "{0} 属性具有无效子句 {1}:预期为字符串或 RegExp",
"62a2d80c405b7fec5f547c448ab1b6ff": "{{order}} {0} 具有无效的方向",
"6502a117987610380b9068ef98b1b0ee": "在 {0} 中找不到以下项的记录:({1}.{2} ,{3}.{4})",
"67c2bf43b5281ab929617423ea8a6f3e": "连接器 {0} 不支持 {{replaceById}} 操作。这不是 LoopBack 中的错误。请联系连接器的作者,首选通过 GitHub 提交问题。",
"6c3234937d69763fc7f6bcafccc59bbc": "{{Model::deleteById}} 需要 {{id}} 自变量",
"6eb6fd4fbd73394000bc25f5776fd20c": "{{Model::exists}} 需要 {{id}} 自变量",
"6fcc2ff0db7a4f490f5e0ce9e24691f3": "{{HasOne}} 关系无法创建 {0} 的多个实例",
"728232e473bf80272c042df2b7e002f4": "{{polymorphic}} {0} 关系:提供参数 `polymorphic.foreignKey` 时,{1} 需要参数 `polymorphic.discriminator`",
"791ab3031a73ede03f7d6299a85e8289": "在 {0} 毫秒后连接超时",
"7b277018e43d41bc445731092b91547d": "未连接",
"7bbbdece4eea90e42aa5c0bce295e503": "{{Model::findById}} 需要 {{id}} 自变量",
"7e9530c0399289be0ee601a604be71ff": "{{BelongsTo}} 关系 {0} 为空",
"7faa840eb6ce11250a141deb42a6c489": "未知的关系 {{scope}}{0}",
"8091838319a5cc7d6a34af2f2a616ce9": "属性名称不应是模型中的“{{constructor}}”:{0}",
"881e4b0cb86ed59549248ee540a9fd10": "{0} 数据中不允许属性名称“{{constructor}}”",
"89afd3a9249f5a8d3edda07d84ca049d": "找不到 {{Polymorphic}} 模型:“{0}”",
"89bf6d92731fe7bd2146ce8d0bec205c": "无效的自变量,必须是字符串、{{regex}} 字面值或 {{RegExp}} 对象",
"8a39126103a157f501affa070367a1b0": "{0} 实例无效。详细信息:{1}。",
"8c5ab01638c1ac1d58168c6346a8481a": "无效的 {{regex}} 标志:{0}",
"938401ea4ce48159efa9be1d4a5e8bab": "项必须是数组:{0}",
"9e1f143ee02946324d34da92f71bf74e": "{0} 关系:{1} 需要参数 `model`",
"a004f310d315e592843776fab964eaeb": "{{Polymorphic}} 关系需要直通模型",
"a0cf0e09c26df14283223e84e6a10f00": "无法更新属性。包含 {{id}} {0} 的 {{Object}} 不存在!",
"a2487abefef4259c2131d96cdb8543b1": "连接失败:{0}\n将在下一次请求时重试。",
"a25e41a39c60c4702e55d0c3936576a1": "键不匹配:{0}.{1}: {2}, {3}.{4}: {5}",
"a327355560d495454fba2c1aad6bdf09": "未知的作用域方法:{0}",
"a6c18a7f4390cd3d59a2a7a047ae2aab": "运行“{{npm install loopback-datasource-juggler}} {0}”命令",
"a829dee089c912e68c18920ba015400c": "警告:对于以下模型,{{id}} 属性无法从 {0} 更改为 {1}{{'loaded'}} 操作挂钩中的 {2}",
"a984a076c59e451948b2bcf7a393d860": "警告:对于以下模型,{{id}} 属性无法从 {0} 更改为 {1}{{'before save'}} 操作挂钩中的 {2}",
"ac04cf275b71c1eb89a41cf6bbad7a64": "不推荐使用 HasOne 方法“getAsync()”请改为使用“get()”。",
"b138294f132edfe1eb2a8211150c7238": "查询中存在意外的“未定义”",
"b15b20280211ad258d92947f05b6e4a5": "连接器尚未进行初始化。",
"b278876ec93ef9760f00e83f38ba313d": "不推荐使用 Scope 方法“getAsync()”请改为使用“find()”。",
"ba0fd8106eb54de4d003a844206431fd": "不推荐使用模型挂钩“{0}”,请改用操作挂钩。{{http://docs.strongloop.com/display/LB/Operation+hooks}}",
"baf2c8b0c5a574b8a894e9b6304fece1": "Where 子句 {0} 不是 {{object}}",
"bdb11cc1c780c9ccac33c316cfdc9d82": "未针对属性 {0}.{1} 定义类型",
"bdfb951c8ff7ce0cbc08c06f548fd927": "值为空的 {{object}}",
"bec226891a505828bfc76c5cfd73b336": "无法获取未知键 {0} 的 TTL",
"cd930369e86cdd222f7bd117c6f9fa94": "未知的缺省值提供程序 {0}",
"cfee4d8149316d9a647c0885cf3cafaf": "不支持包含点的属性名称。模型:{0},动态属性:{1}",
"d40328eabd8756d795bcdd49d782d4e9": "数据源不支持事务",
"da02dd6c53d4148320eeb31718a7aebe": "属性 {0} 的类型无效",
"da751a8a748adbde5b55fa83b707b4e2": "不支持包含点的属性名称。模型:{0},属性:{1}",
"db03083e9a768388fdbee865249ac67a": "正在忽略 {{updateOrCreate()}} 中的验证错误:",
"dd63416d9b7d9fa4181e89efd619dfd8": "值不是具有有序数字索引的 {{array}} 或 {{object}}",
"ddf0aa14803f1c84f4a97f3803f7471c": "类名是必需的",
"e08ab0e1ab55f26c357061447b635905": "在 {0} 中找不到以下项的关系:({1}.{2} ,{3}.{4})",
"e0e9504e137a3c3339144b51ed76fef2": "连接器定义不正确:应创建数据源的“{{connector}}”成员",
"e2f282cbe3efba001d6d3a09f7f6ca8c": "{{polymorphic}} {0} 关系:提供参数 `polymorphic.discriminator` 时,{1} 需要参数 `polymorphic.foreignKey`",
"e39e0f5d52bfbf511e645d19ecadd2fa": "{0} 属性有无效子句 {1}{2}",
"e4434de4bb8f5a3cd1d416e4d80d7e0b": "未知的“{0}”{{id}}“{1}”。",
"e54d944c2a2c85a23caa86027ae307cf": "无法迁移未附加到此数据源的模型:{0}",
"e54f118a75e15e132f16b985274eb46d": "查询过滤器 {0} 不是 {{object}}",
"e55937649d8d7a11706b8cec22d02eae": "{{HasOne}} 关系 {0} 为空",
"e6161ae8459c79d810e2aa9d21282a39": "在更新属性时必须提供 {{id}}",
"eb56c2b0c30cf006e2df00a549ec9c2c": "未针对 {1} 模型定义关系“{0}”",
"ec42dca074f1818c447f7ad16e2d01af": "连接的连接器未提供 {0}",
"ecb7aa804bf54c682999d20d6436104c": "{{transaction}} 不活动:{0}",
"f30809cb932b72a66416a709c8531530": "连接器不支持某个事务内的 {{method}}",
"f41bd91dc0f000a79c0bf842f1b7fdf9": "无法从 JSON 字符串创建列表:{0}",
"f6e8c96c93b9c7687d6c172b3695e898": "{{id}} 属性 ({0}) 无法从 {1} 更新为 {2}",
"fa9ae17e8e008d0eb0f0421a2972308c": "{{polymorphic}} {0} 关系:{1} 需要参数 `model`",
"fca4d12faff1035d9d0438d73432571b": "{0}.{1} 的重复条目",
"fd3cc89dc67e2d604eaae21bdf41d403": "针对模型 {1} 找不到关系 {0}",
"fec8ebda24db46a9d040bf863765cc44": "{0} 操作员有无效子句 {1}{2}"
"fec8ebda24db46a9d040bf863765cc44": "{0} 操作员有无效子句 {1}{2}",
"0be2d39d225b1d8b2a0f92ad5c65c9ac": "未针对 {{polymorphic}} {0} 指定模型:{1}",
"0c4eb8b6c2ff6e51d7e195eee346ced9": "表“{0}”不存在。",
"2f4af31c144bbfab1bbf479866acd820": "\n警告未作为以下任何模块安装 {{LoopBack}} 连接器“{0}”\n\n {1}\n\n要修正请运行\n\n {{npm install {2} --save}}\n",
"6111399276924ffa3bc9a410cdfcb2e5": "无 {{id}} 名称 {0}",
"791ab3031a73ede03f7d6299a85e8289": "在 {0} 毫秒后连接超时",
"7b277018e43d41bc445731092b91547d": "未连接",
"a2487abefef4259c2131d96cdb8543b1": "连接失败:{0}\n将在下一次请求时重试。",
"b15b20280211ad258d92947f05b6e4a5": "连接器尚未进行初始化。",
"ddf0aa14803f1c84f4a97f3803f7471c": "类名是必需的",
"e0e9504e137a3c3339144b51ed76fef2": "连接器定义不正确:应创建 dataSource 的“{{connector}}”成员",
"ec42dca074f1818c447f7ad16e2d01af": "连接的连接器未提供 {0}",
"ba0fd8106eb54de4d003a844206431fd": "不推荐使用模型挂钩“{0}”,请改用操作挂钩。{{http://docs.strongloop.com/display/LB/Operation+hooks}}",
"280f4550f90e133118955ec6f6f72830": "已指定鉴别器类型 {0},但是不存在具有此类名称的模型",
"38dbf42c29a4645238cc3d632e88ebc9": "未针对关系 {0} 定义 {{Relation.modelTo}},并且不是 {{polymorphic}}",
"eb56c2b0c30cf006e2df00a549ec9c2c": "未针对 {1} 模型定义关系“{0}”",
"938401ea4ce48159efa9be1d4a5e8bab": "项必须是数组:{0}",
"f41bd91dc0f000a79c0bf842f1b7fdf9": "无法从 JSON 字符串创建列表:{0}",
"514985b2327f061ffb1c932f6b909979": "未定义模型 {0}。",
"8091838319a5cc7d6a34af2f2a616ce9": "属性名称不应是模型中的“{{constructor}}”:{0}",
"da02dd6c53d4148320eeb31718a7aebe": "属性 {0} 的类型无效",
"da751a8a748adbde5b55fa83b707b4e2": "不支持包含点的属性名称。模型:{0},属性:{1}",
"3864f9be10f27723074566d2b3893514": "警告:模型 {0} {{strict mode: `throw`}} 已移除,请使用 {{`strict: true`}} 代替,其将返回未知属性的 {{`Validation Error`}}。",
"881e4b0cb86ed59549248ee540a9fd10": "{0} 数据中不允许属性名称“{{constructor}}”",
"bdb11cc1c780c9ccac33c316cfdc9d82": "未针对属性 {0} 定义类型。{1}",
"cd930369e86cdd222f7bd117c6f9fa94": "未知的缺省值提供程序 {0}",
"cfee4d8149316d9a647c0885cf3cafaf": "不支持包含点的属性名称。模型:{0},动态属性:{1}",
"0c0b867aca0973ba26e887d3337cc4ec": "找不到 {{Polymorphic}} 模型:未设置“{0}”",
"2f062cbecdf24245731bddc77714c814": "无法找到 {1} 的“{0}”关系",
"3cde8cc9bca22c67278b202ab0720106": "对于 {1},找不到具有标识 {0} 的实例",
"6502a117987610380b9068ef98b1b0ee": "在 {0} 中找不到以下项的记录:({1}. {2}{3}.{4}",
"6fcc2ff0db7a4f490f5e0ce9e24691f3": "{{HasOne}} 关系无法创建 {0} 的多个实例",
"7e9530c0399289be0ee601a604be71ff": "{{BelongsTo}} 关系 {0} 为空",
"7faa840eb6ce11250a141deb42a6c489": "未知的关系 {{scope}}{0}",
"89afd3a9249f5a8d3edda07d84ca049d": "找不到 {{Polymorphic}} 模型:“{0}”",
"a004f310d315e592843776fab964eaeb": "{{Polymorphic}} 关系需要直通模型",
"a25e41a39c60c4702e55d0c3936576a1": "键不匹配:{0}.{1}{2}{3}.{4}{5}",
"a327355560d495454fba2c1aad6bdf09": "未知的作用域方法:{0}",
"e08ab0e1ab55f26c357061447b635905": "在 {0} 中找不到以下项的关系:({1}. {2}{3}.{4}",
"e55937649d8d7a11706b8cec22d02eae": "{{HasOne}} 关系 {0} 为空",
"2c4904377a87fdab502118719cc0d266": "不支持 {{Transaction}}",
"ecb7aa804bf54c682999d20d6436104c": "{{transaction}} 不活动:{0}",
"89bf6d92731fe7bd2146ce8d0bec205c": "无效的自变量,必须是字符串、{{regex}} 字面值或 {{RegExp}} 对象",
"8c5ab01638c1ac1d58168c6346a8481a": "无效的 {{regex}} 标志:{0}",
"a6c18a7f4390cd3d59a2a7a047ae2aab": "运行“{{npm install loopback-datasource-juggler}} {0}”命令",
"b138294f132edfe1eb2a8211150c7238": "查询中存在意外的“未定义”",
"8a39126103a157f501affa070367a1b0": "{0} 实例无效。详细信息:{1}。"
}

View File

@ -1,97 +1,80 @@
{
"0483a77cf77741504204e5c066597487": "{{polymorphic}} {0} 關係:定義自訂 'foreignKey'/'discriminator' 時 {1} 並未預期參數 'polymorphic.as'",
"0bd753a8944ad0af85a939bb25273887": "無法使不明索引鍵 {0} 到期",
"bec226891a505828bfc76c5cfd73b336": "無法取得不明索引鍵 {0} 的 TTL",
"4c78325cedbb826db3a05bf5df0e8546": "更換時必須提供 {{id}}",
"a0cf0e09c26df14283223e84e6a10f00": "無法更新屬性。{{id}} 為 {0} 的 {{Object}} 不存在!",
"e54d944c2a2c85a23caa86027ae307cf": "無法移轉未連接至這個資料來源的模型:{0}",
"e6161ae8459c79d810e2aa9d21282a39": "更新屬性時必須提供 {{id}}",
"fca4d12faff1035d9d0438d73432571b": "{0}.{1} 的項目重複",
"09483e03b91c8bd58732a74b3ef1ec13": "無效日期:{0}",
"0a5aa17f7866a85e3aee37ef5369403c": "LinkManyToMany 收到的目標不含必要的 \"{0}\"",
"0b16d3ffc42f91b4b9a4b3b50c41c838": "順序 {0} 無效",
"0bd753a8944ad0af85a939bb25273887": "無法使不明金鑰 {0} 到期",
"0c0b867aca0973ba26e887d3337cc4ec": "找不到 {{Polymorphic}} 模型:`{0}` 未設定",
"0c4eb8b6c2ff6e51d7e195eee346ced9": "表格 '{0}' 不存在。",
"0ff31abb394afb555df162e74ff1a0a0": "當 {{forceId}} 設定為 true 時,無法將 {{id}} 從 {0} 更新為 {1}",
"1ae7d3e0be381efb32bfd1ba652f5172": "警告:{{polymorphic}} {0} 關係:{1} 使用關鍵字 'polymorphic.as'(將在 LoopBack.next 中淘汰),請參閱此文件以取得取代解決方案 (https://loopback.io/doc/en/lb3/Polymorphic-relations.html#deprecated-polymorphic-as)",
"1daef4e937fe52136597ba8fd2060f55": "不支援巢狀交易",
"21095484501dbff31af6556fa6039182": "{{offset/skip}} 參數 {0} 無效",
"280f4550f90e133118955ec6f6f72830": "已指定鑑別器類型 {0},但不存在此名稱的模型",
"28697ec15968a7969211f6d035ba9260": "{{polymorphic}} {0} 關係:{1} 並未預期參數 'model'",
"2c4904377a87fdab502118719cc0d266": "不支援 {{Transaction}}",
"2c5c8519721f749aab13c2f04f41d611": "{0} 內容具有無效的子句 {1}:預期為正好 2 個值,但接收到 {2} 個",
"2f4af31c144bbfab1bbf479866acd820": "\n警告{{LoopBack}} 連接器 \"{0}\" 未安裝為下列任一模組:\n\n {1}\n\n若要修正請執行\n\n {{npm install {2} --save}}\n",
"3864f9be10f27723074566d2b3893514": "警告:模型 {0} {{strict mode: `throw`}} 已被移除,請改為使用 {{`strict: true`}},其會對不明內容傳回 {{`Validation Error`}}",
"38dbf42c29a4645238cc3d632e88ebc9": "{{Relation.modelTo}} 未定義給關係 {0},而且不是 {{polymorphic}}",
"3cde8cc9bca22c67278b202ab0720106": "對於 {1},找不到 id 為 {0} 的實例",
"2c5c8519721f749aab13c2f04f41d611": "{0} 內容具有無效的子句 {1}:預期為明確 2 個值,但接收到 {2} 個",
"416dfbb7b823f51c9f3800be81060b41": "對於 {1},找不到 {{id}} 為 {0} 的實例",
"49b5afd8c6a19ad9c8abeffb2f8114eb": "BelongsTo 方法 \"getAsync()\" 已淘汰,請改用 \"get()\"。",
"4c78325cedbb826db3a05bf5df0e8546": "取代時必須提供 {{id}}",
"4e31b1edd10dadb724d83387de0b5062": "{{limit}} 參數 {0} 無效",
"514985b2327f061ffb1c932f6b909979": "模型 {0} 未定義。",
"525c856e65daab43be247e7b5410febd": "{{polymorphic}} {0} 關係:定義自訂 'foreignKey'/'discriminator' 時 {1} 並未預期參數 'polymorphic.selector'",
"5c18ee111dd87540cdb19a2a93b33be9": "由於逾時,已回復交易",
"5ec7e6664256f7ea78f4f06dafc7d974": "交易尚未備妥,等候解析傳回的承諾",
"5ec8efeb715a2c34b440f2d76e2cf87d": " {0}",
"6111399276924ffa3bc9a410cdfcb2e5": "沒有 {{id}} 名稱 {0}",
"614e3355647e4127c96256102dc63376": "{0} 內容具有無效的子句 {1}:預期為字串或 RegExp",
"62a2d80c405b7fec5f547c448ab1b6ff": "{{order}} {0} 的方向無效",
"6502a117987610380b9068ef98b1b0ee": "在 {0} 中找不到 ({1}.{2}{3}.{4}) 的記錄",
"67c2bf43b5281ab929617423ea8a6f3e": "連接器 {0} 不支援 {{replaceById}} 作業。這不是 LoopBack 的錯誤。請聯絡連接器的作者,建議透過 GitHub 問題聯絡。",
"67c2bf43b5281ab929617423ea8a6f3e": "連接器 {0} 不支援 {{replaceById}} 作業。這不是 LoopBack 的錯誤。請聯絡連接器的作者,建議透過 GitHub 議題。",
"6c3234937d69763fc7f6bcafccc59bbc": "{{Model::deleteById}} 需要 {{id}} 引數",
"6eb6fd4fbd73394000bc25f5776fd20c": "{{Model::exists}} 需要 {{id}} 引數",
"6fcc2ff0db7a4f490f5e0ce9e24691f3": "{{HasOne}} 關係無法建立多個 {0} 實例",
"728232e473bf80272c042df2b7e002f4": "{{polymorphic}} {0} 關係:提供參數 'polymorphic.foreignKey' 時 {1} 需要參數 'polymorphic.discriminator'",
"791ab3031a73ede03f7d6299a85e8289": "連接 {0} 毫秒之後逾時",
"7b277018e43d41bc445731092b91547d": "未連接",
"7bbbdece4eea90e42aa5c0bce295e503": "{{Model::findById}} 需要 {{id}} 引數",
"7e9530c0399289be0ee601a604be71ff": "{{BelongsTo}} 關係 {0} 是空的",
"7faa840eb6ce11250a141deb42a6c489": "不明關係 {{scope}}{0}",
"8091838319a5cc7d6a34af2f2a616ce9": "在模型中,內容名稱不應該為 \"{{constructor}}\"{0}",
"881e4b0cb86ed59549248ee540a9fd10": "{0} 資料中不接受內容名稱 \"{{constructor}}\"",
"89afd3a9249f5a8d3edda07d84ca049d": "找不到 {{Polymorphic}} 模型:`{0}`",
"89bf6d92731fe7bd2146ce8d0bec205c": "引數無效,必須是字串、{{regex}} 文字或 {{RegExp}} 物件",
"8a39126103a157f501affa070367a1b0": "{0} 實例無效。詳細資料:{1}。",
"8c5ab01638c1ac1d58168c6346a8481a": "無效 {{regex}} 旗標:{0}",
"938401ea4ce48159efa9be1d4a5e8bab": "項目必須是陣列:{0}",
"9e1f143ee02946324d34da92f71bf74e": "{0} 關係:{1} 需要參數 'model'",
"a004f310d315e592843776fab964eaeb": "{{Polymorphic}} 關係需要有通過模型",
"a0cf0e09c26df14283223e84e6a10f00": "無法更新屬性。{{id}} 為 {0} 的 {{Object}} 不存在!",
"a2487abefef4259c2131d96cdb8543b1": "連線失敗:{0}\n將在下一次要求時重試。",
"a25e41a39c60c4702e55d0c3936576a1": "金鑰不符:{0}.{1}{2}{3}.{4}{5}",
"a327355560d495454fba2c1aad6bdf09": "不明範圍方法:{0}",
"a6c18a7f4390cd3d59a2a7a047ae2aab": "執行 \"{{npm install loopback-datasource-juggler}} {0}\" 指令",
"a829dee089c912e68c18920ba015400c": "警告:在 {{'loaded'}} 作業連結鉤中,無法將 model:{2} 的 {{id}} 內容從 {0} 變更為 {1}",
"a984a076c59e451948b2bcf7a393d860": "警告:在 {{'before save'}} 作業連結鉤中,無法將 model:{2} 的 {{id}} 內容從 {0} 變更為 {1}",
"ac04cf275b71c1eb89a41cf6bbad7a64": "HasOne 方法 \"getAsync()\" 已淘汰,請改用 \"get()\"。",
"b138294f132edfe1eb2a8211150c7238": "查詢中有非預期的 `undefined`",
"b15b20280211ad258d92947f05b6e4a5": "尚未起始設定連接器。",
"b278876ec93ef9760f00e83f38ba313d": "Scope 方法 \"getAsync()\" 已淘汰,請改用 \"find()\"。",
"ba0fd8106eb54de4d003a844206431fd": "模型連結鉤 \"{0}\" 已淘汰,請改用作業連結鉤。{{http://docs.strongloop.com/display/LB/Operation+hooks}}",
"baf2c8b0c5a574b8a894e9b6304fece1": "where 子句 {0} 不是 {{object}}",
"bdb11cc1c780c9ccac33c316cfdc9d82": "未針對內容 {0}.{1} 定義類型",
"bdfb951c8ff7ce0cbc08c06f548fd927": "值是空的 {{object}}",
"bec226891a505828bfc76c5cfd73b336": "無法取得不明金鑰 {0} 的 TTL",
"cd930369e86cdd222f7bd117c6f9fa94": "預設值提供者 {0} 不明",
"cfee4d8149316d9a647c0885cf3cafaf": "不支援含有點的內容名稱。模型:{0},動態內容:{1}",
"d40328eabd8756d795bcdd49d782d4e9": "資料來源不支援交易",
"da02dd6c53d4148320eeb31718a7aebe": "內容 {0} 的類型無效",
"da751a8a748adbde5b55fa83b707b4e2": "不支援含有點的內容名稱。模型:{0},內容:{1}",
"db03083e9a768388fdbee865249ac67a": "忽略 {{updateOrCreate()}} 中的驗證錯誤:",
"dd63416d9b7d9fa4181e89efd619dfd8": "值不是具有循序數值索引的 {{array}} 或 {{object}}",
"ddf0aa14803f1c84f4a97f3803f7471c": "需要類別名稱",
"e08ab0e1ab55f26c357061447b635905": "在 {0} 中找不到 ({1}.{2}{3}.{4}) 的關係",
"e0e9504e137a3c3339144b51ed76fef2": "未正確定義連接器:應該建立資料來源的 `{{connector}}` 成員",
"e2f282cbe3efba001d6d3a09f7f6ca8c": "{{polymorphic}} {0} 關係:提供參數 'polymorphic.discriminator' 時 {1} 需要參數 'polymorphic.foreignKey'",
"e39e0f5d52bfbf511e645d19ecadd2fa": "{0} 內容具有無效的子句 {1}{2}",
"e39e0f5d52bfbf511e645d19ecadd2fa": "{0} 內容有具有無效的子句 {1}{2}",
"e4434de4bb8f5a3cd1d416e4d80d7e0b": "\"{0}\" {{id}} \"{1}\" 不明。",
"e54d944c2a2c85a23caa86027ae307cf": "無法移轉未連接至這個資料來源的模型:{0}",
"e54f118a75e15e132f16b985274eb46d": "查詢過濾器 {0} 不是 {{object}}",
"e55937649d8d7a11706b8cec22d02eae": "{{HasOne}} 關係 {0} 是空的",
"e6161ae8459c79d810e2aa9d21282a39": "更新屬性時必須提供 {{id}}",
"eb56c2b0c30cf006e2df00a549ec9c2c": "未定義 {1} 模型的關係 \"{0}\"",
"ec42dca074f1818c447f7ad16e2d01af": "連接的連接器未提供 {0}",
"ecb7aa804bf54c682999d20d6436104c": "{{transaction}} 為非作用中:{0}",
"f30809cb932b72a66416a709c8531530": "連接器在交易內不支援 {{method}}",
"f41bd91dc0f000a79c0bf842f1b7fdf9": "無法從 JSON 字串建立 List{0}",
"f6e8c96c93b9c7687d6c172b3695e898": "無法將 {{id}} 內容 ({0}) 從 {1} 更新為 {2}",
"fa9ae17e8e008d0eb0f0421a2972308c": "{{polymorphic}} {0} 關係:{1} 需要參數 'model'",
"fca4d12faff1035d9d0438d73432571b": "{0}.{1} 的重複項目",
"fd3cc89dc67e2d604eaae21bdf41d403": "找不到模型 {1} 的關係 {0}",
"fec8ebda24db46a9d040bf863765cc44": "{0} 運算子具有無效的子句 {1}{2}"
"fec8ebda24db46a9d040bf863765cc44": "{0} 運算子具有無效的子句 {1}{2}",
"0be2d39d225b1d8b2a0f92ad5c65c9ac": "未指定 {{polymorphic}} {0} 的模型:{1}",
"0c4eb8b6c2ff6e51d7e195eee346ced9": "表格 '{0}' 不存在。",
"2f4af31c144bbfab1bbf479866acd820": "\n警告{{LoopBack}} 連接器 \"{0}\" 未安裝為下列任一模組:\n\n {1}\n\n若要修正請執行\n\n {{npm install {2} --save}}\n",
"6111399276924ffa3bc9a410cdfcb2e5": "沒有 {{id}} 名稱 {0}",
"791ab3031a73ede03f7d6299a85e8289": "連接 {0} 毫秒之後逾時",
"7b277018e43d41bc445731092b91547d": "未連接",
"a2487abefef4259c2131d96cdb8543b1": "連線失敗:{0}\n將在下一次要求時重試。",
"b15b20280211ad258d92947f05b6e4a5": "尚未起始設定連接器。",
"ddf0aa14803f1c84f4a97f3803f7471c": "需要類別名稱",
"e0e9504e137a3c3339144b51ed76fef2": "未正確定義連接器:應該建立資料來源的 `{{connector}}` 成員",
"ec42dca074f1818c447f7ad16e2d01af": "連接的連接器未提供 {0}",
"ba0fd8106eb54de4d003a844206431fd": "模型連結鉤 \"{0}\" 已淘汰,請改用作業連結鉤。{{http://docs.strongloop.com/display/LB/Operation+hooks}}",
"280f4550f90e133118955ec6f6f72830": "已指定鑑別器類型 {0},但不存在此名稱的模型",
"38dbf42c29a4645238cc3d632e88ebc9": "{{Relation.modelTo}} 未定義給關係 {0},而且不是 {{polymorphic}}",
"eb56c2b0c30cf006e2df00a549ec9c2c": "未定義 {1} 模型的關係 \"{0}\"",
"938401ea4ce48159efa9be1d4a5e8bab": "Items 必須是陣列:{0}",
"f41bd91dc0f000a79c0bf842f1b7fdf9": "無法從 JSON 字串建立 List{0}",
"514985b2327f061ffb1c932f6b909979": "模型 {0} 未定義。",
"8091838319a5cc7d6a34af2f2a616ce9": "在模型中,內容名稱不應該為 \"{{constructor}}\"{0}",
"da02dd6c53d4148320eeb31718a7aebe": "內容 {0} 的類型無效",
"da751a8a748adbde5b55fa83b707b4e2": "不支援含有點的內容名稱。模型:{0},內容:{1}",
"3864f9be10f27723074566d2b3893514": "警告:模型 {0} {{strict mode: `throw`}} 已被移除,請改為使用 {{`strict: true`}},其會對不明內容傳回 {{`Validation Error`}}",
"881e4b0cb86ed59549248ee540a9fd10": "{0} 資料中不接受內容名稱 \"{{constructor}}\"",
"bdb11cc1c780c9ccac33c316cfdc9d82": "未定義內容 {0}.{1} 的類型",
"cd930369e86cdd222f7bd117c6f9fa94": "預設值提供者 {0} 不明",
"cfee4d8149316d9a647c0885cf3cafaf": "不支援含有點的內容名稱。模型:{0},動態內容:{1}",
"0c0b867aca0973ba26e887d3337cc4ec": "找不到 {{Polymorphic}} 模型:`{0}` 未設定",
"2f062cbecdf24245731bddc77714c814": "找不到 {1} 的 \"{0}\" 關係",
"3cde8cc9bca22c67278b202ab0720106": "對於 {1},找不到 id 為 {0} 的實例",
"6502a117987610380b9068ef98b1b0ee": "在 {0} 中找不到 ({1}.{2} ,{3}.{4}) 的記錄",
"6fcc2ff0db7a4f490f5e0ce9e24691f3": "{{HasOne}} 關係無法建立多個 {0} 實例",
"7e9530c0399289be0ee601a604be71ff": "{{BelongsTo}} 關係 {0} 是空的",
"7faa840eb6ce11250a141deb42a6c489": "不明關係 {{scope}}{0}",
"89afd3a9249f5a8d3edda07d84ca049d": "找不到 {{Polymorphic}} 模型:`{0}`",
"a004f310d315e592843776fab964eaeb": "{{Polymorphic}} 關係需要有通過模型",
"a25e41a39c60c4702e55d0c3936576a1": "索引鍵不符:{0}.{1}{2}{3}.{4}{5}",
"a327355560d495454fba2c1aad6bdf09": "不明範圍方法:{0}",
"e08ab0e1ab55f26c357061447b635905": "在 {0} 中找不到 ({1}.{2},{3}.{4}) 的記錄",
"e55937649d8d7a11706b8cec22d02eae": "{{HasOne}} 關係 {0} 是空的",
"2c4904377a87fdab502118719cc0d266": "不支援 {{Transaction}}",
"ecb7aa804bf54c682999d20d6436104c": "{{transaction}} 為非作用中:{0}",
"89bf6d92731fe7bd2146ce8d0bec205c": "引數無效,必須是字串、{{regex}} 文字或 {{RegExp}} 物件",
"8c5ab01638c1ac1d58168c6346a8481a": "無效 {{regex}} 旗標:{0}",
"a6c18a7f4390cd3d59a2a7a047ae2aab": "執行 \"{{npm install loopback-datasource-juggler}} {0}\" 指令",
"b138294f132edfe1eb2a8211150c7238": "查詢中有非預期的 `undefined`",
"8a39126103a157f501affa070367a1b0": "{0} 實例無效。詳細資料:{1}。"
}

View File

@ -1,4 +1,4 @@
// Copyright IBM Corp. 2015,2019. All Rights Reserved.
// Copyright IBM Corp. 2015,2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
@ -7,7 +7,7 @@
// A lightweight alternative to "depd" that works in the browser
module.exports = function depd(namespace) {
const warned = {};
var warned = {};
return function deprecate(message) {
if (warned[message]) return;
warned[message] = true;

View File

@ -1,20 +1,15 @@
// Copyright IBM Corp. 2016,2019. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const g = require('strong-globalize')();
var g = require('strong-globalize')();
const assert = require('assert');
const Connector = require('loopback-connector').Connector;
const debug = require('debug')('loopback:connector:kv-memory');
const minimatch = require('minimatch');
const util = require('util');
var assert = require('assert');
var Connector = require('loopback-connector').Connector;
var debug = require('debug')('loopback:connector:kv-memory');
var minimatch = require('minimatch');
var util = require('util');
exports.initialize = function initializeDataSource(dataSource, cb) {
const settings = dataSource.settings;
var settings = dataSource.settings;
dataSource.connector = new KeyValueMemoryConnector(settings, dataSource);
if (cb) process.nextTick(cb);
};
@ -30,7 +25,7 @@ function KeyValueMemoryConnector(settings, dataSource) {
this._store = Object.create(null);
this._setupRegularCleanup();
}
};
util.inherits(KeyValueMemoryConnector, Connector);
KeyValueMemoryConnector.prototype._setupRegularCleanup = function() {
@ -38,25 +33,25 @@ KeyValueMemoryConnector.prototype._setupRegularCleanup = function() {
// in order to release memory. Note that GET operation checks
// key expiration too, the scheduled cleanup is merely a performance
// optimization.
this._cleanupTimer = setInterval(
() => {
if (this && this._removeExpiredItems) {
this._removeExpiredItems();
var self = this;
var timer = this._cleanupTimer = setInterval(
function() {
if (self && self._removeExpiredItems) {
self._removeExpiredItems();
} else {
// The datasource/connector was destroyed - cancel the timer
clearInterval(this._cleanupTimer);
clearInterval(timer);
}
},
1000,
);
1000);
this._cleanupTimer.unref();
};
KeyValueMemoryConnector._removeExpiredItems = function() {
debug('Running scheduled cleanup of expired items.');
for (const modelName in this._store) {
const modelStore = this._store[modelName];
for (const key in modelStore) {
for (var modelName in this._store) {
var modelStore = this._store[modelName];
for (var key in modelStore) {
if (modelStore[key].isExpired()) {
debug('Removing expired key', key);
delete modelStore[key];
@ -73,8 +68,8 @@ KeyValueMemoryConnector.prototype._getStoreForModel = function(modelName) {
};
KeyValueMemoryConnector.prototype._removeIfExpired = function(modelName, key) {
const store = this._getStoreForModel(modelName);
let item = store[key];
var store = this._getStoreForModel(modelName);
var item = store[key];
if (item && item.isExpired()) {
debug('Removing expired key', key);
delete store[key];
@ -88,9 +83,9 @@ KeyValueMemoryConnector.prototype.get =
function(modelName, key, options, callback) {
this._removeIfExpired(modelName, key);
const store = this._getStoreForModel(modelName);
const item = store[key];
let value = item ? item.value : null;
var store = this._getStoreForModel(modelName);
var item = store[key];
var value = item ? item.value : null;
debug('GET %j %j -> %s', modelName, key, value);
if (/^buffer:/.test(value)) {
@ -108,7 +103,7 @@ function(modelName, key, options, callback) {
KeyValueMemoryConnector.prototype.set =
function(modelName, key, value, options, callback) {
const store = this._getStoreForModel(modelName);
var store = this._getStoreForModel(modelName);
if (Buffer.isBuffer(value)) {
value = 'buffer:' + value.toString('base64');
} else if (value instanceof Date) {
@ -127,11 +122,11 @@ KeyValueMemoryConnector.prototype.expire =
function(modelName, key, ttl, options, callback) {
this._removeIfExpired(modelName, key);
const store = this._getStoreForModel(modelName);
var store = this._getStoreForModel(modelName);
if (!(key in store)) {
return process.nextTick(function() {
const err = new Error(g.f('Cannot expire unknown key %j', key));
var err = new Error(g.f('Cannot expire unknown key %j', key));
err.statusCode = 404;
callback(err);
});
@ -146,18 +141,18 @@ KeyValueMemoryConnector.prototype.ttl =
function(modelName, key, options, callback) {
this._removeIfExpired(modelName, key);
const store = this._getStoreForModel(modelName);
var store = this._getStoreForModel(modelName);
// key is unknown
if (!(key in store)) {
return process.nextTick(function() {
const err = new Error(g.f('Cannot get TTL for unknown key %j', key));
var err = new Error(g.f('Cannot get TTL for unknown key %j', key));
err.statusCode = 404;
callback(err);
});
}
const ttl = store[key].getTtl();
var ttl = store[key].getTtl();
debug('TTL %j %j -> %s', modelName, key, ttl);
process.nextTick(function() {
@ -167,20 +162,20 @@ function(modelName, key, options, callback) {
KeyValueMemoryConnector.prototype.iterateKeys =
function(modelName, filter, options, callback) {
const store = this._getStoreForModel(modelName);
const self = this;
const checkFilter = createMatcher(filter.match);
var store = this._getStoreForModel(modelName);
var self = this;
var checkFilter = createMatcher(filter.match);
const keys = Object.keys(store).filter(function(key) {
var keys = Object.keys(store).filter(function(key) {
return !self._removeIfExpired(modelName, key) && checkFilter(key);
});
debug('ITERATE KEYS %j -> %s keys', modelName, keys.length);
let ix = 0;
var ix = 0;
return {
next: function(cb) {
const value = ix < keys.length ? keys[ix++] : undefined;
var value = ix < keys.length ? keys[ix++] : undefined;
setImmediate(function() { cb(null, value); });
},
};
@ -207,15 +202,15 @@ KeyValueMemoryConnector.prototype.disconnect = function(callback) {
KeyValueMemoryConnector.prototype.delete =
function(modelName, key, options, callback) {
const store = this._getStoreForModel(modelName);
var store = this._getStoreForModel(modelName);
delete store[key];
callback();
};
KeyValueMemoryConnector.prototype.deleteAll =
function(modelName, options, callback) {
const modelStore = this._getStoreForModel(modelName);
for (const key in modelStore)
var modelStore = this._getStoreForModel(modelName);
for (var key in modelStore)
delete modelStore[key];
callback();
};

View File

@ -1,4 +1,4 @@
// Copyright IBM Corp. 2013,2019. All Rights Reserved.
// Copyright IBM Corp. 2013,2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
@ -6,14 +6,14 @@
'use strict';
/* global window:false */
const g = require('strong-globalize')();
const util = require('util');
const Connector = require('loopback-connector').Connector;
const geo = require('../geo');
const utils = require('../utils');
const fs = require('fs');
const async = require('async');
const debug = require('debug')('loopback:connector:memory');
var g = require('strong-globalize')();
var util = require('util');
var Connector = require('loopback-connector').Connector;
var geo = require('../geo');
var utils = require('../utils');
var fs = require('fs');
var async = require('async');
var debug = require('debug')('loopback:connector:memory');
/**
* Initialize the Memory connector against the given data source
@ -47,8 +47,6 @@ function Memory(m, settings) {
util.inherits(Memory, Connector);
Memory.prototype.multiInsertSupported = true;
Memory.prototype.getDefaultIdType = function() {
return Number;
};
@ -84,7 +82,7 @@ function deserialize(dbObj) {
}
Memory.prototype.getCollection = function(model) {
const modelClass = this._models[model];
var modelClass = this._models[model];
if (modelClass && modelClass.settings.memory) {
model = modelClass.settings.memory.collection || model;
}
@ -113,15 +111,15 @@ Memory.prototype.collectionSeq = function(model, val) {
* @returns {*} The file operation queue
*/
Memory.prototype.setupFileQueue = function() {
const self = this;
var self = this;
if (!this.fileQueue) {
// Create a queue for writes
this.fileQueue = async.queue(function(task, done) {
const callback = task.callback || function() {};
const file = self.settings.file;
var callback = task.callback || function() {};
var file = self.settings.file;
if (task.operation === 'write') {
// Flush out the models/ids
const data = JSON.stringify({
var data = JSON.stringify({
ids: self.ids,
models: self.cache,
}, null, ' ');
@ -132,7 +130,7 @@ Memory.prototype.setupFileQueue = function() {
callback(err, task.data);
});
} else if (task.operation === 'read') {
debug('Reading cache from %s', file);
debug('Reading cache from %s: %s', file, data);
fs.readFile(file, {
encoding: 'utf8',
flag: 'r',
@ -149,7 +147,7 @@ Memory.prototype.setupFileQueue = function() {
}
});
} else {
const err = new Error('Unknown type of task');
var err = new Error('Unknown type of task');
done(err);
callback(err);
}
@ -178,8 +176,8 @@ Memory.prototype.parseAndLoad = function(data, callback) {
};
Memory.prototype.loadFromFile = function(callback) {
const hasLocalStorage = typeof window !== 'undefined' && window.localStorage;
const localStorage = hasLocalStorage && this.settings.localStorage;
var hasLocalStorage = typeof window !== 'undefined' && window.localStorage;
var localStorage = hasLocalStorage && this.settings.localStorage;
if (this.settings.file) {
debug('Queueing read %s', this.settings.file);
@ -188,7 +186,7 @@ Memory.prototype.loadFromFile = function(callback) {
callback: callback,
});
} else if (localStorage) {
let data = window.localStorage.getItem(localStorage);
var data = window.localStorage.getItem(localStorage);
data = data || '{}';
this.parseAndLoad(data, callback);
} else {
@ -201,9 +199,9 @@ Memory.prototype.loadFromFile = function(callback) {
* @param {Function} callback
*/
Memory.prototype.saveToFile = function(result, callback) {
const file = this.settings.file;
const hasLocalStorage = typeof window !== 'undefined' && window.localStorage;
const localStorage = hasLocalStorage && this.settings.localStorage;
var file = this.settings.file;
var hasLocalStorage = typeof window !== 'undefined' && window.localStorage;
var localStorage = hasLocalStorage && this.settings.localStorage;
if (file) {
debug('Queueing write %s', this.settings.file);
// Enqueue the write
@ -214,7 +212,7 @@ Memory.prototype.saveToFile = function(result, callback) {
});
} else if (localStorage) {
// Flush out the models/ids
const data = JSON.stringify({
var data = JSON.stringify({
ids: this.ids,
models: this.cache,
}, null, ' ');
@ -231,26 +229,26 @@ Memory.prototype.saveToFile = function(result, callback) {
Memory.prototype.define = function defineModel(definition) {
this.constructor.super_.prototype.define.apply(this, [].slice.call(arguments));
const m = definition.model.modelName;
var m = definition.model.modelName;
if (!this.collection(m)) this.initCollection(m);
};
Memory.prototype._createSync = function(model, data, fn) {
// FIXME: [rfeng] We need to generate unique ids based on the id type
// FIXME: [rfeng] We don't support composite ids yet
let currentId = this.collectionSeq(model);
var currentId = this.collectionSeq(model);
if (currentId === undefined) { // First time
currentId = this.collectionSeq(model, 1);
}
let id = this.getIdValue(model, data) || currentId;
var id = this.getIdValue(model, data) || currentId;
if (id > currentId) {
// If the id is passed in and the value is greater than the current id
currentId = id;
}
this.collectionSeq(model, Number(currentId) + 1);
const props = this._models[model].properties;
const idName = this.idName(model);
var props = this._models[model].properties;
var idName = this.idName(model);
id = (props[idName] && props[idName].type && props[idName].type(id)) || id;
this.setIdValue(model, data, id);
if (!this.collection(model)) {
@ -258,7 +256,7 @@ Memory.prototype._createSync = function(model, data, fn) {
}
if (this.collection(model)[id]) {
const error = new Error(g.f('Duplicate entry for %s.%s', model, idName));
var error = new Error(g.f('Duplicate entry for %s.%s', model, idName));
error.statusCode = error.status = 409;
return fn(error);
}
@ -268,42 +266,19 @@ Memory.prototype._createSync = function(model, data, fn) {
};
Memory.prototype.create = function create(model, data, options, callback) {
const self = this;
var self = this;
this._createSync(model, data, function(err, id) {
if (err) {
return process.nextTick(function() {
callback(err);
});
}
};
self.saveToFile(id, callback);
});
};
Memory.prototype.createAll = function create(model, dataArray, options, callback) {
const returnArr = [];
async.eachSeries(
dataArray,
(data, cb) => {
this._createSync(model, data, (err, id) => {
if (err) {
return process.nextTick(function() {
cb(err);
});
}
const returnData = Object.assign({}, data);
this.setIdValue(model, returnData, id);
returnArr.push(returnData);
this.saveToFile(id, cb);
});
},
(err) => {
callback(err, returnArr);
},
);
};
Memory.prototype.updateOrCreate = function(model, data, options, callback) {
const self = this;
var self = this;
this.exists(model, self.getIdValue(model, data), options, function(err, exists) {
if (exists) {
self.save(model, data, options, function(err, data) {
@ -320,10 +295,10 @@ Memory.prototype.updateOrCreate = function(model, data, options, callback) {
Memory.prototype.patchOrCreateWithWhere =
Memory.prototype.upsertWithWhere = function(model, where, data, options, callback) {
const self = this;
const primaryKey = this.idName(model);
const filter = {where: where};
const nodes = self._findAllSkippingIncludes(model, filter);
var self = this;
var primaryKey = this.idName(model);
var filter = {where: where};
var nodes = self._findAllSkippingIncludes(model, filter);
if (nodes.length === 0) {
return self._createSync(model, data, function(err, id) {
if (err) return process.nextTick(function() { callback(err); });
@ -334,13 +309,13 @@ Memory.prototype.upsertWithWhere = function(model, where, data, options, callbac
});
}
if (nodes.length === 1) {
const primaryKeyValue = nodes[0][primaryKey];
var primaryKeyValue = nodes[0][primaryKey];
self.updateAttributes(model, primaryKeyValue, data, options, function(err, data) {
callback(err, data, {isNewInstance: false});
});
} else {
process.nextTick(function() {
const error = new Error('There are multiple instances found.' +
var error = new Error('There are multiple instances found.' +
'Upsert Operation will not be performed!');
error.statusCode = 400;
callback(error);
@ -348,10 +323,10 @@ Memory.prototype.upsertWithWhere = function(model, where, data, options, callbac
}
};
Memory.prototype.findOrCreate = function(model, filter, data, options, callback) {
const self = this;
const nodes = self._findAllSkippingIncludes(model, filter);
const found = nodes[0];
Memory.prototype.findOrCreate = function(model, filter, data, callback) {
var self = this;
var nodes = self._findAllSkippingIncludes(model, filter);
var found = nodes[0];
if (!found) {
// Calling _createSync to update the collection in a sync way and to guarantee to create it in the same turn of even loop
@ -370,7 +345,7 @@ Memory.prototype.findOrCreate = function(model, filter, data, options, callback)
});
}
self._models[model].model.include(nodes[0], filter.include, options, function(err, nodes) {
self._models[model].model.include(nodes[0], filter.include, {}, function(err, nodes) {
process.nextTick(function() {
if (err) return callback(err);
callback(null, nodes[0], false);
@ -379,10 +354,10 @@ Memory.prototype.findOrCreate = function(model, filter, data, options, callback)
};
Memory.prototype.save = function save(model, data, options, callback) {
const self = this;
const id = this.getIdValue(model, data);
const cachedModels = this.collection(model);
let modelData = cachedModels && this.collection(model)[id];
var self = this;
var id = this.getIdValue(model, data);
var cachedModels = this.collection(model);
var modelData = cachedModels && this.collection(model)[id];
modelData = modelData && deserialize(modelData);
if (modelData) {
data = merge(modelData, data);
@ -406,7 +381,7 @@ Memory.prototype.find = function find(model, id, options, callback) {
};
Memory.prototype.destroy = function destroy(model, id, options, callback) {
const exists = this.collection(model)[id];
var exists = this.collection(model)[id];
delete this.collection(model)[id];
this.saveToFile({count: exists ? 1 : 0}, callback);
};
@ -414,9 +389,9 @@ Memory.prototype.destroy = function destroy(model, id, options, callback) {
Memory.prototype.fromDb = function(model, data) {
if (!data) return null;
data = deserialize(data);
const props = this._models[model].properties;
for (const key in data) {
let val = data[key];
var props = this._models[model].properties;
for (var key in data) {
var val = data[key];
if (val === undefined || val === null) {
continue;
}
@ -442,9 +417,9 @@ function getValue(obj, path) {
if (obj == null) {
return undefined;
}
const keys = path.split('.');
let val = obj;
for (let i = 0, n = keys.length; i < n; i++) {
var keys = path.split('.');
var val = obj;
for (var i = 0, n = keys.length; i < n; i++) {
val = val[keys[i]];
if (val == null) {
return val;
@ -454,26 +429,26 @@ function getValue(obj, path) {
}
Memory.prototype._findAllSkippingIncludes = function(model, filter) {
let nodes = Object.keys(this.collection(model)).map(function(key) {
var nodes = Object.keys(this.collection(model)).map(function(key) {
return this.fromDb(model, this.collection(model)[key]);
}.bind(this));
if (filter) {
if (!filter.order) {
const idNames = this.idNames(model);
var idNames = this.idNames(model);
if (idNames && idNames.length) {
filter.order = idNames;
}
}
// do we need some sorting?
if (filter.order) {
let orders = filter.order;
var orders = filter.order;
if (typeof filter.order === 'string') {
orders = [filter.order];
}
orders.forEach(function(key, i) {
let reverse = 1;
const m = key.match(/\s+(A|DE)SC$/i);
var reverse = 1;
var m = key.match(/\s+(A|DE)SC$/i);
if (m) {
key = key.replace(/\s+(A|DE)SC/i, '');
if (m[1].toLowerCase() === 'de') reverse = -1;
@ -483,7 +458,7 @@ Memory.prototype._findAllSkippingIncludes = function(model, filter) {
nodes = nodes.sort(sorting.bind(orders));
}
const nearFilter = geo.nearFilter(filter.where);
var nearFilter = geo.nearFilter(filter.where);
// geo sorting
if (nearFilter) {
@ -500,18 +475,18 @@ Memory.prototype._findAllSkippingIncludes = function(model, filter) {
}
// limit/skip
const skip = filter.skip || filter.offset || 0;
const limit = filter.limit || nodes.length;
var skip = filter.skip || filter.offset || 0;
var limit = filter.limit || nodes.length;
nodes = nodes.slice(skip, skip + limit);
}
return nodes;
function sorting(a, b) {
let undefinedA, undefinedB;
var undefinedA, undefinedB;
for (let i = 0, l = this.length; i < l; i++) {
const aVal = getValue(a, this[i].key);
const bVal = getValue(b, this[i].key);
for (var i = 0, l = this.length; i < l; i++) {
var aVal = getValue(a, this[i].key);
var bVal = getValue(b, this[i].key);
undefinedB = bVal === undefined && aVal !== undefined;
undefinedA = aVal === undefined && bVal !== undefined;
@ -527,8 +502,8 @@ Memory.prototype._findAllSkippingIncludes = function(model, filter) {
};
Memory.prototype.all = function all(model, filter, options, callback) {
const self = this;
const nodes = self._findAllSkippingIncludes(model, filter);
var self = this;
var nodes = self._findAllSkippingIncludes(model, filter);
process.nextTick(function() {
if (filter && filter.include) {
@ -540,11 +515,11 @@ Memory.prototype.all = function all(model, filter, options, callback) {
};
function applyFilter(filter) {
const where = filter.where;
var where = filter.where;
if (typeof where === 'function') {
return where;
}
const keys = Object.keys(where);
var keys = Object.keys(where);
return function(obj) {
return keys.every(function(key) {
if (key === 'and' || key === 'or') {
@ -562,18 +537,18 @@ function applyFilter(filter) {
}
}
const value = getValue(obj, key);
var value = getValue(obj, key);
// Support referencesMany and other embedded relations
// Also support array types. Mongo, possibly PostgreSQL
if (Array.isArray(value)) {
const matcher = where[key];
var matcher = where[key];
// The following condition is for the case where we are querying with
// a neq filter, and when the value is an empty array ([]).
if (matcher.neq !== undefined && value.length <= 0) {
return true;
}
return value.some(function(v, i) {
const filter = {where: {}};
var filter = {where: {}};
filter.where[i] = matcher;
return applyFilter(filter)(value);
});
@ -585,11 +560,11 @@ function applyFilter(filter) {
// If we have a composed key a.b and b would resolve to a property of an object inside an array
// then, we attempt to emulate mongo db matching. Helps for embedded relations
const dotIndex = key.indexOf('.');
const subValue = obj[key.substring(0, dotIndex)];
var dotIndex = key.indexOf('.');
var subValue = obj[key.substring(0, dotIndex)];
if (dotIndex !== -1) {
const subFilter = {where: {}};
const subKey = key.substring(dotIndex + 1);
var subFilter = {where: {}};
var subKey = key.substring(dotIndex + 1);
subFilter.where[subKey] = where[key];
if (Array.isArray(subValue)) {
return subValue.some(applyFilter(subFilter));
@ -606,12 +581,12 @@ function applyFilter(filter) {
if (pattern instanceof RegExp) {
return pattern;
}
let regex = '';
var regex = '';
// Escaping user input to be treated as a literal string within a regular expression
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#Writing_a_Regular_Expression_Pattern
pattern = pattern.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, '\\$1');
for (let i = 0, n = pattern.length; i < n; i++) {
const char = pattern.charAt(i);
for (var i = 0, n = pattern.length; i < n; i++) {
var char = pattern.charAt(i);
if (char === '\\') {
i++; // Skip to next char
if (i < n) {
@ -638,8 +613,8 @@ function applyFilter(filter) {
return value.match(example);
}
if (example == null) {
return value == null;
if (example === undefined) {
return undefined;
}
if (typeof example === 'object' && example !== null) {
@ -652,7 +627,7 @@ function applyFilter(filter) {
return true;
}
let i;
var i;
if (example.inq) {
// if (!value) return false;
for (i = 0; i < example.inq.length; i++) {
@ -682,7 +657,7 @@ function applyFilter(filter) {
}
if (example.like || example.nlike || example.ilike || example.nilike) {
let like = example.like || example.nlike || example.ilike || example.nilike;
var like = example.like || example.nlike || example.ilike || example.nilike;
if (typeof like === 'string') {
like = toRegExp(like);
}
@ -707,13 +682,9 @@ function applyFilter(filter) {
return true;
}
}
// compare date
if (example instanceof Date && value instanceof Date) {
return example.getTime() === value.getTime();
}
// not strict equality
return example == value;
return (example !== null ? example.toString() : example) ==
(value != null ? value.toString() : value);
}
/**
@ -738,7 +709,7 @@ function applyFilter(filter) {
return val1 - val2;
}
if (val1 instanceof Date) {
const result = val1 - val2;
var result = val1 - val2;
return result;
}
// Return NaN if we don't know how to compare
@ -763,9 +734,9 @@ function applyFilter(filter) {
}
Memory.prototype.destroyAll = function destroyAll(model, where, options, callback) {
const cache = this.collection(model);
let filter = null;
let count = 0;
var cache = this.collection(model);
var filter = null;
var count = 0;
if (where) {
filter = applyFilter({where: where});
Object.keys(cache).forEach(function(id) {
@ -782,10 +753,10 @@ Memory.prototype.destroyAll = function destroyAll(model, where, options, callbac
};
Memory.prototype.count = function count(model, where, options, callback) {
const cache = this.collection(model);
let data = Object.keys(cache);
var cache = this.collection(model);
var data = Object.keys(cache);
if (where) {
const filter = {where: where};
var filter = {where: where};
data = data.map(function(id) {
return this.fromDb(model, cache[id]);
}.bind(this));
@ -798,16 +769,16 @@ Memory.prototype.count = function count(model, where, options, callback) {
Memory.prototype.update =
Memory.prototype.updateAll = function updateAll(model, where, data, options, cb) {
const self = this;
const cache = this.collection(model);
let filter = null;
var self = this;
var cache = this.collection(model);
var filter = null;
where = where || {};
filter = applyFilter({where: where});
const ids = Object.keys(cache);
let count = 0;
var ids = Object.keys(cache);
var count = 0;
async.each(ids, function(id, done) {
const inst = self.fromDb(model, cache[id]);
var inst = self.fromDb(model, cache[id]);
if (!filter || filter(inst)) {
count++;
// The id value from the cache is string
@ -825,7 +796,7 @@ Memory.prototype.update =
Memory.prototype.updateAttributes = function updateAttributes(model, id, data, options, cb) {
if (!id) {
const err = new Error(g.f('You must provide an {{id}} when updating attributes!'));
var err = new Error(g.f('You must provide an {{id}} when updating attributes!'));
if (cb) {
return cb(err);
} else {
@ -838,40 +809,40 @@ Memory.prototype.updateAttributes = function updateAttributes(model, id, data, o
this.setIdValue(model, data, id);
const cachedModels = this.collection(model);
const modelData = cachedModels && this.collection(model)[id];
var cachedModels = this.collection(model);
var modelData = cachedModels && this.collection(model)[id];
if (modelData) {
this.save(model, data, options, cb);
} else {
const msg = g.f('Could not update attributes. {{Object}} with {{id}} %s does not exist!', id);
const error = new Error(msg);
var msg = g.f('Could not update attributes. {{Object}} with {{id}} %s does not exist!', id);
var error = new Error(msg);
error.statusCode = error.status = 404;
cb(error);
}
};
Memory.prototype.replaceById = function(model, id, data, options, cb) {
const self = this;
var self = this;
if (!id) {
const err = new Error(g.f('You must provide an {{id}} when replacing!'));
var err = new Error(g.f('You must provide an {{id}} when replacing!'));
return process.nextTick(function() { cb(err); });
}
// Do not modify the data object passed in arguments
data = Object.create(data);
this.setIdValue(model, data, id);
const cachedModels = this.collection(model);
const modelData = cachedModels && this.collection(model)[id];
var cachedModels = this.collection(model);
var modelData = cachedModels && this.collection(model)[id];
if (!modelData) {
const msg = 'Could not replace. Object with id ' + id + ' does not exist!';
const error = new Error(msg);
var msg = 'Could not replace. Object with id ' + id + ' does not exist!';
var error = new Error(msg);
error.statusCode = error.status = 404;
return process.nextTick(function() { cb(error); });
}
const newModelData = {};
for (const key in data) {
const val = data[key];
var newModelData = {};
for (var key in data) {
var val = data[key];
if (typeof val === 'function') {
continue; // Skip methods
}
@ -885,13 +856,13 @@ Memory.prototype.replaceById = function(model, id, data, options, cb) {
};
Memory.prototype.replaceOrCreate = function(model, data, options, callback) {
const self = this;
const idName = self.idNames(model)[0];
const idValue = self.getIdValue(model, data);
const filter = {where: {}};
var self = this;
var idName = self.idNames(model)[0];
var idValue = self.getIdValue(model, data);
var filter = {where: {}};
filter.where[idName] = idValue;
const nodes = self._findAllSkippingIncludes(model, filter);
const found = nodes[0];
var nodes = self._findAllSkippingIncludes(model, filter);
var found = nodes[0];
if (!found) {
// Calling _createSync to update the collection in a sync way and
@ -904,7 +875,7 @@ Memory.prototype.replaceOrCreate = function(model, data, options, callback) {
});
});
}
const id = self.getIdValue(model, data);
var id = self.getIdValue(model, data);
self.collection(model)[id] = serialize(data);
self.saveToFile(data, function(err) {
callback(err, self.fromDb(model, data), {isNewInstance: false});
@ -925,7 +896,7 @@ Memory.prototype.buildNearFilter = function(filter) {
};
Memory.prototype.automigrate = function(models, cb) {
const self = this;
var self = this;
if ((!cb) && ('function' === typeof models)) {
cb = models;
@ -941,7 +912,7 @@ Memory.prototype.automigrate = function(models, cb) {
return process.nextTick(cb);
}
const invalidModels = models.filter(function(m) {
var invalidModels = models.filter(function(m) {
return !(m in self._models);
});
@ -964,8 +935,8 @@ function merge(base, update) {
}
// We cannot use Object.keys(update) if the update is an instance of the model
// class as the properties are defined at the ModelClass.prototype level
for (const key in update) {
const val = update[key];
for (var key in update) {
var val = update[key];
if (typeof val === 'function') {
continue; // Skip methods
}

View File

@ -1,15 +1,15 @@
// Copyright IBM Corp. 2014,2019. All Rights Reserved.
// Copyright IBM Corp. 2014,2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const g = require('strong-globalize')();
const util = require('util');
const Connector = require('loopback-connector').Connector;
const utils = require('../utils');
const crypto = require('crypto');
var g = require('strong-globalize')();
var util = require('util');
var Connector = require('loopback-connector').Connector;
var utils = require('../utils');
var crypto = require('crypto');
/**
* Initialize the Transient connector against the given data source
@ -59,16 +59,16 @@ Transient.prototype.connect = function(callback) {
};
Transient.prototype.generateId = function(model, data, idName) {
let idType;
const props = this._models[model].properties;
var idType;
var props = this._models[model].properties;
if (idName) idType = props[idName] && props[idName].type;
idType = idType || this.getDefaultIdType();
if (idType === Number) {
return Math.floor(Math.random() * 10000); // max. 4 digits
} else {
return crypto.randomBytes(Math.ceil(24 / 2))
.toString('hex') // convert to hexadecimal format
.slice(0, 24); // return required number of characters
.toString('hex') // convert to hexadecimal format
.slice(0, 24); // return required number of characters
}
};
@ -89,11 +89,10 @@ Transient.prototype.count = function count(model, callback, where) {
};
Transient.prototype.create = function create(model, data, callback) {
const props = this._models[model].properties;
const idName = this.idName(model);
let id = undefined;
var props = this._models[model].properties;
var idName = this.idName(model);
if (idName && props[idName]) {
id = this.getIdValue(model, data) || this.generateId(model, data, idName);
var id = this.getIdValue(model, data) || this.generateId(model, data, idName);
id = (props[idName] && props[idName].type && props[idName].type(id)) || id;
this.setIdValue(model, data, id);
}
@ -106,13 +105,13 @@ Transient.prototype.save = function save(model, data, callback) {
Transient.prototype.update =
Transient.prototype.updateAll = function updateAll(model, where, data, cb) {
const count = 0;
var count = 0;
this.flush('update', {count: count}, cb);
};
Transient.prototype.updateAttributes = function updateAttributes(model, id, data, cb) {
if (!id) {
const err = new Error(g.f('You must provide an {{id}} when updating attributes!'));
var err = new Error(g.f('You must provide an {{id}} when updating attributes!'));
if (cb) {
return cb(err);
} else {

1614
lib/dao.js

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,11 @@
// Copyright IBM Corp. 2017,2019. All Rights Reserved.
// Copyright IBM Corp. 2013,2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const inspect = require('util').inspect;
var inspect = require('util').inspect;
module.exports = DateString;
@ -53,10 +53,6 @@ function DateString(value) {
return new DateString(value);
}
if (value instanceof DateString) {
value = value.when;
}
if (typeof(value) !== 'string') {
throw new Error('Input must be a string');
}
@ -64,7 +60,7 @@ function DateString(value) {
Object.defineProperty(this, 'when', {
get: () => { return this._when; },
set: (val) => {
const d = new Date(val);
var d = new Date(val);
if (isNaN(d.getTime())) {
throw new Error('Invalid date');
} else {
@ -75,7 +71,7 @@ function DateString(value) {
});
this.when = value;
}
};
/**
* Returns the value of DateString in its original form.
@ -101,10 +97,3 @@ DateString.prototype.inspect = function(depth, options) {
_date: this._date,
});
};
if (inspect.custom) {
// Node.js 12+ no longer recognizes "inspect" method,
// it uses "inspect.custom" symbol as the key instead
// TODO(semver-major) always use the symbol key only (requires Node.js 8+).
DateString.prototype[inspect.custom] = DateString.prototype.inspect;
}

View File

@ -1,21 +1,17 @@
// Copyright IBM Corp. 2013,2019. All Rights Reserved.
// Copyright IBM Corp. 2013,2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const assert = require('assert');
var assert = require('assert');
/*!
* Get a near filter from a given where object. For connector use only.
*/
exports.nearFilter = function nearFilter(where) {
const nearResults = [];
nearSearch(where);
return (!nearResults.length ? false : nearResults);
function nearSearch(clause, parentKeys) {
if (typeof clause !== 'object') {
return false;
@ -26,12 +22,12 @@ exports.nearFilter = function nearFilter(where) {
if (typeof clause[clauseKey] !== 'object' || !clause[clauseKey]) return;
if (Array.isArray(clause[clauseKey])) {
clause[clauseKey].forEach(function(el, index) {
const ret = nearSearch(el, parentKeys.concat(clauseKey).concat(index));
var ret = nearSearch(el, parentKeys.concat(clauseKey).concat(index));
if (ret) return ret;
});
} else {
if (clause[clauseKey].hasOwnProperty('near')) {
const result = clause[clauseKey];
var result = clause[clauseKey];
nearResults.push({
near: result.near,
maxDistance: result.maxDistance,
@ -42,9 +38,13 @@ exports.nearFilter = function nearFilter(where) {
key: clauseKey,
});
}
}
};
});
}
var nearResults = [];
nearSearch(where);
return (!nearResults.length ? false : nearResults);
};
/*!
@ -68,19 +68,19 @@ exports.nearFilter = function nearFilter(where) {
*/
exports.filter = function(rawResults, filters) {
const distances = {};
const results = [];
var distances = {};
var results = [];
filters.forEach(function(filter) {
const origin = filter.near;
const max = filter.maxDistance > 0 ? filter.maxDistance : false;
const min = filter.minDistance > 0 ? filter.minDistance : false;
const unit = filter.unit;
const key = filter.key;
var origin = filter.near;
var max = filter.maxDistance > 0 ? filter.maxDistance : false;
var min = filter.minDistance > 0 ? filter.minDistance : false;
var unit = filter.unit;
var key = filter.key;
// create distance index
rawResults.forEach(function(result) {
let loc = result[key];
var loc = result[key];
// filter out results without locations
if (!loc) return;
@ -90,7 +90,7 @@ exports.filter = function(rawResults, filters) {
if (typeof loc.lat !== 'number') return;
if (typeof loc.lng !== 'number') return;
const d = GeoPoint.distanceBetween(origin, loc, {type: unit});
var d = GeoPoint.distanceBetween(origin, loc, {type: unit});
// filter result if distance is either < minDistance or > maxDistance
if ((min && d < min) || (max && d > max)) return;
@ -100,12 +100,12 @@ exports.filter = function(rawResults, filters) {
});
results.sort(function(resA, resB) {
const a = resA[key];
const b = resB[key];
var a = resA[key];
var b = resB[key];
if (a && b) {
const da = distances[resA.id];
const db = distances[resB.id];
var da = distances[resA.id];
var db = distances[resB.id];
if (db === da) return 0;
return da > db ? 1 : -1;
@ -231,11 +231,11 @@ GeoPoint.distanceBetween = function distanceBetween(a, b, options) {
b = GeoPoint(b);
}
const x1 = a.lat;
const y1 = a.lng;
var x1 = a.lat;
var y1 = a.lng;
const x2 = b.lat;
const y2 = b.lng;
var x2 = b.lat;
var y2 = b.lng;
return geoDistance(x1, y1, x2, y2, options);
};
@ -283,13 +283,13 @@ GeoPoint.prototype.toString = function() {
*/
// factor to convert degrees to radians
const DEG2RAD = 0.01745329252;
var DEG2RAD = 0.01745329252;
// factor to convert radians degrees to degrees
const RAD2DEG = 57.29577951308;
var RAD2DEG = 57.29577951308;
// radius of the earth
const EARTH_RADIUS = {
var EARTH_RADIUS = {
kilometers: 6370.99056,
meters: 6370990.56,
miles: 3958.75,
@ -299,7 +299,7 @@ const EARTH_RADIUS = {
};
function geoDistance(x1, y1, x2, y2, options) {
const type = (options && options.type) || 'miles';
var type = (options && options.type) || 'miles';
// Convert to radians
x1 = x1 * DEG2RAD;
@ -309,11 +309,11 @@ function geoDistance(x1, y1, x2, y2, options) {
// use the haversine formula to calculate distance for any 2 points on a sphere.
// ref http://en.wikipedia.org/wiki/Haversine_formula
const haversine = function(a) {
var haversine = function(a) {
return Math.pow(Math.sin(a / 2.0), 2);
};
const f = Math.sqrt(haversine(x2 - x1) + Math.cos(x2) * Math.cos(x1) * haversine(y2 - y1));
var f = Math.sqrt(haversine(x2 - x1) + Math.cos(x2) * Math.cos(x1) * haversine(y2 - y1));
return 2 * Math.asin(f) * EARTH_RADIUS[type];
}

View File

@ -1,12 +1,12 @@
// Copyright IBM Corp. 2013,2019. All Rights Reserved.
// Copyright IBM Corp. 2013,2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const deprecated = require('depd')('loopback-datasource-juggler');
const g = require('strong-globalize')();
var deprecated = require('depd')('loopback-datasource-juggler');
var g = require('strong-globalize')();
/*!
* Module exports
@ -48,16 +48,16 @@ Hookable.afterDestroy = null;
* @param {Function} callback
*/
Hookable.prototype.trigger = function trigger(actionName, work, data, callback) {
const capitalizedName = capitalize(actionName);
let beforeHook = this.constructor['before' + capitalizedName] ||
var capitalizedName = capitalize(actionName);
var beforeHook = this.constructor['before' + capitalizedName] ||
this.constructor['pre' + capitalizedName];
let afterHook = this.constructor['after' + capitalizedName] ||
var afterHook = this.constructor['after' + capitalizedName] ||
this.constructor['post' + capitalizedName];
if (actionName === 'validate') {
beforeHook = beforeHook || this.constructor.beforeValidation;
afterHook = afterHook || this.constructor.afterValidation;
}
const inst = this;
var inst = this;
if (actionName !== 'initialize') {
if (beforeHook)
@ -100,13 +100,13 @@ function capitalize(string) {
}
function deprecateHook(ctor, prefixes, capitalizedName) {
const candidateNames = prefixes.map(function(p) { return p + capitalizedName; });
var candidateNames = prefixes.map(function(p) { return p + capitalizedName; });
if (capitalizedName === 'Validate')
candidateNames.push(prefixes[0] + 'Validation');
let hookName = candidateNames.filter(function(hook) { return !!ctor[hook]; })[0];
var hookName = candidateNames.filter(function(hook) { return !!ctor[hook]; })[0];
if (!hookName) return; // just to be sure, this should never happen
if (ctor.modelName) hookName = ctor.modelName + '.' + hookName;
if (ctor.modelName) hookName = ctor.modelName + '.' + hookName;
deprecated(g.f('Model hook "%s" is deprecated, ' +
'use Operation hooks instead. ' +
'{{http://docs.strongloop.com/display/LB/Operation+hooks}}', hookName));

View File

@ -1,22 +1,19 @@
// Copyright IBM Corp. 2013,2019. All Rights Reserved.
// Copyright IBM Corp. 2013,2015. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const async = require('async');
const g = require('strong-globalize')();
const utils = require('./utils');
const List = require('./list');
const includeUtils = require('./include_utils');
const isPlainObject = utils.isPlainObject;
const defineCachedRelations = utils.defineCachedRelations;
const uniq = utils.uniq;
const idName = utils.idName;
const debug = require('debug')('loopback:include');
const DISALLOWED_TYPES = ['boolean', 'number', 'symbol', 'function'];
var async = require('async');
var g = require('strong-globalize')();
var utils = require('./utils');
var List = require('./list');
var includeUtils = require('./include_utils');
var isPlainObject = utils.isPlainObject;
var defineCachedRelations = utils.defineCachedRelations;
var uniq = utils.uniq;
var idName = utils.idName;
/*!
* Normalize the include to be an array
@ -24,19 +21,19 @@ const DISALLOWED_TYPES = ['boolean', 'number', 'symbol', 'function'];
* @returns {*}
*/
function normalizeInclude(include) {
let newInclude;
var newInclude;
if (typeof include === 'string') {
return [include];
} else if (isPlainObject(include)) {
// Build an array of key/value pairs
newInclude = [];
const rel = include.rel || include.relation;
const obj = {};
var rel = include.rel || include.relation;
var obj = {};
if (typeof rel === 'string') {
obj[rel] = new IncludeScope(include.scope);
newInclude.push(obj);
} else {
for (const key in include) {
for (var key in include) {
obj[key] = include[key];
newInclude.push(obj);
}
@ -44,14 +41,11 @@ function normalizeInclude(include) {
return newInclude;
} else if (Array.isArray(include)) {
newInclude = [];
for (let i = 0, n = include.length; i < n; i++) {
const subIncludes = normalizeInclude(include[i]);
for (var i = 0, n = include.length; i < n; i++) {
var subIncludes = normalizeInclude(include[i]);
newInclude = newInclude.concat(subIncludes);
}
return newInclude;
} else if (DISALLOWED_TYPES.includes(typeof include)) {
debug('Ignoring invalid "include" value of type %s:', typeof include, include);
return [];
} else {
return include;
}
@ -85,8 +79,8 @@ function lookupModel(models, modelName) {
if (models[modelName]) {
return models[modelName];
}
const lookupClassName = modelName.toLowerCase();
for (const name in models) {
var lookupClassName = modelName.toLowerCase();
for (var name in models) {
if (name.toLowerCase() === lookupClassName) {
return models[name];
}
@ -166,7 +160,7 @@ Inclusion.include = function(objects, include, options, cb) {
cb = options;
options = {};
}
const self = this;
var self = this;
if (!include || (Array.isArray(include) && include.length === 0) ||
(Array.isArray(objects) && objects.length === 0) ||
@ -178,24 +172,17 @@ Inclusion.include = function(objects, include, options, cb) {
}
include = normalizeInclude(include);
debug('include: %j', include);
// Find the limit of items for `inq`
let inqLimit = 256;
var inqLimit = 256;
if (self.dataSource && self.dataSource.settings &&
self.dataSource.settings.inqLimit) {
inqLimit = self.dataSource.settings.inqLimit;
}
async.each(include, function(item, callback) {
try {
processIncludeItem(objects, item, options, callback);
} catch (err) {
// async does not catch the error and report to the outer callback
callback(err);
}
processIncludeItem(objects, item, options, callback);
}, function(err) {
debug(err, objects);
cb && cb(err, objects);
});
@ -209,21 +196,13 @@ Inclusion.include = function(objects, include, options, cb) {
* @param cb
*/
function findWithForeignKeysByPage(model, filter, fkName, pageSize, options, cb) {
try {
const opts = Object.assign({prohibitProtectedPropertiesInQuery: true}, options);
model._sanitizeQuery(filter.where, opts);
model._coerce(filter.where, options);
} catch (e) {
return cb(e);
}
let foreignKeys = [];
var foreignKeys = [];
if (filter.where[fkName]) {
foreignKeys = filter.where[fkName].inq;
} else if (filter.where.and) {
// The inq can be embedded inside 'and: []'. No or: [] is needed as
// include only uses and. We only deal with the generated inq for include.
for (const j in filter.where.and) {
for (var j in filter.where.and) {
if (filter.where.and[j][fkName] &&
Array.isArray(filter.where.and[j][fkName].inq)) {
foreignKeys = filter.where.and[j][fkName].inq;
@ -238,7 +217,7 @@ Inclusion.include = function(objects, include, options, cb) {
// Force the find to be performed per FK to honor the pagination
pageSize = 1;
}
const size = foreignKeys.length;
var size = foreignKeys.length;
if (size > inqLimit && pageSize <= 0) {
pageSize = inqLimit;
}
@ -246,29 +225,29 @@ Inclusion.include = function(objects, include, options, cb) {
return model.find(filter, options, cb);
}
let listOfFKs = [];
var listOfFKs = [];
for (let i = 0; i < size; i += pageSize) {
let end = i + pageSize;
for (var i = 0; i < size; i += pageSize) {
var end = i + pageSize;
if (end > size) {
end = size;
}
listOfFKs.push(foreignKeys.slice(i, end));
}
let items = [];
var items = [];
// Optimization: no need to resolve keys that are an empty array
listOfFKs = listOfFKs.filter(function(keys) {
return keys.length > 0;
});
async.each(listOfFKs, function(foreignKeys, done) {
const newFilter = {};
for (const f in filter) {
var newFilter = {};
for (var f in filter) {
newFilter[f] = filter[f];
}
if (filter.where) {
newFilter.where = {};
for (const w in filter.where) {
for (var w in filter.where) {
newFilter.where[w] = filter.where[w];
}
}
@ -287,10 +266,10 @@ Inclusion.include = function(objects, include, options, cb) {
}
function processIncludeItem(objs, include, options, cb) {
const relations = self.relations;
var relations = self.relations;
let relationName;
let subInclude = null, scope = null;
var relationName;
var subInclude = null, scope = null;
if (isPlainObject(include)) {
relationName = Object.keys(include)[0];
@ -309,13 +288,12 @@ Inclusion.include = function(objects, include, options, cb) {
subInclude = null;
}
const relation = relations[relationName];
var relation = relations[relationName];
if (!relation) {
cb(new Error(g.f('Relation "%s" is not defined for %s model', relationName, self.modelName)));
return;
}
debug('Relation: %j', relation);
const polymorphic = relation.polymorphic;
var polymorphic = relation.polymorphic;
// if (polymorphic && !polymorphic.discriminator) {
// cb(new Error('Relation "' + relationName + '" is polymorphic but ' +
// 'discriminator is not present'));
@ -331,19 +309,18 @@ Inclusion.include = function(objects, include, options, cb) {
// Just skip if inclusion is disabled
if (relation.options.disableInclude) {
debug('Relation is disabled from include', relation);
return cb();
}
// prepare filter and fields for making DB Call
const filter = (scope && scope.conditions()) || {};
var filter = (scope && scope.conditions()) || {};
if ((relation.multiple || relation.type === 'belongsTo') && scope) {
const includeScope = {};
var includeScope = {};
// make sure not to miss any fields for sub includes
if (filter.fields && Array.isArray(subInclude) &&
relation.modelTo.relations) {
includeScope.fields = [];
subInclude.forEach(function(name) {
const rel = relation.modelTo.relations[name];
var rel = relation.modelTo.relations[name];
if (rel && rel.type === 'belongsTo') {
includeScope.fields.push(rel.keyFrom);
}
@ -354,7 +331,7 @@ Inclusion.include = function(objects, include, options, cb) {
// Let's add a placeholder where query
filter.where = filter.where || {};
// if fields are specified, make sure target foreign key is present
let fields = filter.fields;
var fields = filter.fields;
if (typeof fields === 'string') {
// transform string into array containing this string
filter.fields = fields = [fields];
@ -410,14 +387,14 @@ Inclusion.include = function(objects, include, options, cb) {
* @param callback
*/
function includeHasManyThrough(callback) {
const sourceIds = [];
var sourceIds = [];
// Map for Indexing objects by their id for faster retrieval
const objIdMap = {};
for (let i = 0; i < objs.length; i++) {
const obj = objs[i];
var objIdMap = {};
for (var i = 0; i < objs.length; i++) {
var obj = objs[i];
// one-to-many: foreign key reference is modelTo -> modelFrom.
// use modelFrom.keyFrom in where filter later
const sourceId = obj[relation.keyFrom];
var sourceId = obj[relation.keyFrom];
if (sourceId) {
sourceIds.push(sourceId);
objIdMap[sourceId.toString()] = obj;
@ -428,7 +405,7 @@ Inclusion.include = function(objects, include, options, cb) {
}
// default filters are not applicable on through model. should be applied
// on modelTo later in 2nd DB call.
const throughFilter = {
var throughFilter = {
where: {},
};
throughFilter.where[relation.keyTo] = {
@ -437,9 +414,8 @@ Inclusion.include = function(objects, include, options, cb) {
if (polymorphic) {
// handle polymorphic hasMany (reverse) in which case we need to filter
// by discriminator to filter other types
const throughModel = polymorphic.invert ? relation.modelTo : relation.modelFrom;
throughFilter.where[polymorphic.discriminator] =
throughModel.definition.name;
relation.modelFrom.definition.name;
}
// 1st DB Call of 2-step process. Get through model objects first
@ -457,25 +433,25 @@ Inclusion.include = function(objects, include, options, cb) {
return callback(err);
}
// start preparing for 2nd DB call.
const targetIds = [];
const targetObjsMap = {};
for (let i = 0; i < throughObjs.length; i++) {
const throughObj = throughObjs[i];
const targetId = throughObj[relation.keyThrough];
var targetIds = [];
var targetObjsMap = {};
for (var i = 0; i < throughObjs.length; i++) {
var throughObj = throughObjs[i];
var targetId = throughObj[relation.keyThrough];
if (targetId) {
// save targetIds for 2nd DB Call
targetIds.push(targetId);
const sourceObj = objIdMap[throughObj[relation.keyTo]];
const targetIdStr = targetId.toString();
var sourceObj = objIdMap[throughObj[relation.keyTo]];
var targetIdStr = targetId.toString();
// Since targetId can be duplicates, multiple source objs are put
// into buckets.
const objList = targetObjsMap[targetIdStr] =
var objList = targetObjsMap[targetIdStr] =
targetObjsMap[targetIdStr] || [];
objList.push(sourceObj);
}
}
// Polymorphic relation does not have idKey of modelTo. Find it manually
const modelToIdName = idName(relation.modelTo);
var modelToIdName = idName(relation.modelTo);
filter.where[modelToIdName] = {
inq: uniq(targetIds),
};
@ -496,7 +472,7 @@ Inclusion.include = function(objects, include, options, cb) {
if (err) {
return callback(err);
}
const tasks = [];
var tasks = [];
// simultaneously process subIncludes. Call it first as it is an async
// process.
if (subInclude && targets) {
@ -509,15 +485,13 @@ Inclusion.include = function(objects, include, options, cb) {
function targetLinkingTask(next) {
async.each(targets, linkManyToMany, next);
function linkManyToMany(target, next) {
const targetId = target[modelToIdName];
var targetId = target[modelToIdName];
if (!targetId) {
const err = new Error(g.f(
'LinkManyToMany received target that doesn\'t contain required "%s"',
modelToIdName,
));
var err = new Error(g.f('LinkManyToMany received target that doesn\'t contain required "%s"',
modelToIdName));
return next(err);
}
const objList = targetObjsMap[targetId.toString()];
var objList = targetObjsMap[targetId.toString()];
async.each(objList, function(obj, next) {
if (!obj) return next();
obj.__cachedRelations[relationName].push(target);
@ -536,15 +510,15 @@ Inclusion.include = function(objects, include, options, cb) {
* @param callback
*/
function includeReferencesMany(callback) {
const modelToIdName = idName(relation.modelTo);
let allTargetIds = [];
var modelToIdName = idName(relation.modelTo);
var allTargetIds = [];
// Map for Indexing objects by their id for faster retrieval
const targetObjsMap = {};
for (let i = 0; i < objs.length; i++) {
const obj = objs[i];
var targetObjsMap = {};
for (var i = 0; i < objs.length; i++) {
var obj = objs[i];
// one-to-many: foreign key reference is modelTo -> modelFrom.
// use modelFrom.keyFrom in where filter later
let targetIds = obj[relation.keyFrom];
var targetIds = obj[relation.keyFrom];
if (targetIds) {
if (typeof targetIds === 'string') {
// For relational DBs, the array is stored as stringified json
@ -554,10 +528,10 @@ Inclusion.include = function(objects, include, options, cb) {
// referencesMany has multiple targetIds per obj. We need to concat
// them into allTargetIds before DB Call
allTargetIds = allTargetIds.concat(targetIds);
for (let j = 0; j < targetIds.length; j++) {
const targetId = targetIds[j];
const targetIdStr = targetId.toString();
const objList = targetObjsMap[targetIdStr] =
for (var j = 0; j < targetIds.length; j++) {
var targetId = targetIds[j];
var targetIdStr = targetId.toString();
var objList = targetObjsMap[targetIdStr] =
targetObjsMap[targetIdStr] || [];
objList.push(obj);
}
@ -585,7 +559,7 @@ Inclusion.include = function(objects, include, options, cb) {
if (err) {
return callback(err);
}
const tasks = [];
var tasks = [];
// simultaneously process subIncludes
if (subInclude && targets) {
tasks.push(function subIncludesTask(next) {
@ -598,7 +572,7 @@ Inclusion.include = function(objects, include, options, cb) {
function targetLinkingTask(next) {
async.each(targets, linkManyToMany, next);
function linkManyToMany(target, next) {
const objList = targetObjsMap[target[relation.keyTo].toString()];
var objList = targetObjsMap[target[relation.keyTo].toString()];
async.each(objList, function(obj, next) {
if (!obj) return next();
obj.__cachedRelations[relationName].push(target);
@ -617,7 +591,7 @@ Inclusion.include = function(objects, include, options, cb) {
*/
function includeHasManySimple(callback) {
// Map for Indexing objects by their id for faster retrieval
const objIdMap2 = includeUtils.buildOneToOneIdentityMapWithOrigKeys(objs, relation.keyFrom);
var objIdMap2 = includeUtils.buildOneToOneIdentityMapWithOrigKeys(objs, relation.keyFrom);
filter.where[relation.keyTo] = {
inq: uniq(objIdMap2.getKeys()),
@ -632,7 +606,7 @@ Inclusion.include = function(objects, include, options, cb) {
if (err) {
return callback(err);
}
const targetsIdMap = includeUtils.buildOneToManyIdentityMapWithOrigKeys(targets, relation.keyTo);
var targetsIdMap = includeUtils.buildOneToManyIdentityMapWithOrigKeys(targets, relation.keyTo);
includeUtils.join(objIdMap2, targetsIdMap, function(obj1, valueToMergeIn) {
defineCachedRelations(obj1);
obj1.__cachedRelations[relationName] = valueToMergeIn;
@ -647,14 +621,14 @@ Inclusion.include = function(objects, include, options, cb) {
* @param callback
*/
function includeHasMany(callback) {
const sourceIds = [];
var sourceIds = [];
// Map for Indexing objects by their id for faster retrieval
const objIdMap = {};
for (let i = 0; i < objs.length; i++) {
const obj = objs[i];
var objIdMap = {};
for (var i = 0; i < objs.length; i++) {
var obj = objs[i];
// one-to-many: foreign key reference is modelTo -> modelFrom.
// use modelFrom.keyFrom in where filter later
const sourceId = obj[relation.keyFrom];
var sourceId = obj[relation.keyFrom];
if (sourceId) {
sourceIds.push(sourceId);
objIdMap[sourceId.toString()] = obj;
@ -682,7 +656,7 @@ Inclusion.include = function(objects, include, options, cb) {
if (err) {
return callback(err);
}
const tasks = [];
var tasks = [];
// simultaneously process subIncludes
if (subInclude && targets) {
tasks.push(function subIncludesTask(next) {
@ -701,9 +675,9 @@ Inclusion.include = function(objects, include, options, cb) {
async.each(targets, linkManyToOne, next);
function linkManyToOne(target, next) {
// fix for bug in hasMany with referencesMany
const targetIds = [].concat(target[relation.keyTo]);
var targetIds = [].concat(target[relation.keyTo]);
async.each(targetIds, function(targetId, next) {
const obj = objIdMap[targetId.toString()];
var obj = objIdMap[targetId.toString()];
if (!obj) return next();
obj.__cachedRelations[relationName].push(target);
processTargetObj(obj, next);
@ -712,7 +686,7 @@ Inclusion.include = function(objects, include, options, cb) {
return next(err);
}
const objsWithEmptyRelation = objs.filter(function(obj) {
var objsWithEmptyRelation = objs.filter(function(obj) {
return obj.__cachedRelations[relationName].length === 0;
});
async.each(objsWithEmptyRelation, function(obj, next) {
@ -733,22 +707,22 @@ Inclusion.include = function(objects, include, options, cb) {
* @param callback
*/
function includePolymorphicBelongsTo(callback) {
const targetIdsByType = {};
var targetIdsByType = {};
// Map for Indexing objects by their type and targetId for faster retrieval
const targetObjMapByType = {};
for (let i = 0; i < objs.length; i++) {
const obj = objs[i];
const discriminator = polymorphic.discriminator;
const modelType = obj[discriminator];
var targetObjMapByType = {};
for (var i = 0; i < objs.length; i++) {
var obj = objs[i];
var discriminator = polymorphic.discriminator;
var modelType = obj[discriminator];
if (modelType) {
targetIdsByType[modelType] = targetIdsByType[modelType] || [];
targetObjMapByType[modelType] = targetObjMapByType[modelType] || {};
const targetIds = targetIdsByType[modelType];
const targetObjsMap = targetObjMapByType[modelType];
const targetId = obj[relation.keyFrom];
var targetIds = targetIdsByType[modelType];
var targetObjsMap = targetObjMapByType[modelType];
var targetId = obj[relation.keyFrom];
if (targetId) {
targetIds.push(targetId);
const targetIdStr = targetId.toString();
var targetIdStr = targetId.toString();
targetObjsMap[targetIdStr] = targetObjsMap[targetIdStr] || [];
// Is belongsTo. Multiple objects can have the same
// targetId and therefore map value is an array
@ -766,13 +740,13 @@ Inclusion.include = function(objects, include, options, cb) {
* @param callback
*/
function processPolymorphicType(modelType, callback) {
const typeFilter = {where: {}};
var typeFilter = {where: {}};
utils.mergeQuery(typeFilter, filter);
const targetIds = targetIdsByType[modelType];
var targetIds = targetIdsByType[modelType];
typeFilter.where[relation.keyTo] = {
inq: uniq(targetIds),
};
const Model = lookupModel(relation.modelFrom.dataSource.modelBuilder.
var Model = lookupModel(relation.modelFrom.dataSource.modelBuilder.
models, modelType);
if (!Model) {
callback(new Error(g.f('Discriminator type %s specified but no model exists with such name',
@ -794,7 +768,7 @@ Inclusion.include = function(objects, include, options, cb) {
if (err) {
return callback(err);
}
const tasks = [];
var tasks = [];
// simultaneously process subIncludes
if (subInclude && targets) {
@ -805,10 +779,10 @@ Inclusion.include = function(objects, include, options, cb) {
// process each target object
tasks.push(targetLinkingTask);
function targetLinkingTask(next) {
const targetObjsMap = targetObjMapByType[modelType];
var targetObjsMap = targetObjMapByType[modelType];
async.each(targets, linkOneToMany, next);
function linkOneToMany(target, next) {
const objList = targetObjsMap[target[relation.keyTo].toString()];
var objList = targetObjsMap[target[relation.keyTo].toString()];
async.each(objList, function(obj, next) {
if (!obj) return next();
obj.__cachedRelations[relationName] = target;
@ -827,14 +801,14 @@ Inclusion.include = function(objects, include, options, cb) {
* @param callback
*/
function includePolymorphicHasOne(callback) {
const sourceIds = [];
var sourceIds = [];
// Map for Indexing objects by their id for faster retrieval
const objIdMap = {};
for (let i = 0; i < objs.length; i++) {
const obj = objs[i];
var objIdMap = {};
for (var i = 0; i < objs.length; i++) {
var obj = objs[i];
// one-to-one: foreign key reference is modelTo -> modelFrom.
// use modelFrom.keyFrom in where filter later
const sourceId = obj[relation.keyFrom];
var sourceId = obj[relation.keyFrom];
if (sourceId) {
sourceIds.push(sourceId);
objIdMap[sourceId.toString()] = obj;
@ -861,7 +835,7 @@ Inclusion.include = function(objects, include, options, cb) {
if (err) {
return callback(err);
}
const tasks = [];
var tasks = [];
// simultaneously process subIncludes
if (subInclude && targets) {
tasks.push(function subIncludesTask(next) {
@ -873,9 +847,9 @@ Inclusion.include = function(objects, include, options, cb) {
function targetLinkingTask(next) {
async.each(targets, linkOneToOne, next);
function linkOneToOne(target, next) {
const sourceId = target[relation.keyTo];
var sourceId = target[relation.keyTo];
if (!sourceId) return next();
const obj = objIdMap[sourceId.toString()];
var obj = objIdMap[sourceId.toString()];
if (!obj) return next();
obj.__cachedRelations[relationName] = target;
processTargetObj(obj, next);
@ -891,26 +865,24 @@ Inclusion.include = function(objects, include, options, cb) {
* @param callback
*/
function includeOneToOne(callback) {
const targetIds = [];
const objTargetIdMap = {};
for (let i = 0; i < objs.length; i++) {
const obj = objs[i];
var targetIds = [];
var objTargetIdMap = {};
for (var i = 0; i < objs.length; i++) {
var obj = objs[i];
if (relation.type === 'belongsTo') {
if (obj[relation.keyFrom] == null) {
if (obj[relation.keyFrom] === null ||
obj[relation.keyFrom] === undefined) {
defineCachedRelations(obj);
obj.__cachedRelations[relationName] = null;
debug('ID property "%s" is missing in item %j', relation.keyFrom, obj);
continue;
}
}
const targetId = obj[relation.keyFrom];
var targetId = obj[relation.keyFrom];
if (targetId) {
targetIds.push(targetId);
const targetIdStr = targetId.toString();
var targetIdStr = targetId.toString();
objTargetIdMap[targetIdStr] = objTargetIdMap[targetIdStr] || [];
objTargetIdMap[targetIdStr].push(obj);
} else {
debug('ID property "%s" is missing in item %j', relation.keyFrom, obj);
}
defineCachedRelations(obj);
obj.__cachedRelations[relationName] = null;
@ -933,7 +905,7 @@ Inclusion.include = function(objects, include, options, cb) {
if (err) {
return callback(err);
}
const tasks = [];
var tasks = [];
// simultaneously process subIncludes
if (subInclude && targets) {
tasks.push(function subIncludesTask(next) {
@ -945,8 +917,8 @@ Inclusion.include = function(objects, include, options, cb) {
function targetLinkingTask(next) {
async.each(targets, linkOneToMany, next);
function linkOneToMany(target, next) {
const targetId = target[relation.keyTo];
const objList = objTargetIdMap[targetId.toString()];
var targetId = target[relation.keyTo];
var objList = objTargetIdMap[targetId.toString()];
async.each(objList, function(obj, next) {
if (!obj) return next();
obj.__cachedRelations[relationName] = target;
@ -981,7 +953,7 @@ Inclusion.include = function(objects, include, options, cb) {
* @returns {*}
*/
function processTargetObj(obj, callback) {
const isInst = obj instanceof self;
var isInst = obj instanceof self;
// Calling the relation method on the instance
if (relation.type === 'belongsTo') {
@ -1023,21 +995,21 @@ Inclusion.include = function(objects, include, options, cb) {
callback);
}
const inst = (obj instanceof self) ? obj : new self(obj);
var inst = (obj instanceof self) ? obj : new self(obj);
// If related objects are not cached by include Handlers, directly call
// related accessor function even though it is not very efficient
let related; // relation accessor function
var related; // relation accessor function
if ((relation.multiple || relation.type === 'belongsTo') && scope) {
const includeScope = {};
const filter = scope.conditions();
var includeScope = {};
var filter = scope.conditions();
// make sure not to miss any fields for sub includes
if (filter.fields && Array.isArray(subInclude) && relation.modelTo.relations) {
includeScope.fields = [];
subInclude.forEach(function(name) {
const rel = relation.modelTo.relations[name];
var rel = relation.modelTo.relations[name];
if (rel && rel.type === 'belongsTo') {
includeScope.fields.push(rel.keyFrom);
}

View File

@ -1,31 +1,15 @@
// Copyright IBM Corp. 2015,2019. All Rights Reserved.
// Copyright IBM Corp. 2015,2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const g = require('strong-globalize')();
module.exports.buildOneToOneIdentityMapWithOrigKeys = buildOneToOneIdentityMapWithOrigKeys;
module.exports.buildOneToManyIdentityMapWithOrigKeys = buildOneToManyIdentityMapWithOrigKeys;
module.exports.join = join;
module.exports.KVMap = KVMap;
const util = require('util');
function getId(obj, idName) {
const id = obj && obj[idName];
if (id == null) {
const msg = g.f('ID property "%s" is missing for included item: %j. ' +
'Please make sure `fields` include "%s" if it\'s present in the `filter`',
idName, obj, idName);
const err = new Error(msg);
err.statusCode = 400;
throw err;
}
return id;
}
/**
* Effectively builds associative map on id -> object relation and stores original keys.
* Map returned in form of object with ids in keys and object as values.
@ -35,21 +19,21 @@ function getId(obj, idName) {
* @returns {} object where keys are ids and values are objects itself
*/
function buildOneToOneIdentityMapWithOrigKeys(objs, idName) {
const kvMap = new KVMap();
for (let i = 0; i < objs.length; i++) {
const obj = objs[i];
const id = getId(obj, idName);
var kvMap = new KVMap();
for (var i = 0; i < objs.length; i++) {
var obj = objs[i];
var id = obj[idName];
kvMap.set(id, obj);
}
return kvMap;
}
function buildOneToManyIdentityMapWithOrigKeys(objs, idName) {
const kvMap = new KVMap();
for (let i = 0; i < objs.length; i++) {
const obj = objs[i];
const id = getId(obj, idName);
const value = kvMap.get(id) || [];
var kvMap = new KVMap();
for (var i = 0; i < objs.length; i++) {
var obj = objs[i];
var id = obj[idName];
var value = kvMap.get(id) || [];
value.push(obj);
kvMap.set(id, value);
}
@ -64,11 +48,11 @@ function buildOneToManyIdentityMapWithOrigKeys(objs, idName) {
* @param mergeF function(obj, objectsToMergeIn)
*/
function join(oneToOneIdMap, oneToManyIdMap, mergeF) {
const ids = oneToOneIdMap.getKeys();
for (let i = 0; i < ids.length; i++) {
const id = ids[i];
const obj = oneToOneIdMap.get(id);
const objectsToMergeIn = oneToManyIdMap.get(id) || [];
var ids = oneToOneIdMap.getKeys();
for (var i = 0; i < ids.length; i++) {
var id = ids[i];
var obj = oneToOneIdMap.get(id);
var objectsToMergeIn = oneToManyIdMap.get(id) || [];
mergeF(obj, objectsToMergeIn);
}
}
@ -79,20 +63,20 @@ function join(oneToOneIdMap, oneToManyIdMap, mergeF) {
* @constructor
*/
function KVMap() {
const _originalKeyFieldName = 'originalKey';
const _valueKeyFieldName = 'value';
const _dict = {};
const keyToString = function(key) { return key.toString(); };
const mapImpl = {
var _originalKeyFieldName = 'originalKey';
var _valueKeyFieldName = 'value';
var _dict = {};
var keyToString = function(key) { return key.toString(); };
var mapImpl = {
set: function(key, value) {
const recordObj = {};
var recordObj = {};
recordObj[_originalKeyFieldName] = key;
recordObj[_valueKeyFieldName] = value;
_dict[keyToString(key)] = recordObj;
return true;
},
get: function(key) {
const storeObj = _dict[keyToString(key)];
var storeObj = _dict[keyToString(key)];
if (storeObj) {
return storeObj[_valueKeyFieldName];
} else {
@ -104,12 +88,12 @@ function KVMap() {
return true;
},
exist: function(key) {
const result = _dict.hasOwnProperty(keyToString(key));
var result = _dict.hasOwnProperty(keyToString(key));
return result;
},
getKeys: function() {
const result = [];
for (const key in _dict) {
var result = [];
for (var key in _dict) {
result.push(_dict[key][_originalKeyFieldName]);
}
return result;

View File

@ -1,4 +1,4 @@
// Copyright IBM Corp. 2013,2019. All Rights Reserved.
// Copyright IBM Corp. 2013,2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
@ -13,14 +13,14 @@ module.exports = function getIntrospector(ModelBuilder) {
}
// Check registered schemaTypes
for (const t in ModelBuilder.schemaTypes) {
const st = ModelBuilder.schemaTypes[t];
for (var t in ModelBuilder.schemaTypes) {
var st = ModelBuilder.schemaTypes[t];
if (st !== Object && st !== Array && (value instanceof st)) {
return t;
}
}
const type = typeof value;
var type = typeof value;
if (type === 'string' || type === 'number' || type === 'boolean') {
return type;
}
@ -29,9 +29,9 @@ module.exports = function getIntrospector(ModelBuilder) {
return 'date';
}
let itemType;
var itemType;
if (Array.isArray(value)) {
for (let i = 0; i < value.length; i++) {
for (var i = 0; i < value.length; i++) {
if (value[i] === null || value[i] === undefined) {
continue;
}
@ -47,8 +47,8 @@ module.exports = function getIntrospector(ModelBuilder) {
return value.constructor.name;
}
const properties = {};
for (const p in value) {
var properties = {};
for (var p in value) {
itemType = introspectType(value[p]);
if (itemType) {
properties[p] = itemType;

View File

@ -1,11 +1,11 @@
// Copyright IBM Corp. 2011,2019. All Rights Reserved.
// Copyright IBM Corp. 2011,2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const util = require('util');
var util = require('util');
/**
*
@ -24,7 +24,7 @@ exports.inherits = function(newClass, baseClass, options) {
Object.keys(baseClass).forEach(function(classProp) {
if (classProp !== 'super_' && (!newClass.hasOwnProperty(classProp) ||
options.override)) {
const pd = Object.getOwnPropertyDescriptor(baseClass, classProp);
var pd = Object.getOwnPropertyDescriptor(baseClass, classProp);
Object.defineProperty(newClass, classProp, pd);
}
});
@ -75,13 +75,13 @@ exports.mixin = function(newClass, mixinClass, options) {
function mixInto(sourceScope, targetScope, options) {
Object.keys(sourceScope).forEach(function(propertyName) {
const targetPropertyExists = targetScope.hasOwnProperty(propertyName);
const sourceProperty = Object.getOwnPropertyDescriptor(sourceScope, propertyName);
const targetProperty = targetPropertyExists && Object.getOwnPropertyDescriptor(targetScope, propertyName);
const sourceIsFunc = typeof sourceProperty.value === 'function';
const isFunc = targetPropertyExists && typeof targetProperty.value === 'function';
const isDelegate = isFunc && targetProperty.value._delegate;
const shouldOverride = options.override || !targetPropertyExists || isDelegate;
var targetPropertyExists = targetScope.hasOwnProperty(propertyName);
var sourceProperty = Object.getOwnPropertyDescriptor(sourceScope, propertyName);
var targetProperty = targetPropertyExists && Object.getOwnPropertyDescriptor(targetScope, propertyName);
var sourceIsFunc = typeof sourceProperty.value === 'function';
var isFunc = targetPropertyExists && typeof targetProperty.value === 'function';
var isDelegate = isFunc && targetProperty.value._delegate;
var shouldOverride = options.override || !targetPropertyExists || isDelegate;
if (propertyName == '_mixins') {
mergeMixins(sourceScope._mixins, targetScope._mixins);
@ -96,8 +96,8 @@ function mixInto(sourceScope, targetScope, options) {
function mergeMixins(source, target) {
// hand-written equivalent of lodash.union()
for (const ix in source) {
const mx = source[ix];
for (var ix in source) {
var mx = source[ix];
if (target.indexOf(mx) === -1)
target.push(mx);
}

View File

@ -1,14 +1,9 @@
// Copyright IBM Corp. 2017,2019. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const assert = require('assert');
const async = require('async');
const debug = require('debug')('loopback:kvao:delete-all');
const utils = require('../utils');
var assert = require('assert');
var async = require('async');
var debug = require('debug')('loopback:kvao:delete-all');
var utils = require('../utils');
/**
* Delete all keys (and values) associated to the current model.
@ -32,17 +27,17 @@ module.exports = function deleteAll(options, callback) {
callback = callback || utils.createPromiseCallback();
const connector = this.getConnector();
var connector = this.getConnector();
if (typeof connector.deleteAll === 'function') {
connector.deleteAll(this.modelName, options, callback);
} else if (typeof connector.delete === 'function') {
debug('Falling back to unoptimized key-value pair deletion');
iterateAndDelete(connector, this.modelName, options, callback);
} else {
const errMsg = 'Connector does not support key-value pair deletion';
var errMsg = 'Connector does not support key-value pair deletion';
debug(errMsg);
process.nextTick(function() {
const err = new Error(errMsg);
var err = new Error(errMsg);
err.statusCode = 501;
callback(err);
});
@ -51,8 +46,8 @@ module.exports = function deleteAll(options, callback) {
};
function iterateAndDelete(connector, modelName, options, callback) {
const iter = connector.iterateKeys(modelName, {});
const keys = [];
var iter = connector.iterateKeys(modelName, {});
var keys = [];
iter.next(onNextKey);
function onNextKey(err, key) {

View File

@ -1,13 +1,8 @@
// Copyright IBM Corp. 2017,2019. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const assert = require('assert');
const debug = require('debug')('loopback:kvao:delete');
const utils = require('../utils');
var assert = require('assert');
var debug = require('debug')('loopback:kvao:delete');
var utils = require('../utils');
/**
* Delete the key-value pair associated to the given key.
@ -33,14 +28,14 @@ module.exports = function keyValueDelete(key, options, callback) {
callback = callback || utils.createPromiseCallback();
const connector = this.getConnector();
var connector = this.getConnector();
if (typeof connector.delete === 'function') {
connector.delete(this.modelName, key, options, callback);
} else {
const errMsg = 'Connector does not support key-value pair deletion';
var errMsg = 'Connector does not support key-value pair deletion';
debug(errMsg);
process.nextTick(function() {
const err = new Error(errMsg);
var err = new Error(errMsg);
err.statusCode = 501;
callback(err);
});

View File

@ -1,12 +1,7 @@
// Copyright IBM Corp. 2016,2019. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const assert = require('assert');
const utils = require('../utils');
var assert = require('assert');
var utils = require('../utils');
/**
* Set the TTL (time to live) in ms (milliseconds) for a given key. TTL is the

View File

@ -1,12 +1,7 @@
// Copyright IBM Corp. 2016,2019. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const assert = require('assert');
const utils = require('../utils');
var assert = require('assert');
var utils = require('../utils');
/**
* Return the value associated with a given key.

View File

@ -1,12 +1,7 @@
// Copyright IBM Corp. 2016,2019. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
function KeyValueAccessObject() {
}
};
module.exports = KeyValueAccessObject;

View File

@ -1,12 +1,7 @@
// Copyright IBM Corp. 2016,2019. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const assert = require('assert');
const utils = require('../utils');
var assert = require('assert');
var utils = require('../utils');
/**
* Asynchronously iterate all keys in the database. Similar to `.keys()` but
@ -31,7 +26,7 @@ module.exports = function keyValueIterateKeys(filter, options) {
assert(typeof filter === 'object', 'filter must be an object');
assert(typeof options === 'object', 'options must be an object');
const iter = this.getConnector().iterateKeys(this.modelName, filter, options);
var iter = this.getConnector().iterateKeys(this.modelName, filter, options);
// promisify the returned iterator
return {
next: function(callback) {

View File

@ -1,12 +1,7 @@
// Copyright IBM Corp. 2016,2019. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const assert = require('assert');
const utils = require('../utils');
var assert = require('assert');
var utils = require('../utils');
/**
* Return all keys in the database.
@ -46,8 +41,8 @@ module.exports = function keyValueKeys(filter, options, callback) {
callback = callback || utils.createPromiseCallback();
const iter = this.iterateKeys(filter, options);
const keys = [];
var iter = this.iterateKeys(filter, options);
var keys = [];
iter.next(onNextKey);
function onNextKey(err, key) {

View File

@ -1,12 +1,7 @@
// Copyright IBM Corp. 2016,2019. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const assert = require('assert');
const utils = require('../utils');
var assert = require('assert');
var utils = require('../utils');
/**
* Persist a value and associate it with the given key.

View File

@ -1,12 +1,7 @@
// Copyright IBM Corp. 2016,2019. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const assert = require('assert');
const utils = require('../utils');
var assert = require('assert');
var utils = require('../utils');
/**
* Return the TTL (time to live) for a given key. TTL is the remaining time

View File

@ -1,21 +1,18 @@
// Copyright IBM Corp. 2012,2019. All Rights Reserved.
// Copyright IBM Corp. 2012,2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const g = require('strong-globalize')();
const util = require('util');
const Any = require('./types').Types.Any;
const {
applyParentProperty,
} = require('./utils');
var g = require('strong-globalize')();
var util = require('util');
var Any = require('./types').Types.Any;
module.exports = List;
function List(items, itemType, parent) {
const list = this;
var list = this;
if (!(list instanceof List)) {
return new List(items, itemType, parent);
}
@ -30,12 +27,7 @@ function List(items, itemType, parent) {
}
}
if (typeof items === 'number') {
// trying to initialise empty array with a length
items = [...new Array(items)];
}
const arr = [];
var arr = [];
arr.__proto__ = List.prototype;
items = items || [];
@ -64,7 +56,6 @@ function List(items, itemType, parent) {
});
if (parent) {
// List constructor now called with actual model instance
Object.defineProperty(arr, 'parent', {
writable: true,
enumerable: false,
@ -74,11 +65,10 @@ function List(items, itemType, parent) {
items.forEach(function(item, i) {
if (itemType && !(item instanceof itemType)) {
arr[i] = arr.toItem(item);
arr[i] = itemType(item);
} else {
arr[i] = item;
}
if (parent && arr[i] && typeof arr[i] === 'object') applyParentProperty(arr[i], parent);
});
return arr;
@ -86,37 +76,18 @@ function List(items, itemType, parent) {
util.inherits(List, Array);
const _push = List.prototype.push;
List.prototype.toItem = function(item) {
if (isClass(this.itemType)) {
return new this.itemType(item);
} else {
if (Array.isArray(item)) {
return item;
} else if (this.itemType === Date) {
if (item === null) return null;
return new Date(item);
} else {
return this.itemType(item);
}
}
};
var _push = List.prototype.push;
List.prototype.push = function(obj) {
const item = this.itemType && (obj instanceof this.itemType) ? obj : this.toItem(obj);
if (item && typeof item === 'object' && this.parent) applyParentProperty(item, this.parent);
var item = this.itemType && (obj instanceof this.itemType) ? obj : this.itemType(obj);
_push.call(this, item);
return item;
};
List.prototype.toObject = function(onlySchema, removeHidden, removeProtected) {
const items = [];
var items = [];
this.forEach(function(item) {
if (item && Array.isArray(item) && item.toArray) {
const subArray = item.toArray();
items.push(subArray);
} else if (item && typeof item === 'object' && item.toObject) {
if (item && typeof item === 'object' && item.toObject) {
items.push(item.toObject(onlySchema, removeHidden, removeProtected));
} else {
items.push(item);
@ -125,19 +96,6 @@ List.prototype.toObject = function(onlySchema, removeHidden, removeProtected) {
return items;
};
/**
* Convert itself to a plain array.
*
* Some modules such as `should` checks prototype for comparison
*/
List.prototype.toArray = function() {
const items = [];
this.forEach(function(item) {
items.push(item);
});
return items;
};
List.prototype.toJSON = function() {
return this.toObject(true);
};
@ -146,6 +104,3 @@ List.prototype.toString = function() {
return JSON.stringify(this.toJSON());
};
function isClass(fn) {
return fn && fn.toString().indexOf('class ') === 0;
}

View File

@ -1,13 +1,12 @@
// Copyright IBM Corp. 2014,2019. All Rights Reserved.
// Copyright IBM Corp. 2014,2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const debug = require('debug')('loopback:mixin');
const assert = require('assert');
const DefaultModelBaseClass = require('./model.js');
var debug = require('debug')('loopback:mixin');
var assert = require('assert');
var DefaultModelBaseClass = require('./model.js');
function isModelClass(cls) {
if (!cls) {
@ -30,7 +29,7 @@ function MixinProvider(modelBuilder) {
* @param {Object} options
*/
MixinProvider.prototype.applyMixin = function applyMixin(modelClass, name, options) {
const fn = this.mixins[name];
var fn = this.mixins[name];
if (typeof fn === 'function') {
if (modelClass.dataSource) {
fn(modelClass, options || {});
@ -41,12 +40,12 @@ MixinProvider.prototype.applyMixin = function applyMixin(modelClass, name, optio
}
} else {
// Try model name
const model = this.modelBuilder.getModel(name);
var model = this.modelBuilder.getModel(name);
if (model) {
debug('Mixin is resolved to a model: %s', name);
modelClass.mixin(model, options);
} else {
const errMsg = 'Model "' + modelClass.modelName + '" uses unknown mixin: ' + name;
var errMsg = 'Model "' + modelClass.modelName + '" uses unknown mixin: ' + name;
debug(errMsg);
throw new Error(errMsg);
}

View File

@ -1,36 +1,31 @@
// Copyright IBM Corp. 2013,2019. All Rights Reserved.
// Copyright IBM Corp. 2013,2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
/*!
* Module dependencies
*/
const g = require('strong-globalize')();
const inflection = require('inflection');
const EventEmitter = require('events').EventEmitter;
const util = require('util');
const assert = require('assert');
const deprecated = require('depd')('loopback-datasource-juggler');
const DefaultModelBaseClass = require('./model.js');
const List = require('./list.js');
const ModelDefinition = require('./model-definition.js');
const MixinProvider = require('./mixins');
const {
deepMerge,
deepMergeProperty,
rankArrayElements,
isClass,
applyParentProperty,
} = require('./utils');
var g = require('strong-globalize')();
var inflection = require('inflection');
var EventEmitter = require('events').EventEmitter;
var util = require('util');
var assert = require('assert');
var deprecated = require('depd')('loopback-datasource-juggler');
var DefaultModelBaseClass = require('./model.js');
var List = require('./list.js');
var ModelDefinition = require('./model-definition.js');
var deepMerge = require('./utils').deepMerge;
var deepMergeProperty = require('./utils').deepMergeProperty;
var rankArrayElements = require('./utils').rankArrayElements;
var MixinProvider = require('./mixins');
// Set up types
require('./types')(ModelBuilder);
const introspect = require('./introspection')(ModelBuilder);
var introspect = require('./introspection')(ModelBuilder);
/*!
* Export public API
@ -40,7 +35,7 @@ exports.ModelBuilder = exports.Schema = ModelBuilder;
/*!
* Helpers
*/
const slice = Array.prototype.slice;
var slice = Array.prototype.slice;
/**
* ModelBuilder - A builder to define data models.
@ -79,7 +74,7 @@ function isModelClass(cls) {
* @returns {ModelClass} The model class
*/
ModelBuilder.prototype.getModel = function(name, forceCreate) {
let model = this.models[name];
var model = this.models[name];
if (!model && forceCreate) {
model = this.define(name, {}, {unresolved: true});
}
@ -125,13 +120,13 @@ ModelBuilder.prototype.getModelDefinition = function(name) {
*
*/
ModelBuilder.prototype.define = function defineClass(className, properties, settings, parent) {
const modelBuilder = this;
const args = slice.call(arguments);
const pluralName = (settings && settings.plural) ||
var modelBuilder = this;
var args = slice.call(arguments);
var pluralName = (settings && settings.plural) ||
inflection.pluralize(className);
const httpOptions = (settings && settings.http) || {};
let pathName = httpOptions.path || pluralName;
var httpOptions = (settings && settings.http) || {};
var pathName = httpOptions.path || pluralName;
if (!className) {
throw new Error(g.f('Class name required'));
@ -154,8 +149,8 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett
}
// Set up the base model class
let ModelBaseClass = parent || this.defaultModelBaseClass;
const baseClass = settings.base || settings['super'];
var ModelBaseClass = parent || this.defaultModelBaseClass;
var baseClass = settings.base || settings['super'];
if (baseClass) {
// Normalize base model property
settings.base = baseClass;
@ -185,19 +180,27 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett
}
// Check if there is a unresolved model with the same name
let ModelClass = this.models[className];
var ModelClass = this.models[className];
// Create the ModelClass if it doesn't exist or it's resolved (override)
// TODO: [rfeng] We need to decide what names to use for built-in models such as User.
if (!ModelClass || !ModelClass.settings.unresolved) {
ModelClass = createModelClassCtor(className, ModelBaseClass);
// every class can receive hash of data as optional param
ModelClass = function ModelConstructor(data, options) {
if (!(this instanceof ModelConstructor)) {
return new ModelConstructor(data, options);
}
if (ModelClass.settings.unresolved) {
throw new Error(g.f('Model %s is not defined.', ModelClass.modelName));
}
ModelBaseClass.apply(this, arguments);
};
// mix in EventEmitter (don't inherit from)
const events = new EventEmitter();
var events = new EventEmitter();
// The model can have more than 10 listeners for lazy relationship setup
// See https://github.com/strongloop/loopback/issues/404
events.setMaxListeners(32);
for (const f in EventEmitter.prototype) {
for (var f in EventEmitter.prototype) {
if (typeof EventEmitter.prototype[f] === 'function') {
ModelClass[f] = EventEmitter.prototype[f].bind(events);
}
@ -234,7 +237,7 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett
hiddenProperty(ModelClass, '_warned', {});
// inherit ModelBaseClass static methods
for (const i in ModelBaseClass) {
for (var i in ModelBaseClass) {
// We need to skip properties that are already in the subclass, for example, the event emitter methods
if (i !== '_mixins' && !(i in ModelClass)) {
ModelClass[i] = ModelBaseClass[i];
@ -244,7 +247,7 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett
// Load and inject the model classes
if (settings.models) {
Object.keys(settings.models).forEach(function(m) {
const model = settings.models[m];
var model = settings.models[m];
ModelClass[m] = typeof model === 'string' ? modelBuilder.getModel(model, true) : model;
});
}
@ -252,7 +255,7 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett
ModelClass.getter = {};
ModelClass.setter = {};
for (const p in properties) {
for (var p in properties) {
// e.g excludePropertyList = ['id'] - base properties listed in excludePropertyList will be excluded from the model.
// excludeBaseProperties is introduced in SOAP model generation only for now and below logic
// handles excludeBaseProperties. Generated SOAP model has base as 'Model' which means 'id' property gets added
@ -261,7 +264,7 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett
// work either for SOAP generator case since generators use ModelDefinition.create to create property in the model
// dynamically, that execution path has strict validation where doesn't accept 'id: false' in a property.
// See https://github.com/strongloop/loopback-workspace/issues/486 for some more details.
const excludePropertyList = settings['excludeBaseProperties'];
var excludePropertyList = settings['excludeBaseProperties'];
// Remove properties that reverted by the subclass of the property from excludePropertyList
if (properties[p] === null || properties[p] === false ||
(excludePropertyList != null && excludePropertyList.indexOf(p) != -1)) {
@ -281,7 +284,7 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett
}
}
const modelDefinition = new ModelDefinition(this, className, properties, settings);
var modelDefinition = new ModelDefinition(this, className, properties, settings);
this.definitions[className] = modelDefinition;
@ -290,13 +293,13 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett
// keep a pointer to settings as models can use it for configuration
ModelClass.settings = modelDefinition.settings;
let idInjection = settings.idInjection;
var idInjection = settings.idInjection;
if (idInjection !== false) {
// Default to true if undefined
idInjection = true;
}
let idNames = modelDefinition.idNames();
var idNames = modelDefinition.idNames();
if (idNames.length > 0) {
// id already exists
idInjection = false;
@ -311,11 +314,11 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett
idNames = modelDefinition.idNames(); // Reload it after rebuild
// Create a virtual property 'id'
if (idNames.length === 1) {
const idProp = idNames[0];
var idProp = idNames[0];
if (idProp !== 'id') {
Object.defineProperty(ModelClass.prototype, 'id', {
get: function() {
const idProp = ModelClass.definition.idNames()[0];
var idProp = ModelClass.definition.idNames()[0];
return this.__data[idProp];
},
configurable: true,
@ -326,9 +329,9 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett
// Now the id property is an object that consists of multiple keys
Object.defineProperty(ModelClass.prototype, 'id', {
get: function() {
const compositeId = {};
const idNames = ModelClass.definition.idNames();
for (let i = 0, p; i < idNames.length; i++) {
var compositeId = {};
var idNames = ModelClass.definition.idNames();
for (var i = 0, p; i < idNames.length; i++) {
p = idNames[i];
compositeId[p] = this.__data[p];
}
@ -339,37 +342,11 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett
});
}
// updateOnly property is added to indicate that this property will appear in
// the model for update/updateorcreate operations but and not for create operation.
let forceId = ModelClass.settings.forceId;
if (idNames.length > 0) {
const idName = modelDefinition.idName();
const idProp = ModelClass.definition.rawProperties[idName];
if (idProp.generated && forceId !== false) {
forceId = 'auto';
} else if (!idProp.generated && forceId === 'auto') {
// One of our parent models has enabled forceId because
// it uses an auto-generated id property. However,
// this particular model does not use auto-generated id,
// therefore we need to disable `forceId`.
forceId = false;
}
if (forceId) {
ModelClass.validatesAbsenceOf(idName, {if: 'isNewRecord'});
}
ModelClass.definition.properties[idName].updateOnly = !!forceId;
ModelClass.definition.rawProperties[idName].updateOnly = !!forceId;
ModelClass.settings.forceId = forceId;
}
// A function to loop through the properties
ModelClass.forEachProperty = function(cb) {
const props = ModelClass.definition.properties;
const keys = Object.keys(props);
for (let i = 0, n = keys.length; i < n; i++) {
var props = ModelClass.definition.properties;
var keys = Object.keys(props);
for (var i = 0, n = keys.length; i < n; i++) {
cb(keys[i], props[keys[i]]);
}
};
@ -401,15 +378,15 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett
* merged with base model settings.
*/
ModelClass.extend = function(className, subClassProperties, subClassSettings) {
const baseClassProperties = ModelClass.definition.properties;
const baseClassSettings = ModelClass.definition.settings;
var baseClassProperties = ModelClass.definition.properties;
var baseClassSettings = ModelClass.definition.settings;
subClassProperties = subClassProperties || {};
subClassSettings = subClassSettings || {};
// Check if subclass redefines the ids
let idFound = false;
for (const k in subClassProperties) {
var idFound = false;
for (var k in subClassProperties) {
if (subClassProperties[k] && subClassProperties[k].id) {
idFound = true;
break;
@ -417,17 +394,17 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett
}
// Merging the properties
const keys = Object.keys(baseClassProperties);
for (let i = 0, n = keys.length; i < n; i++) {
const key = keys[i];
var keys = Object.keys(baseClassProperties);
for (var i = 0, n = keys.length; i < n; i++) {
var key = keys[i];
if (idFound && baseClassProperties[key].id) {
// don't inherit id properties
continue;
}
if (subClassProperties[key] === undefined) {
const baseProp = baseClassProperties[key];
let basePropCopy = baseProp;
var baseProp = baseClassProperties[key];
var basePropCopy = baseProp;
if (baseProp && typeof baseProp === 'object') {
// Deep clone the base properties
basePropCopy = deepMerge(baseProp);
@ -437,8 +414,8 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett
}
// Merging the settings
const originalSubclassSettings = subClassSettings;
const mergePolicy = ModelClass.getMergePolicy(subClassSettings);
var originalSubclassSettings = subClassSettings;
let mergePolicy = ModelClass.getMergePolicy(subClassSettings);
subClassSettings = mergeSettings(baseClassSettings, subClassSettings, mergePolicy);
// Ensure 'base' is not inherited. Note we don't have to delete 'super'
@ -449,7 +426,7 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett
}
// Define the subclass
const subClass = modelBuilder.define(className, subClassProperties, subClassSettings, ModelClass);
var subClass = modelBuilder.define(className, subClassProperties, subClassSettings, ModelClass);
// Calling the setup function
if (typeof subClass.setup === 'function') {
@ -497,7 +474,7 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett
*/
function mergeSettings(baseClassSettings, subClassSettings, mergePolicy) {
// deep clone base class settings
const mergedSettings = deepMerge(baseClassSettings);
let mergedSettings = deepMerge(baseClassSettings);
Object.keys(baseClassSettings).forEach(function(key) {
// rank base class settings arrays elements where required
@ -550,15 +527,15 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett
* @param {String} propertyName Name of the property.
*/
ModelClass.registerProperty = function(propertyName) {
const properties = modelDefinition.build();
const prop = properties[propertyName];
const DataType = prop.type;
var properties = modelDefinition.build();
var prop = properties[propertyName];
var DataType = prop.type;
if (!DataType) {
throw new Error(g.f('Invalid type for property %s', propertyName));
}
if (prop.required) {
const requiredOptions = typeof prop.required === 'object' ? prop.required : undefined;
var requiredOptions = typeof prop.required === 'object' ? prop.required : undefined;
ModelClass.validatesPresenceOf(propertyName, requiredOptions);
}
if (DataType === Date) ModelClass.validatesDateOf(propertyName);
@ -572,7 +549,7 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett
}
},
set: function(value) {
let DataType = ModelClass.definition.properties[propertyName].type;
var DataType = ModelClass.definition.properties[propertyName].type;
if (Array.isArray(DataType) || DataType === Array) {
DataType = List;
} else if (DataType === Date) {
@ -583,7 +560,7 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett
DataType = modelBuilder.resolveType(DataType);
}
const persistUndefinedAsNull = ModelClass.definition.settings.persistUndefinedAsNull;
var persistUndefinedAsNull = ModelClass.definition.settings.persistUndefinedAsNull;
if (value === undefined && persistUndefinedAsNull) {
value = null;
}
@ -596,19 +573,11 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett
this.__data[propertyName] = value;
} else {
if (DataType === List) {
this.__data[propertyName] = isClass(DataType) ?
new DataType(value, properties[propertyName].type, this) :
DataType(value, properties[propertyName].type, this);
this.__data[propertyName] = DataType(value, properties[propertyName].type, this.__data);
} else {
// Assume the type constructor handles Constructor() call
// If not, we should call new DataType(value).valueOf();
this.__data[propertyName] = (value instanceof DataType) ?
value :
isClass(DataType) ? new DataType(value) : DataType(value);
if (value && this.__data[propertyName] instanceof DefaultModelBaseClass) {
// we are dealing with an embedded model, apply parent
applyParentProperty(this.__data[propertyName], this);
}
this.__data[propertyName] = (value instanceof DataType) ? value : DataType(value);
}
}
}
@ -634,20 +603,20 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett
});
};
const props = ModelClass.definition.properties;
let keys = Object.keys(props);
let size = keys.length;
for (let i = 0; i < size; i++) {
const propertyName = keys[i];
var props = ModelClass.definition.properties;
var keys = Object.keys(props);
var size = keys.length;
for (i = 0; i < size; i++) {
var propertyName = keys[i];
ModelClass.registerProperty(propertyName);
}
const mixinSettings = settings.mixins || {};
var mixinSettings = settings.mixins || {};
keys = Object.keys(mixinSettings);
size = keys.length;
for (let i = 0; i < size; i++) {
const name = keys[i];
let mixin = mixinSettings[name];
for (i = 0; i < size; i++) {
var name = keys[i];
var mixin = mixinSettings[name];
if (mixin === true) {
mixin = {};
}
@ -668,48 +637,10 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett
return ModelClass;
};
function createModelClassCtor(name, ModelBaseClass) {
// A simple sanitization to handle most common characters
// that are used in model names but cannot be used as a function/class name.
// Note that the rules for valid JS indentifiers are way too complex,
// implementing a fully spec-compliant sanitization is not worth the effort.
// See https://mathiasbynens.be/notes/javascript-identifiers-es6
name = name.replace(/[-.:]/g, '_');
try {
// It is not possible to access closure variables like "ModelBaseClass"
// from a dynamically defined function. The solution is to
// create a dynamically defined factory function that accepts
// closure variables as arguments.
const factory = new Function('ModelBaseClass', `
// every class can receive hash of data as optional param
return function ${name}(data, options) {
if (!(this instanceof ${name})) {
return new ${name}(data, options);
}
if (${name}.settings.unresolved) {
throw new Error(g.f('Model %s is not defined.', ${JSON.stringify(name)}));
}
ModelBaseClass.apply(this, arguments);
};`);
return factory(ModelBaseClass);
} catch (err) {
// modelName is not a valid function/class name, e.g. 'grand-child'
// and our simple sanitization was not good enough.
// Falling back to legacy 'ModelConstructor' name.
if (err.name === 'SyntaxError') {
return createModelClassCtor('ModelConstructor', ModelBaseClass);
} else {
throw err;
}
}
}
// DataType for Date
function DateType(arg) {
if (arg === null) return null;
const d = new Date(arg);
var d = new Date(arg);
return d;
}
@ -783,19 +714,19 @@ ModelBuilder.prototype.defineValueType = function(type, aliases) {
* @property {Boolean} index True if the property is an index; false otherwise.
*/
ModelBuilder.prototype.extendModel = function(model, props) {
const t = this;
const keys = Object.keys(props);
for (let i = 0; i < keys.length; i++) {
const definition = props[keys[i]];
var t = this;
var keys = Object.keys(props);
for (var i = 0; i < keys.length; i++) {
var definition = props[keys[i]];
t.defineProperty(model, keys[i], definition);
}
};
ModelBuilder.prototype.copyModel = function copyModel(Master) {
const modelBuilder = this;
const className = Master.modelName;
const md = Master.modelBuilder.definitions[className];
const Slave = function SlaveModel() {
var modelBuilder = this;
var className = Master.modelName;
var md = Master.modelBuilder.definitions[className];
var Slave = function SlaveModel() {
Master.apply(this, [].slice.call(arguments));
};
@ -819,16 +750,6 @@ ModelBuilder.prototype.copyModel = function copyModel(Master) {
return Slave;
};
/**
* Remove a model from the registry.
*
* @param {String} modelName
*/
ModelBuilder.prototype.deleteModelByName = function(modelName) {
delete this.models[modelName];
delete this.definitions[modelName];
};
/*!
* Define hidden property
*/
@ -862,46 +783,47 @@ ModelBuilder.prototype.getSchemaName = function(name) {
/**
* Resolve the type string to be a function, for example, 'String' to String.
* Returns {Function} if the type is resolved
* @param {String | Object | Array} prop The object whose type is to be resolved
* @param {String} type The type string, such as 'number', 'Number', 'boolean',
* or 'String'. This parameter is case insensitive.
*/
ModelBuilder.prototype.resolveType = function(prop, isSubProperty) {
if (!prop) {
return prop;
ModelBuilder.prototype.resolveType = function(type) {
if (!type) {
return type;
}
if (Array.isArray(prop) && prop.length > 0) {
if (Array.isArray(type) && type.length > 0) {
// For array types, the first item should be the type string
const itemType = this.resolveType(prop[0]);
var itemType = this.resolveType(type[0]);
if (typeof itemType === 'function') {
return [itemType];
} else {
return itemType; // Not resolved, return the type string
}
}
if (typeof prop === 'string') {
const schemaType = ModelBuilder.schemaTypes[prop.toLowerCase()] || this.models[prop];
if (typeof type === 'string') {
var schemaType = ModelBuilder.schemaTypes[type.toLowerCase()] || this.models[type];
if (schemaType) {
return schemaType;
} else {
// The type cannot be resolved, let's create a place holder
prop = this.define(prop, {}, {unresolved: true});
return prop;
type = this.define(type, {}, {unresolved: true});
return type;
}
} else if (prop.constructor.name === 'Object') {
} else if (type.constructor.name === 'Object') {
// We also support the syntax {type: 'string', ...}
if (!isSubProperty && prop.type) {
return this.resolveType(prop.type, true);
if (type.type) {
return this.resolveType(type.type);
} else {
return this.define(this.getSchemaName(null),
prop, {
type, {
anonymous: true,
idInjection: false,
strict: this.settings.strictEmbeddedModels || false,
});
}
} else if ('function' === typeof prop) {
return prop;
} else if ('function' === typeof type) {
return type;
}
return prop;
return type;
};
/**
@ -918,7 +840,7 @@ ModelBuilder.prototype.resolveType = function(prop, isSubProperty) {
* model name.
*/
ModelBuilder.prototype.buildModels = function(schemas, createModel) {
const models = {};
var models = {};
// Normalize the schemas to be an array of the schema objects {name: <name>, properties: {}, options: {}}
if (!Array.isArray(schemas)) {
@ -937,22 +859,25 @@ ModelBuilder.prototype.buildModels = function(schemas, createModel) {
}
}
let relations = [];
for (let s = 0, n = schemas.length; s < n; s++) {
const name = this.getSchemaName(schemas[s].name);
var relations = [];
for (var s = 0, n = schemas.length; s < n; s++) {
var name = this.getSchemaName(schemas[s].name);
schemas[s].name = name;
const model = typeof createModel === 'function' ?
createModel(schemas[s].name, schemas[s].properties, schemas[s].options) :
this.define(schemas[s].name, schemas[s].properties, schemas[s].options);
var model;
if (typeof createModel === 'function') {
model = createModel(schemas[s].name, schemas[s].properties, schemas[s].options);
} else {
model = this.define(schemas[s].name, schemas[s].properties, schemas[s].options);
}
models[name] = model;
relations = relations.concat(model.definition.relations);
}
// Connect the models based on the relations
for (let i = 0; i < relations.length; i++) {
const relation = relations[i];
const sourceModel = models[relation.source];
const targetModel = models[relation.target];
for (var i = 0; i < relations.length; i++) {
var relation = relations[i];
var sourceModel = models[relation.source];
var targetModel = models[relation.target];
if (sourceModel && targetModel) {
if (typeof sourceModel[relation.type] === 'function') {
sourceModel[relation.type](targetModel, {as: relation.as});
@ -971,7 +896,7 @@ ModelBuilder.prototype.buildModels = function(schemas, createModel) {
*/
ModelBuilder.prototype.buildModelFromInstance = function(name, json, options) {
// Introspect the JSON document to generate a schema
const schema = introspect(json);
var schema = introspect(json);
// Create a model for the generated schema
return this.define(name, schema, options);

View File

@ -1,16 +1,15 @@
// Copyright IBM Corp. 2013,2019. All Rights Reserved.
// Copyright IBM Corp. 2013,2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const assert = require('assert');
const util = require('util');
const EventEmitter = require('events').EventEmitter;
const traverse = require('traverse');
const ModelBaseClass = require('./model');
const ModelBuilder = require('./model-builder');
var assert = require('assert');
var util = require('util');
var EventEmitter = require('events').EventEmitter;
var traverse = require('traverse');
var ModelBaseClass = require('./model');
var ModelBuilder = require('./model-builder');
/**
* Model definition
@ -36,7 +35,7 @@ function ModelDefinition(modelBuilder, name, properties, settings) {
assert(name, 'name is missing');
if (arguments.length === 2 && typeof name === 'object') {
const schema = name;
var schema = name;
this.name = schema.name;
this.rawProperties = schema.properties || {}; // Keep the raw property definitions
this.settings = schema.settings || {};
@ -61,7 +60,7 @@ require('./types')(ModelDefinition);
* @param {String} connectorType The connector type, such as 'oracle' or 'mongodb'
*/
ModelDefinition.prototype.tableName = function(connectorType) {
const settings = this.settings;
var settings = this.settings;
if (settings[connectorType]) {
return settings[connectorType].table || settings[connectorType].tableName || this.name;
} else {
@ -80,7 +79,7 @@ ModelDefinition.prototype.columnName = function(connectorType, propertyName) {
return propertyName;
}
this.build();
const property = this.properties[propertyName];
var property = this.properties[propertyName];
if (property && property[connectorType]) {
return property[connectorType].column || property[connectorType].columnName || propertyName;
} else {
@ -99,7 +98,7 @@ ModelDefinition.prototype.columnMetadata = function(connectorType, propertyName)
return propertyName;
}
this.build();
const property = this.properties[propertyName];
var property = this.properties[propertyName];
if (property && property[connectorType]) {
return property[connectorType];
} else {
@ -114,9 +113,9 @@ ModelDefinition.prototype.columnMetadata = function(connectorType, propertyName)
*/
ModelDefinition.prototype.columnNames = function(connectorType) {
this.build();
const props = this.properties;
const cols = [];
for (const p in props) {
var props = this.properties;
var cols = [];
for (var p in props) {
if (props[p][connectorType]) {
cols.push(props[p][connectorType].column || props[p][connectorType].columnName || p);
} else {
@ -134,11 +133,11 @@ ModelDefinition.prototype.ids = function() {
if (this._ids) {
return this._ids;
}
const ids = [];
var ids = [];
this.build();
const props = this.properties;
for (const key in props) {
let id = props[key].id;
var props = this.properties;
for (var key in props) {
var id = props[key].id;
if (!id) {
continue;
}
@ -168,7 +167,7 @@ ModelDefinition.prototype.idColumnName = function(connectorType) {
* @returns {String} property name for ID
*/
ModelDefinition.prototype.idName = function() {
const id = this.ids()[0];
var id = this.ids()[0];
if (this.properties.id && this.properties.id.id) {
return 'id';
} else {
@ -181,8 +180,8 @@ ModelDefinition.prototype.idName = function() {
* @returns {String[]} property names for IDs
*/
ModelDefinition.prototype.idNames = function() {
const ids = this.ids();
const names = ids.map(function(id) {
var ids = this.ids();
var names = ids.map(function(id) {
return id.name;
});
return names;
@ -194,13 +193,13 @@ ModelDefinition.prototype.idNames = function() {
*/
ModelDefinition.prototype.indexes = function() {
this.build();
const indexes = {};
var indexes = {};
if (this.settings.indexes) {
for (const i in this.settings.indexes) {
for (var i in this.settings.indexes) {
indexes[i] = this.settings.indexes[i];
}
}
for (const p in this.properties) {
for (var p in this.properties) {
if (this.properties[p].index) {
indexes[p + '_index'] = this.properties[p].index;
}
@ -223,9 +222,9 @@ ModelDefinition.prototype.build = function(forceRebuild) {
return this.properties;
}
this.properties = {};
for (const p in this.rawProperties) {
const prop = this.rawProperties[p];
const type = this.modelBuilder.resolveType(prop);
for (var p in this.rawProperties) {
var prop = this.rawProperties[p];
var type = this.modelBuilder.resolveType(prop);
if (typeof type === 'string') {
this.relations.push({
source: this.name,
@ -234,11 +233,11 @@ ModelDefinition.prototype.build = function(forceRebuild) {
as: p,
});
} else {
const typeDef = {
var typeDef = {
type: type,
};
if (typeof prop === 'object' && prop !== null) {
for (const a in prop) {
for (var a in prop) {
// Skip the type property but don't delete it Model.extend() shares same instances of the properties from the base class
if (a !== 'type') {
typeDef[a] = prop[a];
@ -275,14 +274,14 @@ ModelDefinition.prototype.toJSON = function(forceRebuild) {
if (this.json) {
return this.json;
}
const json = {
var json = {
name: this.name,
properties: {},
settings: this.settings,
};
this.build(forceRebuild);
const mapper = function(val) {
var mapper = function(val) {
if (val === undefined || val === null) {
return val;
}
@ -303,7 +302,7 @@ ModelDefinition.prototype.toJSON = function(forceRebuild) {
return val;
}
};
for (const p in this.properties) {
for (var p in this.properties) {
json.properties[p] = traverse(this.properties[p]).map(mapper);
}
this.json = json;

View File

@ -1,586 +0,0 @@
// Copyright IBM Corp. 2018,2019. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
// Turning on strict for this file breaks lots of test cases;
// disabling strict for this file
/* eslint-disable strict */
module.exports = ModelUtils;
/*!
* Module dependencies
*/
const g = require('strong-globalize')();
const geo = require('./geo');
const {
fieldsToArray,
sanitizeQuery: sanitizeQueryOrData,
isPlainObject,
isClass,
toRegExp,
} = require('./utils');
const BaseModel = require('./model');
/**
* A mixin to contain utility methods for DataAccessObject
*/
function ModelUtils() {
}
/**
* Verify if allowExtendedOperators is enabled
* @options {Object} [options] Optional options to use.
* @property {Boolean} allowExtendedOperators.
* @returns {Boolean} Returns `true` if allowExtendedOperators is enabled, else `false`.
*/
ModelUtils._allowExtendedOperators = function(options) {
const flag = this._getSetting('allowExtendedOperators', options);
if (flag != null) return !!flag;
// Default to `false`
return false;
};
/**
* Get settings via hierarchical determination
* - method level options
* - model level settings
* - data source level settings
*
* @param {String} key The setting key
*/
ModelUtils._getSetting = function(key, options) {
// Check method level options
let val = options && options[key];
if (val !== undefined) return val;
// Check for settings in model
const m = this.definition;
if (m && m.settings) {
val = m.settings[key];
if (val !== undefined) {
return m.settings[key];
}
// Fall back to data source level
}
// Check for settings in connector
const ds = this.getDataSource();
if (ds && ds.settings) {
return ds.settings[key];
}
return undefined;
};
const operators = {
eq: '=',
gt: '>',
gte: '>=',
lt: '<',
lte: '<=',
between: 'BETWEEN',
inq: 'IN',
nin: 'NOT IN',
neq: '!=',
like: 'LIKE',
nlike: 'NOT LIKE',
ilike: 'ILIKE',
nilike: 'NOT ILIKE',
regexp: 'REGEXP',
};
/*
* Normalize the filter object and throw errors if invalid values are detected
* @param {Object} filter The query filter object
* @options {Object} [options] Optional options to use.
* @property {Boolean} allowExtendedOperators.
* @returns {Object} The normalized filter object
* @private
*/
ModelUtils._normalize = function(filter, options) {
if (!filter) {
return undefined;
}
let err = null;
if ((typeof filter !== 'object') || Array.isArray(filter)) {
err = new Error(g.f('The query filter %j is not an {{object}}', filter));
err.statusCode = 400;
throw err;
}
if (filter.limit || filter.skip || filter.offset) {
const limit = Number(filter.limit || 100);
const offset = Number(filter.skip || filter.offset || 0);
if (isNaN(limit) || limit <= 0 || Math.ceil(limit) !== limit) {
err = new Error(g.f('The {{limit}} parameter %j is not valid',
filter.limit));
err.statusCode = 400;
throw err;
}
if (isNaN(offset) || offset < 0 || Math.ceil(offset) !== offset) {
err = new Error(g.f('The {{offset/skip}} parameter %j is not valid',
filter.skip || filter.offset));
err.statusCode = 400;
throw err;
}
filter.limit = limit;
filter.offset = offset;
filter.skip = offset;
}
if (filter.order) {
let order = filter.order;
if (!Array.isArray(order)) {
order = [order];
}
const fields = [];
for (let i = 0, m = order.length; i < m; i++) {
if (typeof order[i] === 'string') {
// Normalize 'f1 ASC, f2 DESC, f3' to ['f1 ASC', 'f2 DESC', 'f3']
const tokens = order[i].split(/(?:\s*,\s*)+/);
for (let t = 0, n = tokens.length; t < n; t++) {
let token = tokens[t];
if (token.length === 0) {
// Skip empty token
continue;
}
const parts = token.split(/\s+/);
if (parts.length >= 2) {
const dir = parts[1].toUpperCase();
if (dir === 'ASC' || dir === 'DESC') {
token = parts[0] + ' ' + dir;
} else {
err = new Error(g.f('The {{order}} %j has invalid direction', token));
err.statusCode = 400;
throw err;
}
}
fields.push(token);
}
} else {
err = new Error(g.f('The order %j is not valid', order[i]));
err.statusCode = 400;
throw err;
}
}
if (fields.length === 1 && typeof filter.order === 'string') {
filter.order = fields[0];
} else {
filter.order = fields;
}
}
// normalize fields as array of included property names
if (filter.fields) {
filter.fields = fieldsToArray(filter.fields,
Object.keys(this.definition.properties), this.settings.strict);
}
filter = this._sanitizeQuery(filter, options);
this._coerce(filter.where, options);
return filter;
};
function DateType(arg) {
const d = new Date(arg);
if (isNaN(d.getTime())) {
throw new Error(g.f('Invalid date: %s', arg));
}
return d;
}
function BooleanType(arg) {
if (typeof arg === 'string') {
switch (arg) {
case 'true':
case '1':
return true;
case 'false':
case '0':
return false;
}
}
if (arg == null) {
return null;
}
return Boolean(arg);
}
function NumberType(val) {
const num = Number(val);
return !isNaN(num) ? num : val;
}
function coerceArray(val) {
if (Array.isArray(val)) {
return val;
}
if (!isPlainObject(val)) {
throw new Error(g.f('Value is not an {{array}} or {{object}} with sequential numeric indices'));
}
// It is an object, check if empty
const props = Object.keys(val);
if (props.length === 0) {
throw new Error(g.f('Value is an empty {{object}}'));
}
const arrayVal = new Array(props.length);
for (let i = 0; i < arrayVal.length; ++i) {
if (!val.hasOwnProperty(i)) {
throw new Error(g.f('Value is not an {{array}} or {{object}} with sequential numeric indices'));
}
arrayVal[i] = val[i];
}
return arrayVal;
}
function _normalizeAsArray(result) {
if (typeof result === 'string') {
result = [result];
}
if (Array.isArray(result)) {
return result;
} else {
// See https://github.com/strongloop/loopback-datasource-juggler/issues/1646
// `ModelBaseClass` normalize the properties to an object such as `{secret: true}`
const keys = [];
for (const k in result) {
if (result[k]) keys.push(k);
}
return keys;
}
}
/**
* Get an array of hidden property names
*/
ModelUtils._getHiddenProperties = function() {
const settings = this.definition.settings || {};
const result = settings.hiddenProperties || settings.hidden || [];
return _normalizeAsArray(result);
};
/**
* Get an array of protected property names
*/
ModelUtils._getProtectedProperties = function() {
const settings = this.definition.settings || {};
const result = settings.protectedProperties || settings.protected || [];
return _normalizeAsArray(result);
};
/**
* Get the maximum depth of a query object
*/
ModelUtils._getMaxDepthOfQuery = function(options, defaultValue) {
options = options || {};
// See https://github.com/strongloop/loopback-datasource-juggler/issues/1651
let maxDepth = this._getSetting('maxDepthOfQuery', options);
if (maxDepth == null) {
maxDepth = defaultValue || 32;
}
return +maxDepth;
};
/**
* Get the maximum depth of a data object
*/
ModelUtils._getMaxDepthOfData = function(options, defaultValue) {
options = options || {};
// See https://github.com/strongloop/loopback-datasource-juggler/issues/1651
let maxDepth = this._getSetting('maxDepthOfData', options);
if (maxDepth == null) {
maxDepth = defaultValue || 64;
}
return +maxDepth;
};
/**
* Get the prohibitHiddenPropertiesInQuery flag
*/
ModelUtils._getProhibitHiddenPropertiesInQuery = function(options, defaultValue) {
const flag = this._getSetting('prohibitHiddenPropertiesInQuery', options);
if (flag == null) return !!defaultValue;
return !!flag;
};
/**
* Sanitize the query object
*/
ModelUtils._sanitizeQuery = function(query, options) {
options = options || {};
// Get settings to normalize `undefined` values
const normalizeUndefinedInQuery = this._getSetting('normalizeUndefinedInQuery', options);
// Get setting to prohibit hidden/protected properties in query
const prohibitHiddenPropertiesInQuery = this._getProhibitHiddenPropertiesInQuery(options);
// See https://github.com/strongloop/loopback-datasource-juggler/issues/1651
const maxDepthOfQuery = this._getMaxDepthOfQuery(options);
let prohibitedKeys = [];
// Check violation of keys
if (prohibitHiddenPropertiesInQuery) {
prohibitedKeys = this._getHiddenProperties();
if (options.prohibitProtectedPropertiesInQuery) {
prohibitedKeys = prohibitedKeys.concat(this._getProtectedProperties());
}
}
return sanitizeQueryOrData(query,
Object.assign({
maxDepth: maxDepthOfQuery,
prohibitedKeys: prohibitedKeys,
normalizeUndefinedInQuery: normalizeUndefinedInQuery,
}, options));
};
/**
* Sanitize the data object
*/
ModelUtils._sanitizeData = function(data, options) {
options = options || {};
return sanitizeQueryOrData(data,
Object.assign({
maxDepth: this._getMaxDepthOfData(options),
}, options));
};
/*
* Coerce values based the property types
* @param {Object} where The where clause
* @options {Object} [options] Optional options to use.
* @param {Object} Optional model definition to use.
* @property {Boolean} allowExtendedOperators.
* @returns {Object} The coerced where clause
* @private
*/
ModelUtils._coerce = function(where, options, modelDef) {
const self = this;
if (where == null) {
return where;
}
options = options || {};
let err;
if (typeof where !== 'object' || Array.isArray(where)) {
err = new Error(g.f('The where clause %j is not an {{object}}', where));
err.statusCode = 400;
throw err;
}
let props;
if (modelDef && modelDef.properties) {
props = modelDef.properties;
} else {
props = self.definition.properties;
}
for (const p in where) {
// Handle logical operators
if (p === 'and' || p === 'or' || p === 'nor') {
let clauses = where[p];
try {
clauses = coerceArray(clauses);
} catch (e) {
err = new Error(g.f('The %s operator has invalid clauses %j: %s', p, clauses, e.message));
err.statusCode = 400;
throw err;
}
for (let k = 0; k < clauses.length; k++) {
self._coerce(clauses[k], options);
}
where[p] = clauses;
continue;
}
let DataType = props[p] && props[p].type;
if (!DataType) {
continue;
}
if ((Array.isArray(DataType) || DataType === Array) && !isNestedModel(DataType)) {
DataType = DataType[0];
}
if (DataType === Date) {
DataType = DateType;
} else if (DataType === Boolean) {
DataType = BooleanType;
} else if (DataType === Number) {
// This fixes a regression in mongodb connector
// For numbers, only convert it produces a valid number
// LoopBack by default injects a number id. We should fix it based
// on the connector's input, for example, MongoDB should use string
// while RDBs typically use number
DataType = NumberType;
}
if (!DataType) {
continue;
}
if (DataType === geo.GeoPoint) {
// Skip the GeoPoint as the near operator breaks the assumption that
// an operation has only one property
// We should probably fix it based on
// http://docs.mongodb.org/manual/reference/operator/query/near/
// The other option is to make operators start with $
continue;
}
let val = where[p];
if (val === null || val === undefined) {
continue;
}
// Check there is an operator
let operator = null;
const exp = val;
if (val.constructor === Object) {
for (const op in operators) {
if (op in val) {
val = val[op];
operator = op;
switch (operator) {
case 'inq':
case 'nin':
case 'between':
try {
val = coerceArray(val);
} catch (e) {
err = new Error(g.f('The %s property has invalid clause %j: %s', p, where[p], e));
err.statusCode = 400;
throw err;
}
if (operator === 'between' && val.length !== 2) {
err = new Error(g.f(
'The %s property has invalid clause %j: Expected precisely 2 values, received %d',
p,
where[p],
val.length,
));
err.statusCode = 400;
throw err;
}
break;
case 'like':
case 'nlike':
case 'ilike':
case 'nilike':
if (!(typeof val === 'string' || val instanceof RegExp)) {
err = new Error(g.f(
'The %s property has invalid clause %j: Expected a string or RegExp',
p,
where[p],
));
err.statusCode = 400;
throw err;
}
break;
case 'regexp':
val = toRegExp(val);
if (val instanceof Error) {
val.statusCode = 400;
throw val;
}
break;
}
break;
}
}
}
try {
// Coerce val into an array if it resembles an array-like object
val = coerceArray(val);
} catch (e) {
// NOOP when not coercable into an array.
}
const allowExtendedOperators = self._allowExtendedOperators(options);
// Coerce the array items
if (Array.isArray(val) && !isNestedModel(DataType)) {
for (let i = 0; i < val.length; i++) {
if (val[i] !== null && val[i] !== undefined) {
if (!(val[i] instanceof RegExp)) {
val[i] = isClass(DataType) ? new DataType(val[i]) : DataType(val[i]);
}
}
}
} else {
if (val != null) {
if (operator === null && val instanceof RegExp) {
// Normalize {name: /A/} to {name: {regexp: /A/}}
operator = 'regexp';
} else if (operator === 'regexp' && val instanceof RegExp) {
// Do not coerce regex literals/objects
} else if ((operator === 'like' || operator === 'nlike' ||
operator === 'ilike' || operator === 'nilike') && val instanceof RegExp) {
// Do not coerce RegExp operator value
} else if (allowExtendedOperators && typeof val === 'object') {
// Do not coerce object values when extended operators are allowed
} else {
if (!allowExtendedOperators) {
const extendedOperators = Object.keys(val).filter(function(k) {
return k[0] === '$';
});
if (extendedOperators.length) {
const msg = g.f('Operators "' + extendedOperators.join(', ') + '" are not allowed in query');
const err = new Error(msg);
err.code = 'OPERATOR_NOT_ALLOWED_IN_QUERY';
err.statusCode = 400;
err.details = {
operators: extendedOperators,
where: where,
};
throw err;
}
}
if (isNestedModel(DataType)) {
if (Array.isArray(DataType) && Array.isArray(val)) {
if (val === null || val === undefined) continue;
for (const it of val) {
self._coerce(it, options, DataType[0].definition);
}
} else {
self._coerce(val, options, DataType.definition);
}
continue;
} else {
val = isClass(DataType) ? new DataType(val) : DataType(val);
}
}
}
}
// Rebuild {property: {operator: value}}
if (operator && operator !== 'eq') {
const value = {};
value[operator] = val;
if (exp.options) {
// Keep options for operators
value.options = exp.options;
}
val = value;
}
where[p] = val;
}
return where;
};
/**
* A utility function which checks for nested property definitions
*
* @param {*} propType Property type metadata
*
*/
function isNestedModel(propType) {
if (!propType) return false;
if (Array.isArray(propType)) return isNestedModel(propType[0]);
return propType.hasOwnProperty('definition') && propType.definition.hasOwnProperty('properties');
}

View File

@ -1,4 +1,4 @@
// Copyright IBM Corp. 2013,2019. All Rights Reserved.
// Copyright IBM Corp. 2013,2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
@ -16,22 +16,20 @@ module.exports = ModelBaseClass;
* Module dependencies
*/
const g = require('strong-globalize')();
const util = require('util');
const jutil = require('./jutil');
const List = require('./list');
const DataAccessUtils = require('./model-utils');
const Observer = require('./observer');
const Hookable = require('./hooks');
const validations = require('./validations');
const _extend = util._extend;
const utils = require('./utils');
const fieldsToArray = utils.fieldsToArray;
const uuid = require('uuid');
const {nanoid} = require('nanoid');
var g = require('strong-globalize')();
var util = require('util');
var jutil = require('./jutil');
var List = require('./list');
var Hookable = require('./hooks');
var validations = require('./validations');
var _extend = util._extend;
var utils = require('./utils');
var fieldsToArray = utils.fieldsToArray;
var uuid = require('uuid');
var shortid = require('shortid');
// Set up an object for quick lookup
const BASE_TYPES = {
var BASE_TYPES = {
'String': true,
'Boolean': true,
'Number': true,
@ -73,10 +71,10 @@ function ModelBaseClass(data, options) {
* @private
*/
ModelBaseClass.prototype._initProperties = function(data, options) {
const self = this;
const ctor = this.constructor;
var self = this;
var ctor = this.constructor;
if (typeof data !== 'undefined' && data !== null && data.constructor &&
if (typeof data !== 'undefined' && data.constructor &&
typeof (data.constructor) !== 'function') {
throw new Error(g.f('Property name "{{constructor}}" is not allowed in %s data', ctor.modelName));
}
@ -85,7 +83,7 @@ ModelBaseClass.prototype._initProperties = function(data, options) {
// Convert the data to be plain object to avoid pollutions
data = data.toObject(false);
}
const properties = _extend({}, ctor.definition.properties);
var properties = _extend({}, ctor.definition.properties);
data = data || {};
if (typeof ctor.applyProperties === 'function') {
@ -93,9 +91,9 @@ ModelBaseClass.prototype._initProperties = function(data, options) {
}
options = options || {};
const applySetters = options.applySetters;
const applyDefaultValues = options.applyDefaultValues;
let strict = options.strict;
var applySetters = options.applySetters;
var applyDefaultValues = options.applyDefaultValues;
var strict = options.strict;
if (strict === undefined) {
strict = ctor.definition.settings.strict;
@ -105,7 +103,7 @@ ModelBaseClass.prototype._initProperties = function(data, options) {
'{{`Validation Error`}} for unknown properties,', ctor.modelName);
}
const persistUndefinedAsNull = ctor.definition.settings.persistUndefinedAsNull;
var persistUndefinedAsNull = ctor.definition.settings.persistUndefinedAsNull;
if (ctor.hideInternalProperties) {
// Object.defineProperty() is expensive. We only try to make the internal
@ -177,7 +175,7 @@ ModelBaseClass.prototype._initProperties = function(data, options) {
this.__cachedRelations = data.__cachedRelations;
}
let keys = Object.keys(data);
var keys = Object.keys(data);
if (Array.isArray(options.fields)) {
keys = keys.filter(function(k) {
@ -185,9 +183,9 @@ ModelBaseClass.prototype._initProperties = function(data, options) {
});
}
let size = keys.length;
let p, propVal;
for (let k = 0; k < size; k++) {
var size = keys.length;
var p, propVal;
for (var k = 0; k < size; k++) {
p = keys[k];
propVal = data[p];
if (typeof propVal === 'function') {
@ -206,14 +204,14 @@ ModelBaseClass.prototype._initProperties = function(data, options) {
self.__data[p] = propVal;
}
} else if (ctor.relations[p]) {
const relationType = ctor.relations[p].type;
var relationType = ctor.relations[p].type;
let modelTo;
var modelTo;
if (!properties[p]) {
modelTo = ctor.relations[p].modelTo || ModelBaseClass;
const multiple = ctor.relations[p].multiple;
const typeName = multiple ? 'Array' : modelTo.modelName;
const propType = multiple ? [modelTo] : modelTo;
var multiple = ctor.relations[p].multiple;
var typeName = multiple ? 'Array' : modelTo.modelName;
var propType = multiple ? [modelTo] : modelTo;
properties[p] = {name: typeName, type: propType};
/* Issue #1252
this.setStrict(false);
@ -226,7 +224,7 @@ ModelBaseClass.prototype._initProperties = function(data, options) {
self.__data[ctor.relations[p].keyFrom] = propVal[ctor.relations[p].keyTo];
if (ctor.relations[p].options.embedsProperties) {
const fields = fieldsToArray(ctor.relations[p].properties,
var fields = fieldsToArray(ctor.relations[p].properties,
modelTo.definition.properties, modelTo.settings.strict);
if (!~fields.indexOf(ctor.relations[p].keyTo)) {
fields.push(ctor.relations[p].keyTo);
@ -251,7 +249,7 @@ ModelBaseClass.prototype._initProperties = function(data, options) {
throw new Error(g.f(
'Property names containing dot(s) are not supported. ' +
'Model: %s, dynamic property: %s',
this.constructor.modelName, p,
this.constructor.modelName, p
));
}
} else {
@ -272,14 +270,14 @@ ModelBaseClass.prototype._initProperties = function(data, options) {
size = keys.length;
for (let k = 0; k < size; k++) {
for (k = 0; k < size; k++) {
p = keys[k];
propVal = self.__data[p];
const type = properties[p].type;
var type = properties[p].type;
// Set default values
if (applyDefaultValues && propVal === undefined && appliesDefaultsOnWrites(properties[p])) {
let def = properties[p]['default'];
if (applyDefaultValues && propVal === undefined) {
var def = properties[p]['default'];
if (def !== undefined) {
if (typeof def === 'function') {
if (def === Date) {
@ -299,13 +297,9 @@ ModelBaseClass.prototype._initProperties = function(data, options) {
}
}
if (ignoresMatchedDefault(properties[p]) && properties[p].default === propVal) {
delete self.__data[p];
}
// Set default value using a named function
if (applyDefaultValues && propVal === undefined) {
const defn = properties[p].defaultFn;
var defn = properties[p].defaultFn;
switch (defn) {
case undefined:
break;
@ -322,8 +316,7 @@ ModelBaseClass.prototype._initProperties = function(data, options) {
propVal = new Date();
break;
case 'shortid':
case 'nanoid':
propVal = nanoid(9);
propVal = shortid.generate();
break;
default:
// TODO Support user-provided functions via a registry of functions
@ -354,7 +347,6 @@ ModelBaseClass.prototype._initProperties = function(data, options) {
typeof self.__data[p] === 'object' &&
self.__data[p] !== null) {
self.__data[p] = new type(self.__data[p]);
utils.applyParentProperty(self.__data[p], this);
}
} else if (type.name === 'Array' || Array.isArray(type)) {
if (!(self.__data[p] instanceof List) &&
@ -368,21 +360,6 @@ ModelBaseClass.prototype._initProperties = function(data, options) {
this.trigger('initialize');
};
// Implementation of persistDefaultValues property
function ignoresMatchedDefault(property) {
if (property && property.persistDefaultValues === false) {
return true;
}
}
// Helper function for determing the applyDefaultOnWrites value of a property
function appliesDefaultsOnWrites(property) {
if (property && ('applyDefaultOnWrites' in property)) {
return property.applyDefaultOnWrites;
}
return true;
}
/**
* Define a property on the model.
* @param {String} prop Property name
@ -402,7 +379,7 @@ ModelBaseClass.defineProperty = function(prop, params) {
* @returns {String} Name of property type
*/
ModelBaseClass.getPropertyType = function(propName) {
const prop = this.definition.properties[propName];
var prop = this.definition.properties[propName];
if (!prop) {
// The property is not part of the definition
return null;
@ -441,33 +418,27 @@ ModelBaseClass.toString = function() {
* @returns {Object} returns Plain JSON object
*/
ModelBaseClass.prototype.toObject = function(onlySchema, removeHidden, removeProtected) {
if (typeof onlySchema === 'object' && onlySchema != null) {
const options = onlySchema;
onlySchema = options.onlySchema;
removeHidden = options.removeHidden;
removeProtected = options.removeProtected;
}
if (onlySchema === undefined) {
onlySchema = true;
}
const data = {};
const self = this;
const Model = this.constructor;
var data = {};
var self = this;
var Model = this.constructor;
// if it is already an Object
if (Model === Object) {
return self;
}
const strict = this.__strict;
const schemaLess = (strict === false) || !onlySchema;
const persistUndefinedAsNull = Model.definition.settings.persistUndefinedAsNull;
var strict = this.__strict;
var schemaLess = (strict === false) || !onlySchema;
var persistUndefinedAsNull = Model.definition.settings.persistUndefinedAsNull;
const props = Model.definition.properties;
let keys = Object.keys(props);
let propertyName, val;
var props = Model.definition.properties;
var keys = Object.keys(props);
var propertyName, val;
for (let i = 0; i < keys.length; i++) {
for (var i = 0; i < keys.length; i++) {
propertyName = keys[i];
val = self[propertyName];
@ -503,8 +474,8 @@ ModelBaseClass.prototype.toObject = function(onlySchema, removeHidden, removePro
// If the property is not declared in the model definition, no setter will be
// triggered to add it to __data
keys = Object.keys(self);
let size = keys.length;
for (let i = 0; i < size; i++) {
var size = keys.length;
for (i = 0; i < size; i++) {
propertyName = keys[i];
if (props[propertyName]) {
continue;
@ -538,7 +509,7 @@ ModelBaseClass.prototype.toObject = function(onlySchema, removeHidden, removePro
// Now continue to check __data
keys = Object.keys(self.__data);
size = keys.length;
for (let i = 0; i < size; i++) {
for (i = 0; i < size; i++) {
propertyName = keys[i];
if (propertyName.indexOf('__') === 0) {
continue;
@ -550,7 +521,7 @@ ModelBaseClass.prototype.toObject = function(onlySchema, removeHidden, removePro
if (removeProtected && Model.isProtectedProperty(propertyName)) {
continue;
}
const ownVal = self[propertyName];
var ownVal = self[propertyName];
// The ownVal can be a relation function
val = (ownVal !== undefined && (typeof ownVal !== 'function')) ? ownVal : self.__data[propertyName];
if (typeof val === 'function') {
@ -571,30 +542,28 @@ ModelBaseClass.prototype.toObject = function(onlySchema, removeHidden, removePro
return data;
};
/**
* Convert an array of strings into an object as the map
* @param {string[]} arr An array of strings
*/
function asObjectMap(arr) {
const obj = {};
if (Array.isArray(arr)) {
for (let i = 0; i < arr.length; i++) {
obj[arr[i]] = true;
}
return obj;
}
return arr || obj;
}
/**
* Checks if property is protected.
* @param {String} propertyName Property name
* @returns {Boolean} true or false if protected or not.
* @returns {Boolean} true or false if proptected or not.
*/
ModelBaseClass.isProtectedProperty = function(propertyName) {
const settings = (this.definition && this.definition.settings) || {};
const protectedProperties = settings.protectedProperties || settings.protected;
settings.protectedProperties = asObjectMap(protectedProperties);
return settings.protectedProperties[propertyName];
var Model = this;
var settings = Model.definition && Model.definition.settings;
var protectedProperties = settings && (settings.protectedProperties || settings.protected);
if (Array.isArray(protectedProperties)) {
// Cache the protected properties as an object for quick lookup
settings.protectedProperties = {};
for (var i = 0; i < protectedProperties.length; i++) {
settings.protectedProperties[protectedProperties[i]] = true;
}
protectedProperties = settings.protectedProperties;
}
if (protectedProperties) {
return protectedProperties[propertyName];
} else {
return false;
}
};
/**
@ -603,10 +572,22 @@ ModelBaseClass.isProtectedProperty = function(propertyName) {
* @returns {Boolean} true or false if hidden or not.
*/
ModelBaseClass.isHiddenProperty = function(propertyName) {
const settings = (this.definition && this.definition.settings) || {};
const hiddenProperties = settings.hiddenProperties || settings.hidden;
settings.hiddenProperties = asObjectMap(hiddenProperties);
return settings.hiddenProperties[propertyName];
var Model = this;
var settings = Model.definition && Model.definition.settings;
var hiddenProperties = settings && (settings.hiddenProperties || settings.hidden);
if (Array.isArray(hiddenProperties)) {
// Cache the hidden properties as an object for quick lookup
settings.hiddenProperties = {};
for (var i = 0; i < hiddenProperties.length; i++) {
settings.hiddenProperties[hiddenProperties[i]] = true;
}
hiddenProperties = settings.hiddenProperties;
}
if (hiddenProperties) {
return hiddenProperties[propertyName];
} else {
return false;
}
};
ModelBaseClass.prototype.toJSON = function() {
@ -614,7 +595,7 @@ ModelBaseClass.prototype.toJSON = function() {
};
ModelBaseClass.prototype.fromObject = function(obj) {
for (const key in obj) {
for (var key in obj) {
this[key] = obj[key];
}
};
@ -625,8 +606,8 @@ ModelBaseClass.prototype.fromObject = function(obj) {
* initial state.
*/
ModelBaseClass.prototype.reset = function() {
const obj = this;
for (const k in obj) {
var obj = this;
for (var k in obj) {
if (k !== 'id' && !obj.constructor.dataSource.definitions[obj.constructor.modelName].properties[k]) {
delete obj[k];
}
@ -636,11 +617,11 @@ ModelBaseClass.prototype.reset = function() {
// Node v0.11+ allows custom inspect functions to return an object
// instead of string. That way options like `showHidden` and `colors`
// can be preserved.
const versionParts = process.versions && process.versions.node ?
var versionParts = process.versions && process.versions.node ?
process.versions.node.split(/\./g).map(function(v) { return +v; }) :
[1, 0, 0]; // browserify ships 1.0-compatible version of util.inspect
const INSPECT_SUPPORTS_OBJECT_RETVAL =
var INSPECT_SUPPORTS_OBJECT_RETVAL =
versionParts[0] > 0 ||
versionParts[1] > 11 ||
(versionParts[0] === 11 && versionParts[1] >= 14);
@ -658,13 +639,6 @@ ModelBaseClass.prototype.inspect = function(depth) {
});
};
if (util.inspect.custom) {
// Node.js 12+ no longer recognizes "inspect" method,
// it uses "inspect.custom" symbol as the key instead
// TODO(semver-major) always use the symbol key only (requires Node.js 8+).
ModelBaseClass.prototype[util.inspect.custom] = ModelBaseClass.prototype.inspect;
}
/**
*
* @param {String} anotherClass could be string or class. Name of the class or the class itself
@ -676,8 +650,8 @@ ModelBaseClass.mixin = function(anotherClass, options) {
this.modelBuilder.mixins.applyMixin(this, anotherClass, options);
} else {
if (anotherClass.prototype instanceof ModelBaseClass) {
const props = anotherClass.definition.properties;
for (const i in props) {
var props = anotherClass.definition.properties;
for (var i in props) {
if (this.definition.properties[i]) {
continue;
}
@ -808,7 +782,7 @@ ModelBaseClass.getMergePolicy = function(options) {
// + fix for description arrays that should not be merged
// + fix for relations that should patch matching relations
// + ranking of ACLs
let mergePolicy = {
var mergePolicy = {
description: {replace: true}, // string or array
properties: {patch: true}, // object
hidden: {replace: false}, // array
@ -817,7 +791,7 @@ ModelBaseClass.getMergePolicy = function(options) {
acls: {rank: true}, // array
};
const config = (options || {}).configureModelMerge;
var config = (options || {}).configureModelMerge;
if (config === true) {
// NOTE: recommended merge policy from datasource-juggler v3.6.2
@ -853,22 +827,8 @@ ModelBaseClass.getMergePolicy = function(options) {
return mergePolicy;
};
/**
* Gets properties defined with 'updateOnly' flag set to true from the model. This flag is also set to true
* internally for the id property, if this property is generated and IdInjection is true.
* @returns {updateOnlyProps} List of properties with updateOnly set to true.
*/
ModelBaseClass.getUpdateOnlyProperties = function() {
const props = this.definition.properties;
return Object.keys(props).filter(key => props[key].updateOnly);
};
// Mix in utils
jutil.mixin(ModelBaseClass, DataAccessUtils);
// Mixin observer
jutil.mixin(ModelBaseClass, Observer);
jutil.mixin(ModelBaseClass, require('./observer'));
jutil.mixin(ModelBaseClass, Hookable);
jutil.mixin(ModelBaseClass, validations.Validatable);

View File

@ -1,18 +1,16 @@
// Copyright IBM Corp. 2015,2019. All Rights Reserved.
// Copyright IBM Corp. 2015,2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const async = require('async');
const utils = require('./utils');
const debug = require('debug')('loopback:observer');
var async = require('async');
var utils = require('./utils');
module.exports = ObserverMixin;
/**
* ObserverMixin class. Use to add observe/notifyObserversOf APIs to other
* ObserverMixin class. Use to add observe/notifyObserversOf APIs to other
* classes.
*
* @class ObserverMixin
@ -22,30 +20,12 @@ function ObserverMixin() {
/**
* Register an asynchronous observer for the given operation (event).
*
* Example:
*
* Registers a `before save` observer for a given model.
*
* ```javascript
* MyModel.observe('before save', function filterProperties(ctx, next) {
if (ctx.options && ctx.options.skipPropertyFilter) return next();
if (ctx.instance) {
FILTERED_PROPERTIES.forEach(function(p) {
ctx.instance.unsetAttribute(p);
});
} else {
FILTERED_PROPERTIES.forEach(function(p) {
delete ctx.data[p];
});
}
next();
});
* ```
*
* @param {String} operation The operation name.
* @callback {function} listener The listener function. It will be invoked with
* `this` set to the model constructor, e.g. `User`.
* @param {Object} context Operation-specific context.
* @param {function(Error=)} next The callback to call when the observer
* has finished.
* @end
*/
ObserverMixin.observe = function(operation, listener) {
@ -59,16 +39,6 @@ ObserverMixin.observe = function(operation, listener) {
/**
* Unregister an asynchronous observer for the given operation (event).
*
* Example:
*
* ```javascript
* MyModel.removeObserver('before save', function removedObserver(ctx, next) {
// some logic user want to apply to the removed observer...
next();
});
* ```
*
* @param {String} operation The operation name.
* @callback {function} listener The listener function.
* @end
@ -76,7 +46,7 @@ ObserverMixin.observe = function(operation, listener) {
ObserverMixin.removeObserver = function(operation, listener) {
if (!(this._observers && this._observers[operation])) return;
const index = this._observers[operation].indexOf(listener);
var index = this._observers[operation].indexOf(listener);
if (index !== -1) {
return this._observers[operation].splice(index, 1);
}
@ -84,15 +54,6 @@ ObserverMixin.removeObserver = function(operation, listener) {
/**
* Unregister all asynchronous observers for the given operation (event).
*
* Example:
*
* Remove all observers connected to the `before save` operation.
*
* ```javascript
* MyModel.clearObservers('before save');
* ```
*
* @param {String} operation The operation name.
* @end
*/
@ -104,32 +65,13 @@ ObserverMixin.clearObservers = function(operation) {
/**
* Invoke all async observers for the given operation(s).
*
* Example:
*
* Notify all async observers for the `before save` operation.
*
* ```javascript
* var context = {
Model: Model,
instance: obj,
isNewInstance: true,
hookState: hookState,
options: options,
};
* Model.notifyObserversOf('before save', context, function(err) {
if (err) return cb(err);
// user can specify the logic after the observers have been notified
});
* ```
*
* @param {String|String[]} operation The operation name(s).
* @param {Object} context Operation-specific context.
* @callback {function(Error=)} callback The callback to call when all observers
* have finished.
* @param {function(Error=)} callback The callback to call when all observers
* has finished.
*/
ObserverMixin.notifyObserversOf = function(operation, context, callback) {
const self = this;
var self = this;
if (!callback) callback = utils.createPromiseCallback();
function createNotifier(op) {
@ -143,14 +85,14 @@ ObserverMixin.notifyObserversOf = function(operation, context, callback) {
}
if (Array.isArray(operation)) {
const tasks = [];
for (let i = 0, n = operation.length; i < n; i++) {
var tasks = [];
for (var i = 0, n = operation.length; i < n; i++) {
tasks.push(createNotifier(operation[i]));
}
return async.waterfall(tasks, callback);
}
const observers = this._observers && this._observers[operation];
var observers = this._observers && this._observers[operation];
this._notifyBaseObservers(operation, context, function doNotify(err) {
if (err) return callback(err, context);
@ -159,15 +101,15 @@ ObserverMixin.notifyObserversOf = function(operation, context, callback) {
async.eachSeries(
observers,
function notifySingleObserver(fn, next) {
const retval = fn(context, next);
var retval = fn(context, next);
if (retval && typeof retval.then === 'function') {
retval.then(
function() { next(); return null; },
next, // error handler
next // error handler
);
}
},
function(err) { callback(err, context); },
function(err) { callback(err, context); }
);
});
return callback.promise;
@ -181,45 +123,23 @@ ObserverMixin._notifyBaseObservers = function(operation, context, callback) {
};
/**
* Run the given function with before/after observers.
*
* It's done in three serial asynchronous steps:
* Run the given function with before/after observers. It's done in three serial
* steps asynchronously:
*
* - Notify the registered observers under 'before ' + operation
* - Execute the function
* - Notify the registered observers under 'after ' + operation
*
* If an error happens, it fails first and calls the callback with err.
*
* Example:
*
* ```javascript
* var context = {
Model: Model,
instance: obj,
isNewInstance: true,
hookState: hookState,
options: options,
};
* function work(done) {
process.nextTick(function() {
done(null, 1);
});
}
* Model.notifyObserversAround('execute', context, work, function(err) {
if (err) return cb(err);
// user can specify the logic after the observers have been notified
});
* ```
* If an error happens, it fails fast and calls the callback with err.
*
* @param {String} operation The operation name
* @param {Context} context The context object
* @param {Function} fn The task to be invoked as fn(done) or fn(context, done)
* @callback {Function} callback The callback function
* @param {Function} callback The callback function
* @returns {*}
*/
ObserverMixin.notifyObserversAround = function(operation, context, fn, callback) {
const self = this;
var self = this;
context = context || {};
// Add callback to the context object so that an observer can skip other
// ones by calling the callback function directly and not calling next
@ -232,40 +152,23 @@ ObserverMixin.notifyObserversAround = function(operation, context, fn, callback)
if (err) return callback(err);
function cbForWork(err) {
const args = [].slice.call(arguments, 0);
if (err) {
// call observer in case of error to hook response
context.error = err;
self.notifyObserversOf('after ' + operation + ' error', context,
function(_err, context) {
if (_err && err) {
debug(
'Operation %j failed and "after %s error" hook returned an error too. ' +
'Calling back with the hook error only.' +
'\nOriginal error: %s\nHook error: %s\n',
err.stack || err,
_err.stack || _err,
);
}
callback.call(null, _err || err, context);
});
return;
}
var args = [].slice.call(arguments, 0);
if (err) return callback.apply(null, args);
// Find the list of params from the callback in addition to err
const returnedArgs = args.slice(1);
var returnedArgs = args.slice(1);
// Set up the array of results
context.results = returnedArgs;
// Notify after observers
self.notifyObserversOf('after ' + operation, context,
function(err, context) {
if (err) return callback(err, context);
let results = returnedArgs;
var results = returnedArgs;
if (context && Array.isArray(context.results)) {
// Pickup the results from context
results = context.results;
}
// Build the list of params for final callback
const args = [err].concat(results);
var args = [err].concat(results);
callback.apply(null, args);
});
}

File diff suppressed because it is too large Load Diff

View File

@ -1,20 +1,19 @@
// Copyright IBM Corp. 2013,2019. All Rights Reserved.
// Copyright IBM Corp. 2013,2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
/*!
* Dependencies
*/
const relation = require('./relation-definition');
const RelationDefinition = relation.RelationDefinition;
var relation = require('./relation-definition');
var RelationDefinition = relation.RelationDefinition;
module.exports = RelationMixin;
/**
* RelationMixin class. Use to define relationships between models.
* RelationMixin class. Use to define relationships between models.
*
* @class RelationMixin
*/
@ -22,7 +21,7 @@ function RelationMixin() {
}
/**
* Define a "one to many" relationship by specifying the model name.
* Define a "one to many" relationship by specifying the model name
*
* Examples:
* ```
@ -51,33 +50,25 @@ function RelationMixin() {
* // you can also call the Chapter.create method with the `chapters` property which will build a chapter
* // instance and save the it in the data source.
* book.chapters.create({name: 'Chapter 2'}, function(err, savedChapter) {
* // this callback is optional
* // this callback is optional
* });
*
* // Query chapters for the book
* book.chapters(function(err, chapters) {
* // all chapters with bookId = book.id
* book.chapters(function(err, chapters) { // all chapters with bookId = book.id
* console.log(chapters);
* });
*
* // Query chapters for the book with a filter
* book.chapters({where: {name: 'test'}, function(err, chapters) {
* // All chapters with bookId = book.id and name = 'test'
* console.log(chapters);
* });
* });
* ```
*
*```
* @param {Object|String} modelTo Model object (or String name of model) to which you are creating the relationship.
* @options {Object} params Configuration parameters; see below.
* @options {Object} parameters Configuration parameters; see below.
* @property {String} as Name of the property in the referring model that corresponds to the foreign key field in the related model.
* @property {String} foreignKey Property name of foreign key field.
* @property {String} polymorphic Define a polymorphic relation name.
* @property {String} through Name of the through model.
* @property {String} keyThrough Property name of the foreign key in the through model.
* @property {Object|Function} scope Explicitly define additional scopes.
* @property {Boolean} invert Specify if the relation is inverted.
* @property {Object} model The model object.
* @property {Object} model Model object
*/
RelationMixin.hasMany = function hasMany(modelTo, params) {
return RelationDefinition.hasMany(this, modelTo, params);
@ -132,12 +123,8 @@ RelationMixin.hasMany = function hasMany(modelTo, params) {
* @param {Class|String} modelTo Model object (or String name of model) to which you are creating the relationship.
* @options {Object} params Configuration parameters; see below.
* @property {String} as Name of the property in the referring model that corresponds to the foreign key field in the related model.
* @property {String} primaryKey Property name of primary key field.
* @property {String} foreignKey Name of foreign key property.
* @property {Object|Function} scope Explicitly define additional scopes.
* @property {Object} properties Properties inherited from the parent object.
* @property {Object} options Property level options.
* @property {Boolean} options.invertProperties Specify if the properties should be inverted.
*
*/
RelationMixin.belongsTo = function(modelTo, params) {
return RelationDefinition.belongsTo(this, modelTo, params);
@ -145,7 +132,6 @@ RelationMixin.belongsTo = function(modelTo, params) {
/**
* A hasAndBelongsToMany relation creates a direct many-to-many connection with another model, with no intervening model.
*
* For example, if your application includes users and groups, with each group having many users and each user appearing
* in many groups, you could declare the models this way:
* ```
@ -169,432 +155,28 @@ RelationMixin.belongsTo = function(modelTo, params) {
* ```
*
* @param {String|Object} modelTo Model object (or String name of model) to which you are creating the relationship.
* the relation
* @options {Object} params Configuration parameters; see below.
* @property {String} as Name of the property in the referring model that corresponds to the foreign key field in the related model.
* @property {String} foreignKey Property name of foreign key field.
* @property {String} throughTable The table name of the through model.
* @property {String} through Name of the through model.
* @property {String} polymorphic Define a polymorphic relation name.
* @property {Object|Function} scope Explicitly define additional scopes.
* @property {Object} model The model object.
* @property {Object} model Model object
*/
RelationMixin.hasAndBelongsToMany = function hasAndBelongsToMany(modelTo, params) {
return RelationDefinition.hasAndBelongsToMany(this, modelTo, params);
};
/**
* Define a "one to one" relationship by specifying the model name.
*
* Examples:
* ```
* Supplier.hasOne(Account, {as: 'account', foreignKey: 'supplierId'});
* ```
*
* If the target model doesnt have a foreign key property, LoopBack will add a property with the same name.
*
* The type of the property will be the same as the type of the target models id property.
*
* Please note the foreign key property is defined on the target model (in this example, Account).
*
* If you dont specify them, then LoopBack derives the relation name and foreign key as follows:
* - Relation name: Camel case of the model name, for example, for the supplier model the relation is supplier.
* - Foreign key: The relation name appended with Id, for example, for relation name supplier the default foreign key is supplierId.
*
* Build a new account for the supplier with the supplierId to be set to the id of the supplier.
* ```js
* var supplier = supplier.account.build(data);
* ```
*
* Create a new account for the supplier. If there is already an account, an error will be reported.
* ```js
* supplier.account.create(data, function(err, account) {
* ...
* });
* ```
*
* Find the supplier's account model.
* ```js
* supplier.account(function(err, account) {
* ...
* });
* ```
*
* Update the associated account.
* ```js
* supplier.account.update({balance: 100}, function(err, account) {
* ...
* });
* ```
*
* Remove the account for the supplier.
* ```js
* supplier.account.destroy(function(err) {
* ...
* });
* ```
*
* @param {Object|String} modelTo Model object (or String name of model) to which you are creating the relationship.
* @options {Object} params Configuration parameters; see below.
* @property {String} as Name of the property in the referring model that corresponds to the foreign key field in the related model.
* @property {String} primaryKey Property name of primary key field.
* @property {String} foreignKey Property name of foreign key field.
* @property {String} polymorphic Define a polymorphic relation name.
* @property {Object|Function} scope Explicitly define additional scopes.
* @property {Object} model The model object.
* @property {Object} properties Properties inherited from the parent object.
* @property {Function} methods Scoped methods for the given relation.
*/
RelationMixin.hasOne = function hasOne(modelTo, params) {
return RelationDefinition.hasOne(this, modelTo, params);
};
/**
* References one or more instances of the target model.
*
* For example, a Customer model references one or more instances of the Account model.
*
* Define the relation in the model definition:
*
* - Definition of Customer model:
* ```json
* {
"name": "Customer",
"base": "PersistedModel",
"idInjection": true,
"properties": {
"name": {
"type": "string"
},
"age": {
"type": "number"
}
},
"validations": [],
"relations": {
"accounts": {
"type": "referencesMany",
"model": "Account",
"foreignKey": "accountIds",
"options": {
"validate": true,
"forceId": false
}
}
},
"acls": [],
"methods": {}
}
* ```
*
* - Definition of Account model:
* ```json
* {
"name": "Account",
"base": "PersistedModel",
"idInjection": true,
"properties": {
"name": {
"type": "string"
},
"balance": {
"type": "number"
}
},
"validations": [],
"relations": {},
"acls": [],
"methods": {}
}
* ```
*
* On the bootscript, create a customer instance and for that customer instance reference many account instances.
*
* For example:
* ```javascript
* var Customer = app.models.Customer;
var accounts = [
{
name: 'Checking',
balance: 5000
},
{
name: 'Saving',
balance: 2000
}
];
Customer.create({name: 'Mary Smith'}, function(err, customer) {
console.log('Customer:', customer);
async.each(accounts, function(account, done) {
customer.accounts.create(account, done);
}, function(err) {
console.log('Customer with accounts:', customer);
customer.accounts(console.log);
cb(err);
});
});
* ```
*
* Sample referencesMany model data:
* ```javascript
* {
id: 1,
name: 'John Smith',
accounts: [
"saving-01", "checking-01",
]
}
* ```
*
* Supported helper methods:
* - customer.accounts()
* - customer.accounts.create()
* - customer.accounts.build()
* - customer.accounts.findById()
* - customer.accounts.destroy()
* - customer.accounts.updateById()
* - customer.accounts.exists()
* - customer.accounts.add()
* - customer.accounts.remove()
* - customer.accounts.at()
*
* @param {Object|String} modelTo Model object (or String name of model) to which you are creating the relationship.
* @options {Object} params Configuration parameters; see below.
* @property {String} as Name of the property in the referring model that corresponds to the foreign key field in the related model.
* @property {Any} default The default value.
* @property {Object} options Options to specify for the relationship.
* @property {Boolean} options.forceId Force generation of id for embedded items. Default is false.
* @property {Boolean} options.validate Denote if the embedded items should be validated. Default is true.
* @property {Boolean} options.persistent Denote if the embedded items should be persisted. Default is false.
* @property {Object|Function} scope Explicitly define additional scopes.
* @property {String} foreignKey Property name of foreign key field.
* @property {Object} properties Properties inherited from the parent object.
* @property {Function} methods Scoped methods for the given relation.
*/
RelationMixin.referencesMany = function referencesMany(modelTo, params) {
return RelationDefinition.referencesMany(this, modelTo, params);
};
/**
* Represent a model that embeds another model.
*
* For example, a Customer embeds one billingAddress from the Address model.
*
* - Define the relation in bootscript:
* ```js
* Customer.embedsOne(Address, {
* as: 'address', // default to the relation name - address
* property: 'billingAddress' // default to addressItem
* });
* ```
*
* OR, define the relation in the model definition:
*
* - Definition of Customer model:
* ```json
* {
"name": "Customer",
"base": "PersistedModel",
"idInjection": true,
"properties": {
"name": {
"type": "string"
},
"age": {
"type": "number"
}
},
"validations": [],
"relations": {
"address": {
"type": "embedsOne",
"model": "Address",
"property": "billingAddress",
"options": {
"validate": true,
"forceId": false
}
}
},
"acls": [],
"methods": {}
}
* ```
*
* - Definition of Address model:
* ```json
* {
"name": "Address",
"base": "Model",
"idInjection": true,
"properties": {
"street": {
"type": "string"
},
"city": {
"type": "string"
},
"state": {
"type": "string"
},
"zipCode": {
"type": "string"
}
},
"validations": [],
"relations": {},
"acls": [],
"methods": {}
}
* ```
*
* Sample embedded model data:
* ```javascript
* {
id: 1,
name: 'John Smith',
billingAddress: {
street: '123 Main St',
city: 'San Jose',
state: 'CA',
zipCode: '95124'
}
}
* ```
*
* Supported helper methods:
* - customer.address()
* - customer.address.build()
* - customer.address.create()
* - customer.address.update()
* - customer.address.destroy()
* - customer.address.value()
*
* @param {Object|String} modelTo Model object (or String name of model) to which you are creating the relationship.
* @options {Object} params Configuration parameters; see below.
* @property {String} as Name of the property in the referring model that corresponds to the foreign key field in the related model.
* @property {String} property Name of the property for the embedded item.
* @property {Any} default The default value.
* @property {Object} options Options to specify for the relationship.
* @property {Boolean} options.forceId Force generation of id for embedded items. Default is false.
* @property {Boolean} options.validate Denote if the embedded items should be validated. Default is true.
* @property {Boolean} options.persistent Denote if the embedded items should be persisted. Default is false.
* @property {Object|Function} scope Explicitly define additional scopes.
* @property {Object} properties Properties inherited from the parent object.
* @property {Function} methods Scoped methods for the given relation.
*/
RelationMixin.embedsOne = function embedsOne(modelTo, params) {
return RelationDefinition.embedsOne(this, modelTo, params);
};
/**
* Represent a model that can embed many instances of another model.
*
* For example, a Customer can have multiple email addresses and each email address is a complex object that contains label and address.
*
* Define the relation code in bootscript:
* ```javascript
Customer.embedsMany(EmailAddress, {
as: 'emails', // default to the relation name - emailAddresses
property: 'emailList' // default to emailAddressItems
});
* ```
*
* OR, define the relation in the model definition:
*
* - Definition of Customer model:
* ```json
* {
"name": "Customer",
"base": "PersistedModel",
"idInjection": true,
"properties": {
"name": {
"type": "string"
},
"age": {
"type": "number"
}
},
"validations": [],
"relations": {
"emails": {
"type": "embedsMany",
"model": "EmailAddress",
"property": "emailList",
"options": {
"validate": true,
"forceId": false
}
}
},
"acls": [],
"methods": {}
}
* ```
*
* - Definition of EmailAddress model:
* ```json
* {
"name": "EmailAddress",
"base": "Model",
"idInjection": true,
"properties": {
"label": {
"type": "string"
},
"address": {
"type": "string"
}
},
"validations": [],
"relations": {},
"acls": [],
"methods": {}
}
* ```
*
* Sample embedded model data:
* ```javascript
* {
id: 1,
name: 'John Smith',
emails: [{
label: 'work',
address: 'john@xyz.com'
}, {
label: 'home',
address: 'john@gmail.com'
}]
}
* ```
*
* Supported helper methods:
* - customer.emails()
* - customer.emails.create()
* - customer.emails.build()
* - customer.emails.findById()
* - customer.emails.destroyById()
* - customer.emails.updateById()
* - customer.emails.exists()
* - customer.emails.add()
* - customer.emails.remove()
* - customer.emails.at()
* - customer.emails.value()
*
* @param {Object|String} modelTo Model object (or String name of model) to which you are creating the relationship.
* @options {Object} params Configuration parameters; see below.
* @property {String} as Name of the property in the referring model that corresponds to the foreign key field in the related model.
* @property {String} property Name of the property for the embedded item.
* @property {Any} default The default value.
* @property {Object} options Options to specify for the relationship.
* @property {Boolean} options.forceId Force generation of id for embedded items. Default is false.
* @property {Boolean} options.validate Denote if the embedded items should be validated. Default is true.
* @property {Boolean} options.persistent Denote if the embedded items should be persisted. Default is false.
* @property {String} polymorphic Define a polymorphic relation name.
* @property {Object|Function} scope Explicitly define additional scopes.
* @property {Object} properties Properties inherited from the parent object.
* @property {Function} methods Scoped methods for the given relation.
*/
RelationMixin.embedsMany = function embedsMany(modelTo, params) {
return RelationDefinition.embedsMany(this, modelTo, params);
};

View File

@ -1,21 +1,18 @@
// Copyright IBM Corp. 2013,2019. All Rights Reserved.
// Copyright IBM Corp. 2013,2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const _ = require('lodash');
const i8n = require('inflection');
const g = require('strong-globalize')();
const utils = require('./utils');
const defineCachedRelations = utils.defineCachedRelations;
const setScopeValuesFromWhere = utils.setScopeValuesFromWhere;
const mergeQuery = utils.mergeQuery;
const DefaultModelBaseClass = require('./model.js');
const collectTargetIds = utils.collectTargetIds;
const idName = utils.idName;
const deprecated = require('depd')('loopback-datasource-juggler');
var _ = require('lodash');
var i8n = require('inflection');
var utils = require('./utils');
var defineCachedRelations = utils.defineCachedRelations;
var setScopeValuesFromWhere = utils.setScopeValuesFromWhere;
var mergeQuery = utils.mergeQuery;
var DefaultModelBaseClass = require('./model.js');
var collectTargetIds = utils.collectTargetIds;
var idName = utils.idName;
/**
* Module exports
@ -33,14 +30,14 @@ function ScopeDefinition(definition) {
}
ScopeDefinition.prototype.targetModel = function(receiver) {
let modelTo;
var modelTo;
if (typeof this.options.modelTo === 'function') {
modelTo = this.options.modelTo.call(this, receiver) || this.modelTo;
} else {
modelTo = this.modelTo;
}
if (!(modelTo.prototype instanceof DefaultModelBaseClass)) {
let msg = 'Invalid target model for scope `';
var msg = 'Invalid target model for scope `';
msg += (this.isStatic ? this.modelFrom : this.modelFrom.constructor).modelName;
msg += this.isStatic ? '.' : '.prototype.';
msg += this.name + '`.';
@ -59,12 +56,12 @@ ScopeDefinition.prototype.targetModel = function(receiver) {
* @returns {*}
*/
ScopeDefinition.prototype.related = function(receiver, scopeParams, condOrRefresh, options, cb) {
const name = this.name;
const self = receiver;
var name = this.name;
var self = receiver;
let actualCond = {};
let actualRefresh = false;
let saveOnCache = receiver instanceof DefaultModelBaseClass;
var actualCond = {};
var actualRefresh = false;
var saveOnCache = receiver instanceof DefaultModelBaseClass;
if (typeof condOrRefresh === 'function' &&
options === undefined && cb === undefined) {
// related(receiver, scopeParams, cb)
@ -86,27 +83,25 @@ ScopeDefinition.prototype.related = function(receiver, scopeParams, condOrRefres
}
}
cb = cb || utils.createPromiseCallback();
const refreshIsNeeded = !self.__cachedRelations ||
self.__cachedRelations[name] === undefined ||
actualRefresh;
if (refreshIsNeeded) {
if (!self.__cachedRelations || self.__cachedRelations[name] === undefined ||
actualRefresh) {
// It either doesn't hit the cache or refresh is required
const params = mergeQuery(actualCond, scopeParams, {nestedInclude: true});
const targetModel = this.targetModel(receiver);
var params = mergeQuery(actualCond, scopeParams, {nestedInclude: true});
var targetModel = this.targetModel(receiver);
// If there is a through model
// run another query to apply filter on relatedModel(targetModel)
// see github.com/strongloop/loopback-datasource-juggler/issues/166
const scopeOnRelatedModel = params.collect &&
params.include.scope !== null &&
typeof params.include.scope === 'object';
let filter, queryRelated;
var scopeOnRelatedModel = params.collect &&
params.include.scope !== null &&
typeof params.include.scope === 'object';
if (scopeOnRelatedModel) {
filter = params.include;
var filter = params.include;
// The filter applied on relatedModel
queryRelated = filter.scope;
var queryRelated = filter.scope;
delete params.include.scope;
}
};
targetModel.find(params, options, function(err, data) {
if (!err && saveOnCache) {
@ -115,47 +110,33 @@ ScopeDefinition.prototype.related = function(receiver, scopeParams, condOrRefres
}
if (scopeOnRelatedModel === true) {
const relatedModel = targetModel.relations[filter.relation].modelTo;
const IdKey = idName(relatedModel);
// return {inq: [1,2,3]}}
const smartMerge = function(idCollection, qWhere) {
if (!qWhere[IdKey]) return idCollection;
let merged = {};
const idsA = idCollection.inq;
const idsB = qWhere[IdKey].inq ? qWhere[IdKey].inq : [qWhere[IdKey]];
const intersect = _.intersectionWith(idsA, idsB, _.isEqual);
if (intersect.length === 1) merged = intersect[0];
if (intersect.length > 1) merged = {inq: intersect};
var relatedModel = targetModel.relations[filter.relation].modelTo;
var IdKey = idName(relatedModel);
var smartMerge = function(idCond, qWhere, idKey) {
var merged = {};
var idsA = idCond[idKey].inq;
var idsB = qWhere[idKey].inq ? qWhere[idKey].inq : [qWhere[idKey]];
var intersect = _.intersectionWith(idsA, idsB, _.isEqual);
if (intersect.length === 1) merged[idKey] = intersect[0];
if (intersect.length > 1) merged[idKey] = {inq: intersect};
return merged;
};
// Merge queryRelated filter and targetId filter
var buildWhere = function() {
var IdKeyCondition = {};
IdKeyCondition[IdKey] = collectTargetIds(data, IdKey);
var mergedWhere = smartMerge(IdKeyCondition, queryRelated.where, IdKey);
return mergedWhere;
};
if (queryRelated.where !== undefined) {
// Merge queryRelated filter and targetId filter
const IdKeyCondition = {};
IdKeyCondition[IdKey] = smartMerge(collectTargetIds(data, IdKey),
queryRelated.where);
// if the id in filter doesn't exist after the merge,
// return empty result
if (_.isObject(IdKeyCondition[IdKey]) && _.isEmpty(IdKeyCondition[IdKey])) return cb(null, []);
const mergedWhere = {
and: [
IdKeyCondition,
_.omit(queryRelated.where, IdKey),
],
};
queryRelated.where = mergedWhere;
queryRelated.where = buildWhere();
} else {
queryRelated.where = {};
queryRelated.where[IdKey] = collectTargetIds(data, IdKey);
}
relatedModel.find(queryRelated, options, cb);
relatedModel.find(queryRelated, cb);
} else {
cb(err, data);
}
@ -203,8 +184,8 @@ function defineScope(cls, targetClass, name, params, methods, options) {
options = options || {};
// Check if the cls is the class itself or its prototype
const isStatic = (typeof cls === 'function') || options.isStatic || false;
const definition = new ScopeDefinition({
var isStatic = (typeof cls === 'function') || options.isStatic || false;
var definition = new ScopeDefinition({
isStatic: isStatic,
modelFrom: cls,
modelTo: targetClass,
@ -238,10 +219,10 @@ function defineScope(cls, targetClass, name, params, methods, options) {
*
*/
get: function() {
const targetModel = definition.targetModel(this);
const self = this;
var targetModel = definition.targetModel(this);
var self = this;
const f = function(condOrRefresh, options, cb) {
var f = function(condOrRefresh, options, cb) {
if (arguments.length === 0) {
if (typeof f.value === 'function') {
return f.value(self);
@ -249,10 +230,8 @@ function defineScope(cls, targetClass, name, params, methods, options) {
return self.__cachedRelations[name];
}
} else {
const condOrRefreshIsCallBack = typeof condOrRefresh === 'function' &&
options === undefined &&
cb === undefined;
if (condOrRefreshIsCallBack) {
if (typeof condOrRefresh === 'function' &&
options === undefined && cb === undefined) {
// customer.orders(cb)
cb = condOrRefresh;
options = {};
@ -287,13 +266,15 @@ function defineScope(cls, targetClass, name, params, methods, options) {
f._targetClass = rel && rel.modelTo && rel.modelTo.modelName || i8n.camelize(f._scope.collect);
}
f.find = function(condOrRefresh, options, cb) {
f.getAsync = function(condOrRefresh, options, cb) {
if (typeof condOrRefresh === 'function' &&
options === undefined && cb === undefined) {
// customer.orders.getAsync(cb)
cb = condOrRefresh;
options = {};
condOrRefresh = {};
} else if (typeof options === 'function' && cb === undefined) {
// customer.orders.getAsync(condOrRefresh, cb);
cb = options;
options = {};
}
@ -301,11 +282,6 @@ function defineScope(cls, targetClass, name, params, methods, options) {
return definition.related(self, f._scope, condOrRefresh, options, cb);
};
f.getAsync = function() {
deprecated(g.f('Scope method "getAsync()" is deprecated, use "find()" instead.'));
return this.find.apply(this, arguments);
};
f.build = build;
f.create = create;
f.updateAll = updateAll;
@ -314,7 +290,7 @@ function defineScope(cls, targetClass, name, params, methods, options) {
f.findOne = findOne;
f.count = count;
for (const i in definition.methods) {
for (var i in definition.methods) {
f[i] = definition.methods[i].bind(self);
}
@ -338,52 +314,52 @@ function defineScope(cls, targetClass, name, params, methods, options) {
});
// Wrap the property into a function for remoting
const fn = function() {
var fn = function() {
// primaryObject.scopeName, such as user.accounts
const f = this[name];
var f = this[name];
// set receiver to be the scope property whose value is a function
f.apply(this[name], arguments);
};
cls['__get__' + name] = fn;
const fnCreate = function() {
const f = this[name].create;
var fnCreate = function() {
var f = this[name].create;
f.apply(this[name], arguments);
};
cls['__create__' + name] = fnCreate;
const fnDelete = function() {
const f = this[name].destroyAll;
var fnDelete = function() {
var f = this[name].destroyAll;
f.apply(this[name], arguments);
};
cls['__delete__' + name] = fnDelete;
const fnUpdate = function() {
const f = this[name].updateAll;
var fnUpdate = function() {
var f = this[name].updateAll;
f.apply(this[name], arguments);
};
cls['__update__' + name] = fnUpdate;
const fnFindById = function(cb) {
const f = this[name].findById;
var fnFindById = function(cb) {
var f = this[name].findById;
f.apply(this[name], arguments);
};
cls['__findById__' + name] = fnFindById;
const fnFindOne = function(cb) {
const f = this[name].findOne;
var fnFindOne = function(cb) {
var f = this[name].findOne;
f.apply(this[name], arguments);
};
cls['__findOne__' + name] = fnFindOne;
const fnCount = function(cb) {
const f = this[name].count;
var fnCount = function(cb) {
var f = this[name].count;
f.apply(this[name], arguments);
};
@ -393,8 +369,8 @@ function defineScope(cls, targetClass, name, params, methods, options) {
function build(data) {
data = data || {};
// Find all fixed property values for the scope
const targetModel = definition.targetModel(this._receiver);
const where = (this._scope && this._scope.where) || {};
var targetModel = definition.targetModel(this._receiver);
var where = (this._scope && this._scope.where) || {};
setScopeValuesFromWhere(data, where, targetModel);
return new targetModel(data);
}
@ -432,9 +408,9 @@ function defineScope(cls, targetClass, name, params, methods, options) {
}
options = options || {};
const targetModel = definition.targetModel(this._receiver);
const scoped = (this._scope && this._scope.where) || {};
const filter = mergeQuery({where: scoped}, {where: where || {}});
var targetModel = definition.targetModel(this._receiver);
var scoped = (this._scope && this._scope.where) || {};
var filter = mergeQuery({where: scoped}, {where: where || {}});
return targetModel.destroyAll(filter.where, options, cb);
}
@ -452,9 +428,9 @@ function defineScope(cls, targetClass, name, params, methods, options) {
options = {};
}
options = options || {};
const targetModel = definition.targetModel(this._receiver);
const scoped = (this._scope && this._scope.where) || {};
const filter = mergeQuery({where: scoped}, {where: where || {}});
var targetModel = definition.targetModel(this._receiver);
var scoped = (this._scope && this._scope.where) || {};
var filter = mergeQuery({where: scoped}, {where: where || {}});
return targetModel.updateAll(filter.where, data, options, cb);
}
@ -480,9 +456,9 @@ function defineScope(cls, targetClass, name, params, methods, options) {
options = options || {};
filter = filter || {};
const targetModel = definition.targetModel(this._receiver);
const idName = targetModel.definition.idName();
let query = {where: {}};
var targetModel = definition.targetModel(this._receiver);
var idName = targetModel.definition.idName();
var query = {where: {}};
query.where[idName] = id;
query = mergeQuery(query, filter);
return this.findOne(query, options, cb);
@ -500,8 +476,8 @@ function defineScope(cls, targetClass, name, params, methods, options) {
options = {};
}
options = options || {};
const targetModel = definition.targetModel(this._receiver);
const scoped = (this._scope && this._scope.where) || {};
var targetModel = definition.targetModel(this._receiver);
var scoped = (this._scope && this._scope.where) || {};
filter = mergeQuery({where: scoped}, filter || {});
return targetModel.findOne(filter, options, cb);
}
@ -518,9 +494,9 @@ function defineScope(cls, targetClass, name, params, methods, options) {
}
options = options || {};
const targetModel = definition.targetModel(this._receiver);
const scoped = (this._scope && this._scope.where) || {};
const filter = mergeQuery({where: scoped}, {where: where || {}});
var targetModel = definition.targetModel(this._receiver);
var scoped = (this._scope && this._scope.where) || {};
var filter = mergeQuery({where: scoped}, {where: where || {}});
return targetModel.count(filter.where, options, cb);
}

View File

@ -1,18 +1,17 @@
// Copyright IBM Corp. 2015,2019. All Rights Reserved.
// Copyright IBM Corp. 2015,2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const g = require('strong-globalize')();
const debug = require('debug')('loopback:connector:transaction');
const uuid = require('uuid');
const utils = require('./utils');
const jutil = require('./jutil');
const ObserverMixin = require('./observer');
var g = require('strong-globalize')();
var debug = require('debug')('loopback:connector:transaction');
var uuid = require('uuid');
var utils = require('./utils');
var jutil = require('./jutil');
var ObserverMixin = require('./observer');
const Transaction = require('loopback-connector').Transaction;
var Transaction = require('loopback-connector').Transaction;
module.exports = TransactionMixin;
@ -25,9 +24,35 @@ function TransactionMixin() {
}
/**
* Begin a new transaction.
* Begin a new transaction
* @param {Object|String} [options] Options can be one of the forms:
* - Object: {isolationLevel: '...', timeout: 1000}
* - String: isolationLevel
*
* A transaction can be committed or rolled back. If timeout happens, the
* Valid values of `isolationLevel` are:
*
* - Transaction.READ_COMMITTED = 'READ COMMITTED'; // default
* - Transaction.READ_UNCOMMITTED = 'READ UNCOMMITTED';
* - Transaction.SERIALIZABLE = 'SERIALIZABLE';
* - Transaction.REPEATABLE_READ = 'REPEATABLE READ';
*
* @param {Function} cb Callback function. It calls back with (err, transaction).
* To pass the transaction context to one of the CRUD methods, use the `options`
* argument with `transaction` property, for example,
*
* ```js
*
* MyModel.beginTransaction('READ COMMITTED', function(err, tx) {
* MyModel.create({x: 1, y: 'a'}, {transaction: tx}, function(err, inst) {
* MyModel.find({x: 1}, {transaction: tx}, function(err, results) {
* // ...
* tx.commit(function(err) {...});
* });
* });
* });
* ```
*
* The transaction can be committed or rolled back. If timeout happens, the
* transaction will be rolled back. Please note a transaction is typically
* associated with a pooled connection. Committing or rolling back a transaction
* will release the connection back to the pool.
@ -40,55 +65,20 @@ function TransactionMixin() {
* source/connector instance. CRUD methods will not join the current transaction
* if its model is not attached the same data source.
*
* Example:
*
* To pass the transaction context to one of the CRUD methods, use the `options`
* argument with `transaction` property, for example,
*
* ```js
* MyModel.beginTransaction('READ COMMITTED', function(err, tx) {
* MyModel.create({x: 1, y: 'a'}, {transaction: tx}, function(err, inst) {
* MyModel.find({x: 1}, {transaction: tx}, function(err, results) {
* // ...
* tx.commit(function(err) {...});
* });
* });
* });
* ```
*
* @param {Object|String} options Options to be passed upon transaction.
*
* Can be one of the forms:
* - Object: {isolationLevel: '...', timeout: 1000}
* - String: isolationLevel
*
* Valid values of `isolationLevel` are:
*
* - Transaction.READ_COMMITTED = 'READ COMMITTED'; // default
* - Transaction.READ_UNCOMMITTED = 'READ UNCOMMITTED';
* - Transaction.SERIALIZABLE = 'SERIALIZABLE';
* - Transaction.REPEATABLE_READ = 'REPEATABLE READ';
* @callback {Function} cb Callback function.
* @returns {Promise|undefined} Returns a callback promise.
*/
TransactionMixin.beginTransaction = function(options, cb) {
cb = cb || utils.createPromiseCallback();
if (Transaction) {
const connector = this.getConnector();
var connector = this.getConnector();
Transaction.begin(connector, options, function(err, transaction) {
if (err) return cb(err);
// NOTE(lehni) As part of the process of moving the handling of
// transaction id and timeout from TransactionMixin.beginTransaction() to
// Transaction.begin() in loopback-connector, switch to only setting id
// and timeout if it wasn't taken care of already by Transaction.begin().
// Eventually, we can remove the following two if-blocks altogether.
if (!transaction.id) {
if (transaction) {
// Set an informational transaction id
transaction.id = uuid.v1();
}
if (options.timeout && !transaction.timeout) {
transaction.timeout = setTimeout(function() {
const context = {
if (options.timeout) {
setTimeout(function() {
var context = {
transaction: transaction,
operation: 'timeout',
};
@ -106,7 +96,7 @@ TransactionMixin.beginTransaction = function(options, cb) {
});
} else {
process.nextTick(function() {
const err = new Error(g.f('{{Transaction}} is not supported'));
var err = new Error(g.f('{{Transaction}} is not supported'));
cb(err);
});
}
@ -117,91 +107,71 @@ TransactionMixin.beginTransaction = function(options, cb) {
if (Transaction) {
jutil.mixin(Transaction.prototype, ObserverMixin);
/**
* Commit a transaction and release it back to the pool.
*
* Example:
*
* ```js
* MyModel.beginTransaction('READ COMMITTED', function(err, tx) {
* // some crud operation of your choice
* tx.commit(function(err) {
* // release the connection pool upon committing
* tx.close(err);
* });
* });
* ```
*
* @callback {Function} cb Callback function.
* @returns {Promise|undefined} Returns a callback promise.
* Commit a transaction and release it back to the pool
* @param {Function} cb Callback function
* @returns {Promise|undefined}
*/
Transaction.prototype.commit = function(cb) {
var self = this;
cb = cb || utils.createPromiseCallback();
if (this.ensureActive(cb)) {
const context = {
transaction: this,
operation: 'commit',
};
this.notifyObserversAround('commit', context,
done => {
this.connector.commit(this.connection, done);
},
err => {
// Deference the connection to mark the transaction is not active
// The connection should have been released back the pool
this.connection = null;
cb(err);
});
// Report an error if the transaction is not active
if (!self.connection) {
process.nextTick(function() {
cb(new Error(g.f('The {{transaction}} is not active: %s', self.id)));
});
return cb.promise;
}
var context = {
transaction: self,
operation: 'commit',
};
function work(done) {
self.connector.commit(self.connection, done);
}
self.notifyObserversAround('commit', context, work, function(err) {
// Deference the connection to mark the transaction is not active
// The connection should have been released back the pool
self.connection = null;
cb(err);
});
return cb.promise;
};
/**
* Rollback a transaction and release it back to the pool.
*
* Example:
*
* ```js
* MyModel.beginTransaction('READ COMMITTED', function(err, tx) {
* // some crud operation of your choice
* tx.rollback(function(err) {
* // release the connection pool upon committing
* tx.close(err);
* });
* });
* ```
*
* @callback {Function} cb Callback function.
* @returns {Promise|undefined} Returns a callback promise.
* Rollback a transaction and release it back to the pool
* @param {Function} cb Callback function
* @returns {Promise|undefined}
*/
Transaction.prototype.rollback = function(cb) {
var self = this;
cb = cb || utils.createPromiseCallback();
if (this.ensureActive(cb)) {
const context = {
transaction: this,
operation: 'rollback',
};
this.notifyObserversAround('rollback', context,
done => {
this.connector.rollback(this.connection, done);
},
err => {
// Deference the connection to mark the transaction is not active
// The connection should have been released back the pool
this.connection = null;
cb(err);
});
}
return cb.promise;
};
Transaction.prototype.ensureActive = function(cb) {
// Report an error if the transaction is not active
if (!this.connection) {
process.nextTick(() => {
cb(new Error(g.f('The {{transaction}} is not active: %s', this.id)));
if (!self.connection) {
process.nextTick(function() {
cb(new Error(g.f('The {{transaction}} is not active: %s', self.id)));
});
return cb.promise;
}
return !!this.connection;
var context = {
transaction: self,
operation: 'rollback',
};
function work(done) {
self.connector.rollback(self.connection, done);
}
self.notifyObserversAround('rollback', context, work, function(err) {
// Deference the connection to mark the transaction is not active
// The connection should have been released back the pool
self.connection = null;
cb(err);
});
return cb.promise;
};
Transaction.prototype.toJSON = function() {

View File

@ -1,11 +1,10 @@
// Copyright IBM Corp. 2013,2019. All Rights Reserved.
// Copyright IBM Corp. 2013,2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const Types = {};
var Types = {};
/**
* Schema types
*/
@ -41,10 +40,10 @@ Types.Any.prototype.toObject = Types.Any.prototype.toJSON = function() {
};
module.exports = function(modelTypes) {
const DateString = require('./date-string');
const GeoPoint = require('./geo').GeoPoint;
var DateString = require('./date-string');
var GeoPoint = require('./geo').GeoPoint;
for (const t in Types) {
for (var t in Types) {
modelTypes[t] = Types[t];
}
@ -52,7 +51,7 @@ module.exports = function(modelTypes) {
modelTypes.registerType = function(type, names) {
names = names || [];
names = names.concat([type.name]);
for (let n = 0; n < names.length; n++) {
for (var n = 0; n < names.length; n++) {
this.schemaTypes[names[n].toLowerCase()] = type;
}
};

View File

@ -1,14 +1,13 @@
// Copyright IBM Corp. 2012,2019. All Rights Reserved.
// Copyright IBM Corp. 2012,2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
exports.safeRequire = safeRequire;
exports.fieldsToArray = fieldsToArray;
exports.selectFields = selectFields;
exports.sanitizeQuery = sanitizeQuery;
exports.removeUndefined = removeUndefined;
exports.parseSettings = parseSettings;
exports.mergeSettings = exports.deepMerge = deepMerge;
exports.deepMergeProperty = deepMergeProperty;
@ -27,27 +26,11 @@ exports.findIndexOf = findIndexOf;
exports.collectTargetIds = collectTargetIds;
exports.idName = idName;
exports.rankArrayElements = rankArrayElements;
exports.idsHaveDuplicates = idsHaveDuplicates;
exports.isClass = isClass;
exports.escapeRegExp = escapeRegExp;
exports.applyParentProperty = applyParentProperty;
const g = require('strong-globalize')();
const traverse = require('traverse');
const assert = require('assert');
const debug = require('debug')('loopback:juggler:utils');
/**
* The name of the property in modelBuilder settings that will enable the child parent reference functionality
* @type {string}
*/
const BUILDER_PARENT_SETTING = 'parentRef';
/**
* The property name that should be defined on each child instance if parent feature flag enabled
* @type {string}
*/
const PARENT_PROPERTY_NAME = '__parent';
var g = require('strong-globalize')();
var traverse = require('traverse');
var assert = require('assert');
var Promise = require('bluebird');
function safeRequire(module) {
try {
@ -68,19 +51,19 @@ function safeRequire(module) {
* @param {Object} The where clause
*/
function setScopeValuesFromWhere(data, where, targetModel) {
for (const i in where) {
for (var i in where) {
if (i === 'and') {
// Find fixed property values from each subclauses
for (let w = 0, n = where[i].length; w < n; w++) {
for (var w = 0, n = where[i].length; w < n; w++) {
setScopeValuesFromWhere(data, where[i][w], targetModel);
}
continue;
}
const prop = targetModel.definition.properties[i];
var prop = targetModel.definition.properties[i];
if (prop) {
const val = where[i];
var val = where[i];
if (typeof val !== 'object' || val instanceof prop.type ||
prop.type.name === 'ObjectID' || // MongoDB key
prop.type.name === 'ObjectID' || // MongoDB key
prop.type.name === 'uuidFromString') { // C*
// Only pick the {propertyName: propertyValue}
data[i] = where[i];
@ -98,26 +81,26 @@ function setScopeValuesFromWhere(data, where, targetModel) {
* @returns {Object}
*/
function mergeIncludes(destination, source) {
const destArray = convertToArray(destination);
const sourceArray = convertToArray(source);
var destArray = convertToArray(destination);
var sourceArray = convertToArray(source);
if (destArray.length === 0) {
return sourceArray;
}
if (sourceArray.length === 0) {
return destArray;
}
const relationNames = [];
const resultArray = [];
for (const j in sourceArray) {
const sourceEntry = sourceArray[j];
const sourceEntryRelationName = (typeof (sourceEntry.rel || sourceEntry.relation) === 'string') ?
var relationNames = [];
var resultArray = [];
for (var j in sourceArray) {
var sourceEntry = sourceArray[j];
var sourceEntryRelationName = (typeof (sourceEntry.rel || sourceEntry.relation) === 'string') ?
sourceEntry.relation : Object.keys(sourceEntry)[0];
relationNames.push(sourceEntryRelationName);
resultArray.push(sourceEntry);
}
for (const i in destArray) {
const destEntry = destArray[i];
const destEntryRelationName = (typeof (destEntry.rel || destEntry.relation) === 'string') ?
for (var i in destArray) {
var destEntry = destArray[i];
var destEntryRelationName = (typeof (destEntry.rel || destEntry.relation) === 'string') ?
destEntry.relation : Object.keys(destEntry)[0];
if (relationNames.indexOf(destEntryRelationName) === -1) {
resultArray.push(destEntry);
@ -145,17 +128,17 @@ function convertToArray(include) {
return [include];
}
// Build an array of key/value pairs
const newInclude = [];
for (const key in include) {
var newInclude = [];
for (var key in include) {
const obj = {};
obj[key] = include[key];
newInclude.push(obj);
}
return newInclude;
} else if (Array.isArray(include)) {
const normalized = [];
for (const i in include) {
const includeEntry = include[i];
var normalized = [];
for (var i in include) {
var includeEntry = include[i];
if (typeof includeEntry === 'string') {
const obj = {};
obj[includeEntry] = true;
@ -199,9 +182,9 @@ function mergeQuery(base, update, spec) {
} else {
if (spec.nestedInclude === true) {
// specify nestedInclude=true to force nesting of inclusions on scoped
// queries. e.g. In physician.patients.find({include: 'address'}),
// queries. e.g. In physician.patients.getAsync({include: 'address'}),
// inclusion should be on patient model, not on physician model.
const saved = base.include;
var saved = base.include;
base.include = {};
base.include[update.include] = saved;
} else {
@ -233,7 +216,7 @@ function mergeQuery(base, update, spec) {
base.limit = update.limit;
}
const skip = spec.skip !== false && spec.offset !== false;
var skip = spec.skip !== false && spec.offset !== false;
if (skip && update.skip !== undefined) {
base.skip = update.skip;
@ -257,8 +240,8 @@ function fieldsToArray(fields, properties, excludeUnknown) {
if (!fields) return;
// include all properties by default
let result = properties;
let i, n;
var result = properties;
var i, n;
if (typeof fields === 'string') {
result = [fields];
@ -267,13 +250,13 @@ function fieldsToArray(fields, properties, excludeUnknown) {
result = fields;
} else if ('object' === typeof fields) {
// { field1: boolean, field2: boolean ... }
const included = [];
const excluded = [];
const keys = Object.keys(fields);
var included = [];
var excluded = [];
var keys = Object.keys(fields);
if (!keys.length) return;
for (i = 0, n = keys.length; i < n; i++) {
const k = keys[i];
var k = keys[i];
if (fields[k]) {
included.push(k);
} else if ((k in fields) && !fields[k]) {
@ -284,13 +267,13 @@ function fieldsToArray(fields, properties, excludeUnknown) {
result = included;
} else if (excluded.length > 0) {
for (i = 0, n = excluded.length; i < n; i++) {
const index = result.indexOf(excluded[i]);
var index = result.indexOf(excluded[i]);
if (index !== -1) result.splice(index, 1); // only when existing field excluded
}
}
}
let fieldArray = [];
var fieldArray = [];
if (excludeUnknown) {
for (i = 0, n = result.length; i < n; i++) {
if (properties.indexOf(result[i]) !== -1) {
@ -306,10 +289,10 @@ function fieldsToArray(fields, properties, excludeUnknown) {
function selectFields(fields) {
// map function
return function(obj) {
const result = {};
let key;
var result = {};
var key;
for (let i = 0; i < fields.length; i++) {
for (var i = 0; i < fields.length; i++) {
key = fields[i];
result[key] = obj[key];
@ -318,111 +301,27 @@ function selectFields(fields) {
};
}
function isProhibited(key, prohibitedKeys) {
if (!prohibitedKeys || !prohibitedKeys.length) return false;
if (typeof key !== 'string') {
return false;
}
for (const k of prohibitedKeys) {
if (k === key) return true;
// x.secret, secret.y, or x.secret.y
if (key.split('.').indexOf(k) !== -1) return true;
}
return false;
}
/**
* Accept an operator key and return whether it is used for a regular expression query or not
* @param {string} operator
* @returns {boolean}
* Remove undefined values from the queury object
* @param query
* @param handleUndefined {String} either "nullify", "throw" or "ignore" (default: "ignore")
* @returns {exports.map|*}
*/
function isRegExpOperator(operator) {
return ['like', 'nlike', 'ilike', 'nilike', 'regexp'].includes(operator);
}
/**
* Accept a RegExp string and make sure that any special characters for RegExp are escaped in case they
* create an invalid Regexp
* @param {string} str
* @returns {string}
*/
function escapeRegExp(str) {
assert.strictEqual(typeof str, 'string', 'String required for regexp escaping');
try {
new RegExp(str); // try to parse string as regexp
return str;
} catch (unused) {
console.warn(
'Auto-escaping invalid RegExp value %j supplied by the caller. ' +
'Please note this behavior may change in the future.',
str,
);
return str.replace(/[\-\[\]\/\{\}\(\)\+\?\.\\\^\$\|]/g, '\\$&');
}
}
/**
* Sanitize the query object
* @param query {object} The query object
* @param options
* @property normalizeUndefinedInQuery {String} either "nullify", "throw" or "ignore" (default: "ignore")
* @property prohibitedKeys {String[]} An array of prohibited keys to be removed
* @returns {*}
*/
function sanitizeQuery(query, options) {
debug('Sanitizing query object: %j', query);
function removeUndefined(query, handleUndefined) {
if (typeof query !== 'object' || query === null) {
return query;
}
options = options || {};
if (typeof options === 'string') {
// Keep it backward compatible
options = {normalizeUndefinedInQuery: options};
}
const prohibitedKeys = options.prohibitedKeys;
const offendingKeys = [];
const normalizeUndefinedInQuery = options.normalizeUndefinedInQuery;
const maxDepth = options.maxDepth || Number.MAX_SAFE_INTEGER;
// WARNING: [rfeng] Use map() will cause mongodb to produce invalid BSON
// as traverse doesn't transform the ObjectId correctly
const result = traverse(query).forEach(function(x) {
/**
* Security risk if the client passes in a very deep where object
*/
if (this.circular) {
const msg = g.f('The query object is circular');
const err = new Error(msg);
err.statusCode = 400;
err.code = 'QUERY_OBJECT_IS_CIRCULAR';
throw err;
}
if (this.level > maxDepth) {
const msg = g.f('The query object exceeds maximum depth %d', maxDepth);
const err = new Error(msg);
err.statusCode = 400;
err.code = 'QUERY_OBJECT_TOO_DEEP';
throw err;
}
/**
* Make sure prohibited keys are removed from the query to prevent
* sensitive values from being guessed
*/
if (isProhibited(this.key, prohibitedKeys)) {
offendingKeys.push(this.key);
this.remove();
return;
}
/**
* Handle undefined values
*/
return traverse(query).forEach(function(x) {
if (x === undefined) {
switch (normalizeUndefinedInQuery) {
switch (handleUndefined) {
case 'nullify':
this.update(null);
break;
case 'throw':
throw new Error(g.f('Unexpected `undefined` in query'));
break;
case 'ignore':
default:
this.remove();
@ -436,26 +335,12 @@ function sanitizeQuery(query, options) {
return x;
}
if (isRegExpOperator(this.key) && typeof x === 'string') { // we have regexp supporting operator and string to escape
return escapeRegExp(x);
}
return x;
});
if (offendingKeys.length) {
console.error(
g.f(
'Potential security alert: hidden/protected properties %j are used in query.',
offendingKeys,
),
);
}
return result;
}
const url = require('url');
const qs = require('qs');
var url = require('url');
var qs = require('qs');
/**
* Parse a URL into a settings object
@ -466,18 +351,18 @@ function parseSettings(urlStr) {
if (!urlStr) {
return {};
}
const uri = url.parse(urlStr, false);
const settings = {};
var uri = url.parse(urlStr, false);
var settings = {};
settings.connector = uri.protocol && uri.protocol.split(':')[0]; // Remove the trailing :
settings.host = settings.hostname = uri.hostname;
settings.port = uri.port && Number(uri.port); // port is a string
settings.user = settings.username = uri.auth && uri.auth.split(':')[0]; // <username>:<password>
settings.password = uri.auth && uri.auth.split(':')[1];
settings.database = uri.pathname && uri.pathname.split('/')[1]; // remove the leading /
settings.database = uri.pathname && uri.pathname.split('/')[1]; // remove the leading /
settings.url = urlStr;
if (uri.query) {
const params = qs.parse(uri.query);
for (const p in params) {
var params = qs.parse(uri.query);
for (var p in params) {
settings[p] = params[p];
}
}
@ -501,8 +386,8 @@ function parseSettings(urlStr) {
*/
function deepMerge(base, extras) {
// deepMerge allows undefined extras to allow deep cloning of arrays
const array = Array.isArray(base) && (Array.isArray(extras) || !extras);
let dst = array && [] || {};
var array = Array.isArray(base) && (Array.isArray(extras) || !extras);
var dst = array && [] || {};
if (array) {
// extras or base is an array
@ -530,7 +415,7 @@ function deepMerge(base, extras) {
if (extras != null && typeof extras === 'object') {
// extras is an object {}
Object.keys(extras).forEach(function(key) {
const extra = extras[key];
var extra = extras[key];
if (extra == null || typeof extra !== 'object') {
// extra item value is null, undefined or not an object
dst[key] = extra;
@ -561,15 +446,11 @@ function deepMerge(base, extras) {
* @returns {Object} The merged property
*/
function deepMergeProperty(base, extras) {
const mergedObject = deepMerge({key: base}, {key: extras});
const mergedProperty = mergedObject.key;
let mergedObject = deepMerge({key: base}, {key: extras});
let mergedProperty = mergedObject.key;
return mergedProperty;
}
const numberIsFinite = Number.isFinite || function(value) {
return typeof value === 'number' && isFinite(value);
};
/**
* Adds a property __rank to array elements of type object {}
* If an inner element already has the __rank property it is not altered
@ -580,7 +461,7 @@ const numberIsFinite = Number.isFinite || function(value) {
* @return rankedArray The original array with newly ranked elements
*/
function rankArrayElements(array, rank) {
if (!Array.isArray(array) || !numberIsFinite(rank))
if (!Array.isArray(array) || !Number.isFinite(rank))
return array;
array.forEach(function(el) {
@ -620,7 +501,7 @@ function defineCachedRelations(obj) {
/**
* Check if the argument is plain object
* @param {*} obj The obj value
* @param {*) obj The obj value
* @returns {boolean}
*/
function isPlainObject(obj) {
@ -633,26 +514,26 @@ function sortObjectsByIds(idName, ids, objects, strict) {
return (typeof id === 'object') ? String(id) : id;
});
const indexOf = function(x) {
const isObj = (typeof x[idName] === 'object'); // ObjectID
const id = isObj ? String(x[idName]) : x[idName];
var indexOf = function(x) {
var isObj = (typeof x[idName] === 'object'); // ObjectID
var id = isObj ? String(x[idName]) : x[idName];
return ids.indexOf(id);
};
const heading = [];
const tailing = [];
var heading = [];
var tailing = [];
objects.forEach(function(x) {
if (typeof x === 'object') {
const idx = indexOf(x);
var idx = indexOf(x);
if (strict && idx === -1) return;
idx === -1 ? tailing.push(x) : heading.push(x);
}
});
heading.sort(function(x, y) {
const a = indexOf(x);
const b = indexOf(y);
var a = indexOf(x);
var b = indexOf(y);
if (a === -1 || b === -1) return 1; // last
if (a === b) return 0;
if (a > b) return 1;
@ -660,11 +541,11 @@ function sortObjectsByIds(idName, ids, objects, strict) {
});
return heading.concat(tailing);
}
};
function createPromiseCallback() {
let cb;
const promise = new Promise(function(resolve, reject) {
var cb;
var promise = new Promise(function(resolve, reject) {
cb = function(err, data) {
if (err) return reject(err);
return resolve(data);
@ -674,28 +555,19 @@ function createPromiseCallback() {
return cb;
}
function isBsonType(value) {
// bson@1.x stores _bsontype on ObjectID instance, bson@4.x on prototype
return value.hasOwnProperty('_bsontype') ||
value.constructor.prototype.hasOwnProperty('_bsontype');
}
/**
* Dedupe an array
* @param {Array} an array
* @returns {Array} an array with unique items
*/
function uniq(a) {
const uniqArray = [];
var uniqArray = [];
if (!a) {
return uniqArray;
}
assert(Array.isArray(a), 'array argument is required');
const comparableA = a.map(
item => isBsonType(item) ? item.toString() : item,
);
for (let i = 0, n = comparableA.length; i < n; i++) {
if (comparableA.indexOf(comparableA[i]) === i) {
for (var i = 0, n = a.length; i < n; i++) {
if (a.indexOf(a[i]) === i) {
uniqArray.push(a[i]);
}
}
@ -708,8 +580,8 @@ function uniq(a) {
* @returns {Object} A RegExp object
*/
function toRegExp(regex) {
const isString = typeof regex === 'string';
const isRegExp = regex instanceof RegExp;
var isString = typeof regex === 'string';
var isRegExp = regex instanceof RegExp;
if (!(isString || isRegExp))
return new Error(g.f('Invalid argument, must be a string, {{regex}} literal, or ' +
@ -722,20 +594,20 @@ function toRegExp(regex) {
return new RegExp(regex);
// only accept i, g, or m as valid regex flags
const flags = regex.split('/').pop().split('');
const validFlags = ['i', 'g', 'm'];
const invalidFlags = [];
var flags = regex.split('/').pop().split('');
var validFlags = ['i', 'g', 'm'];
var invalidFlags = [];
flags.forEach(function(flag) {
if (validFlags.indexOf(flag) === -1)
invalidFlags.push(flag);
});
const hasInvalidFlags = invalidFlags.length > 0;
var hasInvalidFlags = invalidFlags.length > 0;
if (hasInvalidFlags)
return new Error(g.f('Invalid {{regex}} flags: %s', invalidFlags));
// strip regex delimiter forward slashes
const expression = regex.substr(1, regex.lastIndexOf('/') - 1);
var expression = regex.substr(1, regex.lastIndexOf('/') - 1);
return new RegExp(expression, flags.join(''));
}
@ -773,9 +645,9 @@ function findIndexOf(arr, target, isEqual) {
return arr.indexOf(target);
}
for (let i = 0; i < arr.length; i++) {
for (var i = 0; i < arr.length; i++) {
if (isEqual(arr[i], target)) { return i; }
}
};
return -1;
}
@ -787,12 +659,12 @@ function findIndexOf(arr, target, isEqual) {
* @returns {Object} The object that queries targetIds
*/
function collectTargetIds(targetData, idPropertyName) {
const targetIds = [];
for (let i = 0; i < targetData.length; i++) {
const targetId = targetData[i][idPropertyName];
var targetIds = [];
for (var i = 0; i < targetData.length; i++) {
var targetId = targetData[i][idPropertyName];
targetIds.push(targetId);
}
const IdQuery = {
};
var IdQuery = {
inq: uniq(targetIds),
};
return IdQuery;
@ -806,90 +678,3 @@ function collectTargetIds(targetData, idPropertyName) {
function idName(m) {
return m.definition.idName() || 'id';
}
/**
* Check a list of IDs to see if there are any duplicates.
*
* @param {Array} The array of IDs to check
* @returns {boolean} If any duplicates were found
*/
function idsHaveDuplicates(ids) {
// use Set if available and all ids are of string or number type
let hasDuplicates = undefined;
let i, j;
if (typeof Set === 'function') {
const uniqueIds = new Set();
for (i = 0; i < ids.length; ++i) {
const idType = typeof ids[i];
if (idType === 'string' || idType === 'number') {
if (uniqueIds.has(ids[i])) {
hasDuplicates = true;
break;
} else {
uniqueIds.add(ids[i]);
}
} else {
// ids are not all string/number that can be checked via Set, stop and do the slow test
break;
}
}
if (hasDuplicates === undefined && uniqueIds.size === ids.length) {
hasDuplicates = false;
}
}
if (hasDuplicates === undefined) {
// fast check was inconclusive or unavailable, do the slow check
// can still optimize this by doing 1/2 N^2 instead of the full N^2
for (i = 0; i < ids.length && hasDuplicates === undefined; ++i) {
for (j = 0; j < i; ++j) {
if (idEquals(ids[i], ids[j])) {
hasDuplicates = true;
break;
}
}
}
}
return hasDuplicates === true;
}
function isClass(fn) {
return fn && fn.toString().startsWith('class ');
}
/**
* Accept an element, and attach the __parent property to it, unless no object given, while also
* making sure to check for already created properties
*
* @param {object} element
* @param {Model} parent
*/
function applyParentProperty(element, parent) {
assert.strictEqual(typeof element, 'object', 'Non object element given to assign parent');
const {constructor: {modelBuilder: {settings: builderSettings} = {}} = {}} = element;
if (!builderSettings || !builderSettings[BUILDER_PARENT_SETTING]) {
// parentRef flag not enabled on ModelBuilder settings
return;
}
if (element.hasOwnProperty(PARENT_PROPERTY_NAME)) {
// property already created on model, just assign
const existingParent = element[PARENT_PROPERTY_NAME];
if (existingParent && existingParent !== parent) {
// parent re-assigned (child model assigned to other model instance)
g.warn('Re-assigning child model instance to another parent than the original!\n' +
'Although supported, this is not a recommended practice: ' +
`${element.constructor.name} -> ${parent.constructor.name}\n` +
'You should create an independent copy of the child model using `new Model(CHILD)` OR ' +
'`new Model(CHILD.toJSON())` and assign to new parent');
}
element[PARENT_PROPERTY_NAME] = parent;
} else {
// first time defining the property on the element
Object.defineProperty(element, PARENT_PROPERTY_NAME, {
value: parent,
writable: true,
enumerable: false,
configurable: false,
});
}
}

View File

@ -1,13 +1,13 @@
// Copyright IBM Corp. 2013,2019. All Rights Reserved.
// Copyright IBM Corp. 2013,2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const g = require('strong-globalize')();
const util = require('util');
const extend = util._extend;
var g = require('strong-globalize')();
var util = require('util');
var extend = util._extend;
/*!
* Module exports
@ -32,7 +32,6 @@ function Validatable() {
/**
* Validate presence of one or more specified properties.
*
* Requires a model to include a property to be considered valid; fails when validated field is blank.
*
* For example, validate presence of title
@ -49,43 +48,34 @@ function Validatable() {
* ```
*
* @param {String} propertyName One or more property names.
* @options {Object} options Configuration parameters; see below.
* @options {Object} errMsg Optional custom error message. Default is "can't be blank"
* @property {String} message Error message to use instead of default.
* @property {String} if Validate only if `if` exists.
* @property {String} unless Validate only if `unless` exists.
*/
Validatable.validatesPresenceOf = getConfigurator('presence');
/**
* Validate absence of one or more specified properties.
*
* A model should not include a property to be considered valid; fails when validated field is not blank.
* A model should not include a property to be considered valid; fails when validated field not blank.
*
* For example, validate absence of reserved
* ```
* Post.validatesAbsenceOf('reserved', { unless: 'special' });
* ```
*
* @param {String} propertyName One or more property names.
* @options {Object} options Configuration parameters; see below.
* @options {Object} errMsg Optional custom error message. Default is "can't be set"
* @property {String} message Error message to use instead of default.
* @property {String} if Validate only if `if` exists.
* @property {String} unless Validate only if `unless` exists.
*/
Validatable.validatesAbsenceOf = getConfigurator('absence');
/**
* Validate length.
*
* Require a property length to be within a specified range.
*
* There are three kinds of validations: min, max, is.
* Validate length. Require a property length to be within a specified range.
* Three kinds of validations: min, max, is.
*
* Default error messages:
*
* - min: too short
* - max: too long
* - is: length is wrong
* - is: length is wrong
*
* Example: length validations
* ```
@ -99,42 +89,36 @@ Validatable.validatesAbsenceOf = getConfigurator('absence');
* User.validatesLengthOf('password', {min: 7, message: {min: 'too weak'}});
* User.validatesLengthOf('state', {is: 2, message: {is: 'is not valid state name'}});
* ```
*
* @param {String} propertyName Property name to validate.
* @options {Object} options Configuration parameters; see below.
* @options {Object} Options See below.
* @property {Number} is Value that property must equal to validate.
* @property {Number} min Value that property must be less than to be valid.
* @property {Number} max Value that property must be less than to be valid.
* @property {Object} message Optional object with string properties for custom error message for each validation: is, min, or max.
* @property {Object} message Optional Object with string properties for custom error message for each validation: is, min, or max
*/
Validatable.validatesLengthOf = getConfigurator('length');
/**
* Validate numericality.
*
* Requires a value for property to be either an integer or number.
* Validate numericality. Requires a value for property to be either an integer or number.
*
* Example
* ```
* User.validatesNumericalityOf('age', { message: { number: 'is not a number' }});
* User.validatesNumericalityOf('age', {int: true, message: { int: 'is not an integer' }});
* User.validatesNumericalityOf('age', { message: { number: '...' }});
* User.validatesNumericalityOf('age', {int: true, message: { int: '...' }});
* ```
*
* @param {String} propertyName Property name to validate.
* @options {Object} options Configuration parameters; see below.
* @options {Object} Options See below.
* @property {Boolean} int If true, then property must be an integer to be valid.
* @property {Boolean} allowBlank Allow property to be blank.
* @property {Boolean} allowNull Allow property to be null.
* @property {Object} message Optional object with string properties for 'int' for integer validation. Default error messages:
* @property {Object} message Optional object with string properties for 'int' for integer validation. Default error messages:
*
* - number: is not a number
* - int: is not an integer
*/
Validatable.validatesNumericalityOf = getConfigurator('numericality');
/**
* Validate inclusion in set.
*
* Require a value for property to be in the specified array.
* Validate inclusion in set. Require a value for property to be in the specified array.
*
* Example:
* ```
@ -145,8 +129,8 @@ Validatable.validatesNumericalityOf = getConfigurator('numericality');
* ```
*
* @param {String} propertyName Property name to validate.
* @options {Object} options Configuration parameters; see below.
* @property {Array} in Property must match one of the values in the array to be valid.
* @options {Object} Options See below
* @property {Array} inArray Property must match one of the values in the array to be valid.
* @property {String} message Optional error message if property is not valid.
* Default error message: "is not included in the list".
* @property {Boolean} allowNull Whether null values are allowed.
@ -154,31 +138,28 @@ Validatable.validatesNumericalityOf = getConfigurator('numericality');
Validatable.validatesInclusionOf = getConfigurator('inclusion');
/**
* Validate exclusion in a set.
*
* Require a property value not be in the specified array.
* Validate exclusion. Require a property value not be in the specified array.
*
* Example: `Company.validatesExclusionOf('domain', {in: ['www', 'admin']});`
*
* @param {String} propertyName Property name to validate.
* @options {Object} options Configuration parameters; see below.
* @options {Object} Options
* @property {Array} in Property must not match any of the values in the array to be valid.
* @property {String} message Optional error message if property is not valid. Default error message: "is reserved".
* @property {String} message Optional error message if property is not valid. Default error message: "is reserved".
* @property {Boolean} allowNull Whether null values are allowed.
*/
Validatable.validatesExclusionOf = getConfigurator('exclusion');
/**
* Validate format.
* Validate format. Require a model to include a property that matches the given format.
*
* Require a model to include a property that matches the given format.
*
* Example: `User.validatesFormatOf('name', {with: /\w+/});`
* Require a model to include a property that matches the given format. Example:
* `User.validatesFormatOf('name', {with: /\w+/});`
*
* @param {String} propertyName Property name to validate.
* @options {Object} options Configuration parameters; see below.
* @options {Object} Options
* @property {RegExp} with Regular expression to validate format.
* @property {String} message Optional error message if property is not valid. Default error message: " is invalid".
* @property {String} message Optional error message if property is not valid. Default error message: " is invalid".
* @property {Boolean} allowNull Whether null values are allowed.
*/
Validatable.validatesFormatOf = getConfigurator('format');
@ -187,7 +168,7 @@ Validatable.validatesFormatOf = getConfigurator('format');
* Validate using custom validation function.
*
* Example:
*```javascript
*
* User.validate('name', customValidator, {message: 'Bad name'});
* function customValidator(err) {
* if (this.name === 'bad') err();
@ -196,12 +177,11 @@ Validatable.validatesFormatOf = getConfigurator('format');
* user.isValid(); // true
* user.name = 'bad';
* user.isValid(); // false
* ```
*
* @param {String} propertyName Property name to validate.
* @param {Function} validatorFn Custom validation function.
* @options {Object} options Configuration parameters; see below.
* @property {String} message Optional error message if property is not valid. Default error message: " is invalid".
* @options {Object} Options See below.
* @property {String} message Optional error message if property is not valid. Default error message: " is invalid".
* @property {Boolean} allowNull Whether null values are allowed.
*/
Validatable.validate = getConfigurator('custom');
@ -209,6 +189,7 @@ Validatable.validate = getConfigurator('custom');
/**
* Validate using custom asynchronous validation function.
*
*
* Example:
*```js
* User.validateAsync('name', customValidator, {message: 'Bad name'});
@ -228,19 +209,17 @@ Validatable.validate = getConfigurator('custom');
* user.isValid(function (isValid) {
* isValid; // false
* })
* ```
*
*```
* @param {String} propertyName Property name to validate.
* @param {Function} validatorFn Custom validation function.
* @options {Object} options Configuration parameters; see below.
* @property {String} message Optional error message if property is not valid. Default error message: " is invalid".
* @options {Object} Options See below
* @property {String} message Optional error message if property is not valid. Default error message: " is invalid".
* @property {Boolean} allowNull Whether null values are allowed.
*/
Validatable.validateAsync = getConfigurator('custom', {async: true});
/**
* Validate uniqueness of the value for a property in the collection of models.
*
* Validate uniqueness. Ensure the value for property is unique in the collection of models.
* Not available for all connectors. Currently supported with these connectors:
* - In Memory
* - Oracle
@ -254,33 +233,18 @@ Validatable.validateAsync = getConfigurator('custom', {async: true});
* // The login must be unique within each Site.
* SiteUser.validateUniquenessOf('login', { scopedTo: ['siteId'] });
* ```
*
* @param {String} propertyName Property name to validate.
* @options {Object} options Configuration parameters; see below.
* @options {Object} Options See below.
* @property {RegExp} with Regular expression to validate format.
* @property {Array.<String>} scopedTo List of properties defining the scope.
* @property {String} message Optional error message if property is not valid. Default error message: "is not unique".
* @property {String} message Optional error message if property is not valid. Default error message: "is not unique".
* @property {Boolean} allowNull Whether null values are allowed.
* @property {String} ignoreCase Make the validation case insensitive.
* @property {String} if Validate only if `if` exists.
* @property {String} unless Validate only if `unless` exists.
* @property {String} ignoreCase Make the validation case insensitive
*/
Validatable.validatesUniquenessOf = getConfigurator('uniqueness', {async: true});
/**
* Validate if a value for a property is a Date.
*
* Example
* ```
* User.validatesDateOf('today', {message: 'today is not a date!'});
* ```
*
* @param {String} propertyName Property name to validate.
* @options {Object} options Configuration parameters; see below.
* @property {String} message Error message to use instead of default.
*/
Validatable.validatesDateOf = getConfigurator('date');
// implementation of validators
/*!
@ -307,7 +271,7 @@ function validateAbsence(attr, conf, err, options) {
function validateLength(attr, conf, err, options) {
if (nullCheck.call(this, attr, conf, err)) return;
const len = this[attr].length;
var len = this[attr].length;
if (conf.min && len < conf.min) {
err('min');
}
@ -361,9 +325,8 @@ function validateExclusion(attr, conf, err, options) {
function validateFormat(attr, conf, err, options) {
if (nullCheck.call(this, attr, conf, err)) return;
if (typeof this[attr] === 'string' || typeof this[attr] === 'number') {
const regex = new RegExp(conf['with']);
if (!regex.test(this[attr])) {
if (typeof this[attr] === 'string') {
if (!this[attr].match(conf['with'])) {
err();
}
} else {
@ -379,25 +342,14 @@ function validateCustom(attr, conf, err, options, done) {
done = options;
options = {};
}
if (!done) {
// called from a sync validator, stick options on end
conf.customValidator.call(this, err, options);
} else {
if (conf.customValidator.length === 3) {
// if they declared the validator with 3 args, they are expecting options
conf.customValidator.call(this, err, options, done);
} else {
// otherwise just pass the expected two (no context)
conf.customValidator.call(this, err, done);
}
}
conf.customValidator.call(this, err, done);
}
function escapeStringRegexp(str) {
if (typeof str !== 'string') {
throw new TypeError('Expected a string');
}
const matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
return str.replace(matchOperatorsRe, '\\$&');
}
@ -412,7 +364,7 @@ function validateUniqueness(attr, conf, err, options, done) {
if (blank(this[attr])) {
return process.nextTick(done);
}
const cond = {where: {}};
var cond = {where: {}};
if (conf && conf.ignoreCase) {
cond.where[attr] = new RegExp('^' + escapeStringRegexp(this[attr]) + '$', 'i');
@ -422,14 +374,14 @@ function validateUniqueness(attr, conf, err, options, done) {
if (conf && conf.scopedTo) {
conf.scopedTo.forEach(function(k) {
const val = this[k];
var val = this[k];
if (val !== undefined)
cond.where[k] = this[k];
}, this);
}
const idName = this.constructor.definition.idName();
const isNewRecord = this.isNewRecord();
var idName = this.constructor.definition.idName();
var isNewRecord = this.isNewRecord();
this.constructor.find(cond, options, function(error, found) {
if (error) {
err(error);
@ -452,11 +404,11 @@ function validateUniqueness(attr, conf, err, options, done) {
function validateDate(attr, conf, err) {
if (this[attr] === null || this[attr] === undefined) return;
const date = new Date(this[attr]);
var date = new Date(this[attr]);
if (isNaN(date.getTime())) return err();
}
const validators = {
var validators = {
presence: validatePresence,
absence: validateAbsence,
length: validateLength,
@ -471,7 +423,7 @@ const validators = {
function getConfigurator(name, opts) {
return function() {
const args = Array.prototype.slice.call(arguments);
var args = Array.prototype.slice.call(arguments);
args[1] = args[1] || {};
configure(this, name, args, opts);
};
@ -486,15 +438,15 @@ function getConfigurator(name, opts) {
* NOTE: This method can be called as synchronous only when no asynchronous validation is
* configured. It's strongly recommended to run all validations as asyncronous.
*
* Example: ExpressJS controller - render user if valid, show flash otherwise
* ```javascript
* Example: ExpressJS controller: render user if valid, show flash otherwise
* ```
* user.isValid(function (valid) {
* if (valid) res.render({user: user});
* else res.flash('error', 'User is not valid'), console.log(user.errors), res.redirect('/users');
* });
* ```
* Another example:
* ```javascript
* ```
* user.isValid(function (valid) {
* if (!valid) {
* console.log(user.errors);
@ -506,18 +458,15 @@ function getConfigurator(name, opts) {
* }
* });
* ```
* @callback {Function} callback Called with (valid).
* @param {Object} data Data to be validated.
* @param {Object} options Options to be specified upon validation.
* @param {Function} callback called with (valid)
* @returns {Boolean} True if no asynchronous validation is configured and all properties pass validation.
*/
Validatable.prototype.isValid = function(callback, data, options) {
options = options || {};
let valid = true, wait = 0, async = false;
const inst = this;
const validations = this.constructor.validations;
var valid = true, inst = this, wait = 0, async = false;
var validations = this.constructor.validations;
const reportDiscardedProperties = this.__strict &&
var reportDiscardedProperties = this.__strict &&
this.__unknownProperties && this.__unknownProperties.length;
// exit with success when no errors
@ -540,13 +489,13 @@ Validatable.prototype.isValid = function(callback, data, options) {
});
this.trigger('validate', function(validationsDone) {
const inst = this;
let asyncFail = false;
var inst = this,
asyncFail = false;
const attrs = Object.keys(validations || {});
var attrs = Object.keys(validations || {});
attrs.forEach(function(attr) {
const attrValidations = validations[attr] || [];
var attrValidations = validations[attr] || [];
attrValidations.forEach(function(v) {
if (v.options && v.options.async) {
async = true;
@ -555,7 +504,7 @@ Validatable.prototype.isValid = function(callback, data, options) {
validationFailed(inst, attr, v, options, done);
});
} else {
if (validationFailed(inst, attr, v, options)) {
if (validationFailed(inst, attr, v)) {
valid = false;
}
}
@ -563,10 +512,10 @@ Validatable.prototype.isValid = function(callback, data, options) {
});
if (reportDiscardedProperties) {
for (const ix in inst.__unknownProperties) {
const key = inst.__unknownProperties[ix];
const code = 'unknown-property';
const msg = defaultMessages[code];
for (var ix in inst.__unknownProperties) {
var key = inst.__unknownProperties[ix];
var code = 'unknown-property';
var msg = defaultMessages[code];
inst.errors.add(key, msg, code);
valid = false;
}
@ -612,7 +561,7 @@ function cleanErrors(inst) {
}
function validationFailed(inst, attr, conf, options, cb) {
const opts = conf.options || {};
var opts = conf.options || {};
if (typeof options === 'function') {
cb = options;
@ -629,13 +578,13 @@ function validationFailed(inst, attr, conf, options, cb) {
return false;
}
let fail = false;
const validator = validators[conf.validation];
const validatorArguments = [];
var fail = false;
var validator = validators[conf.validation];
var validatorArguments = [];
validatorArguments.push(attr);
validatorArguments.push(conf);
validatorArguments.push(function onerror(kind) {
let message, code = conf.code || conf.validation;
var message, code = conf.code || conf.validation;
if (conf.message) {
message = conf.message;
}
@ -670,7 +619,7 @@ function validationFailed(inst, attr, conf, options, cb) {
}
function skipValidation(inst, conf, kind) {
let doValidate = true;
var doValidate = true;
if (typeof conf[kind] === 'function') {
doValidate = conf[kind].call(inst);
if (kind === 'unless') doValidate = !doValidate;
@ -688,7 +637,7 @@ function skipValidation(inst, conf, kind) {
return !doValidate;
}
const defaultMessages = {
var defaultMessages = {
presence: 'can\'t be blank',
absence: 'can\'t be set',
'unknown-property': 'is not defined in the model',
@ -714,7 +663,6 @@ const defaultMessages = {
/**
* Checks if attribute is undefined or null. Calls err function with 'blank' or 'null'.
* See defaultMessages. You can affect this behaviour with conf.allowBlank and conf.allowNull.
* @private
* @param {String} attr Property name of attribute
* @param {Object} conf conf object for validator
* @param {Function} err
@ -722,7 +670,7 @@ const defaultMessages = {
*/
function nullCheck(attr, conf, err) {
// First determine if attribute is defined
if (typeof this[attr] === 'undefined' || this[attr] === '') {
if (typeof this[attr] === 'undefined') {
if (!conf.allowBlank) {
err('blank');
}
@ -765,7 +713,7 @@ function configure(cls, validation, args, opts) {
});
}
args = [].slice.call(args);
let conf;
var conf;
if (typeof args[args.length - 1] === 'object') {
conf = args.pop();
} else {
@ -777,7 +725,7 @@ function configure(cls, validation, args, opts) {
conf.validation = validation;
args.forEach(function(attr) {
if (typeof attr === 'string') {
const validation = extend({}, conf);
var validation = extend({}, conf);
validation.options = opts || {};
cls.validations[attr] = cls.validations[attr] || [];
cls.validations[attr].push(validation);
@ -804,7 +752,7 @@ Errors.prototype.add = function(field, message, code) {
};
function ErrorCodes(messages) {
const c = this;
var c = this;
Object.keys(messages).forEach(function(field) {
c[field] = messages[field].codes;
});
@ -859,19 +807,17 @@ function ErrorCodes(messages) {
* callback(err);
* }
* ```
*
* @private
*/
function ValidationError(obj) {
if (!(this instanceof ValidationError)) return new ValidationError(obj);
this.name = 'ValidationError';
const context = obj && obj.constructor && obj.constructor.modelName;
var context = obj && obj.constructor && obj.constructor.modelName;
this.message = g.f(
'The %s instance is not valid. Details: %s.',
context ? '`' + context + '`' : 'model',
formatErrors(obj.errors, obj.toJSON()) || '(unknown)',
context ? '`' + context + '`' : 'model',
formatErrors(obj.errors, obj.toJSON()) || '(unknown)'
);
this.statusCode = 422;
@ -895,20 +841,20 @@ function ValidationError(obj) {
util.inherits(ValidationError, Error);
const errorHasStackProperty = !!(new Error).stack;
var errorHasStackProperty = !!(new Error).stack;
ValidationError.maxPropertyStringLength = 32;
function formatErrors(errors, propertyValues) {
const DELIM = '; ';
var DELIM = '; ';
errors = errors || {};
return Object.getOwnPropertyNames(errors)
.filter(function(propertyName) {
return Array.isArray(errors[propertyName]);
})
.map(function(propertyName) {
const messages = errors[propertyName];
const propertyValue = propertyValues[propertyName];
var messages = errors[propertyName];
var propertyValue = propertyValues[propertyName];
return messages.map(function(msg) {
return formatPropertyError(propertyName, propertyValue, msg);
}).join(DELIM);
@ -917,8 +863,8 @@ function formatErrors(errors, propertyValues) {
}
function formatPropertyError(propertyName, propertyValue, errorMessage) {
let formattedValue;
const valueType = typeof propertyValue;
var formattedValue;
var valueType = typeof propertyValue;
if (valueType === 'string') {
formattedValue = JSON.stringify(truncatePropertyString(propertyValue));
} else if (propertyValue instanceof Date) {
@ -940,13 +886,13 @@ function formatPropertyError(propertyName, propertyValue, errorMessage) {
}
function truncatePropertyString(value) {
let len = ValidationError.maxPropertyStringLength;
var len = ValidationError.maxPropertyStringLength;
if (value.length <= len) return value;
// preserve few last characters like `}` or `]`, but no more than 3
// this way the last `} ]` in the array of objects is included in the message
let tail;
const m = value.match(/([ \t})\]]+)$/);
var tail;
var m = value.match(/([ \t})\]]+)$/);
if (m) {
tail = m[1].slice(-3);
len -= tail.length;

6978
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "loopback-datasource-juggler",
"version": "5.0.9",
"version": "3.9.1",
"publishConfig": {
"export-tests": true
},
@ -14,56 +14,51 @@
"Juggler",
"ORM"
],
"author": "IBM Corp.",
"engines": {
"node": ">=18"
"node": ">=4.0.0"
},
"repository": {
"type": "git",
"url": "https://github.com/loopbackio/loopback-datasource-juggler"
"url": "https://github.com/strongloop/loopback-datasource-juggler"
},
"main": "index.js",
"types": "index.d.ts",
"browser": {
"depd": "./lib/browser.depd.js"
},
"scripts": {
"lint": "eslint .",
"build": "npm run build-ts-types",
"build-ts-types": "tsc -p tsconfig.json --outDir dist",
"pretest": "npm run build",
"test": "nyc mocha",
"test": "mocha",
"posttest": "npm run lint"
},
"devDependencies": {
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"@types/node": "^10.17.60",
"async-iterators": "^0.2.2",
"bson": "^4.7.2",
"eslint": "^8.57.0",
"eslint-config-loopback": "^13.1.0",
"eslint-plugin-mocha": "^10.4.3",
"eslint": "^3.12.2",
"eslint-config-loopback": "^8.0.0",
"loopback-connector-throwing": "file:./test/fixtures/loopback-connector-throwing",
"mocha": "^10.4.0",
"nyc": "^15.1.0",
"should": "^13.2.3",
"typescript": "^5.4.5"
"mocha": "^3.2.0",
"should": "^8.4.0"
},
"dependencies": {
"async": "^3.2.5",
"change-case": "^4.1.2",
"debug": "^4.3.4",
"depd": "^2.0.0",
"inflection": "^3.0.0",
"lodash": "^4.17.21",
"loopback-connector": "^6.1.5",
"minimatch": "^9.0.4",
"nanoid": "^3.3.7",
"qs": "^6.12.1",
"strong-globalize": "^6.0.6",
"traverse": "^0.6.9",
"uuid": "^9.0.1"
"async": "~2.1.4",
"bluebird": "^3.1.1",
"debug": "^2.1.1",
"depd": "^1.0.0",
"inflection": "^1.6.0",
"lodash": "^4.17.4",
"loopback-connector": "^4.0.0",
"minimatch": "^3.0.3",
"qs": "^6.3.0",
"shortid": "^2.2.6",
"strong-globalize": "^2.6.2",
"traverse": "^0.6.6",
"uuid": "^3.0.1"
},
"license": "MIT"
"license": "MIT",
"ci": {
"downstreamIgnoreList": [
"loopback-connector-db2z",
"loopback-connector-informix",
"loopback-connector-mqlight"
]
}
}

View File

@ -1,5 +0,0 @@
{
"extends": [
"github>loopbackio/cicd//shared-configs/renovate/base"
]
}

View File

@ -1,4 +1,4 @@
// Copyright IBM Corp. 2015,2019. All Rights Reserved.
// Copyright IBM Corp. 2015,2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
@ -12,30 +12,30 @@
* $ open hooks.hml
*
*/
const Promise = global.Promise = require('bluebird');
const DataSource = require('../').DataSource;
const Memory = require('../lib/connectors/memory').Memory;
var Promise = global.Promise = require('bluebird');
var DataSource = require('../').DataSource;
var Memory = require('../lib/connectors/memory').Memory;
const HOOK_NAMES = [
var HOOK_NAMES = [
'access',
'before save', 'persist', 'loaded', 'after save',
'before delete', 'after delete',
];
const dataSources = [
var dataSources = [
createOptimizedDataSource(),
createUnoptimizedDataSource(),
];
const observedContexts = [];
let lastId = 0;
var observedContexts = [];
var lastId = 0;
Promise.onPossiblyUnhandledRejection(function(err) {
console.error('POSSIBLY UNHANDLED REJECTION', err.stack);
});
/* eslint-disable camelcase */
const operations = [
var operations = [
function find(ds) {
return ds.TestModel.find({where: {id: '1'}});
},
@ -51,15 +51,13 @@ const operations = [
function findOrCreate_found(ds) {
return ds.TestModel.findOrCreate(
{where: {name: ds.existingInstance.name}},
{name: ds.existingInstance.name},
);
{name: ds.existingInstance.name});
},
function findOrCreate_create(ds) {
return ds.TestModel.findOrCreate(
{where: {name: 'new-record'}},
{name: 'new-record'},
);
{name: 'new-record'});
},
function updateOrCreate_create(ds) {
@ -68,8 +66,7 @@ const operations = [
function updateOrCreate_update(ds) {
return ds.TestModel.updateOrCreate(
{id: ds.existingInstance.id, name: 'new name'},
);
{id: ds.existingInstance.id, name: 'new name'});
},
function replaceOrCreate_create(ds) {
@ -78,15 +75,13 @@ const operations = [
function replaceOrCreate_update(ds) {
return ds.TestModel.replaceOrCreate(
{id: ds.existingInstance.id, name: 'new name'},
);
{id: ds.existingInstance.id, name: 'new name'});
},
function replaceById(ds) {
return ds.TestModel.replaceById(
ds.existingInstance.id,
{name: 'new name'},
);
{name: 'new name'});
},
function updateAll(ds) {
@ -112,7 +107,7 @@ const operations = [
];
/* eslint-enable camelcase */
let p = setupTestModels();
var p = setupTestModels();
operations.forEach(function(op) {
p = p.then(runner(op));
});
@ -120,13 +115,13 @@ operations.forEach(function(op) {
p.then(report, function(err) { console.error(err.stack); });
function createOptimizedDataSource() {
const ds = new DataSource({connector: Memory});
var ds = new DataSource({connector: Memory});
ds.name = 'Optimized';
return ds;
}
function createUnoptimizedDataSource() {
const ds = new DataSource({connector: Memory});
var ds = new DataSource({connector: Memory});
ds.name = 'Unoptimized';
// disable optimized methods
@ -139,7 +134,7 @@ function createUnoptimizedDataSource() {
function setupTestModels() {
dataSources.forEach(function setupOnDataSource(ds) {
const TestModel = ds.TestModel = ds.createModel('TestModel', {
var TestModel = ds.TestModel = ds.createModel('TestModel', {
id: {type: String, id: true, default: uid},
name: {type: String, required: true},
extra: {type: String, required: false},
@ -155,7 +150,7 @@ function uid() {
function runner(fn) {
return function() {
let res = Promise.resolve();
var res = Promise.resolve();
dataSources.forEach(function(ds) {
res = res.then(function() {
return resetStorage(ds);
@ -173,7 +168,7 @@ function runner(fn) {
}
function resetStorage(ds) {
const TestModel = ds.TestModel;
var TestModel = ds.TestModel;
HOOK_NAMES.forEach(function(hook) {
TestModel.clearObservers(hook);
});
@ -192,7 +187,7 @@ function resetStorage(ds) {
.then(function() {
HOOK_NAMES.forEach(function(hook) {
TestModel.observe(hook, function(ctx, next) {
const row = observedContexts[observedContexts.length - 1];
var row = observedContexts[observedContexts.length - 1];
row.hooks[hook] = Object.keys(ctx);
next();
});
@ -212,7 +207,7 @@ function report() {
// merge rows where Optimized and Unoptimized produce the same context
observedContexts.forEach(function(row, ix) {
if (!ix) return;
const last = observedContexts[ix - 1];
var last = observedContexts[ix - 1];
if (row.operation != last.operation) return;
if (JSON.stringify(row.hooks) !== JSON.stringify(last.hooks)) return;
last.merge = true;
@ -226,11 +221,11 @@ function report() {
observedContexts.forEach(function(row) {
if (row.skip) return;
let caption = row.operation;
var caption = row.operation;
if (!row.merge) caption += ' (' + row.connector + ')';
console.log('<tr><th>' + caption + '</th>');
HOOK_NAMES.forEach(function(h) {
const text = row.hooks[h] ? row.hooks[h].join('<br/>') : '';
var text = row.hooks[h] ? row.hooks[h].join('<br/>') : '';
console.log(' <td>' + text + '</td>');
});
console.log('</tr>');

View File

@ -1,16 +1,15 @@
// Copyright IBM Corp. 2015,2019. All Rights Reserved.
// Copyright IBM Corp. 2015,2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const should = require('./init.js');
var should = require('./init.js');
const jdb = require('../');
const DataSource = jdb.DataSource;
var jdb = require('../');
var DataSource = jdb.DataSource;
let ds, Item, Variant;
var ds, Item, Variant;
describe('Datasource-specific field types for foreign keys', function() {
before(function() {
ds = new DataSource('memory');
@ -36,7 +35,7 @@ describe('Datasource-specific field types for foreign keys', function() {
});
it('should create foreign key with database-specific field type', function(done) {
const VariantDefinition = ds.getModelDefinition('Variant');
var VariantDefinition = ds.getModelDefinition('Variant');
should.exist(VariantDefinition);
should.exist(VariantDefinition.properties.myProp.memory);
should.exist(VariantDefinition.properties.myProp.memory.dataType);

View File

@ -1,4 +1,4 @@
// Copyright IBM Corp. 2016,2019. All Rights Reserved.
// Copyright IBM Corp. 2015,2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
@ -60,66 +60,57 @@ describe('allowExtendedOperators', () => {
all(model, filter, options, callback) {
// return the raw "value" query
const instanceFound = {
let instanceFound = {
value: filter.where.value,
};
callback(null, [instanceFound]);
}
}
function assertOperatorNotAllowed(err) {
should.exist(err);
err.message.should.match(/Operators "\$exists" are not allowed in query/);
err.code.should.equal('OPERATOR_NOT_ALLOWED_IN_QUERY');
err.statusCode.should.equal(400);
err.details.should.have.property('operators');
err.details.should.have.property('where');
}
describe('dataSource.settings.allowExtendedOperators', () => {
context('DAO.find()', () => {
it('reports invalid operator by default', () => {
it('converts extended operators to string value by default', () => {
const TestModel = createTestModel();
return TestModel.find(extendedQuery()).catch(err => {
assertOperatorNotAllowed(err);
return TestModel.find(extendedQuery()).then((results) => {
should(results[0].value).eql('[object Object]');
});
});
it('preserves extended operators with allowExtendedOperators set', () => {
const TestModel = createTestModel({allowExtendedOperators: true});
return TestModel.find(extendedQuery()).then(results => {
return TestModel.find(extendedQuery()).then((results) => {
should(results[0].value).eql({$exists: true});
});
});
it('`Model.settings.allowExtendedOperators` override data source settings - ' +
'reports invalid operator', () => {
'converts extended operators', () => {
const TestModel = createTestModel({allowExtendedOperators: true}, {allowExtendedOperators: false});
return TestModel.find(extendedQuery()).catch(err => {
assertOperatorNotAllowed(err);
return TestModel.find(extendedQuery()).then((results) => {
should(results[0].value).eql('[object Object]');
});
});
it('`Model.settings.allowExtendedOperators` override data source settings - ' +
'preserves extended operators', () => {
const TestModel = createTestModel({allowExtendedOperators: false}, {allowExtendedOperators: true});
return TestModel.find(extendedQuery()).then(results => {
return TestModel.find(extendedQuery()).then((results) => {
should(results[0].value).eql({$exists: true});
});
});
it('`options.allowExtendedOperators` override data source settings - ' +
'reports invalid operator', () => {
'converts extended operators', () => {
const TestModel = createTestModel({allowExtendedOperators: true});
return TestModel.find(extendedQuery(), {allowExtendedOperators: false}).catch(err => {
assertOperatorNotAllowed(err);
return TestModel.find(extendedQuery(), {allowExtendedOperators: false}).then((results) => {
should(results[0].value).eql('[object Object]');
});
});
it('`options.allowExtendedOperators` override data source settings - ' +
'preserves extended operators', () => {
const TestModel = createTestModel({allowExtendedOperators: false});
return TestModel.find(extendedQuery(), {allowExtendedOperators: true}).then(results => {
return TestModel.find(extendedQuery(), {allowExtendedOperators: true}).then((results) => {
should(results[0].value).eql({$exists: true});
});
});
@ -177,37 +168,37 @@ describe('allowExtendedOperators', () => {
context('DAO.find()', () => {
it('preserves extended operators with allowExtendedOperators set', () => {
const TestModel = createTestModel({}, {allowExtendedOperators: true});
return TestModel.find(extendedQuery()).then(results => {
return TestModel.find(extendedQuery()).then((results) => {
should(results[0].value).eql({$exists: true});
});
});
it('`dataSource.settings.allowExtendedOperators` honor Model settings - ' +
'reports invalid operator', () => {
'converts extended operators', () => {
const TestModel = createTestModel({allowExtendedOperators: true}, {allowExtendedOperators: false});
return TestModel.find(extendedQuery()).catch(err => {
assertOperatorNotAllowed(err);
return TestModel.find(extendedQuery()).then((results) => {
should(results[0].value).eql('[object Object]');
});
});
it('`dataSource.settings.allowExtendedOperators` honor Model settings - ' +
'preserves extended operators', () => {
const TestModel = createTestModel({allowExtendedOperators: false}, {allowExtendedOperators: true});
return TestModel.find(extendedQuery()).then(results => {
return TestModel.find(extendedQuery()).then((results) => {
should(results[0].value).eql({$exists: true});
});
});
it('`options.allowExtendedOperators` override Model settings - converts extended operators', () => {
const TestModel = createTestModel({allowExtendedOperators: true});
return TestModel.find(extendedQuery(), {allowExtendedOperators: false}).catch(err => {
assertOperatorNotAllowed(err);
return TestModel.find(extendedQuery(), {allowExtendedOperators: false}).then((results) => {
should(results[0].value).eql('[object Object]');
});
});
it('`options.allowExtendedOperators` Model settings - preserves extended operators', () => {
const TestModel = createTestModel({allowExtendedOperators: false});
return TestModel.find(extendedQuery(), {allowExtendedOperators: true}).then(results => {
return TestModel.find(extendedQuery(), {allowExtendedOperators: true}).then((results) => {
should(results[0].value).eql({$exists: true});
});
});
@ -264,7 +255,7 @@ describe('allowExtendedOperators', () => {
context('DAO.find()', () => {
it('preserves extended operators with allowExtendedOperators set', () => {
const TestModel = createTestModel();
return TestModel.find(extendedQuery(), {allowExtendedOperators: true}).then(results => {
return TestModel.find(extendedQuery(), {allowExtendedOperators: true}).then((results) => {
should(results[0].value).eql({$exists: true});
});
});
@ -272,15 +263,15 @@ describe('allowExtendedOperators', () => {
it('`dataSource.settings.allowExtendedOperators` honor options settings - ' +
'converts extended operators', () => {
const TestModel = createTestModel({allowExtendedOperators: true});
return TestModel.find(extendedQuery(), {allowExtendedOperators: false}).catch(err => {
assertOperatorNotAllowed(err);
return TestModel.find(extendedQuery(), {allowExtendedOperators: false}).then((results) => {
should(results[0].value).eql('[object Object]');
});
});
it('`dataSource.settings.allowExtendedOperators` honor options settings - ' +
'preserves extended operators', () => {
const TestModel = createTestModel({allowExtendedOperators: false});
return TestModel.find(extendedQuery(), {allowExtendedOperators: true}).then(results => {
return TestModel.find(extendedQuery(), {allowExtendedOperators: true}).then((results) => {
should(results[0].value).eql({$exists: true});
});
});
@ -288,15 +279,15 @@ describe('allowExtendedOperators', () => {
it('`Model.settings.allowExtendedOperators` honor options settings - ' +
'converts extended operators', () => {
const TestModel = createTestModel({}, {allowExtendedOperators: true});
return TestModel.find(extendedQuery(), {allowExtendedOperators: false}).catch(err => {
assertOperatorNotAllowed(err);
return TestModel.find(extendedQuery(), {allowExtendedOperators: false}).then((results) => {
should(results[0].value).eql('[object Object]');
});
});
it('`Model.settings.allowExtendedOperators` honor options settings - ' +
'preserves extended operators', () => {
const TestModel = createTestModel({}, {allowExtendedOperators: false});
return TestModel.find(extendedQuery(), {allowExtendedOperators: true}).then(results => {
return TestModel.find(extendedQuery(), {allowExtendedOperators: true}).then((results) => {
should(results[0].value).eql({$exists: true});
});
});

View File

@ -1,22 +1,22 @@
// Copyright IBM Corp. 2015,2019. All Rights Reserved.
// Copyright IBM Corp. 2015,2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const ModelBuilder = require('../').ModelBuilder;
const should = require('./init');
var ModelBuilder = require('../').ModelBuilder;
var should = require('./init');
var Promise = require('bluebird');
describe('async observer', function() {
let TestModel;
var TestModel;
beforeEach(function defineTestModel() {
const modelBuilder = new ModelBuilder();
var modelBuilder = new ModelBuilder();
TestModel = modelBuilder.define('TestModel', {name: String});
});
it('calls registered async observers', function(done) {
const notifications = [];
var notifications = [];
TestModel.observe('before', pushAndNext(notifications, 'before'));
TestModel.observe('after', pushAndNext(notifications, 'after'));
@ -33,7 +33,7 @@ describe('async observer', function() {
});
it('allows multiple observers for the same operation', function(done) {
const notifications = [];
var notifications = [];
TestModel.observe('event', pushAndNext(notifications, 'one'));
TestModel.observe('event', pushAndNext(notifications, 'two'));
@ -45,7 +45,7 @@ describe('async observer', function() {
});
it('allows multiple operations to be notified in one call', function(done) {
const notifications = [];
var notifications = [];
TestModel.observe('event1', pushAndNext(notifications, 'one'));
TestModel.observe('event2', pushAndNext(notifications, 'two'));
@ -57,10 +57,10 @@ describe('async observer', function() {
});
it('inherits observers from base model', function(done) {
const notifications = [];
var notifications = [];
TestModel.observe('event', pushAndNext(notifications, 'base'));
const Child = TestModel.extend('Child');
var Child = TestModel.extend('Child');
Child.observe('event', pushAndNext(notifications, 'child'));
Child.notifyObserversOf('event', {}, function(err) {
@ -71,11 +71,11 @@ describe('async observer', function() {
});
it('allow multiple operations to be notified with base models', function(done) {
const notifications = [];
var notifications = [];
TestModel.observe('event1', pushAndNext(notifications, 'base1'));
TestModel.observe('event2', pushAndNext(notifications, 'base2'));
const Child = TestModel.extend('Child');
var Child = TestModel.extend('Child');
Child.observe('event1', pushAndNext(notifications, 'child1'));
Child.observe('event2', pushAndNext(notifications, 'child2'));
@ -87,10 +87,10 @@ describe('async observer', function() {
});
it('does not modify observers in the base model', function(done) {
const notifications = [];
var notifications = [];
TestModel.observe('event', pushAndNext(notifications, 'base'));
const Child = TestModel.extend('Child');
var Child = TestModel.extend('Child');
Child.observe('event', pushAndNext(notifications, 'child'));
TestModel.notifyObserversOf('event', {}, function(err) {
@ -101,10 +101,10 @@ describe('async observer', function() {
});
it('always calls inherited observers', function(done) {
const notifications = [];
var notifications = [];
TestModel.observe('event', pushAndNext(notifications, 'base'));
const Child = TestModel.extend('Child');
var Child = TestModel.extend('Child');
// Important: there are no observers on the Child model
Child.notifyObserversOf('event', {}, function(err) {
@ -115,12 +115,12 @@ describe('async observer', function() {
});
it('can remove observers', function(done) {
const notifications = [];
var notifications = [];
function call(ctx, next) {
notifications.push('call');
process.nextTick(next);
}
};
TestModel.observe('event', call);
TestModel.removeObserver('event', call);
@ -133,12 +133,12 @@ describe('async observer', function() {
});
it('can clear all observers', function(done) {
const notifications = [];
var notifications = [];
function call(ctx, next) {
notifications.push('call');
process.nextTick(next);
}
};
TestModel.observe('event', call);
TestModel.observe('event', call);
@ -160,7 +160,7 @@ describe('async observer', function() {
});
it('passes context to final callback', function(done) {
const context = {};
var context = {};
TestModel.notifyObserversOf('event', context, function(err, ctx) {
(ctx || 'null').should.equal(context);
done();
@ -168,7 +168,7 @@ describe('async observer', function() {
});
describe('notifyObserversAround', function() {
let notifications;
var notifications;
beforeEach(function() {
notifications = [];
TestModel.observe('before execute',
@ -178,7 +178,7 @@ describe('async observer', function() {
});
it('should notify before/after observers', function(done) {
const context = {};
var context = {};
function work(done) {
process.nextTick(function() {
@ -195,7 +195,7 @@ describe('async observer', function() {
});
it('should allow work with context', function(done) {
const context = {};
var context = {};
function work(context, done) {
process.nextTick(function() {
@ -213,7 +213,7 @@ describe('async observer', function() {
it('should notify before/after observers with multiple results',
function(done) {
const context = {};
var context = {};
function work(done) {
process.nextTick(function() {
@ -240,7 +240,7 @@ describe('async observer', function() {
TestModel.observe('after invoke',
pushAndNext(notifications, 'after invoke'));
const context = {};
var context = {};
function work(done) {
process.nextTick(function() {
@ -265,7 +265,7 @@ describe('async observer', function() {
next();
});
const context = {};
var context = {};
function work(done) {
process.nextTick(function() {
@ -293,7 +293,7 @@ describe('async observer', function() {
});
it('handles rejected promise returned by an observer', function(done) {
const testError = new Error('expected test error');
var testError = new Error('expected test error');
TestModel.observe('event', function(ctx) {
return Promise.reject(testError);
});
@ -304,8 +304,8 @@ describe('async observer', function() {
});
it('returns a promise when no callback is provided', function() {
const context = {value: 'a-test-context'};
const p = TestModel.notifyObserversOf('event', context);
var context = {value: 'a-test-context'};
var p = TestModel.notifyObserversOf('event', context);
(p !== undefined).should.be.true;
return p.then(function(result) {
result.should.eql(context);
@ -313,97 +313,16 @@ describe('async observer', function() {
});
it('returns a rejected promise when no callback is provided', function() {
const testError = new Error('expected test error');
var testError = new Error('expected test error');
TestModel.observe('event', function(ctx, next) { next(testError); });
const p = TestModel.notifyObserversOf('event', context);
var p = TestModel.notifyObserversOf('event', context);
return p.then(
function(result) {
throw new Error('The promise should have been rejected.');
},
function(err) {
err.should.eql(testError);
},
);
});
it('should call after operation hook on error', function(done) {
const context = {
req: {},
};
const operationError = new Error('The operation failed without result');
let callCount = 0;
function fail(context, done) {
process.nextTick(() => {
done(operationError);
});
}
TestModel.observe('after execute error', function(ctx, next) {
callCount++;
next();
});
TestModel.notifyObserversAround('execute', context, fail, (err, ctx) => {
callCount.should.eql(1);
err.message.should.eql(operationError.message);
ctx.error.message.should.eql(operationError.message);
done();
});
});
it('should call after operation hook on error while overwriting error', function(done) {
const context = {
req: {},
};
const operationError = new Error('The operation failed without result');
const overwriteError = new Error('Overwriting the original error');
let callCount = 0;
function fail(context, done) {
process.nextTick(() => {
done(operationError);
});
}
TestModel.observe('after execute error', function(ctx, next) {
callCount++;
next(overwriteError);
});
TestModel.notifyObserversAround('execute', context, fail, (err, ctx) => {
callCount.should.eql(1);
err.message.should.eql(overwriteError.message);
ctx.error.message.should.eql(operationError.message);
done();
});
});
it('should call after operation hook on error while allowing to change err', function(done) {
const context = {
req: {},
};
const operationError = new Error('The operation failed without result');
let callCount = 0;
function fail(context, done) {
process.nextTick(() => {
done(operationError);
});
}
TestModel.observe('after execute error', function(ctx, next) {
callCount++;
const err = ctx.error;
next(err, ctx);
});
TestModel.notifyObserversAround('execute', context, fail, (err, ctx) => {
callCount.should.eql(1);
err.message.should.eql(operationError.message);
ctx.error.message.should.eql(operationError.message);
done();
});
});
});

File diff suppressed because it is too large Load Diff

View File

@ -1,17 +1,17 @@
// Copyright IBM Corp. 2011,2019. All Rights Reserved.
// Copyright IBM Corp. 2011,2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const Schema = require('../index').Schema;
const Text = Schema.Text;
var Schema = require('../index').Schema;
var Text = Schema.Text;
let nbSchemaRequests = 0;
var nbSchemaRequests = 0;
let batch;
let schemaName;
var batch;
var schemaName;
function it(name, cases) {
batch[schemaName][name] = cases;
@ -27,7 +27,7 @@ module.exports = function testSchema(exportCasesHere, dataSource) {
if (dataSource.name.match(/^\/.*\/test\/\.\.$/)) {
schemaName = schemaName.split('/').slice(-3).shift();
}
let start;
var start;
batch['should connect to database'] = function(test) {
start = Date.now();
@ -69,11 +69,31 @@ Object.defineProperty(module.exports, 'skip', {
value: skip,
});
/* eslint-disable mocha/handle-done-callback */
function testOrm(dataSource) {
const requestsAreCounted = dataSource.name !== 'mongodb';
function clearAndCreate(model, data, callback) {
var createdItems = [];
model.destroyAll(function() {
nextItem(null, null);
});
let Post, User, Passport, Log, Dog;
var itemIndex = 0;
function nextItem(err, lastItem) {
if (lastItem !== null) {
createdItems.push(lastItem);
}
if (itemIndex >= data.length) {
callback(createdItems);
return;
}
model.create(data[itemIndex], nextItem);
itemIndex++;
}
}
function testOrm(dataSource) {
var requestsAreCounted = dataSource.name !== 'mongodb';
var Post, User, Passport, Log, Dog;
it('should define class', function(test) {
User = dataSource.define('User', {
@ -102,7 +122,7 @@ function testOrm(dataSource) {
extra: Object,
});
const newuser = new User({settings: {hey: 'you'}});
var newuser = new User({settings: {hey: 'you'}});
test.ok(newuser.settings);
Post = dataSource.define('Post', {
@ -156,7 +176,7 @@ function testOrm(dataSource) {
Passport.belongsTo(User, {as: 'owner', foreignKey: 'ownerId'});
User.hasMany(Passport, {as: 'passports', foreignKey: 'ownerId'});
const user = new User;
var user = new User;
test.ok(User instanceof Function);
@ -178,7 +198,7 @@ function testOrm(dataSource) {
});
it('should initialize object properly', function(test) {
const hw = 'Hello word',
var hw = 'Hello word',
now = Date.now(),
post = new Post({title: hw}),
anotherPost = Post({title: 'Resig style constructor'});
@ -197,7 +217,7 @@ function testOrm(dataSource) {
});
it('should save object', function(test) {
const title = 'Initial title', title2 = 'Hello world',
var title = 'Initial title', title2 = 'Hello world',
date = new Date;
Post.create({
@ -213,51 +233,7 @@ function testOrm(dataSource) {
test.equal(obj.title, title2);
test.ok(!obj.propertyChanged('title'));
const p = new Post({title: 1});
p.title = 2;
p.save(function(err, obj) {
test.ok(!p.propertyChanged('title'));
p.title = 3;
test.ok(p.propertyChanged('title'));
test.equal(p.title_was, 2);
p.save(function() {
test.equal(p.title_was, 3);
test.ok(!p.propertyChanged('title'));
test.done();
});
});
});
});
});
it('should save objects when createAll is invoked', function(test) {
const title = 'Initial title',
title2 = 'Hello world',
date = new Date();
Post.createAll([
{
title,
date,
},
{
title: 'Title 2',
date: date,
},
], function(err, objs) {
const obj = objs[0];
test.ok(obj.id, 'Object id should present');
test.ok(objs[1].id, 'Object id should present');
test.equals(obj.title, title);
test.equals(objs[1].title, 'Title 2');
// test.equals(obj.date, date);
obj.title = title2;
test.ok(obj.propertyChanged('title'), 'Title changed');
obj.save(function(err, obj) {
test.equal(obj.title, title2);
test.ok(!obj.propertyChanged('title'));
const p = new Post({title: 1});
var p = new Post({title: 1});
p.title = 2;
p.save(function(err, obj) {
test.ok(!p.propertyChanged('title'));
@ -275,7 +251,7 @@ function testOrm(dataSource) {
});
it('should create object with initial data', function(test) {
const title = 'Initial title',
var title = 'Initial title',
date = new Date;
Post.create({
@ -324,8 +300,8 @@ function testOrm(dataSource) {
*/
it('should not re-instantiate object on saving', function(test) {
const title = 'Initial title';
const post = new Post({title: title});
var title = 'Initial title';
var post = new Post({title: title});
post.save(function(err, savedPost) {
test.strictEqual(post, savedPost);
test.done();
@ -352,21 +328,21 @@ function testOrm(dataSource) {
});
it('should handle virtual attributes', function(test) {
const salt = 's0m3s3cr3t5a1t';
var salt = 's0m3s3cr3t5a1t';
User.setter.passwd = function(password) {
this._passwd = calcHash(password, salt);
};
function calcHash(pass, salt) {
const crypto = require('crypto');
const hash = crypto.createHash('sha256');
var crypto = require('crypto');
var hash = crypto.createHash('sha256');
hash.update(pass);
hash.update(salt);
return hash.digest('base64');
}
const u = new User;
var u = new User;
u.passwd = 's3cr3t';
test.equal(u.passwd, calcHash('s3cr3t', salt));
test.done();
@ -403,7 +379,7 @@ function testOrm(dataSource) {
});
});
let countOfposts, countOfpostsFiltered;
var countOfposts, countOfpostsFiltered;
it('should fetch collection', function(test) {
Post.all(function(err, posts) {
countOfposts = posts.length;
@ -417,7 +393,7 @@ function testOrm(dataSource) {
});
it('should find records filtered with multiple attributes', function(test) {
const d = new Date;
var d = new Date;
Post.create({title: 'title', content: 'content', published: true, date: d}, function(err, post) {
Post.all({where: {title: 'title', date: d, published: true}}, function(err, res) {
test.equals(res.length, 1, 'Filtering Posts returns one post');
@ -431,7 +407,7 @@ function testOrm(dataSource) {
dataSource.name !== 'memory' &&
dataSource.name !== 'neo4j' &&
dataSource.name !== 'cradle'
)
)
it('relations key is working', function(test) {
test.ok(User.relations, 'Relations key should be defined');
test.ok(User.relations.posts, 'posts relation should exist on User');
@ -508,8 +484,8 @@ function testOrm(dataSource) {
// Finding one post with an existing author associated
Post.all(function(err, posts) {
// We try to get the first post with a userId != NULL
for (let i = 0; i < posts.length; i++) {
const post = posts[i];
for (var i = 0; i < posts.length; i++) {
var post = posts[i];
if (post.userId) {
// We could get the user with belongs to relationship but it is better if there is no interactions.
User.findById(post.userId, function(err, user) {
@ -518,7 +494,7 @@ function testOrm(dataSource) {
// There can't be any concurrency because we are counting requests
// We are first testing cases when user has posts
user.posts(function(err, data) {
const nbInitialRequests = nbSchemaRequests;
var nbInitialRequests = nbSchemaRequests;
user.posts(function(err, data2) {
test.equal(data.length, 2, 'There should be 2 posts.');
test.equal(data.length, data2.length, 'Posts should be the same, since we are loading on the same object.');
@ -537,7 +513,7 @@ function testOrm(dataSource) {
// We are now testing cases when user doesn't have any post
voidUser.posts(function(err, data) {
const nbInitialRequests = nbSchemaRequests;
var nbInitialRequests = nbSchemaRequests;
voidUser.posts(function(err, data2) {
test.equal(data.length, 0, 'There shouldn\'t be any posts (1/2).');
test.equal(data2.length, 0, 'There shouldn\'t be any posts (2/2).');
@ -573,13 +549,13 @@ function testOrm(dataSource) {
// });
it('should support scopes', function(test) {
let wait = 2;
var wait = 2;
test.ok(Post.scope, 'Scope supported');
Post.scope('published', {where: {published: true}});
test.ok(typeof Post.published === 'function');
test.ok(Post.published._scope.where.published === true);
const post = Post.published.build();
var post = Post.published.build();
test.ok(post.published, 'Can build');
test.ok(post.isNewRecord());
Post.published.create(function(err, psto) {
@ -600,20 +576,20 @@ function testOrm(dataSource) {
function done() {
if (--wait === 0) test.done();
}
};
});
it('should return type of property', function(test) {
test.equal(Post.getPropertyType('title'), 'String');
test.equal(Post.getPropertyType('content'), 'Text');
const p = new Post;
var p = new Post;
test.equal(p.getPropertyType('title'), 'String');
test.equal(p.getPropertyType('content'), 'Text');
test.done();
});
it('should handle ORDER clause', function(test) {
const titles = [
var titles = [
{title: 'Title A', subject: 'B'},
{title: 'Title Z', subject: 'A'},
{title: 'Title M', subject: 'C'},
@ -621,8 +597,8 @@ function testOrm(dataSource) {
{title: 'Title B', subject: 'A'},
{title: 'Title C', subject: 'D'},
];
const isRedis = Post.dataSource.name === 'redis';
const dates = isRedis ? [5, 9, 0, 17, 10, 9] : [
var isRedis = Post.dataSource.name === 'redis';
var dates = isRedis ? [5, 9, 0, 17, 10, 9] : [
new Date(1000 * 5),
new Date(1000 * 9),
new Date(1000 * 0),
@ -634,7 +610,7 @@ function testOrm(dataSource) {
Post.create({title: t.title, subject: t.subject, date: dates[i]}, done);
});
let i = 0, tests = 0;
var i = 0, tests = 0;
function done(err, obj) {
if (++i === titles.length) {
@ -740,7 +716,7 @@ function testOrm(dataSource) {
});
}
let fin = 0;
var fin = 0;
function finished() {
if (++fin === tests) {
@ -894,8 +870,8 @@ function testOrm(dataSource) {
// });
it('should handle order clause with direction', function(test) {
let wait = 0;
const emails = [
var wait = 0;
var emails = [
'john@hcompany.com',
'tom@hcompany.com',
'admin@hcompany.com',
@ -910,7 +886,7 @@ function testOrm(dataSource) {
User.create({email: email, name: 'Nick'}, done);
});
});
let tests = 2;
var tests = 2;
function done() {
process.nextTick(function() {
@ -923,7 +899,7 @@ function testOrm(dataSource) {
function doSortTest() {
User.all({order: 'email ASC', where: {name: 'Nick'}}, function(err, users) {
const _emails = emails.sort();
var _emails = emails.sort();
users.forEach(function(user, i) {
test.equal(_emails[i], user.email, 'ASC sorting');
});
@ -933,7 +909,7 @@ function testOrm(dataSource) {
function doReverseSortTest() {
User.all({order: 'email DESC', where: {name: 'Nick'}}, function(err, users) {
const _emails = emails.sort().reverse();
var _emails = emails.sort().reverse();
users.forEach(function(user, i) {
test.equal(_emails[i], user.email, 'DESC sorting');
});
@ -948,7 +924,7 @@ function testOrm(dataSource) {
it('should return id in find result even after updateAttributes', function(test) {
Post.create(function(err, post) {
const id = post.id;
var id = post.id;
test.ok(post.published === false);
post.updateAttributes({title: 'hey', published: true}, function() {
Post.find(id, function(err, post) {
@ -961,7 +937,7 @@ function testOrm(dataSource) {
});
it('should handle belongsTo correctly', function(test) {
const passport = new Passport({ownerId: 16});
var passport = new Passport({ownerId: 16});
// sync getter
test.equal(passport.owner(), 16);
// sync setter
@ -1040,7 +1016,7 @@ function testOrm(dataSource) {
if (dataSource.name !== 'mongoose' && dataSource.name !== 'neo4j')
it('should update or create record', function(test) {
const newData = {
var newData = {
id: 1,
title: 'New title (really new)',
content: 'Some example content (updated)',
@ -1081,7 +1057,7 @@ function testOrm(dataSource) {
User.setter.passwd = function(pass) {
this._passwd = pass + 'salt';
};
const u = new User({passwd: 'qwerty'});
var u = new User({passwd: 'qwerty'});
test.equal(u.passwd, 'qwertysalt');
u.save(function(err, user) {
User.findById(user.id, function(err, user) {
@ -1106,10 +1082,10 @@ function testOrm(dataSource) {
});
it('should work with typed and untyped nested collections', function(test) {
const post = new Post;
const like = post.likes.push({foo: 'bar'});
var post = new Post;
var like = post.likes.push({foo: 'bar'});
test.equal(like.constructor.name, 'ListItem');
const related = post.related.push({hello: 'world'});
var related = post.related.push({hello: 'world'});
test.ok(related.someMethod);
post.save(function(err, p) {
test.equal(p.likes.nextid, 2);
@ -1142,7 +1118,7 @@ function testOrm(dataSource) {
});
it('should find or create', function(test) {
const email = 'some email ' + Math.random();
var email = 'some email ' + Math.random();
User.findOrCreate({where: {email: email}}, function(err, u, created) {
test.ok(u);
test.ok(!u.age);

View File

@ -1,4 +1,4 @@
// Copyright IBM Corp. 2015,2019. All Rights Reserved.
// Copyright IBM Corp. 2015,2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
@ -7,9 +7,9 @@
'use strict';
/* global getSchema:false */
const should = require('./init.js');
const async = require('async');
let db, User, options, filter;
var should = require('./init.js');
var async = require('async');
var db, User, options, filter;
describe('crud-with-options', function() {
before(function(done) {
@ -23,7 +23,6 @@ describe('crud-with-options', function() {
role: {type: String, index: true},
order: {type: Number, index: true, sort: true},
vip: {type: Boolean},
address: {type: {city: String, area: String}},
});
options = {};
filter = {fields: ['name', 'id']};
@ -90,8 +89,7 @@ describe('crud-with-options', function() {
function(done) {
User.findById(undefined, {}, function(err, u) {
err.should.be.eql(
new Error('Model::findById requires the id argument'),
);
new Error('Model::findById requires the id argument'));
done();
});
});
@ -146,7 +144,7 @@ describe('crud-with-options', function() {
it('should allow promise-style findById',
function(done) {
User.create({id: 15, name: 'w', email: 'w@y.com'}).then(function(u) {
User.create({name: 'w', email: 'w@y.com'}).then(function(u) {
should.exist(u.id);
return User.findById(u.id).then(function(u) {
should.exist(u);
@ -193,7 +191,7 @@ describe('crud-with-options', function() {
describe('findByIds', function() {
before(function(done) {
const people = [
var people = [
{id: 1, name: 'a', vip: true},
{id: 2, name: 'b'},
{id: 3, name: 'c'},
@ -213,7 +211,7 @@ describe('crud-with-options', function() {
User.findByIds([3, 2, 1], function(err, users) {
should.exist(users);
should.not.exist(err);
const names = users.map(function(u) { return u.name; });
var names = users.map(function(u) { return u.name; });
names.should.eql(['c', 'b', 'a']);
done();
});
@ -225,7 +223,7 @@ describe('crud-with-options', function() {
{where: {vip: true}}, options, function(err, users) {
should.exist(users);
should.not.exist(err);
const names = users.map(function(u) {
var names = users.map(function(u) {
return u.name;
});
names.should.eql(['d', 'a']);
@ -407,15 +405,15 @@ describe('crud-with-options', function() {
describe('save', function() {
it('should allow save(options, cb)', function(done) {
const options = {foo: 'bar'};
let opts;
var options = {foo: 'bar'};
var opts;
User.observe('after save', function(ctx, next) {
opts = ctx.options;
next();
});
const u = new User();
var u = new User();
u.save(options, function(err) {
should.not.exist(err);
options.should.equal(opts);
@ -521,24 +519,6 @@ describe('crud-with-options', function() {
});
});
});
describe('updateAttributes', function() {
beforeEach(seed);
it('preserves document properties not modified by the patch', function() {
return User.findOne({where: {name: 'John Lennon'}})
.then(function(user) {
return user.updateAttributes({address: {city: 'Volos'}});
})
.then(function() {
return User.findOne({where: {name: 'John Lennon'}}); // retrieve the user again from the db
})
.then(function(updatedUser) {
updatedUser.address.city.should.equal('Volos');
should(updatedUser.address.area).not.be.exactly(null);
should(updatedUser.address.area).be.undefined();
});
});
});
});
describe('upsertWithWhere', function() {
@ -605,9 +585,8 @@ describe('upsertWithWhere', function() {
});
function seed(done) {
const beatles = [
var beatles = [
{
id: 0,
seq: 0,
name: 'John Lennon',
email: 'john@b3atl3s.co.uk',
@ -617,7 +596,6 @@ function seed(done) {
vip: true,
},
{
id: 1,
seq: 1,
name: 'Paul McCartney',
email: 'paul@b3atl3s.co.uk',
@ -626,19 +604,16 @@ function seed(done) {
order: 1,
vip: true,
},
{id: 2, seq: 2, name: 'George Harrison', order: 5, vip: false},
{id: 3, seq: 3, name: 'Ringo Starr', order: 6, vip: false},
{id: 4, seq: 4, name: 'Pete Best', order: 4},
{id: 5, seq: 5, name: 'Stuart Sutcliffe', order: 3, vip: true},
{seq: 2, name: 'George Harrison', order: 5, vip: false},
{seq: 3, name: 'Ringo Starr', order: 6, vip: false},
{seq: 4, name: 'Pete Best', order: 4},
{seq: 5, name: 'Stuart Sutcliffe', order: 3, vip: true},
];
async.series(
[
User.destroyAll.bind(User),
function(cb) {
User.createAll(beatles, cb);
},
],
done,
);
async.series([
User.destroyAll.bind(User),
function(cb) {
async.each(beatles, User.create.bind(User), cb);
},
], done);
}

View File

@ -1,25 +1,16 @@
// Copyright IBM Corp. 2016,2019. All Rights Reserved.
// Copyright IBM Corp. 2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const should = require('./init.js');
const DataSource = require('../lib/datasource.js').DataSource;
var should = require('./init.js');
var DataSource = require('../lib/datasource.js').DataSource;
describe('DataSource', function() {
it('clones settings to prevent surprising changes in passed args', () => {
const config = {connector: 'memory'};
const ds = new DataSource(config);
ds.settings.extra = true;
config.should.eql({connector: 'memory'});
});
it('reports helpful error when connector init throws', function() {
const throwingConnector = {
var throwingConnector = {
name: 'loopback-connector-throwing',
initialize: function(ds, cb) {
throw new Error('expected test error');
@ -54,624 +45,4 @@ describe('DataSource', function() {
});
}).should.throw(/expected test error/);
});
/**
* new DataSource(dsName, settings) without settings.name
*/
it('should retain the name assigned to it', function() {
const dataSource = new DataSource('myDataSource', {
connector: 'memory',
});
dataSource.name.should.equal('myDataSource');
});
/**
* new DataSource(dsName, settings)
*/
it('should allow the name assigned to it to take precedence over the settings name', function() {
const dataSource = new DataSource('myDataSource', {
name: 'defaultDataSource',
connector: 'memory',
});
dataSource.name.should.equal('myDataSource');
});
/**
* new DataSource(settings) with settings.name
*/
it('should retain the name from the settings if no name is assigned', function() {
const dataSource = new DataSource({
name: 'defaultDataSource',
connector: 'memory',
});
dataSource.name.should.equal('defaultDataSource');
});
/**
* new DataSource(undefined, settings)
*/
it('should retain the name from the settings if name is undefined', function() {
const dataSource = new DataSource(undefined, {
name: 'defaultDataSource',
connector: 'memory',
});
dataSource.name.should.equal('defaultDataSource');
});
/**
* new DataSource(settings) without settings.name
*/
it('should use the connector name if no name is provided', function() {
const dataSource = new DataSource({
connector: 'memory',
});
dataSource.name.should.equal('memory');
});
/**
* new DataSource(connectorInstance)
*/
it('should accept resolved connector', function() {
const mockConnector = {
name: 'loopback-connector-mock',
initialize: function(ds, cb) {
ds.connector = mockConnector;
return cb(null);
},
};
const dataSource = new DataSource(mockConnector);
dataSource.name.should.equal('loopback-connector-mock');
dataSource.connector.should.equal(mockConnector);
});
/**
* new DataSource(dsName, connectorInstance)
*/
it('should accept dsName and resolved connector', function() {
const mockConnector = {
name: 'loopback-connector-mock',
initialize: function(ds, cb) {
ds.connector = mockConnector;
return cb(null);
},
};
const dataSource = new DataSource('myDataSource', mockConnector);
dataSource.name.should.equal('myDataSource');
dataSource.connector.should.equal(mockConnector);
});
/**
* new DataSource(connectorInstance, settings)
*/
it('should accept resolved connector and settings', function() {
const mockConnector = {
name: 'loopback-connector-mock',
initialize: function(ds, cb) {
ds.connector = mockConnector;
return cb(null);
},
};
const dataSource = new DataSource(mockConnector, {name: 'myDataSource'});
dataSource.name.should.equal('myDataSource');
dataSource.connector.should.equal(mockConnector);
});
it('should set states correctly with eager connect', function(done) {
const mockConnector = {
name: 'loopback-connector-mock',
initialize: function(ds, cb) {
ds.connector = mockConnector;
this.connect(cb);
},
connect: function(cb) {
process.nextTick(function() {
cb(null);
});
},
};
const dataSource = new DataSource(mockConnector);
// DataSource is instantiated
// connected: false, connecting: false, initialized: false
dataSource.connected.should.be.false();
dataSource.connecting.should.be.false();
dataSource.initialized.should.be.false();
dataSource.on('initialized', function() {
// DataSource is initialized with lazyConnect
// connected: false, connecting: false, initialized: true
dataSource.connected.should.be.false();
dataSource.connecting.should.be.false();
dataSource.initialized.should.be.true();
});
dataSource.on('connected', function() {
// DataSource is now connected
// connected: true, connecting: false
dataSource.connected.should.be.true();
dataSource.connecting.should.be.false();
});
// Call connect() in next tick so that we'll receive initialized event
// first
process.nextTick(function() {
// At this point, the datasource is already connected by
// connector's (mockConnector) initialize function
dataSource.connect(function() {
// DataSource is now connected
// connected: true, connecting: false
dataSource.connected.should.be.true();
dataSource.connecting.should.be.false();
done();
});
// As the datasource is already connected, no connecting will happen
// connected: true, connecting: false
dataSource.connected.should.be.true();
dataSource.connecting.should.be.false();
});
});
it('should set states correctly with deferred connect', function(done) {
const mockConnector = {
name: 'loopback-connector-mock',
initialize: function(ds, cb) {
ds.connector = mockConnector;
// Explicitly call back with false to denote connection is not ready
process.nextTick(function() {
cb(null, false);
});
},
connect: function(cb) {
process.nextTick(function() {
cb(null);
});
},
};
const dataSource = new DataSource(mockConnector);
// DataSource is instantiated
// connected: false, connecting: false, initialized: false
dataSource.connected.should.be.false();
dataSource.connecting.should.be.false();
dataSource.initialized.should.be.false();
dataSource.on('initialized', function() {
// DataSource is initialized with lazyConnect
// connected: false, connecting: false, initialized: true
dataSource.connected.should.be.false();
dataSource.connecting.should.be.false();
dataSource.initialized.should.be.true();
});
dataSource.on('connected', function() {
// DataSource is now connected
// connected: true, connecting: false
dataSource.connected.should.be.true();
dataSource.connecting.should.be.false();
});
// Call connect() in next tick so that we'll receive initialized event
// first
process.nextTick(function() {
dataSource.connect(function() {
// DataSource is now connected
// connected: true, connecting: false
dataSource.connected.should.be.true();
dataSource.connecting.should.be.false();
done();
});
// As the datasource is not connected, connecting will happen
// connected: false, connecting: true
dataSource.connected.should.be.false();
dataSource.connecting.should.be.true();
});
});
it('should set states correctly with lazyConnect = true', function(done) {
const mockConnector = {
name: 'loopback-connector-mock',
initialize: function(ds, cb) {
ds.connector = mockConnector;
process.nextTick(function() {
cb(null);
});
},
connect: function(cb) {
process.nextTick(function() {
cb(null);
});
},
};
const dataSource = new DataSource(mockConnector, {lazyConnect: true});
// DataSource is instantiated
// connected: false, connecting: false, initialized: false
dataSource.connected.should.be.false();
dataSource.connecting.should.be.false();
dataSource.initialized.should.be.false();
dataSource.on('initialized', function() {
// DataSource is initialized with lazyConnect
// connected: false, connecting: false, initialized: true
dataSource.connected.should.be.false();
dataSource.connecting.should.be.false();
dataSource.initialized.should.be.true();
});
dataSource.on('connected', function() {
// DataSource is now connected
// connected: true, connecting: false
dataSource.connected.should.be.true();
dataSource.connecting.should.be.false();
});
// Call connect() in next tick so that we'll receive initialized event
// first
process.nextTick(function() {
dataSource.connect(function() {
// DataSource is now connected
// connected: true, connecting: false
dataSource.connected.should.be.true();
dataSource.connecting.should.be.false();
done();
});
// DataSource is now connecting
// connected: false, connecting: true
dataSource.connected.should.be.false();
dataSource.connecting.should.be.true();
});
});
it('provides stop() API calling disconnect', function(done) {
const mockConnector = {
name: 'loopback-connector-mock',
initialize: function(ds, cb) {
ds.connector = mockConnector;
process.nextTick(function() {
cb(null);
});
},
};
const dataSource = new DataSource(mockConnector);
dataSource.on('connected', function() {
// DataSource is now connected
// connected: true, connecting: false
dataSource.connected.should.be.true();
dataSource.connecting.should.be.false();
dataSource.stop(() => {
dataSource.connected.should.be.false();
done();
});
});
});
describe('deleteModelByName()', () => {
it('removes the model from ModelBuilder registry', () => {
const ds = new DataSource('ds', {connector: 'memory'});
ds.createModel('TestModel');
Object.keys(ds.modelBuilder.models)
.should.containEql('TestModel');
Object.keys(ds.modelBuilder.definitions)
.should.containEql('TestModel');
ds.deleteModelByName('TestModel');
Object.keys(ds.modelBuilder.models)
.should.not.containEql('TestModel');
Object.keys(ds.modelBuilder.definitions)
.should.not.containEql('TestModel');
});
it('removes the model from connector registry', () => {
const ds = new DataSource('ds', {connector: 'memory'});
ds.createModel('TestModel');
Object.keys(ds.connector._models)
.should.containEql('TestModel');
ds.deleteModelByName('TestModel');
Object.keys(ds.connector._models)
.should.not.containEql('TestModel');
});
});
describe('execute', () => {
let ds;
beforeEach(() => ds = new DataSource('ds', {connector: 'memory'}));
it('calls connnector to execute the command', async () => {
let called = 'not called';
ds.connector.execute = function(command, args, options, callback) {
called = {command, args, options};
callback(null, 'a-result');
};
const result = await ds.execute(
'command',
['arg1', 'arg2'],
{'a-flag': 'a-value'},
);
result.should.be.equal('a-result');
called.should.be.eql({
command: 'command',
args: ['arg1', 'arg2'],
options: {'a-flag': 'a-value'},
});
});
it('supports shorthand version (cmd)', async () => {
let called = 'not called';
ds.connector.execute = function(command, args, options, callback) {
// copied from loopback-connector/lib/sql.js
if (typeof args === 'function' && options === undefined && callback === undefined) {
// execute(sql, callback)
options = {};
callback = args;
args = [];
}
called = {command, args, options};
callback(null, 'a-result');
};
const result = await ds.execute('command');
result.should.be.equal('a-result');
called.should.be.eql({
command: 'command',
args: [],
options: {},
});
});
it('supports shorthand version (cmd, args)', async () => {
let called = 'not called';
ds.connector.execute = function(command, args, options, callback) {
// copied from loopback-connector/lib/sql.js
if (typeof options === 'function' && callback === undefined) {
// execute(sql, params, callback)
callback = options;
options = {};
}
called = {command, args, options};
callback(null, 'a-result');
};
await ds.execute('command', ['arg1', 'arg2']);
called.should.be.eql({
command: 'command',
args: ['arg1', 'arg2'],
options: {},
});
});
it('converts multiple callbacks arguments into a promise resolved with an array', async () => {
ds.connector.execute = function() {
const callback = arguments[arguments.length - 1];
callback(null, 'result1', 'result2');
};
const result = await ds.execute('command');
result.should.eql(['result1', 'result2']);
});
it('allows args as object', async () => {
let called = 'not called';
ds.connector.execute = function(command, args, options, callback) {
called = {command, args, options};
callback();
};
// See https://www.npmjs.com/package/loopback-connector-neo4j-graph
const command = 'MATCH (u:User {email: {email}}) RETURN u';
await ds.execute(command, {email: 'alice@example.com'}, {options: true});
called.should.be.eql({
command,
args: {email: 'alice@example.com'},
options: {options: true},
});
});
it('supports MongoDB version (collection, cmd, args, options)', async () => {
let called = 'not called';
ds.connector.execute = function(...params) {
const callback = params.pop();
called = params;
callback(null, 'a-result');
};
const result = await ds.execute(
'collection',
'command',
['arg1', 'arg2'],
{options: true},
);
result.should.equal('a-result');
called.should.be.eql([
'collection',
'command',
['arg1', 'arg2'],
{options: true},
]);
});
it('supports free-form version (...params)', async () => {
let called = 'not called';
ds.connector.execute = function(...params) {
const callback = params.pop();
called = params;
callback(null, 'a-result');
};
const result = await ds.execute(
'arg1',
'arg2',
'arg3',
'arg4',
{options: true},
);
result.should.equal('a-result');
called.should.be.eql([
'arg1',
'arg2',
'arg3',
'arg4',
{options: true},
]);
});
it('throws NOT_IMPLEMENTED when no connector is provided', () => {
ds.connector = undefined;
return ds.execute('command').should.be.rejectedWith({
code: 'NOT_IMPLEMENTED',
});
});
it('throws NOT_IMPLEMENTED for connectors not implementing execute', () => {
ds.connector.execute = undefined;
return ds.execute('command').should.be.rejectedWith({
code: 'NOT_IMPLEMENTED',
});
});
});
describe('automigrate', () => {
it('reports connection errors (immediate connect)', async () => {
const dataSource = new DataSource({
connector: givenConnectorFailingOnConnect(),
});
dataSource.define('MyModel');
await dataSource.automigrate().should.be.rejectedWith(/test failure/);
});
it('reports connection errors (lazy connect)', () => {
const dataSource = new DataSource({
connector: givenConnectorFailingOnConnect(),
lazyConnect: true,
});
dataSource.define('MyModel');
return dataSource.automigrate().should.be.rejectedWith(/test failure/);
});
function givenConnectorFailingOnConnect() {
return givenMockConnector({
connect: function(cb) {
process.nextTick(() => cb(new Error('test failure')));
},
automigrate: function(models, cb) {
cb(new Error('automigrate should not have been called'));
},
});
}
});
describe('autoupdate', () => {
it('reports connection errors (immediate connect)', async () => {
const dataSource = new DataSource({
connector: givenConnectorFailingOnConnect(),
});
dataSource.define('MyModel');
await dataSource.autoupdate().should.be.rejectedWith(/test failure/);
});
it('reports connection errors (lazy connect)', () => {
const dataSource = new DataSource({
connector: givenConnectorFailingOnConnect(),
lazyConnect: true,
});
dataSource.define('MyModel');
return dataSource.autoupdate().should.be.rejectedWith(/test failure/);
});
function givenConnectorFailingOnConnect() {
return givenMockConnector({
connect: function(cb) {
process.nextTick(() => cb(new Error('test failure')));
},
autoupdate: function(models, cb) {
cb(new Error('autoupdate should not have been called'));
},
});
}
});
describe('deleteAllModels', () => {
it('removes all model definitions', () => {
const ds = new DataSource({connector: 'memory'});
ds.define('Category');
ds.define('Product');
Object.keys(ds.modelBuilder.definitions)
.should.deepEqual(['Category', 'Product']);
Object.keys(ds.modelBuilder.models)
.should.deepEqual(['Category', 'Product']);
Object.keys(ds.connector._models)
.should.deepEqual(['Category', 'Product']);
ds.deleteAllModels();
Object.keys(ds.modelBuilder.definitions).should.be.empty();
Object.keys(ds.modelBuilder.models).should.be.empty();
Object.keys(ds.connector._models).should.be.empty();
});
it('preserves the connector instance', () => {
const ds = new DataSource({connector: 'memory'});
const connector = ds.connector;
ds.deleteAllModels();
ds.connector.should.equal(connector);
});
});
describe('getMaxOfflineRequests', () => {
let ds;
beforeEach(() => ds = new DataSource('ds', {connector: 'memory'}));
it('sets the default maximum number of event listeners to 16', () => {
ds.getMaxOfflineRequests().should.be.eql(16);
});
it('uses provided number of listeners', () => {
ds.settings.maxOfflineRequests = 17;
ds.getMaxOfflineRequests().should.be.eql(17);
});
it('throws an error if a non-number is provided for the max number of listeners', () => {
ds.settings.maxOfflineRequests = '17';
(function() {
return ds.getMaxOfflineRequests();
}).should.throw('maxOfflineRequests must be a number');
});
});
});
function givenMockConnector(props) {
const connector = {
name: 'loopback-connector-mock',
initialize: function(ds, cb) {
ds.connector = connector;
if (ds.settings.lazyConnect) {
cb(null, false);
} else {
connector.connect(cb);
}
},
...props,
};
return connector;
}

View File

@ -1,4 +1,4 @@
// Copyright IBM Corp. 2013,2019. All Rights Reserved.
// Copyright IBM Corp. 2013,2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
@ -7,21 +7,15 @@
'use strict';
/* global getSchema:false */
const should = require('./init.js');
var should = require('./init.js');
let db, Model, modelWithDecimalArray, dateArrayModel, numArrayModel;
class NestedClass {
constructor(roleName) {
this.roleName = roleName;
}
}
var db, Model;
describe('datatypes', function() {
before(function(done) {
db = getSchema();
const Nested = db.define('Nested', {});
const modelTableSchema = {
var Nested = db.define('Nested', {});
var modelTableSchema = {
str: String,
date: Date,
num: Number,
@ -29,107 +23,39 @@ describe('datatypes', function() {
list: {type: [String]},
arr: Array,
nested: Nested,
nestedClass: NestedClass,
};
Model = db.define('Model', modelTableSchema);
// 'modelWithDecimalArray' is too long an identifier name for Oracle DB
modelWithDecimalArray = db.define('modelWithDecArr', {
randomReview: {
type: [String],
mongodb: {
dataType: 'Decimal128',
},
},
});
dateArrayModel = db.define('dateArrayModel', {
bunchOfDates: [Date],
bunchOfOtherDates: {
type: [Date],
},
});
numArrayModel = db.define('numArrayModel', {
bunchOfNums: [Number],
});
db.automigrate(['Model', 'modelWithDecArr', 'dateArrayModel', 'numArrayModel'], done);
});
it('should resolve top-level "type" property correctly', function() {
const Account = db.define('Account', {
type: String,
id: String,
});
Account.definition.properties.type.type.should.equal(String);
});
it('should resolve "type" sub-property correctly', function() {
const Account = db.define('Account', {
item: {type: {
itemname: {type: String},
type: {type: String},
}},
});
Account.definition.properties.item.type.should.not.equal(String);
});
it('should resolve array prop with connector specific metadata', function() {
const props = modelWithDecimalArray.definition.properties;
props.randomReview.type.should.deepEqual(Array(String));
props.randomReview.mongodb.should.deepEqual({dataType: 'Decimal128'});
});
it('should coerce array of dates from string', async () => {
const dateVal = new Date('2019-02-21T12:00:00').toISOString();
const created = await dateArrayModel.create({
bunchOfDates: [dateVal,
dateVal,
dateVal],
bunchOfOtherDates: [dateVal,
dateVal,
dateVal],
});
created.bunchOfDates[0].should.be.an.instanceOf(Date);
created.bunchOfDates[0].should.deepEqual(new Date(dateVal));
created.bunchOfOtherDates[0].should.be.an.instanceOf(Date);
created.bunchOfOtherDates[0].should.deepEqual(new Date(dateVal));
});
it('should coerce array of numbers from string', async () => {
const dateVal = new Date('2019-02-21T12:00:00').toISOString();
const created = await numArrayModel.create({
bunchOfNums: ['1',
'2',
'3'],
});
created.bunchOfNums[0].should.be.an.instanceOf(Number);
created.bunchOfNums[0].should.equal(1);
db.automigrate(['Model'], done);
});
it('should return 400 when property of type array is set to string value',
function(done) {
const myModel = db.define('myModel', {
var myModel = db.define('myModel', {
list: {type: ['object']},
});
myModel.create({list: 'This string will crash the server'}, function(err) {
(err.statusCode).should.equal(400);
done();
});
(function() {
myModel.create({list: 'This string will crash the server'});
}).should.throw({statusCode: 400});
done();
});
it('should return 400 when property of type array is set to object value',
function(done) {
const myModel = db.define('myModel', {
var myModel = db.define('myModel', {
list: {type: ['object']},
});
myModel.create({list: {key: 'This string will crash the server'}}, function(err) {
(err.statusCode).should.equal(400);
done();
});
(function() {
myModel.create({list: {key: 'This string will crash the server'}});
}).should.throw({statusCode: 400});
done();
});
it('should keep types when get read data from db', function(done) {
const d = new Date('2015-01-01T12:00:00');
let id;
var d = new Date('2015-01-01T12:00:00'), id;
Model.create({
str: 'hello', date: d, num: '3', bool: 1, list: ['test'], arr: [1, 'str'],
@ -176,194 +102,8 @@ describe('datatypes', function() {
}
});
it('should create nested object defined by a class when reading data from db', async () => {
const d = new Date('2015-01-01T12:00:00');
let id;
const created = await Model.create({
date: d,
list: ['test'],
arr: [1, 'str'],
nestedClass: new NestedClass('admin'),
});
created.list.toJSON().should.deepEqual(['test']);
created.arr.toJSON().should.deepEqual([1, 'str']);
created.date.should.be.an.instanceOf(Date);
created.date.toString().should.equal(d.toString(), 'Time must match');
created.nestedClass.should.have.property('roleName', 'admin');
const found = await Model.findById(created.id);
should.exist(found);
found.list.toJSON().should.deepEqual(['test']);
found.arr.toJSON().should.deepEqual([1, 'str']);
found.date.should.be.an.instanceOf(Date);
found.date.toString().should.equal(d.toString(), 'Time must match');
found.nestedClass.should.have.property('roleName', 'admin');
});
it('should create nested object defined by a class using createAll', async () => {
const d = new Date('2015-01-01T12:00:00');
let id;
const [created] = await Model.createAll([
{
date: d,
list: ['test'],
arr: [1, 'str'],
nestedClass: new NestedClass('admin'),
},
]);
created.list.toJSON().should.deepEqual(['test']);
created.arr.toJSON().should.deepEqual([1, 'str']);
created.date.should.be.an.instanceOf(Date);
created.date.toString().should.equal(d.toString(), 'Time must match');
created.nestedClass.should.have.property('roleName', 'admin');
const found = await Model.findById(created.id);
should.exist(found);
found.list.toJSON().should.deepEqual(['test']);
found.arr.toJSON().should.deepEqual([1, 'str']);
found.date.should.be.an.instanceOf(Date);
found.date.toString().should.equal(d.toString(), 'Time must match');
found.nestedClass.should.have.property('roleName', 'admin');
});
it('should create nested objects defined by a class using multiple createAll calls', async () => {
const d = new Date('2015-01-01T12:00:00');
const result = await Promise.all([
Model.createAll([
{
date: d,
list: ['test 1'],
arr: [1, 'str 1'],
nestedClass: new NestedClass('admin 1'),
},
]),
Model.createAll([
{
date: d,
list: ['test 2'],
arr: [2, 'str 2'],
nestedClass: new NestedClass('admin 2'),
},
{
date: d,
list: ['test 3'],
arr: [3, 'str 3'],
nestedClass: new NestedClass('admin 3'),
},
]),
Model.createAll([
{
date: d,
list: ['test 4'],
arr: [4, 'str 4'],
nestedClass: new NestedClass('admin 4'),
},
]),
Model.createAll([
{
date: d,
list: ['test 6'],
arr: [6, 'str 6'],
nestedClass: new NestedClass('admin 6'),
},
]),
Model.createAll([
{
date: d,
list: ['test 5'],
arr: [5, 'str 5'],
nestedClass: new NestedClass('admin 5'),
},
]),
]);
const [created1] = result[0];
const [created2, created3] = result[1];
const [created4] = result[2];
const [created6] = result[3];
const [created5] = result[4];
await created1.list.toJSON().should.deepEqual(['test 1']);
created1.arr.toJSON().should.deepEqual([1, 'str 1']);
created1.date.should.be.an.instanceOf(Date);
created1.date.toString().should.equal(d.toString(), 'Time must match');
created1.nestedClass.should.have.property('roleName', 'admin 1');
await created2.list.toJSON().should.deepEqual(['test 2']);
created2.arr.toJSON().should.deepEqual([2, 'str 2']);
created2.date.should.be.an.instanceOf(Date);
created2.date.toString().should.equal(d.toString(), 'Time must match');
created2.nestedClass.should.have.property('roleName', 'admin 2');
await created3.list.toJSON().should.deepEqual(['test 3']);
created3.arr.toJSON().should.deepEqual([3, 'str 3']);
created3.date.should.be.an.instanceOf(Date);
created3.date.toString().should.equal(d.toString(), 'Time must match');
created3.nestedClass.should.have.property('roleName', 'admin 3');
await created4.list.toJSON().should.deepEqual(['test 4']);
created4.arr.toJSON().should.deepEqual([4, 'str 4']);
created4.date.should.be.an.instanceOf(Date);
created4.date.toString().should.equal(d.toString(), 'Time must match');
created4.nestedClass.should.have.property('roleName', 'admin 4');
await created5.list.toJSON().should.deepEqual(['test 5']);
created5.arr.toJSON().should.deepEqual([5, 'str 5']);
created5.date.should.be.an.instanceOf(Date);
created5.date.toString().should.equal(d.toString(), 'Time must match');
created5.nestedClass.should.have.property('roleName', 'admin 5');
await created6.list.toJSON().should.deepEqual(['test 6']);
created6.arr.toJSON().should.deepEqual([6, 'str 6']);
created6.date.should.be.an.instanceOf(Date);
created6.date.toString().should.equal(d.toString(), 'Time must match');
created6.nestedClass.should.have.property('roleName', 'admin 6');
const found1 = await Model.findById(created1.id);
should.exist(found1);
found1.list.toJSON().should.deepEqual(['test 1']);
found1.arr.toJSON().should.deepEqual([1, 'str 1']);
found1.date.should.be.an.instanceOf(Date);
found1.date.toString().should.equal(d.toString(), 'Time must match');
found1.nestedClass.should.have.property('roleName', 'admin 1');
const found2 = await Model.findById(created2.id);
should.exist(found2);
found2.list.toJSON().should.deepEqual(['test 2']);
found2.arr.toJSON().should.deepEqual([2, 'str 2']);
found2.date.should.be.an.instanceOf(Date);
found2.date.toString().should.equal(d.toString(), 'Time must match');
found2.nestedClass.should.have.property('roleName', 'admin 2');
const found3 = await Model.findById(created3.id);
should.exist(found3);
found3.list.toJSON().should.deepEqual(['test 3']);
found3.arr.toJSON().should.deepEqual([3, 'str 3']);
found3.date.should.be.an.instanceOf(Date);
found3.date.toString().should.equal(d.toString(), 'Time must match');
found3.nestedClass.should.have.property('roleName', 'admin 3');
const found4 = await Model.findById(created4.id);
should.exist(found4);
found4.list.toJSON().should.deepEqual(['test 4']);
found4.arr.toJSON().should.deepEqual([4, 'str 4']);
found4.date.should.be.an.instanceOf(Date);
found4.date.toString().should.equal(d.toString(), 'Time must match');
found4.nestedClass.should.have.property('roleName', 'admin 4');
const found5 = await Model.findById(created5.id);
should.exist(found5);
found5.list.toJSON().should.deepEqual(['test 5']);
found5.arr.toJSON().should.deepEqual([5, 'str 5']);
found5.date.should.be.an.instanceOf(Date);
found5.date.toString().should.equal(d.toString(), 'Time must match');
found5.nestedClass.should.have.property('roleName', 'admin 5');
const found6 = await Model.findById(created6.id);
should.exist(found6);
found6.list.toJSON().should.deepEqual(['test 6']);
found6.arr.toJSON().should.deepEqual([6, 'str 6']);
found6.date.should.be.an.instanceOf(Date);
found6.date.toString().should.equal(d.toString(), 'Time must match');
found6.nestedClass.should.have.property('roleName', 'admin 6');
});
it('should respect data types when updating attributes', function(done) {
const d = new Date;
let id;
var d = new Date, id;
Model.create({
str: 'hello', date: d, num: '3', bool: 1}, function(err, m) {
@ -413,40 +153,28 @@ describe('datatypes', function() {
});
it('should not coerce nested objects into ModelConstructor types', function() {
const coerced = Model._coerce({nested: {foo: 'bar'}});
var coerced = Model._coerce({nested: {foo: 'bar'}});
coerced.nested.constructor.name.should.equal('Object');
});
it('rejects array value converted to NaN for a required property',
function(done) {
db = getSchema();
Model = db.define('RequiredNumber', {
num: {type: Number, required: true},
});
db.automigrate(['Model'], function() {
Model.create({num: [1, 2, 3]}, function(err, inst) {
should.exist(err);
err.should.have.property('name').equal('ValidationError');
done();
});
});
});
it('handles null data', (done) => {
function(done) {
db = getSchema();
Model = db.define('HandleNullModel', {
data: {type: 'string'},
Model = db.define('RequiredNumber', {
num: {type: Number, required: true},
});
db.automigrate(['HandleNullModel'], function() {
const a = new Model(null);
done();
db.automigrate(['Model'], function() {
Model.create({num: [1, 2, 3]}, function(err, inst) {
should.exist(err);
err.should.have.property('name').equal('ValidationError');
done();
});
});
});
describe('model option persistUndefinedAsNull', function() {
let TestModel, isStrict;
var TestModel, isStrict;
before(function(done) {
db = getSchema();
TestModel = db.define(
'TestModel',
{
@ -456,8 +184,7 @@ describe('datatypes', function() {
},
{
persistUndefinedAsNull: true,
},
);
});
isStrict = TestModel.definition.settings.strict;
@ -465,7 +192,7 @@ describe('datatypes', function() {
});
it('should set missing optional properties to null', function(done) {
const EXPECTED = {desc: null, stars: null};
var EXPECTED = {desc: null, stars: null};
TestModel.create({name: 'a-test-name'}, function(err, created) {
if (err) return done(err);
created.should.have.properties(EXPECTED);
@ -479,8 +206,8 @@ describe('datatypes', function() {
});
it('should convert property value undefined to null', function(done) {
const EXPECTED = {desc: null, extra: null};
const data = {desc: undefined, extra: undefined};
var EXPECTED = {desc: null, extra: null};
var data = {desc: undefined, extra: undefined};
if (isStrict) {
// SQL-based connectors don't support dynamic properties
delete EXPECTED.extra;
@ -500,21 +227,21 @@ describe('datatypes', function() {
});
it('should convert undefined to null in the setter', function() {
const inst = new TestModel();
var inst = new TestModel();
inst.desc = undefined;
inst.should.have.property('desc', null);
inst.toObject().should.have.property('desc', null);
});
it('should use null in unsetAttribute()', function() {
const inst = new TestModel();
var inst = new TestModel();
inst.unsetAttribute('stars');
inst.should.have.property('stars', null);
inst.toObject().should.have.property('stars', null);
});
it('should convert undefined to null on save', function(done) {
const EXPECTED = {desc: null, stars: null, extra: null, dx: null};
var EXPECTED = {desc: null, stars: null, extra: null, dx: null};
if (isStrict) {
// SQL-based connectors don't support dynamic properties
delete EXPECTED.extra;
@ -546,13 +273,13 @@ describe('datatypes', function() {
TestModel.modelName,
{where: {id: created.id}},
{},
cb,
cb
);
} else {
TestModel.dataSource.connector.all(
TestModel.modelName,
{where: {id: created.id}},
cb,
cb
);
}
});
@ -560,7 +287,7 @@ describe('datatypes', function() {
});
it('should convert undefined to null in toObject()', function() {
const inst = new TestModel();
var inst = new TestModel();
inst.desc = undefined; // Note: this may be a no-op
inst.unsetAttribute('stars');
inst.extra = undefined;

Some files were not shown because too many files have changed in this diff Show More