@autofleet/sheilta 1.3.2 → 1.3.3

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.
@@ -1,9 +1,9 @@
1
- import type { Attribute } from '../middleware';
1
+ import type { LiteralAttribute } from '../middleware';
2
2
  declare type OrderItem = string | [string, string];
3
3
  declare type SequelizeOrder = string | OrderItem[];
4
4
  export declare type FormatPayloadOptions = {
5
5
  includeRawPayload?: boolean;
6
- literalAttributes?: Attribute[];
6
+ literalAttributes?: LiteralAttribute[];
7
7
  DBFormatter?: any;
8
8
  };
9
9
  declare const formatPayload: ({ order, page, perPage, include, query, attributes, searchTerm, }: {
package/lib/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import { formatOperators } from './operators';
2
- import { queryFormatMiddleware, queryValidationMiddleware, MiddlewareValidationOption } from './middleware';
3
- export { formatOperators, queryFormatMiddleware, queryValidationMiddleware, MiddlewareValidationOption, };
2
+ import { queryFormatMiddleware, queryValidationMiddleware, MiddlewareValidationOption, LiteralAttribute } from './middleware';
3
+ export { formatOperators, queryFormatMiddleware, queryValidationMiddleware, MiddlewareValidationOption, LiteralAttribute, };
@@ -1,12 +1,15 @@
1
1
  import { FormatPayloadOptions } from '../formatter';
2
- export declare type Attribute = {
2
+ declare type literal = any;
3
+ declare type LiteralQuery = (literal | string)[] | literal;
4
+ export declare type LiteralAttribute = {
3
5
  attribute: string;
4
- literal: any;
6
+ literal: LiteralQuery;
5
7
  };
6
8
  export declare type MiddlewareValidationOption = {
7
- literalAttributes?: Attribute[];
9
+ literalAttributes?: LiteralAttribute[];
8
10
  };
9
11
  export declare const newQueryValidationMiddleware: (inner?: string) => (model: any, options?: MiddlewareValidationOption) => (req: any, res: any, next: any) => Promise<void>;
10
12
  export declare const newQueryFormatMiddleware: (inner?: string) => (model: any, options?: FormatPayloadOptions) => (req: any, res: any, next: any) => Promise<void>;
11
13
  export declare const queryValidationMiddleware: (model: any, options?: MiddlewareValidationOption) => (req: any, res: any, next: any) => Promise<void>;
12
14
  export declare const queryFormatMiddleware: (model: any, options?: FormatPayloadOptions) => (req: any, res: any, next: any) => Promise<void>;
15
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autofleet/sheilta",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "manage cache",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",