@autofleet/sheilta 2.12.0-sephi.2 → 2.13.0

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/lib/index.d.cts CHANGED
@@ -34,6 +34,12 @@ interface JsonAttributes {
34
34
  //#region src/formatter/index.d.ts
35
35
  type OrderItem = string | [string, string];
36
36
  type SequelizeOrder = string | OrderItem[];
37
+ type ScopeValue = string | {
38
+ method: (string | number | boolean | {
39
+ replacementsMap: Record<string, string>;
40
+ scopeValue: Record<string, "DESC" | "ASC">;
41
+ })[];
42
+ };
37
43
  interface FormatPayloadOptions {
38
44
  includeRawPayload?: boolean;
39
45
  literalAttributes?: LiteralAttribute[];
@@ -60,7 +66,6 @@ interface Include {
60
66
  model?: string;
61
67
  required?: boolean;
62
68
  include?: Include[];
63
- enrich?: string[];
64
69
  }
65
70
  interface FormatPayloadData {
66
71
  order?: string[];
@@ -84,12 +89,7 @@ interface FormattedPayload {
84
89
  page: number;
85
90
  perPage: number;
86
91
  include: any;
87
- scopes: (string | {
88
- method: (string | {
89
- replacementsMap: Record<string, string>;
90
- scopeValue: any;
91
- })[];
92
- })[];
92
+ scopes: ScopeValue[];
93
93
  subQuery?: boolean;
94
94
  }
95
95
  declare const formatPayload: ({
@@ -183,7 +183,7 @@ interface QueryHandlerOptions {
183
183
  /** The name of model to be printed in logs. defaults to `model`s constructor name. */
184
184
  modelName?: string;
185
185
  /** Sequelize scopes of the model to be used within the query. @example ['userScope'] */
186
- additionalScopes?: string[];
186
+ additionalScopes?: ScopeValue[];
187
187
  /** Callback to allow modifying the query values prior to querying the DB */
188
188
  modifyQueryValues?: (queryValues: QueryValues) => QueryValues;
189
189
  /** Optional callback to modify endpoint's response based on the DBs response. */
@@ -635,5 +635,5 @@ declare class Bulker extends EventEmitter implements BulkEventEmitter {
635
635
  emitEvent<K extends keyof BulkRouterEvents$1>(event: K, ...args: Parameters<BulkRouterEvents$1[K]>): void;
636
636
  }
637
637
  //#endregion
638
- export { type AdditionalIdsHookData, type BulkPerIdHandler, type BulkRouteOptions, type BulkRouterEvents, Bulker, BulkerError, JobManager as BulkerJobManager, type IBulkEventEmitter, type JobMetadata, type JobStatus, type LiteralAttribute, type MiddlewareValidationOption, formatOperators, generateFilterReplacements, queryFormatMiddleware, queryHandler, queryValidationMiddleware, validatePayload, z };
638
+ export { type AdditionalIdsHookData, type BulkPerIdHandler, type BulkRouteOptions, type BulkRouterEvents, Bulker, BulkerError, JobManager as BulkerJobManager, type IBulkEventEmitter, type JobMetadata, type JobStatus, type LiteralAttribute, type MiddlewareValidationOption, type ScopeValue, formatOperators, generateFilterReplacements, queryFormatMiddleware, queryHandler, queryValidationMiddleware, validatePayload, z };
639
639
  //# sourceMappingURL=index.d.cts.map
package/lib/index.d.ts CHANGED
@@ -34,6 +34,12 @@ interface JsonAttributes {
34
34
  //#region src/formatter/index.d.ts
35
35
  type OrderItem = string | [string, string];
36
36
  type SequelizeOrder = string | OrderItem[];
37
+ type ScopeValue = string | {
38
+ method: (string | number | boolean | {
39
+ replacementsMap: Record<string, string>;
40
+ scopeValue: Record<string, "DESC" | "ASC">;
41
+ })[];
42
+ };
37
43
  interface FormatPayloadOptions {
38
44
  includeRawPayload?: boolean;
39
45
  literalAttributes?: LiteralAttribute[];
@@ -60,7 +66,6 @@ interface Include {
60
66
  model?: string;
61
67
  required?: boolean;
62
68
  include?: Include[];
63
- enrich?: string[];
64
69
  }
65
70
  interface FormatPayloadData {
66
71
  order?: string[];
@@ -84,12 +89,7 @@ interface FormattedPayload {
84
89
  page: number;
85
90
  perPage: number;
86
91
  include: any;
87
- scopes: (string | {
88
- method: (string | {
89
- replacementsMap: Record<string, string>;
90
- scopeValue: any;
91
- })[];
92
- })[];
92
+ scopes: ScopeValue[];
93
93
  subQuery?: boolean;
94
94
  }
95
95
  declare const formatPayload: ({
@@ -183,7 +183,7 @@ interface QueryHandlerOptions {
183
183
  /** The name of model to be printed in logs. defaults to `model`s constructor name. */
184
184
  modelName?: string;
185
185
  /** Sequelize scopes of the model to be used within the query. @example ['userScope'] */
186
- additionalScopes?: string[];
186
+ additionalScopes?: ScopeValue[];
187
187
  /** Callback to allow modifying the query values prior to querying the DB */
188
188
  modifyQueryValues?: (queryValues: QueryValues) => QueryValues;
189
189
  /** Optional callback to modify endpoint's response based on the DBs response. */
@@ -635,5 +635,5 @@ declare class Bulker extends EventEmitter implements BulkEventEmitter {
635
635
  emitEvent<K extends keyof BulkRouterEvents$1>(event: K, ...args: Parameters<BulkRouterEvents$1[K]>): void;
636
636
  }
637
637
  //#endregion
638
- export { type AdditionalIdsHookData, type BulkPerIdHandler, type BulkRouteOptions, type BulkRouterEvents, Bulker, BulkerError, JobManager as BulkerJobManager, type IBulkEventEmitter, type JobMetadata, type JobStatus, type LiteralAttribute, type MiddlewareValidationOption, formatOperators, generateFilterReplacements, queryFormatMiddleware, queryHandler, queryValidationMiddleware, validatePayload, z };
638
+ export { type AdditionalIdsHookData, type BulkPerIdHandler, type BulkRouteOptions, type BulkRouterEvents, Bulker, BulkerError, JobManager as BulkerJobManager, type IBulkEventEmitter, type JobMetadata, type JobStatus, type LiteralAttribute, type MiddlewareValidationOption, type ScopeValue, formatOperators, generateFilterReplacements, queryFormatMiddleware, queryHandler, queryValidationMiddleware, validatePayload, z };
639
639
  //# sourceMappingURL=index.d.ts.map