@kyro-cms/core 0.1.6 → 0.1.7

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 (170) hide show
  1. package/dist/WebhookService-BCgL1bLF.d.cts +112 -0
  2. package/dist/WebhookService-BPVJUgTl.d.ts +112 -0
  3. package/dist/{base-DlhVlwnN.d.cts → base-B0Y6isUJ.d.cts} +1 -1
  4. package/dist/{base-CQkFzqQl.d.ts → base-DaP-5PPG.d.ts} +1 -1
  5. package/dist/bootstrap-BMWVB2T6.cjs +31 -0
  6. package/dist/{bootstrap-WMWQ4DBX.cjs.map → bootstrap-BMWVB2T6.cjs.map} +1 -1
  7. package/dist/bootstrap-LL6O7PWO.js +6 -0
  8. package/dist/{bootstrap-WOVGAKZP.js.map → bootstrap-LL6O7PWO.js.map} +1 -1
  9. package/dist/{chunk-3VZCX4DF.cjs → chunk-42JPONZU.cjs} +77 -14
  10. package/dist/chunk-42JPONZU.cjs.map +1 -0
  11. package/dist/{chunk-3EVLFWH2.cjs → chunk-4M5PHMUE.cjs} +60 -346
  12. package/dist/chunk-4M5PHMUE.cjs.map +1 -0
  13. package/dist/chunk-4PWRCMTQ.cjs +15 -0
  14. package/dist/chunk-4PWRCMTQ.cjs.map +1 -0
  15. package/dist/chunk-6COM32WF.js +47 -0
  16. package/dist/chunk-6COM32WF.js.map +1 -0
  17. package/dist/chunk-6MSSF46R.js +941 -0
  18. package/dist/chunk-6MSSF46R.js.map +1 -0
  19. package/dist/{chunk-TZFJMPCH.cjs → chunk-7YITG2US.cjs} +9 -18
  20. package/dist/chunk-7YITG2US.cjs.map +1 -0
  21. package/dist/{chunk-A3RQWHKD.cjs → chunk-BLMFBDBG.cjs} +56 -6
  22. package/dist/chunk-BLMFBDBG.cjs.map +1 -0
  23. package/dist/{chunk-EINVJPFM.js → chunk-BTOE3VUK.js} +65 -3
  24. package/dist/chunk-BTOE3VUK.js.map +1 -0
  25. package/dist/chunk-E5X75WNB.js +497 -0
  26. package/dist/chunk-E5X75WNB.js.map +1 -0
  27. package/dist/chunk-E63IF3MD.cjs +951 -0
  28. package/dist/chunk-E63IF3MD.cjs.map +1 -0
  29. package/dist/{chunk-K7QF2QCM.cjs → chunk-FTSSDDZQ.cjs} +7 -3
  30. package/dist/chunk-FTSSDDZQ.cjs.map +1 -0
  31. package/dist/chunk-G7VZBCD6.cjs +35 -0
  32. package/dist/{chunk-5BLDMQED.cjs.map → chunk-G7VZBCD6.cjs.map} +1 -1
  33. package/dist/{chunk-VMSRTAH7.js → chunk-GLCPGZPM.js} +56 -6
  34. package/dist/chunk-GLCPGZPM.js.map +1 -0
  35. package/dist/{chunk-V3B25QOK.cjs → chunk-GVFB5C6O.cjs} +74 -2
  36. package/dist/chunk-GVFB5C6O.cjs.map +1 -0
  37. package/dist/chunk-HVSQDZZJ.cjs +765 -0
  38. package/dist/chunk-HVSQDZZJ.cjs.map +1 -0
  39. package/dist/chunk-HYC4GNHX.js +758 -0
  40. package/dist/chunk-HYC4GNHX.js.map +1 -0
  41. package/dist/chunk-KDVDIZ4Y.cjs +3479 -0
  42. package/dist/chunk-KDVDIZ4Y.cjs.map +1 -0
  43. package/dist/{chunk-OG3KX56O.js → chunk-KWGNR4HM.js} +7 -3
  44. package/dist/chunk-KWGNR4HM.js.map +1 -0
  45. package/dist/chunk-LIJVWQKU.cjs +256 -0
  46. package/dist/chunk-LIJVWQKU.cjs.map +1 -0
  47. package/dist/{chunk-XTZSUDSI.js → chunk-LTRCYJAG.js} +3 -18
  48. package/dist/chunk-LTRCYJAG.js.map +1 -0
  49. package/dist/{chunk-UEYC46RL.js → chunk-OUGKLCYF.js} +71 -8
  50. package/dist/chunk-OUGKLCYF.js.map +1 -0
  51. package/dist/chunk-RONAX6UU.js +3456 -0
  52. package/dist/chunk-RONAX6UU.js.map +1 -0
  53. package/dist/{chunk-5Y7QGIHD.js → chunk-RRYXQMZG.js} +60 -344
  54. package/dist/chunk-RRYXQMZG.js.map +1 -0
  55. package/dist/{chunk-QUJ4OLSC.js → chunk-U74F3YZU.js} +87 -7
  56. package/dist/chunk-U74F3YZU.js.map +1 -0
  57. package/dist/chunk-VIONYQ2K.cjs +517 -0
  58. package/dist/chunk-VIONYQ2K.cjs.map +1 -0
  59. package/dist/chunk-VSTRLXMQ.cjs +50 -0
  60. package/dist/chunk-VSTRLXMQ.cjs.map +1 -0
  61. package/dist/chunk-YT7HXXVN.js +13 -0
  62. package/dist/chunk-YT7HXXVN.js.map +1 -0
  63. package/dist/chunk-Z6ZWNWWR.js +30 -0
  64. package/dist/{chunk-NSBPE2FW.js.map → chunk-Z6ZWNWWR.js.map} +1 -1
  65. package/dist/cli/index.cjs +11 -7
  66. package/dist/cli/index.cjs.map +1 -1
  67. package/dist/cli/index.js +11 -7
  68. package/dist/cli/index.js.map +1 -1
  69. package/dist/drizzle/index.cjs +20 -17
  70. package/dist/drizzle/index.d.cts +4 -4
  71. package/dist/drizzle/index.d.ts +4 -4
  72. package/dist/drizzle/index.js +4 -5
  73. package/dist/graphql/index.cjs +4 -4
  74. package/dist/graphql/index.d.cts +3 -2
  75. package/dist/graphql/index.d.ts +3 -2
  76. package/dist/graphql/index.js +2 -2
  77. package/dist/{index-DI0DRPNv.d.cts → index-BwE4NueJ.d.cts} +1 -1
  78. package/dist/{index-CMUNCIWQ.d.ts → index-DUKmDSeC.d.cts} +96 -24
  79. package/dist/{index-BMySjW6o.d.cts → index-DtBi3zP0.d.ts} +96 -24
  80. package/dist/{index-4fJKLFK2.d.ts → index-DupWTmW6.d.ts} +1 -1
  81. package/dist/index.cjs +3317 -352
  82. package/dist/index.cjs.map +1 -1
  83. package/dist/index.d.cts +379 -105
  84. package/dist/index.d.ts +379 -105
  85. package/dist/index.js +3211 -310
  86. package/dist/index.js.map +1 -1
  87. package/dist/media-HOT3O7RW.js +4 -0
  88. package/dist/media-HOT3O7RW.js.map +1 -0
  89. package/dist/media-WKP5AOX2.cjs +17 -0
  90. package/dist/media-WKP5AOX2.cjs.map +1 -0
  91. package/dist/mongodb/index.cjs +1 -1
  92. package/dist/mongodb/index.d.cts +2 -2
  93. package/dist/mongodb/index.d.ts +2 -2
  94. package/dist/mongodb/index.js +1 -1
  95. package/dist/mysql-media-AI6YK767.cjs +48 -0
  96. package/dist/mysql-media-AI6YK767.cjs.map +1 -0
  97. package/dist/mysql-media-CDZUS7YX.js +45 -0
  98. package/dist/mysql-media-CDZUS7YX.js.map +1 -0
  99. package/dist/postgres-auth-adapter-EVRPO7BQ.cjs +14 -0
  100. package/dist/{postgres-auth-adapter-VK6GY7LX.cjs.map → postgres-auth-adapter-EVRPO7BQ.cjs.map} +1 -1
  101. package/dist/postgres-auth-adapter-OTRWSTT5.js +5 -0
  102. package/dist/{postgres-auth-adapter-REJFUMP7.js.map → postgres-auth-adapter-OTRWSTT5.js.map} +1 -1
  103. package/dist/redis-adapter-2N6VA7BI.cjs +13 -0
  104. package/dist/{redis-adapter-LBLNKGNS.cjs.map → redis-adapter-2N6VA7BI.cjs.map} +1 -1
  105. package/dist/redis-adapter-RA24FNCX.js +4 -0
  106. package/dist/{redis-adapter-4YDY4LWE.js.map → redis-adapter-RA24FNCX.js.map} +1 -1
  107. package/dist/rest/index.cjs +7 -5
  108. package/dist/rest/index.d.cts +29 -3
  109. package/dist/rest/index.d.ts +29 -3
  110. package/dist/rest/index.js +5 -3
  111. package/dist/schema-CNB2DDTX.js +6 -0
  112. package/dist/schema-CNB2DDTX.js.map +1 -0
  113. package/dist/schema-Y777CQQS.cjs +67 -0
  114. package/dist/schema-Y777CQQS.cjs.map +1 -0
  115. package/dist/templates/index.cjs +24 -28
  116. package/dist/templates/index.d.cts +2 -4
  117. package/dist/templates/index.d.ts +2 -4
  118. package/dist/templates/index.js +2 -2
  119. package/dist/trpc/index.cjs +12 -12
  120. package/dist/trpc/index.d.cts +19 -14
  121. package/dist/trpc/index.d.ts +19 -14
  122. package/dist/trpc/index.js +3 -3
  123. package/dist/{types-BGM5MV_K.d.cts → types-BM0s_YOy.d.cts} +67 -35
  124. package/dist/{types-BGM5MV_K.d.ts → types-BM0s_YOy.d.ts} +67 -35
  125. package/dist/ws/index.cjs +1 -1
  126. package/dist/ws/index.js +1 -1
  127. package/package.json +11 -1
  128. package/dist/bootstrap-WMWQ4DBX.cjs +0 -29
  129. package/dist/bootstrap-WOVGAKZP.js +0 -4
  130. package/dist/chunk-3EVLFWH2.cjs.map +0 -1
  131. package/dist/chunk-3QX6KG2S.js +0 -2125
  132. package/dist/chunk-3QX6KG2S.js.map +0 -1
  133. package/dist/chunk-3VZCX4DF.cjs.map +0 -1
  134. package/dist/chunk-5BLDMQED.cjs +0 -18
  135. package/dist/chunk-5Y7QGIHD.js.map +0 -1
  136. package/dist/chunk-7G6EVYCU.cjs +0 -94
  137. package/dist/chunk-7G6EVYCU.cjs.map +0 -1
  138. package/dist/chunk-A3RQWHKD.cjs.map +0 -1
  139. package/dist/chunk-EINVJPFM.js.map +0 -1
  140. package/dist/chunk-F5B64H5S.cjs +0 -2149
  141. package/dist/chunk-F5B64H5S.cjs.map +0 -1
  142. package/dist/chunk-K7QF2QCM.cjs.map +0 -1
  143. package/dist/chunk-LRTZJJPD.js +0 -86
  144. package/dist/chunk-LRTZJJPD.js.map +0 -1
  145. package/dist/chunk-NSBPE2FW.js +0 -15
  146. package/dist/chunk-OG3KX56O.js.map +0 -1
  147. package/dist/chunk-QUJ4OLSC.js.map +0 -1
  148. package/dist/chunk-R3XIBBAW.cjs +0 -34
  149. package/dist/chunk-R3XIBBAW.cjs.map +0 -1
  150. package/dist/chunk-SDMNUYVU.js +0 -30
  151. package/dist/chunk-SDMNUYVU.js.map +0 -1
  152. package/dist/chunk-TZFJMPCH.cjs.map +0 -1
  153. package/dist/chunk-UEG7KMKC.cjs +0 -228
  154. package/dist/chunk-UEG7KMKC.cjs.map +0 -1
  155. package/dist/chunk-UEYC46RL.js.map +0 -1
  156. package/dist/chunk-V3B25QOK.cjs.map +0 -1
  157. package/dist/chunk-VMSRTAH7.js.map +0 -1
  158. package/dist/chunk-XTZSUDSI.js.map +0 -1
  159. package/dist/chunk-YD7Y25W7.cjs +0 -176
  160. package/dist/chunk-YD7Y25W7.cjs.map +0 -1
  161. package/dist/chunk-YPAFJ7EV.js +0 -225
  162. package/dist/chunk-YPAFJ7EV.js.map +0 -1
  163. package/dist/database-7CJOXEZR.js +0 -5
  164. package/dist/database-7CJOXEZR.js.map +0 -1
  165. package/dist/database-QOIV44GT.cjs +0 -22
  166. package/dist/database-QOIV44GT.cjs.map +0 -1
  167. package/dist/postgres-auth-adapter-REJFUMP7.js +0 -5
  168. package/dist/postgres-auth-adapter-VK6GY7LX.cjs +0 -14
  169. package/dist/redis-adapter-4YDY4LWE.js +0 -4
  170. package/dist/redis-adapter-LBLNKGNS.cjs +0 -13
@@ -1,45 +1,48 @@
1
1
  'use strict';
2
2
 
3
- var chunkV3B25QOK_cjs = require('../chunk-V3B25QOK.cjs');
4
- var chunkYD7Y25W7_cjs = require('../chunk-YD7Y25W7.cjs');
5
- var chunk7G6EVYCU_cjs = require('../chunk-7G6EVYCU.cjs');
6
- require('../chunk-TZFJMPCH.cjs');
3
+ var chunkGVFB5C6O_cjs = require('../chunk-GVFB5C6O.cjs');
4
+ var chunkLIJVWQKU_cjs = require('../chunk-LIJVWQKU.cjs');
5
+ require('../chunk-7YITG2US.cjs');
7
6
  require('../chunk-RLTG4YZM.cjs');
8
- require('../chunk-5BLDMQED.cjs');
7
+ require('../chunk-G7VZBCD6.cjs');
9
8
 
10
9
 
11
10
 
12
11
  Object.defineProperty(exports, "DrizzleAdapter", {
13
12
  enumerable: true,
14
- get: function () { return chunkV3B25QOK_cjs.DrizzleAdapter; }
13
+ get: function () { return chunkGVFB5C6O_cjs.DrizzleAdapter; }
15
14
  });
16
15
  Object.defineProperty(exports, "collectionToDrizzleSchema", {
17
16
  enumerable: true,
18
- get: function () { return chunkV3B25QOK_cjs.collectionToDrizzleSchema; }
17
+ get: function () { return chunkGVFB5C6O_cjs.collectionToDrizzleSchema; }
19
18
  });
20
- Object.defineProperty(exports, "createDrizzleAdapter", {
19
+ Object.defineProperty(exports, "createDatabase", {
21
20
  enumerable: true,
22
- get: function () { return chunkV3B25QOK_cjs.createDrizzleAdapter; }
21
+ get: function () { return chunkGVFB5C6O_cjs.createDatabase; }
23
22
  });
24
- Object.defineProperty(exports, "fieldToDrizzleType", {
23
+ Object.defineProperty(exports, "createDrizzleAdapter", {
25
24
  enumerable: true,
26
- get: function () { return chunkV3B25QOK_cjs.fieldToDrizzleType; }
25
+ get: function () { return chunkGVFB5C6O_cjs.createDrizzleAdapter; }
27
26
  });
28
- Object.defineProperty(exports, "PostgresAuthAdapter", {
27
+ Object.defineProperty(exports, "fieldToDrizzleType", {
29
28
  enumerable: true,
30
- get: function () { return chunkYD7Y25W7_cjs.PostgresAuthAdapter; }
29
+ get: function () { return chunkGVFB5C6O_cjs.fieldToDrizzleType; }
31
30
  });
32
- Object.defineProperty(exports, "createDatabase", {
31
+ Object.defineProperty(exports, "genId", {
33
32
  enumerable: true,
34
- get: function () { return chunk7G6EVYCU_cjs.createDatabase; }
33
+ get: function () { return chunkGVFB5C6O_cjs.genId; }
35
34
  });
36
35
  Object.defineProperty(exports, "runMigrations", {
37
36
  enumerable: true,
38
- get: function () { return chunk7G6EVYCU_cjs.runMigrations; }
37
+ get: function () { return chunkGVFB5C6O_cjs.runMigrations; }
39
38
  });
40
39
  Object.defineProperty(exports, "seedDefaultRoles", {
41
40
  enumerable: true,
42
- get: function () { return chunk7G6EVYCU_cjs.seedDefaultRoles; }
41
+ get: function () { return chunkGVFB5C6O_cjs.seedDefaultRoles; }
42
+ });
43
+ Object.defineProperty(exports, "PostgresAuthAdapter", {
44
+ enumerable: true,
45
+ get: function () { return chunkLIJVWQKU_cjs.PostgresAuthAdapter; }
43
46
  });
44
47
  //# sourceMappingURL=index.cjs.map
45
48
  //# sourceMappingURL=index.cjs.map
@@ -1,5 +1,5 @@
1
- export { D as DrizzleAdapter, P as PostgresAuthAdapter, d as collectionToDrizzleSchema, e as createDatabase, f as createDrizzleAdapter, g as fieldToDrizzleType, r as runMigrations, s as seedDefaultRoles } from '../index-BMySjW6o.cjs';
2
- import '../base-DlhVlwnN.cjs';
3
- import '../types-BGM5MV_K.cjs';
1
+ export { D as Dialect, h as DrizzleAdapter, P as PostgresAuthAdapter, i as collectionToDrizzleSchema, k as createDatabase, l as createDrizzleAdapter, m as fieldToDrizzleType, n as genId, r as runMigrations, s as seedDefaultRoles } from '../index-DUKmDSeC.cjs';
2
+ import '../base-B0Y6isUJ.cjs';
3
+ import '../types-BM0s_YOy.cjs';
4
4
  import 'drizzle-orm/postgres-js';
5
- import 'postgres';
5
+ import 'ioredis';
@@ -1,5 +1,5 @@
1
- export { D as DrizzleAdapter, P as PostgresAuthAdapter, d as collectionToDrizzleSchema, e as createDatabase, f as createDrizzleAdapter, g as fieldToDrizzleType, r as runMigrations, s as seedDefaultRoles } from '../index-CMUNCIWQ.js';
2
- import '../base-CQkFzqQl.js';
3
- import '../types-BGM5MV_K.js';
1
+ export { D as Dialect, h as DrizzleAdapter, P as PostgresAuthAdapter, i as collectionToDrizzleSchema, k as createDatabase, l as createDrizzleAdapter, m as fieldToDrizzleType, n as genId, r as runMigrations, s as seedDefaultRoles } from '../index-DtBi3zP0.js';
2
+ import '../base-DaP-5PPG.js';
3
+ import '../types-BM0s_YOy.js';
4
4
  import 'drizzle-orm/postgres-js';
5
- import 'postgres';
5
+ import 'ioredis';
@@ -1,8 +1,7 @@
1
- export { DrizzleAdapter, collectionToDrizzleSchema, createDrizzleAdapter, fieldToDrizzleType } from '../chunk-EINVJPFM.js';
2
- export { PostgresAuthAdapter } from '../chunk-QUJ4OLSC.js';
3
- export { createDatabase, runMigrations, seedDefaultRoles } from '../chunk-LRTZJJPD.js';
4
- import '../chunk-XTZSUDSI.js';
1
+ export { DrizzleAdapter, collectionToDrizzleSchema, createDatabase, createDrizzleAdapter, fieldToDrizzleType, genId, runMigrations, seedDefaultRoles } from '../chunk-BTOE3VUK.js';
2
+ export { PostgresAuthAdapter } from '../chunk-U74F3YZU.js';
3
+ import '../chunk-LTRCYJAG.js';
5
4
  import '../chunk-BXMWDUED.js';
6
- import '../chunk-NSBPE2FW.js';
5
+ import '../chunk-Z6ZWNWWR.js';
7
6
  //# sourceMappingURL=index.js.map
8
7
  //# sourceMappingURL=index.js.map
@@ -1,17 +1,17 @@
1
1
  'use strict';
2
2
 
3
- var chunkK7QF2QCM_cjs = require('../chunk-K7QF2QCM.cjs');
4
- require('../chunk-5BLDMQED.cjs');
3
+ var chunkFTSSDDZQ_cjs = require('../chunk-FTSSDDZQ.cjs');
4
+ require('../chunk-G7VZBCD6.cjs');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "buildGraphQLSchema", {
9
9
  enumerable: true,
10
- get: function () { return chunkK7QF2QCM_cjs.buildGraphQLSchema; }
10
+ get: function () { return chunkFTSSDDZQ_cjs.buildGraphQLSchema; }
11
11
  });
12
12
  Object.defineProperty(exports, "createGraphQLSchema", {
13
13
  enumerable: true,
14
- get: function () { return chunkK7QF2QCM_cjs.createGraphQLSchema; }
14
+ get: function () { return chunkFTSSDDZQ_cjs.createGraphQLSchema; }
15
15
  });
16
16
  //# sourceMappingURL=index.cjs.map
17
17
  //# sourceMappingURL=index.cjs.map
@@ -1,6 +1,6 @@
1
1
  import { GraphQLSchema } from 'graphql';
2
- import { B as BaseAdapter, f as User, g as Request } from '../types-BGM5MV_K.cjs';
3
- import { R as Registry } from '../index-DI0DRPNv.cjs';
2
+ import { B as BaseAdapter, f as User, g as Request } from '../types-BM0s_YOy.cjs';
3
+ import { R as Registry } from '../index-BwE4NueJ.cjs';
4
4
  import 'zod';
5
5
 
6
6
  interface GraphQLSchemaOptions {
@@ -9,6 +9,7 @@ interface GraphQLSchemaOptions {
9
9
  user?: User;
10
10
  req?: Request;
11
11
  tenantID?: string;
12
+ settings?: Record<string, any>;
12
13
  }
13
14
  declare function buildGraphQLSchema(options: GraphQLSchemaOptions): GraphQLSchema;
14
15
  declare function createGraphQLSchema(registry: Registry, db: BaseAdapter, options?: {
@@ -1,6 +1,6 @@
1
1
  import { GraphQLSchema } from 'graphql';
2
- import { B as BaseAdapter, f as User, g as Request } from '../types-BGM5MV_K.js';
3
- import { R as Registry } from '../index-4fJKLFK2.js';
2
+ import { B as BaseAdapter, f as User, g as Request } from '../types-BM0s_YOy.js';
3
+ import { R as Registry } from '../index-DupWTmW6.js';
4
4
  import 'zod';
5
5
 
6
6
  interface GraphQLSchemaOptions {
@@ -9,6 +9,7 @@ interface GraphQLSchemaOptions {
9
9
  user?: User;
10
10
  req?: Request;
11
11
  tenantID?: string;
12
+ settings?: Record<string, any>;
12
13
  }
13
14
  declare function buildGraphQLSchema(options: GraphQLSchemaOptions): GraphQLSchema;
14
15
  declare function createGraphQLSchema(registry: Registry, db: BaseAdapter, options?: {
@@ -1,4 +1,4 @@
1
- export { buildGraphQLSchema, createGraphQLSchema } from '../chunk-OG3KX56O.js';
2
- import '../chunk-NSBPE2FW.js';
1
+ export { buildGraphQLSchema, createGraphQLSchema } from '../chunk-KWGNR4HM.js';
2
+ import '../chunk-Z6ZWNWWR.js';
3
3
  //# sourceMappingURL=index.js.map
4
4
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import { C as CollectionConfig, G as GlobalConfig, P as PluginConfig, F as Field } from './types-BGM5MV_K.cjs';
1
+ import { C as CollectionConfig, G as GlobalConfig, P as PluginConfig, F as Field } from './types-BM0s_YOy.cjs';
2
2
  import { ZodTypeAny } from 'zod';
3
3
 
4
4
  declare class Registry {
@@ -1,8 +1,7 @@
1
- import { A as AbstractBaseAdapter } from './base-CQkFzqQl.js';
2
- import { a as FindArgs, b as FindResult, c as FindByIDArgs, d as CreateArgs, U as UpdateArgs, D as DeleteArgs, C as CollectionConfig, F as Field } from './types-BGM5MV_K.js';
3
- import * as drizzle_orm_postgres_js from 'drizzle-orm/postgres-js';
4
- import { PostgresJsDatabase, drizzle } from 'drizzle-orm/postgres-js';
5
- import postgres from 'postgres';
1
+ import { A as AbstractBaseAdapter } from './base-B0Y6isUJ.cjs';
2
+ import { a as FindArgs, b as FindResult, c as FindByIDArgs, d as CreateArgs, U as UpdateArgs, D as DeleteArgs, C as CollectionConfig, F as Field } from './types-BM0s_YOy.cjs';
3
+ import { PostgresJsDatabase } from 'drizzle-orm/postgres-js';
4
+ import Redis from 'ioredis';
6
5
 
7
6
  declare function fieldToDrizzleType(field: Field, dialect?: 'postgres' | 'mysql' | 'sqlite'): string;
8
7
  declare function collectionToDrizzleSchema(collection: CollectionConfig, dialect?: 'postgres' | 'mysql' | 'sqlite'): string;
@@ -49,6 +48,70 @@ declare function createDrizzleAdapter(options: {
49
48
  schema?: any;
50
49
  }): DrizzleAdapter;
51
50
 
51
+ type AuditAction = "login" | "logout" | "login_failed" | "register" | "verify_email" | "password_change" | "password_reset" | "password_reset_request" | "role_change" | "permission_change" | "document_create" | "document_update" | "document_delete" | "settings_change" | "user_lockout" | "user_unlock" | "user_create" | "user_update" | "user_delete" | "api_request" | "api_key_create" | "api_key_delete" | "tenant_create" | "tenant_delete";
52
+ interface AuditLog {
53
+ id: string;
54
+ timestamp: Date;
55
+ action: AuditAction;
56
+ userId?: string;
57
+ userEmail?: string;
58
+ role?: string;
59
+ resource: string;
60
+ resourceId?: string;
61
+ changes?: {
62
+ field: string;
63
+ old: any;
64
+ new: any;
65
+ }[];
66
+ ipAddress?: string;
67
+ userAgent?: string;
68
+ success: boolean;
69
+ error?: string;
70
+ metadata?: Record<string, any>;
71
+ }
72
+ interface AuditLogFilter {
73
+ userId?: string;
74
+ action?: AuditAction | AuditAction[];
75
+ resource?: string;
76
+ resourceId?: string;
77
+ success?: boolean;
78
+ startDate?: Date;
79
+ endDate?: Date;
80
+ limit?: number;
81
+ offset?: number;
82
+ }
83
+ declare class AuditLogger {
84
+ private redis;
85
+ private prefix;
86
+ private retentionDays;
87
+ constructor(redis: Redis, retentionDays?: number, prefix?: string);
88
+ log(data: Omit<AuditLog, "id" | "timestamp">): Promise<string>;
89
+ get(id: string): Promise<AuditLog | null>;
90
+ query(filter?: AuditLogFilter): Promise<{
91
+ logs: AuditLog[];
92
+ total: number;
93
+ }>;
94
+ getRecent(limit?: number): Promise<AuditLog[]>;
95
+ getUserActivity(userId: string, limit?: number): Promise<AuditLog[]>;
96
+ getStats(startDate?: Date, endDate?: Date): Promise<{
97
+ totalEvents: number;
98
+ byAction: Record<string, number>;
99
+ successRate: number;
100
+ failedLogins: number;
101
+ uniqueUsers: Set<string>;
102
+ }>;
103
+ cleanup(): Promise<number>;
104
+ private getKeyForDate;
105
+ private getKeysForDateRange;
106
+ private matchesFilter;
107
+ private serializeLog;
108
+ private deserializeLog;
109
+ }
110
+ declare function createAuditContext(req: Request): {
111
+ ipAddress: string;
112
+ userAgent: string;
113
+ };
114
+
52
115
  interface AuthUser {
53
116
  id: string;
54
117
  email: string;
@@ -109,15 +172,17 @@ interface AuthResult {
109
172
  interface AuthAdapter {
110
173
  createUser(data: {
111
174
  email: string;
112
- passwordHash: string;
113
- role: UserRole;
175
+ password: string;
176
+ role?: UserRole;
114
177
  tenantId?: string;
115
178
  }): Promise<AuthUser>;
116
179
  findUserByEmail(email: string): Promise<AuthUser | null>;
117
180
  findUserById(id: string): Promise<AuthUser | null>;
118
- updateUser(id: string, data: Partial<AuthUser>): Promise<AuthUser | null>;
181
+ updateUser(id: string, data: Partial<AuthUser> & {
182
+ password?: string;
183
+ }): Promise<AuthUser | null>;
119
184
  deleteUser(id: string): Promise<boolean>;
120
- verifyPassword(password: string, hash: string): Promise<boolean>;
185
+ verifyPassword(email: string, password: string): Promise<AuthUser | null>;
121
186
  hashPassword(password: string): Promise<string>;
122
187
  createSession(userId: string, data?: {
123
188
  ipAddress?: string;
@@ -132,6 +197,11 @@ interface AuthAdapter {
132
197
  addPasswordToHistory?(userId: string, passwordHash: string): Promise<void>;
133
198
  getPasswordHistory?(userId: string, count?: number): Promise<string[]>;
134
199
  isPasswordInHistory?(password: string, userId: string, historyCount?: number): Promise<boolean>;
200
+ findAuditLogs(filter: AuditLogFilter): Promise<{
201
+ logs: AuditLog[];
202
+ total: number;
203
+ }>;
204
+ createAuditLog(data: Omit<AuditLog, "id" | "timestamp">): Promise<AuditLog>;
135
205
  }
136
206
 
137
207
  interface PostgresAuthAdapterOptions {
@@ -148,7 +218,7 @@ declare class PostgresAuthAdapter implements AuthAdapter {
148
218
  constructor(options: PostgresAuthAdapterOptions);
149
219
  createUser(data: {
150
220
  email: string;
151
- passwordHash: string;
221
+ password: string;
152
222
  role?: UserRole;
153
223
  tenantId?: string;
154
224
  }): Promise<AuthUser>;
@@ -156,7 +226,7 @@ declare class PostgresAuthAdapter implements AuthAdapter {
156
226
  findUserById(id: string): Promise<AuthUser | null>;
157
227
  updateUser(id: string, data: Partial<AuthUser>): Promise<AuthUser | null>;
158
228
  deleteUser(id: string): Promise<boolean>;
159
- verifyPassword(password: string, hash: string): Promise<boolean>;
229
+ verifyPassword(email: string, password: string): Promise<AuthUser | null>;
160
230
  hashPassword(password: string): Promise<string>;
161
231
  createSession(userId: string, data?: {
162
232
  ipAddress?: string;
@@ -177,22 +247,24 @@ declare class PostgresAuthAdapter implements AuthAdapter {
177
247
  locked: boolean;
178
248
  }>;
179
249
  resetAttempts(userId: string): Promise<void>;
250
+ findAuditLogs(filter: AuditLogFilter): Promise<{
251
+ logs: AuditLog[];
252
+ total: number;
253
+ }>;
254
+ createAuditLog(data: Omit<AuditLog, "id" | "timestamp">): Promise<AuditLog>;
180
255
  private userToAuthUser;
181
256
  private sessionToSession;
182
257
  }
183
258
 
184
- interface DatabaseConfig {
185
- url: string;
186
- maxConnections: number;
187
- ssl: boolean;
259
+ type Dialect = "sqlite" | "postgres" | "mysql";
260
+ declare function genId(): string;
261
+ interface DatabaseResult {
262
+ db: any;
263
+ dialect: Dialect;
264
+ genId: () => string;
188
265
  }
189
- declare function createDatabase(config?: Partial<DatabaseConfig>): Promise<{
190
- client: postgres.Sql<{}>;
191
- db: drizzle_orm_postgres_js.PostgresJsDatabase<any> & {
192
- $client: postgres.Sql<{}>;
193
- };
194
- }>;
195
- declare function runMigrations(db: ReturnType<typeof drizzle>): Promise<void>;
196
- declare function seedDefaultRoles(db: ReturnType<typeof drizzle>): Promise<void>;
266
+ declare function createDatabase(): Promise<DatabaseResult>;
267
+ declare function runMigrations(_db: any, _dialect?: Dialect): Promise<void>;
268
+ declare function seedDefaultRoles(db: any): Promise<void>;
197
269
 
198
- export { type AuthAdapter as A, DrizzleAdapter as D, type JWTPayload as J, type LoginCredentials as L, PostgresAuthAdapter as P, type RegisterData as R, type Session as S, type UserRole as U, type AuthUser as a, type AuthTokenConfig as b, type AuthResult as c, collectionToDrizzleSchema as d, createDatabase as e, createDrizzleAdapter as f, fieldToDrizzleType as g, runMigrations as r, seedDefaultRoles as s };
270
+ export { type AuthAdapter as A, type Dialect as D, type JWTPayload as J, type LoginCredentials as L, PostgresAuthAdapter as P, type RegisterData as R, type Session as S, type UserRole as U, type AuthUser as a, type AuditLog as b, type AuditLogFilter as c, type AuthTokenConfig as d, type AuthResult as e, type AuditAction as f, AuditLogger as g, DrizzleAdapter as h, collectionToDrizzleSchema as i, createAuditContext as j, createDatabase as k, createDrizzleAdapter as l, fieldToDrizzleType as m, genId as n, runMigrations as r, seedDefaultRoles as s };
@@ -1,8 +1,7 @@
1
- import { A as AbstractBaseAdapter } from './base-DlhVlwnN.cjs';
2
- import { a as FindArgs, b as FindResult, c as FindByIDArgs, d as CreateArgs, U as UpdateArgs, D as DeleteArgs, C as CollectionConfig, F as Field } from './types-BGM5MV_K.cjs';
3
- import * as drizzle_orm_postgres_js from 'drizzle-orm/postgres-js';
4
- import { PostgresJsDatabase, drizzle } from 'drizzle-orm/postgres-js';
5
- import postgres from 'postgres';
1
+ import { A as AbstractBaseAdapter } from './base-DaP-5PPG.js';
2
+ import { a as FindArgs, b as FindResult, c as FindByIDArgs, d as CreateArgs, U as UpdateArgs, D as DeleteArgs, C as CollectionConfig, F as Field } from './types-BM0s_YOy.js';
3
+ import { PostgresJsDatabase } from 'drizzle-orm/postgres-js';
4
+ import Redis from 'ioredis';
6
5
 
7
6
  declare function fieldToDrizzleType(field: Field, dialect?: 'postgres' | 'mysql' | 'sqlite'): string;
8
7
  declare function collectionToDrizzleSchema(collection: CollectionConfig, dialect?: 'postgres' | 'mysql' | 'sqlite'): string;
@@ -49,6 +48,70 @@ declare function createDrizzleAdapter(options: {
49
48
  schema?: any;
50
49
  }): DrizzleAdapter;
51
50
 
51
+ type AuditAction = "login" | "logout" | "login_failed" | "register" | "verify_email" | "password_change" | "password_reset" | "password_reset_request" | "role_change" | "permission_change" | "document_create" | "document_update" | "document_delete" | "settings_change" | "user_lockout" | "user_unlock" | "user_create" | "user_update" | "user_delete" | "api_request" | "api_key_create" | "api_key_delete" | "tenant_create" | "tenant_delete";
52
+ interface AuditLog {
53
+ id: string;
54
+ timestamp: Date;
55
+ action: AuditAction;
56
+ userId?: string;
57
+ userEmail?: string;
58
+ role?: string;
59
+ resource: string;
60
+ resourceId?: string;
61
+ changes?: {
62
+ field: string;
63
+ old: any;
64
+ new: any;
65
+ }[];
66
+ ipAddress?: string;
67
+ userAgent?: string;
68
+ success: boolean;
69
+ error?: string;
70
+ metadata?: Record<string, any>;
71
+ }
72
+ interface AuditLogFilter {
73
+ userId?: string;
74
+ action?: AuditAction | AuditAction[];
75
+ resource?: string;
76
+ resourceId?: string;
77
+ success?: boolean;
78
+ startDate?: Date;
79
+ endDate?: Date;
80
+ limit?: number;
81
+ offset?: number;
82
+ }
83
+ declare class AuditLogger {
84
+ private redis;
85
+ private prefix;
86
+ private retentionDays;
87
+ constructor(redis: Redis, retentionDays?: number, prefix?: string);
88
+ log(data: Omit<AuditLog, "id" | "timestamp">): Promise<string>;
89
+ get(id: string): Promise<AuditLog | null>;
90
+ query(filter?: AuditLogFilter): Promise<{
91
+ logs: AuditLog[];
92
+ total: number;
93
+ }>;
94
+ getRecent(limit?: number): Promise<AuditLog[]>;
95
+ getUserActivity(userId: string, limit?: number): Promise<AuditLog[]>;
96
+ getStats(startDate?: Date, endDate?: Date): Promise<{
97
+ totalEvents: number;
98
+ byAction: Record<string, number>;
99
+ successRate: number;
100
+ failedLogins: number;
101
+ uniqueUsers: Set<string>;
102
+ }>;
103
+ cleanup(): Promise<number>;
104
+ private getKeyForDate;
105
+ private getKeysForDateRange;
106
+ private matchesFilter;
107
+ private serializeLog;
108
+ private deserializeLog;
109
+ }
110
+ declare function createAuditContext(req: Request): {
111
+ ipAddress: string;
112
+ userAgent: string;
113
+ };
114
+
52
115
  interface AuthUser {
53
116
  id: string;
54
117
  email: string;
@@ -109,15 +172,17 @@ interface AuthResult {
109
172
  interface AuthAdapter {
110
173
  createUser(data: {
111
174
  email: string;
112
- passwordHash: string;
113
- role: UserRole;
175
+ password: string;
176
+ role?: UserRole;
114
177
  tenantId?: string;
115
178
  }): Promise<AuthUser>;
116
179
  findUserByEmail(email: string): Promise<AuthUser | null>;
117
180
  findUserById(id: string): Promise<AuthUser | null>;
118
- updateUser(id: string, data: Partial<AuthUser>): Promise<AuthUser | null>;
181
+ updateUser(id: string, data: Partial<AuthUser> & {
182
+ password?: string;
183
+ }): Promise<AuthUser | null>;
119
184
  deleteUser(id: string): Promise<boolean>;
120
- verifyPassword(password: string, hash: string): Promise<boolean>;
185
+ verifyPassword(email: string, password: string): Promise<AuthUser | null>;
121
186
  hashPassword(password: string): Promise<string>;
122
187
  createSession(userId: string, data?: {
123
188
  ipAddress?: string;
@@ -132,6 +197,11 @@ interface AuthAdapter {
132
197
  addPasswordToHistory?(userId: string, passwordHash: string): Promise<void>;
133
198
  getPasswordHistory?(userId: string, count?: number): Promise<string[]>;
134
199
  isPasswordInHistory?(password: string, userId: string, historyCount?: number): Promise<boolean>;
200
+ findAuditLogs(filter: AuditLogFilter): Promise<{
201
+ logs: AuditLog[];
202
+ total: number;
203
+ }>;
204
+ createAuditLog(data: Omit<AuditLog, "id" | "timestamp">): Promise<AuditLog>;
135
205
  }
136
206
 
137
207
  interface PostgresAuthAdapterOptions {
@@ -148,7 +218,7 @@ declare class PostgresAuthAdapter implements AuthAdapter {
148
218
  constructor(options: PostgresAuthAdapterOptions);
149
219
  createUser(data: {
150
220
  email: string;
151
- passwordHash: string;
221
+ password: string;
152
222
  role?: UserRole;
153
223
  tenantId?: string;
154
224
  }): Promise<AuthUser>;
@@ -156,7 +226,7 @@ declare class PostgresAuthAdapter implements AuthAdapter {
156
226
  findUserById(id: string): Promise<AuthUser | null>;
157
227
  updateUser(id: string, data: Partial<AuthUser>): Promise<AuthUser | null>;
158
228
  deleteUser(id: string): Promise<boolean>;
159
- verifyPassword(password: string, hash: string): Promise<boolean>;
229
+ verifyPassword(email: string, password: string): Promise<AuthUser | null>;
160
230
  hashPassword(password: string): Promise<string>;
161
231
  createSession(userId: string, data?: {
162
232
  ipAddress?: string;
@@ -177,22 +247,24 @@ declare class PostgresAuthAdapter implements AuthAdapter {
177
247
  locked: boolean;
178
248
  }>;
179
249
  resetAttempts(userId: string): Promise<void>;
250
+ findAuditLogs(filter: AuditLogFilter): Promise<{
251
+ logs: AuditLog[];
252
+ total: number;
253
+ }>;
254
+ createAuditLog(data: Omit<AuditLog, "id" | "timestamp">): Promise<AuditLog>;
180
255
  private userToAuthUser;
181
256
  private sessionToSession;
182
257
  }
183
258
 
184
- interface DatabaseConfig {
185
- url: string;
186
- maxConnections: number;
187
- ssl: boolean;
259
+ type Dialect = "sqlite" | "postgres" | "mysql";
260
+ declare function genId(): string;
261
+ interface DatabaseResult {
262
+ db: any;
263
+ dialect: Dialect;
264
+ genId: () => string;
188
265
  }
189
- declare function createDatabase(config?: Partial<DatabaseConfig>): Promise<{
190
- client: postgres.Sql<{}>;
191
- db: drizzle_orm_postgres_js.PostgresJsDatabase<any> & {
192
- $client: postgres.Sql<{}>;
193
- };
194
- }>;
195
- declare function runMigrations(db: ReturnType<typeof drizzle>): Promise<void>;
196
- declare function seedDefaultRoles(db: ReturnType<typeof drizzle>): Promise<void>;
266
+ declare function createDatabase(): Promise<DatabaseResult>;
267
+ declare function runMigrations(_db: any, _dialect?: Dialect): Promise<void>;
268
+ declare function seedDefaultRoles(db: any): Promise<void>;
197
269
 
198
- export { type AuthAdapter as A, DrizzleAdapter as D, type JWTPayload as J, type LoginCredentials as L, PostgresAuthAdapter as P, type RegisterData as R, type Session as S, type UserRole as U, type AuthUser as a, type AuthTokenConfig as b, type AuthResult as c, collectionToDrizzleSchema as d, createDatabase as e, createDrizzleAdapter as f, fieldToDrizzleType as g, runMigrations as r, seedDefaultRoles as s };
270
+ export { type AuthAdapter as A, type Dialect as D, type JWTPayload as J, type LoginCredentials as L, PostgresAuthAdapter as P, type RegisterData as R, type Session as S, type UserRole as U, type AuthUser as a, type AuditLog as b, type AuditLogFilter as c, type AuthTokenConfig as d, type AuthResult as e, type AuditAction as f, AuditLogger as g, DrizzleAdapter as h, collectionToDrizzleSchema as i, createAuditContext as j, createDatabase as k, createDrizzleAdapter as l, fieldToDrizzleType as m, genId as n, runMigrations as r, seedDefaultRoles as s };
@@ -1,4 +1,4 @@
1
- import { C as CollectionConfig, G as GlobalConfig, P as PluginConfig, F as Field } from './types-BGM5MV_K.js';
1
+ import { C as CollectionConfig, G as GlobalConfig, P as PluginConfig, F as Field } from './types-BM0s_YOy.js';
2
2
  import { ZodTypeAny } from 'zod';
3
3
 
4
4
  declare class Registry {