@pcg/core 1.0.0-alpha.1 → 1.0.0-alpha.2

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.
Files changed (98) hide show
  1. package/dist/index.d.ts +21 -1179
  2. package/dist/index.js +76 -1856
  3. package/dist/index.js.map +1 -1
  4. package/package.json +16 -4
  5. package/.turbo/turbo-build.log +0 -16
  6. package/CHANGELOG.md +0 -14
  7. package/src/abstracts/index.ts +0 -3
  8. package/src/abstracts/nestjs-resource-service.ts +0 -154
  9. package/src/abstracts/nestjs-service.ts +0 -25
  10. package/src/configs/app.config.ts +0 -185
  11. package/src/configs/db.config.ts +0 -122
  12. package/src/configs/index.ts +0 -4
  13. package/src/configs/logger.config.ts +0 -62
  14. package/src/context/action-context.ts +0 -34
  15. package/src/context/current-user.ts +0 -49
  16. package/src/context/index.ts +0 -5
  17. package/src/context/platform-method-context.ts +0 -5
  18. package/src/context/service-method-context.ts +0 -47
  19. package/src/db/snake-naming.strategy.ts +0 -277
  20. package/src/enums/app-env.enum.ts +0 -36
  21. package/src/enums/app-mode.enum.ts +0 -5
  22. package/src/enums/app-server.enum.ts +0 -39
  23. package/src/enums/index.ts +0 -4
  24. package/src/enums/worker-mode.enum.ts +0 -11
  25. package/src/errors/access-denied.error.ts +0 -18
  26. package/src/errors/bad-request.error.ts +0 -9
  27. package/src/errors/forbidden.error.ts +0 -9
  28. package/src/errors/index.ts +0 -8
  29. package/src/errors/input-validation.error.ts +0 -16
  30. package/src/errors/nest-error.filter.ts +0 -70
  31. package/src/errors/nest-error.ts +0 -63
  32. package/src/errors/not-found.error.ts +0 -9
  33. package/src/errors/unauthorized.error.ts +0 -9
  34. package/src/exceptions/http-exception-response.ts +0 -34
  35. package/src/exceptions/http-exceptions.filter.ts +0 -95
  36. package/src/index.ts +0 -32
  37. package/src/jwt/extractors.ts +0 -80
  38. package/src/jwt/types.ts +0 -209
  39. package/src/logger/classes/logger-factory.ts +0 -54
  40. package/src/logger/classes/logger.ts +0 -340
  41. package/src/logger/classes/nest-system-logger.ts +0 -63
  42. package/src/logger/classes/typeorm-logger.ts +0 -83
  43. package/src/logger/index.ts +0 -20
  44. package/src/logger/logger.constants.ts +0 -24
  45. package/src/logger/logger.interfaces.ts +0 -98
  46. package/src/logger/logger.module.ts +0 -45
  47. package/src/logger/logger.providers.ts +0 -140
  48. package/src/logger/winston.tools.ts +0 -241
  49. package/src/middlewares/app.middleware.ts +0 -26
  50. package/src/middlewares/index.ts +0 -1
  51. package/src/modules/hooks/base-hook.ts +0 -64
  52. package/src/modules/hooks/decorators/on-hook.decorator.ts +0 -19
  53. package/src/modules/hooks/hooks.module.ts +0 -10
  54. package/src/modules/hooks/hooks.service.ts +0 -28
  55. package/src/modules/hooks/index.ts +0 -11
  56. package/src/modules/id/id.module.ts +0 -26
  57. package/src/modules/id/id.service.ts +0 -57
  58. package/src/modules/id/index.ts +0 -2
  59. package/src/modules/postgres-pubsub/index.ts +0 -3
  60. package/src/modules/postgres-pubsub/postgres-pubsub.module.ts +0 -14
  61. package/src/modules/postgres-pubsub/postgres-pubsub.ts +0 -461
  62. package/src/pagination/constants.ts +0 -9
  63. package/src/pagination/cursor/cursor-pagination.exception.ts +0 -16
  64. package/src/pagination/cursor/cursor-pagination.helpers.ts +0 -145
  65. package/src/pagination/cursor/cursor-pagination.input.ts +0 -96
  66. package/src/pagination/cursor/cursor-pagination.types.ts +0 -127
  67. package/src/pagination/index.ts +0 -9
  68. package/src/pagination/offset/offset-pagination.exception.ts +0 -15
  69. package/src/pagination/offset/offset-pagination.helpers.ts +0 -122
  70. package/src/pagination/offset/offset-pagination.input.ts +0 -30
  71. package/src/pagination/offset/offset-pagination.types.ts +0 -82
  72. package/src/pagination/tools.ts +0 -53
  73. package/src/tools/compose.ts +0 -92
  74. package/src/tools/convert-to-bigint.ts +0 -27
  75. package/src/tools/create-list-meta.ts +0 -64
  76. package/src/tools/define-statuses.ts +0 -15
  77. package/src/tools/env.ts +0 -139
  78. package/src/tools/fetch-total-with-query.ts +0 -48
  79. package/src/tools/generate-entity-id.ts +0 -23
  80. package/src/tools/get-request-language.ts +0 -13
  81. package/src/tools/is-object.ts +0 -1
  82. package/src/tools/postgres/locale-to-pg-collate.ts +0 -21
  83. package/src/tools/remove-undefined-properties.ts +0 -20
  84. package/src/tools/request-id.ts +0 -25
  85. package/src/tools/stringify-opts.ts +0 -20
  86. package/src/tools/typeorm/add-filter.ts +0 -164
  87. package/src/tools/typeorm/ensure-inner-join.ts +0 -36
  88. package/src/tools/typeorm/ensure-left-join.ts +0 -36
  89. package/src/tools/typeorm/is-alias-already-busy.ts +0 -25
  90. package/src/tools/wait.ts +0 -26
  91. package/src/types/express-request.ts +0 -8
  92. package/src/types/list-mehod-options.ts +0 -32
  93. package/src/types/list-meta.ts +0 -16
  94. package/src/types/maybe.ts +0 -2
  95. package/src/validation/index.ts +0 -1
  96. package/src/validation/validation-pipe.ts +0 -14
  97. package/tsconfig.lib.json +0 -9
  98. package/tsdown.config.ts +0 -15
package/src/tools/wait.ts DELETED
@@ -1,26 +0,0 @@
1
- /**
2
- * Pauses execution for a specified amount of time using a Promise.
3
- * @param ms - The amount of time to pause in milliseconds.
4
- * @returns A Promise that resolves after the specified amount of time has elapsed.
5
- * @deprecated use wait instead
6
- */
7
- export const pauseWithPromise = async (ms: number): Promise<void> => {
8
- return await new Promise((resolve) => {
9
- setTimeout(() => {
10
- resolve();
11
- }, ms);
12
- });
13
- };
14
-
15
- /**
16
- * Pauses execution for a specified amount of time using a Promise.
17
- * @param ms - The amount of time to pause in milliseconds.
18
- * @returns A Promise that resolves after the specified amount of time has elapsed.
19
- */
20
- export const wait = async (ms: number): Promise<void> => {
21
- return await new Promise((resolve) => {
22
- setTimeout(() => {
23
- resolve();
24
- }, ms);
25
- });
26
- };
@@ -1,8 +0,0 @@
1
- import { CurrentUser } from '#/context/current-user';
2
- import { Request } from 'express';
3
-
4
- export interface NestExpressRequest extends Request {
5
- appShortname: string;
6
- requestId: string;
7
- user: CurrentUser;
8
- }
@@ -1,32 +0,0 @@
1
- /**
2
- * Options for list method (getMany)
3
- */
4
- export class ListMethodOptions<F, O> {
5
- /**
6
- * List filter options
7
- */
8
- filter!: F;
9
-
10
- /**
11
- * List order options
12
- * @example
13
- * UsersOrderBy.CREATED_AT_DESC = 'createdAt_DESC'
14
- */
15
- orderBy?: O;
16
-
17
- /**
18
- * Limit of items per page
19
- */
20
- limit?: number;
21
-
22
- /**
23
- * Offset of items per page
24
- */
25
- offset?: number;
26
-
27
- /**
28
- * If true, total count will be calculated by additional SELECT COUNT.
29
- * @default true
30
- */
31
- needCountTotal?: boolean;
32
- }
@@ -1,16 +0,0 @@
1
- export interface ListMeta {
2
- /**
3
- * Total count of items
4
- */
5
- total?: number;
6
-
7
- /**
8
- * Count of items in current page
9
- */
10
- limit?: number;
11
-
12
- /**
13
- * Offset of current page
14
- */
15
- offset?: number;
16
- }
@@ -1,2 +0,0 @@
1
- export type Maybe<T> = T | undefined;
2
- export type MaybeNull<T> = T | null;
@@ -1 +0,0 @@
1
- export * from './validation-pipe.js';
@@ -1,14 +0,0 @@
1
- import { InputValidationError } from '#/errors';
2
- import { ValidationError, ValidationPipe } from '@nestjs/common';
3
-
4
- export class NestKitValidationPipe extends ValidationPipe {
5
- createExceptionFactory() {
6
- return (validationErrors: ValidationError[] = []) => {
7
- if (!this.isDetailedOutputDisabled) {
8
- return new InputValidationError(validationErrors);
9
- }
10
-
11
- return new InputValidationError();
12
- };
13
- }
14
- }
package/tsconfig.lib.json DELETED
@@ -1,9 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.base.json",
3
- "compilerOptions": {
4
- "outDir": "../../dist",
5
- "moduleResolution": "bundler",
6
- },
7
- "include": ["src/**/*.ts"],
8
- "exclude": ["node_modules", "dist"],
9
- }
package/tsdown.config.ts DELETED
@@ -1,15 +0,0 @@
1
- import { resolve } from 'node:path';
2
- import { defineConfig } from 'tsdown';
3
-
4
- export default defineConfig({
5
- entry: ['src/index.ts'],
6
- tsconfig: '../../tsconfig.build.json',
7
- outDir: 'dist',
8
- dts: true,
9
- clean: true,
10
- sourcemap: true,
11
- format: 'esm',
12
- alias: {
13
- '#': resolve(import.meta.dirname, 'src'),
14
- },
15
- });