@nest-boot/row-level-security 7.0.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.
Files changed (118) hide show
  1. package/LICENSE +21 -0
  2. package/dist/decorators/policy.decorator.d.ts +18 -0
  3. package/dist/decorators/policy.decorator.js +257 -0
  4. package/dist/decorators/policy.decorator.js.map +1 -0
  5. package/dist/decorators/policy.decorator.spec.d.ts +1 -0
  6. package/dist/decorators/policy.decorator.spec.js +498 -0
  7. package/dist/decorators/policy.decorator.spec.js.map +1 -0
  8. package/dist/enums/policy-command.enum.d.ts +13 -0
  9. package/dist/enums/policy-command.enum.js +18 -0
  10. package/dist/enums/policy-command.enum.js.map +1 -0
  11. package/dist/enums/policy-mode.enum.d.ts +7 -0
  12. package/dist/enums/policy-mode.enum.js +12 -0
  13. package/dist/enums/policy-mode.enum.js.map +1 -0
  14. package/dist/index.d.ts +9 -0
  15. package/dist/index.js +26 -0
  16. package/dist/index.js.map +1 -0
  17. package/dist/index.spec.d.ts +1 -0
  18. package/dist/index.spec.js +70 -0
  19. package/dist/index.spec.js.map +1 -0
  20. package/dist/interfaces/index.d.ts +5 -0
  21. package/dist/interfaces/index.js +21 -0
  22. package/dist/interfaces/index.js.map +1 -0
  23. package/dist/interfaces/policy-metadata.interface.d.ts +62 -0
  24. package/dist/interfaces/policy-metadata.interface.js +3 -0
  25. package/dist/interfaces/policy-metadata.interface.js.map +1 -0
  26. package/dist/interfaces/policy-options.interface.d.ts +21 -0
  27. package/dist/interfaces/policy-options.interface.js +3 -0
  28. package/dist/interfaces/policy-options.interface.js.map +1 -0
  29. package/dist/interfaces/policy-sql-options.interface.d.ts +21 -0
  30. package/dist/interfaces/policy-sql-options.interface.js +3 -0
  31. package/dist/interfaces/policy-sql-options.interface.js.map +1 -0
  32. package/dist/interfaces/row-level-security-migration-generator.interface.d.ts +65 -0
  33. package/dist/interfaces/row-level-security-migration-generator.interface.js +3 -0
  34. package/dist/interfaces/row-level-security-migration-generator.interface.js.map +1 -0
  35. package/dist/interfaces/row-level-security-options.interface.d.ts +18 -0
  36. package/dist/interfaces/row-level-security-options.interface.js +3 -0
  37. package/dist/interfaces/row-level-security-options.interface.js.map +1 -0
  38. package/dist/row-level-security-context.d.ts +14 -0
  39. package/dist/row-level-security-context.js +38 -0
  40. package/dist/row-level-security-context.js.map +1 -0
  41. package/dist/row-level-security-context.spec.d.ts +1 -0
  42. package/dist/row-level-security-context.spec.js +29 -0
  43. package/dist/row-level-security-context.spec.js.map +1 -0
  44. package/dist/row-level-security-entity-manager.d.ts +22 -0
  45. package/dist/row-level-security-entity-manager.js +135 -0
  46. package/dist/row-level-security-entity-manager.js.map +1 -0
  47. package/dist/row-level-security-entity-manager.spec.d.ts +1 -0
  48. package/dist/row-level-security-entity-manager.spec.js +200 -0
  49. package/dist/row-level-security-entity-manager.spec.js.map +1 -0
  50. package/dist/row-level-security-migration-generator.d.ts +14 -0
  51. package/dist/row-level-security-migration-generator.js +294 -0
  52. package/dist/row-level-security-migration-generator.js.map +1 -0
  53. package/dist/row-level-security-migration-generator.spec.d.ts +1 -0
  54. package/dist/row-level-security-migration-generator.spec.js +468 -0
  55. package/dist/row-level-security-migration-generator.spec.js.map +1 -0
  56. package/dist/row-level-security-migration.d.ts +11 -0
  57. package/dist/row-level-security-migration.js +28 -0
  58. package/dist/row-level-security-migration.js.map +1 -0
  59. package/dist/row-level-security-migration.spec.d.ts +1 -0
  60. package/dist/row-level-security-migration.spec.js +40 -0
  61. package/dist/row-level-security-migration.spec.js.map +1 -0
  62. package/dist/tsconfig.build.tsbuildinfo +1 -0
  63. package/dist/tsconfig.tsbuildinfo +1 -0
  64. package/dist/utils/assert-identifier.d.ts +2 -0
  65. package/dist/utils/assert-identifier.js +11 -0
  66. package/dist/utils/assert-identifier.js.map +1 -0
  67. package/dist/utils/assert-snake-case.d.ts +2 -0
  68. package/dist/utils/assert-snake-case.js +10 -0
  69. package/dist/utils/assert-snake-case.js.map +1 -0
  70. package/dist/utils/create-policy-bootstrap-sql-statements.d.ts +2 -0
  71. package/dist/utils/create-policy-bootstrap-sql-statements.js +17 -0
  72. package/dist/utils/create-policy-bootstrap-sql-statements.js.map +1 -0
  73. package/dist/utils/create-policy-down-sql.d.ts +3 -0
  74. package/dist/utils/create-policy-down-sql.js +30 -0
  75. package/dist/utils/create-policy-down-sql.js.map +1 -0
  76. package/dist/utils/create-policy-up-sql-statements.d.ts +3 -0
  77. package/dist/utils/create-policy-up-sql-statements.js +114 -0
  78. package/dist/utils/create-policy-up-sql-statements.js.map +1 -0
  79. package/dist/utils/default-row-level-security-options.d.ts +3 -0
  80. package/dist/utils/default-row-level-security-options.js +9 -0
  81. package/dist/utils/default-row-level-security-options.js.map +1 -0
  82. package/dist/utils/escape-sql-literal.d.ts +2 -0
  83. package/dist/utils/escape-sql-literal.js +8 -0
  84. package/dist/utils/escape-sql-literal.js.map +1 -0
  85. package/dist/utils/get-row-level-security-options.d.ts +8 -0
  86. package/dist/utils/get-row-level-security-options.js +9 -0
  87. package/dist/utils/get-row-level-security-options.js.map +1 -0
  88. package/dist/utils/index.d.ts +13 -0
  89. package/dist/utils/index.js +29 -0
  90. package/dist/utils/index.js.map +1 -0
  91. package/dist/utils/policy-migration-sql.spec.d.ts +1 -0
  92. package/dist/utils/policy-migration-sql.spec.js +168 -0
  93. package/dist/utils/policy-migration-sql.spec.js.map +1 -0
  94. package/dist/utils/policy-sql-options.d.ts +12 -0
  95. package/dist/utils/policy-sql-options.js +3 -0
  96. package/dist/utils/policy-sql-options.js.map +1 -0
  97. package/dist/utils/quote-identifier.d.ts +2 -0
  98. package/dist/utils/quote-identifier.js +10 -0
  99. package/dist/utils/quote-identifier.js.map +1 -0
  100. package/dist/utils/quote-qualified-identifier.d.ts +2 -0
  101. package/dist/utils/quote-qualified-identifier.js +9 -0
  102. package/dist/utils/quote-qualified-identifier.js.map +1 -0
  103. package/dist/utils/row-level-security-context-builder.d.ts +12 -0
  104. package/dist/utils/row-level-security-context-builder.js +40 -0
  105. package/dist/utils/row-level-security-context-builder.js.map +1 -0
  106. package/dist/utils/row-level-security-context-builder.spec.d.ts +1 -0
  107. package/dist/utils/row-level-security-context-builder.spec.js +40 -0
  108. package/dist/utils/row-level-security-context-builder.spec.js.map +1 -0
  109. package/dist/utils/row-level-security-context-builder.types.d.ts +10 -0
  110. package/dist/utils/row-level-security-context-builder.types.js +3 -0
  111. package/dist/utils/row-level-security-context-builder.types.js.map +1 -0
  112. package/dist/utils/row-level-security-options-state.d.ts +4 -0
  113. package/dist/utils/row-level-security-options-state.js +8 -0
  114. package/dist/utils/row-level-security-options-state.js.map +1 -0
  115. package/dist/utils/set-row-level-security-options.d.ts +3 -0
  116. package/dist/utils/set-row-level-security-options.js +13 -0
  117. package/dist/utils/set-row-level-security-options.js.map +1 -0
  118. package/package.json +77 -0
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RowLevelSecurityContextBuilder = void 0;
4
+ const assert_snake_case_1 = require("./assert-snake-case");
5
+ const escape_sql_literal_1 = require("./escape-sql-literal");
6
+ /** Builds SQL that writes RLS context values into PostgreSQL transaction settings. */
7
+ class RowLevelSecurityContextBuilder {
8
+ constructor() {
9
+ this.ctx = new Map();
10
+ this.namespace = "app";
11
+ }
12
+ /** Adds a context key and value, ignoring nullish values. */
13
+ set(key, value) {
14
+ (0, assert_snake_case_1.assertSnakeCase)(key, "Row level security context key");
15
+ if (value === null || value === undefined) {
16
+ return this;
17
+ }
18
+ this.ctx.set(key, String(value));
19
+ return this;
20
+ }
21
+ /** Returns the context entries that will be emitted to SQL. */
22
+ entries() {
23
+ return Array.from(this.ctx.entries());
24
+ }
25
+ /** Renders a `SELECT set_config(...)` statement for the collected entries. */
26
+ toSQL() {
27
+ const statements = this.entries()
28
+ .map(([key, value]) => {
29
+ const escapedValue = (0, escape_sql_literal_1.escapeSqlLiteral)(value);
30
+ return /* SQL */ `set_config('${this.namespace}.${key}', '${escapedValue}', true)`;
31
+ })
32
+ .join(",");
33
+ if (!statements) {
34
+ return "SELECT 1;";
35
+ }
36
+ return /* SQL */ `SELECT ${statements};`;
37
+ }
38
+ }
39
+ exports.RowLevelSecurityContextBuilder = RowLevelSecurityContextBuilder;
40
+ //# sourceMappingURL=row-level-security-context-builder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"row-level-security-context-builder.js","sourceRoot":"","sources":["../../src/utils/row-level-security-context-builder.ts"],"names":[],"mappings":";;;AAAA,2DAAsD;AACtD,6DAAwD;AAMxD,sFAAsF;AACtF,MAAa,8BAA8B;IAA3C;QACmB,QAAG,GAAG,IAAI,GAAG,EAAkB,CAAC;QAChC,cAAS,GAAG,KAAK,CAAC;IAqCrC,CAAC;IAnCC,6DAA6D;IAC7D,GAAG,CACD,GAAiB,EACjB,KAAmC;QAEnC,IAAA,mCAAe,EAAC,GAAG,EAAE,gCAAgC,CAAC,CAAC;QAEvD,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YAC1C,OAAO,IAAI,CAAC;QACd,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,+DAA+D;IAC/D,OAAO;QACL,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;IACxC,CAAC;IAED,8EAA8E;IAC9E,KAAK;QACH,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE;aAC9B,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;YACpB,MAAM,YAAY,GAAG,IAAA,qCAAgB,EAAC,KAAK,CAAC,CAAC;YAC7C,OAAO,SAAS,CAAC,eAAe,IAAI,CAAC,SAAS,IAAI,GAAG,OAAO,YAAY,UAAU,CAAC;QACrF,CAAC,CAAC;aACD,IAAI,CAAC,GAAG,CAAC,CAAC;QAEb,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,OAAO,WAAW,CAAC;QACrB,CAAC;QAED,OAAO,SAAS,CAAC,UAAU,UAAU,GAAG,CAAC;IAC3C,CAAC;CACF;AAvCD,wEAuCC"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const row_level_security_context_builder_1 = require("./row-level-security-context-builder");
4
+ describe("RowLevelSecurityContextBuilder", () => {
5
+ it("generates transaction-local tenant context SQL", () => {
6
+ const builder = new row_level_security_context_builder_1.RowLevelSecurityContextBuilder();
7
+ builder.set("request_id", "1");
8
+ builder.set("tenant_id", "42");
9
+ expect(builder.entries()).toEqual([
10
+ ["request_id", "1"],
11
+ ["tenant_id", "42"],
12
+ ]);
13
+ expect(builder.toSQL()).toBe("SELECT set_config('app.request_id', '1', true),set_config('app.tenant_id', '42', true);");
14
+ });
15
+ it("ignores null and undefined values", () => {
16
+ const builder = new row_level_security_context_builder_1.RowLevelSecurityContextBuilder();
17
+ builder.set("request_id", undefined);
18
+ builder.set("tenant_id", null);
19
+ builder.set("is_enabled", false);
20
+ expect(builder.entries()).toEqual([["is_enabled", "false"]]);
21
+ expect(builder.toSQL()).toBe("SELECT set_config('app.is_enabled', 'false', true);");
22
+ });
23
+ it("renders no-op SQL when every value is nullish", () => {
24
+ const builder = new row_level_security_context_builder_1.RowLevelSecurityContextBuilder();
25
+ builder.set("request_id", undefined);
26
+ builder.set("tenant_id", null);
27
+ expect(builder.entries()).toEqual([]);
28
+ expect(builder.toSQL()).toBe("SELECT 1;");
29
+ });
30
+ it("escapes string values for SQL literals", () => {
31
+ const builder = new row_level_security_context_builder_1.RowLevelSecurityContextBuilder();
32
+ builder.set("user_name", "O'Connor");
33
+ expect(builder.toSQL()).toBe("SELECT set_config('app.user_name', 'O''Connor', true);");
34
+ });
35
+ it("rejects non snake_case context keys", () => {
36
+ const builder = new row_level_security_context_builder_1.RowLevelSecurityContextBuilder();
37
+ expect(() => builder.set("userId", "1")).toThrow("Row level security context key must be snake_case");
38
+ });
39
+ });
40
+ //# sourceMappingURL=row-level-security-context-builder.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"row-level-security-context-builder.spec.js","sourceRoot":"","sources":["../../src/utils/row-level-security-context-builder.spec.ts"],"names":[],"mappings":";;AAAA,6FAAsF;AAEtF,QAAQ,CAAC,gCAAgC,EAAE,GAAG,EAAE;IAC9C,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;QACxD,MAAM,OAAO,GAAG,IAAI,mEAA8B,EAAE,CAAC;QAErD,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;QAC/B,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QAE/B,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC;YAChC,CAAC,YAAY,EAAE,GAAG,CAAC;YACnB,CAAC,WAAW,EAAE,IAAI,CAAC;SACpB,CAAC,CAAC;QACH,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CAC1B,yFAAyF,CAC1F,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;QAC3C,MAAM,OAAO,GAAG,IAAI,mEAA8B,EAAE,CAAC;QAErD,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;QACrC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QAC/B,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;QAEjC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;QAC7D,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CAC1B,qDAAqD,CACtD,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;QACvD,MAAM,OAAO,GAAG,IAAI,mEAA8B,EAAE,CAAC;QAErD,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;QACrC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QAE/B,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACtC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAChD,MAAM,OAAO,GAAG,IAAI,mEAA8B,EAAE,CAAC;QAErD,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;QAErC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CAC1B,wDAAwD,CACzD,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE;QAC7C,MAAM,OAAO,GAAG,IAAI,mEAA8B,EAAE,CAAC;QAErD,MAAM,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,QAAiB,EAAE,GAAG,CAAC,CAAC,CAAC,OAAO,CACvD,mDAAmD,CACpD,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ /** Lowercase letters allowed in snake_case context keys. */
2
+ export type LowercaseLetter = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z";
3
+ /** Characters allowed in snake_case context keys. */
4
+ export type ValidChar = LowercaseLetter | "_";
5
+ /** Compile-time predicate that checks whether a string contains only valid characters. */
6
+ export type IsValidSnakeCase<S extends string> = S extends `${infer First}${infer Rest}` ? First extends ValidChar ? IsValidSnakeCase<Rest> : false : true;
7
+ /** Compile-time snake_case constraint used by RLS context helpers. */
8
+ export type SnakeCase<S extends string> = S extends "" ? never : S extends `_${string}` | `${string}_` ? never : S extends `${string}__${string}` ? never : IsValidSnakeCase<S> extends true ? S : never;
9
+ /** Values that can be stored in RLS context and converted to PostgreSQL settings. */
10
+ export type RowLevelSecurityContextValue = string | number | boolean | null | undefined;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=row-level-security-context-builder.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"row-level-security-context-builder.types.js","sourceRoot":"","sources":["../../src/utils/row-level-security-context-builder.types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import { RowLevelSecurityOptions } from "../interfaces/row-level-security-options.interface";
2
+ export declare const rowLevelSecurityOptionsState: {
3
+ value: RowLevelSecurityOptions;
4
+ };
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rowLevelSecurityOptionsState = void 0;
4
+ const default_row_level_security_options_1 = require("./default-row-level-security-options");
5
+ exports.rowLevelSecurityOptionsState = {
6
+ value: default_row_level_security_options_1.DEFAULT_ROW_LEVEL_SECURITY_OPTIONS,
7
+ };
8
+ //# sourceMappingURL=row-level-security-options-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"row-level-security-options-state.js","sourceRoot":"","sources":["../../src/utils/row-level-security-options-state.ts"],"names":[],"mappings":";;;AACA,6FAA0F;AAE7E,QAAA,4BAA4B,GAErC;IACF,KAAK,EAAE,uEAAkC;CAC1C,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { RowLevelSecurityOptions } from "../interfaces/row-level-security-options.interface";
2
+ /** Replaces the process-level RLS options used by {@link RowLevelSecurityEntityManager}. */
3
+ export declare function setRowLevelSecurityOptions(options?: RowLevelSecurityOptions): void;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setRowLevelSecurityOptions = setRowLevelSecurityOptions;
4
+ const default_row_level_security_options_1 = require("./default-row-level-security-options");
5
+ const row_level_security_options_state_1 = require("./row-level-security-options-state");
6
+ /** Replaces the process-level RLS options used by {@link RowLevelSecurityEntityManager}. */
7
+ function setRowLevelSecurityOptions(options = {}) {
8
+ row_level_security_options_state_1.rowLevelSecurityOptionsState.value = {
9
+ ...default_row_level_security_options_1.DEFAULT_ROW_LEVEL_SECURITY_OPTIONS,
10
+ ...options,
11
+ };
12
+ }
13
+ //# sourceMappingURL=set-row-level-security-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set-row-level-security-options.js","sourceRoot":"","sources":["../../src/utils/set-row-level-security-options.ts"],"names":[],"mappings":";;AAKA,gEAOC;AAXD,6FAA0F;AAC1F,yFAAkF;AAElF,4FAA4F;AAC5F,SAAgB,0BAA0B,CACxC,UAAmC,EAAE;IAErC,+DAA4B,CAAC,KAAK,GAAG;QACnC,GAAG,uEAAkC;QACrC,GAAG,OAAO;KACX,CAAC;AACJ,CAAC"}
package/package.json ADDED
@@ -0,0 +1,77 @@
1
+ {
2
+ "name": "@nest-boot/row-level-security",
3
+ "version": "7.0.0",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "https://github.com/nest-boot/nest-boot.git",
7
+ "directory": "packages/row-level-security"
8
+ },
9
+ "description": "PostgreSQL row level security helpers for Nest Boot applications",
10
+ "author": {
11
+ "name": "Xudong Huang",
12
+ "email": "me@huangxudong.com",
13
+ "url": "https://www.huangxudong.com/"
14
+ },
15
+ "homepage": "",
16
+ "license": "MIT",
17
+ "main": "dist/index.js",
18
+ "types": "dist/index.d.ts",
19
+ "directories": {
20
+ "lib": "dist"
21
+ },
22
+ "files": [
23
+ "dist"
24
+ ],
25
+ "peerDependencies": {
26
+ "@mikro-orm/migrations": "^6.0.0",
27
+ "@mikro-orm/postgresql": "^6.0.0",
28
+ "@nest-boot/request-context": "^7.4.3",
29
+ "reflect-metadata": "^0.2.2"
30
+ },
31
+ "devDependencies": {
32
+ "@mikro-orm/core": "6.6.2",
33
+ "@mikro-orm/migrations": "6.6.2",
34
+ "@mikro-orm/nestjs": "^6.1.1",
35
+ "@mikro-orm/postgresql": "6.6.2",
36
+ "@mikro-orm/reflection": "6.6.2",
37
+ "@nestjs/common": "^11.1.11",
38
+ "@nestjs/core": "^11.1.11",
39
+ "@nestjs/testing": "^11.1.11",
40
+ "@types/jest": "^29.5.14",
41
+ "@types/node": "^22.18.6",
42
+ "dotenv": "^17.2.3",
43
+ "eslint": "^9.39.3",
44
+ "jest": "^29.7.0",
45
+ "reflect-metadata": "^0.2.2",
46
+ "rxjs": "^7.8.2",
47
+ "ts-jest": "^29.4.4",
48
+ "typescript": "^5.9.3",
49
+ "@nest-boot/eslint-config": "^7.0.3",
50
+ "@nest-boot/mikro-orm": "^7.4.0",
51
+ "@nest-boot/request-context": "^7.4.3",
52
+ "@nest-boot/tsconfig": "^7.0.1",
53
+ "@nest-boot/eslint-plugin": "^7.0.5"
54
+ },
55
+ "publishConfig": {
56
+ "access": "public"
57
+ },
58
+ "lint-staged": {
59
+ "*.ts": [
60
+ "prettier --write",
61
+ "eslint --fix"
62
+ ]
63
+ },
64
+ "volta": {
65
+ "extends": "../../package.json"
66
+ },
67
+ "scripts": {
68
+ "build": "tsc -p tsconfig.build.json",
69
+ "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
70
+ "dev": "tsc -w -p tsconfig.build.json",
71
+ "lint": "eslint \"{src,test}/**/*.ts\" --fix",
72
+ "test": "jest",
73
+ "test:cov": "jest --coverage",
74
+ "test:watch": "jest --watch",
75
+ "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand"
76
+ }
77
+ }