@infrab4a/connect 4.9.7-beta.12 → 4.9.7-beta.14

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/index.cjs.js CHANGED
@@ -5904,26 +5904,24 @@ class ProductStockNotificationHasuraGraphQLRepository extends withCrudHasuraGrap
5904
5904
  const orderByField = {
5905
5905
  [orderBy.field]: orderBy.direction,
5906
5906
  };
5907
- const limit = Object.assign({}, ((pagination === null || pagination === void 0 ? void 0 : pagination.limit) && {
5908
- limit: {
5909
- value: pagination === null || pagination === void 0 ? void 0 : pagination.limit,
5910
- },
5911
- }));
5912
- const offset = Object.assign({}, ((pagination === null || pagination === void 0 ? void 0 : pagination.offset) && {
5913
- offset: {
5914
- value: pagination === null || pagination === void 0 ? void 0 : pagination.offset,
5915
- },
5916
- }));
5917
- const { report_stock_notification } = await this.query('report_stock_notification', ['product_id', 'ean', 'sku', 'name', 'stock', 'category_id', 'category', 'reference', 'emails_registered'], Object.assign(Object.assign({ where: {
5907
+ const { report_stock_notification } = await this.query('report_stock_notification', ['product_id', 'ean', 'sku', 'name', 'stock', 'category_id', 'category', 'reference', 'emails_registered'], {
5908
+ where: {
5918
5909
  type: 'report_stock_notification_bool_exp',
5919
5910
  value: query,
5920
5911
  required: true,
5921
- }, order_by: {
5912
+ },
5913
+ order_by: {
5922
5914
  type: '[report_stock_notification_order_by]',
5923
5915
  value: orderByField,
5924
5916
  required: true,
5925
- } }, limit), offset));
5926
- return report_stock_notification;
5917
+ },
5918
+ });
5919
+ return {
5920
+ data: (pagination === null || pagination === void 0 ? void 0 : pagination.offset) && (pagination === null || pagination === void 0 ? void 0 : pagination.limit)
5921
+ ? report_stock_notification.slice(pagination === null || pagination === void 0 ? void 0 : pagination.offset, pagination === null || pagination === void 0 ? void 0 : pagination.limit)
5922
+ : report_stock_notification,
5923
+ count: report_stock_notification.length,
5924
+ };
5927
5925
  }
5928
5926
  }
5929
5927
 
package/index.esm.js CHANGED
@@ -5898,26 +5898,24 @@ class ProductStockNotificationHasuraGraphQLRepository extends withCrudHasuraGrap
5898
5898
  const orderByField = {
5899
5899
  [orderBy.field]: orderBy.direction,
5900
5900
  };
5901
- const limit = Object.assign({}, ((pagination === null || pagination === void 0 ? void 0 : pagination.limit) && {
5902
- limit: {
5903
- value: pagination === null || pagination === void 0 ? void 0 : pagination.limit,
5904
- },
5905
- }));
5906
- const offset = Object.assign({}, ((pagination === null || pagination === void 0 ? void 0 : pagination.offset) && {
5907
- offset: {
5908
- value: pagination === null || pagination === void 0 ? void 0 : pagination.offset,
5909
- },
5910
- }));
5911
- const { report_stock_notification } = await this.query('report_stock_notification', ['product_id', 'ean', 'sku', 'name', 'stock', 'category_id', 'category', 'reference', 'emails_registered'], Object.assign(Object.assign({ where: {
5901
+ const { report_stock_notification } = await this.query('report_stock_notification', ['product_id', 'ean', 'sku', 'name', 'stock', 'category_id', 'category', 'reference', 'emails_registered'], {
5902
+ where: {
5912
5903
  type: 'report_stock_notification_bool_exp',
5913
5904
  value: query,
5914
5905
  required: true,
5915
- }, order_by: {
5906
+ },
5907
+ order_by: {
5916
5908
  type: '[report_stock_notification_order_by]',
5917
5909
  value: orderByField,
5918
5910
  required: true,
5919
- } }, limit), offset));
5920
- return report_stock_notification;
5911
+ },
5912
+ });
5913
+ return {
5914
+ data: (pagination === null || pagination === void 0 ? void 0 : pagination.offset) && (pagination === null || pagination === void 0 ? void 0 : pagination.limit)
5915
+ ? report_stock_notification.slice(pagination === null || pagination === void 0 ? void 0 : pagination.offset, pagination === null || pagination === void 0 ? void 0 : pagination.limit)
5916
+ : report_stock_notification,
5917
+ count: report_stock_notification.length,
5918
+ };
5921
5919
  }
5922
5920
  }
5923
5921
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infrab4a/connect",
3
- "version": "4.9.7-beta.12",
3
+ "version": "4.9.7-beta.14",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org"
6
6
  },
@@ -1,12 +1,13 @@
1
+ import { RepositoryFindResult } from '../../generic';
1
2
  import { CrudRepository } from '../../generic/repository/crud.repository';
2
3
  import { ProductStockNotification, ReportStockNotification, ReportStockNotificationInput, Shops } from '../models';
3
4
  export interface ProductStockNotificationRepository extends CrudRepository<ProductStockNotification> {
4
5
  addCustomerEmail(shop: Shops, productId: string, name: string, email: string): Promise<void>;
5
- getNotificationsReport(params: ReportStockNotificationInput, orderBy?: {
6
+ getNotificationsReport(params: ReportStockNotificationInput, orderBy: {
6
7
  field: string;
7
8
  direction: string;
8
9
  }, pagination?: {
9
10
  offset: number;
10
11
  limit: number;
11
- }): Promise<ReportStockNotification[]>;
12
+ }): Promise<RepositoryFindResult<ReportStockNotification>>;
12
13
  }
@@ -1,4 +1,4 @@
1
- import { Filter, ProductStockNotification, ReportStockNotification, ReportStockNotificationInput, Shops } from '../../../../domain';
1
+ import { Filter, ProductStockNotification, ReportStockNotification, ReportStockNotificationInput, RepositoryFindResult, Shops } from '../../../../domain';
2
2
  import { ProductStockNotificationRepository } from '../../../../domain/catalog/repositories';
3
3
  import { HasuraConstructorParams } from '../../mixins';
4
4
  declare const ProductStockNotificationHasuraGraphQLRepository_base: import("../../../../utils").MixinCtor<import("../..").GraphQLRepository<ProductStockNotification> & import("../../../../domain").CrudRepository<ProductStockNotification, import("../../../../domain").CrudParams<ProductStockNotification>> & import("../../../../domain").UpdateRepository<ProductStockNotification, import("../../../../domain").RepositoryUpdateParams<ProductStockNotification>> & {
@@ -7,12 +7,12 @@ declare const ProductStockNotificationHasuraGraphQLRepository_base: import("../.
7
7
  export declare class ProductStockNotificationHasuraGraphQLRepository extends ProductStockNotificationHasuraGraphQLRepository_base implements ProductStockNotificationRepository {
8
8
  constructor({ endpoint, authOptions, interceptors, }: Pick<HasuraConstructorParams<Filter>, 'endpoint' | 'authOptions' | 'interceptors'>);
9
9
  addCustomerEmail(shop: Shops, productId: string, name: string, email: string): Promise<void>;
10
- getNotificationsReport(params: ReportStockNotificationInput, orderBy?: {
10
+ getNotificationsReport(params: ReportStockNotificationInput, orderBy: {
11
11
  field: string;
12
12
  direction: string;
13
13
  }, pagination?: {
14
14
  offset: number;
15
15
  limit: number;
16
- }): Promise<ReportStockNotification[]>;
16
+ }): Promise<RepositoryFindResult<ReportStockNotification>>;
17
17
  }
18
18
  export {};