@pcg/core 1.0.0-alpha.0 → 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.
- package/dist/index.d.ts +21 -1189
- package/dist/index.js +76 -1867
- package/dist/index.js.map +1 -1
- package/package.json +16 -3
- package/.turbo/turbo-build.log +0 -15
- package/CHANGELOG.md +0 -7
- package/src/abstracts/index.ts +0 -3
- package/src/abstracts/nestjs-resource-service.ts +0 -154
- package/src/abstracts/nestjs-service.ts +0 -25
- package/src/configs/app.config.ts +0 -185
- package/src/configs/db.config.ts +0 -122
- package/src/configs/index.ts +0 -4
- package/src/configs/logger.config.ts +0 -62
- package/src/context/action-context.ts +0 -34
- package/src/context/current-user.ts +0 -49
- package/src/context/index.ts +0 -5
- package/src/context/platform-method-context.ts +0 -5
- package/src/context/service-method-context.ts +0 -47
- package/src/db/snake-naming.strategy.ts +0 -277
- package/src/enums/app-env.enum.ts +0 -36
- package/src/enums/app-mode.enum.ts +0 -5
- package/src/enums/app-server.enum.ts +0 -39
- package/src/enums/index.ts +0 -4
- package/src/enums/worker-mode.enum.ts +0 -11
- package/src/errors/access-denied.error.ts +0 -18
- package/src/errors/bad-request.error.ts +0 -9
- package/src/errors/forbidden.error.ts +0 -9
- package/src/errors/index.ts +0 -8
- package/src/errors/input-validation.error.ts +0 -16
- package/src/errors/nest-error.filter.ts +0 -70
- package/src/errors/nest-error.ts +0 -63
- package/src/errors/not-found.error.ts +0 -9
- package/src/errors/unauthorized.error.ts +0 -9
- package/src/exceptions/http-exception-response.ts +0 -34
- package/src/exceptions/http-exceptions.filter.ts +0 -95
- package/src/index.ts +0 -32
- package/src/jwt/extractors.ts +0 -80
- package/src/jwt/types.ts +0 -209
- package/src/logger/classes/logger-factory.ts +0 -54
- package/src/logger/classes/logger.ts +0 -340
- package/src/logger/classes/nest-system-logger.ts +0 -63
- package/src/logger/classes/typeorm-logger.ts +0 -83
- package/src/logger/index.ts +0 -20
- package/src/logger/logger.constants.ts +0 -24
- package/src/logger/logger.interfaces.ts +0 -98
- package/src/logger/logger.module.ts +0 -45
- package/src/logger/logger.providers.ts +0 -140
- package/src/logger/winston.tools.ts +0 -241
- package/src/middlewares/app.middleware.ts +0 -26
- package/src/middlewares/index.ts +0 -1
- package/src/modules/hooks/base-hook.ts +0 -64
- package/src/modules/hooks/decorators/on-hook.decorator.ts +0 -19
- package/src/modules/hooks/hooks.module.ts +0 -10
- package/src/modules/hooks/hooks.service.ts +0 -28
- package/src/modules/hooks/index.ts +0 -11
- package/src/modules/id/id.module.ts +0 -26
- package/src/modules/id/id.service.ts +0 -57
- package/src/modules/id/index.ts +0 -2
- package/src/modules/postgres-pubsub/index.ts +0 -3
- package/src/modules/postgres-pubsub/postgres-pubsub.module.ts +0 -14
- package/src/modules/postgres-pubsub/postgres-pubsub.ts +0 -461
- package/src/pagination/constants.ts +0 -9
- package/src/pagination/cursor/cursor-pagination.exception.ts +0 -16
- package/src/pagination/cursor/cursor-pagination.helpers.ts +0 -145
- package/src/pagination/cursor/cursor-pagination.input.ts +0 -96
- package/src/pagination/cursor/cursor-pagination.types.ts +0 -127
- package/src/pagination/index.ts +0 -9
- package/src/pagination/offset/offset-pagination.exception.ts +0 -15
- package/src/pagination/offset/offset-pagination.helpers.ts +0 -122
- package/src/pagination/offset/offset-pagination.input.ts +0 -30
- package/src/pagination/offset/offset-pagination.types.ts +0 -82
- package/src/pagination/tools.ts +0 -53
- package/src/tools/compose.ts +0 -92
- package/src/tools/convert-to-bigint.ts +0 -27
- package/src/tools/create-list-meta.ts +0 -64
- package/src/tools/define-statuses.ts +0 -15
- package/src/tools/env.ts +0 -139
- package/src/tools/fetch-total-with-query.ts +0 -48
- package/src/tools/generate-entity-id.ts +0 -23
- package/src/tools/get-request-language.ts +0 -13
- package/src/tools/is-object.ts +0 -10
- package/src/tools/postgres/locale-to-pg-collate.ts +0 -21
- package/src/tools/remove-undefined-properties.ts +0 -20
- package/src/tools/request-id.ts +0 -25
- package/src/tools/stringify-opts.ts +0 -20
- package/src/tools/typeorm/add-filter.ts +0 -164
- package/src/tools/typeorm/ensure-inner-join.ts +0 -36
- package/src/tools/typeorm/ensure-left-join.ts +0 -36
- package/src/tools/typeorm/is-alias-already-busy.ts +0 -25
- package/src/tools/wait.ts +0 -26
- package/src/types/express-request.ts +0 -8
- package/src/types/list-mehod-options.ts +0 -32
- package/src/types/list-meta.ts +0 -16
- package/src/types/maybe.ts +0 -2
- package/src/validation/index.ts +0 -1
- package/src/validation/validation-pipe.ts +0 -14
- package/tsconfig.lib.json +0 -9
- 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,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
|
-
}
|
package/src/types/list-meta.ts
DELETED
package/src/types/maybe.ts
DELETED
package/src/validation/index.ts
DELETED
|
@@ -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
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
|
-
});
|