How to use the @feathersjs/feathers.SKIP function in @feathersjs/feathers

To help you get started, we’ve selected a few @feathersjs/feathers examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jenkins-infra / evergreen / services / src / services / update / update.hooks.js View on Github external
const authentication = require('@feathersjs/authentication');
const errors         = require('@feathersjs/errors');
const logger         = require('winston');
const SKIP           = require('@feathersjs/feathers').SKIP;

const dbtimestamp        = require('../../hooks/dbtimestamp');
const ensureMatchingUUID = require('../../hooks/ensureuuid');
const internalOnly       = require('../../hooks/internalonly');
const internalApi        = require('../../hooks/internalapi');

const updateApiRequiredFields = [
  'commit',
  'manifest'
];

class UpdateHooks {
  constructor() {
  }

  /*
github feathersjs-ecosystem / feathers-hooks-common / lib / services / soft-delete-2.js View on Github external
- Other hooks anywhere set context.result.

 Semaphores:
 - params.$ignoreDeletedAt
   softDelete2() is a no-op for any call with set to true. This allows you to make service calls
   while ignoring the deletedAt prop. You are then responsible for setting & maintaining deletedAt.
 - params.$disableSoftDelete2
   Set to true for probing get and removing patch service calls made by softDelete().
   Custom replacements functions for these calls must set this as well.
   These types of calls do not run all the get or patch hooks.
 - Calls made on the server can set these param props. Clients cannot without server code allowing
   them to do so. You should not use softDelete if you decide this is a security weakness.
 */

const errors = require('@feathersjs/errors');
const SKIP = require('@feathersjs/feathers').SKIP;
const { callingParams } = require('./calling-params');

const defaultDeletedAt = 'deletedAt';
const deletedMessage = 'Record not found, is logically deleted.';

module.exports = function (options = {}) {
  const keepOnCreate = !!options.keepOnCreate;
  const skipProbeOnGet = !!options.skipProbeOnGet;
  const allowIgnoreDeletedAt = 'allowIgnoreDeletedAt' in options ? !!options.allowIgnoreDeletedAt : true;
  const patchCall = options.patchCall || defaultPatchCall;
  const deletedAt = options.deletedAt || 'deletedAt';

  return async function (context) {
    const method = context.method;
    const hasId = context.id !== undefined && context.id !== null;

@feathersjs/feathers

A framework for real-time applications and REST API with JavaScript and TypeScript

MIT
Latest version published 2 months ago

Package Health Score

92 / 100
Full package analysis