core-services-sdk 1.3.37 → 1.3.39

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 (46) hide show
  1. package/package.json +2 -2
  2. package/src/http/HttpError.js +1 -1
  3. package/tests/http/HttpError.unit.test.js +2 -2
  4. package/tsconfig.json +3 -1
  5. package/types/core/combine-unique-arrays.d.ts +1 -1
  6. package/types/core/index.d.ts +9 -9
  7. package/types/core/normalize-array-operators.d.ts +1 -1
  8. package/types/core/normalize-min-max.d.ts +16 -10
  9. package/types/core/normalize-phone-number.d.ts +30 -24
  10. package/types/core/normalize-premitives-types-or-default.d.ts +17 -4
  11. package/types/core/normalize-to-array.d.ts +1 -1
  12. package/types/core/otp-generators.d.ts +22 -18
  13. package/types/core/regex-utils.d.ts +1 -1
  14. package/types/core/sanitize-objects.d.ts +13 -4
  15. package/types/crypto/crypto.d.ts +31 -18
  16. package/types/crypto/encryption.d.ts +14 -6
  17. package/types/crypto/index.d.ts +2 -2
  18. package/types/fastify/error-handlers/with-error-handling.d.ts +26 -15
  19. package/types/fastify/index.d.ts +2 -2
  20. package/types/http/HttpError.d.ts +3 -4
  21. package/types/http/http-method.d.ts +6 -6
  22. package/types/http/http.d.ts +58 -34
  23. package/types/http/index.d.ts +4 -4
  24. package/types/http/responseType.d.ts +6 -6
  25. package/types/ids/generators.d.ts +28 -28
  26. package/types/ids/index.d.ts +2 -2
  27. package/types/ids/prefixes.d.ts +54 -54
  28. package/types/index.d.ts +11 -11
  29. package/types/logger/get-logger.d.ts +23 -21
  30. package/types/logger/index.d.ts +1 -1
  31. package/types/mailer/index.d.ts +2 -2
  32. package/types/mailer/mailer.service.d.ts +29 -19
  33. package/types/mailer/transport.factory.d.ts +43 -43
  34. package/types/mongodb/connect.d.ts +12 -7
  35. package/types/mongodb/dsl-to-mongo.d.ts +2 -1
  36. package/types/mongodb/index.d.ts +5 -5
  37. package/types/mongodb/initialize-mongodb.d.ts +18 -13
  38. package/types/mongodb/paginate.d.ts +23 -13
  39. package/types/mongodb/validate-mongo-uri.d.ts +1 -1
  40. package/types/rabbit-mq/index.d.ts +1 -1
  41. package/types/rabbit-mq/rabbit-mq.d.ts +62 -37
  42. package/types/templates/index.d.ts +1 -1
  43. package/types/templates/template-loader.d.ts +7 -3
  44. package/types/util/context.d.ts +53 -53
  45. package/types/util/index.d.ts +6 -6
  46. package/types/util/mask-sensitive.d.ts +14 -2
@@ -1,3 +1,7 @@
1
- export function isItFile(filePathOrString: string): Promise<boolean>;
2
- export function getTemplateContent(maybeFilePathOrString: string): Promise<string>;
3
- export function loadTemplates(templateSet: Record<string, string>): Promise<Record<string, (params: Record<string, any>) => string>>;
1
+ export function isItFile(filePathOrString: string): Promise<boolean>
2
+ export function getTemplateContent(
3
+ maybeFilePathOrString: string,
4
+ ): Promise<string>
5
+ export function loadTemplates(
6
+ templateSet: Record<string, string>,
7
+ ): Promise<Record<string, (params: Record<string, any>) => string>>
@@ -1,55 +1,55 @@
1
1
  export namespace Context {
2
- /**
3
- * Run a callback within a given context store.
4
- * Everything `await`ed or invoked inside this callback will have access
5
- * to the provided store via {@link Context.get}, {@link Context.set}, or {@link Context.all}.
6
- *
7
- * @template T
8
- * @param {Record<string, any>} store
9
- * @param {() => T} callback - Function to execute inside the context.
10
- * @returns {T} The return value of the callback (sync or async).
11
- *
12
- * @example
13
- * Context.run(
14
- * { correlationId: 'abc123' },
15
- * async () => {
16
- * console.log(Context.get('correlationId')) // "abc123"
17
- * }
18
- * )
19
- */
20
- function run<T>(store: Record<string, any>, callback: () => T): T;
21
- /**
22
- * Retrieve a single value from the current async context store.
23
- *
24
- * @template T
25
- * @param {string} key - The key of the value to retrieve.
26
- * @returns {T|undefined} The stored value, or `undefined` if no store exists or key not found.
27
- *
28
- * @example
29
- * const userId = Context.get('userId')
30
- */
31
- function get<T>(key: string): T | undefined;
32
- /**
33
- * Set a single key-value pair in the current async context store.
34
- * If there is no active store (i.e. outside of a {@link Context.run}),
35
- * this function does nothing.
36
- *
37
- * @param {string} key - The key under which to store the value.
38
- * @param {any} value - The value to store.
39
- *
40
- * @example
41
- * Context.set('tenantId', 'tnt_1234')
42
- */
43
- function set(key: string, value: any): void;
44
- /**
45
- * Get the entire store object for the current async context.
46
- *
47
- * @returns {Record<string, any>} The current store object,
48
- * or an empty object if no store exists.
49
- *
50
- * @example
51
- * const all = Context.all()
52
- * console.log(all) // { correlationId: 'abc123', userId: 'usr_789' }
53
- */
54
- function all(): Record<string, any>;
2
+ /**
3
+ * Run a callback within a given context store.
4
+ * Everything `await`ed or invoked inside this callback will have access
5
+ * to the provided store via {@link Context.get}, {@link Context.set}, or {@link Context.all}.
6
+ *
7
+ * @template T
8
+ * @param {Record<string, any>} store
9
+ * @param {() => T} callback - Function to execute inside the context.
10
+ * @returns {T} The return value of the callback (sync or async).
11
+ *
12
+ * @example
13
+ * Context.run(
14
+ * { correlationId: 'abc123' },
15
+ * async () => {
16
+ * console.log(Context.get('correlationId')) // "abc123"
17
+ * }
18
+ * )
19
+ */
20
+ function run<T>(store: Record<string, any>, callback: () => T): T
21
+ /**
22
+ * Retrieve a single value from the current async context store.
23
+ *
24
+ * @template T
25
+ * @param {string} key - The key of the value to retrieve.
26
+ * @returns {T|undefined} The stored value, or `undefined` if no store exists or key not found.
27
+ *
28
+ * @example
29
+ * const userId = Context.get('userId')
30
+ */
31
+ function get<T>(key: string): T | undefined
32
+ /**
33
+ * Set a single key-value pair in the current async context store.
34
+ * If there is no active store (i.e. outside of a {@link Context.run}),
35
+ * this function does nothing.
36
+ *
37
+ * @param {string} key - The key under which to store the value.
38
+ * @param {any} value - The value to store.
39
+ *
40
+ * @example
41
+ * Context.set('tenantId', 'tnt_1234')
42
+ */
43
+ function set(key: string, value: any): void
44
+ /**
45
+ * Get the entire store object for the current async context.
46
+ *
47
+ * @returns {Record<string, any>} The current store object,
48
+ * or an empty object if no store exists.
49
+ *
50
+ * @example
51
+ * const all = Context.all()
52
+ * console.log(all) // { correlationId: 'abc123', userId: 'usr_789' }
53
+ */
54
+ function all(): Record<string, any>
55
55
  }
@@ -1,8 +1,8 @@
1
1
  export namespace util {
2
- export { mask };
3
- export { maskSingle };
2
+ export { mask }
3
+ export { maskSingle }
4
4
  }
5
- export { Context } from "./context.js";
6
- import { mask } from './mask-sensitive.js';
7
- import { maskSingle } from './mask-sensitive.js';
8
- export { mask, maskSingle };
5
+ export { Context } from './context.js'
6
+ import { mask } from './mask-sensitive.js'
7
+ import { maskSingle } from './mask-sensitive.js'
8
+ export { mask, maskSingle }
@@ -1,2 +1,14 @@
1
- export function maskSingle(value: string | number | boolean | null | undefined, fill?: string, maskLen?: number, left?: number, right?: number): string;
2
- export function mask(value: string | number | boolean | any[] | any | null | undefined, fill?: string, maskLen?: number, left?: number, right?: number): string | any[] | any;
1
+ export function maskSingle(
2
+ value: string | number | boolean | null | undefined,
3
+ fill?: string,
4
+ maskLen?: number,
5
+ left?: number,
6
+ right?: number,
7
+ ): string
8
+ export function mask(
9
+ value: string | number | boolean | any[] | any | null | undefined,
10
+ fill?: string,
11
+ maskLen?: number,
12
+ left?: number,
13
+ right?: number,
14
+ ): string | any[] | any