denwa-nest-shared 1.2.6 → 1.3.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/dist/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { FindOptionsOrder, FindOptionsWhere } from 'typeorm';
1
+ import { FindOptionsOrder, FindOptionsSelect, FindOptionsWhere } from 'typeorm';
2
2
  export declare enum LANG {
3
3
  RU = "ru",
4
4
  EN = "en",
@@ -11,6 +11,13 @@ export interface IResponse<StatusCode, Data = object> {
11
11
  error?: string;
12
12
  data?: Data;
13
13
  }
14
+ export interface ICursorPagination {
15
+ id: string | number;
16
+ sortValue?: unknown;
17
+ sortValues?: Record<string, unknown>;
18
+ order?: string;
19
+ field?: string;
20
+ }
14
21
  export interface IPaginate {
15
22
  page: number;
16
23
  pages: number;
@@ -18,10 +25,13 @@ export interface IPaginate {
18
25
  next?: number;
19
26
  count: number;
20
27
  limit: number;
28
+ cursor?: string;
29
+ hasNextPage?: boolean;
21
30
  }
22
31
  export type QueryDataType<Entity> = {
23
32
  skip: number;
24
33
  take: number;
34
+ select?: (keyof Entity)[] | FindOptionsSelect<Entity>;
25
35
  order?: FindOptionsOrder<Entity>;
26
36
  where?: FindOptionsWhere<Entity>[] | FindOptionsWhere<Entity>;
27
37
  relations?: string[];
@@ -65,6 +75,7 @@ export interface IGetQuery {
65
75
  filterType?: FilterType;
66
76
  filter?: object;
67
77
  search?: object;
78
+ cursor?: string | ICursorPagination;
68
79
  }
69
80
  export declare enum ImageContentTypeEnum {
70
81
  'image/avif' = "image/avif",
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,IAIX;AAJD,WAAY,IAAI;IACd,iBAAS,CAAA;IACT,iBAAS,CAAA;IACT,iBAAS,CAAA;AACX,CAAC,EAJW,IAAI,KAAJ,IAAI,QAIf;AAyED,MAAM,CAAN,IAAY,oBAMX;AAND,WAAY,oBAAoB;IAC9B,iDAA2B,CAAA;IAC3B,iDAA2B,CAAA;IAC3B,iDAA2B,CAAA;IAC3B,+CAAyB,CAAA;IACzB,6EAAuD,CAAA;AACzD,CAAC,EANW,oBAAoB,KAApB,oBAAoB,QAM/B","sourcesContent":["import { FindOptionsOrder, FindOptionsWhere } from 'typeorm';\n\nexport enum LANG {\n RU = 'ru',\n EN = 'en',\n AR = 'ar',\n}\n\nexport interface IResponse<StatusCode, Data = object> {\n statusCode: StatusCode;\n messages?: string[];\n message?: string;\n error?: string;\n data?: Data;\n}\nexport interface IPaginate {\n page: number;\n pages: number;\n previous?: number;\n next?: number;\n count: number;\n limit: number;\n}\n\nexport type QueryDataType<Entity> = {\n skip: number;\n take: number;\n order?: FindOptionsOrder<Entity>;\n where?: FindOptionsWhere<Entity>[] | FindOptionsWhere<Entity>;\n relations?: string[];\n};\n\nexport type OkNotFoundType = IResponse<404 | 200>;\nexport type OkNotFoundBadRequestType = IResponse<404 | 400 | 200>;\nexport type OkNotFoundForbiddenType = IResponse<404 | 403 | 200>;\n\nexport type FilterType = 'and' | 'or';\nexport type SortOrderType = 'asc' | 'desc' | 'ASC' | 'DESC';\n\nexport interface IPreparedImage {\n name: string;\n fileExtensions?: string[];\n prefixes?: string[];\n originalFileExtension: string;\n entityId: string;\n folder?: string;\n fullPathExample: string;\n altRU?: string;\n altEN?: string;\n altAR?: string;\n}\n\nexport interface IPreparedFile {\n name: string;\n fullName: string;\n extension: string;\n entityId: string;\n fullPathExample: string;\n folder?: string;\n}\n\nexport interface IPreparedImageAndOrder extends IPreparedImage {\n order: number;\n}\n\nexport interface IPreparedFileAndOrder extends IPreparedFile {\n order: number;\n}\n\nexport interface IGetQuery {\n page?: number;\n limit?: number;\n sortField?: string;\n sortOrder?: SortOrderType;\n filterType?: FilterType;\n filter?: object;\n search?: object;\n}\n\nexport enum ImageContentTypeEnum {\n 'image/avif' = 'image/avif',\n 'image/webp' = 'image/webp',\n 'image/jpeg' = 'image/jpeg',\n 'image/png' = 'image/png',\n 'application/octet-stream' = 'application/octet-stream',\n}\n\nexport type NullToUndefined<T> = T extends null\n ? undefined\n : T extends (infer U)[]\n ? NullToUndefined<U>[]\n : T extends object\n ? { [K in keyof T]: NullToUndefined<T[K]> }\n : T;\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,IAIX;AAJD,WAAY,IAAI;IACd,iBAAS,CAAA;IACT,iBAAS,CAAA;IACT,iBAAS,CAAA;AACX,CAAC,EAJW,IAAI,KAAJ,IAAI,QAIf;AAsFD,MAAM,CAAN,IAAY,oBAMX;AAND,WAAY,oBAAoB;IAC9B,iDAA2B,CAAA;IAC3B,iDAA2B,CAAA;IAC3B,iDAA2B,CAAA;IAC3B,+CAAyB,CAAA;IACzB,6EAAuD,CAAA;AACzD,CAAC,EANW,oBAAoB,KAApB,oBAAoB,QAM/B","sourcesContent":["import { FindOptionsOrder, FindOptionsSelect, FindOptionsWhere } from 'typeorm';\n\nexport enum LANG {\n RU = 'ru',\n EN = 'en',\n AR = 'ar',\n}\n\nexport interface IResponse<StatusCode, Data = object> {\n statusCode: StatusCode;\n messages?: string[];\n message?: string;\n error?: string;\n data?: Data;\n}\n\nexport interface ICursorPagination {\n id: string | number;\n sortValue?: unknown;\n sortValues?: Record<string, unknown>;\n order?: string;\n field?: string;\n}\n\nexport interface IPaginate {\n page: number;\n pages: number;\n previous?: number;\n next?: number;\n count: number;\n limit: number;\n cursor?: string;\n hasNextPage?: boolean;\n}\n\nexport type QueryDataType<Entity> = {\n skip: number;\n take: number;\n select?: (keyof Entity)[] | FindOptionsSelect<Entity>;\n order?: FindOptionsOrder<Entity>;\n where?: FindOptionsWhere<Entity>[] | FindOptionsWhere<Entity>;\n relations?: string[];\n};\n\nexport type OkNotFoundType = IResponse<404 | 200>;\nexport type OkNotFoundBadRequestType = IResponse<404 | 400 | 200>;\nexport type OkNotFoundForbiddenType = IResponse<404 | 403 | 200>;\n\nexport type FilterType = 'and' | 'or';\nexport type SortOrderType = 'asc' | 'desc' | 'ASC' | 'DESC';\n\nexport interface IPreparedImage {\n name: string;\n fileExtensions?: string[];\n prefixes?: string[];\n originalFileExtension: string;\n entityId: string;\n folder?: string;\n fullPathExample: string;\n altRU?: string;\n altEN?: string;\n altAR?: string;\n}\n\nexport interface IPreparedFile {\n name: string;\n fullName: string;\n extension: string;\n entityId: string;\n fullPathExample: string;\n folder?: string;\n}\n\nexport interface IPreparedImageAndOrder extends IPreparedImage {\n order: number;\n}\n\nexport interface IPreparedFileAndOrder extends IPreparedFile {\n order: number;\n}\n\nexport interface IGetQuery {\n page?: number;\n limit?: number;\n sortField?: string;\n sortOrder?: SortOrderType;\n filterType?: FilterType;\n filter?: object;\n search?: object;\n cursor?: string | ICursorPagination;\n}\n\nexport enum ImageContentTypeEnum {\n 'image/avif' = 'image/avif',\n 'image/webp' = 'image/webp',\n 'image/jpeg' = 'image/jpeg',\n 'image/png' = 'image/png',\n 'application/octet-stream' = 'application/octet-stream',\n}\n\nexport type NullToUndefined<T> = T extends null\n ? undefined\n : T extends (infer U)[]\n ? NullToUndefined<U>[]\n : T extends object\n ? { [K in keyof T]: NullToUndefined<T[K]> }\n : T;\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "denwa-nest-shared",
4
- "version": "1.2.6",
4
+ "version": "1.3.0",
5
5
  "skills": "skills",
6
6
  "types": "./dist/index.d.ts",
7
7
  "main": "./cjs/index.js",
@@ -1,8 +1,6 @@
1
1
  ---
2
2
  name: auth-security
3
- description: >
4
- Implementing security and RBAC using Roles, Public, and identity decorators.
5
- Handles GraphQL and REST contexts uniformly. Includes field-level role checking.
3
+ description: "Implementing security and RBAC using Roles, Public, and identity decorators. Handles GraphQL and REST contexts uniformly. Includes field-level role checking. Use when adding auth guards, roles, or identity decorators."
6
4
  type: core
7
5
  library: denwa-nest-shared
8
6
  library_version: '1.0.80'
@@ -1,8 +1,6 @@
1
1
  ---
2
2
  name: data-access-typeorm
3
- description: >
4
- Generating complex TypeORM FindOptions using the createQueryData helper.
5
- Standardizes filtering, ILike searching, range mapping (fromToFields), and pagination.
3
+ description: "Generating complex TypeORM FindOptions using the createQueryData helper. Standardizes filtering, ILike searching, range mapping (fromToFields), and pagination. Use when building paginated or filtered TypeORM queries."
6
4
  type: core
7
5
  library: denwa-nest-shared
8
6
  library_version: '1.0.80'
@@ -1,8 +1,6 @@
1
1
  ---
2
2
  name: file-management
3
- description: >
4
- Managing file and image metadata stored as JSON strings in the database.
5
- Standardizes the lifecycle of temporary uploads, entity sync, and S3 metadata formatting.
3
+ description: "Managing file and image metadata stored as JSON strings in the database. Standardizes the lifecycle of temporary uploads, entity sync, and S3 metadata formatting. Use when handling uploaded files or image metadata in entities."
6
4
  type: core
7
5
  library: denwa-nest-shared
8
6
  library_version: '1.0.80'
@@ -116,4 +114,4 @@ Source: Denwa799/nest-shared:src/lib.ts:762
116
114
 
117
115
  ## References
118
116
 
119
- - [Image DTO Reference](Denwa799/nest-shared:src/dto.ts#L250)
117
+ - [Image DTO Reference](https://github.com/Denwa799/nest-shared/blob/master/src/dto.ts#L250)
@@ -1,8 +1,6 @@
1
1
  ---
2
2
  name: schema-definition
3
- description: >
4
- Defining properties in DTOs and Entities using ApiValidationProperty to unify GraphQL, Swagger, and class-validation.
5
- Includes Paginate, DeleteDto, IdsDto, and OkRequestDto for standardizing request/response shapes.
3
+ description: "Defining properties in DTOs and Entities using ApiValidationProperty to unify GraphQL, Swagger, and class-validation. Includes Paginate, DeleteDto, IdsDto, and OkRequestDto for standardizing request/response shapes. Use when creating or updating DTOs and Entities."
6
4
  type: core
7
5
  library: denwa-nest-shared
8
6
  library_version: '1.0.80'