@nest-omni/core 1.0.10 → 1.0.12
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.js → index.js} +1 -0
- package/package.json +20 -19
- package/validator-json/decorators.d.ts +6 -0
- package/validator-json/decorators.js +23 -0
- package/validator-json/default.d.ts +6 -0
- package/validator-json/default.js +130 -0
- package/validator-json/defaultConverters.d.ts +8 -0
- package/validator-json/defaultConverters.js +376 -0
- package/validator-json/index.d.ts +4 -0
- package/validator-json/index.js +20 -0
- package/validator-json/options.d.ts +11 -0
- package/validator-json/options.js +10 -0
- package/dist/boilerplate.polyfill.d.ts +0 -39
- package/dist/boilerplate.polyfill.js +0 -77
- package/dist/index.d.ts +0 -13
- package/dist/snake-naming.strategy.d.ts +0 -11
- package/dist/snake-naming.strategy.js +0 -37
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/types.d.ts +0 -9
- package/dist/types.js +0 -2
- /package/{dist/common → common}/abstract-client.service.d.ts +0 -0
- /package/{dist/common → common}/abstract-client.service.js +0 -0
- /package/{dist/common → common}/abstract.entity.d.ts +0 -0
- /package/{dist/common → common}/abstract.entity.js +0 -0
- /package/{dist/common → common}/dto/abstract.dto.d.ts +0 -0
- /package/{dist/common → common}/dto/abstract.dto.js +0 -0
- /package/{dist/common → common}/dto/bulk-id.dto.d.ts +0 -0
- /package/{dist/common → common}/dto/bulk-id.dto.js +0 -0
- /package/{dist/common → common}/dto/create-translation.dto.d.ts +0 -0
- /package/{dist/common → common}/dto/create-translation.dto.js +0 -0
- /package/{dist/common → common}/dto/index.d.ts +0 -0
- /package/{dist/common → common}/dto/index.js +0 -0
- /package/{dist/common → common}/dto/page-meta.dto.d.ts +0 -0
- /package/{dist/common → common}/dto/page-meta.dto.js +0 -0
- /package/{dist/common → common}/dto/page-options.dto.d.ts +0 -0
- /package/{dist/common → common}/dto/page-options.dto.js +0 -0
- /package/{dist/common → common}/dto/page.dto.d.ts +0 -0
- /package/{dist/common → common}/dto/page.dto.js +0 -0
- /package/{dist/common → common}/index.d.ts +0 -0
- /package/{dist/common → common}/index.js +0 -0
- /package/{dist/common → common}/utils.d.ts +0 -0
- /package/{dist/common → common}/utils.js +0 -0
- /package/{dist/constants → constants}/index.d.ts +0 -0
- /package/{dist/constants → constants}/index.js +0 -0
- /package/{dist/constants → constants}/language-code.d.ts +0 -0
- /package/{dist/constants → constants}/language-code.js +0 -0
- /package/{dist/constants → constants}/order.d.ts +0 -0
- /package/{dist/constants → constants}/order.js +0 -0
- /package/{dist/decorators → decorators}/api-page-ok-response.decorator.d.ts +0 -0
- /package/{dist/decorators → decorators}/api-page-ok-response.decorator.js +0 -0
- /package/{dist/decorators → decorators}/auth-user.decorator.d.ts +0 -0
- /package/{dist/decorators → decorators}/auth-user.decorator.js +0 -0
- /package/{dist/decorators → decorators}/controller.decorator.d.ts +0 -0
- /package/{dist/decorators → decorators}/controller.decorator.js +0 -0
- /package/{dist/decorators → decorators}/field.decorators.d.ts +0 -0
- /package/{dist/decorators → decorators}/field.decorators.js +0 -0
- /package/{dist/decorators → decorators}/http.decorators.d.ts +0 -0
- /package/{dist/decorators → decorators}/http.decorators.js +0 -0
- /package/{dist/decorators → decorators}/index.d.ts +0 -0
- /package/{dist/decorators → decorators}/index.js +0 -0
- /package/{dist/decorators → decorators}/omni-auth.decorator.d.ts +0 -0
- /package/{dist/decorators → decorators}/omni-auth.decorator.js +0 -0
- /package/{dist/decorators → decorators}/operation.decorator.d.ts +0 -0
- /package/{dist/decorators → decorators}/operation.decorator.js +0 -0
- /package/{dist/decorators → decorators}/property.decorators.d.ts +0 -0
- /package/{dist/decorators → decorators}/property.decorators.js +0 -0
- /package/{dist/decorators → decorators}/public-route.decorator.d.ts +0 -0
- /package/{dist/decorators → decorators}/public-route.decorator.js +0 -0
- /package/{dist/decorators → decorators}/swagger.schema.d.ts +0 -0
- /package/{dist/decorators → decorators}/swagger.schema.js +0 -0
- /package/{dist/decorators → decorators}/timestamp-column.decorator.d.ts +0 -0
- /package/{dist/decorators → decorators}/timestamp-column.decorator.js +0 -0
- /package/{dist/decorators → decorators}/transform.decorators.d.ts +0 -0
- /package/{dist/decorators → decorators}/transform.decorators.js +0 -0
- /package/{dist/decorators → decorators}/translate.decorator.d.ts +0 -0
- /package/{dist/decorators → decorators}/translate.decorator.js +0 -0
- /package/{dist/decorators → decorators}/use-dto.decorator.d.ts +0 -0
- /package/{dist/decorators → decorators}/use-dto.decorator.js +0 -0
- /package/{dist/decorators → decorators}/user-check.decorator.d.ts +0 -0
- /package/{dist/decorators → decorators}/user-check.decorator.js +0 -0
- /package/{dist/decorators → decorators}/user.decorator.d.ts +0 -0
- /package/{dist/decorators → decorators}/user.decorator.js +0 -0
- /package/{dist/decorators → decorators}/user_auth.decorator.d.ts +0 -0
- /package/{dist/decorators → decorators}/user_auth.decorator.js +0 -0
- /package/{dist/decorators → decorators}/validator.decorators.d.ts +0 -0
- /package/{dist/decorators → decorators}/validator.decorators.js +0 -0
- /package/{dist/exceptions → exceptions}/file-not-image.exception.d.ts +0 -0
- /package/{dist/exceptions → exceptions}/file-not-image.exception.js +0 -0
- /package/{dist/exceptions → exceptions}/index.d.ts +0 -0
- /package/{dist/exceptions → exceptions}/index.js +0 -0
- /package/{dist/exceptions → exceptions}/page-type.exception.d.ts +0 -0
- /package/{dist/exceptions → exceptions}/page-type.exception.js +0 -0
- /package/{dist/exceptions → exceptions}/user-not-found.exception.d.ts +0 -0
- /package/{dist/exceptions → exceptions}/user-not-found.exception.js +0 -0
- /package/{dist/filters → filters}/bad-request.filter.d.ts +0 -0
- /package/{dist/filters → filters}/bad-request.filter.js +0 -0
- /package/{dist/filters → filters}/constraint-errors.d.ts +0 -0
- /package/{dist/filters → filters}/constraint-errors.js +0 -0
- /package/{dist/filters → filters}/index.d.ts +0 -0
- /package/{dist/filters → filters}/index.js +0 -0
- /package/{dist/filters → filters}/query-failed.filter.d.ts +0 -0
- /package/{dist/filters → filters}/query-failed.filter.js +0 -0
- /package/{dist/health-checker → health-checker}/health-checker.controller.d.ts +0 -0
- /package/{dist/health-checker → health-checker}/health-checker.controller.js +0 -0
- /package/{dist/health-checker → health-checker}/health-checker.module.d.ts +0 -0
- /package/{dist/health-checker → health-checker}/health-checker.module.js +0 -0
- /package/{dist/health-checker → health-checker}/health-indicators/service.indicator.d.ts +0 -0
- /package/{dist/health-checker → health-checker}/health-indicators/service.indicator.js +0 -0
- /package/{dist/helpers → helpers}/common.helper.d.ts +0 -0
- /package/{dist/helpers → helpers}/common.helper.js +0 -0
- /package/{dist/helpers → helpers}/date.helper.d.ts +0 -0
- /package/{dist/helpers → helpers}/date.helper.js +0 -0
- /package/{dist/helpers → helpers}/index.d.ts +0 -0
- /package/{dist/helpers → helpers}/index.js +0 -0
- /package/{dist/i18n → i18n}/en_US/validation.json +0 -0
- /package/{dist/i18n → i18n}/zh_CN/validation.json +0 -0
- /package/{dist/interceptors → interceptors}/auth-user.interceptor.d.ts +0 -0
- /package/{dist/interceptors → interceptors}/auth-user.interceptor.js +0 -0
- /package/{dist/interceptors → interceptors}/index.d.ts +0 -0
- /package/{dist/interceptors → interceptors}/index.js +0 -0
- /package/{dist/interceptors → interceptors}/language-interceptor.service.d.ts +0 -0
- /package/{dist/interceptors → interceptors}/language-interceptor.service.js +0 -0
- /package/{dist/interceptors → interceptors}/translation-interceptor.service.d.ts +0 -0
- /package/{dist/interceptors → interceptors}/translation-interceptor.service.js +0 -0
- /package/{dist/interfaces → interfaces}/IApiFile.d.ts +0 -0
- /package/{dist/interfaces → interfaces}/IApiFile.js +0 -0
- /package/{dist/interfaces → interfaces}/IFile.d.ts +0 -0
- /package/{dist/interfaces → interfaces}/IFile.js +0 -0
- /package/{dist/interfaces → interfaces}/ITranslationDecoratorInterface.d.ts +0 -0
- /package/{dist/interfaces → interfaces}/ITranslationDecoratorInterface.js +0 -0
- /package/{dist/interfaces → interfaces}/index.d.ts +0 -0
- /package/{dist/interfaces → interfaces}/index.js +0 -0
- /package/{dist/interfaces → interfaces}/response.d.ts +0 -0
- /package/{dist/interfaces → interfaces}/response.js +0 -0
- /package/{dist/middlewares → middlewares}/index.d.ts +0 -0
- /package/{dist/middlewares → middlewares}/index.js +0 -0
- /package/{dist/middlewares → middlewares}/omni-auth.middleware.d.ts +0 -0
- /package/{dist/middlewares → middlewares}/omni-auth.middleware.js +0 -0
- /package/{dist/middlewares → middlewares}/powerby.middleware.d.ts +0 -0
- /package/{dist/middlewares → middlewares}/powerby.middleware.js +0 -0
- /package/{dist/middlewares → middlewares}/request-id.middleware.d.ts +0 -0
- /package/{dist/middlewares → middlewares}/request-id.middleware.js +0 -0
- /package/{dist/providers → providers}/context.provider.d.ts +0 -0
- /package/{dist/providers → providers}/context.provider.js +0 -0
- /package/{dist/providers → providers}/generator.provider.d.ts +0 -0
- /package/{dist/providers → providers}/generator.provider.js +0 -0
- /package/{dist/providers → providers}/index.d.ts +0 -0
- /package/{dist/providers → providers}/index.js +0 -0
- /package/{dist/setup → setup}/bootstrap.setup.d.ts +0 -0
- /package/{dist/setup → setup}/bootstrap.setup.js +0 -0
- /package/{dist/setup → setup}/index.d.ts +0 -0
- /package/{dist/setup → setup}/index.js +0 -0
- /package/{dist/shared → shared}/index.d.ts +0 -0
- /package/{dist/shared → shared}/index.js +0 -0
- /package/{dist/shared → shared}/serviceRegistryModule.d.ts +0 -0
- /package/{dist/shared → shared}/serviceRegistryModule.js +0 -0
- /package/{dist/shared → shared}/services/api-config.service.d.ts +0 -0
- /package/{dist/shared → shared}/services/api-config.service.js +0 -0
- /package/{dist/shared → shared}/services/aws-s3.service.d.ts +0 -0
- /package/{dist/shared → shared}/services/aws-s3.service.js +0 -0
- /package/{dist/shared → shared}/services/generator.service.d.ts +0 -0
- /package/{dist/shared → shared}/services/generator.service.js +0 -0
- /package/{dist/shared → shared}/services/index.d.ts +0 -0
- /package/{dist/shared → shared}/services/index.js +0 -0
- /package/{dist/shared → shared}/services/translation.service.d.ts +0 -0
- /package/{dist/shared → shared}/services/translation.service.js +0 -0
- /package/{dist/shared → shared}/services/validator.service.d.ts +0 -0
- /package/{dist/shared → shared}/services/validator.service.js +0 -0
- /package/{dist/validators → validators}/file-mimetype.validator.d.ts +0 -0
- /package/{dist/validators → validators}/file-mimetype.validator.js +0 -0
- /package/{dist/validators → validators}/index.d.ts +0 -0
- /package/{dist/validators → validators}/index.js +0 -0
- /package/{dist/validators → validators}/is-exists.validator.d.ts +0 -0
- /package/{dist/validators → validators}/is-exists.validator.js +0 -0
- /package/{dist/validators → validators}/is-unique.validator.d.ts +0 -0
- /package/{dist/validators → validators}/is-unique.validator.js +0 -0
- /package/{dist/validators → validators}/phone-country-code.validator.d.ts +0 -0
- /package/{dist/validators → validators}/phone-country-code.validator.js +0 -0
- /package/{dist/validators → validators}/same-as.validator.d.ts +0 -0
- /package/{dist/validators → validators}/same-as.validator.js +0 -0
- /package/{dist/validators → validators}/skip-empty.validator.d.ts +0 -0
- /package/{dist/validators → validators}/skip-empty.validator.js +0 -0
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import 'source-map-support/register';
|
|
2
|
-
import type { ObjectLiteral } from 'typeorm';
|
|
3
|
-
import type { AbstractEntity } from './common/abstract.entity';
|
|
4
|
-
import type { AbstractDto } from './common/dto/abstract.dto';
|
|
5
|
-
import type { CreateTranslationDto } from './common/dto/create-translation.dto';
|
|
6
|
-
import { PageDto } from './common/dto/page.dto';
|
|
7
|
-
import { PageMetaDto } from './common/dto/page-meta.dto';
|
|
8
|
-
import type { PageOptionsDto } from './common/dto/page-options.dto';
|
|
9
|
-
import type { LanguageCode } from './constants/language-code';
|
|
10
|
-
import type { KeyOfType } from './types';
|
|
11
|
-
declare global {
|
|
12
|
-
export type Uuid = string & {
|
|
13
|
-
_uuidBrand: undefined;
|
|
14
|
-
};
|
|
15
|
-
export type Todo = any & {
|
|
16
|
-
_todoBrand: undefined;
|
|
17
|
-
};
|
|
18
|
-
interface Array<T> {
|
|
19
|
-
toDtos<Dto extends AbstractDto>(this: T[], options?: unknown): Dto[];
|
|
20
|
-
getByLanguage(this: CreateTranslationDto[], languageCode: LanguageCode): string;
|
|
21
|
-
toPageDto<Dto extends AbstractDto>(this: T[], pageMetaDto: PageMetaDto, options?: unknown): PageDto<Dto>;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
declare module 'typeorm' {
|
|
25
|
-
interface SelectQueryBuilder<Entity> {
|
|
26
|
-
searchByString(q: string, columnNames: string[], options?: {
|
|
27
|
-
formStart: boolean;
|
|
28
|
-
}): this;
|
|
29
|
-
withTenant(tenantId?: string | number, tenantFieldName?: string): this;
|
|
30
|
-
paginate(this: SelectQueryBuilder<Entity>, pageOptionsDto: PageOptionsDto, options?: Partial<{
|
|
31
|
-
takeAll: boolean;
|
|
32
|
-
skipCount: boolean;
|
|
33
|
-
}>): Promise<[Entity[], PageMetaDto]>;
|
|
34
|
-
leftJoinAndSelect<AliasEntity extends AbstractEntity, A extends string>(this: SelectQueryBuilder<Entity>, property: `${A}.${Exclude<KeyOfType<AliasEntity, AbstractEntity>, symbol>}`, alias: string, condition?: string, parameters?: ObjectLiteral): this;
|
|
35
|
-
leftJoin<AliasEntity extends AbstractEntity, A extends string>(this: SelectQueryBuilder<Entity>, property: `${A}.${Exclude<KeyOfType<AliasEntity, AbstractEntity>, symbol>}`, alias: string, condition?: string, parameters?: ObjectLiteral): this;
|
|
36
|
-
innerJoinAndSelect<AliasEntity extends AbstractEntity, A extends string>(this: SelectQueryBuilder<Entity>, property: `${A}.${Exclude<KeyOfType<AliasEntity, AbstractEntity>, symbol>}`, alias: string, condition?: string, parameters?: ObjectLiteral): this;
|
|
37
|
-
innerJoin<AliasEntity extends AbstractEntity, A extends string>(this: SelectQueryBuilder<Entity>, property: `${A}.${Exclude<KeyOfType<AliasEntity, AbstractEntity>, symbol>}`, alias: string, condition?: string, parameters?: ObjectLiteral): this;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
require("source-map-support/register");
|
|
13
|
-
const lodash_1 = require("lodash");
|
|
14
|
-
const typeorm_1 = require("typeorm");
|
|
15
|
-
const page_dto_1 = require("./common/dto/page.dto");
|
|
16
|
-
const page_meta_dto_1 = require("./common/dto/page-meta.dto");
|
|
17
|
-
const providers_1 = require("./providers");
|
|
18
|
-
Array.prototype.toDtos = function (options) {
|
|
19
|
-
return (0, lodash_1.compact)((0, lodash_1.map)(this, (item) => item.toDto(options)));
|
|
20
|
-
};
|
|
21
|
-
Array.prototype.getByLanguage = function (languageCode) {
|
|
22
|
-
return this.find((translation) => languageCode === translation.languageCode)
|
|
23
|
-
.text;
|
|
24
|
-
};
|
|
25
|
-
Array.prototype.toPageDto = function (pageMetaDto, options) {
|
|
26
|
-
return new page_dto_1.PageDto(this.toDtos(options), pageMetaDto);
|
|
27
|
-
};
|
|
28
|
-
typeorm_1.SelectQueryBuilder.prototype.searchByString = function (q, columnNames, options) {
|
|
29
|
-
if (!q) {
|
|
30
|
-
return this;
|
|
31
|
-
}
|
|
32
|
-
this.andWhere(new typeorm_1.Brackets((qb) => {
|
|
33
|
-
for (const item of columnNames) {
|
|
34
|
-
qb.orWhere(`${item} ILIKE :q`);
|
|
35
|
-
}
|
|
36
|
-
}));
|
|
37
|
-
if (options === null || options === void 0 ? void 0 : options.formStart) {
|
|
38
|
-
this.setParameter('q', `${q}%`);
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
this.setParameter('q', `%${q}%`);
|
|
42
|
-
}
|
|
43
|
-
return this;
|
|
44
|
-
};
|
|
45
|
-
typeorm_1.SelectQueryBuilder.prototype.paginate = function (pageOptionsDto, options) {
|
|
46
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
-
if (!(options === null || options === void 0 ? void 0 : options.takeAll)) {
|
|
48
|
-
this.skip(pageOptionsDto.skip).take(pageOptionsDto.pageSize);
|
|
49
|
-
}
|
|
50
|
-
const entities = yield this.getMany();
|
|
51
|
-
let itemCount = -1;
|
|
52
|
-
if (!(options === null || options === void 0 ? void 0 : options.skipCount)) {
|
|
53
|
-
itemCount = yield this.getCount();
|
|
54
|
-
}
|
|
55
|
-
const pageMetaDto = new page_meta_dto_1.PageMetaDto({
|
|
56
|
-
itemCount,
|
|
57
|
-
pageOptionsDto,
|
|
58
|
-
});
|
|
59
|
-
return [entities, pageMetaDto];
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
typeorm_1.SelectQueryBuilder.prototype.withTenant = function (tenantId, tenantFieldName = 'tenantId') {
|
|
63
|
-
var _a;
|
|
64
|
-
if (!tenantId) {
|
|
65
|
-
tenantId = providers_1.ContextProvider.getTenantId();
|
|
66
|
-
}
|
|
67
|
-
if (this.expressionMap.mainAlias.hasMetadata) {
|
|
68
|
-
const entityMetadata = this.expressionMap.mainAlias.metadata;
|
|
69
|
-
const columnName = (_a = entityMetadata.columns.find((column) => column.propertyName === tenantFieldName)) === null || _a === void 0 ? void 0 : _a.databaseName;
|
|
70
|
-
if (columnName) {
|
|
71
|
-
return this.andWhere(`${this.alias}.${columnName} = :tenantId`, {
|
|
72
|
-
tenantId,
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
return this;
|
|
77
|
-
};
|
package/dist/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export * from './constants';
|
|
2
|
-
export * from './decorators';
|
|
3
|
-
export * from './exceptions';
|
|
4
|
-
export * from './filters';
|
|
5
|
-
export * from './interfaces';
|
|
6
|
-
export * from './interceptors';
|
|
7
|
-
export * from './shared';
|
|
8
|
-
export * from './types';
|
|
9
|
-
export * from './snake-naming.strategy';
|
|
10
|
-
export * from './boilerplate.polyfill';
|
|
11
|
-
export * from './middlewares';
|
|
12
|
-
export * from './validators';
|
|
13
|
-
export * from './common';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { NamingStrategyInterface } from 'typeorm';
|
|
2
|
-
import { DefaultNamingStrategy } from 'typeorm';
|
|
3
|
-
export declare class SnakeNamingStrategy extends DefaultNamingStrategy implements NamingStrategyInterface {
|
|
4
|
-
tableName(className: string, customName: string | undefined): string;
|
|
5
|
-
columnName(propertyName: string, customName: string | undefined, embeddedPrefixes: string[]): string;
|
|
6
|
-
relationName(propertyName: string): string;
|
|
7
|
-
joinColumnName(relationName: string, referencedColumnName: string): string;
|
|
8
|
-
joinTableName(firstTableName: string, secondTableName: string, firstPropertyName: string, _secondPropertyName: string): string;
|
|
9
|
-
joinTableColumnName(tableName: string, propertyName: string, columnName?: string): string;
|
|
10
|
-
classTableInheritanceParentColumnName(parentTableName: string, parentTableIdPropertyName: string): string;
|
|
11
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SnakeNamingStrategy = void 0;
|
|
4
|
-
const typeorm_1 = require("typeorm");
|
|
5
|
-
const StringUtils_1 = require("typeorm/util/StringUtils");
|
|
6
|
-
class SnakeNamingStrategy extends typeorm_1.DefaultNamingStrategy {
|
|
7
|
-
tableName(className, customName) {
|
|
8
|
-
if (className.includes('Entity')) {
|
|
9
|
-
className = className.replace('Entity', '');
|
|
10
|
-
}
|
|
11
|
-
return customName !== null && customName !== void 0 ? customName : (0, StringUtils_1.snakeCase)(className);
|
|
12
|
-
}
|
|
13
|
-
columnName(propertyName, customName, embeddedPrefixes) {
|
|
14
|
-
return ((0, StringUtils_1.snakeCase)(embeddedPrefixes.join('_')) +
|
|
15
|
-
(customName !== null && customName !== void 0 ? customName : (0, StringUtils_1.snakeCase)(propertyName)));
|
|
16
|
-
}
|
|
17
|
-
relationName(propertyName) {
|
|
18
|
-
return (0, StringUtils_1.snakeCase)(propertyName);
|
|
19
|
-
}
|
|
20
|
-
joinColumnName(relationName, referencedColumnName) {
|
|
21
|
-
return (0, StringUtils_1.snakeCase)(relationName + '_' + referencedColumnName);
|
|
22
|
-
}
|
|
23
|
-
joinTableName(firstTableName, secondTableName, firstPropertyName, _secondPropertyName) {
|
|
24
|
-
return (0, StringUtils_1.snakeCase)(firstTableName +
|
|
25
|
-
'_' +
|
|
26
|
-
firstPropertyName.replace(/\./gi, '_') +
|
|
27
|
-
'_' +
|
|
28
|
-
secondTableName);
|
|
29
|
-
}
|
|
30
|
-
joinTableColumnName(tableName, propertyName, columnName) {
|
|
31
|
-
return (0, StringUtils_1.snakeCase)(tableName + '_' + (columnName !== null && columnName !== void 0 ? columnName : propertyName));
|
|
32
|
-
}
|
|
33
|
-
classTableInheritanceParentColumnName(parentTableName, parentTableIdPropertyName) {
|
|
34
|
-
return (0, StringUtils_1.snakeCase)(`${parentTableName}_${parentTableIdPropertyName}`);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
exports.SnakeNamingStrategy = SnakeNamingStrategy;
|