@os.io/nest-kit 0.0.1-alpha.0 → 0.0.1-alpha.1
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/README.md +30 -30
- package/package.json +41 -5
- package/dist/auth/auth.constants.d.ts +0 -19
- package/dist/auth/auth.constants.d.ts.map +0 -1
- package/dist/auth/auth.constants.js +0 -19
- package/dist/auth/auth.constants.js.map +0 -1
- package/dist/auth/auth.guard.d.ts +0 -20
- package/dist/auth/auth.guard.d.ts.map +0 -1
- package/dist/auth/auth.guard.js +0 -84
- package/dist/auth/auth.guard.js.map +0 -1
- package/dist/auth/auth.module.d.ts +0 -26
- package/dist/auth/auth.module.d.ts.map +0 -1
- package/dist/auth/auth.module.js +0 -344
- package/dist/auth/auth.module.js.map +0 -1
- package/dist/auth/auth.options.d.ts +0 -179
- package/dist/auth/auth.options.d.ts.map +0 -1
- package/dist/auth/auth.options.js +0 -2
- package/dist/auth/auth.options.js.map +0 -1
- package/dist/auth/auth.service.d.ts +0 -57
- package/dist/auth/auth.service.d.ts.map +0 -1
- package/dist/auth/auth.service.js +0 -175
- package/dist/auth/auth.service.js.map +0 -1
- package/dist/auth/authorization/index.d.ts +0 -3
- package/dist/auth/authorization/index.d.ts.map +0 -1
- package/dist/auth/authorization/index.js +0 -3
- package/dist/auth/authorization/index.js.map +0 -1
- package/dist/auth/authorization/pbac/index.d.ts +0 -6
- package/dist/auth/authorization/pbac/index.d.ts.map +0 -1
- package/dist/auth/authorization/pbac/index.js +0 -4
- package/dist/auth/authorization/pbac/index.js.map +0 -1
- package/dist/auth/authorization/pbac/pbac.decorator.d.ts +0 -18
- package/dist/auth/authorization/pbac/pbac.decorator.d.ts.map +0 -1
- package/dist/auth/authorization/pbac/pbac.decorator.js +0 -14
- package/dist/auth/authorization/pbac/pbac.decorator.js.map +0 -1
- package/dist/auth/authorization/pbac/pbac.guard.d.ts +0 -19
- package/dist/auth/authorization/pbac/pbac.guard.d.ts.map +0 -1
- package/dist/auth/authorization/pbac/pbac.guard.js +0 -60
- package/dist/auth/authorization/pbac/pbac.guard.js.map +0 -1
- package/dist/auth/authorization/pbac/pbac.service.d.ts +0 -44
- package/dist/auth/authorization/pbac/pbac.service.d.ts.map +0 -1
- package/dist/auth/authorization/pbac/pbac.service.js +0 -146
- package/dist/auth/authorization/pbac/pbac.service.js.map +0 -1
- package/dist/auth/authorization/pbac/pbac.types.d.ts +0 -47
- package/dist/auth/authorization/pbac/pbac.types.d.ts.map +0 -1
- package/dist/auth/authorization/pbac/pbac.types.js +0 -2
- package/dist/auth/authorization/pbac/pbac.types.js.map +0 -1
- package/dist/auth/authorization/rbac/index.d.ts +0 -4
- package/dist/auth/authorization/rbac/index.d.ts.map +0 -1
- package/dist/auth/authorization/rbac/index.js +0 -4
- package/dist/auth/authorization/rbac/index.js.map +0 -1
- package/dist/auth/authorization/rbac/rbac.decorator.d.ts +0 -18
- package/dist/auth/authorization/rbac/rbac.decorator.d.ts.map +0 -1
- package/dist/auth/authorization/rbac/rbac.decorator.js +0 -25
- package/dist/auth/authorization/rbac/rbac.decorator.js.map +0 -1
- package/dist/auth/authorization/rbac/rbac.guard.d.ts +0 -19
- package/dist/auth/authorization/rbac/rbac.guard.d.ts.map +0 -1
- package/dist/auth/authorization/rbac/rbac.guard.js +0 -50
- package/dist/auth/authorization/rbac/rbac.guard.js.map +0 -1
- package/dist/auth/authorization/rbac/rbac.service.d.ts +0 -43
- package/dist/auth/authorization/rbac/rbac.service.d.ts.map +0 -1
- package/dist/auth/authorization/rbac/rbac.service.js +0 -95
- package/dist/auth/authorization/rbac/rbac.service.js.map +0 -1
- package/dist/auth/decorators/current-user.decorator.d.ts +0 -17
- package/dist/auth/decorators/current-user.decorator.d.ts.map +0 -1
- package/dist/auth/decorators/current-user.decorator.js +0 -23
- package/dist/auth/decorators/current-user.decorator.js.map +0 -1
- package/dist/auth/decorators/index.d.ts +0 -3
- package/dist/auth/decorators/index.d.ts.map +0 -1
- package/dist/auth/decorators/index.js +0 -3
- package/dist/auth/decorators/index.js.map +0 -1
- package/dist/auth/decorators/public.decorator.d.ts +0 -13
- package/dist/auth/decorators/public.decorator.d.ts.map +0 -1
- package/dist/auth/decorators/public.decorator.js +0 -15
- package/dist/auth/decorators/public.decorator.js.map +0 -1
- package/dist/auth/index.d.ts +0 -63
- package/dist/auth/index.d.ts.map +0 -1
- package/dist/auth/index.js +0 -65
- package/dist/auth/index.js.map +0 -1
- package/dist/auth/interfaces/auth-request.interface.d.ts +0 -18
- package/dist/auth/interfaces/auth-request.interface.d.ts.map +0 -1
- package/dist/auth/interfaces/auth-request.interface.js +0 -2
- package/dist/auth/interfaces/auth-request.interface.js.map +0 -1
- package/dist/auth/interfaces/auth-result.interface.d.ts +0 -28
- package/dist/auth/interfaces/auth-result.interface.d.ts.map +0 -1
- package/dist/auth/interfaces/auth-result.interface.js +0 -2
- package/dist/auth/interfaces/auth-result.interface.js.map +0 -1
- package/dist/auth/interfaces/auth-strategy.interface.d.ts +0 -37
- package/dist/auth/interfaces/auth-strategy.interface.d.ts.map +0 -1
- package/dist/auth/interfaces/auth-strategy.interface.js +0 -16
- package/dist/auth/interfaces/auth-strategy.interface.js.map +0 -1
- package/dist/auth/interfaces/auth-user.interface.d.ts +0 -25
- package/dist/auth/interfaces/auth-user.interface.d.ts.map +0 -1
- package/dist/auth/interfaces/auth-user.interface.js +0 -2
- package/dist/auth/interfaces/auth-user.interface.js.map +0 -1
- package/dist/auth/interfaces/cache-service.interface.d.ts +0 -30
- package/dist/auth/interfaces/cache-service.interface.d.ts.map +0 -1
- package/dist/auth/interfaces/cache-service.interface.js +0 -2
- package/dist/auth/interfaces/cache-service.interface.js.map +0 -1
- package/dist/auth/interfaces/index.d.ts +0 -8
- package/dist/auth/interfaces/index.d.ts.map +0 -1
- package/dist/auth/interfaces/index.js +0 -2
- package/dist/auth/interfaces/index.js.map +0 -1
- package/dist/auth/interfaces/user-service.interface.d.ts +0 -34
- package/dist/auth/interfaces/user-service.interface.d.ts.map +0 -1
- package/dist/auth/interfaces/user-service.interface.js +0 -2
- package/dist/auth/interfaces/user-service.interface.js.map +0 -1
- package/dist/auth/password/password.service.d.ts +0 -23
- package/dist/auth/password/password.service.d.ts.map +0 -1
- package/dist/auth/password/password.service.js +0 -52
- package/dist/auth/password/password.service.js.map +0 -1
- package/dist/auth/session/device-session.service.d.ts +0 -43
- package/dist/auth/session/device-session.service.d.ts.map +0 -1
- package/dist/auth/session/device-session.service.js +0 -72
- package/dist/auth/session/device-session.service.js.map +0 -1
- package/dist/auth/session/index.d.ts +0 -5
- package/dist/auth/session/index.d.ts.map +0 -1
- package/dist/auth/session/index.js +0 -4
- package/dist/auth/session/index.js.map +0 -1
- package/dist/auth/session/jwt.service.d.ts +0 -37
- package/dist/auth/session/jwt.service.d.ts.map +0 -1
- package/dist/auth/session/jwt.service.js +0 -119
- package/dist/auth/session/jwt.service.js.map +0 -1
- package/dist/auth/session/token-blacklist.service.d.ts +0 -37
- package/dist/auth/session/token-blacklist.service.d.ts.map +0 -1
- package/dist/auth/session/token-blacklist.service.js +0 -70
- package/dist/auth/session/token-blacklist.service.js.map +0 -1
- package/dist/auth/strategies/anonymous/anonymous.strategy.d.ts +0 -19
- package/dist/auth/strategies/anonymous/anonymous.strategy.d.ts.map +0 -1
- package/dist/auth/strategies/anonymous/anonymous.strategy.js +0 -49
- package/dist/auth/strategies/anonymous/anonymous.strategy.js.map +0 -1
- package/dist/auth/strategies/base/base.strategy.d.ts +0 -11
- package/dist/auth/strategies/base/base.strategy.d.ts.map +0 -1
- package/dist/auth/strategies/base/base.strategy.js +0 -6
- package/dist/auth/strategies/base/base.strategy.js.map +0 -1
- package/dist/auth/strategies/credentials/credentials.strategy.d.ts +0 -21
- package/dist/auth/strategies/credentials/credentials.strategy.d.ts.map +0 -1
- package/dist/auth/strategies/credentials/credentials.strategy.js +0 -67
- package/dist/auth/strategies/credentials/credentials.strategy.js.map +0 -1
- package/dist/auth/strategies/index.d.ts +0 -12
- package/dist/auth/strategies/index.d.ts.map +0 -1
- package/dist/auth/strategies/index.js +0 -12
- package/dist/auth/strategies/index.js.map +0 -1
- package/dist/auth/strategies/magic-link/magic-link.strategy.d.ts +0 -31
- package/dist/auth/strategies/magic-link/magic-link.strategy.d.ts.map +0 -1
- package/dist/auth/strategies/magic-link/magic-link.strategy.js +0 -88
- package/dist/auth/strategies/magic-link/magic-link.strategy.js.map +0 -1
- package/dist/auth/strategies/oauth/index.d.ts +0 -3
- package/dist/auth/strategies/oauth/index.d.ts.map +0 -1
- package/dist/auth/strategies/oauth/index.js +0 -3
- package/dist/auth/strategies/oauth/index.js.map +0 -1
- package/dist/auth/strategies/oauth/oauth-provider-registry.d.ts +0 -13
- package/dist/auth/strategies/oauth/oauth-provider-registry.d.ts.map +0 -1
- package/dist/auth/strategies/oauth/oauth-provider-registry.js +0 -20
- package/dist/auth/strategies/oauth/oauth-provider-registry.js.map +0 -1
- package/dist/auth/strategies/oauth/oauth.strategy.d.ts +0 -23
- package/dist/auth/strategies/oauth/oauth.strategy.d.ts.map +0 -1
- package/dist/auth/strategies/oauth/oauth.strategy.js +0 -79
- package/dist/auth/strategies/oauth/oauth.strategy.js.map +0 -1
- package/dist/auth/strategies/onetap/onetap.strategy.d.ts +0 -24
- package/dist/auth/strategies/onetap/onetap.strategy.d.ts.map +0 -1
- package/dist/auth/strategies/onetap/onetap.strategy.js +0 -77
- package/dist/auth/strategies/onetap/onetap.strategy.js.map +0 -1
- package/dist/auth/strategies/otp/otp.strategy.d.ts +0 -31
- package/dist/auth/strategies/otp/otp.strategy.d.ts.map +0 -1
- package/dist/auth/strategies/otp/otp.strategy.js +0 -93
- package/dist/auth/strategies/otp/otp.strategy.js.map +0 -1
- package/dist/auth/strategies/passkey/passkey.strategy.d.ts +0 -32
- package/dist/auth/strategies/passkey/passkey.strategy.d.ts.map +0 -1
- package/dist/auth/strategies/passkey/passkey.strategy.js +0 -102
- package/dist/auth/strategies/passkey/passkey.strategy.js.map +0 -1
- package/dist/auth/strategies/sso/sso.strategy.d.ts +0 -25
- package/dist/auth/strategies/sso/sso.strategy.d.ts.map +0 -1
- package/dist/auth/strategies/sso/sso.strategy.js +0 -80
- package/dist/auth/strategies/sso/sso.strategy.js.map +0 -1
- package/dist/auth/strategies/totp/totp.strategy.d.ts +0 -37
- package/dist/auth/strategies/totp/totp.strategy.d.ts.map +0 -1
- package/dist/auth/strategies/totp/totp.strategy.js +0 -109
- package/dist/auth/strategies/totp/totp.strategy.js.map +0 -1
- package/dist/auth/throttling/index.d.ts +0 -2
- package/dist/auth/throttling/index.d.ts.map +0 -1
- package/dist/auth/throttling/index.js +0 -2
- package/dist/auth/throttling/index.js.map +0 -1
- package/dist/auth/throttling/throttle.service.d.ts +0 -27
- package/dist/auth/throttling/throttle.service.d.ts.map +0 -1
- package/dist/auth/throttling/throttle.service.js +0 -63
- package/dist/auth/throttling/throttle.service.js.map +0 -1
- package/dist/bootstrap/cache/config.d.ts +0 -135
- package/dist/bootstrap/cache/config.d.ts.map +0 -1
- package/dist/bootstrap/cache/config.js +0 -189
- package/dist/bootstrap/cache/config.js.map +0 -1
- package/dist/bootstrap/cache/index.d.ts +0 -11
- package/dist/bootstrap/cache/index.d.ts.map +0 -1
- package/dist/bootstrap/cache/index.js +0 -11
- package/dist/bootstrap/cache/index.js.map +0 -1
- package/dist/bootstrap/index.d.ts +0 -21
- package/dist/bootstrap/index.d.ts.map +0 -1
- package/dist/bootstrap/index.js +0 -21
- package/dist/bootstrap/index.js.map +0 -1
- package/dist/bootstrap/scalar/api-docs.d.ts +0 -39
- package/dist/bootstrap/scalar/api-docs.d.ts.map +0 -1
- package/dist/bootstrap/scalar/api-docs.js +0 -41
- package/dist/bootstrap/scalar/api-docs.js.map +0 -1
- package/dist/bootstrap/scalar/index.d.ts +0 -39
- package/dist/bootstrap/scalar/index.d.ts.map +0 -1
- package/dist/bootstrap/scalar/index.js +0 -41
- package/dist/bootstrap/scalar/index.js.map +0 -1
- package/dist/bootstrap/swagger/api-docs.d.ts +0 -73
- package/dist/bootstrap/swagger/api-docs.d.ts.map +0 -1
- package/dist/bootstrap/swagger/api-docs.js +0 -87
- package/dist/bootstrap/swagger/api-docs.js.map +0 -1
- package/dist/bootstrap/swagger/index.d.ts +0 -37
- package/dist/bootstrap/swagger/index.d.ts.map +0 -1
- package/dist/bootstrap/swagger/index.js +0 -36
- package/dist/bootstrap/swagger/index.js.map +0 -1
- package/dist/bootstrap/typeorm/config/index.d.ts +0 -12
- package/dist/bootstrap/typeorm/config/index.d.ts.map +0 -1
- package/dist/bootstrap/typeorm/config/index.js +0 -62
- package/dist/bootstrap/typeorm/config/index.js.map +0 -1
- package/dist/bootstrap/typeorm/crud/controller.d.ts +0 -13
- package/dist/bootstrap/typeorm/crud/controller.d.ts.map +0 -1
- package/dist/bootstrap/typeorm/crud/controller.js +0 -72
- package/dist/bootstrap/typeorm/crud/controller.js.map +0 -1
- package/dist/bootstrap/typeorm/crud/index.d.ts +0 -4
- package/dist/bootstrap/typeorm/crud/index.d.ts.map +0 -1
- package/dist/bootstrap/typeorm/crud/index.js +0 -3
- package/dist/bootstrap/typeorm/crud/index.js.map +0 -1
- package/dist/bootstrap/typeorm/crud/service.d.ts +0 -10
- package/dist/bootstrap/typeorm/crud/service.d.ts.map +0 -1
- package/dist/bootstrap/typeorm/crud/service.js +0 -21
- package/dist/bootstrap/typeorm/crud/service.js.map +0 -1
- package/dist/bootstrap/typeorm/index.d.ts +0 -18
- package/dist/bootstrap/typeorm/index.d.ts.map +0 -1
- package/dist/bootstrap/typeorm/index.js +0 -18
- package/dist/bootstrap/typeorm/index.js.map +0 -1
- package/dist/bootstrap/typeorm/uow/factory.d.ts +0 -5
- package/dist/bootstrap/typeorm/uow/factory.d.ts.map +0 -1
- package/dist/bootstrap/typeorm/uow/factory.js +0 -27
- package/dist/bootstrap/typeorm/uow/factory.js.map +0 -1
- package/dist/bootstrap/typeorm/uow/index.d.ts +0 -4
- package/dist/bootstrap/typeorm/uow/index.d.ts.map +0 -1
- package/dist/bootstrap/typeorm/uow/index.js +0 -4
- package/dist/bootstrap/typeorm/uow/index.js.map +0 -1
- package/dist/bootstrap/typeorm/uow/transactional.decorator.d.ts +0 -62
- package/dist/bootstrap/typeorm/uow/transactional.decorator.d.ts.map +0 -1
- package/dist/bootstrap/typeorm/uow/transactional.decorator.js +0 -114
- package/dist/bootstrap/typeorm/uow/transactional.decorator.js.map +0 -1
- package/dist/bootstrap/typeorm/uow/unit-of-work.d.ts +0 -11
- package/dist/bootstrap/typeorm/uow/unit-of-work.d.ts.map +0 -1
- package/dist/bootstrap/typeorm/uow/unit-of-work.js +0 -23
- package/dist/bootstrap/typeorm/uow/unit-of-work.js.map +0 -1
- package/dist/core/index.d.ts +0 -11
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js +0 -11
- package/dist/core/index.js.map +0 -1
- package/dist/infra/audit-log/index.d.ts +0 -12
- package/dist/infra/audit-log/index.d.ts.map +0 -1
- package/dist/infra/audit-log/index.js +0 -13
- package/dist/infra/audit-log/index.js.map +0 -1
- package/dist/infra/index.d.ts +0 -20
- package/dist/infra/index.d.ts.map +0 -1
- package/dist/infra/index.js +0 -21
- package/dist/infra/index.js.map +0 -1
- package/dist/infra/logger/index.d.ts +0 -12
- package/dist/infra/logger/index.d.ts.map +0 -1
- package/dist/infra/logger/index.js +0 -13
- package/dist/infra/logger/index.js.map +0 -1
- package/dist/infra/metrics/index.d.ts +0 -18
- package/dist/infra/metrics/index.d.ts.map +0 -1
- package/dist/infra/metrics/index.js +0 -19
- package/dist/infra/metrics/index.js.map +0 -1
- package/dist/infra/notification/index.d.ts +0 -12
- package/dist/infra/notification/index.d.ts.map +0 -1
- package/dist/infra/notification/index.js +0 -13
- package/dist/infra/notification/index.js.map +0 -1
- package/dist/infra/storage/index.d.ts +0 -12
- package/dist/infra/storage/index.d.ts.map +0 -1
- package/dist/infra/storage/index.js +0 -13
- package/dist/infra/storage/index.js.map +0 -1
- package/dist/infra/stripe/index.d.ts +0 -12
- package/dist/infra/stripe/index.d.ts.map +0 -1
- package/dist/infra/stripe/index.js +0 -13
- package/dist/infra/stripe/index.js.map +0 -1
- package/dist/saas/index.d.ts +0 -18
- package/dist/saas/index.d.ts.map +0 -1
- package/dist/saas/index.js +0 -19
- package/dist/saas/index.js.map +0 -1
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { DeleteResult, ObjectLiteral, Repository } from 'typeorm';
|
|
2
|
-
export interface CrudService<T> {
|
|
3
|
-
findAll(): Promise<T[]>;
|
|
4
|
-
findOne(id: string | number): Promise<T | null>;
|
|
5
|
-
create(data: Partial<T>): Promise<T>;
|
|
6
|
-
update(id: string | number, data: Partial<T>): Promise<T>;
|
|
7
|
-
remove(id: string | number): Promise<DeleteResult>;
|
|
8
|
-
}
|
|
9
|
-
export declare function createCrudService<T extends ObjectLiteral>(repo: Repository<T>): CrudService<T>;
|
|
10
|
-
//# sourceMappingURL=service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../packages/bootstrap/typeorm/crud/service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAEvE,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,OAAO,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;IACxB,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAChD,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACrC,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAC1D,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CACpD;AAED,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,aAAa,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAuB9F"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export function createCrudService(repo) {
|
|
2
|
-
return {
|
|
3
|
-
findAll() {
|
|
4
|
-
return repo.find();
|
|
5
|
-
},
|
|
6
|
-
findOne(id) {
|
|
7
|
-
return repo.findOneBy({ id });
|
|
8
|
-
},
|
|
9
|
-
create(data) {
|
|
10
|
-
return repo.save(repo.create(data));
|
|
11
|
-
},
|
|
12
|
-
async update(id, data) {
|
|
13
|
-
await repo.update(id, data);
|
|
14
|
-
return repo.findOneBy({ id });
|
|
15
|
-
},
|
|
16
|
-
async remove(id) {
|
|
17
|
-
return repo.delete(id);
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../../packages/bootstrap/typeorm/crud/service.ts"],"names":[],"mappings":"AAUA,MAAM,UAAU,iBAAiB,CAA0B,IAAmB;IAC5E,OAAO;QACL,OAAO;YACL,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;QACrB,CAAC;QAED,OAAO,CAAC,EAAE;YACR,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAW,CAAC,CAAC;QACzC,CAAC;QAED,MAAM,CAAC,IAAI;YACT,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAS,CAAC,CAAC,CAAC;QAC3C,CAAC;QAED,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI;YACnB,MAAM,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;YAC5B,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAW,CAAe,CAAC;QACvD,CAAC;QAED,KAAK,CAAC,MAAM,CAAC,EAAE;YACb,OAAO,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACzB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @os.io/nest-kit/bootstrap/typeorm
|
|
3
|
-
*
|
|
4
|
-
* TypeORM configuration, CRUD factories, and Unit of Work support for NestJS applications.
|
|
5
|
-
*
|
|
6
|
-
* ## Sub-modules
|
|
7
|
-
*
|
|
8
|
-
* - `config` — `configTypeOrm` / `configTypeOrmAsync` for connection setup
|
|
9
|
-
* - `crud` — `createCrudService` / `createCrudController` for generic REST endpoints
|
|
10
|
-
* - `uow` — `UnitOfWork`, `@Transactional()`, `@TransactionalController()`
|
|
11
|
-
*
|
|
12
|
-
* @module
|
|
13
|
-
* @packageDocumentation
|
|
14
|
-
*/
|
|
15
|
-
export * from './config';
|
|
16
|
-
export * from './crud';
|
|
17
|
-
export * from './uow';
|
|
18
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/bootstrap/typeorm/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @os.io/nest-kit/bootstrap/typeorm
|
|
3
|
-
*
|
|
4
|
-
* TypeORM configuration, CRUD factories, and Unit of Work support for NestJS applications.
|
|
5
|
-
*
|
|
6
|
-
* ## Sub-modules
|
|
7
|
-
*
|
|
8
|
-
* - `config` — `configTypeOrm` / `configTypeOrmAsync` for connection setup
|
|
9
|
-
* - `crud` — `createCrudService` / `createCrudController` for generic REST endpoints
|
|
10
|
-
* - `uow` — `UnitOfWork`, `@Transactional()`, `@TransactionalController()`
|
|
11
|
-
*
|
|
12
|
-
* @module
|
|
13
|
-
* @packageDocumentation
|
|
14
|
-
*/
|
|
15
|
-
export * from './config';
|
|
16
|
-
export * from './crud';
|
|
17
|
-
export * from './uow';
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/bootstrap/typeorm/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { DataSource } from 'typeorm';
|
|
2
|
-
import { UnitOfWork } from './unit-of-work';
|
|
3
|
-
export declare function createUnitOfWork(dataSource: DataSource): Promise<UnitOfWork>;
|
|
4
|
-
export declare function withUnitOfWork<T>(dataSource: DataSource, fn: (uow: UnitOfWork) => Promise<T>): Promise<T>;
|
|
5
|
-
//# sourceMappingURL=factory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../packages/bootstrap/typeorm/uow/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,wBAAsB,gBAAgB,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAIlF;AAED,wBAAsB,cAAc,CAAC,CAAC,EACpC,UAAU,EAAE,UAAU,EACtB,EAAE,EAAE,CAAC,GAAG,EAAE,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC,GAClC,OAAO,CAAC,CAAC,CAAC,CAiBZ"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { UnitOfWork } from './unit-of-work';
|
|
2
|
-
export async function createUnitOfWork(dataSource) {
|
|
3
|
-
const uow = new UnitOfWork(dataSource);
|
|
4
|
-
await uow.start();
|
|
5
|
-
return uow;
|
|
6
|
-
}
|
|
7
|
-
export async function withUnitOfWork(dataSource, fn) {
|
|
8
|
-
const uow = await createUnitOfWork(dataSource);
|
|
9
|
-
try {
|
|
10
|
-
const result = await fn(uow);
|
|
11
|
-
await uow.commit();
|
|
12
|
-
return result;
|
|
13
|
-
}
|
|
14
|
-
catch (error) {
|
|
15
|
-
try {
|
|
16
|
-
await uow.rollback();
|
|
17
|
-
}
|
|
18
|
-
catch {
|
|
19
|
-
// rollback failure — discard, original error takes precedence
|
|
20
|
-
}
|
|
21
|
-
throw error;
|
|
22
|
-
}
|
|
23
|
-
finally {
|
|
24
|
-
await uow.release();
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=factory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../../../packages/bootstrap/typeorm/uow/factory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,UAAsB;IAC3D,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,UAAU,CAAC,CAAC;IACvC,MAAM,GAAG,CAAC,KAAK,EAAE,CAAC;IAClB,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,UAAsB,EACtB,EAAmC;IAEnC,MAAM,GAAG,GAAG,MAAM,gBAAgB,CAAC,UAAU,CAAC,CAAC;IAE/C,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC;QAC7B,MAAM,GAAG,CAAC,MAAM,EAAE,CAAC;QACnB,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC;YACH,MAAM,GAAG,CAAC,QAAQ,EAAE,CAAC;QACvB,CAAC;QAAC,MAAM,CAAC;YACP,8DAA8D;QAChE,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;YAAS,CAAC;QACT,MAAM,GAAG,CAAC,OAAO,EAAE,CAAC;IACtB,CAAC;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/bootstrap/typeorm/uow/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,2BAA2B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/bootstrap/typeorm/uow/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,2BAA2B,CAAC"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { UnitOfWork } from './unit-of-work';
|
|
2
|
-
/**
|
|
3
|
-
* Returns the current `UnitOfWork` active inside a `@Transactional()` /
|
|
4
|
-
* `@TransactionalController()` method.
|
|
5
|
-
*
|
|
6
|
-
* Must be called from within a method decorated with `@Transactional()` or a
|
|
7
|
-
* class decorated with `@TransactionalController()`.
|
|
8
|
-
*/
|
|
9
|
-
export declare function getCurrentUnitOfWork(): UnitOfWork | undefined;
|
|
10
|
-
/**
|
|
11
|
-
* Wraps a controller / service method in a database transaction.
|
|
12
|
-
*
|
|
13
|
-
* @param dataSourceProp - Name of the class property holding the `DataSource`
|
|
14
|
-
* (default: `'dataSource'`).
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```ts
|
|
18
|
-
* \@Injectable()
|
|
19
|
-
* class UsersService {
|
|
20
|
-
* constructor(private dataSource: DataSource) {}
|
|
21
|
-
*
|
|
22
|
-
* \@Transactional()
|
|
23
|
-
* async create(data: CreateUserDto): Promise<User> {
|
|
24
|
-
* const uow = getCurrentUnitOfWork();
|
|
25
|
-
* const repo = uow.getRepository(User);
|
|
26
|
-
* return repo.save(data);
|
|
27
|
-
* }
|
|
28
|
-
* }
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
export declare function Transactional(dataSourceProp?: string): MethodDecorator;
|
|
32
|
-
/**
|
|
33
|
-
* Class-level decorator that wraps every method of the controller in a
|
|
34
|
-
* database transaction.
|
|
35
|
-
*
|
|
36
|
-
* @param dataSourceProp - Name of the class property holding the `DataSource`
|
|
37
|
-
* (default: `'dataSource'`).
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
* ```ts
|
|
41
|
-
* \@Controller('users')
|
|
42
|
-
* \@TransactionalController()
|
|
43
|
-
* export class UsersController {
|
|
44
|
-
* constructor(\@InjectDataSource() private readonly dataSource: DataSource) {}
|
|
45
|
-
*
|
|
46
|
-
* \@Post()
|
|
47
|
-
* async create(\@Body() data: CreateUserDto) {
|
|
48
|
-
* const uow = getCurrentUnitOfWork();
|
|
49
|
-
* const repo = uow.getRepository(User);
|
|
50
|
-
* return repo.save(data);
|
|
51
|
-
* }
|
|
52
|
-
*
|
|
53
|
-
* \@Get()
|
|
54
|
-
* async findAll() {
|
|
55
|
-
* const uow = getCurrentUnitOfWork();
|
|
56
|
-
* return uow.getRepository(User).find();
|
|
57
|
-
* }
|
|
58
|
-
* }
|
|
59
|
-
* ```
|
|
60
|
-
*/
|
|
61
|
-
export declare function TransactionalController(dataSourceProp?: string): ClassDecorator;
|
|
62
|
-
//# sourceMappingURL=transactional.decorator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transactional.decorator.d.ts","sourceRoot":"","sources":["../../../../packages/bootstrap/typeorm/uow/transactional.decorator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAmC5C;;;;;;GAMG;AACH,wBAAgB,oBAAoB,IAAI,UAAU,GAAG,SAAS,CAE7D;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,aAAa,CAAC,cAAc,GAAE,MAAqB,GAAG,eAAe,CAMpF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,uBAAuB,CAAC,cAAc,GAAE,MAAqB,GAAG,cAAc,CAiB7F"}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { AsyncLocalStorage } from 'async_hooks';
|
|
2
|
-
import { UnitOfWork } from './unit-of-work';
|
|
3
|
-
const uowStorage = new AsyncLocalStorage();
|
|
4
|
-
function createUowWrapper(originalMethod, dataSourceProp) {
|
|
5
|
-
return async function (...args) {
|
|
6
|
-
const dataSource = this[dataSourceProp];
|
|
7
|
-
if (!dataSource) {
|
|
8
|
-
throw new Error(`@Transactional() requires a DataSource at this.${dataSourceProp}. ` +
|
|
9
|
-
`Inject via constructor: constructor(private ${dataSourceProp}: DataSource) {}`);
|
|
10
|
-
}
|
|
11
|
-
const uow = new UnitOfWork(dataSource);
|
|
12
|
-
await uow.start();
|
|
13
|
-
try {
|
|
14
|
-
const result = await uowStorage.run(uow, () => originalMethod.apply(this, args));
|
|
15
|
-
await uow.commit();
|
|
16
|
-
return result;
|
|
17
|
-
}
|
|
18
|
-
catch (error) {
|
|
19
|
-
try {
|
|
20
|
-
await uow.rollback();
|
|
21
|
-
}
|
|
22
|
-
catch {
|
|
23
|
-
// rollback failure — discard, original error takes precedence
|
|
24
|
-
}
|
|
25
|
-
throw error;
|
|
26
|
-
}
|
|
27
|
-
finally {
|
|
28
|
-
await uow.release();
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Returns the current `UnitOfWork` active inside a `@Transactional()` /
|
|
34
|
-
* `@TransactionalController()` method.
|
|
35
|
-
*
|
|
36
|
-
* Must be called from within a method decorated with `@Transactional()` or a
|
|
37
|
-
* class decorated with `@TransactionalController()`.
|
|
38
|
-
*/
|
|
39
|
-
export function getCurrentUnitOfWork() {
|
|
40
|
-
return uowStorage.getStore();
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Wraps a controller / service method in a database transaction.
|
|
44
|
-
*
|
|
45
|
-
* @param dataSourceProp - Name of the class property holding the `DataSource`
|
|
46
|
-
* (default: `'dataSource'`).
|
|
47
|
-
*
|
|
48
|
-
* @example
|
|
49
|
-
* ```ts
|
|
50
|
-
* \@Injectable()
|
|
51
|
-
* class UsersService {
|
|
52
|
-
* constructor(private dataSource: DataSource) {}
|
|
53
|
-
*
|
|
54
|
-
* \@Transactional()
|
|
55
|
-
* async create(data: CreateUserDto): Promise<User> {
|
|
56
|
-
* const uow = getCurrentUnitOfWork();
|
|
57
|
-
* const repo = uow.getRepository(User);
|
|
58
|
-
* return repo.save(data);
|
|
59
|
-
* }
|
|
60
|
-
* }
|
|
61
|
-
* ```
|
|
62
|
-
*/
|
|
63
|
-
export function Transactional(dataSourceProp = 'dataSource') {
|
|
64
|
-
return (_target, _propertyKey, descriptor) => {
|
|
65
|
-
const originalMethod = descriptor.value;
|
|
66
|
-
descriptor.value = createUowWrapper(originalMethod, dataSourceProp);
|
|
67
|
-
return descriptor;
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Class-level decorator that wraps every method of the controller in a
|
|
72
|
-
* database transaction.
|
|
73
|
-
*
|
|
74
|
-
* @param dataSourceProp - Name of the class property holding the `DataSource`
|
|
75
|
-
* (default: `'dataSource'`).
|
|
76
|
-
*
|
|
77
|
-
* @example
|
|
78
|
-
* ```ts
|
|
79
|
-
* \@Controller('users')
|
|
80
|
-
* \@TransactionalController()
|
|
81
|
-
* export class UsersController {
|
|
82
|
-
* constructor(\@InjectDataSource() private readonly dataSource: DataSource) {}
|
|
83
|
-
*
|
|
84
|
-
* \@Post()
|
|
85
|
-
* async create(\@Body() data: CreateUserDto) {
|
|
86
|
-
* const uow = getCurrentUnitOfWork();
|
|
87
|
-
* const repo = uow.getRepository(User);
|
|
88
|
-
* return repo.save(data);
|
|
89
|
-
* }
|
|
90
|
-
*
|
|
91
|
-
* \@Get()
|
|
92
|
-
* async findAll() {
|
|
93
|
-
* const uow = getCurrentUnitOfWork();
|
|
94
|
-
* return uow.getRepository(User).find();
|
|
95
|
-
* }
|
|
96
|
-
* }
|
|
97
|
-
* ```
|
|
98
|
-
*/
|
|
99
|
-
export function TransactionalController(dataSourceProp = 'dataSource') {
|
|
100
|
-
return (target) => {
|
|
101
|
-
const ctor = target;
|
|
102
|
-
const proto = ctor.prototype;
|
|
103
|
-
const methodNames = Object.getOwnPropertyNames(proto).filter((name) => name !== 'constructor' && typeof proto[name] === 'function');
|
|
104
|
-
for (const methodName of methodNames) {
|
|
105
|
-
const descriptor = Object.getOwnPropertyDescriptor(proto, methodName);
|
|
106
|
-
if (!descriptor?.value)
|
|
107
|
-
continue;
|
|
108
|
-
const originalMethod = descriptor.value;
|
|
109
|
-
descriptor.value = createUowWrapper(originalMethod, dataSourceProp);
|
|
110
|
-
Object.defineProperty(proto, methodName, descriptor);
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
//# sourceMappingURL=transactional.decorator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transactional.decorator.js","sourceRoot":"","sources":["../../../../packages/bootstrap/typeorm/uow/transactional.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,UAAU,GAAG,IAAI,iBAAiB,EAAc,CAAC;AAEvD,SAAS,gBAAgB,CAAC,cAA+C,EAAE,cAAsB;IAC/F,OAAO,KAAK,WAA0C,GAAG,IAAe;QACtE,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,CAA2B,CAAC;QAElE,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CACb,kDAAkD,cAAc,IAAI;gBAClE,+CAA+C,cAAc,kBAAkB,CAClF,CAAC;QACJ,CAAC;QAED,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,UAAU,CAAC,CAAC;QACvC,MAAM,GAAG,CAAC,KAAK,EAAE,CAAC;QAElB,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;YACjF,MAAM,GAAG,CAAC,MAAM,EAAE,CAAC;YACnB,OAAO,MAAM,CAAC;QAChB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC;gBACH,MAAM,GAAG,CAAC,QAAQ,EAAE,CAAC;YACvB,CAAC;YAAC,MAAM,CAAC;gBACP,8DAA8D;YAChE,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;gBAAS,CAAC;YACT,MAAM,GAAG,CAAC,OAAO,EAAE,CAAC;QACtB,CAAC;IACH,CAAC,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB;IAClC,OAAO,UAAU,CAAC,QAAQ,EAAE,CAAC;AAC/B,CAAC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,aAAa,CAAC,iBAAyB,YAAY;IACjE,OAAO,CAAC,OAAe,EAAE,YAA6B,EAAE,UAA8B,EAAE,EAAE;QACxF,MAAM,cAAc,GAAG,UAAU,CAAC,KAAwC,CAAC;QAC3E,UAAU,CAAC,KAAK,GAAG,gBAAgB,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;QACpE,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,UAAU,uBAAuB,CAAC,iBAAyB,YAAY;IAC3E,OAAO,CAAC,MAAc,EAAE,EAAE;QACxB,MAAM,IAAI,GAAG,MAAgD,CAAC;QAC9D,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC;QAC7B,MAAM,WAAW,GAAG,MAAM,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,MAAM,CAC1D,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,aAAa,IAAI,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,UAAU,CACtE,CAAC;QAEF,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;YACrC,MAAM,UAAU,GAAG,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;YACtE,IAAI,CAAC,UAAU,EAAE,KAAK;gBAAE,SAAS;YAEjC,MAAM,cAAc,GAAG,UAAU,CAAC,KAAwC,CAAC;YAC3E,UAAU,CAAC,KAAK,GAAG,gBAAgB,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;YACpE,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;QACvD,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { DataSource, EntityTarget, ObjectLiteral, Repository } from 'typeorm';
|
|
2
|
-
export declare class UnitOfWork {
|
|
3
|
-
private queryRunner;
|
|
4
|
-
constructor(dataSource: DataSource);
|
|
5
|
-
start(): Promise<void>;
|
|
6
|
-
commit(): Promise<void>;
|
|
7
|
-
rollback(): Promise<void>;
|
|
8
|
-
release(): Promise<void>;
|
|
9
|
-
getRepository<T extends ObjectLiteral>(entity: EntityTarget<T>): Repository<T>;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=unit-of-work.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unit-of-work.d.ts","sourceRoot":"","sources":["../../../../packages/bootstrap/typeorm/uow/unit-of-work.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAe,UAAU,EAAE,MAAM,SAAS,CAAC;AAEhG,qBAAa,UAAU;IACrB,OAAO,CAAC,WAAW,CAAc;gBAErB,UAAU,EAAE,UAAU;IAI5B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAKtB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAIvB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAIzB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAI9B,aAAa,CAAC,CAAC,SAAS,aAAa,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC;CAG/E"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export class UnitOfWork {
|
|
2
|
-
queryRunner;
|
|
3
|
-
constructor(dataSource) {
|
|
4
|
-
this.queryRunner = dataSource.createQueryRunner();
|
|
5
|
-
}
|
|
6
|
-
async start() {
|
|
7
|
-
await this.queryRunner.connect();
|
|
8
|
-
await this.queryRunner.startTransaction();
|
|
9
|
-
}
|
|
10
|
-
async commit() {
|
|
11
|
-
await this.queryRunner.commitTransaction();
|
|
12
|
-
}
|
|
13
|
-
async rollback() {
|
|
14
|
-
await this.queryRunner.rollbackTransaction();
|
|
15
|
-
}
|
|
16
|
-
async release() {
|
|
17
|
-
await this.queryRunner.release();
|
|
18
|
-
}
|
|
19
|
-
getRepository(entity) {
|
|
20
|
-
return this.queryRunner.manager.getRepository(entity);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=unit-of-work.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unit-of-work.js","sourceRoot":"","sources":["../../../../packages/bootstrap/typeorm/uow/unit-of-work.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,UAAU;IACb,WAAW,CAAc;IAEjC,YAAY,UAAsB;QAChC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,iBAAiB,EAAE,CAAC;IACpD,CAAC;IAED,KAAK,CAAC,KAAK;QACT,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;QACjC,MAAM,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,MAAM;QACV,MAAM,IAAI,CAAC,WAAW,CAAC,iBAAiB,EAAE,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,MAAM,IAAI,CAAC,WAAW,CAAC,mBAAmB,EAAE,CAAC;IAC/C,CAAC;IAED,KAAK,CAAC,OAAO;QACX,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;IACnC,CAAC;IAED,aAAa,CAA0B,MAAuB;QAC5D,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IACxD,CAAC;CACF"}
|
package/dist/core/index.d.ts
DELETED
package/dist/core/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC"}
|
package/dist/core/index.js
DELETED
package/dist/core/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../packages/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @os.io/nest-kit/infra/audit-log
|
|
3
|
-
*
|
|
4
|
-
* Audit logging for NestJS. Automatically captures and persists user actions,
|
|
5
|
-
* data changes, and security events in a structured format. Supports multiple
|
|
6
|
-
* backends (database, S3, Elasticsearch).
|
|
7
|
-
*
|
|
8
|
-
* @module
|
|
9
|
-
* @packageDocumentation
|
|
10
|
-
*/
|
|
11
|
-
export {};
|
|
12
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/infra/audit-log/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,OAAO,EAAE,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @os.io/nest-kit/infra/audit-log
|
|
3
|
-
*
|
|
4
|
-
* Audit logging for NestJS. Automatically captures and persists user actions,
|
|
5
|
-
* data changes, and security events in a structured format. Supports multiple
|
|
6
|
-
* backends (database, S3, Elasticsearch).
|
|
7
|
-
*
|
|
8
|
-
* @module
|
|
9
|
-
* @packageDocumentation
|
|
10
|
-
*/
|
|
11
|
-
throw new Error('The infra/audit-log module has not been implemented yet. Stay tuned for an upcoming alpha release.');
|
|
12
|
-
export {};
|
|
13
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/infra/audit-log/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,IAAI,KAAK,CACb,oGAAoG,CACrG,CAAC"}
|
package/dist/infra/index.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @os.io/nest-kit/infra
|
|
3
|
-
*
|
|
4
|
-
* Infrastructure & third-party integrations for NestJS applications.
|
|
5
|
-
* Includes Logger, Notification, Storage, Stripe, Audit Log, and Metrics.
|
|
6
|
-
*
|
|
7
|
-
* ## Sub-modules
|
|
8
|
-
*
|
|
9
|
-
* - `@os.io/nest-kit/infra/logger` — Structured logging (Pino, Winston)
|
|
10
|
-
* - `@os.io/nest-kit/infra/notification` — Email, SMS, Push, In-app
|
|
11
|
-
* - `@os.io/nest-kit/infra/storage` — S3, GCS, Azure, local filesystem
|
|
12
|
-
* - `@os.io/nest-kit/infra/stripe` — Webhooks, subscriptions, checkout
|
|
13
|
-
* - `@os.io/nest-kit/infra/audit-log` — Audit trails, data change capture
|
|
14
|
-
* - `@os.io/nest-kit/infra/metrics` — Prometheus, OpenTelemetry, health checks
|
|
15
|
-
*
|
|
16
|
-
* @module
|
|
17
|
-
* @packageDocumentation
|
|
18
|
-
*/
|
|
19
|
-
export {};
|
|
20
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/infra/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAMH,OAAO,EAAE,CAAC"}
|
package/dist/infra/index.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @os.io/nest-kit/infra
|
|
3
|
-
*
|
|
4
|
-
* Infrastructure & third-party integrations for NestJS applications.
|
|
5
|
-
* Includes Logger, Notification, Storage, Stripe, Audit Log, and Metrics.
|
|
6
|
-
*
|
|
7
|
-
* ## Sub-modules
|
|
8
|
-
*
|
|
9
|
-
* - `@os.io/nest-kit/infra/logger` — Structured logging (Pino, Winston)
|
|
10
|
-
* - `@os.io/nest-kit/infra/notification` — Email, SMS, Push, In-app
|
|
11
|
-
* - `@os.io/nest-kit/infra/storage` — S3, GCS, Azure, local filesystem
|
|
12
|
-
* - `@os.io/nest-kit/infra/stripe` — Webhooks, subscriptions, checkout
|
|
13
|
-
* - `@os.io/nest-kit/infra/audit-log` — Audit trails, data change capture
|
|
14
|
-
* - `@os.io/nest-kit/infra/metrics` — Prometheus, OpenTelemetry, health checks
|
|
15
|
-
*
|
|
16
|
-
* @module
|
|
17
|
-
* @packageDocumentation
|
|
18
|
-
*/
|
|
19
|
-
throw new Error('The infra module has not been implemented yet. Stay tuned for an upcoming alpha release.');
|
|
20
|
-
export {};
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
package/dist/infra/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../packages/infra/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,IAAI,KAAK,CACb,0FAA0F,CAC3F,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @os.io/nest-kit/infra/logger
|
|
3
|
-
*
|
|
4
|
-
* Structured logging module for NestJS. Wraps popular logger libraries
|
|
5
|
-
* (Pino, Winston, etc.) and provides a NestJS LoggerService implementation
|
|
6
|
-
* with request-id injection, log levels, and transport configuration.
|
|
7
|
-
*
|
|
8
|
-
* @module
|
|
9
|
-
* @packageDocumentation
|
|
10
|
-
*/
|
|
11
|
-
export {};
|
|
12
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/infra/logger/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,OAAO,EAAE,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @os.io/nest-kit/infra/logger
|
|
3
|
-
*
|
|
4
|
-
* Structured logging module for NestJS. Wraps popular logger libraries
|
|
5
|
-
* (Pino, Winston, etc.) and provides a NestJS LoggerService implementation
|
|
6
|
-
* with request-id injection, log levels, and transport configuration.
|
|
7
|
-
*
|
|
8
|
-
* @module
|
|
9
|
-
* @packageDocumentation
|
|
10
|
-
*/
|
|
11
|
-
throw new Error('The infra/logger module has not been implemented yet. Stay tuned for an upcoming alpha release.');
|
|
12
|
-
export {};
|
|
13
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/infra/logger/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,IAAI,KAAK,CACb,iGAAiG,CAClG,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @os.io/nest-kit/infra/metrics
|
|
3
|
-
*
|
|
4
|
-
* Metrics & observability for NestJS. Exposes Prometheus metrics,
|
|
5
|
-
* OpenTelemetry tracing, health checks, and structured monitoring endpoints.
|
|
6
|
-
*
|
|
7
|
-
* ## Roadmap
|
|
8
|
-
*
|
|
9
|
-
* - Prometheus metric exporters (HTTP request duration, DB query duration, …)
|
|
10
|
-
* - OpenTelemetry integration
|
|
11
|
-
* - Health check endpoint builder
|
|
12
|
-
* - Custom metric decorators
|
|
13
|
-
*
|
|
14
|
-
* @module
|
|
15
|
-
* @packageDocumentation
|
|
16
|
-
*/
|
|
17
|
-
export {};
|
|
18
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/infra/metrics/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAMH,OAAO,EAAE,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @os.io/nest-kit/infra/metrics
|
|
3
|
-
*
|
|
4
|
-
* Metrics & observability for NestJS. Exposes Prometheus metrics,
|
|
5
|
-
* OpenTelemetry tracing, health checks, and structured monitoring endpoints.
|
|
6
|
-
*
|
|
7
|
-
* ## Roadmap
|
|
8
|
-
*
|
|
9
|
-
* - Prometheus metric exporters (HTTP request duration, DB query duration, …)
|
|
10
|
-
* - OpenTelemetry integration
|
|
11
|
-
* - Health check endpoint builder
|
|
12
|
-
* - Custom metric decorators
|
|
13
|
-
*
|
|
14
|
-
* @module
|
|
15
|
-
* @packageDocumentation
|
|
16
|
-
*/
|
|
17
|
-
throw new Error('The infra/metrics module has not been implemented yet. Stay tuned for an upcoming alpha release.');
|
|
18
|
-
export {};
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/infra/metrics/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,IAAI,KAAK,CACb,kGAAkG,CACnG,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @os.io/nest-kit/infra/notification
|
|
3
|
-
*
|
|
4
|
-
* Multi-channel notification module for NestJS. Supports email (SMTP,
|
|
5
|
-
* SendGrid, SES), SMS (Twilio), push notifications (FCM, APNs), and
|
|
6
|
-
* in-app notifications.
|
|
7
|
-
*
|
|
8
|
-
* @module
|
|
9
|
-
* @packageDocumentation
|
|
10
|
-
*/
|
|
11
|
-
export {};
|
|
12
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/infra/notification/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,OAAO,EAAE,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @os.io/nest-kit/infra/notification
|
|
3
|
-
*
|
|
4
|
-
* Multi-channel notification module for NestJS. Supports email (SMTP,
|
|
5
|
-
* SendGrid, SES), SMS (Twilio), push notifications (FCM, APNs), and
|
|
6
|
-
* in-app notifications.
|
|
7
|
-
*
|
|
8
|
-
* @module
|
|
9
|
-
* @packageDocumentation
|
|
10
|
-
*/
|
|
11
|
-
throw new Error('The infra/notification module has not been implemented yet. Stay tuned for an upcoming alpha release.');
|
|
12
|
-
export {};
|
|
13
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/infra/notification/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,IAAI,KAAK,CACb,uGAAuG,CACxG,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @os.io/nest-kit/infra/storage
|
|
3
|
-
*
|
|
4
|
-
* File storage abstraction for NestJS. Provides a unified interface over
|
|
5
|
-
* local filesystem, AWS S3 / S3-compatible, Google Cloud Storage, and
|
|
6
|
-
* Azure Blob Storage.
|
|
7
|
-
*
|
|
8
|
-
* @module
|
|
9
|
-
* @packageDocumentation
|
|
10
|
-
*/
|
|
11
|
-
export {};
|
|
12
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/infra/storage/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,OAAO,EAAE,CAAC"}
|