core-services-sdk 1.3.36 → 1.3.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/fastify/error-codes.js +2 -4
- package/src/fastify/error-handlers/with-error-handling.js +5 -6
- package/src/http/HttpError.js +10 -29
- package/src/http/http.js +2 -3
- package/tests/fastify/error-handler.unit.test.js +3 -11
- package/tests/fastify/error-handlers/with-error-handling.test.js +3 -6
- package/tests/http/HttpError.unit.test.js +13 -17
- package/tsconfig.json +3 -1
- package/types/core/combine-unique-arrays.d.ts +1 -1
- package/types/core/index.d.ts +9 -9
- package/types/core/normalize-array-operators.d.ts +1 -1
- package/types/core/normalize-min-max.d.ts +16 -10
- package/types/core/normalize-phone-number.d.ts +30 -24
- package/types/core/normalize-premitives-types-or-default.d.ts +17 -4
- package/types/core/normalize-to-array.d.ts +1 -1
- package/types/core/otp-generators.d.ts +22 -18
- package/types/core/regex-utils.d.ts +1 -1
- package/types/core/sanitize-objects.d.ts +13 -4
- package/types/crypto/crypto.d.ts +31 -18
- package/types/crypto/encryption.d.ts +14 -6
- package/types/crypto/index.d.ts +2 -2
- package/types/fastify/error-codes.d.ts +11 -16
- package/types/fastify/error-handlers/with-error-handling.d.ts +26 -15
- package/types/fastify/index.d.ts +2 -2
- package/types/http/HttpError.d.ts +67 -76
- package/types/http/http-method.d.ts +6 -6
- package/types/http/http.d.ts +58 -34
- package/types/http/index.d.ts +4 -4
- package/types/http/responseType.d.ts +6 -6
- package/types/ids/generators.d.ts +28 -28
- package/types/ids/index.d.ts +2 -2
- package/types/ids/prefixes.d.ts +54 -54
- package/types/index.d.ts +11 -11
- package/types/logger/get-logger.d.ts +23 -21
- package/types/logger/index.d.ts +1 -1
- package/types/mailer/index.d.ts +2 -2
- package/types/mailer/mailer.service.d.ts +29 -19
- package/types/mailer/transport.factory.d.ts +43 -43
- package/types/mongodb/connect.d.ts +12 -7
- package/types/mongodb/dsl-to-mongo.d.ts +2 -1
- package/types/mongodb/index.d.ts +5 -5
- package/types/mongodb/initialize-mongodb.d.ts +18 -13
- package/types/mongodb/paginate.d.ts +23 -13
- package/types/mongodb/validate-mongo-uri.d.ts +1 -1
- package/types/rabbit-mq/index.d.ts +1 -1
- package/types/rabbit-mq/rabbit-mq.d.ts +62 -37
- package/types/templates/index.d.ts +1 -1
- package/types/templates/template-loader.d.ts +7 -3
- package/types/util/context.d.ts +53 -53
- package/types/util/index.d.ts +6 -6
- package/types/util/mask-sensitive.d.ts +14 -2
package/types/crypto/crypto.d.ts
CHANGED
|
@@ -1,18 +1,31 @@
|
|
|
1
|
-
export function getSalt(length: number): Buffer
|
|
2
|
-
export function getSaltHex(length: number): string
|
|
3
|
-
export function getEncryptedBuffer({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
export function getSalt(length: number): Buffer
|
|
2
|
+
export function getSaltHex(length: number): string
|
|
3
|
+
export function getEncryptedBuffer({
|
|
4
|
+
salt,
|
|
5
|
+
expression,
|
|
6
|
+
length,
|
|
7
|
+
}: {
|
|
8
|
+
expression: string
|
|
9
|
+
salt: string
|
|
10
|
+
length?: number
|
|
11
|
+
}): Promise<Buffer>
|
|
12
|
+
export function encrypt({
|
|
13
|
+
salt,
|
|
14
|
+
expression,
|
|
15
|
+
passwordPrivateKey,
|
|
16
|
+
}: {
|
|
17
|
+
expression: string
|
|
18
|
+
salt: string
|
|
19
|
+
passwordPrivateKey?: string
|
|
20
|
+
}): Promise<string>
|
|
21
|
+
export function isPasswordMatch({
|
|
22
|
+
salt,
|
|
23
|
+
password,
|
|
24
|
+
encryptedPassword,
|
|
25
|
+
passwordPrivateKey,
|
|
26
|
+
}: {
|
|
27
|
+
salt: string
|
|
28
|
+
password: string
|
|
29
|
+
encryptedPassword: string
|
|
30
|
+
passwordPrivateKey?: string
|
|
31
|
+
}): Promise<boolean>
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
export function encryptPassword(
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
1
|
+
export function encryptPassword(
|
|
2
|
+
{
|
|
3
|
+
password,
|
|
4
|
+
}: {
|
|
5
|
+
password: string
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
saltLength,
|
|
9
|
+
passwordPrivateKey,
|
|
10
|
+
}: {
|
|
11
|
+
saltLength: number
|
|
12
|
+
passwordPrivateKey?: string
|
|
13
|
+
},
|
|
14
|
+
): Promise<any>
|
package/types/crypto/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from './crypto.js'
|
|
2
|
+
export * from './encryption.js'
|
|
@@ -3,27 +3,22 @@
|
|
|
3
3
|
* Useful as a fallback error descriptor for unhandled or unexpected failures.
|
|
4
4
|
*
|
|
5
5
|
* @typedef {Object} GeneralError
|
|
6
|
-
* @property {number}
|
|
7
|
-
* @property {string} httpStatusText - The human-readable status text ("Internal Server Error").
|
|
6
|
+
* @property {number} status - The HTTP status code (500).
|
|
8
7
|
* @property {string} code - An application-specific error code in the format "GENERAL.<StatusText>".
|
|
9
8
|
*/
|
|
10
9
|
/** @type {GeneralError} */
|
|
11
|
-
export const GENERAL_ERROR: GeneralError
|
|
10
|
+
export const GENERAL_ERROR: GeneralError
|
|
12
11
|
/**
|
|
13
12
|
* A reusable generic error object representing a server-side failure (HTTP 500).
|
|
14
13
|
* Useful as a fallback error descriptor for unhandled or unexpected failures.
|
|
15
14
|
*/
|
|
16
15
|
export type GeneralError = {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
* - An application-specific error code in the format "GENERAL.<StatusText>".
|
|
27
|
-
*/
|
|
28
|
-
code: string;
|
|
29
|
-
};
|
|
16
|
+
/**
|
|
17
|
+
* - The HTTP status code (500).
|
|
18
|
+
*/
|
|
19
|
+
status: number
|
|
20
|
+
/**
|
|
21
|
+
* - An application-specific error code in the format "GENERAL.<StatusText>".
|
|
22
|
+
*/
|
|
23
|
+
code: string
|
|
24
|
+
}
|
|
@@ -1,15 +1,26 @@
|
|
|
1
|
-
export function withErrorHandling(
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export
|
|
15
|
-
|
|
1
|
+
export function withErrorHandling(
|
|
2
|
+
log: object,
|
|
3
|
+
defaultError: HttpError,
|
|
4
|
+
): (funcToInvoke: () => Promise<any>) => Promise<any>
|
|
5
|
+
export function withErrorHandlingReply({
|
|
6
|
+
reply,
|
|
7
|
+
log,
|
|
8
|
+
defaultError,
|
|
9
|
+
}: {
|
|
10
|
+
reply: Reply
|
|
11
|
+
log: Logger
|
|
12
|
+
defaultError?: HttpError
|
|
13
|
+
}): (funcToInvoke: any) => Promise<any>
|
|
14
|
+
export function replyOnErrorOnly({
|
|
15
|
+
reply,
|
|
16
|
+
log,
|
|
17
|
+
defaultError,
|
|
18
|
+
}: {
|
|
19
|
+
reply: Reply
|
|
20
|
+
log: Logger
|
|
21
|
+
defaultError?: HttpError
|
|
22
|
+
}): (funcToInvoke: any) => Promise<any>
|
|
23
|
+
export type Reply = import('fastify').FastifyReply
|
|
24
|
+
export type Request = import('fastify').FastifyRequest
|
|
25
|
+
export type Logger = import('pino').Logger
|
|
26
|
+
import { HttpError } from '../../http/HttpError.js'
|
package/types/fastify/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { GENERAL_ERROR } from
|
|
2
|
-
export * from
|
|
1
|
+
export { GENERAL_ERROR } from './error-codes.js'
|
|
2
|
+
export * from './error-handlers/with-error-handling.js'
|
|
@@ -3,80 +3,71 @@
|
|
|
3
3
|
* Useful for consistent error handling across services.
|
|
4
4
|
*/
|
|
5
5
|
export class HttpError extends Error {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
* }}
|
|
74
|
-
*/
|
|
75
|
-
toJSON(): {
|
|
76
|
-
code: string | number | undefined;
|
|
77
|
-
message: string;
|
|
78
|
-
httpStatusCode: number | undefined;
|
|
79
|
-
httpStatusText: string | undefined;
|
|
80
|
-
extendInfo?: object;
|
|
81
|
-
};
|
|
6
|
+
/**
|
|
7
|
+
* Checks if a given object is an instance of `HttpError`.
|
|
8
|
+
*
|
|
9
|
+
* @param {*} instance - The object to check.
|
|
10
|
+
* @returns {boolean} True if `instance` is an instance of `HttpError`.
|
|
11
|
+
*/
|
|
12
|
+
static isInstanceOf(instance: any): boolean
|
|
13
|
+
/**
|
|
14
|
+
* Checks if the error is an instance of `HttpError` or has similar shape.
|
|
15
|
+
*
|
|
16
|
+
* @param {object} error
|
|
17
|
+
* @returns {error is HttpError}
|
|
18
|
+
*/
|
|
19
|
+
static isHttpError(error: object): error is HttpError
|
|
20
|
+
/**
|
|
21
|
+
* Creates an HttpError from a generic Error instance or returns it if already an HttpError.
|
|
22
|
+
*
|
|
23
|
+
* @param {Error | HttpError} error
|
|
24
|
+
* @returns {HttpError}
|
|
25
|
+
*/
|
|
26
|
+
static FromError(error: Error | HttpError): HttpError
|
|
27
|
+
/**
|
|
28
|
+
* Creates an instance of HttpError.
|
|
29
|
+
*
|
|
30
|
+
* @param {Object} [error] - Optional error object.
|
|
31
|
+
* @param {string | number} [error.code] - Application-specific error code.
|
|
32
|
+
* @param {string} [error.message] - Custom error message.
|
|
33
|
+
* @param {number} [error.status] - HTTP status code (e.g., 404, 500).
|
|
34
|
+
* @param {object} [error.extendInfo] - Optional extended metadata for diagnostics.
|
|
35
|
+
*/
|
|
36
|
+
constructor(error?: {
|
|
37
|
+
code?: string | number
|
|
38
|
+
message?: string
|
|
39
|
+
status?: number
|
|
40
|
+
extendInfo?: object
|
|
41
|
+
})
|
|
42
|
+
/**
|
|
43
|
+
* @type {string | number | undefined}
|
|
44
|
+
* A short application-specific error code (e.g., "INVALID_INPUT" or a numeric code).
|
|
45
|
+
*/
|
|
46
|
+
code: string | number | undefined
|
|
47
|
+
/**
|
|
48
|
+
* @type {number | undefined}
|
|
49
|
+
* HTTP status code associated with the error (e.g., 400, 500).
|
|
50
|
+
*/
|
|
51
|
+
status: number | undefined
|
|
52
|
+
/**
|
|
53
|
+
* @type {object | undefined}
|
|
54
|
+
* Optional metadata for debugging/logging (e.g., request ID, user ID, retryAfter).
|
|
55
|
+
*/
|
|
56
|
+
extendInfo: object | undefined
|
|
57
|
+
/**
|
|
58
|
+
* Converts the error to a plain object (useful for logging or sending as JSON).
|
|
59
|
+
*
|
|
60
|
+
* @returns {{
|
|
61
|
+
* code: string | number | undefined,
|
|
62
|
+
* message: string,
|
|
63
|
+
* status: number | undefined,
|
|
64
|
+
* extendInfo?: object
|
|
65
|
+
* }}
|
|
66
|
+
*/
|
|
67
|
+
toJSON(): {
|
|
68
|
+
code: string | number | undefined
|
|
69
|
+
message: string
|
|
70
|
+
status: number | undefined
|
|
71
|
+
extendInfo?: object
|
|
72
|
+
}
|
|
82
73
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const HTTP_METHODS: Readonly<{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
2
|
+
GET: 'GET'
|
|
3
|
+
POST: 'POST'
|
|
4
|
+
PUT: 'PUT'
|
|
5
|
+
PATCH: 'PATCH'
|
|
6
|
+
DELETE: 'DELETE'
|
|
7
|
+
}>
|
package/types/http/http.d.ts
CHANGED
|
@@ -1,36 +1,60 @@
|
|
|
1
|
-
export function get({
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
1
|
+
export function get({
|
|
2
|
+
url,
|
|
3
|
+
headers,
|
|
4
|
+
expectedType,
|
|
5
|
+
}: {
|
|
6
|
+
url: any
|
|
7
|
+
headers?: {}
|
|
8
|
+
expectedType?: 'json'
|
|
9
|
+
}): Promise<any>
|
|
10
|
+
export function post({
|
|
11
|
+
url,
|
|
12
|
+
body,
|
|
13
|
+
headers,
|
|
14
|
+
expectedType,
|
|
15
|
+
}: {
|
|
16
|
+
url: any
|
|
17
|
+
body: any
|
|
18
|
+
headers?: {}
|
|
19
|
+
expectedType?: 'json'
|
|
20
|
+
}): Promise<any>
|
|
21
|
+
export function put({
|
|
22
|
+
url,
|
|
23
|
+
body,
|
|
24
|
+
headers,
|
|
25
|
+
expectedType,
|
|
26
|
+
}: {
|
|
27
|
+
url: any
|
|
28
|
+
body: any
|
|
29
|
+
headers?: {}
|
|
30
|
+
expectedType?: 'json'
|
|
31
|
+
}): Promise<any>
|
|
32
|
+
export function patch({
|
|
33
|
+
url,
|
|
34
|
+
body,
|
|
35
|
+
headers,
|
|
36
|
+
expectedType,
|
|
37
|
+
}: {
|
|
38
|
+
url: any
|
|
39
|
+
body: any
|
|
40
|
+
headers?: {}
|
|
41
|
+
expectedType?: 'json'
|
|
42
|
+
}): Promise<any>
|
|
43
|
+
export function deleteApi({
|
|
44
|
+
url,
|
|
45
|
+
body,
|
|
46
|
+
headers,
|
|
47
|
+
expectedType,
|
|
48
|
+
}: {
|
|
49
|
+
url: any
|
|
50
|
+
body: any
|
|
51
|
+
headers?: {}
|
|
52
|
+
expectedType?: 'json'
|
|
53
|
+
}): Promise<any>
|
|
30
54
|
export namespace http {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
55
|
+
export { get }
|
|
56
|
+
export { put }
|
|
57
|
+
export { post }
|
|
58
|
+
export { patch }
|
|
59
|
+
export { deleteApi }
|
|
36
60
|
}
|
package/types/http/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
1
|
+
export * from './http.js'
|
|
2
|
+
export * from './HttpError.js'
|
|
3
|
+
export * from './http-method.js'
|
|
4
|
+
export * from './responseType.js'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* *
|
|
3
3
|
*/
|
|
4
|
-
export type ResponseType = string
|
|
4
|
+
export type ResponseType = string
|
|
5
5
|
/**
|
|
6
6
|
* Enum representing supported response types for HTTP client parsing.
|
|
7
7
|
*
|
|
@@ -13,8 +13,8 @@ export type ResponseType = string;
|
|
|
13
13
|
* @property {string} file - Binary file or blob (not automatically parsed).
|
|
14
14
|
*/
|
|
15
15
|
export const ResponseType: Readonly<{
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
16
|
+
xml: 'xml'
|
|
17
|
+
json: 'json'
|
|
18
|
+
text: 'text'
|
|
19
|
+
file: 'file'
|
|
20
|
+
}>
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
export function generateId(): string
|
|
2
|
-
export function generatePrefixedId(prefix: string): string
|
|
3
|
-
export function generateUserId(): string
|
|
4
|
-
export function generateTenantId(): string
|
|
5
|
-
export function generatePermissionId(): string
|
|
6
|
-
export function generateCorrelationId(): string
|
|
7
|
-
export function generateVerificationId(): string
|
|
8
|
-
export function generateRolePermissionsId(): string
|
|
9
|
-
export function generateOnboardingId(): string
|
|
10
|
-
export function generateSessionId(): string
|
|
11
|
-
export function generateFileId(): string
|
|
12
|
-
export function generateEventId(): string
|
|
13
|
-
export function generateJobId(): string
|
|
14
|
-
export function generateTaskId(): string
|
|
15
|
-
export function generateQueueId(): string
|
|
16
|
-
export function generateMessageId(): string
|
|
17
|
-
export function generateNotificationId(): string
|
|
18
|
-
export function generateLogId(): string
|
|
19
|
-
export function generateAuditId(): string
|
|
20
|
-
export function generateConfigId(): string
|
|
21
|
-
export function generateKeyId(): string
|
|
22
|
-
export function generateMetricId(): string
|
|
23
|
-
export function generateTagId(): string
|
|
24
|
-
export function generatePolicyId(): string
|
|
25
|
-
export function generateProfileId(): string
|
|
26
|
-
export function generateDeviceId(): string
|
|
27
|
-
export function generateAlertId(): string
|
|
28
|
-
export function generateResourceId(): string
|
|
1
|
+
export function generateId(): string
|
|
2
|
+
export function generatePrefixedId(prefix: string): string
|
|
3
|
+
export function generateUserId(): string
|
|
4
|
+
export function generateTenantId(): string
|
|
5
|
+
export function generatePermissionId(): string
|
|
6
|
+
export function generateCorrelationId(): string
|
|
7
|
+
export function generateVerificationId(): string
|
|
8
|
+
export function generateRolePermissionsId(): string
|
|
9
|
+
export function generateOnboardingId(): string
|
|
10
|
+
export function generateSessionId(): string
|
|
11
|
+
export function generateFileId(): string
|
|
12
|
+
export function generateEventId(): string
|
|
13
|
+
export function generateJobId(): string
|
|
14
|
+
export function generateTaskId(): string
|
|
15
|
+
export function generateQueueId(): string
|
|
16
|
+
export function generateMessageId(): string
|
|
17
|
+
export function generateNotificationId(): string
|
|
18
|
+
export function generateLogId(): string
|
|
19
|
+
export function generateAuditId(): string
|
|
20
|
+
export function generateConfigId(): string
|
|
21
|
+
export function generateKeyId(): string
|
|
22
|
+
export function generateMetricId(): string
|
|
23
|
+
export function generateTagId(): string
|
|
24
|
+
export function generatePolicyId(): string
|
|
25
|
+
export function generateProfileId(): string
|
|
26
|
+
export function generateDeviceId(): string
|
|
27
|
+
export function generateAlertId(): string
|
|
28
|
+
export function generateResourceId(): string
|
package/types/ids/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from './prefixes.js'
|
|
2
|
+
export * from './generators.js'
|
package/types/ids/prefixes.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* These prefixes are prepended to ULIDs to create consistent and identifiable IDs across the system.
|
|
5
5
|
* For example: 'usr_01HZY3M7K4FJ9A8Q4Y1ZB5NX3T'
|
|
6
6
|
*/
|
|
7
|
-
export type ID_PREFIXES = string
|
|
7
|
+
export type ID_PREFIXES = string
|
|
8
8
|
/**
|
|
9
9
|
* Mapping of entity types to their unique ID prefixes.
|
|
10
10
|
*
|
|
@@ -15,56 +15,56 @@ export type ID_PREFIXES = string;
|
|
|
15
15
|
* @enum {string}
|
|
16
16
|
*/
|
|
17
17
|
export const ID_PREFIXES: Readonly<{
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
18
|
+
/** User entity ID prefix */
|
|
19
|
+
USER: 'usr'
|
|
20
|
+
/** Tenant entity ID prefix */
|
|
21
|
+
TENANT: 'tnt'
|
|
22
|
+
/** Permission entity ID prefix */
|
|
23
|
+
PERMISSION: 'prm'
|
|
24
|
+
/** Correlation ID prefix (e.g., for tracing requests) */
|
|
25
|
+
CORRELATION: 'crln'
|
|
26
|
+
/** Verification entity ID prefix (e.g., email/phone code) */
|
|
27
|
+
VERIFICATION: 'vrf'
|
|
28
|
+
/** Role-permissions mapping ID prefix */
|
|
29
|
+
ROLE_PERMISSIONS: 'role'
|
|
30
|
+
/** Onboarding mapping ID prefix */
|
|
31
|
+
ONBOARDING: 'onb'
|
|
32
|
+
/** Session mapping ID prefix */
|
|
33
|
+
SESSION: 'sess'
|
|
34
|
+
/** File mapping ID prefix */
|
|
35
|
+
FILE: 'fil'
|
|
36
|
+
/** Event entity ID prefix */
|
|
37
|
+
EVENT: 'evt'
|
|
38
|
+
/** Job entity ID prefix */
|
|
39
|
+
JOB: 'job'
|
|
40
|
+
/** Task entity ID prefix */
|
|
41
|
+
TASK: 'task'
|
|
42
|
+
/** Queue entity ID prefix */
|
|
43
|
+
QUEUE: 'que'
|
|
44
|
+
/** Message entity ID prefix */
|
|
45
|
+
MESSAGE: 'msg'
|
|
46
|
+
/** Notification entity ID prefix */
|
|
47
|
+
NOTIFICATION: 'ntf'
|
|
48
|
+
/** Log entity ID prefix */
|
|
49
|
+
LOG: 'log'
|
|
50
|
+
/** Audit entity ID prefix */
|
|
51
|
+
AUDIT: 'adt'
|
|
52
|
+
/** Config entity ID prefix */
|
|
53
|
+
CONFIG: 'cfg'
|
|
54
|
+
/** Key entity ID prefix */
|
|
55
|
+
KEY: 'key'
|
|
56
|
+
/** Metric entity ID prefix */
|
|
57
|
+
METRIC: 'met'
|
|
58
|
+
/** Tag entity ID prefix */
|
|
59
|
+
TAG: 'tag'
|
|
60
|
+
/** Policy entity ID prefix */
|
|
61
|
+
POLICY: 'plc'
|
|
62
|
+
/** Profile entity ID prefix */
|
|
63
|
+
PROFILE: 'prf'
|
|
64
|
+
/** Device entity ID prefix */
|
|
65
|
+
DEVICE: 'dev'
|
|
66
|
+
/** Alert entity ID prefix */
|
|
67
|
+
ALERT: 'alr'
|
|
68
|
+
/** Resource entity ID prefix */
|
|
69
|
+
RESOURCE: 'res'
|
|
70
|
+
}>
|