@tstdl/base 0.92.145 → 0.92.147

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 (251) hide show
  1. package/ai/ai-file.service.d.ts +29 -1
  2. package/ai/ai-file.service.js +66 -23
  3. package/ai/ai-session.d.ts +28 -1
  4. package/ai/ai-session.js +27 -0
  5. package/ai/ai.service.d.ts +89 -5
  6. package/ai/ai.service.js +130 -27
  7. package/ai/functions.d.ts +7 -1
  8. package/ai/functions.js +7 -1
  9. package/ai/module.d.ts +8 -0
  10. package/ai/module.js +4 -0
  11. package/ai/types.d.ts +115 -2
  12. package/ai/types.js +16 -0
  13. package/api/client/client.d.ts +1 -1
  14. package/api/client/client.js +1 -1
  15. package/api/default-error-handlers.d.ts +1 -1
  16. package/api/index.d.ts +1 -9
  17. package/api/index.js +1 -9
  18. package/api/response.d.ts +1 -1
  19. package/api/server/api-controller.d.ts +1 -1
  20. package/api/server/error-handler.d.ts +1 -1
  21. package/api/server/gateway.d.ts +1 -5
  22. package/api/server/gateway.js +0 -4
  23. package/api/server/middlewares/catch-error.middleware.d.ts +1 -1
  24. package/api/server/module.d.ts +1 -1
  25. package/api/types.d.ts +1 -1
  26. package/application/application.d.ts +1 -1
  27. package/authentication/authentication.api.d.ts +36 -1
  28. package/authentication/authentication.api.js +28 -0
  29. package/authentication/client/api.client.d.ts +14 -1
  30. package/authentication/client/api.client.js +13 -0
  31. package/authentication/client/authentication.service.d.ts +104 -1
  32. package/authentication/client/authentication.service.js +103 -0
  33. package/authentication/client/http-client.middleware.d.ts +5 -0
  34. package/authentication/client/http-client.middleware.js +6 -2
  35. package/authentication/client/module.d.ts +20 -1
  36. package/authentication/client/module.js +6 -1
  37. package/authentication/client/tokens.d.ts +6 -0
  38. package/authentication/client/tokens.js +6 -0
  39. package/authentication/models/authentication-credentials.model.d.ts +6 -0
  40. package/authentication/models/authentication-credentials.model.js +6 -0
  41. package/authentication/models/authentication-session.model.d.ts +6 -0
  42. package/authentication/models/authentication-session.model.js +6 -0
  43. package/authentication/models/init-secret-reset-data.model.d.ts +10 -1
  44. package/authentication/models/init-secret-reset-data.model.js +10 -1
  45. package/authentication/models/token-payload-base.model.d.ts +24 -4
  46. package/authentication/models/token-payload-base.model.js +24 -4
  47. package/authentication/models/token.model.d.ts +33 -2
  48. package/authentication/server/authentication-ancillary.service.d.ts +27 -4
  49. package/authentication/server/authentication-ancillary.service.js +7 -0
  50. package/authentication/server/authentication-api-request-token.provider.d.ts +3 -0
  51. package/authentication/server/authentication-api-request-token.provider.js +3 -0
  52. package/authentication/server/authentication-secret-requirements.validator.d.ts +37 -0
  53. package/authentication/server/authentication-secret-requirements.validator.js +22 -0
  54. package/authentication/server/authentication.api-controller.d.ts +66 -1
  55. package/authentication/server/authentication.api-controller.js +65 -0
  56. package/authentication/server/authentication.service.d.ts +191 -11
  57. package/authentication/server/authentication.service.js +157 -8
  58. package/authentication/server/helper.d.ts +44 -5
  59. package/authentication/server/helper.js +43 -4
  60. package/authentication/server/module.d.ts +23 -1
  61. package/authentication/server/module.js +23 -1
  62. package/browser/browser-context-controller.d.ts +1 -1
  63. package/browser/browser-controller.d.ts +1 -1
  64. package/browser/browser-controller.js +1 -1
  65. package/browser/element-controller.d.ts +1 -1
  66. package/browser/locator-controller.d.ts +1 -1
  67. package/context/context.d.ts +1 -1
  68. package/data-structures/context-data-map.d.ts +1 -1
  69. package/database/mongo/mongo-base.repository.d.ts +1 -1
  70. package/database/mongo/types.d.ts +1 -1
  71. package/database/query.d.ts +1 -1
  72. package/document-management/models/document-management-table.d.ts +1 -1
  73. package/document-management/models/document-validation-definition.model.d.ts +1 -1
  74. package/document-management/server/schemas.d.ts +1 -1
  75. package/document-management/server/services/document-collection.service.d.ts +1 -1
  76. package/document-management/server/services/document-management-observation.service.d.ts +1 -1
  77. package/document-management/server/services/document-management.service.d.ts +1 -1
  78. package/document-management/server/services/document-property.service.d.ts +3 -3
  79. package/document-management/server/services/document-request.service.d.ts +1 -1
  80. package/document-management/server/services/document-validation.service.d.ts +1 -1
  81. package/document-management/server/services/document-workflow.service.d.ts +1 -1
  82. package/document-management/server/services/document.service.d.ts +1 -1
  83. package/document-management/server/services/singleton.d.ts +1 -1
  84. package/document-management/service-models/document-management.view-model.d.ts +1 -1
  85. package/document-management/service-models/enriched/enriched-document-assignment.view.d.ts +1 -1
  86. package/document-management/service-models/enriched/enriched-document-category.view.d.ts +1 -1
  87. package/document-management/service-models/enriched/enriched-document-collection.view.d.ts +1 -1
  88. package/document-management/service-models/enriched/enriched-document-request.view.d.ts +1 -1
  89. package/document-management/service-models/enriched/enriched-document-type.view.d.ts +1 -1
  90. package/document-management/service-models/enriched/enriched-document.view.d.ts +1 -1
  91. package/document-management/service-models/enriched/enriched-requests-template-data.model.d.ts +1 -1
  92. package/dom/file-select-dialog.d.ts +1 -1
  93. package/enumeration/enumeration.d.ts +1 -1
  94. package/errors/custom.error.d.ts +3 -0
  95. package/errors/custom.error.js +0 -1
  96. package/errors/errors.localization.d.ts +1 -1
  97. package/errors/not-supported.error.d.ts +1 -1
  98. package/{formats.js → formats/formats.js} +3 -3
  99. package/formats/index.d.ts +1 -0
  100. package/formats/index.js +1 -0
  101. package/http/client/http-client-request.d.ts +1 -1
  102. package/http/client/http-client-response.d.ts +1 -1
  103. package/http/client/http-client.d.ts +1 -1
  104. package/http/client/module.d.ts +1 -1
  105. package/http/http-body.d.ts +1 -1
  106. package/http/http-value-map.d.ts +1 -1
  107. package/http/http.error.d.ts +1 -1
  108. package/http/server/http-server-request.d.ts +1 -1
  109. package/http/server/http-server-response.d.ts +1 -1
  110. package/http/types.d.ts +1 -1
  111. package/http/utils.d.ts +1 -1
  112. package/injector/decorators.d.ts +1 -1
  113. package/injector/index.d.ts +1 -1
  114. package/injector/index.js +1 -1
  115. package/injector/injector.d.ts +10 -1
  116. package/injector/injector.js +6 -0
  117. package/injector/interfaces.d.ts +1 -1
  118. package/injector/provider.d.ts +1 -1
  119. package/injector/resolution.d.ts +10 -5
  120. package/injector/resolve-chain.d.ts +2 -2
  121. package/injector/resolve-chain.js +1 -1
  122. package/injector/resolve.error.js +1 -1
  123. package/injector/token.d.ts +8 -1
  124. package/injector/token.js +7 -0
  125. package/injector/types.d.ts +1 -1
  126. package/key-value-store/key-value-store.provider.d.ts +2 -2
  127. package/key-value-store/key-value.store.d.ts +2 -2
  128. package/key-value-store/mongo/mongo-key-value-store.provider.d.ts +1 -1
  129. package/key-value-store/mongo/mongo-key-value.store.d.ts +1 -1
  130. package/key-value-store/postgres/key-value-store.service.d.ts +1 -1
  131. package/mail/mail.service.d.ts +1 -1
  132. package/mail/models/mail-data.model.d.ts +1 -1
  133. package/mail/models/mail-template.model.d.ts +1 -1
  134. package/mail/module.d.ts +1 -1
  135. package/module/index.d.ts +0 -1
  136. package/module/index.js +0 -1
  137. package/module/module-base.d.ts +1 -1
  138. package/module/module-metric-reporter.js +1 -1
  139. package/module/module.d.ts +1 -1
  140. package/module/modules/function.module.js +1 -1
  141. package/object-storage/object.d.ts +1 -1
  142. package/openid-connect/mongo-oidc-state.repository.d.ts +1 -1
  143. package/openid-connect/oidc.service.d.ts +1 -1
  144. package/orm/decorators.d.ts +2 -2
  145. package/orm/entity.d.ts +1 -1
  146. package/orm/index.d.ts +3 -3
  147. package/orm/index.js +3 -3
  148. package/orm/query.d.ts +1 -1
  149. package/orm/repository.types.d.ts +1 -1
  150. package/orm/schemas/json.d.ts +1 -1
  151. package/orm/server/database-schema.d.ts +1 -1
  152. package/orm/server/drizzle/schema-converter.d.ts +1 -1
  153. package/orm/server/repository.d.ts +1 -1
  154. package/orm/server/transaction.d.ts +1 -1
  155. package/orm/server/transactional.d.ts +3 -3
  156. package/orm/server/types.d.ts +1 -1
  157. package/orm/types.d.ts +1 -1
  158. package/package.json +23 -20
  159. package/queue/mongo/job.d.ts +1 -1
  160. package/queue/mongo/queue.js +31 -31
  161. package/queue/postgres/job.model.d.ts +1 -1
  162. package/queue/postgres/queue.d.ts +1 -1
  163. package/queue/postgres/queue.provider.d.ts +1 -1
  164. package/queue/provider.d.ts +1 -1
  165. package/reflection/decorators.d.ts +1 -1
  166. package/reflection/registry.d.ts +1 -1
  167. package/reflection/types.d.ts +1 -1
  168. package/reflection/utils.d.ts +1 -1
  169. package/rpc/model.d.ts +1 -1
  170. package/rxjs-utils/retry-backoff.js +2 -2
  171. package/schema/converters/openapi-converter.d.ts +1 -1
  172. package/schema/decorators/schema.d.ts +1 -1
  173. package/schema/decorators/utils.d.ts +1 -1
  174. package/schema/schema.d.ts +1 -1
  175. package/schema/schema.error.d.ts +1 -1
  176. package/schema/schemas/array.d.ts +1 -1
  177. package/schema/schemas/enumeration.d.ts +1 -1
  178. package/schema/schemas/function.d.ts +1 -1
  179. package/schema/schemas/instance.d.ts +1 -1
  180. package/schema/schemas/nullable.d.ts +1 -1
  181. package/schema/schemas/number.d.ts +1 -1
  182. package/schema/schemas/object.d.ts +1 -1
  183. package/schema/schemas/one-or-many.d.ts +1 -1
  184. package/schema/schemas/optional.d.ts +1 -1
  185. package/schema/schemas/simple.d.ts +1 -1
  186. package/search-index/elastic/model/index-mapping.d.ts +1 -1
  187. package/search-index/elastic/search-index.js +3 -4
  188. package/search-index/memory/memory-search-index.d.ts +1 -1
  189. package/search-index/memory/memory-search-index.js +1 -1
  190. package/serializer/handlers/binary.d.ts +1 -1
  191. package/serializer/serializable.d.ts +1 -1
  192. package/serializer/types.d.ts +1 -1
  193. package/templates/module.d.ts +1 -1
  194. package/templates/renderers/handlebars.template-renderer.d.ts +1 -1
  195. package/templates/renderers/jsx.template-renderer.d.ts +1 -1
  196. package/templates/renderers/mjml.template-renderer.d.ts +1 -1
  197. package/templates/renderers/string.template-renderer.d.ts +1 -1
  198. package/templates/resolvers/file.template-resolver.d.ts +1 -1
  199. package/templates/resolvers/jsx.template-resolver.d.ts +1 -1
  200. package/templates/resolvers/string.template-resolver.d.ts +1 -1
  201. package/templates/template.model.d.ts +1 -1
  202. package/templates/template.renderer.d.ts +1 -1
  203. package/templates/template.service.d.ts +1 -1
  204. package/text/dynamic-text.model.d.ts +1 -1
  205. package/text/localization.service.d.ts +1 -1
  206. package/types/geo-json.d.ts +1 -1
  207. package/types/index.d.ts +2 -0
  208. package/types/tagged.d.ts +1 -1
  209. package/{types.d.ts → types/types.d.ts} +2 -1
  210. package/utils/async-hook/async-hook.d.ts +109 -0
  211. package/utils/async-hook/async-hook.js +77 -3
  212. package/utils/backoff.d.ts +125 -43
  213. package/utils/backoff.js +140 -65
  214. package/utils/base64.d.ts +1 -1
  215. package/utils/base64.js +1 -2
  216. package/utils/binary.d.ts +1 -1
  217. package/utils/comparison.d.ts +5 -5
  218. package/utils/comparison.js +5 -3
  219. package/utils/cryptography.d.ts +1 -1
  220. package/utils/encoding.d.ts +1 -1
  221. package/utils/enum.d.ts +1 -1
  222. package/utils/equals.d.ts +1 -1
  223. package/utils/format-error.d.ts +1 -1
  224. package/utils/function/class.d.ts +1 -1
  225. package/utils/function/memoize.d.ts +1 -1
  226. package/utils/helpers.d.ts +1 -1
  227. package/utils/helpers.js +2 -2
  228. package/utils/jwt.d.ts +3 -3
  229. package/utils/merge.d.ts +1 -1
  230. package/utils/middleware.js +3 -3
  231. package/utils/object/decycle.d.ts +1 -1
  232. package/utils/object/forward-ref.d.ts +1 -1
  233. package/utils/object/lazy-property.d.ts +1 -1
  234. package/utils/object/object.d.ts +1 -1
  235. package/utils/object/property-name.d.ts +1 -1
  236. package/utils/patch-worker.d.ts +1 -1
  237. package/utils/reactive-value-to-signal.d.ts +1 -1
  238. package/utils/reflection.d.ts +1 -1
  239. package/utils/repl.d.ts +1 -1
  240. package/utils/singleton.d.ts +1 -1
  241. package/utils/stream/size-limited-stream.d.ts +1 -1
  242. package/utils/type/extends.d.ts +1 -1
  243. package/utils/type-guards.d.ts +1 -1
  244. package/utils/url-builder.d.ts +1 -1
  245. package/utils/z-base32.d.ts +1 -1
  246. package/module/utils.d.ts +0 -4
  247. package/module/utils.js +0 -21
  248. /package/{formats.d.ts → formats/formats.d.ts} +0 -0
  249. /package/{types.js → types/types.js} +0 -0
  250. /package/{web-types.d.ts → types/web-types.d.ts} +0 -0
  251. /package/{web-types.js → types/web-types.js} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tstdl/base",
3
- "version": "0.92.145",
3
+ "version": "0.92.147",
4
4
  "author": "Patrick Hein",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -23,6 +23,8 @@
23
23
  "generate:migration:mail": "drizzle-kit generate --config dist/mail/drizzle.config.js",
24
24
  "generate:migration:queue": "drizzle-kit generate --config dist/queue/postgres/drizzle.config.js",
25
25
  "generate:migration:key-value-store": "drizzle-kit generate --config dist/key-value-store/postgres/drizzle.config.js",
26
+ "generate:readmes": "deno run --allow-run=repomix --allow-read=source --allow-write=source --allow-net=generativelanguage.googleapis.com --allow-env=GEMINI_API_KEY generate-readmes.ts",
27
+ "generate:readmes:new-only": "npm run generate:readmes -- --skip-existing",
26
28
  "copy:orm": "npm run copy:orm:document-management && npm run copy:orm:authentication && npm run copy:orm:mail && npm run copy:orm:queue && npm run copy:orm:key-value-store",
27
29
  "copy:orm:document-management": "rm -rf ./dist/document-management/server/drizzle && cp -r ./source/document-management/server/drizzle ./dist/document-management/server/",
28
30
  "copy:orm:authentication": "rm -rf ./dist/authentication/server/drizzle && cp -r ./source/authentication/server/drizzle ./dist/authentication/server/",
@@ -35,14 +37,11 @@
35
37
  "./eslint.config.js": "./eslint.config.js",
36
38
  ".": "./index.js",
37
39
  "./environment": "./environment.js",
38
- "./formats": "./formats.js",
39
40
  "./interfaces": "./interfaces.js",
40
41
  "./polyfills": "./polyfills.js",
41
42
  "./process-shutdown": "./process-shutdown.js",
42
43
  "./supports": "./supports.js",
43
44
  "./tokens": "./tokens.js",
44
- "./types": "./types.js",
45
- "./web-types": "./web-types.js",
46
45
  "./ai": "./ai/index.js",
47
46
  "./api": "./api/index.js",
48
47
  "./api/client": "./api/client/index.js",
@@ -68,6 +67,7 @@
68
67
  "./errors": "./errors/index.js",
69
68
  "./file": "./file/index.js",
70
69
  "./file/server": "./file/server/index.js",
70
+ "./formats": "./formats/index.js",
71
71
  "./function": "./function/index.js",
72
72
  "./http": "./http/index.js",
73
73
  "./http/node": "./http/server/node/index.js",
@@ -124,7 +124,7 @@
124
124
  "./theme": "./theme/index.js",
125
125
  "./theme/adapters": "./theme/adapters/index.js",
126
126
  "./threading": "./threading/index.js",
127
- "./types/geo-json": "./types/geo-json.js",
127
+ "./types": "./types/index.js",
128
128
  "./utils": "./utils/index.js",
129
129
  "./utils/array": "./utils/array/index.js",
130
130
  "./utils/async-hook": "./utils/async-hook/index.js",
@@ -139,16 +139,16 @@
139
139
  "dependencies": {
140
140
  "disposablestack": "^1.1",
141
141
  "jsondiffpatch": "^0.7",
142
- "luxon": "^3.6",
142
+ "luxon": "^3.7",
143
143
  "reflect-metadata": "^0.2",
144
144
  "rxjs": "^7.8",
145
- "ts-pattern": "^5.7",
145
+ "ts-pattern": "^5.8",
146
146
  "type-fest": "4.37"
147
147
  },
148
148
  "peerDependencies": {
149
- "@elastic/elasticsearch": "^9.0",
150
- "@google-cloud/storage": "7.16",
151
- "@google/genai": "^1.7",
149
+ "@elastic/elasticsearch": "^9.1",
150
+ "@google-cloud/storage": "^7.16",
151
+ "@google/genai": "^1.14",
152
152
  "@tstdl/angular": "^0.92",
153
153
  "@zxcvbn-ts/core": "^3.0",
154
154
  "@zxcvbn-ts/language-common": "^3.0",
@@ -160,14 +160,14 @@
160
160
  "handlebars": "^4.7",
161
161
  "minio": "^8.0",
162
162
  "mjml": "^4.15",
163
- "mongodb": "^6.17",
163
+ "mongodb": "^6.18",
164
164
  "nodemailer": "^7.0",
165
165
  "pg": "^8.16",
166
- "playwright": "^1.53",
167
- "preact": "^10.26",
166
+ "playwright": "^1.54",
167
+ "preact": "^10.27",
168
168
  "preact-render-to-string": "^6.5",
169
169
  "sharp": "^0.34",
170
- "undici": "^7.11",
170
+ "undici": "^7.13",
171
171
  "urlpattern-polyfill": "^10.1"
172
172
  },
173
173
  "peerDependenciesMeta": {
@@ -176,10 +176,10 @@
176
176
  }
177
177
  },
178
178
  "devDependencies": {
179
- "@stylistic/eslint-plugin": "5.0",
179
+ "@stylistic/eslint-plugin": "5.2",
180
180
  "@types/chroma-js": "2.4",
181
181
  "@types/koa__router": "12.0",
182
- "@types/luxon": "3.6",
182
+ "@types/luxon": "3.7",
183
183
  "@types/minio": "7.1",
184
184
  "@types/mjml": "4.7",
185
185
  "@types/node": "24",
@@ -187,12 +187,15 @@
187
187
  "@types/pg": "8.15",
188
188
  "concurrently": "9.2",
189
189
  "drizzle-kit": "0.31",
190
- "eslint": "9.29",
191
- "globals": "16.2",
190
+ "eslint": "9.33",
191
+ "globals": "16.3",
192
+ "repomix": "1.3",
192
193
  "tsc-alias": "1.8",
193
- "typedoc-plugin-missing-exports": "4.0",
194
+ "typedoc-github-wiki-theme": "2.1",
195
+ "typedoc-plugin-markdown": "4.8",
196
+ "typedoc-plugin-missing-exports": "4.1",
194
197
  "typescript": "5.8",
195
- "typescript-eslint": "8.35"
198
+ "typescript-eslint": "8.39"
196
199
  },
197
200
  "overrides": {
198
201
  "drizzle-kit": {
@@ -1,6 +1,6 @@
1
1
  import type { Entity, NewEntity } from '../../database/index.js';
2
2
  import type { Job } from '../../queue/index.js';
3
- import type { TypedOmit } from '../../types.js';
3
+ import type { TypedOmit } from '../../types/index.js';
4
4
  export type MongoJob<T = unknown> = Entity & TypedOmit<Job<T>, 'id'> & {
5
5
  queue: string;
6
6
  jobId: string;
@@ -30,7 +30,7 @@ const backoffOptions = {
30
30
  strategy: 'exponential',
31
31
  initialDelay: 100,
32
32
  increase: 2,
33
- maximumDelay: 5000
33
+ maximumDelay: 5000,
34
34
  };
35
35
  let MongoQueue = class MongoQueue extends Queue {
36
36
  repository;
@@ -59,7 +59,7 @@ let MongoQueue = class MongoQueue extends Queue {
59
59
  enqueueTimestamp: currentTimestamp(),
60
60
  tries: 0,
61
61
  lastDequeueTimestamp: 0,
62
- batch: null
62
+ batch: null,
63
63
  };
64
64
  const job = (uniqueTag == undefined)
65
65
  ? await this.repository.insert(newJob)
@@ -81,7 +81,7 @@ let MongoQueue = class MongoQueue extends Queue {
81
81
  enqueueTimestamp: now,
82
82
  tries: 0,
83
83
  lastDequeueTimestamp: 0,
84
- batch: null
84
+ batch: null,
85
85
  };
86
86
  switch (options?.uniqueTag) {
87
87
  case undefined:
@@ -100,7 +100,7 @@ let MongoQueue = class MongoQueue extends Queue {
100
100
  const [nonUniqueJobs] = await Promise.all([
101
101
  (nonUnique.length > 0) ? this.repository.insertMany(nonUnique) : [],
102
102
  (keepOld.length > 0) ? this.repository.bulkInsertWithUniqueTagStrategy(keepOld, UniqueTagStrategy.KeepOld) : undefined,
103
- (takeNew.length > 0) ? this.repository.bulkInsertWithUniqueTagStrategy(takeNew, UniqueTagStrategy.TakeNew) : undefined
103
+ (takeNew.length > 0) ? this.repository.bulkInsertWithUniqueTagStrategy(takeNew, UniqueTagStrategy.TakeNew) : undefined,
104
104
  ]);
105
105
  if (options?.returnJobs == true) {
106
106
  const keepOldTags = keepOld.map((job) => job.tag);
@@ -111,19 +111,19 @@ let MongoQueue = class MongoQueue extends Queue {
111
111
  return undefined;
112
112
  }
113
113
  async has(id) {
114
- return this.repository.hasByFilter({ queue: this.queueKey, jobId: id });
114
+ return await this.repository.hasByFilter({ queue: this.queueKey, jobId: id });
115
115
  }
116
116
  async countByTag(tag) {
117
- return this.repository.countByFilter({ queue: this.queueKey, tag });
117
+ return await this.repository.countByFilter({ queue: this.queueKey, tag });
118
118
  }
119
119
  async get(id) {
120
- return this.repository.tryLoadByFilter({ queue: this.queueKey, jobId: id });
120
+ return await this.repository.tryLoadByFilter({ queue: this.queueKey, jobId: id });
121
121
  }
122
122
  async getByTag(tag) {
123
- return this.repository.loadManyByFilter({ queue: this.queueKey, tag });
123
+ return await this.repository.loadManyByFilter({ queue: this.queueKey, tag });
124
124
  }
125
125
  async getByTags(tags) {
126
- return this.repository.loadManyByFilter({ queue: this.queueKey, tag: { $in: tags } });
126
+ return await this.repository.loadManyByFilter({ queue: this.queueKey, tag: { $in: tags } });
127
127
  }
128
128
  async cancel(id) {
129
129
  await this.repository.deleteByFilter({ queue: this.queueKey, jobId: id });
@@ -145,8 +145,8 @@ let MongoQueue = class MongoQueue extends Queue {
145
145
  priority: 1,
146
146
  enqueueTimestamp: 1,
147
147
  lastDequeueTimestamp: 1,
148
- tries: 1
149
- }
148
+ tries: 1,
149
+ },
150
150
  });
151
151
  return isUndefined(job) ? undefined : toModelJob(job);
152
152
  }
@@ -161,8 +161,8 @@ let MongoQueue = class MongoQueue extends Queue {
161
161
  [priorityProperty]: 1,
162
162
  [enqueueTimestampProperty]: 1,
163
163
  [lastDequeueTimestampProperty]: 1,
164
- [triesProperty]: 1
165
- }
164
+ [triesProperty]: 1,
165
+ },
166
166
  },
167
167
  { $limit: count },
168
168
  {
@@ -173,47 +173,47 @@ let MongoQueue = class MongoQueue extends Queue {
173
173
  $set: {
174
174
  [triesProperty]: { $add: [`$${triesProperty}`, 1] },
175
175
  [lastDequeueTimestampProperty]: currentTimestamp(),
176
- [batchProperty]: batch
177
- }
178
- }
176
+ [batchProperty]: batch,
177
+ },
178
+ },
179
179
  ],
180
- whenNotMatched: 'discard'
181
- }
182
- }
180
+ whenNotMatched: 'discard',
181
+ },
182
+ },
183
183
  ]).next();
184
184
  });
185
185
  const jobs = await this.repository.loadManyByFilter({ queue: this.queueKey, batch });
186
186
  return jobs.map(toModelJob);
187
187
  }
188
188
  async acknowledge(job) {
189
- return this.cancel(job.id);
189
+ return await this.cancel(job.id);
190
190
  }
191
191
  async acknowledgeMany(jobs) {
192
192
  const jobIds = jobs.map((job) => job.id);
193
- return this.cancelMany(jobIds);
193
+ return await this.cancelMany(jobIds);
194
194
  }
195
195
  async *getConsumer(cancellationSignal) {
196
196
  const continueToken = CancellationToken.from(this.messageBus.allMessages$);
197
- for await (const backoff of backoffGenerator(backoffOptions, cancellationSignal)) {
197
+ for await (const backoff of backoffGenerator({ ...backoffOptions, cancellationSignal })) {
198
198
  const job = await this.dequeue();
199
199
  if (job != undefined) {
200
200
  yield job;
201
201
  }
202
202
  else {
203
- backoff(continueToken);
203
+ backoff({ continueToken });
204
204
  }
205
205
  }
206
206
  continueToken.complete();
207
207
  }
208
208
  async *getBatchConsumer(size, cancellationSignal) {
209
209
  const continueToken = CancellationToken.from(this.messageBus.allMessages$);
210
- for await (const backoff of backoffGenerator(backoffOptions, cancellationSignal)) {
210
+ for await (const backoff of backoffGenerator({ ...backoffOptions, cancellationSignal })) {
211
211
  const jobs = await this.dequeueMany(size);
212
212
  if (jobs.length > 0) {
213
213
  yield jobs;
214
214
  }
215
215
  else {
216
- backoff(continueToken);
216
+ backoff({ continueToken });
217
217
  }
218
218
  }
219
219
  continueToken.complete();
@@ -229,8 +229,8 @@ MongoQueue = __decorate([
229
229
  return provider.get(argument, defaultQueueConfig);
230
230
  }
231
231
  return provider.get(argument.name, { ...defaultQueueConfig, ...argument });
232
- }
233
- }
232
+ },
233
+ },
234
234
  }),
235
235
  __metadata("design:paramtypes", [MongoJobRepository, Lock, MessageBusProvider, String, Object])
236
236
  ], MongoQueue);
@@ -243,7 +243,7 @@ function toModelJob(mongoJob) {
243
243
  data: mongoJob.data,
244
244
  enqueueTimestamp: mongoJob.enqueueTimestamp,
245
245
  lastDequeueTimestamp: mongoJob.lastDequeueTimestamp,
246
- tries: mongoJob.tries
246
+ tries: mongoJob.tries,
247
247
  };
248
248
  return job;
249
249
  }
@@ -253,14 +253,14 @@ function getDequeueFindParameters(queueKey, maxTries, processTimeout, batch = nu
253
253
  const filter = {
254
254
  queue: queueKey,
255
255
  tries: { $lt: maxTries },
256
- lastDequeueTimestamp: { $lte: maximumLastDequeueTimestamp }
256
+ lastDequeueTimestamp: { $lte: maximumLastDequeueTimestamp },
257
257
  };
258
258
  const update = {
259
259
  $inc: { tries: 1 },
260
260
  $set: {
261
261
  lastDequeueTimestamp: now,
262
- batch
263
- }
262
+ batch,
263
+ },
264
264
  };
265
265
  return { filter, update };
266
266
  }
@@ -1,6 +1,6 @@
1
1
  import { EntityWithoutMetadata } from '../../orm/entity.js';
2
2
  import { Integer, Json, Timestamp } from '../../orm/index.js';
3
- import type { ObjectLiteral } from '../../types.js';
3
+ import type { ObjectLiteral } from '../../types/index.js';
4
4
  import type { Job } from '../queue.js';
5
5
  export declare class PostgresJob<T extends ObjectLiteral = ObjectLiteral> extends EntityWithoutMetadata implements Job<T> {
6
6
  queue: string;
@@ -1,5 +1,5 @@
1
1
  import { CancellationSignal } from '../../cancellation/index.js';
2
- import type { ObjectLiteral } from '../../types.js';
2
+ import type { ObjectLiteral } from '../../types/index.js';
3
3
  import { Queue, type EnqueueManyItem, type EnqueueManyOptions, type EnqueueOneOptions, type Job, type JobTag } from '../queue.js';
4
4
  export declare class PostgresQueue<T extends ObjectLiteral> extends Queue<T> {
5
5
  #private;
@@ -1,5 +1,5 @@
1
1
  import { QueueProvider, type QueueConfig } from '../../queue/index.js';
2
- import type { ObjectLiteral } from '../../types.js';
2
+ import type { ObjectLiteral } from '../../types/index.js';
3
3
  import { PostgresQueue } from './queue.js';
4
4
  export declare class PostgresQueueProvider extends QueueProvider {
5
5
  #private;
@@ -1,4 +1,4 @@
1
- import type { ObjectLiteral } from '../types.js';
1
+ import type { ObjectLiteral } from '../types/index.js';
2
2
  import type { Queue, QueueConfig } from './queue.js';
3
3
  export declare abstract class QueueProvider {
4
4
  abstract get<T extends ObjectLiteral>(key: string, config?: QueueConfig): Queue<T>;
@@ -1,5 +1,5 @@
1
1
  import 'reflect-metadata/lite';
2
- import type { ConstructorParameterDecorator } from '../types.js';
2
+ import type { ConstructorParameterDecorator } from '../types/index.js';
3
3
  import type { Decorator, DecoratorHandler } from './types.js';
4
4
  import { type CreateDecoratorOptions, type SpecificCreateDecoratorOptions } from './utils.js';
5
5
  export declare function Decorate({ handler, ...options }?: CreateDecoratorOptions & {
@@ -1,4 +1,4 @@
1
- import type { AbstractConstructor } from '../types.js';
1
+ import type { AbstractConstructor } from '../types/index.js';
2
2
  import { ContextDataMap } from '../data-structures/context-data-map.js';
3
3
  import type { DecoratorData } from './types.js';
4
4
  export type ReflectionMetadata = TypeMetadata | PropertyMetadata | MethodMetadata | ConstructorParameterMetadata | MethodParameterMetadata;
@@ -1,4 +1,4 @@
1
- import type { AbstractConstructor, Constructor, ConstructorParameterDecorator, Record } from '../types.js';
1
+ import type { AbstractConstructor, Constructor, ConstructorParameterDecorator, Record } from '../types/index.js';
2
2
  import type { UnionToIntersection } from 'type-fest';
3
3
  import type { ConstructorParameterMetadata, MethodMetadata, MethodParameterMetadata, ParameterMetadata, PropertyMetadata, TypeMetadata } from './registry.js';
4
4
  export type DecoratorType = 'class' | 'property' | 'accessor' | 'method' | 'parameter' | 'methodParameter' | 'constructorParameter';
@@ -1,4 +1,4 @@
1
- import type { AbstractConstructor, Constructor, ConstructorParameterDecorator, OneOrMany, PropertiesOfType, Record, TypedOmit } from '../types.js';
1
+ import type { AbstractConstructor, Constructor, ConstructorParameterDecorator, OneOrMany, PropertiesOfType, Record, TypedOmit } from '../types/index.js';
2
2
  import type { CombinedDecoratorParameters, Decorator, DecoratorData, DecoratorHandler, DecoratorMetadata, DecoratorType, DecoratorUnion } from './types.js';
3
3
  export type CreateDecoratorTypeOptions = Partial<Record<DecoratorType, boolean>>;
4
4
  export type CreateDecoratorOptions = {
package/rpc/model.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { SerializationOptions } from '../serializer/types.js';
2
- import type { Constructor, Record } from '../types.js';
2
+ import type { Constructor, Record } from '../types/index.js';
3
3
  export type RpcConstructor<T extends Constructor> = T extends Constructor<any, infer R> ? Constructor<Promise<RpcRemote<InstanceType<T>>>, R> : never;
4
4
  export type RpcFunction<T extends (...args: any) => any> = T extends (...args: infer Args) => infer R ? (...args: Args) => Promise<Awaited<R>> : never;
5
5
  export type RpcObject<T extends Record> = {
@@ -7,7 +7,7 @@ export function retryBackoff(count, options) {
7
7
  throw error;
8
8
  }
9
9
  return counter + 1;
10
- }, 0), delayWhen(() => timer(helper.backoff()))));
10
+ }, 0), delayWhen(() => timer(helper.getNextDelay()))));
11
11
  }
12
12
  export function retryBackoffHandled(count, options, handler) {
13
13
  return (source) => {
@@ -19,7 +19,7 @@ export function retryBackoffHandled(count, options, handler) {
19
19
  return (returnValue != undefined) ? from(returnValue) : of(undefined);
20
20
  }
21
21
  return of(undefined);
22
- }), delayWhen(() => timer(helper.backoff())))));
22
+ }), delayWhen(() => timer(helper.getNextDelay())))));
23
23
  return observable;
24
24
  };
25
25
  }
@@ -1,3 +1,3 @@
1
- import type { UndefinableJsonObject } from '../../types.js';
1
+ import type { UndefinableJsonObject } from '../../types/index.js';
2
2
  import type { SchemaTestable } from '../schema.js';
3
3
  export declare function convertToOpenApiSchema(testable: SchemaTestable): UndefinableJsonObject;
@@ -1,6 +1,6 @@
1
1
  import type { SetRequired } from 'type-fest';
2
2
  import { type Decorator } from '../../reflection/index.js';
3
- import type { TypedOmit } from '../../types.js';
3
+ import type { TypedOmit } from '../../types/index.js';
4
4
  import type { SchemaTestable } from '../schema.js';
5
5
  import type { CombinedSchemaDecorator, SchemaReflectionData, SchemaTestableProvider } from './types.js';
6
6
  export type SchemaDecoratorOptions = SchemaReflectionData;
@@ -1,4 +1,4 @@
1
- import type { AbstractConstructor } from '../../types.js';
1
+ import type { AbstractConstructor } from '../../types/index.js';
2
2
  import type { SchemaTestable } from '../schema.js';
3
3
  import type { SchemaReflectionData } from './types.js';
4
4
  export declare function schemaReflectionDataToSchema(reflectionData: SchemaReflectionData | undefined, fallbackType: AbstractConstructor | null, source: {
@@ -1,6 +1,6 @@
1
1
  import type { IsEqual, Or } from 'type-fest';
2
2
  import { JsonPath } from '../json-path/json-path.js';
3
- import type { AbstractConstructor } from '../types.js';
3
+ import type { AbstractConstructor } from '../types/index.js';
4
4
  import type { SchemaError } from './schema.error.js';
5
5
  import type { Coercible, Maskable } from './types.js';
6
6
  export type SchemaTestOptions = Coercible & Maskable & {
@@ -1,6 +1,6 @@
1
1
  import { CustomError, type CustomErrorOptions } from '../errors/custom.error.js';
2
2
  import type { JsonPath } from '../json-path/index.js';
3
- import type { AbstractConstructor, OneOrMany, TypedOmit, UndefinableJson } from '../types.js';
3
+ import type { AbstractConstructor, OneOrMany, TypedOmit, UndefinableJson } from '../types/index.js';
4
4
  import type { ErrorExtraInfo } from '../utils/format-error.js';
5
5
  export type SchemaErrorOptions = Pick<CustomErrorOptions, 'fast'> & {
6
6
  path: string | JsonPath;
@@ -1,5 +1,5 @@
1
1
  import type { JsonPath } from '../../json-path/json-path.js';
2
- import type { TypedOmit } from '../../types.js';
2
+ import type { TypedOmit } from '../../types/index.js';
3
3
  import { type SchemaDecoratorOptions, type SchemaPropertyDecorator } from '../decorators/index.js';
4
4
  import { Schema, type SchemaOptions, type SchemaTestable, type SchemaTestOptions, type SchemaTestResult } from '../schema.js';
5
5
  import type { Coercible } from '../types.js';
@@ -1,4 +1,4 @@
1
- import type { Enumeration as EnumerationType, EnumerationValue } from '../../types.js';
1
+ import type { Enumeration as EnumerationType, EnumerationValue } from '../../types/index.js';
2
2
  import { type SchemaPropertyDecorator, type SchemaDecoratorOptions } from '../decorators/index.js';
3
3
  import { SimpleSchema, type SimpleSchemaOptions } from './simple.js';
4
4
  export type EnumerationSchemaOptions<T extends EnumerationType> = SimpleSchemaOptions<EnumerationValue<T>>;
@@ -1,4 +1,4 @@
1
- import type { AbstractConstructor, Function } from '../../types.js';
1
+ import type { AbstractConstructor, Function } from '../../types/index.js';
2
2
  import { type CombinedSchemaDecorator, type SchemaDecoratorOptions } from '../decorators/index.js';
3
3
  import type { Schema, SchemaTestable } from '../schema.js';
4
4
  import { SimpleSchema, type SimpleSchemaOptions } from './simple.js';
@@ -1,5 +1,5 @@
1
1
  import type { JsonPath } from '../../json-path/json-path.js';
2
- import type { AbstractConstructor } from '../../types.js';
2
+ import type { AbstractConstructor } from '../../types/index.js';
3
3
  import { type SchemaPropertyDecorator, type SchemaDecoratorOptions } from '../decorators/index.js';
4
4
  import { Schema, type SchemaOptions, type SchemaTestOptions, type SchemaTestResult } from '../schema.js';
5
5
  export type InstanceSchemaOptions<T extends AbstractConstructor> = SchemaOptions<InstanceType<T>>;
@@ -1,5 +1,5 @@
1
1
  import type { JsonPath } from '../../json-path/json-path.js';
2
- import type { TypedOmit } from '../../types.js';
2
+ import type { TypedOmit } from '../../types/index.js';
3
3
  import { type SchemaDecoratorOptions, type SchemaPropertyDecorator } from '../decorators/index.js';
4
4
  import { Schema, type SchemaTestable, type SchemaTestOptions, type SchemaTestResult } from '../schema.js';
5
5
  export declare class NullableSchema<T> extends Schema<T | null> {
@@ -1,4 +1,4 @@
1
- import type { TypedOmit } from '../../types.js';
1
+ import type { TypedOmit } from '../../types/index.js';
2
2
  import { type SchemaDecoratorOptions, type SchemaPropertyDecorator } from '../decorators/index.js';
3
3
  import { SimpleSchema, type SimpleSchemaOptions } from './simple.js';
4
4
  export type NumberSchemaOptions = SimpleSchemaOptions<number> & {
@@ -1,7 +1,7 @@
1
1
  import type { EmptyObject, Merge } from 'type-fest';
2
2
  import type { JsonPath } from '../../json-path/json-path.js';
3
3
  import { type Decorator } from '../../reflection/index.js';
4
- import type { AbstractConstructor, OneOrMany, PartialProperty, Record as RecordType, SimplifyObject, Type, TypedOmit } from '../../types.js';
4
+ import type { AbstractConstructor, OneOrMany, PartialProperty, Record as RecordType, SimplifyObject, Type, TypedOmit } from '../../types/index.js';
5
5
  import { type SchemaDecoratorOptions } from '../decorators/index.js';
6
6
  import { type OPTIONAL, Schema, type SchemaOptions, type SchemaOutput, type SchemaTestable, type SchemaTestOptions, type SchemaTestResult } from '../schema.js';
7
7
  export type Record<K extends PropertyKey = PropertyKey, V = any> = RecordType<K, V>;
@@ -1,5 +1,5 @@
1
1
  import type { JsonPath } from '../../json-path/json-path.js';
2
- import type { OneOrMany as OneOrManyType } from '../../types.js';
2
+ import type { OneOrMany as OneOrManyType } from '../../types/index.js';
3
3
  import { type SchemaDecoratorOptions, type SchemaPropertyDecorator } from '../decorators/index.js';
4
4
  import { Schema, type SchemaOptions, type SchemaTestable, type SchemaTestOptions, type SchemaTestResult } from '../schema.js';
5
5
  import { type ArraySchemaOptions } from './array.js';
@@ -1,5 +1,5 @@
1
1
  import type { JsonPath } from '../../json-path/json-path.js';
2
- import type { TypedOmit } from '../../types.js';
2
+ import type { TypedOmit } from '../../types/index.js';
3
3
  import { type SchemaDecoratorOptions, type SchemaPropertyDecorator } from '../decorators/index.js';
4
4
  import { type OPTIONAL, Schema, type SchemaTestable, type SchemaTestOptions, type SchemaTestResult } from '../schema.js';
5
5
  export declare class OptionalSchema<T> extends Schema<T | undefined> {
@@ -1,5 +1,5 @@
1
1
  import type { JsonPath } from '../../json-path/json-path.js';
2
- import type { AbstractConstructor, OneOrMany } from '../../types.js';
2
+ import type { AbstractConstructor, OneOrMany } from '../../types/index.js';
3
3
  import { Schema, type SchemaOptions, type SchemaTestOptions, type SchemaTestResult } from '../schema.js';
4
4
  import type { CoerceResult, Coercible, ConstraintResult } from '../types.js';
5
5
  export type SimpleSchemaOptions<T> = SchemaOptions<T> & Coercible;
@@ -1,6 +1,6 @@
1
1
  import type { estypes } from '@elastic/elasticsearch';
2
2
  import type { Entity } from '../../../database/index.js';
3
- import type { DeepFlatten, StringMap, TypedOmit } from '../../../types.js';
3
+ import type { DeepFlatten, StringMap, TypedOmit } from '../../../types/index.js';
4
4
  export type ElasticIndexMapping<T extends Entity = Entity> = TypedOmit<estypes.MappingTypeMapping, 'properties'> & ElasticNestedIndexMapping<TypedOmit<T, 'id'>>;
5
5
  export type ElasticNestedIndexMapping<T> = {
6
6
  properties: {
@@ -62,7 +62,7 @@ export class ElasticSearchIndex extends SearchIndex {
62
62
  operations: entities.flatMap((entity) => {
63
63
  const { id: _, ...entityWithoutId } = entity;
64
64
  return [{ index: { _id: entity.id } }, entityWithoutId];
65
- })
65
+ }),
66
66
  };
67
67
  const result = await this.client.bulk(request);
68
68
  if (result.errors) {
@@ -84,7 +84,6 @@ export class ElasticSearchIndex extends SearchIndex {
84
84
  const queryBody = convertQuery(query);
85
85
  await this.client.deleteByQuery({ index: this.indexName, query: queryBody });
86
86
  }
87
- // eslint-disable-next-line max-statements
88
87
  async search(searchQueryOrCursor, options) {
89
88
  const cursorData = isString(searchQueryOrCursor) ? deserializeCursor(searchQueryOrCursor) : undefined;
90
89
  const queryBody = isDefined(cursorData) ? cursorData.query : convertQuery(searchQueryOrCursor);
@@ -116,7 +115,7 @@ export class ElasticSearchIndex extends SearchIndex {
116
115
  }
117
116
  const result = await this.client.count({
118
117
  index: this.indexName,
119
- query: convertQuery(query ?? {})
118
+ query: convertQuery(query ?? {}),
120
119
  });
121
120
  return result.count;
122
121
  }
@@ -128,7 +127,7 @@ export class ElasticSearchIndex extends SearchIndex {
128
127
  await this.client.indices.delete({ index: this.indexName });
129
128
  }
130
129
  async exists() {
131
- return this.client.indices.exists({ index: this.indexName });
130
+ return await this.client.indices.exists({ index: this.indexName });
132
131
  }
133
132
  }
134
133
  function serializeCursor(query, sort, options, searchAfter) {
@@ -11,7 +11,7 @@ export declare class MemorySearchIndex<T extends Entity> extends SearchIndex<T>
11
11
  delete(id: string): Promise<void>;
12
12
  deleteByQuery(query: Query<T>): Promise<void>;
13
13
  search(queryOrCursor: string | Query<T>, options?: QueryOptions<T>): Promise<SearchResult<T>>;
14
- count(query?: Query<T>, options?: QueryOptions<T> | undefined): Promise<number>;
14
+ count(query?: Query<T>, options?: QueryOptions<T>): Promise<number>;
15
15
  drop(): Promise<void>;
16
16
  private _delete;
17
17
  private indexEntity;
@@ -81,7 +81,7 @@ export class MemorySearchIndex extends SearchIndex {
81
81
  total: resultItems.length,
82
82
  totalIsLowerBound: false,
83
83
  milliseconds: timer.milliseconds,
84
- items: resultItems
84
+ items: resultItems,
85
85
  };
86
86
  return result;
87
87
  }
@@ -1,4 +1,4 @@
1
- import type { TypedArray } from '../../types.js';
1
+ import type { TypedArray } from '../../types/index.js';
2
2
  interface TypedArrayConstructor {
3
3
  readonly BYTES_PER_ELEMENT: number;
4
4
  new (buffer: ArrayBufferLike, byteOffset?: number, length?: number): TypedArray;
@@ -1,4 +1,4 @@
1
- import type { AbstractConstructor, Record, Type, TypedOmit } from '../types.js';
1
+ import type { AbstractConstructor, Record, Type, TypedOmit } from '../types/index.js';
2
2
  export declare const Serializable: {
3
3
  readonly serialize: unique symbol;
4
4
  readonly deserialize: unique symbol;
@@ -1,4 +1,4 @@
1
- import type { AbstractConstructor, JsonPrimitive, Nested, Record } from '../types.js';
1
+ import type { AbstractConstructor, JsonPrimitive, Nested, Record } from '../types/index.js';
2
2
  declare const serializedSymbol: unique symbol;
3
3
  declare const stringSerializedSymbol: unique symbol;
4
4
  declare const decycledSymbol: unique symbol;
@@ -1,4 +1,4 @@
1
- import type { Type } from '../types.js';
1
+ import type { Type } from '../types/index.js';
2
2
  import { TemplateProvider } from './template.provider.js';
3
3
  import { TemplateRenderer } from './template.renderer.js';
4
4
  import { TemplateResolver } from './template.resolver.js';
@@ -1,4 +1,4 @@
1
- import type { ObjectLiteral, Record } from '../../types.js';
1
+ import type { ObjectLiteral, Record } from '../../types/index.js';
2
2
  import type * as Handlebars from 'handlebars';
3
3
  import { TemplateResolverProvider } from '../template-resolver.provider.js';
4
4
  import type { TemplateField } from '../template.model.js';