@cuboapp/api-backend 3.0.6 → 3.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuboapp/api-backend",
3
- "version": "3.0.6",
3
+ "version": "3.0.7",
4
4
  "description": "Backend Api for CuboApp",
5
5
  "main": "src/index.ts",
6
6
  "repository": "git@github.com:cuboapp/api-backend.git",
package/src/core/index.ts CHANGED
@@ -636,7 +636,9 @@ export class CuboBackendApi<T extends CuboApiEntitiesMap<T>, A extends unknown =
636
636
  }
637
637
 
638
638
  /**
639
- * Опции для внутренних read-back'ов: без наследования queryOptions.
639
+ * Опции для внутренних read-back'ов: без наследования queryOptions фильтрации.
640
+ * Служебный extra сохраняется, чтобы augmentation-хуки могли отличить
641
+ * внутреннюю серверную операцию от пользовательского запроса.
640
642
  * getOne-хуки чтения (beforeGetOne/afterGetOne) ВКЛЮЧЕНЫ — они должны срабатывать
641
643
  * на select/re-select внутри createOne/updateOne/deleteOne (запись+read-back идут
642
644
  * в одной транзакции, поэтому «спрятавший» строку beforeGetOne откатит запись).
@@ -648,7 +650,8 @@ export class CuboBackendApi<T extends CuboApiEntitiesMap<T>, A extends unknown =
648
650
  performer_id: opts.performer_id,
649
651
  auth: opts.auth,
650
652
  log: opts.log,
651
- excludeHooks: ['beforeGetMany', 'afterGetMany']
653
+ queryOptions: { extra: opts.queryOptions?.extra },
654
+ excludeHooks: [...new Set<CuboHookName>([...(opts.excludeHooks || []), 'beforeGetMany', 'afterGetMany'])]
652
655
  }
653
656
  }
654
657